@soma-vertical-web/multi-lib 0.0.28 → 0.0.30

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.
Files changed (33) hide show
  1. package/data/api/catalog/index.d.ts +3 -0
  2. package/data/api/catalog/kit/index.d.ts +11 -0
  3. package/data/api/catalog/product/info/index.d.ts +10 -0
  4. package/data/api/catalog/product/similars/index.d.ts +11 -22
  5. package/data/api/checkout/address/index.d.ts +1 -1
  6. package/data/api/checkout/order-form/attachments/index.d.ts +1 -1
  7. package/data/api/checkout/order-form/attachments/marketing-data/index.d.ts +1 -1
  8. package/data/api/checkout/order-form/attachments/open-text-field/index.d.ts +1 -1
  9. package/data/api/checkout/order-form/coupon/index.d.ts +1 -1
  10. package/data/api/checkout/order-form/custom-data/index.d.ts +1 -1
  11. package/data/api/checkout/order-form/items/remove-all/index.d.ts +1 -1
  12. package/data/api/checkout/order-form/items/update/index.d.ts +1 -1
  13. package/data/api/checkout/order-form/messages/remove-all/index.d.ts +1 -1
  14. package/data/api/checkout/order-form/offerings/index.d.ts +1 -1
  15. package/data/api/checkout/order-form/orderform/index.d.ts +1 -1
  16. package/data/api/checkout/order-form/profile/index.d.ts +1 -1
  17. package/data/api/checkout/order-form/seller-code/index.d.ts +1 -1
  18. package/data/api/checkout/order-form/shipping/index.d.ts +1 -1
  19. package/data/api/checkout/order-form/shipping/update/index.d.ts +1 -1
  20. package/data/api/checkout/region/index.d.ts +1 -1
  21. package/data/api/checkout/simulation/index.d.ts +1 -1
  22. package/data/api/fetchVtex.d.ts +2 -1
  23. package/data/helpers/catalog/index.d.ts +38 -0
  24. package/index2.js +1 -1
  25. package/index2.mjs +504 -338
  26. package/package.json +1 -1
  27. package/server.d.ts +11 -155
  28. package/types/data/api/catalog/kit/index.d.ts +0 -0
  29. package/types/data/api/catalog/portal/index.d.ts +26 -0
  30. package/types/data/api/catalog/product/index.d.ts +50 -0
  31. package/types/data/api/index.d.ts +3 -6
  32. package/types/layout/team-components/FreightCalculation/index.d.ts +6 -24
  33. package/types/layout/team-components/ProductCard/Selectors/index.d.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soma-vertical-web/multi-lib",
3
- "version": "0.0.28",
3
+ "version": "0.0.30",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
package/server.d.ts CHANGED
@@ -1,157 +1,13 @@
1
- import * as cmsAPIs from './data/api/cms';
1
+ import * as checkout from './data/api/checkout';
2
+ import * as catalog from './data/api/catalog';
3
+ import * as catalogHelpers from './data/helpers/catalog';
4
+ import * as cms from './data/api/cms';
2
5
  declare const serverAPIs: {
3
- checkout: {
4
- postOrderformAddress({ apiUrl, body, fetchOptions }: import('./types/data/api').FetchFunctionsProps<{
5
- postalCode?: string | null | undefined;
6
- country: string;
7
- }>): Promise<Record<string, any>>;
8
- schemaAddress: import('yup').ObjectSchema<{
9
- country: string;
10
- postalCode: string | null | undefined;
11
- }, import('yup').AnyObject, {
12
- country: undefined;
13
- postalCode: undefined;
14
- }, "">;
15
- postOrderFormAttachOrderFormData({ apiUrl, body, fetchOptions }: import('./types/data/api').FetchFunctionsProps<{
16
- orderFormId?: string | null | undefined;
17
- sellerCode?: string | null | undefined;
18
- sellerName?: string | null | undefined;
19
- }>): Promise<Record<string, any>>;
20
- schemaAttachments: import('yup').ObjectSchema<{
21
- orderFormId: string | null | undefined;
22
- sellerCode: string | null | undefined;
23
- sellerName: string | null | undefined;
24
- }, import('yup').AnyObject, {
25
- orderFormId: undefined;
26
- sellerCode: undefined;
27
- sellerName: undefined;
28
- }, "">;
29
- postOrderFormAttachmentsMarketingData({ apiUrl, body, fetchOptions }: import('./types/data/api').FetchFunctionsProps<{
30
- orderFormId?: string | null | undefined;
31
- sellerCode?: string | null | undefined;
32
- marketingData: {};
33
- }>): Promise<Record<string, any>>;
34
- postOrderFormAttachmentsOpenTextField({ apiUrl, body, fetchOptions, }: import('./types/data/api').FetchFunctionsProps<{
35
- orderFormId?: string | null | undefined;
36
- sellerCode?: string | null | undefined;
37
- sellerName?: string | null | undefined;
38
- }>): Promise<Record<string, any>>;
39
- postOrderFormAddCoupon({ apiUrl, body, fetchOptions, }: import('./types/data/api').FetchFunctionsProps<{
40
- coupon?: string | null | undefined;
41
- orderFormId?: string | null | undefined;
42
- }>): Promise<Record<string, any>>;
43
- putOrderFormCustomData({ apiUrl, body, fetchOptions, }: import('./types/data/api').FetchFunctionsProps<{
44
- key?: (string | undefined)[] | undefined;
45
- orderFormId?: string | null | undefined;
46
- appId: string;
47
- }>): Promise<Record<string, any>>;
48
- postOrderFormRemoveAllItems({ apiUrl, body, fetchOptions, }: import('./types/data/api').FetchFunctionsProps<{
49
- orderFormId?: string | null | undefined;
50
- }>): Promise<Record<string, any>>;
51
- postOrderFormUpdateItems({ apiUrl, body, fetchOptions, }: import('./types/data/api').FetchFunctionsProps<{
52
- orderFormId?: string | null | undefined;
53
- orderItems?: {
54
- quantity?: number | null | undefined;
55
- price?: number | undefined;
56
- index?: number | null | undefined;
57
- attachments?: {
58
- name: string;
59
- content: {} | null;
60
- }[] | null | undefined;
61
- seller: string;
62
- id: string;
63
- }[] | undefined;
64
- }>): Promise<Record<string, any>>;
65
- schemaItem: import('yup').ObjectSchema<{
66
- attachments: {
67
- name: string;
68
- content: {} | null;
69
- }[] | null | undefined;
70
- id: string;
71
- index: number | null | undefined;
72
- quantity: number | null | undefined;
73
- seller: string;
74
- price: number | undefined;
75
- }, import('yup').AnyObject, {
76
- attachments: "";
77
- id: undefined;
78
- index: undefined;
79
- quantity: undefined;
80
- seller: undefined;
81
- price: undefined;
82
- }, "">;
83
- postOrderFormClearMessages({ apiUrl, body, fetchOptions, }: import('./types/data/api').FetchFunctionsProps<{
84
- orderFormId?: string | null | undefined;
85
- }>): Promise<Record<string, any>>;
86
- updateOrderFormOffering({ apiUrl, body, fetchOptions }: import('./types/data/api').FetchFunctionsProps<{
87
- id?: string | null | undefined;
88
- remove?: boolean | null | undefined;
89
- orderFormId?: string | null | undefined;
90
- itemIndex?: number | null | undefined;
91
- }>): Promise<Record<string, any>>;
92
- getOrderForm({ apiUrl, body, fetchOptions, extraData, }: import('./types/data/api').FetchFunctionsProps<{
93
- orderFormId?: string | null | undefined;
94
- }>): Promise<Record<string, any>>;
95
- postOrderFormAttachClientProfileData({ apiUrl, body, fetchOptions, }: import('./types/data/api').FetchFunctionsProps<{
96
- orderFormId?: string | null | undefined;
97
- phone?: string | undefined;
98
- document: string;
99
- email: string;
100
- firstName: string;
101
- lastName: string;
102
- documentType: string;
103
- }>): Promise<Record<string, any>>;
104
- getMasterDataSellerCode({ apiUrl, body, fetchOptions, }: import('./types/data/api').FetchFunctionsProps<{
105
- sellerCode?: string | null | undefined;
106
- }>): Promise<Record<string, any>>;
107
- postOrderFormAttachShippingData({ apiUrl, body, fetchOptions, }: import('./types/data/api').FetchFunctionsProps<{
108
- postalCode?: string | null | undefined;
109
- orderFormId?: string | null | undefined;
110
- country: string;
111
- }>): Promise<Record<string, any>>;
112
- postOrderFormUpdateShippingData({ apiUrl, body, fetchOptions }: import('./types/data/api').FetchFunctionsProps<{
113
- options?: {
114
- itemIndex?: number | undefined;
115
- selectedDeliveryChannel?: string | undefined;
116
- selectedSla?: string | undefined;
117
- }[] | undefined;
118
- orderFormId?: string | null | undefined;
119
- selectedAddresses?: {
120
- number?: string | null | undefined;
121
- state?: string | null | undefined;
122
- city?: string | null | undefined;
123
- complement?: string | null | undefined;
124
- neighborhood?: string | null | undefined;
125
- receiverName?: string | null | undefined;
126
- reference?: string | null | undefined;
127
- street?: string | null | undefined;
128
- country: string;
129
- postalCode: string;
130
- addressId: string;
131
- addressType: string;
132
- geoCoordinates: (number | undefined)[];
133
- isDisposable: NonNullable<boolean | undefined>;
134
- }[] | undefined;
135
- }>): Promise<Record<string, any>>;
136
- postOrderFormRegion({ apiUrl, body, fetchOptions }: import('./types/data/api').FetchFunctionsProps<{
137
- postalCode?: string | null | undefined;
138
- country: string;
139
- geoCoordinates: {
140
- longitude: number;
141
- latitude: number;
142
- };
143
- }>): Promise<Record<string, any>>;
144
- postOrderFormFreightSimulation({ apiUrl, body, fetchOptions }: import('./types/data/api').FetchFunctionsProps<{
145
- items?: {
146
- seller?: string | undefined;
147
- id: string;
148
- quantity: number;
149
- }[] | undefined;
150
- postalCode?: string | null | undefined;
151
- geoCoordinates?: (number | undefined)[] | null | undefined;
152
- country: string;
153
- }>): Promise<Record<string, any>>;
154
- };
155
- cms: typeof cmsAPIs;
6
+ checkout: typeof checkout;
7
+ catalog: typeof catalog;
8
+ cms: typeof cms;
156
9
  };
157
- export { serverAPIs };
10
+ declare const serverHelpers: {
11
+ catalog: typeof catalogHelpers;
12
+ };
13
+ export { serverAPIs, serverHelpers };
File without changes
@@ -0,0 +1,26 @@
1
+ export type PortalPageType = CollectionPageType | FallbackPageType;
2
+ export declare enum PageType {
3
+ Brand = "Brand",
4
+ Category = "Category",
5
+ Department = "Department",
6
+ SubCategory = "SubCategory",
7
+ Product = "Product",
8
+ Collection = "Collection",
9
+ Cluster = "Cluster"
10
+ }
11
+ export interface CollectionPageType {
12
+ id: number;
13
+ name: string;
14
+ url: string;
15
+ title: string;
16
+ metaTagDescription: string;
17
+ pageType: PageType;
18
+ }
19
+ export interface FallbackPageType {
20
+ id: null;
21
+ name: null | string;
22
+ url: null | string;
23
+ title: null;
24
+ metaTagDescription: null;
25
+ pageType: 'NotFound' | 'FullText';
26
+ }
@@ -0,0 +1,50 @@
1
+ export type SimilarType = {
2
+ productId: string;
3
+ slug: string;
4
+ textureImage: string;
5
+ textureAlt: string;
6
+ };
7
+ export interface SimilarsResponseData {
8
+ items: Array<{
9
+ sellers: Array<{
10
+ commertialOffer: {
11
+ IsAvailable: boolean;
12
+ };
13
+ }>;
14
+ images: Array<{
15
+ imageLabel: string;
16
+ imageUrl: string;
17
+ imageText: string;
18
+ }>;
19
+ }>;
20
+ productId: string;
21
+ linkText: string;
22
+ }
23
+ export interface CategoryTree {
24
+ id: number;
25
+ name: string;
26
+ hasChildren: boolean;
27
+ url: string;
28
+ children: CategoryTree[];
29
+ Title: string;
30
+ MetaTagDescription: string;
31
+ }
32
+ type SEOType = Record<string, string>;
33
+ export interface CreateSeoCategoryProps {
34
+ category: CategoryTree | null;
35
+ previousImages: any;
36
+ canonical: string;
37
+ seo: SEOType;
38
+ }
39
+ export interface CreateEmptySeoCategoryProps {
40
+ slug: string | string[];
41
+ canonical: string;
42
+ seo: SEOType;
43
+ }
44
+ export interface FindCategoryProps {
45
+ items: CategoryTree[];
46
+ parent: string;
47
+ apiUrl: string;
48
+ find?: string;
49
+ }
50
+ export {};
@@ -1,16 +1,13 @@
1
1
  export interface FetchOptions {
2
2
  method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
3
3
  body?: Record<string, unknown>;
4
- headers?: Record<string, string> & {
5
- 'REST-Range'?: string;
6
- 'X-VTEX-API-AppKey'?: string;
7
- 'X-VTEX-API-AppToken'?: string;
8
- };
4
+ headers?: Record<string, string>;
9
5
  skipSanitize?: boolean;
6
+ priority?: 'low' | 'auto' | 'high';
10
7
  }
11
8
  export interface FetchFunctionsProps<T> {
12
9
  apiUrl: string;
13
- body: T;
14
10
  fetchOptions?: FetchOptions;
15
11
  extraData?: any;
12
+ body?: T;
16
13
  }
@@ -1,25 +1,7 @@
1
1
  import { TagProps } from '@soma-vertical-web/core-components/src/lib/Tag/interfaces';
2
2
  import { Dispatch, MutableRefObject, ReactNode, SetStateAction } from 'react';
3
+ import { FREIGHT_CALCULATIONType } from '../../../constants';
3
4
 
4
- export interface FreightConfigType {
5
- messages: {
6
- free_tax: string;
7
- unit_amout: string;
8
- title: string;
9
- prefix_days: string;
10
- remember_cep: string;
11
- delivered_by: string;
12
- delivered_amount_packages: string;
13
- text_input_label: string;
14
- text_input_btn: string;
15
- cep_not_found: string;
16
- select_size_tag: string;
17
- };
18
- icons: {
19
- delivery_truck: string;
20
- feedback_help: string;
21
- };
22
- }
23
5
  export interface FreightOption {
24
6
  id: string;
25
7
  name: string;
@@ -34,7 +16,7 @@ export interface PostalCodeInputProps {
34
16
  setError: Dispatch<SetStateAction<string>>;
35
17
  setIsButtonClicked: Dispatch<SetStateAction<boolean>>;
36
18
  onUpdateFreightItems: (items: any[]) => void;
37
- freightConfig: FreightConfigType;
19
+ freightConfig: FREIGHT_CALCULATIONType;
38
20
  toolTipZIndex: number;
39
21
  local?: string;
40
22
  component?: ReactNode;
@@ -49,7 +31,7 @@ export interface DeliveryStatusBarProps {
49
31
  setError?: Dispatch<SetStateAction<string>>;
50
32
  }
51
33
  export interface DeliveryInfoProps {
52
- freightConfig: FreightConfigType;
34
+ freightConfig: FREIGHT_CALCULATIONType;
53
35
  toolTipZIndex: number;
54
36
  icon: string;
55
37
  title: string;
@@ -78,7 +60,7 @@ export interface ShippingFreightContainerProps {
78
60
  }
79
61
  export interface ShippingFreightProps {
80
62
  children?: ReactNode;
81
- freightConfig: FreightConfigType;
63
+ freightConfig: FREIGHT_CALCULATIONType;
82
64
  }
83
65
  export interface FreightCalculationProps {
84
66
  size: TagProps['size'];
@@ -87,7 +69,7 @@ export interface FreightCalculationProps {
87
69
  skuId: string;
88
70
  quantity: number;
89
71
  CONSTANTS_PROPS: {
90
- freightConfig: FreightConfigType;
72
+ freightConfig: FREIGHT_CALCULATIONType;
91
73
  toolTipZIndex: number;
92
74
  deliveryInfoBoxesAllowed?: boolean;
93
75
  currency?: string;
@@ -290,7 +272,7 @@ export interface ShippingSimulationResponse {
290
272
  export interface FreightTooltipProps {
291
273
  parent: HTMLElement;
292
274
  isOpen: boolean;
293
- freightConfig: FreightConfigType;
275
+ freightConfig: FREIGHT_CALCULATIONType;
294
276
  toolTipZIndex: number;
295
277
  contentRef?: MutableRefObject<HTMLDivElement | null>;
296
278
  left?: number;
@@ -1,7 +1,7 @@
1
1
  import { ToggleSizeProps } from '@soma-vertical-web/core-components/src/lib/ToggleSize/interfaces';
2
- import { SimilarType } from '../../../../../data/api/catalog/product/similars';
3
2
  import { HasVariant, ProductType_PDC } from '../../../../global/product';
4
3
  import { HTMLAttributes } from 'react';
4
+ import { SimilarType } from '../../../../data/api/catalog/product';
5
5
 
6
6
  export interface ProductSize {
7
7
  label: string;