@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,236 @@
|
|
|
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("../../customer/schema.js");
|
|
7
|
+
const schema_js_2 = require("../schema.js");
|
|
8
|
+
const schema_js_3 = require("./schema.js");
|
|
9
|
+
(0, vitest_1.describe)('Authorization Roles - Schema', () => {
|
|
10
|
+
(0, vitest_1.describe)('RoleStatus constants', () => {
|
|
11
|
+
(0, vitest_1.test)('should have correct status values', () => {
|
|
12
|
+
(0, vitest_1.expect)(schema_js_3.RoleStatus.ENABLED).toBe('enabled');
|
|
13
|
+
(0, vitest_1.expect)(schema_js_3.RoleStatus.DISABLED).toBe('disabled');
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
(0, vitest_1.describe)('RoleIdPropertySchema', () => {
|
|
17
|
+
(0, vitest_1.test)('should accept valid id property', () => {
|
|
18
|
+
const payload = { id: (0, schema_js_2.generateRoleId)() };
|
|
19
|
+
const result = (0, schema_js_3.RoleIdPropertySchema)(payload);
|
|
20
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
21
|
+
(0, vitest_1.expect)(result).toEqual({ id: payload.id });
|
|
22
|
+
});
|
|
23
|
+
(0, vitest_1.test)('should reject missing id', () => {
|
|
24
|
+
const result = (0, schema_js_3.RoleIdPropertySchema)({});
|
|
25
|
+
(0, vitest_1.expect)(result).toBeInstanceOf(arktype_1.type.errors);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
(0, vitest_1.describe)('RoleAssociationsSchema', () => {
|
|
29
|
+
(0, vitest_1.test)('should accept valid associations', () => {
|
|
30
|
+
const payload = {
|
|
31
|
+
apps: [(0, utils_js_1.generateAppId)(), (0, utils_js_1.generateAppId)()],
|
|
32
|
+
permissions: [(0, schema_js_2.generatePermissionId)(), (0, schema_js_2.generatePermissionId)()],
|
|
33
|
+
users: [(0, schema_js_1.generateUserId)(), (0, schema_js_1.generateUserId)()],
|
|
34
|
+
};
|
|
35
|
+
const result = (0, schema_js_3.RoleAssociationsSchema)(payload);
|
|
36
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
37
|
+
(0, vitest_1.expect)(result).toEqual({
|
|
38
|
+
apps: payload.apps,
|
|
39
|
+
permissions: payload.permissions,
|
|
40
|
+
users: payload.users,
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
(0, vitest_1.test)('should accept optional associations', () => {
|
|
44
|
+
const result = (0, schema_js_3.RoleAssociationsSchema)({});
|
|
45
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
46
|
+
(0, vitest_1.expect)(result).toEqual({});
|
|
47
|
+
});
|
|
48
|
+
(0, vitest_1.test)('should accept partial associations', () => {
|
|
49
|
+
const result = (0, schema_js_3.RoleAssociationsSchema)({
|
|
50
|
+
permissions: [(0, schema_js_2.generatePermissionId)()],
|
|
51
|
+
users: undefined,
|
|
52
|
+
});
|
|
53
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
54
|
+
});
|
|
55
|
+
(0, vitest_1.test)('should reject non-array associations', () => {
|
|
56
|
+
const result = (0, schema_js_3.RoleAssociationsSchema)({
|
|
57
|
+
apps: 'not-an-array',
|
|
58
|
+
});
|
|
59
|
+
(0, vitest_1.expect)(result).toBeInstanceOf(arktype_1.type.errors);
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
(0, vitest_1.describe)('RoleSchema', () => {
|
|
63
|
+
(0, vitest_1.test)('should accept complete role object', () => {
|
|
64
|
+
const role = {
|
|
65
|
+
id: (0, schema_js_2.generateRoleId)(),
|
|
66
|
+
name: 'admin',
|
|
67
|
+
status: 'enabled',
|
|
68
|
+
description: 'Administrator role',
|
|
69
|
+
apps: { ids: [(0, utils_js_1.generateAppId)()], count: 1 },
|
|
70
|
+
users: { ids: [(0, schema_js_1.generateUserId)()], count: 1 },
|
|
71
|
+
permissions: { ids: [(0, schema_js_2.generatePermissionId)()], count: 1 },
|
|
72
|
+
createdAt: new Date(),
|
|
73
|
+
updatedAt: new Date(),
|
|
74
|
+
metadata: { key: 'value' },
|
|
75
|
+
};
|
|
76
|
+
const result = (0, schema_js_3.RoleSchema)(role);
|
|
77
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
78
|
+
});
|
|
79
|
+
(0, vitest_1.test)('should accept minimal role object', () => {
|
|
80
|
+
const role = {
|
|
81
|
+
id: (0, schema_js_2.generateRoleId)(),
|
|
82
|
+
name: 'user',
|
|
83
|
+
status: 'enabled',
|
|
84
|
+
createdAt: new Date(),
|
|
85
|
+
updatedAt: new Date(),
|
|
86
|
+
metadata: {},
|
|
87
|
+
};
|
|
88
|
+
const result = (0, schema_js_3.RoleSchema)(role);
|
|
89
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
90
|
+
});
|
|
91
|
+
(0, vitest_1.test)('should accept role with optional dates', () => {
|
|
92
|
+
const role = {
|
|
93
|
+
id: (0, schema_js_2.generateRoleId)(),
|
|
94
|
+
name: 'user',
|
|
95
|
+
status: 'disabled',
|
|
96
|
+
createdAt: new Date(),
|
|
97
|
+
updatedAt: new Date(),
|
|
98
|
+
deletedAt: new Date(),
|
|
99
|
+
deactivatedAt: new Date(),
|
|
100
|
+
metadata: {},
|
|
101
|
+
};
|
|
102
|
+
const result = (0, schema_js_3.RoleSchema)(role);
|
|
103
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
104
|
+
});
|
|
105
|
+
(0, vitest_1.test)('should reject invalid status', () => {
|
|
106
|
+
const role = {
|
|
107
|
+
id: (0, schema_js_2.generateRoleId)(),
|
|
108
|
+
name: 'admin',
|
|
109
|
+
status: 'invalid',
|
|
110
|
+
createdAt: new Date(),
|
|
111
|
+
updatedAt: new Date(),
|
|
112
|
+
metadata: {},
|
|
113
|
+
};
|
|
114
|
+
const result = (0, schema_js_3.RoleSchema)(role);
|
|
115
|
+
(0, vitest_1.expect)(result).toBeInstanceOf(arktype_1.type.errors);
|
|
116
|
+
});
|
|
117
|
+
(0, vitest_1.test)('should reject missing required fields', () => {
|
|
118
|
+
const role = {
|
|
119
|
+
id: (0, schema_js_2.generateRoleId)(),
|
|
120
|
+
name: 'admin',
|
|
121
|
+
};
|
|
122
|
+
const result = (0, schema_js_3.RoleSchema)(role);
|
|
123
|
+
(0, vitest_1.expect)(result).toBeInstanceOf(arktype_1.type.errors);
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
(0, vitest_1.describe)('InsertRolePayloadSchema', () => {
|
|
127
|
+
(0, vitest_1.test)('should accept complete insert payload', () => {
|
|
128
|
+
const payload = {
|
|
129
|
+
id: (0, schema_js_2.generateRoleId)(),
|
|
130
|
+
name: 'admin',
|
|
131
|
+
status: 'enabled',
|
|
132
|
+
description: 'Administrator role',
|
|
133
|
+
apps: [(0, utils_js_1.generateAppId)()],
|
|
134
|
+
permissions: [(0, schema_js_2.generatePermissionId)()],
|
|
135
|
+
users: [(0, schema_js_1.generateUserId)()],
|
|
136
|
+
metadata: { key: 'value' },
|
|
137
|
+
};
|
|
138
|
+
const result = (0, schema_js_3.InsertRolePayloadSchema)(payload);
|
|
139
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
140
|
+
});
|
|
141
|
+
(0, vitest_1.test)('should accept minimal insert payload', () => {
|
|
142
|
+
const payload = {
|
|
143
|
+
name: 'user',
|
|
144
|
+
};
|
|
145
|
+
const result = (0, schema_js_3.InsertRolePayloadSchema)(payload);
|
|
146
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
147
|
+
(0, vitest_1.expect)(result.status).toBe('enabled'); // default value
|
|
148
|
+
});
|
|
149
|
+
(0, vitest_1.test)('should generate default ID when not provided', () => {
|
|
150
|
+
const payload = { name: 'admin' };
|
|
151
|
+
const result = (0, schema_js_3.InsertRolePayloadSchema)(payload);
|
|
152
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
153
|
+
(0, vitest_1.expect)(result.id).toMatch(/^rol_/);
|
|
154
|
+
});
|
|
155
|
+
(0, vitest_1.test)('should reject missing name', () => {
|
|
156
|
+
const result = (0, schema_js_3.InsertRolePayloadSchema)({});
|
|
157
|
+
(0, vitest_1.expect)(result).toBeInstanceOf(arktype_1.type.errors);
|
|
158
|
+
});
|
|
159
|
+
(0, vitest_1.test)('should accept associations in insert payload', () => {
|
|
160
|
+
const payload = {
|
|
161
|
+
name: 'moderator',
|
|
162
|
+
apps: [(0, utils_js_1.generateAppId)(), (0, utils_js_1.generateAppId)()],
|
|
163
|
+
permissions: [(0, schema_js_2.generatePermissionId)(), (0, schema_js_2.generatePermissionId)()],
|
|
164
|
+
users: [(0, schema_js_1.generateUserId)()],
|
|
165
|
+
};
|
|
166
|
+
const result = (0, schema_js_3.InsertRolePayloadSchema)(payload);
|
|
167
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
(0, vitest_1.describe)('UpdateRolePayloadSchema', () => {
|
|
171
|
+
(0, vitest_1.test)('should accept all optional fields', () => {
|
|
172
|
+
const payload = {
|
|
173
|
+
name: 'updated-role',
|
|
174
|
+
status: 'disabled',
|
|
175
|
+
description: 'Updated description',
|
|
176
|
+
metadata: { updated: true },
|
|
177
|
+
};
|
|
178
|
+
const result = (0, schema_js_3.UpdateRolePayloadSchema)(payload);
|
|
179
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
180
|
+
(0, vitest_1.expect)(result).toEqual(payload);
|
|
181
|
+
});
|
|
182
|
+
(0, vitest_1.test)('should accept empty update payload', () => {
|
|
183
|
+
const result = (0, schema_js_3.UpdateRolePayloadSchema)({});
|
|
184
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
185
|
+
(0, vitest_1.expect)(result).toEqual({});
|
|
186
|
+
});
|
|
187
|
+
(0, vitest_1.test)('should accept partial updates', () => {
|
|
188
|
+
const payload = { name: 'new-name' };
|
|
189
|
+
const result = (0, schema_js_3.UpdateRolePayloadSchema)(payload);
|
|
190
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
191
|
+
(0, vitest_1.expect)(result).toEqual(payload);
|
|
192
|
+
});
|
|
193
|
+
(0, vitest_1.test)('should reject invalid status', () => {
|
|
194
|
+
const payload = { status: 'invalid-status' };
|
|
195
|
+
const result = (0, schema_js_3.UpdateRolePayloadSchema)(payload);
|
|
196
|
+
(0, vitest_1.expect)(result).toBeInstanceOf(arktype_1.type.errors);
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
(0, vitest_1.describe)('RoleAssociationReferenceSchema', () => {
|
|
200
|
+
(0, vitest_1.test)('should accept complete association reference', () => {
|
|
201
|
+
const reference = {
|
|
202
|
+
id: (0, schema_js_2.generateRoleId)(),
|
|
203
|
+
name: 'admin',
|
|
204
|
+
status: 'enabled',
|
|
205
|
+
model: 'Role',
|
|
206
|
+
};
|
|
207
|
+
const result = (0, schema_js_3.RoleAssociationReferenceSchema)(reference);
|
|
208
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
209
|
+
(0, vitest_1.expect)(result).toEqual(reference);
|
|
210
|
+
});
|
|
211
|
+
(0, vitest_1.test)('should use default status when not provided', () => {
|
|
212
|
+
const reference = {
|
|
213
|
+
id: (0, schema_js_2.generateRoleId)(),
|
|
214
|
+
name: 'admin',
|
|
215
|
+
model: 'Role',
|
|
216
|
+
};
|
|
217
|
+
const result = (0, schema_js_3.RoleAssociationReferenceSchema)(reference);
|
|
218
|
+
(0, vitest_1.expect)(result).not.toBeInstanceOf(arktype_1.type.errors);
|
|
219
|
+
(0, vitest_1.expect)(result.status).toBe('disabled'); // default value
|
|
220
|
+
});
|
|
221
|
+
(0, vitest_1.test)('should reject missing required fields', () => {
|
|
222
|
+
const reference = { id: (0, schema_js_2.generateRoleId)() };
|
|
223
|
+
const result = (0, schema_js_3.RoleAssociationReferenceSchema)(reference);
|
|
224
|
+
(0, vitest_1.expect)(result).toBeInstanceOf(arktype_1.type.errors);
|
|
225
|
+
});
|
|
226
|
+
(0, vitest_1.test)('should reject invalid model value', () => {
|
|
227
|
+
const reference = {
|
|
228
|
+
id: (0, schema_js_2.generateRoleId)(),
|
|
229
|
+
name: 'admin',
|
|
230
|
+
model: 'InvalidModel',
|
|
231
|
+
};
|
|
232
|
+
const result = (0, schema_js_3.RoleAssociationReferenceSchema)(reference);
|
|
233
|
+
(0, vitest_1.expect)(result).toBeInstanceOf(arktype_1.type.errors);
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const Model: {
|
|
2
|
+
readonly Permission: {
|
|
3
|
+
readonly UIDPrefix: "per";
|
|
4
|
+
};
|
|
5
|
+
readonly Role: {
|
|
6
|
+
readonly UIDPrefix: "rol";
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export declare function generatePermissionId(): string;
|
|
10
|
+
export declare function generateRoleId(): string;
|
|
11
|
+
export declare const RoleIdSchema: import("arktype/out/methods/string.js").StringType<string, {}>;
|
|
12
|
+
export type RoleId = typeof RoleIdSchema.inferOut;
|
|
13
|
+
export declare const RoleIdAssociationsSchema: import("arktype").BaseType<string[] | undefined, {}>;
|
|
14
|
+
export declare const PermissionIdSchema: import("arktype/out/methods/string.js").StringType<string, {}>;
|
|
15
|
+
export type PermissionId = typeof PermissionIdSchema.inferOut;
|
|
16
|
+
export declare const PermissionIdAssociationsSchema: import("arktype").BaseType<string[] | undefined, {}>;
|
|
17
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/authorization/schema.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,KAAK;;;;;;;CAOR,CAAC;AAEX,wBAAgB,oBAAoB,WAEnC;AAED,wBAAgB,cAAc,WAE7B;AAED,eAAO,MAAM,YAAY,gEAAoC,CAAC;AAC9D,MAAM,MAAM,MAAM,GAAG,OAAO,YAAY,CAAC,QAAQ,CAAC;AAElD,eAAO,MAAM,wBAAwB,sDAEpC,CAAC;AAEF,eAAO,MAAM,kBAAkB,gEAA0C,CAAC;AAC1E,MAAM,MAAM,YAAY,GAAG,OAAO,kBAAkB,CAAC,QAAQ,CAAC;AAE9D,eAAO,MAAM,8BAA8B,sDAE1C,CAAC"}
|
|
@@ -3,10 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Model = void 0;
|
|
6
|
+
exports.PermissionIdAssociationsSchema = exports.PermissionIdSchema = exports.RoleIdAssociationsSchema = exports.RoleIdSchema = exports.Model = void 0;
|
|
7
7
|
exports.generatePermissionId = generatePermissionId;
|
|
8
8
|
exports.generateRoleId = generateRoleId;
|
|
9
|
+
const arktype_1 = require("arktype");
|
|
9
10
|
const ksuid_1 = __importDefault(require("ksuid"));
|
|
11
|
+
const id_js_1 = require("../common/schema/id.js");
|
|
10
12
|
exports.Model = {
|
|
11
13
|
Permission: {
|
|
12
14
|
UIDPrefix: 'per',
|
|
@@ -21,3 +23,7 @@ function generatePermissionId() {
|
|
|
21
23
|
function generateRoleId() {
|
|
22
24
|
return `${exports.Model.Role.UIDPrefix}_${ksuid_1.default.randomSync().string}`;
|
|
23
25
|
}
|
|
26
|
+
exports.RoleIdSchema = (0, id_js_1.KSUIDSchema)(exports.Model.Role.UIDPrefix);
|
|
27
|
+
exports.RoleIdAssociationsSchema = (0, arktype_1.type)('undefined').or(exports.RoleIdSchema.array());
|
|
28
|
+
exports.PermissionIdSchema = (0, id_js_1.KSUIDSchema)(exports.Model.Permission.UIDPrefix);
|
|
29
|
+
exports.PermissionIdAssociationsSchema = (0, arktype_1.type)('undefined').or(exports.PermissionIdSchema.array());
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.test.d.ts","sourceRoot":"","sources":["../../../src/authorization/schema.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 schema_js_1 = require("./schema.js");
|
|
5
|
+
(0, vitest_1.describe)('Authorization - Utils', () => {
|
|
6
|
+
(0, vitest_1.describe)('Model constants', () => {
|
|
7
|
+
(0, vitest_1.test)('should have correct UID prefixes', () => {
|
|
8
|
+
(0, vitest_1.expect)(schema_js_1.Model.Permission.UIDPrefix).toBe('per');
|
|
9
|
+
(0, vitest_1.expect)(schema_js_1.Model.Role.UIDPrefix).toBe('rol');
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
(0, vitest_1.describe)('generatePermissionId', () => {
|
|
13
|
+
(0, vitest_1.test)('should generate ID with correct prefix', () => {
|
|
14
|
+
const id = (0, schema_js_1.generatePermissionId)();
|
|
15
|
+
(0, vitest_1.expect)(id).toMatch(/^per_[A-Za-z0-9]+$/);
|
|
16
|
+
});
|
|
17
|
+
(0, vitest_1.test)('should generate unique IDs', () => {
|
|
18
|
+
const id1 = (0, schema_js_1.generatePermissionId)();
|
|
19
|
+
const id2 = (0, schema_js_1.generatePermissionId)();
|
|
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, schema_js_1.generatePermissionId)();
|
|
24
|
+
(0, vitest_1.expect)(id.length).toBeGreaterThan(4); // prefix + underscore + KSUID
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
(0, vitest_1.describe)('generateRoleId', () => {
|
|
28
|
+
(0, vitest_1.test)('should generate ID with correct prefix', () => {
|
|
29
|
+
const id = (0, schema_js_1.generateRoleId)();
|
|
30
|
+
(0, vitest_1.expect)(id).toMatch(/^rol_[A-Za-z0-9]+$/);
|
|
31
|
+
});
|
|
32
|
+
(0, vitest_1.test)('should generate unique IDs', () => {
|
|
33
|
+
const id1 = (0, schema_js_1.generateRoleId)();
|
|
34
|
+
const id2 = (0, schema_js_1.generateRoleId)();
|
|
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, schema_js_1.generateRoleId)();
|
|
39
|
+
(0, vitest_1.expect)(id.length).toBeGreaterThan(4); // prefix + underscore + KSUID
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.test.d.ts","sourceRoot":"","sources":["../../../../src/common/errors/http.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const http_js_1 = require("./http.js");
|
|
5
|
+
(0, vitest_1.describe)('Common Errors - HTTP', () => {
|
|
6
|
+
(0, vitest_1.describe)('HttpError', () => {
|
|
7
|
+
(0, vitest_1.test)('should create error with default message and status', () => {
|
|
8
|
+
const error = new http_js_1.HttpError();
|
|
9
|
+
(0, vitest_1.expect)(error.message).toBe('An unknown error occurred. Please try the operation again.');
|
|
10
|
+
(0, vitest_1.expect)(error.statusCode).toBe(500);
|
|
11
|
+
(0, vitest_1.expect)(error.type).toBe('Unknown');
|
|
12
|
+
(0, vitest_1.expect)(error.trace).toBeUndefined();
|
|
13
|
+
(0, vitest_1.expect)(error.body).toBeUndefined();
|
|
14
|
+
});
|
|
15
|
+
(0, vitest_1.test)('should create error with custom message', () => {
|
|
16
|
+
const error = new http_js_1.HttpError('Custom error message');
|
|
17
|
+
(0, vitest_1.expect)(error.message).toBe('Custom error message');
|
|
18
|
+
(0, vitest_1.expect)(error.statusCode).toBe(500);
|
|
19
|
+
(0, vitest_1.expect)(error.type).toBe('Unknown');
|
|
20
|
+
});
|
|
21
|
+
(0, vitest_1.test)('should create error with custom options', () => {
|
|
22
|
+
const options = {
|
|
23
|
+
statusCode: 404,
|
|
24
|
+
type: 'NotFound',
|
|
25
|
+
trace: 'trace-123',
|
|
26
|
+
body: { resource: 'user' },
|
|
27
|
+
};
|
|
28
|
+
const error = new http_js_1.HttpError('Resource not found', options);
|
|
29
|
+
(0, vitest_1.expect)(error.message).toBe('Resource not found');
|
|
30
|
+
(0, vitest_1.expect)(error.statusCode).toBe(404);
|
|
31
|
+
(0, vitest_1.expect)(error.type).toBe('NotFound');
|
|
32
|
+
(0, vitest_1.expect)(error.trace).toBeUndefined(); // trace is not assigned in constructor
|
|
33
|
+
(0, vitest_1.expect)(error.body).toBeUndefined(); // body is not assigned in constructor
|
|
34
|
+
});
|
|
35
|
+
(0, vitest_1.test)('should handle partial options', () => {
|
|
36
|
+
const error = new http_js_1.HttpError('Test error', { statusCode: 400 });
|
|
37
|
+
(0, vitest_1.expect)(error.message).toBe('Test error');
|
|
38
|
+
(0, vitest_1.expect)(error.statusCode).toBe(400);
|
|
39
|
+
(0, vitest_1.expect)(error.type).toBe('Unknown');
|
|
40
|
+
(0, vitest_1.expect)(error.trace).toBeUndefined();
|
|
41
|
+
(0, vitest_1.expect)(error.body).toBeUndefined();
|
|
42
|
+
});
|
|
43
|
+
(0, vitest_1.test)('should be instance of Error', () => {
|
|
44
|
+
const error = new http_js_1.HttpError();
|
|
45
|
+
(0, vitest_1.expect)(error).toBeInstanceOf(Error);
|
|
46
|
+
(0, vitest_1.expect)(error).toBeInstanceOf(http_js_1.HttpError);
|
|
47
|
+
});
|
|
48
|
+
(0, vitest_1.describe)('isAuthorizationError', () => {
|
|
49
|
+
(0, vitest_1.test)('should return true for 401 status', () => {
|
|
50
|
+
const error = new http_js_1.HttpError('Unauthorized', { statusCode: 401 });
|
|
51
|
+
(0, vitest_1.expect)(error.isAuthorizationError).toBe(true);
|
|
52
|
+
});
|
|
53
|
+
(0, vitest_1.test)('should return true for 403 status', () => {
|
|
54
|
+
const error = new http_js_1.HttpError('Forbidden', { statusCode: 403 });
|
|
55
|
+
(0, vitest_1.expect)(error.isAuthorizationError).toBe(true);
|
|
56
|
+
});
|
|
57
|
+
(0, vitest_1.test)('should return false for other status codes', () => {
|
|
58
|
+
const error400 = new http_js_1.HttpError('Bad Request', { statusCode: 400 });
|
|
59
|
+
const error404 = new http_js_1.HttpError('Not Found', { statusCode: 404 });
|
|
60
|
+
const error500 = new http_js_1.HttpError('Internal Error', { statusCode: 500 });
|
|
61
|
+
(0, vitest_1.expect)(error400.isAuthorizationError).toBe(false);
|
|
62
|
+
(0, vitest_1.expect)(error404.isAuthorizationError).toBe(false);
|
|
63
|
+
(0, vitest_1.expect)(error500.isAuthorizationError).toBe(false);
|
|
64
|
+
});
|
|
65
|
+
(0, vitest_1.test)('should return false for default status code', () => {
|
|
66
|
+
const error = new http_js_1.HttpError();
|
|
67
|
+
(0, vitest_1.expect)(error.isAuthorizationError).toBe(false);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.test.d.ts","sourceRoot":"","sources":["../../../../src/common/errors/validation.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const http_js_1 = require("./http.js");
|
|
5
|
+
const validation_js_1 = require("./validation.js");
|
|
6
|
+
(0, vitest_1.describe)('Common Errors - Validation', () => {
|
|
7
|
+
(0, vitest_1.describe)('ValidationError', () => {
|
|
8
|
+
(0, vitest_1.test)('should create validation error with fields', () => {
|
|
9
|
+
const fields = {
|
|
10
|
+
email: 'Invalid email format',
|
|
11
|
+
name: 'Name is required',
|
|
12
|
+
};
|
|
13
|
+
const options = {
|
|
14
|
+
statusCode: 400,
|
|
15
|
+
type: 'ValidationError',
|
|
16
|
+
fields,
|
|
17
|
+
};
|
|
18
|
+
const error = new validation_js_1.ValidationError('Validation failed', options);
|
|
19
|
+
(0, vitest_1.expect)(error.message).toBe('Validation failed');
|
|
20
|
+
(0, vitest_1.expect)(error.statusCode).toBe(400);
|
|
21
|
+
(0, vitest_1.expect)(error.type).toBe('ValidationError');
|
|
22
|
+
(0, vitest_1.expect)(error.fields).toEqual(fields);
|
|
23
|
+
});
|
|
24
|
+
(0, vitest_1.test)('should inherit from HttpError', () => {
|
|
25
|
+
const fields = { field: 'error' };
|
|
26
|
+
const error = new validation_js_1.ValidationError('Test', { fields });
|
|
27
|
+
(0, vitest_1.expect)(error).toBeInstanceOf(Error);
|
|
28
|
+
(0, vitest_1.expect)(error).toBeInstanceOf(http_js_1.HttpError);
|
|
29
|
+
(0, vitest_1.expect)(error).toBeInstanceOf(validation_js_1.ValidationError);
|
|
30
|
+
});
|
|
31
|
+
(0, vitest_1.test)('should use default HTTP error properties when not specified', () => {
|
|
32
|
+
const fields = { field: 'error' };
|
|
33
|
+
const error = new validation_js_1.ValidationError('Test validation error', { fields });
|
|
34
|
+
(0, vitest_1.expect)(error.message).toBe('Test validation error');
|
|
35
|
+
(0, vitest_1.expect)(error.statusCode).toBe(500); // HttpError default
|
|
36
|
+
(0, vitest_1.expect)(error.type).toBe('Unknown'); // HttpError default
|
|
37
|
+
(0, vitest_1.expect)(error.fields).toEqual(fields);
|
|
38
|
+
});
|
|
39
|
+
(0, vitest_1.test)('should handle all HttpError options plus fields', () => {
|
|
40
|
+
const options = {
|
|
41
|
+
statusCode: 422,
|
|
42
|
+
type: 'UnprocessableEntity',
|
|
43
|
+
trace: 'validation-trace-456',
|
|
44
|
+
body: { request: 'data' },
|
|
45
|
+
fields: { username: 'Username already exists' },
|
|
46
|
+
};
|
|
47
|
+
const error = new validation_js_1.ValidationError('Unprocessable entity', options);
|
|
48
|
+
(0, vitest_1.expect)(error.message).toBe('Unprocessable entity');
|
|
49
|
+
(0, vitest_1.expect)(error.statusCode).toBe(422);
|
|
50
|
+
(0, vitest_1.expect)(error.type).toBe('UnprocessableEntity');
|
|
51
|
+
(0, vitest_1.expect)(error.trace).toBeUndefined(); // trace is not assigned in HttpError constructor
|
|
52
|
+
(0, vitest_1.expect)(error.body).toBeUndefined(); // body is not assigned in HttpError constructor
|
|
53
|
+
(0, vitest_1.expect)(error.fields).toEqual({ username: 'Username already exists' });
|
|
54
|
+
});
|
|
55
|
+
(0, vitest_1.test)('should inherit isAuthorizationError from HttpError', () => {
|
|
56
|
+
const fields = { field: 'error' };
|
|
57
|
+
const error401 = new validation_js_1.ValidationError('Unauthorized', {
|
|
58
|
+
statusCode: 401,
|
|
59
|
+
fields,
|
|
60
|
+
});
|
|
61
|
+
const error403 = new validation_js_1.ValidationError('Forbidden', {
|
|
62
|
+
statusCode: 403,
|
|
63
|
+
fields,
|
|
64
|
+
});
|
|
65
|
+
const error400 = new validation_js_1.ValidationError('Bad Request', {
|
|
66
|
+
statusCode: 400,
|
|
67
|
+
fields,
|
|
68
|
+
});
|
|
69
|
+
(0, vitest_1.expect)(error401.isAuthorizationError).toBe(true);
|
|
70
|
+
(0, vitest_1.expect)(error403.isAuthorizationError).toBe(true);
|
|
71
|
+
(0, vitest_1.expect)(error400.isAuthorizationError).toBe(false);
|
|
72
|
+
});
|
|
73
|
+
(0, vitest_1.test)('should handle empty fields object', () => {
|
|
74
|
+
const error = new validation_js_1.ValidationError('No field errors', { fields: {} });
|
|
75
|
+
(0, vitest_1.expect)(error.fields).toEqual({});
|
|
76
|
+
(0, vitest_1.expect)(error.message).toBe('No field errors');
|
|
77
|
+
});
|
|
78
|
+
(0, vitest_1.test)('should handle multiple field errors', () => {
|
|
79
|
+
const fields = {
|
|
80
|
+
email: 'Email is invalid',
|
|
81
|
+
password: 'Password too short',
|
|
82
|
+
confirmPassword: 'Passwords do not match',
|
|
83
|
+
age: 'Must be 18 or older',
|
|
84
|
+
};
|
|
85
|
+
const error = new validation_js_1.ValidationError('Multiple validation errors', {
|
|
86
|
+
fields,
|
|
87
|
+
});
|
|
88
|
+
(0, vitest_1.expect)(error.fields).toEqual(fields);
|
|
89
|
+
(0, vitest_1.expect)(Object.keys(error.fields)).toHaveLength(4);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
});
|
|
@@ -2,8 +2,8 @@ declare const ConfigSchema: import("arktype/out/methods/object").ObjectType<{
|
|
|
2
2
|
host: (In: import("arktype/out/attributes").Default<string, "https://manage-api.mondoidentity.com">) => import("arktype/out/attributes").To<URL>;
|
|
3
3
|
accessToken: string;
|
|
4
4
|
}, {}>;
|
|
5
|
-
type ConfigProps = typeof ConfigSchema.inferIn;
|
|
6
|
-
type Config = typeof ConfigSchema.inferOut;
|
|
5
|
+
export type ConfigProps = typeof ConfigSchema.inferIn;
|
|
6
|
+
export type Config = typeof ConfigSchema.inferOut;
|
|
7
7
|
export declare class MondoIdentity {
|
|
8
8
|
readonly config: Config;
|
|
9
9
|
constructor(config: ConfigProps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../src/common/resources/init.ts"],"names":[],"mappings":"AAYA,QAAA,MAAM,YAAY;;;MAA0B,CAAC;AAE7C,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../src/common/resources/init.ts"],"names":[],"mappings":"AAYA,QAAA,MAAM,YAAY;;;MAA0B,CAAC;AAE7C,MAAM,MAAM,WAAW,GAAG,OAAO,YAAY,CAAC,OAAO,CAAC;AACtD,MAAM,MAAM,MAAM,GAAG,OAAO,YAAY,CAAC,QAAQ,CAAC;AAElD,qBAAa,aAAa;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEL,MAAM,EAAE,WAAW;IAItC;;OAEG;IACH,IAAW,UAAU,IAAI,CAAC,OAAO,EAAE,WAAW,KAAK,WAAW,CAU7D;CAuBF"}
|
|
@@ -6,7 +6,7 @@ const BaseConfigSchema = (0, arktype_1.type)({
|
|
|
6
6
|
host: (0, arktype_1.type)('string.url.parse').default('https://manage-api.mondoidentity.com'),
|
|
7
7
|
});
|
|
8
8
|
const AccessTokenConfigSchema = BaseConfigSchema.and({
|
|
9
|
-
accessToken: (0, arktype_1.type)('string'),
|
|
9
|
+
accessToken: (0, arktype_1.type)('string').moreThanLength(0),
|
|
10
10
|
});
|
|
11
11
|
const ConfigSchema = AccessTokenConfigSchema;
|
|
12
12
|
class MondoIdentity {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.test.d.ts","sourceRoot":"","sources":["../../../../src/common/resources/init.test.ts"],"names":[],"mappings":""}
|