@privy-io/api-base 1.6.0 → 1.6.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/cjs/classes/api-error.js +1 -1
- package/dist/cjs/classes/index.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/dts/index.d.mts +4 -1
- package/dist/dts/index.d.ts +4 -1
- package/dist/esm/classes/api-error.mjs +1 -1
- package/dist/esm/classes/index.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
|
|
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 +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.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.TooManyRequestsError=r.TooManyRequestsError,exports.UnauthorizedError=r.UnauthorizedError,exports.UnsupportedMediaType=r.UnsupportedMediaType;
|
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.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.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
|
@@ -158,6 +158,9 @@ declare class TooManyRequestsError extends HttpError {
|
|
|
158
158
|
declare class InsufficientBalanceError extends HttpError {
|
|
159
159
|
constructor(message?: string);
|
|
160
160
|
}
|
|
161
|
+
declare class PaymentFailedError extends HttpError {
|
|
162
|
+
constructor(message?: string);
|
|
163
|
+
}
|
|
161
164
|
declare class InternalServerError extends HttpError {
|
|
162
165
|
constructor(message?: string);
|
|
163
166
|
}
|
|
@@ -202,4 +205,4 @@ declare const APIError: z.ZodObject<{
|
|
|
202
205
|
code?: PrivyErrorCode | undefined;
|
|
203
206
|
}>;
|
|
204
207
|
|
|
205
|
-
export { APIError, AccountTransferRequiredError, AllowlistRejectedError, type ApiErrorType, ForbiddenError, HttpError, InsufficientBalanceError, InternalServerError, InvalidInputError, LegacyInvalidInputError, NotFoundError, PrivyErrorCode, RequestTimeoutError, TooManyRequestsError, UnauthorizedError, UnsupportedMediaType };
|
|
208
|
+
export { APIError, AccountTransferRequiredError, AllowlistRejectedError, type ApiErrorType, ForbiddenError, HttpError, InsufficientBalanceError, InternalServerError, InvalidInputError, LegacyInvalidInputError, NotFoundError, PaymentFailedError, PrivyErrorCode, RequestTimeoutError, TooManyRequestsError, UnauthorizedError, UnsupportedMediaType };
|
package/dist/dts/index.d.ts
CHANGED
|
@@ -158,6 +158,9 @@ declare class TooManyRequestsError extends HttpError {
|
|
|
158
158
|
declare class InsufficientBalanceError extends HttpError {
|
|
159
159
|
constructor(message?: string);
|
|
160
160
|
}
|
|
161
|
+
declare class PaymentFailedError extends HttpError {
|
|
162
|
+
constructor(message?: string);
|
|
163
|
+
}
|
|
161
164
|
declare class InternalServerError extends HttpError {
|
|
162
165
|
constructor(message?: string);
|
|
163
166
|
}
|
|
@@ -202,4 +205,4 @@ declare const APIError: z.ZodObject<{
|
|
|
202
205
|
code?: PrivyErrorCode | undefined;
|
|
203
206
|
}>;
|
|
204
207
|
|
|
205
|
-
export { APIError, AccountTransferRequiredError, AllowlistRejectedError, type ApiErrorType, ForbiddenError, HttpError, InsufficientBalanceError, InternalServerError, InvalidInputError, LegacyInvalidInputError, NotFoundError, PrivyErrorCode, RequestTimeoutError, TooManyRequestsError, UnauthorizedError, UnsupportedMediaType };
|
|
208
|
+
export { APIError, AccountTransferRequiredError, AllowlistRejectedError, type ApiErrorType, ForbiddenError, HttpError, InsufficientBalanceError, InternalServerError, InvalidInputError, LegacyInvalidInputError, NotFoundError, PaymentFailedError, PrivyErrorCode, RequestTimeoutError, TooManyRequestsError, UnauthorizedError, UnsupportedMediaType };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PrivyErrorCode as s}from"../constants/error-codes.mjs";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 a extends r{constructor(s){super(404,s),this.name="NotFoundError"}}class c 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(400,r||"Insufficient balance.",s.INSUFFICIENT_FUNDS),this.name="InsufficientBalanceError"}}class p extends r{constructor(s){super(402,s||"Payment failed.")}}class h extends r{constructor(s){super(500,s||"Service unavailable."),this.name="InternalServerError"}}class E extends r{constructor(r){super(400,"Account transfer required",s.ACCOUNT_TRANSFER_REQUIRED,r),this.data=r,this.name="AccountTransferRequiredError"}}export{E as AccountTransferRequiredError,n as AllowlistRejectedError,o as ForbiddenError,r as HttpError,l as InsufficientBalanceError,h as InternalServerError,e as InvalidInputError,i as LegacyInvalidInputError,a as NotFoundError,p as PaymentFailedError,c as RequestTimeoutError,d as TooManyRequestsError,t as UnauthorizedError,u as UnsupportedMediaType};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AccountTransferRequiredError,AllowlistRejectedError,ForbiddenError,HttpError,InsufficientBalanceError,InternalServerError,InvalidInputError,LegacyInvalidInputError,NotFoundError,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,TooManyRequestsError,UnauthorizedError,UnsupportedMediaType}from"./api-error.mjs";import"../constants/error-codes.mjs";
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AccountTransferRequiredError,AllowlistRejectedError,ForbiddenError,HttpError,InsufficientBalanceError,InternalServerError,InvalidInputError,LegacyInvalidInputError,NotFoundError,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,TooManyRequestsError,UnauthorizedError,UnsupportedMediaType}from"./classes/api-error.mjs";export{PrivyErrorCode}from"./constants/error-codes.mjs";export{APIError}from"./schemas/error.mjs";import"zod";
|