@go-mondo/identity-sdk 0.0.2-beta.3 → 0.0.2-beta.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.
- package/.release-please-manifest.json +1 -1
- package/.tsbuildinfo/cjs.json +1 -1
- package/.tsbuildinfo/esm.json +1 -1
- package/CHANGELOG.md +14 -0
- package/dist/cjs/activity/schema/base.d.ts +16 -0
- package/dist/cjs/activity/schema/base.d.ts.map +1 -1
- package/dist/cjs/activity/schema/base.js +16 -3
- package/dist/cjs/activity/schema/schema.d.ts +1 -16
- package/dist/cjs/activity/schema/schema.d.ts.map +1 -1
- package/dist/cjs/activity/schema/schema.js +8 -19
- package/dist/cjs/association/schema/association.d.ts +3 -3
- package/dist/cjs/authorization/permissions/schema.d.ts +4 -4
- package/dist/cjs/authorization/permissions/schema.d.ts.map +1 -1
- package/dist/cjs/authorization/permissions/schema.js +4 -2
- package/dist/cjs/common/schema/schema.d.ts +4 -0
- package/dist/cjs/common/schema/schema.d.ts.map +1 -1
- package/dist/cjs/common/schema/schema.js +10 -0
- package/dist/cjs/common/schema/sets.d.ts +1 -1
- package/dist/cjs/common/schema/sets.d.ts.map +1 -1
- package/dist/cjs/common/schema/sets.js +2 -2
- package/dist/cjs/customer/users/schema.d.ts +7 -8
- package/dist/cjs/customer/users/schema.d.ts.map +1 -1
- package/dist/cjs/customer/users/schema.js +25 -24
- package/dist/cjs/customer/users/schema.test.js +49 -0
- package/dist/esm/activity/schema/base.d.ts +16 -0
- package/dist/esm/activity/schema/base.d.ts.map +1 -1
- package/dist/esm/activity/schema/base.js +14 -1
- package/dist/esm/activity/schema/schema.d.ts +1 -16
- package/dist/esm/activity/schema/schema.d.ts.map +1 -1
- package/dist/esm/activity/schema/schema.js +1 -14
- package/dist/esm/association/schema/association.d.ts +3 -3
- package/dist/esm/authorization/permissions/schema.d.ts +4 -4
- package/dist/esm/authorization/permissions/schema.d.ts.map +1 -1
- package/dist/esm/authorization/permissions/schema.js +4 -2
- package/dist/esm/common/schema/schema.d.ts +4 -0
- package/dist/esm/common/schema/schema.d.ts.map +1 -1
- package/dist/esm/common/schema/schema.js +6 -0
- package/dist/esm/common/schema/sets.d.ts +1 -1
- package/dist/esm/common/schema/sets.d.ts.map +1 -1
- package/dist/esm/common/schema/sets.js +1 -1
- package/dist/esm/customer/users/schema.d.ts +7 -8
- package/dist/esm/customer/users/schema.d.ts.map +1 -1
- package/dist/esm/customer/users/schema.js +24 -23
- package/dist/esm/customer/users/schema.test.js +49 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.2-beta.5](https://github.com/go-mondo/identity-node-sdk/compare/identity-sdk-v0.0.2-beta.4...identity-sdk-v0.0.2-beta.5) (2025-05-02)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* Cannot access PerformerType before initialization ([d4c4c2c](https://github.com/go-mondo/identity-node-sdk/commit/d4c4c2cd9880e76efbe10af85b293d9da0c8abfb))
|
|
9
|
+
|
|
10
|
+
## [0.0.2-beta.4](https://github.com/go-mondo/identity-node-sdk/compare/identity-sdk-v0.0.2-beta.3...identity-sdk-v0.0.2-beta.4) (2025-05-02)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* authorization permissions ([642a568](https://github.com/go-mondo/identity-node-sdk/commit/642a568e4dc14184655c11645850f0f485345d0a))
|
|
16
|
+
|
|
3
17
|
## [0.0.2-beta.3](https://github.com/go-mondo/identity-node-sdk/compare/identity-sdk-v0.0.2-beta.2...identity-sdk-v0.0.2-beta.3) (2025-04-30)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
export declare const ActivityType: {
|
|
2
|
+
readonly UNKNOWN: "unknown";
|
|
3
|
+
readonly NOTE: "note";
|
|
4
|
+
readonly OPERATION: "operation";
|
|
5
|
+
readonly AUTHORIZATION: "authorization";
|
|
6
|
+
readonly AUTHENTICATION: "authentication";
|
|
7
|
+
};
|
|
8
|
+
export type AnyActivityType = (typeof ActivityType)[keyof typeof ActivityType];
|
|
9
|
+
export declare const PerformerType: {
|
|
10
|
+
readonly SYSTEM: "system";
|
|
11
|
+
readonly GUEST: "guest";
|
|
12
|
+
readonly IDENTITY: "identity";
|
|
13
|
+
readonly AUTOMATION: "automation";
|
|
14
|
+
readonly INTEGRATION: "integration";
|
|
15
|
+
};
|
|
16
|
+
export type AnyPerformerType = (typeof PerformerType)[keyof typeof PerformerType];
|
|
1
17
|
export declare const ActivityIdSchema: import("arktype/out/methods/string.js").StringType<string, {}>;
|
|
2
18
|
export type ActivityId = typeof ActivityIdSchema.inferOut;
|
|
3
19
|
export declare const ActivityIdPropertySchema: import("arktype/out/methods/object.js").ObjectType<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/activity/schema/base.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/activity/schema/base.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,YAAY;;;;;;CAMf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE/E,eAAO,MAAM,aAAa;;;;;;CAMhB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAErD,eAAO,MAAM,gBAAgB,gEAAc,CAAC;AAC5C,MAAM,MAAM,UAAU,GAAG,OAAO,gBAAgB,CAAC,QAAQ,CAAC;AAE1D,eAAO,MAAM,wBAAwB;;MAEnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,wBAAwB,CAAC,QAAQ,CAAC;AAE1E,eAAO,MAAM,YAAY,gEAAiB,CAAC;AAE3C,eAAO,MAAM,iBAAiB;;;MAS5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,iBAAiB,CAAC,QAAQ,CAAC;AAE5D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;MASO,CAAC;AAEtC,eAAO,MAAM,uBAAuB;;;;;;;;;;;MAGO,CAAC;AAE5C,eAAO,MAAM,uBAAuB;;;;;;;;;;MAEO,CAAC"}
|
|
@@ -1,18 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BaseUpdatePayloadSchema = exports.BaseInsertPayloadSchema = exports.BasePayloadSchema = exports.PerformedBySchema = exports.SourceSchema = exports.ActivityIdPropertySchema = exports.ActivityIdSchema = void 0;
|
|
3
|
+
exports.BaseUpdatePayloadSchema = exports.BaseInsertPayloadSchema = exports.BasePayloadSchema = exports.PerformedBySchema = exports.SourceSchema = exports.ActivityIdPropertySchema = exports.ActivityIdSchema = exports.PerformerType = exports.ActivityType = void 0;
|
|
4
4
|
const arktype_1 = require("arktype");
|
|
5
5
|
const index_js_1 = require("../../common/index.js");
|
|
6
6
|
const metadata_js_1 = require("../../common/schema/metadata.js");
|
|
7
|
-
const schema_js_1 = require("./schema.js");
|
|
8
7
|
const utils_js_1 = require("./utils.js");
|
|
8
|
+
exports.ActivityType = {
|
|
9
|
+
UNKNOWN: 'unknown',
|
|
10
|
+
NOTE: 'note',
|
|
11
|
+
OPERATION: 'operation',
|
|
12
|
+
AUTHORIZATION: 'authorization',
|
|
13
|
+
AUTHENTICATION: 'authentication',
|
|
14
|
+
};
|
|
15
|
+
exports.PerformerType = {
|
|
16
|
+
SYSTEM: 'system',
|
|
17
|
+
GUEST: 'guest',
|
|
18
|
+
IDENTITY: 'identity',
|
|
19
|
+
AUTOMATION: 'automation',
|
|
20
|
+
INTEGRATION: 'integration',
|
|
21
|
+
};
|
|
9
22
|
exports.ActivityIdSchema = arktype_1.type.string;
|
|
10
23
|
exports.ActivityIdPropertySchema = (0, arktype_1.type)({
|
|
11
24
|
id: exports.ActivityIdSchema,
|
|
12
25
|
});
|
|
13
26
|
exports.SourceSchema = (0, arktype_1.type)('string');
|
|
14
27
|
exports.PerformedBySchema = (0, arktype_1.type)({
|
|
15
|
-
type: arktype_1.type.enumerated(
|
|
28
|
+
type: arktype_1.type.enumerated(exports.PerformerType.SYSTEM, exports.PerformerType.GUEST, exports.PerformerType.IDENTITY, exports.PerformerType.AUTOMATION, exports.PerformerType.INTEGRATION),
|
|
16
29
|
identifier: (0, arktype_1.type)('string'),
|
|
17
30
|
});
|
|
18
31
|
exports.BasePayloadSchema = (0, arktype_1.type)({
|
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
readonly UNKNOWN: "unknown";
|
|
3
|
-
readonly NOTE: "note";
|
|
4
|
-
readonly OPERATION: "operation";
|
|
5
|
-
readonly AUTHORIZATION: "authorization";
|
|
6
|
-
readonly AUTHENTICATION: "authentication";
|
|
7
|
-
};
|
|
8
|
-
export type AnyActivityType = (typeof ActivityType)[keyof typeof ActivityType];
|
|
9
|
-
export declare const PerformerType: {
|
|
10
|
-
readonly SYSTEM: "system";
|
|
11
|
-
readonly GUEST: "guest";
|
|
12
|
-
readonly IDENTITY: "identity";
|
|
13
|
-
readonly AUTOMATION: "automation";
|
|
14
|
-
readonly INTEGRATION: "integration";
|
|
15
|
-
};
|
|
16
|
-
export type AnyPerformerType = (typeof PerformerType)[keyof typeof PerformerType];
|
|
1
|
+
export { ActivityType, type AnyActivityType, PerformerType, type AnyPerformerType, } from './base.js';
|
|
17
2
|
export declare const ActivityPayloadSchema: import("arktype/out/methods/object.js").ObjectType<{
|
|
18
3
|
id: string;
|
|
19
4
|
performedBy: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/activity/schema/schema.ts"],"names":[],"mappings":"AAUA,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/activity/schema/schema.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,YAAY,EACZ,KAAK,eAAe,EACpB,aAAa,EACb,KAAK,gBAAgB,GACtB,MAAM,WAAW,CAAC;AAEnB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAKC,CAAC;AACpC,MAAM,MAAM,eAAe,GAAG,OAAO,qBAAqB,CAAC,QAAQ,CAAC;AAEpE,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;MAAkC,CAAC;AAC3E,MAAM,MAAM,qBAAqB,GAAG,OAAO,2BAA2B,CAAC,QAAQ,CAAC;AAEhF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;MAAkC,CAAC;AAC3E,MAAM,MAAM,qBAAqB,GAAG,OAAO,2BAA2B,CAAC,QAAQ,CAAC;AAEhF,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,WAAW,GACjB,MAAM,WAAW,CAAC;AACnB,cAAc,aAAa,CAAC;AAC5B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,YAAY,CAAC"}
|
|
@@ -20,31 +20,20 @@ const authorization_js_1 = require("./types/authorization.js");
|
|
|
20
20
|
const note_js_1 = require("./types/note.js");
|
|
21
21
|
const operation_js_1 = require("./types/operation.js");
|
|
22
22
|
const unknown_js_1 = require("./types/unknown.js");
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
OPERATION: 'operation',
|
|
27
|
-
AUTHORIZATION: 'authorization',
|
|
28
|
-
AUTHENTICATION: 'authentication',
|
|
29
|
-
};
|
|
30
|
-
exports.PerformerType = {
|
|
31
|
-
SYSTEM: 'system',
|
|
32
|
-
GUEST: 'guest',
|
|
33
|
-
IDENTITY: 'identity',
|
|
34
|
-
AUTOMATION: 'automation',
|
|
35
|
-
INTEGRATION: 'integration',
|
|
36
|
-
};
|
|
23
|
+
var base_js_1 = require("./base.js");
|
|
24
|
+
Object.defineProperty(exports, "ActivityType", { enumerable: true, get: function () { return base_js_1.ActivityType; } });
|
|
25
|
+
Object.defineProperty(exports, "PerformerType", { enumerable: true, get: function () { return base_js_1.PerformerType; } });
|
|
37
26
|
exports.ActivityPayloadSchema = note_js_1.NoteActivityPayloadSchema.or(authentication_js_1.AuthenticationActivityPayloadSchema)
|
|
38
27
|
.or(authorization_js_1.AuthorizationActivityPayloadSchema)
|
|
39
28
|
.or(operation_js_1.OperationActivityPayloadSchema)
|
|
40
29
|
.or(unknown_js_1.UnknownActivityPayloadSchema);
|
|
41
30
|
exports.InsertActivityPayloadSchema = note_js_1.InsertNoteActivityPayloadSchema;
|
|
42
31
|
exports.UpdateActivityPayloadSchema = note_js_1.UpdateNoteActivityPayloadSchema;
|
|
43
|
-
var
|
|
44
|
-
Object.defineProperty(exports, "ActivityIdPropertySchema", { enumerable: true, get: function () { return
|
|
45
|
-
Object.defineProperty(exports, "ActivityIdSchema", { enumerable: true, get: function () { return
|
|
46
|
-
Object.defineProperty(exports, "PerformedBySchema", { enumerable: true, get: function () { return
|
|
47
|
-
Object.defineProperty(exports, "SourceSchema", { enumerable: true, get: function () { return
|
|
32
|
+
var base_js_2 = require("./base.js");
|
|
33
|
+
Object.defineProperty(exports, "ActivityIdPropertySchema", { enumerable: true, get: function () { return base_js_2.ActivityIdPropertySchema; } });
|
|
34
|
+
Object.defineProperty(exports, "ActivityIdSchema", { enumerable: true, get: function () { return base_js_2.ActivityIdSchema; } });
|
|
35
|
+
Object.defineProperty(exports, "PerformedBySchema", { enumerable: true, get: function () { return base_js_2.PerformedBySchema; } });
|
|
36
|
+
Object.defineProperty(exports, "SourceSchema", { enumerable: true, get: function () { return base_js_2.SourceSchema; } });
|
|
48
37
|
__exportStar(require("./schema.js"), exports);
|
|
49
38
|
__exportStar(require("./types/authentication.js"), exports);
|
|
50
39
|
__exportStar(require("./types/authorization.js"), exports);
|
|
@@ -15,7 +15,7 @@ export declare const AssociationObjectSchema: import("arktype/out/methods/object
|
|
|
15
15
|
familyName?: string | undefined;
|
|
16
16
|
honorificPrefix?: string | undefined;
|
|
17
17
|
honorificSuffix?: string | undefined;
|
|
18
|
-
email?:
|
|
18
|
+
email?: string | undefined;
|
|
19
19
|
phoneNumber?: string | undefined;
|
|
20
20
|
status: "active" | "suspended" | "unverified";
|
|
21
21
|
model: "User";
|
|
@@ -33,7 +33,7 @@ export declare const ObjectPropertySchema: import("arktype/out/methods/object.js
|
|
|
33
33
|
familyName?: string | undefined;
|
|
34
34
|
honorificPrefix?: string | undefined;
|
|
35
35
|
honorificSuffix?: string | undefined;
|
|
36
|
-
email?:
|
|
36
|
+
email?: string | undefined;
|
|
37
37
|
phoneNumber?: string | undefined;
|
|
38
38
|
status: "active" | "suspended" | "unverified";
|
|
39
39
|
model: "User";
|
|
@@ -54,7 +54,7 @@ export declare const AssociationPayloadSchema: import("arktype/out/methods/objec
|
|
|
54
54
|
familyName?: string | undefined;
|
|
55
55
|
honorificPrefix?: string | undefined;
|
|
56
56
|
honorificSuffix?: string | undefined;
|
|
57
|
-
email?:
|
|
57
|
+
email?: string | undefined;
|
|
58
58
|
phoneNumber?: string | undefined;
|
|
59
59
|
status: "active" | "suspended" | "unverified";
|
|
60
60
|
model: "User";
|
|
@@ -18,6 +18,8 @@ export declare const PermissionSchema: import("arktype/out/methods/object.js").O
|
|
|
18
18
|
name: string;
|
|
19
19
|
status: "enabled" | "disabled";
|
|
20
20
|
description?: string | undefined;
|
|
21
|
+
createdAt: Date | ((In: string) => import("arktype/out/attributes.js").To<Date>);
|
|
22
|
+
updatedAt: Date | ((In: string) => import("arktype/out/attributes.js").To<Date>);
|
|
21
23
|
apps?: {
|
|
22
24
|
ids?: string[] | undefined;
|
|
23
25
|
count?: number | undefined;
|
|
@@ -26,8 +28,6 @@ export declare const PermissionSchema: import("arktype/out/methods/object.js").O
|
|
|
26
28
|
ids?: string[] | undefined;
|
|
27
29
|
count?: number | undefined;
|
|
28
30
|
} | undefined;
|
|
29
|
-
createdAt: Date | ((In: string) => import("arktype/out/attributes.js").To<Date>);
|
|
30
|
-
updatedAt: Date | ((In: string) => import("arktype/out/attributes.js").To<Date>);
|
|
31
31
|
deletedAt?: Date | ((In: string) => import("arktype/out/attributes.js").To<Date>) | undefined;
|
|
32
32
|
deactivatedAt?: Date | ((In: string) => import("arktype/out/attributes.js").To<Date>) | undefined;
|
|
33
33
|
metadata: (In: import("arktype/out/attributes.js").Default<unknown, Map<string, string | number | boolean>>) => import("arktype/out/attributes.js").Out<Map<string, string | number | boolean> | Map<string, any>>;
|
|
@@ -39,6 +39,8 @@ export declare const PermissionPayloadSchema: import("arktype/out/methods/object
|
|
|
39
39
|
name: string;
|
|
40
40
|
status: "enabled" | "disabled";
|
|
41
41
|
description?: string | undefined;
|
|
42
|
+
createdAt: (In: string | Date) => import("arktype/out/attributes.js").Out<string>;
|
|
43
|
+
updatedAt: (In: string | Date) => import("arktype/out/attributes.js").Out<string>;
|
|
42
44
|
apps?: {
|
|
43
45
|
ids?: string[] | undefined;
|
|
44
46
|
count?: number | undefined;
|
|
@@ -47,8 +49,6 @@ export declare const PermissionPayloadSchema: import("arktype/out/methods/object
|
|
|
47
49
|
ids?: string[] | undefined;
|
|
48
50
|
count?: number | undefined;
|
|
49
51
|
} | undefined;
|
|
50
|
-
createdAt: (In: string | Date) => import("arktype/out/attributes.js").Out<string>;
|
|
51
|
-
updatedAt: (In: string | Date) => import("arktype/out/attributes.js").Out<string>;
|
|
52
52
|
deletedAt?: ((In: string | Date | undefined) => import("arktype/out/attributes.js").Out<string | undefined>) | undefined;
|
|
53
53
|
deactivatedAt?: ((In: string | Date | undefined) => import("arktype/out/attributes.js").Out<string | undefined>) | undefined;
|
|
54
54
|
metadata?: ((In: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/authorization/permissions/schema.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,gBAAgB;;;CAGnB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAC7B,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAE3D,eAAO,MAAM,kBAAkB,gEAAc,CAAC;AAE9C,eAAO,MAAM,0BAA0B;;MAErC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,OAAO,0BAA0B,CAAC,QAAQ,CAAC;AAS9E,eAAO,MAAM,4BAA4B;;;MAGvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAChC,OAAO,4BAA4B,CAAC,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/authorization/permissions/schema.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,gBAAgB;;;CAGnB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAC7B,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAE3D,eAAO,MAAM,kBAAkB,gEAAc,CAAC;AAE9C,eAAO,MAAM,0BAA0B;;MAErC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,OAAO,0BAA0B,CAAC,QAAQ,CAAC;AAS9E,eAAO,MAAM,4BAA4B;;;MAGvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAChC,OAAO,4BAA4B,CAAC,QAAQ,CAAC;AAQ/C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;MAOI,CAAC;AAClC,MAAM,MAAM,oBAAoB,GAAG,OAAO,gBAAgB,CAAC,OAAO,CAAC;AACnE,MAAM,MAAM,UAAU,GAAG,OAAO,gBAAgB,CAAC,QAAQ,CAAC;AAE1D,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;MAOC,CAAC;AACtC,MAAM,MAAM,iBAAiB,GAAG,OAAO,uBAAuB,CAAC,QAAQ,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;MAOC,CAAC;AAC5C,MAAM,MAAM,qBAAqB,GAC/B,OAAO,6BAA6B,CAAC,OAAO,CAAC;AAC/C,MAAM,MAAM,uBAAuB,GACjC,OAAO,6BAA6B,CAAC,QAAQ,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;MAIC,CAAC;AAC5C,MAAM,MAAM,qBAAqB,GAC/B,OAAO,6BAA6B,CAAC,OAAO,CAAC;AAC/C,MAAM,MAAM,uBAAuB,GACjC,OAAO,6BAA6B,CAAC,QAAQ,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,oCAAoC;;;;;MAG7C,CAAC;AACL,MAAM,MAAM,8BAA8B,GACxC,OAAO,oCAAoC,CAAC,QAAQ,CAAC"}
|
|
@@ -24,16 +24,18 @@ const BaseSchema = exports.PermissionIdPropertySchema.and({
|
|
|
24
24
|
name: (0, arktype_1.type)('string'),
|
|
25
25
|
status: PermissionStatusSchema,
|
|
26
26
|
description: (0, arktype_1.type)('string').optional(),
|
|
27
|
-
apps: aggregate_js_1.AggregateSchema.optional(),
|
|
28
|
-
roles: aggregate_js_1.AggregateSchema.optional(),
|
|
29
27
|
});
|
|
30
28
|
exports.PermissionSchema = BaseSchema.and({
|
|
29
|
+
apps: aggregate_js_1.AggregateSchema.optional(),
|
|
30
|
+
roles: aggregate_js_1.AggregateSchema.optional(),
|
|
31
31
|
createdAt: index_js_1.RequiredDateSchema,
|
|
32
32
|
updatedAt: index_js_1.RequiredDateSchema,
|
|
33
33
|
'deletedAt?': index_js_1.OptionalDateSchema,
|
|
34
34
|
'deactivatedAt?': index_js_1.OptionalDateSchema,
|
|
35
35
|
}).and(metadata_js_1.MetadataMapPropertySchema);
|
|
36
36
|
exports.PermissionPayloadSchema = BaseSchema.and({
|
|
37
|
+
apps: aggregate_js_1.AggregateSchema.optional(),
|
|
38
|
+
roles: aggregate_js_1.AggregateSchema.optional(),
|
|
37
39
|
createdAt: index_js_1.RequiredDatePayloadSchema,
|
|
38
40
|
updatedAt: index_js_1.RequiredDatePayloadSchema,
|
|
39
41
|
'deletedAt?': index_js_1.OptionalDatePayloadSchema,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { type } from 'arktype';
|
|
1
2
|
export * from './aggregate.js';
|
|
2
3
|
export * from './collection.js';
|
|
3
4
|
export * from './dates.js';
|
|
@@ -5,4 +6,7 @@ export * from './jwt.js';
|
|
|
5
6
|
export * from './metadata.js';
|
|
6
7
|
export * from './pagination.js';
|
|
7
8
|
export * from './sets.js';
|
|
9
|
+
export declare const optionallyNullishToUndefined: <t extends type.Any>(t: t) => [type<t["t"] | undefined>, "?"];
|
|
10
|
+
export declare const optionallyNullish: <t extends type.Any>(t: t) => [type<t["t"] | null | undefined>, "?"];
|
|
11
|
+
export declare const optionallyUndefined: <t extends type.Any>(t: t) => [type<t["t"] | undefined>, "?"];
|
|
8
12
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/common/schema/schema.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/common/schema/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,IAAI,EAAE,MAAM,SAAS,CAAC;AAE1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAE1B,eAAO,MAAM,4BAA4B,GAAI,CAAC,SAAS,IAAI,CAAC,GAAG,EAC7D,GAAG,CAAC,KACH,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,EAAE,GAAG,CAIT,CAAC;AAEzB,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,IAAI,CAAC,GAAG,EAClD,GAAG,CAAC,KACH,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,GAAG,CACgB,CAAC;AAEzD,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,IAAI,CAAC,GAAG,EACpD,GAAG,CAAC,KACH,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,EAAE,GAAG,CACgB,CAAC"}
|
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.optionallyUndefined = exports.optionallyNullish = exports.optionallyNullishToUndefined = void 0;
|
|
17
18
|
__exportStar(require("./aggregate.js"), exports);
|
|
18
19
|
__exportStar(require("./collection.js"), exports);
|
|
19
20
|
__exportStar(require("./dates.js"), exports);
|
|
@@ -21,3 +22,12 @@ __exportStar(require("./jwt.js"), exports);
|
|
|
21
22
|
__exportStar(require("./metadata.js"), exports);
|
|
22
23
|
__exportStar(require("./pagination.js"), exports);
|
|
23
24
|
__exportStar(require("./sets.js"), exports);
|
|
25
|
+
const optionallyNullishToUndefined = (t) => t
|
|
26
|
+
.or('null | undefined')
|
|
27
|
+
.pipe((v) => (v == null ? v : undefined))
|
|
28
|
+
.optional();
|
|
29
|
+
exports.optionallyNullishToUndefined = optionallyNullishToUndefined;
|
|
30
|
+
const optionallyNullish = (t) => t.or('null | undefined').optional();
|
|
31
|
+
exports.optionallyNullish = optionallyNullish;
|
|
32
|
+
const optionallyUndefined = (t) => t.or('undefined').optional();
|
|
33
|
+
exports.optionallyUndefined = optionallyUndefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const UniqueStringSetPayloadSchema: import("arktype/out/methods/object").ObjectType<Set<string> | ((In: string[]) => import("arktype/out/attributes").Out<Set<string>>), {}>;
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const UniqueStringPayloadSchema: import("arktype/out/methods/object").ObjectType<(In: Set<string> | string[]) => import("arktype/out/attributes").Out<string[]>, {}>;
|
|
3
3
|
//# sourceMappingURL=sets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sets.d.ts","sourceRoot":"","sources":["../../../../src/common/schema/sets.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,4BAA4B,0IAAiC,CAAC;AAC3E,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"sets.d.ts","sourceRoot":"","sources":["../../../../src/common/schema/sets.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,4BAA4B,0IAAiC,CAAC;AAC3E,eAAO,MAAM,yBAAyB,qIAErC,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.UniqueStringPayloadSchema = exports.UniqueStringSetPayloadSchema = void 0;
|
|
4
4
|
const arktype_1 = require("arktype");
|
|
5
5
|
const StringArraySchema = (0, arktype_1.type)('string[]');
|
|
6
6
|
const StringArrayToSet = StringArraySchema.pipe((s) => new Set(s));
|
|
7
7
|
const StringSet = arktype_1.type.instanceOf((Set));
|
|
8
8
|
exports.UniqueStringSetPayloadSchema = StringSet.or(StringArrayToSet);
|
|
9
|
-
exports.
|
|
9
|
+
exports.UniqueStringPayloadSchema = exports.UniqueStringSetPayloadSchema.pipe((s) => Array.from(s.values()));
|
|
@@ -16,8 +16,7 @@ export declare const UserNamePropertiesSchema: import("arktype/out/methods/objec
|
|
|
16
16
|
honorificPrefix?: string | undefined;
|
|
17
17
|
honorificSuffix?: string | undefined;
|
|
18
18
|
}, {}>;
|
|
19
|
-
export
|
|
20
|
-
export declare const UpsertUserNamePropertiesSchema: import("arktype/out/methods/object.js").ObjectType<{
|
|
19
|
+
export declare const UpdateUserNamePropertiesSchema: import("arktype/out/methods/object.js").ObjectType<{
|
|
21
20
|
givenName?: string | null | undefined;
|
|
22
21
|
middleName?: string | null | undefined;
|
|
23
22
|
familyName?: string | null | undefined;
|
|
@@ -33,13 +32,13 @@ export type UserIdProperty = typeof UserIdPropertySchema.inferOut;
|
|
|
33
32
|
export declare const RequiredEmailSchema: import("arktype/out/methods/string.js").StringType<string, {}>;
|
|
34
33
|
export declare const RequiredPhoneNumberSchema: import("arktype/out/methods/string.js").StringType<string, {}>;
|
|
35
34
|
export declare const VerifiedEmailOrPhonePropertiesSchema: import("arktype/out/methods/object.js").ObjectType<{
|
|
36
|
-
email?:
|
|
35
|
+
email?: string | undefined;
|
|
37
36
|
verifiedEmail?: boolean | undefined;
|
|
38
37
|
phoneNumber?: string | undefined;
|
|
39
38
|
verifiedPhoneNumber?: boolean | undefined;
|
|
40
39
|
}, {}>;
|
|
41
40
|
export declare const EmailOrPhonePropertiesSchema: import("arktype/out/methods/object.js").ObjectType<{
|
|
42
|
-
email?:
|
|
41
|
+
email?: string | undefined;
|
|
43
42
|
phoneNumber?: string | undefined;
|
|
44
43
|
}, {}>;
|
|
45
44
|
export declare const UserAssociationsSchema: import("arktype/out/methods/object.js").ObjectType<{
|
|
@@ -53,7 +52,7 @@ export declare const UserSchema: import("arktype/out/methods/object.js").ObjectT
|
|
|
53
52
|
familyName?: string | undefined;
|
|
54
53
|
honorificPrefix?: string | undefined;
|
|
55
54
|
honorificSuffix?: string | undefined;
|
|
56
|
-
email?:
|
|
55
|
+
email?: string | undefined;
|
|
57
56
|
verifiedEmail?: boolean | undefined;
|
|
58
57
|
phoneNumber?: string | undefined;
|
|
59
58
|
verifiedPhoneNumber?: boolean | undefined;
|
|
@@ -78,7 +77,7 @@ export declare const UserPayloadSchema: import("arktype/out/methods/object.js").
|
|
|
78
77
|
familyName?: string | undefined;
|
|
79
78
|
honorificPrefix?: string | undefined;
|
|
80
79
|
honorificSuffix?: string | undefined;
|
|
81
|
-
email?:
|
|
80
|
+
email?: string | undefined;
|
|
82
81
|
verifiedEmail?: boolean | undefined;
|
|
83
82
|
phoneNumber?: string | undefined;
|
|
84
83
|
verifiedPhoneNumber?: boolean | undefined;
|
|
@@ -107,7 +106,7 @@ export declare const InsertUserPayloadSchema: import("arktype/out/methods/object
|
|
|
107
106
|
familyName?: string | undefined;
|
|
108
107
|
honorificPrefix?: string | undefined;
|
|
109
108
|
honorificSuffix?: string | undefined;
|
|
110
|
-
email?:
|
|
109
|
+
email?: string | undefined;
|
|
111
110
|
verifiedEmail?: boolean | undefined;
|
|
112
111
|
phoneNumber?: string | undefined;
|
|
113
112
|
verifiedPhoneNumber?: boolean | undefined;
|
|
@@ -142,7 +141,7 @@ export declare const UserAssociationReferenceSchema: import("arktype/out/methods
|
|
|
142
141
|
familyName?: string | undefined;
|
|
143
142
|
honorificPrefix?: string | undefined;
|
|
144
143
|
honorificSuffix?: string | undefined;
|
|
145
|
-
email?:
|
|
144
|
+
email?: string | undefined;
|
|
146
145
|
phoneNumber?: string | undefined;
|
|
147
146
|
status: "active" | "suspended" | "unverified";
|
|
148
147
|
model: "User";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/customer/users/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/customer/users/schema.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAChC,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAEjE,eAAO,MAAM,UAAU;;;;CAIb,CAAC;AACX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAQzE,eAAO,MAAM,wBAAwB;;;;;;MAMnC,CAAC;AAGH,eAAO,MAAM,8BAA8B;;;;;;MAMzC,CAAC;AAGH,eAAO,MAAM,YAAY,gEAAc,CAAC;AACxC,MAAM,MAAM,MAAM,GAAG,OAAO,YAAY,CAAC,QAAQ,CAAC;AAElD,eAAO,MAAM,oBAAoB;;MAE/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,oBAAoB,CAAC,QAAQ,CAAC;AAElE,eAAO,MAAM,mBAAmB,gEAAuB,CAAC;AACxD,eAAO,MAAM,yBAAyB,gEAAiB,CAAC;AAExD,eAAO,MAAM,oCAAoC;;;;;MAK/C,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;MAGvC,CAAC;AAIH,eAAO,MAAM,sBAAsB;;MAEjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,sBAAsB,CAAC,QAAQ,CAAC;AAStE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;MAMU,CAAC;AAClC,MAAM,MAAM,cAAc,GAAG,OAAO,UAAU,CAAC,OAAO,CAAC;AACvD,MAAM,MAAM,IAAI,GAAG,OAAO,UAAU,CAAC,QAAQ,CAAC;AAE9C,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;MAMO,CAAC;AACtC,MAAM,MAAM,WAAW,GAAG,OAAO,iBAAiB,CAAC,QAAQ,CAAC;AAE5D,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;MAOO,CAAC;AAC5C,MAAM,MAAM,eAAe,GAAG,OAAO,uBAAuB,CAAC,OAAO,CAAC;AACrE,MAAM,MAAM,iBAAiB,GAAG,OAAO,uBAAuB,CAAC,QAAQ,CAAC;AAExE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;MAIO,CAAC;AAC5C,MAAM,MAAM,eAAe,GAAG,OAAO,uBAAuB,CAAC,OAAO,CAAC;AACrE,MAAM,MAAM,iBAAiB,GAAG,OAAO,uBAAuB,CAAC,QAAQ,CAAC;AAExE,eAAO,MAAM,8BAA8B;;;;;;;;;;;MAS1C,CAAC;AACF,MAAM,MAAM,wBAAwB,GAClC,OAAO,8BAA8B,CAAC,QAAQ,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UserAssociationReferenceSchema = exports.UpdateUserPayloadSchema = exports.InsertUserPayloadSchema = exports.UserPayloadSchema = exports.UserSchema = exports.UserAssociationsSchema = exports.EmailOrPhonePropertiesSchema = exports.VerifiedEmailOrPhonePropertiesSchema = exports.RequiredPhoneNumberSchema = exports.RequiredEmailSchema = exports.UserIdPropertySchema = exports.UserIdSchema = exports.
|
|
3
|
+
exports.UserAssociationReferenceSchema = exports.UpdateUserPayloadSchema = exports.InsertUserPayloadSchema = exports.UserPayloadSchema = exports.UserSchema = exports.UserAssociationsSchema = exports.EmailOrPhonePropertiesSchema = exports.VerifiedEmailOrPhonePropertiesSchema = exports.RequiredPhoneNumberSchema = exports.RequiredEmailSchema = exports.UserIdPropertySchema = exports.UserIdSchema = exports.UpdateUserNamePropertiesSchema = exports.UserNamePropertiesSchema = exports.UserStatus = exports.VerifiableAttribute = void 0;
|
|
4
4
|
const arktype_1 = require("arktype");
|
|
5
5
|
const aggregate_js_1 = require("../../common/schema/aggregate.js");
|
|
6
6
|
const dates_js_1 = require("../../common/schema/dates.js");
|
|
7
7
|
const metadata_js_1 = require("../../common/schema/metadata.js");
|
|
8
|
+
const schema_js_1 = require("../../common/schema/schema.js");
|
|
8
9
|
const utils_js_1 = require("../schema/utils.js");
|
|
9
10
|
exports.VerifiableAttribute = {
|
|
10
11
|
EMAIL: 'email',
|
|
@@ -17,36 +18,36 @@ exports.UserStatus = {
|
|
|
17
18
|
};
|
|
18
19
|
const UserStatusSchema = arktype_1.type.enumerated(exports.UserStatus.ACTIVE, exports.UserStatus.SUSPENDED, exports.UserStatus.UNVERIFIED);
|
|
19
20
|
exports.UserNamePropertiesSchema = (0, arktype_1.type)({
|
|
20
|
-
givenName: (0, arktype_1.type)('string
|
|
21
|
-
middleName: (0, arktype_1.type)('string
|
|
22
|
-
familyName: (0, arktype_1.type)('string
|
|
23
|
-
honorificPrefix: (0, arktype_1.type)('string
|
|
24
|
-
honorificSuffix: (0, arktype_1.type)('string
|
|
21
|
+
givenName: (0, schema_js_1.optionallyNullishToUndefined)((0, arktype_1.type)('string')),
|
|
22
|
+
middleName: (0, schema_js_1.optionallyNullishToUndefined)((0, arktype_1.type)('string')),
|
|
23
|
+
familyName: (0, schema_js_1.optionallyNullishToUndefined)((0, arktype_1.type)('string')),
|
|
24
|
+
honorificPrefix: (0, schema_js_1.optionallyNullishToUndefined)((0, arktype_1.type)('string')),
|
|
25
|
+
honorificSuffix: (0, schema_js_1.optionallyNullishToUndefined)((0, arktype_1.type)('string')),
|
|
25
26
|
});
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
// export type UserNameProperties = typeof UserNamePropertiesSchema.inferOut;
|
|
28
|
+
exports.UpdateUserNamePropertiesSchema = (0, arktype_1.type)({
|
|
29
|
+
givenName: (0, schema_js_1.optionallyNullish)((0, arktype_1.type)('string')),
|
|
30
|
+
middleName: (0, schema_js_1.optionallyNullish)((0, arktype_1.type)('string')),
|
|
31
|
+
familyName: (0, schema_js_1.optionallyNullish)((0, arktype_1.type)('string')),
|
|
32
|
+
honorificPrefix: (0, schema_js_1.optionallyNullish)((0, arktype_1.type)('string')),
|
|
33
|
+
honorificSuffix: (0, schema_js_1.optionallyNullish)((0, arktype_1.type)('string')),
|
|
32
34
|
});
|
|
35
|
+
// type UpsertUserNameProperties = typeof UpdateUserNamePropertiesSchema.inferOut;
|
|
33
36
|
exports.UserIdSchema = arktype_1.type.string;
|
|
34
37
|
exports.UserIdPropertySchema = (0, arktype_1.type)({
|
|
35
38
|
id: exports.UserIdSchema,
|
|
36
39
|
});
|
|
37
40
|
exports.RequiredEmailSchema = (0, arktype_1.type)('string.email');
|
|
38
41
|
exports.RequiredPhoneNumberSchema = (0, arktype_1.type)('string');
|
|
39
|
-
const EmailSchema = exports.RequiredEmailSchema.or('undefined').pipe((v) => v != null ? v : undefined);
|
|
40
|
-
const PhoneNumberSchema = exports.RequiredPhoneNumberSchema.or('undefined');
|
|
41
42
|
exports.VerifiedEmailOrPhonePropertiesSchema = (0, arktype_1.type)({
|
|
42
|
-
email:
|
|
43
|
-
verifiedEmail: (0, arktype_1.type)('boolean')
|
|
44
|
-
phoneNumber:
|
|
45
|
-
verifiedPhoneNumber: (0, arktype_1.type)('boolean')
|
|
43
|
+
email: (0, schema_js_1.optionallyNullishToUndefined)(exports.RequiredEmailSchema),
|
|
44
|
+
verifiedEmail: (0, schema_js_1.optionallyNullishToUndefined)((0, arktype_1.type)('boolean')),
|
|
45
|
+
phoneNumber: (0, schema_js_1.optionallyNullishToUndefined)(exports.RequiredPhoneNumberSchema),
|
|
46
|
+
verifiedPhoneNumber: (0, schema_js_1.optionallyNullishToUndefined)((0, arktype_1.type)('boolean')),
|
|
46
47
|
});
|
|
47
48
|
exports.EmailOrPhonePropertiesSchema = (0, arktype_1.type)({
|
|
48
|
-
email:
|
|
49
|
-
phoneNumber:
|
|
49
|
+
email: (0, schema_js_1.optionallyNullishToUndefined)(exports.RequiredEmailSchema),
|
|
50
|
+
phoneNumber: (0, schema_js_1.optionallyNullishToUndefined)(exports.RequiredPhoneNumberSchema),
|
|
50
51
|
});
|
|
51
52
|
const UserRoleAssociationSchema = (0, arktype_1.type)('string[] | undefined');
|
|
52
53
|
exports.UserAssociationsSchema = (0, arktype_1.type)({
|
|
@@ -56,14 +57,14 @@ const BaseSchema = exports.UserIdPropertySchema.and(exports.UserNamePropertiesSc
|
|
|
56
57
|
.and(exports.VerifiedEmailOrPhonePropertiesSchema)
|
|
57
58
|
.and({
|
|
58
59
|
status: UserStatusSchema,
|
|
59
|
-
roles:
|
|
60
|
+
roles: (0, schema_js_1.optionallyUndefined)(aggregate_js_1.AggregateSchema),
|
|
60
61
|
});
|
|
61
62
|
exports.UserSchema = BaseSchema.and({
|
|
62
63
|
lastLogin: dates_js_1.OptionalDateSchema.optional(),
|
|
63
64
|
createdAt: dates_js_1.RequiredDateSchema,
|
|
64
65
|
updatedAt: dates_js_1.RequiredDateSchema,
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
deletedAt: dates_js_1.OptionalDateSchema.optional(),
|
|
67
|
+
deactivatedAt: dates_js_1.OptionalDateSchema.optional(),
|
|
67
68
|
}).and(metadata_js_1.MetadataMapPropertySchema);
|
|
68
69
|
exports.UserPayloadSchema = BaseSchema.and({
|
|
69
70
|
lastLogin: dates_js_1.OptionalDatePayloadSchema.optional(),
|
|
@@ -83,7 +84,7 @@ exports.InsertUserPayloadSchema = (0, arktype_1.type)({
|
|
|
83
84
|
exports.UpdateUserPayloadSchema = (0, arktype_1.type)({
|
|
84
85
|
suspended: arktype_1.type.boolean.optional(),
|
|
85
86
|
})
|
|
86
|
-
.and(exports.
|
|
87
|
+
.and(exports.UpdateUserNamePropertiesSchema)
|
|
87
88
|
.and(metadata_js_1.UpsertMetadataPayloadPropertySchema);
|
|
88
89
|
exports.UserAssociationReferenceSchema = exports.UserIdPropertySchema.and(exports.UserNamePropertiesSchema).and(exports.EmailOrPhonePropertiesSchema.and((0, arktype_1.type)({
|
|
89
90
|
status: UserStatusSchema,
|
|
@@ -53,5 +53,54 @@ const schema_js_1 = require("./schema.js");
|
|
|
53
53
|
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
54
54
|
(0, vitest_1.expect)(result?.metadata).to.null;
|
|
55
55
|
});
|
|
56
|
+
(0, vitest_1.test)('should serialize nulls successfully', async () => {
|
|
57
|
+
const payload = {
|
|
58
|
+
id: '123',
|
|
59
|
+
status: 'unverified',
|
|
60
|
+
givenName: null,
|
|
61
|
+
middleName: null,
|
|
62
|
+
familyName: null,
|
|
63
|
+
honorificPrefix: null,
|
|
64
|
+
honorificSuffix: null,
|
|
65
|
+
email: null,
|
|
66
|
+
verifiedEmail: null,
|
|
67
|
+
phoneNumber: null,
|
|
68
|
+
verifiedPhoneNumber: null,
|
|
69
|
+
createdAt: '2025-04-02T03:50:40.812Z',
|
|
70
|
+
updatedAt: '2025-04-02T03:50:40.812Z',
|
|
71
|
+
};
|
|
72
|
+
const result = (0, schema_js_1.UserPayloadSchema)(payload);
|
|
73
|
+
if (result instanceof arktype_1.type.errors) {
|
|
74
|
+
console.log(result.summary);
|
|
75
|
+
}
|
|
76
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
77
|
+
});
|
|
78
|
+
(0, vitest_1.test)('should serialize nulls successfully', async () => {
|
|
79
|
+
const payload = {
|
|
80
|
+
id: '123',
|
|
81
|
+
status: 'unverified',
|
|
82
|
+
givenName: null,
|
|
83
|
+
middleName: null,
|
|
84
|
+
familyName: null,
|
|
85
|
+
honorificPrefix: null,
|
|
86
|
+
honorificSuffix: null,
|
|
87
|
+
email: null,
|
|
88
|
+
verifiedEmail: null,
|
|
89
|
+
phoneNumber: null,
|
|
90
|
+
verifiedPhoneNumber: null,
|
|
91
|
+
createdAt: '2025-04-02T03:50:40.812Z',
|
|
92
|
+
updatedAt: '2025-04-02T03:50:40.812Z',
|
|
93
|
+
};
|
|
94
|
+
const test = (0, arktype_1.type)({
|
|
95
|
+
foo: 'string.numeric.parse',
|
|
96
|
+
bar: 'number',
|
|
97
|
+
baz: 'string.date.iso.parse',
|
|
98
|
+
});
|
|
99
|
+
const result = (0, schema_js_1.UserPayloadSchema)(payload);
|
|
100
|
+
if (result instanceof arktype_1.type.errors) {
|
|
101
|
+
console.log(result.summary);
|
|
102
|
+
}
|
|
103
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
104
|
+
});
|
|
56
105
|
});
|
|
57
106
|
});
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
export declare const ActivityType: {
|
|
2
|
+
readonly UNKNOWN: "unknown";
|
|
3
|
+
readonly NOTE: "note";
|
|
4
|
+
readonly OPERATION: "operation";
|
|
5
|
+
readonly AUTHORIZATION: "authorization";
|
|
6
|
+
readonly AUTHENTICATION: "authentication";
|
|
7
|
+
};
|
|
8
|
+
export type AnyActivityType = (typeof ActivityType)[keyof typeof ActivityType];
|
|
9
|
+
export declare const PerformerType: {
|
|
10
|
+
readonly SYSTEM: "system";
|
|
11
|
+
readonly GUEST: "guest";
|
|
12
|
+
readonly IDENTITY: "identity";
|
|
13
|
+
readonly AUTOMATION: "automation";
|
|
14
|
+
readonly INTEGRATION: "integration";
|
|
15
|
+
};
|
|
16
|
+
export type AnyPerformerType = (typeof PerformerType)[keyof typeof PerformerType];
|
|
1
17
|
export declare const ActivityIdSchema: import("arktype/internal/methods/string.ts").StringType<string, {}>;
|
|
2
18
|
export type ActivityId = typeof ActivityIdSchema.inferOut;
|
|
3
19
|
export declare const ActivityIdPropertySchema: import("arktype/internal/methods/object.ts").ObjectType<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/activity/schema/base.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/activity/schema/base.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,YAAY;;;;;;CAMf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE/E,eAAO,MAAM,aAAa;;;;;;CAMhB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAErD,eAAO,MAAM,gBAAgB,qEAAc,CAAC;AAC5C,MAAM,MAAM,UAAU,GAAG,OAAO,gBAAgB,CAAC,QAAQ,CAAC;AAE1D,eAAO,MAAM,wBAAwB;;MAEnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,wBAAwB,CAAC,QAAQ,CAAC;AAE1E,eAAO,MAAM,YAAY,qEAAiB,CAAC;AAE3C,eAAO,MAAM,iBAAiB;;;MAS5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,iBAAiB,CAAC,QAAQ,CAAC;AAE5D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;MASO,CAAC;AAEtC,eAAO,MAAM,uBAAuB;;;;;;;;;;;MAGO,CAAC;AAE5C,eAAO,MAAM,uBAAuB;;;;;;;;;;MAEO,CAAC"}
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import { type } from 'arktype';
|
|
2
2
|
import { OptionalDatePayloadSchema, RequiredDatePayloadSchema, } from '../../common/index.js';
|
|
3
3
|
import { MetadataPayloadPropertySchema, UpsertMetadataPayloadPropertySchema, } from '../../common/schema/metadata.js';
|
|
4
|
-
import { PerformerType } from './schema.js';
|
|
5
4
|
import { generateActivityId } from './utils.js';
|
|
5
|
+
export const ActivityType = {
|
|
6
|
+
UNKNOWN: 'unknown',
|
|
7
|
+
NOTE: 'note',
|
|
8
|
+
OPERATION: 'operation',
|
|
9
|
+
AUTHORIZATION: 'authorization',
|
|
10
|
+
AUTHENTICATION: 'authentication',
|
|
11
|
+
};
|
|
12
|
+
export const PerformerType = {
|
|
13
|
+
SYSTEM: 'system',
|
|
14
|
+
GUEST: 'guest',
|
|
15
|
+
IDENTITY: 'identity',
|
|
16
|
+
AUTOMATION: 'automation',
|
|
17
|
+
INTEGRATION: 'integration',
|
|
18
|
+
};
|
|
6
19
|
export const ActivityIdSchema = type.string;
|
|
7
20
|
export const ActivityIdPropertySchema = type({
|
|
8
21
|
id: ActivityIdSchema,
|
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
readonly UNKNOWN: "unknown";
|
|
3
|
-
readonly NOTE: "note";
|
|
4
|
-
readonly OPERATION: "operation";
|
|
5
|
-
readonly AUTHORIZATION: "authorization";
|
|
6
|
-
readonly AUTHENTICATION: "authentication";
|
|
7
|
-
};
|
|
8
|
-
export type AnyActivityType = (typeof ActivityType)[keyof typeof ActivityType];
|
|
9
|
-
export declare const PerformerType: {
|
|
10
|
-
readonly SYSTEM: "system";
|
|
11
|
-
readonly GUEST: "guest";
|
|
12
|
-
readonly IDENTITY: "identity";
|
|
13
|
-
readonly AUTOMATION: "automation";
|
|
14
|
-
readonly INTEGRATION: "integration";
|
|
15
|
-
};
|
|
16
|
-
export type AnyPerformerType = (typeof PerformerType)[keyof typeof PerformerType];
|
|
1
|
+
export { ActivityType, type AnyActivityType, PerformerType, type AnyPerformerType, } from './base.js';
|
|
17
2
|
export declare const ActivityPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
|
|
18
3
|
id: string;
|
|
19
4
|
performedBy: {
|