@reeboot/strapi-payment-plugin 0.0.8 → 0.0.10

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 (36) hide show
  1. package/dist/_chunks/{Analytics-CncK5kn-.mjs → Analytics-CPXtqS6s.mjs} +1 -1
  2. package/dist/_chunks/{Analytics-c8KBuG3k.js → Analytics-ZpHHWBQt.js} +1 -1
  3. package/dist/_chunks/{App-B5AB8Omu.mjs → App-CZNZ1JKf.mjs} +13 -7
  4. package/dist/_chunks/{App-Cih9sWu1.js → App-CsbyykNC.js} +13 -7
  5. package/dist/_chunks/{Customers-CZWOnN26.js → Customers-D4RVSZ_m.js} +1 -1
  6. package/dist/_chunks/{Customers-BVk2gx7w.mjs → Customers-DMDEBpH9.mjs} +1 -1
  7. package/dist/_chunks/{Dashboard-DAjD8Q_6.mjs → Dashboard-D-ckyWDO.mjs} +1 -1
  8. package/dist/_chunks/{Dashboard-CEif4jQn.js → Dashboard-NNqGJmYw.js} +1 -1
  9. package/dist/_chunks/{Orders-DZXb54VO.js → Orders-BELfgToU.js} +1 -1
  10. package/dist/_chunks/{Orders-DdJqI1HB.mjs → Orders-BIkRttRZ.mjs} +1 -1
  11. package/dist/_chunks/{Payments-VzDGbK4W.js → Payments-CIEb4f07.js} +1 -1
  12. package/dist/_chunks/{Payments-DFL-Cwgy.mjs → Payments-CKlL-PCV.mjs} +1 -1
  13. package/dist/_chunks/{Settings-SALxClBu.mjs → Settings-BQXkYm-c.mjs} +6 -5
  14. package/dist/_chunks/{Settings-B1tR3WOm.js → Settings-CcY98Hyw.js} +6 -5
  15. package/dist/_chunks/Subscriptions--cI3HC2x.js +178 -0
  16. package/dist/_chunks/Subscriptions-Dq8Uk7sK.mjs +178 -0
  17. package/dist/_chunks/{index-CB6TMitx.mjs → index-BBarHYyt.mjs} +1 -1
  18. package/dist/_chunks/{index-D-fFikb8.js → index-DBZ4rcUW.js} +1 -1
  19. package/dist/admin/index.js +1 -1
  20. package/dist/admin/index.mjs +1 -1
  21. package/dist/admin/src/index.d.ts +22 -1
  22. package/dist/admin/src/pages/Subscriptions.d.ts +2 -0
  23. package/dist/admin/src/types/index.d.ts +20 -0
  24. package/dist/server/index.js +619 -47
  25. package/dist/server/index.mjs +619 -47
  26. package/dist/server/src/content-types/customer/index.d.ts +6 -0
  27. package/dist/server/src/content-types/index.d.ts +89 -0
  28. package/dist/server/src/content-types/subscription/index.d.ts +84 -0
  29. package/dist/server/src/controllers/index.d.ts +7 -0
  30. package/dist/server/src/controllers/stripe.d.ts +34 -2
  31. package/dist/server/src/index.d.ts +99 -6
  32. package/dist/server/src/middlewares/index.d.ts +3 -3
  33. package/dist/server/src/services/stripe.d.ts +97 -13
  34. package/dist/server/src/services/types/api.d.ts +24 -5
  35. package/dist/server/src/types/plugin-config.d.ts +360 -0
  36. package/package.json +2 -2
@@ -63,6 +63,12 @@ declare const _default: {
63
63
  target: string;
64
64
  mappedBy: string;
65
65
  };
66
+ subscriptions: {
67
+ type: string;
68
+ relation: string;
69
+ target: string;
70
+ mappedBy: string;
71
+ };
66
72
  };
67
73
  };
68
74
  };
@@ -64,6 +64,12 @@ declare const _default: {
64
64
  target: string;
65
65
  mappedBy: string;
66
66
  };
67
+ subscriptions: {
68
+ type: string;
69
+ relation: string;
70
+ target: string;
71
+ mappedBy: string;
72
+ };
67
73
  };
68
74
  };
69
75
  };
@@ -211,5 +217,88 @@ declare const _default: {
211
217
  };
212
218
  };
213
219
  };
220
+ subscription: {
221
+ schema: {
222
+ kind: string;
223
+ collectionName: string;
224
+ info: {
225
+ singularName: string;
226
+ pluralName: string;
227
+ displayName: string;
228
+ description: string;
229
+ };
230
+ options: {
231
+ draftAndPublish: boolean;
232
+ };
233
+ attributes: {
234
+ stripe_subscription_id: {
235
+ type: string;
236
+ unique: boolean;
237
+ required: boolean;
238
+ configurable: boolean;
239
+ };
240
+ stripe_customer_id: {
241
+ type: string;
242
+ required: boolean;
243
+ configurable: boolean;
244
+ };
245
+ stripe_price_id: {
246
+ type: string;
247
+ required: boolean;
248
+ configurable: boolean;
249
+ };
250
+ stripe_product_id: {
251
+ type: string;
252
+ configurable: boolean;
253
+ };
254
+ status: {
255
+ type: string;
256
+ enum: string[];
257
+ required: boolean;
258
+ default: string;
259
+ configurable: boolean;
260
+ };
261
+ current_period_start: {
262
+ type: string;
263
+ configurable: boolean;
264
+ };
265
+ current_period_end: {
266
+ type: string;
267
+ configurable: boolean;
268
+ };
269
+ cancel_at_period_end: {
270
+ type: string;
271
+ default: boolean;
272
+ configurable: boolean;
273
+ };
274
+ canceled_at: {
275
+ type: string;
276
+ configurable: boolean;
277
+ };
278
+ trial_start: {
279
+ type: string;
280
+ configurable: boolean;
281
+ };
282
+ trial_end: {
283
+ type: string;
284
+ configurable: boolean;
285
+ };
286
+ latest_invoice_id: {
287
+ type: string;
288
+ configurable: boolean;
289
+ };
290
+ metadata: {
291
+ type: string;
292
+ configurable: boolean;
293
+ };
294
+ customer: {
295
+ type: string;
296
+ relation: string;
297
+ target: string;
298
+ inversedBy: string;
299
+ };
300
+ };
301
+ };
302
+ };
214
303
  };
215
304
  export default _default;
@@ -0,0 +1,84 @@
1
+ declare const _default: {
2
+ schema: {
3
+ kind: string;
4
+ collectionName: string;
5
+ info: {
6
+ singularName: string;
7
+ pluralName: string;
8
+ displayName: string;
9
+ description: string;
10
+ };
11
+ options: {
12
+ draftAndPublish: boolean;
13
+ };
14
+ attributes: {
15
+ stripe_subscription_id: {
16
+ type: string;
17
+ unique: boolean;
18
+ required: boolean;
19
+ configurable: boolean;
20
+ };
21
+ stripe_customer_id: {
22
+ type: string;
23
+ required: boolean;
24
+ configurable: boolean;
25
+ };
26
+ stripe_price_id: {
27
+ type: string;
28
+ required: boolean;
29
+ configurable: boolean;
30
+ };
31
+ stripe_product_id: {
32
+ type: string;
33
+ configurable: boolean;
34
+ };
35
+ status: {
36
+ type: string;
37
+ enum: string[];
38
+ required: boolean;
39
+ default: string;
40
+ configurable: boolean;
41
+ };
42
+ current_period_start: {
43
+ type: string;
44
+ configurable: boolean;
45
+ };
46
+ current_period_end: {
47
+ type: string;
48
+ configurable: boolean;
49
+ };
50
+ cancel_at_period_end: {
51
+ type: string;
52
+ default: boolean;
53
+ configurable: boolean;
54
+ };
55
+ canceled_at: {
56
+ type: string;
57
+ configurable: boolean;
58
+ };
59
+ trial_start: {
60
+ type: string;
61
+ configurable: boolean;
62
+ };
63
+ trial_end: {
64
+ type: string;
65
+ configurable: boolean;
66
+ };
67
+ latest_invoice_id: {
68
+ type: string;
69
+ configurable: boolean;
70
+ };
71
+ metadata: {
72
+ type: string;
73
+ configurable: boolean;
74
+ };
75
+ customer: {
76
+ type: string;
77
+ relation: string;
78
+ target: string;
79
+ inversedBy: string;
80
+ };
81
+ };
82
+ };
83
+ };
84
+ export default _default;
@@ -6,6 +6,13 @@ declare const _default: {
6
6
  index(ctx: any): void;
7
7
  };
8
8
  stripe: {
9
+ createSubscription(ctx: import("koa").Context): Promise<import("koa").Context>;
10
+ cancelSubscription(ctx: import("koa").Context): Promise<void>;
11
+ updateSubscription(ctx: import("koa").Context): Promise<void>;
12
+ getSubscriptionDetails(ctx: import("koa").Context): Promise<import("koa").Context>;
13
+ listSubscriptions(ctx: import("koa").Context): Promise<void>;
14
+ adminListSubscriptions(ctx: import("koa").Context): Promise<void>;
15
+ adminCancelSubscription(ctx: import("koa").Context): Promise<void>;
9
16
  createPaymentIntent(ctx: import("koa").Context): Promise<import("koa").Context>;
10
17
  confirmPayment(ctx: import("koa").Context): Promise<import("koa").Context>;
11
18
  createCustomer(ctx: import("koa").Context): Promise<import("koa").Context>;
@@ -1,5 +1,37 @@
1
1
  import type { Context } from 'koa';
2
- declare const stripeController: {
2
+ declare const stripeControllerFull: {
3
+ /**
4
+ * POST /subscriptions
5
+ * Body: { stripeCustomerId, priceId, trialPeriodDays?, metadata?, defaultPaymentMethod? }
6
+ */
7
+ createSubscription(ctx: Context): Promise<Context>;
8
+ /**
9
+ * POST /subscriptions/:id/cancel
10
+ * Body: { cancelAtPeriodEnd? }
11
+ */
12
+ cancelSubscription(ctx: Context): Promise<void>;
13
+ /**
14
+ * PUT /subscriptions/:id
15
+ * Body: { priceId?, cancelAtPeriodEnd?, trialEnd?, metadata?, defaultPaymentMethod? }
16
+ */
17
+ updateSubscription(ctx: Context): Promise<void>;
18
+ /**
19
+ * GET /subscriptions/:id
20
+ */
21
+ getSubscriptionDetails(ctx: Context): Promise<Context>;
22
+ /**
23
+ * GET /subscriptions
24
+ * Query: page, pageSize, status, stripeCustomerId
25
+ */
26
+ listSubscriptions(ctx: Context): Promise<void>;
27
+ /**
28
+ * GET /admin/subscriptions (admin only)
29
+ */
30
+ adminListSubscriptions(ctx: Context): Promise<void>;
31
+ /**
32
+ * POST /admin/subscriptions/:id/cancel (admin only)
33
+ */
34
+ adminCancelSubscription(ctx: Context): Promise<void>;
3
35
  /**
4
36
  * Create a payment intent
5
37
  */
@@ -101,4 +133,4 @@ declare const stripeController: {
101
133
  */
102
134
  createSamplePayment(ctx: Context): Promise<void>;
103
135
  };
104
- export default stripeController;
136
+ export default stripeControllerFull;
@@ -20,6 +20,13 @@ declare const _default: {
20
20
  index(ctx: any): void;
21
21
  };
22
22
  stripe: {
23
+ createSubscription(ctx: import("koa").Context): Promise<import("koa").Context>;
24
+ cancelSubscription(ctx: import("koa").Context): Promise<void>;
25
+ updateSubscription(ctx: import("koa").Context): Promise<void>;
26
+ getSubscriptionDetails(ctx: import("koa").Context): Promise<import("koa").Context>;
27
+ listSubscriptions(ctx: import("koa").Context): Promise<void>;
28
+ adminListSubscriptions(ctx: import("koa").Context): Promise<void>;
29
+ adminCancelSubscription(ctx: import("koa").Context): Promise<void>;
23
30
  createPaymentIntent(ctx: import("koa").Context): Promise<import("koa").Context>;
24
31
  confirmPayment(ctx: import("koa").Context): Promise<import("koa").Context>;
25
32
  createCustomer(ctx: import("koa").Context): Promise<import("koa").Context>;
@@ -155,6 +162,12 @@ declare const _default: {
155
162
  target: string;
156
163
  mappedBy: string;
157
164
  };
165
+ subscriptions: {
166
+ type: string;
167
+ relation: string;
168
+ target: string;
169
+ mappedBy: string;
170
+ };
158
171
  };
159
172
  };
160
173
  };
@@ -234,9 +247,6 @@ declare const _default: {
234
247
  };
235
248
  };
236
249
  };
237
- /**
238
- * Plugin server methods
239
- */
240
250
  payment: {
241
251
  schema: {
242
252
  kind: string;
@@ -305,14 +315,97 @@ declare const _default: {
305
315
  };
306
316
  };
307
317
  };
318
+ subscription: {
319
+ schema: {
320
+ kind: string;
321
+ collectionName: string;
322
+ info: {
323
+ singularName: string;
324
+ pluralName: string;
325
+ displayName: string;
326
+ description: string;
327
+ };
328
+ options: {
329
+ draftAndPublish: boolean;
330
+ };
331
+ attributes: {
332
+ stripe_subscription_id: {
333
+ type: string;
334
+ unique: boolean;
335
+ required: boolean;
336
+ configurable: boolean;
337
+ };
338
+ stripe_customer_id: {
339
+ type: string;
340
+ required: boolean;
341
+ configurable: boolean;
342
+ };
343
+ stripe_price_id: {
344
+ type: string;
345
+ required: boolean;
346
+ configurable: boolean;
347
+ };
348
+ stripe_product_id: {
349
+ type: string;
350
+ configurable: boolean;
351
+ };
352
+ status: {
353
+ type: string;
354
+ enum: string[];
355
+ required: boolean;
356
+ default: string;
357
+ configurable: boolean;
358
+ };
359
+ current_period_start: {
360
+ type: string;
361
+ configurable: boolean;
362
+ };
363
+ current_period_end: {
364
+ type: string;
365
+ configurable: boolean;
366
+ };
367
+ cancel_at_period_end: {
368
+ type: string;
369
+ default: boolean;
370
+ configurable: boolean;
371
+ };
372
+ canceled_at: {
373
+ type: string;
374
+ configurable: boolean;
375
+ };
376
+ trial_start: {
377
+ type: string;
378
+ configurable: boolean;
379
+ };
380
+ trial_end: {
381
+ type: string;
382
+ configurable: boolean;
383
+ };
384
+ latest_invoice_id: {
385
+ type: string;
386
+ configurable: boolean;
387
+ };
388
+ metadata: {
389
+ type: string;
390
+ configurable: boolean;
391
+ };
392
+ customer: {
393
+ type: string;
394
+ relation: string;
395
+ target: string;
396
+ inversedBy: string;
397
+ };
398
+ };
399
+ };
400
+ };
308
401
  };
309
402
  policies: {
310
403
  isAuthenticated: (ctx: any) => boolean;
311
404
  };
312
405
  middlewares: {
313
- 'webhook-validator': (ctx: import("koa").Context, next: () => Promise<any>) => Promise<import("koa").Context>;
314
- rateLimiter: (ctx: import("koa").Context, next: () => Promise<any>) => Promise<any>;
315
- inputSanitizer: (ctx: import("koa").Context, next: () => Promise<any>) => Promise<void>;
406
+ 'webhook-validator': (ctx: import("koa").Context, next: () => Promise<void>) => Promise<import("koa").Context>;
407
+ rateLimiter: (ctx: import("koa").Context, next: () => Promise<void>) => Promise<any>;
408
+ inputSanitizer: (ctx: import("koa").Context, next: () => Promise<void>) => Promise<void>;
316
409
  };
317
410
  };
318
411
  export default _default;
@@ -7,14 +7,14 @@ declare const _default: {
7
7
  /**
8
8
  * Webhook signature validator
9
9
  */
10
- 'webhook-validator': (ctx: Context, next: () => Promise<any>) => Promise<Context>;
10
+ 'webhook-validator': (ctx: Context, next: () => Promise<void>) => Promise<Context>;
11
11
  /**
12
12
  * Rate limiter middleware for sensitive operations
13
13
  */
14
- rateLimiter: (ctx: Context, next: () => Promise<any>) => Promise<any>;
14
+ rateLimiter: (ctx: Context, next: () => Promise<void>) => Promise<any>;
15
15
  /**
16
16
  * Input sanitization middleware
17
17
  */
18
- inputSanitizer: (ctx: Context, next: () => Promise<any>) => Promise<void>;
18
+ inputSanitizer: (ctx: Context, next: () => Promise<void>) => Promise<void>;
19
19
  };
20
20
  export default _default;