@go-mondo/identity-sdk 0.0.2-beta.12 → 0.0.2-beta.13
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 +7 -0
- package/dist/cjs/action/schema/base.d.ts +22 -20
- package/dist/cjs/action/schema/base.d.ts.map +1 -1
- package/dist/cjs/action/schema/base.js +15 -8
- package/dist/cjs/action/schema/base.test.js +50 -34
- package/dist/cjs/action/schema/operations/set-password.d.ts +30 -30
- package/dist/cjs/action/schema/operations/set-password.d.ts.map +1 -1
- package/dist/cjs/action/schema/operations/set-password.js +9 -8
- package/dist/cjs/action/schema/operations/set-password.test.js +30 -29
- package/dist/cjs/action/schema/operations/sign-up-verification.d.ts +21 -21
- package/dist/cjs/action/schema/operations/sign-up-verification.d.ts.map +1 -1
- package/dist/cjs/action/schema/operations/sign-up-verification.js +8 -7
- package/dist/cjs/action/schema/operations/sign-up-verification.test.js +28 -29
- package/dist/cjs/action/schema/operations/sign-up.d.ts +40 -43
- package/dist/cjs/action/schema/operations/sign-up.d.ts.map +1 -1
- package/dist/cjs/action/schema/operations/sign-up.js +24 -15
- package/dist/cjs/action/schema/operations/sign-up.test.js +33 -34
- package/dist/cjs/action/schema/operations/user-attribute-verification.d.ts +19 -19
- package/dist/cjs/action/schema/operations/user-attribute-verification.d.ts.map +1 -1
- package/dist/cjs/action/schema/operations/user-attribute-verification.js +6 -5
- package/dist/cjs/action/schema/operations/user-attribute-verification.test.js +25 -26
- package/dist/cjs/action/schema/schema.d.ts +70 -76
- package/dist/cjs/action/schema/schema.d.ts.map +1 -1
- package/dist/cjs/action/schema/schema.test.js +26 -27
- package/dist/cjs/activity/resources.d.ts.map +1 -1
- package/dist/cjs/activity/resources.js +1 -1
- package/dist/cjs/activity/schema/base.d.ts +88 -69
- package/dist/cjs/activity/schema/base.d.ts.map +1 -1
- package/dist/cjs/activity/schema/base.js +30 -18
- package/dist/cjs/activity/schema/base.test.js +85 -55
- package/dist/cjs/activity/schema/schema.d.ts +293 -226
- package/dist/cjs/activity/schema/schema.d.ts.map +1 -1
- package/dist/cjs/activity/schema/schema.test.js +47 -48
- package/dist/cjs/activity/schema/types/authentication.d.ts +64 -46
- package/dist/cjs/activity/schema/types/authentication.d.ts.map +1 -1
- package/dist/cjs/activity/schema/types/authentication.js +16 -7
- package/dist/cjs/activity/schema/types/authentication.test.js +37 -38
- package/dist/cjs/activity/schema/types/authorization.d.ts +64 -46
- package/dist/cjs/activity/schema/types/authorization.d.ts.map +1 -1
- package/dist/cjs/activity/schema/types/authorization.js +16 -7
- package/dist/cjs/activity/schema/types/authorization.test.js +41 -42
- package/dist/cjs/activity/schema/types/note.d.ts +83 -70
- package/dist/cjs/activity/schema/types/note.d.ts.map +1 -1
- package/dist/cjs/activity/schema/types/note.js +20 -12
- package/dist/cjs/activity/schema/types/note.test.js +48 -49
- package/dist/cjs/activity/schema/types/operation.d.ts +64 -45
- package/dist/cjs/activity/schema/types/operation.d.ts.map +1 -1
- package/dist/cjs/activity/schema/types/operation.js +19 -8
- package/dist/cjs/activity/schema/types/operation.test.js +34 -35
- package/dist/cjs/activity/schema/types/unknown.d.ts +50 -41
- package/dist/cjs/activity/schema/types/unknown.d.ts.map +1 -1
- package/dist/cjs/activity/schema/types/unknown.js +12 -6
- package/dist/cjs/activity/schema/types/unknown.test.js +29 -30
- package/dist/cjs/app/authorization/resources.d.ts.map +1 -1
- package/dist/cjs/app/authorization/resources.js +2 -3
- package/dist/cjs/app/authorization/schema.d.ts +96 -52
- package/dist/cjs/app/authorization/schema.d.ts.map +1 -1
- package/dist/cjs/app/authorization/schema.js +61 -52
- package/dist/cjs/app/authorization/schema.test.js +96 -71
- package/dist/cjs/app/oauth/resources.d.ts.map +1 -1
- package/dist/cjs/app/oauth/resources.js +2 -3
- package/dist/cjs/app/oauth/schema.d.ts +34 -41
- package/dist/cjs/app/oauth/schema.d.ts.map +1 -1
- package/dist/cjs/app/oauth/schema.js +23 -17
- package/dist/cjs/app/oauth/schema.test.js +38 -39
- package/dist/cjs/app/oidc/resources.d.ts.map +1 -1
- package/dist/cjs/app/oidc/resources.js +4 -5
- package/dist/cjs/app/oidc/schema.d.ts +26 -37
- package/dist/cjs/app/oidc/schema.d.ts.map +1 -1
- package/dist/cjs/app/oidc/schema.js +17 -12
- package/dist/cjs/app/oidc/schema.test.js +45 -26
- package/dist/cjs/app/registration/resources.d.ts.map +1 -1
- package/dist/cjs/app/registration/resources.js +2 -3
- package/dist/cjs/app/registration/schema.d.ts +24 -31
- package/dist/cjs/app/registration/schema.d.ts.map +1 -1
- package/dist/cjs/app/registration/schema.js +23 -16
- package/dist/cjs/app/registration/schema.test.js +68 -150
- package/dist/cjs/app/resources.d.ts.map +1 -1
- package/dist/cjs/app/resources.js +5 -5
- package/dist/cjs/app/saml/resources.d.ts.map +1 -1
- package/dist/cjs/app/saml/resources.js +4 -5
- package/dist/cjs/app/saml/schema.d.ts +26 -37
- package/dist/cjs/app/saml/schema.d.ts.map +1 -1
- package/dist/cjs/app/saml/schema.js +17 -12
- package/dist/cjs/app/schema.d.ts +72 -68
- package/dist/cjs/app/schema.d.ts.map +1 -1
- package/dist/cjs/app/schema.js +34 -27
- package/dist/cjs/app/schema.test.js +38 -41
- package/dist/cjs/association/resources.d.ts.map +1 -1
- package/dist/cjs/association/resources.js +3 -5
- package/dist/cjs/association/schema.d.ts +225 -181
- package/dist/cjs/association/schema.d.ts.map +1 -1
- package/dist/cjs/association/schema.js +28 -22
- package/dist/cjs/association/schema.test.js +36 -28
- package/dist/cjs/authentication/factors/schema.d.ts +18 -55
- package/dist/cjs/authentication/factors/schema.d.ts.map +1 -1
- package/dist/cjs/authentication/factors/schema.js +21 -23
- package/dist/cjs/authentication/factors/schema.test.js +33 -34
- package/dist/cjs/authentication/providers/schema.d.ts +23 -22
- package/dist/cjs/authentication/providers/schema.d.ts.map +1 -1
- package/dist/cjs/authentication/providers/schema.js +10 -8
- package/dist/cjs/authentication/sessions/resources.d.ts.map +1 -1
- package/dist/cjs/authentication/sessions/resources.js +2 -2
- package/dist/cjs/authentication/sessions/schema.d.ts +101 -74
- package/dist/cjs/authentication/sessions/schema.d.ts.map +1 -1
- package/dist/cjs/authentication/sessions/schema.js +56 -25
- package/dist/cjs/authentication/settings/resources.d.ts.map +1 -1
- package/dist/cjs/authentication/settings/resources.js +2 -3
- package/dist/cjs/authentication/settings/schema.d.ts +25 -68
- package/dist/cjs/authentication/settings/schema.d.ts.map +1 -1
- package/dist/cjs/authentication/settings/schema.js +13 -10
- package/dist/cjs/authentication/settings/schema.test.js +28 -19
- package/dist/cjs/authentication/strategies/resources.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/resources.js +5 -5
- package/dist/cjs/authentication/strategies/schema/base.d.ts +59 -51
- package/dist/cjs/authentication/strategies/schema/base.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/schema/base.js +26 -15
- package/dist/cjs/authentication/strategies/schema/schema.d.ts +206 -197
- package/dist/cjs/authentication/strategies/schema/schema.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/schema/types/email.d.ts +61 -60
- package/dist/cjs/authentication/strategies/schema/types/email.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/schema/types/email.js +24 -14
- package/dist/cjs/authentication/strategies/schema/types/email.test.js +49 -50
- package/dist/cjs/authentication/strategies/schema/types/password.d.ts +129 -122
- package/dist/cjs/authentication/strategies/schema/types/password.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/schema/types/password.js +33 -25
- package/dist/cjs/authentication/strategies/schema/types/totp.d.ts +107 -94
- package/dist/cjs/authentication/strategies/schema/types/totp.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/schema/types/totp.js +50 -26
- package/dist/cjs/authorization/permissions/resources.d.ts.map +1 -1
- package/dist/cjs/authorization/permissions/resources.js +5 -5
- package/dist/cjs/authorization/permissions/schema.d.ts +92 -88
- package/dist/cjs/authorization/permissions/schema.d.ts.map +1 -1
- package/dist/cjs/authorization/permissions/schema.js +38 -28
- package/dist/cjs/authorization/permissions/schema.test.js +57 -59
- package/dist/cjs/authorization/roles/resources.d.ts.map +1 -1
- package/dist/cjs/authorization/roles/resources.js +5 -5
- package/dist/cjs/authorization/roles/schema.d.ts +102 -98
- package/dist/cjs/authorization/roles/schema.d.ts.map +1 -1
- package/dist/cjs/authorization/roles/schema.js +35 -32
- package/dist/cjs/authorization/roles/schema.test.js +58 -59
- package/dist/cjs/authorization/schema.d.ts +7 -6
- package/dist/cjs/authorization/schema.d.ts.map +1 -1
- package/dist/cjs/authorization/schema.js +9 -3
- package/dist/cjs/common/resources/init.d.ts +7 -6
- package/dist/cjs/common/resources/init.d.ts.map +1 -1
- package/dist/cjs/common/resources/init.js +17 -9
- package/dist/cjs/common/resources/utils.d.ts +0 -9
- package/dist/cjs/common/resources/utils.d.ts.map +1 -1
- package/dist/cjs/common/resources/utils.js +0 -26
- package/dist/cjs/common/resources/utils.test.js +0 -29
- package/dist/cjs/common/schema/aggregate.d.ts +6 -5
- package/dist/cjs/common/schema/aggregate.d.ts.map +1 -1
- package/dist/cjs/common/schema/aggregate.js +4 -4
- package/dist/cjs/common/schema/aggregate.test.js +21 -22
- package/dist/cjs/common/schema/collection.d.ts +11 -10
- package/dist/cjs/common/schema/collection.d.ts.map +1 -1
- package/dist/cjs/common/schema/collection.js +6 -4
- package/dist/cjs/common/schema/collection.test.js +66 -48
- package/dist/cjs/common/schema/dates.d.ts +27 -26
- package/dist/cjs/common/schema/dates.d.ts.map +1 -1
- package/dist/cjs/common/schema/dates.js +17 -11
- package/dist/cjs/common/schema/dates.test.js +24 -13
- package/dist/cjs/common/schema/id.d.ts +2 -1
- package/dist/cjs/common/schema/id.d.ts.map +1 -1
- package/dist/cjs/common/schema/id.js +2 -2
- package/dist/cjs/common/schema/id.test.js +70 -38
- package/dist/cjs/common/schema/jwt.d.ts +27 -14
- package/dist/cjs/common/schema/jwt.d.ts.map +1 -1
- package/dist/cjs/common/schema/jwt.js +14 -2
- package/dist/cjs/common/schema/jwt.test.js +25 -19
- package/dist/cjs/common/schema/metadata.d.ts +24 -41
- package/dist/cjs/common/schema/metadata.d.ts.map +1 -1
- package/dist/cjs/common/schema/metadata.js +38 -37
- package/dist/cjs/common/schema/metadata.test.js +36 -37
- package/dist/cjs/common/schema/pagination.d.ts +6 -5
- package/dist/cjs/common/schema/pagination.d.ts.map +1 -1
- package/dist/cjs/common/schema/pagination.js +4 -4
- package/dist/cjs/common/schema/pagination.test.js +19 -20
- package/dist/cjs/common/schema/schema.d.ts +4 -4
- package/dist/cjs/common/schema/schema.d.ts.map +1 -1
- package/dist/cjs/common/schema/schema.js +6 -5
- package/dist/cjs/common/schema/schema.test.js +9 -15
- package/dist/cjs/common/schema/sets.d.ts +3 -2
- package/dist/cjs/common/schema/sets.d.ts.map +1 -1
- package/dist/cjs/common/schema/sets.js +9 -6
- package/dist/cjs/common/schema/sets.test.js +52 -43
- package/dist/cjs/customer/organization/schema.d.ts +44 -46
- package/dist/cjs/customer/organization/schema.d.ts.map +1 -1
- package/dist/cjs/customer/organization/schema.js +26 -20
- package/dist/cjs/customer/schema.d.ts +7 -6
- package/dist/cjs/customer/schema.d.ts.map +1 -1
- package/dist/cjs/customer/schema.js +9 -3
- package/dist/cjs/customer/users/resources.d.ts.map +1 -1
- package/dist/cjs/customer/users/resources.js +5 -5
- package/dist/cjs/customer/users/schema.d.ts +140 -139
- package/dist/cjs/customer/users/schema.d.ts.map +1 -1
- package/dist/cjs/customer/users/schema.js +58 -46
- package/dist/cjs/customer/users/schema.test.js +22 -35
- package/dist/cjs/customer/users/utils.d.ts +3 -2
- package/dist/cjs/customer/users/utils.d.ts.map +1 -1
- package/dist/cjs/identity/schema.d.ts +5 -1
- package/dist/cjs/identity/schema.d.ts.map +1 -1
- package/dist/cjs/identity/schema.js +5 -2
- package/dist/cjs/identity/schema.test.js +21 -16
- package/dist/cjs/oauth/authorize/schema/grants/authorization-code.d.ts +31 -28
- package/dist/cjs/oauth/authorize/schema/grants/authorization-code.d.ts.map +1 -1
- package/dist/cjs/oauth/authorize/schema/grants/authorization-code.js +56 -37
- package/dist/cjs/oauth/authorize/schema/grants/authorization-code.test.js +44 -45
- package/dist/cjs/oauth/authorize/schema/grants/implicit.d.ts +16 -10
- package/dist/cjs/oauth/authorize/schema/grants/implicit.d.ts.map +1 -1
- package/dist/cjs/oauth/authorize/schema/grants/implicit.js +19 -10
- package/dist/cjs/oauth/authorize/schema/schema.d.ts +44 -36
- package/dist/cjs/oauth/authorize/schema/schema.d.ts.map +1 -1
- package/dist/cjs/oauth/common/schema.d.ts +21 -7
- package/dist/cjs/oauth/common/schema.d.ts.map +1 -1
- package/dist/cjs/oauth/common/schema.js +20 -7
- package/dist/cjs/oauth/common/schema.test.js +25 -26
- package/dist/cjs/oauth/token/schema/grants/authorization-code.d.ts +12 -9
- package/dist/cjs/oauth/token/schema/grants/authorization-code.d.ts.map +1 -1
- package/dist/cjs/oauth/token/schema/grants/authorization-code.js +11 -10
- package/dist/cjs/oauth/token/schema/grants/client-credentials.d.ts +20 -15
- package/dist/cjs/oauth/token/schema/grants/client-credentials.d.ts.map +1 -1
- package/dist/cjs/oauth/token/schema/grants/client-credentials.js +13 -8
- package/dist/cjs/oauth/token/schema/grants/refresh-token.d.ts +11 -8
- package/dist/cjs/oauth/token/schema/grants/refresh-token.d.ts.map +1 -1
- package/dist/cjs/oauth/token/schema/grants/refresh-token.js +6 -6
- package/dist/cjs/oauth/token/schema/schema.d.ts +28 -21
- package/dist/cjs/oauth/token/schema/schema.d.ts.map +1 -1
- package/dist/cjs/oauth/token/schema/schema.test.js +42 -28
- package/dist/cjs/workspace/authorization/schema.d.ts +44 -27
- package/dist/cjs/workspace/authorization/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/authorization/schema.js +16 -11
- package/dist/cjs/workspace/branding/schema.d.ts +30 -37
- package/dist/cjs/workspace/branding/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/branding/schema.js +20 -15
- package/dist/cjs/workspace/membership/schema.d.ts +21 -20
- package/dist/cjs/workspace/membership/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/membership/schema.js +6 -6
- package/dist/cjs/workspace/registration/schema.d.ts +26 -27
- package/dist/cjs/workspace/registration/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/registration/schema.js +13 -11
- package/dist/cjs/workspace/settings/schema.d.ts +12 -19
- package/dist/cjs/workspace/settings/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/settings/schema.js +7 -6
- package/dist/cjs/workspace/settings/schema.test.js +18 -19
- package/dist/cjs/workspace/tenant/schema.d.ts +55 -57
- package/dist/cjs/workspace/tenant/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/tenant/schema.js +17 -12
- package/dist/cjs/workspace/user/notifications/schema.d.ts +50 -56
- package/dist/cjs/workspace/user/notifications/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/user/notifications/schema.js +26 -23
- package/dist/cjs/workspace/user/preferences/schema.d.ts +18 -25
- package/dist/cjs/workspace/user/preferences/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/user/preferences/schema.js +16 -11
- package/dist/esm/action/schema/base.d.ts +22 -20
- package/dist/esm/action/schema/base.d.ts.map +1 -1
- package/dist/esm/action/schema/base.js +15 -8
- package/dist/esm/action/schema/base.test.js +50 -34
- package/dist/esm/action/schema/operations/set-password.d.ts +30 -30
- package/dist/esm/action/schema/operations/set-password.d.ts.map +1 -1
- package/dist/esm/action/schema/operations/set-password.js +9 -8
- package/dist/esm/action/schema/operations/set-password.test.js +30 -29
- package/dist/esm/action/schema/operations/sign-up-verification.d.ts +21 -21
- package/dist/esm/action/schema/operations/sign-up-verification.d.ts.map +1 -1
- package/dist/esm/action/schema/operations/sign-up-verification.js +8 -7
- package/dist/esm/action/schema/operations/sign-up-verification.test.js +28 -29
- package/dist/esm/action/schema/operations/sign-up.d.ts +40 -43
- package/dist/esm/action/schema/operations/sign-up.d.ts.map +1 -1
- package/dist/esm/action/schema/operations/sign-up.js +19 -10
- package/dist/esm/action/schema/operations/sign-up.test.js +33 -34
- package/dist/esm/action/schema/operations/user-attribute-verification.d.ts +19 -19
- package/dist/esm/action/schema/operations/user-attribute-verification.d.ts.map +1 -1
- package/dist/esm/action/schema/operations/user-attribute-verification.js +6 -5
- package/dist/esm/action/schema/operations/user-attribute-verification.test.js +25 -26
- package/dist/esm/action/schema/schema.d.ts +70 -76
- package/dist/esm/action/schema/schema.d.ts.map +1 -1
- package/dist/esm/action/schema/schema.test.js +26 -27
- package/dist/esm/activity/resources.d.ts.map +1 -1
- package/dist/esm/activity/resources.js +2 -2
- package/dist/esm/activity/schema/base.d.ts +88 -69
- package/dist/esm/activity/schema/base.d.ts.map +1 -1
- package/dist/esm/activity/schema/base.js +30 -18
- package/dist/esm/activity/schema/base.test.js +85 -55
- package/dist/esm/activity/schema/schema.d.ts +293 -226
- package/dist/esm/activity/schema/schema.d.ts.map +1 -1
- package/dist/esm/activity/schema/schema.test.js +47 -48
- package/dist/esm/activity/schema/types/authentication.d.ts +64 -46
- package/dist/esm/activity/schema/types/authentication.d.ts.map +1 -1
- package/dist/esm/activity/schema/types/authentication.js +16 -7
- package/dist/esm/activity/schema/types/authentication.test.js +37 -38
- package/dist/esm/activity/schema/types/authorization.d.ts +64 -46
- package/dist/esm/activity/schema/types/authorization.d.ts.map +1 -1
- package/dist/esm/activity/schema/types/authorization.js +16 -7
- package/dist/esm/activity/schema/types/authorization.test.js +41 -42
- package/dist/esm/activity/schema/types/note.d.ts +83 -70
- package/dist/esm/activity/schema/types/note.d.ts.map +1 -1
- package/dist/esm/activity/schema/types/note.js +20 -12
- package/dist/esm/activity/schema/types/note.test.js +48 -49
- package/dist/esm/activity/schema/types/operation.d.ts +64 -45
- package/dist/esm/activity/schema/types/operation.d.ts.map +1 -1
- package/dist/esm/activity/schema/types/operation.js +19 -8
- package/dist/esm/activity/schema/types/operation.test.js +34 -35
- package/dist/esm/activity/schema/types/unknown.d.ts +50 -41
- package/dist/esm/activity/schema/types/unknown.d.ts.map +1 -1
- package/dist/esm/activity/schema/types/unknown.js +12 -6
- package/dist/esm/activity/schema/types/unknown.test.js +29 -30
- package/dist/esm/app/authorization/resources.d.ts.map +1 -1
- package/dist/esm/app/authorization/resources.js +2 -3
- package/dist/esm/app/authorization/schema.d.ts +96 -52
- package/dist/esm/app/authorization/schema.d.ts.map +1 -1
- package/dist/esm/app/authorization/schema.js +61 -52
- package/dist/esm/app/authorization/schema.test.js +96 -71
- package/dist/esm/app/oauth/resources.d.ts.map +1 -1
- package/dist/esm/app/oauth/resources.js +2 -3
- package/dist/esm/app/oauth/schema.d.ts +34 -41
- package/dist/esm/app/oauth/schema.d.ts.map +1 -1
- package/dist/esm/app/oauth/schema.js +23 -17
- package/dist/esm/app/oauth/schema.test.js +38 -39
- package/dist/esm/app/oidc/resources.d.ts.map +1 -1
- package/dist/esm/app/oidc/resources.js +4 -5
- package/dist/esm/app/oidc/schema.d.ts +26 -37
- package/dist/esm/app/oidc/schema.d.ts.map +1 -1
- package/dist/esm/app/oidc/schema.js +17 -12
- package/dist/esm/app/oidc/schema.test.js +45 -26
- package/dist/esm/app/registration/resources.d.ts.map +1 -1
- package/dist/esm/app/registration/resources.js +2 -3
- package/dist/esm/app/registration/schema.d.ts +24 -31
- package/dist/esm/app/registration/schema.d.ts.map +1 -1
- package/dist/esm/app/registration/schema.js +23 -16
- package/dist/esm/app/registration/schema.test.js +68 -150
- package/dist/esm/app/resources.d.ts.map +1 -1
- package/dist/esm/app/resources.js +6 -6
- package/dist/esm/app/saml/resources.d.ts.map +1 -1
- package/dist/esm/app/saml/resources.js +4 -5
- package/dist/esm/app/saml/schema.d.ts +26 -37
- package/dist/esm/app/saml/schema.d.ts.map +1 -1
- package/dist/esm/app/saml/schema.js +17 -12
- package/dist/esm/app/schema.d.ts +72 -68
- package/dist/esm/app/schema.d.ts.map +1 -1
- package/dist/esm/app/schema.js +34 -27
- package/dist/esm/app/schema.test.js +38 -41
- package/dist/esm/association/resources.d.ts.map +1 -1
- package/dist/esm/association/resources.js +4 -6
- package/dist/esm/association/schema.d.ts +225 -181
- package/dist/esm/association/schema.d.ts.map +1 -1
- package/dist/esm/association/schema.js +28 -22
- package/dist/esm/association/schema.test.js +36 -28
- package/dist/esm/authentication/factors/schema.d.ts +18 -55
- package/dist/esm/authentication/factors/schema.d.ts.map +1 -1
- package/dist/esm/authentication/factors/schema.js +21 -23
- package/dist/esm/authentication/factors/schema.test.js +33 -34
- package/dist/esm/authentication/providers/schema.d.ts +23 -22
- package/dist/esm/authentication/providers/schema.d.ts.map +1 -1
- package/dist/esm/authentication/providers/schema.js +10 -8
- package/dist/esm/authentication/sessions/resources.d.ts.map +1 -1
- package/dist/esm/authentication/sessions/resources.js +3 -3
- package/dist/esm/authentication/sessions/schema.d.ts +101 -74
- package/dist/esm/authentication/sessions/schema.d.ts.map +1 -1
- package/dist/esm/authentication/sessions/schema.js +56 -25
- package/dist/esm/authentication/settings/resources.d.ts.map +1 -1
- package/dist/esm/authentication/settings/resources.js +2 -3
- package/dist/esm/authentication/settings/schema.d.ts +25 -68
- package/dist/esm/authentication/settings/schema.d.ts.map +1 -1
- package/dist/esm/authentication/settings/schema.js +13 -10
- package/dist/esm/authentication/settings/schema.test.js +28 -19
- package/dist/esm/authentication/strategies/resources.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/resources.js +6 -6
- package/dist/esm/authentication/strategies/schema/base.d.ts +59 -51
- package/dist/esm/authentication/strategies/schema/base.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/schema/base.js +26 -15
- package/dist/esm/authentication/strategies/schema/schema.d.ts +206 -197
- package/dist/esm/authentication/strategies/schema/schema.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/schema/types/email.d.ts +61 -60
- package/dist/esm/authentication/strategies/schema/types/email.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/schema/types/email.js +24 -14
- package/dist/esm/authentication/strategies/schema/types/email.test.js +49 -50
- package/dist/esm/authentication/strategies/schema/types/password.d.ts +129 -122
- package/dist/esm/authentication/strategies/schema/types/password.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/schema/types/password.js +33 -25
- package/dist/esm/authentication/strategies/schema/types/totp.d.ts +107 -94
- package/dist/esm/authentication/strategies/schema/types/totp.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/schema/types/totp.js +50 -26
- package/dist/esm/authorization/permissions/resources.d.ts.map +1 -1
- package/dist/esm/authorization/permissions/resources.js +6 -6
- package/dist/esm/authorization/permissions/schema.d.ts +92 -88
- package/dist/esm/authorization/permissions/schema.d.ts.map +1 -1
- package/dist/esm/authorization/permissions/schema.js +38 -28
- package/dist/esm/authorization/permissions/schema.test.js +57 -59
- package/dist/esm/authorization/roles/resources.d.ts.map +1 -1
- package/dist/esm/authorization/roles/resources.js +6 -6
- package/dist/esm/authorization/roles/schema.d.ts +102 -98
- package/dist/esm/authorization/roles/schema.d.ts.map +1 -1
- package/dist/esm/authorization/roles/schema.js +35 -32
- package/dist/esm/authorization/roles/schema.test.js +58 -59
- package/dist/esm/authorization/schema.d.ts +7 -6
- package/dist/esm/authorization/schema.d.ts.map +1 -1
- package/dist/esm/authorization/schema.js +9 -3
- package/dist/esm/common/resources/init.d.ts +7 -6
- package/dist/esm/common/resources/init.d.ts.map +1 -1
- package/dist/esm/common/resources/init.js +17 -9
- package/dist/esm/common/resources/utils.d.ts +0 -9
- package/dist/esm/common/resources/utils.d.ts.map +1 -1
- package/dist/esm/common/resources/utils.js +0 -24
- package/dist/esm/common/resources/utils.test.js +1 -30
- package/dist/esm/common/schema/aggregate.d.ts +6 -5
- package/dist/esm/common/schema/aggregate.d.ts.map +1 -1
- package/dist/esm/common/schema/aggregate.js +4 -4
- package/dist/esm/common/schema/aggregate.test.js +21 -22
- package/dist/esm/common/schema/collection.d.ts +11 -10
- package/dist/esm/common/schema/collection.d.ts.map +1 -1
- package/dist/esm/common/schema/collection.js +4 -4
- package/dist/esm/common/schema/collection.test.js +66 -48
- package/dist/esm/common/schema/dates.d.ts +27 -26
- package/dist/esm/common/schema/dates.d.ts.map +1 -1
- package/dist/esm/common/schema/dates.js +17 -11
- package/dist/esm/common/schema/dates.test.js +24 -13
- package/dist/esm/common/schema/id.d.ts +2 -1
- package/dist/esm/common/schema/id.d.ts.map +1 -1
- package/dist/esm/common/schema/id.js +2 -2
- package/dist/esm/common/schema/id.test.js +70 -38
- package/dist/esm/common/schema/jwt.d.ts +27 -14
- package/dist/esm/common/schema/jwt.d.ts.map +1 -1
- package/dist/esm/common/schema/jwt.js +14 -2
- package/dist/esm/common/schema/jwt.test.js +25 -19
- package/dist/esm/common/schema/metadata.d.ts +24 -41
- package/dist/esm/common/schema/metadata.d.ts.map +1 -1
- package/dist/esm/common/schema/metadata.js +38 -37
- package/dist/esm/common/schema/metadata.test.js +36 -37
- package/dist/esm/common/schema/pagination.d.ts +6 -5
- package/dist/esm/common/schema/pagination.d.ts.map +1 -1
- package/dist/esm/common/schema/pagination.js +4 -4
- package/dist/esm/common/schema/pagination.test.js +19 -20
- package/dist/esm/common/schema/schema.d.ts +4 -4
- package/dist/esm/common/schema/schema.d.ts.map +1 -1
- package/dist/esm/common/schema/schema.js +6 -5
- package/dist/esm/common/schema/schema.test.js +9 -15
- package/dist/esm/common/schema/sets.d.ts +3 -2
- package/dist/esm/common/schema/sets.d.ts.map +1 -1
- package/dist/esm/common/schema/sets.js +9 -6
- package/dist/esm/common/schema/sets.test.js +53 -44
- package/dist/esm/customer/organization/schema.d.ts +44 -46
- package/dist/esm/customer/organization/schema.d.ts.map +1 -1
- package/dist/esm/customer/organization/schema.js +26 -20
- package/dist/esm/customer/schema.d.ts +7 -6
- package/dist/esm/customer/schema.d.ts.map +1 -1
- package/dist/esm/customer/schema.js +9 -3
- package/dist/esm/customer/users/resources.d.ts.map +1 -1
- package/dist/esm/customer/users/resources.js +6 -6
- package/dist/esm/customer/users/schema.d.ts +140 -139
- package/dist/esm/customer/users/schema.d.ts.map +1 -1
- package/dist/esm/customer/users/schema.js +58 -46
- package/dist/esm/customer/users/schema.test.js +22 -35
- package/dist/esm/customer/users/utils.d.ts +3 -2
- package/dist/esm/customer/users/utils.d.ts.map +1 -1
- package/dist/esm/customer/users/utils.test.js +1 -1
- package/dist/esm/identity/schema.d.ts +5 -1
- package/dist/esm/identity/schema.d.ts.map +1 -1
- package/dist/esm/identity/schema.js +5 -2
- package/dist/esm/identity/schema.test.js +21 -16
- package/dist/esm/oauth/authorize/schema/grants/authorization-code.d.ts +31 -28
- package/dist/esm/oauth/authorize/schema/grants/authorization-code.d.ts.map +1 -1
- package/dist/esm/oauth/authorize/schema/grants/authorization-code.js +56 -37
- package/dist/esm/oauth/authorize/schema/grants/authorization-code.test.js +44 -45
- package/dist/esm/oauth/authorize/schema/grants/implicit.d.ts +16 -10
- package/dist/esm/oauth/authorize/schema/grants/implicit.d.ts.map +1 -1
- package/dist/esm/oauth/authorize/schema/grants/implicit.js +19 -10
- package/dist/esm/oauth/authorize/schema/schema.d.ts +44 -36
- package/dist/esm/oauth/authorize/schema/schema.d.ts.map +1 -1
- package/dist/esm/oauth/common/schema.d.ts +21 -7
- package/dist/esm/oauth/common/schema.d.ts.map +1 -1
- package/dist/esm/oauth/common/schema.js +20 -7
- package/dist/esm/oauth/common/schema.test.js +25 -26
- package/dist/esm/oauth/token/schema/grants/authorization-code.d.ts +12 -9
- package/dist/esm/oauth/token/schema/grants/authorization-code.d.ts.map +1 -1
- package/dist/esm/oauth/token/schema/grants/authorization-code.js +11 -10
- package/dist/esm/oauth/token/schema/grants/client-credentials.d.ts +20 -15
- package/dist/esm/oauth/token/schema/grants/client-credentials.d.ts.map +1 -1
- package/dist/esm/oauth/token/schema/grants/client-credentials.js +13 -8
- package/dist/esm/oauth/token/schema/grants/refresh-token.d.ts +11 -8
- package/dist/esm/oauth/token/schema/grants/refresh-token.d.ts.map +1 -1
- package/dist/esm/oauth/token/schema/grants/refresh-token.js +6 -6
- package/dist/esm/oauth/token/schema/schema.d.ts +28 -21
- package/dist/esm/oauth/token/schema/schema.d.ts.map +1 -1
- package/dist/esm/oauth/token/schema/schema.test.js +42 -28
- package/dist/esm/workspace/authorization/schema.d.ts +44 -27
- package/dist/esm/workspace/authorization/schema.d.ts.map +1 -1
- package/dist/esm/workspace/authorization/schema.js +16 -11
- package/dist/esm/workspace/branding/schema.d.ts +30 -37
- package/dist/esm/workspace/branding/schema.d.ts.map +1 -1
- package/dist/esm/workspace/branding/schema.js +20 -15
- package/dist/esm/workspace/membership/schema.d.ts +21 -20
- package/dist/esm/workspace/membership/schema.d.ts.map +1 -1
- package/dist/esm/workspace/membership/schema.js +6 -6
- package/dist/esm/workspace/registration/schema.d.ts +26 -27
- package/dist/esm/workspace/registration/schema.d.ts.map +1 -1
- package/dist/esm/workspace/registration/schema.js +13 -11
- package/dist/esm/workspace/settings/schema.d.ts +12 -19
- package/dist/esm/workspace/settings/schema.d.ts.map +1 -1
- package/dist/esm/workspace/settings/schema.js +7 -6
- package/dist/esm/workspace/settings/schema.test.js +18 -19
- package/dist/esm/workspace/tenant/schema.d.ts +55 -57
- package/dist/esm/workspace/tenant/schema.d.ts.map +1 -1
- package/dist/esm/workspace/tenant/schema.js +17 -12
- package/dist/esm/workspace/user/notifications/schema.d.ts +50 -56
- package/dist/esm/workspace/user/notifications/schema.d.ts.map +1 -1
- package/dist/esm/workspace/user/notifications/schema.js +26 -23
- package/dist/esm/workspace/user/preferences/schema.d.ts +18 -25
- package/dist/esm/workspace/user/preferences/schema.d.ts.map +1 -1
- package/dist/esm/workspace/user/preferences/schema.js +16 -11
- package/package.json +3 -3
- package/src/action/schema/base.test.ts.bak +152 -0
- package/src/action/schema/operations/set-password.test.ts.bak +197 -0
- package/src/action/schema/operations/sign-up-verification.test.ts.bak +163 -0
- package/src/action/schema/operations/sign-up.test.ts.bak +203 -0
- package/src/action/schema/operations/user-attribute-verification.test.ts.bak +148 -0
- package/src/action/schema/schema.test.ts.bak +218 -0
- package/src/activity/schema/base.test.ts.bak +291 -0
- package/src/activity/schema/schema.test.ts.bak +392 -0
- package/src/activity/schema/types/authentication.test.ts.bak +337 -0
- package/src/activity/schema/types/authorization.test.ts.bak +379 -0
- package/src/activity/schema/types/note.test.ts.bak +367 -0
- package/src/activity/schema/types/operation.test.ts.bak +379 -0
- package/src/activity/schema/types/unknown.test.ts.bak +304 -0
- package/src/app/authorization/schema.test.ts.bak +412 -0
- package/src/app/oidc/schema.test.ts.bak +117 -0
- package/src/app/registration/schema.test.ts.bak +308 -0
- package/src/app/schema.test.ts.bak +221 -0
- package/src/association/schema.test.ts.bak +148 -0
- package/src/authentication/factors/schema.test.ts.bak +174 -0
- package/src/authentication/settings/schema.test.ts.bak +91 -0
- package/src/authentication/strategies/schema/types/email.test.ts.bak +252 -0
- package/src/authorization/permissions/schema.test.ts.bak +267 -0
- package/src/authorization/roles/schema.test.ts.bak +283 -0
- package/src/common/schema/aggregate.test.ts.bak +89 -0
- package/src/common/schema/collection.test.ts.bak +116 -0
- package/src/common/schema/dates.test.ts.bak +49 -0
- package/src/common/schema/id.test.ts.bak +149 -0
- package/src/common/schema/jwt.test.ts.bak +61 -0
- package/src/common/schema/metadata.test.ts.bak +141 -0
- package/src/common/schema/pagination.test.ts.bak +80 -0
- package/src/common/schema/schema.test.ts.bak +41 -0
- package/src/common/schema/sets.test.ts.bak +108 -0
- package/src/customer/users/schema.test.ts.bak +138 -0
- package/src/identity/schema.test.ts.bak +48 -0
- package/src/oauth/token/schema/schema.test.ts.bak +142 -0
- package/src/workspace/settings/schema.test.ts.bak +88 -0
|
@@ -1,18 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
import { BaseInsertStrategyPayloadSchema, BaseStrategyPayloadSchema, BaseStrategySchema, BaseUpdateStrategyPayloadSchema, } from '../base.js';
|
|
3
|
-
const TypeSchema =
|
|
4
|
-
type:
|
|
3
|
+
const TypeSchema = z.object({
|
|
4
|
+
type: z.literal('email'),
|
|
5
5
|
});
|
|
6
|
-
export const EmailStrategySchema =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export const UpdateEmailStrategyPayloadSchema = TypeSchema.and(BaseUpdateStrategyPayloadSchema);
|
|
10
|
-
export const VerifyEmailSchema = type({
|
|
11
|
-
email: type('string.email').optional(),
|
|
12
|
-
code: type('string').configure({
|
|
13
|
-
message: 'A verification code is required',
|
|
14
|
-
}),
|
|
6
|
+
export const EmailStrategySchema = z.object({
|
|
7
|
+
...BaseStrategySchema.shape,
|
|
8
|
+
...TypeSchema.shape,
|
|
15
9
|
});
|
|
16
|
-
export const
|
|
17
|
-
|
|
10
|
+
export const EmailStrategyPayloadSchema = z.object({
|
|
11
|
+
...BaseStrategyPayloadSchema.shape,
|
|
12
|
+
...TypeSchema.shape,
|
|
13
|
+
});
|
|
14
|
+
export const InsertEmailStrategyPayloadSchema = z.object({
|
|
15
|
+
...TypeSchema.shape,
|
|
16
|
+
...BaseInsertStrategyPayloadSchema.shape,
|
|
17
|
+
});
|
|
18
|
+
export const UpdateEmailStrategyPayloadSchema = z.object({
|
|
19
|
+
...TypeSchema.shape,
|
|
20
|
+
...BaseUpdateStrategyPayloadSchema.shape,
|
|
21
|
+
});
|
|
22
|
+
export const VerifyEmailSchema = z.object({
|
|
23
|
+
email: z.email().optional(),
|
|
24
|
+
code: z.string({ message: 'A verification code is required' }),
|
|
25
|
+
});
|
|
26
|
+
export const SendEmailVerificationCodeSchema = z.object({
|
|
27
|
+
email: z.email().optional(),
|
|
18
28
|
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type } from 'arktype';
|
|
2
1
|
import { describe, expect, test } from 'vitest';
|
|
3
2
|
import { generateStrategyId } from '../../../../authentication/utils.js';
|
|
4
3
|
import { EmailStrategyPayloadSchema, EmailStrategySchema, InsertEmailStrategyPayloadSchema, SendEmailVerificationCodeSchema, UpdateEmailStrategyPayloadSchema, VerifyEmailSchema, } from './email.js';
|
|
@@ -14,8 +13,8 @@ describe('Authentication Strategies - Email', () => {
|
|
|
14
13
|
updatedAt: new Date(),
|
|
15
14
|
metadata: { provider: 'sendgrid' },
|
|
16
15
|
};
|
|
17
|
-
const result = EmailStrategySchema(strategy);
|
|
18
|
-
|
|
16
|
+
const result = EmailStrategySchema.safeParse(strategy);
|
|
17
|
+
// Parse succeeds for valid data
|
|
19
18
|
});
|
|
20
19
|
test('should reject invalid type', () => {
|
|
21
20
|
const strategy = {
|
|
@@ -26,22 +25,21 @@ describe('Authentication Strategies - Email', () => {
|
|
|
26
25
|
updatedAt: new Date(),
|
|
27
26
|
metadata: {},
|
|
28
27
|
};
|
|
29
|
-
const result = EmailStrategySchema(strategy);
|
|
30
|
-
expect(result).
|
|
28
|
+
const result = EmailStrategySchema.safeParse(strategy);
|
|
29
|
+
expect(result.success).toBe(false);
|
|
31
30
|
});
|
|
32
31
|
test('should reject missing required fields', () => {
|
|
33
32
|
const strategy = {
|
|
34
33
|
type: 'email',
|
|
35
34
|
// missing id, enabled, dates, metadata
|
|
36
35
|
};
|
|
37
|
-
const result = EmailStrategySchema(strategy);
|
|
38
|
-
expect(result).
|
|
36
|
+
const result = EmailStrategySchema.safeParse(strategy);
|
|
37
|
+
expect(result.success).toBe(false);
|
|
39
38
|
});
|
|
40
39
|
});
|
|
41
40
|
describe('EmailStrategyPayloadSchema', () => {
|
|
42
41
|
test('should accept complete payload', () => {
|
|
43
42
|
const payload = {
|
|
44
|
-
id: generateStrategyId(),
|
|
45
43
|
type: 'email',
|
|
46
44
|
label: 'Test',
|
|
47
45
|
status: 'enabled',
|
|
@@ -49,9 +47,9 @@ describe('Authentication Strategies - Email', () => {
|
|
|
49
47
|
updatedAt: new Date().toISOString(),
|
|
50
48
|
metadata: { configured: true },
|
|
51
49
|
};
|
|
52
|
-
const result = EmailStrategyPayloadSchema(payload);
|
|
53
|
-
expect(result).
|
|
54
|
-
expect(result).toEqual(payload);
|
|
50
|
+
const result = EmailStrategyPayloadSchema.safeParse(payload);
|
|
51
|
+
expect(result.success).toBe(true);
|
|
52
|
+
expect(result.data).toEqual(payload);
|
|
55
53
|
});
|
|
56
54
|
test('should reject invalid type', () => {
|
|
57
55
|
const payload = {
|
|
@@ -63,8 +61,8 @@ describe('Authentication Strategies - Email', () => {
|
|
|
63
61
|
updatedAt: new Date().toISOString(),
|
|
64
62
|
metadata: {},
|
|
65
63
|
};
|
|
66
|
-
const result = EmailStrategyPayloadSchema(payload);
|
|
67
|
-
expect(result).
|
|
64
|
+
const result = EmailStrategyPayloadSchema.safeParse(payload);
|
|
65
|
+
expect(result.success).toBe(false);
|
|
68
66
|
});
|
|
69
67
|
});
|
|
70
68
|
describe('InsertEmailStrategyPayloadSchema', () => {
|
|
@@ -76,30 +74,30 @@ describe('Authentication Strategies - Email', () => {
|
|
|
76
74
|
status: 'enabled',
|
|
77
75
|
metadata: { setup: 'manual' },
|
|
78
76
|
};
|
|
79
|
-
const result = InsertEmailStrategyPayloadSchema(payload);
|
|
80
|
-
|
|
77
|
+
const result = InsertEmailStrategyPayloadSchema.safeParse(payload);
|
|
78
|
+
// Parse succeeds for valid data
|
|
81
79
|
});
|
|
82
80
|
test('should accept minimal insert payload', () => {
|
|
83
81
|
const payload = {
|
|
84
82
|
type: 'email',
|
|
85
83
|
label: 'Test',
|
|
86
84
|
};
|
|
87
|
-
const result = InsertEmailStrategyPayloadSchema(payload);
|
|
88
|
-
|
|
85
|
+
const result = InsertEmailStrategyPayloadSchema.safeParse(payload);
|
|
86
|
+
// Parse succeeds for valid data
|
|
89
87
|
});
|
|
90
88
|
test('should reject missing type', () => {
|
|
91
89
|
const payload = {
|
|
92
90
|
status: 'enabled',
|
|
93
91
|
};
|
|
94
|
-
const result = InsertEmailStrategyPayloadSchema(payload);
|
|
95
|
-
expect(result).
|
|
92
|
+
const result = InsertEmailStrategyPayloadSchema.safeParse(payload);
|
|
93
|
+
expect(result.success).toBe(false);
|
|
96
94
|
});
|
|
97
95
|
test('should reject invalid type', () => {
|
|
98
96
|
const payload = {
|
|
99
97
|
type: 'password',
|
|
100
98
|
};
|
|
101
|
-
const result = InsertEmailStrategyPayloadSchema(payload);
|
|
102
|
-
expect(result).
|
|
99
|
+
const result = InsertEmailStrategyPayloadSchema.safeParse(payload);
|
|
100
|
+
expect(result.success).toBe(false);
|
|
103
101
|
});
|
|
104
102
|
});
|
|
105
103
|
describe('UpdateEmailStrategyPayloadSchema', () => {
|
|
@@ -109,23 +107,24 @@ describe('Authentication Strategies - Email', () => {
|
|
|
109
107
|
enabled: false,
|
|
110
108
|
metadata: { updated: true },
|
|
111
109
|
};
|
|
112
|
-
const result = UpdateEmailStrategyPayloadSchema(payload);
|
|
113
|
-
expect(result).
|
|
114
|
-
expect(result).toEqual(payload);
|
|
110
|
+
const result = UpdateEmailStrategyPayloadSchema.safeParse(payload);
|
|
111
|
+
expect(result.success).toBe(true);
|
|
112
|
+
expect(result.data?.type).toEqual(payload.type);
|
|
113
|
+
expect(result.data?.metadata).toEqual(payload.metadata);
|
|
115
114
|
});
|
|
116
115
|
test('should accept minimal update', () => {
|
|
117
116
|
const payload = {
|
|
118
117
|
type: 'email',
|
|
119
118
|
};
|
|
120
|
-
const result = UpdateEmailStrategyPayloadSchema(payload);
|
|
121
|
-
|
|
119
|
+
const result = UpdateEmailStrategyPayloadSchema.safeParse(payload);
|
|
120
|
+
// Parse succeeds for valid data
|
|
122
121
|
});
|
|
123
122
|
test('should reject invalid type', () => {
|
|
124
123
|
const payload = {
|
|
125
124
|
type: 'totp',
|
|
126
125
|
};
|
|
127
|
-
const result = UpdateEmailStrategyPayloadSchema(payload);
|
|
128
|
-
expect(result).
|
|
126
|
+
const result = UpdateEmailStrategyPayloadSchema.safeParse(payload);
|
|
127
|
+
expect(result.success).toBe(false);
|
|
129
128
|
});
|
|
130
129
|
});
|
|
131
130
|
describe('VerifyEmailSchema', () => {
|
|
@@ -134,40 +133,40 @@ describe('Authentication Strategies - Email', () => {
|
|
|
134
133
|
email: 'user@example.com',
|
|
135
134
|
code: '123456',
|
|
136
135
|
};
|
|
137
|
-
const result = VerifyEmailSchema(verification);
|
|
138
|
-
|
|
139
|
-
expect(result).toEqual(verification);
|
|
136
|
+
const result = VerifyEmailSchema.safeParse(verification);
|
|
137
|
+
// Parse succeeds for valid data
|
|
138
|
+
expect(result.data).toEqual(verification);
|
|
140
139
|
});
|
|
141
140
|
test('should accept verification with only code', () => {
|
|
142
141
|
const verification = {
|
|
143
142
|
code: 'ABC123',
|
|
144
143
|
};
|
|
145
|
-
const result = VerifyEmailSchema(verification);
|
|
146
|
-
|
|
147
|
-
expect(result).toEqual(verification);
|
|
144
|
+
const result = VerifyEmailSchema.safeParse(verification);
|
|
145
|
+
// Parse succeeds for valid data
|
|
146
|
+
expect(result.data).toEqual(verification);
|
|
148
147
|
});
|
|
149
148
|
test('should reject missing code', () => {
|
|
150
149
|
const verification = {
|
|
151
150
|
email: 'user@example.com',
|
|
152
151
|
};
|
|
153
|
-
const result = VerifyEmailSchema(verification);
|
|
154
|
-
expect(result).
|
|
152
|
+
const result = VerifyEmailSchema.safeParse(verification);
|
|
153
|
+
expect(result.success).toBe(false);
|
|
155
154
|
});
|
|
156
155
|
test('should reject invalid email format', () => {
|
|
157
156
|
const verification = {
|
|
158
157
|
email: 'invalid-email',
|
|
159
158
|
code: '123456',
|
|
160
159
|
};
|
|
161
|
-
const result = VerifyEmailSchema(verification);
|
|
162
|
-
expect(result).
|
|
160
|
+
const result = VerifyEmailSchema.safeParse(verification);
|
|
161
|
+
expect(result.success).toBe(false);
|
|
163
162
|
});
|
|
164
163
|
test('should reject non-string code', () => {
|
|
165
164
|
const verification = {
|
|
166
165
|
email: 'user@example.com',
|
|
167
166
|
code: 123456,
|
|
168
167
|
};
|
|
169
|
-
const result = VerifyEmailSchema(verification);
|
|
170
|
-
expect(result).
|
|
168
|
+
const result = VerifyEmailSchema.safeParse(verification);
|
|
169
|
+
expect(result.success).toBe(false);
|
|
171
170
|
});
|
|
172
171
|
});
|
|
173
172
|
describe('SendEmailVerificationCodeSchema', () => {
|
|
@@ -175,29 +174,29 @@ describe('Authentication Strategies - Email', () => {
|
|
|
175
174
|
const request = {
|
|
176
175
|
email: 'test@example.com',
|
|
177
176
|
};
|
|
178
|
-
const result = SendEmailVerificationCodeSchema(request);
|
|
179
|
-
|
|
180
|
-
expect(result).toEqual(request);
|
|
177
|
+
const result = SendEmailVerificationCodeSchema.safeParse(request);
|
|
178
|
+
// Parse succeeds for valid data
|
|
179
|
+
expect(result.data).toEqual(request);
|
|
181
180
|
});
|
|
182
181
|
test('should accept empty request', () => {
|
|
183
182
|
const request = {};
|
|
184
|
-
const result = SendEmailVerificationCodeSchema(request);
|
|
185
|
-
|
|
186
|
-
expect(result).toEqual(request);
|
|
183
|
+
const result = SendEmailVerificationCodeSchema.safeParse(request);
|
|
184
|
+
// Parse succeeds for valid data
|
|
185
|
+
expect(result.data).toEqual(request);
|
|
187
186
|
});
|
|
188
187
|
test('should reject invalid email format', () => {
|
|
189
188
|
const request = {
|
|
190
189
|
email: 'not-an-email',
|
|
191
190
|
};
|
|
192
|
-
const result = SendEmailVerificationCodeSchema(request);
|
|
193
|
-
expect(result).
|
|
191
|
+
const result = SendEmailVerificationCodeSchema.safeParse(request);
|
|
192
|
+
expect(result.success).toBe(false);
|
|
194
193
|
});
|
|
195
194
|
test('should reject non-string email', () => {
|
|
196
195
|
const request = {
|
|
197
196
|
email: 123,
|
|
198
197
|
};
|
|
199
|
-
const result = SendEmailVerificationCodeSchema(request);
|
|
200
|
-
expect(result).
|
|
198
|
+
const result = SendEmailVerificationCodeSchema.safeParse(request);
|
|
199
|
+
expect(result.success).toBe(false);
|
|
201
200
|
});
|
|
202
201
|
});
|
|
203
202
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
export declare const PasswordPolicyDefaults: {
|
|
2
3
|
minimumLength: number;
|
|
3
4
|
maximumLength: number;
|
|
@@ -6,126 +7,132 @@ export declare const PasswordPolicyDefaults: {
|
|
|
6
7
|
minimumNumber: number;
|
|
7
8
|
minimumSpecial: number;
|
|
8
9
|
};
|
|
9
|
-
export declare const PasswordPolicySchema:
|
|
10
|
-
minimumLength:
|
|
11
|
-
maximumLength:
|
|
12
|
-
minimumCapital:
|
|
13
|
-
minimumLower:
|
|
14
|
-
minimumNumber:
|
|
15
|
-
minimumSpecial:
|
|
16
|
-
},
|
|
17
|
-
export declare const PasswordStrategySettingsPropertySchema:
|
|
18
|
-
settings: {
|
|
19
|
-
passwordPolicy: {
|
|
20
|
-
minimumLength:
|
|
21
|
-
maximumLength:
|
|
22
|
-
minimumCapital:
|
|
23
|
-
minimumLower:
|
|
24
|
-
minimumNumber:
|
|
25
|
-
minimumSpecial:
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
export declare const PasswordStrategySchema:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
export type
|
|
100
|
-
export
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
},
|
|
120
|
-
export type UpdatePasswordStrategyInput = typeof UpdatePasswordStrategyPayloadSchema
|
|
121
|
-
export type UpdatePasswordStrategyPayload = typeof UpdatePasswordStrategyPayloadSchema
|
|
122
|
-
export declare const ForgotPasswordSchema:
|
|
123
|
-
identifier
|
|
124
|
-
identifierType
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
10
|
+
export declare const PasswordPolicySchema: z.ZodObject<{
|
|
11
|
+
minimumLength: z.ZodDefault<z.ZodNumber>;
|
|
12
|
+
maximumLength: z.ZodDefault<z.ZodNumber>;
|
|
13
|
+
minimumCapital: z.ZodDefault<z.ZodNumber>;
|
|
14
|
+
minimumLower: z.ZodDefault<z.ZodNumber>;
|
|
15
|
+
minimumNumber: z.ZodDefault<z.ZodNumber>;
|
|
16
|
+
minimumSpecial: z.ZodDefault<z.ZodNumber>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export declare const PasswordStrategySettingsPropertySchema: z.ZodObject<{
|
|
19
|
+
settings: z.ZodObject<{
|
|
20
|
+
passwordPolicy: z.ZodObject<{
|
|
21
|
+
minimumLength: z.ZodDefault<z.ZodNumber>;
|
|
22
|
+
maximumLength: z.ZodDefault<z.ZodNumber>;
|
|
23
|
+
minimumCapital: z.ZodDefault<z.ZodNumber>;
|
|
24
|
+
minimumLower: z.ZodDefault<z.ZodNumber>;
|
|
25
|
+
minimumNumber: z.ZodDefault<z.ZodNumber>;
|
|
26
|
+
minimumSpecial: z.ZodDefault<z.ZodNumber>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
export declare const PasswordStrategySchema: z.ZodObject<{
|
|
31
|
+
settings: z.ZodObject<{
|
|
32
|
+
passwordPolicy: z.ZodObject<{
|
|
33
|
+
minimumLength: z.ZodDefault<z.ZodNumber>;
|
|
34
|
+
maximumLength: z.ZodDefault<z.ZodNumber>;
|
|
35
|
+
minimumCapital: z.ZodDefault<z.ZodNumber>;
|
|
36
|
+
minimumLower: z.ZodDefault<z.ZodNumber>;
|
|
37
|
+
minimumNumber: z.ZodDefault<z.ZodNumber>;
|
|
38
|
+
minimumSpecial: z.ZodDefault<z.ZodNumber>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
type: z.ZodLiteral<"password">;
|
|
42
|
+
metadata: z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodNull, z.ZodCustom<Map<string, string | number | boolean>, Map<string, string | number | boolean>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>, z.ZodTransform<Map<string, string | number | boolean>, Record<string, string | number | boolean> | Map<string, string | number | boolean> | null | undefined>>;
|
|
43
|
+
id: z.ZodString;
|
|
44
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
45
|
+
enabled: "enabled";
|
|
46
|
+
disabled: "disabled";
|
|
47
|
+
}>>;
|
|
48
|
+
label: z.ZodString;
|
|
49
|
+
createdAt: z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>;
|
|
50
|
+
updatedAt: z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>;
|
|
51
|
+
deletedAt: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>>;
|
|
52
|
+
deactivatedAt: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
export type PasswordStrategyProperties = z.input<typeof PasswordStrategySchema>;
|
|
55
|
+
export type PasswordStrategy = z.output<typeof PasswordStrategySchema>;
|
|
56
|
+
export declare const PasswordStrategyPayloadSchema: z.ZodObject<{
|
|
57
|
+
settings: z.ZodObject<{
|
|
58
|
+
passwordPolicy: z.ZodObject<{
|
|
59
|
+
minimumLength: z.ZodDefault<z.ZodNumber>;
|
|
60
|
+
maximumLength: z.ZodDefault<z.ZodNumber>;
|
|
61
|
+
minimumCapital: z.ZodDefault<z.ZodNumber>;
|
|
62
|
+
minimumLower: z.ZodDefault<z.ZodNumber>;
|
|
63
|
+
minimumNumber: z.ZodDefault<z.ZodNumber>;
|
|
64
|
+
minimumSpecial: z.ZodDefault<z.ZodNumber>;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
type: z.ZodLiteral<"password">;
|
|
68
|
+
metadata: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodNull, z.ZodCustom<Map<string, string | number | boolean>, Map<string, string | number | boolean>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>, z.ZodTransform<Record<string, string | number | boolean> | undefined, Record<string, string | number | boolean> | Map<string, string | number | boolean> | null | undefined>>>;
|
|
69
|
+
status: z.ZodEnum<{
|
|
70
|
+
enabled: "enabled";
|
|
71
|
+
disabled: "disabled";
|
|
72
|
+
}>;
|
|
73
|
+
label: z.ZodString;
|
|
74
|
+
createdAt: z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>, z.ZodTransform<string, Date>>;
|
|
75
|
+
updatedAt: z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>, z.ZodTransform<string, Date>>;
|
|
76
|
+
deletedAt: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>, z.ZodTransform<string | undefined, Date | undefined>>>;
|
|
77
|
+
deactivatedAt: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>, z.ZodTransform<string | undefined, Date | undefined>>>;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
export type PasswordStrategyPayload = z.output<typeof PasswordStrategyPayloadSchema>;
|
|
80
|
+
export declare const InsertPasswordStrategyPayloadSchema: z.ZodObject<{
|
|
81
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
82
|
+
passwordPolicy: z.ZodObject<{
|
|
83
|
+
minimumLength: z.ZodDefault<z.ZodNumber>;
|
|
84
|
+
maximumLength: z.ZodDefault<z.ZodNumber>;
|
|
85
|
+
minimumCapital: z.ZodDefault<z.ZodNumber>;
|
|
86
|
+
minimumLower: z.ZodDefault<z.ZodNumber>;
|
|
87
|
+
minimumNumber: z.ZodDefault<z.ZodNumber>;
|
|
88
|
+
minimumSpecial: z.ZodDefault<z.ZodNumber>;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
}, z.core.$strip>>;
|
|
91
|
+
metadata: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodNull, z.ZodCustom<Map<string, string | number | boolean>, Map<string, string | number | boolean>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>, z.ZodTransform<Record<string, string | number | boolean> | undefined, Record<string, string | number | boolean> | Map<string, string | number | boolean> | null | undefined>>>;
|
|
92
|
+
id: z.ZodOptional<z.ZodString>;
|
|
93
|
+
label: z.ZodString;
|
|
94
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
95
|
+
enabled: "enabled";
|
|
96
|
+
disabled: "disabled";
|
|
97
|
+
}>>;
|
|
98
|
+
type: z.ZodLiteral<"password">;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
export type InsertPasswordStrategyInput = z.input<typeof InsertPasswordStrategyPayloadSchema>;
|
|
101
|
+
export type InsertPasswordStrategyPayload = z.output<typeof InsertPasswordStrategyPayloadSchema>;
|
|
102
|
+
export declare const UpdatePasswordStrategyPayloadSchema: z.ZodObject<{
|
|
103
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
104
|
+
passwordPolicy: z.ZodObject<{
|
|
105
|
+
minimumLength: z.ZodDefault<z.ZodNumber>;
|
|
106
|
+
maximumLength: z.ZodDefault<z.ZodNumber>;
|
|
107
|
+
minimumCapital: z.ZodDefault<z.ZodNumber>;
|
|
108
|
+
minimumLower: z.ZodDefault<z.ZodNumber>;
|
|
109
|
+
minimumNumber: z.ZodDefault<z.ZodNumber>;
|
|
110
|
+
minimumSpecial: z.ZodDefault<z.ZodNumber>;
|
|
111
|
+
}, z.core.$strip>;
|
|
112
|
+
}, z.core.$strip>>;
|
|
113
|
+
metadata: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodNull, z.ZodCustom<Map<string, string | number | boolean>, Map<string, string | number | boolean>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>, z.ZodTransform<Record<string, string | number | boolean> | undefined, Record<string, string | number | boolean> | Map<string, string | number | boolean> | null | undefined>>>;
|
|
114
|
+
label: z.ZodOptional<z.ZodString>;
|
|
115
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
116
|
+
enabled: "enabled";
|
|
117
|
+
disabled: "disabled";
|
|
118
|
+
}>>;
|
|
119
|
+
type: z.ZodLiteral<"password">;
|
|
120
|
+
}, z.core.$strip>;
|
|
121
|
+
export type UpdatePasswordStrategyInput = z.input<typeof UpdatePasswordStrategyPayloadSchema>;
|
|
122
|
+
export type UpdatePasswordStrategyPayload = z.output<typeof UpdatePasswordStrategyPayloadSchema>;
|
|
123
|
+
export declare const ForgotPasswordSchema: z.ZodObject<{
|
|
124
|
+
identifier: z.ZodOptional<z.ZodString>;
|
|
125
|
+
identifierType: z.ZodOptional<z.ZodEnum<{
|
|
126
|
+
email: "email";
|
|
127
|
+
phoneNumber: "phoneNumber";
|
|
128
|
+
}>>;
|
|
129
|
+
}, z.core.$strip>;
|
|
130
|
+
export declare const VerifyPasswordSchema: z.ZodObject<{
|
|
131
|
+
password: z.ZodString;
|
|
132
|
+
identifier: z.ZodOptional<z.ZodString>;
|
|
133
|
+
identifierType: z.ZodOptional<z.ZodEnum<{
|
|
134
|
+
email: "email";
|
|
135
|
+
phoneNumber: "phoneNumber";
|
|
136
|
+
}>>;
|
|
137
|
+
}, z.core.$strip>;
|
|
131
138
|
//# sourceMappingURL=password.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password.d.ts","sourceRoot":"","sources":["../../../../../../src/authentication/strategies/schema/types/password.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"password.d.ts","sourceRoot":"","sources":["../../../../../../src/authentication/strategies/schema/types/password.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,sBAAsB;;;;;;;CAOlC,CAAC;AAMF,eAAO,MAAM,oBAAoB;;;;;;;iBAO/B,CAAC;AAMH,eAAO,MAAM,sCAAsC;;;;;;;;;;;iBAEjD,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;iBAIjC,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAChF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEvE,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;iBAIxC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAC5C,OAAO,6BAA6B,CACrC,CAAC;AAEF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;iBAI9C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,mCAAmC,CAC3C,CAAC;AACF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAClD,OAAO,mCAAmC,CAC3C,CAAC;AAEF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;iBAI9C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,mCAAmC,CAC3C,CAAC;AACF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAClD,OAAO,mCAAmC,CAC3C,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;iBAG/B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;iBAI/B,CAAC"}
|