@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
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Product } from '../../search/types/ProductSearchResult';
|
|
2
|
+
/**
|
|
3
|
+
* Raw response of the VTEX Recommendations BFF
|
|
4
|
+
* (`GET /api/recommend-bff/v2/recommendations`).
|
|
5
|
+
*
|
|
6
|
+
* The BFF already returns the products fully hydrated in the same Intelligent
|
|
7
|
+
* Search shape (`Product`) used by the `search` query, so the resolver can map
|
|
8
|
+
* them straight to the normalized `StoreProduct` shape via `pickBestSku` +
|
|
9
|
+
* `enhanceSku` — no extra round-trip to search is needed.
|
|
10
|
+
*/
|
|
11
|
+
export interface RecommendationResult {
|
|
12
|
+
products: Product[];
|
|
13
|
+
correlationId: string;
|
|
14
|
+
campaign: RecommendationBffCampaign;
|
|
15
|
+
}
|
|
16
|
+
export interface RecommendationBffCampaign {
|
|
17
|
+
id: string;
|
|
18
|
+
title?: string;
|
|
19
|
+
type: string;
|
|
20
|
+
}
|
|
21
|
+
/** Response of `POST /api/recommend-bff/v2/users/start-session`. */
|
|
22
|
+
export interface StartRecommendationSessionResult {
|
|
23
|
+
recommendationsUserId: string;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=RecommendationResult.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecommendationResult.d.ts","sourceRoot":"","sources":["../../../../../../../src/platforms/vtex/clients/commerce/types/RecommendationResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAA;AAErE;;;;;;;;GAQG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,yBAAyB,CAAA;CACpC;AAED,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;CACb;AAED,oEAAoE;AACpE,MAAM,WAAW,gCAAgC;IAC/C,qBAAqB,EAAE,MAAM,CAAA;CAC9B"}
|
|
@@ -34,12 +34,22 @@ export interface Profile {
|
|
|
34
34
|
lastName?: Value;
|
|
35
35
|
phone?: Value;
|
|
36
36
|
}
|
|
37
|
+
export type SessionAvailableContract = {
|
|
38
|
+
customerId: string;
|
|
39
|
+
contractName: string;
|
|
40
|
+
isActive: boolean;
|
|
41
|
+
isCurrent: boolean;
|
|
42
|
+
};
|
|
37
43
|
export interface Shopper {
|
|
38
44
|
firstName?: Value;
|
|
39
45
|
lastName?: Value;
|
|
40
46
|
organizationManager?: {
|
|
41
47
|
value: boolean;
|
|
42
48
|
};
|
|
49
|
+
availableContracts?: {
|
|
50
|
+
value: SessionAvailableContract[];
|
|
51
|
+
};
|
|
52
|
+
activeContractId?: Value;
|
|
43
53
|
}
|
|
44
54
|
export interface Checkout {
|
|
45
55
|
orderFormId?: Value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Session.d.ts","sourceRoot":"","sources":["../../../../../../../src/platforms/vtex/clients/commerce/types/Session.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,UAAU,CAAA;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,cAAc,CAAC,EAAE,cAAc,CAAA;CAChC;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,KAAK,CAAA;IACjB,WAAW,EAAE,KAAK,CAAA;IAClB,cAAc,EAAE,KAAK,CAAA;IACrB,QAAQ,EAAE,KAAK,CAAA;IACf,MAAM,EAAE,KAAK,CAAA;CACd;AAED,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,KAAK;IACpB,OAAO,EAAE,KAAK,CAAA;IACd,WAAW,EAAE,KAAK,CAAA;IAClB,WAAW,EAAE,KAAK,CAAA;IAClB,YAAY,EAAE,KAAK,CAAA;IACnB,cAAc,EAAE,KAAK,CAAA;CACtB;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,CAAC,EAAE,KAAK,CAAA;IACV,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd;AAED,MAAM,WAAW,OAAO;IACtB,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,mBAAmB,CAAC,EAAE;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"Session.d.ts","sourceRoot":"","sources":["../../../../../../../src/platforms/vtex/clients/commerce/types/Session.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,UAAU,CAAA;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,cAAc,CAAC,EAAE,cAAc,CAAA;CAChC;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,KAAK,CAAA;IACjB,WAAW,EAAE,KAAK,CAAA;IAClB,cAAc,EAAE,KAAK,CAAA;IACrB,QAAQ,EAAE,KAAK,CAAA;IACf,MAAM,EAAE,KAAK,CAAA;CACd;AAED,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,KAAK;IACpB,OAAO,EAAE,KAAK,CAAA;IACd,WAAW,EAAE,KAAK,CAAA;IAClB,WAAW,EAAE,KAAK,CAAA;IAClB,YAAY,EAAE,KAAK,CAAA;IACnB,cAAc,EAAE,KAAK,CAAA;CACtB;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,CAAC,EAAE,KAAK,CAAA;IACV,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,OAAO,CAAA;IACjB,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,MAAM,WAAW,OAAO;IACtB,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,mBAAmB,CAAC,EAAE;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,CAAA;IACxC,kBAAkB,CAAC,EAAE;QAAE,KAAK,EAAE,wBAAwB,EAAE,CAAA;KAAE,CAAA;IAC1D,gBAAgB,CAAC,EAAE,KAAK,CAAA;CACzB;AAED,MAAM,WAAW,QAAQ;IACvB,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB;AAED,MAAM,WAAW,MAAM;IACrB,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,UAAU,CAAC,EAAE,KAAK,CAAA;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;CACX"}
|
|
@@ -137,6 +137,9 @@ export declare const getClients: (options: Options, ctx: GraphqlContext) => {
|
|
|
137
137
|
phone: string;
|
|
138
138
|
}>>;
|
|
139
139
|
};
|
|
140
|
+
quotes: {
|
|
141
|
+
listUserQuotes: (args: import('./commerce/types/Quote').ListUserQuotesArgs) => Promise<import('./commerce/types/Quote').QuoteListResult>;
|
|
142
|
+
};
|
|
140
143
|
vtexid: {
|
|
141
144
|
validate: () => Promise<import('./commerce/types/VtexId').VtexIdResponse>;
|
|
142
145
|
};
|
|
@@ -176,6 +179,10 @@ export declare const getClients: (options: Options, ctx: GraphqlContext) => {
|
|
|
176
179
|
items: import('./commerce/types/OrderForm').OrderFormItem[];
|
|
177
180
|
}>;
|
|
178
181
|
};
|
|
182
|
+
recommendation: {
|
|
183
|
+
recommendations: ({ campaignVrn, userId, products, salesChannel, locale, }: import('./commerce').RecommendationArgs) => Promise<import('./commerce/types/RecommendationResult').RecommendationResult>;
|
|
184
|
+
startRecommendationSession: () => Promise<import('./commerce/types/RecommendationResult').StartRecommendationSessionResult | undefined>;
|
|
185
|
+
};
|
|
179
186
|
};
|
|
180
187
|
};
|
|
181
188
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/vtex/clients/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAA;AAIxC,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA;AAEnD,eAAO,MAAM,UAAU,GAAI,SAAS,OAAO,EAAE,KAAK,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/vtex/clients/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAA;AAIxC,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA;AAEnD,eAAO,MAAM,UAAU,GAAI,SAAS,OAAO,EAAE,KAAK,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;kCASo9M,CAAC;;;;;;;;;4BAAmxC,CAAC;;;;;;;;;;;;kBAAyiF,CAAC;mCAAoC,CAAC;uBAAyB,CAAC;;;;;;;;iCAAq5C,CAAC;4BAAoC,CAAC;+BAAgC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAAszhB,CAAC;;;;;;;;;uBAAkwB,CAAC;4BAA6B,CAAC;;4BAAqD,CAAC;;;;;;;;;;;;;;;;;;CAD3/6B,CAAA"}
|
|
@@ -184,9 +184,35 @@ export declare function getResolvers(): {
|
|
|
184
184
|
}[] | undefined;
|
|
185
185
|
paging: import('../..').Maybe<import('../..').UserOrderListPaging> | undefined;
|
|
186
186
|
}>;
|
|
187
|
+
listUserQuotes: (_: unknown, filters: {
|
|
188
|
+
page?: number;
|
|
189
|
+
perPage?: number;
|
|
190
|
+
status?: string[];
|
|
191
|
+
createdAtFrom?: string;
|
|
192
|
+
createdAtTo?: string;
|
|
193
|
+
expiresAtFrom?: string;
|
|
194
|
+
expiresAtTo?: string;
|
|
195
|
+
label?: string;
|
|
196
|
+
}, ctx: GraphqlContext) => Promise<{
|
|
197
|
+
list: {
|
|
198
|
+
id: string;
|
|
199
|
+
status: string;
|
|
200
|
+
label: string | null;
|
|
201
|
+
createdAt: string;
|
|
202
|
+
expiresAt: string;
|
|
203
|
+
amount: number;
|
|
204
|
+
createdBy: string | null;
|
|
205
|
+
}[];
|
|
206
|
+
paging: {
|
|
207
|
+
total: number;
|
|
208
|
+
currentPage: number;
|
|
209
|
+
perPage: number;
|
|
210
|
+
};
|
|
211
|
+
}>;
|
|
187
212
|
validateUser: (_: unknown, __: unknown, _ctx: GraphqlContext) => Promise<{
|
|
188
213
|
isValid: boolean;
|
|
189
214
|
}>;
|
|
215
|
+
isOrganizationMember: (_: unknown, __: unknown, ctx: GraphqlContext) => Promise<boolean>;
|
|
190
216
|
userDetails: (_: unknown, __: unknown, ctx: GraphqlContext) => Promise<{
|
|
191
217
|
username: string;
|
|
192
218
|
name: string;
|
|
@@ -200,6 +226,7 @@ export declare function getResolvers(): {
|
|
|
200
226
|
email: string;
|
|
201
227
|
id: string;
|
|
202
228
|
} | null>;
|
|
229
|
+
availableContracts: (_: unknown, { orgUnitId }: import('../..').QueryAvailableContractsArgs, ctx: GraphqlContext) => Promise<import('../..').StoreContract[]>;
|
|
203
230
|
pickupPoints: (_: unknown, { geoCoordinates }: import('../..').QueryPickupPointsArgs, ctx: GraphqlContext) => Promise<import('./clients/commerce/types/PickupPoints').PickupPoints>;
|
|
204
231
|
orderEntryOperation: (_: unknown, { operationId }: import('../..').QueryOrderEntryOperationArgs, { clients: { commerce } }: GraphqlContext) => Promise<{
|
|
205
232
|
status: string;
|
|
@@ -222,6 +249,11 @@ export declare function getResolvers(): {
|
|
|
222
249
|
seller: string;
|
|
223
250
|
unitMultiplier: number;
|
|
224
251
|
}[]>;
|
|
252
|
+
recommendations: (_: unknown, { campaignVrn, userId, products }: import('../..').QueryRecommendationsArgs, ctx: GraphqlContext) => Promise<{
|
|
253
|
+
products: import('./utils/enhanceSku').EnhancedSku[];
|
|
254
|
+
correlationId: string;
|
|
255
|
+
campaign: import('./clients/commerce/types/RecommendationResult').RecommendationBffCampaign;
|
|
256
|
+
}>;
|
|
225
257
|
};
|
|
226
258
|
Mutation: {
|
|
227
259
|
validateCart: (_: unknown, { cart: { order }, session }: import('../..').MutationValidateCartArgs, ctx: GraphqlContext) => Promise<{
|
|
@@ -292,6 +324,7 @@ export declare function getResolvers(): {
|
|
|
292
324
|
startOrderEntryOperation: (_: unknown, { data }: import('../..').MutationStartOrderEntryOperationArgs, { clients: { commerce } }: GraphqlContext) => Promise<{
|
|
293
325
|
operationId: string;
|
|
294
326
|
}>;
|
|
327
|
+
startRecommendationSession: (_: unknown, __: unknown, ctx: GraphqlContext) => Promise<boolean>;
|
|
295
328
|
};
|
|
296
329
|
};
|
|
297
330
|
export declare function GraphqlVtexSchema(mergeSchema?: GraphQLSchema): GraphQLSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/platforms/vtex/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAY,MAAM,SAAS,CAAA;AAKtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAExC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAIxC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAG9C,MAAM,WAAW,cAAc;IAC7B,uBAAuB;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB;;;;;SAKK;IACL,OAAO,EAAE;QACP,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;QAC1B,MAAM,EAAE,MAAM,CAAA;QACd,KAAK,EAAE,YAAY,CAAA;QACnB,UAAU,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;QACrC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;KAC7C,CAAA;IACD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B;AAED,eAAO,MAAM,yBAAyB,GAAU,SAAS,OAAO,mBAIpD,GAAG,KAAG,cAAc,CAgB/B,CAAA;AAED,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,IAAI,QAAQ,CAC/D,cAAc,EACd,CAAC,EACD,CAAC,EACD,CAAC,CACF,CAAA;AAED,wBAAgB,YAAY;;;;;;gJAOiB,6CACrC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/platforms/vtex/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAY,MAAM,SAAS,CAAA;AAKtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAExC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAIxC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAG9C,MAAM,WAAW,cAAc;IAC7B,uBAAuB;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB;;;;;SAKK;IACL,OAAO,EAAE;QACP,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;QAC1B,MAAM,EAAE,MAAM,CAAA;QACd,KAAK,EAAE,YAAY,CAAA;QACnB,UAAU,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;QACrC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;KAC7C,CAAA;IACD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B;AAED,eAAO,MAAM,yBAAyB,GAAU,SAAS,OAAO,mBAIpD,GAAG,KAAG,cAAc,CAgB/B,CAAA;AAED,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,IAAI,QAAQ,CAC/D,cAAc,EACd,CAAC,EACD,CAAC,EACD,CAAC,CACF,CAAA;AAED,wBAAgB,YAAY;;;;;;gJAOiB,6CACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA0Bi3a,CAAC;mBAAsB,CAAC;kBAAqB,CAAC;yBAA8B,CAAC;uBAA0B,CAAC;yBAA4B,CAAC;uBAA0B,CAAC;iBAAoB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAAuza,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAlBr21B;AAED,wBAAgB,iBAAiB,CAAC,WAAW,CAAC,EAAE,aAAa,iBAe5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOrderEntryOperation.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/vtex/resolvers/getOrderEntryOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAA;AACxC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAA;AAGjF,eAAO,MAAM,sBAAsB,GACjC,GAAG,OAAO,EACV,iBAAiB,4BAA4B,EAC7C,2BAA2B,cAAc;;;;;;
|
|
1
|
+
{"version":3,"file":"getOrderEntryOperation.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/vtex/resolvers/getOrderEntryOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAA;AACxC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAA;AAGjF,eAAO,MAAM,sBAAsB,GACjC,GAAG,OAAO,EACV,iBAAiB,4BAA4B,EAC7C,2BAA2B,cAAc;;;;;;gBAQg46B,CAAC;;;EAD366B,CAAA"}
|
|
@@ -155,9 +155,35 @@ export declare const getResolvers: () => {
|
|
|
155
155
|
}[] | undefined;
|
|
156
156
|
paging: import('../../..').Maybe<import('../../..').UserOrderListPaging> | undefined;
|
|
157
157
|
}>;
|
|
158
|
+
listUserQuotes: (_: unknown, filters: {
|
|
159
|
+
page?: number;
|
|
160
|
+
perPage?: number;
|
|
161
|
+
status?: string[];
|
|
162
|
+
createdAtFrom?: string;
|
|
163
|
+
createdAtTo?: string;
|
|
164
|
+
expiresAtFrom?: string;
|
|
165
|
+
expiresAtTo?: string;
|
|
166
|
+
label?: string;
|
|
167
|
+
}, ctx: import('..').GraphqlContext) => Promise<{
|
|
168
|
+
list: {
|
|
169
|
+
id: string;
|
|
170
|
+
status: string;
|
|
171
|
+
label: string | null;
|
|
172
|
+
createdAt: string;
|
|
173
|
+
expiresAt: string;
|
|
174
|
+
amount: number;
|
|
175
|
+
createdBy: string | null;
|
|
176
|
+
}[];
|
|
177
|
+
paging: {
|
|
178
|
+
total: number;
|
|
179
|
+
currentPage: number;
|
|
180
|
+
perPage: number;
|
|
181
|
+
};
|
|
182
|
+
}>;
|
|
158
183
|
validateUser: (_: unknown, __: unknown, _ctx: import('..').GraphqlContext) => Promise<{
|
|
159
184
|
isValid: boolean;
|
|
160
185
|
}>;
|
|
186
|
+
isOrganizationMember: (_: unknown, __: unknown, ctx: import('..').GraphqlContext) => Promise<boolean>;
|
|
161
187
|
userDetails: (_: unknown, __: unknown, ctx: import('..').GraphqlContext) => Promise<{
|
|
162
188
|
username: string;
|
|
163
189
|
name: string;
|
|
@@ -171,6 +197,7 @@ export declare const getResolvers: () => {
|
|
|
171
197
|
email: string;
|
|
172
198
|
id: string;
|
|
173
199
|
} | null>;
|
|
200
|
+
availableContracts: (_: unknown, { orgUnitId }: import('../../..').QueryAvailableContractsArgs, ctx: import('..').GraphqlContext) => Promise<import('../../..').StoreContract[]>;
|
|
174
201
|
pickupPoints: (_: unknown, { geoCoordinates }: import('../../..').QueryPickupPointsArgs, ctx: import('..').GraphqlContext) => Promise<import('../clients/commerce/types/PickupPoints').PickupPoints>;
|
|
175
202
|
orderEntryOperation: (_: unknown, { operationId }: import('../../..').QueryOrderEntryOperationArgs, { clients: { commerce } }: import('..').GraphqlContext) => Promise<{
|
|
176
203
|
status: string;
|
|
@@ -193,6 +220,11 @@ export declare const getResolvers: () => {
|
|
|
193
220
|
seller: string;
|
|
194
221
|
unitMultiplier: number;
|
|
195
222
|
}[]>;
|
|
223
|
+
recommendations: (_: unknown, { campaignVrn, userId, products }: import('../../..').QueryRecommendationsArgs, ctx: import('..').GraphqlContext) => Promise<{
|
|
224
|
+
products: import('../utils/enhanceSku').EnhancedSku[];
|
|
225
|
+
correlationId: string;
|
|
226
|
+
campaign: import('../clients/commerce/types/RecommendationResult').RecommendationBffCampaign;
|
|
227
|
+
}>;
|
|
196
228
|
};
|
|
197
229
|
Mutation: {
|
|
198
230
|
validateCart: (_: unknown, { cart: { order }, session }: import('../../..').MutationValidateCartArgs, ctx: import('..').GraphqlContext) => Promise<{
|
|
@@ -263,6 +295,7 @@ export declare const getResolvers: () => {
|
|
|
263
295
|
startOrderEntryOperation: (_: unknown, { data }: import('../../..').MutationStartOrderEntryOperationArgs, { clients: { commerce } }: import('..').GraphqlContext) => Promise<{
|
|
264
296
|
operationId: string;
|
|
265
297
|
}>;
|
|
298
|
+
startRecommendationSession: (_: unknown, __: unknown, ctx: import('..').GraphqlContext) => Promise<boolean>;
|
|
266
299
|
};
|
|
267
300
|
};
|
|
268
301
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/vtex/resolvers/index.ts"],"names":[],"mappings":"AA0CA,eAAO,MAAM,YAAY;;;;;;oJACusC,mCAAe
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/vtex/resolvers/index.ts"],"names":[],"mappings":"AA0CA,eAAO,MAAM,YAAY;;;;;;oJACusC,mCAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAA26b,CAAC;mBAAsB,CAAC;kBAAqB,CAAC;yBAA8B,CAAC;uBAA0B,CAAC;yBAA4B,CAAC;uBAA0B,CAAC;iBAAoB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAAuza,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CADxl5B,CAAA"}
|
|
@@ -67,5 +67,6 @@ export declare const Mutation: {
|
|
|
67
67
|
startOrderEntryOperation: (_: unknown, { data }: import('../../..').MutationStartOrderEntryOperationArgs, { clients: { commerce } }: import('..').GraphqlContext) => Promise<{
|
|
68
68
|
operationId: string;
|
|
69
69
|
}>;
|
|
70
|
+
startRecommendationSession: (_: unknown, __: unknown, ctx: import('..').GraphqlContext) => Promise<boolean>;
|
|
70
71
|
};
|
|
71
72
|
//# sourceMappingURL=mutation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutation.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/vtex/resolvers/mutation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mutation.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/vtex/resolvers/mutation.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CASpB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProcessOrderAuthorizationRule, QueryAllCollectionsArgs, QueryAllProductsArgs, QueryCollectionArgs, QueryListUserOrdersArgs, QueryPickupPointsArgs, QueryProductArgs, QueryProductCountArgs, QueryProductsArgs, QueryProfileArgs, QueryRedirectArgs, QuerySearchArgs, QuerySellersArgs, QueryShippingArgs, QueryUserOrderArgs } from '../../../__generated__/schema';
|
|
1
|
+
import { ProcessOrderAuthorizationRule, QueryAllCollectionsArgs, QueryAllProductsArgs, QueryAvailableContractsArgs, QueryCollectionArgs, QueryListUserOrdersArgs, QueryPickupPointsArgs, QueryProductArgs, QueryProductCountArgs, QueryProductsArgs, QueryProfileArgs, QueryRedirectArgs, QuerySearchArgs, QuerySellersArgs, QueryShippingArgs, QueryUserOrderArgs, StoreContract } from '../../../__generated__/schema';
|
|
2
2
|
import { CategoryTree } from '../clients/commerce/types/CategoryTree';
|
|
3
3
|
import { ProfileAddress } from '../clients/commerce/types/Profile';
|
|
4
4
|
import { SearchArgs } from '../clients/search';
|
|
@@ -114,9 +114,35 @@ export declare const Query: {
|
|
|
114
114
|
}[] | undefined;
|
|
115
115
|
paging: import('../../..').Maybe<import('../../..').UserOrderListPaging> | undefined;
|
|
116
116
|
}>;
|
|
117
|
+
listUserQuotes: (_: unknown, filters: {
|
|
118
|
+
page?: number;
|
|
119
|
+
perPage?: number;
|
|
120
|
+
status?: string[];
|
|
121
|
+
createdAtFrom?: string;
|
|
122
|
+
createdAtTo?: string;
|
|
123
|
+
expiresAtFrom?: string;
|
|
124
|
+
expiresAtTo?: string;
|
|
125
|
+
label?: string;
|
|
126
|
+
}, ctx: GraphqlContext) => Promise<{
|
|
127
|
+
list: {
|
|
128
|
+
id: string;
|
|
129
|
+
status: string;
|
|
130
|
+
label: string | null;
|
|
131
|
+
createdAt: string;
|
|
132
|
+
expiresAt: string;
|
|
133
|
+
amount: number;
|
|
134
|
+
createdBy: string | null;
|
|
135
|
+
}[];
|
|
136
|
+
paging: {
|
|
137
|
+
total: number;
|
|
138
|
+
currentPage: number;
|
|
139
|
+
perPage: number;
|
|
140
|
+
};
|
|
141
|
+
}>;
|
|
117
142
|
validateUser: (_: unknown, __: unknown, _ctx: GraphqlContext) => Promise<{
|
|
118
143
|
isValid: boolean;
|
|
119
144
|
}>;
|
|
145
|
+
isOrganizationMember: (_: unknown, __: unknown, ctx: GraphqlContext) => Promise<boolean>;
|
|
120
146
|
userDetails: (_: unknown, __: unknown, ctx: GraphqlContext) => Promise<{
|
|
121
147
|
username: string;
|
|
122
148
|
name: string;
|
|
@@ -130,6 +156,7 @@ export declare const Query: {
|
|
|
130
156
|
email: string;
|
|
131
157
|
id: string;
|
|
132
158
|
} | null>;
|
|
159
|
+
availableContracts: (_: unknown, { orgUnitId }: QueryAvailableContractsArgs, ctx: GraphqlContext) => Promise<StoreContract[]>;
|
|
133
160
|
pickupPoints: (_: unknown, { geoCoordinates }: QueryPickupPointsArgs, ctx: GraphqlContext) => Promise<import('../clients/commerce/types/PickupPoints').PickupPoints>;
|
|
134
161
|
orderEntryOperation: (_: unknown, { operationId }: import('../../..').QueryOrderEntryOperationArgs, { clients: { commerce } }: GraphqlContext) => Promise<{
|
|
135
162
|
status: string;
|
|
@@ -152,5 +179,10 @@ export declare const Query: {
|
|
|
152
179
|
seller: string;
|
|
153
180
|
unitMultiplier: number;
|
|
154
181
|
}[]>;
|
|
182
|
+
recommendations: (_: unknown, { campaignVrn, userId, products }: import('../../..').QueryRecommendationsArgs, ctx: GraphqlContext) => Promise<{
|
|
183
|
+
products: import('../utils/enhanceSku').EnhancedSku[];
|
|
184
|
+
correlationId: string;
|
|
185
|
+
campaign: import('../clients/commerce/types/RecommendationResult').RecommendationBffCampaign;
|
|
186
|
+
}>;
|
|
155
187
|
};
|
|
156
188
|
//# sourceMappingURL=query.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/vtex/resolvers/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/vtex/resolvers/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,uBAAuB,EACvB,oBAAoB,EACpB,2BAA2B,EAC3B,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EAEd,MAAM,+BAA+B,CAAA;AAWtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAA;AACtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAkC9C,eAAO,MAAM,KAAK;iBAEX,OAAO,eACG,gBAAgB,OACxB,cAAc;oBAgFhB,OAAO,YACA,mBAAmB,OACxB,cAAc;gBAShB,OAAO,6EAQP,eAAe,OACb,cAAc;;;;qBA4EhB,OAAO,gCACoB,oBAAoB,OAC7C,cAAc;;;;;;;;;;;;;kBAkChB,OAAO,kBACM,iBAAiB,OAC5B,cAAc;wBAwBhB,OAAO,gCACoB,uBAAuB,OAChD,cAAc;;;;;;;;;;;;;;;;;;uBAa6B,MAAM;;;;;kBA2CnD,OAAO,kCACsB,iBAAiB,OAC5C,cAAc;;;;;;;;;;;;;;;;;kBAkBhB,OAAO,4BACgB,iBAAiB,OACtC,cAAc;;;iBAqBhB,OAAO,yDAC6C,gBAAgB,OAClE,cAAc;;;;iBAqBhB,OAAO,UACF,gBAAgB,OACnB,cAAc;;;sBAyBhB,OAAO,YACA,qBAAqB,OAC1B,cAAc;mBAahB,OAAO,eACG,kBAAkB,OAC1B,cAAc;;;;;;;;;;;;;;;;;;;;;;;wBAqGhB,OAAO,WACD,uBAAuB,OAC3B,cAAc;;;;;;;;;;;;;;;wBAyBhB,OAAO,WACD;QACP,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;QACjB,aAAa,CAAC,EAAE,MAAM,CAAA;QACtB,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,aAAa,CAAC,EAAE,MAAM,CAAA;QACtB,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,OACI,cAAc;;;;;;;;;;;;;;;;sBAoDG,OAAO,MAAM,OAAO,QAAQ,cAAc;;;8BAQ7D,OAAO,MACN,OAAO,OACN,cAAc;qBAWE,OAAO,MAAM,OAAO,OAAO,cAAc;;;;;;;;wBAqCtC,OAAO,MAAM,OAAO,OAAO,cAAc;;;;;4BAmD9D,OAAO,iBACK,2BAA2B,OACrC,cAAc,KAClB,OAAO,CAAC,aAAa,EAAE,CAAC;sBA4CtB,OAAO,sBACU,qBAAqB,OACpC,cAAc;;;;;;;oBAgBy1O,CAAC;;;;;;;;;;;;;;;;;;;;CADh3O,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { QueryRecommendationsArgs } from '../../../__generated__/schema';
|
|
2
|
+
import { GraphqlContext } from '../index';
|
|
3
|
+
import { EnhancedSku } from '../utils/enhanceSku';
|
|
4
|
+
/**
|
|
5
|
+
* Resolves personalized recommendations for a campaign.
|
|
6
|
+
*
|
|
7
|
+
* The VTEX Recommendations BFF already returns the products fully hydrated in
|
|
8
|
+
* the same Intelligent Search shape used by the `search` query. We map them
|
|
9
|
+
* straight to the normalized `StoreProduct` shape (`pickBestSku` + `enhanceSku`)
|
|
10
|
+
* so recommendation shelves render identical cards to regular shelves, while
|
|
11
|
+
* preserving the recommendation order returned by the BFF.
|
|
12
|
+
*/
|
|
13
|
+
export declare const recommendations: (_: unknown, { campaignVrn, userId, products }: QueryRecommendationsArgs, ctx: GraphqlContext) => Promise<{
|
|
14
|
+
products: EnhancedSku[];
|
|
15
|
+
correlationId: string;
|
|
16
|
+
campaign: import('../clients/commerce/types/RecommendationResult').RecommendationBffCampaign;
|
|
17
|
+
}>;
|
|
18
|
+
//# sourceMappingURL=recommendations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recommendations.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/vtex/resolvers/recommendations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAA;AASlE;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,GAC1B,GAAG,OAAO,EACV,mCAAmC,wBAAwB,EAC3D,KAAK,cAAc;;;;EAuDpB,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GraphqlContext } from '../index';
|
|
2
|
+
/**
|
|
3
|
+
* Starts (or updates) the anonymous personalization session for the current
|
|
4
|
+
* shopper via the Recommendations BFF.
|
|
5
|
+
*
|
|
6
|
+
* The BFF replies with the `vtex-rec-user-id`/`vtex-rec-user-start-session`
|
|
7
|
+
* Set-Cookie headers, which the client forwards to the browser through
|
|
8
|
+
* `ctx.storage.cookies`. Returns `true` once the session has been started.
|
|
9
|
+
*/
|
|
10
|
+
export declare const startRecommendationSession: (_: unknown, __: unknown, ctx: GraphqlContext) => Promise<boolean>;
|
|
11
|
+
//# sourceMappingURL=startRecommendationSession.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"startRecommendationSession.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/vtex/resolvers/startRecommendationSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,GACrC,GAAG,OAAO,EACV,IAAI,OAAO,EACX,KAAK,cAAc,qBAgBpB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateSession.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/vtex/resolvers/validateSession.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAA;AACxC,OAAO,KAAK,EACV,2BAA2B,EAE3B,YAAY,EACb,MAAM,+BAA+B,CAAA;
|
|
1
|
+
{"version":3,"file":"validateSession.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/vtex/resolvers/validateSession.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAA;AACxC,OAAO,KAAK,EACV,2BAA2B,EAE3B,YAAY,EACb,MAAM,+BAA+B,CAAA;AAiCtC,eAAO,MAAM,eAAe,GAC1B,GAAG,GAAG,EACN,iCAAiC,2BAA2B,EAC5D,+BAA+B,cAAc,KAC5C,OAAO,CAAC,YAAY,GAAG,IAAI,CAuL7B,CAAA"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ContractResponse } from '../clients/commerce/Contract';
|
|
2
|
+
import { SessionAvailableContract, Shopper } from '../clients/commerce/types/Session';
|
|
3
|
+
type ProfileNameFields = {
|
|
4
|
+
firstName?: {
|
|
5
|
+
value?: string | null;
|
|
6
|
+
} | null;
|
|
7
|
+
lastName?: {
|
|
8
|
+
value?: string | null;
|
|
9
|
+
} | null;
|
|
10
|
+
} | null;
|
|
11
|
+
/**
|
|
12
|
+
* Display name from Master Data, aligned with buyer-portal `personalDataToContract`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const resolveContractDisplayNameFromMd: (contract: ContractResponse | null | undefined) => string;
|
|
15
|
+
/**
|
|
16
|
+
* Parses VTEX session `shopper.availableContracts` into a typed list.
|
|
17
|
+
*/
|
|
18
|
+
export declare const parseSessionAvailableContracts: (shopper: Shopper | null | undefined) => SessionAvailableContract[];
|
|
19
|
+
/**
|
|
20
|
+
* Whether a session contract is eligible for the switcher list.
|
|
21
|
+
*/
|
|
22
|
+
export declare const isSwitchableSessionContract: (contract: SessionAvailableContract | null | undefined) => boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Resolves the active contract id from VTEX session namespaces.
|
|
25
|
+
*/
|
|
26
|
+
export declare const resolveActiveContractIdFromSession: (sessionData: {
|
|
27
|
+
namespaces?: {
|
|
28
|
+
shopper?: Shopper | null;
|
|
29
|
+
authentication?: {
|
|
30
|
+
customerId?: {
|
|
31
|
+
value?: string | null;
|
|
32
|
+
} | null;
|
|
33
|
+
} | null;
|
|
34
|
+
profile?: {
|
|
35
|
+
id?: {
|
|
36
|
+
value?: string | null;
|
|
37
|
+
} | null;
|
|
38
|
+
} | null;
|
|
39
|
+
} | null;
|
|
40
|
+
} | null) => string;
|
|
41
|
+
/**
|
|
42
|
+
* Maps session contracts to GraphQL `StoreContract` entries.
|
|
43
|
+
*/
|
|
44
|
+
export declare const mapSessionContractsToStoreContracts: (contracts: SessionAvailableContract[], activeContractId?: string) => Array<{
|
|
45
|
+
id: string;
|
|
46
|
+
corporateName: string;
|
|
47
|
+
isActive: boolean;
|
|
48
|
+
}>;
|
|
49
|
+
/**
|
|
50
|
+
* Whether a CL record is eligible for contract switcher summaries (attached list).
|
|
51
|
+
*/
|
|
52
|
+
export declare const isSwitchableContractSummary: (contract: ContractResponse | null | undefined) => boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Resolves the active contract name: Master Data first, then VTEX session profile.
|
|
55
|
+
* Matches `accountProfile` / buyer-portal behavior when CL lookup fails.
|
|
56
|
+
*/
|
|
57
|
+
export declare const resolveActiveContractDisplayName: (contract: ContractResponse | null | undefined, profile: ProfileNameFields) => string;
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/vtex/utils/contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EACV,wBAAwB,EACxB,OAAO,EACR,MAAM,mCAAmC,CAAA;AAE1C,KAAK,iBAAiB,GAAG;IACvB,SAAS,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,CAAA;IAC5C,QAAQ,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,CAAA;CAC5C,GAAG,IAAI,CAAA;AAER;;GAEG;AACH,eAAO,MAAM,gCAAgC,GAC3C,UAAU,gBAAgB,GAAG,IAAI,GAAG,SAAS,KAC5C,MAQF,CAAA;AAoBD;;GAEG;AACH,eAAO,MAAM,8BAA8B,GACzC,SAAS,OAAO,GAAG,IAAI,GAAG,SAAS,KAClC,wBAAwB,EAQ1B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,2BAA2B,GACtC,UAAU,wBAAwB,GAAG,IAAI,GAAG,SAAS,KACpD,OAQF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kCAAkC,GAC7C,aAAa;IACX,UAAU,CAAC,EAAE;QACX,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;QACxB,cAAc,CAAC,EAAE;YAAE,UAAU,CAAC,EAAE;gBAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;aAAE,GAAG,IAAI,CAAA;SAAE,GAAG,IAAI,CAAA;QACzE,OAAO,CAAC,EAAE;YAAE,EAAE,CAAC,EAAE;gBAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;aAAE,GAAG,IAAI,CAAA;SAAE,GAAG,IAAI,CAAA;KAC3D,GAAG,IAAI,CAAA;CACT,GAAG,IAAI,KACP,MAOF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,mCAAmC,GAC9C,WAAW,wBAAwB,EAAE,EACrC,yBAAqB,KACpB,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAUhE,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,2BAA2B,GACtC,UAAU,gBAAgB,GAAG,IAAI,GAAG,SAAS,KAC5C,OASF,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gCAAgC,GAC3C,UAAU,gBAAgB,GAAG,IAAI,GAAG,SAAS,EAC7C,SAAS,iBAAiB,KACzB,MAQF,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/api",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0-dev.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"typings": "dist/src/index.d.ts",
|
|
@@ -58,11 +58,11 @@
|
|
|
58
58
|
"vite": "7.1.5",
|
|
59
59
|
"vite-plugin-dts": "4.5.4",
|
|
60
60
|
"vitest": "^4.0.7",
|
|
61
|
-
"@faststore/diagnostics": "^4.
|
|
61
|
+
"@faststore/diagnostics": "^4.5.0-dev.1"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"graphql": "16.11.0",
|
|
65
|
-
"@faststore/diagnostics": "4.
|
|
65
|
+
"@faststore/diagnostics": "4.5.0-dev.1"
|
|
66
66
|
},
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"access": "public"
|
|
@@ -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
|
/**
|
|
@@ -902,10 +904,20 @@ export type Query = {
|
|
|
902
904
|
allCollections: StoreCollectionConnection;
|
|
903
905
|
/** Returns information about all products. */
|
|
904
906
|
allProducts: StoreProductConnection;
|
|
907
|
+
/**
|
|
908
|
+
* Lists the commercial contracts associated with the given Organization Unit,
|
|
909
|
+
* resolved to human-readable corporate names. Governed: only contracts associated
|
|
910
|
+
* with the authenticated buyer's Organization Unit are returned.
|
|
911
|
+
*/
|
|
912
|
+
availableContracts: Array<StoreContract>;
|
|
905
913
|
/** Returns the details of a collection based on the collection slug. */
|
|
906
914
|
collection: StoreCollection;
|
|
915
|
+
/** Returns whether the current authenticated user belongs to a B2B organization unit. */
|
|
916
|
+
isOrganizationMember: Scalars['Boolean']['output'];
|
|
907
917
|
/** Returns the list of Orders that the User can view. */
|
|
908
918
|
listUserOrders?: Maybe<UserOrderListMinimalResult>;
|
|
919
|
+
/** Returns the list of Quotes that the authenticated Buyer can view. */
|
|
920
|
+
listUserQuotes?: Maybe<UserQuoteListResult>;
|
|
909
921
|
/** Returns the status of an Order Entry Service operation by its ID. */
|
|
910
922
|
orderEntryOperation?: Maybe<StoreOrderEntryOperationStatus>;
|
|
911
923
|
/** Returns the items in an orderForm by its ID. */
|
|
@@ -920,6 +932,8 @@ export type Query = {
|
|
|
920
932
|
products: Array<StoreProduct>;
|
|
921
933
|
/** Returns information about the profile. */
|
|
922
934
|
profile?: Maybe<Profile>;
|
|
935
|
+
/** Returns personalized product recommendations for a given campaign. */
|
|
936
|
+
recommendations: RecommendationResponse;
|
|
923
937
|
/** Returns if there's a redirect for a search. */
|
|
924
938
|
redirect?: Maybe<StoreRedirect>;
|
|
925
939
|
/** Returns the result of a product, facet, or suggestion search. */
|
|
@@ -949,6 +963,11 @@ export type QueryAllProductsArgs = {
|
|
|
949
963
|
};
|
|
950
964
|
|
|
951
965
|
|
|
966
|
+
export type QueryAvailableContractsArgs = {
|
|
967
|
+
orgUnitId: Scalars['String']['input'];
|
|
968
|
+
};
|
|
969
|
+
|
|
970
|
+
|
|
952
971
|
export type QueryCollectionArgs = {
|
|
953
972
|
slug: Scalars['String']['input'];
|
|
954
973
|
};
|
|
@@ -966,6 +985,18 @@ export type QueryListUserOrdersArgs = {
|
|
|
966
985
|
};
|
|
967
986
|
|
|
968
987
|
|
|
988
|
+
export type QueryListUserQuotesArgs = {
|
|
989
|
+
createdAtFrom?: InputMaybe<Scalars['String']['input']>;
|
|
990
|
+
createdAtTo?: InputMaybe<Scalars['String']['input']>;
|
|
991
|
+
expiresAtFrom?: InputMaybe<Scalars['String']['input']>;
|
|
992
|
+
expiresAtTo?: InputMaybe<Scalars['String']['input']>;
|
|
993
|
+
label?: InputMaybe<Scalars['String']['input']>;
|
|
994
|
+
page?: InputMaybe<Scalars['Int']['input']>;
|
|
995
|
+
perPage?: InputMaybe<Scalars['Int']['input']>;
|
|
996
|
+
status?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
|
|
997
|
+
};
|
|
998
|
+
|
|
999
|
+
|
|
969
1000
|
export type QueryOrderEntryOperationArgs = {
|
|
970
1001
|
operationId: Scalars['String']['input'];
|
|
971
1002
|
};
|
|
@@ -1001,6 +1032,13 @@ export type QueryProfileArgs = {
|
|
|
1001
1032
|
};
|
|
1002
1033
|
|
|
1003
1034
|
|
|
1035
|
+
export type QueryRecommendationsArgs = {
|
|
1036
|
+
campaignVrn: Scalars['String']['input'];
|
|
1037
|
+
products?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
1038
|
+
userId?: InputMaybe<Scalars['String']['input']>;
|
|
1039
|
+
};
|
|
1040
|
+
|
|
1041
|
+
|
|
1004
1042
|
export type QueryRedirectArgs = {
|
|
1005
1043
|
selectedFacets?: InputMaybe<Array<IStoreSelectedFacet>>;
|
|
1006
1044
|
term?: InputMaybe<Scalars['String']['input']>;
|
|
@@ -1036,6 +1074,20 @@ export type QueryUserOrderArgs = {
|
|
|
1036
1074
|
orderId: Scalars['String']['input'];
|
|
1037
1075
|
};
|
|
1038
1076
|
|
|
1077
|
+
export type RecommendationCampaign = {
|
|
1078
|
+
__typename?: 'RecommendationCampaign';
|
|
1079
|
+
id: Scalars['String']['output'];
|
|
1080
|
+
title?: Maybe<Scalars['String']['output']>;
|
|
1081
|
+
type: Scalars['String']['output'];
|
|
1082
|
+
};
|
|
1083
|
+
|
|
1084
|
+
export type RecommendationResponse = {
|
|
1085
|
+
__typename?: 'RecommendationResponse';
|
|
1086
|
+
campaign: RecommendationCampaign;
|
|
1087
|
+
correlationId: Scalars['String']['output'];
|
|
1088
|
+
products: Array<StoreProduct>;
|
|
1089
|
+
};
|
|
1090
|
+
|
|
1039
1091
|
export type SkuSpecificationField = {
|
|
1040
1092
|
__typename?: 'SKUSpecificationField';
|
|
1041
1093
|
id?: Maybe<Scalars['String']['output']>;
|
|
@@ -1353,6 +1405,17 @@ export const enum StoreCollectionType {
|
|
|
1353
1405
|
SubCategory = 'SubCategory'
|
|
1354
1406
|
};
|
|
1355
1407
|
|
|
1408
|
+
/** A commercial contract available to a buyer's Organization Unit. */
|
|
1409
|
+
export type StoreContract = {
|
|
1410
|
+
__typename?: 'StoreContract';
|
|
1411
|
+
/** Human-readable corporate name of the contract (resolved from MasterData). */
|
|
1412
|
+
corporateName: Scalars['String']['output'];
|
|
1413
|
+
/** Contract identifier (the contract/scope ID associated with the Organization Unit). */
|
|
1414
|
+
id: Scalars['ID']['output'];
|
|
1415
|
+
/** Indicates whether this contract is the one currently active in the session. */
|
|
1416
|
+
isActive: Scalars['Boolean']['output'];
|
|
1417
|
+
};
|
|
1418
|
+
|
|
1356
1419
|
/** Currency information. */
|
|
1357
1420
|
export type StoreCurrency = {
|
|
1358
1421
|
__typename?: 'StoreCurrency';
|
|
@@ -2736,6 +2799,45 @@ export type UserOrderTransactions = {
|
|
|
2736
2799
|
transactionId?: Maybe<Scalars['String']['output']>;
|
|
2737
2800
|
};
|
|
2738
2801
|
|
|
2802
|
+
/** Pagination metadata for the quotes list. */
|
|
2803
|
+
export type UserQuoteListPaging = {
|
|
2804
|
+
__typename?: 'UserQuoteListPaging';
|
|
2805
|
+
/** Current page number (1-based). */
|
|
2806
|
+
currentPage: Scalars['Int']['output'];
|
|
2807
|
+
/** Number of items per page. */
|
|
2808
|
+
perPage: Scalars['Int']['output'];
|
|
2809
|
+
/** Total number of quotes matching the query. */
|
|
2810
|
+
total: Scalars['Int']['output'];
|
|
2811
|
+
};
|
|
2812
|
+
|
|
2813
|
+
/** Result returned by the listUserQuotes query. */
|
|
2814
|
+
export type UserQuoteListResult = {
|
|
2815
|
+
__typename?: 'UserQuoteListResult';
|
|
2816
|
+
/** Array of quote summaries for the current page. */
|
|
2817
|
+
list: Array<UserQuoteSummary>;
|
|
2818
|
+
/** Pagination information. */
|
|
2819
|
+
paging: UserQuoteListPaging;
|
|
2820
|
+
};
|
|
2821
|
+
|
|
2822
|
+
/** Summary of a quote returned in list results. */
|
|
2823
|
+
export type UserQuoteSummary = {
|
|
2824
|
+
__typename?: 'UserQuoteSummary';
|
|
2825
|
+
/** Total amount of the quote. */
|
|
2826
|
+
amount: Scalars['Float']['output'];
|
|
2827
|
+
/** ISO 8601 date-time when the quote was created. */
|
|
2828
|
+
createdAt: Scalars['String']['output'];
|
|
2829
|
+
/** Name or email of the user who created the quote. */
|
|
2830
|
+
createdBy?: Maybe<Scalars['String']['output']>;
|
|
2831
|
+
/** ISO 8601 date-time when the quote expires. */
|
|
2832
|
+
expiresAt: Scalars['String']['output'];
|
|
2833
|
+
/** Unique identifier of the quote. */
|
|
2834
|
+
id: Scalars['String']['output'];
|
|
2835
|
+
/** Optional label assigned to the quote. */
|
|
2836
|
+
label?: Maybe<Scalars['String']['output']>;
|
|
2837
|
+
/** Status of the quote. */
|
|
2838
|
+
status: Scalars['String']['output'];
|
|
2839
|
+
};
|
|
2840
|
+
|
|
2739
2841
|
export type ValidateUserData = {
|
|
2740
2842
|
__typename?: 'ValidateUserData';
|
|
2741
2843
|
/** Indicates if the user is valid. */
|