@pristine-ts/stripe 2.0.4 → 2.0.6

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.
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./stripe-authentication.error"), exports);
18
+ __exportStar(require("./stripe-error-code.enum"), exports);
18
19
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/errors/errors.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gEAA8C"}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/errors/errors.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gEAA8C;AAC9C,2DAAyC"}
@@ -1,20 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StripeAuthenticationError = void 0;
4
- const networking_1 = require("@pristine-ts/networking");
4
+ const common_1 = require("@pristine-ts/common");
5
+ const stripe_error_code_enum_1 = require("./stripe-error-code.enum");
5
6
  /**
6
- * This Error represents an error when authenticating with Stripe.
7
+ * This Error represents an error when authenticating with Stripe. Wraps the underlying
8
+ * Stripe API response status in the `httpStatus` slot so the framework's
9
+ * `HttpErrorResponder` produces a meaningful response automatically.
7
10
  */
8
- class StripeAuthenticationError extends networking_1.HttpError {
11
+ class StripeAuthenticationError extends common_1.PristineError {
9
12
  constructor(httpStatus, message, errors) {
10
- super(httpStatus, message, errors);
11
- this.httpStatus = httpStatus;
12
- this.message = message;
13
- this.errors = errors;
14
- // Set the prototype explicitly.
15
- // As specified in the documentation in TypeScript
16
- // https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
17
- Object.setPrototypeOf(this, StripeAuthenticationError.prototype);
13
+ super(message, {
14
+ code: stripe_error_code_enum_1.StripeErrorCode.StripeAuthenticationFailed,
15
+ httpStatus,
16
+ exitCode: common_1.ExitCode.Error,
17
+ kind: common_1.PristineErrorKind.UserError,
18
+ details: errors ? { errors } : undefined,
19
+ });
18
20
  }
19
21
  }
20
22
  exports.StripeAuthenticationError = StripeAuthenticationError;
@@ -1 +1 @@
1
- {"version":3,"file":"stripe-authentication.error.js","sourceRoot":"","sources":["../../../../src/errors/stripe-authentication.error.ts"],"names":[],"mappings":";;;AAAA,wDAAkD;AAElD;;GAEG;AACH,MAAa,yBAA0B,SAAQ,sBAAS;IACtD,YAA4B,UAAkB,EAAW,OAAe,EAAW,MAA0B;QAC3G,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QADT,eAAU,GAAV,UAAU,CAAQ;QAAW,YAAO,GAAP,OAAO,CAAQ;QAAW,WAAM,GAAN,MAAM,CAAoB;QAG3G,gCAAgC;QAChC,kDAAkD;QAClD,gIAAgI;QAChI,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,yBAAyB,CAAC,SAAS,CAAC,CAAC;IACnE,CAAC;CACF;AATD,8DASC"}
1
+ {"version":3,"file":"stripe-authentication.error.js","sourceRoot":"","sources":["../../../../src/errors/stripe-authentication.error.ts"],"names":[],"mappings":";;;AAAA,gDAA+E;AAC/E,qEAAyD;AAEzD;;;;GAIG;AACH,MAAa,yBAA0B,SAAQ,sBAAa;IAC1D,YAAmB,UAAkB,EAAE,OAAe,EAAE,MAAc;QACpE,KAAK,CAAC,OAAO,EAAE;YACb,IAAI,EAAE,wCAAe,CAAC,0BAA0B;YAChD,UAAU;YACV,QAAQ,EAAE,iBAAQ,CAAC,KAAK;YACxB,IAAI,EAAE,0BAAiB,CAAC,SAAS;YACjC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAC,MAAM,EAAC,CAAC,CAAC,CAAC,SAAS;SACvC,CAAC,CAAC;IACL,CAAC;CACF;AAVD,8DAUC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StripeErrorCode = void 0;
4
+ /**
5
+ * Error-code catalog owned by `@pristine-ts/stripe`. Surfaced via `PristineErrorOptions.code`
6
+ * (typed `PristineErrorCode | string`, so any enum value is accepted).
7
+ *
8
+ * Codes here describe failures from the Stripe client wrapped by this module.
9
+ */
10
+ var StripeErrorCode;
11
+ (function (StripeErrorCode) {
12
+ StripeErrorCode["StripeAuthenticationFailed"] = "STRIPE_AUTHENTICATION_FAILED";
13
+ })(StripeErrorCode || (exports.StripeErrorCode = StripeErrorCode = {}));
14
+ //# sourceMappingURL=stripe-error-code.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stripe-error-code.enum.js","sourceRoot":"","sources":["../../../../src/errors/stripe-error-code.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,IAAY,eAEX;AAFD,WAAY,eAAe;IACzB,8EAA2D,CAAA;AAC7D,CAAC,EAFW,eAAe,+BAAf,eAAe,QAE1B"}