@replohq/sdk 2.9.0 → 2.10.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 (72) hide show
  1. package/_vendor/replo-utils/lib/url.d.ts +10 -3
  2. package/lib/buildMetadata.js +3 -3
  3. package/loaders/collection-loader.d.ts +4 -1
  4. package/loaders/collection-loader.js +5 -9
  5. package/loaders/collection-products-loader.d.ts +4 -1
  6. package/loaders/collection-products-loader.js +5 -9
  7. package/loaders/contentful-entries-loader.d.ts +4 -1
  8. package/loaders/contentful-entries-loader.js +2 -6
  9. package/loaders/contentful-entry-loader.d.ts +4 -1
  10. package/loaders/contentful-entry-loader.js +2 -6
  11. package/loaders/invoke-loader-action.d.ts +2 -1
  12. package/loaders/invoke-loader-action.js +2 -4
  13. package/loaders/invoke-loader-server.js +8 -4
  14. package/loaders/invoke-loader.d.ts +11 -3
  15. package/loaders/invoke-loader.js +6 -5
  16. package/loaders/judgeme-review-aggregate-loader.d.ts +4 -1
  17. package/loaders/judgeme-review-aggregate-loader.js +5 -11
  18. package/loaders/judgeme-reviews-loader.d.ts +4 -1
  19. package/loaders/judgeme-reviews-loader.js +2 -6
  20. package/loaders/junip-review-aggregate-loader.d.ts +4 -1
  21. package/loaders/junip-review-aggregate-loader.js +5 -11
  22. package/loaders/junip-reviews-loader.d.ts +4 -1
  23. package/loaders/junip-reviews-loader.js +2 -6
  24. package/loaders/kaching-bundles-loader.d.ts +4 -1
  25. package/loaders/kaching-bundles-loader.js +5 -6
  26. package/loaders/levanta-product-loader.d.ts +4 -1
  27. package/loaders/levanta-product-loader.js +5 -9
  28. package/loaders/loader-output.d.ts +28 -0
  29. package/loaders/loader-output.js +122 -0
  30. package/loaders/loader-outputs.d.ts +55 -0
  31. package/loaders/loader-outputs.js +0 -0
  32. package/loaders/loox-review-aggregate-loader.d.ts +4 -1
  33. package/loaders/loox-review-aggregate-loader.js +5 -11
  34. package/loaders/loox-reviews-loader.d.ts +4 -1
  35. package/loaders/loox-reviews-loader.js +5 -9
  36. package/loaders/loyaltylion-earning-rules-loader.js +5 -11
  37. package/loaders/loyaltylion-points-for-price-loader.js +5 -11
  38. package/loaders/loyaltylion-rewards-loader.js +5 -9
  39. package/loaders/loyaltylion-tiers-loader.js +5 -9
  40. package/loaders/metaobject-loader.d.ts +4 -1
  41. package/loaders/metaobject-loader.js +2 -6
  42. package/loaders/metaobjects-loader.d.ts +4 -1
  43. package/loaders/metaobjects-loader.js +2 -6
  44. package/loaders/okendo-review-aggregate-loader.d.ts +4 -1
  45. package/loaders/okendo-review-aggregate-loader.js +5 -9
  46. package/loaders/okendo-reviews-loader.d.ts +4 -1
  47. package/loaders/okendo-reviews-loader.js +2 -6
  48. package/loaders/product-loader.d.ts +4 -1
  49. package/loaders/product-loader.js +2 -6
  50. package/loaders/rebuy-recommendations-loader.d.ts +4 -1
  51. package/loaders/rebuy-recommendations-loader.js +5 -9
  52. package/loaders/reviews-io-review-aggregate-loader.d.ts +4 -1
  53. package/loaders/reviews-io-review-aggregate-loader.js +2 -8
  54. package/loaders/reviews-io-reviews-loader.d.ts +4 -1
  55. package/loaders/reviews-io-reviews-loader.js +2 -8
  56. package/loaders/shopify-integration-details-loader.d.ts +4 -1
  57. package/loaders/shopify-integration-details-loader.js +5 -11
  58. package/loaders/smile-earning-rules-loader.d.ts +4 -1
  59. package/loaders/smile-earning-rules-loader.js +5 -9
  60. package/loaders/smile-rewards-loader.d.ts +4 -1
  61. package/loaders/smile-rewards-loader.js +5 -9
  62. package/loaders/smile-vip-tiers-loader.d.ts +4 -1
  63. package/loaders/smile-vip-tiers-loader.js +5 -9
  64. package/loaders/statsig-experiment-loader.d.ts +4 -1
  65. package/loaders/statsig-experiment-loader.js +2 -6
  66. package/loaders/yotpo-review-aggregate-loader.d.ts +4 -1
  67. package/loaders/yotpo-review-aggregate-loader.js +5 -11
  68. package/loaders/yotpo-reviews-loader.d.ts +4 -1
  69. package/loaders/yotpo-reviews-loader.js +2 -6
  70. package/package.json +4 -4
  71. package/size-budget/fixture/app/fixture-pdp/page.d.ts +1 -1
  72. package/size-budget/fixture/app/fixture-pdp/product-details.d.ts +1 -0
@@ -1,5 +1,8 @@
1
1
  import type { ReactNode } from "react";
2
+ import type { DATA_LOADER_KEYS } from "./loader-keys";
3
+ import type { LoaderKeyProp } from "./loader-outputs";
2
4
  import type { StatsigExperimentAssignment } from "./loader-schemas";
5
+ type LoaderKey = (typeof DATA_LOADER_KEYS)["STATSIG_EXPERIMENT"];
3
6
  type StatsigVisitorIds = {
4
7
  /**
5
8
  * Shorthand for `customIds.stableID`. Use it only when the experiment's ID
@@ -23,7 +26,7 @@ type AtLeastOneVisitorId = (StatsigVisitorIds & {
23
26
  customIds: Record<string, string>;
24
27
  });
25
28
  type StatsigExperimentLoaderProps = AtLeastOneVisitorId & {
26
- loaderKey: string;
29
+ loaderKey: LoaderKeyProp<LoaderKey>;
27
30
  experimentName: string;
28
31
  environmentTier?: string;
29
32
  customAttributes?: Record<string, string>;
@@ -41,12 +41,8 @@ function StatsigExperimentLoaderInner({
41
41
  });
42
42
  const { data } = useSuspenseQuery({
43
43
  queryKey: [loaderKey, args],
44
- queryFn: async () => {
45
- const [loadedData, schemas] = await Promise.all([
46
- invokeLoader({ loaderKey, args }),
47
- import("./loader-schemas")
48
- ]);
49
- return schemas.statsigExperimentLoaderOutputSchema.parse(loadedData);
44
+ queryFn: () => {
45
+ return invokeLoader({ loaderKey, args });
50
46
  }
51
47
  });
52
48
  return /* @__PURE__ */ jsx(Fragment, { children: children(data) });
@@ -1,9 +1,12 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { z } from "zod";
3
+ import type { DATA_LOADER_KEYS } from "./loader-keys";
4
+ import type { LoaderKeyProp } from "./loader-outputs";
3
5
  import type { yotpoProductReviewAggregateLoaderOutputSchema } from "./loader-schemas";
6
+ type LoaderKey = (typeof DATA_LOADER_KEYS)["YOTPO_PRODUCT_REVIEW_AGGREGATE"];
4
7
  type YotpoReviewAggregateData = z.infer<typeof yotpoProductReviewAggregateLoaderOutputSchema>;
5
8
  type YotpoReviewAggregateLoaderProps = {
6
- loaderKey: string;
9
+ loaderKey: LoaderKeyProp<LoaderKey>;
7
10
  productId: string;
8
11
  children: (data: YotpoReviewAggregateData) => ReactNode;
9
12
  fallback?: ReactNode;
@@ -11,17 +11,11 @@ function YotpoReviewAggregateLoaderInner({
11
11
  }) {
12
12
  const queryResult = useSuspenseQuery({
13
13
  queryKey: [loaderKey, { productId }],
14
- queryFn: async () => {
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
- );
14
+ queryFn: () => {
15
+ return invokeLoader({
16
+ loaderKey,
17
+ args: { productId }
18
+ });
25
19
  }
26
20
  });
27
21
  return /* @__PURE__ */ jsx(Fragment, { children: children(queryResult.data) });
@@ -1,9 +1,12 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { z } from "zod";
3
+ import type { DATA_LOADER_KEYS } from "./loader-keys";
4
+ import type { LoaderKeyProp } from "./loader-outputs";
3
5
  import type { yotpoProductReviewsLoaderOutputSchema } from "./loader-schemas";
6
+ type LoaderKey = (typeof DATA_LOADER_KEYS)["YOTPO_PRODUCT_REVIEWS"];
4
7
  type YotpoReviewsData = z.infer<typeof yotpoProductReviewsLoaderOutputSchema>;
5
8
  type YotpoReviewsLoaderProps = {
6
- loaderKey: string;
9
+ loaderKey: LoaderKeyProp<LoaderKey>;
7
10
  productId: string;
8
11
  perPage?: number;
9
12
  page?: number;
@@ -25,12 +25,8 @@ function YotpoReviewsLoaderInner({
25
25
  const args = buildReviewsArgs({ productId, perPage, page });
26
26
  const queryResult = useSuspenseQuery({
27
27
  queryKey: [loaderKey, args],
28
- queryFn: async () => {
29
- const [loadedData, schemas] = await Promise.all([
30
- invokeLoader({ loaderKey, args }),
31
- import("./loader-schemas")
32
- ]);
33
- return schemas.yotpoProductReviewsLoaderOutputSchema.parse(loadedData);
28
+ queryFn: () => {
29
+ return invokeLoader({ loaderKey, args });
34
30
  }
35
31
  });
36
32
  return /* @__PURE__ */ jsx(Fragment, { children: children(queryResult.data) });
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@replohq/sdk",
3
- "version": "2.9.0",
3
+ "version": "2.10.0",
4
4
  "reploBuild": {
5
5
  "packageName": "@replohq/sdk",
6
- "version": "2.9.0",
6
+ "version": "2.10.0",
7
7
  "branch": "HEAD",
8
- "commit": "9b8b9783f1040bce19d91ce9adc8385204be0b93",
9
- "builtAt": "2026-10-26T04:07:50.620Z"
8
+ "commit": "96a07333d34af59c46f8874351df866542e7c2e9",
9
+ "builtAt": "2026-10-26T22:54:01.502Z"
10
10
  },
11
11
  "description": "Replo SDK — cart, analytics, and data loaders for agent-built Next.js sites.",
12
12
  "license": "SEE LICENSE IN LICENSE",
@@ -1 +1 @@
1
- export default function FixtureProductPage(): import("react/jsx-runtime").JSX.Element;
1
+ export default function FixtureProductPage(): Promise<import("react/jsx-runtime").JSX.Element>;
@@ -0,0 +1 @@
1
+ export declare function ProductDetails(): import("react/jsx-runtime").JSX.Element;