@go-mondo/identity-sdk 0.0.2-beta.9 → 0.0.2-beta.91
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 +575 -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 +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 +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 +141 -56
- package/dist/cjs/customer/users/schema.test.js +591 -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 +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 +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 +107 -55
- package/dist/esm/customer/users/schema.test.js +592 -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,22 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
import { GrantType, OptionalSchema, ScopeStringSchema, } from '../../../common/schema.js';
|
|
3
|
+
import { ClientRequestSchema } from './common.js';
|
|
4
4
|
/**
|
|
5
5
|
* @see https://datatracker.ietf.org/doc/html/rfc6749#section-4.4.2
|
|
6
6
|
*/
|
|
7
|
-
const GrantTypeSchema =
|
|
7
|
+
const GrantTypeSchema = z.enum([GrantType.CLIENT_CREDENTIALS]);
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Note: Prior to using this schema, the headers should be checked for
|
|
10
|
+
* HTTP Basic Authentication. If present, the client_id and client_secret
|
|
11
|
+
* should be included in with the payload before parsing.
|
|
10
12
|
*
|
|
11
|
-
*
|
|
13
|
+
* @see https://datatracker.ietf.org/doc/html/rfc6749#section-4.4.2
|
|
12
14
|
*/
|
|
13
|
-
export const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
export const ClientCredentialsGrantTokenSchema = z.object({
|
|
16
|
+
/**
|
|
17
|
+
* REQUIRED. Value MUST be set to "client_credentials".
|
|
18
|
+
*/
|
|
19
|
+
grant_type: GrantTypeSchema.describe('The grant type.'),
|
|
20
|
+
/**
|
|
21
|
+
* OPTIONAL. The scope of the access request.
|
|
22
|
+
*/
|
|
23
|
+
scope: ScopeStringSchema.optional(),
|
|
24
|
+
...ClientRequestSchema.shape,
|
|
25
|
+
...OptionalSchema.shape,
|
|
22
26
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../../src/oauth/token/schema/grants/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,eAAO,MAAM,mBAAmB;;;iBAc9B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
import { AppIdSchema } from '../../../../app/schema.js';
|
|
3
|
+
export const ClientRequestSchema = z.object({
|
|
4
|
+
/**
|
|
5
|
+
* REQUIRED. The client identifier.
|
|
6
|
+
* NOTE: This is only required in the body if the client is NOT authenticating
|
|
7
|
+
* via the HTTP "Authorization" header (Basic Auth).
|
|
8
|
+
*/
|
|
9
|
+
client_id: AppIdSchema.describe('The Client ID.'),
|
|
10
|
+
/**
|
|
11
|
+
* REQUIRED. The client secret.
|
|
12
|
+
* NOTE: This is only required in the body if the client is NOT authenticating
|
|
13
|
+
* via the HTTP "Authorization" header (Basic Auth).
|
|
14
|
+
*/
|
|
15
|
+
client_secret: z.string().min(1).describe('The Client Secret.'),
|
|
16
|
+
});
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
/**
|
|
3
|
+
* @see https://datatracker.ietf.org/doc/html/rfc6749#section-6
|
|
4
|
+
*/
|
|
5
|
+
export declare const RefreshTokenGrantTokenSchema: z.ZodObject<{
|
|
6
|
+
client_id: z.ZodString;
|
|
7
|
+
client_secret: z.ZodString;
|
|
8
|
+
grant_type: z.ZodEnum<{
|
|
9
|
+
refresh_token: "refresh_token";
|
|
10
|
+
}>;
|
|
11
|
+
refresh_token: z.ZodString;
|
|
12
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type RefreshTokenGrantTokenInput = z.input<typeof RefreshTokenGrantTokenSchema>;
|
|
15
|
+
export type RefreshTokenGrantToken = z.output<typeof RefreshTokenGrantTokenSchema>;
|
|
9
16
|
//# sourceMappingURL=refresh-token.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refresh-token.d.ts","sourceRoot":"","sources":["../../../../../../src/oauth/token/schema/grants/refresh-token.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"refresh-token.d.ts","sourceRoot":"","sources":["../../../../../../src/oauth/token/schema/grants/refresh-token.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAS5B;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;iBAmBvC,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,4BAA4B,CACpC,CAAC;AACF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAC3C,OAAO,4BAA4B,CACpC,CAAC"}
|
|
@@ -1,14 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
import { GrantType, ScopeStringSchema } from '../../../common/schema.js';
|
|
3
|
+
import { ClientRequestSchema } from './common.js';
|
|
4
4
|
/**
|
|
5
5
|
* @see https://datatracker.ietf.org/doc/html/rfc6749#section-6
|
|
6
6
|
*/
|
|
7
|
-
const GrantTypeSchema =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
const GrantTypeSchema = z.enum([GrantType.REFRESH_TOKEN]);
|
|
8
|
+
/**
|
|
9
|
+
* @see https://datatracker.ietf.org/doc/html/rfc6749#section-6
|
|
10
|
+
*/
|
|
11
|
+
export const RefreshTokenGrantTokenSchema = z.object({
|
|
12
|
+
/**
|
|
13
|
+
* REQUIRED. Value MUST be set to "refresh_token".
|
|
14
|
+
*/
|
|
15
|
+
grant_type: GrantTypeSchema.describe('The grant type.'),
|
|
16
|
+
/**
|
|
17
|
+
* REQUIRED. The refresh token issued to the client.
|
|
18
|
+
*/
|
|
19
|
+
refresh_token: z.string().min(1).describe('The refresh token.'),
|
|
20
|
+
/**
|
|
21
|
+
* OPTIONAL. The scope of the access request. If omitted, the scope is
|
|
22
|
+
* unchanged from the original grant. If specified, it must be equal to or
|
|
23
|
+
* a subset of the original scope.
|
|
24
|
+
*/
|
|
25
|
+
scope: ScopeStringSchema.optional(),
|
|
26
|
+
...ClientRequestSchema.shape,
|
|
14
27
|
});
|
|
@@ -1,28 +1,55 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
1
2
|
export * from './grants/authorization-code.js';
|
|
2
3
|
export * from './grants/client-credentials.js';
|
|
3
4
|
export * from './grants/refresh-token.js';
|
|
4
5
|
/**
|
|
5
6
|
* Union(s)
|
|
6
7
|
*/
|
|
7
|
-
export declare const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
audience
|
|
18
|
-
client_id:
|
|
19
|
-
client_secret:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
8
|
+
export declare const TokenGrantSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
9
|
+
code_verifier: z.ZodOptional<z.ZodString>;
|
|
10
|
+
client_id: z.ZodString;
|
|
11
|
+
client_secret: z.ZodString;
|
|
12
|
+
grant_type: z.ZodEnum<{
|
|
13
|
+
authorization_code: "authorization_code";
|
|
14
|
+
}>;
|
|
15
|
+
code: z.ZodString;
|
|
16
|
+
redirect_uri: z.ZodOptional<z.ZodURL>;
|
|
17
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
18
|
+
audience: z.ZodOptional<z.ZodString>;
|
|
19
|
+
client_id: z.ZodString;
|
|
20
|
+
client_secret: z.ZodString;
|
|
21
|
+
grant_type: z.ZodEnum<{
|
|
22
|
+
client_credentials: "client_credentials";
|
|
23
|
+
}>;
|
|
24
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
25
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
26
|
+
client_id: z.ZodString;
|
|
27
|
+
client_secret: z.ZodString;
|
|
28
|
+
grant_type: z.ZodEnum<{
|
|
29
|
+
refresh_token: "refresh_token";
|
|
30
|
+
}>;
|
|
31
|
+
refresh_token: z.ZodString;
|
|
32
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, z.core.$strip>], "grant_type">;
|
|
34
|
+
export type TokenGrantInput = z.input<typeof TokenGrantSchema>;
|
|
35
|
+
export type TokenGrant = z.output<typeof TokenGrantSchema>;
|
|
36
|
+
export declare const TokenSchema: z.ZodObject<{
|
|
37
|
+
access_token: z.ZodString;
|
|
38
|
+
token_type: z.ZodDefault<z.ZodLiteral<"Bearer">>;
|
|
39
|
+
expires_in: z.ZodOptional<z.ZodNumber>;
|
|
40
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
|
41
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
42
|
+
id_token: z.ZodOptional<z.ZodString>;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
export type TokenInput = z.input<typeof TokenSchema>;
|
|
45
|
+
export type Token = z.output<typeof TokenSchema>;
|
|
46
|
+
export declare const ImplicitTokenSchema: z.ZodObject<{
|
|
47
|
+
access_token: z.ZodOptional<z.ZodString>;
|
|
48
|
+
id_token: z.ZodOptional<z.ZodString>;
|
|
49
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
50
|
+
token_type: z.ZodDefault<z.ZodLiteral<"Bearer">>;
|
|
51
|
+
expires_in: z.ZodOptional<z.ZodNumber>;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
export type ImplicitTokenInput = z.input<typeof ImplicitTokenSchema>;
|
|
54
|
+
export type ImplicitToken = z.output<typeof ImplicitTokenSchema>;
|
|
28
55
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../../src/oauth/token/schema/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../../src/oauth/token/schema/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAO5B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAE1C;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;iCAI3B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC/D,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAK3D,eAAO,MAAM,WAAW;;;;;;;iBA8CtB,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AACrD,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,CAAC;AAEjD,eAAO,MAAM,mBAAmB;;;;;;iBAG9B,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACrE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -1,10 +1,65 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
import { ScopeStringSchema } from '../../common/schema.js';
|
|
3
|
+
import { AuthorizationCodeGrantTokenSchema } from './grants/authorization-code.js';
|
|
4
|
+
import { ClientCredentialsGrantTokenSchema } from './grants/client-credentials.js';
|
|
5
|
+
import { RefreshTokenGrantTokenSchema } from './grants/refresh-token.js';
|
|
4
6
|
export * from './grants/authorization-code.js';
|
|
5
7
|
export * from './grants/client-credentials.js';
|
|
6
8
|
export * from './grants/refresh-token.js';
|
|
7
9
|
/**
|
|
8
10
|
* Union(s)
|
|
9
11
|
*/
|
|
10
|
-
export const
|
|
12
|
+
export const TokenGrantSchema = z.discriminatedUnion('grant_type', [
|
|
13
|
+
AuthorizationCodeGrantTokenSchema,
|
|
14
|
+
ClientCredentialsGrantTokenSchema,
|
|
15
|
+
RefreshTokenGrantTokenSchema,
|
|
16
|
+
]);
|
|
17
|
+
/*
|
|
18
|
+
* @see https://datatracker.ietf.org/doc/html/rfc6749#section-5.1
|
|
19
|
+
*/
|
|
20
|
+
export const TokenSchema = z.object({
|
|
21
|
+
/**
|
|
22
|
+
* REQUIRED. The access token issued by the authorization server.
|
|
23
|
+
* Typically a JWT or an opaque string.
|
|
24
|
+
*/
|
|
25
|
+
access_token: z
|
|
26
|
+
.string()
|
|
27
|
+
.min(1)
|
|
28
|
+
.describe('The access token issued by the authorization server.'),
|
|
29
|
+
/**
|
|
30
|
+
* REQUIRED. The type of the token issued. Value is typically 'Bearer'.
|
|
31
|
+
*/
|
|
32
|
+
token_type: z
|
|
33
|
+
.literal('Bearer')
|
|
34
|
+
.default('Bearer')
|
|
35
|
+
.describe('The type of the token issued. Must be "Bearer".'),
|
|
36
|
+
/**
|
|
37
|
+
* RECOMMENDED. The lifetime in seconds of the access token.
|
|
38
|
+
* For example, the value 3600 represents an expiration time of one hour.
|
|
39
|
+
*/
|
|
40
|
+
expires_in: z
|
|
41
|
+
.number()
|
|
42
|
+
.int()
|
|
43
|
+
.positive()
|
|
44
|
+
.optional()
|
|
45
|
+
.describe('The lifetime in seconds of the access token.'),
|
|
46
|
+
/**
|
|
47
|
+
* OPTIONAL. The refresh token, which can be used to obtain a new access token
|
|
48
|
+
* when the current one expires.
|
|
49
|
+
*/
|
|
50
|
+
refresh_token: z.string().min(1).optional().describe('The refresh token.'),
|
|
51
|
+
/**
|
|
52
|
+
* OPTIONAL. The scope of the access token as issued by the authorization server.
|
|
53
|
+
* If omitted, the scope is the same as the scope originally requested by the client.
|
|
54
|
+
*/
|
|
55
|
+
scope: ScopeStringSchema.optional(),
|
|
56
|
+
/**
|
|
57
|
+
* OPTIONAL, for OpenID Connect (OIDC). The ID token, a JWT that contains claims
|
|
58
|
+
* about the authentication of the end-user.
|
|
59
|
+
*/
|
|
60
|
+
id_token: z.string().min(1).optional().describe('The ID Token (OIDC only).'),
|
|
61
|
+
});
|
|
62
|
+
export const ImplicitTokenSchema = z.object({
|
|
63
|
+
...TokenSchema.omit({ refresh_token: true, access_token: true }).shape,
|
|
64
|
+
...TokenSchema.pick({ access_token: true }).partial().shape,
|
|
65
|
+
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { type } from 'arktype';
|
|
2
1
|
import { describe, expect, test } from 'vitest';
|
|
3
2
|
import { generateAppId } from '../../../app/utils.js';
|
|
4
|
-
import {
|
|
3
|
+
import { TokenGrantSchema } from './schema.js';
|
|
5
4
|
describe('OAuth Token - Schema', () => {
|
|
6
5
|
describe('Schema union', () => {
|
|
7
6
|
test('should accept authorization code grant', () => {
|
|
@@ -9,23 +8,31 @@ describe('OAuth Token - Schema', () => {
|
|
|
9
8
|
grant_type: 'authorization_code',
|
|
10
9
|
code: 'auth_code_123',
|
|
11
10
|
client_id: generateAppId(),
|
|
11
|
+
client_secret: 'secret_123',
|
|
12
12
|
redirect_uri: 'https://example.com/callback',
|
|
13
13
|
};
|
|
14
|
-
const result =
|
|
15
|
-
|
|
16
|
-
expect(result).
|
|
14
|
+
const result = TokenGrantSchema.safeParse(payload);
|
|
15
|
+
// Parse succeeds for valid data
|
|
16
|
+
expect(result.success).toBe(true);
|
|
17
|
+
if (result.success) {
|
|
18
|
+
expect(result.data).toEqual(payload);
|
|
19
|
+
}
|
|
17
20
|
});
|
|
18
21
|
test('should accept authorization code with PKCE', () => {
|
|
19
22
|
const payload = {
|
|
20
23
|
grant_type: 'authorization_code',
|
|
21
24
|
code: 'auth_code_123',
|
|
22
25
|
client_id: generateAppId(),
|
|
26
|
+
client_secret: 'secret_123',
|
|
23
27
|
redirect_uri: 'https://example.com/callback',
|
|
24
28
|
code_verifier: 'pkce_verifier_123',
|
|
25
29
|
};
|
|
26
|
-
const result =
|
|
27
|
-
|
|
28
|
-
expect(result).
|
|
30
|
+
const result = TokenGrantSchema.safeParse(payload);
|
|
31
|
+
// Parse succeeds for valid data
|
|
32
|
+
expect(result.success).toBe(true);
|
|
33
|
+
if (result.success) {
|
|
34
|
+
expect(result.data).toEqual(payload);
|
|
35
|
+
}
|
|
29
36
|
});
|
|
30
37
|
test('should accept authorization code with client secret', () => {
|
|
31
38
|
const payload = {
|
|
@@ -35,9 +42,12 @@ describe('OAuth Token - Schema', () => {
|
|
|
35
42
|
client_secret: 'secret_123',
|
|
36
43
|
redirect_uri: 'https://example.com/callback',
|
|
37
44
|
};
|
|
38
|
-
const result =
|
|
39
|
-
|
|
40
|
-
expect(result).
|
|
45
|
+
const result = TokenGrantSchema.safeParse(payload);
|
|
46
|
+
// Parse succeeds for valid data
|
|
47
|
+
expect(result.success).toBe(true);
|
|
48
|
+
if (result.success) {
|
|
49
|
+
expect(result.data).toEqual(payload);
|
|
50
|
+
}
|
|
41
51
|
});
|
|
42
52
|
test('should accept client credentials grant', () => {
|
|
43
53
|
const payload = {
|
|
@@ -46,9 +56,12 @@ describe('OAuth Token - Schema', () => {
|
|
|
46
56
|
client_secret: 'secret_123',
|
|
47
57
|
scope: 'read write',
|
|
48
58
|
};
|
|
49
|
-
const result =
|
|
50
|
-
|
|
51
|
-
expect(result).
|
|
59
|
+
const result = TokenGrantSchema.safeParse(payload);
|
|
60
|
+
// Parse succeeds for valid data
|
|
61
|
+
expect(result.success).toBe(true);
|
|
62
|
+
if (result.success) {
|
|
63
|
+
expect(result.data).toEqual(payload);
|
|
64
|
+
}
|
|
52
65
|
});
|
|
53
66
|
test('should accept refresh token grant', () => {
|
|
54
67
|
const payload = {
|
|
@@ -58,9 +71,12 @@ describe('OAuth Token - Schema', () => {
|
|
|
58
71
|
client_secret: 'secret_123',
|
|
59
72
|
scope: 'read',
|
|
60
73
|
};
|
|
61
|
-
const result =
|
|
62
|
-
|
|
63
|
-
expect(result).
|
|
74
|
+
const result = TokenGrantSchema.safeParse(payload);
|
|
75
|
+
// Parse succeeds for valid data
|
|
76
|
+
expect(result.success).toBe(true);
|
|
77
|
+
if (result.success) {
|
|
78
|
+
expect(result.data).toEqual(payload);
|
|
79
|
+
}
|
|
64
80
|
});
|
|
65
81
|
test('should reject invalid grant type', () => {
|
|
66
82
|
const payload = {
|
|
@@ -69,8 +85,8 @@ describe('OAuth Token - Schema', () => {
|
|
|
69
85
|
client_id: generateAppId(),
|
|
70
86
|
redirect_uri: 'https://example.com/callback',
|
|
71
87
|
};
|
|
72
|
-
const result =
|
|
73
|
-
expect(result).
|
|
88
|
+
const result = TokenGrantSchema.safeParse(payload);
|
|
89
|
+
expect(result.success).toBe(false);
|
|
74
90
|
});
|
|
75
91
|
test('should reject authorization code without required fields', () => {
|
|
76
92
|
const payload = {
|
|
@@ -78,8 +94,8 @@ describe('OAuth Token - Schema', () => {
|
|
|
78
94
|
client_id: generateAppId(),
|
|
79
95
|
// missing code and redirect_uri
|
|
80
96
|
};
|
|
81
|
-
const result =
|
|
82
|
-
expect(result).
|
|
97
|
+
const result = TokenGrantSchema.safeParse(payload);
|
|
98
|
+
expect(result.success).toBe(false);
|
|
83
99
|
});
|
|
84
100
|
test('should reject invalid redirect URI', () => {
|
|
85
101
|
const payload = {
|
|
@@ -88,8 +104,8 @@ describe('OAuth Token - Schema', () => {
|
|
|
88
104
|
client_id: generateAppId(),
|
|
89
105
|
redirect_uri: 'not-a-valid-url',
|
|
90
106
|
};
|
|
91
|
-
const result =
|
|
92
|
-
expect(result).
|
|
107
|
+
const result = TokenGrantSchema.safeParse(payload);
|
|
108
|
+
expect(result.success).toBe(false);
|
|
93
109
|
});
|
|
94
110
|
test('should reject client credentials without required fields', () => {
|
|
95
111
|
const payload = {
|
|
@@ -97,8 +113,8 @@ describe('OAuth Token - Schema', () => {
|
|
|
97
113
|
client_id: generateAppId(),
|
|
98
114
|
// missing client_secret
|
|
99
115
|
};
|
|
100
|
-
const result =
|
|
101
|
-
expect(result).
|
|
116
|
+
const result = TokenGrantSchema.safeParse(payload);
|
|
117
|
+
expect(result.success).toBe(false);
|
|
102
118
|
});
|
|
103
119
|
test('should reject refresh token without required fields', () => {
|
|
104
120
|
const payload = {
|
|
@@ -106,15 +122,15 @@ describe('OAuth Token - Schema', () => {
|
|
|
106
122
|
client_id: 'app_123',
|
|
107
123
|
// missing refresh_token and client_secret
|
|
108
124
|
};
|
|
109
|
-
const result =
|
|
110
|
-
expect(result).
|
|
125
|
+
const result = TokenGrantSchema.safeParse(payload);
|
|
126
|
+
expect(result.success).toBe(false);
|
|
111
127
|
});
|
|
112
128
|
test('should reject completely invalid payload', () => {
|
|
113
129
|
const payload = {
|
|
114
130
|
invalid: 'data',
|
|
115
131
|
};
|
|
116
|
-
const result =
|
|
117
|
-
expect(result).
|
|
132
|
+
const result = TokenGrantSchema.safeParse(payload);
|
|
133
|
+
expect(result.success).toBe(false);
|
|
118
134
|
});
|
|
119
135
|
});
|
|
120
136
|
});
|
|
@@ -1,31 +1,66 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
1
2
|
export declare const DEFAULT_SESSION_DURATION: number;
|
|
2
3
|
export declare const DEFAULT_REFRESH_TOKEN_DURATION: number;
|
|
3
4
|
export declare const DEFAULT_ACCESS_TOKEN_DURATION: number;
|
|
4
|
-
export declare const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
5
|
+
export declare const AuthorizationSchema: z.ZodObject<{
|
|
6
|
+
metadata: z.ZodPipe<z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodNull, z.ZodMap<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>, z.ZodTransform<import("../../common/schema/metadata.js").MetadataMap, Record<string, string | number | boolean> | Map<string, string | number | boolean> | null | undefined>>>, z.ZodTransform<import("../../common/schema/metadata.js").MetadataMap, import("../../common/schema/metadata.js").MetadataMap | undefined>>;
|
|
7
|
+
deactivatedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>;
|
|
8
|
+
deletedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>;
|
|
9
|
+
updatedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>;
|
|
10
|
+
sessionDuration: z.ZodDefault<z.ZodNumber>;
|
|
11
|
+
refreshTokenDuration: z.ZodDefault<z.ZodNumber>;
|
|
12
|
+
accessTokenDuration: z.ZodDefault<z.ZodNumber>;
|
|
13
|
+
accessTokenSignatureAlgorithm: z.ZodDefault<z.ZodEnum<{
|
|
14
|
+
RS256: "RS256";
|
|
15
|
+
RS384: "RS384";
|
|
16
|
+
RS512: "RS512";
|
|
17
|
+
ES256: "ES256";
|
|
18
|
+
ES384: "ES384";
|
|
19
|
+
ES512: "ES512";
|
|
20
|
+
PS256: "PS256";
|
|
21
|
+
PS384: "PS384";
|
|
22
|
+
PS512: "PS512";
|
|
23
|
+
}>>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
export type AuthorizationProperties = z.input<typeof AuthorizationSchema>;
|
|
26
|
+
export type Authorization = z.output<typeof AuthorizationSchema>;
|
|
27
|
+
export declare const AuthorizationPayloadSchema: z.ZodObject<{
|
|
28
|
+
metadata: z.ZodPipe<z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodNull, z.ZodMap<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>, z.ZodTransform<import("../../common/schema/metadata.js").MetadataRecord, Record<string, string | number | boolean> | Map<string, string | number | boolean> | null | undefined>>>, z.ZodTransform<import("../../common/schema/metadata.js").MetadataRecord | undefined, import("../../common/schema/metadata.js").MetadataRecord | undefined>>;
|
|
29
|
+
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>>>;
|
|
30
|
+
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>>>;
|
|
31
|
+
updatedAt: 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>>>;
|
|
32
|
+
sessionDuration: z.ZodDefault<z.ZodNumber>;
|
|
33
|
+
refreshTokenDuration: z.ZodDefault<z.ZodNumber>;
|
|
34
|
+
accessTokenDuration: z.ZodDefault<z.ZodNumber>;
|
|
35
|
+
accessTokenSignatureAlgorithm: z.ZodDefault<z.ZodEnum<{
|
|
36
|
+
RS256: "RS256";
|
|
37
|
+
RS384: "RS384";
|
|
38
|
+
RS512: "RS512";
|
|
39
|
+
ES256: "ES256";
|
|
40
|
+
ES384: "ES384";
|
|
41
|
+
ES512: "ES512";
|
|
42
|
+
PS256: "PS256";
|
|
43
|
+
PS384: "PS384";
|
|
44
|
+
PS512: "PS512";
|
|
45
|
+
}>>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
export type AuthorizationPayload = z.output<typeof AuthorizationPayloadSchema>;
|
|
48
|
+
export declare const UpsertAuthorizationPayloadSchema: z.ZodObject<{
|
|
49
|
+
metadata: z.ZodPipe<z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodNull, z.ZodMap<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>, z.ZodTransform<import("../../common/schema/metadata.js").MetadataRecord, Record<string, string | number | boolean> | Map<string, string | number | boolean> | null | undefined>>>, z.ZodTransform<import("../../common/schema/metadata.js").MetadataRecord | null | undefined, import("../../common/schema/metadata.js").MetadataRecord | undefined>>;
|
|
50
|
+
sessionDuration: z.ZodDefault<z.ZodNumber>;
|
|
51
|
+
refreshTokenDuration: z.ZodDefault<z.ZodNumber>;
|
|
52
|
+
accessTokenDuration: z.ZodDefault<z.ZodNumber>;
|
|
53
|
+
accessTokenSignatureAlgorithm: z.ZodDefault<z.ZodEnum<{
|
|
54
|
+
RS256: "RS256";
|
|
55
|
+
RS384: "RS384";
|
|
56
|
+
RS512: "RS512";
|
|
57
|
+
ES256: "ES256";
|
|
58
|
+
ES384: "ES384";
|
|
59
|
+
ES512: "ES512";
|
|
60
|
+
PS256: "PS256";
|
|
61
|
+
PS384: "PS384";
|
|
62
|
+
PS512: "PS512";
|
|
63
|
+
}>>;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
export type UpsertAuthorizationPayload = z.output<typeof UpsertAuthorizationPayloadSchema>;
|
|
31
66
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/workspace/authorization/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/workspace/authorization/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAgB5B,eAAO,MAAM,wBAAwB,QAAc,CAAC;AACpD,eAAO,MAAM,8BAA8B,QAAoB,CAAC;AAChE,eAAO,MAAM,6BAA6B,QAAc,CAAC;AASzD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;iBAM9B,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAC1E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEjE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;iBAMrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE/E,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;iBAG3C,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAC/C,OAAO,gCAAgC,CACxC,CAAC"}
|
|
@@ -1,19 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { OptionalDatePayloadSchema } from '../../common/schema/dates.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
import { DeactivatedAtPropertyPayloadSchema, DeactivatedAtPropertySchema, DeletedAtPropertyPayloadSchema, DeletedAtPropertySchema, OptionalDatePayloadSchema, OptionalDateSchema, } from '../../common/schema/dates.js';
|
|
3
|
+
import { AlgorithmSchema, DEFAULT_ALGORITHM } from '../../common/schema/jwt.js';
|
|
4
|
+
import { MetadataMapPropertySchema, MetadataRecordPropertySchema, UpsertMetadataPropertySchema, } from '../../common/schema/metadata.js';
|
|
5
5
|
export const DEFAULT_SESSION_DURATION = 60 * 60 * 4; // 4 hour
|
|
6
6
|
export const DEFAULT_REFRESH_TOKEN_DURATION = 60 * 60 * 24 * 14; // 14 days
|
|
7
7
|
export const DEFAULT_ACCESS_TOKEN_DURATION = 60 * 60 * 2; // 2 hours
|
|
8
|
-
const BaseAttributes =
|
|
9
|
-
sessionDuration:
|
|
10
|
-
refreshTokenDuration:
|
|
11
|
-
accessTokenDuration:
|
|
12
|
-
accessTokenSignatureAlgorithm: AlgorithmSchema.default(
|
|
8
|
+
const BaseAttributes = z.object({
|
|
9
|
+
sessionDuration: z.number().default(DEFAULT_SESSION_DURATION),
|
|
10
|
+
refreshTokenDuration: z.number().default(DEFAULT_REFRESH_TOKEN_DURATION),
|
|
11
|
+
accessTokenDuration: z.number().default(DEFAULT_ACCESS_TOKEN_DURATION),
|
|
12
|
+
accessTokenSignatureAlgorithm: AlgorithmSchema.default(DEFAULT_ALGORITHM),
|
|
13
|
+
});
|
|
14
|
+
export const AuthorizationSchema = z.object({
|
|
15
|
+
...BaseAttributes.shape,
|
|
16
|
+
updatedAt: OptionalDateSchema,
|
|
17
|
+
...DeletedAtPropertySchema.shape,
|
|
18
|
+
...DeactivatedAtPropertySchema.shape,
|
|
19
|
+
...MetadataMapPropertySchema.shape,
|
|
20
|
+
});
|
|
21
|
+
export const AuthorizationPayloadSchema = z.object({
|
|
22
|
+
...BaseAttributes.shape,
|
|
23
|
+
updatedAt: OptionalDatePayloadSchema,
|
|
24
|
+
...DeletedAtPropertyPayloadSchema.shape,
|
|
25
|
+
...DeactivatedAtPropertyPayloadSchema.shape,
|
|
26
|
+
...MetadataRecordPropertySchema.shape,
|
|
27
|
+
});
|
|
28
|
+
export const UpsertAuthorizationPayloadSchema = z.object({
|
|
29
|
+
...BaseAttributes.shape,
|
|
30
|
+
...UpsertMetadataPropertySchema.shape,
|
|
13
31
|
});
|
|
14
|
-
export const AuthorizationPayloadSchema = BaseAttributes.and({
|
|
15
|
-
'updatedAt?': OptionalDatePayloadSchema,
|
|
16
|
-
'deletedAt?': OptionalDatePayloadSchema,
|
|
17
|
-
'deactivatedAt?': OptionalDatePayloadSchema,
|
|
18
|
-
}).and(MetadataPayloadPropertySchema);
|
|
19
|
-
export const UpsertAuthorizationPayloadSchema = BaseAttributes.and(MetadataPayloadPropertySchema);
|