@forge/egress 1.3.1 → 1.4.0-next.1
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 +12 -0
- package/out/egress/utils.d.ts +6 -1
- package/out/egress/utils.d.ts.map +1 -1
- package/out/egress/utils.js +9 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @forge/egress
|
|
2
2
|
|
|
3
|
+
## 1.4.0-next.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 89c96bf: Make egress category value uppercase
|
|
8
|
+
|
|
9
|
+
## 1.4.0-next.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- c25288c: Update getEgressesBasedOnToggles to handle installationConfig property for an extension
|
|
14
|
+
|
|
3
15
|
## 1.3.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/out/egress/utils.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare enum EgressType {
|
|
|
11
11
|
Styles = "STYLES"
|
|
12
12
|
}
|
|
13
13
|
export declare enum EgressCategory {
|
|
14
|
-
ANALYTICS = "
|
|
14
|
+
ANALYTICS = "ANALYTICS"
|
|
15
15
|
}
|
|
16
16
|
export declare type EgressPermissions = {
|
|
17
17
|
type: EgressType;
|
|
@@ -23,9 +23,14 @@ export declare type EgressPermissionsSimplified = Omit<EgressPermissions, 'inSco
|
|
|
23
23
|
interface ConfigOverrides {
|
|
24
24
|
ALLOW_EGRESS_ANALYTICS?: boolean;
|
|
25
25
|
}
|
|
26
|
+
export interface AppInstallationConfig {
|
|
27
|
+
key: keyof ConfigOverrides;
|
|
28
|
+
value: boolean;
|
|
29
|
+
}
|
|
26
30
|
declare const getEgressesBasedOnToggles: (input: {
|
|
27
31
|
overrides: ConfigOverrides;
|
|
28
32
|
egress: EgressPermissions[];
|
|
33
|
+
installationConfig?: AppInstallationConfig[];
|
|
29
34
|
}) => EgressPermissionsSimplified[];
|
|
30
35
|
export { sortAndGroupEgressPermissionsByDomain, getEgressesBasedOnToggles };
|
|
31
36
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/egress/utils.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,qCAAqC,oBAAqB,MAAM,EAAE,KAAG,MAAM,MAAM,CA6BtF,CAAC;AAEF,oBAAY,UAAU;IACpB,gBAAgB,uBAAuB;IACvC,eAAe,sBAAsB;IACrC,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,UAAU,eAAe;IACzB,OAAO,YAAY;IACnB,MAAM,WAAW;CAClB;AAED,oBAAY,cAAc;IACxB,SAAS,cAAc;CACxB;AAED,oBAAY,iBAAiB,GAAG;IAC9B,IAAI,EAAE,UAAU,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,oBAAY,2BAA2B,GAAG,IAAI,CAAC,iBAAiB,EAAE,YAAY,GAAG,SAAS,GAAG,UAAU,CAAC,CAAC;AAEzG,UAAU,eAAe;IACvB,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,QAAA,MAAM,yBAAyB,UAAW;IACxC,SAAS,EAAE,eAAe,CAAC;IAC3B,MAAM,EAAE,iBAAiB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/egress/utils.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,qCAAqC,oBAAqB,MAAM,EAAE,KAAG,MAAM,MAAM,CA6BtF,CAAC;AAEF,oBAAY,UAAU;IACpB,gBAAgB,uBAAuB;IACvC,eAAe,sBAAsB;IACrC,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,UAAU,eAAe;IACzB,OAAO,YAAY;IACnB,MAAM,WAAW;CAClB;AAED,oBAAY,cAAc;IACxB,SAAS,cAAc;CACxB;AAED,oBAAY,iBAAiB,GAAG;IAC9B,IAAI,EAAE,UAAU,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,oBAAY,2BAA2B,GAAG,IAAI,CAAC,iBAAiB,EAAE,YAAY,GAAG,SAAS,GAAG,UAAU,CAAC,CAAC;AAEzG,UAAU,eAAe;IACvB,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,eAAe,CAAC;IAC3B,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,QAAA,MAAM,yBAAyB,UAAW;IACxC,SAAS,EAAE,eAAe,CAAC;IAC3B,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,kBAAkB,CAAC,EAAE,qBAAqB,EAAE,CAAC;CAC9C,KAAG,2BAA2B,EA4B9B,CAAC;AAEF,OAAO,EAAE,qCAAqC,EAAE,yBAAyB,EAAE,CAAC"}
|
package/out/egress/utils.js
CHANGED
|
@@ -43,12 +43,18 @@ var EgressType;
|
|
|
43
43
|
})(EgressType = exports.EgressType || (exports.EgressType = {}));
|
|
44
44
|
var EgressCategory;
|
|
45
45
|
(function (EgressCategory) {
|
|
46
|
-
EgressCategory["ANALYTICS"] = "
|
|
46
|
+
EgressCategory["ANALYTICS"] = "ANALYTICS";
|
|
47
47
|
})(EgressCategory = exports.EgressCategory || (exports.EgressCategory = {}));
|
|
48
48
|
const getEgressesBasedOnToggles = (input) => {
|
|
49
49
|
const filteredEgresses = input.egress.filter((egress) => {
|
|
50
|
-
if (egress.category === EgressCategory.ANALYTICS) {
|
|
51
|
-
|
|
50
|
+
if (egress.category?.toUpperCase() === EgressCategory.ANALYTICS) {
|
|
51
|
+
if (input.installationConfig) {
|
|
52
|
+
const analyticsConfig = input.installationConfig.find((config) => config.key.toUpperCase() === 'ALLOW_EGRESS_ANALYTICS');
|
|
53
|
+
return analyticsConfig?.value !== false;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
return input.overrides.ALLOW_EGRESS_ANALYTICS !== false;
|
|
57
|
+
}
|
|
52
58
|
}
|
|
53
59
|
return true;
|
|
54
60
|
});
|