@marteye/studiojs 1.1.31 → 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 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,7 +1461,7 @@ declare function resources(httpClient: HttpClient): {
1456
1461
  get: (marketId: string, id: string) => Promise<TaxRate>;
1457
1462
  };
1458
1463
  customers: {
1459
- list: (marketId: string) => Promise<Customer>;
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>;
@@ -1655,7 +1660,7 @@ declare function Studio(info?: {
1655
1660
  get: (marketId: string, id: string) => Promise<TaxRate>;
1656
1661
  };
1657
1662
  customers: {
1658
- list: (marketId: string) => Promise<Customer>;
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>;
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
- return httpClient.get(`/${marketId}/customers`);
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,9 +212,9 @@ function create$a(httpClient) {
208
212
  return null;
209
213
  },
210
214
  getByMartEyeUid: async (marketId, marteyeUid) => {
211
- let customers = await httpClient.get(`/${marketId}/customers`, { marteyeUid });
212
- if (customers.length) {
213
- return customers[0];
215
+ const response = await httpClient.get(`/${marketId}/customers`, { marteyeUid });
216
+ if (response.customers && response.customers.length > 0) {
217
+ return response.customers[0];
214
218
  }
215
219
  return null;
216
220
  },