@forge/manifest 10.0.1-next.7-experimental-effab31 → 10.1.0-next.8-experimental-05d33ea

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,10 +1,11 @@
1
1
  # @forge/manifest
2
2
 
3
- ## 10.0.1-next.7-experimental-effab31
3
+ ## 10.1.0-next.8-experimental-05d33ea
4
4
 
5
5
  ### Minor Changes
6
6
 
7
7
  - effab31: Bumped cheerio from 0.22 to 1.1
8
+ - 46daa27: Added support for default environment variable declaration in the manifest
8
9
 
9
10
  ### Patch Changes
10
11
 
@@ -17,8 +18,15 @@
17
18
  - 1479d2d: Update manifest definitions
18
19
  - ca7e661: Update manifest definitions
19
20
  - 5ab2c49: Update manifest definitions
21
+ - 609f68b: Update manifest definitions
20
22
  - Updated dependencies [195411c]
21
- - @forge/i18n@0.0.7-next.0-experimental-effab31
23
+ - @forge/i18n@0.0.7-next.0-experimental-05d33ea
24
+
25
+ ## 10.1.0-next.8
26
+
27
+ ### Minor Changes
28
+
29
+ - 46daa27: Added support for default environment variable declaration in the manifest
22
30
 
23
31
  ## 10.0.1-next.7
24
32
 
@@ -1 +1 @@
1
- {"version":3,"file":"environment-variable-interpolator.d.ts","sourceRoot":"","sources":["../../src/interpolator/environment-variable-interpolator.ts"],"names":[],"mappings":"AACA,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,yBAAyB,EAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIpD,qBAAa,oCAAqC,SAAQ,yBAAyB;gBACrE,OAAO,EAAE,MAAM;CAI5B;AAKD,qBAAa,+BAAgC,YAAW,oBAAoB;IAS9D,OAAO,CAAC,QAAQ,CAAC,aAAa;IAR1C,IAAI,EAAE,gBAAgB,CAAyC;IAI/D,6BAA6B,SAAqC;IAElE,OAAO,CAAC,gBAAgB,CAAW;gBAEN,aAAa,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAM;IAInF,WAAW,CAAC,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,cAAc;IAKjE,OAAO,CAAC,0BAA0B,CAkBhC;CACH"}
1
+ {"version":3,"file":"environment-variable-interpolator.d.ts","sourceRoot":"","sources":["../../src/interpolator/environment-variable-interpolator.ts"],"names":[],"mappings":"AACA,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,yBAAyB,EAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIpD,qBAAa,oCAAqC,SAAQ,yBAAyB;gBACrE,OAAO,EAAE,MAAM;CAI5B;AAUD,qBAAa,+BAAgC,YAAW,oBAAoB;IAS9D,OAAO,CAAC,QAAQ,CAAC,aAAa;IAR1C,IAAI,EAAE,gBAAgB,CAAyC;IAI/D,6BAA6B,SAAqC;IAElE,OAAO,CAAC,gBAAgB,CAAsB;gBAEjB,aAAa,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAM;IAInF,WAAW,CAAC,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,cAAc;IAmBjE,OAAO,CAAC,0BAA0B,CAoBhC;CACH"}
@@ -23,7 +23,22 @@ class EnvironmentVariableInterpolator {
23
23
  this.envVarsToReplace = [];
24
24
  }
25
25
  interpolate({ manifest }) {
26
- this.envVarsToReplace = manifest.environment?.variables ?? [];
26
+ this.envVarsToReplace = [];
27
+ if (manifest.environment && manifest.environment.variables) {
28
+ this.envVarsToReplace = manifest.environment.variables.map((manifestEnvVar) => {
29
+ if (typeof manifestEnvVar === 'string') {
30
+ return {
31
+ key: manifestEnvVar
32
+ };
33
+ }
34
+ else {
35
+ return {
36
+ key: manifestEnvVar.key,
37
+ default: manifestEnvVar.default
38
+ };
39
+ }
40
+ });
41
+ }
27
42
  return (0, yaml_1.parse)(JSON.stringify(manifest), this.environmentVariableReviver);
28
43
  }
29
44
  environmentVariableReviver = (_, value) => {
@@ -31,10 +46,11 @@ class EnvironmentVariableInterpolator {
31
46
  return value;
32
47
  }
33
48
  value = value.replace(this.POSSIBLE_ENVIRONMENT_VARIABLE, (original, envVarName) => {
34
- if (!this.envVarsToReplace.includes(envVarName)) {
49
+ const envVarToReplace = this.envVarsToReplace.find((envVar) => envVar.key === envVarName);
50
+ if (!envVarToReplace) {
35
51
  return original;
36
52
  }
37
- const envVar = this.envVarsRecord[envVarName];
53
+ const envVar = this.envVarsRecord[envVarName] ?? envVarToReplace.default;
38
54
  if (envVar === undefined) {
39
55
  throw new EnvironmentVariableInterpolatorError(text_1.errors.schema.missingEnvironmentVariable(envVarName));
40
56
  }
@@ -27020,9 +27020,22 @@
27020
27020
  "type": "string",
27021
27021
  "description": "The name of the connector."
27022
27022
  },
27023
- "icon": {
27024
- "type": "string",
27025
- "description": "The icon for the connector."
27023
+ "icons": {
27024
+ "type": "object",
27025
+ "properties": {
27026
+ "light": {
27027
+ "type": "string",
27028
+ "description": "The icon for the connector when in Light mode."
27029
+ },
27030
+ "dark": {
27031
+ "type": "string",
27032
+ "description": "The icon for the connector when in Dark mode."
27033
+ }
27034
+ },
27035
+ "required": [
27036
+ "light",
27037
+ "dark"
27038
+ ]
27026
27039
  },
27027
27040
  "entityTypes": {
27028
27041
  "type": "array",
@@ -27077,7 +27090,7 @@
27077
27090
  },
27078
27091
  "required": [
27079
27092
  "name",
27080
- "icon",
27093
+ "icons",
27081
27094
  "entityTypes",
27082
27095
  "key"
27083
27096
  ],
@@ -27676,8 +27689,16 @@
27676
27689
  "title": "variables",
27677
27690
  "description": "Manifest environment variables",
27678
27691
  "items": {
27679
- "type": "string",
27680
- "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$"
27692
+ "oneOf": [
27693
+ {
27694
+ "$ref": "#/definitions/EnvVarString",
27695
+ "title": "EnvVarString"
27696
+ },
27697
+ {
27698
+ "$ref": "#/definitions/EnvVarObject",
27699
+ "title": "EnvVarObject"
27700
+ }
27701
+ ]
27681
27702
  }
27682
27703
  }
27683
27704
  }
@@ -27835,6 +27856,29 @@
27835
27856
  }
27836
27857
  }
27837
27858
  },
27859
+ "EnvVarString": {
27860
+ "type": "string",
27861
+ "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$",
27862
+ "description": "An environment variable name, which can be used in the manifest"
27863
+ },
27864
+ "EnvVarObject": {
27865
+ "type": "object",
27866
+ "additionalProperties": false,
27867
+ "required": [
27868
+ "key",
27869
+ "default"
27870
+ ],
27871
+ "properties": {
27872
+ "key": {
27873
+ "$ref": "#/definitions/EnvVarString",
27874
+ "description": "The name of the environment variable"
27875
+ },
27876
+ "default": {
27877
+ "type": "string",
27878
+ "description": "The default value of the environment variable"
27879
+ }
27880
+ }
27881
+ },
27838
27882
  "AuthProviderPredefined": {
27839
27883
  "type": "object",
27840
27884
  "additionalProperties": false,
@@ -721,10 +721,14 @@ export type OAuth2ScopeName = string;
721
721
  * External authentication providers
722
722
  */
723
723
  export type Auth = (AuthProviderCustom | AuthProviderPredefined)[];
724
+ /**
725
+ * An environment variable name, which can be used in the manifest
726
+ */
727
+ export type EnvVarString = string;
724
728
  /**
725
729
  * Manifest environment variables
726
730
  */
727
- export type Variables = string[];
731
+ export type Variables = (EnvVarString | EnvVarObject)[];
728
732
  export type TranslationsResources = [
729
733
  {
730
734
  key: ForgeSupportedLocaleCode;
@@ -23223,10 +23227,17 @@ export interface Modules {
23223
23227
  * The name of the connector.
23224
23228
  */
23225
23229
  name: string;
23226
- /**
23227
- * The icon for the connector.
23228
- */
23229
- icon: string;
23230
+ icons: {
23231
+ /**
23232
+ * The icon for the connector when in Light mode.
23233
+ */
23234
+ light: string;
23235
+ /**
23236
+ * The icon for the connector when in Dark mode.
23237
+ */
23238
+ dark: string;
23239
+ [k: string]: unknown;
23240
+ };
23230
23241
  /**
23231
23242
  * Entities that the connector can provide.
23232
23243
  */
@@ -23291,10 +23302,17 @@ export interface Modules {
23291
23302
  * The name of the connector.
23292
23303
  */
23293
23304
  name: string;
23294
- /**
23295
- * The icon for the connector.
23296
- */
23297
- icon: string;
23305
+ icons: {
23306
+ /**
23307
+ * The icon for the connector when in Light mode.
23308
+ */
23309
+ light: string;
23310
+ /**
23311
+ * The icon for the connector when in Dark mode.
23312
+ */
23313
+ dark: string;
23314
+ [k: string]: unknown;
23315
+ };
23298
23316
  /**
23299
23317
  * Entities that the connector can provide.
23300
23318
  */
@@ -72678,6 +72696,16 @@ export interface AuthProviderPredefined {
72678
72696
  export interface Environment {
72679
72697
  variables?: Variables;
72680
72698
  }
72699
+ export interface EnvVarObject {
72700
+ /**
72701
+ * The name of the environment variable
72702
+ */
72703
+ key: string;
72704
+ /**
72705
+ * The default value of the environment variable
72706
+ */
72707
+ default: string;
72708
+ }
72681
72709
  export interface Translations {
72682
72710
  resources: TranslationsResources;
72683
72711
  fallback: TranslationsFallback;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/manifest",
3
- "version": "10.0.1-next.7-experimental-effab31",
3
+ "version": "10.1.0-next.8-experimental-05d33ea",
4
4
  "description": "Definitions and validations of the Forge manifest",
5
5
  "main": "out/index.js",
6
6
  "scripts": {
@@ -24,7 +24,7 @@
24
24
  "author": "Atlassian",
25
25
  "license": "SEE LICENSE IN LICENSE.txt",
26
26
  "dependencies": {
27
- "@forge/i18n": "0.0.7-next.0-experimental-effab31",
27
+ "@forge/i18n": "0.0.7-next.0-experimental-05d33ea",
28
28
  "@sentry/node": "7.106.0",
29
29
  "ajv": "^8.12.0",
30
30
  "ajv-formats": "2.1.1",