@awarevue/api-types 1.0.3 → 1.0.5

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.
@@ -79,7 +79,7 @@ export declare const sAccessRuleDto: z.ZodObject<{
79
79
  }>, "many">;
80
80
  createdOn: z.ZodString;
81
81
  lastModifiedOn: z.ZodString;
82
- refs: z.ZodRecord<z.ZodString, z.ZodString>;
82
+ refs: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
83
83
  version: z.ZodNumber;
84
84
  }, "strip", z.ZodTypeAny, {
85
85
  id: string;
@@ -101,7 +101,7 @@ export declare const sAccessRuleDto: z.ZodObject<{
101
101
  scheduleId: string;
102
102
  groupId: string;
103
103
  }[];
104
- refs: Record<string, string>;
104
+ refs: Record<string, string | string[]>;
105
105
  }, {
106
106
  id: string;
107
107
  version: number;
@@ -122,7 +122,7 @@ export declare const sAccessRuleDto: z.ZodObject<{
122
122
  scheduleId: string;
123
123
  groupId: string;
124
124
  }[];
125
- refs: Record<string, string>;
125
+ refs: Record<string, string | string[]>;
126
126
  }>;
127
127
  export type AccessRuleDto = z.infer<typeof sAccessRuleDto>;
128
128
  export declare const sCreateAccessRuleRequest: z.ZodObject<{
@@ -29,7 +29,7 @@ exports.sAccessRuleDto = zod_1.default.object({
29
29
  .describe('Group permissions'),
30
30
  createdOn: zod_1.default.string().describe('Created on'),
31
31
  lastModifiedOn: zod_1.default.string().describe('Last modified on'),
32
- refs: zod_1.default.record(zod_1.default.string()).describe('References'),
32
+ refs: zod_1.default.record(zod_1.default.union([zod_1.default.string(), zod_1.default.array(zod_1.default.string())])),
33
33
  version: zod_1.default.number().describe('Version'),
34
34
  });
35
35
  exports.sCreateAccessRuleRequest = zod_1.default.object({
@@ -43,7 +43,7 @@ export declare const sPersonDto: z.ZodObject<{
43
43
  displayName: string;
44
44
  }>, "many">;
45
45
  customFields: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>;
46
- refs: z.ZodRecord<z.ZodString, z.ZodString>;
46
+ refs: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
47
47
  version: z.ZodNumber;
48
48
  }, "strip", z.ZodTypeAny, {
49
49
  id: string;
@@ -54,7 +54,7 @@ export declare const sPersonDto: z.ZodObject<{
54
54
  firstName: string;
55
55
  lastName: string;
56
56
  avatarId: string | null;
57
- refs: Record<string, string>;
57
+ refs: Record<string, string | string[]>;
58
58
  validFrom: string | null;
59
59
  validTo: string | null;
60
60
  accessSuspended: boolean;
@@ -78,7 +78,7 @@ export declare const sPersonDto: z.ZodObject<{
78
78
  firstName: string;
79
79
  lastName: string;
80
80
  avatarId: string | null;
81
- refs: Record<string, string>;
81
+ refs: Record<string, string | string[]>;
82
82
  validFrom: string | null;
83
83
  validTo: string | null;
84
84
  accessSuspended: boolean;
@@ -26,7 +26,7 @@ exports.sPersonDto = zod_1.default.object({
26
26
  credentials: zod_1.default.array(credential_1.sAssignedCredential),
27
27
  accessRules: zod_1.default.array(exports.sPersonAccessRule),
28
28
  customFields: zod_1.default.record(zod_1.default.string()).nullable(),
29
- refs: zod_1.default.record(zod_1.default.string()),
29
+ refs: zod_1.default.record(zod_1.default.union([zod_1.default.string(), zod_1.default.array(zod_1.default.string())])),
30
30
  version: zod_1.default.number(),
31
31
  });
32
32
  exports.sCreatePersonRequest = zod_1.default.object({
@@ -135,7 +135,7 @@ export declare const sScheduleDto: z.ZodObject<{
135
135
  deletable: z.ZodBoolean;
136
136
  createdOn: z.ZodString;
137
137
  lastModifiedOn: z.ZodString;
138
- refs: z.ZodRecord<z.ZodString, z.ZodString>;
138
+ refs: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
139
139
  version: z.ZodNumber;
140
140
  flag: z.ZodNullable<z.ZodEnum<["always", "never"]>>;
141
141
  }, "strip", z.ZodTypeAny, {
@@ -164,7 +164,7 @@ export declare const sScheduleDto: z.ZodObject<{
164
164
  displayName: string;
165
165
  createdOn: string;
166
166
  lastModifiedOn: string;
167
- refs: Record<string, string>;
167
+ refs: Record<string, string | string[]>;
168
168
  editable: boolean;
169
169
  deletable: boolean;
170
170
  flag: "always" | "never" | null;
@@ -194,7 +194,7 @@ export declare const sScheduleDto: z.ZodObject<{
194
194
  displayName: string;
195
195
  createdOn: string;
196
196
  lastModifiedOn: string;
197
- refs: Record<string, string>;
197
+ refs: Record<string, string | string[]>;
198
198
  editable: boolean;
199
199
  deletable: boolean;
200
200
  flag: "always" | "never" | null;
@@ -36,7 +36,7 @@ exports.sScheduleDto = zod_1.default.object({
36
36
  deletable: zod_1.default.boolean(),
37
37
  createdOn: zod_1.default.string(),
38
38
  lastModifiedOn: zod_1.default.string(),
39
- refs: zod_1.default.record(zod_1.default.string()),
39
+ refs: zod_1.default.record(zod_1.default.union([zod_1.default.string(), zod_1.default.array(zod_1.default.string())])),
40
40
  version: zod_1.default.number(),
41
41
  flag: exports.sFlagType.nullable(),
42
42
  });
@@ -6,7 +6,7 @@ export declare const sZoneDto: z.ZodObject<{
6
6
  lastModifiedOn: z.ZodString;
7
7
  devices: z.ZodArray<z.ZodString, "many">;
8
8
  isGlobal: z.ZodBoolean;
9
- refs: z.ZodRecord<z.ZodString, z.ZodString>;
9
+ refs: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
10
10
  version: z.ZodNumber;
11
11
  }, "strip", z.ZodTypeAny, {
12
12
  id: string;
@@ -14,7 +14,7 @@ export declare const sZoneDto: z.ZodObject<{
14
14
  displayName: string;
15
15
  createdOn: string;
16
16
  lastModifiedOn: string;
17
- refs: Record<string, string>;
17
+ refs: Record<string, string | string[]>;
18
18
  devices: string[];
19
19
  isGlobal: boolean;
20
20
  }, {
@@ -23,7 +23,7 @@ export declare const sZoneDto: z.ZodObject<{
23
23
  displayName: string;
24
24
  createdOn: string;
25
25
  lastModifiedOn: string;
26
- refs: Record<string, string>;
26
+ refs: Record<string, string | string[]>;
27
27
  devices: string[];
28
28
  isGlobal: boolean;
29
29
  }>;
@@ -12,7 +12,7 @@ exports.sZoneDto = zod_1.default.object({
12
12
  lastModifiedOn: zod_1.default.string(),
13
13
  devices: zod_1.default.array(zod_1.default.string()),
14
14
  isGlobal: zod_1.default.boolean(),
15
- refs: zod_1.default.record(zod_1.default.string()),
15
+ refs: zod_1.default.record(zod_1.default.union([zod_1.default.string(), zod_1.default.array(zod_1.default.string())])),
16
16
  version: zod_1.default.number(),
17
17
  });
18
18
  exports.sCreateZoneRequest = zod_1.default.object({
@@ -1032,32 +1032,32 @@ export declare const sGetAvailableDevicesRs: z.ZodIntersection<z.ZodObject<{
1032
1032
  }>>;
1033
1033
  export declare const sObjectMerge: z.ZodObject<{
1034
1034
  kind: z.ZodLiteral<"merge">;
1035
- objectId: z.ZodOptional<z.ZodString>;
1035
+ objectId: z.ZodString;
1036
1036
  objectKind: z.ZodEnum<["access-rule", "schedule", "zone", "person", "reader"]>;
1037
1037
  props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1038
1038
  }, "strip", z.ZodTypeAny, {
1039
1039
  kind: "merge";
1040
1040
  objectKind: "person" | "zone" | "reader" | "access-rule" | "schedule";
1041
+ objectId: string;
1041
1042
  props: Record<string, unknown>;
1042
- objectId?: string | undefined;
1043
1043
  }, {
1044
1044
  kind: "merge";
1045
1045
  objectKind: "person" | "zone" | "reader" | "access-rule" | "schedule";
1046
+ objectId: string;
1046
1047
  props: Record<string, unknown>;
1047
- objectId?: string | undefined;
1048
1048
  }>;
1049
1049
  export declare const sObjectDelete: z.ZodObject<{
1050
1050
  kind: z.ZodLiteral<"delete">;
1051
- objectId: z.ZodOptional<z.ZodString>;
1051
+ objectId: z.ZodString;
1052
1052
  objectKind: z.ZodEnum<["access-rule", "schedule", "zone", "person", "reader"]>;
1053
1053
  }, "strip", z.ZodTypeAny, {
1054
1054
  kind: "delete";
1055
1055
  objectKind: "person" | "zone" | "reader" | "access-rule" | "schedule";
1056
- objectId?: string | undefined;
1056
+ objectId: string;
1057
1057
  }, {
1058
1058
  kind: "delete";
1059
1059
  objectKind: "person" | "zone" | "reader" | "access-rule" | "schedule";
1060
- objectId?: string | undefined;
1060
+ objectId: string;
1061
1061
  }>;
1062
1062
  export declare const sRelationMerge: z.ZodObject<{
1063
1063
  kind: z.ZodLiteral<"relation-merge">;
@@ -1107,31 +1107,31 @@ export declare const sRelationMerge: z.ZodObject<{
1107
1107
  }>;
1108
1108
  export declare const sAccessMutation: z.ZodUnion<[z.ZodObject<{
1109
1109
  kind: z.ZodLiteral<"merge">;
1110
- objectId: z.ZodOptional<z.ZodString>;
1110
+ objectId: z.ZodString;
1111
1111
  objectKind: z.ZodEnum<["access-rule", "schedule", "zone", "person", "reader"]>;
1112
1112
  props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1113
1113
  }, "strip", z.ZodTypeAny, {
1114
1114
  kind: "merge";
1115
1115
  objectKind: "person" | "zone" | "reader" | "access-rule" | "schedule";
1116
+ objectId: string;
1116
1117
  props: Record<string, unknown>;
1117
- objectId?: string | undefined;
1118
1118
  }, {
1119
1119
  kind: "merge";
1120
1120
  objectKind: "person" | "zone" | "reader" | "access-rule" | "schedule";
1121
+ objectId: string;
1121
1122
  props: Record<string, unknown>;
1122
- objectId?: string | undefined;
1123
1123
  }>, z.ZodObject<{
1124
1124
  kind: z.ZodLiteral<"delete">;
1125
- objectId: z.ZodOptional<z.ZodString>;
1125
+ objectId: z.ZodString;
1126
1126
  objectKind: z.ZodEnum<["access-rule", "schedule", "zone", "person", "reader"]>;
1127
1127
  }, "strip", z.ZodTypeAny, {
1128
1128
  kind: "delete";
1129
1129
  objectKind: "person" | "zone" | "reader" | "access-rule" | "schedule";
1130
- objectId?: string | undefined;
1130
+ objectId: string;
1131
1131
  }, {
1132
1132
  kind: "delete";
1133
1133
  objectKind: "person" | "zone" | "reader" | "access-rule" | "schedule";
1134
- objectId?: string | undefined;
1134
+ objectId: string;
1135
1135
  }>, z.ZodObject<{
1136
1136
  kind: z.ZodLiteral<"relation-merge">;
1137
1137
  left: z.ZodObject<{
@@ -1187,31 +1187,31 @@ export declare const sValidateChangeRq: z.ZodObject<{
1187
1187
  refMap: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
1188
1188
  mutations: z.ZodArray<z.ZodUnion<[z.ZodObject<{
1189
1189
  kind: z.ZodLiteral<"merge">;
1190
- objectId: z.ZodOptional<z.ZodString>;
1190
+ objectId: z.ZodString;
1191
1191
  objectKind: z.ZodEnum<["access-rule", "schedule", "zone", "person", "reader"]>;
1192
1192
  props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1193
1193
  }, "strip", z.ZodTypeAny, {
1194
1194
  kind: "merge";
1195
1195
  objectKind: "person" | "zone" | "reader" | "access-rule" | "schedule";
1196
+ objectId: string;
1196
1197
  props: Record<string, unknown>;
1197
- objectId?: string | undefined;
1198
1198
  }, {
1199
1199
  kind: "merge";
1200
1200
  objectKind: "person" | "zone" | "reader" | "access-rule" | "schedule";
1201
+ objectId: string;
1201
1202
  props: Record<string, unknown>;
1202
- objectId?: string | undefined;
1203
1203
  }>, z.ZodObject<{
1204
1204
  kind: z.ZodLiteral<"delete">;
1205
- objectId: z.ZodOptional<z.ZodString>;
1205
+ objectId: z.ZodString;
1206
1206
  objectKind: z.ZodEnum<["access-rule", "schedule", "zone", "person", "reader"]>;
1207
1207
  }, "strip", z.ZodTypeAny, {
1208
1208
  kind: "delete";
1209
1209
  objectKind: "person" | "zone" | "reader" | "access-rule" | "schedule";
1210
- objectId?: string | undefined;
1210
+ objectId: string;
1211
1211
  }, {
1212
1212
  kind: "delete";
1213
1213
  objectKind: "person" | "zone" | "reader" | "access-rule" | "schedule";
1214
- objectId?: string | undefined;
1214
+ objectId: string;
1215
1215
  }>, z.ZodObject<{
1216
1216
  kind: z.ZodLiteral<"relation-merge">;
1217
1217
  left: z.ZodObject<{
@@ -1266,12 +1266,12 @@ export declare const sValidateChangeRq: z.ZodObject<{
1266
1266
  mutations: ({
1267
1267
  kind: "merge";
1268
1268
  objectKind: "person" | "zone" | "reader" | "access-rule" | "schedule";
1269
+ objectId: string;
1269
1270
  props: Record<string, unknown>;
1270
- objectId?: string | undefined;
1271
1271
  } | {
1272
1272
  kind: "delete";
1273
1273
  objectKind: "person" | "zone" | "reader" | "access-rule" | "schedule";
1274
- objectId?: string | undefined;
1274
+ objectId: string;
1275
1275
  } | {
1276
1276
  left: {
1277
1277
  kind: "person" | "zone" | "reader" | "access-rule" | "schedule";
@@ -1292,12 +1292,12 @@ export declare const sValidateChangeRq: z.ZodObject<{
1292
1292
  mutations: ({
1293
1293
  kind: "merge";
1294
1294
  objectKind: "person" | "zone" | "reader" | "access-rule" | "schedule";
1295
+ objectId: string;
1295
1296
  props: Record<string, unknown>;
1296
- objectId?: string | undefined;
1297
1297
  } | {
1298
1298
  kind: "delete";
1299
1299
  objectKind: "person" | "zone" | "reader" | "access-rule" | "schedule";
1300
- objectId?: string | undefined;
1300
+ objectId: string;
1301
1301
  } | {
1302
1302
  left: {
1303
1303
  kind: "person" | "zone" | "reader" | "access-rule" | "schedule";
@@ -1359,31 +1359,31 @@ export declare const sApplyChange: z.ZodObject<{
1359
1359
  refMap: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
1360
1360
  mutations: z.ZodArray<z.ZodUnion<[z.ZodObject<{
1361
1361
  kind: z.ZodLiteral<"merge">;
1362
- objectId: z.ZodOptional<z.ZodString>;
1362
+ objectId: z.ZodString;
1363
1363
  objectKind: z.ZodEnum<["access-rule", "schedule", "zone", "person", "reader"]>;
1364
1364
  props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1365
1365
  }, "strip", z.ZodTypeAny, {
1366
1366
  kind: "merge";
1367
1367
  objectKind: "person" | "zone" | "reader" | "access-rule" | "schedule";
1368
+ objectId: string;
1368
1369
  props: Record<string, unknown>;
1369
- objectId?: string | undefined;
1370
1370
  }, {
1371
1371
  kind: "merge";
1372
1372
  objectKind: "person" | "zone" | "reader" | "access-rule" | "schedule";
1373
+ objectId: string;
1373
1374
  props: Record<string, unknown>;
1374
- objectId?: string | undefined;
1375
1375
  }>, z.ZodObject<{
1376
1376
  kind: z.ZodLiteral<"delete">;
1377
- objectId: z.ZodOptional<z.ZodString>;
1377
+ objectId: z.ZodString;
1378
1378
  objectKind: z.ZodEnum<["access-rule", "schedule", "zone", "person", "reader"]>;
1379
1379
  }, "strip", z.ZodTypeAny, {
1380
1380
  kind: "delete";
1381
1381
  objectKind: "person" | "zone" | "reader" | "access-rule" | "schedule";
1382
- objectId?: string | undefined;
1382
+ objectId: string;
1383
1383
  }, {
1384
1384
  kind: "delete";
1385
1385
  objectKind: "person" | "zone" | "reader" | "access-rule" | "schedule";
1386
- objectId?: string | undefined;
1386
+ objectId: string;
1387
1387
  }>, z.ZodObject<{
1388
1388
  kind: z.ZodLiteral<"relation-merge">;
1389
1389
  left: z.ZodObject<{
@@ -1438,12 +1438,12 @@ export declare const sApplyChange: z.ZodObject<{
1438
1438
  mutations: ({
1439
1439
  kind: "merge";
1440
1440
  objectKind: "person" | "zone" | "reader" | "access-rule" | "schedule";
1441
+ objectId: string;
1441
1442
  props: Record<string, unknown>;
1442
- objectId?: string | undefined;
1443
1443
  } | {
1444
1444
  kind: "delete";
1445
1445
  objectKind: "person" | "zone" | "reader" | "access-rule" | "schedule";
1446
- objectId?: string | undefined;
1446
+ objectId: string;
1447
1447
  } | {
1448
1448
  left: {
1449
1449
  kind: "person" | "zone" | "reader" | "access-rule" | "schedule";
@@ -1464,12 +1464,12 @@ export declare const sApplyChange: z.ZodObject<{
1464
1464
  mutations: ({
1465
1465
  kind: "merge";
1466
1466
  objectKind: "person" | "zone" | "reader" | "access-rule" | "schedule";
1467
+ objectId: string;
1467
1468
  props: Record<string, unknown>;
1468
- objectId?: string | undefined;
1469
1469
  } | {
1470
1470
  kind: "delete";
1471
1471
  objectKind: "person" | "zone" | "reader" | "access-rule" | "schedule";
1472
- objectId?: string | undefined;
1472
+ objectId: string;
1473
1473
  } | {
1474
1474
  left: {
1475
1475
  kind: "person" | "zone" | "reader" | "access-rule" | "schedule";
@@ -176,10 +176,7 @@ exports.sGetAvailableDevicesRs = (0, exports.sResponsePayload)(zod_1.z.literal('
176
176
  exports.sObjectMerge = zod_1.z
177
177
  .object({
178
178
  kind: zod_1.z.literal('merge'),
179
- objectId: zod_1.z
180
- .string()
181
- .optional()
182
- .describe('Object ID as in backend. Can be undefined if object is new to backend and agent is trying to create it'),
179
+ objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
183
180
  objectKind: exports.sAccessObjectKind,
184
181
  props: zod_1.z.record(zod_1.z.unknown()),
185
182
  })
@@ -187,10 +184,7 @@ exports.sObjectMerge = zod_1.z
187
184
  exports.sObjectDelete = zod_1.z
188
185
  .object({
189
186
  kind: zod_1.z.literal('delete'),
190
- objectId: zod_1.z
191
- .string()
192
- .optional()
193
- .describe('Object ID as in backend. Can be undefined if object is new to backend and agent is trying to create it'),
187
+ objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
194
188
  objectKind: exports.sAccessObjectKind,
195
189
  })
196
190
  .describe('Object delete request');
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awarevue/api-types",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
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.3",
3
+ "version": "1.0.5",
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",