@privy-io/api-base 1.1.0 → 1.1.1-beta-20240530211657

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.d.ts CHANGED
@@ -105,6 +105,9 @@ declare class ForbiddenError extends HttpError {
105
105
  declare class NotFoundError extends HttpError {
106
106
  constructor(message: string);
107
107
  }
108
+ declare class RequestTimeoutError extends HttpError {
109
+ constructor(message: string, errorCode?: PrivyErrorCode);
110
+ }
108
111
  declare class UnsupportedMediaType extends HttpError {
109
112
  constructor(message: string);
110
113
  }
@@ -139,4 +142,4 @@ declare const APIError: z.ZodObject<{
139
142
  code?: PrivyErrorCode | undefined;
140
143
  }>;
141
144
 
142
- export { APIError, AllowlistRejectedError, ApiErrorType, ForbiddenError, HttpError, InternalServerError, InvalidInputError, LegacyInvalidInputError, NotFoundError, PrivyErrorCode, TooManyRequestsError, UnauthorizedError, UnsupportedMediaType };
145
+ export { APIError, AllowlistRejectedError, ApiErrorType, ForbiddenError, HttpError, InternalServerError, InvalidInputError, LegacyInvalidInputError, NotFoundError, PrivyErrorCode, RequestTimeoutError, TooManyRequestsError, UnauthorizedError, UnsupportedMediaType };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var o=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var R=(s,t)=>{for(var e in t)o(s,e,{get:t[e],enumerable:!0})},x=(s,t,e,I)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of m(t))!E.call(s,a)&&a!==e&&o(s,a,{get:()=>t[a],enumerable:!(I=L(t,a))||I.enumerable});return s};var g=s=>x(o({},"__esModule",{value:!0}),s);var U={};R(U,{APIError:()=>d,AllowlistRejectedError:()=>p,ForbiddenError:()=>u,HttpError:()=>n,InternalServerError:()=>S,InvalidInputError:()=>N,LegacyInvalidInputError:()=>D,NotFoundError:()=>O,PrivyErrorCode:()=>c,TooManyRequestsError:()=>T,UnauthorizedError:()=>A,UnsupportedMediaType:()=>l});module.exports=g(U);var c=(_=>(_.OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",_.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_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",_.DISALLOWED_LOGIN_METHOD="disallowed_login_method",_.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",_))(c||{});var n=class extends Error{status;code;constructor(t,e,I){super(e),this.code=I,this.status=t}toString(){return`${this.constructor.name}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},N=class extends n{constructor(t,e){super(400,t,e)}},A=class extends n{constructor(t,e){super(401,t,e)}},p=class extends A{constructor(t){super(t||"User is not allowed to login to this app.","allowlist_rejected")}},u=class extends n{constructor(t,e){super(403,t,e)}},O=class extends n{constructor(t){super(404,t)}},l=class extends n{constructor(t){super(415,t)}},D=class extends n{constructor(t,e){super(422,t,e)}},T=class extends n{constructor(t){super(429,t||"Too many requests. Please wait to try again.","too_many_requests")}},S=class extends n{constructor(t){super(500,t||"Service unavailable.")}};var i=require("zod");var d=i.z.object({error:i.z.string(),cause:i.z.string().optional(),code:i.z.nativeEnum(c).optional()});0&&(module.exports={APIError,AllowlistRejectedError,ForbiddenError,HttpError,InternalServerError,InvalidInputError,LegacyInvalidInputError,NotFoundError,PrivyErrorCode,TooManyRequestsError,UnauthorizedError,UnsupportedMediaType});
1
+ "use strict";var A=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var R=(s,t)=>{for(var e in t)A(s,e,{get:t[e],enumerable:!0})},d=(s,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of m(t))!x.call(s,a)&&a!==e&&A(s,a,{get:()=>t[a],enumerable:!(o=E(t,a))||o.enumerable});return s};var g=s=>d(A({},"__esModule",{value:!0}),s);var h={};R(h,{APIError:()=>U,AllowlistRejectedError:()=>N,ForbiddenError:()=>l,HttpError:()=>n,InternalServerError:()=>L,InvalidInputError:()=>p,LegacyInvalidInputError:()=>T,NotFoundError:()=>u,PrivyErrorCode:()=>c,RequestTimeoutError:()=>O,TooManyRequestsError:()=>S,UnauthorizedError:()=>I,UnsupportedMediaType:()=>D});module.exports=g(h);var c=(_=>(_.OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",_.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_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",_.DISALLOWED_LOGIN_METHOD="disallowed_login_method",_.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",_))(c||{});var n=class extends Error{status;code;constructor(t,e,o){super(e),this.code=o,this.status=t}toString(){return`${this.constructor.name}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},p=class extends n{constructor(t,e){super(400,t,e)}},I=class extends n{constructor(t,e){super(401,t,e)}},N=class extends I{constructor(t){super(t||"User is not allowed to login to this app.","allowlist_rejected")}},l=class extends n{constructor(t,e){super(403,t,e)}},u=class extends n{constructor(t){super(404,t)}},O=class extends n{constructor(t,e){super(408,t,e)}},D=class extends n{constructor(t){super(415,t)}},T=class extends n{constructor(t,e){super(422,t,e)}},S=class extends n{constructor(t){super(429,t||"Too many requests. Please wait to try again.","too_many_requests")}},L=class extends n{constructor(t){super(500,t||"Service unavailable.")}};var i=require("zod");var U=i.z.object({error:i.z.string(),cause:i.z.string().optional(),code:i.z.nativeEnum(c).optional()});0&&(module.exports={APIError,AllowlistRejectedError,ForbiddenError,HttpError,InternalServerError,InvalidInputError,LegacyInvalidInputError,NotFoundError,PrivyErrorCode,RequestTimeoutError,TooManyRequestsError,UnauthorizedError,UnsupportedMediaType});
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- var a=(_=>(_.OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",_.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_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",_.DISALLOWED_LOGIN_METHOD="disallowed_login_method",_.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",_))(a||{});var s=class extends Error{status;code;constructor(t,n,D){super(n),this.code=D,this.status=t}toString(){return`${this.constructor.name}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},I=class extends s{constructor(t,n){super(400,t,n)}},i=class extends s{constructor(t,n){super(401,t,n)}},A=class extends i{constructor(t){super(t||"User is not allowed to login to this app.","allowlist_rejected")}},o=class extends s{constructor(t,n){super(403,t,n)}},N=class extends s{constructor(t){super(404,t)}},p=class extends s{constructor(t){super(415,t)}},u=class extends s{constructor(t,n){super(422,t,n)}},O=class extends s{constructor(t){super(429,t||"Too many requests. Please wait to try again.","too_many_requests")}},l=class extends s{constructor(t){super(500,t||"Service unavailable.")}};import{z as c}from"zod";var U=c.object({error:c.string(),cause:c.string().optional(),code:c.nativeEnum(a).optional()});export{U as APIError,A as AllowlistRejectedError,o as ForbiddenError,s as HttpError,l as InternalServerError,I as InvalidInputError,u as LegacyInvalidInputError,N as NotFoundError,a as PrivyErrorCode,O as TooManyRequestsError,i as UnauthorizedError,p as UnsupportedMediaType};
1
+ var a=(_=>(_.OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",_.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_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",_.DISALLOWED_LOGIN_METHOD="disallowed_login_method",_.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",_))(a||{});var e=class extends Error{status;code;constructor(t,s,T){super(s),this.code=T,this.status=t}toString(){return`${this.constructor.name}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},o=class extends e{constructor(t,s){super(400,t,s)}},i=class extends e{constructor(t,s){super(401,t,s)}},I=class extends i{constructor(t){super(t||"User is not allowed to login to this app.","allowlist_rejected")}},A=class extends e{constructor(t,s){super(403,t,s)}},p=class extends e{constructor(t){super(404,t)}},N=class extends e{constructor(t,s){super(408,t,s)}},l=class extends e{constructor(t){super(415,t)}},u=class extends e{constructor(t,s){super(422,t,s)}},O=class extends e{constructor(t){super(429,t||"Too many requests. Please wait to try again.","too_many_requests")}},D=class extends e{constructor(t){super(500,t||"Service unavailable.")}};import{z as c}from"zod";var h=c.object({error:c.string(),cause:c.string().optional(),code:c.nativeEnum(a).optional()});export{h as APIError,I as AllowlistRejectedError,A as ForbiddenError,e as HttpError,D as InternalServerError,o as InvalidInputError,u as LegacyInvalidInputError,p as NotFoundError,a as PrivyErrorCode,N as RequestTimeoutError,O as TooManyRequestsError,i as UnauthorizedError,l as UnsupportedMediaType};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@privy-io/api-base",
3
- "version": "1.1.0",
3
+ "version": "1.1.1-beta-20240530211657",
4
4
  "engines": {
5
5
  "npm": ">=8.0.0",
6
6
  "node": ">=18.0.0"