@go-mondo/identity-sdk 0.0.2-beta.8 → 0.0.2-beta.9
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 +8 -0
- package/dist/cjs/action/schema/base.d.ts.map +1 -1
- package/dist/cjs/action/schema/base.js +3 -1
- 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 +122 -0
- package/dist/cjs/action/schema/operations/set-password.js +1 -1
- package/dist/cjs/action/schema/operations/set-password.test.d.ts +2 -0
- package/dist/cjs/action/schema/operations/set-password.test.d.ts.map +1 -0
- package/dist/cjs/action/schema/operations/set-password.test.js +167 -0
- package/dist/cjs/action/schema/operations/sign-up-verification.js +1 -1
- 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 +141 -0
- 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 +174 -0
- package/dist/cjs/action/schema/operations/user-attribute-verification.js +1 -1
- 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 +129 -0
- 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 +191 -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.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 +1 -1
- package/dist/cjs/activity/schema/base.d.ts.map +1 -1
- package/dist/cjs/activity/schema/base.js +5 -4
- 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 +239 -0
- package/dist/cjs/activity/schema/schema.d.ts +5 -5
- 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 +344 -0
- package/dist/cjs/activity/schema/types/authentication.d.ts +1 -1
- package/dist/cjs/activity/schema/types/authentication.js +1 -1
- 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 +303 -0
- package/dist/cjs/activity/schema/types/authorization.d.ts +1 -1
- package/dist/cjs/activity/schema/types/authorization.js +1 -1
- 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 +341 -0
- package/dist/cjs/activity/schema/types/note.d.ts +1 -1
- 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 +319 -0
- package/dist/cjs/activity/schema/types/operation.d.ts +1 -1
- 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 +344 -0
- package/dist/cjs/activity/schema/types/unknown.d.ts +1 -1
- 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 +275 -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/schema.d.ts +6 -6
- package/dist/cjs/app/authorization/schema.d.ts.map +1 -1
- package/dist/cjs/app/authorization/schema.js +39 -26
- 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 +353 -0
- package/dist/cjs/app/oauth/schema.d.ts +1 -1
- package/dist/cjs/app/oauth/schema.d.ts.map +1 -1
- package/dist/cjs/app/oauth/schema.js +2 -1
- 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 +173 -0
- package/dist/cjs/app/oidc/schema.d.ts +2 -2
- package/dist/cjs/app/oidc/schema.d.ts.map +1 -1
- package/dist/cjs/app/oidc/schema.js +1 -1
- 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 +95 -0
- 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 +1 -1
- 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 +262 -0
- 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/schema.d.ts +3 -3
- package/dist/cjs/app/saml/schema.d.ts.map +1 -1
- package/dist/cjs/app/saml/schema.js +2 -2
- package/dist/cjs/app/schema.d.ts +5 -1
- package/dist/cjs/app/schema.d.ts.map +1 -1
- package/dist/cjs/app/schema.js +7 -2
- 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 +184 -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/schema.d.ts +23 -23
- package/dist/cjs/association/schema.js +3 -3
- 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 +121 -0
- package/dist/cjs/authentication/factors/schema.test.js +19 -18
- package/dist/cjs/authentication/providers/schema.js +1 -1
- package/dist/cjs/authentication/sessions/schema.d.ts +5 -5
- package/dist/cjs/authentication/sessions/schema.d.ts.map +1 -1
- package/dist/cjs/authentication/sessions/schema.js +4 -2
- package/dist/cjs/authentication/settings/schema.d.ts +1 -1
- package/dist/cjs/authentication/settings/schema.js +1 -1
- 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 +73 -0
- package/dist/cjs/authentication/strategies/schema/base.d.ts +1 -1
- package/dist/cjs/authentication/strategies/schema/base.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/schema/base.js +3 -1
- package/dist/cjs/authentication/strategies/schema/schema.d.ts +3 -3
- package/dist/cjs/authentication/strategies/schema/types/email.d.ts +1 -1
- 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/password.d.ts +1 -1
- package/dist/cjs/authentication/strategies/schema/types/totp.d.ts +1 -1
- 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/schema.d.ts +1 -2
- package/dist/cjs/authorization/permissions/schema.d.ts.map +1 -1
- package/dist/cjs/authorization/permissions/schema.js +9 -10
- 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 +217 -0
- package/dist/cjs/authorization/roles/schema.d.ts +3 -3
- package/dist/cjs/authorization/roles/schema.d.ts.map +1 -1
- package/dist/cjs/authorization/roles/schema.js +10 -10
- 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 +236 -0
- package/dist/cjs/authorization/schema.d.ts +17 -0
- package/dist/cjs/authorization/schema.d.ts.map +1 -0
- package/dist/cjs/authorization/{utils.js → schema.js} +7 -1
- 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 +2 -2
- package/dist/cjs/common/resources/init.d.ts.map +1 -1
- package/dist/cjs/common/resources/init.js +1 -1
- 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.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 -1
- package/dist/cjs/common/resources/utils.d.ts.map +1 -1
- 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 +163 -0
- 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 +75 -0
- package/dist/cjs/common/schema/collection.d.ts +2 -2
- 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 +98 -0
- package/dist/cjs/common/schema/id.d.ts +2 -0
- package/dist/cjs/common/schema/id.d.ts.map +1 -0
- package/dist/cjs/common/schema/id.js +6 -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 +116 -0
- 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 +56 -0
- package/dist/cjs/common/schema/metadata.d.ts +9 -3
- package/dist/cjs/common/schema/metadata.d.ts.map +1 -1
- package/dist/cjs/common/schema/metadata.js +27 -8
- package/dist/cjs/common/schema/metadata.test.js +49 -0
- package/dist/cjs/common/schema/pagination.d.ts +2 -2
- package/dist/cjs/common/schema/pagination.js +2 -2
- 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 +68 -0
- package/dist/cjs/common/schema/sets.test.d.ts +2 -0
- package/dist/cjs/common/schema/sets.test.d.ts.map +1 -0
- package/dist/cjs/common/schema/sets.test.js +84 -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/{schema/organization.d.ts → organization/schema.d.ts} +4 -3
- package/dist/cjs/customer/organization/schema.d.ts.map +1 -0
- package/dist/cjs/customer/{schema/organization.js → organization/schema.js} +9 -7
- package/dist/cjs/customer/schema.d.ts +17 -0
- package/dist/cjs/customer/schema.d.ts.map +1 -0
- package/dist/cjs/customer/{schema/utils.js → schema.js} +7 -1
- 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/schema.d.ts +4 -3
- package/dist/cjs/customer/users/schema.d.ts.map +1 -1
- package/dist/cjs/customer/users/schema.js +29 -26
- package/dist/cjs/customer/users/schema.test.js +13 -12
- 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.test.d.ts +2 -0
- package/dist/cjs/identity/schema.test.d.ts.map +1 -0
- package/dist/cjs/identity/schema.test.js +40 -0
- package/dist/cjs/oauth/authorize/schema/grants/authorization-code.d.ts.map +1 -1
- package/dist/cjs/oauth/authorize/schema/grants/authorization-code.js +22 -3
- 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 +334 -0
- 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 +290 -0
- 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 +122 -0
- 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 +73 -0
- package/dist/cjs/workspace/tenant/schema.d.ts +1 -0
- package/dist/cjs/workspace/tenant/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/tenant/schema.js +8 -7
- package/dist/cjs/workspace/user/notifications/schema.d.ts.map +1 -1
- package/dist/cjs/workspace/user/notifications/schema.js +3 -2
- package/dist/cjs/workspace/user/preferences/schema.js +2 -2
- 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.map +1 -1
- package/dist/esm/action/schema/base.js +3 -1
- 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 +120 -0
- package/dist/esm/action/schema/operations/set-password.js +1 -1
- package/dist/esm/action/schema/operations/set-password.test.d.ts +2 -0
- package/dist/esm/action/schema/operations/set-password.test.d.ts.map +1 -0
- package/dist/esm/action/schema/operations/set-password.test.js +165 -0
- package/dist/esm/action/schema/operations/sign-up-verification.js +1 -1
- 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 +139 -0
- 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 +172 -0
- package/dist/esm/action/schema/operations/user-attribute-verification.js +1 -1
- 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 +127 -0
- 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 +189 -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.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 +1 -1
- package/dist/esm/activity/schema/base.d.ts.map +1 -1
- package/dist/esm/activity/schema/base.js +7 -6
- 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 +237 -0
- package/dist/esm/activity/schema/schema.d.ts +5 -5
- 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 +342 -0
- package/dist/esm/activity/schema/types/authentication.d.ts +1 -1
- package/dist/esm/activity/schema/types/authentication.js +1 -1
- 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 +301 -0
- package/dist/esm/activity/schema/types/authorization.d.ts +1 -1
- package/dist/esm/activity/schema/types/authorization.js +1 -1
- 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 +339 -0
- package/dist/esm/activity/schema/types/note.d.ts +1 -1
- 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 +317 -0
- package/dist/esm/activity/schema/types/operation.d.ts +1 -1
- 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 +342 -0
- package/dist/esm/activity/schema/types/unknown.d.ts +1 -1
- 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 +273 -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/schema.d.ts +6 -6
- package/dist/esm/app/authorization/schema.d.ts.map +1 -1
- package/dist/esm/app/authorization/schema.js +40 -27
- 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 +351 -0
- package/dist/esm/app/oauth/schema.d.ts +1 -1
- package/dist/esm/app/oauth/schema.d.ts.map +1 -1
- package/dist/esm/app/oauth/schema.js +3 -2
- 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 +171 -0
- package/dist/esm/app/oidc/schema.d.ts +2 -2
- package/dist/esm/app/oidc/schema.d.ts.map +1 -1
- package/dist/esm/app/oidc/schema.js +2 -2
- 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 +93 -0
- 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 +1 -1
- 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 +260 -0
- 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/schema.d.ts +3 -3
- package/dist/esm/app/saml/schema.d.ts.map +1 -1
- package/dist/esm/app/saml/schema.js +3 -3
- package/dist/esm/app/schema.d.ts +5 -1
- package/dist/esm/app/schema.d.ts.map +1 -1
- package/dist/esm/app/schema.js +7 -2
- 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 +182 -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/schema.d.ts +23 -23
- package/dist/esm/association/schema.js +1 -1
- 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 +119 -0
- package/dist/esm/authentication/factors/schema.test.js +19 -18
- package/dist/esm/authentication/providers/schema.js +1 -1
- package/dist/esm/authentication/sessions/schema.d.ts +5 -5
- package/dist/esm/authentication/sessions/schema.d.ts.map +1 -1
- package/dist/esm/authentication/sessions/schema.js +4 -2
- package/dist/esm/authentication/settings/schema.d.ts +1 -1
- package/dist/esm/authentication/settings/schema.js +2 -2
- 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 +71 -0
- package/dist/esm/authentication/strategies/schema/base.d.ts +1 -1
- package/dist/esm/authentication/strategies/schema/base.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/schema/base.js +3 -1
- package/dist/esm/authentication/strategies/schema/schema.d.ts +3 -3
- package/dist/esm/authentication/strategies/schema/types/email.d.ts +1 -1
- 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/password.d.ts +1 -1
- package/dist/esm/authentication/strategies/schema/types/totp.d.ts +1 -1
- 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/schema.d.ts +1 -2
- package/dist/esm/authorization/permissions/schema.d.ts.map +1 -1
- package/dist/esm/authorization/permissions/schema.js +7 -8
- 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 +215 -0
- package/dist/esm/authorization/roles/schema.d.ts +3 -3
- package/dist/esm/authorization/roles/schema.d.ts.map +1 -1
- package/dist/esm/authorization/roles/schema.js +9 -9
- 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 +234 -0
- package/dist/esm/authorization/schema.d.ts +17 -0
- package/dist/esm/authorization/schema.d.ts.map +1 -0
- package/dist/esm/authorization/schema.js +21 -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 +2 -2
- package/dist/esm/common/resources/init.d.ts.map +1 -1
- package/dist/esm/common/resources/init.js +1 -1
- 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.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 -1
- package/dist/esm/common/resources/utils.d.ts.map +1 -1
- 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 +161 -0
- 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 +73 -0
- package/dist/esm/common/schema/collection.d.ts +2 -2
- 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 +96 -0
- package/dist/esm/common/schema/id.d.ts +2 -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 +114 -0
- 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 +54 -0
- package/dist/esm/common/schema/metadata.d.ts +9 -3
- package/dist/esm/common/schema/metadata.d.ts.map +1 -1
- package/dist/esm/common/schema/metadata.js +24 -6
- package/dist/esm/common/schema/metadata.test.js +50 -1
- package/dist/esm/common/schema/pagination.d.ts +2 -2
- package/dist/esm/common/schema/pagination.js +2 -2
- 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 +66 -0
- package/dist/esm/common/schema/sets.test.d.ts +2 -0
- package/dist/esm/common/schema/sets.test.d.ts.map +1 -0
- package/dist/esm/common/schema/sets.test.js +82 -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/{schema/organization.d.ts → organization/schema.d.ts} +4 -3
- package/dist/esm/customer/organization/schema.d.ts.map +1 -0
- package/dist/esm/customer/{schema/organization.js → organization/schema.js} +7 -5
- package/dist/esm/customer/schema.d.ts +17 -0
- package/dist/esm/customer/schema.d.ts.map +1 -0
- package/dist/esm/customer/schema.js +21 -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/schema.d.ts +4 -3
- package/dist/esm/customer/users/schema.d.ts.map +1 -1
- package/dist/esm/customer/users/schema.js +9 -6
- package/dist/esm/customer/users/schema.test.js +6 -5
- 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.test.d.ts +2 -0
- package/dist/esm/identity/schema.test.d.ts.map +1 -0
- package/dist/esm/identity/schema.test.js +38 -0
- package/dist/esm/oauth/authorize/schema/grants/authorization-code.d.ts.map +1 -1
- package/dist/esm/oauth/authorize/schema/grants/authorization-code.js +22 -3
- 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 +332 -0
- 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 +288 -0
- 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 +120 -0
- 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 +71 -0
- package/dist/esm/workspace/tenant/schema.d.ts +1 -0
- package/dist/esm/workspace/tenant/schema.d.ts.map +1 -1
- package/dist/esm/workspace/tenant/schema.js +4 -3
- package/dist/esm/workspace/user/notifications/schema.d.ts.map +1 -1
- package/dist/esm/workspace/user/notifications/schema.js +4 -3
- package/dist/esm/workspace/user/preferences/schema.js +3 -3
- 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 +1 -1
- package/dist/cjs/authorization/utils.d.ts +0 -11
- package/dist/cjs/authorization/utils.d.ts.map +0 -1
- package/dist/cjs/customer/schema/organization.d.ts.map +0 -1
- 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/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.map +0 -1
- 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
|
@@ -17,6 +17,11 @@ export declare const AssociationAttributesReferenceSchema: import("arktype/inter
|
|
|
17
17
|
export type AssociationAttributesReference = typeof AssociationAttributesReferenceSchema.inferOut;
|
|
18
18
|
export type AssociationReference = AssociationIdReference | AssociationAttributesReference;
|
|
19
19
|
export declare const AssociationObjectSchema: import("arktype/internal/methods/object.ts").ObjectType<{
|
|
20
|
+
id: string;
|
|
21
|
+
status: import("arktype/internal/attributes.ts").Default<"enabled" | "disabled", "disabled">;
|
|
22
|
+
label: string;
|
|
23
|
+
model: "App";
|
|
24
|
+
} | {
|
|
20
25
|
id: string;
|
|
21
26
|
givenName?: string | undefined;
|
|
22
27
|
middleName?: string | undefined;
|
|
@@ -27,11 +32,6 @@ export declare const AssociationObjectSchema: import("arktype/internal/methods/o
|
|
|
27
32
|
phoneNumber?: string | undefined;
|
|
28
33
|
status: import("arktype/internal/attributes.ts").Default<"active" | "suspended" | "unverified", "unverified">;
|
|
29
34
|
model: "User";
|
|
30
|
-
} | {
|
|
31
|
-
id: string;
|
|
32
|
-
status: import("arktype/internal/attributes.ts").Default<"enabled" | "disabled", "disabled">;
|
|
33
|
-
label: string;
|
|
34
|
-
model: "App";
|
|
35
35
|
} | {
|
|
36
36
|
id: string;
|
|
37
37
|
name: string;
|
|
@@ -50,6 +50,11 @@ export declare const AssociationObjectSchema: import("arktype/internal/methods/o
|
|
|
50
50
|
export type AssociationObject = typeof AssociationObjectSchema.inferOut;
|
|
51
51
|
export declare const ObjectPropertySchema: import("arktype/internal/methods/object.ts").ObjectType<{
|
|
52
52
|
object: {
|
|
53
|
+
id: string;
|
|
54
|
+
status: import("arktype/internal/attributes.ts").Default<"enabled" | "disabled", "disabled">;
|
|
55
|
+
label: string;
|
|
56
|
+
model: "App";
|
|
57
|
+
} | {
|
|
53
58
|
id: string;
|
|
54
59
|
givenName?: string | undefined;
|
|
55
60
|
middleName?: string | undefined;
|
|
@@ -60,11 +65,6 @@ export declare const ObjectPropertySchema: import("arktype/internal/methods/obje
|
|
|
60
65
|
phoneNumber?: string | undefined;
|
|
61
66
|
status: import("arktype/internal/attributes.ts").Default<"active" | "suspended" | "unverified", "unverified">;
|
|
62
67
|
model: "User";
|
|
63
|
-
} | {
|
|
64
|
-
id: string;
|
|
65
|
-
status: import("arktype/internal/attributes.ts").Default<"enabled" | "disabled", "disabled">;
|
|
66
|
-
label: string;
|
|
67
|
-
model: "App";
|
|
68
68
|
} | {
|
|
69
69
|
id: string;
|
|
70
70
|
name: string;
|
|
@@ -83,6 +83,11 @@ export declare const ObjectPropertySchema: import("arktype/internal/methods/obje
|
|
|
83
83
|
}, {}>;
|
|
84
84
|
export declare const AssociationSchema: import("arktype/internal/methods/object.ts").ObjectType<{
|
|
85
85
|
object: {
|
|
86
|
+
id: string;
|
|
87
|
+
status: import("arktype/internal/attributes.ts").Default<"enabled" | "disabled", "disabled">;
|
|
88
|
+
label: string;
|
|
89
|
+
model: "App";
|
|
90
|
+
} | {
|
|
86
91
|
id: string;
|
|
87
92
|
givenName?: string | undefined;
|
|
88
93
|
middleName?: string | undefined;
|
|
@@ -93,11 +98,6 @@ export declare const AssociationSchema: import("arktype/internal/methods/object.
|
|
|
93
98
|
phoneNumber?: string | undefined;
|
|
94
99
|
status: import("arktype/internal/attributes.ts").Default<"active" | "suspended" | "unverified", "unverified">;
|
|
95
100
|
model: "User";
|
|
96
|
-
} | {
|
|
97
|
-
id: string;
|
|
98
|
-
status: import("arktype/internal/attributes.ts").Default<"enabled" | "disabled", "disabled">;
|
|
99
|
-
label: string;
|
|
100
|
-
model: "App";
|
|
101
101
|
} | {
|
|
102
102
|
id: string;
|
|
103
103
|
name: string;
|
|
@@ -117,14 +117,14 @@ export declare const AssociationSchema: import("arktype/internal/methods/object.
|
|
|
117
117
|
expiresAt?: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined;
|
|
118
118
|
deletedAt?: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined;
|
|
119
119
|
deactivatedAt?: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined;
|
|
120
|
-
metadata: (In: import("arktype/internal/attributes.ts").Default<unknown, Map<string, string | number | boolean>>) => import("arktype").Out<Map<string, string | number | boolean
|
|
120
|
+
metadata: (In: import("arktype/internal/attributes.ts").Default<unknown, Map<string, string | number | boolean>>) => import("arktype").Out<Map<string, string | number | boolean>>;
|
|
121
121
|
}, {}>;
|
|
122
122
|
declare const RootAssociationProperties: import("arktype/internal/methods/object.ts").ObjectType<{
|
|
123
123
|
updatedAt: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
124
124
|
expiresAt?: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined;
|
|
125
125
|
deletedAt?: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined;
|
|
126
126
|
deactivatedAt?: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined;
|
|
127
|
-
metadata: (In: import("arktype/internal/attributes.ts").Default<unknown, Map<string, string | number | boolean>>) => import("arktype").Out<Map<string, string | number | boolean
|
|
127
|
+
metadata: (In: import("arktype/internal/attributes.ts").Default<unknown, Map<string, string | number | boolean>>) => import("arktype").Out<Map<string, string | number | boolean>>;
|
|
128
128
|
}, {}>;
|
|
129
129
|
type RootAssociationProperties = typeof RootAssociationProperties.inferIn;
|
|
130
130
|
export type AssociationProperties<O extends AssociationObject = AssociationObject> = RootAssociationProperties & {
|
|
@@ -135,7 +135,7 @@ declare const RootAssociation: import("arktype/internal/methods/object.ts").Obje
|
|
|
135
135
|
expiresAt?: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined;
|
|
136
136
|
deletedAt?: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined;
|
|
137
137
|
deactivatedAt?: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined;
|
|
138
|
-
metadata: (In: import("arktype/internal/attributes.ts").Default<unknown, Map<string, string | number | boolean>>) => import("arktype").Out<Map<string, string | number | boolean
|
|
138
|
+
metadata: (In: import("arktype/internal/attributes.ts").Default<unknown, Map<string, string | number | boolean>>) => import("arktype").Out<Map<string, string | number | boolean>>;
|
|
139
139
|
}, {}>;
|
|
140
140
|
type RootAssociation = typeof RootAssociation.inferOut;
|
|
141
141
|
export type Association<O extends AssociationObject = AssociationObject> = RootAssociation & {
|
|
@@ -147,6 +147,11 @@ export declare const AssociationPayloadSchema: import("arktype/internal/methods/
|
|
|
147
147
|
deletedAt?: ((In: string | Date | undefined) => import("arktype").Out<string | undefined>) | undefined;
|
|
148
148
|
deactivatedAt?: ((In: string | Date | undefined) => import("arktype").Out<string | undefined>) | undefined;
|
|
149
149
|
object: {
|
|
150
|
+
id: string;
|
|
151
|
+
status: import("arktype/internal/attributes.ts").Default<"enabled" | "disabled", "disabled">;
|
|
152
|
+
label: string;
|
|
153
|
+
model: "App";
|
|
154
|
+
} | {
|
|
150
155
|
id: string;
|
|
151
156
|
givenName?: string | undefined;
|
|
152
157
|
middleName?: string | undefined;
|
|
@@ -157,11 +162,6 @@ export declare const AssociationPayloadSchema: import("arktype/internal/methods/
|
|
|
157
162
|
phoneNumber?: string | undefined;
|
|
158
163
|
status: import("arktype/internal/attributes.ts").Default<"active" | "suspended" | "unverified", "unverified">;
|
|
159
164
|
model: "User";
|
|
160
|
-
} | {
|
|
161
|
-
id: string;
|
|
162
|
-
status: import("arktype/internal/attributes.ts").Default<"enabled" | "disabled", "disabled">;
|
|
163
|
-
label: string;
|
|
164
|
-
model: "App";
|
|
165
165
|
} | {
|
|
166
166
|
id: string;
|
|
167
167
|
name: string;
|
|
@@ -3,7 +3,7 @@ import { AppAssociationReferenceSchema } from '../app/schema.js';
|
|
|
3
3
|
import { PermissionAssociationReferenceSchema, RoleAssociationReferenceSchema, } from '../authorization/index.js';
|
|
4
4
|
import { OptionalDatePayloadSchema, OptionalDateSchema, RequiredDatePayloadSchema, RequiredDateSchema, } from '../common/schema/dates.js';
|
|
5
5
|
import { MetadataMapPropertySchema, MetadataPayloadPropertySchema, } from '../common/schema/metadata.js';
|
|
6
|
-
import { OrganizationAssociationReferenceSchema } from '../customer/schema
|
|
6
|
+
import { OrganizationAssociationReferenceSchema } from '../customer/organization/schema.js';
|
|
7
7
|
import { UserAssociationReferenceSchema } from '../customer/users/schema.js';
|
|
8
8
|
export const AssociationObjectType = {
|
|
9
9
|
USER: 'User',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.test.d.ts","sourceRoot":"","sources":["../../../src/association/schema.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { type } from 'arktype';
|
|
2
|
+
import { describe, expect, test } from 'vitest';
|
|
3
|
+
import { generateAppId } from '../app/utils.js';
|
|
4
|
+
import { generatePermissionId, generateRoleId, } from '../authorization/schema.js';
|
|
5
|
+
import { generateUserId } from '../customer/schema.js';
|
|
6
|
+
import { AssociationObjectType, AssociationIdReferenceSchema, AssociationAttributesReferenceSchema, AssociationObjectSchema, } from './schema.js';
|
|
7
|
+
describe('Association - Schema', () => {
|
|
8
|
+
describe('AssociationObjectType constants', () => {
|
|
9
|
+
test('should have correct object type values', () => {
|
|
10
|
+
expect(AssociationObjectType.USER).toBe('User');
|
|
11
|
+
expect(AssociationObjectType.ORGANIZATION).toBe('Organization');
|
|
12
|
+
expect(AssociationObjectType.ROLE).toBe('Role');
|
|
13
|
+
expect(AssociationObjectType.APP).toBe('App');
|
|
14
|
+
expect(AssociationObjectType.PERMISSION).toBe('Permission');
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
describe('AssociationIdReferenceSchema', () => {
|
|
18
|
+
test('should accept valid id reference', () => {
|
|
19
|
+
const reference = { id: 'any_string_id' };
|
|
20
|
+
const result = AssociationIdReferenceSchema(reference);
|
|
21
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
22
|
+
expect(result).toEqual(reference);
|
|
23
|
+
});
|
|
24
|
+
test('should reject missing id', () => {
|
|
25
|
+
const result = AssociationIdReferenceSchema({});
|
|
26
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
27
|
+
});
|
|
28
|
+
test('should reject non-string id', () => {
|
|
29
|
+
const reference = { id: 123 };
|
|
30
|
+
const result = AssociationIdReferenceSchema(reference);
|
|
31
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
describe('AssociationAttributesReferenceSchema', () => {
|
|
35
|
+
test('should accept id with additional attributes', () => {
|
|
36
|
+
const reference = {
|
|
37
|
+
id: 'test_id',
|
|
38
|
+
name: 'Test Name',
|
|
39
|
+
status: 'active',
|
|
40
|
+
metadata: { key: 'value' },
|
|
41
|
+
};
|
|
42
|
+
const result = AssociationAttributesReferenceSchema(reference);
|
|
43
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
44
|
+
expect(result).toEqual(reference);
|
|
45
|
+
});
|
|
46
|
+
test('should accept minimal reference with just id', () => {
|
|
47
|
+
const reference = { id: 'minimal_id' };
|
|
48
|
+
const result = AssociationAttributesReferenceSchema(reference);
|
|
49
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
50
|
+
expect(result).toEqual(reference);
|
|
51
|
+
});
|
|
52
|
+
test('should reject missing id', () => {
|
|
53
|
+
const reference = { name: 'Test', status: 'active' };
|
|
54
|
+
const result = AssociationAttributesReferenceSchema(reference);
|
|
55
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
describe('AssociationObjectSchema', () => {
|
|
59
|
+
// Note: User association reference has complex requirements
|
|
60
|
+
// that depend on UserNamePropertiesSchema and EmailOrPhonePropertiesSchema
|
|
61
|
+
test('should accept App association reference', () => {
|
|
62
|
+
const appAssociation = {
|
|
63
|
+
id: generateAppId(),
|
|
64
|
+
status: 'enabled',
|
|
65
|
+
label: 'Test App',
|
|
66
|
+
model: 'App',
|
|
67
|
+
};
|
|
68
|
+
const result = AssociationObjectSchema(appAssociation);
|
|
69
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
70
|
+
});
|
|
71
|
+
test('should accept Role association reference', () => {
|
|
72
|
+
const roleAssociation = {
|
|
73
|
+
id: generateRoleId(),
|
|
74
|
+
name: 'admin',
|
|
75
|
+
status: 'enabled',
|
|
76
|
+
model: 'Role',
|
|
77
|
+
};
|
|
78
|
+
const result = AssociationObjectSchema(roleAssociation);
|
|
79
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
80
|
+
});
|
|
81
|
+
test('should accept Permission association reference', () => {
|
|
82
|
+
const permissionAssociation = {
|
|
83
|
+
id: generatePermissionId(),
|
|
84
|
+
name: 'read:users',
|
|
85
|
+
status: 'enabled',
|
|
86
|
+
model: 'Permission',
|
|
87
|
+
};
|
|
88
|
+
const result = AssociationObjectSchema(permissionAssociation);
|
|
89
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
90
|
+
});
|
|
91
|
+
test('should reject invalid association object', () => {
|
|
92
|
+
const invalidAssociation = {
|
|
93
|
+
id: 'test_id',
|
|
94
|
+
name: 'Test',
|
|
95
|
+
model: 'InvalidModel',
|
|
96
|
+
};
|
|
97
|
+
const result = AssociationObjectSchema(invalidAssociation);
|
|
98
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
99
|
+
});
|
|
100
|
+
test('should reject association missing required fields', () => {
|
|
101
|
+
const incompleteAssociation = {
|
|
102
|
+
id: generateUserId(),
|
|
103
|
+
// missing required fields for any valid association type
|
|
104
|
+
};
|
|
105
|
+
const result = AssociationObjectSchema(incompleteAssociation);
|
|
106
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
107
|
+
});
|
|
108
|
+
test('should reject association with mismatched model and data', () => {
|
|
109
|
+
const mismatchedAssociation = {
|
|
110
|
+
id: generateUserId(),
|
|
111
|
+
name: 'admin', // role field
|
|
112
|
+
status: 'enabled',
|
|
113
|
+
model: 'User', // but missing user fields
|
|
114
|
+
};
|
|
115
|
+
const result = AssociationObjectSchema(mismatchedAssociation);
|
|
116
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type } from 'arktype';
|
|
2
2
|
import { describe, expect, test } from 'vitest';
|
|
3
|
+
import { generateStrategyId } from '../utils.js';
|
|
3
4
|
import { AuthenticationFactorPayloadSchema, AuthenticationFactorsPayloadSchema, UpsertAuthenticationFactorsPayloadSchema, } from './schema.js';
|
|
4
5
|
describe('Authentication - Factors', () => {
|
|
5
6
|
describe('Schema', () => {
|
|
@@ -9,7 +10,7 @@ describe('Authentication - Factors', () => {
|
|
|
9
10
|
updatedAt: new Date(),
|
|
10
11
|
factors: [
|
|
11
12
|
{
|
|
12
|
-
id:
|
|
13
|
+
id: generateStrategyId(),
|
|
13
14
|
},
|
|
14
15
|
],
|
|
15
16
|
})).not.toBeInstanceOf(type.errors);
|
|
@@ -24,7 +25,7 @@ describe('Authentication - Factors', () => {
|
|
|
24
25
|
expect(UpsertAuthenticationFactorsPayloadSchema({
|
|
25
26
|
factors: [
|
|
26
27
|
{
|
|
27
|
-
id:
|
|
28
|
+
id: generateStrategyId(),
|
|
28
29
|
},
|
|
29
30
|
],
|
|
30
31
|
})).not.toBeInstanceOf(type.errors);
|
|
@@ -42,42 +43,42 @@ describe('Authentication - Factors', () => {
|
|
|
42
43
|
expect(AuthenticationFactorsPayloadSchema({
|
|
43
44
|
createdAt: new Date(),
|
|
44
45
|
updatedAt: new Date(),
|
|
45
|
-
factors: { id:
|
|
46
|
+
factors: { id: generateStrategyId() },
|
|
46
47
|
})).toBeInstanceOf(type.errors);
|
|
47
48
|
// Factor array of string
|
|
48
49
|
expect(AuthenticationFactorsPayloadSchema({
|
|
49
50
|
createdAt: new Date(),
|
|
50
51
|
updatedAt: new Date(),
|
|
51
|
-
factors: [
|
|
52
|
+
factors: [generateStrategyId()],
|
|
52
53
|
})).toBeInstanceOf(type.errors);
|
|
53
54
|
});
|
|
54
55
|
test('should accept various next factors types', async () => {
|
|
55
56
|
// Undefined
|
|
56
57
|
expect(AuthenticationFactorPayloadSchema({
|
|
57
|
-
id:
|
|
58
|
+
id: generateStrategyId(),
|
|
58
59
|
nextFactors: undefined,
|
|
59
60
|
})).not.toBeInstanceOf(type.errors);
|
|
60
61
|
// Array
|
|
61
62
|
expect(AuthenticationFactorPayloadSchema({
|
|
62
|
-
id:
|
|
63
|
+
id: generateStrategyId(),
|
|
63
64
|
nextFactors: [
|
|
64
65
|
{
|
|
65
|
-
id:
|
|
66
|
+
id: generateStrategyId(),
|
|
66
67
|
},
|
|
67
68
|
],
|
|
68
69
|
})).not.toBeInstanceOf(type.errors);
|
|
69
70
|
// Deeply nested array
|
|
70
71
|
expect(AuthenticationFactorPayloadSchema({
|
|
71
|
-
id:
|
|
72
|
+
id: generateStrategyId(),
|
|
72
73
|
nextFactors: [
|
|
73
74
|
{
|
|
74
|
-
id:
|
|
75
|
+
id: generateStrategyId(),
|
|
75
76
|
nextFactors: [
|
|
76
77
|
{
|
|
77
|
-
id:
|
|
78
|
+
id: generateStrategyId(),
|
|
78
79
|
nextFactors: [
|
|
79
80
|
{
|
|
80
|
-
id:
|
|
81
|
+
id: generateStrategyId(),
|
|
81
82
|
},
|
|
82
83
|
],
|
|
83
84
|
},
|
|
@@ -89,7 +90,7 @@ describe('Authentication - Factors', () => {
|
|
|
89
90
|
test('should throw error for invalid factor id', async () => {
|
|
90
91
|
// Number
|
|
91
92
|
expect(AuthenticationFactorsPayloadSchema({
|
|
92
|
-
id:
|
|
93
|
+
id: generateStrategyId(),
|
|
93
94
|
})).toBeInstanceOf(type.errors);
|
|
94
95
|
// Null
|
|
95
96
|
expect(AuthenticationFactorsPayloadSchema({
|
|
@@ -103,18 +104,18 @@ describe('Authentication - Factors', () => {
|
|
|
103
104
|
test('should throw error for invalid next factors', async () => {
|
|
104
105
|
// String
|
|
105
106
|
expect(AuthenticationFactorsPayloadSchema({
|
|
106
|
-
id:
|
|
107
|
-
nextFactors:
|
|
107
|
+
id: generateStrategyId(),
|
|
108
|
+
nextFactors: generateStrategyId(),
|
|
108
109
|
})).toBeInstanceOf(type.errors);
|
|
109
110
|
// Object
|
|
110
111
|
expect(AuthenticationFactorsPayloadSchema({
|
|
111
|
-
id:
|
|
112
|
-
nextFactors: { id:
|
|
112
|
+
id: generateStrategyId(),
|
|
113
|
+
nextFactors: { id: generateStrategyId() },
|
|
113
114
|
})).toBeInstanceOf(type.errors);
|
|
114
115
|
// Array
|
|
115
116
|
expect(AuthenticationFactorsPayloadSchema({
|
|
116
|
-
id:
|
|
117
|
-
nextFactors: [
|
|
117
|
+
id: generateStrategyId(),
|
|
118
|
+
nextFactors: [generateStrategyId()],
|
|
118
119
|
})).toBeInstanceOf(type.errors);
|
|
119
120
|
});
|
|
120
121
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type } from 'arktype';
|
|
2
2
|
import { OptionalDatePayloadSchema, RequiredDatePayloadSchema, } from '../../common/schema/dates.js';
|
|
3
3
|
import { MetadataPayloadPropertySchema } from '../../common/schema/metadata.js';
|
|
4
|
-
import { UserIdSchema } from '../../customer/
|
|
4
|
+
import { UserIdSchema } from '../../customer/schema.js';
|
|
5
5
|
import { StrategyIdSchema } from '../strategies/schema/base.js';
|
|
6
6
|
export const ProviderType = {
|
|
7
7
|
MONDO: 'mondo',
|
|
@@ -10,7 +10,7 @@ export declare const SessionIdPropertySchema: import("arktype/internal/methods/o
|
|
|
10
10
|
id: string;
|
|
11
11
|
}, {}>;
|
|
12
12
|
export type SessionIdProperty = typeof SessionIdPropertySchema.inferOut;
|
|
13
|
-
export declare const SessionStatusSchema: import("arktype/internal/methods/string.ts").StringType<"
|
|
13
|
+
export declare const SessionStatusSchema: import("arktype/internal/methods/string.ts").StringType<"pending" | "initiated" | "authenticated", {}>;
|
|
14
14
|
export declare const SessionAuthenticationFactorSchema: import("arktype/internal/methods/object.ts").ObjectType<{
|
|
15
15
|
id: string;
|
|
16
16
|
type: "email" | "password" | "totp";
|
|
@@ -22,7 +22,7 @@ export declare const SessionAuthenticationFactorHistorySchema: import("arktype/i
|
|
|
22
22
|
export type SessionAuthenticationFactorHistory = typeof SessionAuthenticationFactorHistorySchema.inferOut;
|
|
23
23
|
export declare const SessionSchema: import("arktype/internal/methods/object.ts").ObjectType<{
|
|
24
24
|
id: string;
|
|
25
|
-
status: "
|
|
25
|
+
status: "pending" | "initiated" | "authenticated";
|
|
26
26
|
user?: string | undefined;
|
|
27
27
|
userAgent?: string | undefined;
|
|
28
28
|
sourceIp?: string | undefined;
|
|
@@ -38,13 +38,13 @@ export declare const SessionSchema: import("arktype/internal/methods/object.ts")
|
|
|
38
38
|
updatedAt: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
39
39
|
deletedAt?: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined;
|
|
40
40
|
deactivatedAt?: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined;
|
|
41
|
-
metadata: (In: import("arktype/internal/attributes.ts").Default<unknown, Map<string, string | number | boolean>>) => import("arktype").Out<Map<string, string | number | boolean
|
|
41
|
+
metadata: (In: import("arktype/internal/attributes.ts").Default<unknown, Map<string, string | number | boolean>>) => import("arktype").Out<Map<string, string | number | boolean>>;
|
|
42
42
|
}, {}>;
|
|
43
43
|
export type SessionProperties = typeof SessionSchema.inferIn;
|
|
44
44
|
export type Session = typeof SessionSchema.inferOut;
|
|
45
45
|
export declare const SessionPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
|
|
46
46
|
id: string;
|
|
47
|
-
status: "
|
|
47
|
+
status: "pending" | "initiated" | "authenticated";
|
|
48
48
|
user?: string | undefined;
|
|
49
49
|
userAgent?: string | undefined;
|
|
50
50
|
sourceIp?: string | undefined;
|
|
@@ -69,7 +69,7 @@ export declare const SessionPayloadSchema: import("arktype/internal/methods/obje
|
|
|
69
69
|
export type SessionPayload = typeof SessionPayloadSchema.inferOut;
|
|
70
70
|
export declare const SessionAssociationReferenceSchema: import("arktype/internal/methods/object.ts").ObjectType<{
|
|
71
71
|
id: string;
|
|
72
|
-
status: "
|
|
72
|
+
status: "pending" | "initiated" | "authenticated";
|
|
73
73
|
user?: string | undefined;
|
|
74
74
|
userAgent?: string | undefined;
|
|
75
75
|
sourceIp?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/authentication/sessions/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/authentication/sessions/schema.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAErD,eAAO,MAAM,eAAe,qEAAuC,CAAC;AACpE,MAAM,MAAM,SAAS,GAAG,OAAO,eAAe,CAAC,QAAQ,CAAC;AAExD,eAAO,MAAM,uBAAuB;;MAElC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,uBAAuB,CAAC,QAAQ,CAAC;AAExE,eAAO,MAAM,mBAAmB,wGAI/B,CAAC;AAEF,eAAO,MAAM,iCAAiC;;;;;MAK5C,CAAC;AACH,MAAM,MAAM,2BAA2B,GACrC,OAAO,iCAAiC,CAAC,QAAQ,CAAC;AAMpD,eAAO,MAAM,wCAAwC,oKAKlD,CAAC;AACJ,MAAM,MAAM,kCAAkC,GAC5C,OAAO,wCAAwC,CAAC,QAAQ,CAAC;AAW3D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;MAMO,CAAC;AAClC,MAAM,MAAM,iBAAiB,GAAG,OAAO,aAAa,CAAC,OAAO,CAAC;AAC7D,MAAM,MAAM,OAAO,GAAG,OAAO,aAAa,CAAC,QAAQ,CAAC;AAEpD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;MAMI,CAAC;AACtC,MAAM,MAAM,cAAc,GAAG,OAAO,oBAAoB,CAAC,QAAQ,CAAC;AAElE,eAAO,MAAM,iCAAiC;;;;;;;;;MAU5C,CAAC;AACH,MAAM,MAAM,2BAA2B,GACrC,OAAO,iCAAiC,CAAC,QAAQ,CAAC"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { type } from 'arktype';
|
|
2
2
|
import { OptionalDatePayloadSchema, OptionalDateSchema, RequiredDatePayloadSchema, RequiredDateSchema, } from '../../common/schema/dates.js';
|
|
3
|
+
import { KSUIDSchema } from '../../common/schema/id.js';
|
|
3
4
|
import { MetadataMapPropertySchema, MetadataPayloadPropertySchema, } from '../../common/schema/metadata.js';
|
|
4
|
-
import { UserIdSchema } from '../../customer/
|
|
5
|
+
import { UserIdSchema } from '../../customer/schema.js';
|
|
5
6
|
import { StrategyIdSchema, StrategyTypeSchema, } from '../strategies/schema/base.js';
|
|
7
|
+
import { Model } from '../utils.js';
|
|
6
8
|
export const SessionStatus = {
|
|
7
9
|
INITIATED: 'initiated', // Session was created, but no activity has been taken
|
|
8
10
|
AUTHENTICATED: 'authenticated', // Session is authenticated
|
|
9
11
|
PENDING: 'pending', // Session is in the process of authenticating
|
|
10
12
|
};
|
|
11
|
-
export const SessionIdSchema =
|
|
13
|
+
export const SessionIdSchema = KSUIDSchema(Model.Session.UIDPrefix);
|
|
12
14
|
export const SessionIdPropertySchema = type({
|
|
13
15
|
id: SessionIdSchema,
|
|
14
16
|
});
|
|
@@ -16,7 +16,7 @@ export declare const SettingsSchema: import("arktype/internal/methods/object.ts"
|
|
|
16
16
|
}[] | undefined>) | undefined;
|
|
17
17
|
deletedAt?: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined;
|
|
18
18
|
deactivatedAt?: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined;
|
|
19
|
-
metadata: (In: import("arktype/internal/attributes.ts").Default<unknown, Map<string, string | number | boolean>>) => import("arktype").Out<Map<string, string | number | boolean
|
|
19
|
+
metadata: (In: import("arktype/internal/attributes.ts").Default<unknown, Map<string, string | number | boolean>>) => import("arktype").Out<Map<string, string | number | boolean>>;
|
|
20
20
|
}, {}>;
|
|
21
21
|
export type SettingsProperties = typeof SettingsSchema.inferIn;
|
|
22
22
|
export type Settings = typeof SettingsSchema.inferOut;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type } from 'arktype';
|
|
2
2
|
import { OptionalDatePayloadSchema, OptionalDateSchema, RequiredDateSchema, } from '../../common/schema/dates.js';
|
|
3
|
-
import { MetadataMapPropertySchema, MetadataPayloadPropertySchema,
|
|
3
|
+
import { MetadataMapPropertySchema, MetadataPayloadPropertySchema, UpsertMetadataPropertyPayloadSchema, } from '../../common/schema/metadata.js';
|
|
4
4
|
import { AuthenticationFactorsSchema } from '../factors/schema.js';
|
|
5
5
|
export const SettingsSchema = type({
|
|
6
6
|
factors: AuthenticationFactorsSchema.optional(),
|
|
@@ -17,4 +17,4 @@ export const SettingsPayloadSchema = type({
|
|
|
17
17
|
}).and(MetadataPayloadPropertySchema);
|
|
18
18
|
export const UpsertSettingsPayloadSchema = type({
|
|
19
19
|
factors: AuthenticationFactorsSchema.optional(),
|
|
20
|
-
}).and(
|
|
20
|
+
}).and(UpsertMetadataPropertyPayloadSchema);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.test.d.ts","sourceRoot":"","sources":["../../../../src/authentication/settings/schema.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type } from 'arktype';
|
|
2
|
+
import { describe, expect, test } from 'vitest';
|
|
3
|
+
import { SettingsSchema, SettingsPayloadSchema, UpsertSettingsPayloadSchema, } from './schema.js';
|
|
4
|
+
describe('Authentication Settings - Schema', () => {
|
|
5
|
+
describe('SettingsSchema', () => {
|
|
6
|
+
test('should accept minimal settings object', () => {
|
|
7
|
+
const settings = {
|
|
8
|
+
createdAt: new Date(),
|
|
9
|
+
updatedAt: new Date(),
|
|
10
|
+
metadata: {},
|
|
11
|
+
};
|
|
12
|
+
const result = SettingsSchema(settings);
|
|
13
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
14
|
+
});
|
|
15
|
+
test('should reject missing required dates', () => {
|
|
16
|
+
const settings = {
|
|
17
|
+
metadata: {},
|
|
18
|
+
// missing createdAt, updatedAt
|
|
19
|
+
};
|
|
20
|
+
const result = SettingsSchema(settings);
|
|
21
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
describe('SettingsPayloadSchema', () => {
|
|
25
|
+
test('should accept minimal payload', () => {
|
|
26
|
+
const payload = {
|
|
27
|
+
metadata: {},
|
|
28
|
+
};
|
|
29
|
+
const result = SettingsPayloadSchema(payload);
|
|
30
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
31
|
+
expect(result).toEqual(payload);
|
|
32
|
+
});
|
|
33
|
+
test('should accept payload with optional dates', () => {
|
|
34
|
+
const payload = {
|
|
35
|
+
updatedAt: new Date().toISOString(),
|
|
36
|
+
metadata: {},
|
|
37
|
+
};
|
|
38
|
+
const result = SettingsPayloadSchema(payload);
|
|
39
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
40
|
+
});
|
|
41
|
+
test('should accept empty payload', () => {
|
|
42
|
+
const payload = {
|
|
43
|
+
// Schema might have defaults for metadata
|
|
44
|
+
};
|
|
45
|
+
const result = SettingsPayloadSchema(payload);
|
|
46
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
describe('UpsertSettingsPayloadSchema', () => {
|
|
50
|
+
test('should accept empty upsert payload', () => {
|
|
51
|
+
const payload = {};
|
|
52
|
+
const result = UpsertSettingsPayloadSchema(payload);
|
|
53
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
54
|
+
expect(result).toEqual(payload);
|
|
55
|
+
});
|
|
56
|
+
test('should accept upsert with only metadata', () => {
|
|
57
|
+
const payload = {
|
|
58
|
+
metadata: { configVersion: '2.0' },
|
|
59
|
+
};
|
|
60
|
+
const result = UpsertSettingsPayloadSchema(payload);
|
|
61
|
+
expect(result).not.toBeInstanceOf(type.errors);
|
|
62
|
+
});
|
|
63
|
+
test('should reject invalid factors structure', () => {
|
|
64
|
+
const payload = {
|
|
65
|
+
factors: 'invalid-factors',
|
|
66
|
+
};
|
|
67
|
+
const result = UpsertSettingsPayloadSchema(payload);
|
|
68
|
+
expect(result).toBeInstanceOf(type.errors);
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
});
|
|
@@ -26,7 +26,7 @@ export declare const BaseStrategySchema: import("arktype/internal/methods/object
|
|
|
26
26
|
updatedAt: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
27
27
|
deletedAt?: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined;
|
|
28
28
|
deactivatedAt?: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined;
|
|
29
|
-
metadata: (In: import("arktype/internal/attributes.ts").Default<unknown, Map<string, string | number | boolean>>) => import("arktype").Out<Map<string, string | number | boolean
|
|
29
|
+
metadata: (In: import("arktype/internal/attributes.ts").Default<unknown, Map<string, string | number | boolean>>) => import("arktype").Out<Map<string, string | number | boolean>>;
|
|
30
30
|
}, {}>;
|
|
31
31
|
export declare const BaseStrategyPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
|
|
32
32
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../../src/authentication/strategies/schema/base.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../../src/authentication/strategies/schema/base.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE/E,eAAO,MAAM,cAAc;;;CAGjB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAC3B,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAEvD,eAAO,MAAM,gBAAgB,qEAAwC,CAAC;AACtE,MAAM,MAAM,UAAU,GAAG,OAAO,gBAAgB,CAAC,QAAQ,CAAC;AAE1D,eAAO,MAAM,wBAAwB;;MAEnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,wBAAwB,CAAC,QAAQ,CAAC;AAE1E,eAAO,MAAM,oBAAoB,qFAGhC,CAAC;AACF,eAAO,MAAM,kBAAkB,4FAI9B,CAAC;AACF,eAAO,MAAM,mBAAmB,qEAAiB,CAAC;AAOlD,eAAO,MAAM,kBAAkB;;;;;;;;;MAKE,CAAC;AAElC,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;MAKD,CAAC;AAEtC,eAAO,MAAM,+BAA+B;;;;;;;;;MAIP,CAAC;AAEtC,eAAO,MAAM,+BAA+B;;;;;;;;MAGP,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { type } from 'arktype';
|
|
2
2
|
import { OptionalDatePayloadSchema, OptionalDateSchema, RequiredDatePayloadSchema, RequiredDateSchema, } from '../../../common/index.js';
|
|
3
|
+
import { KSUIDSchema } from '../../../common/schema/id.js';
|
|
3
4
|
import { MetadataMapPropertySchema, MetadataPayloadPropertySchema, } from '../../../common/schema/metadata.js';
|
|
5
|
+
import { Model } from '../../utils.js';
|
|
4
6
|
export const StrategyType = {
|
|
5
7
|
EMAIL: 'email',
|
|
6
8
|
PASSWORD: 'password',
|
|
@@ -10,7 +12,7 @@ export const StrategyStatus = {
|
|
|
10
12
|
ENABLED: 'enabled',
|
|
11
13
|
DISABLED: 'disabled',
|
|
12
14
|
};
|
|
13
|
-
export const StrategyIdSchema =
|
|
15
|
+
export const StrategyIdSchema = KSUIDSchema(Model.Strategy.UIDPrefix);
|
|
14
16
|
export const StrategyIdPropertySchema = type({
|
|
15
17
|
id: StrategyIdSchema,
|
|
16
18
|
});
|
|
@@ -161,7 +161,7 @@ export declare const StrategySchema: import("arktype/internal/methods/object.ts"
|
|
|
161
161
|
updatedAt: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
162
162
|
deletedAt?: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined;
|
|
163
163
|
deactivatedAt?: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined;
|
|
164
|
-
metadata: (In: import("arktype/internal/attributes.ts").Default<unknown, Map<string, string | number | boolean>>) => import("arktype").Out<Map<string, string | number | boolean
|
|
164
|
+
metadata: (In: import("arktype/internal/attributes.ts").Default<unknown, Map<string, string | number | boolean>>) => import("arktype").Out<Map<string, string | number | boolean>>;
|
|
165
165
|
type: "email";
|
|
166
166
|
} | {
|
|
167
167
|
id: string;
|
|
@@ -171,7 +171,7 @@ export declare const StrategySchema: import("arktype/internal/methods/object.ts"
|
|
|
171
171
|
updatedAt: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
172
172
|
deletedAt?: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined;
|
|
173
173
|
deactivatedAt?: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined;
|
|
174
|
-
metadata: (In: import("arktype/internal/attributes.ts").Default<unknown, Map<string, string | number | boolean>>) => import("arktype").Out<Map<string, string | number | boolean
|
|
174
|
+
metadata: (In: import("arktype/internal/attributes.ts").Default<unknown, Map<string, string | number | boolean>>) => import("arktype").Out<Map<string, string | number | boolean>>;
|
|
175
175
|
type: "password";
|
|
176
176
|
settings: {
|
|
177
177
|
passwordPolicy: {
|
|
@@ -191,7 +191,7 @@ export declare const StrategySchema: import("arktype/internal/methods/object.ts"
|
|
|
191
191
|
updatedAt: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
192
192
|
deletedAt?: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined;
|
|
193
193
|
deactivatedAt?: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined;
|
|
194
|
-
metadata: (In: import("arktype/internal/attributes.ts").Default<unknown, Map<string, string | number | boolean>>) => import("arktype").Out<Map<string, string | number | boolean
|
|
194
|
+
metadata: (In: import("arktype/internal/attributes.ts").Default<unknown, Map<string, string | number | boolean>>) => import("arktype").Out<Map<string, string | number | boolean>>;
|
|
195
195
|
type: "totp";
|
|
196
196
|
settings: {
|
|
197
197
|
digits: import("arktype/internal/attributes.ts").Default<6 | 7 | 8, 6>;
|
|
@@ -6,7 +6,7 @@ export declare const EmailStrategySchema: import("arktype/internal/methods/objec
|
|
|
6
6
|
updatedAt: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
7
7
|
deletedAt?: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined;
|
|
8
8
|
deactivatedAt?: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined;
|
|
9
|
-
metadata: (In: import("arktype/internal/attributes.ts").Default<unknown, Map<string, string | number | boolean>>) => import("arktype").Out<Map<string, string | number | boolean
|
|
9
|
+
metadata: (In: import("arktype/internal/attributes.ts").Default<unknown, Map<string, string | number | boolean>>) => import("arktype").Out<Map<string, string | number | boolean>>;
|
|
10
10
|
type: "email";
|
|
11
11
|
}, {}>;
|
|
12
12
|
export type EmailStrategyProperties = typeof EmailStrategySchema.inferIn;
|