@forge/runtime 5.2.3-next.0 → 5.3.0-next.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @forge/runtime
2
2
 
3
+ ## 5.3.0-next.0
4
+
5
+ ### Minor Changes
6
+
7
+ - b3245a7: - Add environmentType, invocationId, installationId in runtime V2 context
8
+ - Rename getRuntime to \_\_getRuntime in @forge/api
9
+ - Add new method getAppContext in @forge/api to retrieve app context data
10
+ - Replace @atlassian/cs-ari package with @atlassian/ari
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [b3245a7]
15
+ - @forge/util@1.4.0-next.0
16
+
17
+ ## 5.2.3
18
+
19
+ ### Patch Changes
20
+
21
+ - b45f058: Bumping dependencies via Renovate:
22
+
23
+ - @types/jest
24
+
3
25
  ## 5.2.3-next.0
4
26
 
5
27
  ### Patch Changes
package/out/context.js CHANGED
@@ -1,14 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.setupRequestContext = exports.createLicenseContext = exports.createPrincipal = exports.isAccountIdDefined = exports.createInstallationContext = void 0;
4
- const tslib_1 = require("tslib");
5
- const ARI = tslib_1.__importStar(require("@forge/util/packages/cs-ari"));
4
+ const ari_1 = require("@forge/util/packages/ari");
6
5
  function wrapWithBrackets(value) {
7
6
  return value !== undefined ? `{${value}}` : undefined;
8
7
  }
9
8
  function createInstallationContext(cfg) {
10
9
  const { contextAri } = cfg.meta;
11
- const ari = ARI.parse(contextAri);
10
+ const ari = ari_1.AnyAri.parse(contextAri);
12
11
  if (ari.resourceType === 'project') {
13
12
  return { projectId: ari.resourceId, installContext: contextAri };
14
13
  }
package/out/request.d.ts CHANGED
@@ -13,8 +13,11 @@ declare const MetadataType: t.IntersectionC<[t.TypeC<{
13
13
  }>>;
14
14
  appContext: t.TypeC<{
15
15
  appId: t.StringC;
16
- environmentId: t.StringC;
17
16
  appVersion: t.StringC;
17
+ environmentId: t.StringC;
18
+ environmentType: t.StringC;
19
+ invocationId: t.StringC;
20
+ installationId: t.StringC;
18
21
  functionKey: t.StringC;
19
22
  moduleType: t.StringC;
20
23
  moduleKey: t.StringC;
@@ -64,8 +67,11 @@ export declare const ExternalRequestBodyType: t.IntersectionC<[t.TypeC<{
64
67
  }>>;
65
68
  appContext: t.TypeC<{
66
69
  appId: t.StringC;
67
- environmentId: t.StringC;
68
70
  appVersion: t.StringC;
71
+ environmentId: t.StringC;
72
+ environmentType: t.StringC;
73
+ invocationId: t.StringC;
74
+ installationId: t.StringC;
69
75
  functionKey: t.StringC;
70
76
  moduleType: t.StringC;
71
77
  moduleKey: t.StringC;
@@ -120,8 +126,11 @@ export declare const InvocationType: t.TypeC<{
120
126
  }>>;
121
127
  appContext: t.TypeC<{
122
128
  appId: t.StringC;
123
- environmentId: t.StringC;
124
129
  appVersion: t.StringC;
130
+ environmentId: t.StringC;
131
+ environmentType: t.StringC;
132
+ invocationId: t.StringC;
133
+ installationId: t.StringC;
125
134
  functionKey: t.StringC;
126
135
  moduleType: t.StringC;
127
136
  moduleKey: t.StringC;
@@ -1 +1 @@
1
- {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAG3B,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoDhB,CAAC;AAEH,QAAA,MAAM,YAAY;;;;EAIhB,CAAC;AAIH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IASlC,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOzB,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,YAAY,CAAC,CAAC;AAEpE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC;AACzD,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,YAAY,CAAC,CAAC;AACrD,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
1
+ {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAG3B,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAuDhB,CAAC;AAEH,QAAA,MAAM,YAAY;;;;EAIhB,CAAC;AAIH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IASlC,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOzB,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,YAAY,CAAC,CAAC;AAEpE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC;AACzD,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,YAAY,CAAC,CAAC;AACrD,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
package/out/request.js CHANGED
@@ -18,8 +18,11 @@ const MetadataType = t.intersection([
18
18
  })),
19
19
  appContext: t.type({
20
20
  appId: t.string,
21
- environmentId: t.string,
22
21
  appVersion: t.string,
22
+ environmentId: t.string,
23
+ environmentType: t.string,
24
+ invocationId: t.string,
25
+ installationId: t.string,
23
26
  functionKey: t.string,
24
27
  moduleType: t.string,
25
28
  moduleKey: t.string
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InvocationRequest = exports.xenInvocationRequestFactory = void 0;
4
- const tslib_1 = require("tslib");
5
4
  const app_manifest_1 = require("../app-manifest");
6
5
  const feature_flag_1 = require("../feature-flag");
7
- const ARI = tslib_1.__importStar(require("@forge/util/packages/cs-ari"));
6
+ const ari_1 = require("@forge/util/packages/ari");
8
7
  const __1 = require("..");
9
8
  class XenInvocationRequestImpl {
10
9
  constructor(request, invocationId) {
@@ -30,7 +29,7 @@ class XenInvocationRequestImpl {
30
29
  return this.request._meta.appContext.environmentId;
31
30
  }
32
31
  getCloudId() {
33
- return ARI.parse(this.request._meta.contextAri).cloudId;
32
+ return ari_1.AnyAri.parse(this.request._meta.contextAri).cloudId;
34
33
  }
35
34
  getContextAri() {
36
35
  return this.request._meta.contextAri;
@@ -39,10 +38,10 @@ class XenInvocationRequestImpl {
39
38
  return this.request._meta.rms;
40
39
  }
41
40
  getInvocationResourceOwner() {
42
- return ARI.parse(this.request._meta.contextAri).resourceOwner;
41
+ return ari_1.AnyAri.parse(this.request._meta.contextAri).resourceOwner;
43
42
  }
44
43
  getWorkspaceId() {
45
- const ari = ARI.parse(this.request._meta.contextAri);
44
+ const ari = ari_1.AnyAri.parse(this.request._meta.contextAri);
46
45
  return ari.resourceType === 'workspace' ? ari.resourceId : undefined;
47
46
  }
48
47
  getAppVersion() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/runtime",
3
- "version": "5.2.3-next.0",
3
+ "version": "5.3.0-next.0",
4
4
  "description": "A Node.js runtime for Atlassian app functions",
5
5
  "author": "Atlassian",
6
6
  "license": "UNLICENSED",
@@ -26,7 +26,7 @@
26
26
  "typescript": "^4.9.5"
27
27
  },
28
28
  "dependencies": {
29
- "@forge/util": "1.3.3",
29
+ "@forge/util": "1.4.0-next.0",
30
30
  "fp-ts": "^2.16.1",
31
31
  "io-ts": "^2.2.20",
32
32
  "io-ts-reporters": "^2.0.1",