@voyantjs/storefront-react 0.4.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.
Files changed (49) hide show
  1. package/dist/client.d.ts +16 -0
  2. package/dist/client.d.ts.map +1 -0
  3. package/dist/client.js +78 -0
  4. package/dist/hooks/index.d.ts +9 -0
  5. package/dist/hooks/index.d.ts.map +1 -0
  6. package/dist/hooks/index.js +8 -0
  7. package/dist/hooks/use-storefront-departure-itinerary.d.ts +22 -0
  8. package/dist/hooks/use-storefront-departure-itinerary.d.ts.map +1 -0
  9. package/dist/hooks/use-storefront-departure-itinerary.js +12 -0
  10. package/dist/hooks/use-storefront-departure-price-preview-mutation.d.ts +35 -0
  11. package/dist/hooks/use-storefront-departure-price-preview-mutation.d.ts.map +1 -0
  12. package/dist/hooks/use-storefront-departure-price-preview-mutation.js +15 -0
  13. package/dist/hooks/use-storefront-departure.d.ts +51 -0
  14. package/dist/hooks/use-storefront-departure.d.ts.map +1 -0
  15. package/dist/hooks/use-storefront-departure.js +12 -0
  16. package/dist/hooks/use-storefront-offer.d.ts +26 -0
  17. package/dist/hooks/use-storefront-offer.d.ts.map +1 -0
  18. package/dist/hooks/use-storefront-offer.js +12 -0
  19. package/dist/hooks/use-storefront-product-departures.d.ts +55 -0
  20. package/dist/hooks/use-storefront-product-departures.d.ts.map +1 -0
  21. package/dist/hooks/use-storefront-product-departures.js +12 -0
  22. package/dist/hooks/use-storefront-product-extensions.d.ts +47 -0
  23. package/dist/hooks/use-storefront-product-extensions.d.ts.map +1 -0
  24. package/dist/hooks/use-storefront-product-extensions.js +12 -0
  25. package/dist/hooks/use-storefront-product-offers.d.ts +26 -0
  26. package/dist/hooks/use-storefront-product-offers.d.ts.map +1 -0
  27. package/dist/hooks/use-storefront-product-offers.js +12 -0
  28. package/dist/hooks/use-storefront-settings.d.ts +62 -0
  29. package/dist/hooks/use-storefront-settings.d.ts.map +1 -0
  30. package/dist/hooks/use-storefront-settings.js +12 -0
  31. package/dist/index.d.ts +8 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +7 -0
  34. package/dist/operations.d.ts +278 -0
  35. package/dist/operations.d.ts.map +1 -0
  36. package/dist/operations.js +28 -0
  37. package/dist/provider.d.ts +2 -0
  38. package/dist/provider.d.ts.map +1 -0
  39. package/dist/provider.js +1 -0
  40. package/dist/query-keys.d.ts +31 -0
  41. package/dist/query-keys.d.ts.map +1 -0
  42. package/dist/query-keys.js +14 -0
  43. package/dist/query-options.d.ts +1096 -0
  44. package/dist/query-options.d.ts.map +1 -0
  45. package/dist/query-options.js +46 -0
  46. package/dist/schemas.d.ts +244 -0
  47. package/dist/schemas.d.ts.map +1 -0
  48. package/dist/schemas.js +11 -0
  49. package/package.json +79 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-options.d.ts","sourceRoot":"","sources":["../src/query-options.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AAU7D,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAE5B,MAAM,iBAAiB,CAAA;AAExB,wBAAgB,iCAAiC,CAAC,MAAM,EAAE,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKnF;AAED,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,0BAA0B,EAClC,WAAW,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;EAMrC;AAED,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,0BAA0B,EAClC,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMhB;AAED,YAAY,EACV,0BAA0B,EAC1B,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,iBAAiB,CAAA"}
@@ -0,0 +1,46 @@
1
+ "use client";
2
+ import { queryOptions } from "@tanstack/react-query";
3
+ import { getStorefrontDeparture, getStorefrontDepartureItinerary, getStorefrontOfferBySlug, getStorefrontSettings, listStorefrontProductDepartures, listStorefrontProductExtensions, listStorefrontProductOffers, } from "./operations.js";
4
+ import { storefrontQueryKeys, } from "./query-keys.js";
5
+ export function getStorefrontSettingsQueryOptions(client) {
6
+ return queryOptions({
7
+ queryKey: storefrontQueryKeys.settings(),
8
+ queryFn: () => getStorefrontSettings(client),
9
+ });
10
+ }
11
+ export function getStorefrontDepartureQueryOptions(client, departureId) {
12
+ return queryOptions({
13
+ queryKey: storefrontQueryKeys.departure(departureId),
14
+ queryFn: () => getStorefrontDeparture(client, departureId),
15
+ });
16
+ }
17
+ export function getStorefrontProductDeparturesQueryOptions(client, productId, filters = {}) {
18
+ return queryOptions({
19
+ queryKey: storefrontQueryKeys.productDepartures(productId, filters),
20
+ queryFn: () => listStorefrontProductDepartures(client, productId, filters),
21
+ });
22
+ }
23
+ export function getStorefrontDepartureItineraryQueryOptions(client, productId, departureId) {
24
+ return queryOptions({
25
+ queryKey: storefrontQueryKeys.departureItinerary(productId, departureId),
26
+ queryFn: () => getStorefrontDepartureItinerary(client, productId, departureId),
27
+ });
28
+ }
29
+ export function getStorefrontProductExtensionsQueryOptions(client, productId, filters = {}) {
30
+ return queryOptions({
31
+ queryKey: storefrontQueryKeys.productExtensions(productId, filters),
32
+ queryFn: () => listStorefrontProductExtensions(client, productId, filters),
33
+ });
34
+ }
35
+ export function getStorefrontProductOffersQueryOptions(client, productId, filters = {}) {
36
+ return queryOptions({
37
+ queryKey: storefrontQueryKeys.productOffers(productId, filters),
38
+ queryFn: () => listStorefrontProductOffers(client, productId, filters),
39
+ });
40
+ }
41
+ export function getStorefrontOfferQueryOptions(client, slug, locale) {
42
+ return queryOptions({
43
+ queryKey: storefrontQueryKeys.offer(slug, locale),
44
+ queryFn: () => getStorefrontOfferBySlug(client, slug, locale ? { locale } : undefined),
45
+ });
46
+ }
@@ -0,0 +1,244 @@
1
+ import { storefrontDepartureItinerarySchema, storefrontDepartureListQuerySchema, storefrontDepartureListResponseSchema, storefrontDeparturePricePreviewInputSchema, storefrontDeparturePricePreviewSchema, storefrontDepartureSchema, storefrontProductExtensionsQuerySchema, storefrontProductExtensionsResponseSchema, storefrontPromotionalOfferListQuerySchema, storefrontPromotionalOfferSchema, storefrontSettingsSchema } from "@voyantjs/storefront";
2
+ import { z } from "zod";
3
+ export declare const singleEnvelope: <T extends z.ZodTypeAny>(item: T) => z.ZodObject<{
4
+ data: T;
5
+ }, z.core.$strip>;
6
+ export declare const arrayEnvelope: <T extends z.ZodTypeAny>(item: T) => z.ZodObject<{
7
+ data: z.ZodArray<T>;
8
+ }, z.core.$strip>;
9
+ export { storefrontDepartureItinerarySchema, storefrontDepartureListQuerySchema, storefrontDepartureListResponseSchema, storefrontDeparturePricePreviewInputSchema, storefrontDeparturePricePreviewSchema, storefrontDepartureSchema, storefrontProductExtensionsQuerySchema, storefrontProductExtensionsResponseSchema, storefrontPromotionalOfferListQuerySchema, storefrontPromotionalOfferSchema, storefrontSettingsSchema, };
10
+ export declare const storefrontSettingsResponseSchema: z.ZodObject<{
11
+ data: z.ZodObject<{
12
+ branding: z.ZodObject<{
13
+ logoUrl: z.ZodNullable<z.ZodURL>;
14
+ supportedLanguages: z.ZodArray<z.ZodString>;
15
+ }, z.core.$strip>;
16
+ support: z.ZodObject<{
17
+ email: z.ZodNullable<z.ZodEmail>;
18
+ phone: z.ZodNullable<z.ZodString>;
19
+ }, z.core.$strip>;
20
+ legal: z.ZodObject<{
21
+ termsUrl: z.ZodNullable<z.ZodURL>;
22
+ privacyUrl: z.ZodNullable<z.ZodURL>;
23
+ defaultContractTemplateId: z.ZodNullable<z.ZodString>;
24
+ }, z.core.$strip>;
25
+ forms: z.ZodObject<{
26
+ billing: z.ZodObject<{
27
+ fields: z.ZodArray<z.ZodObject<{
28
+ key: z.ZodString;
29
+ label: z.ZodString;
30
+ type: z.ZodEnum<{
31
+ date: "date";
32
+ select: "select";
33
+ email: "email";
34
+ country: "country";
35
+ text: "text";
36
+ tel: "tel";
37
+ textarea: "textarea";
38
+ checkbox: "checkbox";
39
+ }>;
40
+ required: z.ZodBoolean;
41
+ placeholder: z.ZodNullable<z.ZodString>;
42
+ description: z.ZodNullable<z.ZodString>;
43
+ autocomplete: z.ZodNullable<z.ZodString>;
44
+ options: z.ZodArray<z.ZodObject<{
45
+ value: z.ZodString;
46
+ label: z.ZodString;
47
+ }, z.core.$strip>>;
48
+ }, z.core.$strip>>;
49
+ }, z.core.$strip>;
50
+ passengers: z.ZodObject<{
51
+ fields: z.ZodArray<z.ZodObject<{
52
+ key: z.ZodString;
53
+ label: z.ZodString;
54
+ type: z.ZodEnum<{
55
+ date: "date";
56
+ select: "select";
57
+ email: "email";
58
+ country: "country";
59
+ text: "text";
60
+ tel: "tel";
61
+ textarea: "textarea";
62
+ checkbox: "checkbox";
63
+ }>;
64
+ required: z.ZodBoolean;
65
+ placeholder: z.ZodNullable<z.ZodString>;
66
+ description: z.ZodNullable<z.ZodString>;
67
+ autocomplete: z.ZodNullable<z.ZodString>;
68
+ options: z.ZodArray<z.ZodObject<{
69
+ value: z.ZodString;
70
+ label: z.ZodString;
71
+ }, z.core.$strip>>;
72
+ }, z.core.$strip>>;
73
+ }, z.core.$strip>;
74
+ }, z.core.$strip>;
75
+ payment: z.ZodObject<{
76
+ defaultMethod: z.ZodNullable<z.ZodEnum<{
77
+ voucher: "voucher";
78
+ card: "card";
79
+ bank_transfer: "bank_transfer";
80
+ cash: "cash";
81
+ invoice: "invoice";
82
+ }>>;
83
+ methods: z.ZodArray<z.ZodObject<{
84
+ code: z.ZodEnum<{
85
+ voucher: "voucher";
86
+ card: "card";
87
+ bank_transfer: "bank_transfer";
88
+ cash: "cash";
89
+ invoice: "invoice";
90
+ }>;
91
+ label: z.ZodString;
92
+ description: z.ZodNullable<z.ZodString>;
93
+ enabled: z.ZodBoolean;
94
+ }, z.core.$strip>>;
95
+ }, z.core.$strip>;
96
+ }, z.core.$strip>;
97
+ }, z.core.$strip>;
98
+ export declare const storefrontDepartureResponseSchema: z.ZodObject<{
99
+ data: z.ZodObject<{
100
+ id: z.ZodString;
101
+ productId: z.ZodString;
102
+ itineraryId: z.ZodString;
103
+ optionId: z.ZodNullable<z.ZodString>;
104
+ dateLocal: z.ZodNullable<z.ZodString>;
105
+ startAt: z.ZodNullable<z.ZodString>;
106
+ endAt: z.ZodNullable<z.ZodString>;
107
+ timezone: z.ZodString;
108
+ startTime: z.ZodNullable<z.ZodObject<{
109
+ id: z.ZodString;
110
+ label: z.ZodNullable<z.ZodString>;
111
+ startTimeLocal: z.ZodString;
112
+ durationMinutes: z.ZodNullable<z.ZodNumber>;
113
+ }, z.core.$strip>>;
114
+ meetingPoint: z.ZodNullable<z.ZodString>;
115
+ capacity: z.ZodNullable<z.ZodNumber>;
116
+ remaining: z.ZodNullable<z.ZodNumber>;
117
+ departureStatus: z.ZodEnum<{
118
+ open: "open";
119
+ closed: "closed";
120
+ sold_out: "sold_out";
121
+ cancelled: "cancelled";
122
+ on_request: "on_request";
123
+ }>;
124
+ nights: z.ZodNullable<z.ZodNumber>;
125
+ days: z.ZodNullable<z.ZodNumber>;
126
+ ratePlans: z.ZodArray<z.ZodObject<{
127
+ id: z.ZodString;
128
+ active: z.ZodBoolean;
129
+ name: z.ZodString;
130
+ pricingModel: z.ZodString;
131
+ basePrices: z.ZodArray<z.ZodObject<{
132
+ amount: z.ZodNumber;
133
+ currencyCode: z.ZodString;
134
+ }, z.core.$strip>>;
135
+ roomPrices: z.ZodArray<z.ZodObject<{
136
+ amount: z.ZodNumber;
137
+ currencyCode: z.ZodString;
138
+ roomType: z.ZodObject<{
139
+ id: z.ZodString;
140
+ name: z.ZodString;
141
+ occupancy: z.ZodObject<{
142
+ adultsMin: z.ZodNumber;
143
+ adultsMax: z.ZodNumber;
144
+ childrenMax: z.ZodNumber;
145
+ }, z.core.$strip>;
146
+ }, z.core.$strip>;
147
+ }, z.core.$strip>>;
148
+ }, z.core.$strip>>;
149
+ }, z.core.$strip>;
150
+ }, z.core.$strip>;
151
+ export declare const storefrontDeparturePricePreviewResponseSchema: z.ZodObject<{
152
+ data: z.ZodObject<{
153
+ departureId: z.ZodString;
154
+ productId: z.ZodString;
155
+ optionId: z.ZodNullable<z.ZodString>;
156
+ currencyCode: z.ZodString;
157
+ basePrice: z.ZodNumber;
158
+ taxAmount: z.ZodNumber;
159
+ total: z.ZodNumber;
160
+ notes: z.ZodNullable<z.ZodString>;
161
+ lineItems: z.ZodArray<z.ZodObject<{
162
+ name: z.ZodString;
163
+ total: z.ZodNumber;
164
+ quantity: z.ZodNumber;
165
+ unitPrice: z.ZodNumber;
166
+ }, z.core.$strip>>;
167
+ }, z.core.$strip>;
168
+ }, z.core.$strip>;
169
+ export declare const storefrontDepartureItineraryResponseSchema: z.ZodObject<{
170
+ data: z.ZodObject<{
171
+ id: z.ZodString;
172
+ days: z.ZodArray<z.ZodObject<{
173
+ id: z.ZodString;
174
+ title: z.ZodString;
175
+ description: z.ZodNullable<z.ZodString>;
176
+ thumbnail: z.ZodNullable<z.ZodObject<{
177
+ url: z.ZodString;
178
+ }, z.core.$strip>>;
179
+ segments: z.ZodArray<z.ZodObject<{
180
+ id: z.ZodString;
181
+ title: z.ZodString;
182
+ description: z.ZodNullable<z.ZodString>;
183
+ }, z.core.$strip>>;
184
+ }, z.core.$strip>>;
185
+ }, z.core.$strip>;
186
+ }, z.core.$strip>;
187
+ export declare const storefrontPromotionalOfferListResponseSchema: z.ZodObject<{
188
+ data: z.ZodArray<z.ZodObject<{
189
+ id: z.ZodString;
190
+ name: z.ZodString;
191
+ slug: z.ZodNullable<z.ZodString>;
192
+ description: z.ZodNullable<z.ZodString>;
193
+ discountType: z.ZodEnum<{
194
+ percentage: "percentage";
195
+ fixed_amount: "fixed_amount";
196
+ }>;
197
+ discountValue: z.ZodString;
198
+ currency: z.ZodNullable<z.ZodString>;
199
+ applicableProductIds: z.ZodArray<z.ZodString>;
200
+ applicableDepartureIds: z.ZodArray<z.ZodString>;
201
+ validFrom: z.ZodNullable<z.ZodString>;
202
+ validTo: z.ZodNullable<z.ZodString>;
203
+ minPassengers: z.ZodNullable<z.ZodNumber>;
204
+ imageMobileUrl: z.ZodNullable<z.ZodString>;
205
+ imageDesktopUrl: z.ZodNullable<z.ZodString>;
206
+ stackable: z.ZodBoolean;
207
+ createdAt: z.ZodString;
208
+ updatedAt: z.ZodString;
209
+ }, z.core.$strip>>;
210
+ }, z.core.$strip>;
211
+ export declare const storefrontPromotionalOfferResponseSchema: z.ZodObject<{
212
+ data: z.ZodObject<{
213
+ id: z.ZodString;
214
+ name: z.ZodString;
215
+ slug: z.ZodNullable<z.ZodString>;
216
+ description: z.ZodNullable<z.ZodString>;
217
+ discountType: z.ZodEnum<{
218
+ percentage: "percentage";
219
+ fixed_amount: "fixed_amount";
220
+ }>;
221
+ discountValue: z.ZodString;
222
+ currency: z.ZodNullable<z.ZodString>;
223
+ applicableProductIds: z.ZodArray<z.ZodString>;
224
+ applicableDepartureIds: z.ZodArray<z.ZodString>;
225
+ validFrom: z.ZodNullable<z.ZodString>;
226
+ validTo: z.ZodNullable<z.ZodString>;
227
+ minPassengers: z.ZodNullable<z.ZodNumber>;
228
+ imageMobileUrl: z.ZodNullable<z.ZodString>;
229
+ imageDesktopUrl: z.ZodNullable<z.ZodString>;
230
+ stackable: z.ZodBoolean;
231
+ createdAt: z.ZodString;
232
+ updatedAt: z.ZodString;
233
+ }, z.core.$strip>;
234
+ }, z.core.$strip>;
235
+ export type StorefrontSettingsRecord = z.infer<typeof storefrontSettingsSchema>;
236
+ export type StorefrontDepartureRecord = z.infer<typeof storefrontDepartureSchema>;
237
+ export type StorefrontDepartureListQuery = z.input<typeof storefrontDepartureListQuerySchema>;
238
+ export type StorefrontDeparturePricePreviewInput = z.input<typeof storefrontDeparturePricePreviewInputSchema>;
239
+ export type StorefrontDeparturePricePreviewRecord = z.infer<typeof storefrontDeparturePricePreviewSchema>;
240
+ export type StorefrontDepartureItineraryRecord = z.infer<typeof storefrontDepartureItinerarySchema>;
241
+ export type StorefrontProductExtensionsQuery = z.input<typeof storefrontProductExtensionsQuerySchema>;
242
+ export type StorefrontPromotionalOfferListQuery = z.input<typeof storefrontPromotionalOfferListQuerySchema>;
243
+ export type StorefrontPromotionalOfferRecord = z.infer<typeof storefrontPromotionalOfferSchema>;
244
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kCAAkC,EAClC,kCAAkC,EAClC,qCAAqC,EACrC,0CAA0C,EAC1C,qCAAqC,EACrC,yBAAyB,EACzB,sCAAsC,EACtC,yCAAyC,EACzC,yCAAyC,EACzC,gCAAgC,EAChC,wBAAwB,EACzB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC;;iBAA6B,CAAA;AAC3F,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC;;iBAAsC,CAAA;AAEnG,OAAO,EACL,kCAAkC,EAClC,kCAAkC,EAClC,qCAAqC,EACrC,0CAA0C,EAC1C,qCAAqC,EACrC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O,yCAAyC,CACjD,CAAA;AACD,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { storefrontDepartureItinerarySchema, storefrontDepartureListQuerySchema, storefrontDepartureListResponseSchema, storefrontDeparturePricePreviewInputSchema, storefrontDeparturePricePreviewSchema, storefrontDepartureSchema, storefrontProductExtensionsQuerySchema, storefrontProductExtensionsResponseSchema, storefrontPromotionalOfferListQuerySchema, storefrontPromotionalOfferSchema, storefrontSettingsSchema, } from "@voyantjs/storefront";
2
+ import { z } from "zod";
3
+ export const singleEnvelope = (item) => z.object({ data: item });
4
+ export const arrayEnvelope = (item) => z.object({ data: z.array(item) });
5
+ export { storefrontDepartureItinerarySchema, storefrontDepartureListQuerySchema, storefrontDepartureListResponseSchema, storefrontDeparturePricePreviewInputSchema, storefrontDeparturePricePreviewSchema, storefrontDepartureSchema, storefrontProductExtensionsQuerySchema, storefrontProductExtensionsResponseSchema, storefrontPromotionalOfferListQuerySchema, storefrontPromotionalOfferSchema, storefrontSettingsSchema, };
6
+ export const storefrontSettingsResponseSchema = singleEnvelope(storefrontSettingsSchema);
7
+ export const storefrontDepartureResponseSchema = singleEnvelope(storefrontDepartureSchema);
8
+ export const storefrontDeparturePricePreviewResponseSchema = singleEnvelope(storefrontDeparturePricePreviewSchema);
9
+ export const storefrontDepartureItineraryResponseSchema = singleEnvelope(storefrontDepartureItinerarySchema);
10
+ export const storefrontPromotionalOfferListResponseSchema = arrayEnvelope(storefrontPromotionalOfferSchema);
11
+ export const storefrontPromotionalOfferResponseSchema = singleEnvelope(storefrontPromotionalOfferSchema);
package/package.json ADDED
@@ -0,0 +1,79 @@
1
+ {
2
+ "name": "@voyantjs/storefront-react",
3
+ "version": "0.4.0",
4
+ "license": "FSL-1.1-Apache-2.0",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/voyantjs/voyant.git",
8
+ "directory": "packages/storefront-react"
9
+ },
10
+ "type": "module",
11
+ "exports": {
12
+ ".": "./src/index.ts",
13
+ "./provider": "./src/provider.tsx",
14
+ "./hooks": "./src/hooks/index.ts",
15
+ "./client": "./src/client.ts",
16
+ "./query-keys": "./src/query-keys.ts"
17
+ },
18
+ "scripts": {
19
+ "build": "tsc -p tsconfig.json",
20
+ "clean": "rm -rf dist",
21
+ "prepack": "pnpm run build",
22
+ "typecheck": "tsc --noEmit",
23
+ "lint": "biome check src/",
24
+ "test": "vitest run --passWithNoTests"
25
+ },
26
+ "peerDependencies": {
27
+ "@voyantjs/storefront": "workspace:*",
28
+ "@tanstack/react-query": "^5.0.0",
29
+ "react": "^19.0.0",
30
+ "react-dom": "^19.0.0",
31
+ "zod": "^4.0.0"
32
+ },
33
+ "devDependencies": {
34
+ "@tanstack/react-query": "^5.96.2",
35
+ "@types/react": "^19.2.14",
36
+ "@types/react-dom": "^19.2.3",
37
+ "@voyantjs/react": "workspace:*",
38
+ "@voyantjs/storefront": "workspace:*",
39
+ "@voyantjs/voyant-typescript-config": "workspace:*",
40
+ "react": "^19.2.4",
41
+ "react-dom": "^19.2.4",
42
+ "typescript": "^6.0.2",
43
+ "vitest": "^4.1.2",
44
+ "zod": "^4.3.6"
45
+ },
46
+ "dependencies": {
47
+ "@voyantjs/react": "workspace:*"
48
+ },
49
+ "files": [
50
+ "dist"
51
+ ],
52
+ "publishConfig": {
53
+ "access": "public",
54
+ "exports": {
55
+ ".": {
56
+ "types": "./dist/index.d.ts",
57
+ "import": "./dist/index.js"
58
+ },
59
+ "./provider": {
60
+ "types": "./dist/provider.d.ts",
61
+ "import": "./dist/provider.js"
62
+ },
63
+ "./hooks": {
64
+ "types": "./dist/hooks/index.d.ts",
65
+ "import": "./dist/hooks/index.js"
66
+ },
67
+ "./client": {
68
+ "types": "./dist/client.d.ts",
69
+ "import": "./dist/client.js"
70
+ },
71
+ "./query-keys": {
72
+ "types": "./dist/query-keys.d.ts",
73
+ "import": "./dist/query-keys.js"
74
+ }
75
+ },
76
+ "main": "./dist/index.js",
77
+ "types": "./dist/index.d.ts"
78
+ }
79
+ }