@trackunit/iris-app-api 0.0.82 → 0.0.85
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 +6 -0
- package/package.json +1 -1
- package/src/types/irisAppCspInput.d.ts +3 -1
- package/src/types/irisAppCspInput.js +11 -2
- package/src/types/irisAppCspInput.js.map +1 -1
- package/src/types/irisAppManifest.d.ts +2 -1
- package/src/types/irisAppManifest.js +1 -0
- package/src/types/irisAppManifest.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.0.85](https://github.com/Trackunit/manager/compare/iris-app-api/0.0.84...iris-app-api/0.0.85) (2023-04-12)
|
|
6
|
+
|
|
7
|
+
## [0.0.84](https://github.com/Trackunit/manager/compare/iris-app-api/0.0.83...iris-app-api/0.0.84) (2023-04-11)
|
|
8
|
+
|
|
9
|
+
## [0.0.83](https://github.com/Trackunit/manager/compare/iris-app-api/0.0.82...iris-app-api/0.0.83) (2023-04-11)
|
|
10
|
+
|
|
5
11
|
## [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
12
|
|
|
7
13
|
## [0.0.81](https://github.com/Trackunit/manager/compare/iris-app-api/0.0.80...iris-app-api/0.0.81) (2023-03-30)
|
package/package.json
CHANGED
|
@@ -15,6 +15,8 @@ export type CspDirectives = {
|
|
|
15
15
|
* This function is used to generate the CSP input for the Iris Apps Csp Header
|
|
16
16
|
*
|
|
17
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
|
|
18
20
|
* @returns { CspDirectives } the CSP input for the Iris Apps Csp Header
|
|
19
21
|
*/
|
|
20
|
-
export declare const irisAppCspInput: (validDomains: string[]) => CspDirectives;
|
|
22
|
+
export declare const irisAppCspInput: (validDomains: string[], frameAncestors?: string[], extraScriptSrc?: string) => CspDirectives;
|
|
@@ -17,10 +17,12 @@ const BrandedUrls = [
|
|
|
17
17
|
* This function is used to generate the CSP input for the Iris Apps Csp Header
|
|
18
18
|
*
|
|
19
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
|
|
20
22
|
* @returns { CspDirectives } the CSP input for the Iris Apps Csp Header
|
|
21
23
|
*/
|
|
22
|
-
const irisAppCspInput = (validDomains) => {
|
|
23
|
-
|
|
24
|
+
const irisAppCspInput = (validDomains, frameAncestors, extraScriptSrc) => {
|
|
25
|
+
const cspInput = {
|
|
24
26
|
directives: {
|
|
25
27
|
"default-src": ["'self'", ...validDomains],
|
|
26
28
|
"script-src": ["'self'", ...validDomains],
|
|
@@ -37,6 +39,13 @@ const irisAppCspInput = (validDomains) => {
|
|
|
37
39
|
},
|
|
38
40
|
reportUri: "https://o343335.ingest.sentry.io/api/1888181/security/?sentry_key=62900a1fa49748d8ba12f4ffbdbd8e07",
|
|
39
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;
|
|
40
49
|
};
|
|
41
50
|
exports.irisAppCspInput = irisAppCspInput;
|
|
42
51
|
//# 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,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
|
|
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"]}
|
|
@@ -202,7 +202,8 @@ export declare enum UnitSi {
|
|
|
202
202
|
"km_2" = "km\u00B2",
|
|
203
203
|
"m_2" = "m\u00B2",
|
|
204
204
|
"m_3" = "m\u00B3",
|
|
205
|
-
"m_s_2" = "m/s\u00B2"
|
|
205
|
+
"m_s_2" = "m/s\u00B2",
|
|
206
|
+
"h" = "h"
|
|
206
207
|
}
|
|
207
208
|
export interface DecimalNumberFieldDefinition extends AbstractCustomFieldDefinition {
|
|
208
209
|
type: "NUMBER";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"irisAppManifest.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-api/src/types/irisAppManifest.ts"],"names":[],"mappings":";;;AA+Fa,QAAA,YAAY,GAAG;IAC1B,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACI,CAAC;AA+GX,IAAY,MAgBX;AAhBD,WAAY,MAAM;IAChB,mBAAW,CAAA;IACX,mBAAW,CAAA;IACX,mBAAW,CAAA;IACX,mBAAW,CAAA;IACX,mBAAW,CAAA;IACX,mBAAW,CAAA;IACX,2BAAc,CAAA;IACd,qBAAa,CAAA;IACb,2BAAc,CAAA;IACd,2BAAmB,CAAA;IACnB,mBAAW,CAAA;IACX,mBAAW,CAAA;IACX,qBAAa,CAAA;IACb,uBAAe,CAAA;IACf,uBAAe,CAAA;AACjB,CAAC,EAhBW,MAAM,GAAN,cAAM,KAAN,cAAM,QAgBjB;AAED,IAAY,MAwBX;AAxBD,WAAY,MAAM;IAChB,mBAAW,CAAA;IACX,iBAAS,CAAA;IACT,mBAAW,CAAA;IACX,mBAAW,CAAA;IACX,iBAAS,CAAA;IACT,mBAAW,CAAA;IACX,iBAAS,CAAA;IACT,qBAAa,CAAA;IACb,iBAAS,CAAA;IACT,mBAAW,CAAA;IACX,iBAAS,CAAA;IACT,qBAAa,CAAA;IACb,qBAAa,CAAA;IACb,mBAAW,CAAA;IACX,qBAAa,CAAA;IACb,qBAAa,CAAA;IACb,uBAAe,CAAA;IACf,uBAAe,CAAA;IACf,uBAAe,CAAA;IACf,2BAAc,CAAA;IACd,yBAAY,CAAA;IACZ,yBAAY,CAAA;IACZ,6BAAgB,CAAA;AAClB,CAAC,EAxBW,MAAM,GAAN,cAAM,KAAN,cAAM,QAwBjB","sourcesContent":["export interface IrisAppManifest {\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 */\n moduleFederationName: string;\n /**\n * A configuration object for handling scoped token acquisition.\n */\n consentConfig?: ConsentConfig | \"inherit\";\n\n /**\n * Activation mode means:\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 validForAccountIds and marketplace.allowForPackage\n */\n activationMode: ActivationMode;\n\n /**\n * A list of any external domains that the Tile needs to communicate with.\n */\n validDomains: string[];\n /**\n * A list of any account ids that can enable this Tile, or empty array if available for all customers.\n */\n validForAccountIds: \"ALL_ACCOUNTS\" | string[];\n /**\n * A configuration object for the Marketplace entry\n */\n marketplace: Marketplace;\n /**\n * A full list of runtime dependencies for the Tile.\n * Used for performance optimization and security scans.\n */\n dependencies: Dependencies;\n\n /**\n * A full list of dev dependencies for the Tile.\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 */\n extensions: IrisAppExtension[];\n\n /**\n * A list of custom field definitions.\n */\n customFieldDefinitions?: CustomFieldDefinition[];\n}\n\nexport type PublicIrisAppManifest = Omit<IrisAppManifest, \"dependencies\" | \"devDependencies\" | \"validForAccountIds\">;\n\nexport type ActivationMode =\n | \"FORCE_ENABLE\"\n | \"DEFAULT_ENABLE\"\n | \"ALWAYS_VISIBLE\"\n | \"CONTROLLED_MANUAL_INSTALLATION\"\n | \"CONTROLLED_AUTOMATIC_INSTALLATION\";\n\nexport interface Translations {\n en: string;\n da?: string;\n de?: string;\n cs?: string;\n nl?: string;\n fr?: string;\n fi?: string;\n hu?: string;\n it?: string;\n nb?: string;\n pl?: string;\n pt?: string;\n ru?: string;\n ro?: string;\n es?: string;\n sv?: string;\n ja?: string;\n th?: string;\n}\n\nexport const languageKeys = [\n \"en\",\n \"da\",\n \"de\",\n \"cs\",\n \"nl\",\n \"fr\",\n \"fi\",\n \"hu\",\n \"it\",\n \"nb\",\n \"pl\",\n \"pt\",\n \"ru\",\n \"ro\",\n \"es\",\n \"sv\",\n \"ja\",\n \"th\",\n] as const;\n\nexport type TranslationLanguageKeys = typeof languageKeys[number];\n\nexport interface TranslationKey {\n key: string;\n}\nexport interface AbstractExtensionManifest {\n /** The id of the app extension, will be part of the URL in the manager */\n id: string;\n\n /**\n * The path to the main entry point for the extension.\n *\n * @default \"index.tsx\"\n */\n main?: string;\n\n /**\n * The relative path from the NX workspace to this projects source Root.\n */\n sourceRoot: string;\n\n /** The type of the app extension */\n type: IrisAppExtensionType;\n}\n\nexport declare type CustomFieldDefinitionType =\n | \"STRING\"\n | \"NUMBER\"\n | \"DATE\"\n | \"BOOLEAN\"\n | \"DROPDOWN\"\n | \"EMAIL\"\n | \"PHONE_NUMBER\"\n | \"WEB_ADDRESS\";\n\nexport declare type EntityType = \"ASSET\" | \"ACCOUNT\";\n\nexport interface AbstractCustomFieldDefinition {\n /**\n * The key is the name you use to get the custom field.\n */\n key: string;\n\n /**\n * The type of the entity to attach this custom field on.\n */\n entityType: EntityType;\n\n /**\n * The human readable translation of the key. So what the end customer will see.\n */\n title: string;\n\n /**\n * Should this be visible in the generic UI in Manager.\n */\n uiVisible: boolean;\n\n /**\n * Should this be editable in the generic UI in Manager. This does not mean you cannot change it inside a app.\n */\n uiEditable: boolean;\n\n /**\n * The type of this custom field definition\n */\n type: CustomFieldDefinitionType;\n}\n\nexport interface StringFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"STRING\";\n minimumLength?: number;\n maximumLength?: number;\n pattern?: string;\n defaultStringValue?: string;\n}\n\nexport interface EmailFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"EMAIL\";\n defaultStringValue?: string;\n}\n\nexport interface WebAddressFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"WEB_ADDRESS\";\n defaultStringValue?: string;\n}\n\nexport interface PhoneNumberFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"PHONE_NUMBER\";\n defaultStringValue?: string;\n}\nexport interface BooleanFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"BOOLEAN\";\n defaultBooleanValue?: boolean;\n}\n\nexport interface DateFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"DATE\";\n defaultDateValue?: string;\n}\n\nexport interface DropDownFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"DROPDOWN\";\n defaultStringArrayValue?: string[];\n multiSelect?: boolean;\n allValues?: string[];\n dropDownValueReplacements: Record<string, string>;\n}\n\nexport enum UnitUs {\n \"mi\" = \"mi\",\n \"yd\" = \"yd\",\n \"ft\" = \"ft\",\n \"in\" = \"in\",\n \"ac\" = \"ac\",\n \"ha\" = \"ha\",\n \"ft_2\" = \"ft²\",\n \"gal\" = \"gal\",\n \"ft_3\" = \"ft³\",\n \"ton_us\" = \"ton_us\",\n \"lb\" = \"lb\",\n \"oz\" = \"oz\",\n \"mph\" = \"mph\",\n \"lb_h\" = \"lb/h\",\n \"lb_s\" = \"lb/s\",\n}\n\nexport enum UnitSi {\n \"km\" = \"km\",\n \"m\" = \"m\",\n \"cm\" = \"cm\",\n \"mm\" = \"mm\",\n \"l\" = \"l\",\n \"kg\" = \"kg\",\n \"g\" = \"g\",\n \"ton\" = \"ton\",\n \"N\" = \"N\",\n \"kW\" = \"kW\",\n \"W\" = \"W\",\n \"kWh\" = \"kWh\",\n \"kPa\" = \"kPa\",\n \"Pa\" = \"Pa\",\n \"bar\" = \"bar\",\n \"m_s\" = \"m/s\",\n \"kg_h\" = \"kg/h\",\n \"kg_s\" = \"kg/s\",\n \"km_h\" = \"km/h\",\n \"km_2\" = \"km²\",\n \"m_2\" = \"m²\",\n \"m_3\" = \"m³\",\n \"m_s_2\" = \"m/s²\",\n}\nexport interface DecimalNumberFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"NUMBER\";\n defaultNumberValue?: number;\n\n minimum?: number;\n maximum?: number;\n\n unitSi?: UnitSi;\n unitUs?: UnitUs;\n\n isInteger: false;\n}\n\nexport interface IntegerNumberFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"NUMBER\";\n defaultNumberValue?: number;\n\n minimum?: number;\n maximum?: number;\n\n isInteger: true;\n\n unitSi: never;\n unitUs: never;\n}\n\nexport declare type CustomFieldDefinition =\n | BooleanFieldDefinition\n | DecimalNumberFieldDefinition\n | IntegerNumberFieldDefinition\n | DateFieldDefinition\n | DropDownFieldDefinition\n | StringFieldDefinition\n | EmailFieldDefinition\n | PhoneNumberFieldDefinition\n | WebAddressFieldDefinition;\n\nexport interface AssetHomeExtensionManifest extends AbstractExtensionManifest {\n type: \"ASSET_HOME_EXTENSION\";\n /**\n * Conditions for the asset home app to be shown.\n * It is case insensitive so does not matter how you write the brand.\n * brand: \"trackunit\" and brand: \"Trackunit\" will be the same.\n *\n * If both model and brand are used/filled out then asset needs to match both model and brand.\n * If only brand or model is used/filled out then the asset needs to match the filled out property.\n */\n conditions?: {\n model?: string[] | string;\n brand?: string[] | string;\n };\n menuItem: {\n name: string | Translations | TranslationKey;\n };\n}\n\nexport interface SiteHomeExtensionManifest extends AbstractExtensionManifest {\n type: \"SITE_HOME_EXTENSION\";\n\n menuItem: {\n name: string | Translations | TranslationKey;\n };\n}\nexport interface FleetExtensionManifest extends AbstractExtensionManifest {\n type: \"FLEET_EXTENSION\";\n\n /**\n * Conditions for the asset home app to be shown.\n * It is case insensitive so does not matter how you write the brand.\n * brand: \"trackunit\" and brand: \"Trackunit\" will be the same.\n *\n * If both model and brand are used/filled out then asset needs to match both model and brand.\n * If only brand or model is used/filled out then the asset needs to match the filled out property.\n */\n conditions?: {\n model?: string[] | string;\n brand?: string[] | string;\n };\n menuItem: {\n name: string | Translations | TranslationKey;\n icon: string;\n };\n}\n\nexport interface AdminExtensionManifest extends AbstractExtensionManifest {\n type: \"ADMIN_EXTENSION\";\n\n menuItem: {\n name: string | Translations | TranslationKey;\n };\n}\n\nexport interface IrisAppSettingsExtensionManifest extends AbstractExtensionManifest {\n type: \"IRIS_APP_SETTINGS_EXTENSION\";\n}\n\nexport interface ReportExtensionManifest extends AbstractExtensionManifest {\n type: \"REPORT_EXTENSION\";\n\n menuItem: {\n /**\n * Title of the card in manager\n */\n name: string | Translations | TranslationKey;\n\n /**\n * Subtitle of the card in manager\n */\n description: string | Translations | TranslationKey;\n\n /**\n * Icon of the card in manager, must use icons from:\n * https://apps.dev.iris.trackunit.com/storybook/?path=/docs/components-icon--default\n */\n icon: string;\n };\n}\nexport declare type IrisAppExtension =\n | AssetHomeExtensionManifest\n | IrisAppSettingsExtensionManifest\n | AdminExtensionManifest\n | FleetExtensionManifest\n | SiteHomeExtensionManifest\n | ReportExtensionManifest;\nexport interface ConsentConfig {\n /**\n * The application type. Should be one of WEB or BROWSER.\n */\n applicationType: string;\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\n/**\n * An image that should be shown in the marketplace for this app.\n */\nexport interface MarketplaceAssetImage {\n /**\n * The type of the Asset\n */\n type: \"IMAGE\";\n /**\n * A Path to an image in the assets folder of the app.\n * Example: typing \"MyImage.png\" here, will show the file \"apps/my-app/assets/MyImage.png\"\n */\n path: string;\n}\n\n/**\n * A video that should be shown in the marketplace for this app.\n */\nexport interface MarketplaceAssetVideo {\n /**\n * The type of the Asset\n */\n type: \"VIDEO\";\n /**\n * An url for a youtube video.\n */\n url: string;\n}\n\n/**\n * A video or image that should be shown in the marketplace for this app.\n */\nexport type MarketplaceAsset = MarketplaceAssetImage | MarketplaceAssetVideo;\n\n/**\n * An object of data used when the app is displayed in the marketplace\n */\nexport interface Marketplace {\n /**\n * Name used for the marketplace.\n */\n name: string;\n\n /**\n * A short summary used for the card on marketplace.\n * For longer description add a description.md file in the /assets/ folder of the app, and set the fullDescriptionPath.\n */\n description: string;\n\n /**\n * The path to the markdown file for the description.\n */\n fullDescriptionPath: string;\n\n /**\n * Path to an image in the assets folder of the app.\n * The image will be shown in the marketplace.\n * Example: typing \"MyImage.png\" here, will show the file \"apps/my-app/assets/MyImage.png\"\n */\n logoPath?: string;\n /**\n * Tags used for describing the marketplace.\n */\n tags?: string[];\n /**\n * Categories used for the app in the marketplace.\n */\n categories?: Category[];\n /**\n * Assets (images and videos) used for the marketplace.\n */\n assets?: MarketplaceAsset[];\n /**\n * Defines what subscription packages the Tile is available at.\n */\n allowForPackage: \"ALL_PACKAGES\" | SubscriptionPackage[];\n /**\n * Homepage of the company building the app for the marketplace.\n */\n homePageUrl?: string;\n /**\n * The direct support page for this app.\n */\n supportUrl?: string;\n}\n\nexport declare type Category =\n | \"ANALYTICS\"\n | \"DATA_FEEDS\"\n | \"ENGINES_AND_HYDRAULICS\"\n | \"SERVICE_AND_MAINTENANCE\"\n | \"CONSULTANTS\"\n | \"CONNECTIVITY_AND_NETWORK\"\n | \"REPORTS\"\n | \"FAULT_CODES_AND_REMOTE_DIAGNOSTICS\"\n | \"SAFETY_AND_QUALITY\";\n\nexport declare type SubscriptionPackage =\n | \"VIEW\"\n | \"COLLECT\"\n | \"INSIGHT\"\n | \"EXPLORE_FLEET_OWNER\"\n | \"EVOLVE_FLEET_OWNER\"\n | \"EXPAND_FLEET_OWNER\"\n | \"EXPLORE_OEM\"\n | \"EVOLVE_OEM\"\n | \"EXPAND_OEM\";\n\nexport declare type IrisAppExtensionType =\n | \"REPORT_EXTENSION\"\n | \"IRIS_APP_SETTINGS_EXTENSION\"\n | \"ADMIN_EXTENSION\"\n | \"FLEET_EXTENSION\"\n | \"ASSET_HOME_EXTENSION\"\n | \"SITE_HOME_EXTENSION\";\ninterface Dependencies {\n [packageName: string]: string;\n}\nexport {};\n"]}
|
|
1
|
+
{"version":3,"file":"irisAppManifest.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-api/src/types/irisAppManifest.ts"],"names":[],"mappings":";;;AA+Fa,QAAA,YAAY,GAAG;IAC1B,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACI,CAAC;AA+GX,IAAY,MAgBX;AAhBD,WAAY,MAAM;IAChB,mBAAW,CAAA;IACX,mBAAW,CAAA;IACX,mBAAW,CAAA;IACX,mBAAW,CAAA;IACX,mBAAW,CAAA;IACX,mBAAW,CAAA;IACX,2BAAc,CAAA;IACd,qBAAa,CAAA;IACb,2BAAc,CAAA;IACd,2BAAmB,CAAA;IACnB,mBAAW,CAAA;IACX,mBAAW,CAAA;IACX,qBAAa,CAAA;IACb,uBAAe,CAAA;IACf,uBAAe,CAAA;AACjB,CAAC,EAhBW,MAAM,GAAN,cAAM,KAAN,cAAM,QAgBjB;AAED,IAAY,MAyBX;AAzBD,WAAY,MAAM;IAChB,mBAAW,CAAA;IACX,iBAAS,CAAA;IACT,mBAAW,CAAA;IACX,mBAAW,CAAA;IACX,iBAAS,CAAA;IACT,mBAAW,CAAA;IACX,iBAAS,CAAA;IACT,qBAAa,CAAA;IACb,iBAAS,CAAA;IACT,mBAAW,CAAA;IACX,iBAAS,CAAA;IACT,qBAAa,CAAA;IACb,qBAAa,CAAA;IACb,mBAAW,CAAA;IACX,qBAAa,CAAA;IACb,qBAAa,CAAA;IACb,uBAAe,CAAA;IACf,uBAAe,CAAA;IACf,uBAAe,CAAA;IACf,2BAAc,CAAA;IACd,yBAAY,CAAA;IACZ,yBAAY,CAAA;IACZ,6BAAgB,CAAA;IAChB,iBAAS,CAAA;AACX,CAAC,EAzBW,MAAM,GAAN,cAAM,KAAN,cAAM,QAyBjB","sourcesContent":["export interface IrisAppManifest {\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 */\n moduleFederationName: string;\n /**\n * A configuration object for handling scoped token acquisition.\n */\n consentConfig?: ConsentConfig | \"inherit\";\n\n /**\n * Activation mode means:\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 validForAccountIds and marketplace.allowForPackage\n */\n activationMode: ActivationMode;\n\n /**\n * A list of any external domains that the Tile needs to communicate with.\n */\n validDomains: string[];\n /**\n * A list of any account ids that can enable this Tile, or empty array if available for all customers.\n */\n validForAccountIds: \"ALL_ACCOUNTS\" | string[];\n /**\n * A configuration object for the Marketplace entry\n */\n marketplace: Marketplace;\n /**\n * A full list of runtime dependencies for the Tile.\n * Used for performance optimization and security scans.\n */\n dependencies: Dependencies;\n\n /**\n * A full list of dev dependencies for the Tile.\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 */\n extensions: IrisAppExtension[];\n\n /**\n * A list of custom field definitions.\n */\n customFieldDefinitions?: CustomFieldDefinition[];\n}\n\nexport type PublicIrisAppManifest = Omit<IrisAppManifest, \"dependencies\" | \"devDependencies\" | \"validForAccountIds\">;\n\nexport type ActivationMode =\n | \"FORCE_ENABLE\"\n | \"DEFAULT_ENABLE\"\n | \"ALWAYS_VISIBLE\"\n | \"CONTROLLED_MANUAL_INSTALLATION\"\n | \"CONTROLLED_AUTOMATIC_INSTALLATION\";\n\nexport interface Translations {\n en: string;\n da?: string;\n de?: string;\n cs?: string;\n nl?: string;\n fr?: string;\n fi?: string;\n hu?: string;\n it?: string;\n nb?: string;\n pl?: string;\n pt?: string;\n ru?: string;\n ro?: string;\n es?: string;\n sv?: string;\n ja?: string;\n th?: string;\n}\n\nexport const languageKeys = [\n \"en\",\n \"da\",\n \"de\",\n \"cs\",\n \"nl\",\n \"fr\",\n \"fi\",\n \"hu\",\n \"it\",\n \"nb\",\n \"pl\",\n \"pt\",\n \"ru\",\n \"ro\",\n \"es\",\n \"sv\",\n \"ja\",\n \"th\",\n] as const;\n\nexport type TranslationLanguageKeys = typeof languageKeys[number];\n\nexport interface TranslationKey {\n key: string;\n}\nexport interface AbstractExtensionManifest {\n /** The id of the app extension, will be part of the URL in the manager */\n id: string;\n\n /**\n * The path to the main entry point for the extension.\n *\n * @default \"index.tsx\"\n */\n main?: string;\n\n /**\n * The relative path from the NX workspace to this projects source Root.\n */\n sourceRoot: string;\n\n /** The type of the app extension */\n type: IrisAppExtensionType;\n}\n\nexport declare type CustomFieldDefinitionType =\n | \"STRING\"\n | \"NUMBER\"\n | \"DATE\"\n | \"BOOLEAN\"\n | \"DROPDOWN\"\n | \"EMAIL\"\n | \"PHONE_NUMBER\"\n | \"WEB_ADDRESS\";\n\nexport declare type EntityType = \"ASSET\" | \"ACCOUNT\";\n\nexport interface AbstractCustomFieldDefinition {\n /**\n * The key is the name you use to get the custom field.\n */\n key: string;\n\n /**\n * The type of the entity to attach this custom field on.\n */\n entityType: EntityType;\n\n /**\n * The human readable translation of the key. So what the end customer will see.\n */\n title: string;\n\n /**\n * Should this be visible in the generic UI in Manager.\n */\n uiVisible: boolean;\n\n /**\n * Should this be editable in the generic UI in Manager. This does not mean you cannot change it inside a app.\n */\n uiEditable: boolean;\n\n /**\n * The type of this custom field definition\n */\n type: CustomFieldDefinitionType;\n}\n\nexport interface StringFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"STRING\";\n minimumLength?: number;\n maximumLength?: number;\n pattern?: string;\n defaultStringValue?: string;\n}\n\nexport interface EmailFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"EMAIL\";\n defaultStringValue?: string;\n}\n\nexport interface WebAddressFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"WEB_ADDRESS\";\n defaultStringValue?: string;\n}\n\nexport interface PhoneNumberFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"PHONE_NUMBER\";\n defaultStringValue?: string;\n}\nexport interface BooleanFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"BOOLEAN\";\n defaultBooleanValue?: boolean;\n}\n\nexport interface DateFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"DATE\";\n defaultDateValue?: string;\n}\n\nexport interface DropDownFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"DROPDOWN\";\n defaultStringArrayValue?: string[];\n multiSelect?: boolean;\n allValues?: string[];\n dropDownValueReplacements: Record<string, string>;\n}\n\nexport enum UnitUs {\n \"mi\" = \"mi\",\n \"yd\" = \"yd\",\n \"ft\" = \"ft\",\n \"in\" = \"in\",\n \"ac\" = \"ac\",\n \"ha\" = \"ha\",\n \"ft_2\" = \"ft²\",\n \"gal\" = \"gal\",\n \"ft_3\" = \"ft³\",\n \"ton_us\" = \"ton_us\",\n \"lb\" = \"lb\",\n \"oz\" = \"oz\",\n \"mph\" = \"mph\",\n \"lb_h\" = \"lb/h\",\n \"lb_s\" = \"lb/s\",\n}\n\nexport enum UnitSi {\n \"km\" = \"km\",\n \"m\" = \"m\",\n \"cm\" = \"cm\",\n \"mm\" = \"mm\",\n \"l\" = \"l\",\n \"kg\" = \"kg\",\n \"g\" = \"g\",\n \"ton\" = \"ton\",\n \"N\" = \"N\",\n \"kW\" = \"kW\",\n \"W\" = \"W\",\n \"kWh\" = \"kWh\",\n \"kPa\" = \"kPa\",\n \"Pa\" = \"Pa\",\n \"bar\" = \"bar\",\n \"m_s\" = \"m/s\",\n \"kg_h\" = \"kg/h\",\n \"kg_s\" = \"kg/s\",\n \"km_h\" = \"km/h\",\n \"km_2\" = \"km²\",\n \"m_2\" = \"m²\",\n \"m_3\" = \"m³\",\n \"m_s_2\" = \"m/s²\",\n \"h\" = \"h\",\n}\nexport interface DecimalNumberFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"NUMBER\";\n defaultNumberValue?: number;\n\n minimum?: number;\n maximum?: number;\n\n unitSi?: UnitSi;\n unitUs?: UnitUs;\n\n isInteger: false;\n}\n\nexport interface IntegerNumberFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"NUMBER\";\n defaultNumberValue?: number;\n\n minimum?: number;\n maximum?: number;\n\n isInteger: true;\n\n unitSi: never;\n unitUs: never;\n}\n\nexport declare type CustomFieldDefinition =\n | BooleanFieldDefinition\n | DecimalNumberFieldDefinition\n | IntegerNumberFieldDefinition\n | DateFieldDefinition\n | DropDownFieldDefinition\n | StringFieldDefinition\n | EmailFieldDefinition\n | PhoneNumberFieldDefinition\n | WebAddressFieldDefinition;\n\nexport interface AssetHomeExtensionManifest extends AbstractExtensionManifest {\n type: \"ASSET_HOME_EXTENSION\";\n /**\n * Conditions for the asset home app to be shown.\n * It is case insensitive so does not matter how you write the brand.\n * brand: \"trackunit\" and brand: \"Trackunit\" will be the same.\n *\n * If both model and brand are used/filled out then asset needs to match both model and brand.\n * If only brand or model is used/filled out then the asset needs to match the filled out property.\n */\n conditions?: {\n model?: string[] | string;\n brand?: string[] | string;\n };\n menuItem: {\n name: string | Translations | TranslationKey;\n };\n}\n\nexport interface SiteHomeExtensionManifest extends AbstractExtensionManifest {\n type: \"SITE_HOME_EXTENSION\";\n\n menuItem: {\n name: string | Translations | TranslationKey;\n };\n}\nexport interface FleetExtensionManifest extends AbstractExtensionManifest {\n type: \"FLEET_EXTENSION\";\n\n /**\n * Conditions for the asset home app to be shown.\n * It is case insensitive so does not matter how you write the brand.\n * brand: \"trackunit\" and brand: \"Trackunit\" will be the same.\n *\n * If both model and brand are used/filled out then asset needs to match both model and brand.\n * If only brand or model is used/filled out then the asset needs to match the filled out property.\n */\n conditions?: {\n model?: string[] | string;\n brand?: string[] | string;\n };\n menuItem: {\n name: string | Translations | TranslationKey;\n icon: string;\n };\n}\n\nexport interface AdminExtensionManifest extends AbstractExtensionManifest {\n type: \"ADMIN_EXTENSION\";\n\n menuItem: {\n name: string | Translations | TranslationKey;\n };\n}\n\nexport interface IrisAppSettingsExtensionManifest extends AbstractExtensionManifest {\n type: \"IRIS_APP_SETTINGS_EXTENSION\";\n}\n\nexport interface ReportExtensionManifest extends AbstractExtensionManifest {\n type: \"REPORT_EXTENSION\";\n\n menuItem: {\n /**\n * Title of the card in manager\n */\n name: string | Translations | TranslationKey;\n\n /**\n * Subtitle of the card in manager\n */\n description: string | Translations | TranslationKey;\n\n /**\n * Icon of the card in manager, must use icons from:\n * https://apps.dev.iris.trackunit.com/storybook/?path=/docs/components-icon--default\n */\n icon: string;\n };\n}\nexport declare type IrisAppExtension =\n | AssetHomeExtensionManifest\n | IrisAppSettingsExtensionManifest\n | AdminExtensionManifest\n | FleetExtensionManifest\n | SiteHomeExtensionManifest\n | ReportExtensionManifest;\nexport interface ConsentConfig {\n /**\n * The application type. Should be one of WEB or BROWSER.\n */\n applicationType: string;\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\n/**\n * An image that should be shown in the marketplace for this app.\n */\nexport interface MarketplaceAssetImage {\n /**\n * The type of the Asset\n */\n type: \"IMAGE\";\n /**\n * A Path to an image in the assets folder of the app.\n * Example: typing \"MyImage.png\" here, will show the file \"apps/my-app/assets/MyImage.png\"\n */\n path: string;\n}\n\n/**\n * A video that should be shown in the marketplace for this app.\n */\nexport interface MarketplaceAssetVideo {\n /**\n * The type of the Asset\n */\n type: \"VIDEO\";\n /**\n * An url for a youtube video.\n */\n url: string;\n}\n\n/**\n * A video or image that should be shown in the marketplace for this app.\n */\nexport type MarketplaceAsset = MarketplaceAssetImage | MarketplaceAssetVideo;\n\n/**\n * An object of data used when the app is displayed in the marketplace\n */\nexport interface Marketplace {\n /**\n * Name used for the marketplace.\n */\n name: string;\n\n /**\n * A short summary used for the card on marketplace.\n * For longer description add a description.md file in the /assets/ folder of the app, and set the fullDescriptionPath.\n */\n description: string;\n\n /**\n * The path to the markdown file for the description.\n */\n fullDescriptionPath: string;\n\n /**\n * Path to an image in the assets folder of the app.\n * The image will be shown in the marketplace.\n * Example: typing \"MyImage.png\" here, will show the file \"apps/my-app/assets/MyImage.png\"\n */\n logoPath?: string;\n /**\n * Tags used for describing the marketplace.\n */\n tags?: string[];\n /**\n * Categories used for the app in the marketplace.\n */\n categories?: Category[];\n /**\n * Assets (images and videos) used for the marketplace.\n */\n assets?: MarketplaceAsset[];\n /**\n * Defines what subscription packages the Tile is available at.\n */\n allowForPackage: \"ALL_PACKAGES\" | SubscriptionPackage[];\n /**\n * Homepage of the company building the app for the marketplace.\n */\n homePageUrl?: string;\n /**\n * The direct support page for this app.\n */\n supportUrl?: string;\n}\n\nexport declare type Category =\n | \"ANALYTICS\"\n | \"DATA_FEEDS\"\n | \"ENGINES_AND_HYDRAULICS\"\n | \"SERVICE_AND_MAINTENANCE\"\n | \"CONSULTANTS\"\n | \"CONNECTIVITY_AND_NETWORK\"\n | \"REPORTS\"\n | \"FAULT_CODES_AND_REMOTE_DIAGNOSTICS\"\n | \"SAFETY_AND_QUALITY\";\n\nexport declare type SubscriptionPackage =\n | \"VIEW\"\n | \"COLLECT\"\n | \"INSIGHT\"\n | \"EXPLORE_FLEET_OWNER\"\n | \"EVOLVE_FLEET_OWNER\"\n | \"EXPAND_FLEET_OWNER\"\n | \"EXPLORE_OEM\"\n | \"EVOLVE_OEM\"\n | \"EXPAND_OEM\";\n\nexport declare type IrisAppExtensionType =\n | \"REPORT_EXTENSION\"\n | \"IRIS_APP_SETTINGS_EXTENSION\"\n | \"ADMIN_EXTENSION\"\n | \"FLEET_EXTENSION\"\n | \"ASSET_HOME_EXTENSION\"\n | \"SITE_HOME_EXTENSION\";\ninterface Dependencies {\n [packageName: string]: string;\n}\nexport {};\n"]}
|