@uappi/public-sdk 1.1.9 → 1.1.11

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.
@@ -34,6 +34,11 @@ import type {
34
34
  CheckCustomerResponse,
35
35
  UpdateCustomerDocument,
36
36
  UpdateCustomerDocumentResponse,
37
+ ProductFields,
38
+ CustomerWishlistConditionFields,
39
+ CustomerWishlistSortFields,
40
+ CustomerListWishlistResponse,
41
+ CustomerDetailWishlistResponse
37
42
  } from '../types';
38
43
 
39
44
  export function detail(
@@ -253,3 +258,42 @@ export function listCustomerHistory(
253
258
  params: options,
254
259
  });
255
260
  }
261
+
262
+
263
+
264
+ export function detailWishlist(
265
+ wishlistId: number,
266
+ options?: Pick<
267
+ ApiParams<ProductFields, '', ''>,
268
+ 'fields' | 'limit' | 'offset'
269
+ >,
270
+ ) {
271
+ return usePublicApi<
272
+ CustomerDetailWishlistResponse,
273
+ ProductFields,
274
+ '',
275
+ ''
276
+ >({
277
+ endpoint: `/customer/wish-list/${wishlistId}/products`,
278
+ method: 'GET',
279
+ params: options,
280
+ });
281
+ }
282
+
283
+ export function listWishlist(
284
+ options?: Pick<
285
+ ApiParams<'', CustomerWishlistSortFields, CustomerWishlistConditionFields>,
286
+ 'condition' | 'limit' | 'offset' | 'order'
287
+ >,
288
+ ) {
289
+ return usePublicApi<
290
+ CustomerListWishlistResponse,
291
+ '',
292
+ CustomerWishlistSortFields,
293
+ CustomerWishlistConditionFields
294
+ >({
295
+ endpoint: '/customer/wish-list/',
296
+ method: 'GET',
297
+ params: options,
298
+ });
299
+ }
@@ -43,7 +43,9 @@ import {
43
43
  listOrderItemHistory,
44
44
  listCustomerHistory,
45
45
  addNewsletter,
46
- updateDocument
46
+ updateDocument,
47
+ listWishlist,
48
+ detailWishlist
47
49
  } from './endpoints/CustomerComposable';
48
50
  import { createInterest } from './endpoints/InterestComposable';
49
51
  import { loggout } from './endpoints/LoggoutComposable';
@@ -120,6 +122,8 @@ const customer = {
120
122
  listWalletTransaction,
121
123
  claimGiftCard,
122
124
  updateDocument,
125
+ listWishlist,
126
+ detailWishlist
123
127
  };
124
128
 
125
129
  const cart = {
@@ -101,3 +101,13 @@ export type CustomerHistoryConditionFields =
101
101
  | 'origin'
102
102
  | 'action'
103
103
  | 'createdAt';
104
+
105
+ export type CustomerWishlistConditionFields =
106
+ | 'id'
107
+ | 'customerId'
108
+ | 'name'
109
+ | 'shareList';
110
+
111
+ export type CustomerWishlistSortFields = 'id' | 'createdAt';
112
+
113
+
@@ -8,6 +8,7 @@ import type {
8
8
  AddressToCartType,
9
9
  SimpleProduct,
10
10
  Discount,
11
+ Product,
11
12
  } from '../..';
12
13
  import type { PickupPoint } from '../shipment/shipment.interfaces';
13
14
 
@@ -446,3 +447,26 @@ export interface CustomerHistoryResponse {
446
447
  registers: Array<CustomerHistory>;
447
448
  pagination: Pagination;
448
449
  }
450
+
451
+ export interface Wishlist {
452
+ customerId: number;
453
+ name: string;
454
+ shareList: boolean;
455
+ default: boolean;
456
+ id: number;
457
+ uriCode: null;
458
+ createdAt: string;
459
+ }
460
+
461
+ export interface CustomerListWishlistResponse {
462
+ registers: Array<Wishlist>;
463
+ pagination: Pagination;
464
+ }
465
+
466
+ export interface CustomerDetailWishlistResponse {
467
+ wishList: Wishlist;
468
+ products: {
469
+ registers: Array<Product>;
470
+ pagination: Pagination;
471
+ }
472
+ }
@@ -71,6 +71,8 @@ import type {
71
71
  CustomerOrderItemHistorySortFields,
72
72
  CustomerHistoryConditionFields,
73
73
  CustomerHistorySortFields,
74
+ CustomerWishlistConditionFields,
75
+ CustomerWishlistSortFields
74
76
  } from './endpoints/customer/customer-obsearch';
75
77
  import type {
76
78
  UpdateCustomer,
@@ -99,7 +101,9 @@ import type {
99
101
  AddCustomerToNewsletterRequest,
100
102
  AddCustomerToNewsletterResponse,
101
103
  UpdateCustomerDocument,
102
- UpdateCustomerDocumentResponse
104
+ UpdateCustomerDocumentResponse,
105
+ CustomerDetailWishlistResponse,
106
+ CustomerListWishlistResponse
103
107
  } from './endpoints/customer/customer.interfaces';
104
108
  import type {
105
109
  CustomerGender,
@@ -421,6 +425,8 @@ export type {
421
425
  CustomerOrderItemHistorySortFields,
422
426
  CustomerHistoryConditionFields,
423
427
  CustomerHistorySortFields,
428
+ CustomerWishlistConditionFields,
429
+ CustomerWishlistSortFields,
424
430
  CustomerErrorCode,
425
431
  UpsertCustomerAddressRequest,
426
432
  CustomerAddressResponse,
@@ -437,6 +443,8 @@ export type {
437
443
  AddCustomerToNewsletterResponse,
438
444
  UpdateCustomerDocument,
439
445
  UpdateCustomerDocumentResponse,
446
+ CustomerDetailWishlistResponse,
447
+ CustomerListWishlistResponse,
440
448
 
441
449
  // Order
442
450
  Order,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uappi/public-sdk",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
4
4
  "description": "Pacotes públicos para desenvolvimento do ecossistema Uappi",
5
5
  "main": "main.ts",
6
6
  "scripts": {