@faststore/api 4.4.0 → 4.5.0-dev.0

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.
@@ -0,0 +1,26 @@
1
+ export interface QuoteSummary {
2
+ id: string;
3
+ status: string;
4
+ label?: string;
5
+ createdAt: string;
6
+ expiresAt: string;
7
+ amount: number;
8
+ createdBy?: string;
9
+ }
10
+ export interface QuoteListResult {
11
+ items: QuoteSummary[];
12
+ pageNumber: number;
13
+ pageSize: number;
14
+ totalItems: number;
15
+ }
16
+ export interface ListUserQuotesArgs {
17
+ page?: number;
18
+ perPage?: number;
19
+ status?: string[];
20
+ createdAtFrom?: string;
21
+ createdAtTo?: string;
22
+ expiresAtFrom?: string;
23
+ expiresAtTo?: string;
24
+ label?: string;
25
+ }
26
+ //# sourceMappingURL=Quote.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Quote.d.ts","sourceRoot":"","sources":["../../../../../../../src/platforms/vtex/clients/commerce/types/Quote.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,YAAY,EAAE,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf"}
@@ -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
  };
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;kCAS2nG,CAAC;;;;;;;;;4BAAmxC,CAAC;;;;;;;;;;;;kBAAyiF,CAAC;mCAAoC,CAAC;uBAAyB,CAAC;;;;;;;;iCAAq5C,CAAC;4BAAoC,CAAC;+BAAgC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAAgwgB,CAAC;;;;;;;;;uBAAkwB,CAAC;4BAA6B,CAAC;;4BAAqD,CAAC;;;;;;;;;;;;;;CAD5mzB,CAAA"}
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;;;;;;;;;;;;;;;;;;;;;;;;;;kCASwwK,CAAC;;;;;;;;;4BAAmxC,CAAC;;;;;;;;;;;;kBAAyiF,CAAC;mCAAoC,CAAC;uBAAyB,CAAC;;;;;;;;iCAAq5C,CAAC;4BAAoC,CAAC;+BAAgC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAA6yhB,CAAC;;;;;;;;;uBAAkwB,CAAC;4BAA6B,CAAC;;4BAAqD,CAAC;;;;;;;;;;;;;;CADty4B,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;
@@ -1 +1 @@
1
- {"version":3,"file":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iBAAiB,4BAA4B,EAC7C,2BAA2B,cAAc;;;;;;gBAQi/yB,CAAC;;;EAD5hzB,CAAA"}
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;;;;;;gBAQ2q4B,CAAC;;;EADtt4B,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;
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAAwgvB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CADzsxB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/vtex/resolvers/index.ts"],"names":[],"mappings":"AA0CA,eAAO,MAAM,YAAY;;;;;;oJACusC,mCAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAAgpb,CAAC;mBAAsB,CAAC;kBAAqB,CAAC;yBAA8B,CAAC;uBAA0B,CAAC;yBAA4B,CAAC;uBAA0B,CAAC;iBAAoB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAA63Y,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CADn42B,CAAA"}
@@ -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;
@@ -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,EAEnB,MAAM,+BAA+B,CAAA;AAUtC,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;AA4B9C,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;;;;;;;;;;;;;;;sBAwBG,OAAO,MAAM,OAAO,QAAQ,cAAc;;;qBAQ3C,OAAO,MAAM,OAAO,OAAO,cAAc;;;;;;;;wBAqCtC,OAAO,MAAM,OAAO,OAAO,cAAc;;;;;sBAmD9D,OAAO,sBACU,qBAAqB,OACpC,cAAc;;;;;;;oBAeo2N,CAAC;;;;;;;;;;;;;;;CAD33N,CAAA"}
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,EAEnB,MAAM,+BAA+B,CAAA;AAUtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA;AAC1E,OAAO,KAAK,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Ac;;;;;;;;;;;;;;;;sBAoDG,OAAO,MAAM,OAAO,QAAQ,cAAc;;;8BAQ7D,OAAO,MACN,OAAO,OACN,cAAc;qBAWE,OAAO,MAAM,OAAO,OAAO,cAAc;;;;;;;;wBAqCtC,OAAO,MAAM,OAAO,OAAO,cAAc;;;;;sBAmD9D,OAAO,sBACU,qBAAqB,OACpC,cAAc;;;;;;;oBAe8nP,CAAC;;;;;;;;;;;;;;;CADrpP,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/api",
3
- "version": "4.4.0",
3
+ "version": "4.5.0-dev.0",
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.4.0"
61
+ "@faststore/diagnostics": "^4.5.0-dev.0"
62
62
  },
63
63
  "peerDependencies": {
64
64
  "graphql": "16.11.0",
65
- "@faststore/diagnostics": "4.4.0"
65
+ "@faststore/diagnostics": "4.5.0-dev.0"
66
66
  },
67
67
  "publishConfig": {
68
68
  "access": "public"
@@ -904,8 +904,12 @@ export type Query = {
904
904
  allProducts: StoreProductConnection;
905
905
  /** Returns the details of a collection based on the collection slug. */
906
906
  collection: StoreCollection;
907
+ /** Returns whether the current authenticated user belongs to a B2B organization unit. */
908
+ isOrganizationMember: Scalars['Boolean']['output'];
907
909
  /** Returns the list of Orders that the User can view. */
908
910
  listUserOrders?: Maybe<UserOrderListMinimalResult>;
911
+ /** Returns the list of Quotes that the authenticated Buyer can view. */
912
+ listUserQuotes?: Maybe<UserQuoteListResult>;
909
913
  /** Returns the status of an Order Entry Service operation by its ID. */
910
914
  orderEntryOperation?: Maybe<StoreOrderEntryOperationStatus>;
911
915
  /** Returns the items in an orderForm by its ID. */
@@ -966,6 +970,18 @@ export type QueryListUserOrdersArgs = {
966
970
  };
967
971
 
968
972
 
973
+ export type QueryListUserQuotesArgs = {
974
+ createdAtFrom?: InputMaybe<Scalars['String']['input']>;
975
+ createdAtTo?: InputMaybe<Scalars['String']['input']>;
976
+ expiresAtFrom?: InputMaybe<Scalars['String']['input']>;
977
+ expiresAtTo?: InputMaybe<Scalars['String']['input']>;
978
+ label?: InputMaybe<Scalars['String']['input']>;
979
+ page?: InputMaybe<Scalars['Int']['input']>;
980
+ perPage?: InputMaybe<Scalars['Int']['input']>;
981
+ status?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
982
+ };
983
+
984
+
969
985
  export type QueryOrderEntryOperationArgs = {
970
986
  operationId: Scalars['String']['input'];
971
987
  };
@@ -2736,6 +2752,45 @@ export type UserOrderTransactions = {
2736
2752
  transactionId?: Maybe<Scalars['String']['output']>;
2737
2753
  };
2738
2754
 
2755
+ /** Pagination metadata for the quotes list. */
2756
+ export type UserQuoteListPaging = {
2757
+ __typename?: 'UserQuoteListPaging';
2758
+ /** Current page number (1-based). */
2759
+ currentPage: Scalars['Int']['output'];
2760
+ /** Number of items per page. */
2761
+ perPage: Scalars['Int']['output'];
2762
+ /** Total number of quotes matching the query. */
2763
+ total: Scalars['Int']['output'];
2764
+ };
2765
+
2766
+ /** Result returned by the listUserQuotes query. */
2767
+ export type UserQuoteListResult = {
2768
+ __typename?: 'UserQuoteListResult';
2769
+ /** Array of quote summaries for the current page. */
2770
+ list: Array<UserQuoteSummary>;
2771
+ /** Pagination information. */
2772
+ paging: UserQuoteListPaging;
2773
+ };
2774
+
2775
+ /** Summary of a quote returned in list results. */
2776
+ export type UserQuoteSummary = {
2777
+ __typename?: 'UserQuoteSummary';
2778
+ /** Total amount of the quote. */
2779
+ amount: Scalars['Float']['output'];
2780
+ /** ISO 8601 date-time when the quote was created. */
2781
+ createdAt: Scalars['String']['output'];
2782
+ /** Name or email of the user who created the quote. */
2783
+ createdBy?: Maybe<Scalars['String']['output']>;
2784
+ /** ISO 8601 date-time when the quote expires. */
2785
+ expiresAt: Scalars['String']['output'];
2786
+ /** Unique identifier of the quote. */
2787
+ id: Scalars['String']['output'];
2788
+ /** Optional label assigned to the quote. */
2789
+ label?: Maybe<Scalars['String']['output']>;
2790
+ /** Status of the quote. */
2791
+ status: Scalars['String']['output'];
2792
+ };
2793
+
2739
2794
  export type ValidateUserData = {
2740
2795
  __typename?: 'ValidateUserData';
2741
2796
  /** Indicates if the user is valid. */
@@ -47,6 +47,7 @@ import type {
47
47
  } from './types/Simulation'
48
48
  import type { ScopesByUnit, UnitResponse } from './types/Unit'
49
49
  import type { VtexIdResponse } from './types/VtexId'
50
+ import type { QuoteListResult, ListUserQuotesArgs } from './types/Quote'
50
51
 
51
52
  type ValueOf<T> = T extends Record<string, infer K> ? K : never
52
53
 
@@ -57,6 +58,84 @@ const BASE_INIT = {
57
58
  },
58
59
  }
59
60
 
61
+ const QUOTE_ISO_DATE = /^\d{4}-\d{2}-\d{2}$/
62
+ const QUOTE_VALID_STATUSES = new Set([
63
+ 'Draft',
64
+ 'Requested',
65
+ 'InReview',
66
+ 'Reviewed',
67
+ 'Approved',
68
+ 'Declined',
69
+ 'Expired',
70
+ 'ConvertedToCart',
71
+ 'ConvertedToOrder',
72
+ ])
73
+
74
+ function validateListUserQuotesArgs({
75
+ page,
76
+ perPage,
77
+ status,
78
+ createdAtFrom,
79
+ createdAtTo,
80
+ expiresAtFrom,
81
+ expiresAtTo,
82
+ }: ListUserQuotesArgs): void {
83
+ if (page !== undefined && (!Number.isInteger(page) || page < 1)) {
84
+ throw new Error(
85
+ `listUserQuotes: invalid page "${page}" — must be a positive integer`
86
+ )
87
+ }
88
+ if (perPage !== undefined && (!Number.isInteger(perPage) || perPage < 1)) {
89
+ throw new Error(
90
+ `listUserQuotes: invalid perPage "${perPage}" — must be a positive integer`
91
+ )
92
+ }
93
+ for (const [field, value] of [
94
+ ['createdAtFrom', createdAtFrom],
95
+ ['createdAtTo', createdAtTo],
96
+ ['expiresAtFrom', expiresAtFrom],
97
+ ['expiresAtTo', expiresAtTo],
98
+ ] as [string, string | undefined][]) {
99
+ if (value && !QUOTE_ISO_DATE.test(value)) {
100
+ throw new Error(
101
+ `listUserQuotes: invalid ${field} "${value}" — must be YYYY-MM-DD`
102
+ )
103
+ }
104
+ }
105
+ if (status && status.length > 0) {
106
+ const invalid = status.filter((s) => !QUOTE_VALID_STATUSES.has(s))
107
+ if (invalid.length > 0) {
108
+ throw new Error(
109
+ `listUserQuotes: invalid status values: ${invalid.join(', ')}`
110
+ )
111
+ }
112
+ }
113
+ }
114
+
115
+ function buildListUserQuotesParams({
116
+ page,
117
+ perPage,
118
+ status,
119
+ createdAtFrom,
120
+ createdAtTo,
121
+ expiresAtFrom,
122
+ expiresAtTo,
123
+ label,
124
+ }: ListUserQuotesArgs): URLSearchParams {
125
+ const params = new URLSearchParams()
126
+
127
+ if (page) params.append('pageNumber', page.toString())
128
+ if (perPage) params.append('pageSize', perPage.toString())
129
+ status?.forEach((s) => params.append('status', s))
130
+ if (createdAtFrom) params.append('createdAtFrom', createdAtFrom)
131
+ if (createdAtTo) params.append('createdAtTo', createdAtTo)
132
+ if (expiresAtFrom) params.append('expiresAtFrom', expiresAtFrom)
133
+ if (expiresAtTo) params.append('expiresAtTo', expiresAtTo)
134
+ if (label?.trim()) params.append('label', label.trim())
135
+
136
+ return params
137
+ }
138
+
60
139
  export const VtexCommerce = (
61
140
  { account, environment, incrementAddress, subDomainPrefix }: Options,
62
141
  ctx: GraphqlContext
@@ -807,6 +886,27 @@ export const VtexCommerce = (
807
886
  )
808
887
  },
809
888
  },
889
+ quotes: {
890
+ listUserQuotes: (args: ListUserQuotesArgs): Promise<QuoteListResult> => {
891
+ validateListUserQuotesArgs(args)
892
+
893
+ const params = buildListUserQuotesParams(args)
894
+
895
+ const headers: HeadersInit = withCookie({
896
+ 'content-type': 'application/json',
897
+ 'X-FORWARDED-HOST': forwardedHost,
898
+ })
899
+
900
+ return fetchAPI(
901
+ `${base}/api/quoting/quotes?${params.toString()}`,
902
+ {
903
+ method: 'GET',
904
+ headers,
905
+ },
906
+ { storeCookies }
907
+ )
908
+ },
909
+ },
810
910
  vtexid: {
811
911
  validate: (): Promise<VtexIdResponse> => {
812
912
  const headers: HeadersInit = withCookie({
@@ -0,0 +1,27 @@
1
+ export interface QuoteSummary {
2
+ id: string
3
+ status: string
4
+ label?: string
5
+ createdAt: string
6
+ expiresAt: string
7
+ amount: number
8
+ createdBy?: string
9
+ }
10
+
11
+ export interface QuoteListResult {
12
+ items: QuoteSummary[]
13
+ pageNumber: number
14
+ pageSize: number
15
+ totalItems: number
16
+ }
17
+
18
+ export interface ListUserQuotesArgs {
19
+ page?: number
20
+ perPage?: number
21
+ status?: string[]
22
+ createdAtFrom?: string
23
+ createdAtTo?: string
24
+ expiresAtFrom?: string
25
+ expiresAtTo?: string
26
+ label?: string
27
+ }
@@ -594,6 +594,70 @@ export const Query = {
594
594
  paging: orders.paging,
595
595
  }
596
596
  },
597
+ listUserQuotes: async (
598
+ _: unknown,
599
+ filters: {
600
+ page?: number
601
+ perPage?: number
602
+ status?: string[]
603
+ createdAtFrom?: string
604
+ createdAtTo?: string
605
+ expiresAtFrom?: string
606
+ expiresAtTo?: string
607
+ label?: string
608
+ },
609
+ ctx: GraphqlContext
610
+ ) => {
611
+ const {
612
+ clients: { commerce },
613
+ } = ctx
614
+
615
+ const result = await commerce.quotes.listUserQuotes(filters)
616
+
617
+ const uniqueCreatedByIds = [
618
+ ...new Set(result.items.map((quote) => quote.createdBy).filter(Boolean)),
619
+ ] as string[]
620
+
621
+ const createdByNameById = new Map<string, string>()
622
+ await Promise.all(
623
+ uniqueCreatedByIds.map(async (userId) => {
624
+ try {
625
+ const [shopper] = await commerce.masterData.getShopperById({
626
+ userId,
627
+ })
628
+ if (shopper) {
629
+ const fullName = [shopper.firstName, shopper.lastName]
630
+ .filter(Boolean)
631
+ .join(' ')
632
+ if (fullName) createdByNameById.set(userId, fullName)
633
+ }
634
+ } catch {
635
+ // Fall back to the raw id below if the lookup fails
636
+ }
637
+ })
638
+ )
639
+
640
+ const list = result.items.map((quote) => ({
641
+ id: quote.id,
642
+ status: quote.status,
643
+ label: quote.label ?? null,
644
+ createdAt: quote.createdAt,
645
+ expiresAt: quote.expiresAt,
646
+ amount: quote.amount,
647
+ createdBy: quote.createdBy
648
+ ? (createdByNameById.get(quote.createdBy) ?? quote.createdBy)
649
+ : null,
650
+ }))
651
+
652
+ return {
653
+ list,
654
+ paging: {
655
+ total: result.totalItems,
656
+ currentPage: result.pageNumber,
657
+ perPage: result.pageSize,
658
+ },
659
+ }
660
+ },
597
661
  validateUser: async (_: unknown, __: unknown, _ctx: GraphqlContext) => {
598
662
  // Authentication is now handled by @auth directive
599
663
  // If we reach here, validation was successful, otherwise an error would have been thrown
@@ -601,6 +665,19 @@ export const Query = {
601
665
  isValid: true,
602
666
  }
603
667
  },
668
+ isOrganizationMember: async (
669
+ _: unknown,
670
+ __: unknown,
671
+ ctx: GraphqlContext
672
+ ) => {
673
+ const {
674
+ clients: { commerce },
675
+ } = ctx
676
+
677
+ const sessionData = await commerce.session('').catch(() => null)
678
+
679
+ return Boolean(sessionData?.namespaces.authentication?.unitId?.value)
680
+ },
604
681
  // only b2b users
605
682
  userDetails: async (_: unknown, __: unknown, ctx: GraphqlContext) => {
606
683
  const {
@@ -430,6 +430,46 @@ type Query {
430
430
  @auth
431
431
  @cacheControl(scope: "private", sMaxAge: 300, staleWhileRevalidate: 3600)
432
432
 
433
+ """
434
+ Returns the list of Quotes that the authenticated Buyer can view.
435
+ """
436
+ listUserQuotes(
437
+ """
438
+ Page number (1-based).
439
+ """
440
+ page: Int
441
+ """
442
+ Number of items per page.
443
+ """
444
+ perPage: Int
445
+ """
446
+ Filter by quote status values.
447
+ """
448
+ status: [String]
449
+ """
450
+ Filter quotes created on or after this ISO 8601 date-time.
451
+ """
452
+ createdAtFrom: String
453
+ """
454
+ Filter quotes created on or before this ISO 8601 date-time.
455
+ """
456
+ createdAtTo: String
457
+ """
458
+ Filter quotes expiring on or after this ISO 8601 date-time.
459
+ """
460
+ expiresAtFrom: String
461
+ """
462
+ Filter quotes expiring on or before this ISO 8601 date-time.
463
+ """
464
+ expiresAtTo: String
465
+ """
466
+ Filter quotes by label (partial match).
467
+ """
468
+ label: String
469
+ ): UserQuoteListResult
470
+ @auth
471
+ @cacheControl(scope: "private", sMaxAge: 300, staleWhileRevalidate: 3600)
472
+
433
473
  """
434
474
  Returns information about the current user details.
435
475
  """
@@ -451,6 +491,13 @@ type Query {
451
491
  @auth
452
492
  @cacheControl(scope: "private", sMaxAge: 300, staleWhileRevalidate: 3600)
453
493
 
494
+ """
495
+ Returns whether the current authenticated user belongs to a B2B organization unit.
496
+ """
497
+ isOrganizationMember: Boolean!
498
+ @auth
499
+ @cacheControl(scope: "private", sMaxAge: 300, staleWhileRevalidate: 3600)
500
+
454
501
  """
455
502
  Returns a list of pickup points near to the given geo coordinates.
456
503
  """
@@ -0,0 +1,65 @@
1
+ """
2
+ Summary of a quote returned in list results.
3
+ """
4
+ type UserQuoteSummary {
5
+ """
6
+ Unique identifier of the quote.
7
+ """
8
+ id: String!
9
+ """
10
+ Status of the quote.
11
+ """
12
+ status: String!
13
+ """
14
+ Optional label assigned to the quote.
15
+ """
16
+ label: String
17
+ """
18
+ ISO 8601 date-time when the quote was created.
19
+ """
20
+ createdAt: String!
21
+ """
22
+ ISO 8601 date-time when the quote expires.
23
+ """
24
+ expiresAt: String!
25
+ """
26
+ Total amount of the quote.
27
+ """
28
+ amount: Float!
29
+ """
30
+ Name or email of the user who created the quote.
31
+ """
32
+ createdBy: String
33
+ }
34
+
35
+ """
36
+ Result returned by the listUserQuotes query.
37
+ """
38
+ type UserQuoteListResult {
39
+ """
40
+ Array of quote summaries for the current page.
41
+ """
42
+ list: [UserQuoteSummary!]!
43
+ """
44
+ Pagination information.
45
+ """
46
+ paging: UserQuoteListPaging!
47
+ }
48
+
49
+ """
50
+ Pagination metadata for the quotes list.
51
+ """
52
+ type UserQuoteListPaging {
53
+ """
54
+ Total number of quotes matching the query.
55
+ """
56
+ total: Int!
57
+ """
58
+ Current page number (1-based).
59
+ """
60
+ currentPage: Int!
61
+ """
62
+ Number of items per page.
63
+ """
64
+ perPage: Int!
65
+ }