@soma-vertical-web/multi-lib 0.0.26 → 0.0.28
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/contexts/contexts/GlobalContext.d.ts +1 -1
- package/contexts/index.d.ts +1 -1
- package/data/api/checkout/address/index.d.ts +21 -0
- package/data/api/checkout/index.d.ts +4 -0
- package/data/api/checkout/order-form/attachments/index.d.ts +17 -0
- package/data/api/checkout/order-form/attachments/marketing-data/index.d.ts +21 -0
- package/data/api/checkout/order-form/attachments/open-text-field/index.d.ts +18 -0
- package/data/api/checkout/order-form/coupon/index.d.ts +15 -0
- package/data/api/checkout/order-form/custom-data/index.d.ts +17 -0
- package/data/api/checkout/order-form/index.d.ts +14 -0
- package/data/api/checkout/order-form/items/remove-all/index.d.ts +13 -0
- package/data/api/checkout/order-form/items/update/index.d.ts +43 -0
- package/data/api/checkout/order-form/messages/remove-all/index.d.ts +13 -0
- package/data/api/checkout/order-form/offerings/index.d.ts +19 -0
- package/data/api/checkout/order-form/orderform/index.d.ts +14 -0
- package/data/api/checkout/order-form/profile/index.d.ts +25 -0
- package/data/api/checkout/order-form/seller-code/index.d.ts +13 -0
- package/data/api/checkout/order-form/shipping/index.d.ts +17 -0
- package/data/api/checkout/order-form/shipping/update/index.d.ts +36 -0
- package/data/api/checkout/region/index.d.ts +33 -0
- package/data/api/checkout/simulation/index.d.ts +20 -7
- package/data/api/fetchVtex.d.ts +2 -10
- package/data/helpers/cart/index.d.ts +4 -4
- package/index.js +17 -17
- package/index.mjs +3978 -3648
- package/index2.js +1 -1
- package/index2.mjs +455 -75
- package/layout/index.d.ts +1 -0
- package/package.json +1 -1
- package/server.d.ts +150 -3
- package/style.css +1 -1
- package/types/constants.d.ts +2 -3
- package/types/contexts/contexts/global.d.ts +0 -1
- package/types/contexts/store/cart.d.ts +4 -0
- package/types/data/api/index.d.ts +16 -0
|
@@ -7,6 +7,6 @@ export declare class Mediator {
|
|
|
7
7
|
publish<T>(event: string, data: T): void;
|
|
8
8
|
}
|
|
9
9
|
declare const GlobalContext: import('react').Context<GlobalContextProps>;
|
|
10
|
-
declare const GlobalProvider: ({ children, headerConfigs, pathname,
|
|
10
|
+
declare const GlobalProvider: ({ children, headerConfigs, pathname, ...props }: GlobalProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
declare const useGlobalContext: () => GlobalContextProps;
|
|
12
12
|
export { GlobalContext, GlobalProvider, useGlobalContext };
|
package/contexts/index.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export declare const contexts: {
|
|
|
47
47
|
};
|
|
48
48
|
global: {
|
|
49
49
|
hook: () => import('../types/contexts/contexts/global').GlobalContextProps;
|
|
50
|
-
provider: ({ children, headerConfigs, pathname,
|
|
50
|
+
provider: ({ children, headerConfigs, pathname, ...props }: import('../types/contexts/contexts/global').GlobalProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
51
51
|
mediator: typeof Mediator;
|
|
52
52
|
};
|
|
53
53
|
header: {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FetchFunctionsProps } from '../../../../types/data/api';
|
|
2
|
+
import * as yup from 'yup';
|
|
3
|
+
export declare const schemaAddress: yup.ObjectSchema<{
|
|
4
|
+
country: string;
|
|
5
|
+
postalCode: string | null | undefined;
|
|
6
|
+
}, yup.AnyObject, {
|
|
7
|
+
country: undefined;
|
|
8
|
+
postalCode: undefined;
|
|
9
|
+
}, "">;
|
|
10
|
+
type SchemaType = yup.InferType<typeof schemaAddress>;
|
|
11
|
+
/**
|
|
12
|
+
* This endpoint retrieves address information for a given postal code and country.
|
|
13
|
+
* https://developers.vtex.com/docs/api-reference/checkout-api?endpoint=get-/api/checkout/pub/postal-code/-countryCode-/-postalCode-
|
|
14
|
+
*
|
|
15
|
+
* @param req The Next.js API request object.
|
|
16
|
+
* @param res The Next.js API response object.
|
|
17
|
+
* @returns Address information corresponding to the provided postal code and country.
|
|
18
|
+
* This request is useful for implementing auto-complete functionality when a customer needs to fill in an address.
|
|
19
|
+
*/
|
|
20
|
+
export declare function postOrderformAddress({ apiUrl, body, fetchOptions }: FetchFunctionsProps<SchemaType>): Promise<Record<string, any>>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FetchFunctionsProps } from '../../../../../types/data/api';
|
|
2
|
+
import * as yup from 'yup';
|
|
3
|
+
export declare const schemaAttachments: yup.ObjectSchema<{
|
|
4
|
+
orderFormId: string | null | undefined;
|
|
5
|
+
sellerCode: string | null | undefined;
|
|
6
|
+
sellerName: string | null | undefined;
|
|
7
|
+
}, yup.AnyObject, {
|
|
8
|
+
orderFormId: undefined;
|
|
9
|
+
sellerCode: undefined;
|
|
10
|
+
sellerName: undefined;
|
|
11
|
+
}, "">;
|
|
12
|
+
type SchemaType = yup.InferType<typeof schemaAttachments>;
|
|
13
|
+
/**
|
|
14
|
+
* Attach marketing and open text field data to a shopping cart.
|
|
15
|
+
*/
|
|
16
|
+
export declare function postOrderFormAttachOrderFormData({ apiUrl, body, fetchOptions }: FetchFunctionsProps<SchemaType>): Promise<Record<string, any>>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FetchFunctionsProps } from '../../../../../../types/data/api';
|
|
2
|
+
import * as yup from 'yup';
|
|
3
|
+
declare const schemaMarketingData: yup.ObjectSchema<{
|
|
4
|
+
orderFormId: string | null | undefined;
|
|
5
|
+
sellerCode: string | null | undefined;
|
|
6
|
+
marketingData: {};
|
|
7
|
+
}, yup.AnyObject, {
|
|
8
|
+
orderFormId: undefined;
|
|
9
|
+
sellerCode: undefined;
|
|
10
|
+
marketingData: {};
|
|
11
|
+
}, "">;
|
|
12
|
+
type SchemaType = yup.InferType<typeof schemaMarketingData>;
|
|
13
|
+
/**
|
|
14
|
+
* Use this request to include marketing information to a given shopping cart.
|
|
15
|
+
* https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pub/orderForm/-orderFormId-/attachments/marketingData
|
|
16
|
+
*
|
|
17
|
+
* @returns A list of sellers that cater to the specified region or address.
|
|
18
|
+
* This endpoint provides flexibility in accessing seller information based on region or address, allowing you to choose between path parameters or query parameters.
|
|
19
|
+
*/
|
|
20
|
+
export declare function postOrderFormAttachmentsMarketingData({ apiUrl, body, fetchOptions }: FetchFunctionsProps<SchemaType>): Promise<Record<string, any>>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FetchFunctionsProps } from '../../../../../../types/data/api';
|
|
2
|
+
import * as yup from 'yup';
|
|
3
|
+
declare const schemaOpenTextField: yup.ObjectSchema<{
|
|
4
|
+
orderFormId: string | null | undefined;
|
|
5
|
+
sellerCode: string | null | undefined;
|
|
6
|
+
sellerName: string | null | undefined;
|
|
7
|
+
}, yup.AnyObject, {
|
|
8
|
+
orderFormId: undefined;
|
|
9
|
+
sellerCode: undefined;
|
|
10
|
+
sellerName: undefined;
|
|
11
|
+
}, "">;
|
|
12
|
+
type SchemaType = yup.InferType<typeof schemaOpenTextField>;
|
|
13
|
+
/**
|
|
14
|
+
* Use this request to include open text field information to a given shopping cart.
|
|
15
|
+
* https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pub/orderForm/-orderFormId-/attachments/openTextField
|
|
16
|
+
*/
|
|
17
|
+
export declare function postOrderFormAttachmentsOpenTextField({ apiUrl, body, fetchOptions, }: FetchFunctionsProps<SchemaType>): Promise<Record<string, any>>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FetchFunctionsProps } from '../../../../../types/data/api';
|
|
2
|
+
import * as yup from 'yup';
|
|
3
|
+
declare const schemaCoupon: yup.ObjectSchema<{
|
|
4
|
+
orderFormId: string | null | undefined;
|
|
5
|
+
coupon: string | null | undefined;
|
|
6
|
+
}, yup.AnyObject, {
|
|
7
|
+
orderFormId: undefined;
|
|
8
|
+
coupon: undefined;
|
|
9
|
+
}, "">;
|
|
10
|
+
type SchemaType = yup.InferType<typeof schemaCoupon>;
|
|
11
|
+
/**
|
|
12
|
+
* Add a coupon to a given shopping cart.
|
|
13
|
+
*/
|
|
14
|
+
export declare function postOrderFormAddCoupon({ apiUrl, body, fetchOptions, }: FetchFunctionsProps<SchemaType>): Promise<Record<string, any>>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FetchFunctionsProps } from '../../../../../types/data/api';
|
|
2
|
+
import * as yup from 'yup';
|
|
3
|
+
declare const schemaCustomData: yup.ObjectSchema<{
|
|
4
|
+
appId: string;
|
|
5
|
+
orderFormId: string | null | undefined;
|
|
6
|
+
key: (string | undefined)[] | undefined;
|
|
7
|
+
}, yup.AnyObject, {
|
|
8
|
+
appId: undefined;
|
|
9
|
+
orderFormId: undefined;
|
|
10
|
+
key: "";
|
|
11
|
+
}, "">;
|
|
12
|
+
type SchemaType = yup.InferType<typeof schemaCustomData>;
|
|
13
|
+
/**
|
|
14
|
+
* Update custom data for an order form app.
|
|
15
|
+
*/
|
|
16
|
+
export declare function putOrderFormCustomData({ apiUrl, body, fetchOptions, }: FetchFunctionsProps<SchemaType>): Promise<Record<string, any>>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './attachments';
|
|
2
|
+
export * from './attachments/marketing-data';
|
|
3
|
+
export * from './attachments/open-text-field';
|
|
4
|
+
export * from './coupon';
|
|
5
|
+
export * from './custom-data';
|
|
6
|
+
export * from './items/remove-all';
|
|
7
|
+
export * from './items/update';
|
|
8
|
+
export * from './messages/remove-all';
|
|
9
|
+
export * from './offerings';
|
|
10
|
+
export * from './orderform';
|
|
11
|
+
export * from './profile';
|
|
12
|
+
export * from './seller-code';
|
|
13
|
+
export * from './shipping';
|
|
14
|
+
export * from './shipping/update';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FetchFunctionsProps } from '../../../../../../types/data/api';
|
|
2
|
+
import * as yup from 'yup';
|
|
3
|
+
declare const schemaItems: yup.ObjectSchema<{
|
|
4
|
+
orderFormId: string | null | undefined;
|
|
5
|
+
}, yup.AnyObject, {
|
|
6
|
+
orderFormId: undefined;
|
|
7
|
+
}, "">;
|
|
8
|
+
type SchemaType = yup.InferType<typeof schemaItems>;
|
|
9
|
+
/**
|
|
10
|
+
* Remove all items from the shopping cart.
|
|
11
|
+
*/
|
|
12
|
+
export declare function postOrderFormRemoveAllItems({ apiUrl, body, fetchOptions, }: FetchFunctionsProps<SchemaType>): Promise<Record<string, any>>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { FetchFunctionsProps } from '../../../../../../types/data/api';
|
|
2
|
+
import * as yup from 'yup';
|
|
3
|
+
export declare const schemaItem: yup.ObjectSchema<{
|
|
4
|
+
attachments: {
|
|
5
|
+
name: string;
|
|
6
|
+
content: {} | null;
|
|
7
|
+
}[] | null | undefined;
|
|
8
|
+
id: string;
|
|
9
|
+
index: number | null | undefined;
|
|
10
|
+
quantity: number | null | undefined;
|
|
11
|
+
seller: string;
|
|
12
|
+
price: number | undefined;
|
|
13
|
+
}, yup.AnyObject, {
|
|
14
|
+
attachments: "";
|
|
15
|
+
id: undefined;
|
|
16
|
+
index: undefined;
|
|
17
|
+
quantity: undefined;
|
|
18
|
+
seller: undefined;
|
|
19
|
+
price: undefined;
|
|
20
|
+
}, "">;
|
|
21
|
+
declare const schemaItems: yup.ObjectSchema<{
|
|
22
|
+
orderFormId: string | null | undefined;
|
|
23
|
+
orderItems: {
|
|
24
|
+
quantity?: number | null | undefined;
|
|
25
|
+
price?: number | undefined;
|
|
26
|
+
index?: number | null | undefined;
|
|
27
|
+
attachments?: {
|
|
28
|
+
name: string;
|
|
29
|
+
content: {} | null;
|
|
30
|
+
}[] | null | undefined;
|
|
31
|
+
seller: string;
|
|
32
|
+
id: string;
|
|
33
|
+
}[] | undefined;
|
|
34
|
+
}, yup.AnyObject, {
|
|
35
|
+
orderFormId: undefined;
|
|
36
|
+
orderItems: "";
|
|
37
|
+
}, "">;
|
|
38
|
+
type SchemaType = yup.InferType<typeof schemaItems>;
|
|
39
|
+
/**
|
|
40
|
+
* Update items in the shopping cart.
|
|
41
|
+
*/
|
|
42
|
+
export declare function postOrderFormUpdateItems({ apiUrl, body, fetchOptions, }: FetchFunctionsProps<SchemaType>): Promise<Record<string, any>>;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FetchFunctionsProps } from '../../../../../../types/data/api';
|
|
2
|
+
import * as yup from 'yup';
|
|
3
|
+
declare const schemaMessage: yup.ObjectSchema<{
|
|
4
|
+
orderFormId: string | null | undefined;
|
|
5
|
+
}, yup.AnyObject, {
|
|
6
|
+
orderFormId: undefined;
|
|
7
|
+
}, "">;
|
|
8
|
+
type SchemaType = yup.InferType<typeof schemaMessage>;
|
|
9
|
+
/**
|
|
10
|
+
* Remove all messages from the orderForm messages field.
|
|
11
|
+
*/
|
|
12
|
+
export declare function postOrderFormClearMessages({ apiUrl, body, fetchOptions, }: FetchFunctionsProps<SchemaType>): Promise<Record<string, any>>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FetchFunctionsProps } from '../../../../../types/data/api';
|
|
2
|
+
import * as yup from 'yup';
|
|
3
|
+
declare const schemaOffering: yup.ObjectSchema<{
|
|
4
|
+
id: string | null | undefined;
|
|
5
|
+
itemIndex: number | null | undefined;
|
|
6
|
+
orderFormId: string | null | undefined;
|
|
7
|
+
remove: boolean | null | undefined;
|
|
8
|
+
}, yup.AnyObject, {
|
|
9
|
+
id: undefined;
|
|
10
|
+
itemIndex: undefined;
|
|
11
|
+
orderFormId: undefined;
|
|
12
|
+
remove: undefined;
|
|
13
|
+
}, "">;
|
|
14
|
+
type SchemaType = yup.InferType<typeof schemaOffering>;
|
|
15
|
+
/**
|
|
16
|
+
* Add or remove a service (offering) to a specific item in the shopping cart.
|
|
17
|
+
*/
|
|
18
|
+
export declare function updateOrderFormOffering({ apiUrl, body, fetchOptions }: FetchFunctionsProps<SchemaType>): Promise<Record<string, any>>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FetchFunctionsProps } from '../../../../../types/data/api';
|
|
2
|
+
import * as yup from 'yup';
|
|
3
|
+
declare const schemaOrderForm: yup.ObjectSchema<{
|
|
4
|
+
orderFormId: string | null | undefined;
|
|
5
|
+
}, yup.AnyObject, {
|
|
6
|
+
orderFormId: undefined;
|
|
7
|
+
}, "">;
|
|
8
|
+
type SchemaType = yup.InferType<typeof schemaOrderForm>;
|
|
9
|
+
/**
|
|
10
|
+
* Retrieves all information associated with a given shopping cart.
|
|
11
|
+
* https://developers.vtex.com/docs/api-reference/checkout-api#get-/api/checkout/pub/orderForm/-orderFormId-
|
|
12
|
+
*/
|
|
13
|
+
export declare function getOrderForm({ apiUrl, body, fetchOptions, extraData, }: FetchFunctionsProps<SchemaType>): Promise<Record<string, any>>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FetchFunctionsProps } from '../../../../../types/data/api';
|
|
2
|
+
import * as yup from 'yup';
|
|
3
|
+
declare const schemaProfile: yup.ObjectSchema<{
|
|
4
|
+
orderFormId: string | null | undefined;
|
|
5
|
+
email: string;
|
|
6
|
+
firstName: string;
|
|
7
|
+
lastName: string;
|
|
8
|
+
documentType: string;
|
|
9
|
+
document: string;
|
|
10
|
+
phone: string | undefined;
|
|
11
|
+
}, yup.AnyObject, {
|
|
12
|
+
orderFormId: undefined;
|
|
13
|
+
email: undefined;
|
|
14
|
+
firstName: undefined;
|
|
15
|
+
lastName: undefined;
|
|
16
|
+
documentType: undefined;
|
|
17
|
+
document: undefined;
|
|
18
|
+
phone: undefined;
|
|
19
|
+
}, "">;
|
|
20
|
+
type SchemaType = yup.InferType<typeof schemaProfile>;
|
|
21
|
+
/**
|
|
22
|
+
* Attach client profile data to a shopping cart.
|
|
23
|
+
*/
|
|
24
|
+
export declare function postOrderFormAttachClientProfileData({ apiUrl, body, fetchOptions, }: FetchFunctionsProps<SchemaType>): Promise<Record<string, any>>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FetchFunctionsProps } from '../../../../../types/data/api';
|
|
2
|
+
import * as yup from 'yup';
|
|
3
|
+
declare const schemaSellerCode: yup.ObjectSchema<{
|
|
4
|
+
sellerCode: string | null | undefined;
|
|
5
|
+
}, yup.AnyObject, {
|
|
6
|
+
sellerCode: undefined;
|
|
7
|
+
}, "">;
|
|
8
|
+
type SchemaType = yup.InferType<typeof schemaSellerCode>;
|
|
9
|
+
/**
|
|
10
|
+
* Fetch seller code data from VTEX data entities.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getMasterDataSellerCode({ apiUrl, body, fetchOptions, }: FetchFunctionsProps<SchemaType>): Promise<Record<string, any>>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FetchFunctionsProps } from '../../../../../types/data/api';
|
|
2
|
+
import * as yup from 'yup';
|
|
3
|
+
declare const schemaShipping: yup.ObjectSchema<{
|
|
4
|
+
country: string;
|
|
5
|
+
orderFormId: string | null | undefined;
|
|
6
|
+
postalCode: string | null | undefined;
|
|
7
|
+
}, yup.AnyObject, {
|
|
8
|
+
country: undefined;
|
|
9
|
+
orderFormId: undefined;
|
|
10
|
+
postalCode: undefined;
|
|
11
|
+
}, "">;
|
|
12
|
+
type SchemaType = yup.InferType<typeof schemaShipping>;
|
|
13
|
+
/**
|
|
14
|
+
* Attach shipping data to a shopping cart.
|
|
15
|
+
*/
|
|
16
|
+
export declare function postOrderFormAttachShippingData({ apiUrl, body, fetchOptions, }: FetchFunctionsProps<SchemaType>): Promise<Record<string, any>>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { FetchFunctionsProps } from '../../../../../../types/data/api';
|
|
2
|
+
import * as yup from 'yup';
|
|
3
|
+
declare const schemaShipping: yup.ObjectSchema<{
|
|
4
|
+
orderFormId: string | null | undefined;
|
|
5
|
+
options: {
|
|
6
|
+
itemIndex?: number | undefined;
|
|
7
|
+
selectedDeliveryChannel?: string | undefined;
|
|
8
|
+
selectedSla?: string | undefined;
|
|
9
|
+
}[] | undefined;
|
|
10
|
+
selectedAddresses: {
|
|
11
|
+
number?: string | null | undefined;
|
|
12
|
+
state?: string | null | undefined;
|
|
13
|
+
city?: string | null | undefined;
|
|
14
|
+
complement?: string | null | undefined;
|
|
15
|
+
neighborhood?: string | null | undefined;
|
|
16
|
+
receiverName?: string | null | undefined;
|
|
17
|
+
reference?: string | null | undefined;
|
|
18
|
+
street?: string | null | undefined;
|
|
19
|
+
country: string;
|
|
20
|
+
postalCode: string;
|
|
21
|
+
addressId: string;
|
|
22
|
+
addressType: string;
|
|
23
|
+
geoCoordinates: (number | undefined)[];
|
|
24
|
+
isDisposable: NonNullable<boolean | undefined>;
|
|
25
|
+
}[] | undefined;
|
|
26
|
+
}, yup.AnyObject, {
|
|
27
|
+
orderFormId: undefined;
|
|
28
|
+
options: "";
|
|
29
|
+
selectedAddresses: "";
|
|
30
|
+
}, "">;
|
|
31
|
+
type SchemaType = yup.InferType<typeof schemaShipping>;
|
|
32
|
+
/**
|
|
33
|
+
* Attach shipping data with options and addresses to a shopping cart.
|
|
34
|
+
*/
|
|
35
|
+
export declare function postOrderFormUpdateShippingData({ apiUrl, body, fetchOptions }: FetchFunctionsProps<SchemaType>): Promise<Record<string, any>>;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { FetchFunctionsProps } from '../../../../types/data/api';
|
|
2
|
+
import * as yup from 'yup';
|
|
3
|
+
declare const schemaRegion: yup.ObjectSchema<{
|
|
4
|
+
country: string;
|
|
5
|
+
postalCode: string | null | undefined;
|
|
6
|
+
geoCoordinates: {
|
|
7
|
+
longitude: number;
|
|
8
|
+
latitude: number;
|
|
9
|
+
};
|
|
10
|
+
}, yup.AnyObject, {
|
|
11
|
+
country: undefined;
|
|
12
|
+
postalCode: undefined;
|
|
13
|
+
geoCoordinates: {
|
|
14
|
+
longitude: undefined;
|
|
15
|
+
latitude: undefined;
|
|
16
|
+
};
|
|
17
|
+
}, "">;
|
|
18
|
+
type SchemaType = yup.InferType<typeof schemaRegion>;
|
|
19
|
+
/**
|
|
20
|
+
* Retrieves a list of sellers that cater to a specific region or address, according to your setup of our regionalization feature.
|
|
21
|
+
* https://developers.vtex.com/docs/api-reference/checkout-api#get-/api/checkout/pub/regions/-regionId-
|
|
22
|
+
*
|
|
23
|
+
* To access the list of sellers, you must choose one of the following methods:
|
|
24
|
+
* 1. Send the identification of the list of sellers (regionId) as a path parameter through the URL.
|
|
25
|
+
* 2. Send the country (3-digit ISO code) and at least one of the two values (postal Code or geo Coordinates) as query parameters through the URL.
|
|
26
|
+
* For this method, it is also allowed to send both values (postalCode or geoCoordinates) in the same request.
|
|
27
|
+
*
|
|
28
|
+
* @param regionId.
|
|
29
|
+
* @returns A list of sellers that cater to the specified region or address.
|
|
30
|
+
* This endpoint provides flexibility in accessing seller information based on region or address, allowing you to choose between path parameters or query parameters.
|
|
31
|
+
*/
|
|
32
|
+
export declare function postOrderFormRegion({ apiUrl, body, fetchOptions }: FetchFunctionsProps<SchemaType>): Promise<Record<string, any>>;
|
|
33
|
+
export {};
|
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { FetchFunctionsProps } from '../../../../types/data/api';
|
|
2
|
+
import * as yup from 'yup';
|
|
3
|
+
declare const schemaSimulation: yup.ObjectSchema<{
|
|
4
|
+
items: {
|
|
5
|
+
seller?: string | undefined;
|
|
6
|
+
id: string;
|
|
7
|
+
quantity: number;
|
|
8
|
+
}[] | undefined;
|
|
9
|
+
country: string;
|
|
10
|
+
postalCode: string | null | undefined;
|
|
11
|
+
geoCoordinates: (number | undefined)[] | null | undefined;
|
|
12
|
+
}, yup.AnyObject, {
|
|
13
|
+
items: "";
|
|
14
|
+
country: undefined;
|
|
15
|
+
postalCode: undefined;
|
|
16
|
+
geoCoordinates: "";
|
|
17
|
+
}, "">;
|
|
18
|
+
type SchemaType = yup.InferType<typeof schemaSimulation>;
|
|
3
19
|
/**
|
|
4
20
|
* This function performs a request to the API to simulate a cart in VTEX Checkout.
|
|
5
21
|
* https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pub/orderForms/simulation
|
|
@@ -10,8 +26,5 @@ import { FetchOptions } from '../../fetchVtex';
|
|
|
10
26
|
* @returns All information about the cart, including selling price of each item, pricing and promotion data, payment and logistics info.
|
|
11
27
|
* This request is useful whenever you need to know the availability of fulfilling an order for a specific cart setting, since the API response will let you know the updated price, inventory, and shipping data.
|
|
12
28
|
*/
|
|
13
|
-
export declare function
|
|
14
|
-
|
|
15
|
-
body: any;
|
|
16
|
-
options: FetchOptions;
|
|
17
|
-
}): Promise<Record<string, any>>;
|
|
29
|
+
export declare function postOrderFormFreightSimulation({ apiUrl, body, fetchOptions }: FetchFunctionsProps<SchemaType>): Promise<Record<string, any>>;
|
|
30
|
+
export {};
|
package/data/api/fetchVtex.d.ts
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
};
|
|
9
|
-
skipSanitize?: boolean;
|
|
10
|
-
}
|
|
1
|
+
import { FetchOptions } from '../../types/data/api';
|
|
2
|
+
|
|
11
3
|
export declare const fetchVtex: (url: string, options?: FetchOptions) => Promise<Record<string, any>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FetchPriority } from '../../../types/contexts/hooks';
|
|
2
2
|
import { OrderFormItem, OrderForm } from '../../../types/data/api/checkout/order-form';
|
|
3
|
-
import { AddToCart, CartItem, CartItemOptionalProps, CartItemStore, NotificationsStore, OptionalOrderForm } from '../../../types/contexts/store/cart';
|
|
3
|
+
import { AddToCart, CartItem, CartItemOptionalProps, CartItemStore, OrderFormConstants, NotificationsStore, OptionalOrderForm } from '../../../types/contexts/store/cart';
|
|
4
4
|
|
|
5
5
|
export declare const VALUE_REFERENCES: {
|
|
6
6
|
readonly attachment: "ATTACHMENT";
|
|
@@ -39,7 +39,7 @@ export declare const isGift: (price: number) => price is 0;
|
|
|
39
39
|
export declare const getCategories: (productCategoryIds: string, productCategories: {
|
|
40
40
|
[key: string]: string;
|
|
41
41
|
}) => string[];
|
|
42
|
-
export declare const createItemOrder: (item: OrderFormItem) => CartItemStore;
|
|
42
|
+
export declare const createItemOrder: (item: OrderFormItem, CONSTANTS?: OrderFormConstants) => CartItemStore;
|
|
43
43
|
export declare const addItemOrder: (items: CartItemStore[], item: AddToCart | AddToCart[]) => AddToCart[];
|
|
44
44
|
export declare const removeQuantity: (items: CartItemStore[], id: string) => {
|
|
45
45
|
updateItems: {
|
|
@@ -74,7 +74,7 @@ export declare const getTotalizer: (items: CartItemStore[]) => {
|
|
|
74
74
|
subTotal: number;
|
|
75
75
|
};
|
|
76
76
|
export declare const getTotalItems: (items?: CartItemStore[]) => number;
|
|
77
|
-
export declare const orderFormValues: (orderForm: OrderForm) => {
|
|
77
|
+
export declare const orderFormValues: (orderForm: OrderForm, CONSTANTS?: OrderFormConstants) => {
|
|
78
78
|
id: string;
|
|
79
79
|
itemMetadata: {
|
|
80
80
|
items: import('../../../types/data/api/checkout/order-form').MetadataItem[];
|
|
@@ -182,7 +182,7 @@ export declare const mergeOptionsPromise: (res: Promise<Array<CartItemOptionalPr
|
|
|
182
182
|
export declare const fetchCartAPI: (url: string, params: {
|
|
183
183
|
priority?: FetchPriority;
|
|
184
184
|
body: Record<string, unknown>;
|
|
185
|
-
}, skipSanitize?: boolean) => Promise<any>;
|
|
185
|
+
}, skipSanitize?: boolean, CONSTANTS?: OrderFormConstants) => Promise<any>;
|
|
186
186
|
export declare const addNotification: (state: NotificationsStore, message: string, callback?: () => void) => {
|
|
187
187
|
notifications: import('../../../types/contexts/store/cart').Notification[];
|
|
188
188
|
};
|