@zyphr-dev/node-sdk 0.1.25 → 0.1.26

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.js CHANGED
@@ -5995,6 +5995,101 @@ function PasswordRequirementsResponseToJSONTyped(value, ignoreDiscriminator = fa
5995
5995
  };
5996
5996
  }
5997
5997
 
5998
+ // src/src/models/PayloadTooLargeErrorErrorDetails.ts
5999
+ function instanceOfPayloadTooLargeErrorErrorDetails(value) {
6000
+ return true;
6001
+ }
6002
+ function PayloadTooLargeErrorErrorDetailsFromJSON(json) {
6003
+ return PayloadTooLargeErrorErrorDetailsFromJSONTyped(json, false);
6004
+ }
6005
+ function PayloadTooLargeErrorErrorDetailsFromJSONTyped(json, ignoreDiscriminator) {
6006
+ if (json == null) {
6007
+ return json;
6008
+ }
6009
+ return {
6010
+ "limitBytes": json["limit_bytes"] == null ? void 0 : json["limit_bytes"],
6011
+ "receivedBytes": json["received_bytes"] == null ? void 0 : json["received_bytes"]
6012
+ };
6013
+ }
6014
+ function PayloadTooLargeErrorErrorDetailsToJSON(json) {
6015
+ return PayloadTooLargeErrorErrorDetailsToJSONTyped(json, false);
6016
+ }
6017
+ function PayloadTooLargeErrorErrorDetailsToJSONTyped(value, ignoreDiscriminator = false) {
6018
+ if (value == null) {
6019
+ return value;
6020
+ }
6021
+ return {
6022
+ "limit_bytes": value["limitBytes"],
6023
+ "received_bytes": value["receivedBytes"]
6024
+ };
6025
+ }
6026
+
6027
+ // src/src/models/PayloadTooLargeErrorError.ts
6028
+ var PayloadTooLargeErrorErrorCodeEnum = {
6029
+ PAYLOAD_TOO_LARGE: "payload_too_large"
6030
+ };
6031
+ function instanceOfPayloadTooLargeErrorError(value) {
6032
+ if (!("code" in value) || value["code"] === void 0) return false;
6033
+ if (!("message" in value) || value["message"] === void 0) return false;
6034
+ return true;
6035
+ }
6036
+ function PayloadTooLargeErrorErrorFromJSON(json) {
6037
+ return PayloadTooLargeErrorErrorFromJSONTyped(json, false);
6038
+ }
6039
+ function PayloadTooLargeErrorErrorFromJSONTyped(json, ignoreDiscriminator) {
6040
+ if (json == null) {
6041
+ return json;
6042
+ }
6043
+ return {
6044
+ "code": json["code"],
6045
+ "message": json["message"],
6046
+ "details": json["details"] == null ? void 0 : PayloadTooLargeErrorErrorDetailsFromJSON(json["details"])
6047
+ };
6048
+ }
6049
+ function PayloadTooLargeErrorErrorToJSON(json) {
6050
+ return PayloadTooLargeErrorErrorToJSONTyped(json, false);
6051
+ }
6052
+ function PayloadTooLargeErrorErrorToJSONTyped(value, ignoreDiscriminator = false) {
6053
+ if (value == null) {
6054
+ return value;
6055
+ }
6056
+ return {
6057
+ "code": value["code"],
6058
+ "message": value["message"],
6059
+ "details": PayloadTooLargeErrorErrorDetailsToJSON(value["details"])
6060
+ };
6061
+ }
6062
+
6063
+ // src/src/models/PayloadTooLargeError.ts
6064
+ function instanceOfPayloadTooLargeError(value) {
6065
+ if (!("error" in value) || value["error"] === void 0) return false;
6066
+ return true;
6067
+ }
6068
+ function PayloadTooLargeErrorFromJSON(json) {
6069
+ return PayloadTooLargeErrorFromJSONTyped(json, false);
6070
+ }
6071
+ function PayloadTooLargeErrorFromJSONTyped(json, ignoreDiscriminator) {
6072
+ if (json == null) {
6073
+ return json;
6074
+ }
6075
+ return {
6076
+ "error": PayloadTooLargeErrorErrorFromJSON(json["error"]),
6077
+ "meta": json["meta"] == null ? void 0 : RequestMetaFromJSON(json["meta"])
6078
+ };
6079
+ }
6080
+ function PayloadTooLargeErrorToJSON(json) {
6081
+ return PayloadTooLargeErrorToJSONTyped(json, false);
6082
+ }
6083
+ function PayloadTooLargeErrorToJSONTyped(value, ignoreDiscriminator = false) {
6084
+ if (value == null) {
6085
+ return value;
6086
+ }
6087
+ return {
6088
+ "error": PayloadTooLargeErrorErrorToJSON(value["error"]),
6089
+ "meta": RequestMetaToJSON(value["meta"])
6090
+ };
6091
+ }
6092
+
5998
6093
  // src/src/models/PhoneAuthAvailabilityResponseData.ts
5999
6094
  function instanceOfPhoneAuthAvailabilityResponseData(value) {
6000
6095
  return true;
@@ -20113,6 +20208,22 @@ var ZyphrNotFoundError = class extends ZyphrError {
20113
20208
  this.name = "ZyphrNotFoundError";
20114
20209
  }
20115
20210
  };
20211
+ var ZyphrPayloadTooLargeError = class extends ZyphrError {
20212
+ constructor(message, details, requestId) {
20213
+ super({ message, status: 413, code: "payload_too_large", details, requestId });
20214
+ this.name = "ZyphrPayloadTooLargeError";
20215
+ }
20216
+ /** Maximum allowed request body size in bytes (server-enforced). */
20217
+ get limitBytes() {
20218
+ const value = this.details?.limit_bytes;
20219
+ return typeof value === "number" ? value : void 0;
20220
+ }
20221
+ /** Size of the rejected request body in bytes, as measured by the server. */
20222
+ get receivedBytes() {
20223
+ const value = this.details?.received_bytes;
20224
+ return typeof value === "number" ? value : void 0;
20225
+ }
20226
+ };
20116
20227
  var ZyphrWebhookVerificationError = class extends ZyphrError {
20117
20228
  constructor(message) {
20118
20229
  super({ message, status: 401, code: "webhook_verification_failed" });
@@ -20141,6 +20252,8 @@ async function parseErrorResponse(response) {
20141
20252
  return new ZyphrAuthenticationError(message);
20142
20253
  case 404:
20143
20254
  return new ZyphrNotFoundError(message);
20255
+ case 413:
20256
+ return new ZyphrPayloadTooLargeError(message, details, requestId);
20144
20257
  case 429: {
20145
20258
  const retryAfterHeader = response.headers.get("Retry-After");
20146
20259
  const retryAfter = retryAfterHeader ? parseInt(retryAfterHeader, 10) : void 0;
@@ -20939,6 +21052,19 @@ export {
20939
21052
  PasswordRequirementsResponseToJSONTyped,
20940
21053
  PasswordRequirementsToJSON,
20941
21054
  PasswordRequirementsToJSONTyped,
21055
+ PayloadTooLargeErrorErrorCodeEnum,
21056
+ PayloadTooLargeErrorErrorDetailsFromJSON,
21057
+ PayloadTooLargeErrorErrorDetailsFromJSONTyped,
21058
+ PayloadTooLargeErrorErrorDetailsToJSON,
21059
+ PayloadTooLargeErrorErrorDetailsToJSONTyped,
21060
+ PayloadTooLargeErrorErrorFromJSON,
21061
+ PayloadTooLargeErrorErrorFromJSONTyped,
21062
+ PayloadTooLargeErrorErrorToJSON,
21063
+ PayloadTooLargeErrorErrorToJSONTyped,
21064
+ PayloadTooLargeErrorFromJSON,
21065
+ PayloadTooLargeErrorFromJSONTyped,
21066
+ PayloadTooLargeErrorToJSON,
21067
+ PayloadTooLargeErrorToJSONTyped,
20942
21068
  PhoneAuthAvailabilityResponseDataFromJSON,
20943
21069
  PhoneAuthAvailabilityResponseDataFromJSONTyped,
20944
21070
  PhoneAuthAvailabilityResponseDataToJSON,
@@ -21873,6 +21999,7 @@ export {
21873
21999
  ZyphrAuthenticationError,
21874
22000
  ZyphrError,
21875
22001
  ZyphrNotFoundError,
22002
+ ZyphrPayloadTooLargeError,
21876
22003
  ZyphrRateLimitError,
21877
22004
  ZyphrValidationError,
21878
22005
  ZyphrWebhookVerificationError,
@@ -22037,6 +22164,9 @@ export {
22037
22164
  instanceOfPasswordRequirements,
22038
22165
  instanceOfPasswordRequirementsResponse,
22039
22166
  instanceOfPasswordRequirementsResponseData,
22167
+ instanceOfPayloadTooLargeError,
22168
+ instanceOfPayloadTooLargeErrorError,
22169
+ instanceOfPayloadTooLargeErrorErrorDetails,
22040
22170
  instanceOfPhoneAuthAvailabilityResponse,
22041
22171
  instanceOfPhoneAuthAvailabilityResponseData,
22042
22172
  instanceOfPhoneLoginVerifyRequest,