@awarevue/api-types 1.0.10 → 1.0.11

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.
@@ -1319,14 +1319,24 @@ export declare const sValidateChangeRq: z.ZodObject<{
1319
1319
  linkExists: boolean;
1320
1320
  })[];
1321
1321
  }>;
1322
+ export declare const sChangeIssueCode: z.ZodEnum<["BAD_REFERENCE", "NOT_FOUND", "NOT_UNIQUE", "INVALID", "NOT_SUPPORTED"]>;
1322
1323
  export declare const sChangeIssue: z.ZodObject<{
1323
1324
  objectId: z.ZodOptional<z.ZodString>;
1324
- issue: z.ZodString;
1325
+ code: z.ZodOptional<z.ZodEnum<["BAD_REFERENCE", "NOT_FOUND", "NOT_UNIQUE", "INVALID", "NOT_SUPPORTED"]>>;
1326
+ path: z.ZodOptional<z.ZodString>;
1327
+ index: z.ZodOptional<z.ZodNumber>;
1328
+ message: z.ZodOptional<z.ZodString>;
1325
1329
  }, "strip", z.ZodTypeAny, {
1326
- issue: string;
1330
+ index?: number | undefined;
1331
+ code?: "BAD_REFERENCE" | "NOT_FOUND" | "NOT_UNIQUE" | "INVALID" | "NOT_SUPPORTED" | undefined;
1332
+ message?: string | undefined;
1333
+ path?: string | undefined;
1327
1334
  objectId?: string | undefined;
1328
1335
  }, {
1329
- issue: string;
1336
+ index?: number | undefined;
1337
+ code?: "BAD_REFERENCE" | "NOT_FOUND" | "NOT_UNIQUE" | "INVALID" | "NOT_SUPPORTED" | undefined;
1338
+ message?: string | undefined;
1339
+ path?: string | undefined;
1330
1340
  objectId?: string | undefined;
1331
1341
  }>;
1332
1342
  export declare const sValidateChangeRs: z.ZodIntersection<z.ZodObject<{
@@ -1341,22 +1351,37 @@ export declare const sValidateChangeRs: z.ZodIntersection<z.ZodObject<{
1341
1351
  }>, z.ZodObject<{
1342
1352
  issues: z.ZodArray<z.ZodObject<{
1343
1353
  objectId: z.ZodOptional<z.ZodString>;
1344
- issue: z.ZodString;
1354
+ code: z.ZodOptional<z.ZodEnum<["BAD_REFERENCE", "NOT_FOUND", "NOT_UNIQUE", "INVALID", "NOT_SUPPORTED"]>>;
1355
+ path: z.ZodOptional<z.ZodString>;
1356
+ index: z.ZodOptional<z.ZodNumber>;
1357
+ message: z.ZodOptional<z.ZodString>;
1345
1358
  }, "strip", z.ZodTypeAny, {
1346
- issue: string;
1359
+ index?: number | undefined;
1360
+ code?: "BAD_REFERENCE" | "NOT_FOUND" | "NOT_UNIQUE" | "INVALID" | "NOT_SUPPORTED" | undefined;
1361
+ message?: string | undefined;
1362
+ path?: string | undefined;
1347
1363
  objectId?: string | undefined;
1348
1364
  }, {
1349
- issue: string;
1365
+ index?: number | undefined;
1366
+ code?: "BAD_REFERENCE" | "NOT_FOUND" | "NOT_UNIQUE" | "INVALID" | "NOT_SUPPORTED" | undefined;
1367
+ message?: string | undefined;
1368
+ path?: string | undefined;
1350
1369
  objectId?: string | undefined;
1351
1370
  }>, "many">;
1352
1371
  }, z.UnknownKeysParam, z.ZodTypeAny, {
1353
1372
  issues: {
1354
- issue: string;
1373
+ index?: number | undefined;
1374
+ code?: "BAD_REFERENCE" | "NOT_FOUND" | "NOT_UNIQUE" | "INVALID" | "NOT_SUPPORTED" | undefined;
1375
+ message?: string | undefined;
1376
+ path?: string | undefined;
1355
1377
  objectId?: string | undefined;
1356
1378
  }[];
1357
1379
  }, {
1358
1380
  issues: {
1359
- issue: string;
1381
+ index?: number | undefined;
1382
+ code?: "BAD_REFERENCE" | "NOT_FOUND" | "NOT_UNIQUE" | "INVALID" | "NOT_SUPPORTED" | undefined;
1383
+ message?: string | undefined;
1384
+ path?: string | undefined;
1360
1385
  objectId?: string | undefined;
1361
1386
  }[];
1362
1387
  }>>;
@@ -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.sValidateChangeRq = exports.sRefMap = exports.sDeviceMap = exports.sAccessMutation = exports.sRelationMerge = 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.sRelationMerge = 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;
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");
@@ -227,10 +227,31 @@ exports.sValidateChangeRq = zod_1.z
227
227
  mutations: zod_1.z.array(exports.sAccessMutation),
228
228
  })
229
229
  .describe('Request to validate access changes');
230
+ exports.sChangeIssueCode = zod_1.z.enum([
231
+ 'BAD_REFERENCE',
232
+ 'NOT_FOUND',
233
+ 'NOT_UNIQUE',
234
+ 'INVALID',
235
+ 'NOT_SUPPORTED',
236
+ ]);
230
237
  exports.sChangeIssue = zod_1.z
231
238
  .object({
232
- objectId: zod_1.z.string().optional(),
233
- issue: zod_1.z.string().nonempty(),
239
+ objectId: zod_1.z.string().optional().describe('Object ID as in backend'),
240
+ code: exports.sChangeIssueCode
241
+ .optional()
242
+ .describe('Issue code that describes the issue to UI agent(s) or bots'),
243
+ path: zod_1.z
244
+ .string()
245
+ .optional()
246
+ .describe('Path - inside object referenced by ObjectID, points to a field or a related object'),
247
+ index: zod_1.z
248
+ .number()
249
+ .optional()
250
+ .describe('Index ofa value in field pointed at by path'),
251
+ message: zod_1.z
252
+ .string()
253
+ .optional()
254
+ .describe('Message that describes the issue to user or the details of what went wrong'),
234
255
  })
235
256
  .describe('Access change issue description');
236
257
  exports.sValidateChangeRs = (0, exports.sResponsePayload)(zod_1.z.literal('validate-change-rs'), zod_1.z.object({
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awarevue/api-types",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "Common types between backend, agent(s) and frontend(s)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awarevue/api-types",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "Common types between backend, agent(s) and frontend(s)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",