npm package diff
Package: @forge/cli
Versions: 11.3.1 - 11.4.0-next.1-experimental-01f8230
File: package/out/installations/graphql-client.js
Index: package/out/installations/graphql-client.js
===================================================================
--- package/out/installations/graphql-client.js
+++ package/out/installations/graphql-client.js
@@ -148,8 +148,65 @@
throw new MissingTaskIdError(error.message);
}
await this.monitorAppInstallOrUpgrade(taskId);
}
+ async getEntitlementOffering(site, product) {
+ try {
+ const productKeys = this.getHamsProductKeys(product);
+ const results = await Promise.allSettled(productKeys.map((productKey) => this.graphqlClient.query(`query getEntitlementOffering($hostNames: [String!], $product: String!) {
+ tenantContexts(hostNames: $hostNames) {
+ cloudUrl
+ entitlementInfo(hamsProductKey: $product) {
+ entitlement {
+ ... on HamsEntitlement {
+ id
+ name
+ currentEdition
+ }
+ ... on CcpEntitlement {
+ id
+ offering {
+ name
+ }
+ }
+ }
+ }
+ }
+ }`, {
+ hostNames: [site.hostname],
+ product: productKey
+ })));
+ for (const result of results) {
+ if (result.status === 'fulfilled') {
+ const data = result.value;
+ return data.tenantContexts?.[0]?.entitlementInfo?.entitlement;
+ }
+ }
+ return undefined;
+ }
+ catch (error) {
+ return undefined;
+ }
+ }
+ getHamsProductKeys(product) {
+ switch (product) {
+ case 'Jira':
+ return [
+ 'jira-software.ondemand',
+ 'jira-core.ondemand',
+ 'jira-servicedesk.ondemand',
+ 'jira-product-discovery.ondemand'
+ ];
+ case 'Confluence':
+ return ['confluence.ondemand'];
+ case 'Compass':
+ return ['compass'];
+ case 'Atlas':
+ return ['townsquare'];
+ default:
+ throw new Error('Unsupported product');
+ }
+ }
async upgradeInstallation({ site, product, environmentKey, appId }) {
const workspaceAri = await this.buildInstallationContext(product, site);
const query = `
mutation forge_cli_upgradeApplication($input: AppInstallationUpgradeInput!) {
@@ -496,4 +553,5 @@
};
}
}
exports.InstallationsGraphqlClient = InstallationsGraphqlClient;
+//# sourceMappingURL=graphql-client.js.map
\ No newline at end of file