@trackunit/iris-app-api 0.0.82-alpha-beca370860.0 → 0.0.84

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
@@ -2,7 +2,11 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
- ## [0.0.82-alpha-beca370860.0](https://github.com/Trackunit/manager/compare/iris-app-api/0.0.81...iris-app-api/0.0.82-alpha-beca370860.0) (2023-04-04)
5
+ ## [0.0.84](https://github.com/Trackunit/manager/compare/iris-app-api/0.0.83...iris-app-api/0.0.84) (2023-04-11)
6
+
7
+ ## [0.0.83](https://github.com/Trackunit/manager/compare/iris-app-api/0.0.82...iris-app-api/0.0.83) (2023-04-11)
8
+
9
+ ## [0.0.82](https://github.com/Trackunit/manager/compare/iris-app-api/0.0.81...iris-app-api/0.0.82) (2023-04-10)
6
10
 
7
11
  ## [0.0.81](https://github.com/Trackunit/manager/compare/iris-app-api/0.0.80...iris-app-api/0.0.81) (2023-03-30)
8
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/iris-app-api",
3
- "version": "0.0.82-alpha-beca370860.0",
3
+ "version": "0.0.84",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "repository": "https://github.com/Trackunit/manager",
6
6
  "main": "./src/index.js",
@@ -1,3 +1,4 @@
1
+ export * from "./irisAppCspInput";
1
2
  export * from "./irisAppManifest";
2
3
  export * from "./mocks";
3
4
  export * from "./modulefederation";
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./irisAppCspInput"), exports);
4
5
  tslib_1.__exportStar(require("./irisAppManifest"), exports);
5
6
  tslib_1.__exportStar(require("./mocks"), exports);
6
7
  tslib_1.__exportStar(require("./modulefederation"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-api/src/types/index.ts"],"names":[],"mappings":";;;AAAA,4DAAkC;AAClC,kDAAwB;AACxB,6DAAmC","sourcesContent":["export * from \"./irisAppManifest\";\nexport * from \"./mocks\";\nexport * from \"./modulefederation\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-api/src/types/index.ts"],"names":[],"mappings":";;;AAAA,4DAAkC;AAClC,4DAAkC;AAClC,kDAAwB;AACxB,6DAAmC","sourcesContent":["export * from \"./irisAppCspInput\";\nexport * from \"./irisAppManifest\";\nexport * from \"./mocks\";\nexport * from \"./modulefederation\";\n"]}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * This type is used to generate the CSP input for the Iris Apps Csp Header
3
+ */
4
+ export type CspDirectives = {
5
+ directives: {
6
+ "default-src": string[];
7
+ "script-src": string[];
8
+ "worker-src": string[];
9
+ "style-src": string[];
10
+ "connect-src": string[];
11
+ };
12
+ reportUri?: string;
13
+ };
14
+ /**
15
+ * This function is used to generate the CSP input for the Iris Apps Csp Header
16
+ *
17
+ * @param validDomains input valid domains to add to the CSP header
18
+ * @param frameAncestors input frame ancestors to add to the CSP header
19
+ * @param extraScriptSrc input extra script src to add to the CSP header
20
+ * @returns { CspDirectives } the CSP input for the Iris Apps Csp Header
21
+ */
22
+ export declare const irisAppCspInput: (validDomains: string[], frameAncestors?: string[], extraScriptSrc?: string) => CspDirectives;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.irisAppCspInput = void 0;
4
+ const BrandedUrls = [
5
+ "https://*.trackunit.com",
6
+ "https://*.wackerneuson.com",
7
+ "https://*.manitou.com",
8
+ "https://*.niftylinkmanager.com",
9
+ "https://*.skyjack.com",
10
+ "https://*.ahernaccess.com",
11
+ "https://*.magnith.com",
12
+ "https://*.terberg.com",
13
+ "https://*.mymecalac.com",
14
+ "https://*.delille.be",
15
+ ];
16
+ /**
17
+ * This function is used to generate the CSP input for the Iris Apps Csp Header
18
+ *
19
+ * @param validDomains input valid domains to add to the CSP header
20
+ * @param frameAncestors input frame ancestors to add to the CSP header
21
+ * @param extraScriptSrc input extra script src to add to the CSP header
22
+ * @returns { CspDirectives } the CSP input for the Iris Apps Csp Header
23
+ */
24
+ const irisAppCspInput = (validDomains, frameAncestors, extraScriptSrc) => {
25
+ const cspInput = {
26
+ directives: {
27
+ "default-src": ["'self'", ...validDomains],
28
+ "script-src": ["'self'", ...validDomains],
29
+ "worker-src": ["'self'", "blob:", ...validDomains],
30
+ "style-src": ["'unsafe-inline'", "https://fonts.googleapis.com"],
31
+ "connect-src": [
32
+ "'self'",
33
+ "https://*.sentry.io",
34
+ "https://sentry.io",
35
+ "http://localhost:3003",
36
+ ...BrandedUrls,
37
+ ...validDomains,
38
+ ],
39
+ },
40
+ reportUri: "https://o343335.ingest.sentry.io/api/1888181/security/?sentry_key=62900a1fa49748d8ba12f4ffbdbd8e07",
41
+ };
42
+ if (extraScriptSrc) {
43
+ cspInput.directives["script-src"].push(extraScriptSrc);
44
+ }
45
+ if (frameAncestors && frameAncestors.length > 0) {
46
+ cspInput.directives["frame-ancestors"] = frameAncestors;
47
+ }
48
+ return cspInput;
49
+ };
50
+ exports.irisAppCspInput = irisAppCspInput;
51
+ //# sourceMappingURL=irisAppCspInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"irisAppCspInput.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-api/src/types/irisAppCspInput.ts"],"names":[],"mappings":";;;AAAA,MAAM,WAAW,GAAG;IAClB,yBAAyB;IACzB,4BAA4B;IAC5B,uBAAuB;IACvB,gCAAgC;IAChC,uBAAuB;IACvB,2BAA2B;IAC3B,uBAAuB;IACvB,uBAAuB;IACvB,yBAAyB;IACzB,sBAAsB;CACvB,CAAC;AAgBF;;;;;;;GAOG;AACI,MAAM,eAAe,GAAG,CAC7B,YAAsB,EACtB,cAAyB,EACzB,cAAuB,EACR,EAAE;IACjB,MAAM,QAAQ,GAAG;QACf,UAAU,EAAE;YACV,aAAa,EAAE,CAAC,QAAQ,EAAE,GAAG,YAAY,CAAC;YAC1C,YAAY,EAAE,CAAC,QAAQ,EAAE,GAAG,YAAY,CAAC;YACzC,YAAY,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,YAAY,CAAC;YAClD,WAAW,EAAE,CAAC,iBAAiB,EAAE,8BAA8B,CAAC;YAEhE,aAAa,EAAE;gBACb,QAAQ;gBACR,qBAAqB;gBACrB,mBAAmB;gBACnB,uBAAuB;gBACvB,GAAG,WAAW;gBACd,GAAG,YAAY;aAChB;SACF;QACD,SAAS,EAAE,oGAAoG;KAChH,CAAC;IACF,IAAI,cAAc,EAAE;QAClB,QAAQ,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;KACxD;IACD,IAAI,cAAc,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;QAC/C,QAAQ,CAAC,UAAU,CAAC,iBAAiB,CAAC,GAAG,cAAc,CAAC;KACzD;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AA9BW,QAAA,eAAe,mBA8B1B","sourcesContent":["const BrandedUrls = [\n \"https://*.trackunit.com\",\n \"https://*.wackerneuson.com\",\n \"https://*.manitou.com\",\n \"https://*.niftylinkmanager.com\",\n \"https://*.skyjack.com\",\n \"https://*.ahernaccess.com\",\n \"https://*.magnith.com\",\n \"https://*.terberg.com\",\n \"https://*.mymecalac.com\",\n \"https://*.delille.be\",\n];\n\n/**\n * This type is used to generate the CSP input for the Iris Apps Csp Header\n */\nexport type CspDirectives = {\n directives: {\n \"default-src\": string[];\n \"script-src\": string[];\n \"worker-src\": string[];\n \"style-src\": string[];\n \"connect-src\": string[];\n };\n reportUri?: string;\n};\n\n/**\n * This function is used to generate the CSP input for the Iris Apps Csp Header\n *\n * @param validDomains input valid domains to add to the CSP header\n * @param frameAncestors input frame ancestors to add to the CSP header\n * @param extraScriptSrc input extra script src to add to the CSP header\n * @returns { CspDirectives } the CSP input for the Iris Apps Csp Header\n */\nexport const irisAppCspInput = (\n validDomains: string[],\n frameAncestors?: string[],\n extraScriptSrc?: string\n): CspDirectives => {\n const cspInput = {\n directives: {\n \"default-src\": [\"'self'\", ...validDomains],\n \"script-src\": [\"'self'\", ...validDomains],\n \"worker-src\": [\"'self'\", \"blob:\", ...validDomains],\n \"style-src\": [\"'unsafe-inline'\", \"https://fonts.googleapis.com\"],\n\n \"connect-src\": [\n \"'self'\",\n \"https://*.sentry.io\",\n \"https://sentry.io\",\n \"http://localhost:3003\",\n ...BrandedUrls,\n ...validDomains,\n ],\n },\n reportUri: \"https://o343335.ingest.sentry.io/api/1888181/security/?sentry_key=62900a1fa49748d8ba12f4ffbdbd8e07\",\n };\n if (extraScriptSrc) {\n cspInput.directives[\"script-src\"].push(extraScriptSrc);\n }\n if (frameAncestors && frameAncestors.length > 0) {\n cspInput.directives[\"frame-ancestors\"] = frameAncestors;\n }\n return cspInput;\n};\n"]}