@payloadcms/plugin-stripe 3.0.0-canary.ca3dd1c → 3.0.0-canary.cb7fa00
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/exports/client.d.ts +2 -0
- package/dist/exports/client.d.ts.map +1 -0
- package/dist/exports/client.js +4 -0
- package/dist/exports/client.js.map +1 -0
- package/dist/fields/getFields.d.ts.map +1 -1
- package/dist/fields/getFields.js +1 -2
- package/dist/fields/getFields.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/ui/LinkToDoc.d.ts +2 -2
- package/dist/ui/LinkToDoc.d.ts.map +1 -1
- package/dist/ui/LinkToDoc.js.map +1 -1
- package/package.json +14 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/exports/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/exports/client.ts"],"sourcesContent":["'use client'\n\nexport { LinkToDoc } from '../ui/LinkToDoc.js'\n"],"names":["LinkToDoc"],"mappings":"AAAA;AAEA,SAASA,SAAS,QAAQ,qBAAoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFields.d.ts","sourceRoot":"","sources":["../../src/fields/getFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEtD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"getFields.d.ts","sourceRoot":"","sources":["../../src/fields/getFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEtD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAE9D,UAAU,IAAI;IACZ,UAAU,EAAE,gBAAgB,CAAA;IAC5B,YAAY,EAAE,2BAA2B,CAAA;IACzC,UAAU,EAAE;QACV,kBAAkB,EAAE,MAAM,CAAA;KAC3B,CAAA;CACF;AAED,eAAO,MAAM,SAAS,6CAA8C,IAAI,KAAG,KAAK,EAyC/E,CAAA"}
|
package/dist/fields/getFields.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { LinkToDoc } from '../ui/LinkToDoc.js';
|
|
2
1
|
export const getFields = ({ collection, pluginConfig, syncConfig })=>{
|
|
3
2
|
const stripeIDField = {
|
|
4
3
|
name: 'stripeID',
|
|
@@ -24,7 +23,7 @@ export const getFields = ({ collection, pluginConfig, syncConfig })=>{
|
|
|
24
23
|
type: 'ui',
|
|
25
24
|
admin: {
|
|
26
25
|
components: {
|
|
27
|
-
Field: LinkToDoc
|
|
26
|
+
Field: '@payloadcms/plugin-stripe/client#LinkToDoc'
|
|
28
27
|
},
|
|
29
28
|
custom: {
|
|
30
29
|
isTestKey: pluginConfig.isTestKey,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/fields/getFields.ts"],"sourcesContent":["import type { CollectionConfig, Field } from 'payload'\n\nimport type { SanitizedStripePluginConfig } from '../types.js'\n\
|
|
1
|
+
{"version":3,"sources":["../../src/fields/getFields.ts"],"sourcesContent":["import type { CollectionConfig, Field } from 'payload'\n\nimport type { SanitizedStripePluginConfig } from '../types.js'\n\ninterface Args {\n collection: CollectionConfig\n pluginConfig: SanitizedStripePluginConfig\n syncConfig: {\n stripeResourceType: string\n }\n}\n\nexport const getFields = ({ collection, pluginConfig, syncConfig }: Args): Field[] => {\n const stripeIDField: Field = {\n name: 'stripeID',\n type: 'text',\n admin: {\n position: 'sidebar',\n readOnly: true,\n },\n label: 'Stripe ID',\n saveToJWT: true,\n }\n\n const skipSyncField: Field = {\n name: 'skipSync',\n type: 'checkbox',\n admin: {\n position: 'sidebar',\n readOnly: true,\n },\n label: 'Skip Sync',\n }\n\n const docUrlField: Field = {\n name: 'docUrl',\n type: 'ui',\n admin: {\n components: {\n Field: '@payloadcms/plugin-stripe/client#LinkToDoc',\n },\n custom: {\n isTestKey: pluginConfig.isTestKey,\n nameOfIDField: 'stripeID',\n stripeResourceType: syncConfig.stripeResourceType,\n },\n position: 'sidebar',\n },\n }\n\n const fields = [...collection.fields, stripeIDField, skipSyncField, docUrlField]\n\n return fields\n}\n"],"names":["getFields","collection","pluginConfig","syncConfig","stripeIDField","name","type","admin","position","readOnly","label","saveToJWT","skipSyncField","docUrlField","components","Field","custom","isTestKey","nameOfIDField","stripeResourceType","fields"],"mappings":"AAYA,OAAO,MAAMA,YAAY,CAAC,EAAEC,UAAU,EAAEC,YAAY,EAAEC,UAAU,EAAQ;IACtE,MAAMC,gBAAuB;QAC3BC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,UAAU;YACVC,UAAU;QACZ;QACAC,OAAO;QACPC,WAAW;IACb;IAEA,MAAMC,gBAAuB;QAC3BP,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,UAAU;YACVC,UAAU;QACZ;QACAC,OAAO;IACT;IAEA,MAAMG,cAAqB;QACzBR,MAAM;QACNC,MAAM;QACNC,OAAO;YACLO,YAAY;gBACVC,OAAO;YACT;YACAC,QAAQ;gBACNC,WAAWf,aAAae,SAAS;gBACjCC,eAAe;gBACfC,oBAAoBhB,WAAWgB,kBAAkB;YACnD;YACAX,UAAU;QACZ;IACF;IAEA,MAAMY,SAAS;WAAInB,WAAWmB,MAAM;QAAEhB;QAAeQ;QAAeC;KAAY;IAEhF,OAAOO;AACT,EAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Config } from 'payload';
|
|
2
2
|
import type { StripePluginConfig } from './types.js';
|
|
3
|
-
export { LinkToDoc } from './ui/LinkToDoc.js';
|
|
4
3
|
export { stripeProxy } from './utilities/stripeProxy.js';
|
|
5
4
|
export declare const stripePlugin: (incomingStripeConfig: StripePluginConfig) => (config: Config) => Config;
|
|
6
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAY,MAAM,SAAS,CAAA;AAE/C,OAAO,KAAK,EAA+B,kBAAkB,EAAE,MAAM,YAAY,CAAA;AASjF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAY,MAAM,SAAS,CAAA;AAE/C,OAAO,KAAK,EAA+B,kBAAkB,EAAE,MAAM,YAAY,CAAA;AASjF,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,eAAO,MAAM,YAAY,yBACA,kBAAkB,cAChC,MAAM,KAAG,MAmGjB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,6 @@ import { deleteFromStripe } from './hooks/deleteFromStripe.js';
|
|
|
4
4
|
import { syncExistingWithStripe } from './hooks/syncExistingWithStripe.js';
|
|
5
5
|
import { stripeREST } from './routes/rest.js';
|
|
6
6
|
import { stripeWebhooks } from './routes/webhooks.js';
|
|
7
|
-
export { LinkToDoc } from './ui/LinkToDoc.js';
|
|
8
7
|
export { stripeProxy } from './utilities/stripeProxy.js';
|
|
9
8
|
export const stripePlugin = (incomingStripeConfig)=>(config)=>{
|
|
10
9
|
const { collections } = config;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Config, Endpoint } 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'\n\nexport {
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Config, Endpoint } 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'\n\nexport { stripeProxy } from './utilities/stripeProxy.js'\n\nexport const stripePlugin =\n (incomingStripeConfig: StripePluginConfig) =>\n (config: Config): Config => {\n const { collections } = config\n\n // set config defaults here\n const pluginConfig: SanitizedStripePluginConfig = {\n ...incomingStripeConfig,\n rest: incomingStripeConfig?.rest ?? false,\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 (incomingStripeConfig?.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 return {\n ...config,\n collections: collections?.map((collection) => {\n const { hooks: existingHooks } = collection\n\n const syncConfig = pluginConfig.sync?.find((sync) => sync.collection === collection.slug)\n\n if (syncConfig) {\n const fields = getFields({\n collection,\n pluginConfig,\n syncConfig,\n })\n return {\n ...collection,\n fields,\n hooks: {\n ...collection.hooks,\n afterDelete: [\n ...(existingHooks?.afterDelete || []),\n (args) =>\n deleteFromStripe({\n ...args,\n collection,\n pluginConfig,\n }),\n ],\n beforeChange: [\n ...(existingHooks?.beforeChange || []),\n (args) =>\n syncExistingWithStripe({\n ...args,\n collection,\n pluginConfig,\n }),\n ],\n beforeValidate: [\n ...(existingHooks?.beforeValidate || []),\n (args) =>\n createNewInStripe({\n ...args,\n collection,\n pluginConfig,\n }),\n ],\n },\n }\n }\n\n return collection\n }),\n endpoints,\n }\n }\n"],"names":["getFields","createNewInStripe","deleteFromStripe","syncExistingWithStripe","stripeREST","stripeWebhooks","stripeProxy","stripePlugin","incomingStripeConfig","config","collections","pluginConfig","rest","sync","endpoints","handler","req","res","method","path","push","map","collection","hooks","existingHooks","syncConfig","find","slug","fields","afterDelete","args","beforeChange","beforeValidate"],"mappings":"AAIA,SAASA,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;AAErD,SAASC,WAAW,QAAQ,6BAA4B;AAExD,OAAO,MAAMC,eACX,CAACC,uBACD,CAACC;QACC,MAAM,EAAEC,WAAW,EAAE,GAAGD;QAExB,2BAA2B;QAC3B,MAAME,eAA4C;YAChD,GAAGH,oBAAoB;YACvBI,MAAMJ,sBAAsBI,QAAQ;YACpCC,MAAML,sBAAsBK,QAAQ,EAAE;QACxC;QAEA,6GAA6G;QAC7G,wGAAwG;QACxG,0EAA0E;QAE1E,MAAMC,YAAwB;eACxBL,QAAQK,aAAa,EAAE;YAC3B;gBACEC,SAAS,OAAOC;oBACd,MAAMC,MAAM,MAAMZ,eAAe;wBAC/BI;wBACAE;wBACAK;oBACF;oBAEA,OAAOC;gBACT;gBACAC,QAAQ;gBACRC,MAAM;YACR;SACD;QAED,IAAIX,sBAAsBI,MAAM;YAC9BE,UAAUM,IAAI,CAAC;gBACbL,SAAS,OAAOC;oBACd,MAAMC,MAAM,MAAMb,WAAW;wBAC3BO;wBACAK;oBACF;oBAEA,OAAOC;gBACT;gBACAC,QAAQ;gBACRC,MAAM;YACR;QACF;QAEA,OAAO;YACL,GAAGV,MAAM;YACTC,aAAaA,aAAaW,IAAI,CAACC;gBAC7B,MAAM,EAAEC,OAAOC,aAAa,EAAE,GAAGF;gBAEjC,MAAMG,aAAad,aAAaE,IAAI,EAAEa,KAAK,CAACb,OAASA,KAAKS,UAAU,KAAKA,WAAWK,IAAI;gBAExF,IAAIF,YAAY;oBACd,MAAMG,SAAS5B,UAAU;wBACvBsB;wBACAX;wBACAc;oBACF;oBACA,OAAO;wBACL,GAAGH,UAAU;wBACbM;wBACAL,OAAO;4BACL,GAAGD,WAAWC,KAAK;4BACnBM,aAAa;mCACPL,eAAeK,eAAe,EAAE;gCACpC,CAACC,OACC5B,iBAAiB;wCACf,GAAG4B,IAAI;wCACPR;wCACAX;oCACF;6BACH;4BACDoB,cAAc;mCACRP,eAAeO,gBAAgB,EAAE;gCACrC,CAACD,OACC3B,uBAAuB;wCACrB,GAAG2B,IAAI;wCACPR;wCACAX;oCACF;6BACH;4BACDqB,gBAAgB;mCACVR,eAAeQ,kBAAkB,EAAE;gCACvC,CAACF,OACC7B,kBAAkB;wCAChB,GAAG6B,IAAI;wCACPR;wCACAX;oCACF;6BACH;wBACH;oBACF;gBACF;gBAEA,OAAOW;YACT;YACAR;QACF;IACF,EAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type StripeWebhookHandler<T = any> = (args: {
|
|
|
7
7
|
pluginConfig?: StripePluginConfig;
|
|
8
8
|
req: PayloadRequest;
|
|
9
9
|
stripe: Stripe;
|
|
10
|
-
}) => void;
|
|
10
|
+
}) => Promise<void> | void;
|
|
11
11
|
export type StripeWebhookHandlers = {
|
|
12
12
|
[webhookName: string]: StripeWebhookHandler;
|
|
13
13
|
};
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC/E,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAEhC,MAAM,MAAM,oBAAoB,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE;IACjD,MAAM,EAAE,aAAa,CAAA;IACrB,KAAK,EAAE,CAAC,CAAA;IACR,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,CAAC,EAAE,kBAAkB,CAAA;IACjC,GAAG,EAAE,cAAc,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;CACf,KAAK,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC/E,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAEhC,MAAM,MAAM,oBAAoB,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE;IACjD,MAAM,EAAE,aAAa,CAAA;IACrB,KAAK,EAAE,CAAC,CAAA;IACR,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,CAAC,EAAE,kBAAkB,CAAA;IACjC,GAAG,EAAE,cAAc,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;CACf,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;AAE1B,MAAM,MAAM,qBAAqB,GAAG;IAClC,CAAC,WAAW,EAAE,MAAM,GAAG,oBAAoB,CAAA;CAC5C,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,eAAe,EAAE,CAAA;IACzB,kBAAkB,EAAE,WAAW,GAAG,UAAU,CAAA;IAC5C,0BAA0B,EAAE,UAAU,GAAG,SAAS,CAAA;CACnD,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,qBAAqB;IACrB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,eAAe,EAAE,MAAM,CAAA;IACvB,4BAA4B,CAAC,EAAE,MAAM,CAAA;IACrC,IAAI,CAAC,EAAE,UAAU,EAAE,CAAA;IACnB,QAAQ,CAAC,EAAE,oBAAoB,GAAG,qBAAqB,CAAA;CACxD,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,UAAU,EAAE,CAAA;CACnB,GAAG,kBAAkB,CAAA;AAEtB,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE;IAC/B,UAAU,EAAE,GAAG,EAAE,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;CACxB,KAAK,OAAO,CAAC;IACZ,IAAI,CAAC,EAAE,GAAG,CAAA;IACV,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACf,CAAC,CAAA"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { Payload, Config as PayloadConfig, PayloadRequest } from 'payload'\nimport type Stripe from 'stripe'\n\nexport type StripeWebhookHandler<T = any> = (args: {\n config: PayloadConfig\n event: T\n payload: Payload\n pluginConfig?: StripePluginConfig\n req: PayloadRequest\n stripe: Stripe\n}) => void\n\nexport type StripeWebhookHandlers = {\n [webhookName: string]: StripeWebhookHandler\n}\n\nexport type FieldSyncConfig = {\n fieldPath: string\n stripeProperty: string\n}\n\nexport type SyncConfig = {\n collection: string\n fields: FieldSyncConfig[]\n stripeResourceType: 'customers' | 'products' // TODO: get this from Stripe types\n stripeResourceTypeSingular: 'customer' | 'product' // TODO: there must be a better way to do this\n}\n\nexport type StripePluginConfig = {\n isTestKey?: boolean\n logs?: boolean\n /** @default false */\n rest?: boolean\n stripeSecretKey: string\n stripeWebhooksEndpointSecret?: string\n sync?: SyncConfig[]\n webhooks?: StripeWebhookHandler | StripeWebhookHandlers\n}\n\nexport type SanitizedStripePluginConfig = {\n sync: SyncConfig[] // convert to required\n} & StripePluginConfig\n\nexport type StripeProxy = (args: {\n stripeArgs: any[]\n stripeMethod: string\n stripeSecretKey: string\n}) => Promise<{\n data?: any\n message?: string\n status: number\n}>\n"],"names":[],"mappings":"AA2CA,WAQE"}
|
|
1
|
+
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { Payload, Config as PayloadConfig, PayloadRequest } from 'payload'\nimport type Stripe from 'stripe'\n\nexport type StripeWebhookHandler<T = any> = (args: {\n config: PayloadConfig\n event: T\n payload: Payload\n pluginConfig?: StripePluginConfig\n req: PayloadRequest\n stripe: Stripe\n}) => Promise<void> | void\n\nexport type StripeWebhookHandlers = {\n [webhookName: string]: StripeWebhookHandler\n}\n\nexport type FieldSyncConfig = {\n fieldPath: string\n stripeProperty: string\n}\n\nexport type SyncConfig = {\n collection: string\n fields: FieldSyncConfig[]\n stripeResourceType: 'customers' | 'products' // TODO: get this from Stripe types\n stripeResourceTypeSingular: 'customer' | 'product' // TODO: there must be a better way to do this\n}\n\nexport type StripePluginConfig = {\n isTestKey?: boolean\n logs?: boolean\n /** @default false */\n rest?: boolean\n stripeSecretKey: string\n stripeWebhooksEndpointSecret?: string\n sync?: SyncConfig[]\n webhooks?: StripeWebhookHandler | StripeWebhookHandlers\n}\n\nexport type SanitizedStripePluginConfig = {\n sync: SyncConfig[] // convert to required\n} & StripePluginConfig\n\nexport type StripeProxy = (args: {\n stripeArgs: any[]\n stripeMethod: string\n stripeSecretKey: string\n}) => Promise<{\n data?: any\n message?: string\n status: number\n}>\n"],"names":[],"mappings":"AA2CA,WAQE"}
|
package/dist/ui/LinkToDoc.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { CustomComponent,
|
|
2
|
-
export declare const LinkToDoc: CustomComponent
|
|
1
|
+
import type { CustomComponent, PayloadClientReactComponent } from 'payload';
|
|
2
|
+
export declare const LinkToDoc: PayloadClientReactComponent<CustomComponent>;
|
|
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,
|
|
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"}
|
package/dist/ui/LinkToDoc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ui/LinkToDoc.tsx"],"sourcesContent":["'use client'\nimport type { CustomComponent,
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/plugin-stripe",
|
|
3
|
-
"version": "3.0.0-canary.
|
|
3
|
+
"version": "3.0.0-canary.cb7fa00",
|
|
4
4
|
"description": "Stripe plugin for Payload",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"payload",
|
|
@@ -31,6 +31,11 @@
|
|
|
31
31
|
"import": "./dist/exports/types.js",
|
|
32
32
|
"types": "./dist/exports/types.d.ts",
|
|
33
33
|
"default": "./dist/exports/types.js"
|
|
34
|
+
},
|
|
35
|
+
"./client": {
|
|
36
|
+
"import": "./dist/exports/client.js",
|
|
37
|
+
"types": "./dist/exports/client.d.ts",
|
|
38
|
+
"default": "./dist/exports/client.js"
|
|
34
39
|
}
|
|
35
40
|
},
|
|
36
41
|
"main": "./dist/index.js",
|
|
@@ -42,7 +47,7 @@
|
|
|
42
47
|
"lodash.get": "^4.4.2",
|
|
43
48
|
"stripe": "^10.2.0",
|
|
44
49
|
"uuid": "10.0.0",
|
|
45
|
-
"@payloadcms/ui": "3.0.0-canary.
|
|
50
|
+
"@payloadcms/ui": "3.0.0-canary.cb7fa00"
|
|
46
51
|
},
|
|
47
52
|
"devDependencies": {
|
|
48
53
|
"@types/express": "^4.17.9",
|
|
@@ -50,16 +55,16 @@
|
|
|
50
55
|
"@types/react": "npm:types-react@19.0.0-rc.0",
|
|
51
56
|
"@types/react-dom": "npm:types-react-dom@19.0.0-rc.0",
|
|
52
57
|
"@types/uuid": "10.0.0",
|
|
53
|
-
"@payloadcms/translations": "3.0.0-canary.ca3dd1c",
|
|
54
|
-
"@payloadcms/next": "3.0.0-canary.ca3dd1c",
|
|
55
58
|
"@payloadcms/eslint-config": "3.0.0-beta.59",
|
|
56
|
-
"@payloadcms/
|
|
57
|
-
"
|
|
59
|
+
"@payloadcms/translations": "3.0.0-canary.cb7fa00",
|
|
60
|
+
"@payloadcms/ui": "3.0.0-canary.cb7fa00",
|
|
61
|
+
"@payloadcms/next": "3.0.0-canary.cb7fa00",
|
|
62
|
+
"payload": "3.0.0-canary.cb7fa00"
|
|
58
63
|
},
|
|
59
64
|
"peerDependencies": {
|
|
60
|
-
"@payloadcms/translations": "3.0.0-canary.
|
|
61
|
-
"@payloadcms/ui": "3.0.0-canary.
|
|
62
|
-
"payload": "3.0.0-canary.
|
|
65
|
+
"@payloadcms/translations": "3.0.0-canary.cb7fa00",
|
|
66
|
+
"@payloadcms/ui": "3.0.0-canary.cb7fa00",
|
|
67
|
+
"payload": "3.0.0-canary.cb7fa00"
|
|
63
68
|
},
|
|
64
69
|
"publishConfig": {
|
|
65
70
|
"registry": "https://registry.npmjs.org/"
|