@payloadcms/plugin-stripe 0.0.18 → 3.0.0-alpha.67
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/README.md +3 -285
- package/dist/admin.d.ts +2 -1
- package/dist/admin.d.ts.map +1 -0
- package/dist/admin.js +23 -32
- package/dist/admin.js.map +1 -1
- package/dist/fields/getFields.d.ts +2 -1
- package/dist/fields/getFields.d.ts.map +1 -0
- package/dist/fields/getFields.js +25 -41
- package/dist/fields/getFields.js.map +1 -1
- package/dist/hooks/createNewInStripe.d.ts +7 -2
- package/dist/hooks/createNewInStripe.d.ts.map +1 -0
- package/dist/hooks/createNewInStripe.js +70 -124
- package/dist/hooks/createNewInStripe.js.map +1 -1
- package/dist/hooks/deleteFromStripe.d.ts +7 -2
- package/dist/hooks/deleteFromStripe.d.ts.map +1 -0
- package/dist/hooks/deleteFromStripe.js +30 -87
- package/dist/hooks/deleteFromStripe.js.map +1 -1
- package/dist/hooks/syncExistingWithStripe.d.ts +7 -2
- package/dist/hooks/syncExistingWithStripe.d.ts.map +1 -0
- package/dist/hooks/syncExistingWithStripe.js +42 -94
- package/dist/hooks/syncExistingWithStripe.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +87 -139
- package/dist/index.js.map +1 -1
- package/dist/payload-stripe-plugin.postman_collection.json +301 -0
- package/dist/routes/rest.d.ts +4 -6
- package/dist/routes/rest.d.ts.map +1 -0
- package/dist/routes/rest.js +33 -76
- package/dist/routes/rest.js.map +1 -1
- package/dist/routes/webhooks.d.ts +4 -6
- package/dist/routes/webhooks.d.ts.map +1 -0
- package/dist/routes/webhooks.js +49 -94
- package/dist/routes/webhooks.js.map +1 -1
- package/dist/types.d.ts +138 -11
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -2
- package/dist/types.js.map +1 -1
- package/dist/ui/LinkToDoc.d.ts +4 -7
- package/dist/ui/LinkToDoc.d.ts.map +1 -0
- package/dist/ui/LinkToDoc.js +29 -31
- package/dist/ui/LinkToDoc.js.map +1 -1
- package/dist/utilities/deepen.d.ts +1 -0
- package/dist/utilities/deepen.d.ts.map +1 -0
- package/dist/utilities/deepen.js +9 -16
- package/dist/utilities/deepen.js.map +1 -1
- package/dist/utilities/stripeProxy.d.ts +2 -1
- package/dist/utilities/stripeProxy.d.ts.map +1 -0
- package/dist/utilities/stripeProxy.js +37 -88
- package/dist/utilities/stripeProxy.js.map +1 -1
- package/dist/webhooks/handleCreatedOrUpdated.d.ts +3 -2
- package/dist/webhooks/handleCreatedOrUpdated.d.ts.map +1 -0
- package/dist/webhooks/handleCreatedOrUpdated.js +115 -196
- package/dist/webhooks/handleCreatedOrUpdated.js.map +1 -1
- package/dist/webhooks/handleDeleted.d.ts +2 -1
- package/dist/webhooks/handleDeleted.d.ts.map +1 -0
- package/dist/webhooks/handleDeleted.js +44 -102
- package/dist/webhooks/handleDeleted.js.map +1 -1
- package/dist/webhooks/index.d.ts +2 -1
- package/dist/webhooks/index.d.ts.map +1 -0
- package/dist/webhooks/index.js +46 -90
- package/dist/webhooks/index.js.map +1 -1
- package/package.json +50 -45
- package/types.d.ts +1 -1
- package/types.js +1 -1
- package/dist/extendWebpackConfig.d.ts +0 -3
- package/dist/extendWebpackConfig.js +0 -29
- package/dist/extendWebpackConfig.js.map +0 -1
package/dist/ui/LinkToDoc.js
CHANGED
|
@@ -1,36 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var fields = _a[0];
|
|
14
|
-
return fields[nameOfIDField];
|
|
15
|
-
});
|
|
16
|
-
var stripeID = (field || {}).value;
|
|
17
|
-
var stripeEnv = isTestKey ? 'test/' : '';
|
|
18
|
-
var href = "https://dashboard.stripe.com/".concat(stripeEnv).concat(stripeResourceType, "/").concat(stripeID);
|
|
1
|
+
'use client';
|
|
2
|
+
import { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider';
|
|
3
|
+
// import CopyToClipboard from 'payload/dist/admin/components/elements/CopyToClipboard'
|
|
4
|
+
import { useFormFields } from '@payloadcms/ui/forms/Form';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
export const LinkToDoc = ()=>{
|
|
7
|
+
const { custom } = useFieldProps();
|
|
8
|
+
const { isTestKey, nameOfIDField, stripeResourceType } = custom;
|
|
9
|
+
const field = useFormFields(([fields])=>fields[nameOfIDField]);
|
|
10
|
+
const { value: stripeID } = field || {};
|
|
11
|
+
const stripeEnv = isTestKey ? 'test/' : '';
|
|
12
|
+
const href = `https://dashboard.stripe.com/${stripeEnv}${stripeResourceType}/${stripeID}`;
|
|
19
13
|
if (stripeID) {
|
|
20
|
-
return (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
14
|
+
return /*#__PURE__*/ React.createElement("div", null, /*#__PURE__*/ React.createElement("div", null, /*#__PURE__*/ React.createElement("span", {
|
|
15
|
+
className: "label",
|
|
16
|
+
style: {
|
|
17
|
+
color: '#9A9A9A'
|
|
18
|
+
}
|
|
19
|
+
}, "View in Stripe")), /*#__PURE__*/ React.createElement("div", {
|
|
20
|
+
style: {
|
|
21
|
+
fontWeight: '600',
|
|
22
|
+
overflow: 'hidden',
|
|
23
|
+
textOverflow: 'ellipsis'
|
|
24
|
+
}
|
|
25
|
+
}, /*#__PURE__*/ React.createElement("a", {
|
|
26
|
+
href: href,
|
|
27
|
+
rel: "noreferrer noopener",
|
|
28
|
+
target: "_blank"
|
|
29
|
+
}, href)));
|
|
32
30
|
}
|
|
33
31
|
return null;
|
|
34
32
|
};
|
|
35
|
-
|
|
33
|
+
|
|
36
34
|
//# sourceMappingURL=LinkToDoc.js.map
|
package/dist/ui/LinkToDoc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../src/ui/LinkToDoc.tsx"],"sourcesContent":["'use client'\nimport type { CustomComponent } from 'payload/config'\nimport type { UIField } from 'payload/types'\n\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\n// import CopyToClipboard from 'payload/dist/admin/components/elements/CopyToClipboard'\nimport { useFormFields } from '@payloadcms/ui/forms/Form'\nimport React from 'react'\n\nexport const LinkToDoc: CustomComponent<UIField> = () => {\n const { custom } = useFieldProps()\n const { isTestKey, nameOfIDField, stripeResourceType } = custom\n\n const field = useFormFields(([fields]) => fields[nameOfIDField])\n const { value: stripeID } = field || {}\n\n const stripeEnv = isTestKey ? 'test/' : ''\n const href = `https://dashboard.stripe.com/${stripeEnv}${stripeResourceType}/${stripeID}`\n\n if (stripeID) {\n return (\n <div>\n <div>\n <span\n className=\"label\"\n style={{\n color: '#9A9A9A',\n }}\n >\n View in Stripe\n </span>\n {/* <CopyToClipboard value={href} /> */}\n </div>\n <div\n style={{\n fontWeight: '600',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n }}\n >\n <a href={href} rel=\"noreferrer noopener\" target=\"_blank\">\n {href}\n </a>\n </div>\n </div>\n )\n }\n\n return null\n}\n"],"names":["useFieldProps","useFormFields","React","LinkToDoc","custom","isTestKey","nameOfIDField","stripeResourceType","field","fields","value","stripeID","stripeEnv","href","div","span","className","style","color","fontWeight","overflow","textOverflow","a","rel","target"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,aAAa,QAAQ,0CAAyC;AACvE,uFAAuF;AACvF,SAASC,aAAa,QAAQ,4BAA2B;AACzD,OAAOC,WAAW,QAAO;AAEzB,OAAO,MAAMC,YAAsC;IACjD,MAAM,EAAEC,MAAM,EAAE,GAAGJ;IACnB,MAAM,EAAEK,SAAS,EAAEC,aAAa,EAAEC,kBAAkB,EAAE,GAAGH;IAEzD,MAAMI,QAAQP,cAAc,CAAC,CAACQ,OAAO,GAAKA,MAAM,CAACH,cAAc;IAC/D,MAAM,EAAEI,OAAOC,QAAQ,EAAE,GAAGH,SAAS,CAAC;IAEtC,MAAMI,YAAYP,YAAY,UAAU;IACxC,MAAMQ,OAAO,CAAC,6BAA6B,EAAED,UAAU,EAAEL,mBAAmB,CAAC,EAAEI,SAAS,CAAC;IAEzF,IAAIA,UAAU;QACZ,qBACE,oBAACG,2BACC,oBAACA,2BACC,oBAACC;YACCC,WAAU;YACVC,OAAO;gBACLC,OAAO;YACT;WACD,kCAKH,oBAACJ;YACCG,OAAO;gBACLE,YAAY;gBACZC,UAAU;gBACVC,cAAc;YAChB;yBAEA,oBAACC;YAAET,MAAMA;YAAMU,KAAI;YAAsBC,QAAO;WAC7CX;IAKX;IAEA,OAAO;AACT,EAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deepen.d.ts","sourceRoot":"","sources":["../../src/utilities/deepen.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,QAAS,OAAO,MAAM,EAAE,GAAG,CAAC,KAAG,OAAO,MAAM,EAAE,GAAG,CAiBnE,CAAA"}
|
package/dist/utilities/deepen.js
CHANGED
|
@@ -1,28 +1,21 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// converts an object of dot notation keys to a nested object
|
|
3
2
|
// i.e. { 'price.stripePriceID': '123' } to { price: { stripePriceID: '123' } }
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var current = result;
|
|
12
|
-
keys.forEach(function (k, index) {
|
|
3
|
+
export const deepen = (obj)=>{
|
|
4
|
+
const result = {};
|
|
5
|
+
for(const key in obj){
|
|
6
|
+
const value = obj[key];
|
|
7
|
+
const keys = key.split('.');
|
|
8
|
+
let current = result;
|
|
9
|
+
keys.forEach((k, index)=>{
|
|
13
10
|
if (index === keys.length - 1) {
|
|
14
11
|
current[k] = value;
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
12
|
+
} else {
|
|
17
13
|
current[k] = current[k] || {};
|
|
18
14
|
current = current[k];
|
|
19
15
|
}
|
|
20
16
|
});
|
|
21
|
-
};
|
|
22
|
-
for (var key in obj) {
|
|
23
|
-
_loop_1(key);
|
|
24
17
|
}
|
|
25
18
|
return result;
|
|
26
19
|
};
|
|
27
|
-
|
|
20
|
+
|
|
28
21
|
//# sourceMappingURL=deepen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/deepen.ts"],"sourcesContent":["// converts an object of dot notation keys to a nested object\n// i.e. { 'price.stripePriceID': '123' } to { price: { stripePriceID: '123' } }\n\nexport const deepen = (obj: Record<string, any>): Record<string, any> => {\n const result: Record<string, any> = {}\n\n for (const key in obj) {\n const value = obj[key]\n const keys = key.split('.')\n let current = result\n keys.forEach((k, index) => {\n if (index === keys.length - 1) {\n current[k] = value\n } else {\n current[k] = current[k] || {}\n current = current[k]\n }\n })\n }\n return result\n}\n"],"names":["deepen","obj","result","key","value","keys","split","current","forEach","k","index","length"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":"AAAA,6DAA6D;AAC7D,+EAA+E;AAE/E,OAAO,MAAMA,SAAS,CAACC;IACrB,MAAMC,SAA8B,CAAC;IAErC,IAAK,MAAMC,OAAOF,IAAK;QACrB,MAAMG,QAAQH,GAAG,CAACE,IAAI;QACtB,MAAME,OAAOF,IAAIG,KAAK,CAAC;QACvB,IAAIC,UAAUL;QACdG,KAAKG,OAAO,CAAC,CAACC,GAAGC;YACf,IAAIA,UAAUL,KAAKM,MAAM,GAAG,GAAG;gBAC7BJ,OAAO,CAACE,EAAE,GAAGL;YACf,OAAO;gBACLG,OAAO,CAACE,EAAE,GAAGF,OAAO,CAACE,EAAE,IAAI,CAAC;gBAC5BF,UAAUA,OAAO,CAACE,EAAE;YACtB;QACF;IACF;IACA,OAAOP;AACT,EAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stripeProxy.d.ts","sourceRoot":"","sources":["../../src/utilities/stripeProxy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,eAAO,MAAM,WAAW,EAAE,WAyCzB,CAAA"}
|
|
@@ -1,93 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import lodashGet from 'lodash.get';
|
|
2
|
+
import Stripe from 'stripe';
|
|
3
|
+
export const stripeProxy = async ({ stripeArgs, stripeMethod, stripeSecretKey })=>{
|
|
4
|
+
const stripe = new Stripe(stripeSecretKey, {
|
|
5
|
+
apiVersion: '2022-08-01',
|
|
6
|
+
appInfo: {
|
|
7
|
+
name: 'Stripe Payload Plugin',
|
|
8
|
+
url: 'https://payloadcms.com'
|
|
9
|
+
}
|
|
9
10
|
});
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
11
|
+
if (typeof stripeMethod === 'string') {
|
|
12
|
+
const topLevelMethod = stripeMethod.split('.')[0];
|
|
13
|
+
const contextToBind = stripe[topLevelMethod];
|
|
14
|
+
// NOTE: 'lodashGet' uses dot notation to get the property of an object
|
|
15
|
+
// NOTE: Stripe API methods using reference "this" within their functions, so we need to bind context
|
|
16
|
+
const foundMethod = lodashGet(stripe, stripeMethod).bind(contextToBind);
|
|
17
|
+
if (typeof foundMethod === 'function') {
|
|
18
|
+
if (Array.isArray(stripeArgs)) {
|
|
19
|
+
try {
|
|
20
|
+
const stripeResponse = await foundMethod(...stripeArgs);
|
|
21
|
+
return {
|
|
22
|
+
data: stripeResponse,
|
|
23
|
+
status: 200
|
|
24
|
+
};
|
|
25
|
+
} catch (error) {
|
|
26
|
+
return {
|
|
27
|
+
message: `A Stripe API error has occurred: ${error}`,
|
|
28
|
+
status: 404
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
} else {
|
|
32
|
+
throw new Error(`Argument 'stripeArgs' must be an array.`);
|
|
32
33
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
} else {
|
|
35
|
+
throw Error(`The provided Stripe method of '${stripeMethod}' is not a part of the Stripe API.`);
|
|
36
|
+
}
|
|
37
|
+
} else {
|
|
38
|
+
throw Error('You must provide a Stripe method to call.');
|
|
36
39
|
}
|
|
37
40
|
};
|
|
38
|
-
|
|
39
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
-
};
|
|
41
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.stripeProxy = void 0;
|
|
43
|
-
var lodash_get_1 = __importDefault(require("lodash.get"));
|
|
44
|
-
var stripe_1 = __importDefault(require("stripe"));
|
|
45
|
-
var stripeProxy = function (_a) {
|
|
46
|
-
var stripeSecretKey = _a.stripeSecretKey, stripeMethod = _a.stripeMethod, stripeArgs = _a.stripeArgs;
|
|
47
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
48
|
-
var stripe, topLevelMethod, contextToBind, foundMethod, stripeResponse, error_1;
|
|
49
|
-
return __generator(this, function (_b) {
|
|
50
|
-
switch (_b.label) {
|
|
51
|
-
case 0:
|
|
52
|
-
stripe = new stripe_1.default(stripeSecretKey, {
|
|
53
|
-
apiVersion: '2022-08-01',
|
|
54
|
-
appInfo: {
|
|
55
|
-
name: 'Stripe Payload Plugin',
|
|
56
|
-
url: 'https://payloadcms.com',
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
if (!(typeof stripeMethod === 'string')) return [3 /*break*/, 9];
|
|
60
|
-
topLevelMethod = stripeMethod.split('.')[0];
|
|
61
|
-
contextToBind = stripe[topLevelMethod];
|
|
62
|
-
foundMethod = (0, lodash_get_1.default)(stripe, stripeMethod).bind(contextToBind);
|
|
63
|
-
if (!(typeof foundMethod === 'function')) return [3 /*break*/, 7];
|
|
64
|
-
if (!Array.isArray(stripeArgs)) return [3 /*break*/, 5];
|
|
65
|
-
_b.label = 1;
|
|
66
|
-
case 1:
|
|
67
|
-
_b.trys.push([1, 3, , 4]);
|
|
68
|
-
return [4 /*yield*/, foundMethod.apply(void 0, stripeArgs)];
|
|
69
|
-
case 2:
|
|
70
|
-
stripeResponse = _b.sent();
|
|
71
|
-
return [2 /*return*/, {
|
|
72
|
-
status: 200,
|
|
73
|
-
data: stripeResponse,
|
|
74
|
-
}];
|
|
75
|
-
case 3:
|
|
76
|
-
error_1 = _b.sent();
|
|
77
|
-
return [2 /*return*/, {
|
|
78
|
-
status: 404,
|
|
79
|
-
message: "A Stripe API error has occurred: ".concat(error_1),
|
|
80
|
-
}];
|
|
81
|
-
case 4: return [3 /*break*/, 6];
|
|
82
|
-
case 5: throw new Error("Argument 'stripeArgs' must be an array.");
|
|
83
|
-
case 6: return [3 /*break*/, 8];
|
|
84
|
-
case 7: throw Error("The provided Stripe method of '".concat(stripeMethod, "' is not a part of the Stripe API."));
|
|
85
|
-
case 8: return [3 /*break*/, 10];
|
|
86
|
-
case 9: throw Error('You must provide a Stripe method to call.');
|
|
87
|
-
case 10: return [2 /*return*/];
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
exports.stripeProxy = stripeProxy;
|
|
41
|
+
|
|
93
42
|
//# sourceMappingURL=stripeProxy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/stripeProxy.ts"],"sourcesContent":["import lodashGet from 'lodash.get'\nimport Stripe from 'stripe'\n\nimport type { StripeProxy } from '../types.js'\n\nexport const stripeProxy: StripeProxy = async ({ stripeArgs, stripeMethod, stripeSecretKey }) => {\n const stripe = new Stripe(stripeSecretKey, {\n apiVersion: '2022-08-01',\n appInfo: {\n name: 'Stripe Payload Plugin',\n url: 'https://payloadcms.com',\n },\n })\n\n if (typeof stripeMethod === 'string') {\n const topLevelMethod = stripeMethod.split('.')[0] as keyof Stripe\n const contextToBind = stripe[topLevelMethod]\n // NOTE: 'lodashGet' uses dot notation to get the property of an object\n // NOTE: Stripe API methods using reference \"this\" within their functions, so we need to bind context\n const foundMethod = lodashGet(stripe, stripeMethod).bind(contextToBind)\n\n if (typeof foundMethod === 'function') {\n if (Array.isArray(stripeArgs)) {\n try {\n const stripeResponse = await foundMethod(...stripeArgs)\n return {\n data: stripeResponse,\n status: 200,\n }\n } catch (error: unknown) {\n return {\n message: `A Stripe API error has occurred: ${error}`,\n status: 404,\n }\n }\n } else {\n throw new Error(`Argument 'stripeArgs' must be an array.`)\n }\n } else {\n throw Error(\n `The provided Stripe method of '${stripeMethod}' is not a part of the Stripe API.`,\n )\n }\n } else {\n throw Error('You must provide a Stripe method to call.')\n }\n}\n"],"names":["lodashGet","Stripe","stripeProxy","stripeArgs","stripeMethod","stripeSecretKey","stripe","apiVersion","appInfo","name","url","topLevelMethod","split","contextToBind","foundMethod","bind","Array","isArray","stripeResponse","data","status","error","message","Error"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,eAAe,aAAY;AAClC,OAAOC,YAAY,SAAQ;AAI3B,OAAO,MAAMC,cAA2B,OAAO,EAAEC,UAAU,EAAEC,YAAY,EAAEC,eAAe,EAAE;IAC1F,MAAMC,SAAS,IAAIL,OAAOI,iBAAiB;QACzCE,YAAY;QACZC,SAAS;YACPC,MAAM;YACNC,KAAK;QACP;IACF;IAEA,IAAI,OAAON,iBAAiB,UAAU;QACpC,MAAMO,iBAAiBP,aAAaQ,KAAK,CAAC,IAAI,CAAC,EAAE;QACjD,MAAMC,gBAAgBP,MAAM,CAACK,eAAe;QAC5C,uEAAuE;QACvE,qGAAqG;QACrG,MAAMG,cAAcd,UAAUM,QAAQF,cAAcW,IAAI,CAACF;QAEzD,IAAI,OAAOC,gBAAgB,YAAY;YACrC,IAAIE,MAAMC,OAAO,CAACd,aAAa;gBAC7B,IAAI;oBACF,MAAMe,iBAAiB,MAAMJ,eAAeX;oBAC5C,OAAO;wBACLgB,MAAMD;wBACNE,QAAQ;oBACV;gBACF,EAAE,OAAOC,OAAgB;oBACvB,OAAO;wBACLC,SAAS,CAAC,iCAAiC,EAAED,MAAM,CAAC;wBACpDD,QAAQ;oBACV;gBACF;YACF,OAAO;gBACL,MAAM,IAAIG,MAAM,CAAC,uCAAuC,CAAC;YAC3D;QACF,OAAO;YACL,MAAMA,MACJ,CAAC,+BAA+B,EAAEnB,aAAa,kCAAkC,CAAC;QAEtF;IACF,OAAO;QACL,MAAMmB,MAAM;IACd;AACF,EAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { SanitizedStripeConfig, StripeWebhookHandler } from '../types';
|
|
1
|
+
import type { SanitizedStripeConfig, StripeWebhookHandler } from '../types.js';
|
|
2
2
|
type HandleCreatedOrUpdated = (args: Parameters<StripeWebhookHandler>[0] & {
|
|
3
|
-
syncConfig: SanitizedStripeConfig['sync'][0];
|
|
4
3
|
resourceType: string;
|
|
4
|
+
syncConfig: SanitizedStripeConfig['sync'][0];
|
|
5
5
|
}) => void;
|
|
6
6
|
export declare const handleCreatedOrUpdated: HandleCreatedOrUpdated;
|
|
7
7
|
export {};
|
|
8
|
+
//# sourceMappingURL=handleCreatedOrUpdated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleCreatedOrUpdated.d.ts","sourceRoot":"","sources":["../../src/webhooks/handleCreatedOrUpdated.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAI9E,KAAK,sBAAsB,GAAG,CAC5B,IAAI,EAAE,UAAU,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,GAAG;IAC1C,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;CAC7C,KACE,IAAI,CAAA;AAET,eAAO,MAAM,sBAAsB,EAAE,sBAsLpC,CAAA"}
|