@marteye/studiojs 1.1.30 → 1.1.32
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/index.d.ts +9 -4
- package/dist/index.esm.js +11 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/dist/resources/customers.d.ts +7 -2
- package/dist/resources.d.ts +2 -2
- package/dist/studio.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1253,6 +1253,11 @@ interface CreateCustomerPayload {
|
|
|
1253
1253
|
};
|
|
1254
1254
|
marteyeUid?: string;
|
|
1255
1255
|
}
|
|
1256
|
+
interface CustomersListResponse {
|
|
1257
|
+
customers: Customer[];
|
|
1258
|
+
lastId: string | null;
|
|
1259
|
+
hasMore: boolean;
|
|
1260
|
+
}
|
|
1256
1261
|
|
|
1257
1262
|
interface CreateApplicationPayload {
|
|
1258
1263
|
displayName: string;
|
|
@@ -1456,12 +1461,12 @@ declare function resources(httpClient: HttpClient): {
|
|
|
1456
1461
|
get: (marketId: string, id: string) => Promise<TaxRate>;
|
|
1457
1462
|
};
|
|
1458
1463
|
customers: {
|
|
1459
|
-
list: (marketId: string) => Promise<
|
|
1464
|
+
list: (marketId: string, lastId?: string) => Promise<CustomersListResponse>;
|
|
1460
1465
|
get: (marketId: string, customerId: string) => Promise<Customer>;
|
|
1461
1466
|
avatar: (marketId: string, customerId: string) => Promise<Customer>;
|
|
1462
1467
|
create: (marketId: string, customerData: CreateCustomerPayload) => Promise<Customer>;
|
|
1463
1468
|
getByAccountNumber: (marketId: string, accountNumber: string) => Promise<Customer | null>;
|
|
1464
|
-
getByMartEyeUid: (marketId: string, marteyeUid: string) => Promise<Customer>;
|
|
1469
|
+
getByMartEyeUid: (marketId: string, marteyeUid: string) => Promise<Customer | null>;
|
|
1465
1470
|
};
|
|
1466
1471
|
search: {
|
|
1467
1472
|
query: (marketId: string, query: string) => Promise<SearchResult>;
|
|
@@ -1655,12 +1660,12 @@ declare function Studio(info?: {
|
|
|
1655
1660
|
get: (marketId: string, id: string) => Promise<TaxRate>;
|
|
1656
1661
|
};
|
|
1657
1662
|
customers: {
|
|
1658
|
-
list: (marketId: string) => Promise<
|
|
1663
|
+
list: (marketId: string, lastId?: string) => Promise<CustomersListResponse>;
|
|
1659
1664
|
get: (marketId: string, customerId: string) => Promise<Customer>;
|
|
1660
1665
|
avatar: (marketId: string, customerId: string) => Promise<Customer>;
|
|
1661
1666
|
create: (marketId: string, customerData: CreateCustomerPayload) => Promise<Customer>;
|
|
1662
1667
|
getByAccountNumber: (marketId: string, accountNumber: string) => Promise<Customer | null>;
|
|
1663
|
-
getByMartEyeUid: (marketId: string, marteyeUid: string) => Promise<Customer>;
|
|
1668
|
+
getByMartEyeUid: (marketId: string, marteyeUid: string) => Promise<Customer | null>;
|
|
1664
1669
|
};
|
|
1665
1670
|
search: {
|
|
1666
1671
|
query: (marketId: string, query: string) => Promise<SearchResult>;
|
package/dist/index.esm.js
CHANGED
|
@@ -180,8 +180,12 @@ function create$b(httpClient) {
|
|
|
180
180
|
// Path: studiojs/src/resources/markets.ts
|
|
181
181
|
function create$a(httpClient) {
|
|
182
182
|
let customers = {
|
|
183
|
-
list: async (marketId) => {
|
|
184
|
-
|
|
183
|
+
list: async (marketId, lastId) => {
|
|
184
|
+
let params = {};
|
|
185
|
+
if (lastId) {
|
|
186
|
+
params.lastId = lastId;
|
|
187
|
+
}
|
|
188
|
+
return httpClient.get(`/${marketId}/customers`, params);
|
|
185
189
|
},
|
|
186
190
|
get: async (marketId, customerId) => {
|
|
187
191
|
return httpClient.get(`/${marketId}/customers/${customerId}`);
|
|
@@ -208,7 +212,11 @@ function create$a(httpClient) {
|
|
|
208
212
|
return null;
|
|
209
213
|
},
|
|
210
214
|
getByMartEyeUid: async (marketId, marteyeUid) => {
|
|
211
|
-
|
|
215
|
+
const response = await httpClient.get(`/${marketId}/customers`, { marteyeUid });
|
|
216
|
+
if (response.customers && response.customers.length > 0) {
|
|
217
|
+
return response.customers[0];
|
|
218
|
+
}
|
|
219
|
+
return null;
|
|
212
220
|
},
|
|
213
221
|
};
|
|
214
222
|
return customers;
|