@replohq/sdk 2.8.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.
- package/_vendor/replo-utils/lib/url.d.ts +10 -3
- package/_vendor/schemas/generated/consent.d.ts +2 -2
- package/consent/script-snippets.js +10 -0
- package/consent/types.d.ts +2 -2
- package/lib/buildMetadata.js +3 -3
- package/loaders/collection-loader.d.ts +4 -1
- package/loaders/collection-loader.js +5 -9
- package/loaders/collection-products-loader.d.ts +4 -1
- package/loaders/collection-products-loader.js +5 -9
- package/loaders/contentful-entries-loader.d.ts +4 -1
- package/loaders/contentful-entries-loader.js +2 -6
- package/loaders/contentful-entry-loader.d.ts +4 -1
- package/loaders/contentful-entry-loader.js +2 -6
- package/loaders/invoke-loader-action.d.ts +2 -1
- package/loaders/invoke-loader-action.js +2 -4
- package/loaders/invoke-loader-server.js +8 -4
- package/loaders/invoke-loader.d.ts +11 -3
- package/loaders/invoke-loader.js +6 -5
- package/loaders/judgeme-review-aggregate-loader.d.ts +4 -1
- package/loaders/judgeme-review-aggregate-loader.js +5 -11
- package/loaders/judgeme-reviews-loader.d.ts +4 -1
- package/loaders/judgeme-reviews-loader.js +2 -6
- package/loaders/junip-review-aggregate-loader.d.ts +4 -1
- package/loaders/junip-review-aggregate-loader.js +5 -11
- package/loaders/junip-reviews-loader.d.ts +4 -1
- package/loaders/junip-reviews-loader.js +2 -6
- package/loaders/kaching-bundles-loader.d.ts +4 -1
- package/loaders/kaching-bundles-loader.js +5 -6
- package/loaders/levanta-product-loader.d.ts +4 -1
- package/loaders/levanta-product-loader.js +5 -9
- package/loaders/loader-output.d.ts +28 -0
- package/loaders/loader-output.js +122 -0
- package/loaders/loader-outputs.d.ts +55 -0
- package/loaders/loader-outputs.js +0 -0
- package/loaders/loox-review-aggregate-loader.d.ts +4 -1
- package/loaders/loox-review-aggregate-loader.js +5 -11
- package/loaders/loox-reviews-loader.d.ts +4 -1
- package/loaders/loox-reviews-loader.js +5 -9
- package/loaders/loyaltylion-earning-rules-loader.js +5 -11
- package/loaders/loyaltylion-points-for-price-loader.js +5 -11
- package/loaders/loyaltylion-rewards-loader.js +5 -9
- package/loaders/loyaltylion-tiers-loader.js +5 -9
- package/loaders/metaobject-loader.d.ts +4 -1
- package/loaders/metaobject-loader.js +2 -6
- package/loaders/metaobjects-loader.d.ts +4 -1
- package/loaders/metaobjects-loader.js +2 -6
- package/loaders/okendo-review-aggregate-loader.d.ts +4 -1
- package/loaders/okendo-review-aggregate-loader.js +5 -9
- package/loaders/okendo-reviews-loader.d.ts +4 -1
- package/loaders/okendo-reviews-loader.js +2 -6
- package/loaders/product-loader.d.ts +4 -1
- package/loaders/product-loader.js +2 -6
- package/loaders/rebuy-recommendations-loader.d.ts +4 -1
- package/loaders/rebuy-recommendations-loader.js +5 -9
- package/loaders/reviews-io-review-aggregate-loader.d.ts +4 -1
- package/loaders/reviews-io-review-aggregate-loader.js +2 -8
- package/loaders/reviews-io-reviews-loader.d.ts +4 -1
- package/loaders/reviews-io-reviews-loader.js +2 -8
- package/loaders/shopify-integration-details-loader.d.ts +4 -1
- package/loaders/shopify-integration-details-loader.js +5 -11
- package/loaders/smile-earning-rules-loader.d.ts +4 -1
- package/loaders/smile-earning-rules-loader.js +5 -9
- package/loaders/smile-rewards-loader.d.ts +4 -1
- package/loaders/smile-rewards-loader.js +5 -9
- package/loaders/smile-vip-tiers-loader.d.ts +4 -1
- package/loaders/smile-vip-tiers-loader.js +5 -9
- package/loaders/statsig-experiment-loader.d.ts +4 -1
- package/loaders/statsig-experiment-loader.js +2 -6
- package/loaders/yotpo-review-aggregate-loader.d.ts +4 -1
- package/loaders/yotpo-review-aggregate-loader.js +5 -11
- package/loaders/yotpo-reviews-loader.d.ts +4 -1
- package/loaders/yotpo-reviews-loader.js +2 -6
- package/package.json +4 -4
- package/size-budget/fixture/app/fixture-pdp/page.d.ts +1 -1
- package/size-budget/fixture/app/fixture-pdp/product-details.d.ts +1 -0
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import type { z } from "zod";
|
|
3
3
|
import type { smileEarningRuleSchema } from "./integration-loader-schemas";
|
|
4
|
+
import type { DATA_LOADER_KEYS } from "./loader-keys";
|
|
5
|
+
import type { LoaderKeyProp } from "./loader-outputs";
|
|
6
|
+
type LoaderKey = (typeof DATA_LOADER_KEYS)["SMILE_IO_EARNING_RULES"];
|
|
4
7
|
export type SmileEarningRule = z.infer<typeof smileEarningRuleSchema>;
|
|
5
8
|
type SmileEarningRulesLoaderProps = {
|
|
6
|
-
loaderKey:
|
|
9
|
+
loaderKey: LoaderKeyProp<LoaderKey>;
|
|
7
10
|
children: (data: {
|
|
8
11
|
earningRules: SmileEarningRule[];
|
|
9
12
|
}) => ReactNode;
|
|
@@ -10,15 +10,11 @@ function SmileEarningRulesLoaderInner({
|
|
|
10
10
|
}) {
|
|
11
11
|
const queryResult = useSuspenseQuery({
|
|
12
12
|
queryKey: [loaderKey, {}],
|
|
13
|
-
queryFn:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}),
|
|
19
|
-
import("./integration-loader-schemas")
|
|
20
|
-
]);
|
|
21
|
-
return schemas.smileEarningRulesOutputSchema.parse(loadedData);
|
|
13
|
+
queryFn: () => {
|
|
14
|
+
return invokeLoader({
|
|
15
|
+
loaderKey,
|
|
16
|
+
args: {}
|
|
17
|
+
});
|
|
22
18
|
}
|
|
23
19
|
});
|
|
24
20
|
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
3
|
import type { smileRewardSchema } from "./integration-loader-schemas";
|
|
4
|
+
import type { DATA_LOADER_KEYS } from "./loader-keys";
|
|
5
|
+
import type { LoaderKeyProp } from "./loader-outputs";
|
|
6
|
+
type LoaderKey = (typeof DATA_LOADER_KEYS)["SMILE_IO_REWARDS"];
|
|
4
7
|
export type SmileReward = z.infer<typeof smileRewardSchema>;
|
|
5
8
|
type SmileRewardsLoaderProps = {
|
|
6
|
-
loaderKey:
|
|
9
|
+
loaderKey: LoaderKeyProp<LoaderKey>;
|
|
7
10
|
children: (data: {
|
|
8
11
|
rewards: SmileReward[];
|
|
9
12
|
}) => ReactNode;
|
|
@@ -10,15 +10,11 @@ function SmileRewardsLoaderInner({
|
|
|
10
10
|
}) {
|
|
11
11
|
const queryResult = useSuspenseQuery({
|
|
12
12
|
queryKey: [loaderKey, {}],
|
|
13
|
-
queryFn:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}),
|
|
19
|
-
import("./integration-loader-schemas")
|
|
20
|
-
]);
|
|
21
|
-
return schemas.smileRewardsOutputSchema.parse(loadedData);
|
|
13
|
+
queryFn: () => {
|
|
14
|
+
return invokeLoader({
|
|
15
|
+
loaderKey,
|
|
16
|
+
args: {}
|
|
17
|
+
});
|
|
22
18
|
}
|
|
23
19
|
});
|
|
24
20
|
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
3
|
import type { smileVipTierSchema } from "./integration-loader-schemas";
|
|
4
|
+
import type { DATA_LOADER_KEYS } from "./loader-keys";
|
|
5
|
+
import type { LoaderKeyProp } from "./loader-outputs";
|
|
6
|
+
type LoaderKey = (typeof DATA_LOADER_KEYS)["SMILE_IO_VIP_TIERS"];
|
|
4
7
|
export type SmileVipTier = z.infer<typeof smileVipTierSchema>;
|
|
5
8
|
type SmileVipTiersLoaderProps = {
|
|
6
|
-
loaderKey:
|
|
9
|
+
loaderKey: LoaderKeyProp<LoaderKey>;
|
|
7
10
|
children: (data: {
|
|
8
11
|
vipTiers: SmileVipTier[];
|
|
9
12
|
}) => ReactNode;
|
|
@@ -10,15 +10,11 @@ function SmileVipTiersLoaderInner({
|
|
|
10
10
|
}) {
|
|
11
11
|
const queryResult = useSuspenseQuery({
|
|
12
12
|
queryKey: [loaderKey, {}],
|
|
13
|
-
queryFn:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}),
|
|
19
|
-
import("./integration-loader-schemas")
|
|
20
|
-
]);
|
|
21
|
-
return schemas.smileVipTiersOutputSchema.parse(loadedData);
|
|
13
|
+
queryFn: () => {
|
|
14
|
+
return invokeLoader({
|
|
15
|
+
loaderKey,
|
|
16
|
+
args: {}
|
|
17
|
+
});
|
|
22
18
|
}
|
|
23
19
|
});
|
|
24
20
|
return /* @__PURE__ */ jsx(Fragment, { children: children(queryResult.data) });
|
|
@@ -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:
|
|
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:
|
|
45
|
-
|
|
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:
|
|
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:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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:
|
|
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:
|
|
29
|
-
|
|
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.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"reploBuild": {
|
|
5
5
|
"packageName": "@replohq/sdk",
|
|
6
|
-
"version": "2.
|
|
6
|
+
"version": "2.10.0",
|
|
7
7
|
"branch": "HEAD",
|
|
8
|
-
"commit": "
|
|
9
|
-
"builtAt": "2026-10-
|
|
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;
|