@trackunit/iris-app-runtime-core-api 1.9.4 → 1.9.7
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 +65 -13
- package/index.esm.js +60 -14
- package/package.json +3 -3
- package/src/AssetSortingRuntime.d.ts +3 -0
- package/src/NavigationRuntime.d.ts +31 -6
package/index.cjs.js
CHANGED
|
@@ -41,6 +41,9 @@ exports.AssetSortByProperty = void 0;
|
|
|
41
41
|
AssetSortByProperty["Type"] = "TYPE";
|
|
42
42
|
AssetSortByProperty["PlannedServiceBooked"] = "PLANNED_SERVICE_BOOKED";
|
|
43
43
|
AssetSortByProperty["PlannedServiceBookingDate"] = "PLANNED_SERVICE_BOOKING_DATE";
|
|
44
|
+
AssetSortByProperty["PlannedServiceDate"] = "PLANNED_SERVICE_DATE";
|
|
45
|
+
AssetSortByProperty["PlannedServiceHoursRemaining"] = "PLANNED_SERVICE_HOURS_REMAINING";
|
|
46
|
+
AssetSortByProperty["PlannedServiceDistanceRemaining"] = "PLANNED_SERVICE_DISTANCE_REMAINING";
|
|
44
47
|
AssetSortByProperty["ServicePlanPrediction"] = "SERVICE_PLAN_PREDICTION";
|
|
45
48
|
AssetSortByProperty["IssueCreatedAt"] = "ISSUE_CREATED_AT";
|
|
46
49
|
AssetSortByProperty["BatteryChargerState"] = "BATTERY_CHARGER_STATE";
|
|
@@ -75,6 +78,9 @@ const stringToEnum = {
|
|
|
75
78
|
TYPE: exports.AssetSortByProperty.Type,
|
|
76
79
|
PLANNED_SERVICE_BOOKED: exports.AssetSortByProperty.PlannedServiceBooked,
|
|
77
80
|
PLANNED_SERVICE_BOOKING_DATE: exports.AssetSortByProperty.PlannedServiceBookingDate,
|
|
81
|
+
PLANNED_SERVICE_DATE: exports.AssetSortByProperty.PlannedServiceDate,
|
|
82
|
+
PLANNED_SERVICE_HOURS_REMAINING: exports.AssetSortByProperty.PlannedServiceHoursRemaining,
|
|
83
|
+
PLANNED_SERVICE_DISTANCE_REMAINING: exports.AssetSortByProperty.PlannedServiceDistanceRemaining,
|
|
78
84
|
SERVICE_PLAN_PREDICTION: exports.AssetSortByProperty.ServicePlanPrediction,
|
|
79
85
|
ISSUE_CREATED_AT: exports.AssetSortByProperty.IssueCreatedAt,
|
|
80
86
|
BATTERY_CHARGER_STATE: exports.AssetSortByProperty.BatteryChargerState,
|
|
@@ -238,31 +244,71 @@ const UnitSi = {
|
|
|
238
244
|
hour: "HOUR",
|
|
239
245
|
};
|
|
240
246
|
|
|
241
|
-
const mainApps = ["
|
|
242
|
-
const assetHomePageIds = [
|
|
243
|
-
"status",
|
|
244
|
-
"movement",
|
|
245
|
-
"events",
|
|
246
|
-
"insights",
|
|
247
|
-
"specification",
|
|
248
|
-
"telematics",
|
|
249
|
-
"contracts",
|
|
250
|
-
];
|
|
247
|
+
const mainApps = ["myhome", "map", "assets", "sites", "customers", "groups", "reports"];
|
|
248
|
+
const assetHomePageIds = ["status", "movement", "events", "insights", "specification", "telematics"];
|
|
251
249
|
const siteHomePageIds = ["overview", "assets", "asset-visibility"];
|
|
252
250
|
const groupHomePageIds = ["assets", "users", "details"];
|
|
253
251
|
const customerHomePageIds = ["info", "assets", "contact-list"];
|
|
252
|
+
const allPages = [
|
|
253
|
+
...assetHomePageIds,
|
|
254
|
+
...siteHomePageIds,
|
|
255
|
+
...groupHomePageIds,
|
|
256
|
+
...customerHomePageIds,
|
|
257
|
+
...mainApps,
|
|
258
|
+
];
|
|
254
259
|
/**
|
|
255
260
|
* type guard for IrisAppOptions
|
|
256
261
|
*/
|
|
257
262
|
const isIrisOptions = (options) => {
|
|
258
|
-
if (!options) {
|
|
259
|
-
return false;
|
|
260
|
-
}
|
|
261
263
|
return (typeof options === "object" &&
|
|
262
264
|
"irisAppId" in options &&
|
|
263
265
|
Boolean(options.irisAppId) &&
|
|
264
266
|
"extensionId" in options);
|
|
265
267
|
};
|
|
268
|
+
/**
|
|
269
|
+
* type guard for FleetAppStandardOptions
|
|
270
|
+
*/
|
|
271
|
+
const isFleetAppStandardOptions = (options) => {
|
|
272
|
+
// eslint-disable-next-line local-rules/no-typescript-assertion
|
|
273
|
+
return Boolean(options.page && mainApps.includes(options.page) && !isIrisOptions(options));
|
|
274
|
+
};
|
|
275
|
+
/**
|
|
276
|
+
* type guard for AssetHomeOptions
|
|
277
|
+
*/
|
|
278
|
+
const isAssetHomeOptions = (options) => {
|
|
279
|
+
return Boolean(typeof options === "object" &&
|
|
280
|
+
"assetId" in options &&
|
|
281
|
+
Boolean(options.assetId) &&
|
|
282
|
+
typeof options.page === "string" &&
|
|
283
|
+
!isIrisOptions(options) &&
|
|
284
|
+
assetHomePageIds.includes(options.page));
|
|
285
|
+
};
|
|
286
|
+
/**
|
|
287
|
+
* type guard for SiteHomeOptions
|
|
288
|
+
*/
|
|
289
|
+
const isSiteHomeOptions = (options) => {
|
|
290
|
+
return Boolean(typeof options === "object" &&
|
|
291
|
+
"siteId" in options &&
|
|
292
|
+
Boolean(options.siteId) &&
|
|
293
|
+
typeof options.page === "string" &&
|
|
294
|
+
!isIrisOptions(options) &&
|
|
295
|
+
siteHomePageIds.includes(options.page));
|
|
296
|
+
};
|
|
297
|
+
/**
|
|
298
|
+
* type guard for GroupHomeStandardOptions
|
|
299
|
+
*/
|
|
300
|
+
const isGroupHomeStandardOptions = (options) => {
|
|
301
|
+
// eslint-disable-next-line local-rules/no-typescript-assertion
|
|
302
|
+
return Boolean(options.page && !isIrisOptions(options) && groupHomePageIds.includes(options.page));
|
|
303
|
+
};
|
|
304
|
+
/**
|
|
305
|
+
* type guard for CustomerHomeStandardOptions
|
|
306
|
+
*/
|
|
307
|
+
const isCustomerHomeStandardOptions = (options) => {
|
|
308
|
+
return Boolean(
|
|
309
|
+
// eslint-disable-next-line local-rules/no-typescript-assertion
|
|
310
|
+
options.page && !isIrisOptions(options) && customerHomePageIds.includes(options.page));
|
|
311
|
+
};
|
|
266
312
|
|
|
267
313
|
exports.BodyType = void 0;
|
|
268
314
|
(function (BodyType) {
|
|
@@ -297,11 +343,17 @@ exports.UnitOfMeasurement = UnitOfMeasurement;
|
|
|
297
343
|
exports.UnitSi = UnitSi;
|
|
298
344
|
exports.UnitUs = UnitUs;
|
|
299
345
|
exports.UserSubscriptionPackage = UserSubscriptionPackage;
|
|
346
|
+
exports.allPages = allPages;
|
|
300
347
|
exports.assetHomePageIds = assetHomePageIds;
|
|
301
348
|
exports.createEvent = createEvent;
|
|
302
349
|
exports.customerHomePageIds = customerHomePageIds;
|
|
303
350
|
exports.groupHomePageIds = groupHomePageIds;
|
|
351
|
+
exports.isAssetHomeOptions = isAssetHomeOptions;
|
|
352
|
+
exports.isCustomerHomeStandardOptions = isCustomerHomeStandardOptions;
|
|
353
|
+
exports.isFleetAppStandardOptions = isFleetAppStandardOptions;
|
|
354
|
+
exports.isGroupHomeStandardOptions = isGroupHomeStandardOptions;
|
|
304
355
|
exports.isIrisOptions = isIrisOptions;
|
|
356
|
+
exports.isSiteHomeOptions = isSiteHomeOptions;
|
|
305
357
|
exports.mainApps = mainApps;
|
|
306
358
|
exports.siteHomePageIds = siteHomePageIds;
|
|
307
359
|
exports.validateStringAsAssetSortByProperty = validateStringAsAssetSortByProperty;
|
package/index.esm.js
CHANGED
|
@@ -39,6 +39,9 @@ var AssetSortByProperty;
|
|
|
39
39
|
AssetSortByProperty["Type"] = "TYPE";
|
|
40
40
|
AssetSortByProperty["PlannedServiceBooked"] = "PLANNED_SERVICE_BOOKED";
|
|
41
41
|
AssetSortByProperty["PlannedServiceBookingDate"] = "PLANNED_SERVICE_BOOKING_DATE";
|
|
42
|
+
AssetSortByProperty["PlannedServiceDate"] = "PLANNED_SERVICE_DATE";
|
|
43
|
+
AssetSortByProperty["PlannedServiceHoursRemaining"] = "PLANNED_SERVICE_HOURS_REMAINING";
|
|
44
|
+
AssetSortByProperty["PlannedServiceDistanceRemaining"] = "PLANNED_SERVICE_DISTANCE_REMAINING";
|
|
42
45
|
AssetSortByProperty["ServicePlanPrediction"] = "SERVICE_PLAN_PREDICTION";
|
|
43
46
|
AssetSortByProperty["IssueCreatedAt"] = "ISSUE_CREATED_AT";
|
|
44
47
|
AssetSortByProperty["BatteryChargerState"] = "BATTERY_CHARGER_STATE";
|
|
@@ -73,6 +76,9 @@ const stringToEnum = {
|
|
|
73
76
|
TYPE: AssetSortByProperty.Type,
|
|
74
77
|
PLANNED_SERVICE_BOOKED: AssetSortByProperty.PlannedServiceBooked,
|
|
75
78
|
PLANNED_SERVICE_BOOKING_DATE: AssetSortByProperty.PlannedServiceBookingDate,
|
|
79
|
+
PLANNED_SERVICE_DATE: AssetSortByProperty.PlannedServiceDate,
|
|
80
|
+
PLANNED_SERVICE_HOURS_REMAINING: AssetSortByProperty.PlannedServiceHoursRemaining,
|
|
81
|
+
PLANNED_SERVICE_DISTANCE_REMAINING: AssetSortByProperty.PlannedServiceDistanceRemaining,
|
|
76
82
|
SERVICE_PLAN_PREDICTION: AssetSortByProperty.ServicePlanPrediction,
|
|
77
83
|
ISSUE_CREATED_AT: AssetSortByProperty.IssueCreatedAt,
|
|
78
84
|
BATTERY_CHARGER_STATE: AssetSortByProperty.BatteryChargerState,
|
|
@@ -236,31 +242,71 @@ const UnitSi = {
|
|
|
236
242
|
hour: "HOUR",
|
|
237
243
|
};
|
|
238
244
|
|
|
239
|
-
const mainApps = ["
|
|
240
|
-
const assetHomePageIds = [
|
|
241
|
-
"status",
|
|
242
|
-
"movement",
|
|
243
|
-
"events",
|
|
244
|
-
"insights",
|
|
245
|
-
"specification",
|
|
246
|
-
"telematics",
|
|
247
|
-
"contracts",
|
|
248
|
-
];
|
|
245
|
+
const mainApps = ["myhome", "map", "assets", "sites", "customers", "groups", "reports"];
|
|
246
|
+
const assetHomePageIds = ["status", "movement", "events", "insights", "specification", "telematics"];
|
|
249
247
|
const siteHomePageIds = ["overview", "assets", "asset-visibility"];
|
|
250
248
|
const groupHomePageIds = ["assets", "users", "details"];
|
|
251
249
|
const customerHomePageIds = ["info", "assets", "contact-list"];
|
|
250
|
+
const allPages = [
|
|
251
|
+
...assetHomePageIds,
|
|
252
|
+
...siteHomePageIds,
|
|
253
|
+
...groupHomePageIds,
|
|
254
|
+
...customerHomePageIds,
|
|
255
|
+
...mainApps,
|
|
256
|
+
];
|
|
252
257
|
/**
|
|
253
258
|
* type guard for IrisAppOptions
|
|
254
259
|
*/
|
|
255
260
|
const isIrisOptions = (options) => {
|
|
256
|
-
if (!options) {
|
|
257
|
-
return false;
|
|
258
|
-
}
|
|
259
261
|
return (typeof options === "object" &&
|
|
260
262
|
"irisAppId" in options &&
|
|
261
263
|
Boolean(options.irisAppId) &&
|
|
262
264
|
"extensionId" in options);
|
|
263
265
|
};
|
|
266
|
+
/**
|
|
267
|
+
* type guard for FleetAppStandardOptions
|
|
268
|
+
*/
|
|
269
|
+
const isFleetAppStandardOptions = (options) => {
|
|
270
|
+
// eslint-disable-next-line local-rules/no-typescript-assertion
|
|
271
|
+
return Boolean(options.page && mainApps.includes(options.page) && !isIrisOptions(options));
|
|
272
|
+
};
|
|
273
|
+
/**
|
|
274
|
+
* type guard for AssetHomeOptions
|
|
275
|
+
*/
|
|
276
|
+
const isAssetHomeOptions = (options) => {
|
|
277
|
+
return Boolean(typeof options === "object" &&
|
|
278
|
+
"assetId" in options &&
|
|
279
|
+
Boolean(options.assetId) &&
|
|
280
|
+
typeof options.page === "string" &&
|
|
281
|
+
!isIrisOptions(options) &&
|
|
282
|
+
assetHomePageIds.includes(options.page));
|
|
283
|
+
};
|
|
284
|
+
/**
|
|
285
|
+
* type guard for SiteHomeOptions
|
|
286
|
+
*/
|
|
287
|
+
const isSiteHomeOptions = (options) => {
|
|
288
|
+
return Boolean(typeof options === "object" &&
|
|
289
|
+
"siteId" in options &&
|
|
290
|
+
Boolean(options.siteId) &&
|
|
291
|
+
typeof options.page === "string" &&
|
|
292
|
+
!isIrisOptions(options) &&
|
|
293
|
+
siteHomePageIds.includes(options.page));
|
|
294
|
+
};
|
|
295
|
+
/**
|
|
296
|
+
* type guard for GroupHomeStandardOptions
|
|
297
|
+
*/
|
|
298
|
+
const isGroupHomeStandardOptions = (options) => {
|
|
299
|
+
// eslint-disable-next-line local-rules/no-typescript-assertion
|
|
300
|
+
return Boolean(options.page && !isIrisOptions(options) && groupHomePageIds.includes(options.page));
|
|
301
|
+
};
|
|
302
|
+
/**
|
|
303
|
+
* type guard for CustomerHomeStandardOptions
|
|
304
|
+
*/
|
|
305
|
+
const isCustomerHomeStandardOptions = (options) => {
|
|
306
|
+
return Boolean(
|
|
307
|
+
// eslint-disable-next-line local-rules/no-typescript-assertion
|
|
308
|
+
options.page && !isIrisOptions(options) && customerHomePageIds.includes(options.page));
|
|
309
|
+
};
|
|
264
310
|
|
|
265
311
|
var BodyType;
|
|
266
312
|
(function (BodyType) {
|
|
@@ -289,4 +335,4 @@ const UserSubscriptionPackage = {
|
|
|
289
335
|
CUSTOMER_PORTAL: "Customer Portal",
|
|
290
336
|
};
|
|
291
337
|
|
|
292
|
-
export { AssetSortByProperty, BodyType, SortOrder, SystemOfMeasurement, TimeZonePreference, UnitOfMeasurement, UnitSi, UnitUs, UserSubscriptionPackage, assetHomePageIds, createEvent, customerHomePageIds, groupHomePageIds, isIrisOptions, mainApps, siteHomePageIds, validateStringAsAssetSortByProperty };
|
|
338
|
+
export { AssetSortByProperty, BodyType, SortOrder, SystemOfMeasurement, TimeZonePreference, UnitOfMeasurement, UnitSi, UnitUs, UserSubscriptionPackage, allPages, assetHomePageIds, createEvent, customerHomePageIds, groupHomePageIds, isAssetHomeOptions, isCustomerHomeStandardOptions, isFleetAppStandardOptions, isGroupHomeStandardOptions, isIrisOptions, isSiteHomeOptions, mainApps, siteHomePageIds, validateStringAsAssetSortByProperty };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/iris-app-runtime-core-api",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.7",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@graphql-typed-document-node/core": "^3.2.0",
|
|
11
|
-
"@trackunit/shared-utils": "1.11.
|
|
12
|
-
"@trackunit/geo-json-utils": "1.9.
|
|
11
|
+
"@trackunit/shared-utils": "1.11.5",
|
|
12
|
+
"@trackunit/geo-json-utils": "1.9.5"
|
|
13
13
|
},
|
|
14
14
|
"module": "./index.esm.js",
|
|
15
15
|
"main": "./index.cjs.js",
|
|
@@ -21,6 +21,9 @@ export declare enum AssetSortByProperty {
|
|
|
21
21
|
Type = "TYPE",
|
|
22
22
|
PlannedServiceBooked = "PLANNED_SERVICE_BOOKED",
|
|
23
23
|
PlannedServiceBookingDate = "PLANNED_SERVICE_BOOKING_DATE",
|
|
24
|
+
PlannedServiceDate = "PLANNED_SERVICE_DATE",
|
|
25
|
+
PlannedServiceHoursRemaining = "PLANNED_SERVICE_HOURS_REMAINING",
|
|
26
|
+
PlannedServiceDistanceRemaining = "PLANNED_SERVICE_DISTANCE_REMAINING",
|
|
24
27
|
ServicePlanPrediction = "SERVICE_PLAN_PREDICTION",
|
|
25
28
|
IssueCreatedAt = "ISSUE_CREATED_AT",
|
|
26
29
|
BatteryChargerState = "BATTERY_CHARGER_STATE",
|
|
@@ -21,14 +21,14 @@ export type IrisAppOptions = {
|
|
|
21
21
|
irisAppId: string;
|
|
22
22
|
extensionId: string;
|
|
23
23
|
} & SubPage & Search & FragmentIdentifier & NeverPage;
|
|
24
|
-
export declare const mainApps: readonly ["
|
|
24
|
+
export declare const mainApps: readonly ["myhome", "map", "assets", "sites", "customers", "groups", "reports"];
|
|
25
25
|
export type MainFleetApp = (typeof mainApps)[number];
|
|
26
26
|
export type FleetAppStandardOptions = Page<MainFleetApp> & NeverIrisApp;
|
|
27
27
|
export type MapAppStandardOptions = Page<"map"> & NeverIrisApp;
|
|
28
28
|
export type MarketplaceOptions = {
|
|
29
29
|
irisAppId: string;
|
|
30
30
|
};
|
|
31
|
-
export declare const assetHomePageIds: readonly ["status", "movement", "events", "insights", "specification", "telematics"
|
|
31
|
+
export declare const assetHomePageIds: readonly ["status", "movement", "events", "insights", "specification", "telematics"];
|
|
32
32
|
export type AssetHomePageId = (typeof assetHomePageIds)[number];
|
|
33
33
|
export type AssetHomeStandardOptions = Page<AssetHomePageId> & NeverIrisApp;
|
|
34
34
|
export declare const siteHomePageIds: readonly ["overview", "assets", "asset-visibility"];
|
|
@@ -40,14 +40,39 @@ export type GroupHomeStandardOptions = Page<GroupHomePageId> & NeverIrisApp;
|
|
|
40
40
|
export declare const customerHomePageIds: readonly ["info", "assets", "contact-list"];
|
|
41
41
|
export type CustomerHomePageId = (typeof customerHomePageIds)[number];
|
|
42
42
|
export type CustomerHomeStandardOptions = Page<CustomerHomePageId> & NeverIrisApp;
|
|
43
|
-
export
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
export declare const allPages: readonly ["status", "movement", "events", "insights", "specification", "telematics", "overview", "assets", "asset-visibility", "assets", "users", "details", "info", "assets", "contact-list", "myhome", "map", "assets", "sites", "customers", "groups", "reports"];
|
|
44
|
+
export type AllPages = (typeof allPages)[number];
|
|
45
|
+
export type AssetHomeOptions = AssetHomeStandardOptions & {
|
|
46
|
+
assetId: string;
|
|
46
47
|
};
|
|
48
|
+
export type SiteHomeOptions = SiteHomeStandardOptions & {
|
|
49
|
+
siteId: string;
|
|
50
|
+
};
|
|
51
|
+
export type HasAccessToOptions = IrisAppOptions | AssetHomeOptions | SiteHomeOptions | GroupHomeStandardOptions | CustomerHomeStandardOptions | FleetAppStandardOptions;
|
|
47
52
|
/**
|
|
48
53
|
* type guard for IrisAppOptions
|
|
49
54
|
*/
|
|
50
|
-
export declare const isIrisOptions: (options: IrisAppOptions |
|
|
55
|
+
export declare const isIrisOptions: (options: IrisAppOptions | AssetHomeStandardOptions | SiteHomeStandardOptions | FleetAppStandardOptions | GroupHomeStandardOptions | CustomerHomeStandardOptions | undefined) => options is IrisAppOptions;
|
|
56
|
+
/**
|
|
57
|
+
* type guard for FleetAppStandardOptions
|
|
58
|
+
*/
|
|
59
|
+
export declare const isFleetAppStandardOptions: (options: HasAccessToOptions) => options is FleetAppStandardOptions;
|
|
60
|
+
/**
|
|
61
|
+
* type guard for AssetHomeOptions
|
|
62
|
+
*/
|
|
63
|
+
export declare const isAssetHomeOptions: (options: HasAccessToOptions) => options is AssetHomeOptions;
|
|
64
|
+
/**
|
|
65
|
+
* type guard for SiteHomeOptions
|
|
66
|
+
*/
|
|
67
|
+
export declare const isSiteHomeOptions: (options: HasAccessToOptions) => options is SiteHomeOptions;
|
|
68
|
+
/**
|
|
69
|
+
* type guard for GroupHomeStandardOptions
|
|
70
|
+
*/
|
|
71
|
+
export declare const isGroupHomeStandardOptions: (options: HasAccessToOptions) => options is GroupHomeStandardOptions;
|
|
72
|
+
/**
|
|
73
|
+
* type guard for CustomerHomeStandardOptions
|
|
74
|
+
*/
|
|
75
|
+
export declare const isCustomerHomeStandardOptions: (options: HasAccessToOptions) => options is CustomerHomeStandardOptions;
|
|
51
76
|
export interface NavigationRuntimeApi {
|
|
52
77
|
hasAccessTo: (options: HasAccessToOptions) => Promise<boolean>;
|
|
53
78
|
gotoAssetHome: (assetId: string, options?: IrisAppOptions | AssetHomeStandardOptions) => Promise<boolean>;
|