@awarevue/api-types 1.0.23 → 1.0.25

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/error.d.ts CHANGED
@@ -55,11 +55,29 @@ export declare const sConflictMeta: z.ZodObject<{
55
55
  blockingId?: string | undefined;
56
56
  }>;
57
57
  export declare const sVoidMeta: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
58
+ export declare const sAccessRuleConflictMeta: z.ZodObject<{
59
+ deviceSchedules: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>;
60
+ }, "strip", z.ZodTypeAny, {
61
+ deviceSchedules: Record<string, string[]>;
62
+ }, {
63
+ deviceSchedules: Record<string, string[]>;
64
+ }>;
65
+ export declare const sZoneAccessRuleConflictMeta: z.ZodObject<{
66
+ zoneId: z.ZodString;
67
+ accessRuleIds: z.ZodArray<z.ZodString, "many">;
68
+ }, "strip", z.ZodTypeAny, {
69
+ zoneId: string;
70
+ accessRuleIds: string[];
71
+ }, {
72
+ zoneId: string;
73
+ accessRuleIds: string[];
74
+ }>;
58
75
  export type VoidMeta = z.infer<typeof sVoidMeta>;
59
76
  export type DuplicateMeta = z.infer<typeof sDuplicateMeta>;
60
77
  export type NotFoundMeta = z.infer<typeof sNotFoundMeta>;
61
78
  export type InvalidMeta = z.infer<typeof sInvalidMeta>;
62
79
  export type ConflictMeta = z.infer<typeof sConflictMeta>;
80
+ export type AccessRuleConflictMeta = z.infer<typeof sAccessRuleConflictMeta>;
63
81
  export declare enum AppErrorCode {
64
82
  RESOURCE_ALREADY_EXISTS = "RESOURCE_ALREADY_EXISTS",
65
83
  RESOURCE_NOT_FOUND = "RESOURCE_NOT_FOUND",
@@ -100,6 +118,7 @@ export declare enum AppErrorCode {
100
118
  ZONE_NOT_FOUND = "ZONE_NOT_FOUND",
101
119
  ZONE_ALREADY_EXISTS = "ZONE_ALREADY_EXISTS",
102
120
  ZONE_IN_USE = "ZONE_IN_USE",
121
+ ZONE_ACCESS_RULE_CONFLICT = "ZONE_ACCESS_RULE_CONFLICT",
103
122
  SCHEDULE_NOT_FOUND = "SCHEDULE_NOT_FOUND",
104
123
  SCHEDULE_ALREADY_EXISTS = "SCHEDULE_ALREADY_EXISTS",
105
124
  SCHEDULE_IN_USE = "SCHEDULE_IN_USE",
@@ -186,7 +205,13 @@ export declare const errorMetadataSchemas: {
186
205
  field: string;
187
206
  subject: string;
188
207
  }>;
189
- readonly ACCESS_RULE_PERMISSION_CONFLICT: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
208
+ readonly ACCESS_RULE_PERMISSION_CONFLICT: z.ZodObject<{
209
+ deviceSchedules: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>;
210
+ }, "strip", z.ZodTypeAny, {
211
+ deviceSchedules: Record<string, string[]>;
212
+ }, {
213
+ deviceSchedules: Record<string, string[]>;
214
+ }>;
190
215
  readonly ALARM_NOT_FOUND: z.ZodObject<{
191
216
  subject: z.ZodString;
192
217
  field: z.ZodString;
@@ -468,6 +493,16 @@ export declare const errorMetadataSchemas: {
468
493
  blockingSubject?: string | undefined;
469
494
  blockingId?: string | undefined;
470
495
  }>;
496
+ readonly ZONE_ACCESS_RULE_CONFLICT: z.ZodObject<{
497
+ zoneId: z.ZodString;
498
+ accessRuleIds: z.ZodArray<z.ZodString, "many">;
499
+ }, "strip", z.ZodTypeAny, {
500
+ zoneId: string;
501
+ accessRuleIds: string[];
502
+ }, {
503
+ zoneId: string;
504
+ accessRuleIds: string[];
505
+ }>;
471
506
  readonly SCHEDULE_NOT_FOUND: z.ZodObject<{
472
507
  subject: z.ZodString;
473
508
  field: z.ZodString;
package/dist/error.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.errorMetadataSchemas = exports.AppErrorCode = exports.sVoidMeta = exports.sConflictMeta = exports.sInvalidMeta = exports.sNotFoundMeta = exports.sDuplicateMeta = void 0;
3
+ exports.errorMetadataSchemas = exports.AppErrorCode = exports.sZoneAccessRuleConflictMeta = exports.sAccessRuleConflictMeta = exports.sVoidMeta = exports.sConflictMeta = exports.sInvalidMeta = exports.sNotFoundMeta = exports.sDuplicateMeta = void 0;
4
4
  exports.isErrorResponse = isErrorResponse;
5
5
  const zod_1 = require("zod");
6
6
  // METADATA
@@ -26,6 +26,13 @@ exports.sConflictMeta = zod_1.z.object({
26
26
  value: zod_1.z.string().optional(),
27
27
  });
28
28
  exports.sVoidMeta = zod_1.z.object({}).strict();
29
+ exports.sAccessRuleConflictMeta = zod_1.z.object({
30
+ deviceSchedules: zod_1.z.record(zod_1.z.string(), zod_1.z.array(zod_1.z.string())),
31
+ });
32
+ exports.sZoneAccessRuleConflictMeta = zod_1.z.object({
33
+ zoneId: zod_1.z.string(),
34
+ accessRuleIds: zod_1.z.array(zod_1.z.string()),
35
+ });
29
36
  // ERROR CODES
30
37
  var AppErrorCode;
31
38
  (function (AppErrorCode) {
@@ -75,6 +82,7 @@ var AppErrorCode;
75
82
  AppErrorCode["ZONE_NOT_FOUND"] = "ZONE_NOT_FOUND";
76
83
  AppErrorCode["ZONE_ALREADY_EXISTS"] = "ZONE_ALREADY_EXISTS";
77
84
  AppErrorCode["ZONE_IN_USE"] = "ZONE_IN_USE";
85
+ AppErrorCode["ZONE_ACCESS_RULE_CONFLICT"] = "ZONE_ACCESS_RULE_CONFLICT";
78
86
  AppErrorCode["SCHEDULE_NOT_FOUND"] = "SCHEDULE_NOT_FOUND";
79
87
  AppErrorCode["SCHEDULE_ALREADY_EXISTS"] = "SCHEDULE_ALREADY_EXISTS";
80
88
  AppErrorCode["SCHEDULE_IN_USE"] = "SCHEDULE_IN_USE";
@@ -103,7 +111,7 @@ exports.errorMetadataSchemas = {
103
111
  [AppErrorCode.BAD_REFERENCE]: exports.sVoidMeta,
104
112
  // access
105
113
  [AppErrorCode.ACCESS_RULE_NOT_FOUND]: exports.sNotFoundMeta,
106
- [AppErrorCode.ACCESS_RULE_PERMISSION_CONFLICT]: exports.sVoidMeta,
114
+ [AppErrorCode.ACCESS_RULE_PERMISSION_CONFLICT]: exports.sAccessRuleConflictMeta,
107
115
  // alarm
108
116
  [AppErrorCode.ALARM_NOT_FOUND]: exports.sNotFoundMeta,
109
117
  // auth / user
@@ -135,6 +143,7 @@ exports.errorMetadataSchemas = {
135
143
  [AppErrorCode.ZONE_NOT_FOUND]: exports.sNotFoundMeta,
136
144
  [AppErrorCode.ZONE_ALREADY_EXISTS]: exports.sDuplicateMeta,
137
145
  [AppErrorCode.ZONE_IN_USE]: exports.sConflictMeta,
146
+ [AppErrorCode.ZONE_ACCESS_RULE_CONFLICT]: exports.sZoneAccessRuleConflictMeta,
138
147
  [AppErrorCode.SCHEDULE_NOT_FOUND]: exports.sNotFoundMeta,
139
148
  [AppErrorCode.SCHEDULE_ALREADY_EXISTS]: exports.sDuplicateMeta,
140
149
  [AppErrorCode.SCHEDULE_IN_USE]: exports.sConflictMeta,
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awarevue/api-types",
3
- "version": "1.0.23",
3
+ "version": "1.0.25",
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.23",
3
+ "version": "1.0.25",
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",