@go-mondo/identity-sdk 0.0.2-beta.9 → 0.0.2-beta.92
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/.github/workflows/release.yaml +1 -1
- package/.release-please-manifest.json +1 -1
- package/.tsbuildinfo/cjs.json +1 -1
- package/.tsbuildinfo/esm.json +1 -1
- package/CHANGELOG.md +582 -0
- package/README.md +384 -2
- package/dist/cjs/action/schema/base.d.ts +21 -21
- package/dist/cjs/action/schema/base.d.ts.map +1 -1
- package/dist/cjs/action/schema/base.js +48 -10
- package/dist/cjs/action/schema/base.test.js +50 -35
- 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 +41 -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 +57 -15
- package/dist/cjs/action/schema/operations/sign-up.test.js +40 -35
- 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 +39 -5
- package/dist/cjs/action/schema/operations/user-attribute-verification.test.js +25 -26
- package/dist/cjs/action/schema/schema.d.ts +49 -77
- package/dist/cjs/action/schema/schema.d.ts.map +1 -1
- package/dist/cjs/action/schema/schema.js +7 -5
- package/dist/cjs/action/schema/schema.test.js +31 -58
- package/dist/cjs/activity/resources.d.ts +3 -3
- package/dist/cjs/activity/resources.d.ts.map +1 -1
- package/dist/cjs/activity/resources.js +2 -2
- package/dist/cjs/activity/resources.test.js +14 -13
- 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 +71 -26
- 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 +49 -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 +49 -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 +53 -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 +52 -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 +45 -6
- package/dist/cjs/activity/schema/types/unknown.test.js +29 -30
- package/dist/cjs/app/authorization/resources.d.ts +4 -4
- package/dist/cjs/app/authorization/resources.d.ts.map +1 -1
- package/dist/cjs/app/authorization/resources.js +2 -6
- package/dist/cjs/app/authorization/schema.d.ts +90 -52
- package/dist/cjs/app/authorization/schema.d.ts.map +1 -1
- package/dist/cjs/app/authorization/schema.js +90 -65
- package/dist/cjs/app/authorization/schema.test.js +155 -74
- package/dist/cjs/app/oauth/resources.d.ts +4 -4
- 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 +56 -17
- package/dist/cjs/app/oauth/schema.test.js +39 -40
- package/dist/cjs/app/oidc/resources.d.ts +6 -6
- 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 +50 -13
- package/dist/cjs/app/oidc/schema.test.js +46 -27
- package/dist/cjs/app/registration/resources.d.ts +4 -4
- 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/resources.test.js +14 -13
- 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 +56 -16
- package/dist/cjs/app/registration/schema.test.js +68 -150
- package/dist/cjs/app/resources.d.ts +7 -7
- package/dist/cjs/app/resources.d.ts.map +1 -1
- package/dist/cjs/app/resources.js +6 -6
- package/dist/cjs/app/resources.test.js +14 -13
- package/dist/cjs/app/saml/resources.d.ts +6 -6
- 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 +50 -13
- 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 +76 -35
- package/dist/cjs/app/schema.test.js +128 -42
- package/dist/cjs/association/resources.d.ts +5 -5
- package/dist/cjs/association/resources.d.ts.map +1 -1
- package/dist/cjs/association/resources.js +4 -6
- package/dist/cjs/association/schema.d.ts +270 -182
- package/dist/cjs/association/schema.d.ts.map +1 -1
- package/dist/cjs/association/schema.js +70 -32
- package/dist/cjs/association/schema.test.js +13 -54
- package/dist/cjs/authentication/factors/schema.d.ts +39 -49
- package/dist/cjs/authentication/factors/schema.d.ts.map +1 -1
- package/dist/cjs/authentication/factors/schema.js +59 -20
- package/dist/cjs/authentication/factors/schema.test.js +33 -34
- package/dist/cjs/authentication/index.d.ts +1 -0
- package/dist/cjs/authentication/index.d.ts.map +1 -1
- package/dist/cjs/authentication/index.js +2 -0
- 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 +44 -9
- package/dist/cjs/authentication/sessions/resources.d.ts +4 -4
- package/dist/cjs/authentication/sessions/resources.d.ts.map +1 -1
- package/dist/cjs/authentication/sessions/resources.js +3 -3
- package/dist/cjs/authentication/sessions/schema.d.ts +96 -74
- package/dist/cjs/authentication/sessions/schema.d.ts.map +1 -1
- package/dist/cjs/authentication/sessions/schema.js +99 -33
- package/dist/cjs/authentication/sessions/schema.test.d.ts +2 -0
- package/dist/cjs/authentication/sessions/schema.test.d.ts.map +1 -0
- package/dist/cjs/authentication/sessions/schema.test.js +65 -0
- package/dist/cjs/authentication/settings/resources.d.ts +4 -4
- 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 +45 -62
- package/dist/cjs/authentication/settings/schema.d.ts.map +1 -1
- package/dist/cjs/authentication/settings/schema.js +49 -14
- package/dist/cjs/authentication/settings/schema.test.js +409 -22
- package/dist/cjs/authentication/strategies/resources.d.ts +9 -8
- package/dist/cjs/authentication/strategies/resources.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/resources.js +11 -11
- package/dist/cjs/authentication/strategies/schema/base.d.ts +59 -53
- package/dist/cjs/authentication/strategies/schema/base.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/schema/base.js +68 -24
- package/dist/cjs/authentication/strategies/schema/schema.d.ts +126 -200
- package/dist/cjs/authentication/strategies/schema/schema.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/schema/schema.js +39 -6
- package/dist/cjs/authentication/strategies/schema/types/email.d.ts +62 -61
- package/dist/cjs/authentication/strategies/schema/types/email.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/schema/types/email.js +59 -16
- package/dist/cjs/authentication/strategies/schema/types/email.test.js +49 -49
- package/dist/cjs/authentication/strategies/schema/types/totp.d.ts +108 -95
- package/dist/cjs/authentication/strategies/schema/types/totp.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/schema/types/totp.js +83 -26
- package/dist/cjs/authorization/permissions/resources.d.ts +7 -7
- package/dist/cjs/authorization/permissions/resources.d.ts.map +1 -1
- package/dist/cjs/authorization/permissions/resources.js +6 -6
- 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 +78 -37
- package/dist/cjs/authorization/permissions/schema.test.js +54 -62
- package/dist/cjs/authorization/roles/resources.d.ts +7 -7
- package/dist/cjs/authorization/roles/resources.d.ts.map +1 -1
- package/dist/cjs/authorization/roles/resources.js +6 -6
- 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 +74 -38
- package/dist/cjs/authorization/roles/schema.test.js +55 -62
- 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 +42 -3
- package/dist/cjs/common/index.d.ts +2 -0
- package/dist/cjs/common/index.d.ts.map +1 -1
- package/dist/cjs/common/resources/authorization.d.ts +18 -1
- package/dist/cjs/common/resources/authorization.d.ts.map +1 -1
- package/dist/cjs/common/resources/authorization.js +6 -0
- package/dist/cjs/common/resources/init.d.ts +28 -11
- package/dist/cjs/common/resources/init.d.ts.map +1 -1
- package/dist/cjs/common/resources/init.js +81 -21
- package/dist/cjs/common/resources/init.test.js +62 -38
- package/dist/cjs/common/resources/operations.d.ts +7 -6
- package/dist/cjs/common/resources/operations.d.ts.map +1 -1
- package/dist/cjs/common/resources/operations.js +44 -21
- package/dist/cjs/common/resources/operations.test.js +47 -17
- 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 +2 -31
- 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 +37 -4
- package/dist/cjs/common/schema/aggregate.test.js +21 -22
- package/dist/cjs/common/schema/collection.d.ts +13 -14
- package/dist/cjs/common/schema/collection.d.ts.map +1 -1
- package/dist/cjs/common/schema/collection.js +40 -5
- package/dist/cjs/common/schema/collection.test.js +99 -48
- package/dist/cjs/common/schema/dates.d.ts +43 -26
- package/dist/cjs/common/schema/dates.d.ts.map +1 -1
- package/dist/cjs/common/schema/dates.js +63 -12
- 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 +35 -2
- package/dist/cjs/common/schema/id.test.js +70 -38
- package/dist/cjs/common/schema/jwt.d.ts +22 -14
- package/dist/cjs/common/schema/jwt.d.ts.map +1 -1
- package/dist/cjs/common/schema/jwt.js +37 -8
- package/dist/cjs/common/schema/jwt.test.js +22 -25
- package/dist/cjs/common/schema/metadata.d.ts +86 -49
- package/dist/cjs/common/schema/metadata.d.ts.map +1 -1
- package/dist/cjs/common/schema/metadata.js +154 -75
- package/dist/cjs/common/schema/metadata.test.js +198 -67
- package/dist/cjs/common/schema/pagination.d.ts +15 -5
- package/dist/cjs/common/schema/pagination.d.ts.map +1 -1
- package/dist/cjs/common/schema/pagination.js +46 -4
- package/dist/cjs/common/schema/pagination.test.js +55 -36
- 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 +28 -5
- package/dist/cjs/common/schema/schema.test.js +42 -15
- package/dist/cjs/common/schema/sets.d.ts +6 -2
- package/dist/cjs/common/schema/sets.d.ts.map +1 -1
- package/dist/cjs/common/schema/sets.js +50 -7
- package/dist/cjs/common/schema/url.d.ts +21 -0
- package/dist/cjs/common/schema/url.d.ts.map +1 -1
- package/dist/cjs/common/schema/url.js +79 -0
- package/dist/cjs/common/schema/url.test.js +10 -0
- package/dist/cjs/customer/organization/schema.d.ts +59 -46
- package/dist/cjs/customer/organization/schema.d.ts.map +1 -1
- package/dist/cjs/customer/organization/schema.js +76 -26
- 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 +42 -3
- package/dist/cjs/customer/users/resources.d.ts +7 -7
- package/dist/cjs/customer/users/resources.d.ts.map +1 -1
- package/dist/cjs/customer/users/resources.js +6 -6
- package/dist/cjs/customer/users/schema.d.ts +213 -104
- package/dist/cjs/customer/users/schema.d.ts.map +1 -1
- package/dist/cjs/customer/users/schema.js +145 -56
- package/dist/cjs/customer/users/schema.test.js +600 -60
- 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 +38 -2
- package/dist/cjs/identity/schema.test.js +21 -16
- package/dist/cjs/oauth/authorize/schema/grants/authorization-code.d.ts +34 -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 +93 -38
- package/dist/cjs/oauth/authorize/schema/grants/authorization-code.test.js +47 -48
- package/dist/cjs/oauth/authorize/schema/grants/common.d.ts +6 -0
- package/dist/cjs/oauth/authorize/schema/grants/common.d.ts.map +1 -0
- package/dist/cjs/oauth/authorize/schema/grants/common.js +47 -0
- package/dist/cjs/oauth/authorize/schema/grants/implicit.d.ts +18 -10
- package/dist/cjs/oauth/authorize/schema/grants/implicit.d.ts.map +1 -1
- package/dist/cjs/oauth/authorize/schema/grants/implicit.js +56 -11
- package/dist/cjs/oauth/authorize/schema/schema.d.ts +48 -36
- package/dist/cjs/oauth/authorize/schema/schema.d.ts.map +1 -1
- package/dist/cjs/oauth/authorize/schema/schema.js +4 -2
- package/dist/cjs/oauth/common/schema.d.ts +24 -7
- package/dist/cjs/oauth/common/schema.d.ts.map +1 -1
- package/dist/cjs/oauth/common/schema.js +59 -8
- package/dist/cjs/oauth/common/schema.test.js +22 -30
- package/dist/cjs/oauth/index.d.ts +3 -3
- package/dist/cjs/oauth/index.d.ts.map +1 -1
- package/dist/cjs/oauth/index.js +8 -25
- package/dist/cjs/oauth/token/schema/grants/authorization-code.d.ts +16 -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 +66 -12
- package/dist/cjs/oauth/token/schema/grants/client-credentials.d.ts +16 -17
- package/dist/cjs/oauth/token/schema/grants/client-credentials.d.ts.map +1 -1
- package/dist/cjs/oauth/token/schema/grants/client-credentials.js +53 -16
- package/dist/cjs/oauth/token/schema/grants/common.d.ts +6 -0
- package/dist/cjs/oauth/token/schema/grants/common.d.ts.map +1 -0
- package/dist/cjs/oauth/token/schema/grants/common.js +52 -0
- package/dist/cjs/oauth/token/schema/grants/refresh-token.d.ts +15 -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 +57 -11
- package/dist/cjs/oauth/token/schema/schema.d.ts +48 -21
- package/dist/cjs/oauth/token/schema/schema.d.ts.map +1 -1
- package/dist/cjs/oauth/token/schema/schema.js +79 -2
- package/dist/cjs/oauth/token/schema/schema.test.js +44 -28
- package/dist/cjs/workspace/authorization/schema.d.ts +62 -27
- package/dist/cjs/workspace/authorization/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/authorization/schema.js +58 -13
- package/dist/cjs/workspace/branding/schema.d.ts +47 -37
- package/dist/cjs/workspace/branding/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/branding/schema.js +61 -16
- package/dist/cjs/workspace/membership/schema.d.ts +42 -20
- package/dist/cjs/workspace/membership/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/membership/schema.js +47 -7
- package/dist/cjs/workspace/registration/schema.d.ts +41 -27
- package/dist/cjs/workspace/registration/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/registration/schema.js +63 -14
- package/dist/cjs/workspace/settings/schema.d.ts +20 -19
- package/dist/cjs/workspace/settings/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/settings/schema.js +48 -8
- package/dist/cjs/workspace/settings/schema.test.js +18 -19
- package/dist/cjs/workspace/tenant/schema.d.ts +88 -57
- package/dist/cjs/workspace/tenant/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/tenant/schema.js +59 -13
- package/dist/cjs/workspace/tenant/schema.test.d.ts +2 -0
- package/dist/cjs/workspace/tenant/schema.test.d.ts.map +1 -0
- package/dist/cjs/workspace/tenant/schema.test.js +235 -0
- package/dist/cjs/workspace/user/notifications/schema.d.ts +70 -56
- package/dist/cjs/workspace/user/notifications/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/user/notifications/schema.js +76 -30
- package/dist/cjs/workspace/user/preferences/schema.d.ts +29 -25
- package/dist/cjs/workspace/user/preferences/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/user/preferences/schema.js +57 -12
- package/dist/esm/action/schema/base.d.ts +21 -21
- package/dist/esm/action/schema/base.d.ts.map +1 -1
- package/dist/esm/action/schema/base.js +17 -12
- package/dist/esm/action/schema/base.test.js +51 -36
- 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 +40 -35
- 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 +49 -77
- package/dist/esm/action/schema/schema.d.ts.map +1 -1
- package/dist/esm/action/schema/schema.js +7 -5
- package/dist/esm/action/schema/schema.test.js +24 -51
- package/dist/esm/activity/resources.d.ts +3 -3
- package/dist/esm/activity/resources.d.ts.map +1 -1
- package/dist/esm/activity/resources.js +4 -4
- package/dist/esm/activity/resources.test.js +14 -13
- 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 +38 -26
- 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 +4 -4
- package/dist/esm/app/authorization/resources.d.ts.map +1 -1
- package/dist/esm/app/authorization/resources.js +3 -7
- package/dist/esm/app/authorization/schema.d.ts +90 -52
- package/dist/esm/app/authorization/schema.d.ts.map +1 -1
- package/dist/esm/app/authorization/schema.js +58 -66
- package/dist/esm/app/authorization/schema.test.js +155 -74
- package/dist/esm/app/oauth/resources.d.ts +4 -4
- package/dist/esm/app/oauth/resources.d.ts.map +1 -1
- package/dist/esm/app/oauth/resources.js +3 -4
- 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 +25 -19
- package/dist/esm/app/oauth/schema.test.js +39 -40
- package/dist/esm/app/oidc/resources.d.ts +6 -6
- package/dist/esm/app/oidc/resources.d.ts.map +1 -1
- package/dist/esm/app/oidc/resources.js +5 -6
- 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 +19 -15
- package/dist/esm/app/oidc/schema.test.js +46 -27
- package/dist/esm/app/registration/resources.d.ts +4 -4
- package/dist/esm/app/registration/resources.d.ts.map +1 -1
- package/dist/esm/app/registration/resources.js +3 -4
- package/dist/esm/app/registration/resources.test.js +14 -13
- 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 +25 -18
- package/dist/esm/app/registration/schema.test.js +68 -150
- package/dist/esm/app/resources.d.ts +7 -7
- package/dist/esm/app/resources.d.ts.map +1 -1
- package/dist/esm/app/resources.js +8 -8
- package/dist/esm/app/resources.test.js +14 -13
- package/dist/esm/app/saml/resources.d.ts +6 -6
- package/dist/esm/app/saml/resources.d.ts.map +1 -1
- package/dist/esm/app/saml/resources.js +5 -6
- 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 +19 -15
- 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 +45 -37
- package/dist/esm/app/schema.test.js +129 -43
- package/dist/esm/association/resources.d.ts +5 -5
- package/dist/esm/association/resources.d.ts.map +1 -1
- package/dist/esm/association/resources.js +6 -8
- package/dist/esm/association/schema.d.ts +270 -182
- package/dist/esm/association/schema.d.ts.map +1 -1
- package/dist/esm/association/schema.js +36 -31
- package/dist/esm/association/schema.test.js +14 -55
- package/dist/esm/authentication/factors/schema.d.ts +39 -49
- package/dist/esm/authentication/factors/schema.d.ts.map +1 -1
- package/dist/esm/authentication/factors/schema.js +26 -20
- package/dist/esm/authentication/factors/schema.test.js +33 -34
- package/dist/esm/authentication/index.d.ts +1 -0
- package/dist/esm/authentication/index.d.ts.map +1 -1
- package/dist/esm/authentication/index.js +2 -0
- 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 +13 -11
- package/dist/esm/authentication/sessions/resources.d.ts +4 -4
- package/dist/esm/authentication/sessions/resources.d.ts.map +1 -1
- package/dist/esm/authentication/sessions/resources.js +5 -5
- package/dist/esm/authentication/sessions/schema.d.ts +96 -74
- package/dist/esm/authentication/sessions/schema.d.ts.map +1 -1
- package/dist/esm/authentication/sessions/schema.js +67 -34
- package/dist/esm/authentication/sessions/schema.test.d.ts +2 -0
- package/dist/esm/authentication/sessions/schema.test.d.ts.map +1 -0
- package/dist/esm/authentication/sessions/schema.test.js +63 -0
- package/dist/esm/authentication/settings/resources.d.ts +4 -4
- package/dist/esm/authentication/settings/resources.d.ts.map +1 -1
- package/dist/esm/authentication/settings/resources.js +3 -4
- package/dist/esm/authentication/settings/schema.d.ts +45 -62
- package/dist/esm/authentication/settings/schema.d.ts.map +1 -1
- package/dist/esm/authentication/settings/schema.js +18 -16
- package/dist/esm/authentication/settings/schema.test.js +409 -22
- package/dist/esm/authentication/strategies/resources.d.ts +9 -8
- package/dist/esm/authentication/strategies/resources.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/resources.js +13 -13
- package/dist/esm/authentication/strategies/schema/base.d.ts +59 -53
- package/dist/esm/authentication/strategies/schema/base.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/schema/base.js +36 -25
- package/dist/esm/authentication/strategies/schema/schema.d.ts +126 -200
- package/dist/esm/authentication/strategies/schema/schema.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/schema/schema.js +17 -6
- package/dist/esm/authentication/strategies/schema/types/email.d.ts +62 -61
- package/dist/esm/authentication/strategies/schema/types/email.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/schema/types/email.js +25 -15
- package/dist/esm/authentication/strategies/schema/types/email.test.js +49 -49
- package/dist/esm/authentication/strategies/schema/types/totp.d.ts +108 -95
- package/dist/esm/authentication/strategies/schema/types/totp.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/schema/types/totp.js +51 -27
- package/dist/esm/authorization/permissions/resources.d.ts +7 -7
- package/dist/esm/authorization/permissions/resources.d.ts.map +1 -1
- package/dist/esm/authorization/permissions/resources.js +8 -8
- 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 +47 -39
- package/dist/esm/authorization/permissions/schema.test.js +54 -62
- package/dist/esm/authorization/roles/resources.d.ts +7 -7
- package/dist/esm/authorization/roles/resources.d.ts.map +1 -1
- package/dist/esm/authorization/roles/resources.js +8 -8
- 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 +43 -40
- package/dist/esm/authorization/roles/schema.test.js +55 -62
- 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/index.d.ts +2 -0
- package/dist/esm/common/index.d.ts.map +1 -1
- package/dist/esm/common/resources/authorization.d.ts +18 -1
- package/dist/esm/common/resources/authorization.d.ts.map +1 -1
- package/dist/esm/common/resources/authorization.js +5 -1
- package/dist/esm/common/resources/init.d.ts +28 -11
- package/dist/esm/common/resources/init.d.ts.map +1 -1
- package/dist/esm/common/resources/init.js +47 -21
- package/dist/esm/common/resources/init.test.js +63 -39
- package/dist/esm/common/resources/operations.d.ts +7 -6
- package/dist/esm/common/resources/operations.d.ts.map +1 -1
- package/dist/esm/common/resources/operations.js +41 -19
- package/dist/esm/common/resources/operations.test.js +48 -18
- 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 +3 -32
- 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 +13 -14
- package/dist/esm/common/schema/collection.d.ts.map +1 -1
- package/dist/esm/common/schema/collection.js +5 -5
- package/dist/esm/common/schema/collection.test.js +66 -48
- package/dist/esm/common/schema/dates.d.ts +43 -26
- package/dist/esm/common/schema/dates.d.ts.map +1 -1
- package/dist/esm/common/schema/dates.js +29 -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 +22 -14
- package/dist/esm/common/schema/jwt.d.ts.map +1 -1
- package/dist/esm/common/schema/jwt.js +3 -7
- package/dist/esm/common/schema/jwt.test.js +22 -25
- package/dist/esm/common/schema/metadata.d.ts +86 -49
- package/dist/esm/common/schema/metadata.d.ts.map +1 -1
- package/dist/esm/common/schema/metadata.js +120 -74
- package/dist/esm/common/schema/metadata.test.js +199 -68
- package/dist/esm/common/schema/pagination.d.ts +15 -5
- package/dist/esm/common/schema/pagination.d.ts.map +1 -1
- package/dist/esm/common/schema/pagination.js +13 -4
- package/dist/esm/common/schema/pagination.test.js +55 -36
- 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 +6 -2
- package/dist/esm/common/schema/sets.d.ts.map +1 -1
- package/dist/esm/common/schema/sets.js +16 -6
- package/dist/esm/common/schema/url.d.ts +21 -0
- package/dist/esm/common/schema/url.d.ts.map +1 -1
- package/dist/esm/common/schema/url.js +45 -0
- package/dist/esm/common/schema/url.test.js +11 -1
- package/dist/esm/customer/organization/schema.d.ts +59 -46
- package/dist/esm/customer/organization/schema.d.ts.map +1 -1
- package/dist/esm/customer/organization/schema.js +43 -26
- 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 +7 -7
- package/dist/esm/customer/users/resources.d.ts.map +1 -1
- package/dist/esm/customer/users/resources.js +8 -8
- package/dist/esm/customer/users/schema.d.ts +213 -104
- package/dist/esm/customer/users/schema.d.ts.map +1 -1
- package/dist/esm/customer/users/schema.js +111 -55
- package/dist/esm/customer/users/schema.test.js +601 -61
- 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 +34 -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 +60 -38
- package/dist/esm/oauth/authorize/schema/grants/authorization-code.test.js +48 -49
- package/dist/esm/oauth/authorize/schema/grants/common.d.ts +6 -0
- package/dist/esm/oauth/authorize/schema/grants/common.d.ts.map +1 -0
- package/dist/esm/oauth/authorize/schema/grants/common.js +11 -0
- package/dist/esm/oauth/authorize/schema/grants/implicit.d.ts +18 -10
- package/dist/esm/oauth/authorize/schema/grants/implicit.d.ts.map +1 -1
- package/dist/esm/oauth/authorize/schema/grants/implicit.js +22 -10
- package/dist/esm/oauth/authorize/schema/schema.d.ts +48 -36
- package/dist/esm/oauth/authorize/schema/schema.d.ts.map +1 -1
- package/dist/esm/oauth/authorize/schema/schema.js +4 -3
- package/dist/esm/oauth/common/schema.d.ts +24 -7
- package/dist/esm/oauth/common/schema.d.ts.map +1 -1
- package/dist/esm/oauth/common/schema.js +25 -7
- package/dist/esm/oauth/common/schema.test.js +23 -31
- package/dist/esm/oauth/index.d.ts +3 -3
- package/dist/esm/oauth/index.d.ts.map +1 -1
- package/dist/esm/oauth/index.js +3 -3
- package/dist/esm/oauth/token/schema/grants/authorization-code.d.ts +16 -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 +32 -11
- package/dist/esm/oauth/token/schema/grants/client-credentials.d.ts +16 -17
- package/dist/esm/oauth/token/schema/grants/client-credentials.d.ts.map +1 -1
- package/dist/esm/oauth/token/schema/grants/client-credentials.js +19 -15
- package/dist/esm/oauth/token/schema/grants/common.d.ts +6 -0
- package/dist/esm/oauth/token/schema/grants/common.d.ts.map +1 -0
- package/dist/esm/oauth/token/schema/grants/common.js +16 -0
- package/dist/esm/oauth/token/schema/grants/refresh-token.d.ts +15 -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 +23 -10
- package/dist/esm/oauth/token/schema/schema.d.ts +48 -21
- package/dist/esm/oauth/token/schema/schema.d.ts.map +1 -1
- package/dist/esm/oauth/token/schema/schema.js +59 -4
- package/dist/esm/oauth/token/schema/schema.test.js +45 -29
- package/dist/esm/workspace/authorization/schema.d.ts +62 -27
- package/dist/esm/workspace/authorization/schema.d.ts.map +1 -1
- package/dist/esm/workspace/authorization/schema.js +27 -15
- package/dist/esm/workspace/branding/schema.d.ts +47 -37
- package/dist/esm/workspace/branding/schema.d.ts.map +1 -1
- package/dist/esm/workspace/branding/schema.js +29 -17
- package/dist/esm/workspace/membership/schema.d.ts +42 -20
- package/dist/esm/workspace/membership/schema.d.ts.map +1 -1
- package/dist/esm/workspace/membership/schema.js +14 -7
- package/dist/esm/workspace/registration/schema.d.ts +41 -27
- package/dist/esm/workspace/registration/schema.d.ts.map +1 -1
- package/dist/esm/workspace/registration/schema.js +32 -16
- package/dist/esm/workspace/settings/schema.d.ts +20 -19
- package/dist/esm/workspace/settings/schema.d.ts.map +1 -1
- package/dist/esm/workspace/settings/schema.js +16 -9
- package/dist/esm/workspace/settings/schema.test.js +18 -19
- package/dist/esm/workspace/tenant/schema.d.ts +88 -57
- package/dist/esm/workspace/tenant/schema.d.ts.map +1 -1
- package/dist/esm/workspace/tenant/schema.js +26 -13
- package/dist/esm/workspace/tenant/schema.test.d.ts +2 -0
- package/dist/esm/workspace/tenant/schema.test.d.ts.map +1 -0
- package/dist/esm/workspace/tenant/schema.test.js +233 -0
- package/dist/esm/workspace/user/notifications/schema.d.ts +70 -56
- package/dist/esm/workspace/user/notifications/schema.d.ts.map +1 -1
- package/dist/esm/workspace/user/notifications/schema.js +42 -29
- package/dist/esm/workspace/user/preferences/schema.d.ts +29 -25
- package/dist/esm/workspace/user/preferences/schema.d.ts.map +1 -1
- package/dist/esm/workspace/user/preferences/schema.js +25 -13
- package/package.json +3 -3
- package/dist/cjs/action/schema/operations/set-password.d.ts +0 -31
- package/dist/cjs/action/schema/operations/set-password.d.ts.map +0 -1
- package/dist/cjs/action/schema/operations/set-password.js +0 -18
- package/dist/cjs/action/schema/operations/set-password.test.d.ts +0 -2
- package/dist/cjs/action/schema/operations/set-password.test.d.ts.map +0 -1
- package/dist/cjs/action/schema/operations/set-password.test.js +0 -167
- package/dist/cjs/authentication/strategies/schema/types/password.d.ts +0 -132
- package/dist/cjs/authentication/strategies/schema/types/password.d.ts.map +0 -1
- package/dist/cjs/authentication/strategies/schema/types/password.js +0 -52
- package/dist/cjs/common/schema/sets.test.d.ts +0 -2
- package/dist/cjs/common/schema/sets.test.d.ts.map +0 -1
- package/dist/cjs/common/schema/sets.test.js +0 -84
- package/dist/esm/action/schema/operations/set-password.d.ts +0 -31
- package/dist/esm/action/schema/operations/set-password.d.ts.map +0 -1
- package/dist/esm/action/schema/operations/set-password.js +0 -15
- package/dist/esm/action/schema/operations/set-password.test.d.ts +0 -2
- package/dist/esm/action/schema/operations/set-password.test.d.ts.map +0 -1
- package/dist/esm/action/schema/operations/set-password.test.js +0 -165
- package/dist/esm/authentication/strategies/schema/types/password.d.ts +0 -132
- package/dist/esm/authentication/strategies/schema/types/password.d.ts.map +0 -1
- package/dist/esm/authentication/strategies/schema/types/password.js +0 -49
- package/dist/esm/common/schema/sets.test.d.ts +0 -2
- package/dist/esm/common/schema/sets.test.d.ts.map +0 -1
- package/dist/esm/common/schema/sets.test.js +0 -82
|
@@ -1,39 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
export
|
|
4
|
-
export type
|
|
5
|
-
export type
|
|
6
|
-
export type
|
|
7
|
-
export
|
|
8
|
-
export declare const
|
|
9
|
-
export
|
|
10
|
-
export type
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
export declare const RequiredDateSchema: z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>;
|
|
3
|
+
export declare const OptionalDateSchema: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>;
|
|
4
|
+
export type AnyRequiredDateType = z.input<typeof RequiredDateSchema>;
|
|
5
|
+
export type RequiredDate = z.output<typeof RequiredDateSchema>;
|
|
6
|
+
export type AnyOptionalDate = z.input<typeof OptionalDateSchema>;
|
|
7
|
+
export type OptionalDate = z.output<typeof OptionalDateSchema>;
|
|
8
|
+
export declare const RequiredDatePayloadSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>, z.ZodTransform<string, Date>>;
|
|
9
|
+
export declare const OptionalDatePayloadSchema: 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>>>;
|
|
10
|
+
export type RequiredDatePayload = z.output<typeof RequiredDatePayloadSchema>;
|
|
11
|
+
export type OptionalDatePayload = z.output<typeof OptionalDatePayloadSchema>;
|
|
11
12
|
/**
|
|
12
13
|
* Created At
|
|
13
14
|
*/
|
|
14
|
-
export declare const CreatedAtPropertyPayloadSchema:
|
|
15
|
-
createdAt:
|
|
16
|
-
},
|
|
17
|
-
export type CreatedAtPropertyPayload = typeof CreatedAtPropertyPayloadSchema
|
|
15
|
+
export declare const CreatedAtPropertyPayloadSchema: z.ZodObject<{
|
|
16
|
+
createdAt: z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>, z.ZodTransform<string, Date>>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export type CreatedAtPropertyPayload = z.output<typeof CreatedAtPropertyPayloadSchema>;
|
|
19
|
+
export declare const CreatedAtPropertySchema: z.ZodObject<{
|
|
20
|
+
createdAt: z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export type CreatedAtProperty = z.output<typeof CreatedAtPropertySchema>;
|
|
18
23
|
/**
|
|
19
24
|
* Updated At
|
|
20
25
|
*/
|
|
21
|
-
export declare const UpdatedAtPropertyPayloadSchema:
|
|
22
|
-
updatedAt:
|
|
23
|
-
},
|
|
24
|
-
export type UpdatedAtPropertyPayload = typeof UpdatedAtPropertyPayloadSchema
|
|
26
|
+
export declare const UpdatedAtPropertyPayloadSchema: z.ZodObject<{
|
|
27
|
+
updatedAt: z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>, z.ZodTransform<string, Date>>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
export type UpdatedAtPropertyPayload = z.output<typeof UpdatedAtPropertyPayloadSchema>;
|
|
30
|
+
export declare const UpdatedAtPropertySchema: z.ZodObject<{
|
|
31
|
+
updatedAt: z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
export type UpdatedAtProperty = z.output<typeof UpdatedAtPropertySchema>;
|
|
25
34
|
/**
|
|
26
35
|
* Deleted At
|
|
27
36
|
*/
|
|
28
|
-
export declare const DeletedAtPropertyPayloadSchema:
|
|
29
|
-
deletedAt
|
|
30
|
-
},
|
|
31
|
-
export type DeletedAtPropertyPayload = typeof DeletedAtPropertyPayloadSchema
|
|
37
|
+
export declare const DeletedAtPropertyPayloadSchema: z.ZodObject<{
|
|
38
|
+
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>>>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
export type DeletedAtPropertyPayload = z.output<typeof DeletedAtPropertyPayloadSchema>;
|
|
41
|
+
export declare const DeletedAtPropertySchema: z.ZodObject<{
|
|
42
|
+
deletedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
export type DeletedAtProperty = z.output<typeof DeletedAtPropertySchema>;
|
|
32
45
|
/**
|
|
33
46
|
* Deactivated At
|
|
34
47
|
*/
|
|
35
|
-
export declare const DeactivatedAtPropertyPayloadSchema:
|
|
36
|
-
deactivatedAt
|
|
37
|
-
},
|
|
38
|
-
export type DeactivatedAtPropertyPayload = typeof DeactivatedAtPropertyPayloadSchema
|
|
48
|
+
export declare const DeactivatedAtPropertyPayloadSchema: z.ZodObject<{
|
|
49
|
+
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>>>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
export type DeactivatedAtPropertyPayload = z.output<typeof DeactivatedAtPropertyPayloadSchema>;
|
|
52
|
+
export declare const DeactivatedAtPropertySchema: z.ZodObject<{
|
|
53
|
+
deactivatedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
export type DeactivatedAtProperty = z.output<typeof DeactivatedAtPropertySchema>;
|
|
39
56
|
//# sourceMappingURL=dates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../../../../src/common/schema/dates.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../../../../src/common/schema/dates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,eAAO,MAAM,kBAAkB,wFAM7B,CAAC;AACH,eAAO,MAAM,kBAAkB,uGAAgC,CAAC;AAEhE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACrE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE/D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACjE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAG/D,eAAO,MAAM,yBAAyB,iIAErC,CAAC;AACF,eAAO,MAAM,yBAAyB,uLAE1B,CAAC;AAEb,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC7E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE7E;;GAEG;AACH,eAAO,MAAM,8BAA8B;;iBAEzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAC7C,OAAO,8BAA8B,CACtC,CAAC;AACF,eAAO,MAAM,uBAAuB;;iBAElC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,8BAA8B;;iBAEzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAC7C,OAAO,8BAA8B,CACtC,CAAC;AACF,eAAO,MAAM,uBAAuB;;iBAElC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,8BAA8B;;iBAEzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAC7C,OAAO,8BAA8B,CACtC,CAAC;AACF,eAAO,MAAM,uBAAuB;;iBAElC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,kCAAkC;;iBAE7C,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CACjD,OAAO,kCAAkC,CAC1C,CAAC;AACF,eAAO,MAAM,2BAA2B;;iBAEtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAC1C,OAAO,2BAA2B,CACnC,CAAC"}
|
|
@@ -1,31 +1,49 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
2
|
// Normalizing to a Date object
|
|
3
|
-
export const RequiredDateSchema =
|
|
4
|
-
|
|
3
|
+
export const RequiredDateSchema = z.union([
|
|
4
|
+
z.date(),
|
|
5
|
+
z
|
|
6
|
+
.string()
|
|
7
|
+
.datetime()
|
|
8
|
+
.transform((str) => new Date(str)),
|
|
9
|
+
]);
|
|
10
|
+
export const OptionalDateSchema = RequiredDateSchema.optional();
|
|
5
11
|
// What the class property is serialized to
|
|
6
|
-
export const RequiredDatePayloadSchema = RequiredDateSchema.
|
|
7
|
-
export const OptionalDatePayloadSchema = OptionalDateSchema.
|
|
12
|
+
export const RequiredDatePayloadSchema = RequiredDateSchema.transform((d) => d.toISOString());
|
|
13
|
+
export const OptionalDatePayloadSchema = OptionalDateSchema.transform((d) => d?.toISOString()).optional();
|
|
8
14
|
/**
|
|
9
15
|
* Created At
|
|
10
16
|
*/
|
|
11
|
-
export const CreatedAtPropertyPayloadSchema =
|
|
17
|
+
export const CreatedAtPropertyPayloadSchema = z.object({
|
|
12
18
|
createdAt: RequiredDatePayloadSchema,
|
|
13
19
|
});
|
|
20
|
+
export const CreatedAtPropertySchema = z.object({
|
|
21
|
+
createdAt: RequiredDateSchema,
|
|
22
|
+
});
|
|
14
23
|
/**
|
|
15
24
|
* Updated At
|
|
16
25
|
*/
|
|
17
|
-
export const UpdatedAtPropertyPayloadSchema =
|
|
26
|
+
export const UpdatedAtPropertyPayloadSchema = z.object({
|
|
18
27
|
updatedAt: RequiredDatePayloadSchema,
|
|
19
28
|
});
|
|
29
|
+
export const UpdatedAtPropertySchema = z.object({
|
|
30
|
+
updatedAt: RequiredDateSchema,
|
|
31
|
+
});
|
|
20
32
|
/**
|
|
21
33
|
* Deleted At
|
|
22
34
|
*/
|
|
23
|
-
export const DeletedAtPropertyPayloadSchema =
|
|
24
|
-
|
|
35
|
+
export const DeletedAtPropertyPayloadSchema = z.object({
|
|
36
|
+
deletedAt: OptionalDatePayloadSchema,
|
|
37
|
+
});
|
|
38
|
+
export const DeletedAtPropertySchema = z.object({
|
|
39
|
+
deletedAt: OptionalDateSchema,
|
|
25
40
|
});
|
|
26
41
|
/**
|
|
27
42
|
* Deactivated At
|
|
28
43
|
*/
|
|
29
|
-
export const DeactivatedAtPropertyPayloadSchema =
|
|
30
|
-
|
|
44
|
+
export const DeactivatedAtPropertyPayloadSchema = z.object({
|
|
45
|
+
deactivatedAt: OptionalDatePayloadSchema,
|
|
46
|
+
});
|
|
47
|
+
export const DeactivatedAtPropertySchema = z.object({
|
|
48
|
+
deactivatedAt: OptionalDateSchema,
|
|
31
49
|
});
|
|
@@ -1,31 +1,42 @@
|
|
|
1
|
-
import { type } from 'arktype';
|
|
2
1
|
import { describe, expect, test } from 'vitest';
|
|
3
2
|
import { RequiredDatePayloadSchema, RequiredDateSchema } from './dates.js';
|
|
4
3
|
describe('Common - Dates', () => {
|
|
5
4
|
describe('Date Schema', () => {
|
|
6
5
|
test('should accept an iso string', async () => {
|
|
7
|
-
const result = RequiredDateSchema(new Date().toISOString());
|
|
8
|
-
|
|
9
|
-
expect(result).
|
|
6
|
+
const result = RequiredDateSchema.safeParse(new Date().toISOString());
|
|
7
|
+
// Parse succeeds for valid data
|
|
8
|
+
expect(result.success).toBe(true);
|
|
9
|
+
if (result.success) {
|
|
10
|
+
expect(result.data).toBeInstanceOf(Date);
|
|
11
|
+
}
|
|
10
12
|
});
|
|
11
13
|
test('should accept a Date object', async () => {
|
|
12
|
-
const result = RequiredDateSchema(new Date());
|
|
13
|
-
|
|
14
|
-
expect(result).
|
|
14
|
+
const result = RequiredDateSchema.safeParse(new Date());
|
|
15
|
+
// Parse succeeds for valid data
|
|
16
|
+
expect(result.success).toBe(true);
|
|
17
|
+
if (result.success) {
|
|
18
|
+
expect(result.data).toBeInstanceOf(Date);
|
|
19
|
+
}
|
|
15
20
|
});
|
|
16
21
|
});
|
|
17
22
|
describe('Payload Schema', () => {
|
|
18
23
|
test('should parse a Date to an ISO string', async () => {
|
|
19
24
|
const iso = new Date().toISOString();
|
|
20
|
-
const result = RequiredDatePayloadSchema(new Date(iso));
|
|
21
|
-
|
|
22
|
-
expect(result).
|
|
25
|
+
const result = RequiredDatePayloadSchema.safeParse(new Date(iso));
|
|
26
|
+
// Parse succeeds for valid data
|
|
27
|
+
expect(result.success).toBe(true);
|
|
28
|
+
if (result.success) {
|
|
29
|
+
expect(result.data).toBe(iso);
|
|
30
|
+
}
|
|
23
31
|
});
|
|
24
32
|
test('should parse an ISO to an ISO string', async () => {
|
|
25
33
|
const iso = new Date().toISOString();
|
|
26
|
-
const result = RequiredDatePayloadSchema(iso);
|
|
27
|
-
|
|
28
|
-
expect(result).
|
|
34
|
+
const result = RequiredDatePayloadSchema.safeParse(iso);
|
|
35
|
+
// Parse succeeds for valid data
|
|
36
|
+
expect(result.success).toBe(true);
|
|
37
|
+
if (result.success) {
|
|
38
|
+
expect(result.data).toBe(iso);
|
|
39
|
+
}
|
|
29
40
|
});
|
|
30
41
|
});
|
|
31
42
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../../../src/common/schema/id.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../../../src/common/schema/id.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,eAAO,MAAM,WAAW,GAAI,QAAQ,MAAM,gBACmB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export const KSUIDSchema = (prefix) =>
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
export const KSUIDSchema = (prefix) => z.string().regex(new RegExp(`^${prefix}_[A-Za-z0-9]{27}$`));
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type } from 'arktype';
|
|
2
1
|
import { describe, expect, test } from 'vitest';
|
|
3
2
|
import { KSUIDSchema } from './id.js';
|
|
4
3
|
describe('Common Schema - ID', () => {
|
|
@@ -6,8 +5,11 @@ describe('Common Schema - ID', () => {
|
|
|
6
5
|
test('should accept valid KSUID with correct prefix', () => {
|
|
7
6
|
const schema = KSUIDSchema('usr');
|
|
8
7
|
const validId = 'usr_123456789012345678901234567';
|
|
9
|
-
const result = schema(validId);
|
|
10
|
-
expect(result).toBe(
|
|
8
|
+
const result = schema.safeParse(validId);
|
|
9
|
+
expect(result.success).toBe(true);
|
|
10
|
+
if (result.success) {
|
|
11
|
+
expect(result.data).toBe(validId);
|
|
12
|
+
}
|
|
11
13
|
});
|
|
12
14
|
test('should accept KSUID with different prefixes', () => {
|
|
13
15
|
const userSchema = KSUIDSchema('usr');
|
|
@@ -16,87 +18,109 @@ describe('Common Schema - ID', () => {
|
|
|
16
18
|
const userId = 'usr_abcdefghijklmnopqrstuvwxy12';
|
|
17
19
|
const appId = 'app_1234567890ABCDEFGHIJKLMNOP1';
|
|
18
20
|
const activityId = 'act_abcDEF123456789012345678901';
|
|
19
|
-
|
|
20
|
-
expect(
|
|
21
|
-
|
|
21
|
+
const userResult = userSchema.safeParse(userId);
|
|
22
|
+
expect(userResult.success).toBe(true);
|
|
23
|
+
if (userResult.success)
|
|
24
|
+
expect(userResult.data).toBe(userId);
|
|
25
|
+
const appResult = appSchema.safeParse(appId);
|
|
26
|
+
expect(appResult.success).toBe(true);
|
|
27
|
+
if (appResult.success)
|
|
28
|
+
expect(appResult.data).toBe(appId);
|
|
29
|
+
const activityResult = activitySchema.safeParse(activityId);
|
|
30
|
+
expect(activityResult.success).toBe(true);
|
|
31
|
+
if (activityResult.success)
|
|
32
|
+
expect(activityResult.data).toBe(activityId);
|
|
22
33
|
});
|
|
23
34
|
test('should accept KSUID with mixed alphanumeric characters', () => {
|
|
24
35
|
const schema = KSUIDSchema('test');
|
|
25
36
|
const mixedId = 'test_1a2B3c4D5e6F7g8H9i0JkLmNoPq';
|
|
26
|
-
const result = schema(mixedId);
|
|
27
|
-
expect(result).toBe(
|
|
37
|
+
const result = schema.safeParse(mixedId);
|
|
38
|
+
expect(result.success).toBe(true);
|
|
39
|
+
if (result.success) {
|
|
40
|
+
expect(result.data).toBe(mixedId);
|
|
41
|
+
}
|
|
28
42
|
});
|
|
29
43
|
test('should reject KSUID with wrong prefix', () => {
|
|
30
44
|
const schema = KSUIDSchema('usr');
|
|
31
45
|
const wrongPrefixId = 'app_123456789012345678901234567';
|
|
32
|
-
const result = schema(wrongPrefixId);
|
|
33
|
-
expect(result).
|
|
46
|
+
const result = schema.safeParse(wrongPrefixId);
|
|
47
|
+
expect(result.success).toBe(false);
|
|
34
48
|
});
|
|
35
49
|
test('should reject KSUID with missing prefix', () => {
|
|
36
50
|
const schema = KSUIDSchema('usr');
|
|
37
51
|
const noPrefixId = '123456789012345678901234567';
|
|
38
|
-
const result = schema(noPrefixId);
|
|
39
|
-
expect(result).
|
|
52
|
+
const result = schema.safeParse(noPrefixId);
|
|
53
|
+
expect(result.success).toBe(false);
|
|
40
54
|
});
|
|
41
55
|
test('should reject KSUID with missing underscore', () => {
|
|
42
56
|
const schema = KSUIDSchema('usr');
|
|
43
57
|
const noUnderscoreId = 'usr123456789012345678901234567';
|
|
44
|
-
const result = schema(noUnderscoreId);
|
|
45
|
-
expect(result).
|
|
58
|
+
const result = schema.safeParse(noUnderscoreId);
|
|
59
|
+
expect(result.success).toBe(false);
|
|
46
60
|
});
|
|
47
61
|
test('should reject KSUID with incorrect suffix length (too short)', () => {
|
|
48
62
|
const schema = KSUIDSchema('usr');
|
|
49
63
|
const shortId = 'usr_12345678901234567890123456';
|
|
50
|
-
const result = schema(shortId);
|
|
51
|
-
expect(result).
|
|
64
|
+
const result = schema.safeParse(shortId);
|
|
65
|
+
expect(result.success).toBe(false);
|
|
52
66
|
});
|
|
53
67
|
test('should reject KSUID with incorrect suffix length (too long)', () => {
|
|
54
68
|
const schema = KSUIDSchema('usr');
|
|
55
69
|
const longId = 'usr_1234567890123456789012345678';
|
|
56
|
-
const result = schema(longId);
|
|
57
|
-
expect(result).
|
|
70
|
+
const result = schema.safeParse(longId);
|
|
71
|
+
expect(result.success).toBe(false);
|
|
58
72
|
});
|
|
59
73
|
test('should reject KSUID with invalid characters in suffix', () => {
|
|
60
74
|
const schema = KSUIDSchema('usr');
|
|
61
75
|
const invalidCharsId = 'usr_123456789012345678901234_*';
|
|
62
|
-
const result = schema(invalidCharsId);
|
|
63
|
-
expect(result).
|
|
76
|
+
const result = schema.safeParse(invalidCharsId);
|
|
77
|
+
expect(result.success).toBe(false);
|
|
64
78
|
});
|
|
65
79
|
test('should reject KSUID with special characters in suffix', () => {
|
|
66
80
|
const schema = KSUIDSchema('usr');
|
|
67
81
|
const specialCharsId = 'usr_12345678901234567890123456@';
|
|
68
|
-
const result = schema(specialCharsId);
|
|
69
|
-
expect(result).
|
|
82
|
+
const result = schema.safeParse(specialCharsId);
|
|
83
|
+
expect(result.success).toBe(false);
|
|
70
84
|
});
|
|
71
85
|
test('should reject KSUID with spaces', () => {
|
|
72
86
|
const schema = KSUIDSchema('usr');
|
|
73
87
|
const spaceId = 'usr_1234567890123456789012345 7';
|
|
74
|
-
const result = schema(spaceId);
|
|
75
|
-
expect(result).
|
|
88
|
+
const result = schema.safeParse(spaceId);
|
|
89
|
+
expect(result.success).toBe(false);
|
|
76
90
|
});
|
|
77
91
|
test('should reject empty string', () => {
|
|
78
92
|
const schema = KSUIDSchema('usr');
|
|
79
|
-
const result = schema('');
|
|
80
|
-
expect(result).
|
|
93
|
+
const result = schema.safeParse('');
|
|
94
|
+
expect(result.success).toBe(false);
|
|
81
95
|
});
|
|
82
96
|
test('should reject non-string values', () => {
|
|
83
97
|
const schema = KSUIDSchema('usr');
|
|
84
|
-
|
|
85
|
-
expect(
|
|
86
|
-
|
|
87
|
-
expect(
|
|
98
|
+
const result1 = schema.safeParse(123);
|
|
99
|
+
expect(result1.success).toBe(false);
|
|
100
|
+
const result2 = schema.safeParse(null);
|
|
101
|
+
expect(result2.success).toBe(false);
|
|
102
|
+
const result3 = schema.safeParse(undefined);
|
|
103
|
+
expect(result3.success).toBe(false);
|
|
104
|
+
const result4 = schema.safeParse({});
|
|
105
|
+
expect(result4.success).toBe(false);
|
|
88
106
|
});
|
|
89
107
|
test('should work with complex prefixes', () => {
|
|
90
108
|
const complexSchema = KSUIDSchema('app_config');
|
|
91
109
|
const validComplexId = 'app_config_123456789012345678901234567';
|
|
92
|
-
const result = complexSchema(validComplexId);
|
|
93
|
-
expect(result).toBe(
|
|
110
|
+
const result = complexSchema.safeParse(validComplexId);
|
|
111
|
+
expect(result.success).toBe(true);
|
|
112
|
+
if (result.success) {
|
|
113
|
+
expect(result.data).toBe(validComplexId);
|
|
114
|
+
}
|
|
94
115
|
});
|
|
95
116
|
test('should work with single character prefix', () => {
|
|
96
117
|
const singleCharSchema = KSUIDSchema('a');
|
|
97
118
|
const validSingleCharId = 'a_123456789012345678901234567';
|
|
98
|
-
const result = singleCharSchema(validSingleCharId);
|
|
99
|
-
expect(result).toBe(
|
|
119
|
+
const result = singleCharSchema.safeParse(validSingleCharId);
|
|
120
|
+
expect(result.success).toBe(true);
|
|
121
|
+
if (result.success) {
|
|
122
|
+
expect(result.data).toBe(validSingleCharId);
|
|
123
|
+
}
|
|
100
124
|
});
|
|
101
125
|
test('should create different schemas for different prefixes', () => {
|
|
102
126
|
const userSchema = KSUIDSchema('usr');
|
|
@@ -104,11 +128,19 @@ describe('Common Schema - ID', () => {
|
|
|
104
128
|
const userId = 'usr_123456789012345678901234567';
|
|
105
129
|
const orgId = 'org_123456789012345678901234567';
|
|
106
130
|
// User schema should accept user ID but reject org ID
|
|
107
|
-
|
|
108
|
-
expect(
|
|
131
|
+
const userResult = userSchema.safeParse(userId);
|
|
132
|
+
expect(userResult.success).toBe(true);
|
|
133
|
+
if (userResult.success)
|
|
134
|
+
expect(userResult.data).toBe(userId);
|
|
135
|
+
const userOrgResult = userSchema.safeParse(orgId);
|
|
136
|
+
expect(userOrgResult.success).toBe(false);
|
|
109
137
|
// Org schema should accept org ID but reject user ID
|
|
110
|
-
|
|
111
|
-
expect(
|
|
138
|
+
const orgResult = orgSchema.safeParse(orgId);
|
|
139
|
+
expect(orgResult.success).toBe(true);
|
|
140
|
+
if (orgResult.success)
|
|
141
|
+
expect(orgResult.data).toBe(orgId);
|
|
142
|
+
const orgUserResult = orgSchema.safeParse(userId);
|
|
143
|
+
expect(orgUserResult.success).toBe(false);
|
|
112
144
|
});
|
|
113
145
|
});
|
|
114
146
|
});
|
|
@@ -1,21 +1,29 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
1
2
|
/**
|
|
2
3
|
* Ref: https://datatracker.ietf.org/doc/html/rfc7518#section-3.1
|
|
3
4
|
*/
|
|
4
5
|
export declare const Algorithm: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
ES512: string;
|
|
15
|
-
PS256: string;
|
|
16
|
-
PS384: string;
|
|
17
|
-
PS512: string;
|
|
6
|
+
readonly RS256: "RS256";
|
|
7
|
+
readonly RS384: "RS384";
|
|
8
|
+
readonly RS512: "RS512";
|
|
9
|
+
readonly ES256: "ES256";
|
|
10
|
+
readonly ES384: "ES384";
|
|
11
|
+
readonly ES512: "ES512";
|
|
12
|
+
readonly PS256: "PS256";
|
|
13
|
+
readonly PS384: "PS384";
|
|
14
|
+
readonly PS512: "PS512";
|
|
18
15
|
};
|
|
19
16
|
export type AnyAlgorithm = (typeof Algorithm)[keyof typeof Algorithm];
|
|
20
|
-
export declare const
|
|
17
|
+
export declare const DEFAULT_ALGORITHM: "RS256";
|
|
18
|
+
export declare const AlgorithmSchema: z.ZodEnum<{
|
|
19
|
+
RS256: "RS256";
|
|
20
|
+
RS384: "RS384";
|
|
21
|
+
RS512: "RS512";
|
|
22
|
+
ES256: "ES256";
|
|
23
|
+
ES384: "ES384";
|
|
24
|
+
ES512: "ES512";
|
|
25
|
+
PS256: "PS256";
|
|
26
|
+
PS384: "PS384";
|
|
27
|
+
PS512: "PS512";
|
|
28
|
+
}>;
|
|
21
29
|
//# sourceMappingURL=jwt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jwt.d.ts","sourceRoot":"","sources":["../../../../src/common/schema/jwt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jwt.d.ts","sourceRoot":"","sources":["../../../../src/common/schema/jwt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;CAUZ,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAEtE,eAAO,MAAM,iBAAiB,SAAkB,CAAC;AAEjD,eAAO,MAAM,eAAe;;;;;;;;;;EAEO,CAAC"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
2
|
/**
|
|
3
3
|
* Ref: https://datatracker.ietf.org/doc/html/rfc7518#section-3.1
|
|
4
4
|
*/
|
|
5
5
|
export const Algorithm = {
|
|
6
|
-
// DEFAULT: 'ES256',
|
|
7
|
-
DEFAULT: 'RS256',
|
|
8
|
-
HS256: 'HS256',
|
|
9
|
-
HS384: 'HS384',
|
|
10
|
-
HS512: 'HS512',
|
|
11
6
|
RS256: 'RS256',
|
|
12
7
|
RS384: 'RS384',
|
|
13
8
|
RS512: 'RS512',
|
|
@@ -18,4 +13,5 @@ export const Algorithm = {
|
|
|
18
13
|
PS384: 'PS384',
|
|
19
14
|
PS512: 'PS512',
|
|
20
15
|
};
|
|
21
|
-
export const
|
|
16
|
+
export const DEFAULT_ALGORITHM = Algorithm.RS256;
|
|
17
|
+
export const AlgorithmSchema = z.enum(Object.values(Algorithm));
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import { type } from 'arktype';
|
|
2
1
|
import { describe, expect, test } from 'vitest';
|
|
3
2
|
import { Algorithm, AlgorithmSchema } from './jwt.js';
|
|
4
3
|
describe('Common Schema - JWT', () => {
|
|
5
4
|
describe('Algorithm constants', () => {
|
|
6
5
|
test('should have correct algorithm values', () => {
|
|
7
|
-
expect(Algorithm.DEFAULT).toBe('RS256');
|
|
8
|
-
expect(Algorithm.HS256).toBe('HS256');
|
|
9
|
-
expect(Algorithm.HS384).toBe('HS384');
|
|
10
|
-
expect(Algorithm.HS512).toBe('HS512');
|
|
11
6
|
expect(Algorithm.RS256).toBe('RS256');
|
|
12
7
|
expect(Algorithm.RS384).toBe('RS384');
|
|
13
8
|
expect(Algorithm.RS512).toBe('RS512');
|
|
@@ -20,35 +15,37 @@ describe('Common Schema - JWT', () => {
|
|
|
20
15
|
});
|
|
21
16
|
});
|
|
22
17
|
describe('AlgorithmSchema', () => {
|
|
23
|
-
test('should accept valid HMAC algorithms', () => {
|
|
24
|
-
expect(AlgorithmSchema('HS256')).not.toBeInstanceOf(type.errors);
|
|
25
|
-
expect(AlgorithmSchema('HS384')).not.toBeInstanceOf(type.errors);
|
|
26
|
-
expect(AlgorithmSchema('HS512')).not.toBeInstanceOf(type.errors);
|
|
27
|
-
});
|
|
28
18
|
test('should accept valid RSA algorithms', () => {
|
|
29
|
-
expect(AlgorithmSchema('RS256')).
|
|
30
|
-
expect(AlgorithmSchema('RS384')).
|
|
31
|
-
expect(AlgorithmSchema('RS512')).
|
|
19
|
+
expect(AlgorithmSchema.safeParse('RS256').success).toBe(true);
|
|
20
|
+
expect(AlgorithmSchema.safeParse('RS384').success).toBe(true);
|
|
21
|
+
expect(AlgorithmSchema.safeParse('RS512').success).toBe(true);
|
|
32
22
|
});
|
|
33
23
|
test('should accept valid ECDSA algorithms', () => {
|
|
34
|
-
expect(AlgorithmSchema('ES256')).
|
|
35
|
-
expect(AlgorithmSchema('ES384')).
|
|
24
|
+
expect(AlgorithmSchema.safeParse('ES256').success).toBe(true);
|
|
25
|
+
expect(AlgorithmSchema.safeParse('ES384').success).toBe(true);
|
|
36
26
|
});
|
|
37
27
|
test('should accept valid PSS algorithms', () => {
|
|
38
|
-
expect(AlgorithmSchema('PS256')).
|
|
39
|
-
expect(AlgorithmSchema('PS384')).
|
|
40
|
-
expect(AlgorithmSchema('PS512')).
|
|
28
|
+
expect(AlgorithmSchema.safeParse('PS256').success).toBe(true);
|
|
29
|
+
expect(AlgorithmSchema.safeParse('PS384').success).toBe(true);
|
|
30
|
+
expect(AlgorithmSchema.safeParse('PS512').success).toBe(true);
|
|
41
31
|
});
|
|
42
32
|
test('should reject invalid algorithms', () => {
|
|
43
|
-
|
|
44
|
-
expect(
|
|
45
|
-
|
|
46
|
-
expect(
|
|
33
|
+
const result1 = AlgorithmSchema.safeParse('INVALID');
|
|
34
|
+
expect(result1.success).toBe(false);
|
|
35
|
+
const result2 = AlgorithmSchema.safeParse('HS128');
|
|
36
|
+
expect(result2.success).toBe(false);
|
|
37
|
+
const result3 = AlgorithmSchema.safeParse('RS128');
|
|
38
|
+
expect(result3.success).toBe(false);
|
|
39
|
+
const result4 = AlgorithmSchema.safeParse('');
|
|
40
|
+
expect(result4.success).toBe(false);
|
|
47
41
|
});
|
|
48
42
|
test('should reject non-string values', () => {
|
|
49
|
-
|
|
50
|
-
expect(
|
|
51
|
-
|
|
43
|
+
const result1 = AlgorithmSchema.safeParse(123);
|
|
44
|
+
expect(result1.success).toBe(false);
|
|
45
|
+
const result2 = AlgorithmSchema.safeParse(null);
|
|
46
|
+
expect(result2.success).toBe(false);
|
|
47
|
+
const result3 = AlgorithmSchema.safeParse(undefined);
|
|
48
|
+
expect(result3.success).toBe(false);
|
|
52
49
|
});
|
|
53
50
|
});
|
|
54
51
|
});
|