@forge/cli-shared 9.7.0-next.8 → 9.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/CHANGELOG.md +155 -0
  2. package/out/app-logs/graphql-client.d.ts.map +1 -1
  3. package/out/app-logs/graphql-client.js +29 -27
  4. package/out/apps/create-an-app.d.ts +3 -3
  5. package/out/apps/create-an-app.d.ts.map +1 -1
  6. package/out/apps/create-an-app.js +2 -2
  7. package/out/apps/create-app-graphql-client.d.ts.map +1 -1
  8. package/out/apps/create-app-graphql-client.js +4 -3
  9. package/out/apps/get-app-owner.d.ts +17 -2
  10. package/out/apps/get-app-owner.d.ts.map +1 -1
  11. package/out/apps/get-app-owner.js +12 -12
  12. package/out/apps/register-app.d.ts +5 -2
  13. package/out/apps/register-app.d.ts.map +1 -1
  14. package/out/apps/register-app.js +2 -8
  15. package/out/ari/ari.d.ts +5 -0
  16. package/out/ari/ari.d.ts.map +1 -1
  17. package/out/ari/ari.js +13 -1
  18. package/out/auth/personal/me-graphql-client.d.ts.map +1 -1
  19. package/out/auth/personal/me-graphql-client.js +4 -2
  20. package/out/graphql/app-environment-graphql-client.d.ts.map +1 -1
  21. package/out/graphql/app-environment-graphql-client.js +6 -5
  22. package/out/graphql/app-oauth-client-id-graphql-client.d.ts.map +1 -1
  23. package/out/graphql/app-oauth-client-id-graphql-client.js +3 -2
  24. package/out/graphql/get-mutation-error.d.ts +11 -2
  25. package/out/graphql/get-mutation-error.d.ts.map +1 -1
  26. package/out/graphql/get-mutation-error.js +8 -0
  27. package/out/graphql/gql/gql.d.ts +78 -0
  28. package/out/graphql/gql/gql.d.ts.map +1 -0
  29. package/out/graphql/gql/gql.js +87 -0
  30. package/out/graphql/gql/graphql.d.ts +47747 -0
  31. package/out/graphql/gql/graphql.d.ts.map +1 -0
  32. package/out/graphql/gql/graphql.js +1460 -0
  33. package/out/graphql/gql/index.d.ts +2 -0
  34. package/out/graphql/gql/index.d.ts.map +1 -0
  35. package/out/graphql/gql/index.js +4 -0
  36. package/out/graphql/graphql-client.d.ts +5 -8
  37. package/out/graphql/graphql-client.d.ts.map +1 -1
  38. package/out/graphql/graphql-domain-types.d.ts +111 -0
  39. package/out/graphql/graphql-domain-types.d.ts.map +1 -0
  40. package/out/graphql/graphql-domain-types.js +2 -0
  41. package/out/graphql/graphql-runtime-enums.d.ts +88 -0
  42. package/out/graphql/graphql-runtime-enums.d.ts.map +1 -0
  43. package/out/graphql/graphql-runtime-enums.js +77 -0
  44. package/out/graphql/index.d.ts +3 -1
  45. package/out/graphql/index.d.ts.map +1 -1
  46. package/out/graphql/index.js +5 -1
  47. package/out/graphql/mutation-aware-graphql-client.d.ts +4 -9
  48. package/out/graphql/mutation-aware-graphql-client.d.ts.map +1 -1
  49. package/out/graphql/mutation-aware-graphql-client.js +6 -10
  50. package/out/service/statsig-service.d.ts +1 -2
  51. package/out/service/statsig-service.d.ts.map +1 -1
  52. package/out/service/statsig-service.js +0 -3
  53. package/out/shared/environment.d.ts +1 -1
  54. package/out/shared/environment.d.ts.map +1 -1
  55. package/out/shared/environment.js +4 -4
  56. package/out/shared/test.d.ts.map +1 -1
  57. package/out/shared/test.js +2 -1
  58. package/out/ui/command-line-ui.d.ts +1 -0
  59. package/out/ui/command-line-ui.d.ts.map +1 -1
  60. package/out/ui/command-line-ui.js +22 -0
  61. package/out/ui/text.d.ts +64 -8
  62. package/out/ui/text.d.ts.map +1 -1
  63. package/out/ui/text.js +58 -9
  64. package/out/ui/ui.d.ts +1 -0
  65. package/out/ui/ui.d.ts.map +1 -1
  66. package/package.json +7 -5
  67. package/out/graphql/graphql-types.d.ts +0 -261260
  68. package/out/graphql/graphql-types.d.ts.map +0 -1
  69. package/out/graphql/graphql-types.js +0 -21639
package/CHANGELOG.md CHANGED
@@ -1,5 +1,160 @@
1
1
  # @forge/cli-shared
2
2
 
3
+ ## 9.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - c2f6468: Removed the "Global (EAP)" product option from `forge create`. Global templates are now listed under the Jira, Confluence, and Multiple products, and set `app.compatibility` to match the selected product. The global product in `forge module add` is now labelled "Global".
8
+ - 82730f2: Added container services to version details tables, interactive property selection, version summaries, and comparison tables.
9
+ - 9f27f8a: Update uninstall flow to improve user experience and support global apps
10
+ - cf81630: Wire up global apps installer into existing flow for EAP
11
+ - a384019: Add identity client for listing orgs and units
12
+ - e7dc317: Warn when Teamwork Graph API usage is detected without graph scopes in the manifest, with guidance to review scope documentation. The warning does not block builds or automatically add scopes.
13
+ - 9d391ab: `forge show services` and `forge show containers` now read every placement the app is deployed to, by paginating the `appContainerServices` query instead of reading only the first placement. Both commands report which placement each service and container runs in, so a service deployed to more than one placement is no longer collapsed into a single row.
14
+ - 988dff5: Replace the `--shard` option on the `forge show` commands with `--placement`, which takes a bare placement ID such as `ic-dr6` or `us-east-1`. The `appContainerServices` query now filters on `PLACEMENT` using a fully qualified `EcosystemAppPlacementAri`, with the placement type derived from the ID.
15
+ - 4740d03: Add new controller and ui to support global install flow EAP
16
+
17
+ ### Patch Changes
18
+
19
+ - 2a491b9: Increase the timeout for deployment artifact and hosted resource uploads from 30s to 5 minutes.
20
+ - fb0dbe8: Global app installs no longer mark connections as linked, so you can connect the same Atlassian app or platform tool more than once (for example, multiple Jira sites).
21
+ - b090628: Add new empty spinner for long loading
22
+ - 385ac1a: Adding new UI text to support global apps EAP
23
+ - c0b2b2a: Support global apps install for app-id-override flag
24
+ - 56fd47c: Bumping dependencies via Renovate:
25
+
26
+ - @graphql-tools/schema
27
+
28
+ - 93f4631: Improved artifact too large error messages to include limits
29
+ - b77e195: Improved rendering performance for multiline tables, including `forge version compare`.
30
+ - 78af9a2: Always bundle the Node runtime loader, removing the forge-cli-bundle-runtime-loader feature gate
31
+ - 797ac88: Add tests for manual packaging
32
+ - ea3b2ba: Implement error message for deployment failure due to exceededing file size for skill directory
33
+ - 3e160b1: Generate GraphQL types from CLI `graphql()` documents with `@graphql-codegen/client-preset` and `onlyOperationTypes`. Stop star-exporting the 27MB gateway dump from `@forge/cli-shared`.
34
+ - 608da16: Align GraphQL dependency ranges with the workspace root to fix dependency linking.
35
+ - Updated dependencies [dc2caec]
36
+ - Updated dependencies [e7dc317]
37
+ - Updated dependencies [5932866]
38
+ - Updated dependencies [2d36913]
39
+ - Updated dependencies [537590c]
40
+ - Updated dependencies [ce74751]
41
+ - @forge/manifest@13.6.0
42
+
43
+ ## 9.7.0-next.25
44
+
45
+ ### Patch Changes
46
+
47
+ - Updated dependencies [537590c]
48
+ - @forge/manifest@13.6.0-next.5
49
+
50
+ ## 9.7.0-next.24
51
+
52
+ ### Minor Changes
53
+
54
+ - c2f6468: Removed the "Global (EAP)" product option from `forge create`. Global templates are now listed under the Jira, Confluence, and Multiple products, and set `app.compatibility` to match the selected product. The global product in `forge module add` is now labelled "Global".
55
+
56
+ ## 9.7.0-next.23
57
+
58
+ ### Patch Changes
59
+
60
+ - 3e160b1: Generate GraphQL types from CLI `graphql()` documents with `@graphql-codegen/client-preset` and `onlyOperationTypes`. Stop star-exporting the 27MB gateway dump from `@forge/cli-shared`.
61
+
62
+ ## 9.7.0-next.22
63
+
64
+ ### Patch Changes
65
+
66
+ - Updated dependencies [5932866]
67
+ - @forge/manifest@13.6.0-next.4
68
+
69
+ ## 9.7.0-next.21
70
+
71
+ ### Minor Changes
72
+
73
+ - e7dc317: Warn when Teamwork Graph API usage is detected without graph scopes in the manifest, with guidance to review scope documentation. The warning does not block builds or automatically add scopes.
74
+
75
+ ### Patch Changes
76
+
77
+ - Updated dependencies [e7dc317]
78
+ - @forge/manifest@13.6.0-next.3
79
+
80
+ ## 9.7.0-next.20
81
+
82
+ ### Patch Changes
83
+
84
+ - fb0dbe8: Global app installs no longer mark connections as linked, so you can connect the same Atlassian app or platform tool more than once (for example, multiple Jira sites).
85
+
86
+ ## 9.7.0-next.19
87
+
88
+ ### Patch Changes
89
+
90
+ - 608da16: Align GraphQL dependency ranges with the workspace root to fix dependency linking.
91
+
92
+ ## 9.7.0-next.18
93
+
94
+ ### Minor Changes
95
+
96
+ - cf81630: Wire up global apps installer into existing flow for EAP
97
+
98
+ ### Patch Changes
99
+
100
+ - c0b2b2a: Support global apps install for app-id-override flag
101
+
102
+ ## 9.7.0-next.17
103
+
104
+ ### Patch Changes
105
+
106
+ - 797ac88: Add tests for manual packaging
107
+
108
+ ## 9.7.0-next.16
109
+
110
+ ### Patch Changes
111
+
112
+ - 78af9a2: Always bundle the Node runtime loader, removing the forge-cli-bundle-runtime-loader feature gate
113
+
114
+ ## 9.7.0-next.15
115
+
116
+ ### Patch Changes
117
+
118
+ - Updated dependencies [2d36913]
119
+ - @forge/manifest@13.6.0-next.2
120
+
121
+ ## 9.7.0-next.14
122
+
123
+ ### Minor Changes
124
+
125
+ - 4740d03: Add new controller and ui to support global install flow EAP
126
+
127
+ ## 9.7.0-next.13
128
+
129
+ ### Patch Changes
130
+
131
+ - Updated dependencies [ce74751]
132
+ - @forge/manifest@13.5.1-next.1
133
+
134
+ ## 9.7.0-next.12
135
+
136
+ ### Minor Changes
137
+
138
+ - a384019: Add identity client for listing orgs and units
139
+
140
+ ## 9.7.0-next.11
141
+
142
+ ### Patch Changes
143
+
144
+ - b090628: Add new empty spinner for long loading
145
+
146
+ ## 9.7.0-next.10
147
+
148
+ ### Patch Changes
149
+
150
+ - 385ac1a: Adding new UI text to support global apps EAP
151
+
152
+ ## 9.7.0-next.9
153
+
154
+ ### Minor Changes
155
+
156
+ - 988dff5: Replace the `--shard` option on the `forge show` commands with `--placement`, which takes a bare placement ID such as `ic-dr6` or `us-east-1`. The `appContainerServices` query now filters on `PLACEMENT` using a fully qualified `EcosystemAppPlacementAri`, with the placement type derived from the ID.
157
+
3
158
  ## 9.7.0-next.8
4
159
 
5
160
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../src/app-logs/graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,aAAa,EACd,MAA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gBAAb,aAAa,EAAE,aAAa;IAE5C,kBAAkB,CAAC,OAAO,EAAE,wBAAwB;;;;;;;IAapD,aAAa,CACxB,OAAO,EAAE,gBAAgB,EACzB,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EACtC,sBAAsB,EAAE,UAAU,EAAE,EACpC,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,UAAU,EAAE,CAAC;IA4IX,WAAW,CAAC,OAAO,EAAE,cAAc;IA4EhD,OAAO,CAAC,qBAAqB;IAe7B,OAAO,CAAC,eAAe;YAcT,iBAAiB;CAkDhC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LogsGraphQLClient = exports.MissingMetadataError = exports.MissingInvocationError = exports.MissingAppLogLinesError = exports.MissingAppLogsError = void 0;
4
+ const graphql_1 = require("../graphql");
4
5
  const sanitizeLogLine = (line) => ({
5
6
  timestamp: line.timestamp,
6
7
  level: line.level || undefined,
@@ -50,14 +51,14 @@ class LogsGraphQLClient {
50
51
  };
51
52
  }
52
53
  async viewAppLogsV2(details, invocationMap, logLinesWithInvocation, totalRecieved) {
53
- const query = `
54
+ const query = (0, graphql_1.graphql)(`
54
55
  query forge_cli_getApplicationLogsV2(
55
- $appId: String!,
56
- $environmentId: String!,
57
- $dateSearchInput: DateSearchInput,
58
- $offset: Int!,
59
- $limit: Int!,
60
- $queryStartTime: String!,
56
+ $appId: String!
57
+ $environmentId: String!
58
+ $dateSearchInput: DateSearchInput
59
+ $offset: Int!
60
+ $limit: Int!
61
+ $queryStartTime: String!
61
62
  $runtime: String
62
63
  $functionKeys: [String]
63
64
  $containers: [String]
@@ -123,7 +124,7 @@ class LogsGraphQLClient {
123
124
  __typename
124
125
  }
125
126
  }
126
- `;
127
+ `);
127
128
  const result = await this.graphqlClient.query(query, details);
128
129
  if (!result || !result.appLogsWithMetaData || !result.appLogsWithMetaData.appLogs) {
129
130
  throw new MissingAppLogsError();
@@ -172,18 +173,19 @@ class LogsGraphQLClient {
172
173
  return details.grouped ? invocations : logLinesWithInvocation;
173
174
  }
174
175
  async viewAppLogs(details) {
175
- const query = `
176
- query forge_cli_getApplicationLogs($appId: ID!, $environmentId: [ID!]!, $limit: Int!, $contextAri: [ID!], $startTime: String) {
176
+ const query = (0, graphql_1.graphql)(`
177
+ query forge_cli_getApplicationLogs(
178
+ $appId: ID!
179
+ $environmentId: [ID!]!
180
+ $limit: Int!
181
+ $contextAri: [ID!]
182
+ $startTime: String
183
+ ) {
177
184
  appLogs(
178
- appId: $appId,
179
- environmentId: $environmentId,
180
- last: $limit,
181
- query: {
182
- installationContexts: $contextAri,
183
- dates: {
184
- earliestStart: $startTime
185
- }
186
- }
185
+ appId: $appId
186
+ environmentId: $environmentId
187
+ last: $limit
188
+ query: { installationContexts: $contextAri, dates: { earliestStart: $startTime } }
187
189
  ) {
188
190
  nodes {
189
191
  id
@@ -211,8 +213,11 @@ class LogsGraphQLClient {
211
213
  }
212
214
  }
213
215
  }
214
- `;
215
- const result = await this.graphqlClient.query(query, details);
216
+ `);
217
+ const result = await this.graphqlClient.query(query, {
218
+ ...details,
219
+ contextAri: details.contextAri?.map((ari) => String(ari))
220
+ });
216
221
  if (!result.appLogs || !result.appLogs.nodes) {
217
222
  throw new MissingAppLogsError();
218
223
  }
@@ -257,12 +262,9 @@ class LogsGraphQLClient {
257
262
  return { cursor, lines };
258
263
  }
259
264
  async getInvocationLogs(filter) {
260
- const query = `
265
+ const query = (0, graphql_1.graphql)(`
261
266
  query forge_cli_getInvocationLogs($invocationId: ID!, $after: String) {
262
- appLogLines(
263
- after: $after,
264
- invocation: $invocationId
265
- ) {
267
+ appLogLines(after: $after, invocation: $invocationId) {
266
268
  metadata {
267
269
  id
268
270
  function {
@@ -287,7 +289,7 @@ class LogsGraphQLClient {
287
289
  }
288
290
  }
289
291
  }
290
- `;
292
+ `);
291
293
  const result = await this.graphqlClient.query(query, filter);
292
294
  if (!result.appLogLines) {
293
295
  throw new MissingAppLogLinesError();
@@ -1,11 +1,11 @@
1
1
  import { StatsigService } from '../service';
2
2
  import { PackageInstaller } from './package-installer';
3
- import { CreateAppClientInput, RegisterAppCommand, RegisterAppResult } from './register-app';
3
+ import { AppCompatibility, CreateAppClientInput, RegisterAppCommand, RegisterAppResult } from './register-app';
4
4
  import { Templater } from './template';
5
5
  export interface CreateAppCommandInput extends CreateAppClientInput {
6
6
  template: string;
7
7
  directory: string;
8
- requiredProduct?: string;
8
+ compatibility?: AppCompatibility;
9
9
  }
10
10
  export declare class NoTemplatesError extends Error {
11
11
  constructor();
@@ -21,7 +21,7 @@ export declare class CreateAppCommand {
21
21
  private readonly packageInstaller;
22
22
  private readonly statsig;
23
23
  constructor(templater: Templater, registerAppCommand: RegisterAppCommand, packageInstaller: PackageInstaller, statsig: StatsigService);
24
- execute({ name, description, template, directory, requiredProduct, developerSpaceId, billingConsent, appFeatures }: CreateAppCommandInput): Promise<CreateAppCommandResult>;
24
+ execute({ name, description, template, directory, compatibility, developerSpaceId, billingConsent, appFeatures }: CreateAppCommandInput): Promise<CreateAppCommandResult>;
25
25
  getAvailableTemplates(): Promise<string[]>;
26
26
  filterAvailableProducts<T extends string>(products: T[], teamworkGraph: T, crossContext: T): Promise<T[]>;
27
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"create-an-app.d.ts","sourceRoot":"","sources":["../../src/apps/create-an-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC7F,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,MAAM,WAAW,qBAAsB,SAAQ,oBAAoB;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB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IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,gBAAgB,CAAC;CAClC;AAED,qBAAa,gBAAiB,SAAQ,KAAK;;CAI1C;AAED,MAAM,MAAM,sBAAsB,GAAG,iBAAiB,GAAG;IACvD,SAAS,EAAE;QACT,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAHP,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,kBAAkB,EACtC,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,EAAE,cAAc;IAG7B,OAAO,CAAC,EACnB,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,WAAW,EACZ,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAuB7C,qBAAqB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAS1C,uBAAuB,CAAC,CAAC,SAAS,MAAM,EACnD,QAAQ,EAAE,CAAC,EAAE,EACb,aAAa,EAAE,CAAC,EAChB,YAAY,EAAE,CAAC,GACd,OAAO,CAAC,CAAC,EAAE,CAAC;CAchB"}
@@ -19,7 +19,7 @@ class CreateAppCommand {
19
19
  this.packageInstaller = packageInstaller;
20
20
  this.statsig = statsig;
21
21
  }
22
- async execute({ name, description, template, directory, requiredProduct, developerSpaceId, billingConsent, appFeatures }) {
22
+ async execute({ name, description, template, directory, compatibility, developerSpaceId, billingConsent, appFeatures }) {
23
23
  await this.templater.downloadAndExtract(template, directory);
24
24
  const result = await this.registerAppCommand.registerApp({
25
25
  name,
@@ -29,7 +29,7 @@ class CreateAppCommand {
29
29
  ...(appFeatures && { appFeatures })
30
30
  }, directory, {
31
31
  shouldPrependAppName: true,
32
- requiredProduct
32
+ compatibility
33
33
  });
34
34
  await this.packageInstaller.install(directory);
35
35
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"create-app-graphql-client.d.ts","sourceRoot":"","sources":["../../src/apps/create-app-graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,aAAa,EAA+C,MAAM,YAAY,CAAC;AAGlG,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAExF,qBAAa,oBAAqB,SAAQ,KAAK;CAAG;AAElD,qBAAa,sBAAuB,YAAW,eAAe;IAChD,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAE5C,SAAS,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC;CA8C9E"}
1
+ {"version":3,"file":"create-app-graphql-client.d.ts","sourceRoot":"","sources":["../../src/apps/create-app-graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,aAAa,EAAyD,MAAM,YAAY,CAAC;AAG5G,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAExF,qBAAa,oBAAqB,SAAQ,KAAK;CAAG;AAElD,qBAAa,sBAAuB,YAAW,eAAe;IAChD,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAE5C,SAAS,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC;CA0C9E"}
@@ -12,7 +12,7 @@ class CreateAppGraphQLClient {
12
12
  this.graphqlClient = graphqlClient;
13
13
  }
14
14
  async createApp(input) {
15
- const createAppQuery = `
15
+ const createAppQuery = (0, graphql_1.graphql)(`
16
16
  mutation forge_cli_createApplication($input: CreateAppInput!) {
17
17
  createApp(input: $input) {
18
18
  success
@@ -31,10 +31,11 @@ class CreateAppGraphQLClient {
31
31
  }
32
32
  }
33
33
  }
34
- `;
35
- const { response: { createApp: { success, errors, app } }, requestId } = await this.graphqlClient.mutate(createAppQuery, {
34
+ `);
35
+ const { response, requestId } = await this.graphqlClient.mutate(createAppQuery, {
36
36
  input
37
37
  });
38
+ const { success, errors, app } = (0, graphql_1.requireMutationPayload)(response.createApp, requestId);
38
39
  const error = (0, graphql_1.getError)(errors);
39
40
  if (!success) {
40
41
  throw new graphql_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, {
@@ -1,13 +1,28 @@
1
- import { GraphQLClient, User } from '../graphql';
1
+ import { GraphQLClient } from '../graphql';
2
2
  import { AppConfigProvider } from './app-config';
3
3
  export declare class MissingAppOwnerError extends Error {
4
4
  constructor();
5
5
  }
6
+ export declare const GET_APP_OWNER: import("../graphql/gql/graphql").TypedDocumentString<import("../graphql/gql/graphql").Forge_Cli_GetAppOwnerQuery, import("../graphql/gql/graphql").Exact<{
7
+ id: import("../graphql/gql/graphql").Scalars["ID"]["input"];
8
+ }>>;
6
9
  export declare class GetAppOwnerQuery {
7
10
  private readonly graphqlClient;
8
11
  private readonly getAppConfig;
9
12
  constructor(graphqlClient: GraphQLClient, getAppConfig: AppConfigProvider);
10
- execute(): Promise<User>;
13
+ execute(): Promise<{
14
+ __typename?: "AppUser";
15
+ name: string;
16
+ accountId: string;
17
+ } | {
18
+ __typename?: "AtlassianAccountUser";
19
+ name: string;
20
+ accountId: string;
21
+ } | {
22
+ __typename?: "CustomerUser";
23
+ name: string;
24
+ accountId: string;
25
+ }>;
11
26
  private getAppOwner;
12
27
  }
13
28
  //# sourceMappingURL=get-app-owner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-app-owner.d.ts","sourceRoot":"","sources":["../../src/apps/get-app-owner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAiC,IAAI,EAAE,MAAM,YAAY,CAAC;AAEhF,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,qBAAa,oBAAqB,SAAQ,KAAK;;CAI9C;AAED,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,iBAAiB;IAGrC,OAAO;YAMN,WAAW;CA0B1B"}
1
+ {"version":3,"file":"get-app-owner.d.ts","sourceRoot":"","sources":["../../src/apps/get-app-owner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA4B,MAAM,YAAY,CAAC;AAErE,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,qBAAa,oBAAqB,SAAQ,KAAK;;CAI9C;AAED,eAAO,MAAM,aAAa;QAuCsittG,8CAAc;GA9B5kttG,CAAC;AAEH,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,iBAAiB;IAGrC,OAAO;;;;;;;;;;;;;YAMN,WAAW;CAe1B"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GetAppOwnerQuery = exports.MissingAppOwnerError = void 0;
3
+ exports.GetAppOwnerQuery = exports.GET_APP_OWNER = exports.MissingAppOwnerError = void 0;
4
4
  const graphql_1 = require("../graphql");
5
5
  const ui_1 = require("../ui");
6
6
  class MissingAppOwnerError extends Error {
@@ -9,6 +9,16 @@ class MissingAppOwnerError extends Error {
9
9
  }
10
10
  }
11
11
  exports.MissingAppOwnerError = MissingAppOwnerError;
12
+ exports.GET_APP_OWNER = (0, graphql_1.graphql)(`
13
+ query forge_cli_getAppOwner($id: ID!) {
14
+ app(id: $id) {
15
+ createdBy {
16
+ name
17
+ accountId
18
+ }
19
+ }
20
+ }
21
+ `);
12
22
  class GetAppOwnerQuery {
13
23
  graphqlClient;
14
24
  getAppConfig;
@@ -21,17 +31,7 @@ class GetAppOwnerQuery {
21
31
  return this.getAppOwner(appId);
22
32
  }
23
33
  async getAppOwner(appId) {
24
- const query = `
25
- query forge_cli_getAppOwner($id: ID!) {
26
- app(id: $id) {
27
- createdBy {
28
- name
29
- accountId
30
- }
31
- }
32
- }
33
- `;
34
- const { app } = await this.graphqlClient.query(query, {
34
+ const { app } = await this.graphqlClient.query(exports.GET_APP_OWNER, {
35
35
  id: appId
36
36
  });
37
37
  if (!app) {
@@ -2,6 +2,9 @@ import { ConfigFile, ConfigSectionReader, ConfigSectionWriter, NO_VALIDATION_TYP
2
2
  import { CreateAppInput } from '../graphql';
3
3
  import { Logger } from '../ui';
4
4
  import { AppDetails } from './app-config';
5
+ export type AppCompatibility = Record<string, {
6
+ required: boolean;
7
+ }>;
5
8
  export interface CreateAppClientInput {
6
9
  name: string;
7
10
  description?: string;
@@ -35,9 +38,9 @@ export declare class RegisterAppCommand {
35
38
  execute(input: CreateAppClientInput, { shouldPrependAppName }?: {
36
39
  shouldPrependAppName?: boolean | undefined;
37
40
  }): Promise<RegisterAppResult>;
38
- registerApp(input: CreateAppClientInput, directory: string, { shouldPrependAppName, requiredProduct }: {
41
+ registerApp(input: CreateAppClientInput, directory: string, { shouldPrependAppName, compatibility }: {
39
42
  shouldPrependAppName: boolean;
40
- requiredProduct?: string;
43
+ compatibility?: AppCompatibility;
41
44
  }): Promise<CreateAppResult>;
42
45
  }
43
46
  //# sourceMappingURL=register-app.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"register-app.d.ts","sourceRoot":"","sources":["../../src/apps/register-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,mBAAmB,EAAqB,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAExH,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAQ,MAAM,O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AO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAJV,SAAS,EAAE,eAAe,EAC1B,eAAe,EAAE,mBAAmB,CAAC,kBAAkB,CAAC,EACxD,eAAe,EAAE,mBAAmB,CAAC,UAAU,CAAC,EAChD,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU;IAG5B,OAAO,CAAC,KAAK,EAAE,oBAAoB,EAAE,EAAE,oBAA4B,EAAE;;KAAK,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAQvG,WAAW,CACtB,KAAK,EAAE,oBAAoB,EAC3B,SAAS,EAAE,MAAM,EACjB,EACE,oBAAoB,EACpB,aAAa,EACd,EAAE;QACD,oBAAoB,EAAE,OAAO,CAAC;QAC9B,aAAa,CAAC,EAAE,gBAAgB,CAAC;KAClC,GACA,OAAO,CAAC,eAAe,CAAC;CAiC5B"}
@@ -24,7 +24,7 @@ class RegisterAppCommand {
24
24
  environments: result.environments.map((env) => env.key)
25
25
  };
26
26
  }
27
- async registerApp(input, directory, { shouldPrependAppName, requiredProduct }) {
27
+ async registerApp(input, directory, { shouldPrependAppName, compatibility }) {
28
28
  this.logger.info(ui_1.Text.create.taskRegister);
29
29
  const result = await this.appClient.createApp(input);
30
30
  await (0, file_system_1.inDirectory)(directory, async () => {
@@ -38,13 +38,7 @@ class RegisterAppCommand {
38
38
  const section = await this.appConfigReader.readConfigSection();
39
39
  let newAppDetails = {
40
40
  id: result.id,
41
- ...(requiredProduct && {
42
- compatibility: {
43
- [requiredProduct]: {
44
- required: true
45
- }
46
- }
47
- })
41
+ ...(compatibility && { compatibility })
48
42
  };
49
43
  if (section !== 'invalid' && section !== 'missing') {
50
44
  newAppDetails = {
package/out/ari/ari.d.ts CHANGED
@@ -6,7 +6,12 @@ export declare const INSTALLATION_RESOURCE_TYPE = "installation";
6
6
  export declare const UNIT_RESOURCE_TYPE = "unit";
7
7
  export declare const TRELLO_RESOURCE_OWNER = "trello";
8
8
  export declare const BITBUCKET_RESOURCE_OWNER = "bitbucket";
9
+ export declare const APP_PLACEMENT_RESOURCE_TYPE = "app-placement";
10
+ export declare const ISOLATION_CONTEXT_PLACEMENT_TYPE = "isolation-context";
11
+ export declare const REGION_PLACEMENT_TYPE = "region";
9
12
  export declare function appIdToAriString(appId: string): string;
13
+ export declare function placementIdToPlacementType(placementId: string): string;
14
+ export declare function placementIdToAriString(placementId: string): string;
10
15
  export declare function buildContextAri(cloudId: string, product: string): Ari;
11
16
  export declare function buildExtensionAri(appId: string, environmentId: string, functionKey: string): Ari;
12
17
  export declare function encodeContext(context: Ari, extension: Ari): string;
@@ -1 +1 @@
1
- {"version":3,"file":"ari.d.ts","sourceRoot":"","sources":["../../src/ari/ari.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,GAAG,EACH,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,0BAA0B,CAAC;AAIlC,eAAO,MAAM,kBAAkB,SAAS,CAAC;AACzC,eAAO,MAAM,uBAAuB,cAAc,CAAC;AACnD,eAAO,MAAM,4BAA4B,mBAAmB,CAAC;AAC7D,eAAO,MAAM,0BAA0B,iBAAiB,CAAC;AACzD,eAAO,MAAM,kBAAkB,SAAS,CAAC;AACzC,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAC9C,eAAO,MAAM,wBAAwB,cAAc,CAAC;AAEpD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEtD;AAID,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,GAAG,CAMrE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,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CAIlE;AAID,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,GAAG,CAMrE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,GAAG,CAMhG;AAGD,wBAAgB,aAAa,CAAC,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,GAAG,MAAM,CAKlE;AACD,qBAAa,iCAAkC,SAAQ,KAAK;;CAI3D;AACD,qBAAa,sCAAuC,SAAQ,KAAK;;CAIhE;AACD,qBAAa,yCAA0C,SAAQ,KAAK;;CAInE;AASD,wBAAgB,wBAAwB,CAAC,mBAAmB,EAAE,MAAM,GAAG,MAAM,CAmC5E;AAGD,eAAO,MAAM,2BAA2B;mBACvB,MAAM,gBAAgB,MAAM;yBACtB,MAAM,gBAAgB,MAAM;sBAC/B,MAAM,eAAe,MAAM;qBAC5B,MAAM,eAAe,MAAM;CAC7C,CAAC"}
package/out/ari/ari.js CHANGED
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createWorkspaceAriByProduct = exports.UnknownInstallationWithoutResourceIdError = exports.UnknownWorkspaceWithoutResourceIdError = exports.UnknownSiteWithoutResourceIdError = exports.BITBUCKET_RESOURCE_OWNER = exports.TRELLO_RESOURCE_OWNER = exports.UNIT_RESOURCE_TYPE = exports.INSTALLATION_RESOURCE_TYPE = exports.WORKSPACE_USER_RESOURCE_TYPE = exports.WORKSPACE_RESOURCE_TYPE = exports.SITE_RESOURCE_TYPE = void 0;
3
+ exports.createWorkspaceAriByProduct = exports.UnknownInstallationWithoutResourceIdError = exports.UnknownWorkspaceWithoutResourceIdError = exports.UnknownSiteWithoutResourceIdError = exports.REGION_PLACEMENT_TYPE = exports.ISOLATION_CONTEXT_PLACEMENT_TYPE = exports.APP_PLACEMENT_RESOURCE_TYPE = exports.BITBUCKET_RESOURCE_OWNER = exports.TRELLO_RESOURCE_OWNER = exports.UNIT_RESOURCE_TYPE = exports.INSTALLATION_RESOURCE_TYPE = exports.WORKSPACE_USER_RESOURCE_TYPE = exports.WORKSPACE_RESOURCE_TYPE = exports.SITE_RESOURCE_TYPE = void 0;
4
4
  exports.appIdToAriString = appIdToAriString;
5
+ exports.placementIdToPlacementType = placementIdToPlacementType;
6
+ exports.placementIdToAriString = placementIdToAriString;
5
7
  exports.buildContextAri = buildContextAri;
6
8
  exports.buildExtensionAri = buildExtensionAri;
7
9
  exports.encodeContext = encodeContext;
@@ -16,9 +18,19 @@ exports.INSTALLATION_RESOURCE_TYPE = 'installation';
16
18
  exports.UNIT_RESOURCE_TYPE = 'unit';
17
19
  exports.TRELLO_RESOURCE_OWNER = 'trello';
18
20
  exports.BITBUCKET_RESOURCE_OWNER = 'bitbucket';
21
+ exports.APP_PLACEMENT_RESOURCE_TYPE = 'app-placement';
22
+ exports.ISOLATION_CONTEXT_PLACEMENT_TYPE = 'isolation-context';
23
+ exports.REGION_PLACEMENT_TYPE = 'region';
24
+ const ISOLATION_CONTEXT_ID_PATTERN = /^ic-[a-z0-9]+$/;
19
25
  function appIdToAriString(appId) {
20
26
  return `ari:cloud:ecosystem::app/${appId}`;
21
27
  }
28
+ function placementIdToPlacementType(placementId) {
29
+ return ISOLATION_CONTEXT_ID_PATTERN.test(placementId) ? exports.ISOLATION_CONTEXT_PLACEMENT_TYPE : exports.REGION_PLACEMENT_TYPE;
30
+ }
31
+ function placementIdToAriString(placementId) {
32
+ return `ari:cloud:ecosystem::${exports.APP_PLACEMENT_RESOURCE_TYPE}/${placementIdToPlacementType(placementId)}/${placementId}`;
33
+ }
22
34
  function buildContextAri(cloudId, product) {
23
35
  return ari_1.AnyAri.create({
24
36
  resourceOwner: (0, shared_1.ariResourceOwner)(product),
@@ -1 +1 @@
1
- {"version":3,"file":"me-graphql-client.d.ts","sourceRoot":"","sources":["../../../src/auth/personal/me-graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAgB,MAAM,EAAE,MAAM,UAAU,CAAC;AAEhD,qBAAa,iBAAkB,SAAQ,SAAS;CAAG;AAEnD,qBAAa,eAAe;IAExB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,MAAM;IAGpB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAwBtC"}
1
+ {"version":3,"file":"me-graphql-client.d.ts","sourceRoot":"","sources":["../../../src/auth/personal/me-graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAW,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAgB,MAAM,EAAE,MAAM,UAAU,CAAC;AAEhD,qBAAa,iBAAkB,SAAQ,SAAS;CAAG;AAEnD,qBAAa,eAAe;IAExB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,MAAM;IAGpB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAyBtC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MeGraphqlClient = exports.UserNotFoundError = void 0;
4
+ const graphql_1 = require("../../graphql");
4
5
  const shared_1 = require("../../shared");
5
6
  const ui_1 = require("../../ui");
6
7
  class UserNotFoundError extends shared_1.UserError {
@@ -15,7 +16,7 @@ class MeGraphqlClient {
15
16
  }
16
17
  async getUser() {
17
18
  try {
18
- const query = `
19
+ const query = (0, graphql_1.graphql)(`
19
20
  query forge_cli_getUserDetails {
20
21
  me {
21
22
  user {
@@ -24,7 +25,8 @@ class MeGraphqlClient {
24
25
  accountId
25
26
  }
26
27
  }
27
- }`;
28
+ }
29
+ `);
28
30
  const result = await this.graphqlClient.query(query, {});
29
31
  if (result.me.user && result.me.user.accountStatus === 'active') {
30
32
  return result.me.user;
@@ -1 +1 @@
1
- {"version":3,"file":"app-environment-graphql-client.d.ts","sourceRoot":"","sources":["../../src/graphql/app-environment-graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,qBAAa,eAAgB,SAAQ,SAAS;;CAI7C;AAED,qBAAa,0BAA2B,SAAQ,SAAS;gBAC3C,MAAM,EAAE,MAAM;CAG3B;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,kBAAkB,CAAC;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAChF,wBAAwB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACrG;AAED,qBAAa,4BAA6B,YAAW,oBAAoB;IAC3D,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAE5C,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA2B3E,wBAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAiC9G"}
1
+ {"version":3,"file":"app-environment-graphql-client.d.ts","sourceRoot":"","sources":["../../src/graphql/app-environment-graphql-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,qBAAa,eAAgB,SAAQ,SAAS;;CAI7C;AAED,qBAAa,0BAA2B,SAAQ,SAAS;gBAC3C,MAAM,EAAE,MAAM;CAG3B;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,kBAAkB,CAAC;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAChF,wBAAwB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACrG;AAED,qBAAa,4BAA6B,YAAW,oBAAoB;IAC3D,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAE5C,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA2B3E,wBAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAiC9G"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AppEnvironmentsGraphqlClient = exports.MissingAppEnvironmentError = exports.MissingAppError = void 0;
4
+ const gql_1 = require("./gql/gql");
4
5
  const ui_1 = require("../ui");
5
6
  const error_handling_1 = require("../shared/error-handling");
6
7
  class MissingAppError extends error_handling_1.UserError {
@@ -21,7 +22,7 @@ class AppEnvironmentsGraphqlClient {
21
22
  this.graphqlClient = graphqlClient;
22
23
  }
23
24
  async getAppEnvironmentId(appId, environmentKey) {
24
- const query = `
25
+ const query = (0, gql_1.graphql)(`
25
26
  query forge_cli_getApplicationEnvironmentId($id: ID!, $key: String!) {
26
27
  app(id: $id) {
27
28
  environmentByKey(key: $key) {
@@ -29,7 +30,7 @@ class AppEnvironmentsGraphqlClient {
29
30
  }
30
31
  }
31
32
  }
32
- `;
33
+ `);
33
34
  const result = await this.graphqlClient.query(query, {
34
35
  id: appId,
35
36
  key: environmentKey
@@ -43,8 +44,8 @@ class AppEnvironmentsGraphqlClient {
43
44
  return result.app.environmentByKey.id;
44
45
  }
45
46
  async getAppEnvironmentDetails(appAri, environmentKey) {
46
- const query = `
47
- query forge_cli_getApplicationEnvironmentId($id: ID!, $key: String!) {
47
+ const query = (0, gql_1.graphql)(`
48
+ query forge_cli_getApplicationEnvironmentDetails($id: ID!, $key: String!) {
48
49
  app(id: $id) {
49
50
  name
50
51
  environmentByKey(key: $key) {
@@ -53,7 +54,7 @@ class AppEnvironmentsGraphqlClient {
53
54
  }
54
55
  }
55
56
  }
56
- `;
57
+ `);
57
58
  const result = await this.graphqlClient.query(query, {
58
59
  id: appAri,
59
60
  key: environmentKey
@@ -1 +1 @@
1
- {"version":3,"file":"app-oauth-client-id-graphql-client.d.ts","sourceRoot":"","sources":["../../src/graphql/app-oauth-client-id-graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAA+C,MAAM,SAAS,CAAC;AAEzG,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,kBAAkB,CAAC;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB;IACrC,0BAA0B,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACvG;AAED,qBAAa,2BAA4B,YAAW,sBAAsB;IAC5D,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAE5C,0BAA0B,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAsChH"}
1
+ {"version":3,"file":"app-oauth-client-id-graphql-client.d.ts","sourceRoot":"","sources":["../../src/graphql/app-oauth-client-id-graphql-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAA+C,MAAM,SAAS,CAAC;AAEzG,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,kBAAkB,CAAC;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB;IACrC,0BAA0B,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACvG;AAED,qBAAa,2BAA4B,YAAW,sBAAsB;IAC5D,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAE5C,0BAA0B,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAsChH"}