@awarevue/api-types 1.0.21 → 1.0.22

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
@@ -63,11 +63,15 @@ export type ConflictMeta = z.infer<typeof sConflictMeta>;
63
63
  export declare enum AppErrorCode {
64
64
  RESOURCE_ALREADY_EXISTS = "RESOURCE_ALREADY_EXISTS",
65
65
  RESOURCE_NOT_FOUND = "RESOURCE_NOT_FOUND",
66
+ RESOURCE_FORBIDDEN = "RESOURCE_FORBIDDEN",
66
67
  RESOURCE_INVALID = "RESOURCE_INVALID",
67
68
  RESOURCE_IN_USE = "RESOURCE_IN_USE",
68
69
  RESOURCE_NOT_SUPPORTED = "RESOURCE_NOT_SUPPORTED",
69
70
  BAD_REFERENCE = "BAD_REFERENCE",
70
71
  UNKNOWN = "UNKNOWN",
72
+ SERVER_INTERNAL_ERROR = "SERVER_INTERNAL_ERROR",
73
+ UNAUTHORIZED = "UNAUTHORIZED",
74
+ BAD_REQUEST = "BAD_REQUEST",
71
75
  ACCESS_RULE_NOT_FOUND = "ACCESS_RULE_NOT_FOUND",
72
76
  ACCESS_RULE_PERMISSION_CONFLICT = "ACCESS_RULE_PERMISSION_CONFLICT",
73
77
  ALARM_NOT_FOUND = "ALARM_NOT_FOUND",
@@ -167,6 +171,7 @@ export declare const errorMetadataSchemas: {
167
171
  blockingId?: string | undefined;
168
172
  }>;
169
173
  readonly RESOURCE_NOT_SUPPORTED: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
174
+ readonly RESOURCE_FORBIDDEN: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
170
175
  readonly BAD_REFERENCE: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
171
176
  readonly ACCESS_RULE_NOT_FOUND: z.ZodObject<{
172
177
  subject: z.ZodString;
@@ -612,6 +617,9 @@ export declare const errorMetadataSchemas: {
612
617
  fieldErrors: Record<string, string>;
613
618
  }>;
614
619
  readonly UNKNOWN: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
620
+ readonly SERVER_INTERNAL_ERROR: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
621
+ readonly UNAUTHORIZED: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
622
+ readonly BAD_REQUEST: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
615
623
  };
616
624
  type AppErrorMetadataSchemaMap = typeof errorMetadataSchemas;
617
625
  export type AppErrorMetadataMap = {
package/dist/error.js CHANGED
@@ -32,11 +32,15 @@ var AppErrorCode;
32
32
  // generic
33
33
  AppErrorCode["RESOURCE_ALREADY_EXISTS"] = "RESOURCE_ALREADY_EXISTS";
34
34
  AppErrorCode["RESOURCE_NOT_FOUND"] = "RESOURCE_NOT_FOUND";
35
+ AppErrorCode["RESOURCE_FORBIDDEN"] = "RESOURCE_FORBIDDEN";
35
36
  AppErrorCode["RESOURCE_INVALID"] = "RESOURCE_INVALID";
36
37
  AppErrorCode["RESOURCE_IN_USE"] = "RESOURCE_IN_USE";
37
38
  AppErrorCode["RESOURCE_NOT_SUPPORTED"] = "RESOURCE_NOT_SUPPORTED";
38
39
  AppErrorCode["BAD_REFERENCE"] = "BAD_REFERENCE";
39
40
  AppErrorCode["UNKNOWN"] = "UNKNOWN";
41
+ AppErrorCode["SERVER_INTERNAL_ERROR"] = "SERVER_INTERNAL_ERROR";
42
+ AppErrorCode["UNAUTHORIZED"] = "UNAUTHORIZED";
43
+ AppErrorCode["BAD_REQUEST"] = "BAD_REQUEST";
40
44
  // access
41
45
  AppErrorCode["ACCESS_RULE_NOT_FOUND"] = "ACCESS_RULE_NOT_FOUND";
42
46
  AppErrorCode["ACCESS_RULE_PERMISSION_CONFLICT"] = "ACCESS_RULE_PERMISSION_CONFLICT";
@@ -95,6 +99,7 @@ exports.errorMetadataSchemas = {
95
99
  [AppErrorCode.RESOURCE_INVALID]: exports.sInvalidMeta,
96
100
  [AppErrorCode.RESOURCE_IN_USE]: exports.sConflictMeta,
97
101
  [AppErrorCode.RESOURCE_NOT_SUPPORTED]: exports.sVoidMeta,
102
+ [AppErrorCode.RESOURCE_FORBIDDEN]: exports.sVoidMeta,
98
103
  [AppErrorCode.BAD_REFERENCE]: exports.sVoidMeta,
99
104
  // access
100
105
  [AppErrorCode.ACCESS_RULE_NOT_FOUND]: exports.sNotFoundMeta,
@@ -148,6 +153,9 @@ exports.errorMetadataSchemas = {
148
153
  // config
149
154
  [AppErrorCode.CONFIG_INVALID]: exports.sInvalidMeta,
150
155
  [AppErrorCode.UNKNOWN]: exports.sVoidMeta,
156
+ [AppErrorCode.SERVER_INTERNAL_ERROR]: exports.sVoidMeta,
157
+ [AppErrorCode.UNAUTHORIZED]: exports.sVoidMeta,
158
+ [AppErrorCode.BAD_REQUEST]: exports.sVoidMeta,
151
159
  };
152
160
  function isErrorResponse(err) {
153
161
  return (!!err &&
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awarevue/api-types",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
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.21",
3
+ "version": "1.0.22",
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",