@go-mondo/identity-sdk 0.0.2-beta.12 → 0.0.2-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.release-please-manifest.json +1 -1
- package/.tsbuildinfo/cjs.json +1 -1
- package/.tsbuildinfo/esm.json +1 -1
- package/CHANGELOG.md +7 -0
- package/dist/cjs/action/schema/base.d.ts +22 -20
- package/dist/cjs/action/schema/base.d.ts.map +1 -1
- package/dist/cjs/action/schema/base.js +15 -8
- package/dist/cjs/action/schema/base.test.js +50 -34
- package/dist/cjs/action/schema/operations/set-password.d.ts +30 -30
- package/dist/cjs/action/schema/operations/set-password.d.ts.map +1 -1
- package/dist/cjs/action/schema/operations/set-password.js +9 -8
- package/dist/cjs/action/schema/operations/set-password.test.js +30 -29
- package/dist/cjs/action/schema/operations/sign-up-verification.d.ts +21 -21
- package/dist/cjs/action/schema/operations/sign-up-verification.d.ts.map +1 -1
- package/dist/cjs/action/schema/operations/sign-up-verification.js +8 -7
- package/dist/cjs/action/schema/operations/sign-up-verification.test.js +28 -29
- package/dist/cjs/action/schema/operations/sign-up.d.ts +40 -43
- package/dist/cjs/action/schema/operations/sign-up.d.ts.map +1 -1
- package/dist/cjs/action/schema/operations/sign-up.js +24 -15
- package/dist/cjs/action/schema/operations/sign-up.test.js +33 -34
- package/dist/cjs/action/schema/operations/user-attribute-verification.d.ts +19 -19
- package/dist/cjs/action/schema/operations/user-attribute-verification.d.ts.map +1 -1
- package/dist/cjs/action/schema/operations/user-attribute-verification.js +6 -5
- package/dist/cjs/action/schema/operations/user-attribute-verification.test.js +25 -26
- package/dist/cjs/action/schema/schema.d.ts +70 -76
- package/dist/cjs/action/schema/schema.d.ts.map +1 -1
- package/dist/cjs/action/schema/schema.test.js +26 -27
- package/dist/cjs/activity/resources.d.ts.map +1 -1
- package/dist/cjs/activity/resources.js +1 -1
- package/dist/cjs/activity/schema/base.d.ts +88 -69
- package/dist/cjs/activity/schema/base.d.ts.map +1 -1
- package/dist/cjs/activity/schema/base.js +30 -18
- package/dist/cjs/activity/schema/base.test.js +85 -55
- package/dist/cjs/activity/schema/schema.d.ts +293 -226
- package/dist/cjs/activity/schema/schema.d.ts.map +1 -1
- package/dist/cjs/activity/schema/schema.test.js +47 -48
- package/dist/cjs/activity/schema/types/authentication.d.ts +64 -46
- package/dist/cjs/activity/schema/types/authentication.d.ts.map +1 -1
- package/dist/cjs/activity/schema/types/authentication.js +16 -7
- package/dist/cjs/activity/schema/types/authentication.test.js +37 -38
- package/dist/cjs/activity/schema/types/authorization.d.ts +64 -46
- package/dist/cjs/activity/schema/types/authorization.d.ts.map +1 -1
- package/dist/cjs/activity/schema/types/authorization.js +16 -7
- package/dist/cjs/activity/schema/types/authorization.test.js +41 -42
- package/dist/cjs/activity/schema/types/note.d.ts +83 -70
- package/dist/cjs/activity/schema/types/note.d.ts.map +1 -1
- package/dist/cjs/activity/schema/types/note.js +20 -12
- package/dist/cjs/activity/schema/types/note.test.js +48 -49
- package/dist/cjs/activity/schema/types/operation.d.ts +64 -45
- package/dist/cjs/activity/schema/types/operation.d.ts.map +1 -1
- package/dist/cjs/activity/schema/types/operation.js +19 -8
- package/dist/cjs/activity/schema/types/operation.test.js +34 -35
- package/dist/cjs/activity/schema/types/unknown.d.ts +50 -41
- package/dist/cjs/activity/schema/types/unknown.d.ts.map +1 -1
- package/dist/cjs/activity/schema/types/unknown.js +12 -6
- package/dist/cjs/activity/schema/types/unknown.test.js +29 -30
- package/dist/cjs/app/authorization/resources.d.ts.map +1 -1
- package/dist/cjs/app/authorization/resources.js +2 -3
- package/dist/cjs/app/authorization/schema.d.ts +96 -52
- package/dist/cjs/app/authorization/schema.d.ts.map +1 -1
- package/dist/cjs/app/authorization/schema.js +61 -52
- package/dist/cjs/app/authorization/schema.test.js +96 -71
- package/dist/cjs/app/oauth/resources.d.ts.map +1 -1
- package/dist/cjs/app/oauth/resources.js +2 -3
- package/dist/cjs/app/oauth/schema.d.ts +34 -41
- package/dist/cjs/app/oauth/schema.d.ts.map +1 -1
- package/dist/cjs/app/oauth/schema.js +23 -17
- package/dist/cjs/app/oauth/schema.test.js +38 -39
- package/dist/cjs/app/oidc/resources.d.ts.map +1 -1
- package/dist/cjs/app/oidc/resources.js +4 -5
- package/dist/cjs/app/oidc/schema.d.ts +26 -37
- package/dist/cjs/app/oidc/schema.d.ts.map +1 -1
- package/dist/cjs/app/oidc/schema.js +17 -12
- package/dist/cjs/app/oidc/schema.test.js +45 -26
- package/dist/cjs/app/registration/resources.d.ts.map +1 -1
- package/dist/cjs/app/registration/resources.js +2 -3
- package/dist/cjs/app/registration/schema.d.ts +24 -31
- package/dist/cjs/app/registration/schema.d.ts.map +1 -1
- package/dist/cjs/app/registration/schema.js +23 -16
- package/dist/cjs/app/registration/schema.test.js +68 -150
- package/dist/cjs/app/resources.d.ts.map +1 -1
- package/dist/cjs/app/resources.js +5 -5
- package/dist/cjs/app/saml/resources.d.ts.map +1 -1
- package/dist/cjs/app/saml/resources.js +4 -5
- package/dist/cjs/app/saml/schema.d.ts +26 -37
- package/dist/cjs/app/saml/schema.d.ts.map +1 -1
- package/dist/cjs/app/saml/schema.js +17 -12
- package/dist/cjs/app/schema.d.ts +72 -68
- package/dist/cjs/app/schema.d.ts.map +1 -1
- package/dist/cjs/app/schema.js +34 -27
- package/dist/cjs/app/schema.test.js +38 -41
- package/dist/cjs/association/resources.d.ts.map +1 -1
- package/dist/cjs/association/resources.js +3 -5
- package/dist/cjs/association/schema.d.ts +225 -181
- package/dist/cjs/association/schema.d.ts.map +1 -1
- package/dist/cjs/association/schema.js +28 -22
- package/dist/cjs/association/schema.test.js +36 -28
- package/dist/cjs/authentication/factors/schema.d.ts +18 -55
- package/dist/cjs/authentication/factors/schema.d.ts.map +1 -1
- package/dist/cjs/authentication/factors/schema.js +21 -23
- package/dist/cjs/authentication/factors/schema.test.js +33 -34
- package/dist/cjs/authentication/providers/schema.d.ts +23 -22
- package/dist/cjs/authentication/providers/schema.d.ts.map +1 -1
- package/dist/cjs/authentication/providers/schema.js +10 -8
- package/dist/cjs/authentication/sessions/resources.d.ts.map +1 -1
- package/dist/cjs/authentication/sessions/resources.js +2 -2
- package/dist/cjs/authentication/sessions/schema.d.ts +101 -74
- package/dist/cjs/authentication/sessions/schema.d.ts.map +1 -1
- package/dist/cjs/authentication/sessions/schema.js +56 -25
- package/dist/cjs/authentication/settings/resources.d.ts.map +1 -1
- package/dist/cjs/authentication/settings/resources.js +2 -3
- package/dist/cjs/authentication/settings/schema.d.ts +25 -68
- package/dist/cjs/authentication/settings/schema.d.ts.map +1 -1
- package/dist/cjs/authentication/settings/schema.js +13 -10
- package/dist/cjs/authentication/settings/schema.test.js +28 -19
- package/dist/cjs/authentication/strategies/resources.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/resources.js +5 -5
- package/dist/cjs/authentication/strategies/schema/base.d.ts +59 -51
- package/dist/cjs/authentication/strategies/schema/base.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/schema/base.js +26 -15
- package/dist/cjs/authentication/strategies/schema/schema.d.ts +206 -197
- package/dist/cjs/authentication/strategies/schema/schema.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/schema/types/email.d.ts +61 -60
- package/dist/cjs/authentication/strategies/schema/types/email.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/schema/types/email.js +24 -14
- package/dist/cjs/authentication/strategies/schema/types/email.test.js +49 -50
- package/dist/cjs/authentication/strategies/schema/types/password.d.ts +129 -122
- package/dist/cjs/authentication/strategies/schema/types/password.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/schema/types/password.js +33 -25
- package/dist/cjs/authentication/strategies/schema/types/totp.d.ts +107 -94
- package/dist/cjs/authentication/strategies/schema/types/totp.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/schema/types/totp.js +50 -26
- package/dist/cjs/authorization/permissions/resources.d.ts.map +1 -1
- package/dist/cjs/authorization/permissions/resources.js +5 -5
- package/dist/cjs/authorization/permissions/schema.d.ts +92 -88
- package/dist/cjs/authorization/permissions/schema.d.ts.map +1 -1
- package/dist/cjs/authorization/permissions/schema.js +38 -28
- package/dist/cjs/authorization/permissions/schema.test.js +57 -59
- package/dist/cjs/authorization/roles/resources.d.ts.map +1 -1
- package/dist/cjs/authorization/roles/resources.js +5 -5
- package/dist/cjs/authorization/roles/schema.d.ts +102 -98
- package/dist/cjs/authorization/roles/schema.d.ts.map +1 -1
- package/dist/cjs/authorization/roles/schema.js +35 -32
- package/dist/cjs/authorization/roles/schema.test.js +58 -59
- package/dist/cjs/authorization/schema.d.ts +7 -6
- package/dist/cjs/authorization/schema.d.ts.map +1 -1
- package/dist/cjs/authorization/schema.js +9 -3
- package/dist/cjs/common/resources/init.d.ts +7 -6
- package/dist/cjs/common/resources/init.d.ts.map +1 -1
- package/dist/cjs/common/resources/init.js +17 -9
- package/dist/cjs/common/resources/utils.d.ts +0 -9
- package/dist/cjs/common/resources/utils.d.ts.map +1 -1
- package/dist/cjs/common/resources/utils.js +0 -26
- package/dist/cjs/common/resources/utils.test.js +0 -29
- package/dist/cjs/common/schema/aggregate.d.ts +6 -5
- package/dist/cjs/common/schema/aggregate.d.ts.map +1 -1
- package/dist/cjs/common/schema/aggregate.js +4 -4
- package/dist/cjs/common/schema/aggregate.test.js +21 -22
- package/dist/cjs/common/schema/collection.d.ts +11 -10
- package/dist/cjs/common/schema/collection.d.ts.map +1 -1
- package/dist/cjs/common/schema/collection.js +6 -4
- package/dist/cjs/common/schema/collection.test.js +66 -48
- package/dist/cjs/common/schema/dates.d.ts +27 -26
- package/dist/cjs/common/schema/dates.d.ts.map +1 -1
- package/dist/cjs/common/schema/dates.js +17 -11
- package/dist/cjs/common/schema/dates.test.js +24 -13
- package/dist/cjs/common/schema/id.d.ts +2 -1
- package/dist/cjs/common/schema/id.d.ts.map +1 -1
- package/dist/cjs/common/schema/id.js +2 -2
- package/dist/cjs/common/schema/id.test.js +70 -38
- package/dist/cjs/common/schema/jwt.d.ts +27 -14
- package/dist/cjs/common/schema/jwt.d.ts.map +1 -1
- package/dist/cjs/common/schema/jwt.js +14 -2
- package/dist/cjs/common/schema/jwt.test.js +25 -19
- package/dist/cjs/common/schema/metadata.d.ts +24 -41
- package/dist/cjs/common/schema/metadata.d.ts.map +1 -1
- package/dist/cjs/common/schema/metadata.js +38 -37
- package/dist/cjs/common/schema/metadata.test.js +36 -37
- package/dist/cjs/common/schema/pagination.d.ts +6 -5
- package/dist/cjs/common/schema/pagination.d.ts.map +1 -1
- package/dist/cjs/common/schema/pagination.js +4 -4
- package/dist/cjs/common/schema/pagination.test.js +19 -20
- package/dist/cjs/common/schema/schema.d.ts +4 -4
- package/dist/cjs/common/schema/schema.d.ts.map +1 -1
- package/dist/cjs/common/schema/schema.js +6 -5
- package/dist/cjs/common/schema/schema.test.js +9 -15
- package/dist/cjs/common/schema/sets.d.ts +3 -2
- package/dist/cjs/common/schema/sets.d.ts.map +1 -1
- package/dist/cjs/common/schema/sets.js +9 -6
- package/dist/cjs/common/schema/sets.test.js +52 -43
- package/dist/cjs/customer/organization/schema.d.ts +44 -46
- package/dist/cjs/customer/organization/schema.d.ts.map +1 -1
- package/dist/cjs/customer/organization/schema.js +26 -20
- package/dist/cjs/customer/schema.d.ts +7 -6
- package/dist/cjs/customer/schema.d.ts.map +1 -1
- package/dist/cjs/customer/schema.js +9 -3
- package/dist/cjs/customer/users/resources.d.ts.map +1 -1
- package/dist/cjs/customer/users/resources.js +5 -5
- package/dist/cjs/customer/users/schema.d.ts +140 -139
- package/dist/cjs/customer/users/schema.d.ts.map +1 -1
- package/dist/cjs/customer/users/schema.js +58 -46
- package/dist/cjs/customer/users/schema.test.js +22 -35
- package/dist/cjs/customer/users/utils.d.ts +3 -2
- package/dist/cjs/customer/users/utils.d.ts.map +1 -1
- package/dist/cjs/identity/schema.d.ts +5 -1
- package/dist/cjs/identity/schema.d.ts.map +1 -1
- package/dist/cjs/identity/schema.js +5 -2
- package/dist/cjs/identity/schema.test.js +21 -16
- package/dist/cjs/oauth/authorize/schema/grants/authorization-code.d.ts +31 -28
- package/dist/cjs/oauth/authorize/schema/grants/authorization-code.d.ts.map +1 -1
- package/dist/cjs/oauth/authorize/schema/grants/authorization-code.js +56 -37
- package/dist/cjs/oauth/authorize/schema/grants/authorization-code.test.js +44 -45
- package/dist/cjs/oauth/authorize/schema/grants/implicit.d.ts +16 -10
- package/dist/cjs/oauth/authorize/schema/grants/implicit.d.ts.map +1 -1
- package/dist/cjs/oauth/authorize/schema/grants/implicit.js +19 -10
- package/dist/cjs/oauth/authorize/schema/schema.d.ts +44 -36
- package/dist/cjs/oauth/authorize/schema/schema.d.ts.map +1 -1
- package/dist/cjs/oauth/common/schema.d.ts +21 -7
- package/dist/cjs/oauth/common/schema.d.ts.map +1 -1
- package/dist/cjs/oauth/common/schema.js +20 -7
- package/dist/cjs/oauth/common/schema.test.js +25 -26
- package/dist/cjs/oauth/token/schema/grants/authorization-code.d.ts +12 -9
- package/dist/cjs/oauth/token/schema/grants/authorization-code.d.ts.map +1 -1
- package/dist/cjs/oauth/token/schema/grants/authorization-code.js +11 -10
- package/dist/cjs/oauth/token/schema/grants/client-credentials.d.ts +20 -15
- package/dist/cjs/oauth/token/schema/grants/client-credentials.d.ts.map +1 -1
- package/dist/cjs/oauth/token/schema/grants/client-credentials.js +13 -8
- package/dist/cjs/oauth/token/schema/grants/refresh-token.d.ts +11 -8
- package/dist/cjs/oauth/token/schema/grants/refresh-token.d.ts.map +1 -1
- package/dist/cjs/oauth/token/schema/grants/refresh-token.js +6 -6
- package/dist/cjs/oauth/token/schema/schema.d.ts +28 -21
- package/dist/cjs/oauth/token/schema/schema.d.ts.map +1 -1
- package/dist/cjs/oauth/token/schema/schema.test.js +42 -28
- package/dist/cjs/workspace/authorization/schema.d.ts +44 -27
- package/dist/cjs/workspace/authorization/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/authorization/schema.js +16 -11
- package/dist/cjs/workspace/branding/schema.d.ts +30 -37
- package/dist/cjs/workspace/branding/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/branding/schema.js +20 -15
- package/dist/cjs/workspace/membership/schema.d.ts +21 -20
- package/dist/cjs/workspace/membership/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/membership/schema.js +6 -6
- package/dist/cjs/workspace/registration/schema.d.ts +26 -27
- package/dist/cjs/workspace/registration/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/registration/schema.js +13 -11
- package/dist/cjs/workspace/settings/schema.d.ts +12 -19
- package/dist/cjs/workspace/settings/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/settings/schema.js +7 -6
- package/dist/cjs/workspace/settings/schema.test.js +18 -19
- package/dist/cjs/workspace/tenant/schema.d.ts +55 -57
- package/dist/cjs/workspace/tenant/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/tenant/schema.js +17 -12
- package/dist/cjs/workspace/user/notifications/schema.d.ts +50 -56
- package/dist/cjs/workspace/user/notifications/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/user/notifications/schema.js +26 -23
- package/dist/cjs/workspace/user/preferences/schema.d.ts +18 -25
- package/dist/cjs/workspace/user/preferences/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/user/preferences/schema.js +16 -11
- package/dist/esm/action/schema/base.d.ts +22 -20
- package/dist/esm/action/schema/base.d.ts.map +1 -1
- package/dist/esm/action/schema/base.js +15 -8
- package/dist/esm/action/schema/base.test.js +50 -34
- package/dist/esm/action/schema/operations/set-password.d.ts +30 -30
- package/dist/esm/action/schema/operations/set-password.d.ts.map +1 -1
- package/dist/esm/action/schema/operations/set-password.js +9 -8
- package/dist/esm/action/schema/operations/set-password.test.js +30 -29
- package/dist/esm/action/schema/operations/sign-up-verification.d.ts +21 -21
- package/dist/esm/action/schema/operations/sign-up-verification.d.ts.map +1 -1
- package/dist/esm/action/schema/operations/sign-up-verification.js +8 -7
- package/dist/esm/action/schema/operations/sign-up-verification.test.js +28 -29
- package/dist/esm/action/schema/operations/sign-up.d.ts +40 -43
- package/dist/esm/action/schema/operations/sign-up.d.ts.map +1 -1
- package/dist/esm/action/schema/operations/sign-up.js +19 -10
- package/dist/esm/action/schema/operations/sign-up.test.js +33 -34
- package/dist/esm/action/schema/operations/user-attribute-verification.d.ts +19 -19
- package/dist/esm/action/schema/operations/user-attribute-verification.d.ts.map +1 -1
- package/dist/esm/action/schema/operations/user-attribute-verification.js +6 -5
- package/dist/esm/action/schema/operations/user-attribute-verification.test.js +25 -26
- package/dist/esm/action/schema/schema.d.ts +70 -76
- package/dist/esm/action/schema/schema.d.ts.map +1 -1
- package/dist/esm/action/schema/schema.test.js +26 -27
- package/dist/esm/activity/resources.d.ts.map +1 -1
- package/dist/esm/activity/resources.js +2 -2
- package/dist/esm/activity/schema/base.d.ts +88 -69
- package/dist/esm/activity/schema/base.d.ts.map +1 -1
- package/dist/esm/activity/schema/base.js +30 -18
- package/dist/esm/activity/schema/base.test.js +85 -55
- package/dist/esm/activity/schema/schema.d.ts +293 -226
- package/dist/esm/activity/schema/schema.d.ts.map +1 -1
- package/dist/esm/activity/schema/schema.test.js +47 -48
- package/dist/esm/activity/schema/types/authentication.d.ts +64 -46
- package/dist/esm/activity/schema/types/authentication.d.ts.map +1 -1
- package/dist/esm/activity/schema/types/authentication.js +16 -7
- package/dist/esm/activity/schema/types/authentication.test.js +37 -38
- package/dist/esm/activity/schema/types/authorization.d.ts +64 -46
- package/dist/esm/activity/schema/types/authorization.d.ts.map +1 -1
- package/dist/esm/activity/schema/types/authorization.js +16 -7
- package/dist/esm/activity/schema/types/authorization.test.js +41 -42
- package/dist/esm/activity/schema/types/note.d.ts +83 -70
- package/dist/esm/activity/schema/types/note.d.ts.map +1 -1
- package/dist/esm/activity/schema/types/note.js +20 -12
- package/dist/esm/activity/schema/types/note.test.js +48 -49
- package/dist/esm/activity/schema/types/operation.d.ts +64 -45
- package/dist/esm/activity/schema/types/operation.d.ts.map +1 -1
- package/dist/esm/activity/schema/types/operation.js +19 -8
- package/dist/esm/activity/schema/types/operation.test.js +34 -35
- package/dist/esm/activity/schema/types/unknown.d.ts +50 -41
- package/dist/esm/activity/schema/types/unknown.d.ts.map +1 -1
- package/dist/esm/activity/schema/types/unknown.js +12 -6
- package/dist/esm/activity/schema/types/unknown.test.js +29 -30
- package/dist/esm/app/authorization/resources.d.ts.map +1 -1
- package/dist/esm/app/authorization/resources.js +2 -3
- package/dist/esm/app/authorization/schema.d.ts +96 -52
- package/dist/esm/app/authorization/schema.d.ts.map +1 -1
- package/dist/esm/app/authorization/schema.js +61 -52
- package/dist/esm/app/authorization/schema.test.js +96 -71
- package/dist/esm/app/oauth/resources.d.ts.map +1 -1
- package/dist/esm/app/oauth/resources.js +2 -3
- package/dist/esm/app/oauth/schema.d.ts +34 -41
- package/dist/esm/app/oauth/schema.d.ts.map +1 -1
- package/dist/esm/app/oauth/schema.js +23 -17
- package/dist/esm/app/oauth/schema.test.js +38 -39
- package/dist/esm/app/oidc/resources.d.ts.map +1 -1
- package/dist/esm/app/oidc/resources.js +4 -5
- package/dist/esm/app/oidc/schema.d.ts +26 -37
- package/dist/esm/app/oidc/schema.d.ts.map +1 -1
- package/dist/esm/app/oidc/schema.js +17 -12
- package/dist/esm/app/oidc/schema.test.js +45 -26
- package/dist/esm/app/registration/resources.d.ts.map +1 -1
- package/dist/esm/app/registration/resources.js +2 -3
- package/dist/esm/app/registration/schema.d.ts +24 -31
- package/dist/esm/app/registration/schema.d.ts.map +1 -1
- package/dist/esm/app/registration/schema.js +23 -16
- package/dist/esm/app/registration/schema.test.js +68 -150
- package/dist/esm/app/resources.d.ts.map +1 -1
- package/dist/esm/app/resources.js +6 -6
- package/dist/esm/app/saml/resources.d.ts.map +1 -1
- package/dist/esm/app/saml/resources.js +4 -5
- package/dist/esm/app/saml/schema.d.ts +26 -37
- package/dist/esm/app/saml/schema.d.ts.map +1 -1
- package/dist/esm/app/saml/schema.js +17 -12
- package/dist/esm/app/schema.d.ts +72 -68
- package/dist/esm/app/schema.d.ts.map +1 -1
- package/dist/esm/app/schema.js +34 -27
- package/dist/esm/app/schema.test.js +38 -41
- package/dist/esm/association/resources.d.ts.map +1 -1
- package/dist/esm/association/resources.js +4 -6
- package/dist/esm/association/schema.d.ts +225 -181
- package/dist/esm/association/schema.d.ts.map +1 -1
- package/dist/esm/association/schema.js +28 -22
- package/dist/esm/association/schema.test.js +36 -28
- package/dist/esm/authentication/factors/schema.d.ts +18 -55
- package/dist/esm/authentication/factors/schema.d.ts.map +1 -1
- package/dist/esm/authentication/factors/schema.js +21 -23
- package/dist/esm/authentication/factors/schema.test.js +33 -34
- package/dist/esm/authentication/providers/schema.d.ts +23 -22
- package/dist/esm/authentication/providers/schema.d.ts.map +1 -1
- package/dist/esm/authentication/providers/schema.js +10 -8
- package/dist/esm/authentication/sessions/resources.d.ts.map +1 -1
- package/dist/esm/authentication/sessions/resources.js +3 -3
- package/dist/esm/authentication/sessions/schema.d.ts +101 -74
- package/dist/esm/authentication/sessions/schema.d.ts.map +1 -1
- package/dist/esm/authentication/sessions/schema.js +56 -25
- package/dist/esm/authentication/settings/resources.d.ts.map +1 -1
- package/dist/esm/authentication/settings/resources.js +2 -3
- package/dist/esm/authentication/settings/schema.d.ts +25 -68
- package/dist/esm/authentication/settings/schema.d.ts.map +1 -1
- package/dist/esm/authentication/settings/schema.js +13 -10
- package/dist/esm/authentication/settings/schema.test.js +28 -19
- package/dist/esm/authentication/strategies/resources.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/resources.js +6 -6
- package/dist/esm/authentication/strategies/schema/base.d.ts +59 -51
- package/dist/esm/authentication/strategies/schema/base.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/schema/base.js +26 -15
- package/dist/esm/authentication/strategies/schema/schema.d.ts +206 -197
- package/dist/esm/authentication/strategies/schema/schema.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/schema/types/email.d.ts +61 -60
- package/dist/esm/authentication/strategies/schema/types/email.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/schema/types/email.js +24 -14
- package/dist/esm/authentication/strategies/schema/types/email.test.js +49 -50
- package/dist/esm/authentication/strategies/schema/types/password.d.ts +129 -122
- package/dist/esm/authentication/strategies/schema/types/password.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/schema/types/password.js +33 -25
- package/dist/esm/authentication/strategies/schema/types/totp.d.ts +107 -94
- package/dist/esm/authentication/strategies/schema/types/totp.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/schema/types/totp.js +50 -26
- package/dist/esm/authorization/permissions/resources.d.ts.map +1 -1
- package/dist/esm/authorization/permissions/resources.js +6 -6
- package/dist/esm/authorization/permissions/schema.d.ts +92 -88
- package/dist/esm/authorization/permissions/schema.d.ts.map +1 -1
- package/dist/esm/authorization/permissions/schema.js +38 -28
- package/dist/esm/authorization/permissions/schema.test.js +57 -59
- package/dist/esm/authorization/roles/resources.d.ts.map +1 -1
- package/dist/esm/authorization/roles/resources.js +6 -6
- package/dist/esm/authorization/roles/schema.d.ts +102 -98
- package/dist/esm/authorization/roles/schema.d.ts.map +1 -1
- package/dist/esm/authorization/roles/schema.js +35 -32
- package/dist/esm/authorization/roles/schema.test.js +58 -59
- package/dist/esm/authorization/schema.d.ts +7 -6
- package/dist/esm/authorization/schema.d.ts.map +1 -1
- package/dist/esm/authorization/schema.js +9 -3
- package/dist/esm/common/resources/init.d.ts +7 -6
- package/dist/esm/common/resources/init.d.ts.map +1 -1
- package/dist/esm/common/resources/init.js +17 -9
- package/dist/esm/common/resources/utils.d.ts +0 -9
- package/dist/esm/common/resources/utils.d.ts.map +1 -1
- package/dist/esm/common/resources/utils.js +0 -24
- package/dist/esm/common/resources/utils.test.js +1 -30
- package/dist/esm/common/schema/aggregate.d.ts +6 -5
- package/dist/esm/common/schema/aggregate.d.ts.map +1 -1
- package/dist/esm/common/schema/aggregate.js +4 -4
- package/dist/esm/common/schema/aggregate.test.js +21 -22
- package/dist/esm/common/schema/collection.d.ts +11 -10
- package/dist/esm/common/schema/collection.d.ts.map +1 -1
- package/dist/esm/common/schema/collection.js +4 -4
- package/dist/esm/common/schema/collection.test.js +66 -48
- package/dist/esm/common/schema/dates.d.ts +27 -26
- package/dist/esm/common/schema/dates.d.ts.map +1 -1
- package/dist/esm/common/schema/dates.js +17 -11
- package/dist/esm/common/schema/dates.test.js +24 -13
- package/dist/esm/common/schema/id.d.ts +2 -1
- package/dist/esm/common/schema/id.d.ts.map +1 -1
- package/dist/esm/common/schema/id.js +2 -2
- package/dist/esm/common/schema/id.test.js +70 -38
- package/dist/esm/common/schema/jwt.d.ts +27 -14
- package/dist/esm/common/schema/jwt.d.ts.map +1 -1
- package/dist/esm/common/schema/jwt.js +14 -2
- package/dist/esm/common/schema/jwt.test.js +25 -19
- package/dist/esm/common/schema/metadata.d.ts +24 -41
- package/dist/esm/common/schema/metadata.d.ts.map +1 -1
- package/dist/esm/common/schema/metadata.js +38 -37
- package/dist/esm/common/schema/metadata.test.js +36 -37
- package/dist/esm/common/schema/pagination.d.ts +6 -5
- package/dist/esm/common/schema/pagination.d.ts.map +1 -1
- package/dist/esm/common/schema/pagination.js +4 -4
- package/dist/esm/common/schema/pagination.test.js +19 -20
- package/dist/esm/common/schema/schema.d.ts +4 -4
- package/dist/esm/common/schema/schema.d.ts.map +1 -1
- package/dist/esm/common/schema/schema.js +6 -5
- package/dist/esm/common/schema/schema.test.js +9 -15
- package/dist/esm/common/schema/sets.d.ts +3 -2
- package/dist/esm/common/schema/sets.d.ts.map +1 -1
- package/dist/esm/common/schema/sets.js +9 -6
- package/dist/esm/common/schema/sets.test.js +53 -44
- package/dist/esm/customer/organization/schema.d.ts +44 -46
- package/dist/esm/customer/organization/schema.d.ts.map +1 -1
- package/dist/esm/customer/organization/schema.js +26 -20
- package/dist/esm/customer/schema.d.ts +7 -6
- package/dist/esm/customer/schema.d.ts.map +1 -1
- package/dist/esm/customer/schema.js +9 -3
- package/dist/esm/customer/users/resources.d.ts.map +1 -1
- package/dist/esm/customer/users/resources.js +6 -6
- package/dist/esm/customer/users/schema.d.ts +140 -139
- package/dist/esm/customer/users/schema.d.ts.map +1 -1
- package/dist/esm/customer/users/schema.js +58 -46
- package/dist/esm/customer/users/schema.test.js +22 -35
- package/dist/esm/customer/users/utils.d.ts +3 -2
- package/dist/esm/customer/users/utils.d.ts.map +1 -1
- package/dist/esm/customer/users/utils.test.js +1 -1
- package/dist/esm/identity/schema.d.ts +5 -1
- package/dist/esm/identity/schema.d.ts.map +1 -1
- package/dist/esm/identity/schema.js +5 -2
- package/dist/esm/identity/schema.test.js +21 -16
- package/dist/esm/oauth/authorize/schema/grants/authorization-code.d.ts +31 -28
- package/dist/esm/oauth/authorize/schema/grants/authorization-code.d.ts.map +1 -1
- package/dist/esm/oauth/authorize/schema/grants/authorization-code.js +56 -37
- package/dist/esm/oauth/authorize/schema/grants/authorization-code.test.js +44 -45
- package/dist/esm/oauth/authorize/schema/grants/implicit.d.ts +16 -10
- package/dist/esm/oauth/authorize/schema/grants/implicit.d.ts.map +1 -1
- package/dist/esm/oauth/authorize/schema/grants/implicit.js +19 -10
- package/dist/esm/oauth/authorize/schema/schema.d.ts +44 -36
- package/dist/esm/oauth/authorize/schema/schema.d.ts.map +1 -1
- package/dist/esm/oauth/common/schema.d.ts +21 -7
- package/dist/esm/oauth/common/schema.d.ts.map +1 -1
- package/dist/esm/oauth/common/schema.js +20 -7
- package/dist/esm/oauth/common/schema.test.js +25 -26
- package/dist/esm/oauth/token/schema/grants/authorization-code.d.ts +12 -9
- package/dist/esm/oauth/token/schema/grants/authorization-code.d.ts.map +1 -1
- package/dist/esm/oauth/token/schema/grants/authorization-code.js +11 -10
- package/dist/esm/oauth/token/schema/grants/client-credentials.d.ts +20 -15
- package/dist/esm/oauth/token/schema/grants/client-credentials.d.ts.map +1 -1
- package/dist/esm/oauth/token/schema/grants/client-credentials.js +13 -8
- package/dist/esm/oauth/token/schema/grants/refresh-token.d.ts +11 -8
- package/dist/esm/oauth/token/schema/grants/refresh-token.d.ts.map +1 -1
- package/dist/esm/oauth/token/schema/grants/refresh-token.js +6 -6
- package/dist/esm/oauth/token/schema/schema.d.ts +28 -21
- package/dist/esm/oauth/token/schema/schema.d.ts.map +1 -1
- package/dist/esm/oauth/token/schema/schema.test.js +42 -28
- package/dist/esm/workspace/authorization/schema.d.ts +44 -27
- package/dist/esm/workspace/authorization/schema.d.ts.map +1 -1
- package/dist/esm/workspace/authorization/schema.js +16 -11
- package/dist/esm/workspace/branding/schema.d.ts +30 -37
- package/dist/esm/workspace/branding/schema.d.ts.map +1 -1
- package/dist/esm/workspace/branding/schema.js +20 -15
- package/dist/esm/workspace/membership/schema.d.ts +21 -20
- package/dist/esm/workspace/membership/schema.d.ts.map +1 -1
- package/dist/esm/workspace/membership/schema.js +6 -6
- package/dist/esm/workspace/registration/schema.d.ts +26 -27
- package/dist/esm/workspace/registration/schema.d.ts.map +1 -1
- package/dist/esm/workspace/registration/schema.js +13 -11
- package/dist/esm/workspace/settings/schema.d.ts +12 -19
- package/dist/esm/workspace/settings/schema.d.ts.map +1 -1
- package/dist/esm/workspace/settings/schema.js +7 -6
- package/dist/esm/workspace/settings/schema.test.js +18 -19
- package/dist/esm/workspace/tenant/schema.d.ts +55 -57
- package/dist/esm/workspace/tenant/schema.d.ts.map +1 -1
- package/dist/esm/workspace/tenant/schema.js +17 -12
- package/dist/esm/workspace/user/notifications/schema.d.ts +50 -56
- package/dist/esm/workspace/user/notifications/schema.d.ts.map +1 -1
- package/dist/esm/workspace/user/notifications/schema.js +26 -23
- package/dist/esm/workspace/user/preferences/schema.d.ts +18 -25
- package/dist/esm/workspace/user/preferences/schema.d.ts.map +1 -1
- package/dist/esm/workspace/user/preferences/schema.js +16 -11
- package/package.json +3 -3
- package/src/action/schema/base.test.ts.bak +152 -0
- package/src/action/schema/operations/set-password.test.ts.bak +197 -0
- package/src/action/schema/operations/sign-up-verification.test.ts.bak +163 -0
- package/src/action/schema/operations/sign-up.test.ts.bak +203 -0
- package/src/action/schema/operations/user-attribute-verification.test.ts.bak +148 -0
- package/src/action/schema/schema.test.ts.bak +218 -0
- package/src/activity/schema/base.test.ts.bak +291 -0
- package/src/activity/schema/schema.test.ts.bak +392 -0
- package/src/activity/schema/types/authentication.test.ts.bak +337 -0
- package/src/activity/schema/types/authorization.test.ts.bak +379 -0
- package/src/activity/schema/types/note.test.ts.bak +367 -0
- package/src/activity/schema/types/operation.test.ts.bak +379 -0
- package/src/activity/schema/types/unknown.test.ts.bak +304 -0
- package/src/app/authorization/schema.test.ts.bak +412 -0
- package/src/app/oidc/schema.test.ts.bak +117 -0
- package/src/app/registration/schema.test.ts.bak +308 -0
- package/src/app/schema.test.ts.bak +221 -0
- package/src/association/schema.test.ts.bak +148 -0
- package/src/authentication/factors/schema.test.ts.bak +174 -0
- package/src/authentication/settings/schema.test.ts.bak +91 -0
- package/src/authentication/strategies/schema/types/email.test.ts.bak +252 -0
- package/src/authorization/permissions/schema.test.ts.bak +267 -0
- package/src/authorization/roles/schema.test.ts.bak +283 -0
- package/src/common/schema/aggregate.test.ts.bak +89 -0
- package/src/common/schema/collection.test.ts.bak +116 -0
- package/src/common/schema/dates.test.ts.bak +49 -0
- package/src/common/schema/id.test.ts.bak +149 -0
- package/src/common/schema/jwt.test.ts.bak +61 -0
- package/src/common/schema/metadata.test.ts.bak +141 -0
- package/src/common/schema/pagination.test.ts.bak +80 -0
- package/src/common/schema/schema.test.ts.bak +41 -0
- package/src/common/schema/sets.test.ts.bak +108 -0
- package/src/customer/users/schema.test.ts.bak +138 -0
- package/src/identity/schema.test.ts.bak +48 -0
- package/src/oauth/token/schema/schema.test.ts.bak +142 -0
- package/src/workspace/settings/schema.test.ts.bak +88 -0
|
@@ -1,42 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const UnknownActivitySchema: z.ZodObject<{
|
|
3
|
+
type: z.ZodLiteral<"unknown">;
|
|
4
|
+
message: z.ZodString;
|
|
5
|
+
metadata: z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodNull, z.ZodCustom<Map<string, string | number | boolean>, Map<string, string | number | boolean>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>, z.ZodTransform<Map<string, string | number | boolean>, Record<string, string | number | boolean> | Map<string, string | number | boolean> | null | undefined>>;
|
|
6
|
+
createdAt: z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>;
|
|
7
|
+
updatedAt: z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>;
|
|
8
|
+
deletedAt: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>>;
|
|
9
|
+
deactivatedAt: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>>;
|
|
10
|
+
id: z.ZodString;
|
|
11
|
+
performedBy: z.ZodObject<{
|
|
12
|
+
type: z.ZodEnum<{
|
|
13
|
+
system: "system";
|
|
14
|
+
guest: "guest";
|
|
15
|
+
identity: "identity";
|
|
16
|
+
automation: "automation";
|
|
17
|
+
integration: "integration";
|
|
18
|
+
}>;
|
|
19
|
+
identifier: z.ZodString;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
source: z.ZodString;
|
|
22
|
+
app: z.ZodOptional<z.ZodString>;
|
|
23
|
+
isMutateable: z.ZodBoolean;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
export type UnknownActivityProperties = z.input<typeof UnknownActivitySchema>;
|
|
26
|
+
export type UnknownActivity = z.output<typeof UnknownActivitySchema>;
|
|
27
|
+
export declare const UnknownActivityPayloadSchema: z.ZodObject<{
|
|
28
|
+
type: z.ZodLiteral<"unknown">;
|
|
29
|
+
message: z.ZodString;
|
|
30
|
+
metadata: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodNull, z.ZodCustom<Map<string, string | number | boolean>, Map<string, string | number | boolean>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>, z.ZodTransform<Record<string, string | number | boolean> | undefined, Record<string, string | number | boolean> | Map<string, string | number | boolean> | null | undefined>>>;
|
|
31
|
+
createdAt: z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>, z.ZodTransform<string, Date>>;
|
|
32
|
+
updatedAt: z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>, z.ZodTransform<string, Date>>;
|
|
33
|
+
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>>>;
|
|
34
|
+
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>>>;
|
|
35
|
+
id: z.ZodString;
|
|
36
|
+
performedBy: z.ZodObject<{
|
|
37
|
+
type: z.ZodEnum<{
|
|
38
|
+
system: "system";
|
|
39
|
+
guest: "guest";
|
|
40
|
+
identity: "identity";
|
|
41
|
+
automation: "automation";
|
|
42
|
+
integration: "integration";
|
|
43
|
+
}>;
|
|
44
|
+
identifier: z.ZodString;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
source: z.ZodString;
|
|
47
|
+
app: z.ZodOptional<z.ZodString>;
|
|
48
|
+
isMutateable: z.ZodBoolean;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
export type UnknownActivityPayload = z.output<typeof UnknownActivityPayloadSchema>;
|
|
42
51
|
//# sourceMappingURL=unknown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unknown.d.ts","sourceRoot":"","sources":["../../../../../src/activity/schema/types/unknown.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"unknown.d.ts","sourceRoot":"","sources":["../../../../../src/activity/schema/types/unknown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;iBAGhC,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC9E,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAErE,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;iBAGvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAC3C,OAAO,4BAA4B,CACpC,CAAC"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
import { BasePayloadSchema, BaseSchema } from '../base.js';
|
|
3
|
-
const BaseUnknownSchema =
|
|
4
|
-
type:
|
|
5
|
-
message:
|
|
3
|
+
const BaseUnknownSchema = z.object({
|
|
4
|
+
type: z.literal('unknown'),
|
|
5
|
+
message: z.string(),
|
|
6
|
+
});
|
|
7
|
+
export const UnknownActivitySchema = z.object({
|
|
8
|
+
...BaseSchema.shape,
|
|
9
|
+
...BaseUnknownSchema.shape,
|
|
10
|
+
});
|
|
11
|
+
export const UnknownActivityPayloadSchema = z.object({
|
|
12
|
+
...BasePayloadSchema.shape,
|
|
13
|
+
...BaseUnknownSchema.shape,
|
|
6
14
|
});
|
|
7
|
-
export const UnknownActivitySchema = BaseSchema.and(BaseUnknownSchema);
|
|
8
|
-
export const UnknownActivityPayloadSchema = BasePayloadSchema.and(BaseUnknownSchema);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type } from 'arktype';
|
|
2
1
|
import { describe, expect, test } from 'vitest';
|
|
3
2
|
import { generateActivityId } from '../utils.js';
|
|
4
3
|
import { UnknownActivityPayloadSchema, UnknownActivitySchema, } from './unknown.js';
|
|
@@ -19,8 +18,8 @@ describe('Activity Schema - Unknown', () => {
|
|
|
19
18
|
updatedAt: new Date(),
|
|
20
19
|
metadata: { webhook_source: 'third-party', event_type: 'custom' },
|
|
21
20
|
};
|
|
22
|
-
const result = UnknownActivitySchema(activity);
|
|
23
|
-
|
|
21
|
+
const result = UnknownActivitySchema.safeParse(activity);
|
|
22
|
+
// Parse succeeds for valid data
|
|
24
23
|
});
|
|
25
24
|
test('should accept unknown activity with system performer', () => {
|
|
26
25
|
const activity = {
|
|
@@ -37,8 +36,8 @@ describe('Activity Schema - Unknown', () => {
|
|
|
37
36
|
updatedAt: new Date(),
|
|
38
37
|
metadata: { severity: 'low', category: 'anomaly' },
|
|
39
38
|
};
|
|
40
|
-
const result = UnknownActivitySchema(activity);
|
|
41
|
-
|
|
39
|
+
const result = UnknownActivitySchema.safeParse(activity);
|
|
40
|
+
// Parse succeeds for valid data
|
|
42
41
|
});
|
|
43
42
|
test('should accept unknown activity with integration performer', () => {
|
|
44
43
|
const activity = {
|
|
@@ -59,8 +58,8 @@ describe('Activity Schema - Unknown', () => {
|
|
|
59
58
|
raw_data: '{"type":"unknown","data":{}}',
|
|
60
59
|
},
|
|
61
60
|
};
|
|
62
|
-
const result = UnknownActivitySchema(activity);
|
|
63
|
-
|
|
61
|
+
const result = UnknownActivitySchema.safeParse(activity);
|
|
62
|
+
// Parse succeeds for valid data
|
|
64
63
|
});
|
|
65
64
|
test('should accept unknown activity with optional fields', () => {
|
|
66
65
|
const activity = {
|
|
@@ -82,8 +81,8 @@ describe('Activity Schema - Unknown', () => {
|
|
|
82
81
|
migrated: false,
|
|
83
82
|
},
|
|
84
83
|
};
|
|
85
|
-
const result = UnknownActivitySchema(activity);
|
|
86
|
-
|
|
84
|
+
const result = UnknownActivitySchema.safeParse(activity);
|
|
85
|
+
// Parse succeeds for valid data
|
|
87
86
|
});
|
|
88
87
|
test('should reject unknown activity with wrong type', () => {
|
|
89
88
|
const activity = {
|
|
@@ -100,8 +99,8 @@ describe('Activity Schema - Unknown', () => {
|
|
|
100
99
|
updatedAt: new Date(),
|
|
101
100
|
metadata: {},
|
|
102
101
|
};
|
|
103
|
-
const result = UnknownActivitySchema(activity);
|
|
104
|
-
expect(result).
|
|
102
|
+
const result = UnknownActivitySchema.safeParse(activity);
|
|
103
|
+
expect(result.success).toBe(false);
|
|
105
104
|
});
|
|
106
105
|
test('should reject unknown activity missing message', () => {
|
|
107
106
|
const activity = {
|
|
@@ -118,8 +117,8 @@ describe('Activity Schema - Unknown', () => {
|
|
|
118
117
|
updatedAt: new Date(),
|
|
119
118
|
metadata: {},
|
|
120
119
|
};
|
|
121
|
-
const result = UnknownActivitySchema(activity);
|
|
122
|
-
expect(result).
|
|
120
|
+
const result = UnknownActivitySchema.safeParse(activity);
|
|
121
|
+
expect(result.success).toBe(false);
|
|
123
122
|
});
|
|
124
123
|
test('should reject unknown activity with non-string message', () => {
|
|
125
124
|
const activity = {
|
|
@@ -136,8 +135,8 @@ describe('Activity Schema - Unknown', () => {
|
|
|
136
135
|
updatedAt: new Date(),
|
|
137
136
|
metadata: {},
|
|
138
137
|
};
|
|
139
|
-
const result = UnknownActivitySchema(activity);
|
|
140
|
-
expect(result).
|
|
138
|
+
const result = UnknownActivitySchema.safeParse(activity);
|
|
139
|
+
expect(result.success).toBe(false);
|
|
141
140
|
});
|
|
142
141
|
test('should reject unknown activity missing required base fields', () => {
|
|
143
142
|
const activity = {
|
|
@@ -146,8 +145,8 @@ describe('Activity Schema - Unknown', () => {
|
|
|
146
145
|
message: 'Test message',
|
|
147
146
|
// missing performedBy, source, isMutateable, dates, metadata
|
|
148
147
|
};
|
|
149
|
-
const result = UnknownActivitySchema(activity);
|
|
150
|
-
expect(result).
|
|
148
|
+
const result = UnknownActivitySchema.safeParse(activity);
|
|
149
|
+
expect(result.success).toBe(false);
|
|
151
150
|
});
|
|
152
151
|
});
|
|
153
152
|
describe('UnknownActivityPayloadSchema', () => {
|
|
@@ -170,9 +169,9 @@ describe('Activity Schema - Unknown', () => {
|
|
|
170
169
|
processed: false,
|
|
171
170
|
},
|
|
172
171
|
};
|
|
173
|
-
const result = UnknownActivityPayloadSchema(payload);
|
|
174
|
-
|
|
175
|
-
expect(result).toEqual(payload);
|
|
172
|
+
const result = UnknownActivityPayloadSchema.safeParse(payload);
|
|
173
|
+
// Parse succeeds for valid data
|
|
174
|
+
expect(result.data).toEqual(payload);
|
|
176
175
|
});
|
|
177
176
|
test('should accept minimal unknown activity payload', () => {
|
|
178
177
|
const payload = {
|
|
@@ -189,8 +188,8 @@ describe('Activity Schema - Unknown', () => {
|
|
|
189
188
|
updatedAt: new Date().toISOString(),
|
|
190
189
|
metadata: {},
|
|
191
190
|
};
|
|
192
|
-
const result = UnknownActivityPayloadSchema(payload);
|
|
193
|
-
|
|
191
|
+
const result = UnknownActivityPayloadSchema.safeParse(payload);
|
|
192
|
+
// Parse succeeds for valid data
|
|
194
193
|
});
|
|
195
194
|
test('should accept payload with optional date fields', () => {
|
|
196
195
|
const payload = {
|
|
@@ -212,8 +211,8 @@ describe('Activity Schema - Unknown', () => {
|
|
|
212
211
|
retention_policy: 'long_term',
|
|
213
212
|
},
|
|
214
213
|
};
|
|
215
|
-
const result = UnknownActivityPayloadSchema(payload);
|
|
216
|
-
|
|
214
|
+
const result = UnknownActivityPayloadSchema.safeParse(payload);
|
|
215
|
+
// Parse succeeds for valid data
|
|
217
216
|
});
|
|
218
217
|
test('should reject payload with invalid date format', () => {
|
|
219
218
|
const payload = {
|
|
@@ -230,8 +229,8 @@ describe('Activity Schema - Unknown', () => {
|
|
|
230
229
|
updatedAt: new Date().toISOString(),
|
|
231
230
|
metadata: {},
|
|
232
231
|
};
|
|
233
|
-
const result = UnknownActivityPayloadSchema(payload);
|
|
234
|
-
expect(result).
|
|
232
|
+
const result = UnknownActivityPayloadSchema.safeParse(payload);
|
|
233
|
+
expect(result.success).toBe(false);
|
|
235
234
|
});
|
|
236
235
|
test('should reject payload with wrong type', () => {
|
|
237
236
|
const payload = {
|
|
@@ -248,8 +247,8 @@ describe('Activity Schema - Unknown', () => {
|
|
|
248
247
|
updatedAt: new Date().toISOString(),
|
|
249
248
|
metadata: {},
|
|
250
249
|
};
|
|
251
|
-
const result = UnknownActivityPayloadSchema(payload);
|
|
252
|
-
expect(result).
|
|
250
|
+
const result = UnknownActivityPayloadSchema.safeParse(payload);
|
|
251
|
+
expect(result.success).toBe(false);
|
|
253
252
|
});
|
|
254
253
|
test('should reject payload missing message', () => {
|
|
255
254
|
const payload = {
|
|
@@ -266,8 +265,8 @@ describe('Activity Schema - Unknown', () => {
|
|
|
266
265
|
updatedAt: new Date().toISOString(),
|
|
267
266
|
metadata: {},
|
|
268
267
|
};
|
|
269
|
-
const result = UnknownActivityPayloadSchema(payload);
|
|
270
|
-
expect(result).
|
|
268
|
+
const result = UnknownActivityPayloadSchema.safeParse(payload);
|
|
269
|
+
expect(result.success).toBe(false);
|
|
271
270
|
});
|
|
272
271
|
});
|
|
273
272
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../../src/app/authorization/resources.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../../src/app/authorization/resources.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAMpE,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,wBAAwB,EAE9B,MAAM,aAAa,CAAC;AAIrB,qBAAa,sBAAsB;IACd,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,aAAa;IAE3D,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAIhC,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAI3C,UAAU,CACf,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,wBAAwB,GAC7B,OAAO,CAAC,aAAa,CAAC;CAG1B;AAED,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,aAAa,EACvB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,aAAa,CAAC,CAOxB;AAED,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,aAAa,EACvB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,wBAAwB,GAC7B,OAAO,CAAC,aAAa,CAAC,CAQxB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getItemWithAuthorization, updateItemWithAuthorization, } from '../../common/resources/operations.js';
|
|
2
|
-
import { parseEgressSchema } from '../../common/resources/utils.js';
|
|
3
2
|
import { PATH } from '../resources.js';
|
|
4
3
|
import { AuthorizationSchema, UpsertAuthorizationPayloadSchema, } from './schema.js';
|
|
5
4
|
const RESOURCE = 'authorization';
|
|
@@ -19,8 +18,8 @@ export class AuthorizationResources {
|
|
|
19
18
|
}
|
|
20
19
|
}
|
|
21
20
|
export async function getAuthorization(instance, appId) {
|
|
22
|
-
return
|
|
21
|
+
return AuthorizationSchema.parse(await getItemWithAuthorization(new URL(AuthorizationResources.buildPath(appId), instance.config.host), instance.authorizer));
|
|
23
22
|
}
|
|
24
23
|
export async function upsertAuthorization(instance, appId, item) {
|
|
25
|
-
return
|
|
24
|
+
return AuthorizationSchema.parse(await updateItemWithAuthorization(new URL(AuthorizationResources.buildPath(appId), instance.config.host), instance.authorizer, UpsertAuthorizationPayloadSchema.parse(item)));
|
|
26
25
|
}
|
|
@@ -1,54 +1,98 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
import { type AnyGrantType } from '../../oauth/common/schema.js';
|
|
2
|
-
export declare const AuthorizationSchema:
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
3
|
+
export declare const AuthorizationSchema: z.ZodObject<{
|
|
4
|
+
metadata: z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodNull, z.ZodCustom<Map<string, string | number | boolean>, Map<string, string | number | boolean>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>, z.ZodTransform<Map<string, string | number | boolean>, Record<string, string | number | boolean> | Map<string, string | number | boolean> | null | undefined>>;
|
|
5
|
+
loginUri: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodUndefined]>>;
|
|
6
|
+
callbackUrls: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<Set<URL> | undefined, Set<URL> | URL[] | undefined>>>;
|
|
7
|
+
availableAudiences: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>, z.ZodCustom<Set<string>, Set<string>>]>, z.ZodTransform<Set<string> | undefined, Set<string> | string[] | undefined>>>;
|
|
8
|
+
availableGrants: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodEnum<{
|
|
9
|
+
client_credentials: "client_credentials";
|
|
10
|
+
authorization_code: "authorization_code";
|
|
11
|
+
implicit: "implicit";
|
|
12
|
+
refresh_token: "refresh_token";
|
|
13
|
+
}>>, z.ZodCustom<Set<AnyGrantType>, Set<AnyGrantType>>]>, z.ZodTransform<Set<AnyGrantType> | undefined, Set<AnyGrantType> | ("client_credentials" | "authorization_code" | "implicit" | "refresh_token")[] | undefined>>>;
|
|
14
|
+
defaultAudience: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>>;
|
|
15
|
+
updatedAt: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>>;
|
|
16
|
+
deletedAt: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>>;
|
|
17
|
+
deactivatedAt: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>>;
|
|
18
|
+
refreshTokenDuration: z.ZodDefault<z.ZodNumber>;
|
|
19
|
+
accessTokenDuration: z.ZodDefault<z.ZodNumber>;
|
|
20
|
+
accessTokenSignatureAlgorithm: z.ZodDefault<z.ZodEnum<{
|
|
21
|
+
RS256: "RS256";
|
|
22
|
+
HS256: "HS256";
|
|
23
|
+
HS384: "HS384";
|
|
24
|
+
HS512: "HS512";
|
|
25
|
+
RS384: "RS384";
|
|
26
|
+
RS512: "RS512";
|
|
27
|
+
ES256: "ES256";
|
|
28
|
+
ES384: "ES384";
|
|
29
|
+
PS256: "PS256";
|
|
30
|
+
PS384: "PS384";
|
|
31
|
+
PS512: "PS512";
|
|
32
|
+
}>>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
export type AuthorizationProperties = z.input<typeof AuthorizationSchema>;
|
|
35
|
+
export type Authorization = z.output<typeof AuthorizationSchema>;
|
|
36
|
+
export declare const AuthorizationPayloadSchema: z.ZodObject<{
|
|
37
|
+
metadata: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodNull, z.ZodCustom<Map<string, string | number | boolean>, Map<string, string | number | boolean>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>, z.ZodTransform<Record<string, string | number | boolean> | undefined, Record<string, string | number | boolean> | Map<string, string | number | boolean> | null | undefined>>>;
|
|
38
|
+
loginUri: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodUndefined]>>;
|
|
39
|
+
callbackUrls: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<URL[] | undefined, Set<URL> | URL[] | undefined>>>;
|
|
40
|
+
availableAudiences: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>, z.ZodCustom<Set<string>, Set<string>>]>, z.ZodTransform<string[] | undefined, Set<string> | string[] | undefined>>>;
|
|
41
|
+
availableGrants: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodEnum<{
|
|
42
|
+
client_credentials: "client_credentials";
|
|
43
|
+
authorization_code: "authorization_code";
|
|
44
|
+
implicit: "implicit";
|
|
45
|
+
refresh_token: "refresh_token";
|
|
46
|
+
}>>, z.ZodCustom<Set<AnyGrantType>, Set<AnyGrantType>>]>, z.ZodTransform<("client_credentials" | "authorization_code" | "implicit" | "refresh_token")[] | undefined, Set<AnyGrantType> | ("client_credentials" | "authorization_code" | "implicit" | "refresh_token")[] | undefined>>>;
|
|
47
|
+
defaultAudience: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>>;
|
|
48
|
+
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>>>;
|
|
49
|
+
deletedAt: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>, z.ZodTransform<string | undefined, Date | undefined>>>;
|
|
50
|
+
deactivatedAt: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>, z.ZodTransform<string | undefined, Date | undefined>>>;
|
|
51
|
+
refreshTokenDuration: z.ZodDefault<z.ZodNumber>;
|
|
52
|
+
accessTokenDuration: z.ZodDefault<z.ZodNumber>;
|
|
53
|
+
accessTokenSignatureAlgorithm: z.ZodDefault<z.ZodEnum<{
|
|
54
|
+
RS256: "RS256";
|
|
55
|
+
HS256: "HS256";
|
|
56
|
+
HS384: "HS384";
|
|
57
|
+
HS512: "HS512";
|
|
58
|
+
RS384: "RS384";
|
|
59
|
+
RS512: "RS512";
|
|
60
|
+
ES256: "ES256";
|
|
61
|
+
ES384: "ES384";
|
|
62
|
+
PS256: "PS256";
|
|
63
|
+
PS384: "PS384";
|
|
64
|
+
PS512: "PS512";
|
|
65
|
+
}>>;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
export type AuthorizationPayload = z.output<typeof AuthorizationPayloadSchema>;
|
|
68
|
+
export declare const UpsertAuthorizationPayloadSchema: z.ZodObject<{
|
|
69
|
+
metadata: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodNull, z.ZodCustom<Map<string, string | number | boolean>, Map<string, string | number | boolean>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>, z.ZodTransform<Record<string, string | number | boolean> | null | undefined, Record<string, string | number | boolean> | Map<string, string | number | boolean> | null | undefined>>>;
|
|
70
|
+
loginUri: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodUndefined]>>;
|
|
71
|
+
callbackUrls: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<URL[] | undefined, Set<URL> | URL[] | undefined>>>;
|
|
72
|
+
availableAudiences: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>, z.ZodCustom<Set<string>, Set<string>>]>, z.ZodTransform<string[] | undefined, Set<string> | string[] | undefined>>>;
|
|
73
|
+
availableGrants: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodEnum<{
|
|
74
|
+
client_credentials: "client_credentials";
|
|
75
|
+
authorization_code: "authorization_code";
|
|
76
|
+
implicit: "implicit";
|
|
77
|
+
refresh_token: "refresh_token";
|
|
78
|
+
}>>, z.ZodCustom<Set<AnyGrantType>, Set<AnyGrantType>>]>, z.ZodTransform<("client_credentials" | "authorization_code" | "implicit" | "refresh_token")[] | undefined, Set<AnyGrantType> | ("client_credentials" | "authorization_code" | "implicit" | "refresh_token")[] | undefined>>>;
|
|
79
|
+
defaultAudience: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>>;
|
|
80
|
+
refreshTokenDuration: z.ZodDefault<z.ZodNumber>;
|
|
81
|
+
accessTokenDuration: z.ZodDefault<z.ZodNumber>;
|
|
82
|
+
accessTokenSignatureAlgorithm: z.ZodDefault<z.ZodEnum<{
|
|
83
|
+
RS256: "RS256";
|
|
84
|
+
HS256: "HS256";
|
|
85
|
+
HS384: "HS384";
|
|
86
|
+
HS512: "HS512";
|
|
87
|
+
RS384: "RS384";
|
|
88
|
+
RS512: "RS512";
|
|
89
|
+
ES256: "ES256";
|
|
90
|
+
ES384: "ES384";
|
|
91
|
+
PS256: "PS256";
|
|
92
|
+
PS384: "PS384";
|
|
93
|
+
PS512: "PS512";
|
|
94
|
+
}>>;
|
|
95
|
+
}, z.core.$strip>;
|
|
96
|
+
export type UpsertAuthorizationInput = z.input<typeof UpsertAuthorizationPayloadSchema>;
|
|
97
|
+
export type UpsertAuthorizationPayload = z.output<typeof UpsertAuthorizationPayloadSchema>;
|
|
54
98
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/app/authorization/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/app/authorization/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,OAAO,EAAE,KAAK,YAAY,EAAa,MAAM,8BAA8B,CAAC;AA0D5E,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAW9B,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAWrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE/E,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQ3C,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,gCAAgC,CACxC,CAAC;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAC/C,OAAO,gCAAgC,CACxC,CAAC"}
|
|
@@ -1,70 +1,79 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
import { OptionalDatePayloadSchema, OptionalDateSchema, } from '../../common/schema/dates.js';
|
|
3
3
|
import { MetadataMapPropertySchema, MetadataPayloadPropertySchema, UpsertMetadataPropertyPayloadSchema, } from '../../common/schema/metadata.js';
|
|
4
4
|
import { GrantType } from '../../oauth/common/schema.js';
|
|
5
5
|
import { AuthorizationPayloadSchema as WorkspaceAuthorizationPayloadSchema } from '../../workspace/authorization/schema.js';
|
|
6
|
-
const UrlSetSchema =
|
|
7
|
-
const UrlArrayScheama =
|
|
8
|
-
const StringSetSchema =
|
|
6
|
+
const UrlSetSchema = z.instanceof((Set));
|
|
7
|
+
const UrlArrayScheama = z.array(z.url().pipe(z.transform((url) => new URL(url))));
|
|
8
|
+
const StringSetSchema = z.instanceof((Set));
|
|
9
9
|
// const UrlStringSchema = type('string.url[]').pipe((v) => v?.filter((i) => !!i));
|
|
10
|
-
const StringSchema =
|
|
10
|
+
const StringSchema = z
|
|
11
|
+
.array(z.string())
|
|
12
|
+
.pipe(z.transform((v) => v?.filter((i) => !!i)));
|
|
11
13
|
// const CallbackUrlsSchema = type('undefined')
|
|
12
14
|
// .or(UrlArrayScheama)
|
|
13
15
|
// .or(UrlSetSchema)
|
|
14
16
|
// .pipe((v) => (v instanceof Set ? Array.from(v.values()) : v));
|
|
15
|
-
const CallbackUrlArraySchema =
|
|
16
|
-
.
|
|
17
|
-
.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
.
|
|
21
|
-
|
|
22
|
-
.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
.
|
|
26
|
-
.pipe((v) => (v instanceof Set ?
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
.
|
|
30
|
-
.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
.
|
|
37
|
-
|
|
38
|
-
.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
17
|
+
const CallbackUrlArraySchema = z
|
|
18
|
+
.union([z.undefined(), UrlArrayScheama, UrlSetSchema])
|
|
19
|
+
.pipe(z.transform((v) => (v instanceof Set ? Array.from(v.values()) : v)));
|
|
20
|
+
const CallbackUrlSetSchema = z
|
|
21
|
+
.union([z.undefined(), UrlArrayScheama, UrlSetSchema])
|
|
22
|
+
.pipe(z.transform((v) => (!v || v instanceof Set ? v : new Set(v))));
|
|
23
|
+
const AvailableAudienceArraySchema = z
|
|
24
|
+
.union([z.undefined(), StringSchema, StringSetSchema])
|
|
25
|
+
.pipe(z.transform((v) => (v instanceof Set ? Array.from(v.values()) : v)));
|
|
26
|
+
const AvailableAudienceSetSchema = z
|
|
27
|
+
.union([z.undefined(), StringSchema, StringSetSchema])
|
|
28
|
+
.pipe(z.transform((v) => (!v || v instanceof Set ? v : new Set(v))));
|
|
29
|
+
const GrantSetSchema = z.instanceof((Set));
|
|
30
|
+
const GrantArraySchema = z.array(z.enum([
|
|
31
|
+
GrantType.AUTHORIZATION_CODE,
|
|
32
|
+
GrantType.CLIENT_CREDENTIALS,
|
|
33
|
+
GrantType.IMPLICIT,
|
|
34
|
+
GrantType.REFRESH_TOKEN,
|
|
35
|
+
]));
|
|
36
|
+
const AvailableGrantSetSchema = z
|
|
37
|
+
.union([z.undefined(), GrantArraySchema, GrantSetSchema])
|
|
38
|
+
.pipe(z.transform((v) => (!v || v instanceof Set ? v : new Set(v))));
|
|
39
|
+
const AvailableGrantArraySchema = z
|
|
40
|
+
.union([z.undefined(), GrantArraySchema, GrantSetSchema])
|
|
41
|
+
.pipe(z.transform((v) => (v instanceof Set ? Array.from(v.values()) : v)));
|
|
42
|
+
const BaseAuthorization = WorkspaceAuthorizationPayloadSchema.pick({
|
|
43
|
+
refreshTokenDuration: true,
|
|
44
|
+
accessTokenDuration: true,
|
|
45
|
+
accessTokenSignatureAlgorithm: true,
|
|
46
|
+
});
|
|
47
|
+
export const AuthorizationSchema = z.object({
|
|
48
|
+
...BaseAuthorization.shape,
|
|
49
|
+
loginUri: z.union([z.url(), z.undefined()]).optional(),
|
|
46
50
|
callbackUrls: CallbackUrlSetSchema.optional(),
|
|
47
51
|
availableAudiences: AvailableAudienceSetSchema.optional(),
|
|
48
52
|
availableGrants: AvailableGrantSetSchema.optional(),
|
|
49
|
-
defaultAudience:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
defaultAudience: z.union([z.string(), z.undefined()]).optional(),
|
|
54
|
+
updatedAt: OptionalDateSchema.optional(),
|
|
55
|
+
deletedAt: OptionalDateSchema.optional(),
|
|
56
|
+
deactivatedAt: OptionalDateSchema.optional(),
|
|
57
|
+
...MetadataMapPropertySchema.shape,
|
|
58
|
+
});
|
|
59
|
+
export const AuthorizationPayloadSchema = z.object({
|
|
60
|
+
...BaseAuthorization.shape,
|
|
61
|
+
loginUri: z.union([z.url(), z.undefined()]).optional(),
|
|
56
62
|
callbackUrls: CallbackUrlArraySchema.optional(),
|
|
57
63
|
availableAudiences: AvailableAudienceArraySchema.optional(),
|
|
58
64
|
availableGrants: AvailableGrantArraySchema.optional(),
|
|
59
|
-
defaultAudience:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
defaultAudience: z.union([z.string(), z.undefined()]).optional(),
|
|
66
|
+
updatedAt: OptionalDatePayloadSchema.optional(),
|
|
67
|
+
deletedAt: OptionalDatePayloadSchema.optional(),
|
|
68
|
+
deactivatedAt: OptionalDatePayloadSchema.optional(),
|
|
69
|
+
...MetadataPayloadPropertySchema.shape,
|
|
70
|
+
});
|
|
71
|
+
export const UpsertAuthorizationPayloadSchema = z.object({
|
|
72
|
+
...BaseAuthorization.shape,
|
|
73
|
+
loginUri: z.union([z.url(), z.undefined()]).optional(),
|
|
66
74
|
callbackUrls: CallbackUrlArraySchema.optional(),
|
|
67
75
|
availableAudiences: AvailableAudienceArraySchema.optional(),
|
|
68
76
|
availableGrants: AvailableGrantArraySchema.optional(),
|
|
69
|
-
defaultAudience:
|
|
70
|
-
|
|
77
|
+
defaultAudience: z.union([z.string(), z.undefined()]).optional(),
|
|
78
|
+
...UpsertMetadataPropertyPayloadSchema.shape,
|
|
79
|
+
});
|