@acmekit/js-sdk 2.13.14 → 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.
- package/dist/admin/index.d.ts +0 -15
- package/dist/admin/index.d.ts.map +1 -1
- package/dist/admin/index.js +0 -6
- package/dist/admin/index.js.map +1 -1
- package/dist/client.d.ts +3 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +6 -6
- package/dist/client.js.map +1 -1
- package/dist/esm/admin/index.d.ts +0 -15
- package/dist/esm/admin/index.d.ts.map +1 -1
- package/dist/esm/admin/index.js +0 -6
- package/dist/esm/admin/index.js.map +1 -1
- package/dist/esm/client.d.ts +3 -3
- package/dist/esm/client.d.ts.map +1 -1
- package/dist/esm/client.js +5 -5
- package/dist/esm/client.js.map +1 -1
- package/dist/esm/index.d.ts +0 -3
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +0 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types.d.ts +1 -1
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -5
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/admin/customer-group.d.ts +0 -170
- package/dist/admin/customer-group.d.ts.map +0 -1
- package/dist/admin/customer-group.js +0 -206
- package/dist/admin/customer-group.js.map +0 -1
- package/dist/admin/customer.d.ts +0 -264
- package/dist/admin/customer.d.ts.map +0 -1
- package/dist/admin/customer.js +0 -323
- package/dist/admin/customer.js.map +0 -1
- package/dist/admin/store.d.ts +0 -116
- package/dist/admin/store.d.ts.map +0 -1
- package/dist/admin/store.js +0 -134
- package/dist/admin/store.js.map +0 -1
- package/dist/esm/admin/customer-group.d.ts +0 -170
- package/dist/esm/admin/customer-group.d.ts.map +0 -1
- package/dist/esm/admin/customer-group.js +0 -223
- package/dist/esm/admin/customer-group.js.map +0 -1
- package/dist/esm/admin/customer.d.ts +0 -264
- package/dist/esm/admin/customer.d.ts.map +0 -1
- package/dist/esm/admin/customer.js +0 -350
- package/dist/esm/admin/customer.js.map +0 -1
- package/dist/esm/admin/store.d.ts +0 -116
- package/dist/esm/admin/store.d.ts.map +0 -1
- package/dist/esm/admin/store.js +0 -145
- package/dist/esm/admin/store.js.map +0 -1
- package/dist/esm/store/index.d.ts +0 -12
- package/dist/esm/store/index.d.ts.map +0 -1
- package/dist/esm/store/index.js +0 -13
- package/dist/esm/store/index.js.map +0 -1
- package/dist/store/index.d.ts +0 -12
- package/dist/store/index.d.ts.map +0 -1
- package/dist/store/index.js +0 -17
- package/dist/store/index.js.map +0 -1
|
@@ -1,350 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
export class Customer {
|
|
11
|
-
/**
|
|
12
|
-
* @ignore
|
|
13
|
-
*/
|
|
14
|
-
constructor(client) {
|
|
15
|
-
this.client = client;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* This method creates a customer. It sends a request to the
|
|
19
|
-
* [Create Customer](https://docs.acmekit.com/api/admin#customers_postcustomers) API route.
|
|
20
|
-
*
|
|
21
|
-
* @param body - The customer's details.
|
|
22
|
-
* @param query - Configure the fields to retrieve in the customer.
|
|
23
|
-
* @param headers - Headers to pass in the request.
|
|
24
|
-
* @returns The customer's details.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* sdk.admin.customer.create({
|
|
28
|
-
* email: "customer@gmail.com"
|
|
29
|
-
* })
|
|
30
|
-
* .then(({ customer }) => {
|
|
31
|
-
* console.log(customer)
|
|
32
|
-
* })
|
|
33
|
-
*/
|
|
34
|
-
create(body, query, headers) {
|
|
35
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
return this.client.fetch(`/admin/customers`, {
|
|
37
|
-
method: "POST",
|
|
38
|
-
headers,
|
|
39
|
-
body,
|
|
40
|
-
query,
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* This method updates a customer's details. It sends a request to the
|
|
46
|
-
* [Update Customer](https://docs.acmekit.com/api/admin#customers_postcustomersid) API route.
|
|
47
|
-
*
|
|
48
|
-
* @param id - The customer's ID.
|
|
49
|
-
* @param body - The details to update of the customer.
|
|
50
|
-
* @param query - Configure the fields to retrieve in the customer.
|
|
51
|
-
* @param headers - Headers to pass in the request.
|
|
52
|
-
* @returns The customer's details.
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* sdk.admin.customer.update("cus_123", {
|
|
56
|
-
* first_name: "John"
|
|
57
|
-
* })
|
|
58
|
-
* .then(({ customer }) => {
|
|
59
|
-
* console.log(customer)
|
|
60
|
-
* })
|
|
61
|
-
*/
|
|
62
|
-
update(id, body, query, headers) {
|
|
63
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
-
return this.client.fetch(`/admin/customers/${id}`, {
|
|
65
|
-
method: "POST",
|
|
66
|
-
headers,
|
|
67
|
-
body,
|
|
68
|
-
query,
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* This method retrieves a paginated list of customers. It sends a request to the
|
|
74
|
-
* [List Customers](https://docs.acmekit.com/api/admin#customers_getcustomers)
|
|
75
|
-
* API route.
|
|
76
|
-
*
|
|
77
|
-
* @param queryParams - Filters and pagination configurations.
|
|
78
|
-
* @param headers - Headers to pass in the request.
|
|
79
|
-
* @returns The paginated list of customers.
|
|
80
|
-
*
|
|
81
|
-
* @example
|
|
82
|
-
* To retrieve the list of customers:
|
|
83
|
-
*
|
|
84
|
-
* ```ts
|
|
85
|
-
* sdk.admin.customer.list()
|
|
86
|
-
* .then(({ customers, count, limit, offset }) => {
|
|
87
|
-
* console.log(customers)
|
|
88
|
-
* })
|
|
89
|
-
* ```
|
|
90
|
-
*
|
|
91
|
-
* To configure the pagination, pass the `limit` and `offset` query parameters.
|
|
92
|
-
*
|
|
93
|
-
* For example, to retrieve only 10 items and skip 10 items:
|
|
94
|
-
*
|
|
95
|
-
* ```ts
|
|
96
|
-
* sdk.admin.customer.list({
|
|
97
|
-
* limit: 10,
|
|
98
|
-
* offset: 10
|
|
99
|
-
* })
|
|
100
|
-
* .then(({ customers, count, limit, offset }) => {
|
|
101
|
-
* console.log(customers)
|
|
102
|
-
* })
|
|
103
|
-
* ```
|
|
104
|
-
*
|
|
105
|
-
* Using the `fields` query parameter, you can specify the fields and relations to retrieve
|
|
106
|
-
* in each customer:
|
|
107
|
-
*
|
|
108
|
-
* ```ts
|
|
109
|
-
* sdk.admin.customer.list({
|
|
110
|
-
* fields: "id,*groups"
|
|
111
|
-
* })
|
|
112
|
-
* .then(({ customers, count, limit, offset }) => {
|
|
113
|
-
* console.log(customers)
|
|
114
|
-
* })
|
|
115
|
-
* ```
|
|
116
|
-
*
|
|
117
|
-
* Learn more about the `fields` property in the [API reference](https://docs.acmekit.com/api/store#select-fields-and-relations).
|
|
118
|
-
*/
|
|
119
|
-
list(queryParams, headers) {
|
|
120
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
121
|
-
return this.client.fetch(`/admin/customers`, {
|
|
122
|
-
headers,
|
|
123
|
-
query: queryParams,
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* This method retrieves a customer by its ID. It sends a request to the
|
|
129
|
-
* [Get Customer](https://docs.acmekit.com/api/admin#customers_getcustomersid)
|
|
130
|
-
* API route.
|
|
131
|
-
*
|
|
132
|
-
* @param id - The customer's ID.
|
|
133
|
-
* @param query - Configure the fields to retrieve in the customer.
|
|
134
|
-
* @param headers - Headers to pass in the request.
|
|
135
|
-
* @returns The customer's details.
|
|
136
|
-
*
|
|
137
|
-
* @example
|
|
138
|
-
* To retrieve a customer by its ID:
|
|
139
|
-
*
|
|
140
|
-
* ```ts
|
|
141
|
-
* sdk.admin.customer.retrieve("cus_123")
|
|
142
|
-
* .then(({ customer }) => {
|
|
143
|
-
* console.log(customer)
|
|
144
|
-
* })
|
|
145
|
-
* ```
|
|
146
|
-
*
|
|
147
|
-
* To specify the fields and relations to retrieve:
|
|
148
|
-
*
|
|
149
|
-
* ```ts
|
|
150
|
-
* sdk.admin.customer.retrieve("cus_123", {
|
|
151
|
-
* fields: "id,*groups"
|
|
152
|
-
* })
|
|
153
|
-
* .then(({ customer }) => {
|
|
154
|
-
* console.log(customer)
|
|
155
|
-
* })
|
|
156
|
-
* ```
|
|
157
|
-
*
|
|
158
|
-
* Learn more about the `fields` property in the [API reference](https://docs.acmekit.com/api/store#select-fields-and-relations).
|
|
159
|
-
*/
|
|
160
|
-
retrieve(id, query, headers) {
|
|
161
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
162
|
-
return this.client.fetch(`/admin/customers/${id}`, {
|
|
163
|
-
query,
|
|
164
|
-
headers,
|
|
165
|
-
});
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* This method deletes a customer by its ID. It sends a request to the
|
|
170
|
-
* [Delete Customer](https://docs.acmekit.com/api/admin#customers_deletecustomersid)
|
|
171
|
-
* API route.
|
|
172
|
-
*
|
|
173
|
-
* @param id - The customer's ID.
|
|
174
|
-
* @param headers - Headers to pass in the request.
|
|
175
|
-
* @returns The deletion's details.
|
|
176
|
-
*
|
|
177
|
-
* @example
|
|
178
|
-
* sdk.admin.customer.delete("cus_123")
|
|
179
|
-
* .then(({ deleted }) => {
|
|
180
|
-
* console.log(deleted)
|
|
181
|
-
* })
|
|
182
|
-
*/
|
|
183
|
-
delete(id, headers) {
|
|
184
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
185
|
-
return this.client.fetch(`/admin/customers/${id}`, {
|
|
186
|
-
method: "DELETE",
|
|
187
|
-
headers,
|
|
188
|
-
});
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* This method manages customer groups for a customer.
|
|
193
|
-
* It sends a request to the [Manage Customers](https://docs.acmekit.com/api/admin#customers_postcustomersidcustomergroups)
|
|
194
|
-
* API route.
|
|
195
|
-
*
|
|
196
|
-
* @param id - The customer's ID.
|
|
197
|
-
* @param body - The groups to add customer to or remove customer from.
|
|
198
|
-
* @param headers - Headers to pass in the request
|
|
199
|
-
* @returns The customers details.
|
|
200
|
-
*
|
|
201
|
-
* @example
|
|
202
|
-
* sdk.admin.customer.batchCustomerGroups("cus_123", {
|
|
203
|
-
* add: ["cusgroup_123"],
|
|
204
|
-
* remove: ["cusgroup_321"]
|
|
205
|
-
* })
|
|
206
|
-
* .then(({ customer }) => {
|
|
207
|
-
* console.log(customer)
|
|
208
|
-
* })
|
|
209
|
-
*/
|
|
210
|
-
batchCustomerGroups(id, body, headers) {
|
|
211
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
212
|
-
return yield this.client.fetch(`/admin/customers/${id}/customer-groups`, {
|
|
213
|
-
method: "POST",
|
|
214
|
-
headers,
|
|
215
|
-
body,
|
|
216
|
-
});
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* This method creates a customer address. It sends a request to the
|
|
221
|
-
* [Create Customer Address](https://docs.acmekit.com/api/admin#customers_postcustomersidaddresses)
|
|
222
|
-
* API route.
|
|
223
|
-
*
|
|
224
|
-
* @param id - The customer's ID.
|
|
225
|
-
* @param body - The customer address's details.
|
|
226
|
-
* @param headers - Headers to pass in the request.
|
|
227
|
-
* @returns The customer address's details.
|
|
228
|
-
*
|
|
229
|
-
* @example
|
|
230
|
-
* sdk.admin.customer.createAddress("cus_123", {
|
|
231
|
-
* address_1: "123 Main St",
|
|
232
|
-
* city: "Anytown",
|
|
233
|
-
* country_code: "US",
|
|
234
|
-
* postal_code: "12345"
|
|
235
|
-
* })
|
|
236
|
-
* .then(({ customer }) => {
|
|
237
|
-
* console.log(customer)
|
|
238
|
-
* })
|
|
239
|
-
*/
|
|
240
|
-
createAddress(id, body, headers) {
|
|
241
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
242
|
-
return yield this.client.fetch(`/admin/customers/${id}/addresses`, {
|
|
243
|
-
method: "POST",
|
|
244
|
-
headers,
|
|
245
|
-
body,
|
|
246
|
-
});
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
/**
|
|
250
|
-
* This method updates a customer address. It sends a request to the
|
|
251
|
-
* [Update Customer Address](https://docs.acmekit.com/api/admin#customers_postcustomersidaddressesaddressid)
|
|
252
|
-
* API route.
|
|
253
|
-
*
|
|
254
|
-
* @param id - The customer's ID.
|
|
255
|
-
* @param addressId - The customer address's ID.
|
|
256
|
-
* @param body - The customer address's details.
|
|
257
|
-
* @param headers - Headers to pass in the request.
|
|
258
|
-
* @returns The customer address's details.
|
|
259
|
-
*
|
|
260
|
-
* @example
|
|
261
|
-
* sdk.admin.customer.updateAddress("cus_123", "cus_addr_123", {
|
|
262
|
-
* address_1: "123 Main St",
|
|
263
|
-
* city: "Anytown",
|
|
264
|
-
* country_code: "US",
|
|
265
|
-
* postal_code: "12345"
|
|
266
|
-
* })
|
|
267
|
-
* .then(({ customer }) => {
|
|
268
|
-
* console.log(customer)
|
|
269
|
-
* })
|
|
270
|
-
*/
|
|
271
|
-
updateAddress(id, addressId, body, headers) {
|
|
272
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
273
|
-
return yield this.client.fetch(`/admin/customers/${id}/addresses/${addressId}`, {
|
|
274
|
-
method: "POST",
|
|
275
|
-
headers,
|
|
276
|
-
body,
|
|
277
|
-
});
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
/**
|
|
281
|
-
* This method deletes a customer address. It sends a request to the
|
|
282
|
-
* [Delete Customer Address](https://docs.acmekit.com/api/admin#customers_deletecustomersidaddressesaddressid)
|
|
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.deleteAddress("cus_123", "cus_addr_123")
|
|
292
|
-
* .then(({ customer }) => {
|
|
293
|
-
* console.log(customer)
|
|
294
|
-
* })
|
|
295
|
-
*/
|
|
296
|
-
deleteAddress(id, addressId, headers) {
|
|
297
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
298
|
-
return yield this.client.fetch(`/admin/customers/${id}/addresses/${addressId}`, {
|
|
299
|
-
method: "DELETE",
|
|
300
|
-
headers,
|
|
301
|
-
});
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* This method retrieves a customer address by its ID. It sends a request to the
|
|
306
|
-
* [Get Customer Address](https://docs.acmekit.com/api/admin#customers_getcustomersidaddressesaddressid)
|
|
307
|
-
* API route.
|
|
308
|
-
*
|
|
309
|
-
* @param id - The customer's ID.
|
|
310
|
-
* @param addressId - The customer address's ID.
|
|
311
|
-
* @param headers - Headers to pass in the request.
|
|
312
|
-
* @returns The customer address's details.
|
|
313
|
-
*
|
|
314
|
-
* @example
|
|
315
|
-
* sdk.admin.customer.retrieveAddress("cus_123", "cus_addr_123")
|
|
316
|
-
* .then(({ customer }) => {
|
|
317
|
-
* console.log(customer)
|
|
318
|
-
* })
|
|
319
|
-
*/
|
|
320
|
-
retrieveAddress(id, addressId, headers) {
|
|
321
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
322
|
-
return yield this.client.fetch(`/admin/customers/${id}/addresses/${addressId}`, {
|
|
323
|
-
headers,
|
|
324
|
-
});
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
/**
|
|
328
|
-
* This method retrieves a list of customer addresses. It sends a request to the
|
|
329
|
-
* [List Customer Addresses](https://docs.acmekit.com/api/admin#customers_getcustomersidaddresses)
|
|
330
|
-
* API route.
|
|
331
|
-
*
|
|
332
|
-
* @param id - The customer's ID.
|
|
333
|
-
* @param headers - Headers to pass in the request.
|
|
334
|
-
* @returns The list of customer addresses.
|
|
335
|
-
*
|
|
336
|
-
* @example
|
|
337
|
-
* sdk.admin.customer.listAddresses("cus_123")
|
|
338
|
-
* .then(({ addresses }) => {
|
|
339
|
-
* console.log(addresses)
|
|
340
|
-
* })
|
|
341
|
-
*/
|
|
342
|
-
listAddresses(id, headers) {
|
|
343
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
344
|
-
return yield this.client.fetch(`/admin/customers/${id}/addresses`, {
|
|
345
|
-
headers,
|
|
346
|
-
});
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
//# sourceMappingURL=customer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"customer.js","sourceRoot":"","sources":["../../../src/admin/customer.ts"],"names":[],"mappings":";;;;;;;;;AAIA,MAAM,OAAO,QAAQ;IAKnB;;OAEG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACG,MAAM,CACV,IAAmC,EACnC,KAAoB,EACpB,OAAuB;;YAEvB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,kBAAkB,EAClB;gBACE,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,IAAI;gBACJ,KAAK;aACN,CACF,CAAA;Q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
|
|
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"}
|
package/dist/esm/admin/store.js
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
export class Store {
|
|
11
|
-
/**
|
|
12
|
-
* @ignore
|
|
13
|
-
*/
|
|
14
|
-
constructor(client) {
|
|
15
|
-
this.client = client;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* This method retrieves a store by its ID. It sends a request to the
|
|
19
|
-
* [Get Store](https://docs.acmekit.com/api/admin#stores_getstoresid)
|
|
20
|
-
* API route.
|
|
21
|
-
*
|
|
22
|
-
* @param id - The ID of the store to retrieve.
|
|
23
|
-
* @param query - Configure the fields and relations to retrieve in the store.
|
|
24
|
-
* @param headers - Headers to pass in the request.
|
|
25
|
-
* @returns The store's details.
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* To retrieve a store by its ID:
|
|
29
|
-
*
|
|
30
|
-
* ```ts
|
|
31
|
-
* sdk.admin.store.retrieve("store_123")
|
|
32
|
-
* .then(({ store }) => {
|
|
33
|
-
* console.log(store)
|
|
34
|
-
* })
|
|
35
|
-
* ```
|
|
36
|
-
*
|
|
37
|
-
* To specify the fields and relations to retrieve:
|
|
38
|
-
*
|
|
39
|
-
* ```ts
|
|
40
|
-
* sdk.admin.store.retrieve("store_123", {
|
|
41
|
-
* fields: "id,*supported_currencies"
|
|
42
|
-
* })
|
|
43
|
-
* .then(({ store }) => {
|
|
44
|
-
* console.log(store)
|
|
45
|
-
* })
|
|
46
|
-
* ```
|
|
47
|
-
*
|
|
48
|
-
* Learn more about the `fields` property in the [API reference](https://docs.acmekit.com/api/admin#select-fields-and-relations).
|
|
49
|
-
*/
|
|
50
|
-
retrieve(id, query, headers) {
|
|
51
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
-
return yield this.client.fetch(`/admin/stores/${id}`, {
|
|
53
|
-
method: "GET",
|
|
54
|
-
headers,
|
|
55
|
-
query,
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* This method retrieves a list of stores. It sends a request to the
|
|
61
|
-
* [List Stores](https://docs.acmekit.com/api/admin#stores_getstores)
|
|
62
|
-
* API route.
|
|
63
|
-
*
|
|
64
|
-
* @param query - Filters and pagination configurations.
|
|
65
|
-
* @param headers - Headers to pass in the request.
|
|
66
|
-
* @returns The list of stores.
|
|
67
|
-
*
|
|
68
|
-
* @example
|
|
69
|
-
* To retrieve the list of stores:
|
|
70
|
-
*
|
|
71
|
-
* ```ts
|
|
72
|
-
* sdk.admin.store.list()
|
|
73
|
-
* .then(({ stores, count, limit, offset }) => {
|
|
74
|
-
* console.log(stores)
|
|
75
|
-
* })
|
|
76
|
-
* ```
|
|
77
|
-
*
|
|
78
|
-
* To configure the pagination, pass the `limit` and `offset` query parameters.
|
|
79
|
-
*
|
|
80
|
-
* For example, to retrieve only 10 items and skip 10 items:
|
|
81
|
-
*
|
|
82
|
-
* ```ts
|
|
83
|
-
* sdk.admin.store.list({
|
|
84
|
-
* limit: 10,
|
|
85
|
-
* offset: 10
|
|
86
|
-
* })
|
|
87
|
-
* .then(({ stores, count, limit, offset }) => {
|
|
88
|
-
* console.log(stores)
|
|
89
|
-
* })
|
|
90
|
-
* ```
|
|
91
|
-
*
|
|
92
|
-
* Using the `fields` query parameter, you can specify the fields and relations to retrieve
|
|
93
|
-
* in each store:
|
|
94
|
-
*
|
|
95
|
-
* ```ts
|
|
96
|
-
* sdk.admin.store.list({
|
|
97
|
-
* fields: "id,*supported_currencies"
|
|
98
|
-
* })
|
|
99
|
-
* .then(({ stores, count, limit, offset }) => {
|
|
100
|
-
* console.log(stores)
|
|
101
|
-
* })
|
|
102
|
-
* ```
|
|
103
|
-
*
|
|
104
|
-
* Learn more about the `fields` property in the [API reference](https://docs.acmekit.com/api/admin#select-fields-and-relations).
|
|
105
|
-
*/
|
|
106
|
-
list(query, headers) {
|
|
107
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
-
return yield this.client.fetch(`/admin/stores`, {
|
|
109
|
-
method: "GET",
|
|
110
|
-
headers,
|
|
111
|
-
query,
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* This method updates a store. It sends a request to the
|
|
117
|
-
* [Update Store](https://docs.acmekit.com/api/admin#stores_poststoresid)
|
|
118
|
-
* API route.
|
|
119
|
-
*
|
|
120
|
-
* @param id - The ID of the store to update.
|
|
121
|
-
* @param body - The details of the store to update.
|
|
122
|
-
* @param query - Configure the fields and relations to retrieve in the store.
|
|
123
|
-
* @param headers - Headers to pass in the request.
|
|
124
|
-
* @returns The store's details.
|
|
125
|
-
*
|
|
126
|
-
* @example
|
|
127
|
-
* sdk.admin.store.update("store_123", {
|
|
128
|
-
* name: "My Store",
|
|
129
|
-
* })
|
|
130
|
-
* .then(({ store }) => {
|
|
131
|
-
* console.log(store)
|
|
132
|
-
* })
|
|
133
|
-
*/
|
|
134
|
-
update(id, body, query, headers) {
|
|
135
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
136
|
-
return yield this.client.fetch(`/admin/stores/${id}`, {
|
|
137
|
-
method: "POST",
|
|
138
|
-
headers,
|
|
139
|
-
body,
|
|
140
|
-
query,
|
|
141
|
-
});
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
//# sourceMappingURL=store.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../../src/admin/store.ts"],"names":[],"mappings":";;;;;;;;;AAIA,MAAM,OAAO,KAAK;IAKhB;;OAEG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,QAAQ,CACZ,EAAU,EACV,KAAkC,EAClC,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,iBAAiB,EAAE,EAAE,EACrB;gBACE,MAAM,EAAE,KAAK;gBACb,OAAO;gBACP,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACG,IAAI,CAAC,KAAsC,EAAE,OAAuB;;YACxE,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,eAAe,EACf;gBACE,MAAM,EAAE,KAAK;gBACb,OAAO;gBACP,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACG,MAAM,CACV,EAAU,EACV,IAAgC,EAChC,KAAoB,EACpB,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,iBAAiB,EAAE,EAAE,EACrB;gBACE,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,IAAI;gBACJ,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;CACF"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Client } from "../client";
|
|
2
|
-
/**
|
|
3
|
-
* Store API client. Commerce storefront routes (cart, orders, products, etc.) have been removed.
|
|
4
|
-
* Kernel store API (e.g. customers/me, locales) can be extended here when needed.
|
|
5
|
-
*/
|
|
6
|
-
export declare class Store {
|
|
7
|
-
/**
|
|
8
|
-
* @ignore
|
|
9
|
-
*/
|
|
10
|
-
constructor(_client: Client);
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC;;;GAGG;AACH,qBAAa,KAAK;IAChB;;OAEG;gBACS,OAAO,EAAE,MAAM;CAG5B"}
|
package/dist/esm/store/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Store API client. Commerce storefront routes (cart, orders, products, etc.) have been removed.
|
|
3
|
-
* Kernel store API (e.g. customers/me, locales) can be extended here when needed.
|
|
4
|
-
*/
|
|
5
|
-
export class Store {
|
|
6
|
-
/**
|
|
7
|
-
* @ignore
|
|
8
|
-
*/
|
|
9
|
-
constructor(_client) {
|
|
10
|
-
// Store API (commerce) removed; client kept for future storefront endpoints
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/store/index.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,OAAO,KAAK;IAChB;;OAEG;IACH,YAAY,OAAe;QACzB,4EAA4E;IAC9E,CAAC;CACF"}
|
package/dist/store/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Client } from "../client";
|
|
2
|
-
/**
|
|
3
|
-
* Store API client. Commerce storefront routes (cart, orders, products, etc.) have been removed.
|
|
4
|
-
* Kernel store API (e.g. customers/me, locales) can be extended here when needed.
|
|
5
|
-
*/
|
|
6
|
-
export declare class Store {
|
|
7
|
-
/**
|
|
8
|
-
* @ignore
|
|
9
|
-
*/
|
|
10
|
-
constructor(_client: Client);
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC;;;GAGG;AACH,qBAAa,KAAK;IAChB;;OAEG;gBACS,OAAO,EAAE,MAAM;CAG5B"}
|