@trackunit/iris-app-api 0.0.151 → 0.0.153
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.153](https://github.com/Trackunit/manager/compare/iris-app-api/0.0.152...iris-app-api/0.0.153) (2024-02-20)
|
|
6
|
+
|
|
7
|
+
## [0.0.152](https://github.com/Trackunit/manager/compare/iris-app-api/0.0.151...iris-app-api/0.0.152) (2024-02-15)
|
|
8
|
+
|
|
5
9
|
## [0.0.151](https://github.com/Trackunit/manager/compare/iris-app-api/0.0.150...iris-app-api/0.0.151) (2024-02-09)
|
|
6
10
|
|
|
7
11
|
## [0.0.150](https://github.com/Trackunit/manager/compare/iris-app-api/0.0.149...iris-app-api/0.0.150) (2024-02-08)
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultValidHosts.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-api/src/types/defaultValidHosts.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACI,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,2EAA2E;IAC3E,OAAO;QACL,mCAAmC;QACnC,qCAAqC;QACrC,mCAAmC;QACnC,wBAAwB;QACxB,wBAAwB;QACxB,wBAAwB;QACxB,8BAA8B;QAC9B,OAAO;QACP,QAAQ;QACR,mCAAmC;QACnC,iCAAiC;QACjC,QAAQ;QACR,gCAAgC;QAChC,QAAQ;QACR,uBAAuB;QACvB,0BAA0B;QAC1B,qBAAqB;QACrB,SAAS;QACT,uBAAuB;QACvB,WAAW;QACX,yBAAyB;QACzB,WAAW;QACX,yBAAyB;QACzB,yBAAyB;KAC1B,CAAC;AACJ,CAAC,CAAC;AA5BW,QAAA,iBAAiB,qBA4B5B","sourcesContent":["/**\n * Returns default valid hosts for CSP for manager.\n *\n * ! Internal use only !\n *\n * @returns {string[]} - Array of valid hosts for CSP\n */\nexport const defaultValidHosts = () => {\n // TRY TO KEEP IN SYNC WITH CHANGES IN server.js from manager (CSP headers)\n return [\n \"https://dev.manager.trackunit.com\",\n \"https://stage.manager.trackunit.com\",\n \"https://new.manager.trackunit.com\",\n \"http://localhost:5005/\",\n \"http://localhost:5010/\",\n \"http://localhost:5011/\",\n //Allow inline data like icons\n \"data:\",\n //IMAGES\n \"https://images.iris.trackunit.com\",\n \"https://*.awsapi.trackunit.com/\", // loading images from machines api\n //SENTRY\n \"https://browser.sentry-cdn.com\",\n //GOOGLE\n \"https://*.gstatic.com\",\n \"https://*.googleapis.com\",\n \"https://*.ggpht.com\",\n //APPCUES\n \"https://*.appcues.com\",\n //AMPLITUDE\n \"https://*.amplitude.com\",\n //SPECCHECK\n \"https://*.speccheck.com\",\n \"https://api.hsforms.com\"
|
|
1
|
+
{"version":3,"file":"defaultValidHosts.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-api/src/types/defaultValidHosts.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACI,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,2EAA2E;IAC3E,OAAO;QACL,mCAAmC;QACnC,qCAAqC;QACrC,mCAAmC;QACnC,wBAAwB;QACxB,wBAAwB;QACxB,wBAAwB;QACxB,8BAA8B;QAC9B,OAAO;QACP,QAAQ;QACR,mCAAmC;QACnC,iCAAiC;QACjC,QAAQ;QACR,gCAAgC;QAChC,QAAQ;QACR,uBAAuB;QACvB,0BAA0B;QAC1B,qBAAqB;QACrB,SAAS;QACT,uBAAuB;QACvB,WAAW;QACX,yBAAyB;QACzB,WAAW;QACX,yBAAyB;QACzB,yBAAyB;KAC1B,CAAC;AACJ,CAAC,CAAC;AA5BW,QAAA,iBAAiB,qBA4B5B","sourcesContent":["/**\n * Returns default valid hosts for CSP for manager.\n *\n * ! Internal use only !\n *\n * @returns {string[]} - Array of valid hosts for CSP\n */\nexport const defaultValidHosts = () => {\n // TRY TO KEEP IN SYNC WITH CHANGES IN server.js from manager (CSP headers)\n return [\n \"https://dev.manager.trackunit.com\",\n \"https://stage.manager.trackunit.com\",\n \"https://new.manager.trackunit.com\",\n \"http://localhost:5005/\",\n \"http://localhost:5010/\",\n \"http://localhost:5011/\",\n //Allow inline data like icons\n \"data:\",\n //IMAGES\n \"https://images.iris.trackunit.com\",\n \"https://*.awsapi.trackunit.com/\", // loading images from machines api\n //SENTRY\n \"https://browser.sentry-cdn.com\",\n //GOOGLE\n \"https://*.gstatic.com\",\n \"https://*.googleapis.com\",\n \"https://*.ggpht.com\",\n //APPCUES\n \"https://*.appcues.com\",\n //AMPLITUDE\n \"https://*.amplitude.com\",\n //SPECCHECK\n \"https://*.speccheck.com\",\n \"https://api.hsforms.com\",\n ];\n};\n"]}
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import { TranslationKey, TranslationLanguageKeys } from "./irisAppExtensionManifest";
|
|
2
2
|
export declare type CustomFieldDefinitionType = "STRING" | "NUMBER" | "DATE" | "BOOLEAN" | "DROPDOWN" | "EMAIL" | "PHONE_NUMBER" | "WEB_ADDRESS" | "JSON" | "MONETARY";
|
|
3
3
|
export declare type EntityType = "ASSET" | "ACCOUNT" | "SITE" | "GROUP";
|
|
4
|
+
export declare const ScopeType: {
|
|
5
|
+
/**
|
|
6
|
+
* Values with account scope will be shared within a single account
|
|
7
|
+
*/
|
|
8
|
+
readonly ACCOUNT: "ACCOUNT";
|
|
9
|
+
/**
|
|
10
|
+
* Values will be shared within a single account (write) and visible to all accounts (read)
|
|
11
|
+
*/
|
|
12
|
+
readonly ACCOUNT_WRITE_GLOBAL_READ: "ACCOUNT_WRITE_GLOBAL_READ";
|
|
13
|
+
/**
|
|
14
|
+
* Values with global scope will be shared between all accounts with access to the entity.
|
|
15
|
+
*/
|
|
16
|
+
readonly GLOBAL: "GLOBAL";
|
|
17
|
+
};
|
|
18
|
+
export type ScopeTypeType = (typeof ScopeType)[keyof typeof ScopeType];
|
|
4
19
|
/**
|
|
5
20
|
* Test if the object is a CustomFieldTranslation array.
|
|
6
21
|
*/
|
|
@@ -35,6 +50,10 @@ export interface AbstractCustomFieldDefinition {
|
|
|
35
50
|
* The type of the entity to attach this custom field on.
|
|
36
51
|
*/
|
|
37
52
|
entityType: EntityType;
|
|
53
|
+
/**
|
|
54
|
+
* Who can access the field value. Default is only within the users account.
|
|
55
|
+
*/
|
|
56
|
+
scopeType?: ScopeTypeType;
|
|
38
57
|
/**
|
|
39
58
|
* The translations for the custom field definition.
|
|
40
59
|
* For Arrays of translations, the list must contain the language "en" as the default.
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UnitSi = exports.UnitUs = exports.isCustomFieldTranslationArray = void 0;
|
|
3
|
+
exports.UnitSi = exports.UnitUs = exports.isCustomFieldTranslationArray = exports.ScopeType = void 0;
|
|
4
|
+
exports.ScopeType = {
|
|
5
|
+
/**
|
|
6
|
+
* Values with account scope will be shared within a single account
|
|
7
|
+
*/
|
|
8
|
+
ACCOUNT: "ACCOUNT",
|
|
9
|
+
/**
|
|
10
|
+
* Values will be shared within a single account (write) and visible to all accounts (read)
|
|
11
|
+
*/
|
|
12
|
+
ACCOUNT_WRITE_GLOBAL_READ: "ACCOUNT_WRITE_GLOBAL_READ",
|
|
13
|
+
/**
|
|
14
|
+
* Values with global scope will be shared between all accounts with access to the entity.
|
|
15
|
+
*/
|
|
16
|
+
GLOBAL: "GLOBAL",
|
|
17
|
+
};
|
|
4
18
|
/**
|
|
5
19
|
* Test if the object is a CustomFieldTranslation array.
|
|
6
20
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"irisAppCustomFields.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-api/src/types/irisAppCustomFields.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"irisAppCustomFields.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-api/src/types/irisAppCustomFields.ts"],"names":[],"mappings":";;;AAgBa,QAAA,SAAS,GAAG;IACvB;;OAEG;IACH,OAAO,EAAE,SAAS;IAClB;;OAEG;IACH,yBAAyB,EAAE,2BAA2B;IACtD;;OAEG;IACH,MAAM,EAAE,QAAQ;CACR,CAAC;AAGX;;GAEG;AACI,MAAM,6BAA6B,GAAG,CAC3C,MAA6F,EACtD,EAAE;IACzC,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC,CAAC;AAJW,QAAA,6BAA6B,iCAIxC;AAgGW,QAAA,MAAM,GAAG;IACpB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,aAAa;IAC1B,UAAU,EAAE,YAAY;IACxB,aAAa,EAAE,eAAe;IAC9B,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,cAAc,EAAE,gBAAgB;IAChC,gBAAgB,EAAE,kBAAkB;IACpC,IAAI,EAAE,MAAM;IACZ,aAAa,EAAE,eAAe;IAC9B,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,qBAAqB,EAAE,uBAAuB;CACtC,CAAC;AAGE,QAAA,MAAM,GAAG;IACpB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;IACxB,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,YAAY;IACxB,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,WAAW;IACtB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;IACpB,YAAY,EAAE,cAAc;IAC5B,iBAAiB,EAAE,mBAAmB;IACtC,mBAAmB,EAAE,qBAAqB;IAC1C,gBAAgB,EAAE,kBAAkB;IACpC,kBAAkB,EAAE,oBAAoB;IACxC,KAAK,EAAE,OAAO;IACd,YAAY,EAAE,cAAc;IAC5B,WAAW,EAAE,aAAa;IAC1B,gBAAgB,EAAE,kBAAkB;IACpC,wBAAwB,EAAE,0BAA0B;IACpD,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;CACJ,CAAC","sourcesContent":["import { TranslationKey, TranslationLanguageKeys } from \"./irisAppExtensionManifest\";\n\nexport 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 const ScopeType = {\n /**\n * Values with account scope will be shared within a single account\n */\n ACCOUNT: \"ACCOUNT\",\n /**\n * Values will be shared within a single account (write) and visible to all accounts (read)\n */\n ACCOUNT_WRITE_GLOBAL_READ: \"ACCOUNT_WRITE_GLOBAL_READ\",\n /**\n * Values with global scope will be shared between all accounts with access to the entity.\n */\n GLOBAL: \"GLOBAL\",\n} as const;\nexport type ScopeTypeType = (typeof ScopeType)[keyof typeof ScopeType];\n\n/**\n * Test if the object is a CustomFieldTranslation array.\n */\nexport const isCustomFieldTranslationArray = (\n object: CustomFieldTranslationArray | { title: TranslationKey; description?: TranslationKey }\n): object is CustomFieldTranslationArray => {\n return Array.isArray(object);\n};\n\nexport interface CustomFieldTranslation {\n language: TranslationLanguageKeys;\n title: string;\n description?: string;\n}\n\nexport interface CustomFieldTranslationWithoutEnglish {\n language: Exclude<TranslationLanguageKeys, \"en\">;\n title: string;\n description?: string;\n}\n\nexport type CustomFieldTranslationArray = [\n { language: \"en\"; title: string; description?: string },\n ...CustomFieldTranslationWithoutEnglish[],\n];\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 * Who can access the field value. Default is only within the users account.\n */\n scopeType?: ScopeTypeType;\n\n /**\n * The translations for the custom field definition.\n * For Arrays of translations, the list must contain the language \"en\" as the default.\n * Either a list of translations or a single translation object with\n * translation keys it will look for all available languages in src/locales/<languagecode>/translation.json\n */\n translations: CustomFieldTranslationArray | { title: TranslationKey; description?: TranslationKey };\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}\n\nexport interface EmailFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"EMAIL\";\n}\n\nexport interface WebAddressFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"WEB_ADDRESS\";\n}\n\nexport interface PhoneNumberFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"PHONE_NUMBER\";\n}\nexport interface BooleanFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"BOOLEAN\";\n}\n\nexport interface DateFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"DATE\";\n}\n\nexport interface DropDownFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"DROPDOWN\";\n multiSelect?: boolean;\n allValues?: string[];\n /**\n * Map from old values not in the 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 const 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} as const;\nexport type UnitUsType = (typeof UnitUs)[keyof typeof UnitUs];\n\nexport const 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} as const;\nexport type UnitSiType = (typeof UnitSi)[keyof typeof UnitSi];\n\nexport interface DecimalNumberFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"NUMBER\";\n\n minimum?: number;\n maximum?: number;\n\n unitSi?: UnitSiType;\n unitUs?: UnitUsType;\n\n isInteger: false;\n}\n\nexport interface IntegerNumberFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"NUMBER\";\n\n minimum?: number;\n maximum?: number;\n\n isInteger: true;\n}\n\nexport type JSONValue = string | number | boolean | null | { [x: string]: JSONValue } | JSONValue[];\n\nexport interface JsonFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"JSON\";\n}\n\nexport interface MonetaryFieldDefinition extends AbstractCustomFieldDefinition {\n type: \"MONETARY\";\n /**\n * The currency of the monetary field definition - ISO 4217 compliant.\n */\n currency: string;\n}\n"]}
|