@awarevue/api-types 1.0.113 → 1.1.0
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/dist/agent-communication/protocol.d.ts +74 -2
- package/dist/agent-communication/protocol.js +17 -23
- package/dist/agent-communication/queries.d.ts +937 -14
- package/dist/agent-communication/queries.js +23 -11
- package/dist/layout.d.ts +36 -0
- package/dist/layout.js +2 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -595,6 +595,74 @@ export declare const sRunCommandRs: z.ZodIntersection<z.ZodObject<{
|
|
|
595
595
|
kind: "command-rs";
|
|
596
596
|
requestId: string;
|
|
597
597
|
}>, z.ZodObject<{}, z.UnknownKeysParam, z.ZodTypeAny, {}, {}>>;
|
|
598
|
+
export declare const sQueryRq: z.ZodObject<{
|
|
599
|
+
kind: z.ZodLiteral<"query">;
|
|
600
|
+
query: z.ZodString;
|
|
601
|
+
device: z.ZodObject<{
|
|
602
|
+
name: z.ZodString;
|
|
603
|
+
foreignRef: z.ZodString;
|
|
604
|
+
provider: z.ZodString;
|
|
605
|
+
providerMetadata: z.ZodObject<{}, "strip", z.ZodUnknown, z.objectOutputType<{}, z.ZodUnknown, "strip">, z.objectInputType<{}, z.ZodUnknown, "strip">>;
|
|
606
|
+
}, "strip", z.ZodTypeAny, {
|
|
607
|
+
name: string;
|
|
608
|
+
foreignRef: string;
|
|
609
|
+
provider: string;
|
|
610
|
+
providerMetadata: {} & {
|
|
611
|
+
[k: string]: unknown;
|
|
612
|
+
};
|
|
613
|
+
}, {
|
|
614
|
+
name: string;
|
|
615
|
+
foreignRef: string;
|
|
616
|
+
provider: string;
|
|
617
|
+
providerMetadata: {} & {
|
|
618
|
+
[k: string]: unknown;
|
|
619
|
+
};
|
|
620
|
+
}>;
|
|
621
|
+
args: z.ZodUnknown;
|
|
622
|
+
replyUrl: z.ZodOptional<z.ZodString>;
|
|
623
|
+
}, "strip", z.ZodTypeAny, {
|
|
624
|
+
kind: "query";
|
|
625
|
+
device: {
|
|
626
|
+
name: string;
|
|
627
|
+
foreignRef: string;
|
|
628
|
+
provider: string;
|
|
629
|
+
providerMetadata: {} & {
|
|
630
|
+
[k: string]: unknown;
|
|
631
|
+
};
|
|
632
|
+
};
|
|
633
|
+
query: string;
|
|
634
|
+
args?: unknown;
|
|
635
|
+
replyUrl?: string | undefined;
|
|
636
|
+
}, {
|
|
637
|
+
kind: "query";
|
|
638
|
+
device: {
|
|
639
|
+
name: string;
|
|
640
|
+
foreignRef: string;
|
|
641
|
+
provider: string;
|
|
642
|
+
providerMetadata: {} & {
|
|
643
|
+
[k: string]: unknown;
|
|
644
|
+
};
|
|
645
|
+
};
|
|
646
|
+
query: string;
|
|
647
|
+
args?: unknown;
|
|
648
|
+
replyUrl?: string | undefined;
|
|
649
|
+
}>;
|
|
650
|
+
export declare const sQueryRs: z.ZodIntersection<z.ZodObject<{
|
|
651
|
+
requestId: z.ZodString;
|
|
652
|
+
kind: z.ZodLiteral<"query-rs">;
|
|
653
|
+
}, "strip", z.ZodTypeAny, {
|
|
654
|
+
kind: "query-rs";
|
|
655
|
+
requestId: string;
|
|
656
|
+
}, {
|
|
657
|
+
kind: "query-rs";
|
|
658
|
+
requestId: string;
|
|
659
|
+
}>, z.ZodObject<{
|
|
660
|
+
result: z.ZodUnknown;
|
|
661
|
+
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
662
|
+
result?: unknown;
|
|
663
|
+
}, {
|
|
664
|
+
result?: unknown;
|
|
665
|
+
}>>;
|
|
598
666
|
export declare const sPushStateUpdateRq: z.ZodObject<{
|
|
599
667
|
kind: z.ZodLiteral<"state">;
|
|
600
668
|
foreignRef: z.ZodString;
|
|
@@ -8573,6 +8641,8 @@ export type StopServiceRq = z.infer<typeof sStopServiceRq>;
|
|
|
8573
8641
|
export type StopServiceRs = z.infer<typeof sStopServiceRs>;
|
|
8574
8642
|
export type RunCommandRq = z.infer<typeof sRunCommandRq>;
|
|
8575
8643
|
export type RunCommandRs = z.infer<typeof sRunCommandRs>;
|
|
8644
|
+
export type QueryRq = z.infer<typeof sQueryRq>;
|
|
8645
|
+
export type QueryRs = z.infer<typeof sQueryRs>;
|
|
8576
8646
|
export type PushStateUpdateRq = z.infer<typeof sPushStateUpdateRq>;
|
|
8577
8647
|
export type PushStateUpdateRs = z.infer<typeof sPushStateUpdateRs>;
|
|
8578
8648
|
export type PushEventRq = z.infer<typeof sPushEventRq>;
|
|
@@ -8608,6 +8678,8 @@ export type PayloadByKind = {
|
|
|
8608
8678
|
'stop-rs': StopServiceRs;
|
|
8609
8679
|
command: RunCommandRq;
|
|
8610
8680
|
'command-rs': RunCommandRs;
|
|
8681
|
+
query: QueryRq;
|
|
8682
|
+
'query-rs': QueryRs;
|
|
8611
8683
|
state: PushStateUpdateRq;
|
|
8612
8684
|
'state-rs': PushStateUpdateRs;
|
|
8613
8685
|
event: PushEventRq;
|
|
@@ -8622,8 +8694,8 @@ export type PayloadByKind = {
|
|
|
8622
8694
|
'abort-change': AccessAbortChange;
|
|
8623
8695
|
'error-rs': ErrorPayload;
|
|
8624
8696
|
};
|
|
8625
|
-
export type FromAgent = ErrorPayload | RegisterRq | Unregister | ValidateProviderConfigRs | StartServiceRs | StopServiceRs | RunCommandRs | PushStateUpdateRq | PushEventRq | GetAvailableDevicesRs | AccessValidateChangeRs | AccessApplyChangeRs | AccessApplyChangeProgress;
|
|
8626
|
-
export type FromServer = ErrorPayload | RegisterRs | ValidateProviderConfigRq | StartServiceRq | StopServiceRq | RunCommandRq | PushStateUpdateRs | PushEventRs | GetAvailableDevicesRq | AccessValidateChangeRq | AccessApplyChange | AccessAbortChange;
|
|
8697
|
+
export type FromAgent = ErrorPayload | RegisterRq | Unregister | ValidateProviderConfigRs | StartServiceRs | StopServiceRs | RunCommandRs | QueryRs | PushStateUpdateRq | PushEventRq | GetAvailableDevicesRs | AccessValidateChangeRs | AccessApplyChangeRs | AccessApplyChangeProgress;
|
|
8698
|
+
export type FromServer = ErrorPayload | RegisterRs | ValidateProviderConfigRq | StartServiceRq | StopServiceRq | RunCommandRq | QueryRq | PushStateUpdateRs | PushEventRs | GetAvailableDevicesRq | AccessValidateChangeRq | AccessApplyChange | AccessAbortChange;
|
|
8627
8699
|
export type AnyPayload = FromAgent | FromServer;
|
|
8628
8700
|
export declare const getAgentMessageIssues: (message: unknown) => string[];
|
|
8629
8701
|
export declare const isMessageFromAgent: (message: unknown) => message is Message<FromAgent>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isMessageFromAgent = exports.getAgentMessageIssues = 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.sGetAvailableDevicesRs = exports.sGetAvailableDevicesRq = exports.sPushEventRs = exports.sPushEventRq = exports.sPushStateUpdateRs = exports.sPushStateUpdateRq = 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.sAccessControlCapabilityReport = exports.sTokenSpecs = exports.sAccessObjectKind = exports.sProviderSpecs = exports.sUiHint = exports.sUiWidgetHint = exports.sUiOrderHint = exports.sErrorPayload = exports.sResponsePayload = exports.sMessageWithPayload = exports.sMessageHeader = void 0;
|
|
3
|
+
exports.isMessageFromAgent = exports.getAgentMessageIssues = 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.sGetAvailableDevicesRs = exports.sGetAvailableDevicesRq = exports.sPushEventRs = exports.sPushEventRq = exports.sPushStateUpdateRs = exports.sPushStateUpdateRq = 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.sAccessControlCapabilityReport = exports.sTokenSpecs = exports.sAccessObjectKind = exports.sProviderSpecs = exports.sUiHint = exports.sUiWidgetHint = exports.sUiOrderHint = exports.sErrorPayload = exports.sResponsePayload = exports.sMessageWithPayload = exports.sMessageHeader = void 0;
|
|
4
4
|
const device_1 = require("../device");
|
|
5
5
|
const device_import_1 = require("../device-import");
|
|
6
6
|
const credential_1 = require("../access-control/credential");
|
|
@@ -142,6 +142,21 @@ exports.sRunCommandRq = zod_1.z
|
|
|
142
142
|
})
|
|
143
143
|
.describe('Request to run a device command');
|
|
144
144
|
exports.sRunCommandRs = (0, exports.sResponsePayload)(zod_1.z.literal('command-rs'), zod_1.z.object({})).describe('Response for running a device command');
|
|
145
|
+
// QUERIES
|
|
146
|
+
exports.sQueryRq = zod_1.z.object({
|
|
147
|
+
kind: zod_1.z.literal('query'),
|
|
148
|
+
query: zod_1.z.string().nonempty(),
|
|
149
|
+
device: device_1.sForeignDeviceInfo,
|
|
150
|
+
args: zod_1.z.unknown().describe('Query arguments, depends on the query type'),
|
|
151
|
+
replyUrl: zod_1.z
|
|
152
|
+
.string()
|
|
153
|
+
.nonempty()
|
|
154
|
+
.optional()
|
|
155
|
+
.describe('URL to optionally POST the query response to. The default is to reply via query-rs'),
|
|
156
|
+
});
|
|
157
|
+
exports.sQueryRs = (0, exports.sResponsePayload)(zod_1.z.literal('query-rs'), zod_1.z.object({
|
|
158
|
+
result: zod_1.z.unknown().describe('Query result, depends on the query type'),
|
|
159
|
+
})).describe('Response for a query');
|
|
145
160
|
// PUSH DEVICE STATE UPDATE
|
|
146
161
|
exports.sPushStateUpdateRq = zod_1.z
|
|
147
162
|
.object({
|
|
@@ -278,28 +293,6 @@ exports.sObjectDelete = zod_1.z
|
|
|
278
293
|
}),
|
|
279
294
|
])
|
|
280
295
|
.describe('Object delete request');
|
|
281
|
-
// export const sRelationMerge = z.object({
|
|
282
|
-
// kind: z.literal('relation-merge'),
|
|
283
|
-
// left: z.object({
|
|
284
|
-
// kind: sAccessObjectKind,
|
|
285
|
-
// objectId: z
|
|
286
|
-
// .string()
|
|
287
|
-
// .optional()
|
|
288
|
-
// .describe(
|
|
289
|
-
// 'Object ID as in backend. Can be undefined if object is new to backend and agent is trying to create it',
|
|
290
|
-
// ),
|
|
291
|
-
// }),
|
|
292
|
-
// right: z.object({
|
|
293
|
-
// kind: sAccessObjectKind,
|
|
294
|
-
// objectId: z
|
|
295
|
-
// .string()
|
|
296
|
-
// .optional()
|
|
297
|
-
// .describe(
|
|
298
|
-
// 'Object ID as in backend. Can be undefined if object is new to backend and agent is trying to create it',
|
|
299
|
-
// ),
|
|
300
|
-
// }),
|
|
301
|
-
// linkExists: z.boolean(),
|
|
302
|
-
// });
|
|
303
296
|
exports.sAccessMutation = zod_1.z
|
|
304
297
|
.union([exports.sObjectMerge, exports.sObjectDelete])
|
|
305
298
|
.describe('Access object change description');
|
|
@@ -391,6 +384,7 @@ const fromAgentSchemaByKind = {
|
|
|
391
384
|
'start-rs': exports.sStartServiceRs,
|
|
392
385
|
'stop-rs': exports.sStopServiceRs,
|
|
393
386
|
'command-rs': exports.sRunCommandRs,
|
|
387
|
+
'query-rs': exports.sQueryRs,
|
|
394
388
|
state: exports.sPushStateUpdateRq,
|
|
395
389
|
event: exports.sPushEventRq,
|
|
396
390
|
'get-available-devices-rs': exports.sGetAvailableDevicesRs,
|