@payloadcms/plugin-stripe 0.0.16 → 0.0.17

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.
@@ -0,0 +1,4 @@
1
+ import type { Config } from 'payload/config';
2
+ import type { StripeConfig } from './types';
3
+ export declare const stripePlugin: (incomingStripeConfig: StripeConfig) => (config: Config) => Config;
4
+ //# sourceMappingURL=admin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAE5C,OAAO,KAAK,EAAyB,YAAY,EAAE,MAAM,SAAS,CAAA;AAIlE,eAAO,MAAM,YAAY,yBACA,YAAY,cAC1B,MAAM,KAAG,MAmCjB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { Config } from 'payload/config';
2
+ import type { Configuration as WebpackConfig } from 'webpack';
3
+ export declare const extendWebpackConfig: (config: Config) => (webpackConfig: WebpackConfig) => WebpackConfig;
4
+ //# sourceMappingURL=extendWebpackConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extendWebpackConfig.d.ts","sourceRoot":"","sources":["../src/extendWebpackConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EAAE,aAAa,IAAI,aAAa,EAAE,MAAM,SAAS,CAAA;AAI7D,eAAO,MAAM,mBAAmB,WACrB,MAAM,qBAAoB,aAAa,KAAK,aAiBpD,CAAA"}
@@ -0,0 +1,12 @@
1
+ import type { CollectionConfig, Field } from 'payload/types';
2
+ import type { SanitizedStripeConfig } from '../types';
3
+ interface Args {
4
+ collection: CollectionConfig;
5
+ stripeConfig: SanitizedStripeConfig;
6
+ syncConfig: {
7
+ stripeResourceType: string;
8
+ };
9
+ }
10
+ export declare const getFields: ({ collection, stripeConfig, syncConfig }: Args) => Field[];
11
+ export {};
12
+ //# sourceMappingURL=getFields.d.ts.map
@@ -0,0 +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,eAAe,CAAA;AAE5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAIrD,UAAU,IAAI;IACZ,UAAU,EAAE,gBAAgB,CAAA;IAC5B,YAAY,EAAE,qBAAqB,CAAA;IACnC,UAAU,EAAE;QACV,kBAAkB,EAAE,MAAM,CAAA;KAC3B,CAAA;CACF;AAED,eAAO,MAAM,SAAS,6CAA8C,IAAI,KAAG,KAAK,EA0C/E,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { CollectionBeforeValidateHook, CollectionConfig } from 'payload/types';
2
+ import type { StripeConfig } from '../types';
3
+ export type CollectionBeforeValidateHookWithArgs = (args: Parameters<CollectionBeforeValidateHook>[0] & {
4
+ collection?: CollectionConfig;
5
+ stripeConfig?: StripeConfig;
6
+ }) => void;
7
+ export declare const createNewInStripe: CollectionBeforeValidateHookWithArgs;
8
+ //# sourceMappingURL=createNewInStripe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createNewInStripe.d.ts","sourceRoot":"","sources":["../../src/hooks/createNewInStripe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAKnF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAO5C,MAAM,MAAM,oCAAoC,GAAG,CACjD,IAAI,EAAE,UAAU,CAAC,4BAA4B,CAAC,CAAC,CAAC,CAAC,GAAG;IAClD,UAAU,CAAC,EAAE,gBAAgB,CAAA;IAC7B,YAAY,CAAC,EAAE,YAAY,CAAA;CAC5B,KACE,IAAI,CAAA;AAET,eAAO,MAAM,iBAAiB,EAAE,oCA4G/B,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { CollectionAfterDeleteHook, CollectionConfig } from 'payload/types';
2
+ import type { StripeConfig } from '../types';
3
+ export type CollectionAfterDeleteHookWithArgs = (args: Parameters<CollectionAfterDeleteHook>[0] & {
4
+ collection?: CollectionConfig;
5
+ stripeConfig?: StripeConfig;
6
+ }) => void;
7
+ export declare const deleteFromStripe: CollectionAfterDeleteHookWithArgs;
8
+ //# sourceMappingURL=deleteFromStripe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deleteFromStripe.d.ts","sourceRoot":"","sources":["../../src/hooks/deleteFromStripe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAKhF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAK5C,MAAM,MAAM,iCAAiC,GAAG,CAC9C,IAAI,EAAE,UAAU,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,GAAG;IAC/C,UAAU,CAAC,EAAE,gBAAgB,CAAA;IAC7B,YAAY,CAAC,EAAE,YAAY,CAAA;CAC5B,KACE,IAAI,CAAA;AAET,eAAO,MAAM,gBAAgB,EAAE,iCAwC9B,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { CollectionBeforeChangeHook, CollectionConfig } from 'payload/types';
2
+ import type { StripeConfig } from '../types';
3
+ export type CollectionBeforeChangeHookWithArgs = (args: Parameters<CollectionBeforeChangeHook>[0] & {
4
+ collection?: CollectionConfig;
5
+ stripeConfig?: StripeConfig;
6
+ }) => void;
7
+ export declare const syncExistingWithStripe: CollectionBeforeChangeHookWithArgs;
8
+ //# sourceMappingURL=syncExistingWithStripe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syncExistingWithStripe.d.ts","sourceRoot":"","sources":["../../src/hooks/syncExistingWithStripe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAKjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAO5C,MAAM,MAAM,kCAAkC,GAAG,CAC/C,IAAI,EAAE,UAAU,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC,GAAG;IAChD,UAAU,CAAC,EAAE,gBAAgB,CAAA;IAC7B,YAAY,CAAC,EAAE,YAAY,CAAA;CAC5B,KACE,IAAI,CAAA;AAET,eAAO,MAAM,sBAAsB,EAAE,kCA8DpC,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { Config } from 'payload/config';
2
+ import type { StripeConfig } from './types';
3
+ export declare const stripePlugin: (incomingStripeConfig: StripeConfig) => (config: Config) => Config;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAY,MAAM,gBAAgB,CAAA;AAKtD,OAAO,KAAK,EAAyB,YAAY,EAAE,MAAM,SAAS,CAAA;AAUlE,eAAO,MAAM,YAAY,yBACA,YAAY,cAC1B,MAAM,KAAG,MA2GjB,CAAA"}
@@ -0,0 +1,10 @@
1
+ import type { Response } from 'express';
2
+ import type { PayloadRequest } from 'payload/types';
3
+ import type { StripeConfig } from '../types';
4
+ export declare const stripeREST: (args: {
5
+ next: any;
6
+ req: PayloadRequest;
7
+ res: Response;
8
+ stripeConfig: StripeConfig;
9
+ }) => Promise<any>;
10
+ //# sourceMappingURL=rest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rest.d.ts","sourceRoot":"","sources":["../../src/routes/rest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAInD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAI5C,eAAO,MAAM,UAAU,SAAgB;IACrC,IAAI,EAAE,GAAG,CAAA;IACT,GAAG,EAAE,cAAc,CAAA;IACnB,GAAG,EAAE,QAAQ,CAAA;IACb,YAAY,EAAE,YAAY,CAAA;CAC3B,KAAG,QAAQ,GAAG,CAoCd,CAAA"}
@@ -0,0 +1,12 @@
1
+ import type { Response } from 'express';
2
+ import type { Config as PayloadConfig } from 'payload/config';
3
+ import type { PayloadRequest } from 'payload/dist/types';
4
+ import type { StripeConfig } from '../types';
5
+ export declare const stripeWebhooks: (args: {
6
+ config: PayloadConfig;
7
+ next: any;
8
+ req: PayloadRequest;
9
+ res: Response;
10
+ stripeConfig: StripeConfig;
11
+ }) => Promise<any>;
12
+ //# sourceMappingURL=webhooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../src/routes/webhooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AACvC,OAAO,KAAK,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAIxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAI5C,eAAO,MAAM,cAAc,SAAgB;IACzC,MAAM,EAAE,aAAa,CAAA;IACrB,IAAI,EAAE,GAAG,CAAA;IACT,GAAG,EAAE,cAAc,CAAA;IACnB,GAAG,EAAE,QAAQ,CAAA;IACb,YAAY,EAAE,YAAY,CAAA;CAC3B,KAAG,QAAQ,GAAG,CAoEd,CAAA"}
@@ -0,0 +1,45 @@
1
+ import type { Payload } from 'payload';
2
+ import type { Config as PayloadConfig } from 'payload/config';
3
+ import type Stripe from 'stripe';
4
+ export type StripeWebhookHandler<T = any> = (args: {
5
+ config: PayloadConfig;
6
+ event: T;
7
+ payload: Payload;
8
+ stripe: Stripe;
9
+ stripeConfig?: StripeConfig;
10
+ }) => void;
11
+ export interface StripeWebhookHandlers {
12
+ [webhookName: string]: StripeWebhookHandler;
13
+ }
14
+ export interface FieldSyncConfig {
15
+ fieldPath: string;
16
+ stripeProperty: string;
17
+ }
18
+ export interface SyncConfig {
19
+ collection: string;
20
+ fields: FieldSyncConfig[];
21
+ stripeResourceType: 'customers' | 'products';
22
+ stripeResourceTypeSingular: 'customer' | 'product';
23
+ }
24
+ export interface StripeConfig {
25
+ isTestKey?: boolean;
26
+ logs?: boolean;
27
+ rest?: boolean;
28
+ stripeSecretKey: string;
29
+ stripeWebhooksEndpointSecret?: string;
30
+ sync?: SyncConfig[];
31
+ webhooks?: StripeWebhookHandler | StripeWebhookHandlers;
32
+ }
33
+ export type SanitizedStripeConfig = StripeConfig & {
34
+ sync: SyncConfig[];
35
+ };
36
+ export type StripeProxy = (args: {
37
+ stripeArgs: any[];
38
+ stripeMethod: string;
39
+ stripeSecretKey: string;
40
+ }) => Promise<{
41
+ data?: any;
42
+ message?: string;
43
+ status: number;
44
+ }>;
45
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC7D,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,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,YAAY,CAAA;CAC5B,KAAK,IAAI,CAAA;AAEV,MAAM,WAAW,qBAAqB;IACpC,CAAC,WAAW,EAAE,MAAM,GAAG,oBAAoB,CAAA;CAC5C;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAA;IACjB,cAAc,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,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;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,IAAI,CAAC,EAAE,OAAO,CAAA;IAEd,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;AAED,MAAM,MAAM,qBAAqB,GAAG,YAAY,GAAG;IACjD,IAAI,EAAE,UAAU,EAAE,CAAA;CACnB,CAAA;AAED,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"}
@@ -0,0 +1,8 @@
1
+ import type { UIField } from 'payload/dist/fields/config/types';
2
+ import React from 'react';
3
+ export declare const LinkToDoc: React.FC<UIField & {
4
+ isTestKey: boolean;
5
+ nameOfIDField: string;
6
+ stripeResourceType: string;
7
+ }>;
8
+ //# sourceMappingURL=LinkToDoc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinkToDoc.d.ts","sourceRoot":"","sources":["../../src/ui/LinkToDoc.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAA;AAI/D,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAC9B,OAAO,GAAG;IACR,SAAS,EAAE,OAAO,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,kBAAkB,EAAE,MAAM,CAAA;CAC3B,CAwCF,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const deepen: (obj: Record<string, any>) => Record<string, any>;
2
+ //# sourceMappingURL=deepen.d.ts.map
@@ -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"}
@@ -0,0 +1,3 @@
1
+ import type { StripeProxy } from '../types';
2
+ export declare const stripeProxy: StripeProxy;
3
+ //# sourceMappingURL=stripeProxy.d.ts.map
@@ -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,UAAU,CAAA;AAE3C,eAAO,MAAM,WAAW,EAAE,WAyCzB,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { SanitizedStripeConfig, StripeWebhookHandler } from '../types';
2
+ type HandleCreatedOrUpdated = (args: Parameters<StripeWebhookHandler>[0] & {
3
+ resourceType: string;
4
+ syncConfig: SanitizedStripeConfig['sync'][0];
5
+ }) => void;
6
+ export declare const handleCreatedOrUpdated: HandleCreatedOrUpdated;
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,UAAU,CAAA;AAI3E,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"}
@@ -0,0 +1,8 @@
1
+ import type { SanitizedStripeConfig, StripeWebhookHandler } from '../types';
2
+ type HandleDeleted = (args: Parameters<StripeWebhookHandler>[0] & {
3
+ resourceType: string;
4
+ syncConfig: SanitizedStripeConfig['sync'][0];
5
+ }) => void;
6
+ export declare const handleDeleted: HandleDeleted;
7
+ export {};
8
+ //# sourceMappingURL=handleDeleted.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handleDeleted.d.ts","sourceRoot":"","sources":["../../src/webhooks/handleDeleted.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAE3E,KAAK,aAAa,GAAG,CACnB,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,aAAa,EAAE,aAwE3B,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { StripeWebhookHandler } from '../types';
2
+ export declare const handleWebhooks: StripeWebhookHandler;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/webhooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAKpD,eAAO,MAAM,cAAc,EAAE,oBAiD5B,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/plugin-stripe",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "homepage:": "https://payloadcms.com",
5
5
  "repository": "git@github.com:payloadcms/plugin-stripe.git",
6
6
  "description": "Stripe plugin for Payload",
@@ -47,7 +47,7 @@
47
47
  "build": "pnpm build:swc && pnpm build:types",
48
48
  "build:swc": "swc ./src -d ./dist --config-file .swcrc",
49
49
  "build:types": "tsc --emitDeclarationOnly --outDir dist",
50
- "test": "echo 'No tests available.'",
51
- "clean": "rimraf dist"
50
+ "clean": "rimraf {dist,*.tsbuildinfo}",
51
+ "test": "echo 'No tests available.'"
52
52
  }
53
53
  }