@uappi/public-sdk 1.2.6 → 1.2.8

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.
@@ -42,6 +42,7 @@ import type {
42
42
  AddProductToWishlistRequest,
43
43
  RequestSendMFA
44
44
  } from '../types';
45
+ import { SalesChannelByEmailResponse } from '../types/endpoints/customer/customer.interfaces';
45
46
 
46
47
  export function detail(
47
48
  options?: Pick<
@@ -316,3 +317,11 @@ export function removeProductToWishlist(wishlistId: number, productId: number) {
316
317
  });
317
318
  }
318
319
 
320
+ export function listSalesChannelByEmail(payload: { identification: string; }) {
321
+ return usePublicApi<Array<SalesChannelByEmailResponse>>({
322
+ method: 'POST',
323
+ endpoint: '/customer/login/check-sales-channel',
324
+ payload,
325
+ });
326
+ }
327
+
@@ -47,7 +47,8 @@ import {
47
47
  listWishlist,
48
48
  detailWishlist,
49
49
  addProductToWishlist,
50
- removeProductToWishlist
50
+ removeProductToWishlist,
51
+ listSalesChannelByEmail
51
52
  } from './endpoints/CustomerComposable';
52
53
  import { createInterest } from './endpoints/InterestComposable';
53
54
  import { loggout } from './endpoints/LoggoutComposable';
@@ -137,7 +138,9 @@ const customer = {
137
138
  confirmMfa,
138
139
  loginMfa,
139
140
  deleteMFA,
140
- mfaSetup
141
+ mfaSetup,
142
+
143
+ listSalesChannelByEmail
141
144
  };
142
145
 
143
146
  const cart = {
@@ -487,3 +487,8 @@ export interface CustomerDetailWishlistResponse {
487
487
  export interface AddProductToWishlistRequest {
488
488
  productId: number;
489
489
  }
490
+
491
+ export interface SalesChannelByEmailResponse {
492
+ id: number;
493
+ domain: string;
494
+ }
@@ -11,6 +11,7 @@ import type { CustomerLead } from '../types';
11
11
  import type {
12
12
  ApiParams,
13
13
  CustomerConditionFields,
14
+ CustomerFields,
14
15
  CustomerSortFields,
15
16
  SigninCustomerByDocument,
16
17
  SigninCustomerByEmail,
@@ -27,11 +28,13 @@ export function detail(
27
28
  'condition' | 'fields' | 'order'
28
29
  >,
29
30
  ) {
31
+
32
+ let fields: Array<CustomerFields> = ['addresses', 'flags'];
33
+
34
+ if (options?.fields) fields = [...options.fields, ...fields];
35
+
30
36
  return publicApi.customer
31
- .detail({
32
- ...options,
33
- fields: ['addresses', 'flags'],
34
- })
37
+ .detail({ ...options, fields })
35
38
  .then(data => {
36
39
  customerProfileAction(data);
37
40
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uappi/public-sdk",
3
- "version": "1.2.6",
3
+ "version": "1.2.8",
4
4
  "description": "Pacotes públicos para desenvolvimento do ecossistema Uappi",
5
5
  "main": "main.ts",
6
6
  "scripts": {