@acmekit/js-sdk 2.13.13 → 2.13.15

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 (61) hide show
  1. package/dist/admin/index.d.ts +0 -15
  2. package/dist/admin/index.d.ts.map +1 -1
  3. package/dist/admin/index.js +0 -6
  4. package/dist/admin/index.js.map +1 -1
  5. package/dist/client.d.ts +3 -3
  6. package/dist/client.d.ts.map +1 -1
  7. package/dist/client.js +6 -6
  8. package/dist/client.js.map +1 -1
  9. package/dist/esm/admin/index.d.ts +0 -15
  10. package/dist/esm/admin/index.d.ts.map +1 -1
  11. package/dist/esm/admin/index.js +0 -6
  12. package/dist/esm/admin/index.js.map +1 -1
  13. package/dist/esm/client.d.ts +3 -3
  14. package/dist/esm/client.d.ts.map +1 -1
  15. package/dist/esm/client.js +5 -5
  16. package/dist/esm/client.js.map +1 -1
  17. package/dist/esm/index.d.ts +0 -3
  18. package/dist/esm/index.d.ts.map +1 -1
  19. package/dist/esm/index.js +0 -3
  20. package/dist/esm/index.js.map +1 -1
  21. package/dist/esm/types.d.ts +1 -1
  22. package/dist/esm/types.d.ts.map +1 -1
  23. package/dist/index.d.ts +0 -3
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +1 -5
  26. package/dist/index.js.map +1 -1
  27. package/dist/types.d.ts +1 -1
  28. package/dist/types.d.ts.map +1 -1
  29. package/package.json +2 -2
  30. package/dist/admin/customer-group.d.ts +0 -170
  31. package/dist/admin/customer-group.d.ts.map +0 -1
  32. package/dist/admin/customer-group.js +0 -206
  33. package/dist/admin/customer-group.js.map +0 -1
  34. package/dist/admin/customer.d.ts +0 -264
  35. package/dist/admin/customer.d.ts.map +0 -1
  36. package/dist/admin/customer.js +0 -323
  37. package/dist/admin/customer.js.map +0 -1
  38. package/dist/admin/store.d.ts +0 -116
  39. package/dist/admin/store.d.ts.map +0 -1
  40. package/dist/admin/store.js +0 -134
  41. package/dist/admin/store.js.map +0 -1
  42. package/dist/esm/admin/customer-group.d.ts +0 -170
  43. package/dist/esm/admin/customer-group.d.ts.map +0 -1
  44. package/dist/esm/admin/customer-group.js +0 -223
  45. package/dist/esm/admin/customer-group.js.map +0 -1
  46. package/dist/esm/admin/customer.d.ts +0 -264
  47. package/dist/esm/admin/customer.d.ts.map +0 -1
  48. package/dist/esm/admin/customer.js +0 -350
  49. package/dist/esm/admin/customer.js.map +0 -1
  50. package/dist/esm/admin/store.d.ts +0 -116
  51. package/dist/esm/admin/store.d.ts.map +0 -1
  52. package/dist/esm/admin/store.js +0 -145
  53. package/dist/esm/admin/store.js.map +0 -1
  54. package/dist/esm/store/index.d.ts +0 -12
  55. package/dist/esm/store/index.d.ts.map +0 -1
  56. package/dist/esm/store/index.js +0 -13
  57. package/dist/esm/store/index.js.map +0 -1
  58. package/dist/store/index.d.ts +0 -12
  59. package/dist/store/index.d.ts.map +0 -1
  60. package/dist/store/index.js +0 -17
  61. package/dist/store/index.js.map +0 -1
@@ -1,170 +0,0 @@
1
- import { HttpTypes } from "@acmekit/types";
2
- import { Client } from "../client";
3
- import { ClientHeaders } from "../types";
4
- export declare class CustomerGroup {
5
- /**
6
- * @ignore
7
- */
8
- private client;
9
- /**
10
- * @ignore
11
- */
12
- constructor(client: Client);
13
- /**
14
- * This method retrieves a customer group by its ID. It sends a request to the
15
- * [Get Customer Group](https://docs.acmekit.com/api/admin#customer-groups_getcustomergroupsid) API route.
16
- *
17
- * @param id - The customer group's ID.
18
- * @param query - Configure the fields to retrieve in the customer group.
19
- * @param headers - Headers to pass in the request
20
- * @returns The group's details.
21
- *
22
- * @example
23
- * To retrieve a customer group by its ID:
24
- *
25
- * ```ts
26
- * sdk.admin.customerGroup.retrieve("cusgroup_123")
27
- * .then(({ customer_group }) => {
28
- * console.log(customer_group)
29
- * })
30
- * ```
31
- *
32
- * To specify the fields and relations to retrieve:
33
- *
34
- * ```ts
35
- * sdk.admin.customerGroup.retrieve("cusgroup_123", {
36
- * fields: "id,*customer"
37
- * })
38
- * .then(({ customer_group }) => {
39
- * console.log(customer_group)
40
- * })
41
- * ```
42
- *
43
- * Learn more about the `fields` property in the [API reference](https://docs.acmekit.com/api/store#select-fields-and-relations).
44
- */
45
- retrieve(id: string, query?: HttpTypes.AdminGetCustomerGroupParams, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerGroupResponse>;
46
- /**
47
- * This method retrieves a paginated list of customer groups. It sends a request to the
48
- * [List Customer Groups](https://docs.acmekit.com/api/admin#customer-groups_getcustomergroups)
49
- * API route.
50
- *
51
- * @param query - Filters and pagination configurations.
52
- * @param headers - Headers to pass in the request.
53
- * @returns The paginated list of customer groups.
54
- *
55
- * @example
56
- * To retrieve the list of customer groups:
57
- *
58
- * ```ts
59
- * sdk.admin.customerGroup.list()
60
- * .then(({ customer_groups, count, limit, offset }) => {
61
- * console.log(customer_groups)
62
- * })
63
- * ```
64
- *
65
- * To configure the pagination, pass the `limit` and `offset` query parameters.
66
- *
67
- * For example, to retrieve only 10 items and skip 10 items:
68
- *
69
- * ```ts
70
- * sdk.admin.customerGroup.list({
71
- * limit: 10,
72
- * offset: 10
73
- * })
74
- * .then(({ customer_groups, count, limit, offset }) => {
75
- * console.log(customer_groups)
76
- * })
77
- * ```
78
- *
79
- * Using the `fields` query parameter, you can specify the fields and relations to retrieve
80
- * in each customer group:
81
- *
82
- * ```ts
83
- * sdk.admin.customerGroup.list({
84
- * fields: "id,*customer"
85
- * })
86
- * .then(({ customer_groups, count, limit, offset }) => {
87
- * console.log(customer_groups)
88
- * })
89
- * ```
90
- *
91
- * Learn more about the `fields` property in the [API reference](https://docs.acmekit.com/api/store#select-fields-and-relations).
92
- */
93
- list(query?: HttpTypes.AdminGetCustomerGroupsParams, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerGroupListResponse>;
94
- /**
95
- * This method creates a customer group. It sends a request to the
96
- * [Create Customer Group](https://docs.acmekit.com/api/admin#customer-groups_postcustomergroups)
97
- * API route.
98
- *
99
- * @param body - The customer group's details.
100
- * @param query - Configure the fields to retrieve in the customer group.
101
- * @param headers - Headers to pass in the request.
102
- * @returns The customer group's details.
103
- *
104
- * @example
105
- * sdk.admin.customerGroup.create({
106
- * name: "VIP"
107
- * })
108
- * .then(({ customer_group }) => {
109
- * console.log(customer_group)
110
- * })
111
- */
112
- create(body: HttpTypes.AdminCreateCustomerGroup, query?: HttpTypes.AdminGetCustomerGroupParams, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerGroupResponse>;
113
- /**
114
- * This method updates a customer group's details. It sends a request to the
115
- * [Update Customer](https://docs.acmekit.com/api/admin#customer-groups_postcustomergroupsid)
116
- * API route.
117
- *
118
- * @param id - The customer group's ID.
119
- * @param body - The details to update in the group.
120
- * @param query - Configure the fields to retrieve in the customer group.
121
- * @param headers - Headers to pass in the request.
122
- * @returns The customer group's details.
123
- *
124
- * @example
125
- * sdk.admin.customerGroup.update("cusgroup_123", {
126
- * name: "VIP"
127
- * })
128
- * .then(({ customer_group }) => {
129
- * console.log(customer_group)
130
- * })
131
- */
132
- update(id: string, body: HttpTypes.AdminUpdateCustomerGroup, query?: HttpTypes.AdminGetCustomerGroupParams, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerGroupResponse>;
133
- /**
134
- * This method deletes a customer group. This method sends a request to the
135
- * [Delete Customer Group](https://docs.acmekit.com/api/admin#customer-groups_deletecustomergroupsid)
136
- * API route.
137
- *
138
- * @param id - The customer group's ID.
139
- * @param headers - Headers to pass in the request
140
- * @returns The deletion's details.
141
- *
142
- * @example
143
- * sdk.admin.customerGroup.delete("cusgroup_123")
144
- * .then(({ deleted }) => {
145
- * console.log(deleted)
146
- * })
147
- */
148
- delete(id: string, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerGroupDeleteResponse>;
149
- /**
150
- * This method manages customers of a group to add or remove them from the group.
151
- * It sends a request to the [Manage Customers](https://docs.acmekit.com/api/admin#customer-groups_postcustomergroupsidcustomers)
152
- * API route.
153
- *
154
- * @param id - The group's ID.
155
- * @param body - The customers to add or remove from the group.
156
- * @param headers - Headers to pass in the request
157
- * @returns The customer group's details.
158
- *
159
- * @example
160
- * sdk.admin.customerGroup.batchCustomers("cusgroup_123", {
161
- * add: ["cus_123"],
162
- * remove: ["cus_321"]
163
- * })
164
- * .then(({ customer_group }) => {
165
- * console.log(customer_group)
166
- * })
167
- */
168
- batchCustomers(id: string, body: HttpTypes.AdminBatchLink, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerGroupResponse>;
169
- }
170
- //# sourceMappingURL=customer-group.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"customer-group.d.ts","sourceRoot":"","sources":["../../src/admin/customer-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,qBAAa,aAAa;IACxB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAQ;IACtB;;OAEG;gBACS,MAAM,EAAE,MAAM;IAI1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACG,QAAQ,CACZ,EAAE,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,SAAS,CAAC,2BAA2B,EAC7C,OAAO,CAAC,EAAE,aAAa;IAYzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACG,IAAI,CACR,KAAK,CAAC,EAAE,SAAS,CAAC,4BAA4B,EAC9C,OAAO,CAAC,EAAE,aAAa;IAYzB;;;;;;;;;;;;;;;;;OAiBG;IACG,MAAM,CACV,IAAI,EAAE,SAAS,CAAC,wBAAwB,EACxC,KAAK,CAAC,EAAE,SAAS,CAAC,2BAA2B,EAC7C,OAAO,CAAC,EAAE,aAAa;IAazB;;;;;;;;;;;;;;;;;;OAkBG;IACG,MAAM,CACV,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,SAAS,CAAC,wBAAwB,EACxC,KAAK,CAAC,EAAE,SAAS,CAAC,2BAA2B,EAC7C,OAAO,CAAC,EAAE,aAAa;IAazB;;;;;;;;;;;;;;OAcG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa;IAUhD;;;;;;;;;;;;;;;;;;OAkBG;IACG,cAAc,CAClB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,SAAS,CAAC,cAAc,EAC9B,OAAO,CAAC,EAAE,aAAa;CAW1B"}
@@ -1,206 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CustomerGroup = void 0;
4
- class CustomerGroup {
5
- /**
6
- * @ignore
7
- */
8
- constructor(client) {
9
- this.client = client;
10
- }
11
- /**
12
- * This method retrieves a customer group by its ID. It sends a request to the
13
- * [Get Customer Group](https://docs.acmekit.com/api/admin#customer-groups_getcustomergroupsid) API route.
14
- *
15
- * @param id - The customer group's ID.
16
- * @param query - Configure the fields to retrieve in the customer group.
17
- * @param headers - Headers to pass in the request
18
- * @returns The group's details.
19
- *
20
- * @example
21
- * To retrieve a customer group by its ID:
22
- *
23
- * ```ts
24
- * sdk.admin.customerGroup.retrieve("cusgroup_123")
25
- * .then(({ customer_group }) => {
26
- * console.log(customer_group)
27
- * })
28
- * ```
29
- *
30
- * To specify the fields and relations to retrieve:
31
- *
32
- * ```ts
33
- * sdk.admin.customerGroup.retrieve("cusgroup_123", {
34
- * fields: "id,*customer"
35
- * })
36
- * .then(({ customer_group }) => {
37
- * console.log(customer_group)
38
- * })
39
- * ```
40
- *
41
- * Learn more about the `fields` property in the [API reference](https://docs.acmekit.com/api/store#select-fields-and-relations).
42
- */
43
- async retrieve(id, query, headers) {
44
- return await this.client.fetch(`/admin/customer-groups/${id}`, {
45
- method: "GET",
46
- query,
47
- headers,
48
- });
49
- }
50
- /**
51
- * This method retrieves a paginated list of customer groups. It sends a request to the
52
- * [List Customer Groups](https://docs.acmekit.com/api/admin#customer-groups_getcustomergroups)
53
- * API route.
54
- *
55
- * @param query - Filters and pagination configurations.
56
- * @param headers - Headers to pass in the request.
57
- * @returns The paginated list of customer groups.
58
- *
59
- * @example
60
- * To retrieve the list of customer groups:
61
- *
62
- * ```ts
63
- * sdk.admin.customerGroup.list()
64
- * .then(({ customer_groups, count, limit, offset }) => {
65
- * console.log(customer_groups)
66
- * })
67
- * ```
68
- *
69
- * To configure the pagination, pass the `limit` and `offset` query parameters.
70
- *
71
- * For example, to retrieve only 10 items and skip 10 items:
72
- *
73
- * ```ts
74
- * sdk.admin.customerGroup.list({
75
- * limit: 10,
76
- * offset: 10
77
- * })
78
- * .then(({ customer_groups, count, limit, offset }) => {
79
- * console.log(customer_groups)
80
- * })
81
- * ```
82
- *
83
- * Using the `fields` query parameter, you can specify the fields and relations to retrieve
84
- * in each customer group:
85
- *
86
- * ```ts
87
- * sdk.admin.customerGroup.list({
88
- * fields: "id,*customer"
89
- * })
90
- * .then(({ customer_groups, count, limit, offset }) => {
91
- * console.log(customer_groups)
92
- * })
93
- * ```
94
- *
95
- * Learn more about the `fields` property in the [API reference](https://docs.acmekit.com/api/store#select-fields-and-relations).
96
- */
97
- async list(query, headers) {
98
- return await this.client.fetch(`/admin/customer-groups`, {
99
- method: "GET",
100
- headers,
101
- query,
102
- });
103
- }
104
- /**
105
- * This method creates a customer group. It sends a request to the
106
- * [Create Customer Group](https://docs.acmekit.com/api/admin#customer-groups_postcustomergroups)
107
- * API route.
108
- *
109
- * @param body - The customer group's details.
110
- * @param query - Configure the fields to retrieve in the customer group.
111
- * @param headers - Headers to pass in the request.
112
- * @returns The customer group's details.
113
- *
114
- * @example
115
- * sdk.admin.customerGroup.create({
116
- * name: "VIP"
117
- * })
118
- * .then(({ customer_group }) => {
119
- * console.log(customer_group)
120
- * })
121
- */
122
- async create(body, query, headers) {
123
- return await this.client.fetch(`/admin/customer-groups`, {
124
- method: "POST",
125
- headers,
126
- body,
127
- query,
128
- });
129
- }
130
- /**
131
- * This method updates a customer group's details. It sends a request to the
132
- * [Update Customer](https://docs.acmekit.com/api/admin#customer-groups_postcustomergroupsid)
133
- * API route.
134
- *
135
- * @param id - The customer group's ID.
136
- * @param body - The details to update in the group.
137
- * @param query - Configure the fields to retrieve in the customer group.
138
- * @param headers - Headers to pass in the request.
139
- * @returns The customer group's details.
140
- *
141
- * @example
142
- * sdk.admin.customerGroup.update("cusgroup_123", {
143
- * name: "VIP"
144
- * })
145
- * .then(({ customer_group }) => {
146
- * console.log(customer_group)
147
- * })
148
- */
149
- async update(id, body, query, headers) {
150
- return await this.client.fetch(`/admin/customer-groups/${id}`, {
151
- method: "POST",
152
- headers,
153
- body,
154
- query,
155
- });
156
- }
157
- /**
158
- * This method deletes a customer group. This method sends a request to the
159
- * [Delete Customer Group](https://docs.acmekit.com/api/admin#customer-groups_deletecustomergroupsid)
160
- * API route.
161
- *
162
- * @param id - The customer group's ID.
163
- * @param headers - Headers to pass in the request
164
- * @returns The deletion's details.
165
- *
166
- * @example
167
- * sdk.admin.customerGroup.delete("cusgroup_123")
168
- * .then(({ deleted }) => {
169
- * console.log(deleted)
170
- * })
171
- */
172
- async delete(id, headers) {
173
- return await this.client.fetch(`/admin/customer-groups/${id}`, {
174
- method: "DELETE",
175
- headers,
176
- });
177
- }
178
- /**
179
- * This method manages customers of a group to add or remove them from the group.
180
- * It sends a request to the [Manage Customers](https://docs.acmekit.com/api/admin#customer-groups_postcustomergroupsidcustomers)
181
- * API route.
182
- *
183
- * @param id - The group's ID.
184
- * @param body - The customers to add or remove from the group.
185
- * @param headers - Headers to pass in the request
186
- * @returns The customer group's details.
187
- *
188
- * @example
189
- * sdk.admin.customerGroup.batchCustomers("cusgroup_123", {
190
- * add: ["cus_123"],
191
- * remove: ["cus_321"]
192
- * })
193
- * .then(({ customer_group }) => {
194
- * console.log(customer_group)
195
- * })
196
- */
197
- async batchCustomers(id, body, headers) {
198
- return await this.client.fetch(`/admin/customer-groups/${id}/customers`, {
199
- method: "POST",
200
- headers,
201
- body,
202
- });
203
- }
204
- }
205
- exports.CustomerGroup = CustomerGroup;
206
- //# sourceMappingURL=customer-group.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"customer-group.js","sourceRoot":"","sources":["../../src/admin/customer-group.ts"],"names":[],"mappings":";;;AAIA,MAAa,aAAa;IAKxB;;OAEG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,KAAK,CAAC,QAAQ,CACZ,EAAU,EACV,KAA6C,EAC7C,OAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,0BAA0B,EAAE,EAAE,EAC9B;YACE,MAAM,EAAE,KAAK;YACb,KAAK;YACL,OAAO;SACR,CACF,CAAA;IACH,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACH,KAAK,CAAC,IAAI,CACR,KAA8C,EAC9C,OAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,wBAAwB,EACxB;YACE,MAAM,EAAE,KAAK;YACb,OAAO;YACP,KAAK;SACN,CACF,CAAA;IACH,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,KAAK,CAAC,MAAM,CACV,IAAwC,EACxC,KAA6C,EAC7C,OAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,wBAAwB,EACxB;YACE,MAAM,EAAE,MAAM;YACd,OAAO;YACP,IAAI;YACJ,KAAK;SACN,CACF,CAAA;IACH,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAK,CAAC,MAAM,CACV,EAAU,EACV,IAAwC,EACxC,KAA6C,EAC7C,OAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,0BAA0B,EAAE,EAAE,EAC9B;YACE,MAAM,EAAE,MAAM;YACd,OAAO;YACP,IAAI;YACJ,KAAK;SACN,CACF,CAAA;IACH,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,OAAuB;QAC9C,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,0BAA0B,EAAE,EAAE,EAC9B;YACE,MAAM,EAAE,QAAQ;YAChB,OAAO;SACR,CACF,CAAA;IACH,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAK,CAAC,cAAc,CAClB,EAAU,EACV,IAA8B,EAC9B,OAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,0BAA0B,EAAE,YAAY,EACxC;YACE,MAAM,EAAE,MAAM;YACd,OAAO;YACP,IAAI;SACL,CACF,CAAA;IACH,CAAC;CACF;AAxPD,sCAwPC"}
@@ -1,264 +0,0 @@
1
- import { HttpTypes, SelectParams } from "@acmekit/types";
2
- import { Client } from "../client";
3
- import { ClientHeaders } from "../types";
4
- export declare class Customer {
5
- /**
6
- * @ignore
7
- */
8
- private client;
9
- /**
10
- * @ignore
11
- */
12
- constructor(client: Client);
13
- /**
14
- * This method creates a customer. It sends a request to the
15
- * [Create Customer](https://docs.acmekit.com/api/admin#customers_postcustomers) API route.
16
- *
17
- * @param body - The customer's details.
18
- * @param query - Configure the fields to retrieve in the customer.
19
- * @param headers - Headers to pass in the request.
20
- * @returns The customer's details.
21
- *
22
- * @example
23
- * sdk.admin.customer.create({
24
- * email: "customer@gmail.com"
25
- * })
26
- * .then(({ customer }) => {
27
- * console.log(customer)
28
- * })
29
- */
30
- create(body: HttpTypes.AdminCreateCustomer, query?: SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerResponse>;
31
- /**
32
- * This method updates a customer's details. It sends a request to the
33
- * [Update Customer](https://docs.acmekit.com/api/admin#customers_postcustomersid) API route.
34
- *
35
- * @param id - The customer's ID.
36
- * @param body - The details to update of the customer.
37
- * @param query - Configure the fields to retrieve in the customer.
38
- * @param headers - Headers to pass in the request.
39
- * @returns The customer's details.
40
- *
41
- * @example
42
- * sdk.admin.customer.update("cus_123", {
43
- * first_name: "John"
44
- * })
45
- * .then(({ customer }) => {
46
- * console.log(customer)
47
- * })
48
- */
49
- update(id: string, body: HttpTypes.AdminUpdateCustomer, query?: SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerResponse>;
50
- /**
51
- * This method retrieves a paginated list of customers. It sends a request to the
52
- * [List Customers](https://docs.acmekit.com/api/admin#customers_getcustomers)
53
- * API route.
54
- *
55
- * @param queryParams - Filters and pagination configurations.
56
- * @param headers - Headers to pass in the request.
57
- * @returns The paginated list of customers.
58
- *
59
- * @example
60
- * To retrieve the list of customers:
61
- *
62
- * ```ts
63
- * sdk.admin.customer.list()
64
- * .then(({ customers, count, limit, offset }) => {
65
- * console.log(customers)
66
- * })
67
- * ```
68
- *
69
- * To configure the pagination, pass the `limit` and `offset` query parameters.
70
- *
71
- * For example, to retrieve only 10 items and skip 10 items:
72
- *
73
- * ```ts
74
- * sdk.admin.customer.list({
75
- * limit: 10,
76
- * offset: 10
77
- * })
78
- * .then(({ customers, count, limit, offset }) => {
79
- * console.log(customers)
80
- * })
81
- * ```
82
- *
83
- * Using the `fields` query parameter, you can specify the fields and relations to retrieve
84
- * in each customer:
85
- *
86
- * ```ts
87
- * sdk.admin.customer.list({
88
- * fields: "id,*groups"
89
- * })
90
- * .then(({ customers, count, limit, offset }) => {
91
- * console.log(customers)
92
- * })
93
- * ```
94
- *
95
- * Learn more about the `fields` property in the [API reference](https://docs.acmekit.com/api/store#select-fields-and-relations).
96
- */
97
- list(queryParams?: HttpTypes.AdminCustomerFilters, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerListResponse>;
98
- /**
99
- * This method retrieves a customer by its ID. It sends a request to the
100
- * [Get Customer](https://docs.acmekit.com/api/admin#customers_getcustomersid)
101
- * API route.
102
- *
103
- * @param id - The customer's ID.
104
- * @param query - Configure the fields to retrieve in the customer.
105
- * @param headers - Headers to pass in the request.
106
- * @returns The customer's details.
107
- *
108
- * @example
109
- * To retrieve a customer by its ID:
110
- *
111
- * ```ts
112
- * sdk.admin.customer.retrieve("cus_123")
113
- * .then(({ customer }) => {
114
- * console.log(customer)
115
- * })
116
- * ```
117
- *
118
- * To specify the fields and relations to retrieve:
119
- *
120
- * ```ts
121
- * sdk.admin.customer.retrieve("cus_123", {
122
- * fields: "id,*groups"
123
- * })
124
- * .then(({ customer }) => {
125
- * console.log(customer)
126
- * })
127
- * ```
128
- *
129
- * Learn more about the `fields` property in the [API reference](https://docs.acmekit.com/api/store#select-fields-and-relations).
130
- */
131
- retrieve(id: string, query?: SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerResponse>;
132
- /**
133
- * This method deletes a customer by its ID. It sends a request to the
134
- * [Delete Customer](https://docs.acmekit.com/api/admin#customers_deletecustomersid)
135
- * API route.
136
- *
137
- * @param id - The customer's ID.
138
- * @param headers - Headers to pass in the request.
139
- * @returns The deletion's details.
140
- *
141
- * @example
142
- * sdk.admin.customer.delete("cus_123")
143
- * .then(({ deleted }) => {
144
- * console.log(deleted)
145
- * })
146
- */
147
- delete(id: string, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerDeleteResponse>;
148
- /**
149
- * This method manages customer groups for a customer.
150
- * It sends a request to the [Manage Customers](https://docs.acmekit.com/api/admin#customers_postcustomersidcustomergroups)
151
- * API route.
152
- *
153
- * @param id - The customer's ID.
154
- * @param body - The groups to add customer to or remove customer from.
155
- * @param headers - Headers to pass in the request
156
- * @returns The customers details.
157
- *
158
- * @example
159
- * sdk.admin.customer.batchCustomerGroups("cus_123", {
160
- * add: ["cusgroup_123"],
161
- * remove: ["cusgroup_321"]
162
- * })
163
- * .then(({ customer }) => {
164
- * console.log(customer)
165
- * })
166
- */
167
- batchCustomerGroups(id: string, body: HttpTypes.AdminBatchLink, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerResponse>;
168
- /**
169
- * This method creates a customer address. It sends a request to the
170
- * [Create Customer Address](https://docs.acmekit.com/api/admin#customers_postcustomersidaddresses)
171
- * API route.
172
- *
173
- * @param id - The customer's ID.
174
- * @param body - The customer address's details.
175
- * @param headers - Headers to pass in the request.
176
- * @returns The customer address's details.
177
- *
178
- * @example
179
- * sdk.admin.customer.createAddress("cus_123", {
180
- * address_1: "123 Main St",
181
- * city: "Anytown",
182
- * country_code: "US",
183
- * postal_code: "12345"
184
- * })
185
- * .then(({ customer }) => {
186
- * console.log(customer)
187
- * })
188
- */
189
- createAddress(id: string, body: HttpTypes.AdminCreateCustomerAddress, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerResponse>;
190
- /**
191
- * This method updates a customer address. It sends a request to the
192
- * [Update Customer Address](https://docs.acmekit.com/api/admin#customers_postcustomersidaddressesaddressid)
193
- * API route.
194
- *
195
- * @param id - The customer's ID.
196
- * @param addressId - The customer address's ID.
197
- * @param body - The customer address's details.
198
- * @param headers - Headers to pass in the request.
199
- * @returns The customer address's details.
200
- *
201
- * @example
202
- * sdk.admin.customer.updateAddress("cus_123", "cus_addr_123", {
203
- * address_1: "123 Main St",
204
- * city: "Anytown",
205
- * country_code: "US",
206
- * postal_code: "12345"
207
- * })
208
- * .then(({ customer }) => {
209
- * console.log(customer)
210
- * })
211
- */
212
- updateAddress(id: string, addressId: string, body: HttpTypes.AdminUpdateCustomerAddress, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerResponse>;
213
- /**
214
- * This method deletes a customer address. It sends a request to the
215
- * [Delete Customer Address](https://docs.acmekit.com/api/admin#customers_deletecustomersidaddressesaddressid)
216
- * API route.
217
- *
218
- * @param id - The customer's ID.
219
- * @param addressId - The customer address's ID.
220
- * @param headers - Headers to pass in the request.
221
- * @returns The customer address's details.
222
- *
223
- * @example
224
- * sdk.admin.customer.deleteAddress("cus_123", "cus_addr_123")
225
- * .then(({ customer }) => {
226
- * console.log(customer)
227
- * })
228
- */
229
- deleteAddress(id: string, addressId: string, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerResponse>;
230
- /**
231
- * This method retrieves a customer address by its ID. It sends a request to the
232
- * [Get Customer Address](https://docs.acmekit.com/api/admin#customers_getcustomersidaddressesaddressid)
233
- * API route.
234
- *
235
- * @param id - The customer's ID.
236
- * @param addressId - The customer address's ID.
237
- * @param headers - Headers to pass in the request.
238
- * @returns The customer address's details.
239
- *
240
- * @example
241
- * sdk.admin.customer.retrieveAddress("cus_123", "cus_addr_123")
242
- * .then(({ customer }) => {
243
- * console.log(customer)
244
- * })
245
- */
246
- retrieveAddress(id: string, addressId: string, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerResponse>;
247
- /**
248
- * This method retrieves a list of customer addresses. It sends a request to the
249
- * [List Customer Addresses](https://docs.acmekit.com/api/admin#customers_getcustomersidaddresses)
250
- * API route.
251
- *
252
- * @param id - The customer's ID.
253
- * @param headers - Headers to pass in the request.
254
- * @returns The list of customer addresses.
255
- *
256
- * @example
257
- * sdk.admin.customer.listAddresses("cus_123")
258
- * .then(({ addresses }) => {
259
- * console.log(addresses)
260
- * })
261
- */
262
- listAddresses(id: string, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerResponse>;
263
- }
264
- //# sourceMappingURL=customer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"customer.d.ts","sourceRoot":"","sources":["../../src/admin/customer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,qBAAa,QAAQ;IACnB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAQ;IACtB;;OAEG;gBACS,MAAM,EAAE,MAAM;IAI1B;;;;;;;;;;;;;;;;OAgBG;IACG,MAAM,CACV,IAAI,EAAE,SAAS,CAAC,mBAAmB,EACnC,KAAK,CAAC,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,aAAa;IAazB;;;;;;;;;;;;;;;;;OAiBG;IACG,MAAM,CACV,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,SAAS,CAAC,mBAAmB,EACnC,KAAK,CAAC,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,aAAa;IAazB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACG,IAAI,CACR,WAAW,CAAC,EAAE,SAAS,CAAC,oBAAoB,EAC5C,OAAO,CAAC,EAAE,aAAa;IAWzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,aAAa;IAUxE;;;;;;;;;;;;;;OAcG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa;IAUhD;;;;;;;;;;;;;;;;;;OAkBG;IACG,mBAAmB,CACvB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,SAAS,CAAC,cAAc,EAC9B,OAAO,CAAC,EAAE,aAAa;IAYzB;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,aAAa,CACjB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,SAAS,CAAC,0BAA0B,EAC1C,OAAO,CAAC,EAAE,aAAa;IAYzB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACG,aAAa,CACjB,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,SAAS,CAAC,0BAA0B,EAC1C,OAAO,CAAC,EAAE,aAAa;IAYzB;;;;;;;;;;;;;;;OAeG;IACG,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa;IAU1E;;;;;;;;;;;;;;;OAeG;IACG,eAAe,CACnB,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,aAAa;IAUzB;;;;;;;;;;;;;;OAcG;IACG,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa;CAQxD"}