@udibo/oauth2 0.1.0
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/LICENSE +20 -0
- package/README.md +174 -0
- package/SECURITY.md +77 -0
- package/esm/_dnt.polyfills.d.ts +17 -0
- package/esm/_dnt.polyfills.js +15 -0
- package/esm/adapters/hono/_common.d.ts +66 -0
- package/esm/adapters/hono/_common.js +108 -0
- package/esm/adapters/hono/authorization-server.d.ts +211 -0
- package/esm/adapters/hono/authorization-server.js +214 -0
- package/esm/adapters/hono/bff/auth-request-store.d.ts +164 -0
- package/esm/adapters/hono/bff/auth-request-store.js +154 -0
- package/esm/adapters/hono/bff/bff.d.ts +852 -0
- package/esm/adapters/hono/bff/bff.js +1194 -0
- package/esm/adapters/hono/bff/cookie-prefix.d.ts +72 -0
- package/esm/adapters/hono/bff/cookie-prefix.js +85 -0
- package/esm/adapters/hono/bff/mod.d.ts +19 -0
- package/esm/adapters/hono/bff/mod.js +19 -0
- package/esm/adapters/hono/bff/proxy.d.ts +108 -0
- package/esm/adapters/hono/bff/proxy.js +314 -0
- package/esm/adapters/hono/bff/session-store.d.ts +250 -0
- package/esm/adapters/hono/bff/session-store.js +216 -0
- package/esm/adapters/hono/bff/testing.d.ts +165 -0
- package/esm/adapters/hono/bff/testing.js +254 -0
- package/esm/adapters/hono/identity.d.ts +117 -0
- package/esm/adapters/hono/identity.js +215 -0
- package/esm/adapters/hono/log.d.ts +49 -0
- package/esm/adapters/hono/log.js +66 -0
- package/esm/adapters/hono/resource-server.d.ts +101 -0
- package/esm/adapters/hono/resource-server.js +108 -0
- package/esm/client/_http.d.ts +91 -0
- package/esm/client/_http.js +303 -0
- package/esm/client/base.d.ts +184 -0
- package/esm/client/base.js +93 -0
- package/esm/client/bff-client.d.ts +235 -0
- package/esm/client/bff-client.js +280 -0
- package/esm/client/browser-storage.d.ts +152 -0
- package/esm/client/browser-storage.js +246 -0
- package/esm/client/check.d.ts +114 -0
- package/esm/client/check.js +97 -0
- package/esm/client/direct-client.d.ts +707 -0
- package/esm/client/direct-client.js +1237 -0
- package/esm/client/discovery-cache.d.ts +138 -0
- package/esm/client/discovery-cache.js +124 -0
- package/esm/client/events.d.ts +54 -0
- package/esm/client/events.js +37 -0
- package/esm/client/mod.d.ts +35 -0
- package/esm/client/mod.js +33 -0
- package/esm/client/storage.d.ts +127 -0
- package/esm/client/storage.js +81 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/almost_equals.d.ts +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/almost_equals.js +47 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/array_includes.d.ts +28 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/array_includes.js +65 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/assert.d.ts +16 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/assert.js +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/assertion_error.d.ts +25 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/assertion_error.js +30 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/equal.d.ts +24 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/equal.js +193 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/equals.d.ts +36 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/equals.js +61 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/exists.d.ts +17 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/exists.js +27 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/fail.d.ts +14 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/fail.js +20 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/false.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/false.js +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/greater.d.ts +19 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/greater.js +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/greater_or_equal.d.ts +19 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/greater_or_equal.js +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/instance_of.d.ts +22 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/instance_of.js +52 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/is_error.d.ts +24 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/is_error.js +53 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/less.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/less.js +28 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/less_or_equal.d.ts +19 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/less_or_equal.js +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/match.d.ts +17 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/match.js +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/mod.d.ts +43 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/mod.js +45 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_equals.d.ts +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_equals.js +39 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_instance_of.d.ts +19 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_instance_of.js +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_match.d.ts +17 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_match.js +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_strict_equals.d.ts +22 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/not_strict_equals.js +32 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/object_match.d.ts +28 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/object_match.js +177 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/rejects.d.ts +41 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/rejects.js +53 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/strict_equals.d.ts +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/strict_equals.js +58 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/string_includes.d.ts +17 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/string_includes.js +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/throws.d.ts +44 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/throws.js +44 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/unimplemented.d.ts +14 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/unimplemented.js +20 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/unreachable.d.ts +14 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/unreachable.js +20 -0
- package/esm/deps/jsr.io/@std/async/1.5.0/delay.d.ts +44 -0
- package/esm/deps/jsr.io/@std/async/1.5.0/delay.js +84 -0
- package/esm/deps/jsr.io/@std/crypto/1.1.0/timing_safe_equal.d.ts +39 -0
- package/esm/deps/jsr.io/@std/crypto/1.1.0/timing_safe_equal.js +61 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/_common16.d.ts +22 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/_common16.js +51 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/_common32.d.ts +34 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/_common32.js +192 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/_common64.d.ts +34 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/_common64.js +113 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/_common_detach.d.ts +3 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/_common_detach.js +13 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/_types.d.ts +8 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/_types.js +2 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/_validate_binary_like.d.ts +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/_validate_binary_like.js +26 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/ascii85.d.ts +60 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/ascii85.js +152 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/base32.d.ts +39 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/base32.js +87 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/base58.d.ts +39 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/base58.js +131 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/base64.d.ts +39 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/base64.js +82 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/base64url.d.ts +39 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/base64url.js +72 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/hex.d.ts +38 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/hex.js +87 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/mod.d.ts +97 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/mod.js +99 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/varint.d.ts +119 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.11/varint.js +209 -0
- package/esm/deps/jsr.io/@std/http/1.1.3/status.d.ts +343 -0
- package/esm/deps/jsr.io/@std/http/1.1.3/status.js +343 -0
- package/esm/deps/jsr.io/@std/internal/1.0.14/assertion_state.d.ts +159 -0
- package/esm/deps/jsr.io/@std/internal/1.0.14/assertion_state.js +223 -0
- package/esm/deps/jsr.io/@std/internal/1.0.14/build_message.d.ts +79 -0
- package/esm/deps/jsr.io/@std/internal/1.0.14/build_message.js +116 -0
- package/esm/deps/jsr.io/@std/internal/1.0.14/diff.d.ts +139 -0
- package/esm/deps/jsr.io/@std/internal/1.0.14/diff.js +277 -0
- package/esm/deps/jsr.io/@std/internal/1.0.14/diff_str.d.ts +98 -0
- package/esm/deps/jsr.io/@std/internal/1.0.14/diff_str.js +181 -0
- package/esm/deps/jsr.io/@std/internal/1.0.14/format.d.ts +29 -0
- package/esm/deps/jsr.io/@std/internal/1.0.14/format.js +68 -0
- package/esm/deps/jsr.io/@std/internal/1.0.14/styles.d.ts +158 -0
- package/esm/deps/jsr.io/@std/internal/1.0.14/styles.js +206 -0
- package/esm/deps/jsr.io/@std/internal/1.0.14/types.d.ts +24 -0
- package/esm/deps/jsr.io/@std/internal/1.0.14/types.js +3 -0
- package/esm/deps/jsr.io/@std/testing/1.0.20/_test_suite.d.ts +91 -0
- package/esm/deps/jsr.io/@std/testing/1.0.20/_test_suite.js +347 -0
- package/esm/deps/jsr.io/@std/testing/1.0.20/bdd.d.ts +382 -0
- package/esm/deps/jsr.io/@std/testing/1.0.20/bdd.js +1110 -0
- package/esm/deps/jsr.io/@udibo/http-error/0.11.1/mod.d.ts +363 -0
- package/esm/deps/jsr.io/@udibo/http-error/0.11.1/mod.js +616 -0
- package/esm/errors.d.ts +203 -0
- package/esm/errors.js +287 -0
- package/esm/identity/captcha.d.ts +147 -0
- package/esm/identity/captcha.js +64 -0
- package/esm/identity/delivery.d.ts +96 -0
- package/esm/identity/delivery.js +41 -0
- package/esm/identity/errors.d.ts +39 -0
- package/esm/identity/errors.js +46 -0
- package/esm/identity/events.d.ts +242 -0
- package/esm/identity/events.js +39 -0
- package/esm/identity/external/_shared.d.ts +86 -0
- package/esm/identity/external/_shared.js +107 -0
- package/esm/identity/external/_token-exchange.d.ts +61 -0
- package/esm/identity/external/_token-exchange.js +179 -0
- package/esm/identity/external/apple-client-secret.d.ts +82 -0
- package/esm/identity/external/apple-client-secret.js +133 -0
- package/esm/identity/external/apple.d.ts +64 -0
- package/esm/identity/external/apple.js +248 -0
- package/esm/identity/external/discord.d.ts +38 -0
- package/esm/identity/external/discord.js +62 -0
- package/esm/identity/external/errors.d.ts +48 -0
- package/esm/identity/external/errors.js +36 -0
- package/esm/identity/external/flow.d.ts +107 -0
- package/esm/identity/external/flow.js +158 -0
- package/esm/identity/external/github.d.ts +42 -0
- package/esm/identity/external/github.js +164 -0
- package/esm/identity/external/google.d.ts +52 -0
- package/esm/identity/external/google.js +38 -0
- package/esm/identity/external/mod.d.ts +63 -0
- package/esm/identity/external/mod.js +61 -0
- package/esm/identity/external/oauth2.d.ts +110 -0
- package/esm/identity/external/oauth2.js +158 -0
- package/esm/identity/external/oidc.d.ts +81 -0
- package/esm/identity/external/oidc.js +250 -0
- package/esm/identity/external/provider.d.ts +132 -0
- package/esm/identity/external/provider.js +12 -0
- package/esm/identity/hibp.d.ts +67 -0
- package/esm/identity/hibp.js +87 -0
- package/esm/identity/identifier.d.ts +44 -0
- package/esm/identity/identifier.js +47 -0
- package/esm/identity/lockout.d.ts +155 -0
- package/esm/identity/lockout.js +117 -0
- package/esm/identity/mfa/mod.d.ts +42 -0
- package/esm/identity/mfa/mod.js +42 -0
- package/esm/identity/mfa/recovery-codes.d.ts +96 -0
- package/esm/identity/mfa/recovery-codes.js +80 -0
- package/esm/identity/mfa/service.d.ts +338 -0
- package/esm/identity/mfa/service.js +351 -0
- package/esm/identity/mfa/totp.d.ts +186 -0
- package/esm/identity/mfa/totp.js +194 -0
- package/esm/identity/migration.d.ts +155 -0
- package/esm/identity/migration.js +243 -0
- package/esm/identity/mod.d.ts +65 -0
- package/esm/identity/mod.js +64 -0
- package/esm/identity/otp.d.ts +255 -0
- package/esm/identity/otp.js +245 -0
- package/esm/identity/password-policy.d.ts +45 -0
- package/esm/identity/password-policy.js +60 -0
- package/esm/identity/password.d.ts +171 -0
- package/esm/identity/password.js +160 -0
- package/esm/identity/rate-limit.d.ts +192 -0
- package/esm/identity/rate-limit.js +168 -0
- package/esm/identity/service.d.ts +579 -0
- package/esm/identity/service.js +835 -0
- package/esm/identity/session.d.ts +122 -0
- package/esm/identity/session.js +48 -0
- package/esm/identity/token-flow.d.ts +214 -0
- package/esm/identity/token-flow.js +173 -0
- package/esm/models/authentication.d.ts +24 -0
- package/esm/models/authentication.js +1 -0
- package/esm/models/authorization-code.d.ts +63 -0
- package/esm/models/authorization-code.js +1 -0
- package/esm/models/authorization.d.ts +165 -0
- package/esm/models/authorization.js +160 -0
- package/esm/models/client.d.ts +78 -0
- package/esm/models/client.js +1 -0
- package/esm/models/device-authorization.d.ts +30 -0
- package/esm/models/device-authorization.js +1 -0
- package/esm/models/responses.d.ts +93 -0
- package/esm/models/responses.js +1 -0
- package/esm/models/scope.d.ts +81 -0
- package/esm/models/scope.js +125 -0
- package/esm/models/token.d.ts +135 -0
- package/esm/models/token.js +1 -0
- package/esm/package.json +3 -0
- package/esm/react/callback.d.ts +52 -0
- package/esm/react/callback.js +71 -0
- package/esm/react/components/class-names.d.ts +91 -0
- package/esm/react/components/class-names.js +118 -0
- package/esm/react/components/internal.d.ts +62 -0
- package/esm/react/components/internal.js +102 -0
- package/esm/react/components/mfa-challenge-form.d.ts +66 -0
- package/esm/react/components/mfa-challenge-form.js +46 -0
- package/esm/react/components/mfa-enrollment-form.d.ts +83 -0
- package/esm/react/components/mfa-enrollment-form.js +41 -0
- package/esm/react/components/mod.d.ts +103 -0
- package/esm/react/components/mod.js +93 -0
- package/esm/react/components/request-password-reset-form.d.ts +61 -0
- package/esm/react/components/request-password-reset-form.js +41 -0
- package/esm/react/components/reset-password-form.d.ts +66 -0
- package/esm/react/components/reset-password-form.js +56 -0
- package/esm/react/components/sign-in-form.d.ts +74 -0
- package/esm/react/components/sign-in-form.js +43 -0
- package/esm/react/components/sign-up-form.d.ts +85 -0
- package/esm/react/components/sign-up-form.js +57 -0
- package/esm/react/components/types.d.ts +208 -0
- package/esm/react/components/types.js +14 -0
- package/esm/react/components/use-auth-form.d.ts +118 -0
- package/esm/react/components/use-auth-form.js +172 -0
- package/esm/react/components/user-menu.d.ts +79 -0
- package/esm/react/components/user-menu.js +73 -0
- package/esm/react/context.d.ts +51 -0
- package/esm/react/context.js +16 -0
- package/esm/react/mod.d.ts +26 -0
- package/esm/react/mod.js +26 -0
- package/esm/react/provider.d.ts +40 -0
- package/esm/react/provider.js +189 -0
- package/esm/react/require-auth.d.ts +31 -0
- package/esm/react/require-auth.js +37 -0
- package/esm/react/testing.d.ts +322 -0
- package/esm/react/testing.js +461 -0
- package/esm/react/use-authorization.d.ts +31 -0
- package/esm/react/use-authorization.js +36 -0
- package/esm/react/use-oauth2.d.ts +112 -0
- package/esm/react/use-oauth2.js +127 -0
- package/esm/server/authorization-server.d.ts +736 -0
- package/esm/server/authorization-server.js +1304 -0
- package/esm/server/client-authentication.d.ts +28 -0
- package/esm/server/client-authentication.js +51 -0
- package/esm/server/grants/authorization-code.d.ts +179 -0
- package/esm/server/grants/authorization-code.js +232 -0
- package/esm/server/grants/client-credentials.d.ts +52 -0
- package/esm/server/grants/client-credentials.js +53 -0
- package/esm/server/grants/device-authorization.d.ts +103 -0
- package/esm/server/grants/device-authorization.js +156 -0
- package/esm/server/grants/grant.d.ts +165 -0
- package/esm/server/grants/grant.js +173 -0
- package/esm/server/grants/password.d.ts +80 -0
- package/esm/server/grants/password.js +92 -0
- package/esm/server/grants/refresh-token.d.ts +80 -0
- package/esm/server/grants/refresh-token.js +136 -0
- package/esm/server/introspection-token-reader.d.ts +153 -0
- package/esm/server/introspection-token-reader.js +164 -0
- package/esm/server/jwks-token-reader.d.ts +263 -0
- package/esm/server/jwks-token-reader.js +508 -0
- package/esm/server/mod.d.ts +23 -0
- package/esm/server/mod.js +15 -0
- package/esm/server/public-suffix/mod.d.ts +62 -0
- package/esm/server/public-suffix/mod.js +103 -0
- package/esm/server/public-suffix/rules.d.ts +23 -0
- package/esm/server/public-suffix/rules.js +23 -0
- package/esm/server/redirect-uri.d.ts +187 -0
- package/esm/server/redirect-uri.js +331 -0
- package/esm/server/resource-server.d.ts +286 -0
- package/esm/server/resource-server.js +365 -0
- package/esm/server/services/authorization-code.d.ts +84 -0
- package/esm/server/services/authorization-code.js +35 -0
- package/esm/server/services/client.d.ts +35 -0
- package/esm/server/services/client.js +1 -0
- package/esm/server/services/device-authorization.d.ts +134 -0
- package/esm/server/services/device-authorization.js +7 -0
- package/esm/server/services/token.d.ts +242 -0
- package/esm/server/services/token.js +78 -0
- package/esm/server/services/user.d.ts +29 -0
- package/esm/server/services/user.js +7 -0
- package/esm/server/signing-keys.d.ts +201 -0
- package/esm/server/signing-keys.js +225 -0
- package/esm/server/utils/hash.d.ts +6 -0
- package/esm/server/utils/hash.js +11 -0
- package/esm/testing/contract/authorization-code.d.ts +37 -0
- package/esm/testing/contract/authorization-code.js +93 -0
- package/esm/testing/contract/client.d.ts +85 -0
- package/esm/testing/contract/client.js +126 -0
- package/esm/testing/contract/device-authorization.d.ts +37 -0
- package/esm/testing/contract/device-authorization.js +193 -0
- package/esm/testing/contract/lockout-store.d.ts +47 -0
- package/esm/testing/contract/lockout-store.js +122 -0
- package/esm/testing/contract/mfa-store.d.ts +50 -0
- package/esm/testing/contract/mfa-store.js +226 -0
- package/esm/testing/contract/mod.d.ts +39 -0
- package/esm/testing/contract/mod.js +39 -0
- package/esm/testing/contract/otp-store.d.ts +48 -0
- package/esm/testing/contract/otp-store.js +197 -0
- package/esm/testing/contract/rate-limit-store.d.ts +52 -0
- package/esm/testing/contract/rate-limit-store.js +105 -0
- package/esm/testing/contract/token-flow-store.d.ts +54 -0
- package/esm/testing/contract/token-flow-store.js +179 -0
- package/esm/testing/contract/token-reader.d.ts +77 -0
- package/esm/testing/contract/token-reader.js +78 -0
- package/esm/testing/contract/token.d.ts +61 -0
- package/esm/testing/contract/token.js +287 -0
- package/esm/testing/contract/user.d.ts +63 -0
- package/esm/testing/contract/user.js +75 -0
- package/esm/testing/mod.d.ts +34 -0
- package/esm/testing/mod.js +34 -0
- package/esm/testing/server.d.ts +197 -0
- package/esm/testing/server.js +193 -0
- package/esm/testing/services.d.ts +373 -0
- package/esm/testing/services.js +703 -0
- package/esm/utils/_buffer.d.ts +10 -0
- package/esm/utils/_buffer.js +12 -0
- package/esm/utils/_timing-safe.d.ts +13 -0
- package/esm/utils/_timing-safe.js +22 -0
- package/esm/utils/authentication-context.d.ts +3 -0
- package/esm/utils/authentication-context.js +14 -0
- package/esm/utils/basic-auth.d.ts +50 -0
- package/esm/utils/basic-auth.js +106 -0
- package/esm/utils/crypto.d.ts +97 -0
- package/esm/utils/crypto.js +162 -0
- package/esm/utils/pkce.d.ts +151 -0
- package/esm/utils/pkce.js +179 -0
- package/esm/utils/text.d.ts +24 -0
- package/esm/utils/text.js +28 -0
- package/esm/utils/url.d.ts +66 -0
- package/esm/utils/url.js +90 -0
- package/package.json +92 -0
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import { type DescribeDefinition, type ItDefinition, type TestSuite } from "./_test_suite.js";
|
|
2
|
+
export type { DescribeDefinition, ItDefinition, TestSuite };
|
|
3
|
+
/**
|
|
4
|
+
* The arguments for an ItFunction.
|
|
5
|
+
*
|
|
6
|
+
* @deprecated This will be removed in 2.0.0 together with {@linkcode it}.
|
|
7
|
+
* Use `node:test`'s `it()` instead.
|
|
8
|
+
*/
|
|
9
|
+
export type ItArgs<T> = [options: ItDefinition<T>] | [
|
|
10
|
+
name: string,
|
|
11
|
+
options: Omit<ItDefinition<T>, "name">
|
|
12
|
+
] | [
|
|
13
|
+
name: string,
|
|
14
|
+
fn: (this: T, t: Deno.TestContext) => void | Promise<void>
|
|
15
|
+
] | [fn: (this: T, t: Deno.TestContext) => void | Promise<void>] | [
|
|
16
|
+
name: string,
|
|
17
|
+
options: Omit<ItDefinition<T>, "fn" | "name">,
|
|
18
|
+
fn: (this: T, t: Deno.TestContext) => void | Promise<void>
|
|
19
|
+
] | [
|
|
20
|
+
options: Omit<ItDefinition<T>, "fn">,
|
|
21
|
+
fn: (this: T, t: Deno.TestContext) => void | Promise<void>
|
|
22
|
+
] | [
|
|
23
|
+
options: Omit<ItDefinition<T>, "fn" | "name">,
|
|
24
|
+
fn: (this: T, t: Deno.TestContext) => void | Promise<void>
|
|
25
|
+
] | [
|
|
26
|
+
suite: TestSuite<T>,
|
|
27
|
+
name: string,
|
|
28
|
+
options: Omit<ItDefinition<T>, "name" | "suite">
|
|
29
|
+
] | [
|
|
30
|
+
suite: TestSuite<T>,
|
|
31
|
+
name: string,
|
|
32
|
+
fn: (this: T, t: Deno.TestContext) => void | Promise<void>
|
|
33
|
+
] | [
|
|
34
|
+
suite: TestSuite<T>,
|
|
35
|
+
fn: (this: T, t: Deno.TestContext) => void | Promise<void>
|
|
36
|
+
] | [
|
|
37
|
+
suite: TestSuite<T>,
|
|
38
|
+
name: string,
|
|
39
|
+
options: Omit<ItDefinition<T>, "fn" | "name" | "suite">,
|
|
40
|
+
fn: (this: T, t: Deno.TestContext) => void | Promise<void>
|
|
41
|
+
] | [
|
|
42
|
+
suite: TestSuite<T>,
|
|
43
|
+
options: Omit<ItDefinition<T>, "fn" | "suite">,
|
|
44
|
+
fn: (this: T, t: Deno.TestContext) => void | Promise<void>
|
|
45
|
+
] | [
|
|
46
|
+
suite: TestSuite<T>,
|
|
47
|
+
options: Omit<ItDefinition<T>, "fn" | "name" | "suite">,
|
|
48
|
+
fn: (this: T, t: Deno.TestContext) => void | Promise<void>
|
|
49
|
+
];
|
|
50
|
+
/**
|
|
51
|
+
* Registers an individual test case.
|
|
52
|
+
*
|
|
53
|
+
* @deprecated This will be removed in 2.0.0. Use `node:test`'s `it()` or
|
|
54
|
+
* `Deno.test()` instead.
|
|
55
|
+
*/
|
|
56
|
+
export interface it {
|
|
57
|
+
<T>(...args: ItArgs<T>): void;
|
|
58
|
+
/** Registers an individual test case with only set to true. */
|
|
59
|
+
only<T>(...args: ItArgs<T>): void;
|
|
60
|
+
/** Registers an individual test case with ignore set to true. */
|
|
61
|
+
ignore<T>(...args: ItArgs<T>): void;
|
|
62
|
+
/**
|
|
63
|
+
* Registers an individual test case with ignore set to true. Alias of
|
|
64
|
+
* `.ignore()`.
|
|
65
|
+
*/
|
|
66
|
+
skip<T>(...args: ItArgs<T>): void;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Registers an individual test case.
|
|
70
|
+
*
|
|
71
|
+
* @example Usage
|
|
72
|
+
* ```ts ignore
|
|
73
|
+
* import { describe, it } from "@std/testing/bdd";
|
|
74
|
+
* import { assertEquals } from "@std/assert";
|
|
75
|
+
*
|
|
76
|
+
* describe("example", () => {
|
|
77
|
+
* it("should pass", () => {
|
|
78
|
+
* // test case
|
|
79
|
+
* assertEquals(2 + 2, 4);
|
|
80
|
+
* });
|
|
81
|
+
* });
|
|
82
|
+
* ```
|
|
83
|
+
*
|
|
84
|
+
* @typeParam T The self type of the function to implement the test case
|
|
85
|
+
* @param args The test case
|
|
86
|
+
*
|
|
87
|
+
* @deprecated This will be removed in 2.0.0. Use `node:test`'s `it()` or
|
|
88
|
+
* `Deno.test()` instead.
|
|
89
|
+
*/
|
|
90
|
+
export declare function it<T>(...args: ItArgs<T>): void;
|
|
91
|
+
export declare namespace it {
|
|
92
|
+
var only: <T>(...args: ItArgs<T>) => void;
|
|
93
|
+
var ignore: <T>(...args: ItArgs<T>) => void;
|
|
94
|
+
var skip: <T>(...args: ItArgs<T>) => void;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Alias of {@linkcode it}
|
|
98
|
+
*
|
|
99
|
+
* Registers an individual test case.
|
|
100
|
+
*
|
|
101
|
+
* @example Usage
|
|
102
|
+
* ```ts ignore
|
|
103
|
+
* import { test } from "@std/testing/bdd";
|
|
104
|
+
* import { assertEquals } from "@std/assert";
|
|
105
|
+
*
|
|
106
|
+
* test("a test case", () => {
|
|
107
|
+
* // test case
|
|
108
|
+
* assertEquals(2 + 2, 4);
|
|
109
|
+
* });
|
|
110
|
+
* ```
|
|
111
|
+
*
|
|
112
|
+
* @typeParam T The self type of the function to implement the test case
|
|
113
|
+
* @param args The test case
|
|
114
|
+
*
|
|
115
|
+
* @deprecated This will be removed in 2.0.0. Use `node:test`'s `test()` or
|
|
116
|
+
* `Deno.test()` instead.
|
|
117
|
+
*/
|
|
118
|
+
export declare function test<T>(...args: ItArgs<T>): void;
|
|
119
|
+
export declare namespace test {
|
|
120
|
+
var only: <T>(...args: ItArgs<T>) => void;
|
|
121
|
+
var ignore: <T>(...args: ItArgs<T>) => void;
|
|
122
|
+
var skip: <T>(...args: ItArgs<T>) => void;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Run some shared setup before all of the tests in the group.
|
|
126
|
+
* Useful for async setup in `describe` blocks. Outside them,
|
|
127
|
+
* top-level initialization code should be used instead.
|
|
128
|
+
*
|
|
129
|
+
* @example Usage
|
|
130
|
+
* ```ts ignore
|
|
131
|
+
* import { describe, it, beforeAll } from "@std/testing/bdd";
|
|
132
|
+
* import { assertEquals } from "@std/assert";
|
|
133
|
+
*
|
|
134
|
+
* beforeAll(() => {
|
|
135
|
+
* console.log("beforeAll");
|
|
136
|
+
* });
|
|
137
|
+
*
|
|
138
|
+
* describe("example", () => {
|
|
139
|
+
* it("should pass", () => {
|
|
140
|
+
* // test case
|
|
141
|
+
* assertEquals(2 + 2, 4);
|
|
142
|
+
* });
|
|
143
|
+
* });
|
|
144
|
+
* ```
|
|
145
|
+
*
|
|
146
|
+
* @typeParam T The self type of the function
|
|
147
|
+
* @param fn The function to implement the setup behavior.
|
|
148
|
+
*
|
|
149
|
+
* @deprecated This will be removed in 2.0.0. Use `node:test`'s `before()` or
|
|
150
|
+
* `Deno.test.beforeAll()` (Deno 2.5+) instead.
|
|
151
|
+
*/
|
|
152
|
+
export declare function beforeAll<T>(fn: (this: T) => void | Promise<void>): void;
|
|
153
|
+
/**
|
|
154
|
+
* Alias of {@linkcode beforeAll}
|
|
155
|
+
*
|
|
156
|
+
* Run some shared setup before all of the tests in the suite.
|
|
157
|
+
*
|
|
158
|
+
* @example Usage
|
|
159
|
+
* ```ts ignore
|
|
160
|
+
* import { describe, it, before } from "@std/testing/bdd";
|
|
161
|
+
* import { assertEquals } from "@std/assert";
|
|
162
|
+
*
|
|
163
|
+
* before(() => {
|
|
164
|
+
* console.log("before");
|
|
165
|
+
* });
|
|
166
|
+
*
|
|
167
|
+
* describe("example", () => {
|
|
168
|
+
* it("should pass", () => {
|
|
169
|
+
* // test case
|
|
170
|
+
* assertEquals(2 + 2, 4);
|
|
171
|
+
* });
|
|
172
|
+
* });
|
|
173
|
+
* ```
|
|
174
|
+
*
|
|
175
|
+
* @typeParam T The self type of the function
|
|
176
|
+
* @param fn The function to implement the setup behavior.
|
|
177
|
+
*
|
|
178
|
+
* @deprecated This will be removed in 2.0.0. Use `node:test`'s `before()` or
|
|
179
|
+
* `Deno.test.beforeAll()` (Deno 2.5+) instead.
|
|
180
|
+
*/
|
|
181
|
+
export declare function before<T>(fn: (this: T) => void | Promise<void>): void;
|
|
182
|
+
/**
|
|
183
|
+
* Run some shared teardown after all of the tests in the suite.
|
|
184
|
+
*
|
|
185
|
+
* @example Usage
|
|
186
|
+
* ```ts ignore
|
|
187
|
+
* import { describe, it, afterAll } from "@std/testing/bdd";
|
|
188
|
+
* import { assertEquals } from "@std/assert";
|
|
189
|
+
*
|
|
190
|
+
* afterAll(() => {
|
|
191
|
+
* console.log("afterAll");
|
|
192
|
+
* });
|
|
193
|
+
*
|
|
194
|
+
* describe("example", () => {
|
|
195
|
+
* it("should pass", () => {
|
|
196
|
+
* // test case
|
|
197
|
+
* assertEquals(2 + 2, 4);
|
|
198
|
+
* });
|
|
199
|
+
* });
|
|
200
|
+
* ```
|
|
201
|
+
*
|
|
202
|
+
* @typeParam T The self type of the function
|
|
203
|
+
* @param fn The function to implement the teardown behavior.
|
|
204
|
+
*
|
|
205
|
+
* @deprecated This will be removed in 2.0.0. Use `node:test`'s `after()` or
|
|
206
|
+
* `Deno.test.afterAll()` (Deno 2.5+) instead.
|
|
207
|
+
*/
|
|
208
|
+
export declare function afterAll<T>(fn: (this: T) => void | Promise<void>): void;
|
|
209
|
+
/**
|
|
210
|
+
* Alias of {@linkcode afterAll}.
|
|
211
|
+
*
|
|
212
|
+
* Run some shared teardown after all of the tests in the suite.
|
|
213
|
+
*
|
|
214
|
+
* @example Usage
|
|
215
|
+
* ```ts ignore
|
|
216
|
+
* import { describe, it, after } from "@std/testing/bdd";
|
|
217
|
+
* import { assertEquals } from "@std/assert";
|
|
218
|
+
*
|
|
219
|
+
* after(() => {
|
|
220
|
+
* console.log("after");
|
|
221
|
+
* });
|
|
222
|
+
*
|
|
223
|
+
* describe("example", () => {
|
|
224
|
+
* it("should pass", () => {
|
|
225
|
+
* // test case
|
|
226
|
+
* assertEquals(2 + 2, 4);
|
|
227
|
+
* });
|
|
228
|
+
* });
|
|
229
|
+
* ```
|
|
230
|
+
*
|
|
231
|
+
* @typeParam T The self type of the function
|
|
232
|
+
* @param fn The function to implement the teardown behavior.
|
|
233
|
+
*
|
|
234
|
+
* @deprecated This will be removed in 2.0.0. Use `node:test`'s `after()` or
|
|
235
|
+
* `Deno.test.afterAll()` (Deno 2.5+) instead.
|
|
236
|
+
*/
|
|
237
|
+
export declare function after<T>(fn: (this: T) => void | Promise<void>): void;
|
|
238
|
+
/**
|
|
239
|
+
* Run some shared setup before each test in the suite.
|
|
240
|
+
*
|
|
241
|
+
* @example Usage
|
|
242
|
+
* ```ts ignore
|
|
243
|
+
* import { describe, it, beforeEach } from "@std/testing/bdd";
|
|
244
|
+
* import { assertEquals } from "@std/assert";
|
|
245
|
+
*
|
|
246
|
+
* beforeEach(() => {
|
|
247
|
+
* console.log("beforeEach");
|
|
248
|
+
* });
|
|
249
|
+
*
|
|
250
|
+
* describe("example", () => {
|
|
251
|
+
* it("should pass", () => {
|
|
252
|
+
* // test case
|
|
253
|
+
* assertEquals(2 + 2, 4);
|
|
254
|
+
* });
|
|
255
|
+
* });
|
|
256
|
+
* ```
|
|
257
|
+
*
|
|
258
|
+
* @typeParam T The self type of the function
|
|
259
|
+
* @param fn The function to implement the shared setup behavior
|
|
260
|
+
*
|
|
261
|
+
* @deprecated This will be removed in 2.0.0. Use `node:test`'s `beforeEach()`
|
|
262
|
+
* or `Deno.test.beforeEach()` (Deno 2.5+) instead.
|
|
263
|
+
*/
|
|
264
|
+
export declare function beforeEach<T>(fn: (this: T) => void | Promise<void>): void;
|
|
265
|
+
/**
|
|
266
|
+
* Run some shared teardown after each test in the suite.
|
|
267
|
+
*
|
|
268
|
+
* @example Usage
|
|
269
|
+
* ```ts ignore
|
|
270
|
+
* import { describe, it, afterEach } from "@std/testing/bdd";
|
|
271
|
+
* import { assertEquals } from "@std/assert";
|
|
272
|
+
*
|
|
273
|
+
* afterEach(() => {
|
|
274
|
+
* console.log("afterEach");
|
|
275
|
+
* });
|
|
276
|
+
*
|
|
277
|
+
* describe("example", () => {
|
|
278
|
+
* it("should pass", () => {
|
|
279
|
+
* // test case
|
|
280
|
+
* assertEquals(2 + 2, 4);
|
|
281
|
+
* });
|
|
282
|
+
* });
|
|
283
|
+
* ```
|
|
284
|
+
*
|
|
285
|
+
* @typeParam T The self type of the function
|
|
286
|
+
* @param fn The function to implement the shared teardown behavior
|
|
287
|
+
*
|
|
288
|
+
* @deprecated This will be removed in 2.0.0. Use `node:test`'s `afterEach()`
|
|
289
|
+
* or `Deno.test.afterEach()` (Deno 2.5+) instead.
|
|
290
|
+
*/
|
|
291
|
+
export declare function afterEach<T>(fn: (this: T) => void | Promise<void>): void;
|
|
292
|
+
/**
|
|
293
|
+
* The arguments for a DescribeFunction.
|
|
294
|
+
*
|
|
295
|
+
* @deprecated This will be removed in 2.0.0 together with {@linkcode describe}.
|
|
296
|
+
* Use `node:test`'s `describe()` instead.
|
|
297
|
+
*/
|
|
298
|
+
export type DescribeArgs<T> = [options: DescribeDefinition<T>] | [name: string] | [
|
|
299
|
+
name: string,
|
|
300
|
+
options: Omit<DescribeDefinition<T>, "name">
|
|
301
|
+
] | [name: string, fn: () => void | undefined] | [fn: () => void | undefined] | [
|
|
302
|
+
name: string,
|
|
303
|
+
options: Omit<DescribeDefinition<T>, "fn" | "name">,
|
|
304
|
+
fn: () => void | undefined
|
|
305
|
+
] | [
|
|
306
|
+
options: Omit<DescribeDefinition<T>, "fn">,
|
|
307
|
+
fn: () => void | undefined
|
|
308
|
+
] | [
|
|
309
|
+
options: Omit<DescribeDefinition<T>, "fn" | "name">,
|
|
310
|
+
fn: () => void | undefined
|
|
311
|
+
] | [
|
|
312
|
+
suite: TestSuite<T>,
|
|
313
|
+
name: string
|
|
314
|
+
] | [
|
|
315
|
+
suite: TestSuite<T>,
|
|
316
|
+
name: string,
|
|
317
|
+
options: Omit<DescribeDefinition<T>, "name" | "suite">
|
|
318
|
+
] | [
|
|
319
|
+
suite: TestSuite<T>,
|
|
320
|
+
name: string,
|
|
321
|
+
fn: () => void | undefined
|
|
322
|
+
] | [
|
|
323
|
+
suite: TestSuite<T>,
|
|
324
|
+
fn: () => void | undefined
|
|
325
|
+
] | [
|
|
326
|
+
suite: TestSuite<T>,
|
|
327
|
+
name: string,
|
|
328
|
+
options: Omit<DescribeDefinition<T>, "fn" | "name" | "suite">,
|
|
329
|
+
fn: () => void | undefined
|
|
330
|
+
] | [
|
|
331
|
+
suite: TestSuite<T>,
|
|
332
|
+
options: Omit<DescribeDefinition<T>, "fn" | "suite">,
|
|
333
|
+
fn: () => void | undefined
|
|
334
|
+
] | [
|
|
335
|
+
suite: TestSuite<T>,
|
|
336
|
+
options: Omit<DescribeDefinition<T>, "fn" | "name" | "suite">,
|
|
337
|
+
fn: () => void | undefined
|
|
338
|
+
];
|
|
339
|
+
/**
|
|
340
|
+
* Registers a test suite.
|
|
341
|
+
*
|
|
342
|
+
* @deprecated This will be removed in 2.0.0. Use `node:test`'s `describe()`
|
|
343
|
+
* instead.
|
|
344
|
+
*/
|
|
345
|
+
export interface describe {
|
|
346
|
+
<T>(...args: DescribeArgs<T>): TestSuite<T>;
|
|
347
|
+
/** Registers a test suite with only set to true. */
|
|
348
|
+
only<T>(...args: DescribeArgs<T>): TestSuite<T>;
|
|
349
|
+
/** Registers a test suite with ignore set to true. */
|
|
350
|
+
ignore<T>(...args: DescribeArgs<T>): TestSuite<T>;
|
|
351
|
+
/** Registers a test suite with ignore set to true. Alias of `.ignore()`. */
|
|
352
|
+
skip<T>(...args: ItArgs<T>): void;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Registers a test suite.
|
|
356
|
+
*
|
|
357
|
+
* @example Usage
|
|
358
|
+
* ```ts ignore
|
|
359
|
+
* import { describe, it } from "@std/testing/bdd";
|
|
360
|
+
* import { assertEquals } from "@std/assert";
|
|
361
|
+
*
|
|
362
|
+
* describe("example", () => {
|
|
363
|
+
* it("should pass", () => {
|
|
364
|
+
* // test case
|
|
365
|
+
* assertEquals(2 + 2, 4);
|
|
366
|
+
* });
|
|
367
|
+
* });
|
|
368
|
+
* ```
|
|
369
|
+
*
|
|
370
|
+
* @typeParam T The self type of the test suite body.
|
|
371
|
+
* @param args The test suite body.
|
|
372
|
+
* @returns The test suite
|
|
373
|
+
*
|
|
374
|
+
* @deprecated This will be removed in 2.0.0. Use `node:test`'s `describe()`
|
|
375
|
+
* instead.
|
|
376
|
+
*/
|
|
377
|
+
export declare function describe<T>(...args: DescribeArgs<T>): TestSuite<T>;
|
|
378
|
+
export declare namespace describe {
|
|
379
|
+
var only: <T>(...args: DescribeArgs<T>) => TestSuite<T>;
|
|
380
|
+
var ignore: <T>(...args: DescribeArgs<T>) => TestSuite<T>;
|
|
381
|
+
var skip: <T>(...args: DescribeArgs<T>) => TestSuite<T>;
|
|
382
|
+
}
|