@productcraft/auth 1.0.0 → 1.0.1
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/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +36512 -0
- package/dist/index.d.ts +62 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/testing.d.cts +32 -0
- package/package.json +25 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { LastResponse, WebhookPayload, WebhookHeaders, APIClient, RequestOptions, APIPromise, PagePromise, ClientOptions, PollOptions, APIError } from '@productcraft/core';
|
|
2
2
|
export { APIConnectionError, APIError, APITimeoutError, APIUserAbortError, AuthenticationError, BadRequestError, ConfigurationError, ConflictError, IdempotencyKeyReuseError, InternalServerError, NotFoundError, PCAuth, PCClientConfig, PermissionDeniedError, ProductCraftError, RateLimitError, UnprocessableEntityError, WebhookVerificationError } from '@productcraft/core';
|
|
3
3
|
import { Client } from 'openapi-fetch';
|
|
4
|
-
import { JWTHeaderParameters, FlattenedJWSInput, CryptoKey, JWTPayload } from 'jose';
|
|
5
4
|
|
|
6
5
|
/** Error codes this API documents. Open: codes added later still type-check. See https://productcraft.co/docs/errors. */
|
|
7
6
|
type AuthErrorCode = "BAD_REQUEST" | "VALIDATION_ERROR" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "METHOD_NOT_ALLOWED" | "NOT_ACCEPTABLE" | "REQUEST_TIMEOUT" | "CONFLICT" | "GONE" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNSUPPORTED_MEDIA_TYPE" | "UNPROCESSABLE_ENTITY" | "PRECONDITION_REQUIRED" | "RATE_LIMITED" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT" | "SERVICE_NOT_ENABLED" | "INVALID_CREDENTIALS" | "SESSION_REVOKED" | "MCP_NOT_PERMITTED" | "MCP_WORKSPACE_MISMATCH" | "PAK_NOT_PERMITTED" | "ACTIONS_NOT_GRANTABLE" | "IDEMPOTENCY_KEY_REUSE" | "IDEMPOTENCY_KEY_REQUIRED" | "IDEMPOTENCY_IN_PROGRESS" | "WEBHOOK_ENDPOINT_LIMIT" | "WEBHOOK_ENDPOINT_NOT_FOUND" | "WEBHOOK_ENDPOINT_NOT_SUBSCRIBED" | "WEBHOOK_EVENT_NOT_FOUND" | "WEBHOOK_EVENT_TYPE_UNKNOWN" | "ACCOUNT_EXISTS" | "ACCOUNT_NOT_FOUND" | "ACCOUNT_SUSPENDED" | "APEX_NOT_SUPPORTED" | "APP_ARCHIVED" | "APP_HAS_NO_WORKSPACE" | "APP_NOT_FOUND" | "APP_SUSPENDED" | "AUTH_SETTINGS_IN_METADATA" | "AVATAR_INVALID_TYPE" | "AVATAR_MAGIC_MISMATCH" | "AVATAR_NOT_FOUND" | "AVATAR_TOO_LARGE" | "BOT_PROTECTION_FAILED" | "BOT_PROTECTION_REQUIRED" | "BOT_PROTECTION_UNAVAILABLE" | "CUSTOM_DOMAIN_EXISTS" | "CUSTOM_DOMAIN_NOT_ACTIVE" | "CUSTOM_DOMAIN_NOT_FOUND" | "CUSTOM_DOMAIN_OAUTH_ONLY" | "DNS_CONFLICTS" | "ENVOI_APP_NOT_BOUND_TO_WORKSPACE" | "ENVOI_NOT_ENABLED" | "ENVOI_NOT_WIRED" | "ENVOI_SENDER_NOT_CONFIGURED" | "ENVOI_TEMPLATE_NOT_CONFIGURED" | "FEATURE_NOT_ENABLED" | "HOSTNAME_RESERVED" | "HOSTNAME_TAKEN" | "INSUFFICIENT_PERMISSIONS" | "INVALID_FORMAT" | "INVALID_HOSTNAME" | "INVALID_IDENTIFIER" | "INVALID_PROVIDER" | "INVALID_ZONE" | "MAIL_UNREACHABLE" | "PAK_WORKSPACE_MISMATCH" | "PASSWORD_BREACHED" | "PASSWORD_TOO_COMMON" | "PROVIDER_ERROR" | "PROVIDER_PERMISSION_DENIED" | "PROVIDER_TOKEN_REJECTED" | "PROVIDER_UNAVAILABLE" | "PROVIDER_ZONE_NOT_FOUND" | "ROLE_IN_USE" | "SENDER_ADDRESS_REQUIRED" | "SESSION_EXPIRED" | "SIGN_IN_TEST_INVALID" | "SLUG_TAKEN" | "SLUG_UUID_SHAPED" | "TENANT_API_KEYS_APP_PROXY_ONLY" | "TENANT_API_KEYS_FORBIDDEN" | "TENANT_API_KEYS_NOT_ENABLED" | "TENANT_API_KEYS_NO_SCOPES" | "TENANT_API_KEYS_SCOPE_INVALID" | "TENANT_API_KEYS_SUSPENDED" | "TENANT_API_KEYS_SUSPENDED_NOT_WRITABLE" | "TENANT_API_KEYS_UNKNOWN_ROLE" | "TENANT_API_KEY_EXPIRY_INVALID" | "TENANT_API_KEY_LIMIT" | "TENANT_API_KEY_NOT_ACTIVE" | "TENANT_API_KEY_NOT_FOUND" | "TENANT_API_KEY_SCOPE_ABOVE_CEILING" | "TENANT_API_KEY_SCOPE_NOT_GRANTABLE" | "TENANT_CONTEXT_REQUIRED" | "TENANT_MEMBERSHIP_REQUIRED" | "TENANT_NOT_ACTIVE" | "TOKEN_EXPIRED" | "TOKEN_INVALID" | "TOKEN_REVOKED" | "USERNAME_TAKEN" | "account_exists_with_different_provider" | "idempotency_secret_not_replayable" | "link_required" | "step_up_required" | (string & {});
|
|
@@ -34818,6 +34817,68 @@ declare class AuthConsumer extends APIResource {
|
|
|
34818
34817
|
verifyEmail(params: VerifyEmailParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerVerify>>;
|
|
34819
34818
|
}
|
|
34820
34819
|
|
|
34820
|
+
/**
|
|
34821
|
+
* Structural copies of the jose types that appear in this package's public
|
|
34822
|
+
* declarations (`AuthGetKeyFn`, `AuthClaims`).
|
|
34823
|
+
*
|
|
34824
|
+
* jose 6 ships ESM-only declarations. If our .d.cts imported them, a
|
|
34825
|
+
* CommonJS consumer on moduleResolution node16/nodenext would get TS1479,
|
|
34826
|
+
* and tsup cannot inline a dependency's types. These copies keep the public
|
|
34827
|
+
* types self-contained; tests/jose-compat.ts proves they stay assignable to
|
|
34828
|
+
* and from jose's own (so `jose.jwtVerify(token, scope.jwks.getKey)` works).
|
|
34829
|
+
*/
|
|
34830
|
+
/** A WebCrypto key, as jose 6 defines it. */
|
|
34831
|
+
type CryptoKey = Extract<Awaited<ReturnType<typeof crypto.subtle.generateKey>>, {
|
|
34832
|
+
type: string;
|
|
34833
|
+
}>;
|
|
34834
|
+
/** JOSE header parameters of a JWS (jose's `JWSHeaderParameters`). */
|
|
34835
|
+
interface JWSHeaderParameters {
|
|
34836
|
+
kid?: string;
|
|
34837
|
+
x5t?: string;
|
|
34838
|
+
x5c?: string[];
|
|
34839
|
+
x5u?: string;
|
|
34840
|
+
jku?: string;
|
|
34841
|
+
jwk?: {
|
|
34842
|
+
kty?: string;
|
|
34843
|
+
crv?: string;
|
|
34844
|
+
x?: string;
|
|
34845
|
+
y?: string;
|
|
34846
|
+
e?: string;
|
|
34847
|
+
n?: string;
|
|
34848
|
+
alg?: string;
|
|
34849
|
+
pub?: string;
|
|
34850
|
+
};
|
|
34851
|
+
typ?: string;
|
|
34852
|
+
cty?: string;
|
|
34853
|
+
alg?: string;
|
|
34854
|
+
b64?: boolean;
|
|
34855
|
+
crit?: string[];
|
|
34856
|
+
[propName: string]: unknown;
|
|
34857
|
+
}
|
|
34858
|
+
/** A JWT's protected header (jose's `JWTHeaderParameters`). */
|
|
34859
|
+
interface JWTHeaderParameters extends JWSHeaderParameters {
|
|
34860
|
+
alg: string;
|
|
34861
|
+
b64?: true;
|
|
34862
|
+
}
|
|
34863
|
+
/** A flattened JWS (jose's `FlattenedJWSInput`). */
|
|
34864
|
+
interface FlattenedJWSInput {
|
|
34865
|
+
header?: JWSHeaderParameters;
|
|
34866
|
+
payload: string | Uint8Array;
|
|
34867
|
+
protected?: string;
|
|
34868
|
+
signature: string;
|
|
34869
|
+
}
|
|
34870
|
+
/** Registered JWT claims, open to any others (jose's `JWTPayload`). */
|
|
34871
|
+
interface JWTPayload {
|
|
34872
|
+
iss?: string;
|
|
34873
|
+
sub?: string;
|
|
34874
|
+
aud?: string | string[];
|
|
34875
|
+
jti?: string;
|
|
34876
|
+
nbf?: number;
|
|
34877
|
+
exp?: number;
|
|
34878
|
+
iat?: number;
|
|
34879
|
+
[propName: string]: unknown;
|
|
34880
|
+
}
|
|
34881
|
+
|
|
34821
34882
|
/**
|
|
34822
34883
|
* In-process JWKS cache for a single app's `/.well-known/jwks.json`.
|
|
34823
34884
|
*
|
package/dist/index.js
CHANGED
|
@@ -5849,7 +5849,7 @@ var WebhookEventStatus = { values: ["pending", "delivered", "failed", "not_sent"
|
|
|
5849
5849
|
var WebhookEventType = { values: ["user.signup", "user.signin", "user.suspended", "user.deactivated", "user.reinstated", "user.role_changed", "user.deleted", "user.contact_verified", "user.email_verified", "user.password_reset.requested", "user.password_reset.completed", "user.mfa.factor_enrolled", "user.mfa.factor_disabled", "user.mfa.recovery_code_used", "user.mfa.step_up_succeeded", "user.mfa.step_up_locked", "user.mfa.enrollment_required", "user.mfa.reenrollment_required", "tenant.created", "tenant.updated", "tenant.deleted", "tenant.member.added", "tenant.member.removed", "tenant.member.role_changed", "tenant.invite.created", "tenant.invite.accepted", "tenant.invite.revoked", "app.slug_changed"] };
|
|
5850
5850
|
|
|
5851
5851
|
// src/_generated/client.ts
|
|
5852
|
-
var VERSION = "1.0.
|
|
5852
|
+
var VERSION = "1.0.1" ;
|
|
5853
5853
|
var Auth = class extends AuthBase {
|
|
5854
5854
|
#openapi;
|
|
5855
5855
|
constructor(options = {}) {
|