@helpdice/sdk 0.0.5 → 0.0.8
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/account/index.d.ts +10 -1
- package/dist/account/index.js +7 -1
- package/dist/account/index.js.map +1 -1
- package/dist/account/types.d.ts +32 -0
- package/dist/account/types.js +2 -0
- package/dist/account/types.js.map +1 -0
- package/dist/account/update_profile.d.ts +12 -0
- package/dist/account/update_profile.js +13 -0
- package/dist/account/update_profile.js.map +1 -0
- package/dist/account/updateprofile.d.ts +12 -0
- package/dist/account/updateprofile.js +13 -0
- package/dist/account/updateprofile.js.map +1 -0
- package/dist/accounting/createInvoice.d.ts +12 -0
- package/dist/accounting/createInvoice.js +13 -0
- package/dist/accounting/createInvoice.js.map +1 -0
- package/dist/accounting/endpoint.d.ts +5 -0
- package/dist/accounting/endpoint.js +5 -1
- package/dist/accounting/endpoint.js.map +1 -1
- package/dist/accounting/index.d.ts +30 -0
- package/dist/accounting/index.js +9 -0
- package/dist/accounting/index.js.map +1 -1
- package/dist/accounting/invoice.d.ts +12 -0
- package/dist/accounting/invoice.js +13 -0
- package/dist/accounting/invoice.js.map +1 -0
- package/dist/accounting/submitInvoice.d.ts +12 -0
- package/dist/accounting/submitInvoice.js +13 -0
- package/dist/accounting/submitInvoice.js.map +1 -0
- package/dist/accounting/types.d.ts +40 -0
- package/dist/accounting/types.js +2 -0
- package/dist/accounting/types.js.map +1 -0
- package/dist/accounting/updateInvoice.d.ts +12 -0
- package/dist/accounting/updateInvoice.js +13 -0
- package/dist/accounting/updateInvoice.js.map +1 -0
- package/dist/assets/endpoint.js +2 -2
- package/dist/assets/endpoint.js.map +1 -1
- package/dist/auth/index.d.ts +6 -0
- package/dist/auth/index.js +32 -0
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/signInWithGoogle.js +8 -3
- package/dist/auth/signInWithGoogle.js.map +1 -1
- package/dist/auth/types.d.ts +3 -0
- package/dist/config/axios.d.ts +1 -0
- package/dist/config/axios.js +24 -17
- package/dist/config/axios.js.map +1 -1
- package/dist/config/route.js +7 -1
- package/dist/config/route.js.map +1 -1
- package/dist/content/endpoint.d.ts +1 -0
- package/dist/content/endpoint.js +1 -0
- package/dist/content/endpoint.js.map +1 -1
- package/dist/content/index.d.ts +1 -0
- package/dist/content/index.js +1 -0
- package/dist/content/index.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/inventory/endpoint.d.ts +7 -0
- package/dist/inventory/endpoint.js +8 -0
- package/dist/inventory/endpoint.js.map +1 -0
- package/dist/inventory/index.d.ts +6 -0
- package/dist/inventory/index.js +25 -0
- package/dist/inventory/index.js.map +1 -0
- package/dist/package.json +48 -0
- package/dist/payment/components/ProcessPayment.d.ts +1 -0
- package/dist/payment/components/ProcessPayment.js +267 -0
- package/dist/payment/components/ProcessPayment.js.map +1 -0
- package/dist/payment/index.d.ts +3 -8
- package/dist/payment/start.d.ts +7 -20
- package/dist/payment/start.js +41 -40
- package/dist/payment/start.js.map +1 -1
- package/dist/payment/types.d.ts +12 -0
- package/dist/payment/verify.d.ts +1 -1
- package/dist/sales/endpoint.d.ts +6 -0
- package/dist/sales/endpoint.js +7 -0
- package/dist/sales/endpoint.js.map +1 -0
- package/dist/sales/index.d.ts +4 -0
- package/dist/sales/index.js +11 -0
- package/dist/sales/index.js.map +1 -0
- package/dist/utils/auth.js +1 -0
- package/dist/utils/auth.js.map +1 -1
- package/dist/utils/exchangeRates.d.ts +1 -0
- package/dist/utils/exchangeRates.js +27 -0
- package/dist/utils/exchangeRates.js.map +1 -0
- package/dist/utils/handler.d.ts +11 -0
- package/dist/utils/handler.js +34 -0
- package/dist/utils/handler.js.map +1 -0
- package/dist/utils/share.d.ts +7 -0
- package/dist/utils/share.js +23 -0
- package/dist/utils/share.js.map +1 -0
- package/package.json +1 -2
package/dist/config/axios.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axios.js","sourceRoot":"","sources":["../../src/config/axios.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACN,iBAAiB,EACjB,SAAS;AACT,uBAAuB;EACvB,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC;AAE/C,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC;IAChC,OAAO,EAAE,GAAG,CAAC,UAAU,CAAC,OAAO;IAC/B,eAAe,EAAE,IAAI;IACrB,OAAO,EAAE;QACR,6BAA6B,EAAE,GAAG;QAClC,cAAc,EAAE,kBAAkB;KAClC;CACD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC;IACjC,OAAO,EAAE,GAAG,CAAC,UAAU,CAAC,OAAO;IAC/B,eAAe,EAAE,IAAI;IACrB,OAAO,EAAE;QACR,6BAA6B,EAAE,GAAG;QAClC,cAAc,EAAE,kBAAkB;KAClC;CACD,CAAC,CAAC;AAEH,
|
|
1
|
+
{"version":3,"file":"axios.js","sourceRoot":"","sources":["../../src/config/axios.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACN,iBAAiB,EACjB,SAAS;AACT,uBAAuB;EACvB,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC;AAE/C,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC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AqB,EAAE,IAAI,CAAC,CAAC;AAE/D,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,IAAmB,EAA0B,EAAE,CACrE,IAAI,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC;AAErC,8BAA8B"}
|
package/dist/config/route.js
CHANGED
|
@@ -3,6 +3,8 @@ import accounting from "../accounting/endpoint.js";
|
|
|
3
3
|
import assets from "../assets/endpoint.js";
|
|
4
4
|
import auth from "../auth/endpoint.js";
|
|
5
5
|
import cms from "../content/endpoint.js";
|
|
6
|
+
import payment from "../payment/endpoint.js";
|
|
7
|
+
import inventory from "../inventory/endpoint.js";
|
|
6
8
|
import support from "../support/endpoint.js";
|
|
7
9
|
const urls = {
|
|
8
10
|
auth,
|
|
@@ -11,13 +13,17 @@ const urls = {
|
|
|
11
13
|
accounting,
|
|
12
14
|
support,
|
|
13
15
|
assets,
|
|
16
|
+
payment,
|
|
17
|
+
inventory
|
|
14
18
|
};
|
|
15
19
|
// Function to get the URL dynamically based on category, version, and action
|
|
16
20
|
export function getUrl(category, version, action) {
|
|
17
21
|
const categoryData = urls[category]; // Access the correct category dynamically
|
|
18
22
|
if (categoryData) {
|
|
19
23
|
const versionData = categoryData[version]; // Access the correct version dynamically
|
|
20
|
-
|
|
24
|
+
console.log(versionData?.[action]);
|
|
25
|
+
if (versionData !== undefined) {
|
|
26
|
+
console.log(versionData[action]);
|
|
21
27
|
return `/api/${version}/${category}/${versionData[action]}`; // Construct the URL
|
|
22
28
|
}
|
|
23
29
|
throw new Error(`Invalid action: ${action} for version: ${version} in category: ${category}`);
|
package/dist/config/route.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../src/config/route.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,wBAAwB,CAAC;AAC7C,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,OAAO,IAAI,MA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QACD,MAAM,IAAI,KAAK,CACd,mBAAmB,MAAM,iBAAiB,OAAO,iBAAiB,QAAQ,EAAE,CAC5E,CAAC;IACH,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,qBAAqB,QAAQ,EAAE,CAAC,CAAC;AAClD,CAAC"}
|
package/dist/content/endpoint.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint.js","sourceRoot":"","sources":["../../src/content/endpoint.ts"],"names":[],"mappings":"AAAA,MAAM,GAAG,GAAG;IACX,EAAE,EAAE;QACH,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,UAAU;QACpB,iBAAiB,EAAE,oBAAoB;QACvC,GAAG,EAAE,KAAK;QACV,IAAI,EAAE,MAAM;QACZ,aAAa,EAAE,gBAAgB;QAC/B,GAAG,EAAE,KAAK;QACV,IAAI,EAAE,MAAM;QACZ,aAAa,EAAE,gBAAgB;KAC/B;CACD,CAAC;AAEF,eAAe,GAAG,CAAC"}
|
|
1
|
+
{"version":3,"file":"endpoint.js","sourceRoot":"","sources":["../../src/content/endpoint.ts"],"names":[],"mappings":"AAAA,MAAM,GAAG,GAAG;IACX,EAAE,EAAE;QACH,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,UAAU;QACpB,iBAAiB,EAAE,oBAAoB;QACvC,GAAG,EAAE,KAAK;QACV,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,UAAU;QACpB,aAAa,EAAE,gBAAgB;QAC/B,GAAG,EAAE,KAAK;QACV,IAAI,EAAE,MAAM;QACZ,aAAa,EAAE,gBAAgB;KAC/B;CACD,CAAC;AAEF,eAAe,GAAG,CAAC"}
|
package/dist/content/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ declare const Content: {
|
|
|
4
4
|
articleCategories: (config?: object | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
5
5
|
mcq: (slug: string) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
6
6
|
mcqs: (config?: object | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
7
|
+
allMcqs: (config?: object | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
7
8
|
mcqsCategories: (config?: object | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
8
9
|
qna: (slug: string) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
9
10
|
qnas: (config?: object | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
|
package/dist/content/index.js
CHANGED
|
@@ -14,6 +14,7 @@ const Content = {
|
|
|
14
14
|
},
|
|
15
15
|
}),
|
|
16
16
|
mcqs: (config) => get(getUrl("cms", "v1", "mcqs"), config),
|
|
17
|
+
allMcqs: (config) => get(getUrl("cms", "v1", "all_mcqs"), config),
|
|
17
18
|
mcqsCategories: (config) => get(getUrl("cms", "v1", "mcqCategories"), config),
|
|
18
19
|
qna: (slug) => get(getUrl("cms", "v1", "qna"), {
|
|
19
20
|
params: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/content/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,MAAM,OAAO,GAAG;IACf,OAAO,EAAE,CAAC,IAAY,EAAE,EAAE,CACzB,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE;QACnC,MAAM,EAAE;YACP,IAAI;SACJ;KACD,CAAC;IACH,QAAQ,EAAE,CAAC,MAA2B,EAAE,EAAE,CACzC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7C,iBAAiB,EAAE,CAAC,MAA2B,EAAE,EAAE,CAClD,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACtD,GA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e,OAAO,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { getCookie } from "./utils/auth.js";
|
|
2
|
+
export { getUrl } from "./config/route.js";
|
|
1
3
|
export { default as Auth } from "./auth/index.js";
|
|
2
4
|
export { default as Order } from "./order/index.js";
|
|
3
5
|
export { default as Payment } from "./payment/index.js";
|
|
@@ -5,3 +7,6 @@ export { default as Content } from "./content/index.js";
|
|
|
5
7
|
export { default as Accounting } from "./accounting/index.js";
|
|
6
8
|
export { default as Support } from "./support/index.js";
|
|
7
9
|
export { default as Assets } from "./assets/index.js";
|
|
10
|
+
export { default as Account } from "./account/index.js";
|
|
11
|
+
export { default as shareUrl } from "./utils/share.js";
|
|
12
|
+
export { default as Inventory } from "./inventory/index.js";
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// @ts-ignore
|
|
2
2
|
/// <reference types="styled-jsx" />
|
|
3
|
-
// export { Protected } from './auth/Protected';
|
|
4
3
|
// export { isAuth } from './utils/auth';
|
|
4
|
+
export { getCookie } from "./utils/auth.js";
|
|
5
|
+
export { getUrl } from "./config/route.js";
|
|
5
6
|
export { default as Auth } from "./auth/index.js";
|
|
6
7
|
export { default as Order } from "./order/index.js";
|
|
7
8
|
export { default as Payment } from "./payment/index.js";
|
|
@@ -9,5 +10,8 @@ export { default as Content } from "./content/index.js";
|
|
|
9
10
|
export { default as Accounting } from "./accounting/index.js";
|
|
10
11
|
export { default as Support } from "./support/index.js";
|
|
11
12
|
export { default as Assets } from "./assets/index.js";
|
|
13
|
+
export { default as Account } from "./account/index.js";
|
|
14
|
+
export { default as shareUrl } from "./utils/share.js";
|
|
15
|
+
export { default as Inventory } from "./inventory/index.js";
|
|
12
16
|
// export { useUser, usePrivate, useAuth } from './hooks';
|
|
13
17
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,oCAAoC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,oCAAoC;AAEpC,yCAAyC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC5D,0DAA0D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoint.js","sourceRoot":"","sources":["../../src/inventory/endpoint.ts"],"names":[],"mappings":"AAAA,MAAM,SAAS,GAAG;IACjB,EAAE,EAAE;QACH,KAAK,EAAE,OAAO;QACd,cAAc,EAAE,gBAAgB;KAChC;CACD,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const Inventory: {
|
|
2
|
+
getStoreById: (id: string) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
3
|
+
getStoreBySlug: (slug: string) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
4
|
+
getStoreProducts: (slug: string, category: string, brand: string, price: string, search: string) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
5
|
+
};
|
|
6
|
+
export default Inventory;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { get } from "../config/axios.js";
|
|
2
|
+
import { getUrl } from "../config/route.js";
|
|
3
|
+
const Inventory = {
|
|
4
|
+
getStoreById: (id) => get(getUrl("inventory", "v1", "store"), {
|
|
5
|
+
params: {
|
|
6
|
+
id,
|
|
7
|
+
},
|
|
8
|
+
}),
|
|
9
|
+
getStoreBySlug: (slug) => get(getUrl("inventory", "v1", "store"), {
|
|
10
|
+
params: {
|
|
11
|
+
slug,
|
|
12
|
+
},
|
|
13
|
+
}),
|
|
14
|
+
getStoreProducts: (slug, category, brand, price, search) => get(getUrl("inventory", "v1", "store_products"), {
|
|
15
|
+
params: {
|
|
16
|
+
slug,
|
|
17
|
+
category,
|
|
18
|
+
brand,
|
|
19
|
+
price,
|
|
20
|
+
search
|
|
21
|
+
},
|
|
22
|
+
}),
|
|
23
|
+
};
|
|
24
|
+
export default Inventory;
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/inventory/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,MAAM,SAAS,GAAG;IACjB,YAAY,EAAE,CAAC,EAAU,EAAE,EAAE,CAC5B,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE;QACvC,MAAM,EAAE;YACP,EAAE;SACF;KACD,CAAC;IACH,cAAc,EAAE,CAAC,IAAY,EAAE,EAAE,CAChC,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE;QACvC,MAAM,EAAE;YACP,IAAI;SACJ;KACD,CAAC;IACH,gBAAgB,EAAE,CAAC,IAAY,EAAE,QAAgB,EAAE,KAAa,EAAE,KAAa,EAAE,MAAc,EAAE,EAAE,CAClG,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,EAAE,gBAAgB,CAAC,EAAE;QAChD,MAAM,EAAE;YACP,IAAI;YACJ,QAAQ;YACR,KAAK;YACL,KAAK;YACL,MAAM;SACN;KACD,CAAC;CACH,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@helpdice/sdk",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"description": "A backend API-based SDK (Software Development Kit) provides developers with pre-built tools and libraries to interact seamlessly with a backend server or service. It simplifies the process of integrating external functionality, such as authentication, data storage, or third-party services, into applications. The SDK typically includes API endpoints, functions, and documentation, allowing developers to make requests, handle responses, and manage errors efficiently. By abstracting complex backend logic, it speeds up development, reduces coding errors, and ensures consistent interactions with the backend, making it easier to build scalable, secure, and feature-rich applications.",
|
|
5
|
+
"version": "0.0.7",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/helpdice/sdk.git"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://sdk.helpdice.com",
|
|
13
|
+
"files": ["dist/**/*"],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"check": "biome check --write ./src",
|
|
17
|
+
"workflow:check": "biome check ./src",
|
|
18
|
+
"release": "pnpm run build && changeset publish"
|
|
19
|
+
},
|
|
20
|
+
"author": "Helpdice Team",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@biomejs/biome": "1.8.3",
|
|
24
|
+
"@changesets/cli": "^2.27.7",
|
|
25
|
+
"@total-typescript/tsconfig": "^1.0.4",
|
|
26
|
+
"@types/crypto-js": "^4.2.2",
|
|
27
|
+
"@types/js-cookie": "^3.0.6",
|
|
28
|
+
"@types/react": "^19.0.8",
|
|
29
|
+
"typescript": "^5.5.3"
|
|
30
|
+
},
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/helpdice/sdk/issues"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"axios": "^1.7.9",
|
|
36
|
+
"crypto-js": "^4.2.0",
|
|
37
|
+
"firebase": "^11.2.0",
|
|
38
|
+
"fs": "^0.0.1-security",
|
|
39
|
+
"fs-extra": "^11.3.0",
|
|
40
|
+
"js-cookie": "^3.0.5",
|
|
41
|
+
"jwt-decode": "^4.0.0",
|
|
42
|
+
"next": "^15.1.6",
|
|
43
|
+
"nookies": "^2.5.2",
|
|
44
|
+
"swr": "^2.3.0",
|
|
45
|
+
"zod": "^3.24.1"
|
|
46
|
+
},
|
|
47
|
+
"packageManager": "pnpm@9.6.0+sha512.38dc6fba8dba35b39340b9700112c2fe1e12f10b17134715a4aa98ccf7bb035e76fd981cf0bb384dfa98f8d6af5481c2bef2f4266a24bfa20c34eb7147ce0b5e"
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
// /* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
2
|
+
// /* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
3
|
+
// /* eslint-disable react/prop-types */
|
|
4
|
+
// import * as Yup from 'yup';
|
|
5
|
+
// import Proptypes from 'prop-types';
|
|
6
|
+
// import { USD_TO_INR } from '../../utils/config';
|
|
7
|
+
// import { razorPay } from '../../utils/paymentFunctions';
|
|
8
|
+
// import { Grid, Modal, Text, FormWrapper } from '@helpdice/ui';
|
|
9
|
+
// import { getExchangeRates } from '../../utils/exchangeRates.js';
|
|
10
|
+
// import { toast } from 'react-toastify';
|
|
11
|
+
export {};
|
|
12
|
+
// const PAYMENT_SERVICE = [
|
|
13
|
+
// { label: 'Razor Pay', currency: 'INR', enable: true },
|
|
14
|
+
// { label: 'Paypal', currency: 'USD', enable: false },
|
|
15
|
+
// { label: 'Stripe', currency: 'USD', enable: false }
|
|
16
|
+
// ];
|
|
17
|
+
// type ProcessPaymentProps = {
|
|
18
|
+
// visible: boolean;
|
|
19
|
+
// setVisible?: () => void;
|
|
20
|
+
// currency: string;
|
|
21
|
+
// amount: number;
|
|
22
|
+
// entity?: string;
|
|
23
|
+
// term?: string;
|
|
24
|
+
// data?: any;
|
|
25
|
+
// token?: string;
|
|
26
|
+
// paymentFn?: () => void;
|
|
27
|
+
// verifyFn?: () => void;
|
|
28
|
+
// onComplete?: (result?: any) => void
|
|
29
|
+
// }
|
|
30
|
+
// function ProcessPayment({
|
|
31
|
+
// visible = false,
|
|
32
|
+
// setVisible = () => {},
|
|
33
|
+
// currency,
|
|
34
|
+
// amount = 0,
|
|
35
|
+
// entity,
|
|
36
|
+
// term,
|
|
37
|
+
// data,
|
|
38
|
+
// token,
|
|
39
|
+
// paymentFn,
|
|
40
|
+
// verifyFn,
|
|
41
|
+
// onComplete = (result) => {}
|
|
42
|
+
// }: ProcessPaymentProps) {
|
|
43
|
+
// return (
|
|
44
|
+
// <FormWrapper
|
|
45
|
+
// enableReinitialize
|
|
46
|
+
// initialValues={{
|
|
47
|
+
// data: data,
|
|
48
|
+
// token: token ?? '',
|
|
49
|
+
// method: {
|
|
50
|
+
// label: 'Paypal',
|
|
51
|
+
// currency: currency
|
|
52
|
+
// },
|
|
53
|
+
// amount: amount,
|
|
54
|
+
// entity: entity,
|
|
55
|
+
// term: 1
|
|
56
|
+
// }}
|
|
57
|
+
// validationSchema={Yup.object().shape({
|
|
58
|
+
// method: Yup.object().shape({
|
|
59
|
+
// label: Yup.string().required('Please select Payment Service'),
|
|
60
|
+
// currency: Yup.string().required('Please select Payment Service'),
|
|
61
|
+
// enable: Yup.bool().required()
|
|
62
|
+
// }),
|
|
63
|
+
// term: Yup.string(),
|
|
64
|
+
// token: Yup.string(),
|
|
65
|
+
// data: Yup.object()
|
|
66
|
+
// })}
|
|
67
|
+
// onSubmit={async (values, { resetForm, setSubmitting }) => {
|
|
68
|
+
// // console.log('Process Payment');
|
|
69
|
+
// return toast.promise(paymentFn({ ...values, order: data?.order }), {
|
|
70
|
+
// pending: 'Processing Payment...',
|
|
71
|
+
// success: {
|
|
72
|
+
// render({ data }) {
|
|
73
|
+
// // const order = data.order;
|
|
74
|
+
// const options = data.options;
|
|
75
|
+
// options.handler = async (response) => {
|
|
76
|
+
// toast.dismiss();
|
|
77
|
+
// const body = {
|
|
78
|
+
// id: values.data._id,
|
|
79
|
+
// payment: response
|
|
80
|
+
// };
|
|
81
|
+
// toast
|
|
82
|
+
// .promise(verifyFn(body), {
|
|
83
|
+
// pending: 'Verifying Payment...',
|
|
84
|
+
// success: {
|
|
85
|
+
// render({ data }) {
|
|
86
|
+
// setVisible(null);
|
|
87
|
+
// return data.message;
|
|
88
|
+
// }
|
|
89
|
+
// },
|
|
90
|
+
// error: {
|
|
91
|
+
// render({ data }) {
|
|
92
|
+
// // When the promise reject, data will contains the error
|
|
93
|
+
// return data.message;
|
|
94
|
+
// }
|
|
95
|
+
// }
|
|
96
|
+
// })
|
|
97
|
+
// .then(() => {
|
|
98
|
+
// cache.invalidateQueries('susbscriptions');
|
|
99
|
+
// });
|
|
100
|
+
// // const validateRes = await fetch('http://localhost:5000/order/validate', {
|
|
101
|
+
// // method: 'POST',
|
|
102
|
+
// // body: JSON.stringify(body),
|
|
103
|
+
// // headers: {
|
|
104
|
+
// // 'Content-Type': 'application/json'
|
|
105
|
+
// // }
|
|
106
|
+
// // });
|
|
107
|
+
// // const jsonRes = await validateRes.json();
|
|
108
|
+
// // console.log(jsonRes);
|
|
109
|
+
// };
|
|
110
|
+
// var rzp1 = new window.Razorpay(data.options);
|
|
111
|
+
// rzp1.on('payment.failed', function (response) {
|
|
112
|
+
// toast.dismiss();
|
|
113
|
+
// toast.error('Payment Failed, Please Try Again Later');
|
|
114
|
+
// // alert(response.error.code);
|
|
115
|
+
// // alert(response.error.description);
|
|
116
|
+
// // alert(response.error.source);
|
|
117
|
+
// // alert(response.error.step);
|
|
118
|
+
// // alert(response.error.reason);
|
|
119
|
+
// // alert(response.error.metadata.order_id);
|
|
120
|
+
// // alert(response.error.metadata.payment_id);
|
|
121
|
+
// });
|
|
122
|
+
// rzp1.open();
|
|
123
|
+
// return data.message;
|
|
124
|
+
// },
|
|
125
|
+
// icon: '🟢'
|
|
126
|
+
// },
|
|
127
|
+
// error: {
|
|
128
|
+
// render({ data }) {
|
|
129
|
+
// // When the promise reject, data will contains the error
|
|
130
|
+
// return data.message;
|
|
131
|
+
// }
|
|
132
|
+
// }
|
|
133
|
+
// });
|
|
134
|
+
// }}
|
|
135
|
+
// >
|
|
136
|
+
// {({ handleChange, handleSubmit, setFieldValue, isSubmitting, values, errors }) => {
|
|
137
|
+
// // console.log(values);
|
|
138
|
+
// console.log(errors);
|
|
139
|
+
// return (
|
|
140
|
+
// <form noValidate onSubmit={handleSubmit}>
|
|
141
|
+
// <Modal visible={visible}>
|
|
142
|
+
// <Modal.Title>Payment Information</Modal.Title>
|
|
143
|
+
// {/* <Modal.Subtitle>This is a modal</Modal.Subtitle> */}
|
|
144
|
+
// <Modal.Content>
|
|
145
|
+
// <Grid.Container gap={1.5}>
|
|
146
|
+
// <Grid xs={24}>
|
|
147
|
+
// <InputLabel>Select Service</InputLabel>
|
|
148
|
+
// </Grid>
|
|
149
|
+
// {PAYMENT_SERVICE.map((mhd, inx) => (
|
|
150
|
+
// <Grid key={`${inx}-payment-service`} xs={12} sm={8}>
|
|
151
|
+
// <div
|
|
152
|
+
// onClick={async () => {
|
|
153
|
+
// setFieldValue('method', { ...mhd });
|
|
154
|
+
// const rate = await getExchangeRates(currency, mhd?.currency);
|
|
155
|
+
// setFieldValue('amount', (Number(amount) * rate).toFixed(2));
|
|
156
|
+
// }}
|
|
157
|
+
// style={{
|
|
158
|
+
// width: '100%',
|
|
159
|
+
// display: 'flex',
|
|
160
|
+
// alignItems: 'center',
|
|
161
|
+
// justifyContent: 'center',
|
|
162
|
+
// height: 60,
|
|
163
|
+
// cursor: 'pointer',
|
|
164
|
+
// position: 'relative',
|
|
165
|
+
// border: `2px solid ${values.method?.label === mhd.label ? '#333' : '#dcdcdc'}`,
|
|
166
|
+
// borderRadius: '10px'
|
|
167
|
+
// }}
|
|
168
|
+
// >
|
|
169
|
+
// <Text h6>{mhd.label}</Text>
|
|
170
|
+
// <Typography
|
|
171
|
+
// sx={{ position: 'absolute', bottom: 0, right: 0, mr: 1, mb: 0.3 }}
|
|
172
|
+
// variant="subtitle2"
|
|
173
|
+
// >
|
|
174
|
+
// {mhd.currency}
|
|
175
|
+
// </Typography>
|
|
176
|
+
// </div>
|
|
177
|
+
// </Grid>
|
|
178
|
+
// ))}
|
|
179
|
+
// {errors.method && (
|
|
180
|
+
// <Grid xs={24}>
|
|
181
|
+
// <Typography sx={{ mt: 0.5 }} color="error">
|
|
182
|
+
// {errors.method.label}
|
|
183
|
+
// </Typography>{' '}
|
|
184
|
+
// </Grid>
|
|
185
|
+
// )}
|
|
186
|
+
// {term && (
|
|
187
|
+
// <Grid xs={24}>
|
|
188
|
+
// <InputLabel>Payment Term</InputLabel>
|
|
189
|
+
// <FormControl sx={{ mt: 2, width: 250 }} required>
|
|
190
|
+
// <Select
|
|
191
|
+
// inputProps={{
|
|
192
|
+
// name: 'term',
|
|
193
|
+
// id: 'payment_term'
|
|
194
|
+
// }}
|
|
195
|
+
// value={values.term}
|
|
196
|
+
// onChange={handleChange}
|
|
197
|
+
// >
|
|
198
|
+
// <MenuItem value="" disabled>
|
|
199
|
+
// Choose Term
|
|
200
|
+
// </MenuItem>
|
|
201
|
+
// {[
|
|
202
|
+
// { label: '1 Month', value: 1 },
|
|
203
|
+
// { label: '12 Month', value: 12 },
|
|
204
|
+
// { label: '24 Month', value: 24 },
|
|
205
|
+
// { label: '36 Month', value: 36 }
|
|
206
|
+
// ].map((term, inx) => (
|
|
207
|
+
// <MenuItem key={`id-term-${inx}`} value={term.value}>
|
|
208
|
+
// {term.label}
|
|
209
|
+
// </MenuItem>
|
|
210
|
+
// ))}
|
|
211
|
+
// </Select>
|
|
212
|
+
// </FormControl>
|
|
213
|
+
// </Grid>
|
|
214
|
+
// )}
|
|
215
|
+
// <Grid xs={24}>
|
|
216
|
+
// <div>
|
|
217
|
+
// <InputLabel>Payment Amount</InputLabel>
|
|
218
|
+
// <Typography sx={{ mt: 2 }}>
|
|
219
|
+
// {formatCurrency(values.amount, null, values.method?.currency)}
|
|
220
|
+
// </Typography>
|
|
221
|
+
// </div>
|
|
222
|
+
// </Grid>
|
|
223
|
+
// </Grid.Container>
|
|
224
|
+
// {/* <Stack spacing={1}> */}
|
|
225
|
+
// {/* <Typography sx={{ color: '#333' }} variant="subtitle2">
|
|
226
|
+
// Card Holder Name
|
|
227
|
+
// </Typography>
|
|
228
|
+
// <TextField autoComplete="off" style={{ width: '100%' }} />
|
|
229
|
+
// <br />
|
|
230
|
+
// <CardElement options={CARD_ELEMENT_OPTIONS} />
|
|
231
|
+
// <br />
|
|
232
|
+
// {errors && (
|
|
233
|
+
// <Typography variant="subtitle2" color="danger">
|
|
234
|
+
// {errors}
|
|
235
|
+
// </Typography>
|
|
236
|
+
// )}
|
|
237
|
+
// <button style={{ cursor: 'pointer' }} type="submit" className="button">
|
|
238
|
+
// CheckOut
|
|
239
|
+
// </button> */}
|
|
240
|
+
// {/* </Stack> */}
|
|
241
|
+
// </Modal.Content>
|
|
242
|
+
// <Modal.Action
|
|
243
|
+
// passive
|
|
244
|
+
// onClick={() => {
|
|
245
|
+
// setVisible(null);
|
|
246
|
+
// toast.dismiss();
|
|
247
|
+
// }}
|
|
248
|
+
// >
|
|
249
|
+
// Cancel
|
|
250
|
+
// </Modal.Action>
|
|
251
|
+
// {/* {console.log(values.method)} */}
|
|
252
|
+
// <Modal.Action disabled={!values.method?.enable} onClick={handleSubmit} type="submit" loading={isSubmitting}>
|
|
253
|
+
// Pay Now
|
|
254
|
+
// </Modal.Action>
|
|
255
|
+
// </Modal>
|
|
256
|
+
// </form>
|
|
257
|
+
// );
|
|
258
|
+
// }}
|
|
259
|
+
// </FormWrapper>
|
|
260
|
+
// );
|
|
261
|
+
// }
|
|
262
|
+
// ProcessPayment.prototype = {
|
|
263
|
+
// paymentFn: Proptypes.func.isRequired,
|
|
264
|
+
// verifyFn: Proptypes.func.isRequired
|
|
265
|
+
// };
|
|
266
|
+
// export default ProcessPayment;
|
|
267
|
+
//# sourceMappingURL=ProcessPayment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProcessPayment.js","sourceRoot":"","sources":["../../../src/payment/components/ProcessPayment.tsx"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,6DAA6D;AAC7D,wCAAwC;AACxC,8BAA8B;AAC9B,sCAAsC;AACtC,mDAAmD;AACnD,2DAA2D;AAC3D,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;;AAE1C,4BAA4B;AAC5B,6DAA6D;AAC7D,2DAA2D;AAC3D,0DAA0D;AAC1D,KAAK;AAEL,+BAA+B;AAC/B,wBAAwB;AACxB,+BAA+B;AAC/B,wBAAwB;AACxB,sBAAsB;AACtB,uBAAuB;AACvB,qBAAqB;AACrB,kBAAkB;AAClB,sBAAsB;AACtB,8BAA8B;AAC9B,6BAA6B;AAC7B,0CAA0C;AAC1C,IAAI;AAEJ,4BAA4B;AAC5B,uBAAuB;AACvB,6BAA6B;AAC7B,gBAAgB;AAChB,kBAAkB;AAClB,cAAc;AACd,YAAY;AACZ,YAAY;AACZ,aAAa;AACb,iBAAiB;AACjB,gBAAgB;AAChB,kCAAkC;AAClC,4BAA4B;AAC5B,eAAe;AACf,uBAAuB;AAC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1D,4DAA4D;AAC5D,6DAA6D;AAC7D,kDAAkD;AAClD,yCAAyC;AACzC,qDAAqD;AACrD,gDAAgD;AAChD,sFAAsF;AACtF,0EAA0E;AAC1E,iHAAiH;AACjH,4DAA4D;AAC5D,iDAAiD;AACjD,8CAA8C;AAC9C,oDAAoD;AACpD,8DAA8D;AAC9D,8FAA8F;AAC9F,uDAAuD;AACvD,gDAAgD;AAChD,6FAA6F;AAC7F,yCAAyC;AACzC,iFAAiF;AACjF,yCAAyC;AACzC,+CAA+C;AAC/C,sFAAsF;AACtF,mDAAmD;AACnD,oDAAoD;AACpD,qCAAqC;AACrC,0GAA0G;AAC1G,+CAA+C;AAC/C,gDAAgD;AAChD,mDAAmD;AACnD,+CAA+C;AAC/C,4CAA4C;AAC5C,0CAA0C;AAC1C,mDAAmD;AACnD,wDAAwD;AACxD,uDAAuD;AACvD,qCAAqC;AACrC,gCAAgC;AAChC,yCAAyC;AACzC,8CAA8C;AAC9C,mEAAmE;AACnE,2IAA2I;AAC3I,0CAA0C;AAC1C,8CAA8C;AAC9C,mCAAmC;AACnC,8BAA8B;AAC9B,qBAAqB;AACrB,iBAAiB;AACjB,yBAAyB;AACzB,SAAS;AACT,IAAI;AAEJ,+BAA+B;AAC/B,4CAA4C;AAC5C,0CAA0C;AAC1C,KAAK;AAEL,iCAAiC"}
|
package/dist/payment/index.d.ts
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
+
import start from "./start.js";
|
|
1
2
|
declare const Payment: {
|
|
2
|
-
start:
|
|
3
|
-
onFetching?: () => void;
|
|
4
|
-
onSuccess?: (data: import("./start.js").SuccessProps) => void;
|
|
5
|
-
onError?: (error: string) => void;
|
|
6
|
-
onSettled?: () => void;
|
|
7
|
-
config?: object;
|
|
8
|
-
}) => Promise<void>;
|
|
3
|
+
start: typeof start;
|
|
9
4
|
verify: (data: import("./types.js").VerifyPayment, { config, onFetching, onSuccess, onError, onSettled, }: {
|
|
10
5
|
onFetching?: () => void;
|
|
11
|
-
onSuccess?: (data: import("./
|
|
6
|
+
onSuccess?: (data: import("./types.js").SuccessProps) => void;
|
|
12
7
|
onError?: (error: string) => void;
|
|
13
8
|
onSettled?: () => void;
|
|
14
9
|
config?: import("axios").AxiosRequestConfig<unknown>;
|
package/dist/payment/start.d.ts
CHANGED
|
@@ -1,21 +1,8 @@
|
|
|
1
|
-
import type { Order } from "../order/types.js";
|
|
2
|
-
export interface SuccessProps {
|
|
3
|
-
data: unknown;
|
|
4
|
-
status: number;
|
|
5
|
-
statusText: string;
|
|
6
|
-
}
|
|
7
|
-
export interface StartSuccessProp {
|
|
8
|
-
_id: string;
|
|
9
|
-
options: {
|
|
10
|
-
handler: (res: unknown) => void;
|
|
11
|
-
};
|
|
12
|
-
method: string;
|
|
13
|
-
}
|
|
14
|
-
declare const start: (data: Order, { config, onFetching, onSuccess, onError, onSettled, }: {
|
|
15
|
-
onFetching?: () => void;
|
|
16
|
-
onSuccess?: (data: SuccessProps) => void;
|
|
17
|
-
onError?: (error: string) => void;
|
|
18
|
-
onSettled?: () => void;
|
|
19
|
-
config?: object;
|
|
20
|
-
}) => Promise<void>;
|
|
21
1
|
export default start;
|
|
2
|
+
declare function start(data: any, { config, onLoading, onSuccess, onError, onSettled }?: {
|
|
3
|
+
config: null;
|
|
4
|
+
onLoading: (isLoading: any) => void;
|
|
5
|
+
onSuccess: (data: any) => void;
|
|
6
|
+
onError: (error: any) => void;
|
|
7
|
+
onSettled: () => void;
|
|
8
|
+
}): void;
|