@trackunit/iris-app-api 0.0.112 → 0.0.114

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,10 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.0.114](https://github.com/Trackunit/manager/compare/iris-app-api/0.0.113...iris-app-api/0.0.114) (2023-09-13)
6
+
7
+ ## [0.0.113](https://github.com/Trackunit/manager/compare/iris-app-api/0.0.112...iris-app-api/0.0.113) (2023-09-12)
8
+
5
9
  ## [0.0.112](https://github.com/Trackunit/manager/compare/iris-app-api/0.0.111...iris-app-api/0.0.112) (2023-09-11)
6
10
 
7
11
  ## 0.0.1 (2023-09-11)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/iris-app-api",
3
- "version": "0.0.112",
3
+ "version": "0.0.114",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "repository": "https://github.com/Trackunit/manager",
6
6
  "engines": {
@@ -1,4 +1,4 @@
1
- import { AbstractExtensionManifest, RequiredPermission, TranslationKey, Translations } from "../irisAppExtensionManifest";
1
+ import { AbstractExtensionManifest, RequiredCustomField, RequiredPermission, TranslationKey, Translations } from "../irisAppExtensionManifest";
2
2
  export interface AssetHomeExtensionManifest extends AbstractExtensionManifest {
3
3
  type: "ASSET_HOME_EXTENSION";
4
4
  /**
@@ -17,6 +17,10 @@ export interface AssetHomeExtensionManifest extends AbstractExtensionManifest {
17
17
  model?: string[] | string;
18
18
  brand?: string[] | string;
19
19
  requiredPermission?: RequiredPermission | RequiredPermission[];
20
+ /**
21
+ * Only entityType ASSET custom fields are supported here
22
+ */
23
+ requiredCustomField?: RequiredCustomField | RequiredCustomField[];
20
24
  };
21
25
  menuItem: {
22
26
  name: string | Translations | TranslationKey;
@@ -1 +1 @@
1
- {"version":3,"file":"assetHomeExtensionManifest.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app-api/src/types/extensions/assetHomeExtensionManifest.ts"],"names":[],"mappings":"","sourcesContent":["import {\n AbstractExtensionManifest,\n RequiredPermission,\n TranslationKey,\n Translations,\n} from \"../irisAppExtensionManifest\";\n\nexport interface AssetHomeExtensionManifest extends AbstractExtensionManifest {\n type: \"ASSET_HOME_EXTENSION\";\n /**\n * Conditions for the asset home extension to be shown.\n * model and brand is case insensitive so does not matter how you write the brand.\n * brand: \"trackunit\" and brand: \"Trackunit\" will be the same.\n *\n * Its doing AND between the conditions types and OR between the conditions of the same type:\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 * - If only requiredPermissions is used/filled out then the asset home extension will be shown for all assets that the user has the required permission for.\n * - If more requiredPermissions are used/filled out then the asset home extension will be shown for all assets that the user has one of the required permission for.\n * - If no conditions are used/filled out then the asset home extension will be shown for all assets.\n */\n conditions?: {\n model?: string[] | string;\n brand?: string[] | string;\n requiredPermission?: RequiredPermission | RequiredPermission[];\n };\n menuItem: {\n name: string | Translations | TranslationKey;\n };\n}\n"]}
1
+ {"version":3,"file":"assetHomeExtensionManifest.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app-api/src/types/extensions/assetHomeExtensionManifest.ts"],"names":[],"mappings":"","sourcesContent":["import {\n AbstractExtensionManifest,\n RequiredCustomField,\n RequiredPermission,\n TranslationKey,\n Translations,\n} from \"../irisAppExtensionManifest\";\n\nexport interface AssetHomeExtensionManifest extends AbstractExtensionManifest {\n type: \"ASSET_HOME_EXTENSION\";\n /**\n * Conditions for the asset home extension to be shown.\n * model and brand is case insensitive so does not matter how you write the brand.\n * brand: \"trackunit\" and brand: \"Trackunit\" will be the same.\n *\n * Its doing AND between the conditions types and OR between the conditions of the same type:\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 * - If only requiredPermissions is used/filled out then the asset home extension will be shown for all assets that the user has the required permission for.\n * - If more requiredPermissions are used/filled out then the asset home extension will be shown for all assets that the user has one of the required permission for.\n * - If no conditions are used/filled out then the asset home extension will be shown for all assets.\n */\n conditions?: {\n model?: string[] | string;\n brand?: string[] | string;\n requiredPermission?: RequiredPermission | RequiredPermission[];\n\n /**\n * Only entityType ASSET custom fields are supported here\n */\n requiredCustomField?: RequiredCustomField | RequiredCustomField[];\n };\n menuItem: {\n name: string | Translations | TranslationKey;\n };\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { AbstractExtensionManifest, RequiredPermission, TranslationKey, Translations } from "../irisAppExtensionManifest";
1
+ import { AbstractExtensionManifest, RequiredCustomField, RequiredPermission, TranslationKey, Translations } from "../irisAppExtensionManifest";
2
2
  export interface SiteHomeExtensionManifest extends AbstractExtensionManifest {
3
3
  type: "SITE_HOME_EXTENSION";
4
4
  /**
@@ -7,10 +7,16 @@ export interface SiteHomeExtensionManifest extends AbstractExtensionManifest {
7
7
  * Its doing AND between the conditions types and OR between the conditions of the same type:
8
8
  * - If only requiredPermission is used/filled out then the site home extension will be shown for all sites that the user has the required permission for.
9
9
  * - If more requiredPermission are used/filled out then the site home extension will be shown for all sites that the user has one of the required permission for.
10
+ * - If only requiredCustomField is used/filled out then the site home extension will be shown for all sites that has the required custom field.
11
+ * - If more requiredCustomField are used/filled out then the site home extension will be shown for all sites that has all of the required custom field.
10
12
  * - If no conditions are used/filled out then the site home extension will be shown for all sites.
11
13
  */
12
14
  conditions?: {
13
15
  requiredPermission?: RequiredPermission | RequiredPermission[];
16
+ /**
17
+ * Only entityType SITE custom fields are supported here
18
+ */
19
+ requiredCustomField?: RequiredCustomField | RequiredCustomField[];
14
20
  };
15
21
  menuItem: {
16
22
  name: string | Translations | TranslationKey;
@@ -1 +1 @@
1
- {"version":3,"file":"siteHomeExtensionManifest.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app-api/src/types/extensions/siteHomeExtensionManifest.ts"],"names":[],"mappings":"","sourcesContent":["import {\n AbstractExtensionManifest,\n RequiredPermission,\n TranslationKey,\n Translations,\n} from \"../irisAppExtensionManifest\";\n\nexport interface SiteHomeExtensionManifest extends AbstractExtensionManifest {\n type: \"SITE_HOME_EXTENSION\";\n\n /**\n * Conditions for the site home extension to be shown.\n *\n * Its doing AND between the conditions types and OR between the conditions of the same type:\n * - If only requiredPermission is used/filled out then the site home extension will be shown for all sites that the user has the required permission for.\n * - If more requiredPermission are used/filled out then the site home extension will be shown for all sites that the user has one of the required permission for.\n * - If no conditions are used/filled out then the site home extension will be shown for all sites.\n */\n conditions?: {\n requiredPermission?: RequiredPermission | RequiredPermission[];\n };\n\n menuItem: {\n name: string | Translations | TranslationKey;\n };\n}\n"]}
1
+ {"version":3,"file":"siteHomeExtensionManifest.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app-api/src/types/extensions/siteHomeExtensionManifest.ts"],"names":[],"mappings":"","sourcesContent":["import {\n AbstractExtensionManifest,\n RequiredCustomField,\n RequiredPermission,\n TranslationKey,\n Translations,\n} from \"../irisAppExtensionManifest\";\n\nexport interface SiteHomeExtensionManifest extends AbstractExtensionManifest {\n type: \"SITE_HOME_EXTENSION\";\n\n /**\n * Conditions for the site home extension to be shown.\n *\n * Its doing AND between the conditions types and OR between the conditions of the same type:\n * - If only requiredPermission is used/filled out then the site home extension will be shown for all sites that the user has the required permission for.\n * - If more requiredPermission are used/filled out then the site home extension will be shown for all sites that the user has one of the required permission for.\n * - If only requiredCustomField is used/filled out then the site home extension will be shown for all sites that has the required custom field.\n * - If more requiredCustomField are used/filled out then the site home extension will be shown for all sites that has all of the required custom field.\n * - If no conditions are used/filled out then the site home extension will be shown for all sites.\n */\n conditions?: {\n requiredPermission?: RequiredPermission | RequiredPermission[];\n\n /**\n * Only entityType SITE custom fields are supported here\n */\n requiredCustomField?: RequiredCustomField | RequiredCustomField[];\n };\n\n menuItem: {\n name: string | Translations | TranslationKey;\n };\n}\n"]}
@@ -1,4 +1,4 @@
1
- export declare type CustomFieldDefinitionType = "STRING" | "NUMBER" | "DATE" | "BOOLEAN" | "DROPDOWN" | "EMAIL" | "PHONE_NUMBER" | "WEB_ADDRESS";
1
+ export declare type CustomFieldDefinitionType = "STRING" | "NUMBER" | "DATE" | "BOOLEAN" | "DROPDOWN" | "EMAIL" | "PHONE_NUMBER" | "WEB_ADDRESS" | "JSON" | "MONETARY";
2
2
  export declare type EntityType = "ASSET" | "ACCOUNT" | "SITE" | "GROUP";
3
3
  export interface AbstractCustomFieldDefinition {
4
4
  /**
@@ -25,7 +25,6 @@ export interface AbstractCustomFieldDefinition {
25
25
  * The type of this custom field definition
26
26
  */
27
27
  type: CustomFieldDefinitionType;
28
- [key: string]: number | string | boolean | string[] | Record<string, string> | undefined;
29
28
  }
30
29
  export interface StringFieldDefinition extends AbstractCustomFieldDefinition {
31
30
  type: "STRING";
@@ -125,3 +124,19 @@ export interface IntegerNumberFieldDefinition extends AbstractCustomFieldDefinit
125
124
  maximum?: number;
126
125
  isInteger: true;
127
126
  }
127
+ type JSONValue = string | number | boolean | null | {
128
+ [x: string]: JSONValue;
129
+ } | JSONValue[];
130
+ export interface JsonFieldDefinition extends AbstractCustomFieldDefinition {
131
+ type: "JSON";
132
+ defaultJsonValue?: JSONValue;
133
+ }
134
+ export interface MonetaryFieldDefinition extends AbstractCustomFieldDefinition {
135
+ type: "MONETARY";
136
+ defaultNumberValue?: number;
137
+ /**
138
+ * The currency of the monetary field definition - ISO 4217 compliant.
139
+ */
140
+ currency: string;
141
+ }
142
+ export {};
@@ -1 +1 @@
1
- {"version":3,"file":"irisAppCustomFields.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-api/src/types/irisAppCustomFields.ts"],"names":[],"mappings":";;;AAyFA,IAAY,MAgBX;AAhBD,WAAY,MAAM;IAChB,uBAAa,CAAA;IACb,uBAAa,CAAA;IACb,qCAA2B,CAAA;IAC3B,mCAAyB,CAAA;IACzB,yCAA+B,CAAA;IAC/B,uBAAa,CAAA;IACb,yBAAe,CAAA;IACf,2CAAiC,CAAA;IACjC,+CAAqC,CAAA;IACrC,uBAAa,CAAA;IACb,yCAA+B,CAAA;IAC/B,yBAAe,CAAA;IACf,2BAAiB,CAAA;IACjB,uBAAa,CAAA;IACb,yDAA+C,CAAA;AACjD,CAAC,EAhBW,MAAM,sBAAN,MAAM,QAgBjB;AAED,IAAY,MA0BX;AA1BD,WAAY,MAAM;IAChB,2BAAiB,CAAA;IACjB,2BAAiB,CAAA;IACjB,mCAAyB,CAAA;IACzB,uBAAa,CAAA;IACb,qBAAW,CAAA;IACX,mCAAyB,CAAA;IACzB,mCAAyB,CAAA;IACzB,yBAAe,CAAA;IACf,iCAAuB,CAAA;IACvB,uBAAa,CAAA;IACb,+BAAqB,CAAA;IACrB,+BAAqB,CAAA;IACrB,uCAA6B,CAAA;IAC7B,iDAAuC,CAAA;IACvC,qDAA2C,CAAA;IAC3C,+CAAqC,CAAA;IACrC,mDAAyC,CAAA;IACzC,yBAAe,CAAA;IACf,uCAA6B,CAAA;IAC7B,qCAA2B,CAAA;IAC3B,+CAAqC,CAAA;IACrC,+DAAqD,CAAA;IACrD,qBAAW,CAAA;IACX,6BAAmB,CAAA;IACnB,uBAAa,CAAA;AACf,CAAC,EA1BW,MAAM,sBAAN,MAAM,QA0BjB","sourcesContent":["export 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\" | \"SITE\" | \"GROUP\";\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 [key: string]: number | string | boolean | string[] | Record<string, string> | undefined;\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 /**\n * Map from old values not in {@link allValues} to new values. Used for updating existing data when changing\n * the drop down options.\n */\n valueReplacements?: Record<string, string>;\n}\n\nexport enum UnitUs {\n acre = \"acre\",\n foot = \"foot\",\n square_foot = \"square_foot\",\n cubic_foot = \"cubic_foot\",\n gallon_liquid = \"gallon_liquid\",\n inch = \"inch\",\n pound = \"pound\",\n pound_per_hour = \"pound_per_hour\",\n pound_per_second = \"pound_per_second\",\n mile = \"mile\",\n mile_per_hour = \"mile_per_hour\",\n ounce = \"ounce\",\n ton_us = \"ton_us\",\n yard = \"yard\",\n pound_per_square_inch = \"pound_per_square_inch\",\n}\n\nexport enum UnitSi {\n newton = \"newton\",\n pascal = \"pascal\",\n kilopascal = \"kilopascal\",\n watt = \"watt\",\n bar = \"bar\",\n centimetre = \"centimetre\",\n millimetre = \"millimetre\",\n metre = \"metre\",\n kilometre = \"kilometre\",\n gram = \"gram\",\n kilogram = \"kilogram\",\n kilowatt = \"kilowatt\",\n kilowatthour = \"kilowatthour\",\n kilogram_per_hour = \"kilogram_per_hour\",\n kilogram_per_second = \"kilogram_per_second\",\n square_kilometre = \"square_kilometre\",\n kilometre_per_hour = \"kilometre_per_hour\",\n litre = \"litre\",\n square_metre = \"square_metre\",\n cubic_metre = \"cubic_metre\",\n metre_per_second = \"metre_per_second\",\n metre_per_second_squared = \"metre_per_second_squared\",\n ton = \"ton\",\n hectare = \"hectare\",\n hour = \"hour\",\n}\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}"]}
1
+ {"version":3,"file":"irisAppCustomFields.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-api/src/types/irisAppCustomFields.ts"],"names":[],"mappings":";;;AA0FA,IAAY,MAgBX;AAhBD,WAAY,MAAM;IAChB,uBAAa,CAAA;IACb,uBAAa,CAAA;IACb,qCAA2B,CAAA;IAC3B,mCAAyB,CAAA;IACzB,yCAA+B,CAAA;IAC/B,uBAAa,CAAA;IACb,yBAAe,CAAA;IACf,2CAAiC,CAAA;IACjC,+CAAqC,CAAA;IACrC,uBAAa,CAAA;IACb,yCAA+B,CAAA;IAC/B,yBAAe,CAAA;IACf,2BAAiB,CAAA;IACjB,uBAAa,CAAA;IACb,yDAA+C,CAAA;AACjD,CAAC,EAhBW,MAAM,sBAAN,MAAM,QAgBjB;AAED,IAAY,MA0BX;AA1BD,WAAY,MAAM;IAChB,2BAAiB,CAAA;IACjB,2BAAiB,CAAA;IACjB,mCAAyB,CAAA;IACzB,uBAAa,CAAA;IACb,qBAAW,CAAA;IACX,mCAAyB,CAAA;IACzB,mCAAyB,CAAA;IACzB,yBAAe,CAAA;IACf,iCAAuB,CAAA;IACvB,uBAAa,CAAA;IACb,+BAAqB,CAAA;IACrB,+BAAqB,CAAA;IACrB,uCAA6B,CAAA;IAC7B,iDAAuC,CAAA;IACvC,qDAA2C,CAAA;IAC3C,+CAAqC,CAAA;IACrC,mDAAyC,CAAA;IACzC,yBAAe,CAAA;IACf,uCAA6B,CAAA;IAC7B,qCAA2B,CAAA;IAC3B,+CAAqC,CAAA;IACrC,+DAAqD,CAAA;IACrD,qBAAW,CAAA;IACX,6BAAmB,CAAA;IACnB,uBAAa,CAAA;AACf,CAAC,EA1BW,MAAM,sBAAN,MAAM,QA0BjB","sourcesContent":["export declare type CustomFieldDefinitionType =\n | \"STRING\"\n | \"NUMBER\"\n | \"DATE\"\n | \"BOOLEAN\"\n | \"DROPDOWN\"\n | \"EMAIL\"\n | \"PHONE_NUMBER\"\n | \"WEB_ADDRESS\"\n | \"JSON\"\n | \"MONETARY\";\n\nexport declare type EntityType = \"ASSET\" | \"ACCOUNT\" | \"SITE\" | \"GROUP\";\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 /**\n * Map from old values not in {@link allValues} to new values. Used for updating existing data when changing\n * the drop down options.\n */\n valueReplacements?: Record<string, string>;\n}\n\nexport enum UnitUs {\n acre = \"acre\",\n foot = \"foot\",\n square_foot = \"square_foot\",\n cubic_foot = \"cubic_foot\",\n gallon_liquid = \"gallon_liquid\",\n inch = \"inch\",\n pound = \"pound\",\n pound_per_hour = \"pound_per_hour\",\n pound_per_second = \"pound_per_second\",\n mile = \"mile\",\n mile_per_hour = \"mile_per_hour\",\n ounce = \"ounce\",\n ton_us = \"ton_us\",\n yard = \"yard\",\n pound_per_square_inch = \"pound_per_square_inch\",\n}\n\nexport enum UnitSi {\n newton = \"newton\",\n pascal = \"pascal\",\n kilopascal = \"kilopascal\",\n watt = \"watt\",\n bar = \"bar\",\n centimetre = \"centimetre\",\n millimetre = \"millimetre\",\n metre = \"metre\",\n kilometre = \"kilometre\",\n gram = \"gram\",\n kilogram = \"kilogram\",\n kilowatt = \"kilowatt\",\n kilowatthour = \"kilowatthour\",\n kilogram_per_hour = \"kilogram_per_hour\",\n kilogram_per_second = \"kilogram_per_second\",\n square_kilometre = \"square_kilometre\",\n kilometre_per_hour = \"kilometre_per_hour\",\n litre = \"litre\",\n square_metre = \"square_metre\",\n cubic_metre = \"cubic_metre\",\n metre_per_second = \"metre_per_second\",\n metre_per_second_squared = \"metre_per_second_squared\",\n ton = \"ton\",\n hectare = \"hectare\",\n hour = \"hour\",\n}\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\ntype JSONValue = string | number | boolean | null | { [x: string]: JSONValue } | JSONValue[];\n\nexport interface JsonFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"JSON\";\n defaultJsonValue?: JSONValue;\n}\n\nexport interface MonetaryFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"MONETARY\";\n defaultNumberValue?: number;\n /**\n * The currency of the monetary field definition - ISO 4217 compliant.\n */\n currency: string;\n}\n"]}
@@ -9,6 +9,19 @@ export interface RequiredPermission {
9
9
  */
10
10
  permission: string;
11
11
  }
12
+ /**
13
+ * Used to limit access to iris apps based on custom field value.
14
+ */
15
+ export interface RequiredCustomField {
16
+ /**
17
+ * The custom field key to check for, only dropdown, string or boolean is supported.
18
+ */
19
+ customFieldKey: string;
20
+ /**
21
+ * The requiredValue that is required for the app extension to be visible.
22
+ */
23
+ requiredValue: string | string[] | boolean;
24
+ }
12
25
  export interface AbstractExtensionManifest {
13
26
  /** The id of the app extension, will be part of the URL in the manager */
14
27
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"irisAppExtensionManifest.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-api/src/types/irisAppExtensionManifest.ts"],"names":[],"mappings":";;;AA8Da,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","sourcesContent":["export declare type IrisAppExtensionType =\n | \"REPORT_EXTENSION\"\n | \"IRIS_APP_SETTINGS_EXTENSION\"\n | \"ADMIN_EXTENSION\"\n | \"FLEET_EXTENSION\"\n | \"WIDGET_EXTENSION\"\n | \"ASSET_HOME_EXTENSION\"\n | \"SITE_HOME_EXTENSION\";\n\nexport interface RequiredPermission {\n /**\n * The type of entity that the permission is required for.\n */\n entityType: \"ACCOUNT\";\n\n /**\n * The permission that is required for the app extension to be visible.\n */\n permission: string;\n}\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 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}\n"]}
1
+ {"version":3,"file":"irisAppExtensionManifest.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-api/src/types/irisAppExtensionManifest.ts"],"names":[],"mappings":";;;AA6Ea,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","sourcesContent":["export declare type IrisAppExtensionType =\n | \"REPORT_EXTENSION\"\n | \"IRIS_APP_SETTINGS_EXTENSION\"\n | \"ADMIN_EXTENSION\"\n | \"FLEET_EXTENSION\"\n | \"WIDGET_EXTENSION\"\n | \"ASSET_HOME_EXTENSION\"\n | \"SITE_HOME_EXTENSION\";\n\nexport interface RequiredPermission {\n /**\n * The type of entity that the permission is required for.\n */\n entityType: \"ACCOUNT\";\n\n /**\n * The permission that is required for the app extension to be visible.\n */\n permission: string;\n}\n\n/**\n * Used to limit access to iris apps based on custom field value.\n */\nexport interface RequiredCustomField {\n /**\n * The custom field key to check for, only dropdown, string or boolean is supported.\n */\n customFieldKey: string;\n\n /**\n * The requiredValue that is required for the app extension to be visible.\n */\n requiredValue: string | string[] | boolean;\n}\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 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}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { AdminExtensionManifest, AssetHomeExtensionManifest, FleetExtensionManifest, IrisAppSettingsExtensionManifest, ReportExtensionManifest, SiteHomeExtensionManifest } from "./extensions";
2
2
  import { WidgetExtensionManifest } from "./extensions/widgetExtensionManifest";
3
- import { BooleanFieldDefinition, DateFieldDefinition, DecimalNumberFieldDefinition, DropDownFieldDefinition, EmailFieldDefinition, IntegerNumberFieldDefinition, PhoneNumberFieldDefinition, StringFieldDefinition, WebAddressFieldDefinition } from "./irisAppCustomFields";
3
+ import { BooleanFieldDefinition, DateFieldDefinition, DecimalNumberFieldDefinition, DropDownFieldDefinition, EmailFieldDefinition, IntegerNumberFieldDefinition, JsonFieldDefinition, MonetaryFieldDefinition, PhoneNumberFieldDefinition, StringFieldDefinition, WebAddressFieldDefinition } from "./irisAppCustomFields";
4
4
  import { InstallationConfig } from "./irisAppInstallationConfig";
5
5
  import { Marketplace, Marketplace_1_0 } from "./irisAppMarketplace";
6
6
  export interface IrisAppManifest extends Omit<IrisAppManifest_1_0, "specVersion" | "activationMode" | "marketplace" | "validForAccountIds"> {
@@ -22,7 +22,7 @@ export interface IrisAppManifest extends Omit<IrisAppManifest_1_0, "specVersion"
22
22
  marketplace: Marketplace;
23
23
  }
24
24
  export declare type IrisAppExtension = AssetHomeExtensionManifest | IrisAppSettingsExtensionManifest | AdminExtensionManifest | FleetExtensionManifest | SiteHomeExtensionManifest | WidgetExtensionManifest | ReportExtensionManifest;
25
- export declare type CustomFieldDefinition = BooleanFieldDefinition | DecimalNumberFieldDefinition | IntegerNumberFieldDefinition | DateFieldDefinition | DropDownFieldDefinition | StringFieldDefinition | EmailFieldDefinition | PhoneNumberFieldDefinition | WebAddressFieldDefinition;
25
+ export declare type CustomFieldDefinition = BooleanFieldDefinition | DecimalNumberFieldDefinition | IntegerNumberFieldDefinition | DateFieldDefinition | DropDownFieldDefinition | StringFieldDefinition | EmailFieldDefinition | PhoneNumberFieldDefinition | WebAddressFieldDefinition | JsonFieldDefinition | MonetaryFieldDefinition;
26
26
  export interface ConsentConfig {
27
27
  /**
28
28
  * The application type. Should be one of WEB or BROWSER.
@@ -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 {\n AdminExtensionManifest,\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 PhoneNumberFieldDefinition,\n StringFieldDefinition,\n WebAddressFieldDefinition,\n} from \"./irisAppCustomFields\";\nimport { InstallationConfig } from \"./irisAppInstallationConfig\";\nimport { Marketplace, Marketplace_1_0 } from \"./irisAppMarketplace\";\n\nexport interface IrisAppManifest\n extends Omit<IrisAppManifest_1_0, \"specVersion\" | \"activationMode\" | \"marketplace\" | \"validForAccountIds\"> {\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\nexport declare type IrisAppExtension =\n | AssetHomeExtensionManifest\n | IrisAppSettingsExtensionManifest\n | AdminExtensionManifest\n | FleetExtensionManifest\n | SiteHomeExtensionManifest\n | WidgetExtensionManifest\n | ReportExtensionManifest;\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 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 * A configuration object for handling scoped token acquisition.\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 validForAccountIds} and {@link marketplace}.allowForPackage\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 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 {\n AdminExtensionManifest,\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\";\n\nexport interface IrisAppManifest\n extends Omit<IrisAppManifest_1_0, \"specVersion\" | \"activationMode\" | \"marketplace\" | \"validForAccountIds\"> {\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\nexport declare type IrisAppExtension =\n | AssetHomeExtensionManifest\n | IrisAppSettingsExtensionManifest\n | AdminExtensionManifest\n | FleetExtensionManifest\n | SiteHomeExtensionManifest\n | WidgetExtensionManifest\n | ReportExtensionManifest;\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\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 * A configuration object for handling scoped token acquisition.\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 validForAccountIds} and {@link marketplace}.allowForPackage\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 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"]}