@go-mondo/identity-sdk 0.0.2-beta.7 → 0.0.2-beta.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/release.yaml +1 -1
- package/.release-please-manifest.json +1 -1
- package/.tsbuildinfo/cjs.json +1 -1
- package/.tsbuildinfo/esm.json +1 -1
- package/CHANGELOG.md +450 -0
- package/README.md +3 -1
- package/dist/cjs/action/schema/base.d.ts +21 -21
- package/dist/cjs/action/schema/base.d.ts.map +1 -1
- package/dist/cjs/action/schema/base.js +51 -11
- package/dist/cjs/action/schema/base.test.d.ts +2 -0
- package/dist/cjs/action/schema/base.test.d.ts.map +1 -0
- package/dist/cjs/action/schema/base.test.js +137 -0
- 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 +42 -8
- package/dist/cjs/action/schema/operations/sign-up-verification.test.d.ts +2 -0
- package/dist/cjs/action/schema/operations/sign-up-verification.test.d.ts.map +1 -0
- package/dist/cjs/action/schema/operations/sign-up-verification.test.js +140 -0
- package/dist/cjs/action/schema/operations/sign-up.d.ts +40 -43
- package/dist/cjs/action/schema/operations/sign-up.d.ts.map +1 -1
- package/dist/cjs/action/schema/operations/sign-up.js +57 -15
- package/dist/cjs/action/schema/operations/sign-up.test.d.ts +2 -0
- package/dist/cjs/action/schema/operations/sign-up.test.d.ts.map +1 -0
- package/dist/cjs/action/schema/operations/sign-up.test.js +173 -0
- 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 +40 -6
- package/dist/cjs/action/schema/operations/user-attribute-verification.test.d.ts +2 -0
- package/dist/cjs/action/schema/operations/user-attribute-verification.test.d.ts.map +1 -0
- package/dist/cjs/action/schema/operations/user-attribute-verification.test.js +128 -0
- package/dist/cjs/action/schema/schema.d.ts +49 -77
- package/dist/cjs/action/schema/schema.d.ts.map +1 -1
- package/dist/cjs/action/schema/schema.js +7 -5
- package/dist/cjs/action/schema/schema.test.d.ts +2 -0
- package/dist/cjs/action/schema/schema.test.d.ts.map +1 -0
- package/dist/cjs/action/schema/schema.test.js +164 -0
- package/dist/cjs/action/schema/utils.d.ts +7 -0
- package/dist/cjs/action/schema/utils.d.ts.map +1 -0
- package/dist/cjs/action/schema/utils.js +16 -0
- package/dist/cjs/action/schema/utils.test.d.ts +2 -0
- package/dist/cjs/action/schema/utils.test.d.ts.map +1 -0
- package/dist/cjs/action/schema/utils.test.js +26 -0
- package/dist/cjs/activity/resources.d.ts.map +1 -1
- package/dist/cjs/activity/resources.js +1 -1
- package/dist/cjs/activity/resources.test.d.ts +2 -0
- package/dist/cjs/activity/resources.test.d.ts.map +1 -0
- package/dist/cjs/activity/resources.test.js +224 -0
- 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 +74 -28
- package/dist/cjs/activity/schema/base.test.d.ts +2 -0
- package/dist/cjs/activity/schema/base.test.d.ts.map +1 -0
- package/dist/cjs/activity/schema/base.test.js +269 -0
- 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.d.ts +2 -0
- package/dist/cjs/activity/schema/schema.test.d.ts.map +1 -0
- package/dist/cjs/activity/schema/schema.test.js +343 -0
- 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 +50 -8
- package/dist/cjs/activity/schema/types/authentication.test.d.ts +2 -0
- package/dist/cjs/activity/schema/types/authentication.test.d.ts.map +1 -0
- package/dist/cjs/activity/schema/types/authentication.test.js +302 -0
- 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 +50 -8
- package/dist/cjs/activity/schema/types/authorization.test.d.ts +2 -0
- package/dist/cjs/activity/schema/types/authorization.test.d.ts.map +1 -0
- package/dist/cjs/activity/schema/types/authorization.test.js +340 -0
- package/dist/cjs/activity/schema/types/note.d.ts +83 -70
- package/dist/cjs/activity/schema/types/note.d.ts.map +1 -1
- package/dist/cjs/activity/schema/types/note.js +53 -12
- package/dist/cjs/activity/schema/types/note.test.d.ts +2 -0
- package/dist/cjs/activity/schema/types/note.test.d.ts.map +1 -0
- package/dist/cjs/activity/schema/types/note.test.js +318 -0
- package/dist/cjs/activity/schema/types/operation.d.ts +64 -45
- package/dist/cjs/activity/schema/types/operation.d.ts.map +1 -1
- package/dist/cjs/activity/schema/types/operation.js +52 -8
- package/dist/cjs/activity/schema/types/operation.test.d.ts +2 -0
- package/dist/cjs/activity/schema/types/operation.test.d.ts.map +1 -0
- package/dist/cjs/activity/schema/types/operation.test.js +343 -0
- package/dist/cjs/activity/schema/types/unknown.d.ts +50 -41
- package/dist/cjs/activity/schema/types/unknown.d.ts.map +1 -1
- package/dist/cjs/activity/schema/types/unknown.js +45 -6
- package/dist/cjs/activity/schema/types/unknown.test.d.ts +2 -0
- package/dist/cjs/activity/schema/types/unknown.test.d.ts.map +1 -0
- package/dist/cjs/activity/schema/types/unknown.test.js +274 -0
- package/dist/cjs/activity/schema/utils.test.d.ts +2 -0
- package/dist/cjs/activity/schema/utils.test.d.ts.map +1 -0
- package/dist/cjs/activity/schema/utils.test.js +26 -0
- package/dist/cjs/app/authorization/resources.d.ts.map +1 -1
- package/dist/cjs/app/authorization/resources.js +2 -6
- package/dist/cjs/app/authorization/schema.d.ts +99 -52
- package/dist/cjs/app/authorization/schema.d.ts.map +1 -1
- package/dist/cjs/app/authorization/schema.js +89 -53
- package/dist/cjs/app/authorization/schema.test.d.ts +2 -0
- package/dist/cjs/app/authorization/schema.test.d.ts.map +1 -0
- package/dist/cjs/app/authorization/schema.test.js +378 -0
- 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 +58 -18
- package/dist/cjs/app/oauth/schema.test.d.ts +2 -0
- package/dist/cjs/app/oauth/schema.test.d.ts.map +1 -0
- package/dist/cjs/app/oauth/schema.test.js +172 -0
- 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 +49 -12
- package/dist/cjs/app/oidc/schema.test.d.ts +2 -0
- package/dist/cjs/app/oidc/schema.test.d.ts.map +1 -0
- package/dist/cjs/app/oidc/schema.test.js +114 -0
- package/dist/cjs/app/registration/resources.d.ts.map +1 -1
- package/dist/cjs/app/registration/resources.js +2 -3
- package/dist/cjs/app/registration/resources.test.d.ts +2 -0
- package/dist/cjs/app/registration/resources.test.d.ts.map +1 -0
- package/dist/cjs/app/registration/resources.test.js +295 -0
- package/dist/cjs/app/registration/schema.d.ts +24 -31
- package/dist/cjs/app/registration/schema.d.ts.map +1 -1
- package/dist/cjs/app/registration/schema.js +56 -16
- package/dist/cjs/app/registration/schema.test.d.ts +2 -0
- package/dist/cjs/app/registration/schema.test.d.ts.map +1 -0
- package/dist/cjs/app/registration/schema.test.js +180 -0
- package/dist/cjs/app/resources.d.ts.map +1 -1
- package/dist/cjs/app/resources.js +5 -5
- package/dist/cjs/app/resources.test.d.ts +2 -0
- package/dist/cjs/app/resources.test.d.ts.map +1 -0
- package/dist/cjs/app/resources.test.js +288 -0
- package/dist/cjs/app/saml/resources.d.ts.map +1 -1
- package/dist/cjs/app/saml/resources.js +4 -5
- package/dist/cjs/app/saml/schema.d.ts +26 -37
- package/dist/cjs/app/saml/schema.d.ts.map +1 -1
- package/dist/cjs/app/saml/schema.js +50 -13
- package/dist/cjs/app/schema.d.ts +75 -67
- package/dist/cjs/app/schema.d.ts.map +1 -1
- package/dist/cjs/app/schema.js +83 -37
- package/dist/cjs/app/schema.test.d.ts +2 -0
- package/dist/cjs/app/schema.test.d.ts.map +1 -0
- package/dist/cjs/app/schema.test.js +181 -0
- package/dist/cjs/app/utils.test.d.ts +2 -0
- package/dist/cjs/app/utils.test.d.ts.map +1 -0
- package/dist/cjs/app/utils.test.js +42 -0
- 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 +270 -128
- package/dist/cjs/association/schema.d.ts.map +1 -1
- package/dist/cjs/association/schema.js +78 -29
- package/dist/cjs/association/schema.test.d.ts +2 -0
- package/dist/cjs/association/schema.test.d.ts.map +1 -0
- package/dist/cjs/association/schema.test.js +80 -0
- package/dist/cjs/authentication/factors/schema.d.ts +39 -49
- package/dist/cjs/authentication/factors/schema.d.ts.map +1 -1
- package/dist/cjs/authentication/factors/schema.js +59 -20
- package/dist/cjs/authentication/factors/schema.test.js +50 -50
- package/dist/cjs/authentication/index.d.ts +1 -0
- package/dist/cjs/authentication/index.d.ts.map +1 -1
- package/dist/cjs/authentication/index.js +2 -0
- package/dist/cjs/authentication/providers/schema.d.ts +23 -22
- package/dist/cjs/authentication/providers/schema.d.ts.map +1 -1
- package/dist/cjs/authentication/providers/schema.js +45 -10
- 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 +96 -74
- package/dist/cjs/authentication/sessions/schema.d.ts.map +1 -1
- package/dist/cjs/authentication/sessions/schema.js +108 -35
- package/dist/cjs/authentication/settings/resources.d.ts.map +1 -1
- package/dist/cjs/authentication/settings/resources.js +2 -3
- package/dist/cjs/authentication/settings/schema.d.ts +45 -62
- package/dist/cjs/authentication/settings/schema.d.ts.map +1 -1
- package/dist/cjs/authentication/settings/schema.js +49 -14
- package/dist/cjs/authentication/settings/schema.test.d.ts +2 -0
- package/dist/cjs/authentication/settings/schema.test.d.ts.map +1 -0
- package/dist/cjs/authentication/settings/schema.test.js +460 -0
- package/dist/cjs/authentication/strategies/resources.d.ts +2 -1
- package/dist/cjs/authentication/strategies/resources.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/resources.js +10 -10
- package/dist/cjs/authentication/strategies/schema/base.d.ts +59 -53
- package/dist/cjs/authentication/strategies/schema/base.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/schema/base.js +71 -25
- package/dist/cjs/authentication/strategies/schema/schema.d.ts +126 -200
- package/dist/cjs/authentication/strategies/schema/schema.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/schema/schema.js +39 -6
- package/dist/cjs/authentication/strategies/schema/types/email.d.ts +62 -61
- package/dist/cjs/authentication/strategies/schema/types/email.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/schema/types/email.js +59 -16
- package/dist/cjs/authentication/strategies/schema/types/email.test.d.ts +2 -0
- package/dist/cjs/authentication/strategies/schema/types/email.test.d.ts.map +1 -0
- package/dist/cjs/authentication/strategies/schema/types/email.test.js +205 -0
- package/dist/cjs/authentication/strategies/schema/types/totp.d.ts +108 -95
- package/dist/cjs/authentication/strategies/schema/types/totp.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/schema/types/totp.js +83 -26
- package/dist/cjs/authentication/utils.d.ts +13 -0
- package/dist/cjs/authentication/utils.d.ts.map +1 -0
- package/dist/cjs/authentication/utils.js +25 -0
- package/dist/cjs/authentication/utils.test.d.ts +2 -0
- package/dist/cjs/authentication/utils.test.d.ts.map +1 -0
- package/dist/cjs/authentication/utils.test.js +142 -0
- package/dist/cjs/authorization/index.d.ts +1 -1
- package/dist/cjs/authorization/index.d.ts.map +1 -1
- package/dist/cjs/authorization/index.js +1 -1
- 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 -89
- package/dist/cjs/authorization/permissions/schema.d.ts.map +1 -1
- package/dist/cjs/authorization/permissions/schema.js +85 -43
- package/dist/cjs/authorization/permissions/schema.test.d.ts +2 -0
- package/dist/cjs/authorization/permissions/schema.test.d.ts.map +1 -0
- package/dist/cjs/authorization/permissions/schema.test.js +209 -0
- 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 +82 -44
- package/dist/cjs/authorization/roles/schema.test.d.ts +2 -0
- package/dist/cjs/authorization/roles/schema.test.d.ts.map +1 -0
- package/dist/cjs/authorization/roles/schema.test.js +229 -0
- package/dist/cjs/authorization/schema.d.ts +18 -0
- package/dist/cjs/authorization/schema.d.ts.map +1 -0
- package/dist/cjs/authorization/schema.js +68 -0
- package/dist/cjs/authorization/schema.test.d.ts +2 -0
- package/dist/cjs/authorization/schema.test.d.ts.map +1 -0
- package/dist/cjs/authorization/schema.test.js +42 -0
- package/dist/cjs/common/errors/http.test.d.ts +2 -0
- package/dist/cjs/common/errors/http.test.d.ts.map +1 -0
- package/dist/cjs/common/errors/http.test.js +71 -0
- package/dist/cjs/common/errors/validation.test.d.ts +2 -0
- package/dist/cjs/common/errors/validation.test.d.ts.map +1 -0
- package/dist/cjs/common/errors/validation.test.js +92 -0
- 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 +50 -9
- package/dist/cjs/common/resources/init.test.d.ts +2 -0
- package/dist/cjs/common/resources/init.test.d.ts.map +1 -0
- package/dist/cjs/common/resources/init.test.js +233 -0
- package/dist/cjs/common/resources/operations.d.ts +3 -2
- package/dist/cjs/common/resources/operations.d.ts.map +1 -1
- package/dist/cjs/common/resources/operations.js +15 -8
- package/dist/cjs/common/resources/operations.test.d.ts +2 -0
- package/dist/cjs/common/resources/operations.test.d.ts.map +1 -0
- package/dist/cjs/common/resources/operations.test.js +356 -0
- package/dist/cjs/common/resources/utils.d.ts +1 -10
- 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.d.ts +2 -0
- package/dist/cjs/common/resources/utils.test.d.ts.map +1 -0
- package/dist/cjs/common/resources/utils.test.js +134 -0
- package/dist/cjs/common/schema/aggregate.d.ts +6 -5
- package/dist/cjs/common/schema/aggregate.d.ts.map +1 -1
- package/dist/cjs/common/schema/aggregate.js +37 -4
- package/dist/cjs/common/schema/aggregate.test.d.ts +2 -0
- package/dist/cjs/common/schema/aggregate.test.d.ts.map +1 -0
- package/dist/cjs/common/schema/aggregate.test.js +74 -0
- package/dist/cjs/common/schema/collection.d.ts +13 -14
- package/dist/cjs/common/schema/collection.d.ts.map +1 -1
- package/dist/cjs/common/schema/collection.js +40 -5
- package/dist/cjs/common/schema/collection.test.d.ts +2 -0
- package/dist/cjs/common/schema/collection.test.d.ts.map +1 -0
- package/dist/cjs/common/schema/collection.test.js +149 -0
- package/dist/cjs/common/schema/dates.d.ts +43 -26
- package/dist/cjs/common/schema/dates.d.ts.map +1 -1
- package/dist/cjs/common/schema/dates.js +63 -12
- package/dist/cjs/common/schema/dates.test.js +24 -13
- package/dist/cjs/common/schema/id.d.ts +3 -0
- package/dist/cjs/common/schema/id.d.ts.map +1 -0
- package/dist/cjs/common/schema/id.js +39 -0
- package/dist/cjs/common/schema/id.test.d.ts +2 -0
- package/dist/cjs/common/schema/id.test.d.ts.map +1 -0
- package/dist/cjs/common/schema/id.test.js +148 -0
- package/dist/cjs/common/schema/jwt.d.ts +28 -14
- package/dist/cjs/common/schema/jwt.d.ts.map +1 -1
- package/dist/cjs/common/schema/jwt.js +37 -5
- package/dist/cjs/common/schema/jwt.test.d.ts +2 -0
- package/dist/cjs/common/schema/jwt.test.d.ts.map +1 -0
- package/dist/cjs/common/schema/jwt.test.js +61 -0
- package/dist/cjs/common/schema/metadata.d.ts +28 -39
- package/dist/cjs/common/schema/metadata.d.ts.map +1 -1
- package/dist/cjs/common/schema/metadata.js +80 -27
- package/dist/cjs/common/schema/metadata.test.js +71 -23
- package/dist/cjs/common/schema/pagination.d.ts +15 -5
- package/dist/cjs/common/schema/pagination.d.ts.map +1 -1
- package/dist/cjs/common/schema/pagination.js +46 -4
- package/dist/cjs/common/schema/pagination.test.d.ts +2 -0
- package/dist/cjs/common/schema/pagination.test.d.ts.map +1 -0
- package/dist/cjs/common/schema/pagination.test.js +87 -0
- package/dist/cjs/common/schema/schema.d.ts +4 -4
- package/dist/cjs/common/schema/schema.d.ts.map +1 -1
- package/dist/cjs/common/schema/schema.js +28 -5
- package/dist/cjs/common/schema/schema.test.js +42 -15
- package/dist/cjs/common/schema/sets.d.ts +6 -2
- package/dist/cjs/common/schema/sets.d.ts.map +1 -1
- package/dist/cjs/common/schema/sets.js +50 -7
- package/dist/cjs/common/schema/url.d.ts +19 -0
- package/dist/cjs/common/schema/url.d.ts.map +1 -1
- package/dist/cjs/common/schema/url.js +74 -0
- package/dist/cjs/common/schema/url.test.d.ts +2 -0
- package/dist/cjs/common/schema/url.test.d.ts.map +1 -0
- package/dist/cjs/common/schema/url.test.js +74 -0
- package/dist/cjs/customer/index.d.ts +2 -1
- package/dist/cjs/customer/index.d.ts.map +1 -1
- package/dist/cjs/customer/index.js +2 -1
- package/dist/cjs/customer/organization/schema.d.ts +68 -0
- package/dist/cjs/customer/organization/schema.d.ts.map +1 -0
- package/dist/cjs/customer/organization/schema.js +92 -0
- package/dist/cjs/customer/schema.d.ts +18 -0
- package/dist/cjs/customer/schema.d.ts.map +1 -0
- package/dist/cjs/customer/schema.js +68 -0
- package/dist/cjs/customer/schema.test.d.ts +2 -0
- package/dist/cjs/customer/schema.test.d.ts.map +1 -0
- package/dist/cjs/customer/schema.test.js +42 -0
- 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 +215 -105
- package/dist/cjs/customer/users/schema.d.ts.map +1 -1
- package/dist/cjs/customer/users/schema.js +148 -65
- package/dist/cjs/customer/users/schema.test.js +579 -67
- package/dist/cjs/customer/users/utils.d.ts +3 -2
- package/dist/cjs/customer/users/utils.d.ts.map +1 -1
- package/dist/cjs/customer/users/utils.test.d.ts +2 -0
- package/dist/cjs/customer/users/utils.test.d.ts.map +1 -0
- package/dist/cjs/customer/users/utils.test.js +145 -0
- package/dist/cjs/identity/schema.d.ts +5 -1
- package/dist/cjs/identity/schema.d.ts.map +1 -1
- package/dist/cjs/identity/schema.js +38 -2
- package/dist/cjs/identity/schema.test.d.ts +2 -0
- package/dist/cjs/identity/schema.test.d.ts.map +1 -0
- package/dist/cjs/identity/schema.test.js +45 -0
- package/dist/cjs/oauth/authorize/schema/grants/authorization-code.d.ts +34 -28
- package/dist/cjs/oauth/authorize/schema/grants/authorization-code.d.ts.map +1 -1
- package/dist/cjs/oauth/authorize/schema/grants/authorization-code.js +96 -22
- package/dist/cjs/oauth/authorize/schema/grants/authorization-code.test.d.ts +2 -0
- package/dist/cjs/oauth/authorize/schema/grants/authorization-code.test.d.ts.map +1 -0
- package/dist/cjs/oauth/authorize/schema/grants/authorization-code.test.js +333 -0
- package/dist/cjs/oauth/authorize/schema/grants/common.d.ts +6 -0
- package/dist/cjs/oauth/authorize/schema/grants/common.d.ts.map +1 -0
- package/dist/cjs/oauth/authorize/schema/grants/common.js +47 -0
- package/dist/cjs/oauth/authorize/schema/grants/implicit.d.ts +18 -10
- package/dist/cjs/oauth/authorize/schema/grants/implicit.d.ts.map +1 -1
- package/dist/cjs/oauth/authorize/schema/grants/implicit.js +56 -11
- package/dist/cjs/oauth/authorize/schema/schema.d.ts +48 -36
- package/dist/cjs/oauth/authorize/schema/schema.d.ts.map +1 -1
- package/dist/cjs/oauth/authorize/schema/schema.js +4 -2
- package/dist/cjs/oauth/common/schema.d.ts +24 -7
- package/dist/cjs/oauth/common/schema.d.ts.map +1 -1
- package/dist/cjs/oauth/common/schema.js +59 -8
- package/dist/cjs/oauth/common/schema.test.d.ts +2 -0
- package/dist/cjs/oauth/common/schema.test.d.ts.map +1 -0
- package/dist/cjs/oauth/common/schema.test.js +282 -0
- package/dist/cjs/oauth/index.d.ts +3 -3
- package/dist/cjs/oauth/index.d.ts.map +1 -1
- package/dist/cjs/oauth/index.js +8 -25
- package/dist/cjs/oauth/token/schema/grants/authorization-code.d.ts +16 -9
- package/dist/cjs/oauth/token/schema/grants/authorization-code.d.ts.map +1 -1
- package/dist/cjs/oauth/token/schema/grants/authorization-code.js +66 -12
- package/dist/cjs/oauth/token/schema/grants/client-credentials.d.ts +16 -17
- package/dist/cjs/oauth/token/schema/grants/client-credentials.d.ts.map +1 -1
- package/dist/cjs/oauth/token/schema/grants/client-credentials.js +53 -16
- package/dist/cjs/oauth/token/schema/grants/common.d.ts +6 -0
- package/dist/cjs/oauth/token/schema/grants/common.d.ts.map +1 -0
- package/dist/cjs/oauth/token/schema/grants/common.js +52 -0
- package/dist/cjs/oauth/token/schema/grants/refresh-token.d.ts +15 -8
- package/dist/cjs/oauth/token/schema/grants/refresh-token.d.ts.map +1 -1
- package/dist/cjs/oauth/token/schema/grants/refresh-token.js +57 -11
- package/dist/cjs/oauth/token/schema/schema.d.ts +48 -21
- package/dist/cjs/oauth/token/schema/schema.d.ts.map +1 -1
- package/dist/cjs/oauth/token/schema/schema.js +79 -2
- package/dist/cjs/oauth/token/schema/schema.test.d.ts +2 -0
- package/dist/cjs/oauth/token/schema/schema.test.d.ts.map +1 -0
- package/dist/cjs/oauth/token/schema/schema.test.js +138 -0
- package/dist/cjs/workspace/authorization/schema.d.ts +71 -27
- package/dist/cjs/workspace/authorization/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/authorization/schema.js +58 -13
- package/dist/cjs/workspace/branding/schema.d.ts +47 -37
- package/dist/cjs/workspace/branding/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/branding/schema.js +61 -16
- package/dist/cjs/workspace/membership/schema.d.ts +42 -20
- package/dist/cjs/workspace/membership/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/membership/schema.js +47 -7
- package/dist/cjs/workspace/registration/schema.d.ts +41 -27
- package/dist/cjs/workspace/registration/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/registration/schema.js +63 -14
- package/dist/cjs/workspace/settings/schema.d.ts +20 -19
- package/dist/cjs/workspace/settings/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/settings/schema.js +47 -7
- package/dist/cjs/workspace/settings/schema.test.d.ts +2 -0
- package/dist/cjs/workspace/settings/schema.test.d.ts.map +1 -0
- package/dist/cjs/workspace/settings/schema.test.js +72 -0
- package/dist/cjs/workspace/tenant/schema.d.ts +88 -56
- package/dist/cjs/workspace/tenant/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/tenant/schema.js +64 -17
- package/dist/cjs/workspace/tenant/schema.test.d.ts +2 -0
- package/dist/cjs/workspace/tenant/schema.test.d.ts.map +1 -0
- package/dist/cjs/workspace/tenant/schema.test.js +235 -0
- package/dist/cjs/workspace/user/notifications/schema.d.ts +70 -56
- package/dist/cjs/workspace/user/notifications/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/user/notifications/schema.js +78 -31
- package/dist/cjs/workspace/user/preferences/schema.d.ts +29 -25
- package/dist/cjs/workspace/user/preferences/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/user/preferences/schema.js +57 -12
- package/dist/cjs/workspace/utils.d.ts +0 -3
- package/dist/cjs/workspace/utils.d.ts.map +1 -1
- package/dist/cjs/workspace/utils.js +0 -3
- package/dist/cjs/workspace/utils.test.d.ts +2 -0
- package/dist/cjs/workspace/utils.test.d.ts.map +1 -0
- package/dist/cjs/workspace/utils.test.js +63 -0
- package/dist/esm/action/schema/base.d.ts +21 -21
- package/dist/esm/action/schema/base.d.ts.map +1 -1
- package/dist/esm/action/schema/base.js +19 -12
- package/dist/esm/action/schema/base.test.d.ts +2 -0
- package/dist/esm/action/schema/base.test.d.ts.map +1 -0
- package/dist/esm/action/schema/base.test.js +135 -0
- 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 +9 -8
- package/dist/esm/action/schema/operations/sign-up-verification.test.d.ts +2 -0
- package/dist/esm/action/schema/operations/sign-up-verification.test.d.ts.map +1 -0
- package/dist/esm/action/schema/operations/sign-up-verification.test.js +138 -0
- 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.d.ts +2 -0
- package/dist/esm/action/schema/operations/sign-up.test.d.ts.map +1 -0
- package/dist/esm/action/schema/operations/sign-up.test.js +171 -0
- 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 +7 -6
- package/dist/esm/action/schema/operations/user-attribute-verification.test.d.ts +2 -0
- package/dist/esm/action/schema/operations/user-attribute-verification.test.d.ts.map +1 -0
- package/dist/esm/action/schema/operations/user-attribute-verification.test.js +126 -0
- package/dist/esm/action/schema/schema.d.ts +49 -77
- package/dist/esm/action/schema/schema.d.ts.map +1 -1
- package/dist/esm/action/schema/schema.js +7 -5
- package/dist/esm/action/schema/schema.test.d.ts +2 -0
- package/dist/esm/action/schema/schema.test.d.ts.map +1 -0
- package/dist/esm/action/schema/schema.test.js +162 -0
- package/dist/esm/action/schema/utils.d.ts +7 -0
- package/dist/esm/action/schema/utils.d.ts.map +1 -0
- package/dist/esm/action/schema/utils.js +9 -0
- package/dist/esm/action/schema/utils.test.d.ts +2 -0
- package/dist/esm/action/schema/utils.test.d.ts.map +1 -0
- package/dist/esm/action/schema/utils.test.js +24 -0
- package/dist/esm/activity/resources.d.ts.map +1 -1
- package/dist/esm/activity/resources.js +2 -2
- package/dist/esm/activity/resources.test.d.ts +2 -0
- package/dist/esm/activity/resources.test.d.ts.map +1 -0
- package/dist/esm/activity/resources.test.js +189 -0
- 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 +42 -29
- package/dist/esm/activity/schema/base.test.d.ts +2 -0
- package/dist/esm/activity/schema/base.test.d.ts.map +1 -0
- package/dist/esm/activity/schema/base.test.js +267 -0
- 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.d.ts +2 -0
- package/dist/esm/activity/schema/schema.test.d.ts.map +1 -0
- package/dist/esm/activity/schema/schema.test.js +341 -0
- 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 +17 -8
- package/dist/esm/activity/schema/types/authentication.test.d.ts +2 -0
- package/dist/esm/activity/schema/types/authentication.test.d.ts.map +1 -0
- package/dist/esm/activity/schema/types/authentication.test.js +300 -0
- 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 +17 -8
- package/dist/esm/activity/schema/types/authorization.test.d.ts +2 -0
- package/dist/esm/activity/schema/types/authorization.test.d.ts.map +1 -0
- package/dist/esm/activity/schema/types/authorization.test.js +338 -0
- 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.d.ts +2 -0
- package/dist/esm/activity/schema/types/note.test.d.ts.map +1 -0
- package/dist/esm/activity/schema/types/note.test.js +316 -0
- 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.d.ts +2 -0
- package/dist/esm/activity/schema/types/operation.test.d.ts.map +1 -0
- package/dist/esm/activity/schema/types/operation.test.js +341 -0
- 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.d.ts +2 -0
- package/dist/esm/activity/schema/types/unknown.test.d.ts.map +1 -0
- package/dist/esm/activity/schema/types/unknown.test.js +272 -0
- package/dist/esm/activity/schema/utils.test.d.ts +2 -0
- package/dist/esm/activity/schema/utils.test.d.ts.map +1 -0
- package/dist/esm/activity/schema/utils.test.js +24 -0
- package/dist/esm/app/authorization/resources.d.ts.map +1 -1
- package/dist/esm/app/authorization/resources.js +3 -7
- package/dist/esm/app/authorization/schema.d.ts +99 -52
- package/dist/esm/app/authorization/schema.d.ts.map +1 -1
- package/dist/esm/app/authorization/schema.js +58 -55
- package/dist/esm/app/authorization/schema.test.d.ts +2 -0
- package/dist/esm/app/authorization/schema.test.d.ts.map +1 -0
- package/dist/esm/app/authorization/schema.test.js +376 -0
- package/dist/esm/app/oauth/resources.d.ts.map +1 -1
- package/dist/esm/app/oauth/resources.js +3 -4
- package/dist/esm/app/oauth/schema.d.ts +34 -41
- package/dist/esm/app/oauth/schema.d.ts.map +1 -1
- package/dist/esm/app/oauth/schema.js +27 -20
- package/dist/esm/app/oauth/schema.test.d.ts +2 -0
- package/dist/esm/app/oauth/schema.test.d.ts.map +1 -0
- package/dist/esm/app/oauth/schema.test.js +170 -0
- package/dist/esm/app/oidc/resources.d.ts.map +1 -1
- package/dist/esm/app/oidc/resources.js +5 -6
- package/dist/esm/app/oidc/schema.d.ts +26 -37
- package/dist/esm/app/oidc/schema.d.ts.map +1 -1
- package/dist/esm/app/oidc/schema.js +18 -14
- package/dist/esm/app/oidc/schema.test.d.ts +2 -0
- package/dist/esm/app/oidc/schema.test.d.ts.map +1 -0
- package/dist/esm/app/oidc/schema.test.js +112 -0
- package/dist/esm/app/registration/resources.d.ts.map +1 -1
- package/dist/esm/app/registration/resources.js +3 -4
- package/dist/esm/app/registration/resources.test.d.ts +2 -0
- package/dist/esm/app/registration/resources.test.d.ts.map +1 -0
- package/dist/esm/app/registration/resources.test.js +260 -0
- 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 +24 -17
- package/dist/esm/app/registration/schema.test.d.ts +2 -0
- package/dist/esm/app/registration/schema.test.d.ts.map +1 -0
- package/dist/esm/app/registration/schema.test.js +178 -0
- package/dist/esm/app/resources.d.ts.map +1 -1
- package/dist/esm/app/resources.js +7 -7
- package/dist/esm/app/resources.test.d.ts +2 -0
- package/dist/esm/app/resources.test.d.ts.map +1 -0
- package/dist/esm/app/resources.test.js +253 -0
- package/dist/esm/app/saml/resources.d.ts.map +1 -1
- package/dist/esm/app/saml/resources.js +5 -6
- package/dist/esm/app/saml/schema.d.ts +26 -37
- package/dist/esm/app/saml/schema.d.ts.map +1 -1
- package/dist/esm/app/saml/schema.js +19 -15
- package/dist/esm/app/schema.d.ts +75 -67
- package/dist/esm/app/schema.d.ts.map +1 -1
- package/dist/esm/app/schema.js +50 -37
- package/dist/esm/app/schema.test.d.ts +2 -0
- package/dist/esm/app/schema.test.d.ts.map +1 -0
- package/dist/esm/app/schema.test.js +179 -0
- package/dist/esm/app/utils.test.d.ts +2 -0
- package/dist/esm/app/utils.test.d.ts.map +1 -0
- package/dist/esm/app/utils.test.js +40 -0
- package/dist/esm/association/resources.d.ts.map +1 -1
- package/dist/esm/association/resources.js +5 -7
- package/dist/esm/association/schema.d.ts +270 -128
- package/dist/esm/association/schema.d.ts.map +1 -1
- package/dist/esm/association/schema.js +45 -29
- package/dist/esm/association/schema.test.d.ts +2 -0
- package/dist/esm/association/schema.test.d.ts.map +1 -0
- package/dist/esm/association/schema.test.js +78 -0
- package/dist/esm/authentication/factors/schema.d.ts +39 -49
- package/dist/esm/authentication/factors/schema.d.ts.map +1 -1
- package/dist/esm/authentication/factors/schema.js +26 -20
- package/dist/esm/authentication/factors/schema.test.js +50 -50
- package/dist/esm/authentication/index.d.ts +1 -0
- package/dist/esm/authentication/index.d.ts.map +1 -1
- package/dist/esm/authentication/index.js +2 -0
- package/dist/esm/authentication/providers/schema.d.ts +23 -22
- package/dist/esm/authentication/providers/schema.d.ts.map +1 -1
- package/dist/esm/authentication/providers/schema.js +13 -11
- package/dist/esm/authentication/sessions/resources.d.ts.map +1 -1
- package/dist/esm/authentication/sessions/resources.js +3 -3
- package/dist/esm/authentication/sessions/schema.d.ts +96 -74
- package/dist/esm/authentication/sessions/schema.d.ts.map +1 -1
- package/dist/esm/authentication/sessions/schema.js +75 -35
- package/dist/esm/authentication/settings/resources.d.ts.map +1 -1
- package/dist/esm/authentication/settings/resources.js +3 -4
- package/dist/esm/authentication/settings/schema.d.ts +45 -62
- package/dist/esm/authentication/settings/schema.d.ts.map +1 -1
- package/dist/esm/authentication/settings/schema.js +18 -16
- package/dist/esm/authentication/settings/schema.test.d.ts +2 -0
- package/dist/esm/authentication/settings/schema.test.d.ts.map +1 -0
- package/dist/esm/authentication/settings/schema.test.js +458 -0
- package/dist/esm/authentication/strategies/resources.d.ts +2 -1
- package/dist/esm/authentication/strategies/resources.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/resources.js +12 -12
- package/dist/esm/authentication/strategies/schema/base.d.ts +59 -53
- package/dist/esm/authentication/strategies/schema/base.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/schema/base.js +38 -25
- package/dist/esm/authentication/strategies/schema/schema.d.ts +126 -200
- package/dist/esm/authentication/strategies/schema/schema.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/schema/schema.js +17 -6
- package/dist/esm/authentication/strategies/schema/types/email.d.ts +62 -61
- package/dist/esm/authentication/strategies/schema/types/email.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/schema/types/email.js +25 -15
- package/dist/esm/authentication/strategies/schema/types/email.test.d.ts +2 -0
- package/dist/esm/authentication/strategies/schema/types/email.test.d.ts.map +1 -0
- package/dist/esm/authentication/strategies/schema/types/email.test.js +203 -0
- package/dist/esm/authentication/strategies/schema/types/totp.d.ts +108 -95
- package/dist/esm/authentication/strategies/schema/types/totp.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/schema/types/totp.js +51 -27
- package/dist/esm/authentication/utils.d.ts +13 -0
- package/dist/esm/authentication/utils.d.ts.map +1 -0
- package/dist/esm/authentication/utils.js +17 -0
- package/dist/esm/authentication/utils.test.d.ts +2 -0
- package/dist/esm/authentication/utils.test.d.ts.map +1 -0
- package/dist/esm/authentication/utils.test.js +140 -0
- package/dist/esm/authorization/index.d.ts +1 -1
- package/dist/esm/authorization/index.d.ts.map +1 -1
- package/dist/esm/authorization/index.js +1 -1
- package/dist/esm/authorization/permissions/resources.d.ts.map +1 -1
- package/dist/esm/authorization/permissions/resources.js +7 -7
- package/dist/esm/authorization/permissions/schema.d.ts +92 -89
- package/dist/esm/authorization/permissions/schema.d.ts.map +1 -1
- package/dist/esm/authorization/permissions/schema.js +51 -42
- package/dist/esm/authorization/permissions/schema.test.d.ts +2 -0
- package/dist/esm/authorization/permissions/schema.test.d.ts.map +1 -0
- package/dist/esm/authorization/permissions/schema.test.js +207 -0
- package/dist/esm/authorization/roles/resources.d.ts.map +1 -1
- package/dist/esm/authorization/roles/resources.js +7 -7
- 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 +49 -44
- package/dist/esm/authorization/roles/schema.test.d.ts +2 -0
- package/dist/esm/authorization/roles/schema.test.d.ts.map +1 -0
- package/dist/esm/authorization/roles/schema.test.js +227 -0
- package/dist/esm/authorization/schema.d.ts +18 -0
- package/dist/esm/authorization/schema.d.ts.map +1 -0
- package/dist/esm/authorization/schema.js +27 -0
- package/dist/esm/authorization/schema.test.d.ts +2 -0
- package/dist/esm/authorization/schema.test.d.ts.map +1 -0
- package/dist/esm/authorization/schema.test.js +40 -0
- package/dist/esm/common/errors/http.test.d.ts +2 -0
- package/dist/esm/common/errors/http.test.d.ts.map +1 -0
- package/dist/esm/common/errors/http.test.js +69 -0
- package/dist/esm/common/errors/validation.test.d.ts +2 -0
- package/dist/esm/common/errors/validation.test.d.ts.map +1 -0
- package/dist/esm/common/errors/validation.test.js +90 -0
- 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/init.test.d.ts +2 -0
- package/dist/esm/common/resources/init.test.d.ts.map +1 -0
- package/dist/esm/common/resources/init.test.js +231 -0
- package/dist/esm/common/resources/operations.d.ts +3 -2
- package/dist/esm/common/resources/operations.d.ts.map +1 -1
- package/dist/esm/common/resources/operations.js +12 -6
- package/dist/esm/common/resources/operations.test.d.ts +2 -0
- package/dist/esm/common/resources/operations.test.d.ts.map +1 -0
- package/dist/esm/common/resources/operations.test.js +354 -0
- package/dist/esm/common/resources/utils.d.ts +1 -10
- 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.d.ts +2 -0
- package/dist/esm/common/resources/utils.test.d.ts.map +1 -0
- package/dist/esm/common/resources/utils.test.js +132 -0
- 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.d.ts +2 -0
- package/dist/esm/common/schema/aggregate.test.d.ts.map +1 -0
- package/dist/esm/common/schema/aggregate.test.js +72 -0
- package/dist/esm/common/schema/collection.d.ts +13 -14
- package/dist/esm/common/schema/collection.d.ts.map +1 -1
- package/dist/esm/common/schema/collection.js +5 -5
- package/dist/esm/common/schema/collection.test.d.ts +2 -0
- package/dist/esm/common/schema/collection.test.d.ts.map +1 -0
- package/dist/esm/common/schema/collection.test.js +114 -0
- package/dist/esm/common/schema/dates.d.ts +43 -26
- package/dist/esm/common/schema/dates.d.ts.map +1 -1
- package/dist/esm/common/schema/dates.js +29 -11
- package/dist/esm/common/schema/dates.test.js +24 -13
- package/dist/esm/common/schema/id.d.ts +3 -0
- package/dist/esm/common/schema/id.d.ts.map +1 -0
- package/dist/esm/common/schema/id.js +2 -0
- package/dist/esm/common/schema/id.test.d.ts +2 -0
- package/dist/esm/common/schema/id.test.d.ts.map +1 -0
- package/dist/esm/common/schema/id.test.js +146 -0
- package/dist/esm/common/schema/jwt.d.ts +28 -14
- package/dist/esm/common/schema/jwt.d.ts.map +1 -1
- package/dist/esm/common/schema/jwt.js +3 -4
- package/dist/esm/common/schema/jwt.test.d.ts +2 -0
- package/dist/esm/common/schema/jwt.test.d.ts.map +1 -0
- package/dist/esm/common/schema/jwt.test.js +59 -0
- package/dist/esm/common/schema/metadata.d.ts +28 -39
- package/dist/esm/common/schema/metadata.d.ts.map +1 -1
- package/dist/esm/common/schema/metadata.js +45 -26
- package/dist/esm/common/schema/metadata.test.js +72 -24
- package/dist/esm/common/schema/pagination.d.ts +15 -5
- package/dist/esm/common/schema/pagination.d.ts.map +1 -1
- package/dist/esm/common/schema/pagination.js +13 -4
- package/dist/esm/common/schema/pagination.test.d.ts +2 -0
- package/dist/esm/common/schema/pagination.test.d.ts.map +1 -0
- package/dist/esm/common/schema/pagination.test.js +85 -0
- package/dist/esm/common/schema/schema.d.ts +4 -4
- package/dist/esm/common/schema/schema.d.ts.map +1 -1
- package/dist/esm/common/schema/schema.js +6 -5
- package/dist/esm/common/schema/schema.test.js +9 -15
- package/dist/esm/common/schema/sets.d.ts +6 -2
- package/dist/esm/common/schema/sets.d.ts.map +1 -1
- package/dist/esm/common/schema/sets.js +16 -6
- package/dist/esm/common/schema/url.d.ts +19 -0
- package/dist/esm/common/schema/url.d.ts.map +1 -1
- package/dist/esm/common/schema/url.js +40 -0
- package/dist/esm/common/schema/url.test.d.ts +2 -0
- package/dist/esm/common/schema/url.test.d.ts.map +1 -0
- package/dist/esm/common/schema/url.test.js +72 -0
- package/dist/esm/customer/index.d.ts +2 -1
- package/dist/esm/customer/index.d.ts.map +1 -1
- package/dist/esm/customer/index.js +2 -1
- package/dist/esm/customer/organization/schema.d.ts +68 -0
- package/dist/esm/customer/organization/schema.d.ts.map +1 -0
- package/dist/esm/customer/organization/schema.js +56 -0
- package/dist/esm/customer/schema.d.ts +18 -0
- package/dist/esm/customer/schema.d.ts.map +1 -0
- package/dist/esm/customer/schema.js +27 -0
- package/dist/esm/customer/schema.test.d.ts +2 -0
- package/dist/esm/customer/schema.test.d.ts.map +1 -0
- package/dist/esm/customer/schema.test.js +40 -0
- package/dist/esm/customer/users/resources.d.ts.map +1 -1
- package/dist/esm/customer/users/resources.js +7 -7
- package/dist/esm/customer/users/schema.d.ts +215 -105
- package/dist/esm/customer/users/schema.d.ts.map +1 -1
- package/dist/esm/customer/users/schema.js +109 -59
- package/dist/esm/customer/users/schema.test.js +578 -66
- 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.d.ts +2 -0
- package/dist/esm/customer/users/utils.test.d.ts.map +1 -0
- package/dist/esm/customer/users/utils.test.js +143 -0
- 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.d.ts +2 -0
- package/dist/esm/identity/schema.test.d.ts.map +1 -0
- package/dist/esm/identity/schema.test.js +43 -0
- package/dist/esm/oauth/authorize/schema/grants/authorization-code.d.ts +34 -28
- package/dist/esm/oauth/authorize/schema/grants/authorization-code.d.ts.map +1 -1
- package/dist/esm/oauth/authorize/schema/grants/authorization-code.js +63 -22
- package/dist/esm/oauth/authorize/schema/grants/authorization-code.test.d.ts +2 -0
- package/dist/esm/oauth/authorize/schema/grants/authorization-code.test.d.ts.map +1 -0
- package/dist/esm/oauth/authorize/schema/grants/authorization-code.test.js +331 -0
- package/dist/esm/oauth/authorize/schema/grants/common.d.ts +6 -0
- package/dist/esm/oauth/authorize/schema/grants/common.d.ts.map +1 -0
- package/dist/esm/oauth/authorize/schema/grants/common.js +11 -0
- package/dist/esm/oauth/authorize/schema/grants/implicit.d.ts +18 -10
- package/dist/esm/oauth/authorize/schema/grants/implicit.d.ts.map +1 -1
- package/dist/esm/oauth/authorize/schema/grants/implicit.js +22 -10
- package/dist/esm/oauth/authorize/schema/schema.d.ts +48 -36
- package/dist/esm/oauth/authorize/schema/schema.d.ts.map +1 -1
- package/dist/esm/oauth/authorize/schema/schema.js +4 -3
- package/dist/esm/oauth/common/schema.d.ts +24 -7
- package/dist/esm/oauth/common/schema.d.ts.map +1 -1
- package/dist/esm/oauth/common/schema.js +25 -7
- package/dist/esm/oauth/common/schema.test.d.ts +2 -0
- package/dist/esm/oauth/common/schema.test.d.ts.map +1 -0
- package/dist/esm/oauth/common/schema.test.js +280 -0
- package/dist/esm/oauth/index.d.ts +3 -3
- package/dist/esm/oauth/index.d.ts.map +1 -1
- package/dist/esm/oauth/index.js +3 -3
- package/dist/esm/oauth/token/schema/grants/authorization-code.d.ts +16 -9
- package/dist/esm/oauth/token/schema/grants/authorization-code.d.ts.map +1 -1
- package/dist/esm/oauth/token/schema/grants/authorization-code.js +32 -11
- package/dist/esm/oauth/token/schema/grants/client-credentials.d.ts +16 -17
- package/dist/esm/oauth/token/schema/grants/client-credentials.d.ts.map +1 -1
- package/dist/esm/oauth/token/schema/grants/client-credentials.js +19 -15
- package/dist/esm/oauth/token/schema/grants/common.d.ts +6 -0
- package/dist/esm/oauth/token/schema/grants/common.d.ts.map +1 -0
- package/dist/esm/oauth/token/schema/grants/common.js +16 -0
- package/dist/esm/oauth/token/schema/grants/refresh-token.d.ts +15 -8
- package/dist/esm/oauth/token/schema/grants/refresh-token.d.ts.map +1 -1
- package/dist/esm/oauth/token/schema/grants/refresh-token.js +23 -10
- package/dist/esm/oauth/token/schema/schema.d.ts +48 -21
- package/dist/esm/oauth/token/schema/schema.d.ts.map +1 -1
- package/dist/esm/oauth/token/schema/schema.js +59 -4
- package/dist/esm/oauth/token/schema/schema.test.d.ts +2 -0
- package/dist/esm/oauth/token/schema/schema.test.d.ts.map +1 -0
- package/dist/esm/oauth/token/schema/schema.test.js +136 -0
- package/dist/esm/workspace/authorization/schema.d.ts +71 -27
- package/dist/esm/workspace/authorization/schema.d.ts.map +1 -1
- package/dist/esm/workspace/authorization/schema.js +27 -15
- package/dist/esm/workspace/branding/schema.d.ts +47 -37
- package/dist/esm/workspace/branding/schema.d.ts.map +1 -1
- package/dist/esm/workspace/branding/schema.js +29 -17
- package/dist/esm/workspace/membership/schema.d.ts +42 -20
- package/dist/esm/workspace/membership/schema.d.ts.map +1 -1
- package/dist/esm/workspace/membership/schema.js +14 -7
- package/dist/esm/workspace/registration/schema.d.ts +41 -27
- package/dist/esm/workspace/registration/schema.d.ts.map +1 -1
- package/dist/esm/workspace/registration/schema.js +32 -16
- package/dist/esm/workspace/settings/schema.d.ts +20 -19
- package/dist/esm/workspace/settings/schema.d.ts.map +1 -1
- package/dist/esm/workspace/settings/schema.js +15 -8
- package/dist/esm/workspace/settings/schema.test.d.ts +2 -0
- package/dist/esm/workspace/settings/schema.test.d.ts.map +1 -0
- package/dist/esm/workspace/settings/schema.test.js +70 -0
- package/dist/esm/workspace/tenant/schema.d.ts +88 -56
- package/dist/esm/workspace/tenant/schema.d.ts.map +1 -1
- package/dist/esm/workspace/tenant/schema.js +29 -15
- package/dist/esm/workspace/tenant/schema.test.d.ts +2 -0
- package/dist/esm/workspace/tenant/schema.test.d.ts.map +1 -0
- package/dist/esm/workspace/tenant/schema.test.js +233 -0
- package/dist/esm/workspace/user/notifications/schema.d.ts +70 -56
- package/dist/esm/workspace/user/notifications/schema.d.ts.map +1 -1
- package/dist/esm/workspace/user/notifications/schema.js +45 -31
- package/dist/esm/workspace/user/preferences/schema.d.ts +29 -25
- package/dist/esm/workspace/user/preferences/schema.d.ts.map +1 -1
- package/dist/esm/workspace/user/preferences/schema.js +25 -13
- package/dist/esm/workspace/utils.d.ts +0 -3
- package/dist/esm/workspace/utils.d.ts.map +1 -1
- package/dist/esm/workspace/utils.js +0 -3
- package/dist/esm/workspace/utils.test.d.ts +2 -0
- package/dist/esm/workspace/utils.test.d.ts.map +1 -0
- package/dist/esm/workspace/utils.test.js +61 -0
- package/package.json +3 -3
- 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/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/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/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
- package/dist/cjs/action/schema/operations/set-password.d.ts +0 -31
- package/dist/cjs/action/schema/operations/set-password.d.ts.map +0 -1
- package/dist/cjs/action/schema/operations/set-password.js +0 -18
- package/dist/cjs/authentication/strategies/schema/types/password.d.ts +0 -132
- package/dist/cjs/authentication/strategies/schema/types/password.d.ts.map +0 -1
- package/dist/cjs/authentication/strategies/schema/types/password.js +0 -52
- package/dist/cjs/authorization/utils.d.ts +0 -11
- package/dist/cjs/authorization/utils.d.ts.map +0 -1
- package/dist/cjs/authorization/utils.js +0 -23
- package/dist/cjs/customer/schema/organization.d.ts +0 -54
- package/dist/cjs/customer/schema/organization.d.ts.map +0 -1
- package/dist/cjs/customer/schema/organization.js +0 -40
- package/dist/cjs/customer/schema/schema.d.ts +0 -4
- package/dist/cjs/customer/schema/schema.d.ts.map +0 -1
- package/dist/cjs/customer/schema/schema.js +0 -19
- package/dist/cjs/customer/schema/utils.d.ts +0 -11
- package/dist/cjs/customer/schema/utils.d.ts.map +0 -1
- package/dist/cjs/customer/schema/utils.js +0 -23
- package/dist/esm/action/schema/operations/set-password.d.ts +0 -31
- package/dist/esm/action/schema/operations/set-password.d.ts.map +0 -1
- package/dist/esm/action/schema/operations/set-password.js +0 -15
- package/dist/esm/authentication/strategies/schema/types/password.d.ts +0 -132
- package/dist/esm/authentication/strategies/schema/types/password.d.ts.map +0 -1
- package/dist/esm/authentication/strategies/schema/types/password.js +0 -49
- package/dist/esm/authorization/utils.d.ts +0 -11
- package/dist/esm/authorization/utils.d.ts.map +0 -1
- package/dist/esm/authorization/utils.js +0 -15
- package/dist/esm/customer/schema/organization.d.ts +0 -54
- package/dist/esm/customer/schema/organization.d.ts.map +0 -1
- package/dist/esm/customer/schema/organization.js +0 -37
- package/dist/esm/customer/schema/schema.d.ts +0 -4
- package/dist/esm/customer/schema/schema.d.ts.map +0 -1
- package/dist/esm/customer/schema/schema.js +0 -3
- package/dist/esm/customer/schema/utils.d.ts +0 -11
- package/dist/esm/customer/schema/utils.d.ts.map +0 -1
- package/dist/esm/customer/schema/utils.js +0 -15
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { type } from 'arktype';
|
|
2
|
+
import { describe, expect, test } from 'vitest';
|
|
3
|
+
import { generateAppId } from '../../app/utils.js';
|
|
4
|
+
import { generateUserId } from '../../customer/schema.js';
|
|
5
|
+
import { generatePermissionId, generateRoleId } from '../schema.js';
|
|
6
|
+
import {
|
|
7
|
+
type InsertRolePayload,
|
|
8
|
+
InsertRolePayloadSchema,
|
|
9
|
+
type RoleAssociationReference,
|
|
10
|
+
RoleAssociationReferenceSchema,
|
|
11
|
+
RoleAssociationsSchema,
|
|
12
|
+
RoleIdPropertySchema,
|
|
13
|
+
RoleSchema,
|
|
14
|
+
RoleStatus,
|
|
15
|
+
UpdateRolePayloadSchema,
|
|
16
|
+
} from './schema.js';
|
|
17
|
+
|
|
18
|
+
describe('Authorization Roles - Schema', () => {
|
|
19
|
+
describe('RoleStatus constants', () => {
|
|
20
|
+
test('should have correct status values', () => {
|
|
21
|
+
expect(RoleStatus.ENABLED).toBe('enabled');
|
|
22
|
+
expect(RoleStatus.DISABLED).toBe('disabled');
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
describe('RoleIdPropertySchema', () => {
|
|
27
|
+
test('should accept valid id property', () => {
|
|
28
|
+
const payload = { id: generateRoleId() };
|
|
29
|
+
const result = RoleIdPropertySchema(payload);
|
|
30
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
31
|
+
expect(result).toEqual({ id: payload.id });
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test('should reject missing id', () => {
|
|
35
|
+
const result = RoleIdPropertySchema({});
|
|
36
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
describe('RoleAssociationsSchema', () => {
|
|
41
|
+
test('should accept valid associations', () => {
|
|
42
|
+
const payload = {
|
|
43
|
+
apps: [generateAppId(), generateAppId()],
|
|
44
|
+
permissions: [generatePermissionId(), generatePermissionId()],
|
|
45
|
+
users: [generateUserId(), generateUserId()],
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const result = RoleAssociationsSchema(payload);
|
|
49
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
50
|
+
expect(result).toEqual({
|
|
51
|
+
apps: payload.apps,
|
|
52
|
+
permissions: payload.permissions,
|
|
53
|
+
users: payload.users,
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
test('should accept optional associations', () => {
|
|
58
|
+
const result = RoleAssociationsSchema({});
|
|
59
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
60
|
+
expect(result).toEqual({});
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
test('should accept partial associations', () => {
|
|
64
|
+
const result = RoleAssociationsSchema({
|
|
65
|
+
permissions: [generatePermissionId()],
|
|
66
|
+
users: undefined,
|
|
67
|
+
});
|
|
68
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test('should reject non-array associations', () => {
|
|
72
|
+
const result = RoleAssociationsSchema({
|
|
73
|
+
apps: 'not-an-array',
|
|
74
|
+
});
|
|
75
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
describe('RoleSchema', () => {
|
|
80
|
+
test('should accept complete role object', () => {
|
|
81
|
+
const role = {
|
|
82
|
+
id: generateRoleId(),
|
|
83
|
+
name: 'admin',
|
|
84
|
+
status: 'enabled' as const,
|
|
85
|
+
description: 'Administrator role',
|
|
86
|
+
apps: { ids: [generateAppId()], count: 1 },
|
|
87
|
+
users: { ids: [generateUserId()], count: 1 },
|
|
88
|
+
permissions: { ids: [generatePermissionId()], count: 1 },
|
|
89
|
+
createdAt: new Date(),
|
|
90
|
+
updatedAt: new Date(),
|
|
91
|
+
metadata: { key: 'value' },
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const result = RoleSchema(role);
|
|
95
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
test('should accept minimal role object', () => {
|
|
99
|
+
const role = {
|
|
100
|
+
id: generateRoleId(),
|
|
101
|
+
name: 'user',
|
|
102
|
+
status: 'enabled' as const,
|
|
103
|
+
createdAt: new Date(),
|
|
104
|
+
updatedAt: new Date(),
|
|
105
|
+
metadata: {},
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const result = RoleSchema(role);
|
|
109
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
test('should accept role with optional dates', () => {
|
|
113
|
+
const role = {
|
|
114
|
+
id: generateRoleId(),
|
|
115
|
+
name: 'user',
|
|
116
|
+
status: 'disabled' as const,
|
|
117
|
+
createdAt: new Date(),
|
|
118
|
+
updatedAt: new Date(),
|
|
119
|
+
deletedAt: new Date(),
|
|
120
|
+
deactivatedAt: new Date(),
|
|
121
|
+
metadata: {},
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const result = RoleSchema(role);
|
|
125
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
test('should reject invalid status', () => {
|
|
129
|
+
const role = {
|
|
130
|
+
id: generateRoleId(),
|
|
131
|
+
name: 'admin',
|
|
132
|
+
status: 'invalid',
|
|
133
|
+
createdAt: new Date(),
|
|
134
|
+
updatedAt: new Date(),
|
|
135
|
+
metadata: {},
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const result = RoleSchema(role);
|
|
139
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
test('should reject missing required fields', () => {
|
|
143
|
+
const role = {
|
|
144
|
+
id: generateRoleId(),
|
|
145
|
+
name: 'admin',
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
const result = RoleSchema(role);
|
|
149
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
describe('InsertRolePayloadSchema', () => {
|
|
154
|
+
test('should accept complete insert payload', () => {
|
|
155
|
+
const payload = {
|
|
156
|
+
id: generateRoleId(),
|
|
157
|
+
name: 'admin',
|
|
158
|
+
status: 'enabled' as const,
|
|
159
|
+
description: 'Administrator role',
|
|
160
|
+
apps: [generateAppId()],
|
|
161
|
+
permissions: [generatePermissionId()],
|
|
162
|
+
users: [generateUserId()],
|
|
163
|
+
metadata: { key: 'value' },
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
const result = InsertRolePayloadSchema(payload);
|
|
167
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
test('should accept minimal insert payload', () => {
|
|
171
|
+
const payload = {
|
|
172
|
+
name: 'user',
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
const result = InsertRolePayloadSchema(payload);
|
|
176
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
177
|
+
expect((result as InsertRolePayload).status).toBe('enabled'); // default value
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
test('should generate default ID when not provided', () => {
|
|
181
|
+
const payload = { name: 'admin' };
|
|
182
|
+
const result = InsertRolePayloadSchema(payload);
|
|
183
|
+
|
|
184
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
185
|
+
expect((result as InsertRolePayload).id).toMatch(/^rol_/);
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
test('should reject missing name', () => {
|
|
189
|
+
const result = InsertRolePayloadSchema({});
|
|
190
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
test('should accept associations in insert payload', () => {
|
|
194
|
+
const payload = {
|
|
195
|
+
name: 'moderator',
|
|
196
|
+
apps: [generateAppId(), generateAppId()],
|
|
197
|
+
permissions: [generatePermissionId(), generatePermissionId()],
|
|
198
|
+
users: [generateUserId()],
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
const result = InsertRolePayloadSchema(payload);
|
|
202
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
describe('UpdateRolePayloadSchema', () => {
|
|
207
|
+
test('should accept all optional fields', () => {
|
|
208
|
+
const payload = {
|
|
209
|
+
name: 'updated-role',
|
|
210
|
+
status: 'disabled' as const,
|
|
211
|
+
description: 'Updated description',
|
|
212
|
+
metadata: { updated: true },
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
const result = UpdateRolePayloadSchema(payload);
|
|
216
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
217
|
+
expect(result).toEqual(payload);
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
test('should accept empty update payload', () => {
|
|
221
|
+
const result = UpdateRolePayloadSchema({});
|
|
222
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
223
|
+
expect(result).toEqual({});
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
test('should accept partial updates', () => {
|
|
227
|
+
const payload = { name: 'new-name' };
|
|
228
|
+
const result = UpdateRolePayloadSchema(payload);
|
|
229
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
230
|
+
expect(result).toEqual(payload);
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
test('should reject invalid status', () => {
|
|
234
|
+
const payload = { status: 'invalid-status' };
|
|
235
|
+
const result = UpdateRolePayloadSchema(payload);
|
|
236
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
237
|
+
});
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
describe('RoleAssociationReferenceSchema', () => {
|
|
241
|
+
test('should accept complete association reference', () => {
|
|
242
|
+
const reference = {
|
|
243
|
+
id: generateRoleId(),
|
|
244
|
+
name: 'admin',
|
|
245
|
+
status: 'enabled' as const,
|
|
246
|
+
model: 'Role' as const,
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
const result = RoleAssociationReferenceSchema(reference);
|
|
250
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
251
|
+
expect(result).toEqual(reference);
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
test('should use default status when not provided', () => {
|
|
255
|
+
const reference = {
|
|
256
|
+
id: generateRoleId(),
|
|
257
|
+
name: 'admin',
|
|
258
|
+
model: 'Role' as const,
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
const result = RoleAssociationReferenceSchema(reference);
|
|
262
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
263
|
+
expect((result as RoleAssociationReference).status).toBe('disabled'); // default value
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
test('should reject missing required fields', () => {
|
|
267
|
+
const reference = { id: generateRoleId() };
|
|
268
|
+
const result = RoleAssociationReferenceSchema(reference);
|
|
269
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
test('should reject invalid model value', () => {
|
|
273
|
+
const reference = {
|
|
274
|
+
id: generateRoleId(),
|
|
275
|
+
name: 'admin',
|
|
276
|
+
model: 'InvalidModel',
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
const result = RoleAssociationReferenceSchema(reference);
|
|
280
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { type } from 'arktype';
|
|
2
|
+
import { describe, expect, test } from 'vitest';
|
|
3
|
+
import { AggregateSchema } from './aggregate.js';
|
|
4
|
+
|
|
5
|
+
describe('Common Schema - Aggregate', () => {
|
|
6
|
+
describe('AggregateSchema', () => {
|
|
7
|
+
test('should accept valid aggregate with ids and count', () => {
|
|
8
|
+
const result = AggregateSchema({
|
|
9
|
+
ids: ['id1', 'id2', 'id3'],
|
|
10
|
+
count: 25,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
14
|
+
expect(result).toEqual({
|
|
15
|
+
ids: ['id1', 'id2', 'id3'],
|
|
16
|
+
count: 25,
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test('should accept aggregate with only ids', () => {
|
|
21
|
+
const result = AggregateSchema({
|
|
22
|
+
ids: ['id1', 'id2'],
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
26
|
+
expect(result).toEqual({
|
|
27
|
+
ids: ['id1', 'id2'],
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test('should accept aggregate with only count', () => {
|
|
32
|
+
const result = AggregateSchema({
|
|
33
|
+
count: 42,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
37
|
+
expect(result).toEqual({
|
|
38
|
+
count: 42,
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
test('should accept empty aggregate', () => {
|
|
43
|
+
const result = AggregateSchema({});
|
|
44
|
+
|
|
45
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
46
|
+
expect(result).toEqual({});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test('should accept aggregate with empty ids array', () => {
|
|
50
|
+
const result = AggregateSchema({
|
|
51
|
+
ids: [],
|
|
52
|
+
count: 0,
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
56
|
+
expect(result).toEqual({
|
|
57
|
+
ids: [],
|
|
58
|
+
count: 0,
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test('should reject invalid ids type', () => {
|
|
63
|
+
const result = AggregateSchema({
|
|
64
|
+
ids: 'not-an-array',
|
|
65
|
+
count: 10,
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test('should reject invalid count type', () => {
|
|
72
|
+
const result = AggregateSchema({
|
|
73
|
+
ids: ['id1'],
|
|
74
|
+
count: 'not-a-number',
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
test('should reject non-string items in ids array', () => {
|
|
81
|
+
const result = AggregateSchema({
|
|
82
|
+
ids: ['id1', 123, 'id3'],
|
|
83
|
+
count: 3,
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
});
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { type } from 'arktype';
|
|
2
|
+
import { describe, expect, test } from 'vitest';
|
|
3
|
+
import { CollectionSchema, PaginationCollectionSchema } from './collection.js';
|
|
4
|
+
|
|
5
|
+
describe('Common Schema - Collection', () => {
|
|
6
|
+
describe('CollectionSchema', () => {
|
|
7
|
+
test('should accept valid collection with string items', () => {
|
|
8
|
+
const StringCollectionSchema = CollectionSchema('string');
|
|
9
|
+
const result = StringCollectionSchema({
|
|
10
|
+
items: ['item1', 'item2', 'item3'],
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
14
|
+
expect(result).toEqual({
|
|
15
|
+
items: ['item1', 'item2', 'item3'],
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test('should accept valid collection with number items', () => {
|
|
20
|
+
const NumberCollectionSchema = CollectionSchema('number');
|
|
21
|
+
const result = NumberCollectionSchema({
|
|
22
|
+
items: [1, 2, 3],
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
26
|
+
expect(result).toEqual({
|
|
27
|
+
items: [1, 2, 3],
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test('should accept empty collection', () => {
|
|
32
|
+
const StringCollectionSchema = CollectionSchema('string');
|
|
33
|
+
const result = StringCollectionSchema({
|
|
34
|
+
items: [],
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
38
|
+
expect(result).toEqual({
|
|
39
|
+
items: [],
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test('should reject invalid items type', () => {
|
|
44
|
+
const StringCollectionSchema = CollectionSchema('string');
|
|
45
|
+
const result = StringCollectionSchema({
|
|
46
|
+
items: 'not-an-array',
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
describe('PaginationCollectionSchema', () => {
|
|
54
|
+
test('should accept valid paginated collection', () => {
|
|
55
|
+
const StringPaginationCollectionSchema =
|
|
56
|
+
PaginationCollectionSchema('string');
|
|
57
|
+
const result = StringPaginationCollectionSchema({
|
|
58
|
+
items: ['item1', 'item2'],
|
|
59
|
+
pagination: {
|
|
60
|
+
pageSize: '10',
|
|
61
|
+
nextToken: 'token123',
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
66
|
+
expect(result).toEqual({
|
|
67
|
+
items: ['item1', 'item2'],
|
|
68
|
+
pagination: {
|
|
69
|
+
pageSize: '10',
|
|
70
|
+
nextToken: 'token123',
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
test('should accept collection without pagination', () => {
|
|
76
|
+
const StringPaginationCollectionSchema =
|
|
77
|
+
PaginationCollectionSchema('string');
|
|
78
|
+
const result = StringPaginationCollectionSchema({
|
|
79
|
+
items: ['item1', 'item2'],
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
83
|
+
expect(result).toEqual({
|
|
84
|
+
items: ['item1', 'item2'],
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
test('should accept collection with empty pagination', () => {
|
|
89
|
+
const StringPaginationCollectionSchema =
|
|
90
|
+
PaginationCollectionSchema('string');
|
|
91
|
+
const result = StringPaginationCollectionSchema({
|
|
92
|
+
items: ['item1'],
|
|
93
|
+
pagination: {},
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
97
|
+
expect(result).toEqual({
|
|
98
|
+
items: ['item1'],
|
|
99
|
+
pagination: {},
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
test('should reject invalid pagination', () => {
|
|
104
|
+
const StringPaginationCollectionSchema =
|
|
105
|
+
PaginationCollectionSchema('string');
|
|
106
|
+
const result = StringPaginationCollectionSchema({
|
|
107
|
+
items: ['item1'],
|
|
108
|
+
pagination: {
|
|
109
|
+
pageSize: true,
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type } from 'arktype';
|
|
2
|
+
import { describe, expect, test } from 'vitest';
|
|
3
|
+
import { RequiredDatePayloadSchema, RequiredDateSchema } from './dates.js';
|
|
4
|
+
|
|
5
|
+
describe('Common - Dates', () => {
|
|
6
|
+
describe('Date Schema', () => {
|
|
7
|
+
test('should accept an iso string', async () => {
|
|
8
|
+
const result = RequiredDateSchema(
|
|
9
|
+
new Date().toISOString()
|
|
10
|
+
) as typeof RequiredDateSchema.inferOut;
|
|
11
|
+
|
|
12
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
13
|
+
expect(result).toBeInstanceOf(Date);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test('should accept a Date object', async () => {
|
|
17
|
+
const result = RequiredDateSchema(
|
|
18
|
+
new Date()
|
|
19
|
+
) as typeof RequiredDateSchema.inferOut;
|
|
20
|
+
|
|
21
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
22
|
+
expect(result).toBeInstanceOf(Date);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
describe('Payload Schema', () => {
|
|
27
|
+
test('should parse a Date to an ISO string', async () => {
|
|
28
|
+
const iso = new Date().toISOString();
|
|
29
|
+
|
|
30
|
+
const result = RequiredDatePayloadSchema(
|
|
31
|
+
new Date(iso)
|
|
32
|
+
) as typeof RequiredDatePayloadSchema.inferOut;
|
|
33
|
+
|
|
34
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
35
|
+
expect(result).to.equal(iso);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test('should parse an ISO to an ISO string', async () => {
|
|
39
|
+
const iso = new Date().toISOString();
|
|
40
|
+
|
|
41
|
+
const result = RequiredDatePayloadSchema(
|
|
42
|
+
iso
|
|
43
|
+
) as typeof RequiredDatePayloadSchema.inferOut;
|
|
44
|
+
|
|
45
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
46
|
+
expect(result).to.equal(iso);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { type } from 'arktype';
|
|
2
|
+
import { describe, expect, test } from 'vitest';
|
|
3
|
+
import { KSUIDSchema } from './id.js';
|
|
4
|
+
|
|
5
|
+
describe('Common Schema - ID', () => {
|
|
6
|
+
describe('KSUIDSchema', () => {
|
|
7
|
+
test('should accept valid KSUID with correct prefix', () => {
|
|
8
|
+
const schema = KSUIDSchema('usr');
|
|
9
|
+
const validId = 'usr_123456789012345678901234567';
|
|
10
|
+
|
|
11
|
+
const result = schema(validId);
|
|
12
|
+
expect(result).toBe(validId);
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test('should accept KSUID with different prefixes', () => {
|
|
16
|
+
const userSchema = KSUIDSchema('usr');
|
|
17
|
+
const appSchema = KSUIDSchema('app');
|
|
18
|
+
const activitySchema = KSUIDSchema('act');
|
|
19
|
+
|
|
20
|
+
const userId = 'usr_abcdefghijklmnopqrstuvwxy12';
|
|
21
|
+
const appId = 'app_1234567890ABCDEFGHIJKLMNOP1';
|
|
22
|
+
const activityId = 'act_abcDEF123456789012345678901';
|
|
23
|
+
|
|
24
|
+
expect(userSchema(userId)).toBe(userId);
|
|
25
|
+
expect(appSchema(appId)).toBe(appId);
|
|
26
|
+
expect(activitySchema(activityId)).toBe(activityId);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
test('should accept KSUID with mixed alphanumeric characters', () => {
|
|
30
|
+
const schema = KSUIDSchema('test');
|
|
31
|
+
const mixedId = 'test_1a2B3c4D5e6F7g8H9i0JkLmNoPq';
|
|
32
|
+
|
|
33
|
+
const result = schema(mixedId);
|
|
34
|
+
expect(result).toBe(mixedId);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test('should reject KSUID with wrong prefix', () => {
|
|
38
|
+
const schema = KSUIDSchema('usr');
|
|
39
|
+
const wrongPrefixId = 'app_123456789012345678901234567';
|
|
40
|
+
|
|
41
|
+
const result = schema(wrongPrefixId);
|
|
42
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test('should reject KSUID with missing prefix', () => {
|
|
46
|
+
const schema = KSUIDSchema('usr');
|
|
47
|
+
const noPrefixId = '123456789012345678901234567';
|
|
48
|
+
|
|
49
|
+
const result = schema(noPrefixId);
|
|
50
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test('should reject KSUID with missing underscore', () => {
|
|
54
|
+
const schema = KSUIDSchema('usr');
|
|
55
|
+
const noUnderscoreId = 'usr123456789012345678901234567';
|
|
56
|
+
|
|
57
|
+
const result = schema(noUnderscoreId);
|
|
58
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test('should reject KSUID with incorrect suffix length (too short)', () => {
|
|
62
|
+
const schema = KSUIDSchema('usr');
|
|
63
|
+
const shortId = 'usr_12345678901234567890123456';
|
|
64
|
+
|
|
65
|
+
const result = schema(shortId);
|
|
66
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
test('should reject KSUID with incorrect suffix length (too long)', () => {
|
|
70
|
+
const schema = KSUIDSchema('usr');
|
|
71
|
+
const longId = 'usr_1234567890123456789012345678';
|
|
72
|
+
|
|
73
|
+
const result = schema(longId);
|
|
74
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
test('should reject KSUID with invalid characters in suffix', () => {
|
|
78
|
+
const schema = KSUIDSchema('usr');
|
|
79
|
+
const invalidCharsId = 'usr_123456789012345678901234_*';
|
|
80
|
+
|
|
81
|
+
const result = schema(invalidCharsId);
|
|
82
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test('should reject KSUID with special characters in suffix', () => {
|
|
86
|
+
const schema = KSUIDSchema('usr');
|
|
87
|
+
const specialCharsId = 'usr_12345678901234567890123456@';
|
|
88
|
+
|
|
89
|
+
const result = schema(specialCharsId);
|
|
90
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
test('should reject KSUID with spaces', () => {
|
|
94
|
+
const schema = KSUIDSchema('usr');
|
|
95
|
+
const spaceId = 'usr_1234567890123456789012345 7';
|
|
96
|
+
|
|
97
|
+
const result = schema(spaceId);
|
|
98
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
test('should reject empty string', () => {
|
|
102
|
+
const schema = KSUIDSchema('usr');
|
|
103
|
+
|
|
104
|
+
const result = schema('');
|
|
105
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
test('should reject non-string values', () => {
|
|
109
|
+
const schema = KSUIDSchema('usr');
|
|
110
|
+
|
|
111
|
+
expect(schema(123)).toBeInstanceOf(type.errors);
|
|
112
|
+
expect(schema(null)).toBeInstanceOf(type.errors);
|
|
113
|
+
expect(schema(undefined)).toBeInstanceOf(type.errors);
|
|
114
|
+
expect(schema({})).toBeInstanceOf(type.errors);
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
test('should work with complex prefixes', () => {
|
|
118
|
+
const complexSchema = KSUIDSchema('app_config');
|
|
119
|
+
const validComplexId = 'app_config_123456789012345678901234567';
|
|
120
|
+
|
|
121
|
+
const result = complexSchema(validComplexId);
|
|
122
|
+
expect(result).toBe(validComplexId);
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
test('should work with single character prefix', () => {
|
|
126
|
+
const singleCharSchema = KSUIDSchema('a');
|
|
127
|
+
const validSingleCharId = 'a_123456789012345678901234567';
|
|
128
|
+
|
|
129
|
+
const result = singleCharSchema(validSingleCharId);
|
|
130
|
+
expect(result).toBe(validSingleCharId);
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
test('should create different schemas for different prefixes', () => {
|
|
134
|
+
const userSchema = KSUIDSchema('usr');
|
|
135
|
+
const orgSchema = KSUIDSchema('org');
|
|
136
|
+
|
|
137
|
+
const userId = 'usr_123456789012345678901234567';
|
|
138
|
+
const orgId = 'org_123456789012345678901234567';
|
|
139
|
+
|
|
140
|
+
// User schema should accept user ID but reject org ID
|
|
141
|
+
expect(userSchema(userId)).toBe(userId);
|
|
142
|
+
expect(userSchema(orgId)).toBeInstanceOf(type.errors);
|
|
143
|
+
|
|
144
|
+
// Org schema should accept org ID but reject user ID
|
|
145
|
+
expect(orgSchema(orgId)).toBe(orgId);
|
|
146
|
+
expect(orgSchema(userId)).toBeInstanceOf(type.errors);
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
});
|