@privy-io/api-base 1.6.1 → 1.7.0-beta-20250912184522
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/cjs/classes/api-error.js +1 -1
- package/dist/cjs/classes/index.js +1 -1
- package/dist/cjs/constants/error-codes.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/dts/index.d.mts +9 -2
- package/dist/dts/index.d.ts +9 -2
- package/dist/esm/classes/api-error.mjs +1 -1
- package/dist/esm/classes/index.mjs +1 -1
- package/dist/esm/constants/error-codes.mjs +1 -1
- package/dist/esm/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var r=require("../constants/error-codes.js");class e extends Error{toString(){return`${this.name}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(r,e,s,t){super(e),this.status=r,this.code=s,this.name="HttpError",this.responseData=t}}class s extends e{constructor(r,e){super(401,r,e),this.name="UnauthorizedError"}}exports.AccountTransferRequiredError=class extends e{constructor(e){super(400,"Account transfer required",r.PrivyErrorCode.ACCOUNT_TRANSFER_REQUIRED,e),this.data=e,this.name="AccountTransferRequiredError"}},exports.AllowlistRejectedError=class extends s{constructor(e){super(e||"User is not allowed to login to this app.",r.PrivyErrorCode.ALLOWLIST_REJECTED),this.name="AllowlistRejectedError"}},exports.ForbiddenError=class extends e{constructor(r,e){super(403,r,e),this.name="ForbiddenError"}},exports.HttpError=e,exports.InsufficientBalanceError=class extends e{constructor(e){super(400,e||"Insufficient balance.",r.PrivyErrorCode.INSUFFICIENT_FUNDS),this.name="InsufficientBalanceError"}},exports.InternalServerError=class extends e{constructor(r){super(500,r||"Service unavailable."),this.name="InternalServerError"}},exports.InvalidInputError=class extends e{constructor(e,s){super(400,e,s||r.PrivyErrorCode.INVALID_DATA),this.name="InvalidInputError"}},exports.LegacyInvalidInputError=class extends e{constructor(r,e){super(422,r,e),this.name="LegacyInvalidInputError"}},exports.NotFoundError=class extends e{constructor(r){super(404,r),this.name="NotFoundError"}},exports.PaymentFailedError=class extends e{constructor(r){super(402,r||"Payment failed.")}},exports.RequestTimeoutError=class extends e{constructor(r,e){super(408,r,e),this.name="RequestTimeoutError"}},exports.TooManyRequestsError=class extends e{constructor(e){super(429,e||"Too many requests. Please wait to try again.",r.PrivyErrorCode.TOO_MANY_REQUESTS),this.name="TooManyRequestsError"}},exports.UnauthorizedError=s,exports.UnsupportedMediaType=class extends e{constructor(r){super(415,r),this.name="UnsupportedMediaType"}};
|
|
1
|
+
"use strict";var r=require("../constants/error-codes.js");class e extends Error{toString(){return`${this.name}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(r,e,s,t){super(e),this.status=r,this.code=s,this.name="HttpError",this.responseData=t}}class s extends e{constructor(r,e){super(401,r,e),this.name="UnauthorizedError"}}exports.AccountTransferRequiredError=class extends e{constructor(e){super(400,"Account transfer required",r.PrivyErrorCode.ACCOUNT_TRANSFER_REQUIRED,e),this.data=e,this.name="AccountTransferRequiredError"}},exports.AllowlistRejectedError=class extends s{constructor(e){super(e||"User is not allowed to login to this app.",r.PrivyErrorCode.ALLOWLIST_REJECTED),this.name="AllowlistRejectedError"}},exports.ForbiddenError=class extends e{constructor(r,e){super(403,r,e),this.name="ForbiddenError"}},exports.HttpError=e,exports.InsufficientBalanceError=class extends e{constructor(e){super(400,e||"Insufficient balance.",r.PrivyErrorCode.INSUFFICIENT_FUNDS),this.name="InsufficientBalanceError"}},exports.InternalServerError=class extends e{constructor(r){super(500,r||"Service unavailable."),this.name="InternalServerError"}},exports.InvalidInputError=class extends e{constructor(e,s){super(400,e,s||r.PrivyErrorCode.INVALID_DATA),this.name="InvalidInputError"}},exports.LegacyInvalidInputError=class extends e{constructor(r,e){super(422,r,e),this.name="LegacyInvalidInputError"}},exports.NotFoundError=class extends e{constructor(r){super(404,r),this.name="NotFoundError"}},exports.PaymentFailedError=class extends e{constructor(r){super(402,r||"Payment failed.")}},exports.RequestTimeoutError=class extends e{constructor(r,e){super(408,r,e),this.name="RequestTimeoutError"}},exports.ResourceConflictError=class extends e{constructor(e){super(409,e||"Conflict encountered while trying to modify resource.",r.PrivyErrorCode.RESOURCE_CONFLICT),this.name="ResourceConflictError"}},exports.TooManyRequestsError=class extends e{constructor(e){super(429,e||"Too many requests. Please wait to try again.",r.PrivyErrorCode.TOO_MANY_REQUESTS),this.name="TooManyRequestsError"}},exports.UnauthorizedError=s,exports.UnsupportedMediaType=class extends e{constructor(r){super(415,r),this.name="UnsupportedMediaType"}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var r=require("./api-error.js");require("../constants/error-codes.js"),exports.AccountTransferRequiredError=r.AccountTransferRequiredError,exports.AllowlistRejectedError=r.AllowlistRejectedError,exports.ForbiddenError=r.ForbiddenError,exports.HttpError=r.HttpError,exports.InsufficientBalanceError=r.InsufficientBalanceError,exports.InternalServerError=r.InternalServerError,exports.InvalidInputError=r.InvalidInputError,exports.LegacyInvalidInputError=r.LegacyInvalidInputError,exports.NotFoundError=r.NotFoundError,exports.PaymentFailedError=r.PaymentFailedError,exports.RequestTimeoutError=r.RequestTimeoutError,exports.TooManyRequestsError=r.TooManyRequestsError,exports.UnauthorizedError=r.UnauthorizedError,exports.UnsupportedMediaType=r.UnsupportedMediaType;
|
|
1
|
+
"use strict";var r=require("./api-error.js");require("../constants/error-codes.js"),exports.AccountTransferRequiredError=r.AccountTransferRequiredError,exports.AllowlistRejectedError=r.AllowlistRejectedError,exports.ForbiddenError=r.ForbiddenError,exports.HttpError=r.HttpError,exports.InsufficientBalanceError=r.InsufficientBalanceError,exports.InternalServerError=r.InternalServerError,exports.InvalidInputError=r.InvalidInputError,exports.LegacyInvalidInputError=r.LegacyInvalidInputError,exports.NotFoundError=r.NotFoundError,exports.PaymentFailedError=r.PaymentFailedError,exports.RequestTimeoutError=r.RequestTimeoutError,exports.ResourceConflictError=r.ResourceConflictError,exports.TooManyRequestsError=r.TooManyRequestsError,exports.UnauthorizedError=r.UnauthorizedError,exports.UnsupportedMediaType=r.UnsupportedMediaType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var _,e=((_={}).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",_.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",_.MISSING_OR_INVALID_PRIVY_CLIENT_ID="missing_or_invalid_privy_client_id",_.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",_.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",_.MISSING_OR_INVALID_MFA="missing_or_invalid_mfa",_.EXPIRED_OR_INVALID_MFA_TOKEN="expired_or_invalid_mfa_token",_.INVALID_DATA="invalid_data",_.INVALID_CREDENTIALS="invalid_credentials",_.INVALID_CAPTCHA="invalid_captcha",_.LINKED_TO_ANOTHER_USER="linked_to_another_user",_.ALLOWLIST_REJECTED="allowlist_rejected",_.CANNOT_UNLINK_EMBEDDED_WALLET="cannot_unlink_embedded_wallet",_.CANNOT_UNLINK_SOLE_ACCOUNT="cannot_unlink_sole_account",_.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",_.LINKED_ACCOUNT_NOT_FOUND="linked_account_not_found",_.TOO_MANY_REQUESTS="too_many_requests",_.INVALID_ORIGIN="invalid_origin",_.MISSING_ORIGIN="missing_origin",_.INVALID_NATIVE_APP_ID="invalid_native_app_id",_.TOKEN_ALREADY_USED="token_already_used",_.ALREADY_LOGGED_OUT="already_logged_out",_.NOT_SUPPORTED="not_supported",_.USER_UNSUBSCRIBED="user_unsubscribed",_.MAX_APPS_REACHED="max_apps_reached",_.USER_LIMIT_REACHED="max_accounts_reached",_.DEVICE_REVOKED="device_revoked",_.WALLET_PASSWORD_EXISTS="wallet_password_exists",_.OAUTH_STATE_MISMATCH="oauth_state_mismatch",_.MAX_DENYLIST_ENTRIES_REACHED="max_denylist_entries_reached",_.MAX_TEST_ACCOUNTS_REACHED="max_test_accounts_reached",_.DISALLOWED_LOGIN_METHOD="disallowed_login_method",_.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",_.DISALLOWED_RECOVERY_METHOD="disallowed_recovery_method",_.LEGACY_DASHBOARD_LOGIN_CONFIGURATION="legacy_dashboard_login_configuration",_.CANNOT_SET_PASSWORD="cannot_set_password",_.INVALID_PKCE_PARAMETERS="invalid_pkce_parameters",_.INVALID_APP_URL_SCHEME_CONFIGURATION="invalid_app_url_scheme_configuration",_.CROSS_APP_CONNECTION_NOT_ALLOWED="cross_app_connection_not_allowed",_.USER_DOES_NOT_EXIST="user_does_not_exist",_.ALREADY_EXISTS="resource_already_exists",_.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",_.USER_HAS_NOT_DELEGATED_WALLET="user_has_not_delegated_wallet",_.FEATURE_NOT_ENABLED="feature_not_enabled",_.INSUFFICIENT_FUNDS="insufficient_funds",_.TRANSACTION_BROADCAST_FAILURE="transaction_broadcast_failure",_.INVALID_POLICY_FORMAT="invalid_policy_format",_.POLICY_VIOLATION="policy_violation",_.AUTHORIZATION_KEY_HAS_ASSOCIATED_WALLETS="authorization_key_has_associated_wallets",_.INVALID_REQUEST="invalid_request",_);exports.PrivyErrorCode=e;
|
|
1
|
+
"use strict";var _,e=((_={}).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",_.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",_.MISSING_OR_INVALID_PRIVY_CLIENT_ID="missing_or_invalid_privy_client_id",_.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",_.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",_.MISSING_OR_INVALID_MFA="missing_or_invalid_mfa",_.EXPIRED_OR_INVALID_MFA_TOKEN="expired_or_invalid_mfa_token",_.INVALID_DATA="invalid_data",_.INVALID_CREDENTIALS="invalid_credentials",_.INVALID_CAPTCHA="invalid_captcha",_.LINKED_TO_ANOTHER_USER="linked_to_another_user",_.ALLOWLIST_REJECTED="allowlist_rejected",_.CANNOT_UNLINK_EMBEDDED_WALLET="cannot_unlink_embedded_wallet",_.CANNOT_UNLINK_SOLE_ACCOUNT="cannot_unlink_sole_account",_.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",_.LINKED_ACCOUNT_NOT_FOUND="linked_account_not_found",_.TOO_MANY_REQUESTS="too_many_requests",_.RESOURCE_CONFLICT="resource_conflict",_.INVALID_ORIGIN="invalid_origin",_.MISSING_ORIGIN="missing_origin",_.INVALID_NATIVE_APP_ID="invalid_native_app_id",_.TOKEN_ALREADY_USED="token_already_used",_.ALREADY_LOGGED_OUT="already_logged_out",_.NOT_SUPPORTED="not_supported",_.USER_UNSUBSCRIBED="user_unsubscribed",_.MAX_APPS_REACHED="max_apps_reached",_.USER_LIMIT_REACHED="max_accounts_reached",_.DEVICE_REVOKED="device_revoked",_.WALLET_PASSWORD_EXISTS="wallet_password_exists",_.OAUTH_STATE_MISMATCH="oauth_state_mismatch",_.MAX_DENYLIST_ENTRIES_REACHED="max_denylist_entries_reached",_.MAX_TEST_ACCOUNTS_REACHED="max_test_accounts_reached",_.DISALLOWED_LOGIN_METHOD="disallowed_login_method",_.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",_.DISALLOWED_RECOVERY_METHOD="disallowed_recovery_method",_.LEGACY_DASHBOARD_LOGIN_CONFIGURATION="legacy_dashboard_login_configuration",_.CANNOT_SET_PASSWORD="cannot_set_password",_.INVALID_PKCE_PARAMETERS="invalid_pkce_parameters",_.INVALID_APP_URL_SCHEME_CONFIGURATION="invalid_app_url_scheme_configuration",_.CROSS_APP_CONNECTION_NOT_ALLOWED="cross_app_connection_not_allowed",_.USER_DOES_NOT_EXIST="user_does_not_exist",_.ALREADY_EXISTS="resource_already_exists",_.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",_.USER_HAS_NOT_DELEGATED_WALLET="user_has_not_delegated_wallet",_.FEATURE_NOT_ENABLED="feature_not_enabled",_.INSUFFICIENT_FUNDS="insufficient_funds",_.TRANSACTION_BROADCAST_FAILURE="transaction_broadcast_failure",_.INVALID_POLICY_FORMAT="invalid_policy_format",_.POLICY_VIOLATION="policy_violation",_.AUTHORIZATION_KEY_HAS_ASSOCIATED_WALLETS="authorization_key_has_associated_wallets",_.INVALID_REQUEST="invalid_request",_.SIGNUP_DISABLED="signup_disabled",_);exports.PrivyErrorCode=e;
|
package/dist/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var r=require("./classes/api-error.js"),e=require("./constants/error-codes.js"),o=require("./schemas/error.js");require("zod"),exports.AccountTransferRequiredError=r.AccountTransferRequiredError,exports.AllowlistRejectedError=r.AllowlistRejectedError,exports.ForbiddenError=r.ForbiddenError,exports.HttpError=r.HttpError,exports.InsufficientBalanceError=r.InsufficientBalanceError,exports.InternalServerError=r.InternalServerError,exports.InvalidInputError=r.InvalidInputError,exports.LegacyInvalidInputError=r.LegacyInvalidInputError,exports.NotFoundError=r.NotFoundError,exports.PaymentFailedError=r.PaymentFailedError,exports.RequestTimeoutError=r.RequestTimeoutError,exports.TooManyRequestsError=r.TooManyRequestsError,exports.UnauthorizedError=r.UnauthorizedError,exports.UnsupportedMediaType=r.UnsupportedMediaType,exports.PrivyErrorCode=e.PrivyErrorCode,exports.APIError=o.APIError;
|
|
1
|
+
"use strict";var r=require("./classes/api-error.js"),e=require("./constants/error-codes.js"),o=require("./schemas/error.js");require("zod"),exports.AccountTransferRequiredError=r.AccountTransferRequiredError,exports.AllowlistRejectedError=r.AllowlistRejectedError,exports.ForbiddenError=r.ForbiddenError,exports.HttpError=r.HttpError,exports.InsufficientBalanceError=r.InsufficientBalanceError,exports.InternalServerError=r.InternalServerError,exports.InvalidInputError=r.InvalidInputError,exports.LegacyInvalidInputError=r.LegacyInvalidInputError,exports.NotFoundError=r.NotFoundError,exports.PaymentFailedError=r.PaymentFailedError,exports.RequestTimeoutError=r.RequestTimeoutError,exports.ResourceConflictError=r.ResourceConflictError,exports.TooManyRequestsError=r.TooManyRequestsError,exports.UnauthorizedError=r.UnauthorizedError,exports.UnsupportedMediaType=r.UnsupportedMediaType,exports.PrivyErrorCode=e.PrivyErrorCode,exports.APIError=o.APIError;
|
package/dist/dts/index.d.mts
CHANGED
|
@@ -35,6 +35,8 @@ declare enum PrivyErrorCode {
|
|
|
35
35
|
LINKED_ACCOUNT_NOT_FOUND = "linked_account_not_found",
|
|
36
36
|
/** Too many requests. Please wait to try again. */
|
|
37
37
|
TOO_MANY_REQUESTS = "too_many_requests",
|
|
38
|
+
/** Conflict encountered while trying to update resource. */
|
|
39
|
+
RESOURCE_CONFLICT = "resource_conflict",
|
|
38
40
|
/** Origin was expected and is invalid. */
|
|
39
41
|
INVALID_ORIGIN = "invalid_origin",
|
|
40
42
|
/** Origin was expected and is not set. */
|
|
@@ -99,7 +101,9 @@ declare enum PrivyErrorCode {
|
|
|
99
101
|
/** Authorization key has associated wallets */
|
|
100
102
|
AUTHORIZATION_KEY_HAS_ASSOCIATED_WALLETS = "authorization_key_has_associated_wallets",
|
|
101
103
|
/** Invalid request */
|
|
102
|
-
INVALID_REQUEST = "invalid_request"
|
|
104
|
+
INVALID_REQUEST = "invalid_request",
|
|
105
|
+
/** User sign ups are suspended for this account. */
|
|
106
|
+
SIGNUP_DISABLED = "signup_disabled"
|
|
103
107
|
}
|
|
104
108
|
|
|
105
109
|
type ApiErrorType = {
|
|
@@ -155,6 +159,9 @@ declare class LegacyInvalidInputError extends HttpError {
|
|
|
155
159
|
declare class TooManyRequestsError extends HttpError {
|
|
156
160
|
constructor(message?: string);
|
|
157
161
|
}
|
|
162
|
+
declare class ResourceConflictError extends HttpError {
|
|
163
|
+
constructor(message?: string);
|
|
164
|
+
}
|
|
158
165
|
declare class InsufficientBalanceError extends HttpError {
|
|
159
166
|
constructor(message?: string);
|
|
160
167
|
}
|
|
@@ -205,4 +212,4 @@ declare const APIError: z.ZodObject<{
|
|
|
205
212
|
code?: PrivyErrorCode | undefined;
|
|
206
213
|
}>;
|
|
207
214
|
|
|
208
|
-
export { APIError, AccountTransferRequiredError, AllowlistRejectedError, type ApiErrorType, ForbiddenError, HttpError, InsufficientBalanceError, InternalServerError, InvalidInputError, LegacyInvalidInputError, NotFoundError, PaymentFailedError, PrivyErrorCode, RequestTimeoutError, TooManyRequestsError, UnauthorizedError, UnsupportedMediaType };
|
|
215
|
+
export { APIError, AccountTransferRequiredError, AllowlistRejectedError, type ApiErrorType, ForbiddenError, HttpError, InsufficientBalanceError, InternalServerError, InvalidInputError, LegacyInvalidInputError, NotFoundError, PaymentFailedError, PrivyErrorCode, RequestTimeoutError, ResourceConflictError, TooManyRequestsError, UnauthorizedError, UnsupportedMediaType };
|
package/dist/dts/index.d.ts
CHANGED
|
@@ -35,6 +35,8 @@ declare enum PrivyErrorCode {
|
|
|
35
35
|
LINKED_ACCOUNT_NOT_FOUND = "linked_account_not_found",
|
|
36
36
|
/** Too many requests. Please wait to try again. */
|
|
37
37
|
TOO_MANY_REQUESTS = "too_many_requests",
|
|
38
|
+
/** Conflict encountered while trying to update resource. */
|
|
39
|
+
RESOURCE_CONFLICT = "resource_conflict",
|
|
38
40
|
/** Origin was expected and is invalid. */
|
|
39
41
|
INVALID_ORIGIN = "invalid_origin",
|
|
40
42
|
/** Origin was expected and is not set. */
|
|
@@ -99,7 +101,9 @@ declare enum PrivyErrorCode {
|
|
|
99
101
|
/** Authorization key has associated wallets */
|
|
100
102
|
AUTHORIZATION_KEY_HAS_ASSOCIATED_WALLETS = "authorization_key_has_associated_wallets",
|
|
101
103
|
/** Invalid request */
|
|
102
|
-
INVALID_REQUEST = "invalid_request"
|
|
104
|
+
INVALID_REQUEST = "invalid_request",
|
|
105
|
+
/** User sign ups are suspended for this account. */
|
|
106
|
+
SIGNUP_DISABLED = "signup_disabled"
|
|
103
107
|
}
|
|
104
108
|
|
|
105
109
|
type ApiErrorType = {
|
|
@@ -155,6 +159,9 @@ declare class LegacyInvalidInputError extends HttpError {
|
|
|
155
159
|
declare class TooManyRequestsError extends HttpError {
|
|
156
160
|
constructor(message?: string);
|
|
157
161
|
}
|
|
162
|
+
declare class ResourceConflictError extends HttpError {
|
|
163
|
+
constructor(message?: string);
|
|
164
|
+
}
|
|
158
165
|
declare class InsufficientBalanceError extends HttpError {
|
|
159
166
|
constructor(message?: string);
|
|
160
167
|
}
|
|
@@ -205,4 +212,4 @@ declare const APIError: z.ZodObject<{
|
|
|
205
212
|
code?: PrivyErrorCode | undefined;
|
|
206
213
|
}>;
|
|
207
214
|
|
|
208
|
-
export { APIError, AccountTransferRequiredError, AllowlistRejectedError, type ApiErrorType, ForbiddenError, HttpError, InsufficientBalanceError, InternalServerError, InvalidInputError, LegacyInvalidInputError, NotFoundError, PaymentFailedError, PrivyErrorCode, RequestTimeoutError, TooManyRequestsError, UnauthorizedError, UnsupportedMediaType };
|
|
215
|
+
export { APIError, AccountTransferRequiredError, AllowlistRejectedError, type ApiErrorType, ForbiddenError, HttpError, InsufficientBalanceError, InternalServerError, InvalidInputError, LegacyInvalidInputError, NotFoundError, PaymentFailedError, PrivyErrorCode, RequestTimeoutError, ResourceConflictError, TooManyRequestsError, UnauthorizedError, UnsupportedMediaType };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PrivyErrorCode as s}from"../constants/error-codes.mjs";class r extends Error{toString(){return`${this.name}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(s,r,e,t){super(r),this.status=s,this.code=e,this.name="HttpError",this.responseData=t}}class e extends r{constructor(r,e){super(400,r,e||s.INVALID_DATA),this.name="InvalidInputError"}}class t extends r{constructor(s,r){super(401,s,r),this.name="UnauthorizedError"}}class n extends t{constructor(r){super(r||"User is not allowed to login to this app.",s.ALLOWLIST_REJECTED),this.name="AllowlistRejectedError"}}class o extends r{constructor(s,r){super(403,s,r),this.name="ForbiddenError"}}class
|
|
1
|
+
import{PrivyErrorCode as s}from"../constants/error-codes.mjs";class r extends Error{toString(){return`${this.name}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(s,r,e,t){super(r),this.status=s,this.code=e,this.name="HttpError",this.responseData=t}}class e extends r{constructor(r,e){super(400,r,e||s.INVALID_DATA),this.name="InvalidInputError"}}class t extends r{constructor(s,r){super(401,s,r),this.name="UnauthorizedError"}}class n extends t{constructor(r){super(r||"User is not allowed to login to this app.",s.ALLOWLIST_REJECTED),this.name="AllowlistRejectedError"}}class o extends r{constructor(s,r){super(403,s,r),this.name="ForbiddenError"}}class c extends r{constructor(s){super(404,s),this.name="NotFoundError"}}class a extends r{constructor(s,r){super(408,s,r),this.name="RequestTimeoutError"}}class u extends r{constructor(s){super(415,s),this.name="UnsupportedMediaType"}}class i extends r{constructor(s,r){super(422,s,r),this.name="LegacyInvalidInputError"}}class d extends r{constructor(r){super(429,r||"Too many requests. Please wait to try again.",s.TOO_MANY_REQUESTS),this.name="TooManyRequestsError"}}class l extends r{constructor(r){super(409,r||"Conflict encountered while trying to modify resource.",s.RESOURCE_CONFLICT),this.name="ResourceConflictError"}}class p extends r{constructor(r){super(400,r||"Insufficient balance.",s.INSUFFICIENT_FUNDS),this.name="InsufficientBalanceError"}}class h extends r{constructor(s){super(402,s||"Payment failed.")}}class E extends r{constructor(s){super(500,s||"Service unavailable."),this.name="InternalServerError"}}class m extends r{constructor(r){super(400,"Account transfer required",s.ACCOUNT_TRANSFER_REQUIRED,r),this.data=r,this.name="AccountTransferRequiredError"}}export{m as AccountTransferRequiredError,n as AllowlistRejectedError,o as ForbiddenError,r as HttpError,p as InsufficientBalanceError,E as InternalServerError,e as InvalidInputError,i as LegacyInvalidInputError,c as NotFoundError,h as PaymentFailedError,a as RequestTimeoutError,l as ResourceConflictError,d as TooManyRequestsError,t as UnauthorizedError,u as UnsupportedMediaType};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AccountTransferRequiredError,AllowlistRejectedError,ForbiddenError,HttpError,InsufficientBalanceError,InternalServerError,InvalidInputError,LegacyInvalidInputError,NotFoundError,PaymentFailedError,RequestTimeoutError,TooManyRequestsError,UnauthorizedError,UnsupportedMediaType}from"./api-error.mjs";import"../constants/error-codes.mjs";
|
|
1
|
+
export{AccountTransferRequiredError,AllowlistRejectedError,ForbiddenError,HttpError,InsufficientBalanceError,InternalServerError,InvalidInputError,LegacyInvalidInputError,NotFoundError,PaymentFailedError,RequestTimeoutError,ResourceConflictError,TooManyRequestsError,UnauthorizedError,UnsupportedMediaType}from"./api-error.mjs";import"../constants/error-codes.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _,e=((_={}).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",_.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",_.MISSING_OR_INVALID_PRIVY_CLIENT_ID="missing_or_invalid_privy_client_id",_.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",_.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",_.MISSING_OR_INVALID_MFA="missing_or_invalid_mfa",_.EXPIRED_OR_INVALID_MFA_TOKEN="expired_or_invalid_mfa_token",_.INVALID_DATA="invalid_data",_.INVALID_CREDENTIALS="invalid_credentials",_.INVALID_CAPTCHA="invalid_captcha",_.LINKED_TO_ANOTHER_USER="linked_to_another_user",_.ALLOWLIST_REJECTED="allowlist_rejected",_.CANNOT_UNLINK_EMBEDDED_WALLET="cannot_unlink_embedded_wallet",_.CANNOT_UNLINK_SOLE_ACCOUNT="cannot_unlink_sole_account",_.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",_.LINKED_ACCOUNT_NOT_FOUND="linked_account_not_found",_.TOO_MANY_REQUESTS="too_many_requests",_.INVALID_ORIGIN="invalid_origin",_.MISSING_ORIGIN="missing_origin",_.INVALID_NATIVE_APP_ID="invalid_native_app_id",_.TOKEN_ALREADY_USED="token_already_used",_.ALREADY_LOGGED_OUT="already_logged_out",_.NOT_SUPPORTED="not_supported",_.USER_UNSUBSCRIBED="user_unsubscribed",_.MAX_APPS_REACHED="max_apps_reached",_.USER_LIMIT_REACHED="max_accounts_reached",_.DEVICE_REVOKED="device_revoked",_.WALLET_PASSWORD_EXISTS="wallet_password_exists",_.OAUTH_STATE_MISMATCH="oauth_state_mismatch",_.MAX_DENYLIST_ENTRIES_REACHED="max_denylist_entries_reached",_.MAX_TEST_ACCOUNTS_REACHED="max_test_accounts_reached",_.DISALLOWED_LOGIN_METHOD="disallowed_login_method",_.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",_.DISALLOWED_RECOVERY_METHOD="disallowed_recovery_method",_.LEGACY_DASHBOARD_LOGIN_CONFIGURATION="legacy_dashboard_login_configuration",_.CANNOT_SET_PASSWORD="cannot_set_password",_.INVALID_PKCE_PARAMETERS="invalid_pkce_parameters",_.INVALID_APP_URL_SCHEME_CONFIGURATION="invalid_app_url_scheme_configuration",_.CROSS_APP_CONNECTION_NOT_ALLOWED="cross_app_connection_not_allowed",_.USER_DOES_NOT_EXIST="user_does_not_exist",_.ALREADY_EXISTS="resource_already_exists",_.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",_.USER_HAS_NOT_DELEGATED_WALLET="user_has_not_delegated_wallet",_.FEATURE_NOT_ENABLED="feature_not_enabled",_.INSUFFICIENT_FUNDS="insufficient_funds",_.TRANSACTION_BROADCAST_FAILURE="transaction_broadcast_failure",_.INVALID_POLICY_FORMAT="invalid_policy_format",_.POLICY_VIOLATION="policy_violation",_.AUTHORIZATION_KEY_HAS_ASSOCIATED_WALLETS="authorization_key_has_associated_wallets",_.INVALID_REQUEST="invalid_request",_);export{e as PrivyErrorCode};
|
|
1
|
+
var _,e=((_={}).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",_.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",_.MISSING_OR_INVALID_PRIVY_CLIENT_ID="missing_or_invalid_privy_client_id",_.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",_.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",_.MISSING_OR_INVALID_MFA="missing_or_invalid_mfa",_.EXPIRED_OR_INVALID_MFA_TOKEN="expired_or_invalid_mfa_token",_.INVALID_DATA="invalid_data",_.INVALID_CREDENTIALS="invalid_credentials",_.INVALID_CAPTCHA="invalid_captcha",_.LINKED_TO_ANOTHER_USER="linked_to_another_user",_.ALLOWLIST_REJECTED="allowlist_rejected",_.CANNOT_UNLINK_EMBEDDED_WALLET="cannot_unlink_embedded_wallet",_.CANNOT_UNLINK_SOLE_ACCOUNT="cannot_unlink_sole_account",_.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",_.LINKED_ACCOUNT_NOT_FOUND="linked_account_not_found",_.TOO_MANY_REQUESTS="too_many_requests",_.RESOURCE_CONFLICT="resource_conflict",_.INVALID_ORIGIN="invalid_origin",_.MISSING_ORIGIN="missing_origin",_.INVALID_NATIVE_APP_ID="invalid_native_app_id",_.TOKEN_ALREADY_USED="token_already_used",_.ALREADY_LOGGED_OUT="already_logged_out",_.NOT_SUPPORTED="not_supported",_.USER_UNSUBSCRIBED="user_unsubscribed",_.MAX_APPS_REACHED="max_apps_reached",_.USER_LIMIT_REACHED="max_accounts_reached",_.DEVICE_REVOKED="device_revoked",_.WALLET_PASSWORD_EXISTS="wallet_password_exists",_.OAUTH_STATE_MISMATCH="oauth_state_mismatch",_.MAX_DENYLIST_ENTRIES_REACHED="max_denylist_entries_reached",_.MAX_TEST_ACCOUNTS_REACHED="max_test_accounts_reached",_.DISALLOWED_LOGIN_METHOD="disallowed_login_method",_.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",_.DISALLOWED_RECOVERY_METHOD="disallowed_recovery_method",_.LEGACY_DASHBOARD_LOGIN_CONFIGURATION="legacy_dashboard_login_configuration",_.CANNOT_SET_PASSWORD="cannot_set_password",_.INVALID_PKCE_PARAMETERS="invalid_pkce_parameters",_.INVALID_APP_URL_SCHEME_CONFIGURATION="invalid_app_url_scheme_configuration",_.CROSS_APP_CONNECTION_NOT_ALLOWED="cross_app_connection_not_allowed",_.USER_DOES_NOT_EXIST="user_does_not_exist",_.ALREADY_EXISTS="resource_already_exists",_.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",_.USER_HAS_NOT_DELEGATED_WALLET="user_has_not_delegated_wallet",_.FEATURE_NOT_ENABLED="feature_not_enabled",_.INSUFFICIENT_FUNDS="insufficient_funds",_.TRANSACTION_BROADCAST_FAILURE="transaction_broadcast_failure",_.INVALID_POLICY_FORMAT="invalid_policy_format",_.POLICY_VIOLATION="policy_violation",_.AUTHORIZATION_KEY_HAS_ASSOCIATED_WALLETS="authorization_key_has_associated_wallets",_.INVALID_REQUEST="invalid_request",_.SIGNUP_DISABLED="signup_disabled",_);export{e as PrivyErrorCode};
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AccountTransferRequiredError,AllowlistRejectedError,ForbiddenError,HttpError,InsufficientBalanceError,InternalServerError,InvalidInputError,LegacyInvalidInputError,NotFoundError,PaymentFailedError,RequestTimeoutError,TooManyRequestsError,UnauthorizedError,UnsupportedMediaType}from"./classes/api-error.mjs";export{PrivyErrorCode}from"./constants/error-codes.mjs";export{APIError}from"./schemas/error.mjs";import"zod";
|
|
1
|
+
export{AccountTransferRequiredError,AllowlistRejectedError,ForbiddenError,HttpError,InsufficientBalanceError,InternalServerError,InvalidInputError,LegacyInvalidInputError,NotFoundError,PaymentFailedError,RequestTimeoutError,ResourceConflictError,TooManyRequestsError,UnauthorizedError,UnsupportedMediaType}from"./classes/api-error.mjs";export{PrivyErrorCode}from"./constants/error-codes.mjs";export{APIError}from"./schemas/error.mjs";import"zod";
|