@awarevue/api-types 2.0.150 → 2.0.152
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/api/error.d.ts +30 -0
- package/dist/api/error.js +15 -1
- package/dist/api/rest/access-control-authority.d.ts +48 -0
- package/dist/api/rest/access-control-authority.js +52 -0
- package/dist/api/rest/index.d.ts +1 -0
- package/dist/api/rest/index.js +1 -0
- package/dist/api/rest/module-config.d.ts +6 -0
- package/dist/api/rest/module-config.js +8 -0
- package/dist/objects/device/server.d.ts +1 -2
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/api/error.d.ts
CHANGED
|
@@ -42,6 +42,20 @@ export declare const sTokenLimitExceededMeta: z.ZodObject<{
|
|
|
42
42
|
retina: "retina";
|
|
43
43
|
}>;
|
|
44
44
|
}, z.core.$strip>;
|
|
45
|
+
export declare const sPersonTypeNotAccessControlUserMeta: z.ZodObject<{
|
|
46
|
+
personTypeId: z.ZodString;
|
|
47
|
+
field: z.ZodEnum<{
|
|
48
|
+
type: "type";
|
|
49
|
+
credentials: "credentials";
|
|
50
|
+
accessRules: "accessRules";
|
|
51
|
+
}>;
|
|
52
|
+
personIds: z.ZodArray<z.ZodString>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
export declare const sPersonTypeSyncPermissionRequiredMeta: z.ZodObject<{
|
|
55
|
+
personTypeId: z.ZodString;
|
|
56
|
+
affectedPeople: z.ZodNumber;
|
|
57
|
+
permission: z.ZodString;
|
|
58
|
+
}, z.core.$strip>;
|
|
45
59
|
export type VoidMeta = z.infer<typeof sVoidMeta>;
|
|
46
60
|
export type DuplicateMeta = z.infer<typeof sDuplicateMeta>;
|
|
47
61
|
export type NotFoundMeta = z.infer<typeof sNotFoundMeta>;
|
|
@@ -75,6 +89,8 @@ export declare enum AppErrorCode {
|
|
|
75
89
|
TOKEN_INVALID_FORMAT = "TOKEN_INVALID_FORMAT",
|
|
76
90
|
TOKEN_LIMIT_EXCEEDED = "TOKEN_LIMIT_EXCEEDED",
|
|
77
91
|
TOKEN_IN_USE = "TOKEN_IN_USE",
|
|
92
|
+
PERSON_TYPE_NOT_ACCESS_CONTROL_USER = "PERSON_TYPE_NOT_ACCESS_CONTROL_USER",
|
|
93
|
+
PERSON_TYPE_SYNC_PERMISSION_REQUIRED = "PERSON_TYPE_SYNC_PERMISSION_REQUIRED",
|
|
78
94
|
DEVICE_NOT_FOUND = "DEVICE_NOT_FOUND",
|
|
79
95
|
DEVICE_ALREADY_EXISTS = "DEVICE_ALREADY_EXISTS",
|
|
80
96
|
DEVICE_INVALID_ID = "DEVICE_INVALID_ID",
|
|
@@ -192,6 +208,20 @@ export declare const errorMetadataSchemas: {
|
|
|
192
208
|
blockingId: z.ZodOptional<z.ZodString>;
|
|
193
209
|
value: z.ZodOptional<z.ZodString>;
|
|
194
210
|
}, z.core.$strip>;
|
|
211
|
+
readonly PERSON_TYPE_NOT_ACCESS_CONTROL_USER: z.ZodObject<{
|
|
212
|
+
personTypeId: z.ZodString;
|
|
213
|
+
field: z.ZodEnum<{
|
|
214
|
+
type: "type";
|
|
215
|
+
credentials: "credentials";
|
|
216
|
+
accessRules: "accessRules";
|
|
217
|
+
}>;
|
|
218
|
+
personIds: z.ZodArray<z.ZodString>;
|
|
219
|
+
}, z.core.$strip>;
|
|
220
|
+
readonly PERSON_TYPE_SYNC_PERMISSION_REQUIRED: z.ZodObject<{
|
|
221
|
+
personTypeId: z.ZodString;
|
|
222
|
+
affectedPeople: z.ZodNumber;
|
|
223
|
+
permission: z.ZodString;
|
|
224
|
+
}, z.core.$strip>;
|
|
195
225
|
readonly DEVICE_NOT_FOUND: z.ZodObject<{
|
|
196
226
|
subject: z.ZodString;
|
|
197
227
|
field: z.ZodString;
|
package/dist/api/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.sTokenLimitExceededMeta = exports.sTokenInvalidFormatMeta = exports.sZoneAccessRuleConflictMeta = exports.sAccessRuleConflictMeta = exports.sVoidMeta = exports.sConflictMeta = exports.sInvalidMeta = exports.sNotFoundMeta = exports.sDuplicateMeta = void 0;
|
|
3
|
+
exports.errorMetadataSchemas = exports.AppErrorCode = exports.sPersonTypeSyncPermissionRequiredMeta = exports.sPersonTypeNotAccessControlUserMeta = exports.sTokenLimitExceededMeta = exports.sTokenInvalidFormatMeta = 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
|
const credential_type_1 = require("../primitives/credential-type");
|
|
@@ -42,6 +42,16 @@ exports.sTokenLimitExceededMeta = zod_1.z.object({
|
|
|
42
42
|
limit: zod_1.z.number(),
|
|
43
43
|
type: credential_type_1.sCredentialType,
|
|
44
44
|
});
|
|
45
|
+
exports.sPersonTypeNotAccessControlUserMeta = zod_1.z.object({
|
|
46
|
+
personTypeId: zod_1.z.string(),
|
|
47
|
+
field: zod_1.z.enum(['credentials', 'accessRules', 'type']),
|
|
48
|
+
personIds: zod_1.z.array(zod_1.z.string()),
|
|
49
|
+
});
|
|
50
|
+
exports.sPersonTypeSyncPermissionRequiredMeta = zod_1.z.object({
|
|
51
|
+
personTypeId: zod_1.z.string(),
|
|
52
|
+
affectedPeople: zod_1.z.number(),
|
|
53
|
+
permission: zod_1.z.string(),
|
|
54
|
+
});
|
|
45
55
|
// ERROR CODES
|
|
46
56
|
var AppErrorCode;
|
|
47
57
|
(function (AppErrorCode) {
|
|
@@ -76,6 +86,8 @@ var AppErrorCode;
|
|
|
76
86
|
AppErrorCode["TOKEN_INVALID_FORMAT"] = "TOKEN_INVALID_FORMAT";
|
|
77
87
|
AppErrorCode["TOKEN_LIMIT_EXCEEDED"] = "TOKEN_LIMIT_EXCEEDED";
|
|
78
88
|
AppErrorCode["TOKEN_IN_USE"] = "TOKEN_IN_USE";
|
|
89
|
+
AppErrorCode["PERSON_TYPE_NOT_ACCESS_CONTROL_USER"] = "PERSON_TYPE_NOT_ACCESS_CONTROL_USER";
|
|
90
|
+
AppErrorCode["PERSON_TYPE_SYNC_PERMISSION_REQUIRED"] = "PERSON_TYPE_SYNC_PERMISSION_REQUIRED";
|
|
79
91
|
// device
|
|
80
92
|
AppErrorCode["DEVICE_NOT_FOUND"] = "DEVICE_NOT_FOUND";
|
|
81
93
|
AppErrorCode["DEVICE_ALREADY_EXISTS"] = "DEVICE_ALREADY_EXISTS";
|
|
@@ -138,6 +150,8 @@ exports.errorMetadataSchemas = {
|
|
|
138
150
|
[AppErrorCode.TOKEN_INVALID_FORMAT]: exports.sTokenInvalidFormatMeta,
|
|
139
151
|
[AppErrorCode.TOKEN_LIMIT_EXCEEDED]: exports.sTokenLimitExceededMeta,
|
|
140
152
|
[AppErrorCode.TOKEN_IN_USE]: exports.sConflictMeta,
|
|
153
|
+
[AppErrorCode.PERSON_TYPE_NOT_ACCESS_CONTROL_USER]: exports.sPersonTypeNotAccessControlUserMeta,
|
|
154
|
+
[AppErrorCode.PERSON_TYPE_SYNC_PERMISSION_REQUIRED]: exports.sPersonTypeSyncPermissionRequiredMeta,
|
|
141
155
|
// device
|
|
142
156
|
[AppErrorCode.DEVICE_NOT_FOUND]: exports.sNotFoundMeta,
|
|
143
157
|
[AppErrorCode.DEVICE_ALREADY_EXISTS]: exports.sDuplicateMeta,
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const sAccessProviderObjectCounts: z.ZodObject<{
|
|
3
|
+
person: z.ZodNumber;
|
|
4
|
+
accessRule: z.ZodNumber;
|
|
5
|
+
schedule: z.ZodNumber;
|
|
6
|
+
zone: z.ZodNumber;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export type AccessProviderObjectCounts = z.infer<typeof sAccessProviderObjectCounts>;
|
|
9
|
+
export declare const sAccessProviderAuditConflict: z.ZodObject<{
|
|
10
|
+
personId: z.ZodUUID;
|
|
11
|
+
firstName: z.ZodString;
|
|
12
|
+
lastName: z.ZodString;
|
|
13
|
+
personTypeId: z.ZodString;
|
|
14
|
+
credentialCount: z.ZodNumber;
|
|
15
|
+
accessRuleCount: z.ZodNumber;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export type AccessProviderAuditConflict = z.infer<typeof sAccessProviderAuditConflict>;
|
|
18
|
+
export declare const sAccessProviderAuditDto: z.ZodObject<{
|
|
19
|
+
provider: z.ZodString;
|
|
20
|
+
held: z.ZodObject<{
|
|
21
|
+
person: z.ZodNumber;
|
|
22
|
+
accessRule: z.ZodNumber;
|
|
23
|
+
schedule: z.ZodNumber;
|
|
24
|
+
zone: z.ZodNumber;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
people: z.ZodObject<{
|
|
27
|
+
eligible: z.ZodNumber;
|
|
28
|
+
toAdd: z.ZodNumber;
|
|
29
|
+
toRemove: z.ZodNumber;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
conflicts: z.ZodArray<z.ZodObject<{
|
|
32
|
+
personId: z.ZodUUID;
|
|
33
|
+
firstName: z.ZodString;
|
|
34
|
+
lastName: z.ZodString;
|
|
35
|
+
personTypeId: z.ZodString;
|
|
36
|
+
credentialCount: z.ZodNumber;
|
|
37
|
+
accessRuleCount: z.ZodNumber;
|
|
38
|
+
}, z.core.$strip>>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
export type AccessProviderAuditDto = z.infer<typeof sAccessProviderAuditDto>;
|
|
41
|
+
export declare const sPersonTypeSyncImpactDto: z.ZodObject<{
|
|
42
|
+
personTypeId: z.ZodString;
|
|
43
|
+
accessControlUser: z.ZodBoolean;
|
|
44
|
+
affectedPeople: z.ZodNumber;
|
|
45
|
+
peopleWithAccess: z.ZodNumber;
|
|
46
|
+
syncRequired: z.ZodBoolean;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
export type PersonTypeSyncImpactDto = z.infer<typeof sPersonTypeSyncImpactDto>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sPersonTypeSyncImpactDto = exports.sAccessProviderAuditDto = exports.sAccessProviderAuditConflict = exports.sAccessProviderObjectCounts = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
// Number of local objects that currently have a reference in the provider
|
|
6
|
+
exports.sAccessProviderObjectCounts = zod_1.z.object({
|
|
7
|
+
person: zod_1.z.number().int(),
|
|
8
|
+
accessRule: zod_1.z.number().int(),
|
|
9
|
+
schedule: zod_1.z.number().int(),
|
|
10
|
+
zone: zod_1.z.number().int(),
|
|
11
|
+
});
|
|
12
|
+
// LEGACY(access-control-user-sync): remove once no site has conflicts
|
|
13
|
+
// A person whose type is not an access control user, but who still holds
|
|
14
|
+
// credentials or access rules. A resync removes them from the provider.
|
|
15
|
+
exports.sAccessProviderAuditConflict = zod_1.z.object({
|
|
16
|
+
personId: zod_1.z.uuid(),
|
|
17
|
+
firstName: zod_1.z.string(),
|
|
18
|
+
lastName: zod_1.z.string(),
|
|
19
|
+
personTypeId: zod_1.z.string(),
|
|
20
|
+
credentialCount: zod_1.z.number().int(),
|
|
21
|
+
accessRuleCount: zod_1.z.number().int(),
|
|
22
|
+
});
|
|
23
|
+
exports.sAccessProviderAuditDto = zod_1.z.object({
|
|
24
|
+
provider: zod_1.z.string(),
|
|
25
|
+
// objects held in the provider, according to the reference table
|
|
26
|
+
held: exports.sAccessProviderObjectCounts,
|
|
27
|
+
people: zod_1.z.object({
|
|
28
|
+
// people whose type is an access control user
|
|
29
|
+
eligible: zod_1.z.number().int(),
|
|
30
|
+
// eligible people not yet in the provider; a resync adds them
|
|
31
|
+
toAdd: zod_1.z.number().int(),
|
|
32
|
+
// people in the provider whose type is not an access control user;
|
|
33
|
+
// a resync removes them
|
|
34
|
+
toRemove: zod_1.z.number().int(),
|
|
35
|
+
}),
|
|
36
|
+
// LEGACY(access-control-user-sync): remove once no site has conflicts
|
|
37
|
+
conflicts: zod_1.z.array(exports.sAccessProviderAuditConflict),
|
|
38
|
+
});
|
|
39
|
+
// Effect of toggling accessControlUser on a person type
|
|
40
|
+
exports.sPersonTypeSyncImpactDto = zod_1.z.object({
|
|
41
|
+
personTypeId: zod_1.z.string(),
|
|
42
|
+
// the value the flag would change to
|
|
43
|
+
accessControlUser: zod_1.z.boolean(),
|
|
44
|
+
// people that would be added to (enabling) or removed from (disabling)
|
|
45
|
+
// the access control providers; 0 when no provider is connected
|
|
46
|
+
affectedPeople: zod_1.z.number().int(),
|
|
47
|
+
// people whose credentials and access rules would be removed (disabling only)
|
|
48
|
+
peopleWithAccess: zod_1.z.number().int(),
|
|
49
|
+
// true when affectedPeople or peopleWithAccess is non-zero; the change then
|
|
50
|
+
// needs the access-authority:sync permission, and a Sync All afterwards
|
|
51
|
+
syncRequired: zod_1.z.boolean(),
|
|
52
|
+
});
|
package/dist/api/rest/index.d.ts
CHANGED
package/dist/api/rest/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { JSONSchema4 } from 'json-schema';
|
|
2
|
+
import z from 'zod';
|
|
2
3
|
import { UiHint } from '../../objects';
|
|
3
4
|
export interface SaveProviderConfigRq {
|
|
4
5
|
provider: string;
|
|
@@ -17,3 +18,8 @@ export interface ModuleConfigSpecs {
|
|
|
17
18
|
default: Record<string, unknown>;
|
|
18
19
|
uiHints?: UiHint[];
|
|
19
20
|
}
|
|
21
|
+
export declare const sModuleConfig: z.ZodObject<{
|
|
22
|
+
app: z.ZodObject<{
|
|
23
|
+
modules: z.ZodArray<z.ZodString>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
}, z.core.$catchall<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.sModuleConfig = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
exports.sModuleConfig = zod_1.default
|
|
9
|
+
.object({ app: zod_1.default.object({ modules: zod_1.default.array(zod_1.default.string()) }) })
|
|
10
|
+
.catchall(zod_1.default.record(zod_1.default.string(), zod_1.default.unknown()));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigState } from '../../objects/device/changeset';
|
|
2
2
|
import { AccessControlCapabilityReport } from '../agent-metadata';
|
|
3
|
-
import {
|
|
3
|
+
import { ModuleConfigMetadata } from '../module-config';
|
|
4
4
|
export declare const SERVER = "server";
|
|
5
5
|
export type AccessControlProviderState = AccessControlCapabilityReport & {
|
|
6
6
|
syncInProgress: boolean;
|
|
@@ -12,7 +12,6 @@ export type AccessControlProviderState = AccessControlCapabilityReport & {
|
|
|
12
12
|
export type ServerState = {
|
|
13
13
|
activeProviders: string[];
|
|
14
14
|
configMetadata: ModuleConfigMetadata;
|
|
15
|
-
config: ModuleConfig;
|
|
16
15
|
runnableProviders: string[];
|
|
17
16
|
accessControlProviders: Record<string, AccessControlProviderState>;
|
|
18
17
|
citadelMode: boolean;
|
package/dist/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "git",
|
|
5
5
|
"url": "git+https://github.com/Linc-Security-Systems/aware-essentials.git"
|
|
6
6
|
},
|
|
7
|
-
"version": "2.0.
|
|
7
|
+
"version": "2.0.152",
|
|
8
8
|
"description": "Common types between backend, agent(s) and frontend(s)",
|
|
9
9
|
"main": "dist/index.js",
|
|
10
10
|
"types": "dist/index.d.ts",
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "git",
|
|
5
5
|
"url": "git+https://github.com/Linc-Security-Systems/aware-essentials.git"
|
|
6
6
|
},
|
|
7
|
-
"version": "2.0.
|
|
7
|
+
"version": "2.0.152",
|
|
8
8
|
"description": "Common types between backend, agent(s) and frontend(s)",
|
|
9
9
|
"main": "dist/index.js",
|
|
10
10
|
"types": "dist/index.d.ts",
|