@awarevue/api-types 2.0.118 → 2.0.120
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.
|
@@ -518,6 +518,23 @@ export declare const sPushFile: z.ZodObject<{
|
|
|
518
518
|
args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
519
519
|
url: z.ZodString;
|
|
520
520
|
}, z.core.$strip>;
|
|
521
|
+
export declare const sPushTrackableUpdate: z.ZodObject<{
|
|
522
|
+
updates: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
523
|
+
timestamp: z.ZodNumber;
|
|
524
|
+
objectId: z.ZodString;
|
|
525
|
+
objectName: z.ZodString;
|
|
526
|
+
objectKind: z.ZodNullable<z.ZodString>;
|
|
527
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
528
|
+
longitude: z.ZodNumber;
|
|
529
|
+
latitude: z.ZodNumber;
|
|
530
|
+
altitude: z.ZodOptional<z.ZodNumber>;
|
|
531
|
+
speed: z.ZodOptional<z.ZodNumber>;
|
|
532
|
+
heading: z.ZodOptional<z.ZodNumber>;
|
|
533
|
+
}, z.core.$strip>>;
|
|
534
|
+
kind: z.ZodLiteral<"trackable-update">;
|
|
535
|
+
provider: z.ZodString;
|
|
536
|
+
foreignRef: z.ZodString;
|
|
537
|
+
}, z.core.$strip>;
|
|
521
538
|
export declare const sPushStateUpdateRq: z.ZodObject<{
|
|
522
539
|
kind: z.ZodLiteral<"state">;
|
|
523
540
|
foreignRef: z.ZodString;
|
|
@@ -1861,6 +1878,7 @@ export type QueryRq = z.infer<typeof sQueryRq>;
|
|
|
1861
1878
|
export type QueryRs = z.infer<typeof sQueryRs>;
|
|
1862
1879
|
export type ProgressUpdate = z.infer<typeof sProgressUpdate>;
|
|
1863
1880
|
export type PushFile = z.infer<typeof sPushFile>;
|
|
1881
|
+
export type PushTrackableUpdate = z.infer<typeof sPushTrackableUpdate>;
|
|
1864
1882
|
export type PushStateUpdateRq = z.infer<typeof sPushStateUpdateRq>;
|
|
1865
1883
|
export type PushStateUpdateRs = z.infer<typeof sPushStateUpdateRs>;
|
|
1866
1884
|
export type PushEventRq = z.infer<typeof sPushEventRq>;
|
|
@@ -1915,8 +1933,9 @@ export type PayloadByKind = {
|
|
|
1915
1933
|
'describe-object': DescribeObjectRq;
|
|
1916
1934
|
'describe-object-rs': DescribeObjectRs;
|
|
1917
1935
|
'error-rs': ErrorPayload;
|
|
1936
|
+
'trackable-update': PushTrackableUpdate;
|
|
1918
1937
|
};
|
|
1919
|
-
export type FromAgent = ErrorPayload | RegisterRq | Unregister | ValidateProviderConfigRs | StartServiceRs | StopServiceRs | RunCommandRs | QueryRs | PushStateUpdateRq | PushEventRq | ProgressUpdate | GetAvailableDevicesRs | AccessValidateChangeRs | AccessApplyChangeRs | AccessApplyChangeProgress | DescribeObjectRs;
|
|
1938
|
+
export type FromAgent = ErrorPayload | RegisterRq | Unregister | ValidateProviderConfigRs | StartServiceRs | StopServiceRs | RunCommandRs | QueryRs | PushStateUpdateRq | PushTrackableUpdate | PushEventRq | ProgressUpdate | GetAvailableDevicesRs | AccessValidateChangeRs | AccessApplyChangeRs | AccessApplyChangeProgress | DescribeObjectRs;
|
|
1920
1939
|
export type FromServer = ErrorPayload | RegisterRs | ValidateProviderConfigRq | StartServiceRq | StopServiceRq | RunCommandRq | QueryRq | PushFile | PushStateUpdateRs | PushEventRs | GetAvailableDevicesRq | AccessValidateChangeRq | AccessApplyChange | AccessAbortChange | DescribeObjectRq;
|
|
1921
1940
|
export type AnyPayload = FromAgent | FromServer;
|
|
1922
1941
|
export declare const ReplyKindByRequestKind: {
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getAgentMessageIssues = exports.ReplyKindByRequestKind = exports.sDescribeObjectRs = exports.sDescribeObjectRq = exports.sAbortChange = exports.sApplyChangeProgress = exports.sApplyChangeRs = exports.sApplyChange = exports.sValidateChangeRs = exports.sChangeIssue = exports.sChangeIssueCode = exports.sValidateChangeRq = exports.sRefMap = exports.sDeviceMap = exports.sAccessMutation = exports.sObjectDelete = exports.sObjectMerge = exports.sExternalObjectProps = exports.sExternalZoneProps = exports.sExternalAccessRuleProps = exports.sExternalScheduleProps = exports.sExternalPersonProps = exports.sGetAvailableDevicesRs = exports.sGetAvailableDevicesRq = exports.sPushEventRs = exports.sPushEventRq = exports.sPushStateUpdateRs = exports.sPushStateUpdateRq = exports.sPushTrackableUpdate = exports.sPushFile = exports.sProgressUpdate = exports.sQueryRs = exports.sQueryRq = exports.sRunCommandRs = exports.sRunCommandRq = exports.sStopServiceRs = exports.sStopServiceRq = exports.sStartServiceRs = exports.sStartServiceRq = exports.sValidateProviderConfigRs = exports.sConfigurationIssue = exports.sValidateProviderConfigRq = exports.sUnregister = exports.sRegisterRs = exports.sRegisterRq = exports.sErrorPayload = exports.sAgentErrorCode = exports.sResponsePayload = exports.sMessageWithPayload = exports.sMessageHeader = void 0;
|
|
4
|
+
exports.isMessageFromAgent = void 0;
|
|
4
5
|
const device_import_1 = require("../../objects/device/device-import");
|
|
5
6
|
const zod_1 = require("zod");
|
|
6
7
|
const rest_1 = require("../rest");
|
|
7
8
|
const primitives_1 = require("../../primitives");
|
|
8
9
|
const agent_metadata_1 = require("../../objects/agent-metadata");
|
|
9
10
|
const objects_1 = require("../../objects");
|
|
11
|
+
const trackables_1 = require("../ws/trackables");
|
|
10
12
|
// PROTOCOL ENVELOPE
|
|
11
13
|
exports.sMessageHeader = zod_1.z.object({
|
|
12
14
|
version: zod_1.z.number().describe('Protocol version'),
|
|
@@ -133,6 +135,16 @@ exports.sPushFile = zod_1.z
|
|
|
133
135
|
url: zod_1.z.string().nonempty().describe('URL to pull the file from'),
|
|
134
136
|
})
|
|
135
137
|
.describe('Instruction to push a file from an agent to file relay');
|
|
138
|
+
exports.sPushTrackableUpdate = trackables_1.sTrackableUpdatePayload
|
|
139
|
+
.extend({
|
|
140
|
+
kind: zod_1.z.literal('trackable-update'),
|
|
141
|
+
provider: zod_1.z.string().nonempty().describe('Provider that sent the update'),
|
|
142
|
+
foreignRef: zod_1.z
|
|
143
|
+
.string()
|
|
144
|
+
.nonempty()
|
|
145
|
+
.describe('Foreign reference of the trackable in the source provider'),
|
|
146
|
+
})
|
|
147
|
+
.describe('Instruction to push a trackable update from an agent to server');
|
|
136
148
|
// PUSH DEVICE STATE UPDATE
|
|
137
149
|
exports.sPushStateUpdateRq = zod_1.z
|
|
138
150
|
.object({
|
|
@@ -420,6 +432,7 @@ const fromAgentSchemaByKind = {
|
|
|
420
432
|
'query-rs': exports.sQueryRs,
|
|
421
433
|
progress: exports.sProgressUpdate,
|
|
422
434
|
state: exports.sPushStateUpdateRq,
|
|
435
|
+
'trackable-update': exports.sPushTrackableUpdate,
|
|
423
436
|
event: exports.sPushEventRq,
|
|
424
437
|
'get-available-devices-rs': exports.sGetAvailableDevicesRs,
|
|
425
438
|
'validate-change-rs': exports.sValidateChangeRs,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { WebSocketMessage } from './web-socket';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const sTrackableUpdate: z.ZodObject<{
|
|
4
4
|
timestamp: z.ZodNumber;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
objectId: z.ZodString;
|
|
6
|
+
objectName: z.ZodString;
|
|
7
7
|
objectKind: z.ZodNullable<z.ZodString>;
|
|
8
8
|
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
9
9
|
longitude: z.ZodNumber;
|
|
@@ -12,6 +12,21 @@ export declare const sTrackableUpdatePayload: z.ZodObject<{
|
|
|
12
12
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
13
13
|
heading: z.ZodOptional<z.ZodNumber>;
|
|
14
14
|
}, z.core.$strip>;
|
|
15
|
+
export type TrackableUpdate = z.infer<typeof sTrackableUpdate>;
|
|
16
|
+
export declare const sTrackableUpdatePayload: z.ZodObject<{
|
|
17
|
+
updates: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
18
|
+
timestamp: z.ZodNumber;
|
|
19
|
+
objectId: z.ZodString;
|
|
20
|
+
objectName: z.ZodString;
|
|
21
|
+
objectKind: z.ZodNullable<z.ZodString>;
|
|
22
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
23
|
+
longitude: z.ZodNumber;
|
|
24
|
+
latitude: z.ZodNumber;
|
|
25
|
+
altitude: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
speed: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
heading: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
}, z.core.$strip>>;
|
|
29
|
+
}, z.core.$strip>;
|
|
15
30
|
export type TrackableUpdatePayload = z.infer<typeof sTrackableUpdatePayload>;
|
|
16
31
|
interface TrackableMessageMap {
|
|
17
32
|
update: TrackableUpdatePayload;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isTrackableMessage = exports.sTrackableUpdatePayload = void 0;
|
|
3
|
+
exports.isTrackableMessage = exports.sTrackableUpdatePayload = exports.sTrackableUpdate = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const primitives_1 = require("../../primitives");
|
|
6
|
-
exports.
|
|
6
|
+
exports.sTrackableUpdate = zod_1.z.object({
|
|
7
7
|
timestamp: zod_1.z.number(),
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
objectId: zod_1.z.string().nonempty(),
|
|
9
|
+
objectName: zod_1.z.string().nonempty(),
|
|
10
10
|
objectKind: primitives_1.sWorldObjectId.nullable(),
|
|
11
11
|
metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()),
|
|
12
12
|
longitude: zod_1.z.number().min(-180).max(180),
|
|
@@ -15,6 +15,9 @@ exports.sTrackableUpdatePayload = zod_1.z.object({
|
|
|
15
15
|
speed: zod_1.z.number().optional(),
|
|
16
16
|
heading: zod_1.z.number().optional(),
|
|
17
17
|
});
|
|
18
|
+
exports.sTrackableUpdatePayload = zod_1.z.object({
|
|
19
|
+
updates: zod_1.z.record(zod_1.z.string(), exports.sTrackableUpdate),
|
|
20
|
+
});
|
|
18
21
|
const validators = {
|
|
19
22
|
update: exports.sTrackableUpdatePayload,
|
|
20
23
|
};
|
package/dist/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "git",
|
|
5
5
|
"url": "git+https://github.com/Linc-Security-Systems/aware-essentials.git"
|
|
6
6
|
},
|
|
7
|
-
"version": "2.0.
|
|
7
|
+
"version": "2.0.120",
|
|
8
8
|
"description": "Common types between backend, agent(s) and frontend(s)",
|
|
9
9
|
"main": "dist/index.js",
|
|
10
10
|
"types": "dist/index.d.ts",
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "git",
|
|
5
5
|
"url": "git+https://github.com/Linc-Security-Systems/aware-essentials.git"
|
|
6
6
|
},
|
|
7
|
-
"version": "2.0.
|
|
7
|
+
"version": "2.0.120",
|
|
8
8
|
"description": "Common types between backend, agent(s) and frontend(s)",
|
|
9
9
|
"main": "dist/index.js",
|
|
10
10
|
"types": "dist/index.d.ts",
|