@soma-vertical-web/multi-lib 0.0.29 → 0.0.31

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 (39) 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 +2 -2
  6. package/data/api/checkout/order-form/attachments/index.d.ts +2 -2
  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/index.d.ts +1 -0
  12. package/data/api/checkout/order-form/items/index.d.ts +23 -0
  13. package/data/api/checkout/order-form/items/remove-all/index.d.ts +1 -1
  14. package/data/api/checkout/order-form/items/update/index.d.ts +1 -19
  15. package/data/api/checkout/order-form/messages/remove-all/index.d.ts +1 -1
  16. package/data/api/checkout/order-form/offerings/index.d.ts +1 -1
  17. package/data/api/checkout/order-form/orderform/index.d.ts +1 -1
  18. package/data/api/checkout/order-form/profile/index.d.ts +1 -1
  19. package/data/api/checkout/order-form/seller-code/index.d.ts +1 -1
  20. package/data/api/checkout/order-form/shipping/index.d.ts +1 -1
  21. package/data/api/checkout/order-form/shipping/update/index.d.ts +1 -1
  22. package/data/api/checkout/region/index.d.ts +1 -1
  23. package/data/api/checkout/simulation/index.d.ts +1 -1
  24. package/data/api/fetchVtex.d.ts +2 -1
  25. package/data/helpers/cart/index.d.ts +1 -1
  26. package/data/helpers/catalog/index.d.ts +38 -0
  27. package/index.js +14 -14
  28. package/index.mjs +1954 -1949
  29. package/index2.js +1 -1
  30. package/index2.mjs +463 -262
  31. package/package.json +1 -1
  32. package/server.d.ts +11 -155
  33. package/types/constants.d.ts +0 -8
  34. package/types/data/api/catalog/kit/index.d.ts +0 -0
  35. package/types/data/api/catalog/portal/index.d.ts +26 -0
  36. package/types/data/api/catalog/product/index.d.ts +50 -0
  37. package/types/data/api/index.d.ts +3 -6
  38. package/types/layout/team-components/ProductCard/Selectors/index.d.ts +1 -1
  39. package/types/data/api/checkout/index.d.ts +0 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soma-vertical-web/multi-lib",
3
- "version": "0.0.29",
3
+ "version": "0.0.31",
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 };
@@ -2,15 +2,7 @@ import { Size } from '@soma-vertical-web/core-components/src/lib/TextField/inter
2
2
  import { EditorState } from 'draft-js';
3
3
  import { CSSProperties } from 'react';
4
4
 
5
- import * as yup from 'yup';
6
5
  export declare const PDPShelfType: readonly ["whosawalsosaw", "whosawalsobought", "whoboughtalsobought", "accessories", "similars", "showtogether", "suggestions"];
7
- export declare const schemaAddress: yup.ObjectSchema<{
8
- country: string;
9
- postalCode: string | null | undefined;
10
- }, yup.AnyObject, {
11
- country: undefined;
12
- postalCode: undefined;
13
- }, "">;
14
6
  export declare const PLP_FILTERS_SORT: {
15
7
  placeholder: string;
16
8
  options: {
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,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;
@@ -1,3 +0,0 @@
1
- import { schemaAddress } from '../../../constants';
2
- import * as yup from 'yup';
3
- export type SchemaAddressType = yup.InferType<typeof schemaAddress>;