@forge/egress 2.0.3-next.0 → 2.1.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,17 @@
1
1
  # @forge/egress
2
2
 
3
+ ## 2.1.0-next.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5143f1b: 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
+
3
15
  ## 2.0.3-next.0
4
16
 
5
17
  ### Patch Changes
@@ -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
@@ -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.3-next.0",
3
+ "version": "2.1.0-next.0",
4
4
  "description": "Helpers and utils for egress implementation in Forge apps",
5
5
  "main": "out/index.js",
6
6
  "author": "Atlassian",