@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,4 +1,3 @@
|
|
|
1
|
-
import { type } from 'arktype';
|
|
2
1
|
import { describe, expect, test } from 'vitest';
|
|
3
2
|
import { generateAppId } from '../app/utils.js';
|
|
4
3
|
import { generatePermissionId, generateRoleId, } from '../authorization/schema.js';
|
|
@@ -17,18 +16,21 @@ describe('Association - Schema', () => {
|
|
|
17
16
|
describe('AssociationIdReferenceSchema', () => {
|
|
18
17
|
test('should accept valid id reference', () => {
|
|
19
18
|
const reference = { id: 'any_string_id' };
|
|
20
|
-
const result = AssociationIdReferenceSchema(reference);
|
|
21
|
-
|
|
22
|
-
expect(result).
|
|
19
|
+
const result = AssociationIdReferenceSchema.safeParse(reference);
|
|
20
|
+
// Parse succeeds for valid data
|
|
21
|
+
expect(result.success).toBe(true);
|
|
22
|
+
if (result.success) {
|
|
23
|
+
expect(result.data).toEqual(reference);
|
|
24
|
+
}
|
|
23
25
|
});
|
|
24
26
|
test('should reject missing id', () => {
|
|
25
|
-
const result = AssociationIdReferenceSchema({});
|
|
26
|
-
expect(result).
|
|
27
|
+
const result = AssociationIdReferenceSchema.safeParse({});
|
|
28
|
+
expect(result.success).toBe(false);
|
|
27
29
|
});
|
|
28
30
|
test('should reject non-string id', () => {
|
|
29
31
|
const reference = { id: 123 };
|
|
30
|
-
const result = AssociationIdReferenceSchema(reference);
|
|
31
|
-
expect(result).
|
|
32
|
+
const result = AssociationIdReferenceSchema.safeParse(reference);
|
|
33
|
+
expect(result.success).toBe(false);
|
|
32
34
|
});
|
|
33
35
|
});
|
|
34
36
|
describe('AssociationAttributesReferenceSchema', () => {
|
|
@@ -39,20 +41,26 @@ describe('Association - Schema', () => {
|
|
|
39
41
|
status: 'active',
|
|
40
42
|
metadata: { key: 'value' },
|
|
41
43
|
};
|
|
42
|
-
const result = AssociationAttributesReferenceSchema(reference);
|
|
43
|
-
|
|
44
|
-
expect(result).
|
|
44
|
+
const result = AssociationAttributesReferenceSchema.safeParse(reference);
|
|
45
|
+
// Parse succeeds for valid data
|
|
46
|
+
expect(result.success).toBe(true);
|
|
47
|
+
if (result.success) {
|
|
48
|
+
expect(result.data).toEqual(reference);
|
|
49
|
+
}
|
|
45
50
|
});
|
|
46
51
|
test('should accept minimal reference with just id', () => {
|
|
47
52
|
const reference = { id: 'minimal_id' };
|
|
48
|
-
const result = AssociationAttributesReferenceSchema(reference);
|
|
49
|
-
|
|
50
|
-
expect(result).
|
|
53
|
+
const result = AssociationAttributesReferenceSchema.safeParse(reference);
|
|
54
|
+
// Parse succeeds for valid data
|
|
55
|
+
expect(result.success).toBe(true);
|
|
56
|
+
if (result.success) {
|
|
57
|
+
expect(result.data).toEqual(reference);
|
|
58
|
+
}
|
|
51
59
|
});
|
|
52
60
|
test('should reject missing id', () => {
|
|
53
61
|
const reference = { name: 'Test', status: 'active' };
|
|
54
|
-
const result = AssociationAttributesReferenceSchema(reference);
|
|
55
|
-
expect(result).
|
|
62
|
+
const result = AssociationAttributesReferenceSchema.safeParse(reference);
|
|
63
|
+
expect(result.success).toBe(false);
|
|
56
64
|
});
|
|
57
65
|
});
|
|
58
66
|
describe('AssociationObjectSchema', () => {
|
|
@@ -65,8 +73,8 @@ describe('Association - Schema', () => {
|
|
|
65
73
|
label: 'Test App',
|
|
66
74
|
model: 'App',
|
|
67
75
|
};
|
|
68
|
-
const result = AssociationObjectSchema(appAssociation);
|
|
69
|
-
|
|
76
|
+
const result = AssociationObjectSchema.safeParse(appAssociation);
|
|
77
|
+
// Parse succeeds for valid data
|
|
70
78
|
});
|
|
71
79
|
test('should accept Role association reference', () => {
|
|
72
80
|
const roleAssociation = {
|
|
@@ -75,8 +83,8 @@ describe('Association - Schema', () => {
|
|
|
75
83
|
status: 'enabled',
|
|
76
84
|
model: 'Role',
|
|
77
85
|
};
|
|
78
|
-
const result = AssociationObjectSchema(roleAssociation);
|
|
79
|
-
|
|
86
|
+
const result = AssociationObjectSchema.safeParse(roleAssociation);
|
|
87
|
+
// Parse succeeds for valid data
|
|
80
88
|
});
|
|
81
89
|
test('should accept Permission association reference', () => {
|
|
82
90
|
const permissionAssociation = {
|
|
@@ -85,8 +93,8 @@ describe('Association - Schema', () => {
|
|
|
85
93
|
status: 'enabled',
|
|
86
94
|
model: 'Permission',
|
|
87
95
|
};
|
|
88
|
-
const result = AssociationObjectSchema(permissionAssociation);
|
|
89
|
-
|
|
96
|
+
const result = AssociationObjectSchema.safeParse(permissionAssociation);
|
|
97
|
+
// Parse succeeds for valid data
|
|
90
98
|
});
|
|
91
99
|
test('should reject invalid association object', () => {
|
|
92
100
|
const invalidAssociation = {
|
|
@@ -94,16 +102,16 @@ describe('Association - Schema', () => {
|
|
|
94
102
|
name: 'Test',
|
|
95
103
|
model: 'InvalidModel',
|
|
96
104
|
};
|
|
97
|
-
const result = AssociationObjectSchema(invalidAssociation);
|
|
98
|
-
expect(result).
|
|
105
|
+
const result = AssociationObjectSchema.safeParse(invalidAssociation);
|
|
106
|
+
expect(result.success).toBe(false);
|
|
99
107
|
});
|
|
100
108
|
test('should reject association missing required fields', () => {
|
|
101
109
|
const incompleteAssociation = {
|
|
102
110
|
id: generateUserId(),
|
|
103
111
|
// missing required fields for any valid association type
|
|
104
112
|
};
|
|
105
|
-
const result = AssociationObjectSchema(incompleteAssociation);
|
|
106
|
-
expect(result).
|
|
113
|
+
const result = AssociationObjectSchema.safeParse(incompleteAssociation);
|
|
114
|
+
expect(result.success).toBe(false);
|
|
107
115
|
});
|
|
108
116
|
test('should reject association with mismatched model and data', () => {
|
|
109
117
|
const mismatchedAssociation = {
|
|
@@ -112,8 +120,8 @@ describe('Association - Schema', () => {
|
|
|
112
120
|
status: 'enabled',
|
|
113
121
|
model: 'User', // but missing user fields
|
|
114
122
|
};
|
|
115
|
-
const result = AssociationObjectSchema(mismatchedAssociation);
|
|
116
|
-
expect(result).
|
|
123
|
+
const result = AssociationObjectSchema.safeParse(mismatchedAssociation);
|
|
124
|
+
expect(result.success).toBe(false);
|
|
117
125
|
});
|
|
118
126
|
});
|
|
119
127
|
});
|
|
@@ -1,57 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export type AuthenticationFactorType = {
|
|
2
3
|
id: string;
|
|
3
|
-
nextFactors?:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
export type
|
|
10
|
-
export declare const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
id: string;
|
|
20
|
-
nextFactors?: {
|
|
21
|
-
id: string;
|
|
22
|
-
nextFactors?: /*elided*/ any[] | null | undefined;
|
|
23
|
-
}[] | null | undefined;
|
|
24
|
-
}[] | null | undefined) => import("arktype").Out<{
|
|
25
|
-
id: string;
|
|
26
|
-
nextFactors?: {
|
|
27
|
-
id: string;
|
|
28
|
-
nextFactors?: /*elided*/ any[] | null | undefined;
|
|
29
|
-
}[] | null | undefined;
|
|
30
|
-
}[] | undefined>, {}>;
|
|
31
|
-
export type AuthenticationFactors = typeof AuthenticationFactorsSchema.inferOut;
|
|
32
|
-
export declare const AuthenticationFactorsPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
|
|
33
|
-
factors: (In: {
|
|
34
|
-
id: string;
|
|
35
|
-
nextFactors?: {
|
|
36
|
-
id: string;
|
|
37
|
-
nextFactors?: /*elided*/ any[] | null | undefined;
|
|
38
|
-
}[] | null | undefined;
|
|
39
|
-
}[] | null | undefined) => import("arktype").Out<{
|
|
40
|
-
id: string;
|
|
41
|
-
nextFactors?: {
|
|
42
|
-
id: string;
|
|
43
|
-
nextFactors?: /*elided*/ any[] | null | undefined;
|
|
44
|
-
}[] | null | undefined;
|
|
45
|
-
}[] | undefined>;
|
|
46
|
-
}, {}>;
|
|
47
|
-
export type AuthenticationFactorsPayload = typeof AuthenticationFactorsPayloadSchema.inferOut;
|
|
48
|
-
export declare const UpsertAuthenticationFactorsPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
|
|
49
|
-
factors?: {
|
|
50
|
-
id: string;
|
|
51
|
-
nextFactors?: {
|
|
52
|
-
id: string;
|
|
53
|
-
nextFactors?: /*elided*/ any[] | null | undefined;
|
|
54
|
-
}[] | null | undefined;
|
|
55
|
-
}[] | null | undefined;
|
|
56
|
-
}, {}>;
|
|
4
|
+
nextFactors?: AuthenticationFactorType[] | undefined | null;
|
|
5
|
+
};
|
|
6
|
+
export declare const AuthenticationFactorSchema: z.ZodType<AuthenticationFactorType, unknown, z.core.$ZodTypeInternals<AuthenticationFactorType, unknown>>;
|
|
7
|
+
export type AuthenticationFactorProperties = z.input<typeof AuthenticationFactorPayloadSchema>;
|
|
8
|
+
export type AuthenticationFactor = z.output<typeof AuthenticationFactorPayloadSchema>;
|
|
9
|
+
export declare const AuthenticationFactorPayloadSchema: z.ZodType<AuthenticationFactorType, unknown, z.core.$ZodTypeInternals<AuthenticationFactorType, unknown>>;
|
|
10
|
+
export type AuthenticationFactorPayload = z.output<typeof AuthenticationFactorPayloadSchema>;
|
|
11
|
+
export declare const AuthenticationFactorsSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodNull, z.ZodArray<z.ZodType<AuthenticationFactorType, unknown, z.core.$ZodTypeInternals<AuthenticationFactorType, unknown>>>]>, z.ZodTransform<AuthenticationFactorType[] | undefined, AuthenticationFactorType[] | null | undefined>>;
|
|
12
|
+
export type AuthenticationFactors = z.output<typeof AuthenticationFactorsSchema>;
|
|
13
|
+
export declare const AuthenticationFactorsPayloadSchema: z.ZodObject<{
|
|
14
|
+
factors: z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodNull, z.ZodArray<z.ZodType<AuthenticationFactorType, unknown, z.core.$ZodTypeInternals<AuthenticationFactorType, unknown>>>]>, z.ZodTransform<AuthenticationFactorType[] | undefined, AuthenticationFactorType[] | null | undefined>>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export type AuthenticationFactorsPayload = z.output<typeof AuthenticationFactorsPayloadSchema>;
|
|
17
|
+
export declare const UpsertAuthenticationFactorsPayloadSchema: z.ZodObject<{
|
|
18
|
+
factors: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodType<AuthenticationFactorType, unknown, z.core.$ZodTypeInternals<AuthenticationFactorType, unknown>>>, z.ZodUndefined, z.ZodNull]>>;
|
|
19
|
+
}, z.core.$strip>;
|
|
57
20
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/authentication/factors/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/authentication/factors/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,MAAM,wBAAwB,GAAG;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,CAAC,EAAE,wBAAwB,EAAE,GAAG,SAAS,GAAG,IAAI,CAAC;CAC7D,CAAC;AAcF,eAAO,MAAM,0BAA0B,2GAAiC,CAAC;AACzE,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,iCAAiC,CACzC,CAAC;AACF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CACzC,OAAO,iCAAiC,CACzC,CAAC;AAEF,eAAO,MAAM,iCAAiC,2GAAiC,CAAC;AAChF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAChD,OAAO,iCAAiC,CACzC,CAAC;AAEF,eAAO,MAAM,2BAA2B,2RAEgB,CAAC;AAOzD,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAC1C,OAAO,2BAA2B,CACnC,CAAC;AAEF,eAAO,MAAM,kCAAkC;;iBAE7C,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CACjD,OAAO,kCAAkC,CAC1C,CAAC;AAEF,eAAO,MAAM,wCAAwC;;iBAQnD,CAAC"}
|
|
@@ -1,29 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
import { StrategyIdSchema } from '../strategies/schema/base.js';
|
|
3
|
-
const
|
|
4
|
-
factor: {
|
|
5
|
-
id: StrategyIdSchema,
|
|
6
|
-
'nextFactors?': 'childFactors',
|
|
7
|
-
},
|
|
8
|
-
childFactors: 'factor[] | undefined | null',
|
|
9
|
-
'nextFactors?': 'factor[] | undefined | null',
|
|
10
|
-
});
|
|
11
|
-
export const AuthenticationFactorSchema = type({
|
|
12
|
-
id: StrategyIdSchema,
|
|
13
|
-
...factorScope.export('nextFactors?'),
|
|
14
|
-
});
|
|
15
|
-
export const AuthenticationFactorPayloadSchema = type({
|
|
3
|
+
const AuthenticationFactorBaseSchema = z.lazy(() => z.object({
|
|
16
4
|
id: StrategyIdSchema,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
5
|
+
nextFactors: z
|
|
6
|
+
.array(AuthenticationFactorBaseSchema)
|
|
7
|
+
.or(z.undefined())
|
|
8
|
+
.or(z.null())
|
|
9
|
+
.optional(),
|
|
10
|
+
}));
|
|
11
|
+
export const AuthenticationFactorSchema = AuthenticationFactorBaseSchema;
|
|
12
|
+
export const AuthenticationFactorPayloadSchema = AuthenticationFactorBaseSchema;
|
|
13
|
+
export const AuthenticationFactorsSchema = z
|
|
14
|
+
.union([z.undefined(), z.null(), z.array(AuthenticationFactorPayloadSchema)])
|
|
15
|
+
.pipe(z.transform((f) => (f == null ? undefined : f)));
|
|
16
|
+
export const AuthenticationFactorsPayloadSchema = z.object({
|
|
23
17
|
factors: AuthenticationFactorsSchema,
|
|
24
18
|
});
|
|
25
|
-
export const UpsertAuthenticationFactorsPayloadSchema =
|
|
26
|
-
factors:
|
|
27
|
-
.
|
|
19
|
+
export const UpsertAuthenticationFactorsPayloadSchema = z.object({
|
|
20
|
+
factors: z
|
|
21
|
+
.union([
|
|
22
|
+
z.array(AuthenticationFactorPayloadSchema),
|
|
23
|
+
z.undefined(),
|
|
24
|
+
z.null(),
|
|
25
|
+
])
|
|
28
26
|
.optional(),
|
|
29
27
|
});
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { type } from 'arktype';
|
|
2
1
|
import { describe, expect, test } from 'vitest';
|
|
3
2
|
import { generateStrategyId } from '../utils.js';
|
|
4
3
|
import { AuthenticationFactorPayloadSchema, AuthenticationFactorsPayloadSchema, UpsertAuthenticationFactorsPayloadSchema, } from './schema.js';
|
|
5
4
|
describe('Authentication - Factors', () => {
|
|
6
5
|
describe('Schema', () => {
|
|
7
6
|
test('should parse response payload successfully', async () => {
|
|
8
|
-
expect(AuthenticationFactorsPayloadSchema({
|
|
7
|
+
expect(AuthenticationFactorsPayloadSchema.safeParse({
|
|
9
8
|
createdAt: new Date(),
|
|
10
9
|
updatedAt: new Date(),
|
|
11
10
|
factors: [
|
|
@@ -13,62 +12,62 @@ describe('Authentication - Factors', () => {
|
|
|
13
12
|
id: generateStrategyId(),
|
|
14
13
|
},
|
|
15
14
|
],
|
|
16
|
-
})).
|
|
15
|
+
}).success).toBe(true);
|
|
17
16
|
// Undefined factors
|
|
18
|
-
expect(AuthenticationFactorsPayloadSchema({
|
|
17
|
+
expect(AuthenticationFactorsPayloadSchema.safeParse({
|
|
19
18
|
createdAt: new Date(),
|
|
20
19
|
updatedAt: new Date(),
|
|
21
20
|
factors: undefined,
|
|
22
|
-
})).
|
|
21
|
+
}).success).toBe(true);
|
|
23
22
|
});
|
|
24
23
|
test('should parse upsert payload successfully', async () => {
|
|
25
|
-
expect(UpsertAuthenticationFactorsPayloadSchema({
|
|
24
|
+
expect(UpsertAuthenticationFactorsPayloadSchema.safeParse({
|
|
26
25
|
factors: [
|
|
27
26
|
{
|
|
28
27
|
id: generateStrategyId(),
|
|
29
28
|
},
|
|
30
29
|
],
|
|
31
|
-
})).
|
|
30
|
+
}).success).toBe(true);
|
|
32
31
|
// Null factors
|
|
33
|
-
expect(UpsertAuthenticationFactorsPayloadSchema({
|
|
32
|
+
expect(UpsertAuthenticationFactorsPayloadSchema.safeParse({
|
|
34
33
|
factors: null,
|
|
35
|
-
})).
|
|
34
|
+
}).success).toBe(true);
|
|
36
35
|
// Undefined factors
|
|
37
|
-
expect(UpsertAuthenticationFactorsPayloadSchema({
|
|
36
|
+
expect(UpsertAuthenticationFactorsPayloadSchema.safeParse({
|
|
38
37
|
factors: undefined,
|
|
39
|
-
})).
|
|
38
|
+
}).success).toBe(true);
|
|
40
39
|
});
|
|
41
40
|
test('should throw error for invalid factors', async () => {
|
|
42
41
|
// Factor object
|
|
43
|
-
expect(AuthenticationFactorsPayloadSchema({
|
|
42
|
+
expect(AuthenticationFactorsPayloadSchema.safeParse({
|
|
44
43
|
createdAt: new Date(),
|
|
45
44
|
updatedAt: new Date(),
|
|
46
45
|
factors: { id: generateStrategyId() },
|
|
47
|
-
})).
|
|
46
|
+
}).success).toBe(false);
|
|
48
47
|
// Factor array of string
|
|
49
|
-
expect(AuthenticationFactorsPayloadSchema({
|
|
48
|
+
expect(AuthenticationFactorsPayloadSchema.safeParse({
|
|
50
49
|
createdAt: new Date(),
|
|
51
50
|
updatedAt: new Date(),
|
|
52
51
|
factors: [generateStrategyId()],
|
|
53
|
-
})).
|
|
52
|
+
}).success).toBe(false);
|
|
54
53
|
});
|
|
55
54
|
test('should accept various next factors types', async () => {
|
|
56
55
|
// Undefined
|
|
57
|
-
expect(AuthenticationFactorPayloadSchema({
|
|
56
|
+
expect(AuthenticationFactorPayloadSchema.safeParse({
|
|
58
57
|
id: generateStrategyId(),
|
|
59
58
|
nextFactors: undefined,
|
|
60
|
-
})).
|
|
59
|
+
}).success).toBe(true);
|
|
61
60
|
// Array
|
|
62
|
-
expect(AuthenticationFactorPayloadSchema({
|
|
61
|
+
expect(AuthenticationFactorPayloadSchema.safeParse({
|
|
63
62
|
id: generateStrategyId(),
|
|
64
63
|
nextFactors: [
|
|
65
64
|
{
|
|
66
65
|
id: generateStrategyId(),
|
|
67
66
|
},
|
|
68
67
|
],
|
|
69
|
-
})).
|
|
68
|
+
}).success).toBe(true);
|
|
70
69
|
// Deeply nested array
|
|
71
|
-
expect(AuthenticationFactorPayloadSchema({
|
|
70
|
+
expect(AuthenticationFactorPayloadSchema.safeParse({
|
|
72
71
|
id: generateStrategyId(),
|
|
73
72
|
nextFactors: [
|
|
74
73
|
{
|
|
@@ -85,38 +84,38 @@ describe('Authentication - Factors', () => {
|
|
|
85
84
|
],
|
|
86
85
|
},
|
|
87
86
|
],
|
|
88
|
-
})).
|
|
87
|
+
}).success).toBe(true);
|
|
89
88
|
});
|
|
90
89
|
test('should throw error for invalid factor id', async () => {
|
|
91
90
|
// Number
|
|
92
|
-
expect(
|
|
93
|
-
id:
|
|
94
|
-
})).
|
|
91
|
+
expect(AuthenticationFactorPayloadSchema.safeParse({
|
|
92
|
+
id: 123,
|
|
93
|
+
}).success).toBe(false);
|
|
95
94
|
// Null
|
|
96
|
-
expect(
|
|
95
|
+
expect(AuthenticationFactorPayloadSchema.safeParse({
|
|
97
96
|
id: null,
|
|
98
|
-
})).
|
|
97
|
+
}).success).toBe(false);
|
|
99
98
|
// Undefined
|
|
100
|
-
expect(
|
|
99
|
+
expect(AuthenticationFactorPayloadSchema.safeParse({
|
|
101
100
|
id: undefined,
|
|
102
|
-
})).
|
|
101
|
+
}).success).toBe(false);
|
|
103
102
|
});
|
|
104
103
|
test('should throw error for invalid next factors', async () => {
|
|
105
104
|
// String
|
|
106
|
-
expect(
|
|
105
|
+
expect(AuthenticationFactorPayloadSchema.safeParse({
|
|
107
106
|
id: generateStrategyId(),
|
|
108
107
|
nextFactors: generateStrategyId(),
|
|
109
|
-
})).
|
|
108
|
+
}).success).toBe(false);
|
|
110
109
|
// Object
|
|
111
|
-
expect(
|
|
110
|
+
expect(AuthenticationFactorPayloadSchema.safeParse({
|
|
112
111
|
id: generateStrategyId(),
|
|
113
112
|
nextFactors: { id: generateStrategyId() },
|
|
114
|
-
})).
|
|
113
|
+
}).success).toBe(false);
|
|
115
114
|
// Array
|
|
116
|
-
expect(
|
|
115
|
+
expect(AuthenticationFactorPayloadSchema.safeParse({
|
|
117
116
|
id: generateStrategyId(),
|
|
118
117
|
nextFactors: [generateStrategyId()],
|
|
119
|
-
})).
|
|
118
|
+
}).success).toBe(false);
|
|
120
119
|
});
|
|
121
120
|
});
|
|
122
121
|
});
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
export declare const ProviderType: {
|
|
2
3
|
readonly MONDO: "mondo";
|
|
3
4
|
};
|
|
4
5
|
export type AnyProviderType = (typeof ProviderType)[keyof typeof ProviderType];
|
|
5
|
-
export declare const ProviderIdSchema:
|
|
6
|
-
export type ProviderId = typeof ProviderIdSchema
|
|
7
|
-
export declare const ProviderIdPropertySchema:
|
|
8
|
-
id:
|
|
9
|
-
},
|
|
10
|
-
export type ProviderIdProperty = typeof ProviderIdPropertySchema
|
|
11
|
-
export declare const ProviderTypeSchema:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
export type ProviderPayload = typeof ProviderPayloadSchema
|
|
6
|
+
export declare const ProviderIdSchema: z.ZodString;
|
|
7
|
+
export type ProviderId = z.output<typeof ProviderIdSchema>;
|
|
8
|
+
export declare const ProviderIdPropertySchema: z.ZodObject<{
|
|
9
|
+
id: z.ZodString;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export type ProviderIdProperty = z.output<typeof ProviderIdPropertySchema>;
|
|
12
|
+
export declare const ProviderTypeSchema: z.ZodEnum<{
|
|
13
|
+
mondo: "mondo";
|
|
14
|
+
}>;
|
|
15
|
+
export declare const ProviderPayloadSchema: z.ZodObject<{
|
|
16
|
+
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>>>;
|
|
17
|
+
type: z.ZodEnum<{
|
|
18
|
+
mondo: "mondo";
|
|
19
|
+
}>;
|
|
20
|
+
user: z.ZodString;
|
|
21
|
+
strategy: z.ZodString;
|
|
22
|
+
updatedAt: z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>, z.ZodTransform<string, Date>>;
|
|
23
|
+
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>>>;
|
|
24
|
+
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>>>;
|
|
25
|
+
id: z.ZodString;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export type ProviderPayload = z.output<typeof ProviderPayloadSchema>;
|
|
27
28
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/authentication/providers/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/authentication/providers/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,YAAY;;CAEf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE/E,eAAO,MAAM,gBAAgB,aAAa,CAAC;AAC3C,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE3D,eAAO,MAAM,wBAAwB;;iBAEnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE3E,eAAO,MAAM,kBAAkB;;EAAwC,CAAC;AAExE,eAAO,MAAM,qBAAqB;;;;;;;;;;;iBAShC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
import { OptionalDatePayloadSchema, RequiredDatePayloadSchema, } from '../../common/schema/dates.js';
|
|
3
3
|
import { MetadataPayloadPropertySchema } from '../../common/schema/metadata.js';
|
|
4
4
|
import { UserIdSchema } from '../../customer/schema.js';
|
|
@@ -6,16 +6,18 @@ import { StrategyIdSchema } from '../strategies/schema/base.js';
|
|
|
6
6
|
export const ProviderType = {
|
|
7
7
|
MONDO: 'mondo',
|
|
8
8
|
};
|
|
9
|
-
export const ProviderIdSchema =
|
|
10
|
-
export const ProviderIdPropertySchema =
|
|
9
|
+
export const ProviderIdSchema = z.string();
|
|
10
|
+
export const ProviderIdPropertySchema = z.object({
|
|
11
11
|
id: ProviderIdSchema,
|
|
12
12
|
});
|
|
13
|
-
export const ProviderTypeSchema =
|
|
14
|
-
export const ProviderPayloadSchema =
|
|
13
|
+
export const ProviderTypeSchema = z.enum([ProviderType.MONDO]);
|
|
14
|
+
export const ProviderPayloadSchema = z.object({
|
|
15
|
+
...ProviderIdPropertySchema.shape,
|
|
15
16
|
type: ProviderTypeSchema,
|
|
16
17
|
user: UserIdSchema,
|
|
17
18
|
strategy: StrategyIdSchema,
|
|
18
19
|
updatedAt: RequiredDatePayloadSchema,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
deletedAt: OptionalDatePayloadSchema.optional(),
|
|
21
|
+
deactivatedAt: OptionalDatePayloadSchema.optional(),
|
|
22
|
+
...MetadataPayloadPropertySchema.shape,
|
|
23
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../../src/authentication/sessions/resources.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../../src/authentication/sessions/resources.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAMpE,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAGpE,OAAO,EAAE,KAAK,OAAO,EAAiB,MAAM,aAAa,CAAC;AAI1D,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,CAAC,EAAE;QACP,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;CACH,CAAC;AAEF,qBAAa,gBAAgB;IACR,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,aAAa;IAE3D,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAQpC,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM;IAYzD,SAAS,CACd,OAAO,CAAC,EAAE,qBAAqB,EAC/B,UAAU,CAAC,EAAE,UAAU,GACtB,OAAO,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAIlC,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAGhD;AAED,wBAAsB,YAAY,CAChC,QAAQ,EAAE,aAAa,EACvB,OAAO,CAAC,EAAE,qBAAqB,EAC/B,UAAU,CAAC,EAAE,UAAU,GACtB,OAAO,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CASxC;AAED,wBAAsB,aAAa,CACjC,QAAQ,EAAE,aAAa,EACvB,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,OAAO,CAAC,CAOlB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { deleteItemWithAuthorization, getItemWithAuthorization, } from '../../common/resources/operations.js';
|
|
2
|
-
import { addPaginationToURL
|
|
2
|
+
import { addPaginationToURL } from '../../common/resources/utils.js';
|
|
3
3
|
import { PaginationCollectionSchema, } from '../../common/schema/collection.js';
|
|
4
4
|
import { appendSearchParams } from '../../common/schema/url.js';
|
|
5
5
|
import { PATH } from '../resources.js';
|
|
@@ -30,8 +30,8 @@ export class SessionResources {
|
|
|
30
30
|
}
|
|
31
31
|
export async function listSessions(instance, options, pagination) {
|
|
32
32
|
const url = addPaginationToURL(new URL(SessionResources.buildListingPath(options), instance.config.host), pagination);
|
|
33
|
-
return
|
|
33
|
+
return PaginationCollectionSchema(SessionSchema).parse(await getItemWithAuthorization(url, instance.authorizer));
|
|
34
34
|
}
|
|
35
35
|
export async function deleteSession(instance, id) {
|
|
36
|
-
return
|
|
36
|
+
return SessionSchema.parse(await deleteItemWithAuthorization(new URL(SessionResources.buildPath(id), instance.config.host), instance.authorizer));
|
|
37
37
|
}
|