@awarevue/api-types 2.0.118 → 2.0.119
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,21 @@ 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
|
+
timestamp: z.ZodNumber;
|
|
523
|
+
objectId: z.ZodString;
|
|
524
|
+
objectName: z.ZodString;
|
|
525
|
+
objectKind: z.ZodNullable<z.ZodString>;
|
|
526
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
527
|
+
longitude: z.ZodNumber;
|
|
528
|
+
latitude: z.ZodNumber;
|
|
529
|
+
altitude: z.ZodOptional<z.ZodNumber>;
|
|
530
|
+
speed: z.ZodOptional<z.ZodNumber>;
|
|
531
|
+
heading: z.ZodOptional<z.ZodNumber>;
|
|
532
|
+
kind: z.ZodLiteral<"trackable-update">;
|
|
533
|
+
provider: z.ZodString;
|
|
534
|
+
foreignRef: z.ZodString;
|
|
535
|
+
}, z.core.$strip>;
|
|
521
536
|
export declare const sPushStateUpdateRq: z.ZodObject<{
|
|
522
537
|
kind: z.ZodLiteral<"state">;
|
|
523
538
|
foreignRef: z.ZodString;
|
|
@@ -1861,6 +1876,7 @@ export type QueryRq = z.infer<typeof sQueryRq>;
|
|
|
1861
1876
|
export type QueryRs = z.infer<typeof sQueryRs>;
|
|
1862
1877
|
export type ProgressUpdate = z.infer<typeof sProgressUpdate>;
|
|
1863
1878
|
export type PushFile = z.infer<typeof sPushFile>;
|
|
1879
|
+
export type PushTrackableUpdate = z.infer<typeof sPushTrackableUpdate>;
|
|
1864
1880
|
export type PushStateUpdateRq = z.infer<typeof sPushStateUpdateRq>;
|
|
1865
1881
|
export type PushStateUpdateRs = z.infer<typeof sPushStateUpdateRs>;
|
|
1866
1882
|
export type PushEventRq = z.infer<typeof sPushEventRq>;
|
|
@@ -1915,8 +1931,9 @@ export type PayloadByKind = {
|
|
|
1915
1931
|
'describe-object': DescribeObjectRq;
|
|
1916
1932
|
'describe-object-rs': DescribeObjectRs;
|
|
1917
1933
|
'error-rs': ErrorPayload;
|
|
1934
|
+
'trackable-update': PushTrackableUpdate;
|
|
1918
1935
|
};
|
|
1919
|
-
export type FromAgent = ErrorPayload | RegisterRq | Unregister | ValidateProviderConfigRs | StartServiceRs | StopServiceRs | RunCommandRs | QueryRs | PushStateUpdateRq | PushEventRq | ProgressUpdate | GetAvailableDevicesRs | AccessValidateChangeRs | AccessApplyChangeRs | AccessApplyChangeProgress | DescribeObjectRs;
|
|
1936
|
+
export type FromAgent = ErrorPayload | RegisterRq | Unregister | ValidateProviderConfigRs | StartServiceRs | StopServiceRs | RunCommandRs | QueryRs | PushStateUpdateRq | PushTrackableUpdate | PushEventRq | ProgressUpdate | GetAvailableDevicesRs | AccessValidateChangeRs | AccessApplyChangeRs | AccessApplyChangeProgress | DescribeObjectRs;
|
|
1920
1937
|
export type FromServer = ErrorPayload | RegisterRs | ValidateProviderConfigRq | StartServiceRq | StopServiceRq | RunCommandRq | QueryRq | PushFile | PushStateUpdateRs | PushEventRs | GetAvailableDevicesRq | AccessValidateChangeRq | AccessApplyChange | AccessAbortChange | DescribeObjectRq;
|
|
1921
1938
|
export type AnyPayload = FromAgent | FromServer;
|
|
1922
1939
|
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,
|
|
@@ -2,8 +2,8 @@ import { z } from 'zod';
|
|
|
2
2
|
import { WebSocketMessage } from './web-socket';
|
|
3
3
|
export declare const sTrackableUpdatePayload: 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;
|
|
@@ -5,8 +5,8 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const primitives_1 = require("../../primitives");
|
|
6
6
|
exports.sTrackableUpdatePayload = 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),
|
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.119",
|
|
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.119",
|
|
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",
|