@tsed/stripe 7.0.0-beta.1 → 7.0.0-beta.4
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/.mocharc.js +2 -2
- package/lib/cjs/constants/{index.js → constants.js} +1 -1
- package/lib/cjs/constants/constants.js.map +1 -0
- package/lib/cjs/decorators/webhookEvent.js +4 -3
- package/lib/cjs/decorators/webhookEvent.js.map +1 -1
- package/lib/cjs/index.js +8 -5
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/middlewares/WebhookEventMiddleware.js +19 -17
- package/lib/cjs/middlewares/WebhookEventMiddleware.js.map +1 -1
- package/lib/cjs/package.json +3 -0
- package/lib/esm/constants/{index.js → constants.js} +1 -1
- package/lib/esm/constants/constants.js.map +1 -0
- package/lib/esm/decorators/webhookEvent.js +4 -3
- package/lib/esm/decorators/webhookEvent.js.map +1 -1
- package/lib/esm/index.js +8 -5
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/middlewares/WebhookEventMiddleware.js +5 -3
- package/lib/esm/middlewares/WebhookEventMiddleware.js.map +1 -1
- package/lib/esm/package.json +3 -0
- package/lib/types/constants/{index.d.ts → constants.d.ts} +0 -0
- package/lib/types/index.d.ts +5 -2
- package/lib/types/middlewares/WebhookEventMiddleware.d.ts +2 -1
- package/package.json +33 -16
- package/readme.md +90 -71
- package/tsconfig.compile.esm.json +1 -12
- package/lib/cjs/constants/index.js.map +0 -1
- package/lib/cjs/domain/index.js +0 -5
- package/lib/cjs/domain/index.js.map +0 -1
- package/lib/esm/constants/index.js.map +0 -1
- package/lib/esm/domain/index.js +0 -2
- package/lib/esm/domain/index.js.map +0 -1
- package/lib/types/domain/index.d.ts +0 -1
package/.mocharc.js
CHANGED
|
@@ -3,4 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.STRIPE_WEBHOOK_SIGNATURE = exports.STRIPE_WEBHOOK_EVENT = void 0;
|
|
4
4
|
exports.STRIPE_WEBHOOK_EVENT = "strip_webhook_event";
|
|
5
5
|
exports.STRIPE_WEBHOOK_SIGNATURE = "strip_webhook_signature";
|
|
6
|
-
//# sourceMappingURL=
|
|
6
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/constants/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG,qBAAqB,CAAC;AAC7C,QAAA,wBAAwB,GAAG,yBAAyB,CAAC","sourcesContent":["export const STRIPE_WEBHOOK_EVENT = \"strip_webhook_event\";\nexport const STRIPE_WEBHOOK_SIGNATURE = \"strip_webhook_signature\";\n"]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WebhookEvent = void 0;
|
|
4
|
-
const
|
|
4
|
+
const platform_middlewares_1 = require("@tsed/platform-middlewares");
|
|
5
|
+
const platform_params_1 = require("@tsed/platform-params");
|
|
5
6
|
const core_1 = require("@tsed/core");
|
|
6
7
|
const schema_1 = require("@tsed/schema");
|
|
7
|
-
const constants_1 = require("../constants");
|
|
8
|
+
const constants_1 = require("../constants/constants");
|
|
8
9
|
const WebhookEventMiddleware_1 = require("../middlewares/WebhookEventMiddleware");
|
|
9
10
|
/**
|
|
10
11
|
* Get the stripe webhook event.
|
|
@@ -14,7 +15,7 @@ const WebhookEventMiddleware_1 = require("../middlewares/WebhookEventMiddleware"
|
|
|
14
15
|
* @input
|
|
15
16
|
*/
|
|
16
17
|
function WebhookEvent(options) {
|
|
17
|
-
return (0, core_1.useDecorators)((0, core_1.useMethodDecorators)((0, schema_1.In)("body").Type(Object).Required().Description("The raw webhook payload"), (0, schema_1.In)("header").Name("stripe-signature").Type(String).Required().Description("The stripe webhook signature"), (0, core_1.StoreSet)(WebhookEventMiddleware_1.WebhookEventMiddleware, options), (0,
|
|
18
|
+
return (0, core_1.useDecorators)((0, core_1.useMethodDecorators)((0, schema_1.In)("body").Type(Object).Required().Description("The raw webhook payload"), (0, schema_1.In)("header").Name("stripe-signature").Type(String).Required().Description("The stripe webhook signature"), (0, core_1.StoreSet)(WebhookEventMiddleware_1.WebhookEventMiddleware, options), (0, platform_middlewares_1.UseBefore)(WebhookEventMiddleware_1.WebhookEventMiddleware)), (0, platform_params_1.Context)(constants_1.STRIPE_WEBHOOK_EVENT));
|
|
18
19
|
}
|
|
19
20
|
exports.WebhookEvent = WebhookEvent;
|
|
20
21
|
//# sourceMappingURL=webhookEvent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhookEvent.js","sourceRoot":"","sources":["../../../src/decorators/webhookEvent.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"webhookEvent.js","sourceRoot":"","sources":["../../../src/decorators/webhookEvent.ts"],"names":[],"mappings":";;;AAAA,qEAAqD;AACrD,2DAA8C;AAC9C,qCAAwE;AACxE,yCAAgC;AAChC,sDAA4D;AAC5D,kFAAkG;AAElG;;;;;;GAMG;AACH,SAAgB,YAAY,CAAC,OAAsC;IACjE,OAAO,IAAA,oBAAa,EAClB,IAAA,0BAAmB,EACjB,IAAA,WAAE,EAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC,yBAAyB,CAAC,EACzE,IAAA,WAAE,EAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC,8BAA8B,CAAC,EACzG,IAAA,eAAQ,EAAC,+CAAsB,EAAE,OAAO,CAAC,EACzC,IAAA,gCAAS,EAAC,+CAAsB,CAAC,CAClC,EACD,IAAA,yBAAO,EAAC,gCAAoB,CAAC,CAC9B,CAAC;AACJ,CAAC;AAVD,oCAUC","sourcesContent":["import {UseBefore} from \"@tsed/platform-middlewares\";\nimport {Context} from \"@tsed/platform-params\";\nimport {StoreSet, useDecorators, useMethodDecorators} from \"@tsed/core\";\nimport {In} from \"@tsed/schema\";\nimport {STRIPE_WEBHOOK_EVENT} from \"../constants/constants\";\nimport {WebhookEventMiddleware, WebhookEventOptions} from \"../middlewares/WebhookEventMiddleware\";\n\n/**\n * Get the stripe webhook event.\n *\n * @decorator\n * @operation\n * @input\n */\nexport function WebhookEvent(options?: Partial<WebhookEventOptions>) {\n return useDecorators(\n useMethodDecorators(\n In(\"body\").Type(Object).Required().Description(\"The raw webhook payload\"),\n In(\"header\").Name(\"stripe-signature\").Type(String).Required().Description(\"The stripe webhook signature\"),\n StoreSet(WebhookEventMiddleware, options),\n UseBefore(WebhookEventMiddleware)\n ),\n Context(STRIPE_WEBHOOK_EVENT)\n );\n}\n"]}
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file Automatically generated by barrelsby.
|
|
4
|
+
*/
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
const tslib_1 = require("tslib");
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
tslib_1.__exportStar(require("./constants/constants"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./decorators/webhookEvent"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./domain/StripSettings"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./middlewares/WebhookEventMiddleware"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./services/StripeFactory"), exports);
|
|
9
12
|
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,gEAAsC;AACtC,oEAA0C;AAC1C,iEAAuC;AACvC,+EAAqD;AACrD,mEAAyC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./constants/constants\";\nexport * from \"./decorators/webhookEvent\";\nexport * from \"./domain/StripSettings\";\nexport * from \"./middlewares/WebhookEventMiddleware\";\nexport * from \"./services/StripeFactory\";\n"]}
|
|
@@ -3,10 +3,12 @@ var WebhookEventMiddleware_1;
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.WebhookEventMiddleware = void 0;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
|
-
const
|
|
6
|
+
const platform_params_1 = require("@tsed/platform-params");
|
|
7
|
+
const platform_middlewares_1 = require("@tsed/platform-middlewares");
|
|
8
|
+
const di_1 = require("@tsed/di");
|
|
7
9
|
const exceptions_1 = require("@tsed/exceptions");
|
|
8
10
|
const stripe_1 = require("stripe");
|
|
9
|
-
const constants_1 = require("../constants");
|
|
11
|
+
const constants_1 = require("../constants/constants");
|
|
10
12
|
require("../services/StripeFactory");
|
|
11
13
|
let WebhookEventMiddleware = WebhookEventMiddleware_1 = class WebhookEventMiddleware {
|
|
12
14
|
use(signature, body, ctx) {
|
|
@@ -26,24 +28,24 @@ let WebhookEventMiddleware = WebhookEventMiddleware_1 = class WebhookEventMiddle
|
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
30
|
};
|
|
29
|
-
|
|
30
|
-
(0,
|
|
31
|
-
|
|
31
|
+
tslib_1.__decorate([
|
|
32
|
+
(0, di_1.Inject)(),
|
|
33
|
+
tslib_1.__metadata("design:type", stripe_1.Stripe)
|
|
32
34
|
], WebhookEventMiddleware.prototype, "stripe", void 0);
|
|
33
|
-
|
|
34
|
-
(0,
|
|
35
|
-
|
|
35
|
+
tslib_1.__decorate([
|
|
36
|
+
(0, di_1.Constant)("stripe.webhooks"),
|
|
37
|
+
tslib_1.__metadata("design:type", Object)
|
|
36
38
|
], WebhookEventMiddleware.prototype, "webhooks", void 0);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
tslib_1.__decorate([
|
|
40
|
+
tslib_1.__param(0, (0, platform_params_1.HeaderParams)("stripe-signature")),
|
|
41
|
+
tslib_1.__param(1, (0, platform_params_1.RawBodyParams)()),
|
|
42
|
+
tslib_1.__param(2, (0, platform_params_1.Context)()),
|
|
43
|
+
tslib_1.__metadata("design:type", Function),
|
|
44
|
+
tslib_1.__metadata("design:paramtypes", [String, Buffer, Object]),
|
|
45
|
+
tslib_1.__metadata("design:returntype", Object)
|
|
44
46
|
], WebhookEventMiddleware.prototype, "use", null);
|
|
45
|
-
WebhookEventMiddleware = WebhookEventMiddleware_1 =
|
|
46
|
-
(0,
|
|
47
|
+
WebhookEventMiddleware = WebhookEventMiddleware_1 = tslib_1.__decorate([
|
|
48
|
+
(0, platform_middlewares_1.Middleware)()
|
|
47
49
|
], WebhookEventMiddleware);
|
|
48
50
|
exports.WebhookEventMiddleware = WebhookEventMiddleware;
|
|
49
51
|
//# sourceMappingURL=WebhookEventMiddleware.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebhookEventMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/WebhookEventMiddleware.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"WebhookEventMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/WebhookEventMiddleware.ts"],"names":[],"mappings":";;;;;AAAA,2DAA2E;AAC3E,qEAAyE;AACzE,iCAA0C;AAC1C,iDAAiE;AACjE,mCAA8B;AAC9B,sDAAsF;AACtF,qCAAmC;AAQnC,IAAa,sBAAsB,8BAAnC,MAAa,sBAAsB;IAOjC,GAAG,CAAmC,SAAiB,EAAmB,IAAY,EAAa,GAAY;QAC7G,MAAM,EAAC,MAAM,EAAE,SAAS,EAAC,GAAwB;YAC/C,GAAG,IAAI,CAAC,QAAQ;YAChB,GAAG,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,wBAAsB,CAAC;SAClD,CAAC;QAEF,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,IAAI,gCAAmB,CAC3B,qHAAqH,CACtH,CAAC;SACH;QAED,IAAI;YACF,GAAG,CAAC,GAAG,CAAC,oCAAwB,EAAE,SAAS,CAAC,CAAC;YAC7C,GAAG,CAAC,GAAG,CAAC,gCAAoB,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;SACxG;QAAC,OAAO,GAAG,EAAE;YACZ,MAAM,IAAI,uBAAU,CAAC,yBAAyB,GAAG,CAAC,OAAO,EAAE,EAAE,GAAG,CAAC,CAAC;SACnE;IACH,CAAC;CACF,CAAA;AAxBC;IADC,IAAA,WAAM,GAAE;sCACS,eAAM;sDAAC;AAGzB;IADC,IAAA,aAAQ,EAAC,iBAAiB,CAAC;;wDACY;AAExC;IAAK,mBAAA,IAAA,8BAAY,EAAC,kBAAkB,CAAC,CAAA;IAAqB,mBAAA,IAAA,+BAAa,GAAE,CAAA;IAAgB,mBAAA,IAAA,yBAAO,GAAE,CAAA;;qDAAlB,MAAM;;iDAkBrF;AAzBU,sBAAsB;IADlC,IAAA,iCAAU,GAAE;GACA,sBAAsB,CA0BlC;AA1BY,wDAAsB","sourcesContent":["import {Context, HeaderParams, RawBodyParams} from \"@tsed/platform-params\";\nimport {Middleware, MiddlewareMethods} from \"@tsed/platform-middlewares\";\nimport {Constant, Inject} from \"@tsed/di\";\nimport {BadRequest, InternalServerError} from \"@tsed/exceptions\";\nimport {Stripe} from \"stripe\";\nimport {STRIPE_WEBHOOK_EVENT, STRIPE_WEBHOOK_SIGNATURE} from \"../constants/constants\";\nimport \"../services/StripeFactory\";\n\nexport interface WebhookEventOptions {\n secret: string;\n tolerance: number;\n}\n\n@Middleware()\nexport class WebhookEventMiddleware implements MiddlewareMethods {\n @Inject()\n protected stripe: Stripe;\n\n @Constant(\"stripe.webhooks\")\n protected webhooks: WebhookEventOptions;\n\n use(@HeaderParams(\"stripe-signature\") signature: string, @RawBodyParams() body: Buffer, @Context() ctx: Context): any {\n const {secret, tolerance}: WebhookEventOptions = {\n ...this.webhooks,\n ...ctx.endpoint.store.get(WebhookEventMiddleware)\n };\n\n if (!secret) {\n throw new InternalServerError(\n \"Missing Stripe webhooks secret key. You can get this in your dashboard. See: https://dashboard.stripe.com/webhooks.\"\n );\n }\n\n try {\n ctx.set(STRIPE_WEBHOOK_SIGNATURE, signature);\n ctx.set(STRIPE_WEBHOOK_EVENT, this.stripe.webhooks.constructEvent(body, signature, secret, tolerance));\n } catch (err) {\n throw new BadRequest(`Stripe webhook error: ${err.message}`, err);\n }\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/constants/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,qBAAqB,CAAC;AAC1D,MAAM,CAAC,MAAM,wBAAwB,GAAG,yBAAyB,CAAC","sourcesContent":["export const STRIPE_WEBHOOK_EVENT = \"strip_webhook_event\";\nexport const STRIPE_WEBHOOK_SIGNATURE = \"strip_webhook_signature\";\n"]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UseBefore } from "@tsed/platform-middlewares";
|
|
2
|
+
import { Context } from "@tsed/platform-params";
|
|
2
3
|
import { StoreSet, useDecorators, useMethodDecorators } from "@tsed/core";
|
|
3
4
|
import { In } from "@tsed/schema";
|
|
4
|
-
import { STRIPE_WEBHOOK_EVENT } from "../constants";
|
|
5
|
-
import { WebhookEventMiddleware } from "../middlewares/WebhookEventMiddleware";
|
|
5
|
+
import { STRIPE_WEBHOOK_EVENT } from "../constants/constants.js";
|
|
6
|
+
import { WebhookEventMiddleware } from "../middlewares/WebhookEventMiddleware.js";
|
|
6
7
|
/**
|
|
7
8
|
* Get the stripe webhook event.
|
|
8
9
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhookEvent.js","sourceRoot":"","sources":["../../../src/decorators/webhookEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"webhookEvent.js","sourceRoot":"","sources":["../../../src/decorators/webhookEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAC,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAE,mBAAmB,EAAC,MAAM,YAAY,CAAC;AACxE,OAAO,EAAC,EAAE,EAAC,MAAM,cAAc,CAAC;AAChC,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAC,sBAAsB,EAAsB,MAAM,uCAAuC,CAAC;AAElG;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,OAAsC;IACjE,OAAO,aAAa,CAClB,mBAAmB,CACjB,EAAE,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC,yBAAyB,CAAC,EACzE,EAAE,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC,8BAA8B,CAAC,EACzG,QAAQ,CAAC,sBAAsB,EAAE,OAAO,CAAC,EACzC,SAAS,CAAC,sBAAsB,CAAC,CAClC,EACD,OAAO,CAAC,oBAAoB,CAAC,CAC9B,CAAC;AACJ,CAAC","sourcesContent":["import {UseBefore} from \"@tsed/platform-middlewares\";\nimport {Context} from \"@tsed/platform-params\";\nimport {StoreSet, useDecorators, useMethodDecorators} from \"@tsed/core\";\nimport {In} from \"@tsed/schema\";\nimport {STRIPE_WEBHOOK_EVENT} from \"../constants/constants\";\nimport {WebhookEventMiddleware, WebhookEventOptions} from \"../middlewares/WebhookEventMiddleware\";\n\n/**\n * Get the stripe webhook event.\n *\n * @decorator\n * @operation\n * @input\n */\nexport function WebhookEvent(options?: Partial<WebhookEventOptions>) {\n return useDecorators(\n useMethodDecorators(\n In(\"body\").Type(Object).Required().Description(\"The raw webhook payload\"),\n In(\"header\").Name(\"stripe-signature\").Type(String).Required().Description(\"The stripe webhook signature\"),\n StoreSet(WebhookEventMiddleware, options),\n UseBefore(WebhookEventMiddleware)\n ),\n Context(STRIPE_WEBHOOK_EVENT)\n );\n}\n"]}
|
package/lib/esm/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
1
|
+
/**
|
|
2
|
+
* @file Automatically generated by barrelsby.
|
|
3
|
+
*/
|
|
4
|
+
export * from "./constants/constants.js";
|
|
5
|
+
export * from "./decorators/webhookEvent.js";
|
|
6
|
+
export * from "./domain/StripSettings.js";
|
|
7
|
+
export * from "./middlewares/WebhookEventMiddleware.js";
|
|
8
|
+
export * from "./services/StripeFactory.js";
|
|
6
9
|
//# sourceMappingURL=index.js.map
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sCAAsC,CAAC;AACrD,cAAc,0BAA0B,CAAC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./constants/constants\";\nexport * from \"./decorators/webhookEvent\";\nexport * from \"./domain/StripSettings\";\nexport * from \"./middlewares/WebhookEventMiddleware\";\nexport * from \"./services/StripeFactory\";\n"]}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
var WebhookEventMiddleware_1;
|
|
2
2
|
import { __decorate, __metadata, __param } from "tslib";
|
|
3
|
-
import {
|
|
3
|
+
import { Context, HeaderParams, RawBodyParams } from "@tsed/platform-params";
|
|
4
|
+
import { Middleware } from "@tsed/platform-middlewares";
|
|
5
|
+
import { Constant, Inject } from "@tsed/di";
|
|
4
6
|
import { BadRequest, InternalServerError } from "@tsed/exceptions";
|
|
5
7
|
import { Stripe } from "stripe";
|
|
6
|
-
import { STRIPE_WEBHOOK_EVENT, STRIPE_WEBHOOK_SIGNATURE } from "../constants";
|
|
7
|
-
import "../services/StripeFactory";
|
|
8
|
+
import { STRIPE_WEBHOOK_EVENT, STRIPE_WEBHOOK_SIGNATURE } from "../constants/constants.js";
|
|
9
|
+
import "../services/StripeFactory.js";
|
|
8
10
|
let WebhookEventMiddleware = WebhookEventMiddleware_1 = class WebhookEventMiddleware {
|
|
9
11
|
use(signature, body, ctx) {
|
|
10
12
|
const { secret, tolerance } = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebhookEventMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/WebhookEventMiddleware.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"WebhookEventMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/WebhookEventMiddleware.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAC,UAAU,EAAoB,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAC,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAC,UAAU,EAAE,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAC,MAAM,EAAC,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAC,oBAAoB,EAAE,wBAAwB,EAAC,MAAM,wBAAwB,CAAC;AACtF,OAAO,2BAA2B,CAAC;AAQnC,IAAa,sBAAsB,8BAAnC,MAAa,sBAAsB;IAOjC,GAAG,CAAmC,SAAiB,EAAmB,IAAY,EAAa,GAAY;QAC7G,MAAM,EAAC,MAAM,EAAE,SAAS,EAAC,GAAwB;YAC/C,GAAG,IAAI,CAAC,QAAQ;YAChB,GAAG,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,wBAAsB,CAAC;SAClD,CAAC;QAEF,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,IAAI,mBAAmB,CAC3B,qHAAqH,CACtH,CAAC;SACH;QAED,IAAI;YACF,GAAG,CAAC,GAAG,CAAC,wBAAwB,EAAE,SAAS,CAAC,CAAC;YAC7C,GAAG,CAAC,GAAG,CAAC,oBAAoB,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;SACxG;QAAC,OAAO,GAAG,EAAE;YACZ,MAAM,IAAI,UAAU,CAAC,yBAAyB,GAAG,CAAC,OAAO,EAAE,EAAE,GAAG,CAAC,CAAC;SACnE;IACH,CAAC;CACF,CAAA;AAxBC;IADC,MAAM,EAAE;8BACS,MAAM;sDAAC;AAGzB;IADC,QAAQ,CAAC,iBAAiB,CAAC;;wDACY;AAExC;IAAK,WAAA,YAAY,CAAC,kBAAkB,CAAC,CAAA;IAAqB,WAAA,aAAa,EAAE,CAAA;IAAgB,WAAA,OAAO,EAAE,CAAA;;6CAAlB,MAAM;;iDAkBrF;AAzBU,sBAAsB;IADlC,UAAU,EAAE;GACA,sBAAsB,CA0BlC;SA1BY,sBAAsB","sourcesContent":["import {Context, HeaderParams, RawBodyParams} from \"@tsed/platform-params\";\nimport {Middleware, MiddlewareMethods} from \"@tsed/platform-middlewares\";\nimport {Constant, Inject} from \"@tsed/di\";\nimport {BadRequest, InternalServerError} from \"@tsed/exceptions\";\nimport {Stripe} from \"stripe\";\nimport {STRIPE_WEBHOOK_EVENT, STRIPE_WEBHOOK_SIGNATURE} from \"../constants/constants\";\nimport \"../services/StripeFactory\";\n\nexport interface WebhookEventOptions {\n secret: string;\n tolerance: number;\n}\n\n@Middleware()\nexport class WebhookEventMiddleware implements MiddlewareMethods {\n @Inject()\n protected stripe: Stripe;\n\n @Constant(\"stripe.webhooks\")\n protected webhooks: WebhookEventOptions;\n\n use(@HeaderParams(\"stripe-signature\") signature: string, @RawBodyParams() body: Buffer, @Context() ctx: Context): any {\n const {secret, tolerance}: WebhookEventOptions = {\n ...this.webhooks,\n ...ctx.endpoint.store.get(WebhookEventMiddleware)\n };\n\n if (!secret) {\n throw new InternalServerError(\n \"Missing Stripe webhooks secret key. You can get this in your dashboard. See: https://dashboard.stripe.com/webhooks.\"\n );\n }\n\n try {\n ctx.set(STRIPE_WEBHOOK_SIGNATURE, signature);\n ctx.set(STRIPE_WEBHOOK_EVENT, this.stripe.webhooks.constructEvent(body, signature, secret, tolerance));\n } catch (err) {\n throw new BadRequest(`Stripe webhook error: ${err.message}`, err);\n }\n }\n}\n"]}
|
|
File without changes
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @file Automatically generated by barrelsby.
|
|
3
|
+
*/
|
|
4
|
+
export * from "./constants/constants";
|
|
3
5
|
export * from "./decorators/webhookEvent";
|
|
6
|
+
export * from "./domain/StripSettings";
|
|
4
7
|
export * from "./middlewares/WebhookEventMiddleware";
|
|
5
8
|
export * from "./services/StripeFactory";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { Context
|
|
2
|
+
import { Context } from "@tsed/platform-params";
|
|
3
|
+
import { MiddlewareMethods } from "@tsed/platform-middlewares";
|
|
3
4
|
import { Stripe } from "stripe";
|
|
4
5
|
import "../services/StripeFactory";
|
|
5
6
|
export interface WebhookEventOptions {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/stripe",
|
|
3
|
-
"version": "7.0.0-beta.
|
|
3
|
+
"version": "7.0.0-beta.4",
|
|
4
4
|
"description": "Stripe package for Ts.ED framework",
|
|
5
5
|
"private": false,
|
|
6
6
|
"keywords": [
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
],
|
|
15
15
|
"source": "./src/index.ts",
|
|
16
16
|
"main": "./lib/cjs/index.js",
|
|
17
|
+
"module": "./lib/esm/index.js",
|
|
17
18
|
"typings": "./lib/types/index.d.ts",
|
|
18
19
|
"exports": {
|
|
19
20
|
"types": "./lib/types/index.d.ts",
|
|
@@ -22,39 +23,55 @@
|
|
|
22
23
|
"default": "./lib/esm/index.js"
|
|
23
24
|
},
|
|
24
25
|
"scripts": {
|
|
25
|
-
"build": "yarn run build:esm && yarn run build:cjs",
|
|
26
|
+
"build": "yarn barrels && yarn run build:esm && yarn run build:cjs",
|
|
26
27
|
"build:cjs": "tsc --build tsconfig.compile.json",
|
|
27
28
|
"build:esm": "tsc --build tsconfig.compile.esm.json",
|
|
29
|
+
"barrels": "yarn barrelsby --delete -d ./src -e \"\\.spec\\.ts\" -e \"__mock__\" -e \".benchmark.ts\"",
|
|
28
30
|
"test": "cross-env NODE_ENV=test nyc mocha"
|
|
29
31
|
},
|
|
30
32
|
"dependencies": {
|
|
31
|
-
"tslib": "2.
|
|
33
|
+
"tslib": "2.3.1"
|
|
32
34
|
},
|
|
33
35
|
"devDependencies": {
|
|
34
|
-
"@tsed/
|
|
35
|
-
"@tsed/
|
|
36
|
-
"@tsed/
|
|
37
|
-
"@tsed/
|
|
38
|
-
"@tsed/
|
|
39
|
-
"@tsed/schema": "7.0.0-beta.
|
|
36
|
+
"@tsed/core": "7.0.0-beta.4",
|
|
37
|
+
"@tsed/di": "7.0.0-beta.4",
|
|
38
|
+
"@tsed/exceptions": "7.0.0-beta.4",
|
|
39
|
+
"@tsed/platform-middlewares": "7.0.0-beta.4",
|
|
40
|
+
"@tsed/platform-params": "7.0.0-beta.4",
|
|
41
|
+
"@tsed/schema": "7.0.0-beta.4",
|
|
40
42
|
"stripe": "^8.129.0"
|
|
41
43
|
},
|
|
42
44
|
"peerDependencies": {
|
|
43
|
-
"@tsed/
|
|
44
|
-
"@tsed/
|
|
45
|
-
"@tsed/
|
|
46
|
-
"@tsed/
|
|
47
|
-
"@tsed/openspec": "^7.0.0-beta.1",
|
|
48
|
-
"@tsed/schema": "^7.0.0-beta.1",
|
|
45
|
+
"@tsed/exceptions": "^7.0.0-beta.4",
|
|
46
|
+
"@tsed/platform-middlewares": "^7.0.0-beta.4",
|
|
47
|
+
"@tsed/platform-params": "^7.0.0-beta.4",
|
|
48
|
+
"@tsed/schema": "^7.0.0-beta.4",
|
|
49
49
|
"@types/body-parser": "^1.19.0",
|
|
50
50
|
"body-parser": "^1.19.0",
|
|
51
51
|
"stripe": "^8.129.0"
|
|
52
52
|
},
|
|
53
|
+
"peerDependenciesMeta": {
|
|
54
|
+
"@tsed/platform-middlewares": {
|
|
55
|
+
"optional": false
|
|
56
|
+
},
|
|
57
|
+
"@tsed/platform-params": {
|
|
58
|
+
"optional": false
|
|
59
|
+
},
|
|
60
|
+
"@tsed/schema": {
|
|
61
|
+
"optional": false
|
|
62
|
+
},
|
|
63
|
+
"@tsed/exceptions": {
|
|
64
|
+
"optional": false
|
|
65
|
+
},
|
|
66
|
+
"stripe": {
|
|
67
|
+
"optional": false
|
|
68
|
+
}
|
|
69
|
+
},
|
|
53
70
|
"repository": "https://github.com/tsedio/tsed",
|
|
54
71
|
"bugs": {
|
|
55
72
|
"url": "https://github.com/tsedio/tsed/issues"
|
|
56
73
|
},
|
|
57
|
-
"homepage": "https://github.com/tsedio/tsed/tree/
|
|
74
|
+
"homepage": "https://github.com/tsedio/tsed/tree/production/packages/third-parties/stripe",
|
|
58
75
|
"author": "Romain Lenzotti",
|
|
59
76
|
"license": "MIT"
|
|
60
77
|
}
|
package/readme.md
CHANGED
|
@@ -32,7 +32,7 @@ A package of Ts.ED framework. See website: https://tsed.io/tutorials/stripe.html
|
|
|
32
32
|
## Feature
|
|
33
33
|
|
|
34
34
|
Currently, `@tsed/stripe` allows you:
|
|
35
|
-
|
|
35
|
+
|
|
36
36
|
- Configure stripe,
|
|
37
37
|
- Create webhooks,
|
|
38
38
|
- Use stripe API.
|
|
@@ -50,33 +50,59 @@ Then import `@tsed/stripe` in your Server:
|
|
|
50
50
|
|
|
51
51
|
```typescript
|
|
52
52
|
import {Configuration, PlatformApplication} from "@tsed/common";
|
|
53
|
-
import "@tsed/stripe";
|
|
53
|
+
import "@tsed/stripe";
|
|
54
54
|
import {Stripe} from "stripe";
|
|
55
55
|
|
|
56
56
|
@Configuration({
|
|
57
57
|
stripe: {
|
|
58
58
|
apiKey: process.env.STRIPE_SECRET_KEY,
|
|
59
59
|
webhooks: {
|
|
60
|
-
secret: process.env.STRIPE_WEBHOOK_SECRET
|
|
60
|
+
secret: process.env.STRIPE_WEBHOOK_SECRET
|
|
61
61
|
},
|
|
62
62
|
// Stripe options
|
|
63
|
-
apiVersion:
|
|
64
|
-
httpProxy: new ProxyAgent(process.env.http_proxy)
|
|
63
|
+
apiVersion: "2019-08-08",
|
|
64
|
+
httpProxy: new ProxyAgent(process.env.http_proxy)
|
|
65
65
|
}
|
|
66
66
|
})
|
|
67
67
|
export class Server {
|
|
68
68
|
@Inject()
|
|
69
69
|
stripe: Stripe;
|
|
70
|
-
|
|
70
|
+
|
|
71
71
|
$afterInit() {
|
|
72
72
|
// do something with stripe
|
|
73
73
|
// this.stripe.customers
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
```
|
|
77
|
+
|
|
77
78
|
> See Stripe options for more details: https://www.npmjs.com/package/stripe
|
|
78
79
|
|
|
79
|
-
|
|
80
|
+
::: warning
|
|
81
|
+
Stripe needs to validate signature transaction when you received a webhook notification.
|
|
82
|
+
To work properly, you have to remove bodyParser add on `$beforeRoutesInit`.
|
|
83
|
+
|
|
84
|
+
```diff
|
|
85
|
+
@Configuration({
|
|
86
|
+
+ middlewares: [
|
|
87
|
+
+ bodyParser.json(),
|
|
88
|
+
+ bodyParser.urlencoded({extended: true})
|
|
89
|
+
+ ]
|
|
90
|
+
})
|
|
91
|
+
export class Server {
|
|
92
|
+
@Inject()
|
|
93
|
+
protected app: PlatformApplication;
|
|
94
|
+
|
|
95
|
+
$beforeRoutesInit() {
|
|
96
|
+
- this.app
|
|
97
|
+
- .use(bodyParser.json())
|
|
98
|
+
- .use(bodyParser.urlencoded({extended: true}));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
::
|
|
104
|
+
|
|
105
|
+
## Inject Stripe
|
|
80
106
|
|
|
81
107
|
```typescript
|
|
82
108
|
import {Injectable} from "@tsed/di";
|
|
@@ -85,15 +111,13 @@ import {Injectable} from "@tsed/di";
|
|
|
85
111
|
class MyStripeService {
|
|
86
112
|
@Inject()
|
|
87
113
|
stripe: Stripe;
|
|
88
|
-
|
|
114
|
+
|
|
89
115
|
$onInit() {
|
|
90
116
|
// do something with stripe
|
|
91
|
-
this.stripe.on(
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
protected onRequest(request: any) {
|
|
95
|
-
|
|
117
|
+
this.stripe.on("request", this.onRequest.bind(this));
|
|
96
118
|
}
|
|
119
|
+
|
|
120
|
+
protected onRequest(request: any) {}
|
|
97
121
|
}
|
|
98
122
|
```
|
|
99
123
|
|
|
@@ -102,7 +126,7 @@ class MyStripeService {
|
|
|
102
126
|
Stripe can optionally sign the webhook events it sends to your endpoint, allowing you to validate that they were not sent by a third-party. You can read more about it [here](https://stripe.com/docs/webhooks#signatures).
|
|
103
127
|
|
|
104
128
|
To register a Stripe webhook with Ts.ED, just use the `@WebhookEvent` decorator. It'll call for you the `stripe.webhooks.constructEvent` with the right parameters:
|
|
105
|
-
|
|
129
|
+
|
|
106
130
|
```typescript
|
|
107
131
|
import {RawBodyParams, HeaderParams, Controller, Context} from "@tsed/common";
|
|
108
132
|
import {Stripe} from "stripe";
|
|
@@ -111,15 +135,12 @@ import {Stripe} from "stripe";
|
|
|
111
135
|
export class StripWebhookCtrl {
|
|
112
136
|
@Inject()
|
|
113
137
|
stripe: Stripe;
|
|
114
|
-
|
|
138
|
+
|
|
115
139
|
@Post("/callback")
|
|
116
|
-
successPaymentHook(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
ctx.logger.info({name: 'Webhook success', event});
|
|
121
|
-
|
|
122
|
-
return {received: true}
|
|
140
|
+
successPaymentHook(@WebhookEvent() event: Stripe.Event, @Context() ctx: Context) {
|
|
141
|
+
ctx.logger.info({name: "Webhook success", event});
|
|
142
|
+
|
|
143
|
+
return {received: true};
|
|
123
144
|
}
|
|
124
145
|
}
|
|
125
146
|
```
|
|
@@ -133,41 +154,43 @@ import {Stripe} from "stripe";
|
|
|
133
154
|
import {PlatformTest} from "@tsed/common";
|
|
134
155
|
import {StripWebhookCtrl} from "./StripWebhookCtrl";
|
|
135
156
|
|
|
136
|
-
describe(
|
|
137
|
-
beforeEach(() =>
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
157
|
+
describe("StripWebhookCtrl", () => {
|
|
158
|
+
beforeEach(() =>
|
|
159
|
+
PlatformTest.create({
|
|
160
|
+
stripe: {
|
|
161
|
+
apiKey: "fake_api_key",
|
|
162
|
+
webhooks: {
|
|
163
|
+
secret: "whsec_test_secret"
|
|
164
|
+
},
|
|
165
|
+
// Stripe options
|
|
166
|
+
apiVersion: "2019-08-08"
|
|
167
|
+
}
|
|
168
|
+
})
|
|
169
|
+
);
|
|
170
|
+
afterEach(PlatformTest.reset);
|
|
148
171
|
it("should call event", async () => {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
172
|
+
const stripe = PlatformTest.get<Stripe>(Stripe);
|
|
173
|
+
const payload = {
|
|
174
|
+
id: "evt_test_webhook",
|
|
175
|
+
object: "event"
|
|
176
|
+
};
|
|
177
|
+
const payloadString = JSON.stringify(payload, null, 2);
|
|
178
|
+
|
|
179
|
+
const header = stripe.webhooks.generateTestHeaderString({
|
|
180
|
+
payload: payloadString,
|
|
181
|
+
secret: "whsec_test_secret"
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
const event = stripe.webhooks.constructEvent(payloadString, header, secret);
|
|
185
|
+
const ctx = PlatformTest.createRequestContext();
|
|
186
|
+
|
|
187
|
+
const ctrl = await PlatformTest.invoke<StripWebhookCtrl>(StripWebhookCtrl);
|
|
188
|
+
|
|
189
|
+
const result = ctrl.successPaymentHook(event, ctx);
|
|
190
|
+
|
|
191
|
+
expect(result).toEqual({received: true});
|
|
169
192
|
});
|
|
170
|
-
})
|
|
193
|
+
});
|
|
171
194
|
```
|
|
172
195
|
|
|
173
196
|
With SuperTest:
|
|
@@ -180,10 +203,9 @@ import {expect} from "chai";
|
|
|
180
203
|
import {Stripe} from "stripe";
|
|
181
204
|
import SuperTest from "supertest";
|
|
182
205
|
import {StripeWebhooksCtrl} from "./StripWebhookCtrl";
|
|
183
|
-
import {
|
|
206
|
+
import {Server} from "../Server";
|
|
184
207
|
|
|
185
208
|
const utils = PlatformTestUtils.create({
|
|
186
|
-
rootDir,
|
|
187
209
|
platform: PlatformExpress,
|
|
188
210
|
server: Server,
|
|
189
211
|
logger: {
|
|
@@ -193,11 +215,13 @@ const utils = PlatformTestUtils.create({
|
|
|
193
215
|
|
|
194
216
|
describe("Stripe", () => {
|
|
195
217
|
let request: SuperTest.SuperTest<SuperTest.Test>;
|
|
196
|
-
beforeEach(
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
218
|
+
beforeEach(
|
|
219
|
+
utils.bootstrap({
|
|
220
|
+
mount: {
|
|
221
|
+
"/rest": [StripWebhookCtrl]
|
|
222
|
+
}
|
|
223
|
+
})
|
|
224
|
+
);
|
|
201
225
|
beforeEach(() => {
|
|
202
226
|
request = SuperTest.agent(PlatformTest.callback());
|
|
203
227
|
});
|
|
@@ -217,33 +241,28 @@ describe("Stripe", () => {
|
|
|
217
241
|
secret: "whsec_test_secret"
|
|
218
242
|
});
|
|
219
243
|
|
|
220
|
-
const response = await request
|
|
221
|
-
.post("/rest/webhooks/callback")
|
|
222
|
-
.send(payloadString)
|
|
223
|
-
.set("stripe-signature", signature)
|
|
224
|
-
.expect(200);
|
|
244
|
+
const response = await request.post("/rest/webhooks/callback").send(payloadString).set("stripe-signature", signature).expect(200);
|
|
225
245
|
|
|
226
246
|
expect(response.body).to.deep.eq({
|
|
227
|
-
|
|
228
|
-
|
|
247
|
+
event: payload,
|
|
248
|
+
received: true
|
|
229
249
|
});
|
|
230
250
|
});
|
|
231
251
|
});
|
|
232
252
|
```
|
|
233
253
|
|
|
234
254
|
## Contributors
|
|
255
|
+
|
|
235
256
|
Please read [contributing guidelines here](https://tsed.io/CONTRIBUTING.html)
|
|
236
257
|
|
|
237
258
|
<a href="https://github.com/tsedio/ts-express-decorators/graphs/contributors"><img src="https://opencollective.com/tsed/contributors.svg?width=890" /></a>
|
|
238
259
|
|
|
239
|
-
|
|
240
260
|
## Backers
|
|
241
261
|
|
|
242
262
|
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/tsed#backer)]
|
|
243
263
|
|
|
244
264
|
<a href="https://opencollective.com/tsed#backers" target="_blank"><img src="https://opencollective.com/tsed/backers.svg?width=890"></a>
|
|
245
265
|
|
|
246
|
-
|
|
247
266
|
## Sponsors
|
|
248
267
|
|
|
249
268
|
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/tsed#sponsor)]
|
|
@@ -8,16 +8,5 @@
|
|
|
8
8
|
"declaration": true,
|
|
9
9
|
"declarationDir": "./lib/types"
|
|
10
10
|
},
|
|
11
|
-
"exclude": [
|
|
12
|
-
"node_modules",
|
|
13
|
-
"test",
|
|
14
|
-
"lib",
|
|
15
|
-
"benchmark",
|
|
16
|
-
"coverage",
|
|
17
|
-
"spec",
|
|
18
|
-
"**/*.benchmark.ts",
|
|
19
|
-
"**/*.spec.ts",
|
|
20
|
-
"keys",
|
|
21
|
-
"jest.config.js"
|
|
22
|
-
]
|
|
11
|
+
"exclude": ["node_modules", "test", "lib", "benchmark", "coverage", "spec", "**/*.benchmark.ts", "**/*.spec.ts", "keys", "jest.config.js"]
|
|
23
12
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG,qBAAqB,CAAC;AAC7C,QAAA,wBAAwB,GAAG,yBAAyB,CAAC","sourcesContent":["export const STRIPE_WEBHOOK_EVENT = \"strip_webhook_event\";\nexport const STRIPE_WEBHOOK_SIGNATURE = \"strip_webhook_signature\";\n"]}
|
package/lib/cjs/domain/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/index.ts"],"names":[],"mappings":";;;AAAA,+DAAgC","sourcesContent":["export * from \"./StripSettings\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,qBAAqB,CAAC;AAC1D,MAAM,CAAC,MAAM,wBAAwB,GAAG,yBAAyB,CAAC","sourcesContent":["export const STRIPE_WEBHOOK_EVENT = \"strip_webhook_event\";\nexport const STRIPE_WEBHOOK_SIGNATURE = \"strip_webhook_signature\";\n"]}
|
package/lib/esm/domain/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC","sourcesContent":["export * from \"./StripSettings\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./StripSettings";
|