@acmekit/js-sdk 2.13.14 → 2.13.16

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,323 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Customer = void 0;
4
- class Customer {
5
- /**
6
- * @ignore
7
- */
8
- constructor(client) {
9
- this.client = client;
10
- }
11
- /**
12
- * This method creates a customer. It sends a request to the
13
- * [Create Customer](https://docs.acmekit.com/api/admin#customers_postcustomers) API route.
14
- *
15
- * @param body - The customer's details.
16
- * @param query - Configure the fields to retrieve in the customer.
17
- * @param headers - Headers to pass in the request.
18
- * @returns The customer's details.
19
- *
20
- * @example
21
- * sdk.admin.customer.create({
22
- * email: "customer@gmail.com"
23
- * })
24
- * .then(({ customer }) => {
25
- * console.log(customer)
26
- * })
27
- */
28
- async create(body, query, headers) {
29
- return this.client.fetch(`/admin/customers`, {
30
- method: "POST",
31
- headers,
32
- body,
33
- query,
34
- });
35
- }
36
- /**
37
- * This method updates a customer's details. It sends a request to the
38
- * [Update Customer](https://docs.acmekit.com/api/admin#customers_postcustomersid) API route.
39
- *
40
- * @param id - The customer's ID.
41
- * @param body - The details to update of the customer.
42
- * @param query - Configure the fields to retrieve in the customer.
43
- * @param headers - Headers to pass in the request.
44
- * @returns The customer's details.
45
- *
46
- * @example
47
- * sdk.admin.customer.update("cus_123", {
48
- * first_name: "John"
49
- * })
50
- * .then(({ customer }) => {
51
- * console.log(customer)
52
- * })
53
- */
54
- async update(id, body, query, headers) {
55
- return this.client.fetch(`/admin/customers/${id}`, {
56
- method: "POST",
57
- headers,
58
- body,
59
- query,
60
- });
61
- }
62
- /**
63
- * This method retrieves a paginated list of customers. It sends a request to the
64
- * [List Customers](https://docs.acmekit.com/api/admin#customers_getcustomers)
65
- * API route.
66
- *
67
- * @param queryParams - Filters and pagination configurations.
68
- * @param headers - Headers to pass in the request.
69
- * @returns The paginated list of customers.
70
- *
71
- * @example
72
- * To retrieve the list of customers:
73
- *
74
- * ```ts
75
- * sdk.admin.customer.list()
76
- * .then(({ customers, count, limit, offset }) => {
77
- * console.log(customers)
78
- * })
79
- * ```
80
- *
81
- * To configure the pagination, pass the `limit` and `offset` query parameters.
82
- *
83
- * For example, to retrieve only 10 items and skip 10 items:
84
- *
85
- * ```ts
86
- * sdk.admin.customer.list({
87
- * limit: 10,
88
- * offset: 10
89
- * })
90
- * .then(({ customers, count, limit, offset }) => {
91
- * console.log(customers)
92
- * })
93
- * ```
94
- *
95
- * Using the `fields` query parameter, you can specify the fields and relations to retrieve
96
- * in each customer:
97
- *
98
- * ```ts
99
- * sdk.admin.customer.list({
100
- * fields: "id,*groups"
101
- * })
102
- * .then(({ customers, count, limit, offset }) => {
103
- * console.log(customers)
104
- * })
105
- * ```
106
- *
107
- * Learn more about the `fields` property in the [API reference](https://docs.acmekit.com/api/store#select-fields-and-relations).
108
- */
109
- async list(queryParams, headers) {
110
- return this.client.fetch(`/admin/customers`, {
111
- headers,
112
- query: queryParams,
113
- });
114
- }
115
- /**
116
- * This method retrieves a customer by its ID. It sends a request to the
117
- * [Get Customer](https://docs.acmekit.com/api/admin#customers_getcustomersid)
118
- * API route.
119
- *
120
- * @param id - The customer's ID.
121
- * @param query - Configure the fields to retrieve in the customer.
122
- * @param headers - Headers to pass in the request.
123
- * @returns The customer's details.
124
- *
125
- * @example
126
- * To retrieve a customer by its ID:
127
- *
128
- * ```ts
129
- * sdk.admin.customer.retrieve("cus_123")
130
- * .then(({ customer }) => {
131
- * console.log(customer)
132
- * })
133
- * ```
134
- *
135
- * To specify the fields and relations to retrieve:
136
- *
137
- * ```ts
138
- * sdk.admin.customer.retrieve("cus_123", {
139
- * fields: "id,*groups"
140
- * })
141
- * .then(({ customer }) => {
142
- * console.log(customer)
143
- * })
144
- * ```
145
- *
146
- * Learn more about the `fields` property in the [API reference](https://docs.acmekit.com/api/store#select-fields-and-relations).
147
- */
148
- async retrieve(id, query, headers) {
149
- return this.client.fetch(`/admin/customers/${id}`, {
150
- query,
151
- headers,
152
- });
153
- }
154
- /**
155
- * This method deletes a customer by its ID. It sends a request to the
156
- * [Delete Customer](https://docs.acmekit.com/api/admin#customers_deletecustomersid)
157
- * API route.
158
- *
159
- * @param id - The customer's ID.
160
- * @param headers - Headers to pass in the request.
161
- * @returns The deletion's details.
162
- *
163
- * @example
164
- * sdk.admin.customer.delete("cus_123")
165
- * .then(({ deleted }) => {
166
- * console.log(deleted)
167
- * })
168
- */
169
- async delete(id, headers) {
170
- return this.client.fetch(`/admin/customers/${id}`, {
171
- method: "DELETE",
172
- headers,
173
- });
174
- }
175
- /**
176
- * This method manages customer groups for a customer.
177
- * It sends a request to the [Manage Customers](https://docs.acmekit.com/api/admin#customers_postcustomersidcustomergroups)
178
- * API route.
179
- *
180
- * @param id - The customer's ID.
181
- * @param body - The groups to add customer to or remove customer from.
182
- * @param headers - Headers to pass in the request
183
- * @returns The customers details.
184
- *
185
- * @example
186
- * sdk.admin.customer.batchCustomerGroups("cus_123", {
187
- * add: ["cusgroup_123"],
188
- * remove: ["cusgroup_321"]
189
- * })
190
- * .then(({ customer }) => {
191
- * console.log(customer)
192
- * })
193
- */
194
- async batchCustomerGroups(id, body, headers) {
195
- return await this.client.fetch(`/admin/customers/${id}/customer-groups`, {
196
- method: "POST",
197
- headers,
198
- body,
199
- });
200
- }
201
- /**
202
- * This method creates a customer address. It sends a request to the
203
- * [Create Customer Address](https://docs.acmekit.com/api/admin#customers_postcustomersidaddresses)
204
- * API route.
205
- *
206
- * @param id - The customer's ID.
207
- * @param body - The customer address's details.
208
- * @param headers - Headers to pass in the request.
209
- * @returns The customer address's details.
210
- *
211
- * @example
212
- * sdk.admin.customer.createAddress("cus_123", {
213
- * address_1: "123 Main St",
214
- * city: "Anytown",
215
- * country_code: "US",
216
- * postal_code: "12345"
217
- * })
218
- * .then(({ customer }) => {
219
- * console.log(customer)
220
- * })
221
- */
222
- async createAddress(id, body, headers) {
223
- return await this.client.fetch(`/admin/customers/${id}/addresses`, {
224
- method: "POST",
225
- headers,
226
- body,
227
- });
228
- }
229
- /**
230
- * This method updates a customer address. It sends a request to the
231
- * [Update Customer Address](https://docs.acmekit.com/api/admin#customers_postcustomersidaddressesaddressid)
232
- * API route.
233
- *
234
- * @param id - The customer's ID.
235
- * @param addressId - The customer address's ID.
236
- * @param body - The customer address's details.
237
- * @param headers - Headers to pass in the request.
238
- * @returns The customer address's details.
239
- *
240
- * @example
241
- * sdk.admin.customer.updateAddress("cus_123", "cus_addr_123", {
242
- * address_1: "123 Main St",
243
- * city: "Anytown",
244
- * country_code: "US",
245
- * postal_code: "12345"
246
- * })
247
- * .then(({ customer }) => {
248
- * console.log(customer)
249
- * })
250
- */
251
- async updateAddress(id, addressId, body, headers) {
252
- return await this.client.fetch(`/admin/customers/${id}/addresses/${addressId}`, {
253
- method: "POST",
254
- headers,
255
- body,
256
- });
257
- }
258
- /**
259
- * This method deletes a customer address. It sends a request to the
260
- * [Delete Customer Address](https://docs.acmekit.com/api/admin#customers_deletecustomersidaddressesaddressid)
261
- * API route.
262
- *
263
- * @param id - The customer's ID.
264
- * @param addressId - The customer address's ID.
265
- * @param headers - Headers to pass in the request.
266
- * @returns The customer address's details.
267
- *
268
- * @example
269
- * sdk.admin.customer.deleteAddress("cus_123", "cus_addr_123")
270
- * .then(({ customer }) => {
271
- * console.log(customer)
272
- * })
273
- */
274
- async deleteAddress(id, addressId, headers) {
275
- return await this.client.fetch(`/admin/customers/${id}/addresses/${addressId}`, {
276
- method: "DELETE",
277
- headers,
278
- });
279
- }
280
- /**
281
- * This method retrieves a customer address by its ID. It sends a request to the
282
- * [Get Customer Address](https://docs.acmekit.com/api/admin#customers_getcustomersidaddressesaddressid)
283
- * API route.
284
- *
285
- * @param id - The customer's ID.
286
- * @param addressId - The customer address's ID.
287
- * @param headers - Headers to pass in the request.
288
- * @returns The customer address's details.
289
- *
290
- * @example
291
- * sdk.admin.customer.retrieveAddress("cus_123", "cus_addr_123")
292
- * .then(({ customer }) => {
293
- * console.log(customer)
294
- * })
295
- */
296
- async retrieveAddress(id, addressId, headers) {
297
- return await this.client.fetch(`/admin/customers/${id}/addresses/${addressId}`, {
298
- headers,
299
- });
300
- }
301
- /**
302
- * This method retrieves a list of customer addresses. It sends a request to the
303
- * [List Customer Addresses](https://docs.acmekit.com/api/admin#customers_getcustomersidaddresses)
304
- * API route.
305
- *
306
- * @param id - The customer's ID.
307
- * @param headers - Headers to pass in the request.
308
- * @returns The list of customer addresses.
309
- *
310
- * @example
311
- * sdk.admin.customer.listAddresses("cus_123")
312
- * .then(({ addresses }) => {
313
- * console.log(addresses)
314
- * })
315
- */
316
- async listAddresses(id, headers) {
317
- return await this.client.fetch(`/admin/customers/${id}/addresses`, {
318
- headers,
319
- });
320
- }
321
- }
322
- exports.Customer = Customer;
323
- //# sourceMappingURL=customer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"customer.js","sourceRoot":"","sources":["../../src/admin/customer.ts"],"names":[],"mappings":";;;AAIA,MAAa,QAAQ;IAKnB;;OAEG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED;;;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AK,CAAC,aAAa,CAAC,EAAU,EAAE,OAAuB;QACrD,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,oBAAoB,EAAE,YAAY,EAClC;YACE,OAAO;SACR,CACF,CAAA;IACH,CAAC;CACF;AA1YD,4BA0YC"}
@@ -1,116 +0,0 @@
1
- import { HttpTypes, SelectParams } from "@acmekit/types";
2
- import { Client } from "../client";
3
- import { ClientHeaders } from "../types";
4
- export declare class Store {
5
- /**
6
- * @ignore
7
- */
8
- private client;
9
- /**
10
- * @ignore
11
- */
12
- constructor(client: Client);
13
- /**
14
- * This method retrieves a store by its ID. It sends a request to the
15
- * [Get Store](https://docs.acmekit.com/api/admin#stores_getstoresid)
16
- * API route.
17
- *
18
- * @param id - The ID of the store to retrieve.
19
- * @param query - Configure the fields and relations to retrieve in the store.
20
- * @param headers - Headers to pass in the request.
21
- * @returns The store's details.
22
- *
23
- * @example
24
- * To retrieve a store by its ID:
25
- *
26
- * ```ts
27
- * sdk.admin.store.retrieve("store_123")
28
- * .then(({ store }) => {
29
- * console.log(store)
30
- * })
31
- * ```
32
- *
33
- * To specify the fields and relations to retrieve:
34
- *
35
- * ```ts
36
- * sdk.admin.store.retrieve("store_123", {
37
- * fields: "id,*supported_currencies"
38
- * })
39
- * .then(({ store }) => {
40
- * console.log(store)
41
- * })
42
- * ```
43
- *
44
- * Learn more about the `fields` property in the [API reference](https://docs.acmekit.com/api/admin#select-fields-and-relations).
45
- */
46
- retrieve(id: string, query?: HttpTypes.AdminStoreParams, headers?: ClientHeaders): Promise<HttpTypes.AdminStoreResponse>;
47
- /**
48
- * This method retrieves a list of stores. It sends a request to the
49
- * [List Stores](https://docs.acmekit.com/api/admin#stores_getstores)
50
- * API route.
51
- *
52
- * @param query - Filters and pagination configurations.
53
- * @param headers - Headers to pass in the request.
54
- * @returns The list of stores.
55
- *
56
- * @example
57
- * To retrieve the list of stores:
58
- *
59
- * ```ts
60
- * sdk.admin.store.list()
61
- * .then(({ stores, count, limit, offset }) => {
62
- * console.log(stores)
63
- * })
64
- * ```
65
- *
66
- * To configure the pagination, pass the `limit` and `offset` query parameters.
67
- *
68
- * For example, to retrieve only 10 items and skip 10 items:
69
- *
70
- * ```ts
71
- * sdk.admin.store.list({
72
- * limit: 10,
73
- * offset: 10
74
- * })
75
- * .then(({ stores, count, limit, offset }) => {
76
- * console.log(stores)
77
- * })
78
- * ```
79
- *
80
- * Using the `fields` query parameter, you can specify the fields and relations to retrieve
81
- * in each store:
82
- *
83
- * ```ts
84
- * sdk.admin.store.list({
85
- * fields: "id,*supported_currencies"
86
- * })
87
- * .then(({ stores, count, limit, offset }) => {
88
- * console.log(stores)
89
- * })
90
- * ```
91
- *
92
- * Learn more about the `fields` property in the [API reference](https://docs.acmekit.com/api/admin#select-fields-and-relations).
93
- */
94
- list(query?: HttpTypes.AdminStoreListParams, headers?: ClientHeaders): Promise<HttpTypes.AdminStoreListResponse>;
95
- /**
96
- * This method updates a store. It sends a request to the
97
- * [Update Store](https://docs.acmekit.com/api/admin#stores_poststoresid)
98
- * API route.
99
- *
100
- * @param id - The ID of the store to update.
101
- * @param body - The details of the store to update.
102
- * @param query - Configure the fields and relations to retrieve in the store.
103
- * @param headers - Headers to pass in the request.
104
- * @returns The store's details.
105
- *
106
- * @example
107
- * sdk.admin.store.update("store_123", {
108
- * name: "My Store",
109
- * })
110
- * .then(({ store }) => {
111
- * console.log(store)
112
- * })
113
- */
114
- update(id: string, body: HttpTypes.AdminUpdateStore, query?: SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminStoreResponse>;
115
- }
116
- //# sourceMappingURL=store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/admin/store.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,KAAK;IAChB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAQ;IACtB;;OAEG;gBACS,MAAM,EAAE,MAAM;IAI1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,QAAQ,CACZ,EAAE,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,SAAS,CAAC,gBAAgB,EAClC,OAAO,CAAC,EAAE,aAAa;IAYzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACG,IAAI,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,oBAAoB,EAAE,OAAO,CAAC,EAAE,aAAa;IAW1E;;;;;;;;;;;;;;;;;;OAkBG;IACG,MAAM,CACV,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,SAAS,CAAC,gBAAgB,EAChC,KAAK,CAAC,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,aAAa;CAY1B"}
@@ -1,134 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Store = void 0;
4
- class Store {
5
- /**
6
- * @ignore
7
- */
8
- constructor(client) {
9
- this.client = client;
10
- }
11
- /**
12
- * This method retrieves a store by its ID. It sends a request to the
13
- * [Get Store](https://docs.acmekit.com/api/admin#stores_getstoresid)
14
- * API route.
15
- *
16
- * @param id - The ID of the store to retrieve.
17
- * @param query - Configure the fields and relations to retrieve in the store.
18
- * @param headers - Headers to pass in the request.
19
- * @returns The store's details.
20
- *
21
- * @example
22
- * To retrieve a store by its ID:
23
- *
24
- * ```ts
25
- * sdk.admin.store.retrieve("store_123")
26
- * .then(({ store }) => {
27
- * console.log(store)
28
- * })
29
- * ```
30
- *
31
- * To specify the fields and relations to retrieve:
32
- *
33
- * ```ts
34
- * sdk.admin.store.retrieve("store_123", {
35
- * fields: "id,*supported_currencies"
36
- * })
37
- * .then(({ store }) => {
38
- * console.log(store)
39
- * })
40
- * ```
41
- *
42
- * Learn more about the `fields` property in the [API reference](https://docs.acmekit.com/api/admin#select-fields-and-relations).
43
- */
44
- async retrieve(id, query, headers) {
45
- return await this.client.fetch(`/admin/stores/${id}`, {
46
- method: "GET",
47
- headers,
48
- query,
49
- });
50
- }
51
- /**
52
- * This method retrieves a list of stores. It sends a request to the
53
- * [List Stores](https://docs.acmekit.com/api/admin#stores_getstores)
54
- * API route.
55
- *
56
- * @param query - Filters and pagination configurations.
57
- * @param headers - Headers to pass in the request.
58
- * @returns The list of stores.
59
- *
60
- * @example
61
- * To retrieve the list of stores:
62
- *
63
- * ```ts
64
- * sdk.admin.store.list()
65
- * .then(({ stores, count, limit, offset }) => {
66
- * console.log(stores)
67
- * })
68
- * ```
69
- *
70
- * To configure the pagination, pass the `limit` and `offset` query parameters.
71
- *
72
- * For example, to retrieve only 10 items and skip 10 items:
73
- *
74
- * ```ts
75
- * sdk.admin.store.list({
76
- * limit: 10,
77
- * offset: 10
78
- * })
79
- * .then(({ stores, count, limit, offset }) => {
80
- * console.log(stores)
81
- * })
82
- * ```
83
- *
84
- * Using the `fields` query parameter, you can specify the fields and relations to retrieve
85
- * in each store:
86
- *
87
- * ```ts
88
- * sdk.admin.store.list({
89
- * fields: "id,*supported_currencies"
90
- * })
91
- * .then(({ stores, count, limit, offset }) => {
92
- * console.log(stores)
93
- * })
94
- * ```
95
- *
96
- * Learn more about the `fields` property in the [API reference](https://docs.acmekit.com/api/admin#select-fields-and-relations).
97
- */
98
- async list(query, headers) {
99
- return await this.client.fetch(`/admin/stores`, {
100
- method: "GET",
101
- headers,
102
- query,
103
- });
104
- }
105
- /**
106
- * This method updates a store. It sends a request to the
107
- * [Update Store](https://docs.acmekit.com/api/admin#stores_poststoresid)
108
- * API route.
109
- *
110
- * @param id - The ID of the store to update.
111
- * @param body - The details of the store to update.
112
- * @param query - Configure the fields and relations to retrieve in the store.
113
- * @param headers - Headers to pass in the request.
114
- * @returns The store's details.
115
- *
116
- * @example
117
- * sdk.admin.store.update("store_123", {
118
- * name: "My Store",
119
- * })
120
- * .then(({ store }) => {
121
- * console.log(store)
122
- * })
123
- */
124
- async update(id, body, query, headers) {
125
- return await this.client.fetch(`/admin/stores/${id}`, {
126
- method: "POST",
127
- headers,
128
- body,
129
- query,
130
- });
131
- }
132
- }
133
- exports.Store = Store;
134
- //# sourceMappingURL=store.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/admin/store.ts"],"names":[],"mappings":";;;AAIA,MAAa,KAAK;IAKhB;;OAEG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,KAAK,CAAC,QAAQ,CACZ,EAAU,EACV,KAAkC,EAClC,OAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,iBAAiB,EAAE,EAAE,EACrB;YACE,MAAM,EAAE,KAAK;YACb,OAAO;YACP,KAAK;SACN,CACF,CAAA;IACH,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACH,KAAK,CAAC,IAAI,CAAC,KAAsC,EAAE,OAAuB;QACxE,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,eAAe,EACf;YACE,MAAM,EAAE,KAAK;YACb,OAAO;YACP,KAAK;SACN,CACF,CAAA;IACH,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAK,CAAC,MAAM,CACV,EAAU,EACV,IAAgC,EAChC,KAAoB,EACpB,OAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,iBAAiB,EAAE,EAAE,EACrB;YACE,MAAM,EAAE,MAAM;YACd,OAAO;YACP,IAAI;YACJ,KAAK;SACN,CACF,CAAA;IACH,CAAC;CACF;AAzJD,sBAyJC"}