@pristine-ts/stripe 2.0.3 → 2.0.5
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/lib/cjs/clients/stripe.client.js +6 -0
- package/dist/lib/cjs/clients/stripe.client.js.map +1 -1
- package/dist/lib/cjs/errors/errors.js +1 -0
- package/dist/lib/cjs/errors/errors.js.map +1 -1
- package/dist/lib/cjs/errors/stripe-authentication.error.js +13 -11
- package/dist/lib/cjs/errors/stripe-authentication.error.js.map +1 -1
- package/dist/lib/cjs/errors/stripe-error-code.enum.js +14 -0
- package/dist/lib/cjs/errors/stripe-error-code.enum.js.map +1 -0
- package/dist/lib/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/lib/esm/clients/stripe.client.js +7 -1
- package/dist/lib/esm/clients/stripe.client.js.map +1 -1
- package/dist/lib/esm/errors/errors.js +1 -0
- package/dist/lib/esm/errors/errors.js.map +1 -1
- package/dist/lib/esm/errors/stripe-authentication.error.js +13 -11
- package/dist/lib/esm/errors/stripe-authentication.error.js.map +1 -1
- package/dist/lib/esm/errors/stripe-error-code.enum.js +11 -0
- package/dist/lib/esm/errors/stripe-error-code.enum.js.map +1 -0
- package/dist/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/types/errors/errors.d.ts +1 -0
- package/dist/types/errors/stripe-authentication.error.d.ts +6 -7
- package/dist/types/errors/stripe-error-code.enum.d.ts +9 -0
- package/package.json +6 -6
|
@@ -86,6 +86,12 @@ let StripeClient = class StripeClient {
|
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
exports.StripeClient = StripeClient;
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, common_1.traced)(),
|
|
91
|
+
__metadata("design:type", Function),
|
|
92
|
+
__metadata("design:paramtypes", [common_1.Request, String]),
|
|
93
|
+
__metadata("design:returntype", Promise)
|
|
94
|
+
], StripeClient.prototype, "verifySignature", null);
|
|
89
95
|
exports.StripeClient = StripeClient = __decorate([
|
|
90
96
|
(0, common_1.tag)("StripeClientInterface"),
|
|
91
97
|
(0, tsyringe_1.injectable)(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe.client.js","sourceRoot":"","sources":["../../../../src/clients/stripe.client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA4C;AAE5C,
|
|
1
|
+
{"version":3,"file":"stripe.client.js","sourceRoot":"","sources":["../../../../src/clients/stripe.client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA4C;AAE5C,gDAAyD;AAEzD,uFAAgF;AAChF,oEAA6D;AAC7D,oDAA4B;AAE5B;;;GAGG;AAGI,IAAM,YAAY,GAAlB,MAAM,YAAY;IAQvB;;;;;OAKG;IACH,YACkD,UAA+B,EACb,YAAoB;QADtC,eAAU,GAAV,UAAU,CAAqB;QACb,iBAAY,GAAZ,YAAY,CAAQ;IAExF,CAAC;IAED;;OAEG;IACH,eAAe;;QACb,OAAO,IAAI,CAAC,MAAM,GAAG,MAAA,IAAI,CAAC,MAAM,mCAAI,IAAI,gBAAM,CAAC,IAAI,CAAC,YAAY,EAAE;YAChE,UAAU,EAAE,YAAY;SACzB,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IAEG,eAAe,CAAC,OAAgB,EAAE,2BAAmC;;;YACzE,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE,CAAC;gBAC7D,MAAM,IAAI,uDAAyB,CAAC,GAAG,EAAE,sCAAsC,CAAC,CAAC;YACnF,CAAC;YAED,MAAM,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;YAE5D,IAAI,CAAC;gBACH,OAAO,IAAI,CAAC,eAAe,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,OAAO,EAAE,eAAe,EAAE,2BAA2B,CAAC,CAAC;YACvH,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,4CAA4C,EAAE;oBAClE,UAAU,EAAE;wBACV,YAAY,EAAE,MAAA,KAAK,CAAC,OAAO,mCAAI,eAAe;wBAC9C,UAAU,EAAE,GAAG,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,EAAE;qBACnD;oBACD,KAAK,EAAE;wBACL,OAAO;wBACP,KAAK;qBACN;iBACF,CAAC,CAAC;gBACH,MAAM,IAAI,uDAAyB,CAAC,GAAG,EAAE,0CAA0C,CAAC,CAAC;YACvF,CAAC;QACH,CAAC;KAAA;CACF,CAAA;AA1DY,oCAAY;AAmCjB;IADL,IAAA,eAAM,GAAE;;qCACsB,gBAAO;;mDAsBrC;uBAzDU,YAAY;IAFxB,IAAA,YAAG,EAAC,uBAAuB,CAAC;IAC5B,IAAA,qBAAU,GAAE;IAgBR,WAAA,IAAA,iBAAM,EAAC,qBAAqB,CAAC,CAAA;IAC7B,WAAA,IAAA,iBAAM,EAAC,IAAI,2CAAmB,gBAAgB,CAAC,CAAA;;GAhBvC,YAAY,CA0DxB"}
|
|
@@ -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
|
|
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
|
|
11
|
+
class StripeAuthenticationError extends common_1.PristineError {
|
|
9
12
|
constructor(httpStatus, message, errors) {
|
|
10
|
-
super(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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,
|
|
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"}
|