@trackunit/iris-app-runtime-core-api 0.3.87 → 0.3.90

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/index.cjs.js CHANGED
@@ -2,68 +2,69 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- exports.CustomFieldType = void 0;
6
- (function (CustomFieldType) {
7
- CustomFieldType["BOOLEAN"] = "BOOLEAN";
8
- CustomFieldType["DATE"] = "DATE";
9
- CustomFieldType["DROPDOWN"] = "DROPDOWN";
10
- CustomFieldType["EMAIL"] = "EMAIL";
11
- CustomFieldType["JSON"] = "JSON";
12
- CustomFieldType["MONETARY"] = "MONETARY";
13
- CustomFieldType["NUMBER"] = "NUMBER";
14
- CustomFieldType["PHONE_NUMBER"] = "PHONE_NUMBER";
15
- CustomFieldType["STRING"] = "STRING";
16
- CustomFieldType["WEB_ADDRESS"] = "WEB_ADDRESS";
17
- })(exports.CustomFieldType || (exports.CustomFieldType = {}));
18
- exports.UnitUs = void 0;
19
- (function (UnitUs) {
20
- UnitUs["acre"] = "acre";
21
- UnitUs["foot"] = "foot";
22
- UnitUs["square_foot"] = "square_foot";
23
- UnitUs["cubic_foot"] = "cubic_foot";
24
- UnitUs["gallon_liquid"] = "gallon_liquid";
25
- UnitUs["inch"] = "inch";
26
- UnitUs["pound"] = "pound";
27
- UnitUs["pound_per_hour"] = "pound_per_hour";
28
- UnitUs["pound_per_second"] = "pound_per_second";
29
- UnitUs["mile"] = "mile";
30
- UnitUs["mile_per_hour"] = "mile_per_hour";
31
- UnitUs["ounce"] = "ounce";
32
- UnitUs["ton_us"] = "ton_us";
33
- UnitUs["yard"] = "yard";
34
- UnitUs["pound_per_square_inch"] = "pound_per_square_inch";
35
- })(exports.UnitUs || (exports.UnitUs = {}));
36
- exports.UnitSi = void 0;
37
- (function (UnitSi) {
38
- UnitSi["newton"] = "newton";
39
- UnitSi["pascal"] = "pascal";
40
- UnitSi["kilopascal"] = "kilopascal";
41
- UnitSi["watt"] = "watt";
42
- UnitSi["bar"] = "bar";
43
- UnitSi["centimetre"] = "centimetre";
44
- UnitSi["millimetre"] = "millimetre";
45
- UnitSi["metre"] = "metre";
46
- UnitSi["kilometre"] = "kilometre";
47
- UnitSi["gram"] = "gram";
48
- UnitSi["kilogram"] = "kilogram";
49
- UnitSi["kilowatt"] = "kilowatt";
50
- UnitSi["kilowatthour"] = "kilowatthour";
51
- UnitSi["kilogram_per_hour"] = "kilogram_per_hour";
52
- UnitSi["kilogram_per_second"] = "kilogram_per_second";
53
- UnitSi["square_kilometre"] = "square_kilometre";
54
- UnitSi["kilometre_per_hour"] = "kilometre_per_hour";
55
- UnitSi["litre"] = "litre";
56
- UnitSi["square_metre"] = "square_metre";
57
- UnitSi["cubic_metre"] = "cubic_metre";
58
- UnitSi["metre_per_second"] = "metre_per_second";
59
- UnitSi["metre_per_second_squared"] = "metre_per_second_squared";
60
- UnitSi["ton"] = "ton";
61
- UnitSi["hectare"] = "hectare";
62
- UnitSi["hour"] = "hour";
63
- })(exports.UnitSi || (exports.UnitSi = {}));
5
+ const customFieldType = {
6
+ BOOLEAN: "BOOLEAN",
7
+ DATE: "DATE",
8
+ DROPDOWN: "DROPDOWN",
9
+ EMAIL: "EMAIL",
10
+ JSON: "JSON",
11
+ MONETARY: "MONETARY",
12
+ NUMBER: "NUMBER",
13
+ PHONE_NUMBER: "PHONE_NUMBER",
14
+ STRING: "STRING",
15
+ WEB_ADDRESS: "WEB_ADDRESS",
16
+ };
17
+ const UnitUs = {
18
+ acre: "acre",
19
+ foot: "foot",
20
+ square_foot: "square_foot",
21
+ cubic_foot: "cubic_foot",
22
+ gallon_liquid: "gallon_liquid",
23
+ inch: "inch",
24
+ pound: "pound",
25
+ pound_per_hour: "pound_per_hour",
26
+ pound_per_second: "pound_per_second",
27
+ mile: "mile",
28
+ mile_per_hour: "mile_per_hour",
29
+ ounce: "ounce",
30
+ ton_us: "ton_us",
31
+ yard: "yard",
32
+ pound_per_square_inch: "pound_per_square_inch",
33
+ };
34
+ const UnitSi = {
35
+ newton: "newton",
36
+ pascal: "pascal",
37
+ kilopascal: "kilopascal",
38
+ watt: "watt",
39
+ bar: "bar",
40
+ centimetre: "centimetre",
41
+ millimetre: "millimetre",
42
+ metre: "metre",
43
+ kilometre: "kilometre",
44
+ gram: "gram",
45
+ kilogram: "kilogram",
46
+ kilowatt: "kilowatt",
47
+ kilowatthour: "kilowatthour",
48
+ kilogram_per_hour: "kilogram_per_hour",
49
+ kilogram_per_second: "kilogram_per_second",
50
+ square_kilometre: "square_kilometre",
51
+ kilometre_per_hour: "kilometre_per_hour",
52
+ litre: "litre",
53
+ square_metre: "square_metre",
54
+ cubic_metre: "cubic_metre",
55
+ metre_per_second: "metre_per_second",
56
+ metre_per_second_squared: "metre_per_second_squared",
57
+ ton: "ton",
58
+ hectare: "hectare",
59
+ hour: "hour",
60
+ };
64
61
 
65
62
  exports.BodyType = void 0;
66
63
  (function (BodyType) {
67
64
  BodyType[BodyType["Json"] = 0] = "Json";
68
65
  BodyType[BodyType["FormData"] = 1] = "FormData";
69
66
  })(exports.BodyType || (exports.BodyType = {}));
67
+
68
+ exports.UnitSi = UnitSi;
69
+ exports.UnitUs = UnitUs;
70
+ exports.customFieldType = customFieldType;
package/index.esm.js CHANGED
@@ -1,62 +1,59 @@
1
- var CustomFieldType;
2
- (function (CustomFieldType) {
3
- CustomFieldType["BOOLEAN"] = "BOOLEAN";
4
- CustomFieldType["DATE"] = "DATE";
5
- CustomFieldType["DROPDOWN"] = "DROPDOWN";
6
- CustomFieldType["EMAIL"] = "EMAIL";
7
- CustomFieldType["JSON"] = "JSON";
8
- CustomFieldType["MONETARY"] = "MONETARY";
9
- CustomFieldType["NUMBER"] = "NUMBER";
10
- CustomFieldType["PHONE_NUMBER"] = "PHONE_NUMBER";
11
- CustomFieldType["STRING"] = "STRING";
12
- CustomFieldType["WEB_ADDRESS"] = "WEB_ADDRESS";
13
- })(CustomFieldType || (CustomFieldType = {}));
14
- var UnitUs;
15
- (function (UnitUs) {
16
- UnitUs["acre"] = "acre";
17
- UnitUs["foot"] = "foot";
18
- UnitUs["square_foot"] = "square_foot";
19
- UnitUs["cubic_foot"] = "cubic_foot";
20
- UnitUs["gallon_liquid"] = "gallon_liquid";
21
- UnitUs["inch"] = "inch";
22
- UnitUs["pound"] = "pound";
23
- UnitUs["pound_per_hour"] = "pound_per_hour";
24
- UnitUs["pound_per_second"] = "pound_per_second";
25
- UnitUs["mile"] = "mile";
26
- UnitUs["mile_per_hour"] = "mile_per_hour";
27
- UnitUs["ounce"] = "ounce";
28
- UnitUs["ton_us"] = "ton_us";
29
- UnitUs["yard"] = "yard";
30
- UnitUs["pound_per_square_inch"] = "pound_per_square_inch";
31
- })(UnitUs || (UnitUs = {}));
32
- var UnitSi;
33
- (function (UnitSi) {
34
- UnitSi["newton"] = "newton";
35
- UnitSi["pascal"] = "pascal";
36
- UnitSi["kilopascal"] = "kilopascal";
37
- UnitSi["watt"] = "watt";
38
- UnitSi["bar"] = "bar";
39
- UnitSi["centimetre"] = "centimetre";
40
- UnitSi["millimetre"] = "millimetre";
41
- UnitSi["metre"] = "metre";
42
- UnitSi["kilometre"] = "kilometre";
43
- UnitSi["gram"] = "gram";
44
- UnitSi["kilogram"] = "kilogram";
45
- UnitSi["kilowatt"] = "kilowatt";
46
- UnitSi["kilowatthour"] = "kilowatthour";
47
- UnitSi["kilogram_per_hour"] = "kilogram_per_hour";
48
- UnitSi["kilogram_per_second"] = "kilogram_per_second";
49
- UnitSi["square_kilometre"] = "square_kilometre";
50
- UnitSi["kilometre_per_hour"] = "kilometre_per_hour";
51
- UnitSi["litre"] = "litre";
52
- UnitSi["square_metre"] = "square_metre";
53
- UnitSi["cubic_metre"] = "cubic_metre";
54
- UnitSi["metre_per_second"] = "metre_per_second";
55
- UnitSi["metre_per_second_squared"] = "metre_per_second_squared";
56
- UnitSi["ton"] = "ton";
57
- UnitSi["hectare"] = "hectare";
58
- UnitSi["hour"] = "hour";
59
- })(UnitSi || (UnitSi = {}));
1
+ const customFieldType = {
2
+ BOOLEAN: "BOOLEAN",
3
+ DATE: "DATE",
4
+ DROPDOWN: "DROPDOWN",
5
+ EMAIL: "EMAIL",
6
+ JSON: "JSON",
7
+ MONETARY: "MONETARY",
8
+ NUMBER: "NUMBER",
9
+ PHONE_NUMBER: "PHONE_NUMBER",
10
+ STRING: "STRING",
11
+ WEB_ADDRESS: "WEB_ADDRESS",
12
+ };
13
+ const UnitUs = {
14
+ acre: "acre",
15
+ foot: "foot",
16
+ square_foot: "square_foot",
17
+ cubic_foot: "cubic_foot",
18
+ gallon_liquid: "gallon_liquid",
19
+ inch: "inch",
20
+ pound: "pound",
21
+ pound_per_hour: "pound_per_hour",
22
+ pound_per_second: "pound_per_second",
23
+ mile: "mile",
24
+ mile_per_hour: "mile_per_hour",
25
+ ounce: "ounce",
26
+ ton_us: "ton_us",
27
+ yard: "yard",
28
+ pound_per_square_inch: "pound_per_square_inch",
29
+ };
30
+ const UnitSi = {
31
+ newton: "newton",
32
+ pascal: "pascal",
33
+ kilopascal: "kilopascal",
34
+ watt: "watt",
35
+ bar: "bar",
36
+ centimetre: "centimetre",
37
+ millimetre: "millimetre",
38
+ metre: "metre",
39
+ kilometre: "kilometre",
40
+ gram: "gram",
41
+ kilogram: "kilogram",
42
+ kilowatt: "kilowatt",
43
+ kilowatthour: "kilowatthour",
44
+ kilogram_per_hour: "kilogram_per_hour",
45
+ kilogram_per_second: "kilogram_per_second",
46
+ square_kilometre: "square_kilometre",
47
+ kilometre_per_hour: "kilometre_per_hour",
48
+ litre: "litre",
49
+ square_metre: "square_metre",
50
+ cubic_metre: "cubic_metre",
51
+ metre_per_second: "metre_per_second",
52
+ metre_per_second_squared: "metre_per_second_squared",
53
+ ton: "ton",
54
+ hectare: "hectare",
55
+ hour: "hour",
56
+ };
60
57
 
61
58
  var BodyType;
62
59
  (function (BodyType) {
@@ -64,4 +61,4 @@ var BodyType;
64
61
  BodyType[BodyType["FormData"] = 1] = "FormData";
65
62
  })(BodyType || (BodyType = {}));
66
63
 
67
- export { BodyType, CustomFieldType, UnitSi, UnitUs };
64
+ export { BodyType, UnitSi, UnitUs, customFieldType };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/iris-app-runtime-core-api",
3
- "version": "0.3.87",
3
+ "version": "0.3.90",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -3,18 +3,19 @@ export interface EntityIdentity {
3
3
  type: EntityType;
4
4
  id: string;
5
5
  }
6
- export declare enum CustomFieldType {
7
- BOOLEAN = "BOOLEAN",
8
- DATE = "DATE",
9
- DROPDOWN = "DROPDOWN",
10
- EMAIL = "EMAIL",
11
- JSON = "JSON",
12
- MONETARY = "MONETARY",
13
- NUMBER = "NUMBER",
14
- PHONE_NUMBER = "PHONE_NUMBER",
15
- STRING = "STRING",
16
- WEB_ADDRESS = "WEB_ADDRESS"
17
- }
6
+ export declare const customFieldType: {
7
+ readonly BOOLEAN: "BOOLEAN";
8
+ readonly DATE: "DATE";
9
+ readonly DROPDOWN: "DROPDOWN";
10
+ readonly EMAIL: "EMAIL";
11
+ readonly JSON: "JSON";
12
+ readonly MONETARY: "MONETARY";
13
+ readonly NUMBER: "NUMBER";
14
+ readonly PHONE_NUMBER: "PHONE_NUMBER";
15
+ readonly STRING: "STRING";
16
+ readonly WEB_ADDRESS: "WEB_ADDRESS";
17
+ };
18
+ export type CustomFieldType = (typeof customFieldType)[keyof typeof customFieldType];
18
19
  /**
19
20
  * The new field definition
20
21
  */
@@ -28,149 +29,148 @@ export interface AbstractCustomFieldDefinitionObject {
28
29
  } | null;
29
30
  } | null;
30
31
  /** The title */
31
- title: string | null;
32
- entityType: string;
32
+ title?: string | null;
33
33
  description?: string | null;
34
34
  uiVisible?: boolean | null;
35
35
  uiEditable?: boolean | null;
36
- type: CustomFieldType;
36
+ type?: CustomFieldType | null;
37
37
  }
38
38
  export type BooleanFieldDefinition = AbstractCustomFieldDefinitionObject & {
39
- type: CustomFieldType.BOOLEAN;
39
+ type: "BOOLEAN";
40
40
  };
41
41
  export type DateFieldDefinition = AbstractCustomFieldDefinitionObject & {
42
42
  /**
43
43
  * ISO8601 formatted date
44
44
  */
45
- type: CustomFieldType.DATE;
45
+ type: "DATE";
46
46
  };
47
47
  export type PhoneNumberFieldDefinition = AbstractCustomFieldDefinitionObject & {
48
- type: CustomFieldType.PHONE_NUMBER;
48
+ type: "PHONE_NUMBER";
49
49
  };
50
50
  export type EmailFieldDefinition = AbstractCustomFieldDefinitionObject & {
51
- type: CustomFieldType.EMAIL;
51
+ type: "EMAIL";
52
52
  };
53
53
  export type JsonFieldDefinition = AbstractCustomFieldDefinitionObject & {
54
- type: CustomFieldType.JSON;
54
+ type: "JSON";
55
55
  };
56
56
  export type MonetaryFieldDefinition = AbstractCustomFieldDefinitionObject & {
57
57
  currency: string;
58
58
  minimumNumber?: number | null;
59
59
  maximumNumber?: number | null;
60
- type: CustomFieldType.MONETARY;
60
+ type: "MONETARY";
61
61
  };
62
62
  export type WebAddressFieldDefinition = AbstractCustomFieldDefinitionObject & {
63
- type: CustomFieldType.WEB_ADDRESS;
63
+ type: "WEB_ADDRESS";
64
64
  };
65
65
  export type DropDownFieldDefinition = AbstractCustomFieldDefinitionObject & {
66
66
  multiSelect?: boolean | null;
67
67
  allValues?: string[] | null;
68
- type: CustomFieldType.DROPDOWN;
69
- };
70
- export declare enum UnitUs {
71
- acre = "acre",
72
- foot = "foot",
73
- square_foot = "square_foot",
74
- cubic_foot = "cubic_foot",
75
- gallon_liquid = "gallon_liquid",
76
- inch = "inch",
77
- pound = "pound",
78
- pound_per_hour = "pound_per_hour",
79
- pound_per_second = "pound_per_second",
80
- mile = "mile",
81
- mile_per_hour = "mile_per_hour",
82
- ounce = "ounce",
83
- ton_us = "ton_us",
84
- yard = "yard",
85
- pound_per_square_inch = "pound_per_square_inch"
86
- }
87
- export type UnitUsType = `${UnitUs}`;
88
- export declare enum UnitSi {
89
- newton = "newton",
90
- pascal = "pascal",
91
- kilopascal = "kilopascal",
92
- watt = "watt",
93
- bar = "bar",
94
- centimetre = "centimetre",
95
- millimetre = "millimetre",
96
- metre = "metre",
97
- kilometre = "kilometre",
98
- gram = "gram",
99
- kilogram = "kilogram",
100
- kilowatt = "kilowatt",
101
- kilowatthour = "kilowatthour",
102
- kilogram_per_hour = "kilogram_per_hour",
103
- kilogram_per_second = "kilogram_per_second",
104
- square_kilometre = "square_kilometre",
105
- kilometre_per_hour = "kilometre_per_hour",
106
- litre = "litre",
107
- square_metre = "square_metre",
108
- cubic_metre = "cubic_metre",
109
- metre_per_second = "metre_per_second",
110
- metre_per_second_squared = "metre_per_second_squared",
111
- ton = "ton",
112
- hectare = "hectare",
113
- hour = "hour"
114
- }
115
- export type UnitSiType = `${UnitSi}`;
68
+ type: "DROPDOWN";
69
+ };
70
+ export declare const UnitUs: {
71
+ readonly acre: "acre";
72
+ readonly foot: "foot";
73
+ readonly square_foot: "square_foot";
74
+ readonly cubic_foot: "cubic_foot";
75
+ readonly gallon_liquid: "gallon_liquid";
76
+ readonly inch: "inch";
77
+ readonly pound: "pound";
78
+ readonly pound_per_hour: "pound_per_hour";
79
+ readonly pound_per_second: "pound_per_second";
80
+ readonly mile: "mile";
81
+ readonly mile_per_hour: "mile_per_hour";
82
+ readonly ounce: "ounce";
83
+ readonly ton_us: "ton_us";
84
+ readonly yard: "yard";
85
+ readonly pound_per_square_inch: "pound_per_square_inch";
86
+ };
87
+ export type UnitUsType = (typeof UnitUs)[keyof typeof UnitUs];
88
+ export declare const UnitSi: {
89
+ readonly newton: "newton";
90
+ readonly pascal: "pascal";
91
+ readonly kilopascal: "kilopascal";
92
+ readonly watt: "watt";
93
+ readonly bar: "bar";
94
+ readonly centimetre: "centimetre";
95
+ readonly millimetre: "millimetre";
96
+ readonly metre: "metre";
97
+ readonly kilometre: "kilometre";
98
+ readonly gram: "gram";
99
+ readonly kilogram: "kilogram";
100
+ readonly kilowatt: "kilowatt";
101
+ readonly kilowatthour: "kilowatthour";
102
+ readonly kilogram_per_hour: "kilogram_per_hour";
103
+ readonly kilogram_per_second: "kilogram_per_second";
104
+ readonly square_kilometre: "square_kilometre";
105
+ readonly kilometre_per_hour: "kilometre_per_hour";
106
+ readonly litre: "litre";
107
+ readonly square_metre: "square_metre";
108
+ readonly cubic_metre: "cubic_metre";
109
+ readonly metre_per_second: "metre_per_second";
110
+ readonly metre_per_second_squared: "metre_per_second_squared";
111
+ readonly ton: "ton";
112
+ readonly hectare: "hectare";
113
+ readonly hour: "hour";
114
+ };
115
+ export type UnitSiType = (typeof UnitSi)[keyof typeof UnitSi];
116
116
  export type NumberFieldDefinition = AbstractCustomFieldDefinitionObject & {
117
117
  minimumNumber?: number | null;
118
118
  maximumNumber?: number | null;
119
- unitSi?: UnitSi | null;
120
- unitUs?: UnitUs | null;
119
+ unitSi?: UnitSiType | null;
120
+ unitUs?: UnitUsType | null;
121
121
  isInteger?: boolean | null;
122
- type: CustomFieldType.NUMBER;
122
+ type: "NUMBER";
123
123
  };
124
124
  export type StringFieldDefinition = AbstractCustomFieldDefinitionObject & {
125
125
  minimumLength?: number | null;
126
126
  maximumLength?: number | null;
127
127
  pattern?: string | null;
128
- type: CustomFieldType.STRING;
128
+ type: "STRING";
129
129
  };
130
130
  export interface AbstractCustomFieldValue {
131
131
  type: CustomFieldType;
132
132
  }
133
133
  export type BooleanFieldValue = {
134
- type: CustomFieldType.BOOLEAN;
134
+ type: "BOOLEAN";
135
135
  booleanValue?: boolean | null;
136
136
  };
137
137
  export type DateFieldValue = {
138
- type: CustomFieldType.DATE;
138
+ type: "DATE";
139
139
  /**
140
140
  * ISO8601 formatted date
141
141
  */
142
142
  dateValue?: string | null;
143
143
  };
144
144
  export type DropDownFieldValue = {
145
- type: CustomFieldType.DROPDOWN;
145
+ type: "DROPDOWN";
146
146
  stringArrayValue?: string[];
147
147
  };
148
148
  export type EmailFieldValue = {
149
- type: CustomFieldType.EMAIL;
149
+ type: "EMAIL";
150
150
  stringValue?: string | null;
151
151
  };
152
152
  export type JsonFieldValue = {
153
- type: CustomFieldType.JSON;
153
+ type: "JSON";
154
154
  jsonValue?: unknown | null;
155
155
  };
156
156
  export type MonetaryFieldValue = {
157
- type: CustomFieldType.MONETARY;
157
+ type: "MONETARY";
158
158
  numberValue?: number | null;
159
159
  };
160
160
  export type NumberFieldValue = {
161
- type: CustomFieldType.NUMBER;
161
+ type: "NUMBER";
162
162
  numberValue?: number | null;
163
163
  };
164
164
  export type PhoneNumberFieldValue = {
165
- type: CustomFieldType.PHONE_NUMBER;
165
+ type: "PHONE_NUMBER";
166
166
  stringValue?: string | null;
167
167
  };
168
168
  export type StringFieldValue = {
169
- type: CustomFieldType.STRING;
169
+ type: "STRING";
170
170
  stringValue?: string | null;
171
171
  };
172
172
  export type WebAddressFieldValue = {
173
- type: CustomFieldType.WEB_ADDRESS;
173
+ type: "WEB_ADDRESS";
174
174
  stringValue?: string | null;
175
175
  };
176
176
  export type CustomFieldDefinition = BooleanFieldDefinition | DateFieldDefinition | DropDownFieldDefinition | EmailFieldDefinition | JsonFieldDefinition | MonetaryFieldDefinition | NumberFieldDefinition | PhoneNumberFieldDefinition | StringFieldDefinition | WebAddressFieldDefinition;
@@ -11,7 +11,7 @@ export interface CustomFieldError {
11
11
  */
12
12
  customFieldKeys: string[];
13
13
  }
14
- export interface HostConnectorApi extends IAnalyticsContextAsync<{}>, INavigationContext, IOemBrandingContext, ICurrentUserPreferenceContext {
14
+ export interface HostConnectorApi extends IAnalyticsContextAsync<Record<string, never>>, INavigationContext, IOemBrandingContext, ICurrentUserPreferenceContext {
15
15
  getAssetSortingState(): Promise<IAssetSortingContext["sortingState"]>;
16
16
  setAssetSortingState(...args: Parameters<IAssetSortingContext["setSortBy"]>): Promise<void>;
17
17
  getEnvironmentContext(): Promise<IEnvironmentContext>;