@reeboot/strapi-payment-plugin 0.0.0

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 (54) hide show
  1. package/README.md +112 -0
  2. package/dist/_chunks/App-BGle38NN.js +1149 -0
  3. package/dist/_chunks/App-DoUUpjp-.mjs +1149 -0
  4. package/dist/_chunks/en-B4KWt_jN.js +4 -0
  5. package/dist/_chunks/en-Byx4XI2L.mjs +4 -0
  6. package/dist/admin/index.js +64 -0
  7. package/dist/admin/index.mjs +65 -0
  8. package/dist/admin/src/components/Header.d.ts +2 -0
  9. package/dist/admin/src/components/Initializer.d.ts +5 -0
  10. package/dist/admin/src/components/NavigationMenu.d.ts +2 -0
  11. package/dist/admin/src/components/PluginIcon.d.ts +2 -0
  12. package/dist/admin/src/components/Sidebar.d.ts +2 -0
  13. package/dist/admin/src/components/TransactionDetailsModal.d.ts +18 -0
  14. package/dist/admin/src/components/TransactionList.d.ts +18 -0
  15. package/dist/admin/src/index.d.ts +10 -0
  16. package/dist/admin/src/pages/App.d.ts +2 -0
  17. package/dist/admin/src/pages/ConfigurationPage.d.ts +2 -0
  18. package/dist/admin/src/pages/DashboardPage.d.ts +2 -0
  19. package/dist/admin/src/pages/HomePage.d.ts +2 -0
  20. package/dist/admin/src/pages/ProductsPage.d.ts +2 -0
  21. package/dist/admin/src/pages/SubscriptionsPage.d.ts +2 -0
  22. package/dist/admin/src/pages/TransactionsPage.d.ts +2 -0
  23. package/dist/admin/src/pluginId.d.ts +1 -0
  24. package/dist/admin/src/utils/getTranslation.d.ts +2 -0
  25. package/dist/server/controllers/product.d.ts +12 -0
  26. package/dist/server/controllers/subscription.d.ts +12 -0
  27. package/dist/server/index.js +7287 -0
  28. package/dist/server/index.mjs +7286 -0
  29. package/dist/server/services/product.d.ts +7 -0
  30. package/dist/server/services/subscription.d.ts +7 -0
  31. package/dist/server/src/bootstrap.d.ts +5 -0
  32. package/dist/server/src/config/index.d.ts +13 -0
  33. package/dist/server/src/content-types/index.d.ts +2 -0
  34. package/dist/server/src/controllers/controller.d.ts +10 -0
  35. package/dist/server/src/controllers/index.d.ts +41 -0
  36. package/dist/server/src/controllers/productController.d.ts +9 -0
  37. package/dist/server/src/controllers/subscriptionController.d.ts +9 -0
  38. package/dist/server/src/destroy.d.ts +5 -0
  39. package/dist/server/src/index.d.ts +159 -0
  40. package/dist/server/src/middlewares/index.d.ts +2 -0
  41. package/dist/server/src/policies/index.d.ts +2 -0
  42. package/dist/server/src/register.d.ts +5 -0
  43. package/dist/server/src/routes/admin-routes.d.ts +13 -0
  44. package/dist/server/src/routes/content-api.d.ts +12 -0
  45. package/dist/server/src/routes/index.d.ts +51 -0
  46. package/dist/server/src/routes/product-routes.d.ts +13 -0
  47. package/dist/server/src/routes/refund-routes.d.ts +13 -0
  48. package/dist/server/src/routes/subscription-routes.d.ts +13 -0
  49. package/dist/server/src/services/index.d.ts +41 -0
  50. package/dist/server/src/services/paypalDriver.d.ts +7 -0
  51. package/dist/server/src/services/service.d.ts +33 -0
  52. package/dist/server/src/services/stripeDriver.d.ts +290 -0
  53. package/jest.config.js +13 -0
  54. package/package.json +75 -0
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const en = {};
4
+ exports.default = en;
@@ -0,0 +1,4 @@
1
+ const en = {};
2
+ export {
3
+ en as default
4
+ };
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ const react = require("react");
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const icons = require("@strapi/icons");
5
+ const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
6
+ const v = glob[path];
7
+ if (v) {
8
+ return typeof v === "function" ? v() : Promise.resolve(v);
9
+ }
10
+ return new Promise((_, reject) => {
11
+ (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
12
+ reject.bind(
13
+ null,
14
+ new Error(
15
+ "Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
16
+ )
17
+ )
18
+ );
19
+ });
20
+ };
21
+ const PLUGIN_ID = "payment-plugin";
22
+ const Initializer = ({ setPlugin }) => {
23
+ const ref = react.useRef(setPlugin);
24
+ react.useEffect(() => {
25
+ ref.current(PLUGIN_ID);
26
+ }, []);
27
+ return null;
28
+ };
29
+ const PluginIcon = () => /* @__PURE__ */ jsxRuntime.jsx(icons.PuzzlePiece, {});
30
+ const index = {
31
+ register(app) {
32
+ app.addMenuLink({
33
+ to: `plugins/${PLUGIN_ID}`,
34
+ icon: PluginIcon,
35
+ intlLabel: {
36
+ id: `${PLUGIN_ID}.plugin.name`,
37
+ defaultMessage: PLUGIN_ID
38
+ },
39
+ Component: async () => {
40
+ const { App } = await Promise.resolve().then(() => require("../_chunks/App-BGle38NN.js"));
41
+ return App;
42
+ }
43
+ });
44
+ app.registerPlugin({
45
+ id: PLUGIN_ID,
46
+ initializer: Initializer,
47
+ isReady: false,
48
+ name: PLUGIN_ID
49
+ });
50
+ },
51
+ async registerTrads({ locales }) {
52
+ return Promise.all(
53
+ locales.map(async (locale) => {
54
+ try {
55
+ const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("../_chunks/en-B4KWt_jN.js")) }), `./translations/${locale}.json`, 3);
56
+ return { data, locale };
57
+ } catch {
58
+ return { data: {}, locale };
59
+ }
60
+ })
61
+ );
62
+ }
63
+ };
64
+ module.exports = index;
@@ -0,0 +1,65 @@
1
+ import { useRef, useEffect } from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { PuzzlePiece } from "@strapi/icons";
4
+ const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
5
+ const v = glob[path];
6
+ if (v) {
7
+ return typeof v === "function" ? v() : Promise.resolve(v);
8
+ }
9
+ return new Promise((_, reject) => {
10
+ (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
11
+ reject.bind(
12
+ null,
13
+ new Error(
14
+ "Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
15
+ )
16
+ )
17
+ );
18
+ });
19
+ };
20
+ const PLUGIN_ID = "payment-plugin";
21
+ const Initializer = ({ setPlugin }) => {
22
+ const ref = useRef(setPlugin);
23
+ useEffect(() => {
24
+ ref.current(PLUGIN_ID);
25
+ }, []);
26
+ return null;
27
+ };
28
+ const PluginIcon = () => /* @__PURE__ */ jsx(PuzzlePiece, {});
29
+ const index = {
30
+ register(app) {
31
+ app.addMenuLink({
32
+ to: `plugins/${PLUGIN_ID}`,
33
+ icon: PluginIcon,
34
+ intlLabel: {
35
+ id: `${PLUGIN_ID}.plugin.name`,
36
+ defaultMessage: PLUGIN_ID
37
+ },
38
+ Component: async () => {
39
+ const { App } = await import("../_chunks/App-DoUUpjp-.mjs");
40
+ return App;
41
+ }
42
+ });
43
+ app.registerPlugin({
44
+ id: PLUGIN_ID,
45
+ initializer: Initializer,
46
+ isReady: false,
47
+ name: PLUGIN_ID
48
+ });
49
+ },
50
+ async registerTrads({ locales }) {
51
+ return Promise.all(
52
+ locales.map(async (locale) => {
53
+ try {
54
+ const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => import("../_chunks/en-Byx4XI2L.mjs") }), `./translations/${locale}.json`, 3);
55
+ return { data, locale };
56
+ } catch {
57
+ return { data: {}, locale };
58
+ }
59
+ })
60
+ );
61
+ }
62
+ };
63
+ export {
64
+ index as default
65
+ };
@@ -0,0 +1,2 @@
1
+ declare const Header: () => import("react/jsx-runtime").JSX.Element;
2
+ export default Header;
@@ -0,0 +1,5 @@
1
+ type InitializerProps = {
2
+ setPlugin: (id: string) => void;
3
+ };
4
+ declare const Initializer: ({ setPlugin }: InitializerProps) => null;
5
+ export { Initializer };
@@ -0,0 +1,2 @@
1
+ declare const NavigationMenu: () => import("react/jsx-runtime").JSX.Element;
2
+ export default NavigationMenu;
@@ -0,0 +1,2 @@
1
+ declare const PluginIcon: () => import("react/jsx-runtime").JSX.Element;
2
+ export { PluginIcon };
@@ -0,0 +1,2 @@
1
+ declare const Sidebar: () => import("react/jsx-runtime").JSX.Element;
2
+ export default Sidebar;
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ interface TransactionDetailsModalProps {
3
+ isOpen: boolean;
4
+ onClose: () => void;
5
+ transaction: {
6
+ id: string;
7
+ amount: number;
8
+ currency: string;
9
+ status: string;
10
+ date: string;
11
+ customer: string;
12
+ paymentMethod: string;
13
+ gateway: string;
14
+ } | null;
15
+ onRefund: () => void;
16
+ }
17
+ declare const TransactionDetailsModal: React.FC<TransactionDetailsModalProps>;
18
+ export default TransactionDetailsModal;
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ interface Transaction {
3
+ id: string;
4
+ amount: number;
5
+ currency: string;
6
+ status: string;
7
+ date: string;
8
+ customer: string;
9
+ paymentMethod: string;
10
+ gateway: string;
11
+ }
12
+ interface TransactionListProps {
13
+ transactions: Transaction[];
14
+ onViewDetails: (transaction: Transaction) => void;
15
+ onStatusUpdate?: (transactionId: string, newStatus: string) => void;
16
+ }
17
+ declare const TransactionList: React.FC<TransactionListProps>;
18
+ export default TransactionList;
@@ -0,0 +1,10 @@
1
+ declare const _default: {
2
+ register(app: any): void;
3
+ registerTrads({ locales }: {
4
+ locales: string[];
5
+ }): Promise<{
6
+ data: any;
7
+ locale: string;
8
+ }[]>;
9
+ };
10
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const App: () => import("react/jsx-runtime").JSX.Element;
2
+ export { App };
@@ -0,0 +1,2 @@
1
+ declare const ConfigurationPage: () => import("react/jsx-runtime").JSX.Element;
2
+ export default ConfigurationPage;
@@ -0,0 +1,2 @@
1
+ declare const DashboardPage: () => import("react/jsx-runtime").JSX.Element;
2
+ export default DashboardPage;
@@ -0,0 +1,2 @@
1
+ declare const HomePage: () => import("react/jsx-runtime").JSX.Element;
2
+ export default HomePage;
@@ -0,0 +1,2 @@
1
+ declare const ProductsPage: () => import("react/jsx-runtime").JSX.Element;
2
+ export default ProductsPage;
@@ -0,0 +1,2 @@
1
+ declare const SubscriptionsPage: () => import("react/jsx-runtime").JSX.Element;
2
+ export default SubscriptionsPage;
@@ -0,0 +1,2 @@
1
+ declare const TransactionsPage: () => import("react/jsx-runtime").JSX.Element;
2
+ export default TransactionsPage;
@@ -0,0 +1 @@
1
+ export declare const PLUGIN_ID = "payment-plugin";
@@ -0,0 +1,2 @@
1
+ declare const getTranslation: (id: string) => string;
2
+ export { getTranslation };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * controller
3
+ */
4
+ /// <reference types="koa" />
5
+ declare const _default: {
6
+ find(ctx: import("koa").Context): Promise<void>;
7
+ findOne(ctx: import("koa").Context): Promise<import("koa").Context>;
8
+ create(ctx: import("koa").Context): Promise<void>;
9
+ update(ctx: import("koa").Context): Promise<void>;
10
+ delete(ctx: import("koa").Context): Promise<void>;
11
+ };
12
+ export default _default;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * controller
3
+ */
4
+ /// <reference types="koa" />
5
+ declare const _default: {
6
+ find(ctx: import("koa").Context): Promise<void>;
7
+ findOne(ctx: import("koa").Context): Promise<import("koa").Context>;
8
+ create(ctx: import("koa").Context): Promise<void>;
9
+ update(ctx: import("koa").Context): Promise<void>;
10
+ delete(ctx: import("koa").Context): Promise<void>;
11
+ };
12
+ export default _default;