@faststore/api 4.4.1-dev.0 → 4.5.0-dev.1
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/dist/cjs/index.js +207 -41
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/index.mjs +1545 -1138
- package/dist/es/index.mjs.map +1 -1
- package/dist/src/__generated__/schema.d.ts +90 -0
- package/dist/src/__generated__/schema.d.ts.map +1 -1
- package/dist/src/platforms/vtex/clients/commerce/Contract.d.ts +1 -0
- package/dist/src/platforms/vtex/clients/commerce/Contract.d.ts.map +1 -1
- package/dist/src/platforms/vtex/clients/commerce/index.d.ts +16 -0
- package/dist/src/platforms/vtex/clients/commerce/index.d.ts.map +1 -1
- package/dist/src/platforms/vtex/clients/commerce/types/Quote.d.ts +26 -0
- package/dist/src/platforms/vtex/clients/commerce/types/Quote.d.ts.map +1 -0
- package/dist/src/platforms/vtex/clients/commerce/types/RecommendationResult.d.ts +25 -0
- package/dist/src/platforms/vtex/clients/commerce/types/RecommendationResult.d.ts.map +1 -0
- package/dist/src/platforms/vtex/clients/commerce/types/Session.d.ts +10 -0
- package/dist/src/platforms/vtex/clients/commerce/types/Session.d.ts.map +1 -1
- package/dist/src/platforms/vtex/clients/index.d.ts +7 -0
- package/dist/src/platforms/vtex/clients/index.d.ts.map +1 -1
- package/dist/src/platforms/vtex/index.d.ts +33 -0
- package/dist/src/platforms/vtex/index.d.ts.map +1 -1
- package/dist/src/platforms/vtex/resolvers/getOrderEntryOperation.d.ts.map +1 -1
- package/dist/src/platforms/vtex/resolvers/index.d.ts +33 -0
- package/dist/src/platforms/vtex/resolvers/index.d.ts.map +1 -1
- package/dist/src/platforms/vtex/resolvers/mutation.d.ts +1 -0
- package/dist/src/platforms/vtex/resolvers/mutation.d.ts.map +1 -1
- package/dist/src/platforms/vtex/resolvers/query.d.ts +33 -1
- package/dist/src/platforms/vtex/resolvers/query.d.ts.map +1 -1
- package/dist/src/platforms/vtex/resolvers/recommendations.d.ts +18 -0
- package/dist/src/platforms/vtex/resolvers/recommendations.d.ts.map +1 -0
- package/dist/src/platforms/vtex/resolvers/startRecommendationSession.d.ts +11 -0
- package/dist/src/platforms/vtex/resolvers/startRecommendationSession.d.ts.map +1 -0
- package/dist/src/platforms/vtex/resolvers/validateSession.d.ts.map +1 -1
- package/dist/src/platforms/vtex/utils/contract.d.ts +59 -0
- package/dist/src/platforms/vtex/utils/contract.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/__generated__/schema.ts +102 -0
- package/src/platforms/vtex/clients/commerce/Contract.ts +1 -0
- package/src/platforms/vtex/clients/commerce/index.ts +188 -3
- package/src/platforms/vtex/clients/commerce/types/Quote.ts +27 -0
- package/src/platforms/vtex/clients/commerce/types/RecommendationResult.ts +27 -0
- package/src/platforms/vtex/clients/commerce/types/Session.ts +9 -0
- package/src/platforms/vtex/resolvers/mutation.ts +2 -0
- package/src/platforms/vtex/resolvers/query.ts +137 -3
- package/src/platforms/vtex/resolvers/recommendations.ts +80 -0
- package/src/platforms/vtex/resolvers/startRecommendationSession.ts +30 -0
- package/src/platforms/vtex/resolvers/validateSession.ts +2 -1
- package/src/platforms/vtex/typeDefs/mutation.graphql +4 -0
- package/src/platforms/vtex/typeDefs/organization.graphql +18 -0
- package/src/platforms/vtex/typeDefs/query.graphql +68 -0
- package/src/platforms/vtex/typeDefs/quote.graphql +65 -0
- package/src/platforms/vtex/typeDefs/recommendation.graphql +11 -0
- package/src/platforms/vtex/utils/contract.ts +144 -0
|
@@ -690,6 +690,8 @@ export type Mutation = {
|
|
|
690
690
|
* Returns an operationId to poll for the operation status.
|
|
691
691
|
*/
|
|
692
692
|
startOrderEntryOperation?: Maybe<StoreOrderEntryOperationResult>;
|
|
693
|
+
/** Starts an anonymous personalization session for the current shopper. */
|
|
694
|
+
startRecommendationSession: Scalars['Boolean']['output'];
|
|
693
695
|
/** Subscribes a new person to the newsletter list. */
|
|
694
696
|
subscribeToNewsletter?: Maybe<PersonNewsletter>;
|
|
695
697
|
/**
|
|
@@ -876,10 +878,20 @@ export type Query = {
|
|
|
876
878
|
allCollections: StoreCollectionConnection;
|
|
877
879
|
/** Returns information about all products. */
|
|
878
880
|
allProducts: StoreProductConnection;
|
|
881
|
+
/**
|
|
882
|
+
* Lists the commercial contracts associated with the given Organization Unit,
|
|
883
|
+
* resolved to human-readable corporate names. Governed: only contracts associated
|
|
884
|
+
* with the authenticated buyer's Organization Unit are returned.
|
|
885
|
+
*/
|
|
886
|
+
availableContracts: Array<StoreContract>;
|
|
879
887
|
/** Returns the details of a collection based on the collection slug. */
|
|
880
888
|
collection: StoreCollection;
|
|
889
|
+
/** Returns whether the current authenticated user belongs to a B2B organization unit. */
|
|
890
|
+
isOrganizationMember: Scalars['Boolean']['output'];
|
|
881
891
|
/** Returns the list of Orders that the User can view. */
|
|
882
892
|
listUserOrders?: Maybe<UserOrderListMinimalResult>;
|
|
893
|
+
/** Returns the list of Quotes that the authenticated Buyer can view. */
|
|
894
|
+
listUserQuotes?: Maybe<UserQuoteListResult>;
|
|
883
895
|
/** Returns the status of an Order Entry Service operation by its ID. */
|
|
884
896
|
orderEntryOperation?: Maybe<StoreOrderEntryOperationStatus>;
|
|
885
897
|
/** Returns the items in an orderForm by its ID. */
|
|
@@ -894,6 +906,8 @@ export type Query = {
|
|
|
894
906
|
products: Array<StoreProduct>;
|
|
895
907
|
/** Returns information about the profile. */
|
|
896
908
|
profile?: Maybe<Profile>;
|
|
909
|
+
/** Returns personalized product recommendations for a given campaign. */
|
|
910
|
+
recommendations: RecommendationResponse;
|
|
897
911
|
/** Returns if there's a redirect for a search. */
|
|
898
912
|
redirect?: Maybe<StoreRedirect>;
|
|
899
913
|
/** Returns the result of a product, facet, or suggestion search. */
|
|
@@ -917,6 +931,9 @@ export type QueryAllProductsArgs = {
|
|
|
917
931
|
after?: InputMaybe<Scalars['String']['input']>;
|
|
918
932
|
first: Scalars['Int']['input'];
|
|
919
933
|
};
|
|
934
|
+
export type QueryAvailableContractsArgs = {
|
|
935
|
+
orgUnitId: Scalars['String']['input'];
|
|
936
|
+
};
|
|
920
937
|
export type QueryCollectionArgs = {
|
|
921
938
|
slug: Scalars['String']['input'];
|
|
922
939
|
};
|
|
@@ -930,6 +947,16 @@ export type QueryListUserOrdersArgs = {
|
|
|
930
947
|
status?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
|
|
931
948
|
text?: InputMaybe<Scalars['String']['input']>;
|
|
932
949
|
};
|
|
950
|
+
export type QueryListUserQuotesArgs = {
|
|
951
|
+
createdAtFrom?: InputMaybe<Scalars['String']['input']>;
|
|
952
|
+
createdAtTo?: InputMaybe<Scalars['String']['input']>;
|
|
953
|
+
expiresAtFrom?: InputMaybe<Scalars['String']['input']>;
|
|
954
|
+
expiresAtTo?: InputMaybe<Scalars['String']['input']>;
|
|
955
|
+
label?: InputMaybe<Scalars['String']['input']>;
|
|
956
|
+
page?: InputMaybe<Scalars['Int']['input']>;
|
|
957
|
+
perPage?: InputMaybe<Scalars['Int']['input']>;
|
|
958
|
+
status?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
|
|
959
|
+
};
|
|
933
960
|
export type QueryOrderEntryOperationArgs = {
|
|
934
961
|
operationId: Scalars['String']['input'];
|
|
935
962
|
};
|
|
@@ -951,6 +978,11 @@ export type QueryProductsArgs = {
|
|
|
951
978
|
export type QueryProfileArgs = {
|
|
952
979
|
id: Scalars['String']['input'];
|
|
953
980
|
};
|
|
981
|
+
export type QueryRecommendationsArgs = {
|
|
982
|
+
campaignVrn: Scalars['String']['input'];
|
|
983
|
+
products?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
984
|
+
userId?: InputMaybe<Scalars['String']['input']>;
|
|
985
|
+
};
|
|
954
986
|
export type QueryRedirectArgs = {
|
|
955
987
|
selectedFacets?: InputMaybe<Array<IStoreSelectedFacet>>;
|
|
956
988
|
term?: InputMaybe<Scalars['String']['input']>;
|
|
@@ -977,6 +1009,18 @@ export type QueryShippingArgs = {
|
|
|
977
1009
|
export type QueryUserOrderArgs = {
|
|
978
1010
|
orderId: Scalars['String']['input'];
|
|
979
1011
|
};
|
|
1012
|
+
export type RecommendationCampaign = {
|
|
1013
|
+
__typename?: 'RecommendationCampaign';
|
|
1014
|
+
id: Scalars['String']['output'];
|
|
1015
|
+
title?: Maybe<Scalars['String']['output']>;
|
|
1016
|
+
type: Scalars['String']['output'];
|
|
1017
|
+
};
|
|
1018
|
+
export type RecommendationResponse = {
|
|
1019
|
+
__typename?: 'RecommendationResponse';
|
|
1020
|
+
campaign: RecommendationCampaign;
|
|
1021
|
+
correlationId: Scalars['String']['output'];
|
|
1022
|
+
products: Array<StoreProduct>;
|
|
1023
|
+
};
|
|
980
1024
|
export type SkuSpecificationField = {
|
|
981
1025
|
__typename?: 'SKUSpecificationField';
|
|
982
1026
|
id?: Maybe<Scalars['String']['output']>;
|
|
@@ -1263,6 +1307,16 @@ export declare const enum StoreCollectionType {
|
|
|
1263
1307
|
/** Third level of product categorization. */
|
|
1264
1308
|
SubCategory = "SubCategory"
|
|
1265
1309
|
}
|
|
1310
|
+
/** A commercial contract available to a buyer's Organization Unit. */
|
|
1311
|
+
export type StoreContract = {
|
|
1312
|
+
__typename?: 'StoreContract';
|
|
1313
|
+
/** Human-readable corporate name of the contract (resolved from MasterData). */
|
|
1314
|
+
corporateName: Scalars['String']['output'];
|
|
1315
|
+
/** Contract identifier (the contract/scope ID associated with the Organization Unit). */
|
|
1316
|
+
id: Scalars['ID']['output'];
|
|
1317
|
+
/** Indicates whether this contract is the one currently active in the session. */
|
|
1318
|
+
isActive: Scalars['Boolean']['output'];
|
|
1319
|
+
};
|
|
1266
1320
|
/** Currency information. */
|
|
1267
1321
|
export type StoreCurrency = {
|
|
1268
1322
|
__typename?: 'StoreCurrency';
|
|
@@ -2525,6 +2579,42 @@ export type UserOrderTransactions = {
|
|
|
2525
2579
|
payments?: Maybe<Array<Maybe<UserOrderPayments>>>;
|
|
2526
2580
|
transactionId?: Maybe<Scalars['String']['output']>;
|
|
2527
2581
|
};
|
|
2582
|
+
/** Pagination metadata for the quotes list. */
|
|
2583
|
+
export type UserQuoteListPaging = {
|
|
2584
|
+
__typename?: 'UserQuoteListPaging';
|
|
2585
|
+
/** Current page number (1-based). */
|
|
2586
|
+
currentPage: Scalars['Int']['output'];
|
|
2587
|
+
/** Number of items per page. */
|
|
2588
|
+
perPage: Scalars['Int']['output'];
|
|
2589
|
+
/** Total number of quotes matching the query. */
|
|
2590
|
+
total: Scalars['Int']['output'];
|
|
2591
|
+
};
|
|
2592
|
+
/** Result returned by the listUserQuotes query. */
|
|
2593
|
+
export type UserQuoteListResult = {
|
|
2594
|
+
__typename?: 'UserQuoteListResult';
|
|
2595
|
+
/** Array of quote summaries for the current page. */
|
|
2596
|
+
list: Array<UserQuoteSummary>;
|
|
2597
|
+
/** Pagination information. */
|
|
2598
|
+
paging: UserQuoteListPaging;
|
|
2599
|
+
};
|
|
2600
|
+
/** Summary of a quote returned in list results. */
|
|
2601
|
+
export type UserQuoteSummary = {
|
|
2602
|
+
__typename?: 'UserQuoteSummary';
|
|
2603
|
+
/** Total amount of the quote. */
|
|
2604
|
+
amount: Scalars['Float']['output'];
|
|
2605
|
+
/** ISO 8601 date-time when the quote was created. */
|
|
2606
|
+
createdAt: Scalars['String']['output'];
|
|
2607
|
+
/** Name or email of the user who created the quote. */
|
|
2608
|
+
createdBy?: Maybe<Scalars['String']['output']>;
|
|
2609
|
+
/** ISO 8601 date-time when the quote expires. */
|
|
2610
|
+
expiresAt: Scalars['String']['output'];
|
|
2611
|
+
/** Unique identifier of the quote. */
|
|
2612
|
+
id: Scalars['String']['output'];
|
|
2613
|
+
/** Optional label assigned to the quote. */
|
|
2614
|
+
label?: Maybe<Scalars['String']['output']>;
|
|
2615
|
+
/** Status of the quote. */
|
|
2616
|
+
status: Scalars['String']['output'];
|
|
2617
|
+
};
|
|
2528
2618
|
export type ValidateUserData = {
|
|
2529
2619
|
__typename?: 'ValidateUserData';
|
|
2530
2620
|
/** Indicates if the user is valid. */
|