@forge/egress 2.0.2 → 2.0.3-experimental-90687cf

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,23 @@
1
1
  # @forge/egress
2
2
 
3
+ ## 2.0.3-experimental-90687cf
4
+
5
+ ### Patch Changes
6
+
7
+ - 90687cf: Update tsconfig.json to include ES2018 in lib and ensure target is set to ES2018
8
+
9
+ ## 2.0.3
10
+
11
+ ### Patch Changes
12
+
13
+ - 8a3d993: Expose allowsEverything property in Egress Service via function
14
+
15
+ ## 2.0.3-next.0
16
+
17
+ ### Patch Changes
18
+
19
+ - 8a3d993: Expose allowsEverything property in Egress Service via function
20
+
3
21
  ## 2.0.2
4
22
 
5
23
  ### Patch Changes
@@ -4,6 +4,7 @@ export declare class EgressFilteringService {
4
4
  private readonly allowsEverything;
5
5
  constructor(allowList: string[]);
6
6
  private parseUrl;
7
+ containsWildCardEgress(): boolean;
7
8
  isValidUrl(url: string): boolean;
8
9
  private allowedDomain;
9
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"egress-filtering-service.d.ts","sourceRoot":"","sources":["../../src/egress/egress-filtering-service.ts"],"names":[],"mappings":"AAGA,qBAAa,sBAAsB;IACjC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAY;IACjC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAY;IAC5C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAU;gBAE/B,SAAS,EAAE,MAAM,EAAE;IAU/B,OAAO,CAAC,QAAQ;IAKT,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IASvC,OAAO,CAAC,aAAa;CAKtB"}
1
+ {"version":3,"file":"egress-filtering-service.d.ts","sourceRoot":"","sources":["../../src/egress/egress-filtering-service.ts"],"names":[],"mappings":"AAGA,qBAAa,sBAAsB;IACjC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAY;IACjC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAY;IAC5C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAU;gBAE/B,SAAS,EAAE,MAAM,EAAE;IAU/B,OAAO,CAAC,QAAQ;IAIT,sBAAsB,IAAI,OAAO;IAKjC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IASvC,OAAO,CAAC,aAAa;CAKtB"}
@@ -4,9 +4,6 @@ exports.EgressFilteringService = void 0;
4
4
  const minimatch_1 = require("minimatch");
5
5
  const url_parser_1 = require("./url-parser");
6
6
  class EgressFilteringService {
7
- URLs;
8
- wildcardDomains;
9
- allowsEverything;
10
7
  constructor(allowList) {
11
8
  this.URLs = allowList.filter((domainOrURL) => !domainOrURL.startsWith('*')).map((url) => this.parseUrl(url));
12
9
  this.wildcardDomains = allowList
@@ -18,6 +15,9 @@ class EgressFilteringService {
18
15
  parseUrl(url) {
19
16
  return (0, url_parser_1.parseUrl)(url);
20
17
  }
18
+ containsWildCardEgress() {
19
+ return this.allowsEverything;
20
+ }
21
21
  isValidUrl(url) {
22
22
  if (this.allowsEverything) {
23
23
  return true;
@@ -2,7 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.parseUrl = void 0;
4
4
  function parseUrl(url) {
5
- const protocol = url.match(/^(.*?:)/)?.[0] ?? 'https:';
5
+ var _a, _b;
6
+ const protocol = (_b = (_a = url.match(/^(.*?:)/)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : 'https:';
6
7
  const hostname = url
7
8
  .replace(protocol, '')
8
9
  .replace(/^\/*/, '')
@@ -4,7 +4,7 @@ exports.getEgressesBasedOnToggles = exports.sortAndGroupEgressPermissionsByDomai
4
4
  const minimatch_1 = require("minimatch");
5
5
  const url_parser_1 = require("./url-parser");
6
6
  const sortAndGroupEgressPermissionsByDomain = (egressAddresses) => {
7
- if (egressAddresses?.length === 0) {
7
+ if ((egressAddresses === null || egressAddresses === void 0 ? void 0 : egressAddresses.length) === 0) {
8
8
  return [];
9
9
  }
10
10
  const protocolRegex = /^(.*?:\/\/)/;
@@ -47,10 +47,11 @@ var EgressCategory;
47
47
  })(EgressCategory = exports.EgressCategory || (exports.EgressCategory = {}));
48
48
  const getEgressesBasedOnToggles = (input) => {
49
49
  const filteredEgresses = input.egress.filter((egress) => {
50
- if (egress.category?.toUpperCase() === EgressCategory.ANALYTICS) {
50
+ var _a;
51
+ if (((_a = egress.category) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === EgressCategory.ANALYTICS) {
51
52
  if (input.installationConfig) {
52
53
  const analyticsConfig = input.installationConfig.find((config) => config.key.toUpperCase() === 'ALLOW_EGRESS_ANALYTICS');
53
- return analyticsConfig?.value !== false;
54
+ return (analyticsConfig === null || analyticsConfig === void 0 ? void 0 : analyticsConfig.value) !== false;
54
55
  }
55
56
  else {
56
57
  return input.overrides.ALLOW_EGRESS_ANALYTICS !== false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/egress",
3
- "version": "2.0.2",
3
+ "version": "2.0.3-experimental-90687cf",
4
4
  "description": "Helpers and utils for egress implementation in Forge apps",
5
5
  "main": "out/index.js",
6
6
  "author": "Atlassian",