@helpdice/sdk 0.1.4 → 0.1.6
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/config/route.js +3 -1
- package/dist/config/route.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/sales/endpoint.d.ts +1 -1
- package/dist/sales/endpoint.js +1 -1
- package/dist/sales/endpoint.js.map +1 -1
- package/dist/sales/index.d.ts +2 -1
- package/dist/sales/index.js +2 -7
- package/dist/sales/index.js.map +1 -1
- package/dist/sales/lead.d.ts +11 -0
- package/dist/sales/lead.js +17 -0
- package/dist/sales/lead.js.map +1 -0
- package/dist/sales/types.d.ts +31 -0
- package/dist/sales/types.js +15 -0
- package/dist/sales/types.js.map +1 -0
- package/dist/types.d.ts +5 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/package.json +3 -2
package/dist/config/route.js
CHANGED
|
@@ -5,6 +5,7 @@ import auth from "../auth/endpoint.js";
|
|
|
5
5
|
import cms from "../content/endpoint.js";
|
|
6
6
|
import inventory from "../inventory/endpoint.js";
|
|
7
7
|
import payment from "../payment/endpoint.js";
|
|
8
|
+
import sales from "../sales/endpoint.js";
|
|
8
9
|
import support from "../support/endpoint.js";
|
|
9
10
|
import tools from "../tools/endpoint.js";
|
|
10
11
|
const urls = {
|
|
@@ -17,13 +18,14 @@ const urls = {
|
|
|
17
18
|
payment,
|
|
18
19
|
inventory,
|
|
19
20
|
tools,
|
|
21
|
+
sales
|
|
20
22
|
};
|
|
21
23
|
// Function to get the URL dynamically based on category, version, and action
|
|
22
24
|
export function getUrl(category, version, action) {
|
|
23
25
|
const categoryData = urls[category]; // Access the correct category dynamically
|
|
24
26
|
if (categoryData) {
|
|
25
27
|
const versionData = categoryData[version]; // Access the correct version dynamically
|
|
26
|
-
console.log(versionData?.[action]);
|
|
28
|
+
// console.log(versionData?.[action]);
|
|
27
29
|
if (versionData !== undefined) {
|
|
28
30
|
console.log(versionData[action]);
|
|
29
31
|
return `/api/${version}/${category}/${versionData[action]}`; // Construct the URL
|
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,MAAM,qBAAqB,CAAC;AACvC,OAAO,GAAG,MAAM,wBAAwB,CAAC;AACzC,OAAO,SAAS,MAAM,0BAA0B,CAAC;AACjD,OAAO,OAAO,MAAM,wBAAwB,CAAC;AAC7C,OAAO,OAAO,MAAM,wBAAwB,CAAC;AAC7C,OAAO,KAAK,MAAM,sBAAsB,CAAC;AAYzC,MAAM,IAAI,GAAS;IAClB,IAAI;IACJ,GAAG;IACH,OAAO;IACP,UAAU;IACV,OAAO;IACP,MAAM;IACN,OAAO;IACP,SAAS;IACT,KAAK;CACL,CAAC;AAEF,6EAA6E;AAC7E,MAAM,UAAU,MAAM,CACrB,QAAgB,EAChB,OAAe,EACf,MAAc;IAEd,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,0CAA0C;IAC/E,IAAI,YAAY,EAAE,CAAC;QAClB,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,yCAAyC;QACpF,
|
|
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,MAAM,qBAAqB,CAAC;AACvC,OAAO,GAAG,MAAM,wBAAwB,CAAC;AACzC,OAAO,SAAS,MAAM,0BAA0B,CAAC;AACjD,OAAO,OAAO,MAAM,wBAAwB,CAAC;AAC7C,OAAO,KAAK,MAAM,sBAAsB,CAAC;AACzC,OAAO,OAAO,MAAM,wBAAwB,CAAC;AAC7C,OAAO,KAAK,MAAM,sBAAsB,CAAC;AAYzC,MAAM,IAAI,GAAS;IAClB,IAAI;IACJ,GAAG;IACH,OAAO;IACP,UAAU;IACV,OAAO;IACP,MAAM;IACN,OAAO;IACP,SAAS;IACT,KAAK;IACL,KAAK;CACL,CAAC;AAEF,6EAA6E;AAC7E,MAAM,UAAU,MAAM,CACrB,QAAgB,EAChB,OAAe,EACf,MAAc;IAEd,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,0CAA0C;IAC/E,IAAI,YAAY,EAAE,CAAC;QAClB,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,yCAAyC;QACpF,sCAAsC;QACtC,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC/B,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;YACjC,OAAO,QAAQ,OAAO,IAAI,QAAQ,IAAI,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,oBAAoB;QAClF,CAAC;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/index.d.ts
CHANGED
|
@@ -9,5 +9,7 @@ export { default as Support } from "./support/index.js";
|
|
|
9
9
|
export { default as Assets } from "./assets/index.js";
|
|
10
10
|
export { default as Account } from "./account/index.js";
|
|
11
11
|
export { default as shareUrl } from "./utils/share.js";
|
|
12
|
+
export { default as Sales } from "./sales/index.js";
|
|
12
13
|
export { default as Inventory } from "./inventory/index.js";
|
|
13
14
|
export { default as Tools } from "./tools/index.js";
|
|
15
|
+
export * from './sales/types.js';
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,10 @@ export { default as Support } from "./support/index.js";
|
|
|
12
12
|
export { default as Assets } from "./assets/index.js";
|
|
13
13
|
export { default as Account } from "./account/index.js";
|
|
14
14
|
export { default as shareUrl } from "./utils/share.js";
|
|
15
|
+
export { default as Sales } from "./sales/index.js";
|
|
15
16
|
export { default as Inventory } from "./inventory/index.js";
|
|
16
17
|
export { default as Tools } from "./tools/index.js";
|
|
17
18
|
// export { useUser, usePrivate, useAuth } from './hooks';
|
|
19
|
+
// Type
|
|
20
|
+
export * from './sales/types.js';
|
|
18
21
|
//# 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;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,Q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dist/sales/endpoint.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint.js","sourceRoot":"","sources":["../../src/sales/endpoint.ts"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG;IACb,EAAE,EAAE;QACH,
|
|
1
|
+
{"version":3,"file":"endpoint.js","sourceRoot":"","sources":["../../src/sales/endpoint.ts"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG;IACb,EAAE,EAAE;QACH,OAAO,EAAE,MAAM;KACf;CACD,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
package/dist/sales/index.d.ts
CHANGED
package/dist/sales/index.js
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getUrl } from "../config/route.js";
|
|
1
|
+
import { addLead } from "./lead.js";
|
|
3
2
|
const Sales = {
|
|
4
|
-
|
|
5
|
-
params: {
|
|
6
|
-
slug,
|
|
7
|
-
},
|
|
8
|
-
}),
|
|
3
|
+
addLead,
|
|
9
4
|
};
|
|
10
5
|
export default Sales;
|
|
11
6
|
//# sourceMappingURL=index.js.map
|
package/dist/sales/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sales/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sales/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,KAAK,GAAG;IACb,OAAO;CACP,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AxiosRequestConfig } from "axios";
|
|
2
|
+
import type { Lead } from "./types.js";
|
|
3
|
+
interface StartOptions {
|
|
4
|
+
config?: AxiosRequestConfig | null;
|
|
5
|
+
onLoading?: (isLoading: boolean) => void;
|
|
6
|
+
onSuccess?: (data: any) => void;
|
|
7
|
+
onError?: (error: any) => void;
|
|
8
|
+
onSettled?: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function addLead(data: Lead, { config, onLoading, onSuccess, onError, onSettled, }?: StartOptions): void;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { post } from "../config/axios.js";
|
|
2
|
+
import { getUrl } from "../config/route.js";
|
|
3
|
+
import handler from "../utils/handler.js";
|
|
4
|
+
export function addLead(data, { config = null, onLoading = () => { }, onSuccess = () => { }, onError = () => { }, onSettled = () => { }, } = {}) {
|
|
5
|
+
return handler({
|
|
6
|
+
promise: post(getUrl("sales", "v1", "addLead"), {
|
|
7
|
+
...data
|
|
8
|
+
}, config || undefined),
|
|
9
|
+
onLoading,
|
|
10
|
+
onError: (error) => onError(error),
|
|
11
|
+
onSuccess: (responseData) => {
|
|
12
|
+
onSuccess(responseData);
|
|
13
|
+
},
|
|
14
|
+
onSettled,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=lead.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lead.js","sourceRoot":"","sources":["../../src/sales/lead.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAW1C,MAAM,UAAU,OAAO,CACtB,IAAU,EACV,EACC,MAAM,GAAG,IAAI,EACb,SAAS,GAAG,GAAG,EAAE,GAAE,CAAC,EACpB,SAAS,GAAG,GAAG,EAAE,GAAE,CAAC,EACpB,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,EAClB,SAAS,GAAG,GAAG,EAAE,GAAE,CAAC,MACH,EAAE;IAEpB,OAAO,OAAO,CAAC;QACd,OAAO,EAAE,IAAI,CACZ,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,CAAC,EAChC;YACC,GAAG,IAAI;SACP,EACD,MAAM,IAAI,SAAS,CACnB;QACD,SAAS;QACT,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;QAClC,SAAS,EAAE,CAAC,YAAiB,EAAE,EAAE;YACvB,SAAS,CAAC,YAAY,CAAC,CAAC;QAClC,CAAC;QACD,SAAS;KACT,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Gender } from "../types.js";
|
|
2
|
+
export declare enum LeadSource {
|
|
3
|
+
Paid = "Paid",
|
|
4
|
+
Organic = "Organic"
|
|
5
|
+
}
|
|
6
|
+
export declare enum LeadStatus {
|
|
7
|
+
Raw = "Raw",
|
|
8
|
+
InProgress = "In-Progress",
|
|
9
|
+
NoResponse = "No-response",
|
|
10
|
+
Won = "Won",
|
|
11
|
+
Bad = "Bad",
|
|
12
|
+
Archived = "Archived"
|
|
13
|
+
}
|
|
14
|
+
export type Lead = {
|
|
15
|
+
name?: string;
|
|
16
|
+
email?: string;
|
|
17
|
+
contact?: string;
|
|
18
|
+
category: string;
|
|
19
|
+
channel: string;
|
|
20
|
+
note?: string;
|
|
21
|
+
objective: string;
|
|
22
|
+
source: LeadSource;
|
|
23
|
+
status: LeadStatus;
|
|
24
|
+
links: string[];
|
|
25
|
+
address: string;
|
|
26
|
+
position: string;
|
|
27
|
+
gender: Gender;
|
|
28
|
+
company_name?: string;
|
|
29
|
+
timings?: string;
|
|
30
|
+
timezone?: string;
|
|
31
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export var LeadSource;
|
|
2
|
+
(function (LeadSource) {
|
|
3
|
+
LeadSource["Paid"] = "Paid";
|
|
4
|
+
LeadSource["Organic"] = "Organic";
|
|
5
|
+
})(LeadSource || (LeadSource = {}));
|
|
6
|
+
export var LeadStatus;
|
|
7
|
+
(function (LeadStatus) {
|
|
8
|
+
LeadStatus["Raw"] = "Raw";
|
|
9
|
+
LeadStatus["InProgress"] = "In-Progress";
|
|
10
|
+
LeadStatus["NoResponse"] = "No-response";
|
|
11
|
+
LeadStatus["Won"] = "Won";
|
|
12
|
+
LeadStatus["Bad"] = "Bad";
|
|
13
|
+
LeadStatus["Archived"] = "Archived";
|
|
14
|
+
})(LeadStatus || (LeadStatus = {}));
|
|
15
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/sales/types.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,iCAAmB,CAAA;AACrB,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAED,MAAM,CAAN,IAAY,UAOX;AAPD,WAAY,UAAU;IAClB,yBAAW,CAAA;IACX,wCAA0B,CAAA;IAC1B,wCAA0B,CAAA;IAC1B,yBAAW,CAAA;IACX,yBAAW,CAAA;IACX,mCAAqB,CAAA;AACzB,CAAC,EAPW,UAAU,KAAV,UAAU,QAOrB"}
|
package/dist/types.d.ts
ADDED
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,MAIX;AAJD,WAAY,MAAM;IAChB,uBAAa,CAAA;IACb,2BAAiB,CAAA;IACjB,yBAAe,CAAA;AACjB,CAAC,EAJW,MAAM,KAAN,MAAM,QAIjB"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@helpdice/sdk",
|
|
3
3
|
"type": "module",
|
|
4
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.1.
|
|
5
|
+
"version": "0.1.6",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"repository": {
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"build": "tsc",
|
|
45
45
|
"check": "biome check --write ./src",
|
|
46
46
|
"workflow:check": "biome check ./src",
|
|
47
|
-
"release": "pnpm run build && changeset publish"
|
|
47
|
+
"release": "pnpm run build && changeset publish",
|
|
48
|
+
"release:github": "npm publish --registry=https://npm.pkg.github.com"
|
|
48
49
|
}
|
|
49
50
|
}
|