@forge/bridge 5.14.2-next.4 → 5.15.0-next.5

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,11 @@
1
1
  # @forge/bridge
2
2
 
3
+ ## 5.15.0-next.5
4
+
5
+ ### Minor Changes
6
+
7
+ - 0081fc3: Add validations and Update Readme for forge UI feature flags
8
+
3
9
  ## 5.14.2-next.4
4
10
 
5
11
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"featureFlags.d.ts","sourceRoot":"","sources":["../../src/featureFlags/featureFlags.ts"],"names":[],"mappings":"AAGA,OAAO,EAKL,eAAe,EACf,sBAAsB,EAEvB,MAAM,SAAS,CAAC;AAEjB,qBAAa,YAAY;IACvB,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,UAAU,CAAkC;IAKvC,UAAU,CACrB,IAAI,EAAE,eAAe,EACrB,MAAM,GAAE,sBAAuD,GAC9D,OAAO,CAAC,IAAI,CAAC;IAgBT,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,UAAQ,GAAG,OAAO;IAa1D,QAAQ;IAQR,aAAa;IAIpB,OAAO,CAAC,kBAAkB;CAa3B"}
1
+ {"version":3,"file":"featureFlags.d.ts","sourceRoot":"","sources":["../../src/featureFlags/featureFlags.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,eAAe,EACf,sBAAsB,EAEvB,MAAM,SAAS,CAAC;AAEjB,qBAAa,YAAY;IACvB,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,UAAU,CAAkC;IAKvC,UAAU,CACrB,IAAI,EAAE,eAAe,EACrB,MAAM,GAAE,sBAAuD,GAC9D,OAAO,CAAC,IAAI,CAAC;IAoBT,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,UAAQ,GAAG,OAAO;IAa1D,QAAQ;IAQR,aAAa;IAIpB,OAAO,CAAC,kBAAkB;CAa3B"}
@@ -14,6 +14,9 @@ class FeatureFlags {
14
14
  if (this.isInitialized()) {
15
15
  return;
16
16
  }
17
+ if (!(config === null || config === void 0 ? void 0 : config.environment)) {
18
+ config.environment = 'development';
19
+ }
17
20
  this.eventProps.environment = config.environment;
18
21
  const result = await (0, initFeatureFlags_1.initFeatureFlags)({ user, config });
19
22
  this.initialized = true;
@@ -1 +1 @@
1
- {"version":3,"file":"initFeatureFlags.d.ts","sourceRoot":"","sources":["../../src/featureFlags/initFeatureFlags.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAA4B,MAAM,SAAS,CAAC;AAuB5E,eAAO,MAAM,gBAAgB,qDAK5B,CAAC"}
1
+ {"version":3,"file":"initFeatureFlags.d.ts","sourceRoot":"","sources":["../../src/featureFlags/initFeatureFlags.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAA4B,MAAM,SAAS,CAAC;AA2B5E,eAAO,MAAM,gBAAgB,qDAK5B,CAAC"}
@@ -11,6 +11,9 @@ const validatePayload = (payload) => {
11
11
  if (!payload || !payload.user || !payload.config) {
12
12
  throw new errors_1.BridgeAPIError('Missing required parameters. Parameter user is required in the payload.');
13
13
  }
14
+ if (!payload.config.environment || !['development', 'staging', 'production'].includes(payload.config.environment)) {
15
+ throw new errors_1.BridgeAPIError('Invalid environment. Valid environments are: development, staging, production');
16
+ }
14
17
  if (Object.values(payload).some((val) => typeof val === 'function')) {
15
18
  throw new errors_1.BridgeAPIError('Passing functions as part of the payload is not supported!');
16
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/bridge",
3
- "version": "5.14.2-next.4",
3
+ "version": "5.15.0-next.5",
4
4
  "description": "Forge bridge API for custom UI apps",
5
5
  "author": "Atlassian",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",