@payloadcms/plugin-stripe 4.0.0-internal.ea6e8f8 → 4.0.0-internal.ee5d8bd

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.
Files changed (2) hide show
  1. package/dist/index.js.map +1 -1
  2. package/package.json +27 -30
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Endpoint } from 'payload'\n\nimport { definePlugin } from 'payload'\n\nimport type { SanitizedStripePluginConfig, StripePluginConfig } from './types.js'\n\nimport { getFields } from './fields/getFields.js'\nimport { createNewInStripe } from './hooks/createNewInStripe.js'\nimport { deleteFromStripe } from './hooks/deleteFromStripe.js'\nimport { syncExistingWithStripe } from './hooks/syncExistingWithStripe.js'\nimport { stripeREST } from './routes/rest.js'\nimport { stripeWebhooks } from './routes/webhooks.js'\nimport { sanitizeStripeRESTConfig } from './utilities/sanitizeStripeRESTConfig.js'\n\nexport { stripeProxy } from './utilities/stripeProxy.js'\n\nexport const stripePlugin = definePlugin<StripePluginConfig>({\n slug: '@payloadcms/plugin-stripe',\n plugin: ({ config, options: incomingStripeConfig }) => {\n const { collections } = config\n\n // set config defaults here\n const pluginConfig: SanitizedStripePluginConfig = {\n ...incomingStripeConfig,\n rest: sanitizeStripeRESTConfig({ rest: incomingStripeConfig?.rest }),\n sync: incomingStripeConfig?.sync || [],\n }\n\n // NOTE: env variables are never passed to the client, but we need to know if `stripeSecretKey` is a test key\n // unfortunately we must set the 'isTestKey' property on the config instead of using the following code:\n // const isTestKey = stripeConfig.stripeSecretKey?.startsWith('sk_test_');\n\n const endpoints: Endpoint[] = [\n ...(config?.endpoints || []),\n {\n handler: async (req) => {\n const res = await stripeWebhooks({\n config,\n pluginConfig,\n req,\n })\n\n return res\n },\n method: 'post',\n path: '/stripe/webhooks',\n },\n ]\n\n if (pluginConfig.rest) {\n endpoints.push({\n handler: async (req) => {\n const res = await stripeREST({\n pluginConfig,\n req,\n })\n\n return res\n },\n method: 'post' as Endpoint['method'],\n path: '/stripe/rest',\n })\n }\n\n for (const collection of collections!) {\n const { hooks: existingHooks } = collection\n\n const syncConfig = pluginConfig.sync?.find((sync) => sync.collection === collection.slug)\n\n if (!syncConfig) {\n continue\n }\n const fields = getFields({\n collection,\n pluginConfig,\n syncConfig,\n })\n collection.fields = fields\n\n if (!collection.hooks) {\n collection.hooks = {}\n }\n\n collection.hooks.afterDelete = [\n ...(existingHooks?.afterDelete || []),\n (args) =>\n deleteFromStripe({\n ...args,\n collection,\n pluginConfig,\n }),\n ]\n collection.hooks.beforeChange = [\n ...(existingHooks?.beforeChange || []),\n (args) =>\n syncExistingWithStripe({\n ...args,\n collection,\n pluginConfig,\n }),\n ]\n collection.hooks.beforeValidate = [\n ...(existingHooks?.beforeValidate || []),\n (args) =>\n createNewInStripe({\n ...args,\n collection,\n pluginConfig,\n }),\n ]\n }\n\n config.endpoints = endpoints\n\n return config\n },\n})\n"],"names":["definePlugin","getFields","createNewInStripe","deleteFromStripe","syncExistingWithStripe","stripeREST","stripeWebhooks","sanitizeStripeRESTConfig","stripeProxy","stripePlugin","slug","plugin","config","options","incomingStripeConfig","collections","pluginConfig","rest","sync","endpoints","handler","req","res","method","path","push","collection","hooks","existingHooks","syncConfig","find","fields","afterDelete","args","beforeChange","beforeValidate"],"mappings":"AAEA,SAASA,YAAY,QAAQ,UAAS;AAItC,SAASC,SAAS,QAAQ,wBAAuB;AACjD,SAASC,iBAAiB,QAAQ,+BAA8B;AAChE,SAASC,gBAAgB,QAAQ,8BAA6B;AAC9D,SAASC,sBAAsB,QAAQ,oCAAmC;AAC1E,SAASC,UAAU,QAAQ,mBAAkB;AAC7C,SAASC,cAAc,QAAQ,uBAAsB;AACrD,SAASC,wBAAwB,QAAQ,0CAAyC;AAElF,SAASC,WAAW,QAAQ,6BAA4B;AAExD,OAAO,MAAMC,eAAeT,aAAiC;IAC3DU,MAAM;IACNC,QAAQ,CAAC,EAAEC,MAAM,E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;gBACrC,CAACD,OACC7B,uBAAuB;wBACrB,GAAG6B,IAAI;wBACPP;wBACAV;oBACF;aACH;YACDU,WAAWC,KAAK,CAACQ,cAAc,GAAG;mBAC5BP,eAAeO,kBAAkB,EAAE;gBACvC,CAACF,OACC/B,kBAAkB;wBAChB,GAAG+B,IAAI;wBACPP;wBACAV;oBACF;aACH;QACH;QAEAJ,OAAOO,SAAS,GAAGA;QAEnB,OAAOP;IACT;AACF,GAAE"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Endpoint } from 'payload'\n\nimport { definePlugin } from 'payload'\n\nimport type { SanitizedStripePluginConfig, StripePluginConfig } from './types.js'\n\nimport { getFields } from './fields/getFields.js'\nimport { createNewInStripe } from './hooks/createNewInStripe.js'\nimport { deleteFromStripe } from './hooks/deleteFromStripe.js'\nimport { syncExistingWithStripe } from './hooks/syncExistingWithStripe.js'\nimport { stripeREST } from './routes/rest.js'\nimport { stripeWebhooks } from './routes/webhooks.js'\nimport { sanitizeStripeRESTConfig } from './utilities/sanitizeStripeRESTConfig.js'\n\nexport { stripeProxy } from './utilities/stripeProxy.js'\n\nexport const stripePlugin = definePlugin<StripePluginConfig>({\n slug: '@payloadcms/plugin-stripe',\n plugin: ({ config, options: incomingStripeConfig }) => {\n const { collections } = config\n\n // set config defaults here\n const pluginConfig: SanitizedStripePluginConfig = {\n ...incomingStripeConfig,\n rest: sanitizeStripeRESTConfig({ rest: incomingStripeConfig?.rest }),\n sync: incomingStripeConfig?.sync || [],\n }\n\n // NOTE: env variables are never passed to the client, but we need to know if `stripeSecretKey` is a test key\n // unfortunately we must set the 'isTestKey' property on the config instead of using the following code:\n // const isTestKey = stripeConfig.stripeSecretKey?.startsWith('sk_test_');\n\n const endpoints: Endpoint[] = [\n ...(config?.endpoints || []),\n {\n handler: async (req) => {\n const res = await stripeWebhooks({\n config,\n pluginConfig,\n req,\n })\n\n return res\n },\n method: 'post',\n path: '/stripe/webhooks',\n },\n ]\n\n if (pluginConfig.rest) {\n endpoints.push({\n handler: async (req) => {\n const res = await stripeREST({\n pluginConfig,\n req,\n })\n\n return res\n },\n method: 'post',\n path: '/stripe/rest',\n })\n }\n\n for (const collection of collections!) {\n const { hooks: existingHooks } = collection\n\n const syncConfig = pluginConfig.sync?.find((sync) => sync.collection === collection.slug)\n\n if (!syncConfig) {\n continue\n }\n const fields = getFields({\n collection,\n pluginConfig,\n syncConfig,\n })\n collection.fields = fields\n\n if (!collection.hooks) {\n collection.hooks = {}\n }\n\n collection.hooks.afterDelete = [\n ...(existingHooks?.afterDelete || []),\n (args) =>\n deleteFromStripe({\n ...args,\n collection,\n pluginConfig,\n }),\n ]\n collection.hooks.beforeChange = [\n ...(existingHooks?.beforeChange || []),\n (args) =>\n syncExistingWithStripe({\n ...args,\n collection,\n pluginConfig,\n }),\n ]\n collection.hooks.beforeValidate = [\n ...(existingHooks?.beforeValidate || []),\n (args) =>\n createNewInStripe({\n ...args,\n collection,\n pluginConfig,\n }),\n ]\n }\n\n config.endpoints = endpoints\n\n return config\n },\n})\n"],"names":["definePlugin","getFields","createNewInStripe","deleteFromStripe","syncExistingWithStripe","stripeREST","stripeWebhooks","sanitizeStripeRESTConfig","stripeProxy","stripePlugin","slug","plugin","config","options","incomingStripeConfig","collections","pluginConfig","rest","sync","endpoints","handler","req","res","method","path","push","collection","hooks","existingHooks","syncConfig","find","fields","afterDelete","args","beforeChange","beforeValidate"],"mappings":"AAEA,SAASA,YAAY,QAAQ,UAAS;AAItC,SAASC,SAAS,QAAQ,wBAAuB;AACjD,SAASC,iBAAiB,QAAQ,+BAA8B;AAChE,SAASC,gBAAgB,QAAQ,8BAA6B;AAC9D,SAASC,sBAAsB,QAAQ,oCAAmC;AAC1E,SAASC,UAAU,QAAQ,mBAAkB;AAC7C,SAASC,cAAc,QAAQ,uBAAsB;AACrD,SAASC,wBAAwB,QAAQ,0CAAyC;AAElF,SAASC,WAAW,QAAQ,6BAA4B;AAExD,OAAO,MAAMC,eAAeT,aAAiC;I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AACO,YAAY,GAAG;mBAC1BN,eAAeM,gBAAgB,EAAE;gBACrC,CAACD,OACC7B,uBAAuB;wBACrB,GAAG6B,IAAI;wBACPP;wBACAV;oBACF;aACH;YACDU,WAAWC,KAAK,CAACQ,cAAc,GAAG;mBAC5BP,eAAeO,kBAAkB,EAAE;gBACvC,CAACF,OACC/B,kBAAkB;wBAChB,GAAG+B,IAAI;wBACPP;wBACAV;oBACF;aACH;QACH;QAEAJ,OAAOO,SAAS,GAAGA;QAEnB,OAAOP;IACT;AACF,GAAE"}
package/package.json CHANGED
@@ -1,23 +1,18 @@
1
1
  {
2
2
  "name": "@payloadcms/plugin-stripe",
3
- "version": "4.0.0-internal.ea6e8f8",
3
+ "version": "4.0.0-internal.ee5d8bd",
4
4
  "description": "Stripe plugin for Payload",
5
5
  "keywords": [
6
- "payload",
7
- "stripe",
8
6
  "cms",
9
- "plugin",
10
- "typescript",
7
+ "licensing",
8
+ "payload",
11
9
  "payments",
10
+ "plugin",
12
11
  "saas",
12
+ "stripe",
13
13
  "subscriptions",
14
- "licensing"
14
+ "typescript"
15
15
  ],
16
- "repository": {
17
- "type": "git",
18
- "url": "https://github.com/payloadcms/payload.git",
19
- "directory": "packages/plugin-stripe"
20
- },
21
16
  "license": "MIT",
22
17
  "author": "Payload <dev@payloadcms.com> (https://payloadcms.com)",
23
18
  "maintainers": [
@@ -27,8 +22,18 @@
27
22
  "url": "https://payloadcms.com"
28
23
  }
29
24
  ],
30
- "sideEffects": false,
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "https://github.com/payloadcms/payload.git",
28
+ "directory": "packages/plugin-stripe"
29
+ },
30
+ "files": [
31
+ "dist"
32
+ ],
31
33
  "type": "module",
34
+ "sideEffects": false,
35
+ "main": "./dist/index.js",
36
+ "types": "./dist/index.d.ts",
32
37
  "exports": {
33
38
  ".": {
34
39
  "import": "./dist/index.js",
@@ -46,31 +51,25 @@
46
51
  "default": "./dist/exports/client.js"
47
52
  }
48
53
  },
49
- "main": "./dist/index.js",
50
- "types": "./dist/index.d.ts",
51
- "files": [
52
- "dist"
53
- ],
54
+ "publishConfig": {
55
+ "registry": "https://registry.npmjs.org/"
56
+ },
54
57
  "dependencies": {
58
+ "@payloadcms/translations": "4.0.0-internal.ee5d8bd",
59
+ "@payloadcms/ui": "4.0.0-internal.ee5d8bd",
55
60
  "lodash.get": "^4.4.2",
56
61
  "stripe": "^10.2.0",
57
- "uuid": "14.0.0",
58
- "@payloadcms/translations": "4.0.0-internal.ea6e8f8",
59
- "@payloadcms/ui": "4.0.0-internal.ea6e8f8"
62
+ "uuid": "14.0.0"
60
63
  },
61
64
  "devDependencies": {
65
+ "@payloadcms/next": "4.0.0-internal.ee5d8bd",
62
66
  "@types/lodash.get": "^4.4.7",
63
67
  "@types/react": "19.3.0",
64
68
  "@types/react-dom": "19.3.0",
65
- "@payloadcms/eslint-config": "3.28.0",
66
- "@payloadcms/next": "4.0.0-internal.ea6e8f8",
67
- "payload": "4.0.0-internal.ea6e8f8"
69
+ "payload": "4.0.0-internal.ee5d8bd"
68
70
  },
69
71
  "peerDependencies": {
70
- "payload": "4.0.0-internal.ea6e8f8"
71
- },
72
- "publishConfig": {
73
- "registry": "https://registry.npmjs.org/"
72
+ "payload": "4.0.0-internal.ee5d8bd"
74
73
  },
75
74
  "homepage:": "https://payloadcms.com",
76
75
  "scripts": {
@@ -79,8 +78,6 @@
79
78
  "build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
80
79
  "build:types": "tsc --emitDeclarationOnly --outDir dist",
81
80
  "clean": "rimraf -g {dist,*.tsbuildinfo}",
82
- "copyfiles": "copyfiles -u 1 -e \"**/*.spec.*\" \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
83
- "lint": "eslint .",
84
- "lint:fix": "eslint . --fix"
81
+ "copyfiles": "copyfiles -u 1 -e \"**/*.spec.*\" \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/"
85
82
  }
86
83
  }