@trackunit/iris-app-api 0.0.161 → 0.0.162

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,6 +2,8 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.0.162](https://github.com/Trackunit/manager/compare/iris-app-api/0.0.161...iris-app-api/0.0.162) (2024-04-08)
6
+
5
7
  ## [0.0.161](https://github.com/Trackunit/manager/compare/iris-app-api/0.0.160...iris-app-api/0.0.161) (2024-04-02)
6
8
 
7
9
  ## [0.0.160](https://github.com/Trackunit/manager/compare/iris-app-api/0.0.159...iris-app-api/0.0.160) (2024-03-21)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/iris-app-api",
3
- "version": "0.0.161",
3
+ "version": "0.0.162",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "repository": "https://github.com/Trackunit/manager",
6
6
  "engines": {
@@ -34,9 +34,7 @@ export type CSPDirectives = {
34
34
  "form-action": TNavigationDirective[];
35
35
  "frame-src": TFetchDirective[];
36
36
  "img-src": (TFetchDirective | typeof STRICT_DYNAMIC)[];
37
- "manifest-src": TFetchDirective[];
38
37
  "media-src": TFetchDirective[];
39
- "object-src": TFetchDirective[];
40
38
  sandbox: (typeof ALLOW_DOWNLOADS_WITHOUT_USER_ACTIVATION | typeof ALLOW_FORMS | typeof ALLOW_MODALS | typeof ALLOW_ORIENTATION_LOCK | typeof ALLOW_POINTER_LOCK | typeof ALLOW_POPUPS | typeof ALLOW_POPUPS_TO_ESCAPE_SANDBOX | typeof ALLOW_PRESENTATION | typeof ALLOW_SAME_ORIGIN | typeof ALLOW_SCRIPTS | typeof ALLOW_STORAGE_ACCESS_BY_USER_ACTIVATION | typeof ALLOW_TOP_NAVIGATION | typeof ALLOW_TOP_NAVIGATION_BY_USER_ACTIVATION)[];
41
39
  "script-src": (TFetchDirective | typeof STRICT_DYNAMIC | typeof REPORT_SAMPLE | typeof WASM_UNSAFE_EVAL)[];
42
40
  "script-src-attr": (TAttrDirective | typeof REPORT_SAMPLE)[];
@@ -46,9 +44,5 @@ export type CSPDirectives = {
46
44
  "style-src-elem": (TFetchDirective | typeof REPORT_SAMPLE)[];
47
45
  "upgrade-insecure-requests": boolean;
48
46
  "worker-src": TFetchDirective[];
49
- /**
50
- * @deprecated
51
- */
52
- "report-uri": string;
53
47
  };
54
48
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"cspDirectives.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-api/src/types/cspDirectives.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,yFAAyF;AACzF,EAAE;;;AAEW,QAAA,uCAAuC,GAAG,yCAAyC,CAAC;AACpF,QAAA,gBAAgB,GAAG,oBAAoB,CAAC;AACxC,QAAA,WAAW,GAAG,aAAa,CAAC;AAC5B,QAAA,YAAY,GAAG,cAAc,CAAC;AAC9B,QAAA,sBAAsB,GAAG,wBAAwB,CAAC;AAClD,QAAA,kBAAkB,GAAG,oBAAoB,CAAC;AAC1C,QAAA,YAAY,GAAG,cAAc,CAAC;AAC9B,QAAA,8BAA8B,GAAG,gCAAgC,CAAC;AAClE,QAAA,kBAAkB,GAAG,oBAAoB,CAAC;AAC1C,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AACxC,QAAA,uCAAuC,GAAG,yCAAyC,CAAC;AACpF,QAAA,aAAa,GAAG,qBAAqB,CAAC;AACtC,QAAA,oBAAoB,GAAG,sBAAsB,CAAC;AAC9C,QAAA,uCAAuC,GAAG,yCAAyC,CAAC;AA0BpF,QAAA,IAAI,GAAG,QAAQ,CAAC;AAChB,QAAA,IAAI,GAAG,QAAQ,CAAC;AAChB,QAAA,cAAc,GAAG,kBAAkB,CAAC;AACpC,QAAA,aAAa,GAAG,iBAAiB,CAAC;AAClC,QAAA,WAAW,GAAG,eAAe,CAAC;AAC9B,QAAA,aAAa,GAAG,iBAAiB,CAAC;AAClC,QAAA,aAAa,GAAG,iBAAiB,CAAC;AAClC,QAAA,gBAAgB,GAAG,oBAAoB,CAAC","sourcesContent":["//\n// Based on types from https://www.npmjs.com/package/csp-header but adjusted to our needs\n//\n\nexport const ALLOW_DOWNLOADS_WITHOUT_USER_ACTIVATION = \"allow-downloads-without-user-activation\";\nexport const ALLOW_DUPLICATES = \"'allow-duplicates'\";\nexport const ALLOW_FORMS = \"allow-forms\";\nexport const ALLOW_MODALS = \"allow-modals\";\nexport const ALLOW_ORIENTATION_LOCK = \"allow-orientation-lock\";\nexport const ALLOW_POINTER_LOCK = \"allow-pointer-lock\";\nexport const ALLOW_POPUPS = \"allow-popups\";\nexport const ALLOW_POPUPS_TO_ESCAPE_SANDBOX = \"allow-popups-to-escape-sandbox\";\nexport const ALLOW_PRESENTATION = \"allow-presentation\";\nexport const ALLOW_SAME_ORIGIN = \"allow-same-origin\";\nexport const ALLOW_STORAGE_ACCESS_BY_USER_ACTIVATION = \"allow-storage-access-by-user-activation\";\nexport const ALLOW_SCRIPTS = \"allow-allow-scripts\";\nexport const ALLOW_TOP_NAVIGATION = \"allow-top-navigation\";\nexport const ALLOW_TOP_NAVIGATION_BY_USER_ACTIVATION = \"allow-top-navigation-by-user-activation\";\n\ntype TSource = string;\ntype TNonce = `nonce-${string}`;\ntype THash = `sha${\"256\" | \"384\" | \"512\"}-${string}`;\ntype TAttrDirective = THash | typeof NONE | typeof UNSAFE_INLINE | typeof UNSAFE_HASHES;\ntype TFetchDirective =\n | TSource\n | TNonce\n | THash\n | typeof NONE\n | typeof SELF\n | typeof UNSAFE_EVAL\n | typeof UNSAFE_HASHES\n | typeof UNSAFE_INLINE;\ntype TNavigationDirective =\n | TSource\n | TNonce\n | THash\n | typeof NONE\n | typeof SELF\n | typeof UNSAFE_EVAL\n | typeof UNSAFE_HASHES\n | typeof UNSAFE_INLINE\n | typeof STRICT_DYNAMIC;\n\nexport const NONE = \"'none'\";\nexport const SELF = \"'self'\";\nexport const STRICT_DYNAMIC = \"'strict-dynamic'\";\nexport const REPORT_SAMPLE = \"'report-sample'\";\nexport const UNSAFE_EVAL = \"'unsafe-eval'\";\nexport const UNSAFE_HASHES = \"'unsafe-hashes'\";\nexport const UNSAFE_INLINE = \"'unsafe-inline'\";\nexport const WASM_UNSAFE_EVAL = \"'wasm-unsafe-eval'\";\n\nexport type CSPDirectives = {\n \"child-src\": TFetchDirective[];\n \"connect-src\": TFetchDirective[];\n \"default-src\": (TFetchDirective | typeof STRICT_DYNAMIC)[];\n \"font-src\": TFetchDirective[];\n \"form-action\": TNavigationDirective[];\n \"frame-src\": TFetchDirective[];\n \"img-src\": (TFetchDirective | typeof STRICT_DYNAMIC)[];\n \"manifest-src\": TFetchDirective[];\n \"media-src\": TFetchDirective[];\n \"object-src\": TFetchDirective[];\n sandbox: (\n | typeof ALLOW_DOWNLOADS_WITHOUT_USER_ACTIVATION\n | typeof ALLOW_FORMS\n | typeof ALLOW_MODALS\n | typeof ALLOW_ORIENTATION_LOCK\n | typeof ALLOW_POINTER_LOCK\n | typeof ALLOW_POPUPS\n | typeof ALLOW_POPUPS_TO_ESCAPE_SANDBOX\n | typeof ALLOW_PRESENTATION\n | typeof ALLOW_SAME_ORIGIN\n | typeof ALLOW_SCRIPTS\n | typeof ALLOW_STORAGE_ACCESS_BY_USER_ACTIVATION\n | typeof ALLOW_TOP_NAVIGATION\n | typeof ALLOW_TOP_NAVIGATION_BY_USER_ACTIVATION\n )[];\n \"script-src\": (TFetchDirective | typeof STRICT_DYNAMIC | typeof REPORT_SAMPLE | typeof WASM_UNSAFE_EVAL)[];\n \"script-src-attr\": (TAttrDirective | typeof REPORT_SAMPLE)[];\n \"script-src-elem\": (TFetchDirective | typeof STRICT_DYNAMIC | typeof REPORT_SAMPLE)[];\n \"style-src\": TFetchDirective[] | typeof REPORT_SAMPLE;\n \"style-src-attr\": (TAttrDirective | typeof REPORT_SAMPLE)[];\n \"style-src-elem\": (TFetchDirective | typeof REPORT_SAMPLE)[];\n \"upgrade-insecure-requests\": boolean;\n \"worker-src\": TFetchDirective[];\n /**\n * @deprecated\n */\n \"report-uri\": string;\n};\n"]}
1
+ {"version":3,"file":"cspDirectives.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-api/src/types/cspDirectives.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,yFAAyF;AACzF,EAAE;;;AAEW,QAAA,uCAAuC,GAAG,yCAAyC,CAAC;AACpF,QAAA,gBAAgB,GAAG,oBAAoB,CAAC;AACxC,QAAA,WAAW,GAAG,aAAa,CAAC;AAC5B,QAAA,YAAY,GAAG,cAAc,CAAC;AAC9B,QAAA,sBAAsB,GAAG,wBAAwB,CAAC;AAClD,QAAA,kBAAkB,GAAG,oBAAoB,CAAC;AAC1C,QAAA,YAAY,GAAG,cAAc,CAAC;AAC9B,QAAA,8BAA8B,GAAG,gCAAgC,CAAC;AAClE,QAAA,kBAAkB,GAAG,oBAAoB,CAAC;AAC1C,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AACxC,QAAA,uCAAuC,GAAG,yCAAyC,CAAC;AACpF,QAAA,aAAa,GAAG,qBAAqB,CAAC;AACtC,QAAA,oBAAoB,GAAG,sBAAsB,CAAC;AAC9C,QAAA,uCAAuC,GAAG,yCAAyC,CAAC;AA0BpF,QAAA,IAAI,GAAG,QAAQ,CAAC;AAChB,QAAA,IAAI,GAAG,QAAQ,CAAC;AAChB,QAAA,cAAc,GAAG,kBAAkB,CAAC;AACpC,QAAA,aAAa,GAAG,iBAAiB,CAAC;AAClC,QAAA,WAAW,GAAG,eAAe,CAAC;AAC9B,QAAA,aAAa,GAAG,iBAAiB,CAAC;AAClC,QAAA,aAAa,GAAG,iBAAiB,CAAC;AAClC,QAAA,gBAAgB,GAAG,oBAAoB,CAAC","sourcesContent":["//\n// Based on types from https://www.npmjs.com/package/csp-header but adjusted to our needs\n//\n\nexport const ALLOW_DOWNLOADS_WITHOUT_USER_ACTIVATION = \"allow-downloads-without-user-activation\";\nexport const ALLOW_DUPLICATES = \"'allow-duplicates'\";\nexport const ALLOW_FORMS = \"allow-forms\";\nexport const ALLOW_MODALS = \"allow-modals\";\nexport const ALLOW_ORIENTATION_LOCK = \"allow-orientation-lock\";\nexport const ALLOW_POINTER_LOCK = \"allow-pointer-lock\";\nexport const ALLOW_POPUPS = \"allow-popups\";\nexport const ALLOW_POPUPS_TO_ESCAPE_SANDBOX = \"allow-popups-to-escape-sandbox\";\nexport const ALLOW_PRESENTATION = \"allow-presentation\";\nexport const ALLOW_SAME_ORIGIN = \"allow-same-origin\";\nexport const ALLOW_STORAGE_ACCESS_BY_USER_ACTIVATION = \"allow-storage-access-by-user-activation\";\nexport const ALLOW_SCRIPTS = \"allow-allow-scripts\";\nexport const ALLOW_TOP_NAVIGATION = \"allow-top-navigation\";\nexport const ALLOW_TOP_NAVIGATION_BY_USER_ACTIVATION = \"allow-top-navigation-by-user-activation\";\n\ntype TSource = string;\ntype TNonce = `nonce-${string}`;\ntype THash = `sha${\"256\" | \"384\" | \"512\"}-${string}`;\ntype TAttrDirective = THash | typeof NONE | typeof UNSAFE_INLINE | typeof UNSAFE_HASHES;\ntype TFetchDirective =\n | TSource\n | TNonce\n | THash\n | typeof NONE\n | typeof SELF\n | typeof UNSAFE_EVAL\n | typeof UNSAFE_HASHES\n | typeof UNSAFE_INLINE;\ntype TNavigationDirective =\n | TSource\n | TNonce\n | THash\n | typeof NONE\n | typeof SELF\n | typeof UNSAFE_EVAL\n | typeof UNSAFE_HASHES\n | typeof UNSAFE_INLINE\n | typeof STRICT_DYNAMIC;\n\nexport const NONE = \"'none'\";\nexport const SELF = \"'self'\";\nexport const STRICT_DYNAMIC = \"'strict-dynamic'\";\nexport const REPORT_SAMPLE = \"'report-sample'\";\nexport const UNSAFE_EVAL = \"'unsafe-eval'\";\nexport const UNSAFE_HASHES = \"'unsafe-hashes'\";\nexport const UNSAFE_INLINE = \"'unsafe-inline'\";\nexport const WASM_UNSAFE_EVAL = \"'wasm-unsafe-eval'\";\n\nexport type CSPDirectives = {\n \"child-src\": TFetchDirective[];\n \"connect-src\": TFetchDirective[];\n \"default-src\": (TFetchDirective | typeof STRICT_DYNAMIC)[];\n \"font-src\": TFetchDirective[];\n \"form-action\": TNavigationDirective[];\n \"frame-src\": TFetchDirective[];\n \"img-src\": (TFetchDirective | typeof STRICT_DYNAMIC)[];\n \"media-src\": TFetchDirective[];\n sandbox: (\n | typeof ALLOW_DOWNLOADS_WITHOUT_USER_ACTIVATION\n | typeof ALLOW_FORMS\n | typeof ALLOW_MODALS\n | typeof ALLOW_ORIENTATION_LOCK\n | typeof ALLOW_POINTER_LOCK\n | typeof ALLOW_POPUPS\n | typeof ALLOW_POPUPS_TO_ESCAPE_SANDBOX\n | typeof ALLOW_PRESENTATION\n | typeof ALLOW_SAME_ORIGIN\n | typeof ALLOW_SCRIPTS\n | typeof ALLOW_STORAGE_ACCESS_BY_USER_ACTIVATION\n | typeof ALLOW_TOP_NAVIGATION\n | typeof ALLOW_TOP_NAVIGATION_BY_USER_ACTIVATION\n )[];\n \"script-src\": (TFetchDirective | typeof STRICT_DYNAMIC | typeof REPORT_SAMPLE | typeof WASM_UNSAFE_EVAL)[];\n \"script-src-attr\": (TAttrDirective | typeof REPORT_SAMPLE)[];\n \"script-src-elem\": (TFetchDirective | typeof STRICT_DYNAMIC | typeof REPORT_SAMPLE)[];\n \"style-src\": TFetchDirective[] | typeof REPORT_SAMPLE;\n \"style-src-attr\": (TAttrDirective | typeof REPORT_SAMPLE)[];\n \"style-src-elem\": (TFetchDirective | typeof REPORT_SAMPLE)[];\n \"upgrade-insecure-requests\": boolean;\n \"worker-src\": TFetchDirective[];\n};\n"]}
@@ -29,4 +29,7 @@ export declare const irisAppDefaultCsp: {
29
29
  "worker-src": string[];
30
30
  "style-src": string[];
31
31
  "connect-src": string[];
32
+ "manifest-src": string[];
33
+ "object-src": string[];
34
+ "upgrade-insecure-requests": boolean;
32
35
  };
@@ -46,5 +46,8 @@ exports.irisAppDefaultCsp = {
46
46
  "worker-src": [cspDirectives_1.SELF],
47
47
  "style-src": [cspDirectives_1.UNSAFE_INLINE, "https://fonts.googleapis.com"],
48
48
  "connect-src": [cspDirectives_1.SELF, "https://*.sentry.io", "https://sentry.io", ...BrandedUrls],
49
+ "manifest-src": [cspDirectives_1.NONE],
50
+ "object-src": [cspDirectives_1.NONE],
51
+ "upgrade-insecure-requests": true,
49
52
  };
50
53
  //# sourceMappingURL=irisAppCspInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"irisAppCspInput.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-api/src/types/irisAppCspInput.ts"],"names":[],"mappings":";;;AAAA,mDAAqE;AAErE,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;AAkBF;;;;;;GAMG;AACI,MAAM,eAAe,GAAG,CAC7B,YAAuB,EACvB,SAAkC,EACV,EAAE;IAC1B,IAAI,SAAS,EAAE;QACb,OAAO,SAAS,CAAC;KAClB;SAAM,IAAI,YAAY,EAAE;QACvB,OAAO;YACL,aAAa,EAAE,YAAY;YAC3B,YAAY,EAAE,YAAY;YAC1B,SAAS,EAAE,YAAY;YACvB,YAAY,EAAE,YAAY;YAC1B,aAAa,EAAE,YAAY;SAC5B,CAAC;KACH;SAAM;QACL,OAAO,EAAE,CAAC;KACX;AACH,CAAC,CAAC;AAjBW,QAAA,eAAe,mBAiB1B;AAEW,QAAA,iBAAiB,GAAG;IAC/B,aAAa,EAAE,CAAC,oBAAI,CAAC;IACrB,YAAY,EAAE,CAAC,oBAAI,CAAC;IACpB,SAAS,EAAE,CAAC,oBAAI,EAAE,mCAAmC,EAAE,iCAAiC,CAAC;IACzF,YAAY,EAAE,CAAC,oBAAI,CAAC;IACpB,WAAW,EAAE,CAAC,6BAAa,EAAE,8BAA8B,CAAC;IAC5D,aAAa,EAAE,CAAC,oBAAI,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,GAAG,WAAW,CAAC;CAClF,CAAC","sourcesContent":["import { CSPDirectives, SELF, UNSAFE_INLINE } from \"./cspDirectives\";\n\nconst 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 \"img-src\": string[];\n \"connect-src\": string[];\n \"frame-ancestors\"?: 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 legacy validDomains from manifest\n * @param cspHeader input cspHeader from manifest\n * @returns the CSP input for the Iris Apps Csp Header\n */\nexport const irisAppCspInput = (\n validDomains?: string[],\n cspHeader?: Partial<CSPDirectives>\n): Partial<CSPDirectives> => {\n if (cspHeader) {\n return cspHeader;\n } else if (validDomains) {\n return {\n \"default-src\": validDomains,\n \"script-src\": validDomains,\n \"img-src\": validDomains,\n \"worker-src\": validDomains,\n \"connect-src\": validDomains,\n };\n } else {\n return {};\n }\n};\n\nexport const irisAppDefaultCsp = {\n \"default-src\": [SELF],\n \"script-src\": [SELF],\n \"img-src\": [SELF, \"https://images.iris.trackunit.com\", \"https://*.awsapi.trackunit.com/\"],\n \"worker-src\": [SELF],\n \"style-src\": [UNSAFE_INLINE, \"https://fonts.googleapis.com\"],\n \"connect-src\": [SELF, \"https://*.sentry.io\", \"https://sentry.io\", ...BrandedUrls],\n};\n"]}
1
+ {"version":3,"file":"irisAppCspInput.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-api/src/types/irisAppCspInput.ts"],"names":[],"mappings":";;;AAAA,mDAA2E;AAE3E,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;AAkBF;;;;;;GAMG;AACI,MAAM,eAAe,GAAG,CAC7B,YAAuB,EACvB,SAAkC,EACV,EAAE;IAC1B,IAAI,SAAS,EAAE;QACb,OAAO,SAAS,CAAC;KAClB;SAAM,IAAI,YAAY,EAAE;QACvB,OAAO;YACL,aAAa,EAAE,YAAY;YAC3B,YAAY,EAAE,YAAY;YAC1B,SAAS,EAAE,YAAY;YACvB,YAAY,EAAE,YAAY;YAC1B,aAAa,EAAE,YAAY;SAC5B,CAAC;KACH;SAAM;QACL,OAAO,EAAE,CAAC;KACX;AACH,CAAC,CAAC;AAjBW,QAAA,eAAe,mBAiB1B;AAEW,QAAA,iBAAiB,GAAG;IAC/B,aAAa,EAAE,CAAC,oBAAI,CAAC;IACrB,YAAY,EAAE,CAAC,oBAAI,CAAC;IACpB,SAAS,EAAE,CAAC,oBAAI,EAAE,mCAAmC,EAAE,iCAAiC,CAAC;IACzF,YAAY,EAAE,CAAC,oBAAI,CAAC;IACpB,WAAW,EAAE,CAAC,6BAAa,EAAE,8BAA8B,CAAC;IAC5D,aAAa,EAAE,CAAC,oBAAI,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,GAAG,WAAW,CAAC;IACjF,cAAc,EAAE,CAAC,oBAAI,CAAC;IACtB,YAAY,EAAE,CAAC,oBAAI,CAAC;IACpB,2BAA2B,EAAE,IAAI;CAClC,CAAC","sourcesContent":["import { CSPDirectives, NONE, SELF, UNSAFE_INLINE } from \"./cspDirectives\";\n\nconst 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 \"img-src\": string[];\n \"connect-src\": string[];\n \"frame-ancestors\"?: 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 legacy validDomains from manifest\n * @param cspHeader input cspHeader from manifest\n * @returns the CSP input for the Iris Apps Csp Header\n */\nexport const irisAppCspInput = (\n validDomains?: string[],\n cspHeader?: Partial<CSPDirectives>\n): Partial<CSPDirectives> => {\n if (cspHeader) {\n return cspHeader;\n } else if (validDomains) {\n return {\n \"default-src\": validDomains,\n \"script-src\": validDomains,\n \"img-src\": validDomains,\n \"worker-src\": validDomains,\n \"connect-src\": validDomains,\n };\n } else {\n return {};\n }\n};\n\nexport const irisAppDefaultCsp = {\n \"default-src\": [SELF],\n \"script-src\": [SELF],\n \"img-src\": [SELF, \"https://images.iris.trackunit.com\", \"https://*.awsapi.trackunit.com/\"],\n \"worker-src\": [SELF],\n \"style-src\": [UNSAFE_INLINE, \"https://fonts.googleapis.com\"],\n \"connect-src\": [SELF, \"https://*.sentry.io\", \"https://sentry.io\", ...BrandedUrls],\n \"manifest-src\": [NONE],\n \"object-src\": [NONE],\n \"upgrade-insecure-requests\": true,\n};\n"]}
@@ -32,6 +32,28 @@ export interface IrisAppManifest extends Omit<IrisAppManifest_1_0, "specVersion"
32
32
  tokenCallback?: {
33
33
  url: string;
34
34
  };
35
+ /**
36
+ * Configuration of the Content Security Policy (CSP) header for the app.
37
+ *
38
+ * We support a subset of the CSP directives. The supported directives are:
39
+ * - [child-src](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/child-src)
40
+ * - [connect-src](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/connect-src)
41
+ * - [font-src](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/font-src)
42
+ * - [form-action](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/form-action)
43
+ * - [frame-src](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-src)
44
+ * - [img-src](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/img-src)
45
+ * - [media-src](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/media-src)
46
+ * - [script-src](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src)
47
+ * - [script-src-attr](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src-attr)
48
+ * - [script-src-elem](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src-elem)
49
+ * - [style-src](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src)
50
+ * - [style-src-attr](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src-attr)
51
+ * - [style-src-elem](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src-elem)
52
+ * - [worker-src](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/worker-src)
53
+ * - [default-src](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/default-src)
54
+ *
55
+ * More information about CSP can be found [here](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP).
56
+ */
35
57
  cspHeader?: Partial<CSPDirectives>;
36
58
  }
37
59
  export type RequiredOrOptionalScope = {
@@ -1 +1 @@
1
- {"version":3,"file":"irisAppManifest.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-api/src/types/irisAppManifest.ts"],"names":[],"mappings":"","sourcesContent":["import { CSPDirectives } from \"./cspDirectives\";\nimport {\n AdminExtensionManifest,\n AssetEventsActionsExtensionManifest,\n AssetHomeExtensionManifest,\n FleetExtensionManifest,\n IrisAppSettingsExtensionManifest,\n ReportExtensionManifest,\n SiteHomeExtensionManifest,\n} from \"./extensions\";\nimport { WidgetExtensionManifest } from \"./extensions/widgetExtensionManifest\";\nimport {\n BooleanFieldDefinition,\n DateFieldDefinition,\n DecimalNumberFieldDefinition,\n DropDownFieldDefinition,\n EmailFieldDefinition,\n IntegerNumberFieldDefinition,\n JsonFieldDefinition,\n MonetaryFieldDefinition,\n PhoneNumberFieldDefinition,\n StringFieldDefinition,\n WebAddressFieldDefinition,\n} from \"./irisAppCustomFields\";\nimport { InstallationConfig } from \"./irisAppInstallationConfig\";\nimport { Marketplace, Marketplace_1_0 } from \"./irisAppMarketplace\";\nimport { Scope } from \"./scopes\";\n\nexport interface IrisAppManifest\n extends Omit<\n IrisAppManifest_1_0,\n \"specVersion\" | \"activationMode\" | \"marketplace\" | \"validForAccountIds\" | \"consentConfig\"\n > {\n /**\n * A spec version for the manifest.\n * This should not be changed manually.\n */\n specVersion: \"1.1\";\n\n /**\n * Configuration for the installation of the app.\n *\n * Each parameter can be combined to create rules to target specific customers.\n * Each parameter works as a filter to decide if an app is available to a specific customer.\n */\n installation: InstallationConfig;\n\n /**\n * A configuration object for the Marketplace entry\n */\n marketplace: Marketplace;\n\n /**\n * Scopes needed in app tokens, these scopes are used from the token - when contacting Trackunits backend.\n */\n scopes?: RequiredOrOptionalScope | RequiredOrOptionalScope[];\n\n /**\n * Configuration of callback to get credentials to call the API after app installation.\n */\n tokenCallback?: {\n url: string;\n };\n\n cspHeader?: Partial<CSPDirectives>;\n}\n\nexport type RequiredOrOptionalScope = { scope: Scope; optional?: boolean };\n\nexport declare type IrisAppExtension =\n | AssetHomeExtensionManifest\n | IrisAppSettingsExtensionManifest\n | AdminExtensionManifest\n | FleetExtensionManifest\n | SiteHomeExtensionManifest\n | WidgetExtensionManifest\n | ReportExtensionManifest\n | AssetEventsActionsExtensionManifest;\n\nexport declare type CustomFieldDefinition =\n | BooleanFieldDefinition\n | DecimalNumberFieldDefinition\n | IntegerNumberFieldDefinition\n | DateFieldDefinition\n | DropDownFieldDefinition\n | StringFieldDefinition\n | EmailFieldDefinition\n | PhoneNumberFieldDefinition\n | WebAddressFieldDefinition\n | JsonFieldDefinition\n | MonetaryFieldDefinition;\n\n/**\n * @deprecated\n */\nexport interface ConsentConfig {\n /**\n * The application type. Should be one of WEB or BROWSER.\n */\n applicationType: \"WEB\" | \"BROWSER\";\n /**\n * List of scopes required by the application.\n */\n scopes: string[];\n /**\n * List of redirect URIs to be used when returning an authorization code.\n */\n redirectUris?: string[];\n}\n\nexport interface Dependencies {\n [packageName: string]: string;\n}\n\nexport type PublicIrisAppManifest = Omit<IrisAppManifest, \"dependencies\" | \"devDependencies\" | \"installation\"> & {\n /**\n * Relative path for this iris app.\n *\n * @returns {string} the path to the iris app\n */\n irisAppPath: string;\n\n installation: Omit<InstallationConfig, \"accountIds\">;\n};\n\n/**\n * @deprecated\n */\nexport interface IrisAppManifest_1_0 {\n /**\n * A spec version for the manifest.\n * This should not be changed manually.\n */\n specVersion: \"1.0\";\n /**\n * The name of the exposed module from module federation build into the remoteEntry.js.\n * Basically the name of your app including workspace name, automatically parsed from your app-specific package.json.\n */\n moduleFederationName: string;\n\n /**\n * A configuration object for handling scoped token acquisition.\n *\n * @deprecated Use `scopes` instead.\n */\n consentConfig?: ConsentConfig | \"inherit\";\n\n /**\n * Controls the visibility of your app and how it is installed.\n * The different modes are:\n * - Enabled means its enabled on the subscription when this Iris app is approved.\n * - Visible means it will be visible to the customer to choose for them selves to enable/disable it.\n *\n * - FORCE_ENABLE then it can not be removed by the end customer, and will be installed based on the selected subscription package.\n * - DEFAULT_ENABLE means it will be enabled when a customer activates a new subscription package.\n * - ALWAYS_VISIBLE then it will always be visible for all customers.\n * - CONTROLLED_MANUAL_INSTALLATION then it will be controlled by the team that activates the subscription package for the customer, not activating the app.\n * - CONTROLLED_AUTOMATIC_INSTALLATION then it will be controlled by the team that activates the subscription package for the customer, also adding.\n *\n * All modes will take into consideration both {@link IrisAppManifest_1_0.validForAccountIds} and {@link IrisAppManifest_1_0.marketplace}.allowForPackage\n *\n * @deprecated Use `installation.policy` instead.\n */\n activationMode: ActivationMode;\n\n /**\n * A list of any external domains that the app needs to communicate with.\n * The list is audited in the approval step of the app and every external API call\n * must be listed here to get through the verification process.\n * Even if it goes through without being listed, your app will fail to call the endpoint.\n *\n * @deprecated Use `cspHeader` instead\n */\n validDomains?: string[];\n /**\n * Put `ALL_ACCOUNTS` in if your app is available to all users.\n * If you want to only make it available to certain users, provide a list of account ID's as strings.\n */\n validForAccountIds: \"ALL_ACCOUNTS\" | string[];\n /**\n * A configuration object for the Marketplace entry.\n * Holds all the settings associated with your apps listing on the marketplace.\n */\n marketplace: Marketplace_1_0;\n /**\n * A full list of runtime dependencies for the App.\n * Used for performance optimization and security scans.\n * It is automatically parsed from the package.json in root.\n */\n dependencies: Dependencies;\n\n /**\n * A full list of dev dependencies for the App.\n * Used for security scans.\n */\n devDependencies: Dependencies;\n\n /**\n * A list of extensions to the UI that this app manifest exposes.\n * Extensions are automatically added when a new extension is generated.\n * The array contains an import of the extension manifest within the extension.\n * If an extension is required in multiple apps, the you must manually add it to the arrays of those apps.\n */\n extensions: IrisAppExtension[];\n\n /**\n * A list of custom field definitions.\n */\n customFieldDefinitions?: CustomFieldDefinition[];\n}\n\n/**\n * @deprecated\n */\nexport type ActivationMode =\n | \"FORCE_ENABLE\"\n | \"DEFAULT_ENABLE\"\n | \"ALWAYS_VISIBLE\"\n | \"CONTROLLED_MANUAL_INSTALLATION\"\n | \"CONTROLLED_AUTOMATIC_INSTALLATION\";\n"]}
1
+ {"version":3,"file":"irisAppManifest.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-api/src/types/irisAppManifest.ts"],"names":[],"mappings":"","sourcesContent":["import { CSPDirectives } from \"./cspDirectives\";\nimport {\n AdminExtensionManifest,\n AssetEventsActionsExtensionManifest,\n AssetHomeExtensionManifest,\n FleetExtensionManifest,\n IrisAppSettingsExtensionManifest,\n ReportExtensionManifest,\n SiteHomeExtensionManifest,\n} from \"./extensions\";\nimport { WidgetExtensionManifest } from \"./extensions/widgetExtensionManifest\";\nimport {\n BooleanFieldDefinition,\n DateFieldDefinition,\n DecimalNumberFieldDefinition,\n DropDownFieldDefinition,\n EmailFieldDefinition,\n IntegerNumberFieldDefinition,\n JsonFieldDefinition,\n MonetaryFieldDefinition,\n PhoneNumberFieldDefinition,\n StringFieldDefinition,\n WebAddressFieldDefinition,\n} from \"./irisAppCustomFields\";\nimport { InstallationConfig } from \"./irisAppInstallationConfig\";\nimport { Marketplace, Marketplace_1_0 } from \"./irisAppMarketplace\";\nimport { Scope } from \"./scopes\";\n\nexport interface IrisAppManifest\n extends Omit<\n IrisAppManifest_1_0,\n \"specVersion\" | \"activationMode\" | \"marketplace\" | \"validForAccountIds\" | \"consentConfig\"\n > {\n /**\n * A spec version for the manifest.\n * This should not be changed manually.\n */\n specVersion: \"1.1\";\n\n /**\n * Configuration for the installation of the app.\n *\n * Each parameter can be combined to create rules to target specific customers.\n * Each parameter works as a filter to decide if an app is available to a specific customer.\n */\n installation: InstallationConfig;\n\n /**\n * A configuration object for the Marketplace entry\n */\n marketplace: Marketplace;\n\n /**\n * Scopes needed in app tokens, these scopes are used from the token - when contacting Trackunits backend.\n */\n scopes?: RequiredOrOptionalScope | RequiredOrOptionalScope[];\n\n /**\n * Configuration of callback to get credentials to call the API after app installation.\n */\n tokenCallback?: {\n url: string;\n };\n\n /**\n * Configuration of the Content Security Policy (CSP) header for the app.\n *\n * We support a subset of the CSP directives. The supported directives are:\n * - [child-src](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/child-src)\n * - [connect-src](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/connect-src)\n * - [font-src](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/font-src)\n * - [form-action](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/form-action)\n * - [frame-src](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-src)\n * - [img-src](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/img-src)\n * - [media-src](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/media-src)\n * - [script-src](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src)\n * - [script-src-attr](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src-attr)\n * - [script-src-elem](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src-elem)\n * - [style-src](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src)\n * - [style-src-attr](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src-attr)\n * - [style-src-elem](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src-elem)\n * - [worker-src](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/worker-src)\n * - [default-src](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/default-src)\n *\n * More information about CSP can be found [here](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP).\n */\n cspHeader?: Partial<CSPDirectives>;\n}\n\nexport type RequiredOrOptionalScope = { scope: Scope; optional?: boolean };\n\nexport declare type IrisAppExtension =\n | AssetHomeExtensionManifest\n | IrisAppSettingsExtensionManifest\n | AdminExtensionManifest\n | FleetExtensionManifest\n | SiteHomeExtensionManifest\n | WidgetExtensionManifest\n | ReportExtensionManifest\n | AssetEventsActionsExtensionManifest;\n\nexport declare type CustomFieldDefinition =\n | BooleanFieldDefinition\n | DecimalNumberFieldDefinition\n | IntegerNumberFieldDefinition\n | DateFieldDefinition\n | DropDownFieldDefinition\n | StringFieldDefinition\n | EmailFieldDefinition\n | PhoneNumberFieldDefinition\n | WebAddressFieldDefinition\n | JsonFieldDefinition\n | MonetaryFieldDefinition;\n\n/**\n * @deprecated\n */\nexport interface ConsentConfig {\n /**\n * The application type. Should be one of WEB or BROWSER.\n */\n applicationType: \"WEB\" | \"BROWSER\";\n /**\n * List of scopes required by the application.\n */\n scopes: string[];\n /**\n * List of redirect URIs to be used when returning an authorization code.\n */\n redirectUris?: string[];\n}\n\nexport interface Dependencies {\n [packageName: string]: string;\n}\n\nexport type PublicIrisAppManifest = Omit<IrisAppManifest, \"dependencies\" | \"devDependencies\" | \"installation\"> & {\n /**\n * Relative path for this iris app.\n *\n * @returns {string} the path to the iris app\n */\n irisAppPath: string;\n\n installation: Omit<InstallationConfig, \"accountIds\">;\n};\n\n/**\n * @deprecated\n */\nexport interface IrisAppManifest_1_0 {\n /**\n * A spec version for the manifest.\n * This should not be changed manually.\n */\n specVersion: \"1.0\";\n /**\n * The name of the exposed module from module federation build into the remoteEntry.js.\n * Basically the name of your app including workspace name, automatically parsed from your app-specific package.json.\n */\n moduleFederationName: string;\n\n /**\n * A configuration object for handling scoped token acquisition.\n *\n * @deprecated Use `scopes` instead.\n */\n consentConfig?: ConsentConfig | \"inherit\";\n\n /**\n * Controls the visibility of your app and how it is installed.\n * The different modes are:\n * - Enabled means its enabled on the subscription when this Iris app is approved.\n * - Visible means it will be visible to the customer to choose for them selves to enable/disable it.\n *\n * - FORCE_ENABLE then it can not be removed by the end customer, and will be installed based on the selected subscription package.\n * - DEFAULT_ENABLE means it will be enabled when a customer activates a new subscription package.\n * - ALWAYS_VISIBLE then it will always be visible for all customers.\n * - CONTROLLED_MANUAL_INSTALLATION then it will be controlled by the team that activates the subscription package for the customer, not activating the app.\n * - CONTROLLED_AUTOMATIC_INSTALLATION then it will be controlled by the team that activates the subscription package for the customer, also adding.\n *\n * All modes will take into consideration both {@link IrisAppManifest_1_0.validForAccountIds} and {@link IrisAppManifest_1_0.marketplace}.allowForPackage\n *\n * @deprecated Use `installation.policy` instead.\n */\n activationMode: ActivationMode;\n\n /**\n * A list of any external domains that the app needs to communicate with.\n * The list is audited in the approval step of the app and every external API call\n * must be listed here to get through the verification process.\n * Even if it goes through without being listed, your app will fail to call the endpoint.\n *\n * @deprecated Use `cspHeader` instead\n */\n validDomains?: string[];\n /**\n * Put `ALL_ACCOUNTS` in if your app is available to all users.\n * If you want to only make it available to certain users, provide a list of account ID's as strings.\n */\n validForAccountIds: \"ALL_ACCOUNTS\" | string[];\n /**\n * A configuration object for the Marketplace entry.\n * Holds all the settings associated with your apps listing on the marketplace.\n */\n marketplace: Marketplace_1_0;\n /**\n * A full list of runtime dependencies for the App.\n * Used for performance optimization and security scans.\n * It is automatically parsed from the package.json in root.\n */\n dependencies: Dependencies;\n\n /**\n * A full list of dev dependencies for the App.\n * Used for security scans.\n */\n devDependencies: Dependencies;\n\n /**\n * A list of extensions to the UI that this app manifest exposes.\n * Extensions are automatically added when a new extension is generated.\n * The array contains an import of the extension manifest within the extension.\n * If an extension is required in multiple apps, the you must manually add it to the arrays of those apps.\n */\n extensions: IrisAppExtension[];\n\n /**\n * A list of custom field definitions.\n */\n customFieldDefinitions?: CustomFieldDefinition[];\n}\n\n/**\n * @deprecated\n */\nexport type ActivationMode =\n | \"FORCE_ENABLE\"\n | \"DEFAULT_ENABLE\"\n | \"ALWAYS_VISIBLE\"\n | \"CONTROLLED_MANUAL_INSTALLATION\"\n | \"CONTROLLED_AUTOMATIC_INSTALLATION\";\n"]}