@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,113 +1,117 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
export declare const RoleStatus: {
|
|
2
3
|
readonly ENABLED: "enabled";
|
|
3
4
|
readonly DISABLED: "disabled";
|
|
4
5
|
};
|
|
5
6
|
export type AnyRoleStatus = (typeof RoleStatus)[keyof typeof RoleStatus];
|
|
6
|
-
export declare const RoleIdPropertySchema:
|
|
7
|
-
id:
|
|
8
|
-
},
|
|
9
|
-
export type RoleIdProperty = typeof RoleIdPropertySchema
|
|
10
|
-
export declare const RoleAssociationsSchema:
|
|
11
|
-
apps
|
|
12
|
-
permissions
|
|
13
|
-
users
|
|
14
|
-
},
|
|
15
|
-
export type RoleAssociations = typeof RoleAssociationsSchema
|
|
16
|
-
export declare const RoleSchema:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
7
|
+
export declare const RoleIdPropertySchema: z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type RoleIdProperty = z.output<typeof RoleIdPropertySchema>;
|
|
11
|
+
export declare const RoleAssociationsSchema: z.ZodObject<{
|
|
12
|
+
apps: z.ZodOptional<z.ZodUnion<[z.ZodUndefined, z.ZodArray<z.ZodString>]>>;
|
|
13
|
+
permissions: z.ZodOptional<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodString>]>>;
|
|
14
|
+
users: z.ZodOptional<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodString>]>>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export type RoleAssociations = z.output<typeof RoleAssociationsSchema>;
|
|
17
|
+
export declare const RoleSchema: z.ZodObject<{
|
|
18
|
+
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>>;
|
|
19
|
+
createdAt: z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>;
|
|
20
|
+
updatedAt: z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>;
|
|
21
|
+
deletedAt: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>>;
|
|
22
|
+
deactivatedAt: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>>;
|
|
23
|
+
name: z.ZodString;
|
|
24
|
+
status: z.ZodEnum<{
|
|
25
|
+
enabled: "enabled";
|
|
26
|
+
disabled: "disabled";
|
|
27
|
+
}>;
|
|
28
|
+
description: z.ZodOptional<z.ZodString>;
|
|
29
|
+
apps: z.ZodOptional<z.ZodObject<{
|
|
30
|
+
ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
31
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
|
+
users: z.ZodOptional<z.ZodObject<{
|
|
34
|
+
ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
35
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
}, z.core.$strip>>;
|
|
37
|
+
permissions: z.ZodOptional<z.ZodObject<{
|
|
38
|
+
ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
39
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
40
|
+
}, z.core.$strip>>;
|
|
41
|
+
id: z.ZodString;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
export type RoleProperties = z.input<typeof RoleSchema>;
|
|
44
|
+
export type Role = z.output<typeof RoleSchema>;
|
|
45
|
+
export declare const RolePayloadSchema: z.ZodObject<{
|
|
46
|
+
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>>>;
|
|
47
|
+
createdAt: z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>, z.ZodTransform<string, Date>>;
|
|
48
|
+
updatedAt: z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>, z.ZodTransform<string, Date>>;
|
|
49
|
+
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>>>;
|
|
50
|
+
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>>>;
|
|
51
|
+
name: z.ZodString;
|
|
52
|
+
status: z.ZodEnum<{
|
|
53
|
+
enabled: "enabled";
|
|
54
|
+
disabled: "disabled";
|
|
55
|
+
}>;
|
|
56
|
+
description: z.ZodOptional<z.ZodString>;
|
|
57
|
+
apps: z.ZodOptional<z.ZodObject<{
|
|
58
|
+
ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
59
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
}, z.core.$strip>>;
|
|
61
|
+
users: z.ZodOptional<z.ZodObject<{
|
|
62
|
+
ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
63
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
}, z.core.$strip>>;
|
|
65
|
+
permissions: z.ZodOptional<z.ZodObject<{
|
|
66
|
+
ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
67
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
68
|
+
}, z.core.$strip>>;
|
|
69
|
+
id: z.ZodString;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
export type RolePayload = z.output<typeof RolePayloadSchema>;
|
|
69
72
|
/**
|
|
70
73
|
* Insert
|
|
71
74
|
*/
|
|
72
|
-
export declare const InsertRolePayloadSchema:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
export type
|
|
87
|
-
export type InsertRolePayload = typeof InsertRolePayloadSchema.inferOut;
|
|
75
|
+
export declare const InsertRolePayloadSchema: z.ZodObject<{
|
|
76
|
+
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> | null | undefined, Record<string, string | number | boolean> | Map<string, string | number | boolean> | null | undefined>>>;
|
|
77
|
+
apps: z.ZodOptional<z.ZodUnion<[z.ZodUndefined, z.ZodArray<z.ZodString>]>>;
|
|
78
|
+
permissions: z.ZodOptional<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodString>]>>;
|
|
79
|
+
users: z.ZodOptional<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodString>]>>;
|
|
80
|
+
id: z.ZodDefault<z.ZodString>;
|
|
81
|
+
name: z.ZodString;
|
|
82
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
83
|
+
enabled: "enabled";
|
|
84
|
+
disabled: "disabled";
|
|
85
|
+
}>>;
|
|
86
|
+
description: z.ZodOptional<z.ZodString>;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
export type InsertRoleInput = z.input<typeof InsertRolePayloadSchema>;
|
|
89
|
+
export type InsertRolePayload = z.output<typeof InsertRolePayloadSchema>;
|
|
88
90
|
/**
|
|
89
91
|
* Update
|
|
90
92
|
*/
|
|
91
|
-
export declare const UpdateRolePayloadSchema:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
export type
|
|
102
|
-
export type UpdateRolePayload = typeof UpdateRolePayloadSchema.inferOut;
|
|
93
|
+
export declare const UpdateRolePayloadSchema: z.ZodObject<{
|
|
94
|
+
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> | null | undefined, Record<string, string | number | boolean> | Map<string, string | number | boolean> | null | undefined>>>;
|
|
95
|
+
name: z.ZodOptional<z.ZodString>;
|
|
96
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
97
|
+
enabled: "enabled";
|
|
98
|
+
disabled: "disabled";
|
|
99
|
+
}>>;
|
|
100
|
+
description: z.ZodOptional<z.ZodString>;
|
|
101
|
+
}, z.core.$strip>;
|
|
102
|
+
export type UpdateRoleInput = z.input<typeof UpdateRolePayloadSchema>;
|
|
103
|
+
export type UpdateRolePayload = z.output<typeof UpdateRolePayloadSchema>;
|
|
103
104
|
/**
|
|
104
105
|
* Association
|
|
105
106
|
*/
|
|
106
|
-
export declare const RoleAssociationReferenceSchema:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
|
|
107
|
+
export declare const RoleAssociationReferenceSchema: z.ZodObject<{
|
|
108
|
+
name: z.ZodString;
|
|
109
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
110
|
+
enabled: "enabled";
|
|
111
|
+
disabled: "disabled";
|
|
112
|
+
}>>;
|
|
113
|
+
model: z.ZodLiteral<"Role">;
|
|
114
|
+
id: z.ZodString;
|
|
115
|
+
}, z.core.$strip>;
|
|
116
|
+
export type RoleAssociationReference = z.output<typeof RoleAssociationReferenceSchema>;
|
|
113
117
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqBxB,eAAO,MAAM,UAAU;;;CAGb,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAEzE,eAAO,MAAM,oBAAoB;;iBAE/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAInE,eAAO,MAAM,sBAAsB;;;;iBAIjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAYvE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;iBAOrB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AACxD,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC;AAE/C,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;iBAO5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;iBAOlC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;iBAKlC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;iBAKzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAC7C,OAAO,8BAA8B,CACtC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
import { AppIdAssociationsSchema } from '../../app/schema.js';
|
|
3
3
|
import { OptionalDatePayloadSchema, OptionalDateSchema, RequiredDatePayloadSchema, RequiredDateSchema, } from '../../common/index.js';
|
|
4
4
|
import { AggregateSchema } from '../../common/schema/aggregate.js';
|
|
@@ -9,63 +9,66 @@ export const RoleStatus = {
|
|
|
9
9
|
ENABLED: 'enabled',
|
|
10
10
|
DISABLED: 'disabled',
|
|
11
11
|
};
|
|
12
|
-
export const RoleIdPropertySchema =
|
|
12
|
+
export const RoleIdPropertySchema = z.object({
|
|
13
13
|
id: RoleIdSchema,
|
|
14
14
|
});
|
|
15
|
-
const StatusSchema =
|
|
16
|
-
export const RoleAssociationsSchema =
|
|
15
|
+
const StatusSchema = z.enum([RoleStatus.ENABLED, RoleStatus.DISABLED]);
|
|
16
|
+
export const RoleAssociationsSchema = z.object({
|
|
17
17
|
apps: AppIdAssociationsSchema.optional(),
|
|
18
18
|
permissions: PermissionIdAssociationsSchema.optional(),
|
|
19
19
|
users: UserIdAssociationsSchema.optional(),
|
|
20
20
|
});
|
|
21
|
-
const BaseSchema =
|
|
22
|
-
|
|
21
|
+
const BaseSchema = z.object({
|
|
22
|
+
...RoleIdPropertySchema.shape,
|
|
23
|
+
name: z.string(),
|
|
23
24
|
status: StatusSchema,
|
|
24
|
-
description:
|
|
25
|
+
description: z.string().optional(),
|
|
25
26
|
apps: AggregateSchema.optional(),
|
|
26
27
|
users: AggregateSchema.optional(),
|
|
27
28
|
permissions: AggregateSchema.optional(),
|
|
28
29
|
});
|
|
29
|
-
export const RoleSchema =
|
|
30
|
+
export const RoleSchema = z.object({
|
|
31
|
+
...BaseSchema.shape,
|
|
30
32
|
createdAt: RequiredDateSchema,
|
|
31
33
|
updatedAt: RequiredDateSchema,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
deletedAt: OptionalDateSchema.optional(),
|
|
35
|
+
deactivatedAt: OptionalDateSchema.optional(),
|
|
36
|
+
...MetadataMapPropertySchema.shape,
|
|
37
|
+
});
|
|
38
|
+
export const RolePayloadSchema = z.object({
|
|
39
|
+
...BaseSchema.shape,
|
|
38
40
|
createdAt: RequiredDatePayloadSchema,
|
|
39
41
|
updatedAt: RequiredDatePayloadSchema,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
.and(MetadataPayloadPropertySchema);
|
|
42
|
+
deletedAt: OptionalDatePayloadSchema.optional(),
|
|
43
|
+
deactivatedAt: OptionalDatePayloadSchema.optional(),
|
|
44
|
+
...MetadataPayloadPropertySchema.shape,
|
|
45
|
+
});
|
|
45
46
|
/**
|
|
46
47
|
* Insert
|
|
47
48
|
*/
|
|
48
|
-
export const InsertRolePayloadSchema =
|
|
49
|
+
export const InsertRolePayloadSchema = z.object({
|
|
49
50
|
id: RoleIdSchema.default(() => generateRoleId()),
|
|
50
|
-
name:
|
|
51
|
+
name: z.string(),
|
|
51
52
|
status: StatusSchema.default(RoleStatus.ENABLED),
|
|
52
|
-
description:
|
|
53
|
-
|
|
54
|
-
.
|
|
55
|
-
|
|
53
|
+
description: z.string().optional(),
|
|
54
|
+
...RoleAssociationsSchema.shape,
|
|
55
|
+
...UpsertMetadataPropertyPayloadSchema.shape,
|
|
56
|
+
});
|
|
56
57
|
/**
|
|
57
58
|
* Update
|
|
58
59
|
*/
|
|
59
|
-
export const UpdateRolePayloadSchema =
|
|
60
|
-
name:
|
|
60
|
+
export const UpdateRolePayloadSchema = z.object({
|
|
61
|
+
name: z.string().optional(),
|
|
61
62
|
status: StatusSchema.optional(),
|
|
62
|
-
description:
|
|
63
|
-
|
|
63
|
+
description: z.string().optional(),
|
|
64
|
+
...UpsertMetadataPropertyPayloadSchema.shape,
|
|
65
|
+
});
|
|
64
66
|
/**
|
|
65
67
|
* Association
|
|
66
68
|
*/
|
|
67
|
-
export const RoleAssociationReferenceSchema =
|
|
68
|
-
|
|
69
|
+
export const RoleAssociationReferenceSchema = z.object({
|
|
70
|
+
...RoleIdPropertySchema.shape,
|
|
71
|
+
name: z.string(),
|
|
69
72
|
status: StatusSchema.default('disabled'),
|
|
70
|
-
model:
|
|
73
|
+
model: z.literal('Role'),
|
|
71
74
|
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type } from 'arktype';
|
|
2
1
|
import { describe, expect, test } from 'vitest';
|
|
3
2
|
import { generateAppId } from '../../app/utils.js';
|
|
4
3
|
import { generateUserId } from '../../customer/schema.js';
|
|
@@ -14,13 +13,13 @@ describe('Authorization Roles - Schema', () => {
|
|
|
14
13
|
describe('RoleIdPropertySchema', () => {
|
|
15
14
|
test('should accept valid id property', () => {
|
|
16
15
|
const payload = { id: generateRoleId() };
|
|
17
|
-
const result = RoleIdPropertySchema(payload);
|
|
18
|
-
|
|
19
|
-
expect(result).toEqual({ id: payload.id });
|
|
16
|
+
const result = RoleIdPropertySchema.safeParse(payload);
|
|
17
|
+
// Parse succeeds for valid data
|
|
18
|
+
expect(result.data).toEqual({ id: payload.id });
|
|
20
19
|
});
|
|
21
20
|
test('should reject missing id', () => {
|
|
22
|
-
const result = RoleIdPropertySchema({});
|
|
23
|
-
expect(result).
|
|
21
|
+
const result = RoleIdPropertySchema.safeParse({});
|
|
22
|
+
expect(result.success).toBe(false);
|
|
24
23
|
});
|
|
25
24
|
});
|
|
26
25
|
describe('RoleAssociationsSchema', () => {
|
|
@@ -30,31 +29,31 @@ describe('Authorization Roles - Schema', () => {
|
|
|
30
29
|
permissions: [generatePermissionId(), generatePermissionId()],
|
|
31
30
|
users: [generateUserId(), generateUserId()],
|
|
32
31
|
};
|
|
33
|
-
const result = RoleAssociationsSchema(payload);
|
|
34
|
-
|
|
35
|
-
expect(result).toEqual({
|
|
32
|
+
const result = RoleAssociationsSchema.safeParse(payload);
|
|
33
|
+
// Parse succeeds for valid data
|
|
34
|
+
expect(result.data).toEqual({
|
|
36
35
|
apps: payload.apps,
|
|
37
36
|
permissions: payload.permissions,
|
|
38
37
|
users: payload.users,
|
|
39
38
|
});
|
|
40
39
|
});
|
|
41
40
|
test('should accept optional associations', () => {
|
|
42
|
-
const result = RoleAssociationsSchema({});
|
|
43
|
-
|
|
44
|
-
expect(result).toEqual({});
|
|
41
|
+
const result = RoleAssociationsSchema.safeParse({});
|
|
42
|
+
// Parse succeeds for valid data
|
|
43
|
+
expect(result.data).toEqual({});
|
|
45
44
|
});
|
|
46
45
|
test('should accept partial associations', () => {
|
|
47
|
-
const result = RoleAssociationsSchema({
|
|
46
|
+
const result = RoleAssociationsSchema.safeParse({
|
|
48
47
|
permissions: [generatePermissionId()],
|
|
49
48
|
users: undefined,
|
|
50
49
|
});
|
|
51
|
-
|
|
50
|
+
// Parse succeeds for valid data
|
|
52
51
|
});
|
|
53
52
|
test('should reject non-array associations', () => {
|
|
54
|
-
const result = RoleAssociationsSchema({
|
|
53
|
+
const result = RoleAssociationsSchema.safeParse({
|
|
55
54
|
apps: 'not-an-array',
|
|
56
55
|
});
|
|
57
|
-
expect(result).
|
|
56
|
+
expect(result.success).toBe(false);
|
|
58
57
|
});
|
|
59
58
|
});
|
|
60
59
|
describe('RoleSchema', () => {
|
|
@@ -71,8 +70,8 @@ describe('Authorization Roles - Schema', () => {
|
|
|
71
70
|
updatedAt: new Date(),
|
|
72
71
|
metadata: { key: 'value' },
|
|
73
72
|
};
|
|
74
|
-
const result = RoleSchema(role);
|
|
75
|
-
|
|
73
|
+
const result = RoleSchema.safeParse(role);
|
|
74
|
+
// Parse succeeds for valid data
|
|
76
75
|
});
|
|
77
76
|
test('should accept minimal role object', () => {
|
|
78
77
|
const role = {
|
|
@@ -83,8 +82,8 @@ describe('Authorization Roles - Schema', () => {
|
|
|
83
82
|
updatedAt: new Date(),
|
|
84
83
|
metadata: {},
|
|
85
84
|
};
|
|
86
|
-
const result = RoleSchema(role);
|
|
87
|
-
|
|
85
|
+
const result = RoleSchema.safeParse(role);
|
|
86
|
+
// Parse succeeds for valid data
|
|
88
87
|
});
|
|
89
88
|
test('should accept role with optional dates', () => {
|
|
90
89
|
const role = {
|
|
@@ -97,8 +96,8 @@ describe('Authorization Roles - Schema', () => {
|
|
|
97
96
|
deactivatedAt: new Date(),
|
|
98
97
|
metadata: {},
|
|
99
98
|
};
|
|
100
|
-
const result = RoleSchema(role);
|
|
101
|
-
|
|
99
|
+
const result = RoleSchema.safeParse(role);
|
|
100
|
+
// Parse succeeds for valid data
|
|
102
101
|
});
|
|
103
102
|
test('should reject invalid status', () => {
|
|
104
103
|
const role = {
|
|
@@ -109,16 +108,16 @@ describe('Authorization Roles - Schema', () => {
|
|
|
109
108
|
updatedAt: new Date(),
|
|
110
109
|
metadata: {},
|
|
111
110
|
};
|
|
112
|
-
const result = RoleSchema(role);
|
|
113
|
-
expect(result).
|
|
111
|
+
const result = RoleSchema.safeParse(role);
|
|
112
|
+
expect(result.success).toBe(false);
|
|
114
113
|
});
|
|
115
114
|
test('should reject missing required fields', () => {
|
|
116
115
|
const role = {
|
|
117
116
|
id: generateRoleId(),
|
|
118
117
|
name: 'admin',
|
|
119
118
|
};
|
|
120
|
-
const result = RoleSchema(role);
|
|
121
|
-
expect(result).
|
|
119
|
+
const result = RoleSchema.safeParse(role);
|
|
120
|
+
expect(result.success).toBe(false);
|
|
122
121
|
});
|
|
123
122
|
});
|
|
124
123
|
describe('InsertRolePayloadSchema', () => {
|
|
@@ -133,26 +132,26 @@ describe('Authorization Roles - Schema', () => {
|
|
|
133
132
|
users: [generateUserId()],
|
|
134
133
|
metadata: { key: 'value' },
|
|
135
134
|
};
|
|
136
|
-
const result = InsertRolePayloadSchema(payload);
|
|
137
|
-
|
|
135
|
+
const result = InsertRolePayloadSchema.safeParse(payload);
|
|
136
|
+
// Parse succeeds for valid data
|
|
138
137
|
});
|
|
139
138
|
test('should accept minimal insert payload', () => {
|
|
140
139
|
const payload = {
|
|
141
140
|
name: 'user',
|
|
142
141
|
};
|
|
143
|
-
const result = InsertRolePayloadSchema(payload);
|
|
144
|
-
|
|
145
|
-
expect(result.status).toBe('enabled'); // default value
|
|
142
|
+
const result = InsertRolePayloadSchema.safeParse(payload);
|
|
143
|
+
// Parse succeeds for valid data
|
|
144
|
+
expect(result.data?.status).toBe('enabled'); // default value
|
|
146
145
|
});
|
|
147
146
|
test('should generate default ID when not provided', () => {
|
|
148
147
|
const payload = { name: 'admin' };
|
|
149
|
-
const result = InsertRolePayloadSchema(payload);
|
|
150
|
-
|
|
151
|
-
expect(result.id).toMatch(/^rol_/);
|
|
148
|
+
const result = InsertRolePayloadSchema.safeParse(payload);
|
|
149
|
+
// Parse succeeds for valid data
|
|
150
|
+
expect(result.data?.id).toMatch(/^rol_/);
|
|
152
151
|
});
|
|
153
152
|
test('should reject missing name', () => {
|
|
154
|
-
const result = InsertRolePayloadSchema({});
|
|
155
|
-
expect(result).
|
|
153
|
+
const result = InsertRolePayloadSchema.safeParse({});
|
|
154
|
+
expect(result.success).toBe(false);
|
|
156
155
|
});
|
|
157
156
|
test('should accept associations in insert payload', () => {
|
|
158
157
|
const payload = {
|
|
@@ -161,8 +160,8 @@ describe('Authorization Roles - Schema', () => {
|
|
|
161
160
|
permissions: [generatePermissionId(), generatePermissionId()],
|
|
162
161
|
users: [generateUserId()],
|
|
163
162
|
};
|
|
164
|
-
const result = InsertRolePayloadSchema(payload);
|
|
165
|
-
|
|
163
|
+
const result = InsertRolePayloadSchema.safeParse(payload);
|
|
164
|
+
// Parse succeeds for valid data
|
|
166
165
|
});
|
|
167
166
|
});
|
|
168
167
|
describe('UpdateRolePayloadSchema', () => {
|
|
@@ -173,25 +172,25 @@ describe('Authorization Roles - Schema', () => {
|
|
|
173
172
|
description: 'Updated description',
|
|
174
173
|
metadata: { updated: true },
|
|
175
174
|
};
|
|
176
|
-
const result = UpdateRolePayloadSchema(payload);
|
|
177
|
-
|
|
178
|
-
expect(result).toEqual(payload);
|
|
175
|
+
const result = UpdateRolePayloadSchema.safeParse(payload);
|
|
176
|
+
// Parse succeeds for valid data
|
|
177
|
+
expect(result.data).toEqual(payload);
|
|
179
178
|
});
|
|
180
179
|
test('should accept empty update payload', () => {
|
|
181
|
-
const result = UpdateRolePayloadSchema({});
|
|
182
|
-
|
|
183
|
-
expect(result).toEqual({});
|
|
180
|
+
const result = UpdateRolePayloadSchema.safeParse({});
|
|
181
|
+
// Parse succeeds for valid data
|
|
182
|
+
expect(result.data).toEqual({});
|
|
184
183
|
});
|
|
185
184
|
test('should accept partial updates', () => {
|
|
186
185
|
const payload = { name: 'new-name' };
|
|
187
|
-
const result = UpdateRolePayloadSchema(payload);
|
|
188
|
-
|
|
189
|
-
expect(result).toEqual(payload);
|
|
186
|
+
const result = UpdateRolePayloadSchema.safeParse(payload);
|
|
187
|
+
// Parse succeeds for valid data
|
|
188
|
+
expect(result.data).toEqual(payload);
|
|
190
189
|
});
|
|
191
190
|
test('should reject invalid status', () => {
|
|
192
191
|
const payload = { status: 'invalid-status' };
|
|
193
|
-
const result = UpdateRolePayloadSchema(payload);
|
|
194
|
-
expect(result).
|
|
192
|
+
const result = UpdateRolePayloadSchema.safeParse(payload);
|
|
193
|
+
expect(result.success).toBe(false);
|
|
195
194
|
});
|
|
196
195
|
});
|
|
197
196
|
describe('RoleAssociationReferenceSchema', () => {
|
|
@@ -202,9 +201,9 @@ describe('Authorization Roles - Schema', () => {
|
|
|
202
201
|
status: 'enabled',
|
|
203
202
|
model: 'Role',
|
|
204
203
|
};
|
|
205
|
-
const result = RoleAssociationReferenceSchema(reference);
|
|
206
|
-
|
|
207
|
-
expect(result).toEqual(reference);
|
|
204
|
+
const result = RoleAssociationReferenceSchema.safeParse(reference);
|
|
205
|
+
// Parse succeeds for valid data
|
|
206
|
+
expect(result.data).toEqual(reference);
|
|
208
207
|
});
|
|
209
208
|
test('should use default status when not provided', () => {
|
|
210
209
|
const reference = {
|
|
@@ -212,14 +211,14 @@ describe('Authorization Roles - Schema', () => {
|
|
|
212
211
|
name: 'admin',
|
|
213
212
|
model: 'Role',
|
|
214
213
|
};
|
|
215
|
-
const result = RoleAssociationReferenceSchema(reference);
|
|
216
|
-
|
|
217
|
-
expect(result.status).toBe('disabled'); // default value
|
|
214
|
+
const result = RoleAssociationReferenceSchema.safeParse(reference);
|
|
215
|
+
// Parse succeeds for valid data
|
|
216
|
+
expect(result.data?.status).toBe('disabled'); // default value
|
|
218
217
|
});
|
|
219
218
|
test('should reject missing required fields', () => {
|
|
220
219
|
const reference = { id: generateRoleId() };
|
|
221
|
-
const result = RoleAssociationReferenceSchema(reference);
|
|
222
|
-
expect(result).
|
|
220
|
+
const result = RoleAssociationReferenceSchema.safeParse(reference);
|
|
221
|
+
expect(result.success).toBe(false);
|
|
223
222
|
});
|
|
224
223
|
test('should reject invalid model value', () => {
|
|
225
224
|
const reference = {
|
|
@@ -227,8 +226,8 @@ describe('Authorization Roles - Schema', () => {
|
|
|
227
226
|
name: 'admin',
|
|
228
227
|
model: 'InvalidModel',
|
|
229
228
|
};
|
|
230
|
-
const result = RoleAssociationReferenceSchema(reference);
|
|
231
|
-
expect(result).
|
|
229
|
+
const result = RoleAssociationReferenceSchema.safeParse(reference);
|
|
230
|
+
expect(result.success).toBe(false);
|
|
232
231
|
});
|
|
233
232
|
});
|
|
234
233
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
export declare const Model: {
|
|
2
3
|
readonly Permission: {
|
|
3
4
|
readonly UIDPrefix: "per";
|
|
@@ -8,10 +9,10 @@ export declare const Model: {
|
|
|
8
9
|
};
|
|
9
10
|
export declare function generatePermissionId(): string;
|
|
10
11
|
export declare function generateRoleId(): string;
|
|
11
|
-
export declare const RoleIdSchema:
|
|
12
|
-
export type RoleId = typeof RoleIdSchema
|
|
13
|
-
export declare const RoleIdAssociationsSchema:
|
|
14
|
-
export declare const PermissionIdSchema:
|
|
15
|
-
export type PermissionId = typeof PermissionIdSchema
|
|
16
|
-
export declare const PermissionIdAssociationsSchema:
|
|
12
|
+
export declare const RoleIdSchema: z.ZodString;
|
|
13
|
+
export type RoleId = z.output<typeof RoleIdSchema>;
|
|
14
|
+
export declare const RoleIdAssociationsSchema: z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodString>]>;
|
|
15
|
+
export declare const PermissionIdSchema: z.ZodString;
|
|
16
|
+
export type PermissionId = z.output<typeof PermissionIdSchema>;
|
|
17
|
+
export declare const PermissionIdAssociationsSchema: z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodString>]>;
|
|
17
18
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/authorization/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/authorization/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,KAAK;;;;;;;CAOR,CAAC;AAEX,wBAAgB,oBAAoB,WAEnC;AAED,wBAAgB,cAAc,WAE7B;AAED,eAAO,MAAM,YAAY,aAAoC,CAAC;AAC9D,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,YAAY,CAAC,CAAC;AAEnD,eAAO,MAAM,wBAAwB,gEAGnC,CAAC;AAEH,eAAO,MAAM,kBAAkB,aAA0C,CAAC;AAC1E,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE/D,eAAO,MAAM,8BAA8B,gEAGzC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
import KSUID from 'ksuid';
|
|
3
3
|
import { KSUIDSchema } from '../common/schema/id.js';
|
|
4
4
|
export const Model = {
|
|
@@ -16,6 +16,12 @@ export function generateRoleId() {
|
|
|
16
16
|
return `${Model.Role.UIDPrefix}_${KSUID.randomSync().string}`;
|
|
17
17
|
}
|
|
18
18
|
export const RoleIdSchema = KSUIDSchema(Model.Role.UIDPrefix);
|
|
19
|
-
export const RoleIdAssociationsSchema =
|
|
19
|
+
export const RoleIdAssociationsSchema = z.union([
|
|
20
|
+
z.undefined(),
|
|
21
|
+
z.array(RoleIdSchema),
|
|
22
|
+
]);
|
|
20
23
|
export const PermissionIdSchema = KSUIDSchema(Model.Permission.UIDPrefix);
|
|
21
|
-
export const PermissionIdAssociationsSchema =
|
|
24
|
+
export const PermissionIdAssociationsSchema = z.union([
|
|
25
|
+
z.undefined(),
|
|
26
|
+
z.array(PermissionIdSchema),
|
|
27
|
+
]);
|