@go-mondo/identity-sdk 0.0.2-beta.3 → 0.0.2-beta.4

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.
Files changed (33) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/.tsbuildinfo/cjs.json +1 -1
  3. package/.tsbuildinfo/esm.json +1 -1
  4. package/CHANGELOG.md +7 -0
  5. package/dist/cjs/association/schema/association.d.ts +3 -3
  6. package/dist/cjs/authorization/permissions/schema.d.ts +4 -4
  7. package/dist/cjs/authorization/permissions/schema.d.ts.map +1 -1
  8. package/dist/cjs/authorization/permissions/schema.js +4 -2
  9. package/dist/cjs/common/schema/schema.d.ts +4 -0
  10. package/dist/cjs/common/schema/schema.d.ts.map +1 -1
  11. package/dist/cjs/common/schema/schema.js +10 -0
  12. package/dist/cjs/common/schema/sets.d.ts +1 -1
  13. package/dist/cjs/common/schema/sets.d.ts.map +1 -1
  14. package/dist/cjs/common/schema/sets.js +2 -2
  15. package/dist/cjs/customer/users/schema.d.ts +7 -8
  16. package/dist/cjs/customer/users/schema.d.ts.map +1 -1
  17. package/dist/cjs/customer/users/schema.js +25 -24
  18. package/dist/cjs/customer/users/schema.test.js +49 -0
  19. package/dist/esm/association/schema/association.d.ts +3 -3
  20. package/dist/esm/authorization/permissions/schema.d.ts +4 -4
  21. package/dist/esm/authorization/permissions/schema.d.ts.map +1 -1
  22. package/dist/esm/authorization/permissions/schema.js +4 -2
  23. package/dist/esm/common/schema/schema.d.ts +4 -0
  24. package/dist/esm/common/schema/schema.d.ts.map +1 -1
  25. package/dist/esm/common/schema/schema.js +6 -0
  26. package/dist/esm/common/schema/sets.d.ts +1 -1
  27. package/dist/esm/common/schema/sets.d.ts.map +1 -1
  28. package/dist/esm/common/schema/sets.js +1 -1
  29. package/dist/esm/customer/users/schema.d.ts +7 -8
  30. package/dist/esm/customer/users/schema.d.ts.map +1 -1
  31. package/dist/esm/customer/users/schema.js +24 -23
  32. package/dist/esm/customer/users/schema.test.js +49 -0
  33. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [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)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * authorization permissions ([642a568](https://github.com/go-mondo/identity-node-sdk/commit/642a568e4dc14184655c11645850f0f485345d0a))
9
+
3
10
  ## [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
11
 
5
12
 
@@ -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?: ((In: string | undefined) => import("arktype/out/attributes.js").Out<string | undefined>) | undefined;
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?: ((In: string | undefined) => import("arktype/out/attributes.js").Out<string | undefined>) | undefined;
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?: ((In: string | undefined) => import("arktype/out/attributes.js").Out<string | undefined>) | undefined;
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;AAU/C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;MAKI,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;;;;;;;;;;;;;;;;;;;;;;MAKC,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,uBAAu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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 UniqueStringSetPayload: import("arktype/out/methods/object").ObjectType<(In: Set<string> | string[]) => import("arktype/out/attributes").Out<string[]>, {}>;
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,sBAAsB,qIAElC,CAAC"}
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.UniqueStringSetPayload = exports.UniqueStringSetPayloadSchema = void 0;
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.UniqueStringSetPayload = exports.UniqueStringSetPayloadSchema.pipe((s) => Array.from(s.values()));
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 type UserNameProperties = typeof UserNamePropertiesSchema.inferOut;
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?: ((In: string | undefined) => import("arktype/out/attributes.js").Out<string | undefined>) | undefined;
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?: ((In: string | undefined) => import("arktype/out/attributes.js").Out<string | undefined>) | undefined;
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?: ((In: string | undefined) => import("arktype/out/attributes.js").Out<string | undefined>) | undefined;
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?: ((In: string | undefined) => import("arktype/out/attributes.js").Out<string | undefined>) | undefined;
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?: ((In: string | undefined) => import("arktype/out/attributes.js").Out<string | undefined>) | undefined;
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?: ((In: string | undefined) => import("arktype/out/attributes.js").Out<string | undefined>) | undefined;
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":"AAeA,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;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,wBAAwB,CAAC,QAAQ,CAAC;AAE1E,eAAO,MAAM,8BAA8B;;;;;;MAMzC,CAAC;AAEH,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;AAOxD,eAAO,MAAM,oCAAoC;;;;;MAK/C,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;MAGvC,CAAC;AAIH,eAAO,MAAM,sBAAsB;;MAEjC,CAAC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,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.UpsertUserNamePropertiesSchema = exports.UserNamePropertiesSchema = exports.UserStatus = exports.VerifiableAttribute = void 0;
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 | undefined').or('undefined').optional(),
21
- middleName: (0, arktype_1.type)('string | undefined').optional(),
22
- familyName: (0, arktype_1.type)('string | undefined').optional(),
23
- honorificPrefix: (0, arktype_1.type)('string | undefined').optional(),
24
- honorificSuffix: (0, arktype_1.type)('string | undefined').optional(),
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
- exports.UpsertUserNamePropertiesSchema = (0, arktype_1.type)({
27
- givenName: (0, arktype_1.type)('string | undefined | null').optional(),
28
- middleName: (0, arktype_1.type)('string | undefined | null').optional(),
29
- familyName: (0, arktype_1.type)('string | undefined | null').optional(),
30
- honorificPrefix: (0, arktype_1.type)('string | undefined | null').optional(),
31
- honorificSuffix: (0, arktype_1.type)('string | undefined | null').optional(),
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: EmailSchema.optional(),
43
- verifiedEmail: (0, arktype_1.type)('boolean').or('undefined').optional(),
44
- phoneNumber: PhoneNumberSchema.optional(),
45
- verifiedPhoneNumber: (0, arktype_1.type)('boolean').or('undefined').optional(),
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: EmailSchema.optional(),
49
- phoneNumber: PhoneNumberSchema.optional(),
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: aggregate_js_1.AggregateSchema.or(arktype_1.type.undefined).optional(),
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
- 'deletedAt?': dates_js_1.OptionalDateSchema,
66
- 'deactivatedAt?': dates_js_1.OptionalDateSchema,
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.UpsertUserNamePropertiesSchema)
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
  });
@@ -15,7 +15,7 @@ export declare const AssociationObjectSchema: import("arktype/internal/methods/o
15
15
  familyName?: string | undefined;
16
16
  honorificPrefix?: string | undefined;
17
17
  honorificSuffix?: string | undefined;
18
- email?: ((In: string | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
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/internal/methods/obje
33
33
  familyName?: string | undefined;
34
34
  honorificPrefix?: string | undefined;
35
35
  honorificSuffix?: string | undefined;
36
- email?: ((In: string | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
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/internal/methods/
54
54
  familyName?: string | undefined;
55
55
  honorificPrefix?: string | undefined;
56
56
  honorificSuffix?: string | undefined;
57
- email?: ((In: string | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
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/internal/methods/object.t
18
18
  name: string;
19
19
  status: "enabled" | "disabled";
20
20
  description?: string | undefined;
21
+ createdAt: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
22
+ updatedAt: Date | ((In: string) => import("arktype/internal/attributes.ts").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/internal/methods/object.t
26
28
  ids?: string[] | undefined;
27
29
  count?: number | undefined;
28
30
  } | undefined;
29
- createdAt: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
30
- updatedAt: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
31
31
  deletedAt?: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined;
32
32
  deactivatedAt?: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined;
33
33
  metadata: (In: import("arktype/internal/attributes.ts").Default<unknown, Map<string, string | number | boolean>>) => import("arktype/internal/attributes.ts").Out<Map<string, string | number | boolean> | Map<string, any>>;
@@ -39,6 +39,8 @@ export declare const PermissionPayloadSchema: import("arktype/internal/methods/o
39
39
  name: string;
40
40
  status: "enabled" | "disabled";
41
41
  description?: string | undefined;
42
+ createdAt: (In: string | Date) => import("arktype/internal/attributes.ts").Out<string>;
43
+ updatedAt: (In: string | Date) => import("arktype/internal/attributes.ts").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/internal/methods/o
47
49
  ids?: string[] | undefined;
48
50
  count?: number | undefined;
49
51
  } | undefined;
50
- createdAt: (In: string | Date) => import("arktype/internal/attributes.ts").Out<string>;
51
- updatedAt: (In: string | Date) => import("arktype/internal/attributes.ts").Out<string>;
52
52
  deletedAt?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
53
53
  deactivatedAt?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").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,qEAAc,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;AAU/C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;MAKI,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;;;;;;;;;;;;;;;;;;;;;;MAKC,CAAC;AACtC,MAAM,MAAM,iBAAiB,GAAG,OAAO,uBAAuB,CAAC,QAAQ,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;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iB,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"}
@@ -21,16 +21,18 @@ const BaseSchema = PermissionIdPropertySchema.and({
21
21
  name: type('string'),
22
22
  status: PermissionStatusSchema,
23
23
  description: type('string').optional(),
24
- apps: AggregateSchema.optional(),
25
- roles: AggregateSchema.optional(),
26
24
  });
27
25
  export const PermissionSchema = BaseSchema.and({
26
+ apps: AggregateSchema.optional(),
27
+ roles: AggregateSchema.optional(),
28
28
  createdAt: RequiredDateSchema,
29
29
  updatedAt: RequiredDateSchema,
30
30
  'deletedAt?': OptionalDateSchema,
31
31
  'deactivatedAt?': OptionalDateSchema,
32
32
  }).and(MetadataMapPropertySchema);
33
33
  export const PermissionPayloadSchema = BaseSchema.and({
34
+ apps: AggregateSchema.optional(),
35
+ roles: AggregateSchema.optional(),
34
36
  createdAt: RequiredDatePayloadSchema,
35
37
  updatedAt: RequiredDatePayloadSchema,
36
38
  'deletedAt?': 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"}
@@ -5,3 +5,9 @@ export * from './jwt.js';
5
5
  export * from './metadata.js';
6
6
  export * from './pagination.js';
7
7
  export * from './sets.js';
8
+ export const optionallyNullishToUndefined = (t) => t
9
+ .or('null | undefined')
10
+ .pipe((v) => (v == null ? v : undefined))
11
+ .optional();
12
+ export const optionallyNullish = (t) => t.or('null | undefined').optional();
13
+ export const optionallyUndefined = (t) => t.or('undefined').optional();
@@ -1,3 +1,3 @@
1
1
  export declare const UniqueStringSetPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<Set<string> | ((In: string[]) => import("arktype/internal/attributes.ts").Out<Set<string>>), {}>;
2
- export declare const UniqueStringSetPayload: import("arktype/internal/methods/object.ts").ObjectType<(In: Set<string> | string[]) => import("arktype/internal/attributes.ts").Out<string[]>, {}>;
2
+ export declare const UniqueStringPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<(In: Set<string> | string[]) => import("arktype/internal/attributes.ts").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,0JAAiC,CAAC;AAC3E,eAAO,MAAM,sBAAsB,qJAElC,CAAC"}
1
+ {"version":3,"file":"sets.d.ts","sourceRoot":"","sources":["../../../../src/common/schema/sets.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,4BAA4B,0JAAiC,CAAC;AAC3E,eAAO,MAAM,yBAAyB,qJAErC,CAAC"}
@@ -3,4 +3,4 @@ const StringArraySchema = type('string[]');
3
3
  const StringArrayToSet = StringArraySchema.pipe((s) => new Set(s));
4
4
  const StringSet = type.instanceOf((Set));
5
5
  export const UniqueStringSetPayloadSchema = StringSet.or(StringArrayToSet);
6
- export const UniqueStringSetPayload = UniqueStringSetPayloadSchema.pipe((s) => Array.from(s.values()));
6
+ export const UniqueStringPayloadSchema = UniqueStringSetPayloadSchema.pipe((s) => Array.from(s.values()));
@@ -16,8 +16,7 @@ export declare const UserNamePropertiesSchema: import("arktype/internal/methods/
16
16
  honorificPrefix?: string | undefined;
17
17
  honorificSuffix?: string | undefined;
18
18
  }, {}>;
19
- export type UserNameProperties = typeof UserNamePropertiesSchema.inferOut;
20
- export declare const UpsertUserNamePropertiesSchema: import("arktype/internal/methods/object.ts").ObjectType<{
19
+ export declare const UpdateUserNamePropertiesSchema: import("arktype/internal/methods/object.ts").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/internal/methods/string.ts").StringType<string, {}>;
34
33
  export declare const RequiredPhoneNumberSchema: import("arktype/internal/methods/string.ts").StringType<string, {}>;
35
34
  export declare const VerifiedEmailOrPhonePropertiesSchema: import("arktype/internal/methods/object.ts").ObjectType<{
36
- email?: ((In: string | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
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/internal/methods/object.ts").ObjectType<{
42
- email?: ((In: string | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
41
+ email?: string | undefined;
43
42
  phoneNumber?: string | undefined;
44
43
  }, {}>;
45
44
  export declare const UserAssociationsSchema: import("arktype/internal/methods/object.ts").ObjectType<{
@@ -53,7 +52,7 @@ export declare const UserSchema: import("arktype/internal/methods/object.ts").Ob
53
52
  familyName?: string | undefined;
54
53
  honorificPrefix?: string | undefined;
55
54
  honorificSuffix?: string | undefined;
56
- email?: ((In: string | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
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/internal/methods/object.
78
77
  familyName?: string | undefined;
79
78
  honorificPrefix?: string | undefined;
80
79
  honorificSuffix?: string | undefined;
81
- email?: ((In: string | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
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/internal/methods/o
107
106
  familyName?: string | undefined;
108
107
  honorificPrefix?: string | undefined;
109
108
  honorificSuffix?: string | undefined;
110
- email?: ((In: string | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
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/internal/me
142
141
  familyName?: string | undefined;
143
142
  honorificPrefix?: string | undefined;
144
143
  honorificSuffix?: string | undefined;
145
- email?: ((In: string | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
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":"AAeA,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAEX,MAAM,MAAM,sB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