@helpdice/sdk 0.0.6 → 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/account/index.d.ts
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
declare const Account: {
|
|
2
|
-
profile: () => Promise<import("axios").AxiosResponse<any, any>>;
|
|
2
|
+
profile: (id: string) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
3
|
+
updateProfile: (data: import("./types.js").Profile, { config, onFetching, onSuccess, onError, onSettled, }: {
|
|
4
|
+
onFetching?: () => void;
|
|
5
|
+
onSuccess?: (data: object) => void;
|
|
6
|
+
onError?: (error: string) => void;
|
|
7
|
+
onSettled?: () => void;
|
|
8
|
+
config?: {
|
|
9
|
+
params: import("../auth/types.js").AuthRequestParams;
|
|
10
|
+
};
|
|
11
|
+
}) => Promise<void>;
|
|
3
12
|
};
|
|
4
13
|
export default Account;
|
package/dist/account/index.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { get } from "../config/axios.js";
|
|
2
2
|
import { getUrl } from "../config/route.js";
|
|
3
|
+
import updateProfile from "./update_profile.js";
|
|
3
4
|
const Account = {
|
|
4
|
-
profile: () => get(getUrl("account", "v1", "profile")
|
|
5
|
+
profile: (id) => get(getUrl("account", "v1", "profile"), {
|
|
6
|
+
params: {
|
|
7
|
+
id,
|
|
8
|
+
},
|
|
9
|
+
}),
|
|
10
|
+
updateProfile,
|
|
5
11
|
};
|
|
6
12
|
export default Account;
|
|
7
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAEhD,MAAM,OAAO,GAAG;IACf,OAAO,EAAE,CAAC,EAAU,EAAE,EAAE,CACvB,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE;QACvC,MAAM,EAAE;YACP,EAAE;SACF;KACD,CAAC;IACH,aAAa;CACb,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
interface PermanentAddressDetails {
|
|
2
|
+
permanent_house?: string;
|
|
3
|
+
permanent_village_town_street?: string;
|
|
4
|
+
permanent_pincode?: string;
|
|
5
|
+
permanent_country?: string;
|
|
6
|
+
permanent_state?: string;
|
|
7
|
+
permanent_city?: string;
|
|
8
|
+
}
|
|
9
|
+
interface CorrespondenceAddressDetails {
|
|
10
|
+
correspondence_house?: string;
|
|
11
|
+
correspondence_village_town_street?: string;
|
|
12
|
+
correspondence_pincode?: string;
|
|
13
|
+
correspondence_country?: string;
|
|
14
|
+
correspondence_state?: string;
|
|
15
|
+
correspondence_city?: string;
|
|
16
|
+
}
|
|
17
|
+
interface Profile {
|
|
18
|
+
id?: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
email?: string;
|
|
21
|
+
gender?: string;
|
|
22
|
+
marital_status?: string;
|
|
23
|
+
blood_group?: string;
|
|
24
|
+
avatar?: string;
|
|
25
|
+
father_name?: string;
|
|
26
|
+
mother_name?: string;
|
|
27
|
+
guardian_name?: string;
|
|
28
|
+
username?: string;
|
|
29
|
+
permanent_address?: PermanentAddressDetails;
|
|
30
|
+
correspondence_address?: CorrespondenceAddressDetails;
|
|
31
|
+
}
|
|
32
|
+
export type { Profile };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/account/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AuthRequestParams } from "../auth/types.js";
|
|
2
|
+
import type { Profile } from "./types.js";
|
|
3
|
+
declare const updateProfile: (data: Profile, { config, onFetching, onSuccess, onError, onSettled, }: {
|
|
4
|
+
onFetching?: () => void;
|
|
5
|
+
onSuccess?: (data: object) => void;
|
|
6
|
+
onError?: (error: string) => void;
|
|
7
|
+
onSettled?: () => void;
|
|
8
|
+
config?: {
|
|
9
|
+
params: AuthRequestParams;
|
|
10
|
+
};
|
|
11
|
+
}) => Promise<void>;
|
|
12
|
+
export default updateProfile;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { put } from "../config/axios.js";
|
|
2
|
+
import handler from "../config/handler.js";
|
|
3
|
+
import { getUrl } from "../config/route.js";
|
|
4
|
+
const updateProfile = (data, { config, onFetching, onSuccess, onError, onSettled, }) => {
|
|
5
|
+
return handler(put(getUrl("account", "v1", "profile"), data, config), {
|
|
6
|
+
onFetching: () => onFetching?.(),
|
|
7
|
+
onError: (error) => onError?.(error),
|
|
8
|
+
onSuccess: (data) => onSuccess?.(data),
|
|
9
|
+
onSettled: () => onSettled?.(),
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
export default updateProfile;
|
|
13
|
+
//# sourceMappingURL=update_profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update_profile.js","sourceRoot":"","sources":["../../src/account/update_profile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,MAAM,aAAa,GAAG,CACrB,IAAa,EACb,EACC,MAAM,EACN,UAAU,EACV,SAAS,EACT,OAAO,EACP,SAAS,GAOT,EACA,EAAE;IACH,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE;QACrE,UAAU,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,EAAE;QAChC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC;QACpC,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC;QACtC,SAAS,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,EAAE;KAC9B,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AuthRequestParams } from "../auth/types.js";
|
|
2
|
+
import type { Profile } from "./types.js";
|
|
3
|
+
declare const updateProfile: (data: Profile, { config, onFetching, onSuccess, onError, onSettled, }: {
|
|
4
|
+
onFetching?: () => void;
|
|
5
|
+
onSuccess?: (data: object) => void;
|
|
6
|
+
onError?: (error: string) => void;
|
|
7
|
+
onSettled?: () => void;
|
|
8
|
+
config?: {
|
|
9
|
+
params: AuthRequestParams;
|
|
10
|
+
};
|
|
11
|
+
}) => Promise<void>;
|
|
12
|
+
export default updateProfile;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { put } from "../config/axios.js";
|
|
2
|
+
import handler from "../config/handler.js";
|
|
3
|
+
import { getUrl } from "../config/route.js";
|
|
4
|
+
const updateProfile = (data, { config, onFetching, onSuccess, onError, onSettled, }) => {
|
|
5
|
+
return handler(put(getUrl("account", "v1", "profile"), data, config), {
|
|
6
|
+
onFetching: () => onFetching?.(),
|
|
7
|
+
onError: (error) => onError?.(error),
|
|
8
|
+
onSuccess: (data) => onSuccess?.(data),
|
|
9
|
+
onSettled: () => onSettled?.(),
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
export default updateProfile;
|
|
13
|
+
//# sourceMappingURL=updateProfile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateProfile.js","sourceRoot":"","sources":["../../src/account/updateProfile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,MAAM,aAAa,GAAG,CACrB,IAAa,EACb,EACC,MAAM,EACN,UAAU,EACV,SAAS,EACT,OAAO,EACP,SAAS,GAOT,EACA,EAAE;IACH,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE;QACrE,UAAU,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,EAAE;QAChC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC;QACpC,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC;QACtC,SAAS,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,EAAE;KAC9B,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AuthRequestParams } from "../auth/types.js";
|
|
2
|
+
import type { Invoice } from "./types.js";
|
|
3
|
+
declare const createInvoice: (data: Invoice, { config, onFetching, onSuccess, onError, onSettled, }: {
|
|
4
|
+
onFetching?: () => void;
|
|
5
|
+
onSuccess?: (data: object) => void;
|
|
6
|
+
onError?: (error: string) => void;
|
|
7
|
+
onSettled?: () => void;
|
|
8
|
+
config?: {
|
|
9
|
+
params: AuthRequestParams;
|
|
10
|
+
};
|
|
11
|
+
}) => Promise<void>;
|
|
12
|
+
export default createInvoice;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { post } from "../config/axios.js";
|
|
2
|
+
import handler from "../config/handler.js";
|
|
3
|
+
import { getUrl } from "../config/route.js";
|
|
4
|
+
const createInvoice = (data, { config, onFetching, onSuccess, onError, onSettled, }) => {
|
|
5
|
+
return handler(post(getUrl("accounting", "v1", "invoice"), data, config), {
|
|
6
|
+
onFetching: () => onFetching?.(),
|
|
7
|
+
onError: (error) => onError?.(error),
|
|
8
|
+
onSuccess: (data) => onSuccess?.(data),
|
|
9
|
+
onSettled: () => onSettled?.(),
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
export default createInvoice;
|
|
13
|
+
//# sourceMappingURL=createInvoice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createInvoice.js","sourceRoot":"","sources":["../../src/accounting/createInvoice.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,MAAM,aAAa,GAAG,CACrB,IAAa,EACb,EACC,MAAM,EACN,UAAU,EACV,SAAS,EACT,OAAO,EACP,SAAS,GAOT,EACA,EAAE;IACH,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE;QACzE,UAAU,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,EAAE;QAChC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC;QACpC,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC;QACtC,SAAS,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,EAAE;KAC9B,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -2,7 +2,11 @@ const accounting = {
|
|
|
2
2
|
v1: {
|
|
3
3
|
item: "item",
|
|
4
4
|
items: "items",
|
|
5
|
-
|
|
5
|
+
invoice: "invoice",
|
|
6
|
+
submit_invoice: "invoice/submit",
|
|
7
|
+
invoices: "invoices",
|
|
8
|
+
item_categories: "item/category",
|
|
9
|
+
item_brands: "item/brand"
|
|
6
10
|
},
|
|
7
11
|
};
|
|
8
12
|
export default accounting;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint.js","sourceRoot":"","sources":["../../src/accounting/endpoint.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG;IAClB,EAAE,EAAE;QACH,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,OAAO;QACd,
|
|
1
|
+
{"version":3,"file":"endpoint.js","sourceRoot":"","sources":["../../src/accounting/endpoint.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG;IAClB,EAAE,EAAE;QACH,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,OAAO;QACd,OAAO,EAAE,SAAS;QAClB,cAAc,EAAE,gBAAgB;QAChC,QAAQ,EAAE,UAAU;QACpB,eAAe,EAAE,eAAe;QAChC,WAAW,EAAE,YAAY;KACzB;CACD,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
declare const Accounting: {
|
|
2
2
|
item: (slug: string) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
3
3
|
items: (config?: object | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
4
|
+
createInvoice: (data: import("./types.js").Invoice, { config, onFetching, onSuccess, onError, onSettled, }: {
|
|
5
|
+
onFetching?: () => void;
|
|
6
|
+
onSuccess?: (data: object) => void;
|
|
7
|
+
onError?: (error: string) => void;
|
|
8
|
+
onSettled?: () => void;
|
|
9
|
+
config?: {
|
|
10
|
+
params: import("../auth/types.js").AuthRequestParams;
|
|
11
|
+
};
|
|
12
|
+
}) => Promise<void>;
|
|
13
|
+
updateInvoice: (data: import("./types.js").Invoice, { config, onFetching, onSuccess, onError, onSettled, }: {
|
|
14
|
+
onFetching?: () => void;
|
|
15
|
+
onSuccess?: (data: object) => void;
|
|
16
|
+
onError?: (error: string) => void;
|
|
17
|
+
onSettled?: () => void;
|
|
18
|
+
config?: {
|
|
19
|
+
params: import("../auth/types.js").AuthRequestParams;
|
|
20
|
+
};
|
|
21
|
+
}) => Promise<void>;
|
|
22
|
+
invoices: (config?: object | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
23
|
+
submitInvoice: (data: import("./types.js").SubmitInvoice, { config, onFetching, onSuccess, onError, onSettled, }: {
|
|
24
|
+
onFetching?: () => void;
|
|
25
|
+
onSuccess?: (data: object) => void;
|
|
26
|
+
onError?: (error: string) => void;
|
|
27
|
+
onSettled?: () => void;
|
|
28
|
+
config?: {
|
|
29
|
+
params: import("../auth/types.js").AuthRequestParams;
|
|
30
|
+
};
|
|
31
|
+
}) => Promise<void>;
|
|
32
|
+
itemCategories: () => Promise<import("axios").AxiosResponse<any, any>>;
|
|
33
|
+
itemBrands: () => Promise<import("axios").AxiosResponse<any, any>>;
|
|
4
34
|
};
|
|
5
35
|
export default Accounting;
|
package/dist/accounting/index.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { get } from "../config/axios.js";
|
|
2
2
|
import { getUrl } from "../config/route.js";
|
|
3
|
+
import createInvoice from "./createInvoice.js";
|
|
4
|
+
import submitInvoice from "./submitInvoice.js";
|
|
5
|
+
import updateInvoice from "./updateInvoice.js";
|
|
3
6
|
const Accounting = {
|
|
4
7
|
item: (slug) => get(getUrl("accounting", "v1", "item"), {
|
|
5
8
|
params: {
|
|
@@ -7,6 +10,12 @@ const Accounting = {
|
|
|
7
10
|
},
|
|
8
11
|
}),
|
|
9
12
|
items: (config) => get(getUrl("accounting", "v1", "items"), config),
|
|
13
|
+
createInvoice,
|
|
14
|
+
updateInvoice,
|
|
15
|
+
invoices: (config) => get(getUrl("accounting", "v1", "invoices"), config),
|
|
16
|
+
submitInvoice,
|
|
17
|
+
itemCategories: () => get(getUrl("accounting", "v1", "item_categories")),
|
|
18
|
+
itemBrands: () => get(getUrl("accounting", "v1", "item_brands")),
|
|
10
19
|
};
|
|
11
20
|
export default Accounting;
|
|
12
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/accounting/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/accounting/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAE/C,MAAM,UAAU,GAAG;IAClB,IAAI,EAAE,CAAC,IAAY,EAAE,EAAE,CACtB,GAAG,CAAC,MAAM,CAAC,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE;QACvC,MAAM,EAAE;YACP,IAAI;SACJ;KACD,CAAC;IACH,KAAK,EAAE,CAAC,MAA2B,EAAE,EAAE,CACtC,GAAG,CAAC,MAAM,CAAC,YAAY,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjD,aAAa;IACb,aAAa;IACb,QAAQ,EAAE,CAAC,MAA2B,EAAE,EAAE,CACzC,GAAG,CAAC,MAAM,CAAC,YAAY,EAAE,IAAI,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpD,aAAa;IACb,cAAc,EAAE,GAAG,EAAE,CACpB,GAAG,CAAC,MAAM,CAAC,YAAY,EAAE,IAAI,EAAE,iBAAiB,CAAC,CAAC;IACnD,UAAU,EAAE,GAAG,EAAE,CAChB,GAAG,CAAC,MAAM,CAAC,YAAY,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;CAC/C,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AuthRequestParams } from "../auth/types.js";
|
|
2
|
+
import type { Invoice } from "./types.js";
|
|
3
|
+
declare const createInvoice: (data: Invoice, { config, onFetching, onSuccess, onError, onSettled }: {
|
|
4
|
+
onFetching?: () => void;
|
|
5
|
+
onSuccess?: (data: object) => void;
|
|
6
|
+
onError?: (error: string) => void;
|
|
7
|
+
onSettled?: () => void;
|
|
8
|
+
config?: {
|
|
9
|
+
params: AuthRequestParams;
|
|
10
|
+
};
|
|
11
|
+
}) => Promise<void>;
|
|
12
|
+
export default createInvoice;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { post } from "../config/axios.js";
|
|
2
|
+
import handler from "../config/handler.js";
|
|
3
|
+
import { getUrl } from "../config/route.js";
|
|
4
|
+
const createInvoice = (data, { config, onFetching, onSuccess, onError, onSettled }) => {
|
|
5
|
+
return handler(post(getUrl("accounting", "v1", "invoice"), data, config), {
|
|
6
|
+
onFetching: () => onFetching?.(),
|
|
7
|
+
onError: (error) => onError?.(error),
|
|
8
|
+
onSuccess: (data) => onSuccess?.(data),
|
|
9
|
+
onSettled: () => onSettled?.(),
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
export default createInvoice;
|
|
13
|
+
//# sourceMappingURL=invoice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoice.js","sourceRoot":"","sources":["../../src/accounting/invoice.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,MAAM,aAAa,GAAG,CACrB,IAAa,EACb,EACC,MAAM,EACN,UAAU,EACV,SAAS,EACT,OAAO,EACP,SAAS,EAOT,EACA,EAAE;IACH,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE;QACzE,UAAU,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,EAAE;QAChC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC;QACpC,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC;QACtC,SAAS,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,EAAE;KAC9B,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AuthRequestParams } from "../auth/types.js";
|
|
2
|
+
import type { SubmitInvoice } from "./types.js";
|
|
3
|
+
declare const submitInvoice: (data: SubmitInvoice, { config, onFetching, onSuccess, onError, onSettled, }: {
|
|
4
|
+
onFetching?: () => void;
|
|
5
|
+
onSuccess?: (data: object) => void;
|
|
6
|
+
onError?: (error: string) => void;
|
|
7
|
+
onSettled?: () => void;
|
|
8
|
+
config?: {
|
|
9
|
+
params: AuthRequestParams;
|
|
10
|
+
};
|
|
11
|
+
}) => Promise<void>;
|
|
12
|
+
export default submitInvoice;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { post } from "../config/axios.js";
|
|
2
|
+
import handler from "../config/handler.js";
|
|
3
|
+
import { getUrl } from "../config/route.js";
|
|
4
|
+
const submitInvoice = (data, { config, onFetching, onSuccess, onError, onSettled, }) => {
|
|
5
|
+
return handler(post(getUrl("accounting", "v1", "submit_invoice"), data, config), {
|
|
6
|
+
onFetching: () => onFetching?.(),
|
|
7
|
+
onError: (error) => onError?.(error),
|
|
8
|
+
onSuccess: (data) => onSuccess?.(data),
|
|
9
|
+
onSettled: () => onSettled?.(),
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
export default submitInvoice;
|
|
13
|
+
//# sourceMappingURL=submitInvoice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submitInvoice.js","sourceRoot":"","sources":["../../src/accounting/submitInvoice.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,MAAM,aAAa,GAAG,CACrB,IAAmB,EACnB,EACC,MAAM,EACN,UAAU,EACV,SAAS,EACT,OAAO,EACP,SAAS,GAOT,EACA,EAAE;IACH,OAAO,OAAO,CACb,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,IAAI,EAAE,gBAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,EAChE;QACC,UAAU,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,EAAE;QAChC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC;QACpC,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC;QACtC,SAAS,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,EAAE;KAC9B,CACD,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
interface Item {
|
|
2
|
+
item?: string;
|
|
3
|
+
tax?: string;
|
|
4
|
+
rate?: number;
|
|
5
|
+
quantity?: number;
|
|
6
|
+
amount?: number;
|
|
7
|
+
}
|
|
8
|
+
interface Tax {
|
|
9
|
+
index: number;
|
|
10
|
+
taxAccount: string;
|
|
11
|
+
taxRate: number;
|
|
12
|
+
taxAmount: number;
|
|
13
|
+
}
|
|
14
|
+
interface PaymentInfo {
|
|
15
|
+
gateway?: string;
|
|
16
|
+
orderId?: string;
|
|
17
|
+
paymentId?: string;
|
|
18
|
+
}
|
|
19
|
+
interface SubmitInvoice {
|
|
20
|
+
ids?: Array<string>;
|
|
21
|
+
type?: string;
|
|
22
|
+
paymentInfo?: PaymentInfo;
|
|
23
|
+
paymentMethod?: string;
|
|
24
|
+
isPOS?: boolean;
|
|
25
|
+
}
|
|
26
|
+
interface Invoice {
|
|
27
|
+
location?: string;
|
|
28
|
+
party?: string;
|
|
29
|
+
date?: Date;
|
|
30
|
+
items: Array<Item>;
|
|
31
|
+
netTotal: number;
|
|
32
|
+
discount?: number;
|
|
33
|
+
gst: number;
|
|
34
|
+
total: number;
|
|
35
|
+
type: string;
|
|
36
|
+
currency: string;
|
|
37
|
+
taxes: Array<Tax>;
|
|
38
|
+
status: string;
|
|
39
|
+
}
|
|
40
|
+
export type { Invoice, SubmitInvoice };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/accounting/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AuthRequestParams } from "../auth/types.js";
|
|
2
|
+
import type { Invoice } from "./types.js";
|
|
3
|
+
declare const updateInvoice: (data: Invoice, { config, onFetching, onSuccess, onError, onSettled, }: {
|
|
4
|
+
onFetching?: () => void;
|
|
5
|
+
onSuccess?: (data: object) => void;
|
|
6
|
+
onError?: (error: string) => void;
|
|
7
|
+
onSettled?: () => void;
|
|
8
|
+
config?: {
|
|
9
|
+
params: AuthRequestParams;
|
|
10
|
+
};
|
|
11
|
+
}) => Promise<void>;
|
|
12
|
+
export default updateInvoice;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { put } from "../config/axios.js";
|
|
2
|
+
import handler from "../config/handler.js";
|
|
3
|
+
import { getUrl } from "../config/route.js";
|
|
4
|
+
const updateInvoice = (data, { config, onFetching, onSuccess, onError, onSettled, }) => {
|
|
5
|
+
return handler(put(getUrl("accounting", "v1", "invoice"), data, config), {
|
|
6
|
+
onFetching: () => onFetching?.(),
|
|
7
|
+
onError: (error) => onError?.(error),
|
|
8
|
+
onSuccess: (data) => onSuccess?.(data),
|
|
9
|
+
onSettled: () => onSettled?.(),
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
export default updateInvoice;
|
|
13
|
+
//# sourceMappingURL=updateInvoice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateInvoice.js","sourceRoot":"","sources":["../../src/accounting/updateInvoice.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,MAAM,aAAa,GAAG,CACrB,IAAa,EACb,EACC,MAAM,EACN,UAAU,EACV,SAAS,EACT,OAAO,EACP,SAAS,GAOT,EACA,EAAE;IACH,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,YAAY,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE;QACxE,UAAU,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,EAAE;QAChC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC;QACpC,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC;QACtC,SAAS,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,EAAE;KAC9B,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
package/dist/assets/endpoint.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint.js","sourceRoot":"","sources":["../../src/assets/endpoint.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG;IACd,EAAE,EAAE;QACH,gBAAgB,EAAE
|
|
1
|
+
{"version":3,"file":"endpoint.js","sourceRoot":"","sources":["../../src/assets/endpoint.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG;IACd,EAAE,EAAE;QACH,gBAAgB,EAAE,+BAA+B;QACjD,MAAM,EAAE,oBAAoB;KAC5B;CACD,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -24,6 +24,12 @@ declare const Auth: {
|
|
|
24
24
|
saveTokenToStorage: (token: string) => void;
|
|
25
25
|
getTokenFromStorage: () => any;
|
|
26
26
|
getUserFromStrorage: () => any;
|
|
27
|
+
/**
|
|
28
|
+
* Action to update stored admin info in the redux
|
|
29
|
+
* @param {string | object} key key or an object with key: value of the fields to be updated
|
|
30
|
+
* @param {any} value value of the field to be updated (only if the key passed is of type string)
|
|
31
|
+
*/
|
|
32
|
+
updateUserInfo: (key?: string | object, value?: any) => () => void;
|
|
27
33
|
isAuthenticated: (cookie?: boolean) => boolean;
|
|
28
34
|
getServerToken: (ctx: NextPageContext) => string | undefined;
|
|
29
35
|
logout: (data: {
|
package/dist/auth/index.js
CHANGED
|
@@ -28,6 +28,38 @@ const Auth = {
|
|
|
28
28
|
getUserFromStrorage: () => {
|
|
29
29
|
return getDataFromStorage("accountInfo");
|
|
30
30
|
},
|
|
31
|
+
/**
|
|
32
|
+
* Action to update stored admin info in the redux
|
|
33
|
+
* @param {string | object} key key or an object with key: value of the fields to be updated
|
|
34
|
+
* @param {any} value value of the field to be updated (only if the key passed is of type string)
|
|
35
|
+
*/
|
|
36
|
+
updateUserInfo: (key, value) => () => {
|
|
37
|
+
console.log("typeof key: ", typeof key, key);
|
|
38
|
+
try {
|
|
39
|
+
console.log(key);
|
|
40
|
+
const accountInfo = getDataFromStorage("accountInfo");
|
|
41
|
+
if (typeof key === "object") {
|
|
42
|
+
let updatedInfo = { ...accountInfo };
|
|
43
|
+
// for..of
|
|
44
|
+
for (const [ky, value] of Object.entries(key)) {
|
|
45
|
+
updatedInfo = { ...updatedInfo, [ky]: value };
|
|
46
|
+
}
|
|
47
|
+
console.log(updatedInfo);
|
|
48
|
+
setDataInStorage("accountInfo", updatedInfo);
|
|
49
|
+
}
|
|
50
|
+
else if (typeof key === "string") {
|
|
51
|
+
if (value) {
|
|
52
|
+
setDataInStorage("accountInfo", { ...accountInfo, [key]: value });
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
console.error("Value is not provided for the given key to update admin info");
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
console.error("update logo action ", error);
|
|
61
|
+
}
|
|
62
|
+
},
|
|
31
63
|
isAuthenticated: (cookie) => {
|
|
32
64
|
if (cookie) {
|
|
33
65
|
return isAuth();
|
package/dist/auth/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EACN,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,GAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,gBAAgB,MAAM,uBAAuB,CAAC;AACrD,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,IAAI,GAAG;IACZ,MAAM;IACN,MAAM;IACN,gBAAgB;IAChB,iBAAiB,EAAE,CAAC,KAAa,EAAE,EAAE;QACpC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;QAC/C,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,GAAG,CAAC;IAC5B,CAAC;IACD,kBAAkB,EAAE,CA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C;gBACrC,UAAU;gBACV,KAAK,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;oBAC/C,WAAW,GAAG,EAAE,GAAG,WAAW,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC;gBAC/C,CAAC;gBACD,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;gBACzB,gBAAgB,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;YAC9C,CAAC;iBAAM,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;gBACpC,IAAI,KAAK,EAAE,CAAC;oBACX,gBAAgB,CAAC,aAAa,EAAE,EAAE,GAAG,WAAW,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;gBACnE,CAAC;qBAAM,CAAC;oBACP,OAAO,CAAC,KAAK,CACZ,8DAA8D,CAC9D,CAAC;gBACH,CAAC;YACF,CAAC;QACF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,CAAC,KAAK,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC;QAC7C,CAAC;IACF,CAAC;IACD,eAAe,EAAE,CAAC,MAAgB,EAAE,EAAE;QACrC,IAAI,MAAM,EAAE,CAAC;YACZ,OAAO,MAAM,EAAE,CAAC;QACjB,CAAC;QACD,OAAO,kBAAkB,CAAC,oBAAoB,CAAC,KAAK,SAAS,CAAC;IAC/D,CAAC;IACD,cAAc,EAAE,CAAC,GAAoB,EAAE,EAAE,CAAC,kBAAkB,CAAC,GAAG,CAAC;IACjE,MAAM;CACN,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -11,14 +11,19 @@ async function signInWithGoogle({ onSuccess, onError, onFetching, onSettled, })
|
|
|
11
11
|
.then((result) => {
|
|
12
12
|
// This gives you a Google Access Token. You can use it to access the Google API.
|
|
13
13
|
const credential = GoogleAuthProvider.credentialFromResult(result);
|
|
14
|
-
const token = credential?.accessToken;
|
|
14
|
+
// const token = credential?.accessToken;
|
|
15
15
|
// The signed-in user info.
|
|
16
16
|
const user = result.user;
|
|
17
|
+
// console.log(user);
|
|
17
18
|
return signup({
|
|
19
|
+
provider: "Google",
|
|
20
|
+
uid: user.uid,
|
|
18
21
|
name: String(user.displayName),
|
|
19
22
|
email: String(user.email),
|
|
20
|
-
username: user.
|
|
21
|
-
|
|
23
|
+
username: String(user.email),
|
|
24
|
+
password: user.uid.substring(0, user.uid.length / 2),
|
|
25
|
+
// token: token,
|
|
26
|
+
today: new Date(),
|
|
22
27
|
}, {
|
|
23
28
|
onFetching: () => onFetching?.(),
|
|
24
29
|
onError: (error) => onError?.(error),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signInWithGoogle.js","sourceRoot":"","sources":["../../src/auth/signInWithGoogle.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,GAAG,MAAM,uBAAuB,CAAC;AACxC,OAAO,MAAM,MAAM,aAAa,CAAC;AASjC,oCAAoC;AACpC,KAAK,UAAU,gBAAgB,CAAC,EAC/B,SAAS,EACT,OAAO,EACP,UAAU,EACV,SAAS,GACU;IACnB,IAAI,CAAC;QACJ,MAAM,QAAQ,GAAG,IAAI,kBAAkB,EAAE,CAAC;QAC1C,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC1B,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC;aAC7B,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;YAChB,iFAAiF;YACjF,MAAM,UAAU,GAAG,kBAAkB,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;YACnE,
|
|
1
|
+
{"version":3,"file":"signInWithGoogle.js","sourceRoot":"","sources":["../../src/auth/signInWithGoogle.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACj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AAI,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC;gBACtC,SAAS,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,EAAE;aAC9B,CACD,CAAC;QACH,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YAChB,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;YACjB,OAAO,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC;YAC9C,sBAAsB;YACtB,gCAAgC;YAChC,sCAAsC;YACtC,wCAAwC;YACxC,wCAAwC;YACxC,yCAAyC;YACzC,oEAAoE;YACpE,MAAM;QACP,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACd,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;IAChB,CAAC;AACF,CAAC;AAED,eAAe,gBAAgB,CAAC"}
|
package/dist/auth/types.d.ts
CHANGED
|
@@ -6,10 +6,13 @@ interface AuthRequest {
|
|
|
6
6
|
}
|
|
7
7
|
type AuthRequestParams = unknown;
|
|
8
8
|
interface SignupRequest extends AuthRequest {
|
|
9
|
+
provider?: string;
|
|
10
|
+
uid?: string;
|
|
9
11
|
gender?: string;
|
|
10
12
|
username?: string;
|
|
11
13
|
image_url?: string;
|
|
12
14
|
name?: string;
|
|
13
15
|
token?: string;
|
|
16
|
+
today?: Date;
|
|
14
17
|
}
|
|
15
18
|
export type { AuthRequest, AuthRequestParams, SignupRequest };
|
package/dist/config/axios.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare const BASE_URL: string | undefined;
|
|
|
4
4
|
export declare const http: import("axios").AxiosInstance;
|
|
5
5
|
export declare const chttp: import("axios").AxiosInstance;
|
|
6
6
|
export declare const post: (endpoint: string, data?: unknown, config?: AxiosRequestConfig<unknown>) => Promise<AxiosResponse>;
|
|
7
|
+
export declare const put: (endpoint: string, data?: unknown, config?: AxiosRequestConfig<unknown>) => Promise<AxiosResponse>;
|
|
7
8
|
export declare const get: (endpoint: string, config?: AxiosRequestConfig<unknown>) => Promise<AxiosResponse>;
|
|
8
9
|
export declare const patch: <T>(endpoint: string, data: T) => Promise<AxiosResponse>;
|
|
9
10
|
export declare const login: (data: AuthRequest) => Promise<AxiosResponse>;
|
package/dist/config/axios.js
CHANGED
|
@@ -21,23 +21,6 @@ export const chttp = axios.create({
|
|
|
21
21
|
"Content-Type": "application/json",
|
|
22
22
|
},
|
|
23
23
|
});
|
|
24
|
-
export const post = (endpoint, data, config) => new Promise((resolve, reject) => http
|
|
25
|
-
.post(endpoint, data, config)
|
|
26
|
-
.then(resolve)
|
|
27
|
-
.catch((e) => reject(e.response?.data)));
|
|
28
|
-
export const get = (endpoint, config) => new Promise((resolve, reject) => http
|
|
29
|
-
.get(endpoint, config)
|
|
30
|
-
.then(resolve)
|
|
31
|
-
.catch((e) => reject(e.response?.data)));
|
|
32
|
-
export const patch = (endpoint, data) => new Promise((resolve, reject) => http
|
|
33
|
-
.patch(endpoint, data)
|
|
34
|
-
.then(resolve)
|
|
35
|
-
.catch((e) => reject(e.response.data)));
|
|
36
|
-
export const login = (data) => post("passport/basic/login", data);
|
|
37
|
-
export const logout = () => post("user/logout");
|
|
38
|
-
export const passwordReset = (data) => post("user/reset-password", data);
|
|
39
|
-
export const signup = (data) => post("passport/basic/signup", data);
|
|
40
|
-
/* For Client Side Handling */
|
|
41
24
|
http.interceptors.request.use((config) => {
|
|
42
25
|
if (config.headers) {
|
|
43
26
|
config.headers["Content-Type"] = "application/json";
|
|
@@ -83,4 +66,28 @@ chttp.interceptors.response.use((response) => response, async (error) => {
|
|
|
83
66
|
// }
|
|
84
67
|
return Promise.reject(error);
|
|
85
68
|
});
|
|
69
|
+
export const post = (endpoint, data, config) => new Promise((resolve, reject) => http
|
|
70
|
+
.post(endpoint, data, config)
|
|
71
|
+
.then(resolve)
|
|
72
|
+
.catch((e) => reject(e.response?.data)));
|
|
73
|
+
export const put = (endpoint, data, config) => new Promise((resolve, reject) => http
|
|
74
|
+
.put(endpoint, data, config)
|
|
75
|
+
.then(resolve)
|
|
76
|
+
.catch((e) => reject(e.response?.data)));
|
|
77
|
+
export const get = (endpoint, config) => {
|
|
78
|
+
// console.log('Get Request Config :', config);
|
|
79
|
+
return new Promise((resolve, reject) => http
|
|
80
|
+
.get(endpoint, config)
|
|
81
|
+
.then(resolve)
|
|
82
|
+
.catch((e) => reject(e.response?.data)));
|
|
83
|
+
};
|
|
84
|
+
export const patch = (endpoint, data) => new Promise((resolve, reject) => http
|
|
85
|
+
.patch(endpoint, data)
|
|
86
|
+
.then(resolve)
|
|
87
|
+
.catch((e) => reject(e.response.data)));
|
|
88
|
+
export const login = (data) => post("passport/basic/login", data);
|
|
89
|
+
export const logout = () => post("user/logout");
|
|
90
|
+
export const passwordReset = (data) => post("user/reset-password", data);
|
|
91
|
+
export const signup = (data) => post("passport/basic/signup", data);
|
|
92
|
+
/* For Client Side Handling */
|
|
86
93
|
//# sourceMappingURL=axios.js.map
|