@payloadcms/plugin-stripe 3.0.0-beta.126 → 3.0.0-beta.128

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.
@@ -1,3 +1,3 @@
1
- import type { CustomComponent, PayloadClientReactComponent } from 'payload';
2
- export declare const LinkToDoc: PayloadClientReactComponent<CustomComponent>;
1
+ import type { UIFieldClientComponent } from 'payload';
2
+ export declare const LinkToDoc: UIFieldClientComponent;
3
3
  //# sourceMappingURL=LinkToDoc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LinkToDoc.d.ts","sourceRoot":"","sources":["../../src/ui/LinkToDoc.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAA;AAK3E,eAAO,MAAM,SAAS,EAAE,2BAA2B,CAAC,eAAe,CAwClE,CAAA"}
1
+ {"version":3,"file":"LinkToDoc.d.ts","sourceRoot":"","sources":["../../src/ui/LinkToDoc.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAKrD,eAAO,MAAM,SAAS,EAAE,sBA0CvB,CAAA"}
@@ -1,9 +1,9 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { CopyToClipboard, useFieldProps, useFormFields } from '@payloadcms/ui';
3
+ import { CopyToClipboard, useFormFields } from '@payloadcms/ui';
4
4
  import React from 'react';
5
- export const LinkToDoc = ()=>{
6
- const { custom } = useFieldProps();
5
+ export const LinkToDoc = (props)=>{
6
+ const { field: { admin: { custom = {} } = {} } } = props;
7
7
  const { isTestKey, nameOfIDField, stripeResourceType } = custom;
8
8
  const field = useFormFields(([fields])=>fields && fields?.[nameOfIDField] || null);
9
9
  const { value: stripeID } = field || {};
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/LinkToDoc.tsx"],"sourcesContent":["'use client'\nimport type { CustomComponent, PayloadClientReactComponent } from 'payload'\n\nimport { CopyToClipboard, useFieldProps, useFormFields } from '@payloadcms/ui'\nimport React from 'react'\n\nexport const LinkToDoc: PayloadClientReactComponent<CustomComponent> = () => {\n const { custom } = useFieldProps()\n const { isTestKey, nameOfIDField, stripeResourceType } = custom\n\n const field = useFormFields(([fields]) => (fields && fields?.[nameOfIDField]) || null)\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":["CopyToClipboard","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"],"mappings":"AAAA;;AAGA,SAASA,eAAe,EAAEC,aAAa,EAAEC,aAAa,QAAQ,iBAAgB;AAC9E,OAAOC,WAAW,QAAO;AAEzB,OAAO,MAAMC,YAA0D;IACrE,MAAM,EAAEC,MAAM,EAAE,GAAGJ;IACnB,MAAM,EAAEK,SAAS,EAAEC,aAAa,EAAEC,kBAAkB,EAAE,GAAGH;IAEzD,MAAMI,QAAQP,cAAc,CAAC,CAACQ,OAAO,GAAK,AAACA,UAAUA,QAAQ,CAACH,cAAc,IAAK;IACjF,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,MAACG;;8BACC,MAACA;;sCACC,KAACC;4BACCC,WAAU;4BACVC,OAAO;gCACLC,OAAO;4BACT;sCACD;;sCAGD,KAACnB;4BAAgBW,OAAOG;;;;8BAE1B,KAACC;oBACCG,OAAO;wBACLE,YAAY;wBACZC,UAAU;wBACVC,cAAc;oBAChB;8BAEA,cAAA,KAACC;wBAAET,MAAMA;wBAAMU,KAAI;wBAAsBC,QAAO;kCAC7CX;;;;;IAKX;IAEA,OAAO;AACT,EAAC"}
1
+ {"version":3,"sources":["../../src/ui/LinkToDoc.tsx"],"sourcesContent":["'use client'\nimport type { UIFieldClientComponent } from 'payload'\n\nimport { CopyToClipboard, useFormFields } from '@payloadcms/ui'\nimport React from 'react'\n\nexport const LinkToDoc: UIFieldClientComponent = (props) => {\n const {\n field: { admin: { custom = {} } = {} },\n } = props\n const { isTestKey, nameOfIDField, stripeResourceType } = custom\n\n const field = useFormFields(([fields]) => (fields && fields?.[nameOfIDField]) || null)\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":["CopyToClipboard","useFormFields","React","LinkToDoc","props","field","admin","custom","isTestKey","nameOfIDField","stripeResourceType","fields","value","stripeID","stripeEnv","href","div","span","className","style","color","fontWeight","overflow","textOverflow","a","rel","target"],"mappings":"AAAA;;AAGA,SAASA,eAAe,EAAEC,aAAa,QAAQ,iBAAgB;AAC/D,OAAOC,WAAW,QAAO;AAEzB,OAAO,MAAMC,YAAoC,CAACC;IAChD,MAAM,EACJC,OAAO,EAAEC,OAAO,EAAEC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,EACvC,GAAGH;IACJ,MAAM,EAAEI,SAAS,EAAEC,aAAa,EAAEC,kBAAkB,EAAE,GAAGH;IAEzD,MAAMF,QAAQJ,cAAc,CAAC,CAACU,OAAO,GAAK,AAACA,UAAUA,QAAQ,CAACF,cAAc,IAAK;IACjF,MAAM,EAAEG,OAAOC,QAAQ,EAAE,GAAGR,SAAS,CAAC;IAEtC,MAAMS,YAAYN,YAAY,UAAU;IACxC,MAAMO,OAAO,CAAC,6BAA6B,EAAED,UAAU,EAAEJ,mBAAmB,CAAC,EAAEG,SAAS,CAAC;IAEzF,IAAIA,UAAU;QACZ,qBACE,MAACG;;8BACC,MAACA;;sCACC,KAACC;4BACCC,WAAU;4BACVC,OAAO;gCACLC,OAAO;4BACT;sCACD;;sCAGD,KAACpB;4BAAgBY,OAAOG;;;;8BAE1B,KAACC;oBACCG,OAAO;wBACLE,YAAY;wBACZC,UAAU;wBACVC,cAAc;oBAChB;8BAEA,cAAA,KAACC;wBAAET,MAAMA;wBAAMU,KAAI;wBAAsBC,QAAO;kCAC7CX;;;;;IAKX;IAEA,OAAO;AACT,EAAC"}
@@ -22,9 +22,9 @@ export const handleWebhooks = (args)=>{
22
22
  });
23
23
  break;
24
24
  }
25
- case 'updated':
25
+ case 'deleted':
26
26
  {
27
- void handleCreatedOrUpdated({
27
+ void handleDeleted({
28
28
  ...args,
29
29
  pluginConfig,
30
30
  resourceType,
@@ -32,9 +32,9 @@ export const handleWebhooks = (args)=>{
32
32
  });
33
33
  break;
34
34
  }
35
- case 'deleted':
35
+ case 'updated':
36
36
  {
37
- void handleDeleted({
37
+ void handleCreatedOrUpdated({
38
38
  ...args,
39
39
  pluginConfig,
40
40
  resourceType,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/webhooks/index.ts"],"sourcesContent":["import type { StripeWebhookHandler } from '../types.js'\n\nimport { handleCreatedOrUpdated } from './handleCreatedOrUpdated.js'\nimport { handleDeleted } from './handleDeleted.js'\n\nexport const handleWebhooks: StripeWebhookHandler = (args) => {\n const { event, payload, pluginConfig } = args\n\n if (pluginConfig?.logs) {\n payload.logger.info(`🪝 Received Stripe '${event.type}' webhook event with ID: '${event.id}'.`)\n }\n\n // could also traverse into event.data.object.object to get the type, but that seems unreliable\n // use cli: `stripe resources` to see all available resources\n const resourceType = event.type.split('.')[0]\n const method = event.type.split('.').pop()\n\n const syncConfig = pluginConfig?.sync?.find(\n (sync) => sync.stripeResourceTypeSingular === resourceType,\n )\n\n if (syncConfig) {\n switch (method) {\n case 'created': {\n void handleCreatedOrUpdated({\n ...args,\n pluginConfig,\n resourceType,\n syncConfig,\n })\n break\n }\n case 'updated': {\n void handleCreatedOrUpdated({\n ...args,\n pluginConfig,\n resourceType,\n syncConfig,\n })\n break\n }\n case 'deleted': {\n void handleDeleted({\n ...args,\n pluginConfig,\n resourceType,\n syncConfig,\n })\n break\n }\n default: {\n break\n }\n }\n }\n}\n"],"names":["handleCreatedOrUpdated","handleDeleted","handleWebhooks","args","event","payload","pluginConfig","logs","logger","info","type","id","resourceType","split","method","pop","syncConfig","sync","find","stripeResourceTypeSingular"],"mappings":"AAEA,SAASA,sBAAsB,QAAQ,8BAA6B;AACpE,SAASC,aAAa,QAAQ,qBAAoB;AAElD,OAAO,MAAMC,iBAAuC,CAACC;IACnD,MAAM,EAAEC,KAAK,EAAEC,OAAO,EAAEC,YAAY,EAAE,GAAGH;IAEzC,IAAIG,cAAcC,MAAM;QACtBF,QAAQG,MAAM,CAACC,IAAI,CAAC,CAAC,oBAAoB,EAAEL,MAAMM,IAAI,CAAC,0BAA0B,EAAEN,MAAMO,EAAE,CAAC,EAAE,CAAC;IAChG;IAEA,+FAA+F;IAC/F,6DAA6D;IAC7D,MAAMC,eAAeR,MAAMM,IAAI,CAACG,KAAK,CAAC,IAAI,CAAC,EAAE;IAC7C,MAAMC,SAASV,MAAMM,IAAI,CAACG,KAAK,CAAC,KAAKE,GAAG;IAExC,MAAMC,aAAaV,cAAcW,MAAMC,KACrC,CAACD,OAASA,KAAKE,0BAA0B,KAAKP;IAGhD,IAAII,YAAY;QACd,OAAQF;YACN,KAAK;gBAAW;oBACd,KAAKd,uBAAuB;wBAC1B,GAAGG,IAAI;wBACPG;wBACAM;wBACAI;oBACF;oBACA;gBACF;YACA,KAAK;gBAAW;oBACd,KAAKhB,uBAAuB;wBAC1B,GAAGG,IAAI;wBACPG;wBACAM;wBACAI;oBACF;oBACA;gBACF;YACA,KAAK;gBAAW;oBACd,KAAKf,cAAc;wBACjB,GAAGE,IAAI;wBACPG;wBACAM;wBACAI;oBACF;oBACA;gBACF;YACA;gBAAS;oBACP;gBACF;QACF;IACF;AACF,EAAC"}
1
+ {"version":3,"sources":["../../src/webhooks/index.ts"],"sourcesContent":["import type { StripeWebhookHandler } from '../types.js'\n\nimport { handleCreatedOrUpdated } from './handleCreatedOrUpdated.js'\nimport { handleDeleted } from './handleDeleted.js'\n\nexport const handleWebhooks: StripeWebhookHandler = (args) => {\n const { event, payload, pluginConfig } = args\n\n if (pluginConfig?.logs) {\n payload.logger.info(`🪝 Received Stripe '${event.type}' webhook event with ID: '${event.id}'.`)\n }\n\n // could also traverse into event.data.object.object to get the type, but that seems unreliable\n // use cli: `stripe resources` to see all available resources\n const resourceType = event.type.split('.')[0]\n const method = event.type.split('.').pop()\n\n const syncConfig = pluginConfig?.sync?.find(\n (sync) => sync.stripeResourceTypeSingular === resourceType,\n )\n\n if (syncConfig) {\n switch (method) {\n case 'created': {\n void handleCreatedOrUpdated({\n ...args,\n pluginConfig,\n resourceType,\n syncConfig,\n })\n break\n }\n case 'deleted': {\n void handleDeleted({\n ...args,\n pluginConfig,\n resourceType,\n syncConfig,\n })\n break\n }\n case 'updated': {\n void handleCreatedOrUpdated({\n ...args,\n pluginConfig,\n resourceType,\n syncConfig,\n })\n break\n }\n default: {\n break\n }\n }\n }\n}\n"],"names":["handleCreatedOrUpdated","handleDeleted","handleWebhooks","args","event","payload","pluginConfig","logs","logger","info","type","id","resourceType","split","method","pop","syncConfig","sync","find","stripeResourceTypeSingular"],"mappings":"AAEA,SAASA,sBAAsB,QAAQ,8BAA6B;AACpE,SAASC,aAAa,QAAQ,qBAAoB;AAElD,OAAO,MAAMC,iBAAuC,CAACC;IACnD,MAAM,EAAEC,KAAK,EAAEC,OAAO,EAAEC,YAAY,EAAE,GAAGH;IAEzC,IAAIG,cAAcC,MAAM;QACtBF,QAAQG,MAAM,CAACC,IAAI,CAAC,CAAC,oBAAoB,EAAEL,MAAMM,IAAI,CAAC,0BAA0B,EAAEN,MAAMO,EAAE,CAAC,EAAE,CAAC;IAChG;IAEA,+FAA+F;IAC/F,6DAA6D;IAC7D,MAAMC,eAAeR,MAAMM,IAAI,CAACG,KAAK,CAAC,IAAI,CAAC,EAAE;IAC7C,MAAMC,SAASV,MAAMM,IAAI,CAACG,KAAK,CAAC,KAAKE,GAAG;IAExC,MAAMC,aAAaV,cAAcW,MAAMC,KACrC,CAACD,OAASA,KAAKE,0BAA0B,KAAKP;IAGhD,IAAII,YAAY;QACd,OAAQF;YACN,KAAK;gBAAW;oBACd,KAAKd,uBAAuB;wBAC1B,GAAGG,IAAI;wBACPG;wBACAM;wBACAI;oBACF;oBACA;gBACF;YACA,KAAK;gBAAW;oBACd,KAAKf,cAAc;wBACjB,GAAGE,IAAI;wBACPG;wBACAM;wBACAI;oBACF;oBACA;gBACF;YACA,KAAK;gBAAW;oBACd,KAAKhB,uBAAuB;wBAC1B,GAAGG,IAAI;wBACPG;wBACAM;wBACAI;oBACF;oBACA;gBACF;YACA;gBAAS;oBACP;gBACF;QACF;IACF;AACF,EAAC"}
package/license.md ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018-2024 Payload CMS, Inc. <info@payloadcms.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/plugin-stripe",
3
- "version": "3.0.0-beta.126",
3
+ "version": "3.0.0-beta.128",
4
4
  "description": "Stripe plugin for Payload",
5
5
  "keywords": [
6
6
  "payload",
@@ -20,6 +20,13 @@
20
20
  },
21
21
  "license": "MIT",
22
22
  "author": "Payload <dev@payloadcms.com> (https://payloadcms.com)",
23
+ "maintainers": [
24
+ {
25
+ "name": "Payload",
26
+ "email": "info@payloadcms.com",
27
+ "url": "https://payloadcms.com"
28
+ }
29
+ ],
23
30
  "type": "module",
24
31
  "exports": {
25
32
  ".": {
@@ -47,20 +54,20 @@
47
54
  "lodash.get": "^4.4.2",
48
55
  "stripe": "^10.2.0",
49
56
  "uuid": "10.0.0",
50
- "@payloadcms/ui": "3.0.0-beta.126",
51
- "@payloadcms/translations": "3.0.0-beta.126"
57
+ "@payloadcms/translations": "3.0.0-beta.128",
58
+ "@payloadcms/ui": "3.0.0-beta.128"
52
59
  },
53
60
  "devDependencies": {
54
61
  "@types/lodash.get": "^4.4.7",
55
62
  "@types/react": "npm:types-react@19.0.0-rc.1",
56
63
  "@types/react-dom": "npm:types-react-dom@19.0.0-rc.1",
57
64
  "@types/uuid": "10.0.0",
58
- "payload": "3.0.0-beta.126",
59
- "@payloadcms/next": "3.0.0-beta.126",
60
- "@payloadcms/eslint-config": "3.0.0-beta.112"
65
+ "@payloadcms/eslint-config": "3.0.0-beta.112",
66
+ "payload": "3.0.0-beta.128",
67
+ "@payloadcms/next": "3.0.0-beta.128"
61
68
  },
62
69
  "peerDependencies": {
63
- "payload": "3.0.0-beta.126"
70
+ "payload": "3.0.0-beta.128"
64
71
  },
65
72
  "publishConfig": {
66
73
  "registry": "https://registry.npmjs.org/"