@voltade/wess-sdk 1.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 (62) hide show
  1. package/README.md +352 -0
  2. package/dist/client.d.ts +20 -0
  3. package/dist/client.d.ts.map +1 -0
  4. package/dist/client.js +195 -0
  5. package/dist/client.js.map +1 -0
  6. package/dist/errors.d.ts +28 -0
  7. package/dist/errors.d.ts.map +1 -0
  8. package/dist/errors.js +59 -0
  9. package/dist/errors.js.map +1 -0
  10. package/dist/index.d.ts +48 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +55 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/resources/branches.d.ts +55 -0
  15. package/dist/resources/branches.d.ts.map +1 -0
  16. package/dist/resources/branches.js +67 -0
  17. package/dist/resources/branches.js.map +1 -0
  18. package/dist/resources/customers.d.ts +18 -0
  19. package/dist/resources/customers.d.ts.map +1 -0
  20. package/dist/resources/customers.js +20 -0
  21. package/dist/resources/customers.js.map +1 -0
  22. package/dist/resources/index.d.ts +7 -0
  23. package/dist/resources/index.d.ts.map +1 -0
  24. package/dist/resources/index.js +7 -0
  25. package/dist/resources/index.js.map +1 -0
  26. package/dist/resources/user.d.ts +16 -0
  27. package/dist/resources/user.d.ts.map +1 -0
  28. package/dist/resources/user.js +18 -0
  29. package/dist/resources/user.js.map +1 -0
  30. package/dist/types/appointment.d.ts +164 -0
  31. package/dist/types/appointment.d.ts.map +1 -0
  32. package/dist/types/appointment.js +67 -0
  33. package/dist/types/appointment.js.map +1 -0
  34. package/dist/types/branch.d.ts +60 -0
  35. package/dist/types/branch.d.ts.map +1 -0
  36. package/dist/types/branch.js +59 -0
  37. package/dist/types/branch.js.map +1 -0
  38. package/dist/types/config.d.ts +17 -0
  39. package/dist/types/config.d.ts.map +1 -0
  40. package/dist/types/config.js +15 -0
  41. package/dist/types/config.js.map +1 -0
  42. package/dist/types/customer.d.ts +37 -0
  43. package/dist/types/customer.d.ts.map +1 -0
  44. package/dist/types/customer.js +36 -0
  45. package/dist/types/customer.js.map +1 -0
  46. package/dist/types/error.d.ts +14 -0
  47. package/dist/types/error.d.ts.map +1 -0
  48. package/dist/types/error.js +12 -0
  49. package/dist/types/error.js.map +1 -0
  50. package/dist/types/index.d.ts +11 -0
  51. package/dist/types/index.d.ts.map +1 -0
  52. package/dist/types/index.js +17 -0
  53. package/dist/types/index.js.map +1 -0
  54. package/dist/types/user.d.ts +26 -0
  55. package/dist/types/user.d.ts.map +1 -0
  56. package/dist/types/user.js +17 -0
  57. package/dist/types/user.js.map +1 -0
  58. package/dist/types.d.ts +6 -0
  59. package/dist/types.d.ts.map +1 -0
  60. package/dist/types.js +6 -0
  61. package/dist/types.js.map +1 -0
  62. package/package.json +80 -0
@@ -0,0 +1,48 @@
1
+ /**
2
+ * @voltade/wess-sdk
3
+ * A comprehensive TypeScript SDK for the WESS Open API
4
+ */
5
+ import { HttpClient } from "./client.js";
6
+ import { UserResource } from "./resources/user.js";
7
+ import { BranchesResource } from "./resources/branches.js";
8
+ import { CustomersResource } from "./resources/customers.js";
9
+ import type { WessClientConfig } from "./types.js";
10
+ /**
11
+ * Main WESS API Client
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * const client = new WessClient({
16
+ * baseUrl: 'https://api.example.com/api',
17
+ * bearerToken: 'your-token-here',
18
+ * });
19
+ *
20
+ * // Get current user
21
+ * const user = await client.user.get();
22
+ *
23
+ * // List branches
24
+ * const branches = await client.branches.list();
25
+ *
26
+ * // Get online appointment services
27
+ * const services = await client.branches.getOnlineAppointmentServices(branchId);
28
+ * ```
29
+ */
30
+ export declare class WessClient {
31
+ private readonly http;
32
+ /** User resource for authentication/profile operations */
33
+ readonly user: UserResource;
34
+ /** Branches resource for branch and online appointment operations */
35
+ readonly branches: BranchesResource;
36
+ /** Customers resource for customer lookup operations */
37
+ readonly customers: CustomersResource;
38
+ constructor(config: WessClientConfig);
39
+ /**
40
+ * Get the underlying HTTP client for custom requests
41
+ */
42
+ getHttpClient(): HttpClient;
43
+ }
44
+ export { HttpClient } from "./client.js";
45
+ export { UserResource, BranchesResource, CustomersResource, } from "./resources/index.js";
46
+ export * from "./types.js";
47
+ export * from "./errors.js";
48
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;IAElC,0DAA0D;IAC1D,SAAgB,IAAI,EAAE,YAAY,CAAC;IAEnC,qEAAqE;IACrE,SAAgB,QAAQ,EAAE,gBAAgB,CAAC;IAE3C,wDAAwD;IACxD,SAAgB,SAAS,EAAE,iBAAiB,CAAC;gBAEjC,MAAM,EAAE,gBAAgB;IAOpC;;OAEG;IACH,aAAa,IAAI,UAAU;CAG5B;AAGD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,55 @@
1
+ /**
2
+ * @voltade/wess-sdk
3
+ * A comprehensive TypeScript SDK for the WESS Open API
4
+ */
5
+ import { HttpClient } from "./client.js";
6
+ import { UserResource } from "./resources/user.js";
7
+ import { BranchesResource } from "./resources/branches.js";
8
+ import { CustomersResource } from "./resources/customers.js";
9
+ /**
10
+ * Main WESS API Client
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * const client = new WessClient({
15
+ * baseUrl: 'https://api.example.com/api',
16
+ * bearerToken: 'your-token-here',
17
+ * });
18
+ *
19
+ * // Get current user
20
+ * const user = await client.user.get();
21
+ *
22
+ * // List branches
23
+ * const branches = await client.branches.list();
24
+ *
25
+ * // Get online appointment services
26
+ * const services = await client.branches.getOnlineAppointmentServices(branchId);
27
+ * ```
28
+ */
29
+ export class WessClient {
30
+ http;
31
+ /** User resource for authentication/profile operations */
32
+ user;
33
+ /** Branches resource for branch and online appointment operations */
34
+ branches;
35
+ /** Customers resource for customer lookup operations */
36
+ customers;
37
+ constructor(config) {
38
+ this.http = new HttpClient(config);
39
+ this.user = new UserResource(this.http);
40
+ this.branches = new BranchesResource(this.http);
41
+ this.customers = new CustomersResource(this.http);
42
+ }
43
+ /**
44
+ * Get the underlying HTTP client for custom requests
45
+ */
46
+ getHttpClient() {
47
+ return this.http;
48
+ }
49
+ }
50
+ // Re-export everything
51
+ export { HttpClient } from "./client.js";
52
+ export { UserResource, BranchesResource, CustomersResource, } from "./resources/index.js";
53
+ export * from "./types.js";
54
+ export * from "./errors.js";
55
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,UAAU;IACJ,IAAI,CAAa;IAElC,0DAA0D;IAC1C,IAAI,CAAe;IAEnC,qEAAqE;IACrD,QAAQ,CAAmB;IAE3C,wDAAwD;IACxC,SAAS,CAAoB;IAE7C,YAAY,MAAwB;QAClC,IAAI,CAAC,IAAI,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;QACnC,IAAI,CAAC,IAAI,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,QAAQ,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChD,IAAI,CAAC,SAAS,GAAG,IAAI,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpD,CAAC;IAED;;OAEG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF;AAED,uBAAuB;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Branches Resource
3
+ * Endpoints for managing branches and branch-related data
4
+ */
5
+ import type { HttpClient } from "../client.js";
6
+ import type { Branch, Customer, OnlineAppointmentService, OnlineAppointmentEmployee, OnlineAppointmentTimeSlot, GetEmployeesParams, GetTimeSlotsParams } from "../types.js";
7
+ export declare class BranchesResource {
8
+ private readonly http;
9
+ constructor(http: HttpClient);
10
+ /**
11
+ * List all branches
12
+ * GET /v1/branches
13
+ * @returns Array of branches
14
+ */
15
+ list(): Promise<Branch[]>;
16
+ /**
17
+ * Get a single branch by ID
18
+ * GET /v1/branches/:branch
19
+ * @param branchId - The branch ID
20
+ * @returns The branch details
21
+ */
22
+ get(branchId: number): Promise<Branch>;
23
+ /**
24
+ * Get a customer from a specific branch
25
+ * GET /v1/branches/:branch/customers/:customer
26
+ * @param branchId - The branch ID
27
+ * @param customerId - The customer ID or code
28
+ * @returns The customer details
29
+ */
30
+ getCustomer(branchId: number, customerId: string | number): Promise<Customer>;
31
+ /**
32
+ * Get services available for online appointments
33
+ * GET /v1/branches/:branch/online-appointments/services
34
+ * @param branchId - The branch ID
35
+ * @returns Array of services available for online booking
36
+ */
37
+ getOnlineAppointmentServices(branchId: number): Promise<OnlineAppointmentService[]>;
38
+ /**
39
+ * Get employees available for online appointments
40
+ * GET /v1/branches/:branch/online-appointments/employees
41
+ * @param branchId - The branch ID
42
+ * @param params - Filter parameters (product_ids required)
43
+ * @returns Array of employees with their products
44
+ */
45
+ getOnlineAppointmentEmployees(branchId: number, params: GetEmployeesParams): Promise<OnlineAppointmentEmployee[]>;
46
+ /**
47
+ * Get available time slots for online appointments
48
+ * GET /v1/branches/:branch/online-appointments/time-slots
49
+ * @param branchId - The branch ID
50
+ * @param params - Query parameters (product_ids and date required)
51
+ * @returns Array of time slots per employee
52
+ */
53
+ getOnlineAppointmentTimeSlots(branchId: number, params: GetTimeSlotsParams): Promise<OnlineAppointmentTimeSlot[]>;
54
+ }
55
+ //# sourceMappingURL=branches.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"branches.d.ts","sourceRoot":"","sources":["../../resources/branches.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EACV,MAAM,EACN,QAAQ,EACR,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAErB,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C;;;;OAIG;IACG,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAI/B;;;;;OAKG;IACG,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAI5C;;;;;;OAMG;IACG,WAAW,CACf,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GAAG,MAAM,GAC1B,OAAO,CAAC,QAAQ,CAAC;IAMpB;;;;;OAKG;IACG,4BAA4B,CAChC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,wBAAwB,EAAE,CAAC;IAMtC;;;;;;OAMG;IACG,6BAA6B,CACjC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,yBAAyB,EAAE,CAAC;IAOvC;;;;;;OAMG;IACG,6BAA6B,CACjC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,yBAAyB,EAAE,CAAC;CAMxC"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Branches Resource
3
+ * Endpoints for managing branches and branch-related data
4
+ */
5
+ export class BranchesResource {
6
+ http;
7
+ constructor(http) {
8
+ this.http = http;
9
+ }
10
+ /**
11
+ * List all branches
12
+ * GET /v1/branches
13
+ * @returns Array of branches
14
+ */
15
+ async list() {
16
+ return this.http.get("/v1/branches");
17
+ }
18
+ /**
19
+ * Get a single branch by ID
20
+ * GET /v1/branches/:branch
21
+ * @param branchId - The branch ID
22
+ * @returns The branch details
23
+ */
24
+ async get(branchId) {
25
+ return this.http.get(`/v1/branches/${branchId}`);
26
+ }
27
+ /**
28
+ * Get a customer from a specific branch
29
+ * GET /v1/branches/:branch/customers/:customer
30
+ * @param branchId - The branch ID
31
+ * @param customerId - The customer ID or code
32
+ * @returns The customer details
33
+ */
34
+ async getCustomer(branchId, customerId) {
35
+ return this.http.get(`/v1/branches/${branchId}/customers/${customerId}`);
36
+ }
37
+ /**
38
+ * Get services available for online appointments
39
+ * GET /v1/branches/:branch/online-appointments/services
40
+ * @param branchId - The branch ID
41
+ * @returns Array of services available for online booking
42
+ */
43
+ async getOnlineAppointmentServices(branchId) {
44
+ return this.http.get(`/v1/branches/${branchId}/online-appointments/services`);
45
+ }
46
+ /**
47
+ * Get employees available for online appointments
48
+ * GET /v1/branches/:branch/online-appointments/employees
49
+ * @param branchId - The branch ID
50
+ * @param params - Filter parameters (product_ids required)
51
+ * @returns Array of employees with their products
52
+ */
53
+ async getOnlineAppointmentEmployees(branchId, params) {
54
+ return this.http.get(`/v1/branches/${branchId}/online-appointments/employees`, { params: { product_ids: params.product_ids } });
55
+ }
56
+ /**
57
+ * Get available time slots for online appointments
58
+ * GET /v1/branches/:branch/online-appointments/time-slots
59
+ * @param branchId - The branch ID
60
+ * @param params - Query parameters (product_ids and date required)
61
+ * @returns Array of time slots per employee
62
+ */
63
+ async getOnlineAppointmentTimeSlots(branchId, params) {
64
+ return this.http.get(`/v1/branches/${branchId}/online-appointments/time-slots`, { params: { product_ids: params.product_ids, date: params.date } });
65
+ }
66
+ }
67
+ //# sourceMappingURL=branches.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"branches.js","sourceRoot":"","sources":["../../resources/branches.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,MAAM,OAAO,gBAAgB;IACE;IAA7B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD;;;;OAIG;IACH,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAW,cAAc,CAAC,CAAC;IACjD,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,GAAG,CAAC,QAAgB;QACxB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAS,gBAAgB,QAAQ,EAAE,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,WAAW,CACf,QAAgB,EAChB,UAA2B;QAE3B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAClB,gBAAgB,QAAQ,cAAc,UAAU,EAAE,CACnD,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,4BAA4B,CAChC,QAAgB;QAEhB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAClB,gBAAgB,QAAQ,+BAA+B,CACxD,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,6BAA6B,CACjC,QAAgB,EAChB,MAA0B;QAE1B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAClB,gBAAgB,QAAQ,gCAAgC,EACxD,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,EAAE,CAChD,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,6BAA6B,CACjC,QAAgB,EAChB,MAA0B;QAE1B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAClB,gBAAgB,QAAQ,iCAAiC,EACzD,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,CACnE,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Customers Resource
3
+ * Endpoints for customer management and lookup
4
+ */
5
+ import type { HttpClient } from "../client.js";
6
+ import type { Customer } from "../types.js";
7
+ export declare class CustomersResource {
8
+ private readonly http;
9
+ constructor(http: HttpClient);
10
+ /**
11
+ * Search for customers by phone number
12
+ * GET /v1/customers/phone-number/:phoneNumber
13
+ * @param phoneNumber - The phone number to search for
14
+ * @returns Array of matching customers
15
+ */
16
+ searchByPhoneNumber(phoneNumber: string): Promise<Customer[]>;
17
+ }
18
+ //# sourceMappingURL=customers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customers.d.ts","sourceRoot":"","sources":["../../resources/customers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,qBAAa,iBAAiB;IAChB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C;;;;;OAKG;IACG,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;CAKpE"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Customers Resource
3
+ * Endpoints for customer management and lookup
4
+ */
5
+ export class CustomersResource {
6
+ http;
7
+ constructor(http) {
8
+ this.http = http;
9
+ }
10
+ /**
11
+ * Search for customers by phone number
12
+ * GET /v1/customers/phone-number/:phoneNumber
13
+ * @param phoneNumber - The phone number to search for
14
+ * @returns Array of matching customers
15
+ */
16
+ async searchByPhoneNumber(phoneNumber) {
17
+ return this.http.get(`/v1/customers/phone-number/${encodeURIComponent(phoneNumber)}`);
18
+ }
19
+ }
20
+ //# sourceMappingURL=customers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customers.js","sourceRoot":"","sources":["../../resources/customers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,OAAO,iBAAiB;IACC;IAA7B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD;;;;;OAKG;IACH,KAAK,CAAC,mBAAmB,CAAC,WAAmB;QAC3C,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAClB,8BAA8B,kBAAkB,CAAC,WAAW,CAAC,EAAE,CAChE,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Resource Exports
3
+ */
4
+ export { UserResource } from "./user.js";
5
+ export { BranchesResource } from "./branches.js";
6
+ export { CustomersResource } from "./customers.js";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../resources/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Resource Exports
3
+ */
4
+ export { UserResource } from "./user.js";
5
+ export { BranchesResource } from "./branches.js";
6
+ export { CustomersResource } from "./customers.js";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../resources/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * User Resource
3
+ * GET /v1/user - Get current authenticated user
4
+ */
5
+ import type { HttpClient } from "../client.js";
6
+ import type { UserResponse } from "../types.js";
7
+ export declare class UserResource {
8
+ private readonly http;
9
+ constructor(http: HttpClient);
10
+ /**
11
+ * Get the current authenticated user
12
+ * @returns The authenticated user's information
13
+ */
14
+ get(): Promise<UserResponse>;
15
+ }
16
+ //# sourceMappingURL=user.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../resources/user.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C;;;OAGG;IACG,GAAG,IAAI,OAAO,CAAC,YAAY,CAAC;CAGnC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * User Resource
3
+ * GET /v1/user - Get current authenticated user
4
+ */
5
+ export class UserResource {
6
+ http;
7
+ constructor(http) {
8
+ this.http = http;
9
+ }
10
+ /**
11
+ * Get the current authenticated user
12
+ * @returns The authenticated user's information
13
+ */
14
+ async get() {
15
+ return this.http.get("/v1/user");
16
+ }
17
+ }
18
+ //# sourceMappingURL=user.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.js","sourceRoot":"","sources":["../../resources/user.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,OAAO,YAAY;IACM;IAA7B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD;;;OAGG;IACH,KAAK,CAAC,GAAG;QACP,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAe,UAAU,CAAC,CAAC;IACjD,CAAC;CACF"}
@@ -0,0 +1,164 @@
1
+ /**
2
+ * Online Appointment Types
3
+ */
4
+ import { z } from "zod";
5
+ export declare const ServiceDetailsSchema: z.ZodObject<{
6
+ id: z.ZodNumber;
7
+ product_id: z.ZodNumber;
8
+ processing_time: z.ZodNumber;
9
+ service_commission_type: z.ZodNumber;
10
+ consume_by: z.ZodNullable<z.ZodString>;
11
+ promotion_id: z.ZodNullable<z.ZodNumber>;
12
+ start_date: z.ZodNullable<z.ZodString>;
13
+ end_date: z.ZodNullable<z.ZodString>;
14
+ unit: z.ZodNumber;
15
+ unit_remain: z.ZodNumber;
16
+ limit_qty: z.ZodNumber;
17
+ promotion_price: z.ZodNullable<z.ZodNumber>;
18
+ show_for_online_appointment: z.ZodBoolean;
19
+ }, z.core.$strip>;
20
+ export type ServiceDetails = z.infer<typeof ServiceDetailsSchema>;
21
+ export declare const OnlineAppointmentServiceSchema: z.ZodObject<{
22
+ id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
23
+ section_id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
24
+ category_id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
25
+ name: z.ZodString;
26
+ description: z.ZodNullable<z.ZodString>;
27
+ price: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
28
+ lowest_price: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
29
+ branches: z.ZodArray<z.ZodNumber>;
30
+ service: z.ZodObject<{
31
+ id: z.ZodNumber;
32
+ product_id: z.ZodNumber;
33
+ processing_time: z.ZodNumber;
34
+ service_commission_type: z.ZodNumber;
35
+ consume_by: z.ZodNullable<z.ZodString>;
36
+ promotion_id: z.ZodNullable<z.ZodNumber>;
37
+ start_date: z.ZodNullable<z.ZodString>;
38
+ end_date: z.ZodNullable<z.ZodString>;
39
+ unit: z.ZodNumber;
40
+ unit_remain: z.ZodNumber;
41
+ limit_qty: z.ZodNumber;
42
+ promotion_price: z.ZodNullable<z.ZodNumber>;
43
+ show_for_online_appointment: z.ZodBoolean;
44
+ }, z.core.$strip>;
45
+ }, z.core.$strip>;
46
+ export type OnlineAppointmentService = z.infer<typeof OnlineAppointmentServiceSchema>;
47
+ export declare const EmployeeProductSchema: z.ZodObject<{
48
+ id: z.ZodNumber;
49
+ employee_id: z.ZodNumber;
50
+ product_id: z.ZodNumber;
51
+ product: z.ZodObject<{
52
+ id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
53
+ section_id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
54
+ category_id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
55
+ name: z.ZodString;
56
+ description: z.ZodNullable<z.ZodString>;
57
+ price: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
58
+ lowest_price: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
59
+ branches: z.ZodArray<z.ZodNumber>;
60
+ service: z.ZodObject<{
61
+ id: z.ZodNumber;
62
+ product_id: z.ZodNumber;
63
+ processing_time: z.ZodNumber;
64
+ service_commission_type: z.ZodNumber;
65
+ consume_by: z.ZodNullable<z.ZodString>;
66
+ promotion_id: z.ZodNullable<z.ZodNumber>;
67
+ start_date: z.ZodNullable<z.ZodString>;
68
+ end_date: z.ZodNullable<z.ZodString>;
69
+ unit: z.ZodNumber;
70
+ unit_remain: z.ZodNumber;
71
+ limit_qty: z.ZodNumber;
72
+ promotion_price: z.ZodNullable<z.ZodNumber>;
73
+ show_for_online_appointment: z.ZodBoolean;
74
+ }, z.core.$strip>;
75
+ }, z.core.$strip>;
76
+ }, z.core.$strip>;
77
+ export type EmployeeProduct = z.infer<typeof EmployeeProductSchema>;
78
+ export declare const OnlineAppointmentEmployeeSchema: z.ZodObject<{
79
+ id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
80
+ first_name: z.ZodString;
81
+ last_name: z.ZodString;
82
+ salutation: z.ZodString;
83
+ employee_product: z.ZodArray<z.ZodObject<{
84
+ id: z.ZodNumber;
85
+ employee_id: z.ZodNumber;
86
+ product_id: z.ZodNumber;
87
+ product: z.ZodObject<{
88
+ id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
89
+ section_id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
90
+ category_id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
91
+ name: z.ZodString;
92
+ description: z.ZodNullable<z.ZodString>;
93
+ price: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
94
+ lowest_price: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
95
+ branches: z.ZodArray<z.ZodNumber>;
96
+ service: z.ZodObject<{
97
+ id: z.ZodNumber;
98
+ product_id: z.ZodNumber;
99
+ processing_time: z.ZodNumber;
100
+ service_commission_type: z.ZodNumber;
101
+ consume_by: z.ZodNullable<z.ZodString>;
102
+ promotion_id: z.ZodNullable<z.ZodNumber>;
103
+ start_date: z.ZodNullable<z.ZodString>;
104
+ end_date: z.ZodNullable<z.ZodString>;
105
+ unit: z.ZodNumber;
106
+ unit_remain: z.ZodNumber;
107
+ limit_qty: z.ZodNumber;
108
+ promotion_price: z.ZodNullable<z.ZodNumber>;
109
+ show_for_online_appointment: z.ZodBoolean;
110
+ }, z.core.$strip>;
111
+ }, z.core.$strip>;
112
+ }, z.core.$strip>>;
113
+ }, z.core.$strip>;
114
+ export type OnlineAppointmentEmployee = z.infer<typeof OnlineAppointmentEmployeeSchema>;
115
+ export declare const OnlineAppointmentTimeSlotSchema: z.ZodObject<{
116
+ employee: z.ZodObject<{
117
+ id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
118
+ first_name: z.ZodString;
119
+ last_name: z.ZodString;
120
+ salutation: z.ZodString;
121
+ employee_product: z.ZodArray<z.ZodObject<{
122
+ id: z.ZodNumber;
123
+ employee_id: z.ZodNumber;
124
+ product_id: z.ZodNumber;
125
+ product: z.ZodObject<{
126
+ id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
127
+ section_id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
128
+ category_id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
129
+ name: z.ZodString;
130
+ description: z.ZodNullable<z.ZodString>;
131
+ price: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
132
+ lowest_price: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
133
+ branches: z.ZodArray<z.ZodNumber>;
134
+ service: z.ZodObject<{
135
+ id: z.ZodNumber;
136
+ product_id: z.ZodNumber;
137
+ processing_time: z.ZodNumber;
138
+ service_commission_type: z.ZodNumber;
139
+ consume_by: z.ZodNullable<z.ZodString>;
140
+ promotion_id: z.ZodNullable<z.ZodNumber>;
141
+ start_date: z.ZodNullable<z.ZodString>;
142
+ end_date: z.ZodNullable<z.ZodString>;
143
+ unit: z.ZodNumber;
144
+ unit_remain: z.ZodNumber;
145
+ limit_qty: z.ZodNumber;
146
+ promotion_price: z.ZodNullable<z.ZodNumber>;
147
+ show_for_online_appointment: z.ZodBoolean;
148
+ }, z.core.$strip>;
149
+ }, z.core.$strip>;
150
+ }, z.core.$strip>>;
151
+ }, z.core.$strip>;
152
+ time_slots: z.ZodArray<z.ZodString>;
153
+ }, z.core.$strip>;
154
+ export type OnlineAppointmentTimeSlot = z.infer<typeof OnlineAppointmentTimeSlotSchema>;
155
+ export declare const GetEmployeesParamsSchema: z.ZodObject<{
156
+ product_ids: z.ZodArray<z.ZodNumber>;
157
+ }, z.core.$strip>;
158
+ export type GetEmployeesParams = z.infer<typeof GetEmployeesParamsSchema>;
159
+ export declare const GetTimeSlotsParamsSchema: z.ZodObject<{
160
+ product_ids: z.ZodArray<z.ZodNumber>;
161
+ date: z.ZodString;
162
+ }, z.core.$strip>;
163
+ export type GetTimeSlotsParams = z.infer<typeof GetTimeSlotsParamsSchema>;
164
+ //# sourceMappingURL=appointment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appointment.d.ts","sourceRoot":"","sources":["../../types/appointment.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;iBAc/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;iBAUzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,8BAA8B,CACtC,CAAC;AAMF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAM1C,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAC;AAMF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAG1C,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAC;AAMF,eAAO,MAAM,wBAAwB;;iBAEnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,wBAAwB;;;iBAGnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Online Appointment Types
3
+ */
4
+ import { z } from "zod";
5
+ // ============================================================================
6
+ // Service Types
7
+ // ============================================================================
8
+ export const ServiceDetailsSchema = z.object({
9
+ id: z.number(),
10
+ product_id: z.number(),
11
+ processing_time: z.number(),
12
+ service_commission_type: z.number(),
13
+ consume_by: z.string().nullable(),
14
+ promotion_id: z.number().nullable(),
15
+ start_date: z.string().nullable(),
16
+ end_date: z.string().nullable(),
17
+ unit: z.number(),
18
+ unit_remain: z.number(),
19
+ limit_qty: z.number(),
20
+ promotion_price: z.number().nullable(),
21
+ show_for_online_appointment: z.boolean(),
22
+ });
23
+ export const OnlineAppointmentServiceSchema = z.object({
24
+ id: z.union([z.string(), z.number()]),
25
+ section_id: z.union([z.string(), z.number()]),
26
+ category_id: z.union([z.string(), z.number()]),
27
+ name: z.string(),
28
+ description: z.string().nullable(),
29
+ price: z.union([z.string(), z.number()]),
30
+ lowest_price: z.union([z.string(), z.number()]),
31
+ branches: z.array(z.number()),
32
+ service: ServiceDetailsSchema,
33
+ });
34
+ // ============================================================================
35
+ // Employee Types
36
+ // ============================================================================
37
+ export const EmployeeProductSchema = z.object({
38
+ id: z.number(),
39
+ employee_id: z.number(),
40
+ product_id: z.number(),
41
+ product: OnlineAppointmentServiceSchema,
42
+ });
43
+ export const OnlineAppointmentEmployeeSchema = z.object({
44
+ id: z.union([z.string(), z.number()]),
45
+ first_name: z.string(),
46
+ last_name: z.string(),
47
+ salutation: z.string(),
48
+ employee_product: z.array(EmployeeProductSchema),
49
+ });
50
+ // ============================================================================
51
+ // Time Slot Types
52
+ // ============================================================================
53
+ export const OnlineAppointmentTimeSlotSchema = z.object({
54
+ employee: OnlineAppointmentEmployeeSchema,
55
+ time_slots: z.array(z.string()),
56
+ });
57
+ // ============================================================================
58
+ // Request Params
59
+ // ============================================================================
60
+ export const GetEmployeesParamsSchema = z.object({
61
+ product_ids: z.array(z.number()),
62
+ });
63
+ export const GetTimeSlotsParamsSchema = z.object({
64
+ product_ids: z.array(z.number()),
65
+ date: z.string(), // Format: YYYY-MM-DD
66
+ });
67
+ //# sourceMappingURL=appointment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appointment.js","sourceRoot":"","sources":["../../types/appointment.ts"],"names":[],"mappings":"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"}