@replohq/sdk 1.22.0 → 2.0.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 (117) hide show
  1. package/_vendor/replo-utils/lib/json.mjs +4 -5
  2. package/_vendor/replo-utils/lib/misc.mjs +4 -3
  3. package/_vendor/replo-utils/lib/object.d.ts +16 -1
  4. package/_vendor/replo-utils/lib/object.mjs +3 -4
  5. package/_vendor/schemas/contentEntry.mjs +3 -3
  6. package/_vendor/schemas/contentManifest.mjs +6 -6
  7. package/_vendor/schemas/errors.d.ts +3 -43
  8. package/_vendor/schemas/{money.d.ts → moneyFormat.d.ts} +1 -8
  9. package/_vendor/schemas/{money.mjs → moneyFormat.mjs} +5 -16
  10. package/_vendor/schemas/reploError.d.ts +43 -0
  11. package/_vendor/schemas/routing/locale.mjs +6 -4
  12. package/_vendor/schemas/routing/rules.mjs +6 -4
  13. package/analytics/analytics-sink.d.ts +126 -14
  14. package/analytics/combine-sinks.js +36 -13
  15. package/analytics/hooks/use-product-viewed-analytics.d.ts +1 -17
  16. package/analytics/hooks/use-product-viewed-analytics.js +5 -14
  17. package/analytics/legacy-checkout.d.ts +2 -0
  18. package/analytics/legacy-checkout.js +26 -0
  19. package/analytics/sinks/converge-event-mapper.d.ts +10 -11
  20. package/analytics/sinks/converge-event-mapper.js +50 -133
  21. package/analytics/sinks/converge-sink.d.ts +8 -7
  22. package/analytics/sinks/converge-sink.js +21 -3
  23. package/analytics/sinks/elevar-sink.d.ts +9 -7
  24. package/analytics/sinks/elevar-sink.js +37 -128
  25. package/analytics/sinks/ga4-sink.d.ts +9 -8
  26. package/analytics/sinks/ga4-sink.js +9 -8
  27. package/analytics/sinks/intelligems-sink.d.ts +9 -8
  28. package/analytics/sinks/intelligems-sink.js +3 -1
  29. package/analytics/sinks/meta-sink.d.ts +5 -4
  30. package/analytics/sinks/meta-sink.js +7 -3
  31. package/analytics/sinks/northbeam-sink.d.ts +1 -0
  32. package/analytics/sinks/northbeam-sink.js +2 -0
  33. package/analytics/sinks/pinterest-sink.d.ts +7 -6
  34. package/analytics/sinks/pinterest-sink.js +14 -20
  35. package/analytics/sinks/reddit-sink.d.ts +8 -7
  36. package/analytics/sinks/reddit-sink.js +13 -20
  37. package/analytics/sinks/replo-sink.d.ts +21 -9
  38. package/analytics/sinks/replo-sink.js +37 -39
  39. package/analytics/sinks/snapchat-sink.d.ts +6 -5
  40. package/analytics/sinks/snapchat-sink.js +8 -8
  41. package/analytics/sinks/tiktok-sink.d.ts +8 -7
  42. package/analytics/sinks/tiktok-sink.js +10 -15
  43. package/analytics/sinks/window-sink.d.ts +11 -9
  44. package/analytics/sinks/window-sink.js +5 -1
  45. package/analytics/sinks/x-sink.d.ts +5 -4
  46. package/analytics/sinks/x-sink.js +19 -50
  47. package/analytics/test-fixtures.d.ts +5 -0
  48. package/analytics/test-fixtures.js +18 -0
  49. package/analytics/utils/analytics-products.d.ts +0 -30
  50. package/analytics/utils/analytics-products.js +1 -51
  51. package/analytics/utils/collection-analytics.d.ts +2 -15
  52. package/analytics/utils/collection-analytics.js +14 -18
  53. package/analytics/utils/product-analytics.d.ts +23 -0
  54. package/analytics/utils/product-analytics.js +21 -0
  55. package/cart/hooks/use-add-to-cart.js +1 -1
  56. package/cart/utils/cart-analytics.d.ts +3 -23
  57. package/cart/utils/cart-analytics.js +1 -1
  58. package/cart/utils/cart-utils.js +1 -1
  59. package/cart/utils/variant-to-cart-line.js +1 -1
  60. package/chunk-CKRRL66R.mjs +28 -0
  61. package/{chunk-VVB7BEDE.mjs → chunk-O4QBR4QC.mjs} +9 -4
  62. package/{chunk-EUIVDITZ.mjs → chunk-OPKMOW43.mjs} +1 -1
  63. package/{chunk-C37TXOGI.mjs → chunk-PSYP2DYM.mjs} +1 -1
  64. package/{chunk-ACQS4AG5.mjs → chunk-TTEBDCWT.mjs} +272 -109
  65. package/{chunk-HFKL4ZR5.mjs → chunk-XGXJOHUY.mjs} +2 -1
  66. package/{chunk-AQG3256R.mjs → chunk-XSMYSAKY.mjs} +0 -26
  67. package/{chunk-SSBIMQES.mjs → chunk-XWWFRIXV.mjs} +36 -99
  68. package/chunk-ZPDXVFCR.mjs +66 -0
  69. package/hooks/use-formatted-price.js +1 -1
  70. package/lib/buildMetadata.js +3 -3
  71. package/loaders/collection-loader.js +8 -6
  72. package/loaders/collection-products-loader.js +8 -6
  73. package/loaders/contentful-entries-loader.js +5 -3
  74. package/loaders/contentful-entry-loader.js +5 -3
  75. package/loaders/integration-loader-schemas.d.ts +260 -0
  76. package/loaders/integration-loader-schemas.js +55 -0
  77. package/loaders/invoke-loader.d.ts +5 -0
  78. package/loaders/invoke-loader.js +1 -1
  79. package/loaders/judgeme-review-aggregate-loader.d.ts +1 -1
  80. package/loaders/judgeme-review-aggregate-loader.js +10 -6
  81. package/loaders/judgeme-reviews-loader.d.ts +1 -1
  82. package/loaders/judgeme-reviews-loader.js +5 -3
  83. package/loaders/kaching-bundles-loader.js +5 -3
  84. package/loaders/levanta-product-loader.js +8 -6
  85. package/loaders/loox-review-aggregate-loader.d.ts +1 -1
  86. package/loaders/loox-review-aggregate-loader.js +10 -6
  87. package/loaders/loox-reviews-loader.d.ts +1 -1
  88. package/loaders/loox-reviews-loader.js +8 -6
  89. package/loaders/metaobject-loader.js +5 -3
  90. package/loaders/metaobjects-loader.js +5 -3
  91. package/loaders/okendo-review-aggregate-loader.d.ts +2 -7
  92. package/loaders/okendo-review-aggregate-loader.js +8 -12
  93. package/loaders/okendo-reviews-loader.d.ts +2 -42
  94. package/loaders/okendo-reviews-loader.js +5 -8
  95. package/loaders/product-loader.js +5 -3
  96. package/loaders/rebuy-recommendations-loader.d.ts +2 -167
  97. package/loaders/rebuy-recommendations-loader.js +8 -10
  98. package/loaders/reviews-io-review-aggregate-loader.d.ts +1 -1
  99. package/loaders/reviews-io-review-aggregate-loader.js +5 -3
  100. package/loaders/reviews-io-reviews-loader.d.ts +1 -1
  101. package/loaders/reviews-io-reviews-loader.js +7 -3
  102. package/loaders/shopify-integration-details-loader.js +10 -6
  103. package/loaders/smile-earning-rules-loader.d.ts +2 -8
  104. package/loaders/smile-earning-rules-loader.js +8 -16
  105. package/loaders/smile-rewards-loader.d.ts +2 -8
  106. package/loaders/smile-rewards-loader.js +8 -16
  107. package/loaders/smile-vip-tiers-loader.d.ts +2 -7
  108. package/loaders/smile-vip-tiers-loader.js +8 -15
  109. package/loaders/statsig-experiment-loader.js +5 -3
  110. package/loaders/yotpo-review-aggregate-loader.d.ts +1 -1
  111. package/loaders/yotpo-review-aggregate-loader.js +10 -6
  112. package/loaders/yotpo-reviews-loader.d.ts +1 -1
  113. package/loaders/yotpo-reviews-loader.js +5 -3
  114. package/money.d.ts +1 -1
  115. package/money.js +1 -1
  116. package/package.json +8 -4
  117. package/chunk-CQYCPDPI.mjs +0 -166
@@ -1,46 +1,6 @@
1
1
  import type { ReactNode } from "react";
2
- import * as z from "zod";
3
- declare const okendoReviewsOutputSchema: z.ZodObject<{
4
- reviews: z.ZodArray<z.ZodObject<{
5
- id: z.ZodString;
6
- title: z.ZodOptional<z.ZodString>;
7
- body: z.ZodOptional<z.ZodString>;
8
- rating: z.ZodOptional<z.ZodNumber>;
9
- productName: z.ZodOptional<z.ZodString>;
10
- productVariantName: z.ZodOptional<z.ZodString>;
11
- reviewerName: z.ZodOptional<z.ZodString>;
12
- reviewerIsVerified: z.ZodOptional<z.ZodBoolean>;
13
- reviewerLocation: z.ZodOptional<z.ZodString>;
14
- reviewerCountryCode: z.ZodOptional<z.ZodString>;
15
- reviewerAvatarUrl: z.ZodOptional<z.ZodString>;
16
- reviewerVerifiedStatus: z.ZodOptional<z.ZodString>;
17
- reviewerSocialConnection: z.ZodOptional<z.ZodString>;
18
- source: z.ZodOptional<z.ZodString>;
19
- dateCreated: z.ZodOptional<z.ZodString>;
20
- status: z.ZodOptional<z.ZodString>;
21
- isRecommended: z.ZodOptional<z.ZodBoolean>;
22
- helpfulCount: z.ZodOptional<z.ZodNumber>;
23
- media: z.ZodOptional<z.ZodArray<z.ZodObject<{
24
- type: z.ZodString;
25
- thumbnailUrl: z.ZodOptional<z.ZodString>;
26
- largeUrl: z.ZodOptional<z.ZodString>;
27
- fullSizeUrl: z.ZodOptional<z.ZodString>;
28
- largePortraitThumbnailUrl: z.ZodOptional<z.ZodString>;
29
- videoPosterUrl: z.ZodOptional<z.ZodString>;
30
- videoWebmUrl: z.ZodOptional<z.ZodString>;
31
- alt: z.ZodOptional<z.ZodString>;
32
- }, z.core.$strip>>>;
33
- attributes: z.ZodOptional<z.ZodArray<z.ZodObject<{
34
- title: z.ZodString;
35
- value: z.ZodString;
36
- }, z.core.$strip>>>;
37
- reply: z.ZodOptional<z.ZodObject<{
38
- body: z.ZodString;
39
- dateCreated: z.ZodOptional<z.ZodString>;
40
- }, z.core.$strip>>;
41
- }, z.core.$strip>>;
42
- nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
43
- }, z.core.$strip>;
2
+ import type { z } from "zod";
3
+ import type { okendoReviewsOutputSchema } from "./integration-loader-schemas";
44
4
  type OkendoReviewsData = z.infer<typeof okendoReviewsOutputSchema>;
45
5
  /** Sort orders Okendo supports; `has_media desc` puts reviews with photos or videos first. */
46
6
  export type OkendoReviewOrder = "date desc" | "date asc" | "rating desc" | "rating asc" | "helpful desc" | "has_media desc";
@@ -2,14 +2,8 @@
2
2
  import { Fragment, jsx } from "react/jsx-runtime";
3
3
  import { Suspense } from "react";
4
4
  import { useSuspenseQuery } from "@tanstack/react-query";
5
- import * as z from "zod";
6
5
  import { invokeLoader } from "./invoke-loader";
7
6
  import { LoaderErrorBoundary } from "./loader-error-boundary";
8
- import { okendoReviewSchema } from "./loader-schemas";
9
- const okendoReviewsOutputSchema = z.object({
10
- reviews: z.array(okendoReviewSchema),
11
- nextCursor: z.string().nullish()
12
- });
13
7
  function OkendoReviewsLoaderInner({
14
8
  loaderKey,
15
9
  shopifyProductId,
@@ -22,8 +16,11 @@ function OkendoReviewsLoaderInner({
22
16
  const queryResult = useSuspenseQuery({
23
17
  queryKey: [loaderKey, args],
24
18
  queryFn: async () => {
25
- const loadedData = await invokeLoader({ loaderKey, args });
26
- return okendoReviewsOutputSchema.parse(loadedData);
19
+ const [loadedData, schemas] = await Promise.all([
20
+ invokeLoader({ loaderKey, args }),
21
+ import("./integration-loader-schemas")
22
+ ]);
23
+ return schemas.okendoReviewsOutputSchema.parse(loadedData);
27
24
  }
28
25
  });
29
26
  return /* @__PURE__ */ jsx(Fragment, { children: children(queryResult.data) });
@@ -4,7 +4,6 @@ import { Suspense } from "react";
4
4
  import { useSuspenseQuery } from "@tanstack/react-query";
5
5
  import { invokeLoader } from "./invoke-loader";
6
6
  import { LoaderErrorBoundary } from "./loader-error-boundary";
7
- import { fullProductSchema } from "./loader-schemas";
8
7
  import { useReportPreviewPlaceholderRender } from "./preview-placeholder";
9
8
  import { buildProductLoaderArgs } from "./product-loader-args";
10
9
  function ProductLoaderInner({
@@ -15,8 +14,11 @@ function ProductLoaderInner({
15
14
  const queryResult = useSuspenseQuery({
16
15
  queryKey: [loaderKey, args],
17
16
  queryFn: async () => {
18
- const loadedData = await invokeLoader({ loaderKey, args });
19
- return fullProductSchema.parse(loadedData);
17
+ const [loadedData, schemas] = await Promise.all([
18
+ invokeLoader({ loaderKey, args }),
19
+ import("./loader-schemas")
20
+ ]);
21
+ return schemas.fullProductSchema.parse(loadedData);
20
22
  }
21
23
  });
22
24
  useReportPreviewPlaceholderRender(queryResult.data);
@@ -1,171 +1,6 @@
1
1
  import type { ReactNode } from "react";
2
- import * as z from "zod";
3
- declare const rebuyRecommendationsOutputSchema: z.ZodObject<{
4
- products: z.ZodArray<z.ZodObject<{
5
- id: z.ZodString;
6
- handle: z.ZodOptional<z.ZodString>;
7
- title: z.ZodOptional<z.ZodString>;
8
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9
- descriptionHtml: z.ZodOptional<z.ZodNullable<z.ZodString>>;
10
- availableForSale: z.ZodOptional<z.ZodBoolean>;
11
- status: z.ZodOptional<z.ZodEnum<{
12
- ACTIVE: "ACTIVE";
13
- DRAFT: "DRAFT";
14
- ARCHIVED: "ARCHIVED";
15
- UNLISTED: "UNLISTED";
16
- }>>;
17
- featuredImage: z.ZodOptional<z.ZodNullable<z.ZodObject<{
18
- url: z.ZodString;
19
- altText: z.ZodNullable<z.ZodString>;
20
- width: z.ZodNullable<z.ZodNumber>;
21
- height: z.ZodNullable<z.ZodNumber>;
22
- }, z.core.$strip>>>;
23
- options: z.ZodOptional<z.ZodArray<z.ZodObject<{
24
- id: z.ZodOptional<z.ZodString>;
25
- name: z.ZodString;
26
- values: z.ZodArray<z.ZodString>;
27
- optionValues: z.ZodOptional<z.ZodArray<z.ZodObject<{
28
- id: z.ZodString;
29
- value: z.ZodString;
30
- swatch: z.ZodNullable<z.ZodObject<{
31
- color: z.ZodNullable<z.ZodString>;
32
- imageUrl: z.ZodNullable<z.ZodString>;
33
- }, z.core.$strip>>;
34
- }, z.core.$strip>>>;
35
- }, z.core.$strip>>>;
36
- variants: z.ZodOptional<z.ZodArray<z.ZodObject<{
37
- id: z.ZodString;
38
- title: z.ZodOptional<z.ZodString>;
39
- availableForSale: z.ZodOptional<z.ZodBoolean>;
40
- isLowStock: z.ZodOptional<z.ZodBoolean>;
41
- sku: z.ZodOptional<z.ZodNullable<z.ZodString>>;
42
- selectedOptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
43
- name: z.ZodString;
44
- value: z.ZodString;
45
- }, z.core.$strip>>>;
46
- image: z.ZodOptional<z.ZodNullable<z.ZodObject<{
47
- url: z.ZodString;
48
- altText: z.ZodNullable<z.ZodString>;
49
- width: z.ZodNullable<z.ZodNumber>;
50
- height: z.ZodNullable<z.ZodNumber>;
51
- }, z.core.$strip>>>;
52
- price: z.ZodOptional<z.ZodObject<{
53
- amount: z.ZodString;
54
- currencyCode: z.ZodString;
55
- }, z.core.$strip>>;
56
- compareAtPrice: z.ZodOptional<z.ZodNullable<z.ZodObject<{
57
- amount: z.ZodString;
58
- currencyCode: z.ZodString;
59
- }, z.core.$strip>>>;
60
- sellingPlanIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
61
- }, z.core.$strip>>>;
62
- minPrice: z.ZodOptional<z.ZodObject<{
63
- amount: z.ZodString;
64
- currencyCode: z.ZodString;
65
- }, z.core.$strip>>;
66
- maxPrice: z.ZodOptional<z.ZodObject<{
67
- amount: z.ZodString;
68
- currencyCode: z.ZodString;
69
- }, z.core.$strip>>;
70
- compareAtMinPrice: z.ZodOptional<z.ZodObject<{
71
- amount: z.ZodString;
72
- currencyCode: z.ZodString;
73
- }, z.core.$strip>>;
74
- compareAtMaxPrice: z.ZodOptional<z.ZodObject<{
75
- amount: z.ZodString;
76
- currencyCode: z.ZodString;
77
- }, z.core.$strip>>;
78
- images: z.ZodOptional<z.ZodArray<z.ZodObject<{
79
- url: z.ZodString;
80
- altText: z.ZodNullable<z.ZodString>;
81
- width: z.ZodNullable<z.ZodNumber>;
82
- height: z.ZodNullable<z.ZodNumber>;
83
- }, z.core.$strip>>>;
84
- media: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
85
- type: z.ZodLiteral<"image">;
86
- alt: z.ZodNullable<z.ZodString>;
87
- url: z.ZodString;
88
- width: z.ZodNullable<z.ZodNumber>;
89
- height: z.ZodNullable<z.ZodNumber>;
90
- }, z.core.$strip>, z.ZodObject<{
91
- type: z.ZodLiteral<"video">;
92
- alt: z.ZodNullable<z.ZodString>;
93
- sources: z.ZodArray<z.ZodObject<{
94
- url: z.ZodString;
95
- mimeType: z.ZodString;
96
- format: z.ZodString;
97
- width: z.ZodNullable<z.ZodNumber>;
98
- height: z.ZodNullable<z.ZodNumber>;
99
- }, z.core.$strip>>;
100
- previewImage: z.ZodNullable<z.ZodObject<{
101
- alt: z.ZodNullable<z.ZodString>;
102
- url: z.ZodString;
103
- width: z.ZodNullable<z.ZodNumber>;
104
- height: z.ZodNullable<z.ZodNumber>;
105
- }, z.core.$strip>>;
106
- }, z.core.$strip>, z.ZodObject<{
107
- type: z.ZodLiteral<"externalVideo">;
108
- alt: z.ZodNullable<z.ZodString>;
109
- embedUrl: z.ZodString;
110
- host: z.ZodString;
111
- originUrl: z.ZodString;
112
- previewImage: z.ZodNullable<z.ZodObject<{
113
- alt: z.ZodNullable<z.ZodString>;
114
- url: z.ZodString;
115
- width: z.ZodNullable<z.ZodNumber>;
116
- height: z.ZodNullable<z.ZodNumber>;
117
- }, z.core.$strip>>;
118
- }, z.core.$strip>], "type">>>;
119
- vendor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
120
- productType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
121
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
122
- sellingPlanGroups: z.ZodOptional<z.ZodArray<z.ZodObject<{
123
- appId: z.ZodNullable<z.ZodString>;
124
- options: z.ZodArray<z.ZodObject<{
125
- name: z.ZodString;
126
- values: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
127
- }, z.core.$strip>>;
128
- sellingPlans: z.ZodArray<z.ZodObject<{
129
- id: z.ZodString;
130
- name: z.ZodString;
131
- description: z.ZodNullable<z.ZodString>;
132
- optionValues: z.ZodArray<z.ZodObject<{
133
- name: z.ZodOptional<z.ZodString>;
134
- value: z.ZodString;
135
- }, z.core.$strip>>;
136
- priceAdjustments: z.ZodArray<z.ZodObject<{
137
- value: z.ZodNumber;
138
- valueType: z.ZodEnum<{
139
- price: "price";
140
- percentage: "percentage";
141
- fixedAmount: "fixedAmount";
142
- }>;
143
- }, z.core.$strip>>;
144
- appId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
145
- price: z.ZodOptional<z.ZodString>;
146
- externalId: z.ZodNullable<z.ZodString>;
147
- }, z.core.$strip>>;
148
- }, z.core.$strip>>>;
149
- requiresSellingPlan: z.ZodOptional<z.ZodBoolean>;
150
- metafields: z.ZodOptional<z.ZodArray<z.ZodObject<{
151
- key: z.ZodString;
152
- namespace: z.ZodString;
153
- type: z.ZodString;
154
- value: z.ZodString;
155
- reference: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
156
- kind: z.ZodLiteral<"image">;
157
- url: z.ZodNullable<z.ZodString>;
158
- }, z.core.$strip>, z.ZodObject<{
159
- kind: z.ZodLiteral<"file">;
160
- url: z.ZodNullable<z.ZodString>;
161
- }, z.core.$strip>, z.ZodObject<{
162
- kind: z.ZodLiteral<"video">;
163
- url: z.ZodNullable<z.ZodString>;
164
- previewUrl: z.ZodNullable<z.ZodString>;
165
- }, z.core.$strip>], "kind">>>;
166
- }, z.core.$strip>>>;
167
- }, z.core.$strip>>;
168
- }, z.core.$strip>;
2
+ import type { z } from "zod";
3
+ import type { rebuyRecommendationsOutputSchema } from "./integration-loader-schemas";
169
4
  type RebuyRecommendationsData = z.infer<typeof rebuyRecommendationsOutputSchema>;
170
5
  type RebuyRecommendationsLoaderProps = {
171
6
  loaderKey: string;
@@ -2,13 +2,8 @@
2
2
  import { Fragment, jsx } from "react/jsx-runtime";
3
3
  import { Suspense } from "react";
4
4
  import { useSuspenseQuery } from "@tanstack/react-query";
5
- import * as z from "zod";
6
5
  import { invokeLoader } from "./invoke-loader";
7
6
  import { LoaderErrorBoundary } from "./loader-error-boundary";
8
- import { productSchema } from "./loader-schemas";
9
- const rebuyRecommendationsOutputSchema = z.object({
10
- products: z.array(productSchema)
11
- });
12
7
  function RebuyRecommendationsLoaderInner({
13
8
  loaderKey,
14
9
  shopifyProductIds,
@@ -18,11 +13,14 @@ function RebuyRecommendationsLoaderInner({
18
13
  const queryResult = useSuspenseQuery({
19
14
  queryKey: [loaderKey, { shopifyProductIds, limit }],
20
15
  queryFn: async () => {
21
- const loadedData = await invokeLoader({
22
- loaderKey,
23
- args: { shopifyProductIds, limit }
24
- });
25
- return rebuyRecommendationsOutputSchema.parse(loadedData);
16
+ const [loadedData, schemas] = await Promise.all([
17
+ invokeLoader({
18
+ loaderKey,
19
+ args: { shopifyProductIds, limit }
20
+ }),
21
+ import("./integration-loader-schemas")
22
+ ]);
23
+ return schemas.rebuyRecommendationsOutputSchema.parse(loadedData);
26
24
  }
27
25
  });
28
26
  return /* @__PURE__ */ jsx(Fragment, { children: children(queryResult.data) });
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { z } from "zod";
3
- import { reviewsIoProductReviewAggregateLoaderOutputSchema } from "./loader-schemas";
3
+ import type { reviewsIoProductReviewAggregateLoaderOutputSchema } from "./loader-schemas";
4
4
  type ReviewsIoReviewAggregateData = z.infer<typeof reviewsIoProductReviewAggregateLoaderOutputSchema>;
5
5
  type ReviewsIoReviewAggregateLoaderProps = {
6
6
  loaderKey: string;
@@ -4,7 +4,6 @@ import { Suspense } from "react";
4
4
  import { useSuspenseQuery } from "@tanstack/react-query";
5
5
  import { invokeLoader } from "./invoke-loader";
6
6
  import { LoaderErrorBoundary } from "./loader-error-boundary";
7
- import { reviewsIoProductReviewAggregateLoaderOutputSchema } from "./loader-schemas";
8
7
  function ReviewsIoReviewAggregateLoaderInner({
9
8
  loaderKey,
10
9
  sku,
@@ -14,8 +13,11 @@ function ReviewsIoReviewAggregateLoaderInner({
14
13
  const { data } = useSuspenseQuery({
15
14
  queryKey: [loaderKey, args],
16
15
  queryFn: async () => {
17
- const loadedData = await invokeLoader({ loaderKey, args });
18
- return reviewsIoProductReviewAggregateLoaderOutputSchema.parse(
16
+ const [loadedData, schemas] = await Promise.all([
17
+ invokeLoader({ loaderKey, args }),
18
+ import("./loader-schemas")
19
+ ]);
20
+ return schemas.reviewsIoProductReviewAggregateLoaderOutputSchema.parse(
19
21
  loadedData
20
22
  );
21
23
  }
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { z } from "zod";
3
- import { reviewsIoProductReviewsLoaderOutputSchema } from "./loader-schemas";
3
+ import type { reviewsIoProductReviewsLoaderOutputSchema } from "./loader-schemas";
4
4
  type ReviewsIoReviewsData = z.infer<typeof reviewsIoProductReviewsLoaderOutputSchema>;
5
5
  type ReviewsIoReviewsLoaderProps = {
6
6
  loaderKey: string;
@@ -4,7 +4,6 @@ import { Suspense } from "react";
4
4
  import { useSuspenseQuery } from "@tanstack/react-query";
5
5
  import { invokeLoader } from "./invoke-loader";
6
6
  import { LoaderErrorBoundary } from "./loader-error-boundary";
7
- import { reviewsIoProductReviewsLoaderOutputSchema } from "./loader-schemas";
8
7
  function buildReviewsArgs({
9
8
  sku,
10
9
  perPage,
@@ -27,8 +26,13 @@ function ReviewsIoReviewsLoaderInner({
27
26
  const { data } = useSuspenseQuery({
28
27
  queryKey: [loaderKey, args],
29
28
  queryFn: async () => {
30
- const loadedData = await invokeLoader({ loaderKey, args });
31
- return reviewsIoProductReviewsLoaderOutputSchema.parse(loadedData);
29
+ const [loadedData, schemas] = await Promise.all([
30
+ invokeLoader({ loaderKey, args }),
31
+ import("./loader-schemas")
32
+ ]);
33
+ return schemas.reviewsIoProductReviewsLoaderOutputSchema.parse(
34
+ loadedData
35
+ );
32
36
  }
33
37
  });
34
38
  return /* @__PURE__ */ jsx(Fragment, { children: children(data) });
@@ -4,7 +4,6 @@ import { Suspense } from "react";
4
4
  import { useSuspenseQuery } from "@tanstack/react-query";
5
5
  import { invokeLoader } from "./invoke-loader";
6
6
  import { LoaderErrorBoundary } from "./loader-error-boundary";
7
- import { shopifyIntegrationDetailsLoaderOutputSchema } from "./loader-schemas";
8
7
  function ShopifyIntegrationDetailsLoaderInner({
9
8
  loaderKey,
10
9
  children
@@ -12,11 +11,16 @@ function ShopifyIntegrationDetailsLoaderInner({
12
11
  const { data } = useSuspenseQuery({
13
12
  queryKey: [loaderKey, {}],
14
13
  queryFn: async () => {
15
- const loadedData = await invokeLoader({
16
- loaderKey,
17
- args: {}
18
- });
19
- return shopifyIntegrationDetailsLoaderOutputSchema.parse(loadedData);
14
+ const [loadedData, schemas] = await Promise.all([
15
+ invokeLoader({
16
+ loaderKey,
17
+ args: {}
18
+ }),
19
+ import("./loader-schemas")
20
+ ]);
21
+ return schemas.shopifyIntegrationDetailsLoaderOutputSchema.parse(
22
+ loadedData
23
+ );
20
24
  }
21
25
  });
22
26
  return /* @__PURE__ */ jsx(Fragment, { children: children(data) });
@@ -1,12 +1,6 @@
1
1
  import type { ReactNode } from "react";
2
- import * as z from "zod";
3
- declare const smileEarningRuleSchema: z.ZodObject<{
4
- id: z.ZodNumber;
5
- name: z.ZodString;
6
- pointsAwarded: z.ZodNullable<z.ZodNumber>;
7
- pointsAwardedType: z.ZodString;
8
- activityToken: z.ZodString;
9
- }, z.core.$strip>;
2
+ import type { z } from "zod";
3
+ import type { smileEarningRuleSchema } from "./integration-loader-schemas";
10
4
  export type SmileEarningRule = z.infer<typeof smileEarningRuleSchema>;
11
5
  type SmileEarningRulesLoaderProps = {
12
6
  loaderKey: string;
@@ -2,19 +2,8 @@
2
2
  import { Fragment, jsx } from "react/jsx-runtime";
3
3
  import { Suspense } from "react";
4
4
  import { useSuspenseQuery } from "@tanstack/react-query";
5
- import * as z from "zod";
6
5
  import { invokeLoader } from "./invoke-loader";
7
6
  import { LoaderErrorBoundary } from "./loader-error-boundary";
8
- const smileEarningRuleSchema = z.object({
9
- id: z.number(),
10
- name: z.string(),
11
- pointsAwarded: z.number().nullable(),
12
- pointsAwardedType: z.string(),
13
- activityToken: z.string()
14
- });
15
- const smileEarningRulesOutputSchema = z.object({
16
- earningRules: z.array(smileEarningRuleSchema)
17
- });
18
7
  function SmileEarningRulesLoaderInner({
19
8
  loaderKey,
20
9
  children
@@ -22,11 +11,14 @@ function SmileEarningRulesLoaderInner({
22
11
  const queryResult = useSuspenseQuery({
23
12
  queryKey: [loaderKey, {}],
24
13
  queryFn: async () => {
25
- const loadedData = await invokeLoader({
26
- loaderKey,
27
- args: {}
28
- });
29
- return smileEarningRulesOutputSchema.parse(loadedData);
14
+ const [loadedData, schemas] = await Promise.all([
15
+ invokeLoader({
16
+ loaderKey,
17
+ args: {}
18
+ }),
19
+ import("./integration-loader-schemas")
20
+ ]);
21
+ return schemas.smileEarningRulesOutputSchema.parse(loadedData);
30
22
  }
31
23
  });
32
24
  return /* @__PURE__ */ jsx(Fragment, { children: children(queryResult.data) });
@@ -1,12 +1,6 @@
1
1
  import type { ReactNode } from "react";
2
- import * as z from "zod";
3
- declare const smileRewardSchema: z.ZodObject<{
4
- id: z.ZodNumber;
5
- name: z.ZodString;
6
- pointsCost: z.ZodNumber;
7
- rewardType: z.ZodString;
8
- discountValue: z.ZodNullable<z.ZodString>;
9
- }, z.core.$strip>;
2
+ import type { z } from "zod";
3
+ import type { smileRewardSchema } from "./integration-loader-schemas";
10
4
  export type SmileReward = z.infer<typeof smileRewardSchema>;
11
5
  type SmileRewardsLoaderProps = {
12
6
  loaderKey: string;
@@ -2,19 +2,8 @@
2
2
  import { Fragment, jsx } from "react/jsx-runtime";
3
3
  import { Suspense } from "react";
4
4
  import { useSuspenseQuery } from "@tanstack/react-query";
5
- import * as z from "zod";
6
5
  import { invokeLoader } from "./invoke-loader";
7
6
  import { LoaderErrorBoundary } from "./loader-error-boundary";
8
- const smileRewardSchema = z.object({
9
- id: z.number(),
10
- name: z.string(),
11
- pointsCost: z.number(),
12
- rewardType: z.string(),
13
- discountValue: z.string().nullable()
14
- });
15
- const smileRewardsOutputSchema = z.object({
16
- rewards: z.array(smileRewardSchema)
17
- });
18
7
  function SmileRewardsLoaderInner({
19
8
  loaderKey,
20
9
  children
@@ -22,11 +11,14 @@ function SmileRewardsLoaderInner({
22
11
  const queryResult = useSuspenseQuery({
23
12
  queryKey: [loaderKey, {}],
24
13
  queryFn: async () => {
25
- const loadedData = await invokeLoader({
26
- loaderKey,
27
- args: {}
28
- });
29
- return smileRewardsOutputSchema.parse(loadedData);
14
+ const [loadedData, schemas] = await Promise.all([
15
+ invokeLoader({
16
+ loaderKey,
17
+ args: {}
18
+ }),
19
+ import("./integration-loader-schemas")
20
+ ]);
21
+ return schemas.smileRewardsOutputSchema.parse(loadedData);
30
22
  }
31
23
  });
32
24
  return /* @__PURE__ */ jsx(Fragment, { children: children(queryResult.data) });
@@ -1,11 +1,6 @@
1
1
  import type { ReactNode } from "react";
2
- import * as z from "zod";
3
- declare const smileVipTierSchema: z.ZodObject<{
4
- id: z.ZodNumber;
5
- name: z.ZodString;
6
- minimumPointsRequired: z.ZodNumber;
7
- color: z.ZodNullable<z.ZodString>;
8
- }, z.core.$strip>;
2
+ import type { z } from "zod";
3
+ import type { smileVipTierSchema } from "./integration-loader-schemas";
9
4
  export type SmileVipTier = z.infer<typeof smileVipTierSchema>;
10
5
  type SmileVipTiersLoaderProps = {
11
6
  loaderKey: string;
@@ -2,18 +2,8 @@
2
2
  import { Fragment, jsx } from "react/jsx-runtime";
3
3
  import { Suspense } from "react";
4
4
  import { useSuspenseQuery } from "@tanstack/react-query";
5
- import * as z from "zod";
6
5
  import { invokeLoader } from "./invoke-loader";
7
6
  import { LoaderErrorBoundary } from "./loader-error-boundary";
8
- const smileVipTierSchema = z.object({
9
- id: z.number(),
10
- name: z.string(),
11
- minimumPointsRequired: z.number(),
12
- color: z.string().nullable()
13
- });
14
- const smileVipTiersOutputSchema = z.object({
15
- vipTiers: z.array(smileVipTierSchema)
16
- });
17
7
  function SmileVipTiersLoaderInner({
18
8
  loaderKey,
19
9
  children
@@ -21,11 +11,14 @@ function SmileVipTiersLoaderInner({
21
11
  const queryResult = useSuspenseQuery({
22
12
  queryKey: [loaderKey, {}],
23
13
  queryFn: async () => {
24
- const loadedData = await invokeLoader({
25
- loaderKey,
26
- args: {}
27
- });
28
- return smileVipTiersOutputSchema.parse(loadedData);
14
+ const [loadedData, schemas] = await Promise.all([
15
+ invokeLoader({
16
+ loaderKey,
17
+ args: {}
18
+ }),
19
+ import("./integration-loader-schemas")
20
+ ]);
21
+ return schemas.smileVipTiersOutputSchema.parse(loadedData);
29
22
  }
30
23
  });
31
24
  return /* @__PURE__ */ jsx(Fragment, { children: children(queryResult.data) });
@@ -4,7 +4,6 @@ import { Suspense } from "react";
4
4
  import { useSuspenseQuery } from "@tanstack/react-query";
5
5
  import { invokeLoader } from "./invoke-loader";
6
6
  import { LoaderErrorBoundary } from "./loader-error-boundary";
7
- import { statsigExperimentLoaderOutputSchema } from "./loader-schemas";
8
7
  function buildArgs({
9
8
  experimentName,
10
9
  stableId,
@@ -43,8 +42,11 @@ function StatsigExperimentLoaderInner({
43
42
  const { data } = useSuspenseQuery({
44
43
  queryKey: [loaderKey, args],
45
44
  queryFn: async () => {
46
- const loadedData = await invokeLoader({ loaderKey, args });
47
- return statsigExperimentLoaderOutputSchema.parse(loadedData);
45
+ const [loadedData, schemas] = await Promise.all([
46
+ invokeLoader({ loaderKey, args }),
47
+ import("./loader-schemas")
48
+ ]);
49
+ return schemas.statsigExperimentLoaderOutputSchema.parse(loadedData);
48
50
  }
49
51
  });
50
52
  return /* @__PURE__ */ jsx(Fragment, { children: children(data) });
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { z } from "zod";
3
- import { yotpoProductReviewAggregateLoaderOutputSchema } from "./loader-schemas";
3
+ import type { yotpoProductReviewAggregateLoaderOutputSchema } from "./loader-schemas";
4
4
  type YotpoReviewAggregateData = z.infer<typeof yotpoProductReviewAggregateLoaderOutputSchema>;
5
5
  type YotpoReviewAggregateLoaderProps = {
6
6
  loaderKey: string;
@@ -4,7 +4,6 @@ import { Suspense } from "react";
4
4
  import { useSuspenseQuery } from "@tanstack/react-query";
5
5
  import { invokeLoader } from "./invoke-loader";
6
6
  import { LoaderErrorBoundary } from "./loader-error-boundary";
7
- import { yotpoProductReviewAggregateLoaderOutputSchema } from "./loader-schemas";
8
7
  function YotpoReviewAggregateLoaderInner({
9
8
  loaderKey,
10
9
  productId,
@@ -13,11 +12,16 @@ function YotpoReviewAggregateLoaderInner({
13
12
  const queryResult = useSuspenseQuery({
14
13
  queryKey: [loaderKey, { productId }],
15
14
  queryFn: async () => {
16
- const loadedData = await invokeLoader({
17
- loaderKey,
18
- args: { productId }
19
- });
20
- return yotpoProductReviewAggregateLoaderOutputSchema.parse(loadedData);
15
+ const [loadedData, schemas] = await Promise.all([
16
+ invokeLoader({
17
+ loaderKey,
18
+ args: { productId }
19
+ }),
20
+ import("./loader-schemas")
21
+ ]);
22
+ return schemas.yotpoProductReviewAggregateLoaderOutputSchema.parse(
23
+ loadedData
24
+ );
21
25
  }
22
26
  });
23
27
  return /* @__PURE__ */ jsx(Fragment, { children: children(queryResult.data) });
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { z } from "zod";
3
- import { yotpoProductReviewsLoaderOutputSchema } from "./loader-schemas";
3
+ import type { yotpoProductReviewsLoaderOutputSchema } from "./loader-schemas";
4
4
  type YotpoReviewsData = z.infer<typeof yotpoProductReviewsLoaderOutputSchema>;
5
5
  type YotpoReviewsLoaderProps = {
6
6
  loaderKey: string;