@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.test.d.ts","sourceRoot":"","sources":["../../../src/app/schema.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const arktype_1 = require("arktype");
|
|
4
|
+
const vitest_1 = require("vitest");
|
|
5
|
+
const schema_js_1 = require("./schema.js");
|
|
6
|
+
const utils_js_1 = require("./utils.js");
|
|
7
|
+
(0, vitest_1.describe)('App - Schema', () => {
|
|
8
|
+
(0, vitest_1.describe)('AppStatus constants', () => {
|
|
9
|
+
(0, vitest_1.test)('should have correct status values', () => {
|
|
10
|
+
(0, vitest_1.expect)(schema_js_1.AppStatus.ENABLED).toBe('enabled');
|
|
11
|
+
(0, vitest_1.expect)(schema_js_1.AppStatus.DISABLED).toBe('disabled');
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
(0, vitest_1.describe)('AppIdSchema', () => {
|
|
15
|
+
(0, vitest_1.test)('should accept valid app ID', () => {
|
|
16
|
+
const id = (0, utils_js_1.generateAppId)();
|
|
17
|
+
const result = (0, schema_js_1.AppIdSchema)(id);
|
|
18
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
19
|
+
(0, vitest_1.expect)(result).toBe(id);
|
|
20
|
+
});
|
|
21
|
+
(0, vitest_1.test)('should reject invalid app ID format', () => {
|
|
22
|
+
(0, vitest_1.expect)((0, schema_js_1.AppIdSchema)('invalid_id')).toBeInstanceOf(arktype_1.type.errors);
|
|
23
|
+
(0, vitest_1.expect)((0, schema_js_1.AppIdSchema)('wrong_prefix_123')).toBeInstanceOf(arktype_1.type.errors);
|
|
24
|
+
});
|
|
25
|
+
(0, vitest_1.test)('should reject non-string values', () => {
|
|
26
|
+
(0, vitest_1.expect)((0, schema_js_1.AppIdSchema)(123)).toBeInstanceOf(arktype_1.type.errors);
|
|
27
|
+
(0, vitest_1.expect)((0, schema_js_1.AppIdSchema)(null)).toBeInstanceOf(arktype_1.type.errors);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
(0, vitest_1.describe)('AppIdPropertySchema', () => {
|
|
31
|
+
(0, vitest_1.test)('should accept valid id property', () => {
|
|
32
|
+
const payload = { id: (0, utils_js_1.generateAppId)() };
|
|
33
|
+
const result = (0, schema_js_1.AppIdPropertySchema)(payload);
|
|
34
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
35
|
+
(0, vitest_1.expect)(result).toEqual(payload);
|
|
36
|
+
});
|
|
37
|
+
(0, vitest_1.test)('should reject missing id', () => {
|
|
38
|
+
const result = (0, schema_js_1.AppIdPropertySchema)({});
|
|
39
|
+
(0, vitest_1.expect)(result).toBeInstanceOf(arktype_1.type.errors);
|
|
40
|
+
});
|
|
41
|
+
(0, vitest_1.test)('should reject invalid id format', () => {
|
|
42
|
+
const result = (0, schema_js_1.AppIdPropertySchema)({ id: 'invalid_id' });
|
|
43
|
+
(0, vitest_1.expect)(result).toBeInstanceOf(arktype_1.type.errors);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
(0, vitest_1.describe)('AppSchema', () => {
|
|
47
|
+
(0, vitest_1.test)('should accept complete app object', () => {
|
|
48
|
+
const app = {
|
|
49
|
+
id: (0, utils_js_1.generateAppId)(),
|
|
50
|
+
status: 'enabled',
|
|
51
|
+
label: 'My Application',
|
|
52
|
+
description: 'Application description',
|
|
53
|
+
createdAt: new Date(),
|
|
54
|
+
updatedAt: new Date(),
|
|
55
|
+
metadata: { key: 'value' },
|
|
56
|
+
};
|
|
57
|
+
const result = (0, schema_js_1.AppSchema)(app);
|
|
58
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
59
|
+
});
|
|
60
|
+
(0, vitest_1.test)('should accept minimal app object', () => {
|
|
61
|
+
const app = {
|
|
62
|
+
id: (0, utils_js_1.generateAppId)(),
|
|
63
|
+
status: 'enabled',
|
|
64
|
+
label: 'Simple App',
|
|
65
|
+
createdAt: new Date(),
|
|
66
|
+
updatedAt: new Date(),
|
|
67
|
+
metadata: {},
|
|
68
|
+
};
|
|
69
|
+
const result = (0, schema_js_1.AppSchema)(app);
|
|
70
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
71
|
+
});
|
|
72
|
+
(0, vitest_1.test)('should accept app with optional dates', () => {
|
|
73
|
+
const app = {
|
|
74
|
+
id: (0, utils_js_1.generateAppId)(),
|
|
75
|
+
status: 'disabled',
|
|
76
|
+
label: 'Disabled App',
|
|
77
|
+
description: 'This app is disabled',
|
|
78
|
+
createdAt: new Date(),
|
|
79
|
+
updatedAt: new Date(),
|
|
80
|
+
deletedAt: new Date(),
|
|
81
|
+
deactivatedAt: new Date(),
|
|
82
|
+
metadata: {},
|
|
83
|
+
};
|
|
84
|
+
const result = (0, schema_js_1.AppSchema)(app);
|
|
85
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
86
|
+
});
|
|
87
|
+
(0, vitest_1.test)('should reject invalid status', () => {
|
|
88
|
+
const app = {
|
|
89
|
+
id: (0, utils_js_1.generateAppId)(),
|
|
90
|
+
status: 'invalid-status',
|
|
91
|
+
label: 'My App',
|
|
92
|
+
createdAt: new Date(),
|
|
93
|
+
updatedAt: new Date(),
|
|
94
|
+
metadata: {},
|
|
95
|
+
};
|
|
96
|
+
const result = (0, schema_js_1.AppSchema)(app);
|
|
97
|
+
(0, vitest_1.expect)(result).toBeInstanceOf(arktype_1.type.errors);
|
|
98
|
+
});
|
|
99
|
+
(0, vitest_1.test)('should reject missing required fields', () => {
|
|
100
|
+
const app = {
|
|
101
|
+
id: (0, utils_js_1.generateAppId)(),
|
|
102
|
+
status: 'enabled',
|
|
103
|
+
// missing label, createdAt, updatedAt, metadata
|
|
104
|
+
};
|
|
105
|
+
const result = (0, schema_js_1.AppSchema)(app);
|
|
106
|
+
(0, vitest_1.expect)(result).toBeInstanceOf(arktype_1.type.errors);
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
(0, vitest_1.describe)('UpdateAppPayloadSchema', () => {
|
|
110
|
+
(0, vitest_1.test)('should accept all optional fields', () => {
|
|
111
|
+
const payload = {
|
|
112
|
+
status: 'disabled',
|
|
113
|
+
label: 'Updated App',
|
|
114
|
+
description: 'Updated description',
|
|
115
|
+
metadata: { updated: true },
|
|
116
|
+
};
|
|
117
|
+
const result = (0, schema_js_1.UpdateAppPayloadSchema)(payload);
|
|
118
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
119
|
+
(0, vitest_1.expect)(result).toEqual(payload);
|
|
120
|
+
});
|
|
121
|
+
(0, vitest_1.test)('should accept empty update payload', () => {
|
|
122
|
+
const result = (0, schema_js_1.UpdateAppPayloadSchema)({});
|
|
123
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
124
|
+
(0, vitest_1.expect)(result).toEqual({});
|
|
125
|
+
});
|
|
126
|
+
(0, vitest_1.test)('should accept partial updates', () => {
|
|
127
|
+
const payload = { label: 'New Label' };
|
|
128
|
+
const result = (0, schema_js_1.UpdateAppPayloadSchema)(payload);
|
|
129
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
130
|
+
(0, vitest_1.expect)(result).toEqual(payload);
|
|
131
|
+
});
|
|
132
|
+
(0, vitest_1.test)('should accept null values for nullable fields', () => {
|
|
133
|
+
const payload = {
|
|
134
|
+
label: null,
|
|
135
|
+
description: null,
|
|
136
|
+
};
|
|
137
|
+
const result = (0, schema_js_1.UpdateAppPayloadSchema)(payload);
|
|
138
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
139
|
+
(0, vitest_1.expect)(result).toEqual(payload);
|
|
140
|
+
});
|
|
141
|
+
(0, vitest_1.test)('should reject invalid status', () => {
|
|
142
|
+
const payload = { status: 'invalid-status' };
|
|
143
|
+
const result = (0, schema_js_1.UpdateAppPayloadSchema)(payload);
|
|
144
|
+
(0, vitest_1.expect)(result).toBeInstanceOf(arktype_1.type.errors);
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
(0, vitest_1.describe)('AppAssociationReferenceSchema', () => {
|
|
148
|
+
(0, vitest_1.test)('should accept complete association reference', () => {
|
|
149
|
+
const reference = {
|
|
150
|
+
id: (0, utils_js_1.generateAppId)(),
|
|
151
|
+
status: 'enabled',
|
|
152
|
+
label: 'Associated App',
|
|
153
|
+
model: 'App',
|
|
154
|
+
};
|
|
155
|
+
const result = (0, schema_js_1.AppAssociationReferenceSchema)(reference);
|
|
156
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
157
|
+
(0, vitest_1.expect)(result).toEqual(reference);
|
|
158
|
+
});
|
|
159
|
+
(0, vitest_1.test)('should use default status when not provided', () => {
|
|
160
|
+
const reference = {
|
|
161
|
+
id: (0, utils_js_1.generateAppId)(),
|
|
162
|
+
label: 'Test App',
|
|
163
|
+
model: 'App',
|
|
164
|
+
};
|
|
165
|
+
const result = (0, schema_js_1.AppAssociationReferenceSchema)(reference);
|
|
166
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
167
|
+
(0, vitest_1.expect)(result.status).toBe('disabled'); // default value
|
|
168
|
+
});
|
|
169
|
+
(0, vitest_1.test)('should reject missing required fields', () => {
|
|
170
|
+
const reference = { id: (0, utils_js_1.generateAppId)() };
|
|
171
|
+
const result = (0, schema_js_1.AppAssociationReferenceSchema)(reference);
|
|
172
|
+
(0, vitest_1.expect)(result).toBeInstanceOf(arktype_1.type.errors);
|
|
173
|
+
});
|
|
174
|
+
(0, vitest_1.test)('should reject invalid model value', () => {
|
|
175
|
+
const reference = {
|
|
176
|
+
id: (0, utils_js_1.generateAppId)(),
|
|
177
|
+
label: 'Test App',
|
|
178
|
+
model: 'InvalidModel',
|
|
179
|
+
};
|
|
180
|
+
const result = (0, schema_js_1.AppAssociationReferenceSchema)(reference);
|
|
181
|
+
(0, vitest_1.expect)(result).toBeInstanceOf(arktype_1.type.errors);
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.test.d.ts","sourceRoot":"","sources":["../../../src/app/utils.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const utils_js_1 = require("./utils.js");
|
|
5
|
+
(0, vitest_1.describe)('App - Utils', () => {
|
|
6
|
+
(0, vitest_1.describe)('Model constants', () => {
|
|
7
|
+
(0, vitest_1.test)('should have correct UID prefixes', () => {
|
|
8
|
+
(0, vitest_1.expect)(utils_js_1.Model.App.UIDPrefix).toBe('app');
|
|
9
|
+
(0, vitest_1.expect)(utils_js_1.Model.OAuth.UIDPrefix).toBe('aoa');
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
(0, vitest_1.describe)('generateAppId', () => {
|
|
13
|
+
(0, vitest_1.test)('should generate ID with correct prefix', () => {
|
|
14
|
+
const id = (0, utils_js_1.generateAppId)();
|
|
15
|
+
(0, vitest_1.expect)(id).toMatch(/^app_[A-Za-z0-9]+$/);
|
|
16
|
+
});
|
|
17
|
+
(0, vitest_1.test)('should generate unique IDs', () => {
|
|
18
|
+
const id1 = (0, utils_js_1.generateAppId)();
|
|
19
|
+
const id2 = (0, utils_js_1.generateAppId)();
|
|
20
|
+
(0, vitest_1.expect)(id1).not.toBe(id2);
|
|
21
|
+
});
|
|
22
|
+
(0, vitest_1.test)('should generate IDs with correct length', () => {
|
|
23
|
+
const id = (0, utils_js_1.generateAppId)();
|
|
24
|
+
(0, vitest_1.expect)(id.length).toBeGreaterThan(4); // prefix + underscore + KSUID
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
(0, vitest_1.describe)('generateOAuthId', () => {
|
|
28
|
+
(0, vitest_1.test)('should generate ID with correct prefix', () => {
|
|
29
|
+
const id = (0, utils_js_1.generateOAuthId)();
|
|
30
|
+
(0, vitest_1.expect)(id).toMatch(/^aoa_[A-Za-z0-9]+$/);
|
|
31
|
+
});
|
|
32
|
+
(0, vitest_1.test)('should generate unique IDs', () => {
|
|
33
|
+
const id1 = (0, utils_js_1.generateOAuthId)();
|
|
34
|
+
const id2 = (0, utils_js_1.generateOAuthId)();
|
|
35
|
+
(0, vitest_1.expect)(id1).not.toBe(id2);
|
|
36
|
+
});
|
|
37
|
+
(0, vitest_1.test)('should generate IDs with correct length', () => {
|
|
38
|
+
const id = (0, utils_js_1.generateOAuthId)();
|
|
39
|
+
(0, vitest_1.expect)(id.length).toBeGreaterThan(4); // prefix + underscore + KSUID
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -17,6 +17,11 @@ export declare const AssociationAttributesReferenceSchema: import("arktype/out/m
|
|
|
17
17
|
export type AssociationAttributesReference = typeof AssociationAttributesReferenceSchema.inferOut;
|
|
18
18
|
export type AssociationReference = AssociationIdReference | AssociationAttributesReference;
|
|
19
19
|
export declare const AssociationObjectSchema: import("arktype/out/methods/object.js").ObjectType<{
|
|
20
|
+
id: string;
|
|
21
|
+
status: import("arktype/out/attributes.js").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/out/methods/object
|
|
|
27
32
|
phoneNumber?: string | undefined;
|
|
28
33
|
status: import("arktype/out/attributes.js").Default<"active" | "suspended" | "unverified", "unverified">;
|
|
29
34
|
model: "User";
|
|
30
|
-
} | {
|
|
31
|
-
id: string;
|
|
32
|
-
status: import("arktype/out/attributes.js").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/out/methods/object
|
|
|
50
50
|
export type AssociationObject = typeof AssociationObjectSchema.inferOut;
|
|
51
51
|
export declare const ObjectPropertySchema: import("arktype/out/methods/object.js").ObjectType<{
|
|
52
52
|
object: {
|
|
53
|
+
id: string;
|
|
54
|
+
status: import("arktype/out/attributes.js").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/out/methods/object.js
|
|
|
60
65
|
phoneNumber?: string | undefined;
|
|
61
66
|
status: import("arktype/out/attributes.js").Default<"active" | "suspended" | "unverified", "unverified">;
|
|
62
67
|
model: "User";
|
|
63
|
-
} | {
|
|
64
|
-
id: string;
|
|
65
|
-
status: import("arktype/out/attributes.js").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/out/methods/object.js
|
|
|
83
83
|
}, {}>;
|
|
84
84
|
export declare const AssociationSchema: import("arktype/out/methods/object.js").ObjectType<{
|
|
85
85
|
object: {
|
|
86
|
+
id: string;
|
|
87
|
+
status: import("arktype/out/attributes.js").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/out/methods/object.js").
|
|
|
93
98
|
phoneNumber?: string | undefined;
|
|
94
99
|
status: import("arktype/out/attributes.js").Default<"active" | "suspended" | "unverified", "unverified">;
|
|
95
100
|
model: "User";
|
|
96
|
-
} | {
|
|
97
|
-
id: string;
|
|
98
|
-
status: import("arktype/out/attributes.js").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/out/methods/object.js").
|
|
|
117
117
|
expiresAt?: Date | ((In: string) => import("arktype/out/attributes.js").To<Date>) | undefined;
|
|
118
118
|
deletedAt?: Date | ((In: string) => import("arktype/out/attributes.js").To<Date>) | undefined;
|
|
119
119
|
deactivatedAt?: Date | ((In: string) => import("arktype/out/attributes.js").To<Date>) | undefined;
|
|
120
|
-
metadata: (In: import("arktype/out/attributes.js").Default<unknown, Map<string, string | number | boolean>>) => import("arktype").Out<Map<string, string | number | boolean
|
|
120
|
+
metadata: (In: import("arktype/out/attributes.js").Default<unknown, Map<string, string | number | boolean>>) => import("arktype").Out<Map<string, string | number | boolean>>;
|
|
121
121
|
}, {}>;
|
|
122
122
|
declare const RootAssociationProperties: import("arktype/out/methods/object.js").ObjectType<{
|
|
123
123
|
updatedAt: Date | ((In: string) => import("arktype/out/attributes.js").To<Date>);
|
|
124
124
|
expiresAt?: Date | ((In: string) => import("arktype/out/attributes.js").To<Date>) | undefined;
|
|
125
125
|
deletedAt?: Date | ((In: string) => import("arktype/out/attributes.js").To<Date>) | undefined;
|
|
126
126
|
deactivatedAt?: Date | ((In: string) => import("arktype/out/attributes.js").To<Date>) | undefined;
|
|
127
|
-
metadata: (In: import("arktype/out/attributes.js").Default<unknown, Map<string, string | number | boolean>>) => import("arktype").Out<Map<string, string | number | boolean
|
|
127
|
+
metadata: (In: import("arktype/out/attributes.js").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/out/methods/object.js").ObjectTyp
|
|
|
135
135
|
expiresAt?: Date | ((In: string) => import("arktype/out/attributes.js").To<Date>) | undefined;
|
|
136
136
|
deletedAt?: Date | ((In: string) => import("arktype/out/attributes.js").To<Date>) | undefined;
|
|
137
137
|
deactivatedAt?: Date | ((In: string) => import("arktype/out/attributes.js").To<Date>) | undefined;
|
|
138
|
-
metadata: (In: import("arktype/out/attributes.js").Default<unknown, Map<string, string | number | boolean>>) => import("arktype").Out<Map<string, string | number | boolean
|
|
138
|
+
metadata: (In: import("arktype/out/attributes.js").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/out/methods/objec
|
|
|
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/out/attributes.js").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/out/methods/objec
|
|
|
157
162
|
phoneNumber?: string | undefined;
|
|
158
163
|
status: import("arktype/out/attributes.js").Default<"active" | "suspended" | "unverified", "unverified">;
|
|
159
164
|
model: "User";
|
|
160
|
-
} | {
|
|
161
|
-
id: string;
|
|
162
|
-
status: import("arktype/out/attributes.js").Default<"enabled" | "disabled", "disabled">;
|
|
163
|
-
label: string;
|
|
164
|
-
model: "App";
|
|
165
165
|
} | {
|
|
166
166
|
id: string;
|
|
167
167
|
name: string;
|
|
@@ -6,8 +6,8 @@ const schema_js_1 = require("../app/schema.js");
|
|
|
6
6
|
const index_js_1 = require("../authorization/index.js");
|
|
7
7
|
const dates_js_1 = require("../common/schema/dates.js");
|
|
8
8
|
const metadata_js_1 = require("../common/schema/metadata.js");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
9
|
+
const schema_js_2 = require("../customer/organization/schema.js");
|
|
10
|
+
const schema_js_3 = require("../customer/users/schema.js");
|
|
11
11
|
exports.AssociationObjectType = {
|
|
12
12
|
USER: 'User',
|
|
13
13
|
ORGANIZATION: 'Organization',
|
|
@@ -19,7 +19,7 @@ exports.AssociationIdReferenceSchema = (0, arktype_1.type)({
|
|
|
19
19
|
id: (0, arktype_1.type)('string'),
|
|
20
20
|
});
|
|
21
21
|
exports.AssociationAttributesReferenceSchema = exports.AssociationIdReferenceSchema.and('Record<string, unknown>');
|
|
22
|
-
exports.AssociationObjectSchema =
|
|
22
|
+
exports.AssociationObjectSchema = schema_js_3.UserAssociationReferenceSchema.or(schema_js_2.OrganizationAssociationReferenceSchema)
|
|
23
23
|
.or(schema_js_1.AppAssociationReferenceSchema)
|
|
24
24
|
.or(index_js_1.RoleAssociationReferenceSchema)
|
|
25
25
|
.or(index_js_1.PermissionAssociationReferenceSchema);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.test.d.ts","sourceRoot":"","sources":["../../../src/association/schema.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const arktype_1 = require("arktype");
|
|
4
|
+
const vitest_1 = require("vitest");
|
|
5
|
+
const utils_js_1 = require("../app/utils.js");
|
|
6
|
+
const schema_js_1 = require("../authorization/schema.js");
|
|
7
|
+
const schema_js_2 = require("../customer/schema.js");
|
|
8
|
+
const schema_js_3 = require("./schema.js");
|
|
9
|
+
(0, vitest_1.describe)('Association - Schema', () => {
|
|
10
|
+
(0, vitest_1.describe)('AssociationObjectType constants', () => {
|
|
11
|
+
(0, vitest_1.test)('should have correct object type values', () => {
|
|
12
|
+
(0, vitest_1.expect)(schema_js_3.AssociationObjectType.USER).toBe('User');
|
|
13
|
+
(0, vitest_1.expect)(schema_js_3.AssociationObjectType.ORGANIZATION).toBe('Organization');
|
|
14
|
+
(0, vitest_1.expect)(schema_js_3.AssociationObjectType.ROLE).toBe('Role');
|
|
15
|
+
(0, vitest_1.expect)(schema_js_3.AssociationObjectType.APP).toBe('App');
|
|
16
|
+
(0, vitest_1.expect)(schema_js_3.AssociationObjectType.PERMISSION).toBe('Permission');
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
(0, vitest_1.describe)('AssociationIdReferenceSchema', () => {
|
|
20
|
+
(0, vitest_1.test)('should accept valid id reference', () => {
|
|
21
|
+
const reference = { id: 'any_string_id' };
|
|
22
|
+
const result = (0, schema_js_3.AssociationIdReferenceSchema)(reference);
|
|
23
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
24
|
+
(0, vitest_1.expect)(result).toEqual(reference);
|
|
25
|
+
});
|
|
26
|
+
(0, vitest_1.test)('should reject missing id', () => {
|
|
27
|
+
const result = (0, schema_js_3.AssociationIdReferenceSchema)({});
|
|
28
|
+
(0, vitest_1.expect)(result).toBeInstanceOf(arktype_1.type.errors);
|
|
29
|
+
});
|
|
30
|
+
(0, vitest_1.test)('should reject non-string id', () => {
|
|
31
|
+
const reference = { id: 123 };
|
|
32
|
+
const result = (0, schema_js_3.AssociationIdReferenceSchema)(reference);
|
|
33
|
+
(0, vitest_1.expect)(result).toBeInstanceOf(arktype_1.type.errors);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
(0, vitest_1.describe)('AssociationAttributesReferenceSchema', () => {
|
|
37
|
+
(0, vitest_1.test)('should accept id with additional attributes', () => {
|
|
38
|
+
const reference = {
|
|
39
|
+
id: 'test_id',
|
|
40
|
+
name: 'Test Name',
|
|
41
|
+
status: 'active',
|
|
42
|
+
metadata: { key: 'value' },
|
|
43
|
+
};
|
|
44
|
+
const result = (0, schema_js_3.AssociationAttributesReferenceSchema)(reference);
|
|
45
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
46
|
+
(0, vitest_1.expect)(result).toEqual(reference);
|
|
47
|
+
});
|
|
48
|
+
(0, vitest_1.test)('should accept minimal reference with just id', () => {
|
|
49
|
+
const reference = { id: 'minimal_id' };
|
|
50
|
+
const result = (0, schema_js_3.AssociationAttributesReferenceSchema)(reference);
|
|
51
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
52
|
+
(0, vitest_1.expect)(result).toEqual(reference);
|
|
53
|
+
});
|
|
54
|
+
(0, vitest_1.test)('should reject missing id', () => {
|
|
55
|
+
const reference = { name: 'Test', status: 'active' };
|
|
56
|
+
const result = (0, schema_js_3.AssociationAttributesReferenceSchema)(reference);
|
|
57
|
+
(0, vitest_1.expect)(result).toBeInstanceOf(arktype_1.type.errors);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
(0, vitest_1.describe)('AssociationObjectSchema', () => {
|
|
61
|
+
// Note: User association reference has complex requirements
|
|
62
|
+
// that depend on UserNamePropertiesSchema and EmailOrPhonePropertiesSchema
|
|
63
|
+
(0, vitest_1.test)('should accept App association reference', () => {
|
|
64
|
+
const appAssociation = {
|
|
65
|
+
id: (0, utils_js_1.generateAppId)(),
|
|
66
|
+
status: 'enabled',
|
|
67
|
+
label: 'Test App',
|
|
68
|
+
model: 'App',
|
|
69
|
+
};
|
|
70
|
+
const result = (0, schema_js_3.AssociationObjectSchema)(appAssociation);
|
|
71
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
72
|
+
});
|
|
73
|
+
(0, vitest_1.test)('should accept Role association reference', () => {
|
|
74
|
+
const roleAssociation = {
|
|
75
|
+
id: (0, schema_js_1.generateRoleId)(),
|
|
76
|
+
name: 'admin',
|
|
77
|
+
status: 'enabled',
|
|
78
|
+
model: 'Role',
|
|
79
|
+
};
|
|
80
|
+
const result = (0, schema_js_3.AssociationObjectSchema)(roleAssociation);
|
|
81
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
82
|
+
});
|
|
83
|
+
(0, vitest_1.test)('should accept Permission association reference', () => {
|
|
84
|
+
const permissionAssociation = {
|
|
85
|
+
id: (0, schema_js_1.generatePermissionId)(),
|
|
86
|
+
name: 'read:users',
|
|
87
|
+
status: 'enabled',
|
|
88
|
+
model: 'Permission',
|
|
89
|
+
};
|
|
90
|
+
const result = (0, schema_js_3.AssociationObjectSchema)(permissionAssociation);
|
|
91
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
92
|
+
});
|
|
93
|
+
(0, vitest_1.test)('should reject invalid association object', () => {
|
|
94
|
+
const invalidAssociation = {
|
|
95
|
+
id: 'test_id',
|
|
96
|
+
name: 'Test',
|
|
97
|
+
model: 'InvalidModel',
|
|
98
|
+
};
|
|
99
|
+
const result = (0, schema_js_3.AssociationObjectSchema)(invalidAssociation);
|
|
100
|
+
(0, vitest_1.expect)(result).toBeInstanceOf(arktype_1.type.errors);
|
|
101
|
+
});
|
|
102
|
+
(0, vitest_1.test)('should reject association missing required fields', () => {
|
|
103
|
+
const incompleteAssociation = {
|
|
104
|
+
id: (0, schema_js_2.generateUserId)(),
|
|
105
|
+
// missing required fields for any valid association type
|
|
106
|
+
};
|
|
107
|
+
const result = (0, schema_js_3.AssociationObjectSchema)(incompleteAssociation);
|
|
108
|
+
(0, vitest_1.expect)(result).toBeInstanceOf(arktype_1.type.errors);
|
|
109
|
+
});
|
|
110
|
+
(0, vitest_1.test)('should reject association with mismatched model and data', () => {
|
|
111
|
+
const mismatchedAssociation = {
|
|
112
|
+
id: (0, schema_js_2.generateUserId)(),
|
|
113
|
+
name: 'admin', // role field
|
|
114
|
+
status: 'enabled',
|
|
115
|
+
model: 'User', // but missing user fields
|
|
116
|
+
};
|
|
117
|
+
const result = (0, schema_js_3.AssociationObjectSchema)(mismatchedAssociation);
|
|
118
|
+
(0, vitest_1.expect)(result).toBeInstanceOf(arktype_1.type.errors);
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
});
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const arktype_1 = require("arktype");
|
|
4
4
|
const vitest_1 = require("vitest");
|
|
5
|
+
const utils_js_1 = require("../utils.js");
|
|
5
6
|
const schema_js_1 = require("./schema.js");
|
|
6
7
|
(0, vitest_1.describe)('Authentication - Factors', () => {
|
|
7
8
|
(0, vitest_1.describe)('Schema', () => {
|
|
@@ -11,7 +12,7 @@ const schema_js_1 = require("./schema.js");
|
|
|
11
12
|
updatedAt: new Date(),
|
|
12
13
|
factors: [
|
|
13
14
|
{
|
|
14
|
-
id:
|
|
15
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
15
16
|
},
|
|
16
17
|
],
|
|
17
18
|
})).not.toBeInstanceOf(arktype_1.type.errors);
|
|
@@ -26,7 +27,7 @@ const schema_js_1 = require("./schema.js");
|
|
|
26
27
|
(0, vitest_1.expect)((0, schema_js_1.UpsertAuthenticationFactorsPayloadSchema)({
|
|
27
28
|
factors: [
|
|
28
29
|
{
|
|
29
|
-
id:
|
|
30
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
30
31
|
},
|
|
31
32
|
],
|
|
32
33
|
})).not.toBeInstanceOf(arktype_1.type.errors);
|
|
@@ -44,42 +45,42 @@ const schema_js_1 = require("./schema.js");
|
|
|
44
45
|
(0, vitest_1.expect)((0, schema_js_1.AuthenticationFactorsPayloadSchema)({
|
|
45
46
|
createdAt: new Date(),
|
|
46
47
|
updatedAt: new Date(),
|
|
47
|
-
factors: { id:
|
|
48
|
+
factors: { id: (0, utils_js_1.generateStrategyId)() },
|
|
48
49
|
})).toBeInstanceOf(arktype_1.type.errors);
|
|
49
50
|
// Factor array of string
|
|
50
51
|
(0, vitest_1.expect)((0, schema_js_1.AuthenticationFactorsPayloadSchema)({
|
|
51
52
|
createdAt: new Date(),
|
|
52
53
|
updatedAt: new Date(),
|
|
53
|
-
factors: [
|
|
54
|
+
factors: [(0, utils_js_1.generateStrategyId)()],
|
|
54
55
|
})).toBeInstanceOf(arktype_1.type.errors);
|
|
55
56
|
});
|
|
56
57
|
(0, vitest_1.test)('should accept various next factors types', async () => {
|
|
57
58
|
// Undefined
|
|
58
59
|
(0, vitest_1.expect)((0, schema_js_1.AuthenticationFactorPayloadSchema)({
|
|
59
|
-
id:
|
|
60
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
60
61
|
nextFactors: undefined,
|
|
61
62
|
})).not.toBeInstanceOf(arktype_1.type.errors);
|
|
62
63
|
// Array
|
|
63
64
|
(0, vitest_1.expect)((0, schema_js_1.AuthenticationFactorPayloadSchema)({
|
|
64
|
-
id:
|
|
65
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
65
66
|
nextFactors: [
|
|
66
67
|
{
|
|
67
|
-
id:
|
|
68
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
68
69
|
},
|
|
69
70
|
],
|
|
70
71
|
})).not.toBeInstanceOf(arktype_1.type.errors);
|
|
71
72
|
// Deeply nested array
|
|
72
73
|
(0, vitest_1.expect)((0, schema_js_1.AuthenticationFactorPayloadSchema)({
|
|
73
|
-
id:
|
|
74
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
74
75
|
nextFactors: [
|
|
75
76
|
{
|
|
76
|
-
id:
|
|
77
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
77
78
|
nextFactors: [
|
|
78
79
|
{
|
|
79
|
-
id:
|
|
80
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
80
81
|
nextFactors: [
|
|
81
82
|
{
|
|
82
|
-
id:
|
|
83
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
83
84
|
},
|
|
84
85
|
],
|
|
85
86
|
},
|
|
@@ -91,7 +92,7 @@ const schema_js_1 = require("./schema.js");
|
|
|
91
92
|
(0, vitest_1.test)('should throw error for invalid factor id', async () => {
|
|
92
93
|
// Number
|
|
93
94
|
(0, vitest_1.expect)((0, schema_js_1.AuthenticationFactorsPayloadSchema)({
|
|
94
|
-
id:
|
|
95
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
95
96
|
})).toBeInstanceOf(arktype_1.type.errors);
|
|
96
97
|
// Null
|
|
97
98
|
(0, vitest_1.expect)((0, schema_js_1.AuthenticationFactorsPayloadSchema)({
|
|
@@ -105,18 +106,18 @@ const schema_js_1 = require("./schema.js");
|
|
|
105
106
|
(0, vitest_1.test)('should throw error for invalid next factors', async () => {
|
|
106
107
|
// String
|
|
107
108
|
(0, vitest_1.expect)((0, schema_js_1.AuthenticationFactorsPayloadSchema)({
|
|
108
|
-
id:
|
|
109
|
-
nextFactors:
|
|
109
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
110
|
+
nextFactors: (0, utils_js_1.generateStrategyId)(),
|
|
110
111
|
})).toBeInstanceOf(arktype_1.type.errors);
|
|
111
112
|
// Object
|
|
112
113
|
(0, vitest_1.expect)((0, schema_js_1.AuthenticationFactorsPayloadSchema)({
|
|
113
|
-
id:
|
|
114
|
-
nextFactors: { id:
|
|
114
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
115
|
+
nextFactors: { id: (0, utils_js_1.generateStrategyId)() },
|
|
115
116
|
})).toBeInstanceOf(arktype_1.type.errors);
|
|
116
117
|
// Array
|
|
117
118
|
(0, vitest_1.expect)((0, schema_js_1.AuthenticationFactorsPayloadSchema)({
|
|
118
|
-
id:
|
|
119
|
-
nextFactors: [
|
|
119
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
120
|
+
nextFactors: [(0, utils_js_1.generateStrategyId)()],
|
|
120
121
|
})).toBeInstanceOf(arktype_1.type.errors);
|
|
121
122
|
});
|
|
122
123
|
});
|
|
@@ -4,7 +4,7 @@ exports.ProviderPayloadSchema = exports.ProviderTypeSchema = exports.ProviderIdP
|
|
|
4
4
|
const arktype_1 = require("arktype");
|
|
5
5
|
const dates_js_1 = require("../../common/schema/dates.js");
|
|
6
6
|
const metadata_js_1 = require("../../common/schema/metadata.js");
|
|
7
|
-
const schema_js_1 = require("../../customer/
|
|
7
|
+
const schema_js_1 = require("../../customer/schema.js");
|
|
8
8
|
const base_js_1 = require("../strategies/schema/base.js");
|
|
9
9
|
exports.ProviderType = {
|
|
10
10
|
MONDO: 'mondo',
|