@replohq/sdk 2.7.0 → 2.9.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/schemas/generated/consent.d.ts +2 -2
- package/_vendor/schemas/loaderKeys.mjs +2 -0
- package/consent/script-snippets.js +10 -0
- package/consent/types.d.ts +2 -2
- package/lib/buildMetadata.js +3 -3
- package/loaders/junip-review-aggregate-loader.d.ts +12 -0
- package/loaders/junip-review-aggregate-loader.js +53 -0
- package/loaders/junip-reviews-loader.d.ts +13 -0
- package/loaders/junip-reviews-loader.js +58 -0
- package/loaders/loader-keys.d.ts +2 -0
- package/loaders/loader-keys.js +2 -0
- package/loaders/loader-schemas.d.ts +27 -0
- package/loaders/loader-schemas.js +21 -0
- package/package.json +12 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type ReploScriptType = "GA4" | "GoogleTagManager" | "Meta" | "TikTok" | "Pinterest" | "Reddit" | "Snapchat" | "X" | "Hotjar" | "MicrosoftClarity" | "Contentsquare" | "Segment" | "Northbeam" | "Gorgias" | "Converge" | "Mixpanel" | "HubSpot" | "Cookiebot" | "snippet" | "custom" | "consentPlatform";
|
|
1
|
+
export type ReploScriptType = "GA4" | "GoogleTagManager" | "Meta" | "TikTok" | "Pinterest" | "Reddit" | "Snapchat" | "X" | "Hotjar" | "MicrosoftClarity" | "Contentsquare" | "Segment" | "Northbeam" | "Gorgias" | "Converge" | "Mixpanel" | "HubSpot" | "Attentive" | "Cookiebot" | "snippet" | "custom" | "consentPlatform";
|
|
2
2
|
export type ConsentCategory = "necessary" | "analytics" | "marketing" | "preferences" | "sale_of_data";
|
|
3
3
|
export type ConsentMode = "off" | "simple" | "per-category";
|
|
4
4
|
export type ScriptTagDescriptor = {
|
|
@@ -27,7 +27,7 @@ export type ScriptRuntimeOwner = {
|
|
|
27
27
|
};
|
|
28
28
|
export type MixpanelRegion = "us" | "eu" | "in";
|
|
29
29
|
export type ReploScriptEntry = {
|
|
30
|
-
type: "GoogleTagManager" | "Meta" | "TikTok" | "Pinterest" | "Reddit" | "Snapchat" | "Hotjar" | "MicrosoftClarity" | "Contentsquare" | "Segment" | "Northbeam" | "Gorgias" | "Converge" | "HubSpot";
|
|
30
|
+
type: "GoogleTagManager" | "Meta" | "TikTok" | "Pinterest" | "Reddit" | "Snapchat" | "Hotjar" | "MicrosoftClarity" | "Contentsquare" | "Segment" | "Northbeam" | "Gorgias" | "Converge" | "HubSpot" | "Attentive";
|
|
31
31
|
identifier: string;
|
|
32
32
|
requiredConsent?: ConsentCategory[];
|
|
33
33
|
} | {
|
|
@@ -28,6 +28,8 @@ var DATA_LOADER_KEYS = {
|
|
|
28
28
|
LOOX_PRODUCT_REVIEW_AGGREGATE: "loox.product_review_aggregate",
|
|
29
29
|
JUDGEME_PRODUCT_REVIEWS: "judgeme.product_reviews",
|
|
30
30
|
JUDGEME_PRODUCT_REVIEW_AGGREGATE: "judgeme.product_review_aggregate",
|
|
31
|
+
JUNIP_PRODUCT_REVIEWS: "junip.product_reviews",
|
|
32
|
+
JUNIP_PRODUCT_REVIEW_AGGREGATE: "junip.product_review_aggregate",
|
|
31
33
|
STATSIG_EXPERIMENT: "statsig.experiment",
|
|
32
34
|
CONTENTFUL_ENTRY: "contentful.entry",
|
|
33
35
|
CONTENTFUL_ENTRIES: "contentful.entries"
|
|
@@ -175,6 +175,16 @@ gtag('config', '${id}');`
|
|
|
175
175
|
attributes: { id: "hs-script-loader", async: "true", defer: "true" }
|
|
176
176
|
}
|
|
177
177
|
]
|
|
178
|
+
},
|
|
179
|
+
Attentive: {
|
|
180
|
+
defaultConsent: ["marketing"],
|
|
181
|
+
buildTags: (id) => [
|
|
182
|
+
{
|
|
183
|
+
kind: "external",
|
|
184
|
+
src: `https://cdn.attn.tv/${id}/dtag.js`,
|
|
185
|
+
attributes: { async: "true" }
|
|
186
|
+
}
|
|
187
|
+
]
|
|
178
188
|
}
|
|
179
189
|
};
|
|
180
190
|
function isXEventIdForPixel({
|
package/consent/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type ReploScriptType = "GA4" | "GoogleTagManager" | "Meta" | "TikTok" | "Pinterest" | "Reddit" | "Snapchat" | "X" | "Hotjar" | "MicrosoftClarity" | "Contentsquare" | "Segment" | "Northbeam" | "Gorgias" | "Converge" | "HubSpot" | "Mixpanel" | "Cookiebot" | "snippet" | "custom" | "consentPlatform";
|
|
1
|
+
export type ReploScriptType = "GA4" | "GoogleTagManager" | "Meta" | "TikTok" | "Pinterest" | "Reddit" | "Snapchat" | "X" | "Hotjar" | "MicrosoftClarity" | "Contentsquare" | "Segment" | "Northbeam" | "Gorgias" | "Converge" | "HubSpot" | "Mixpanel" | "Attentive" | "Cookiebot" | "snippet" | "custom" | "consentPlatform";
|
|
2
2
|
export type ConsentCategory = "necessary" | "analytics" | "marketing" | "preferences" | "sale_of_data";
|
|
3
3
|
export type ConsentMode = "off" | "simple" | "per-category";
|
|
4
4
|
declare module "react" {
|
|
@@ -36,7 +36,7 @@ export type ScriptRuntimeOwner = {
|
|
|
36
36
|
};
|
|
37
37
|
export type MixpanelRegion = "us" | "eu" | "in";
|
|
38
38
|
export type ReploScriptEntry = {
|
|
39
|
-
type: "GoogleTagManager" | "Meta" | "TikTok" | "Pinterest" | "Reddit" | "Snapchat" | "Hotjar" | "MicrosoftClarity" | "Contentsquare" | "Segment" | "Northbeam" | "Gorgias" | "Converge" | "HubSpot";
|
|
39
|
+
type: "GoogleTagManager" | "Meta" | "TikTok" | "Pinterest" | "Reddit" | "Snapchat" | "Hotjar" | "MicrosoftClarity" | "Contentsquare" | "Segment" | "Northbeam" | "Gorgias" | "Converge" | "HubSpot" | "Attentive";
|
|
40
40
|
identifier: string;
|
|
41
41
|
requiredConsent?: ConsentCategory[];
|
|
42
42
|
} | {
|
package/lib/buildMetadata.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const BUILD_METADATA = {
|
|
2
2
|
"packageName": "@replohq/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"branch": "HEAD",
|
|
5
|
-
"commit": "
|
|
6
|
-
"builtAt": "2026-10-
|
|
5
|
+
"commit": "9b8b9783f1040bce19d91ce9adc8385204be0b93",
|
|
6
|
+
"builtAt": "2026-10-26T04:07:50.620Z"
|
|
7
7
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { z } from "zod";
|
|
3
|
+
import type { junipProductReviewAggregateLoaderOutputSchema } from "./loader-schemas";
|
|
4
|
+
type JunipReviewAggregateData = z.infer<typeof junipProductReviewAggregateLoaderOutputSchema>;
|
|
5
|
+
type JunipReviewAggregateLoaderProps = {
|
|
6
|
+
loaderKey: string;
|
|
7
|
+
productId: string;
|
|
8
|
+
children: (data: JunipReviewAggregateData) => ReactNode;
|
|
9
|
+
fallback?: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export declare function JunipReviewAggregateLoader({ loaderKey, productId, children, fallback, }: JunipReviewAggregateLoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Suspense } from "react";
|
|
4
|
+
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
5
|
+
import { invokeLoader } from "./invoke-loader";
|
|
6
|
+
import { LoaderErrorBoundary } from "./loader-error-boundary";
|
|
7
|
+
function JunipReviewAggregateLoaderInner({
|
|
8
|
+
loaderKey,
|
|
9
|
+
productId,
|
|
10
|
+
children
|
|
11
|
+
}) {
|
|
12
|
+
const { data } = useSuspenseQuery({
|
|
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.junipProductReviewAggregateLoaderOutputSchema.parse(
|
|
23
|
+
loadedData
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return /* @__PURE__ */ jsx(Fragment, { children: children(data) });
|
|
28
|
+
}
|
|
29
|
+
function JunipReviewAggregateLoader({
|
|
30
|
+
loaderKey,
|
|
31
|
+
productId,
|
|
32
|
+
children,
|
|
33
|
+
fallback
|
|
34
|
+
}) {
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
36
|
+
LoaderErrorBoundary,
|
|
37
|
+
{
|
|
38
|
+
fallback: fallback ?? null,
|
|
39
|
+
resetKey: `${loaderKey}:${productId}`,
|
|
40
|
+
children: /* @__PURE__ */ jsx(Suspense, { fallback: fallback ?? null, children: /* @__PURE__ */ jsx(
|
|
41
|
+
JunipReviewAggregateLoaderInner,
|
|
42
|
+
{
|
|
43
|
+
loaderKey,
|
|
44
|
+
productId,
|
|
45
|
+
children
|
|
46
|
+
}
|
|
47
|
+
) })
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
JunipReviewAggregateLoader
|
|
53
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { z } from "zod";
|
|
3
|
+
import type { junipProductReviewsLoaderOutputSchema } from "./loader-schemas";
|
|
4
|
+
type JunipReviewsData = z.infer<typeof junipProductReviewsLoaderOutputSchema>;
|
|
5
|
+
type JunipReviewsLoaderProps = {
|
|
6
|
+
loaderKey: string;
|
|
7
|
+
productId: string;
|
|
8
|
+
perPage?: number;
|
|
9
|
+
children: (data: JunipReviewsData) => ReactNode;
|
|
10
|
+
fallback?: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
export declare function JunipReviewsLoader({ loaderKey, productId, perPage, children, fallback, }: JunipReviewsLoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Suspense } from "react";
|
|
4
|
+
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
5
|
+
import { invokeLoader } from "./invoke-loader";
|
|
6
|
+
import { LoaderErrorBoundary } from "./loader-error-boundary";
|
|
7
|
+
function buildReviewsArgs({
|
|
8
|
+
productId,
|
|
9
|
+
perPage
|
|
10
|
+
}) {
|
|
11
|
+
return { productId, ...perPage !== void 0 ? { perPage } : {} };
|
|
12
|
+
}
|
|
13
|
+
function JunipReviewsLoaderInner({
|
|
14
|
+
loaderKey,
|
|
15
|
+
productId,
|
|
16
|
+
perPage,
|
|
17
|
+
children
|
|
18
|
+
}) {
|
|
19
|
+
const args = buildReviewsArgs({ productId, perPage });
|
|
20
|
+
const { data } = useSuspenseQuery({
|
|
21
|
+
queryKey: [loaderKey, args],
|
|
22
|
+
queryFn: async () => {
|
|
23
|
+
const [loadedData, schemas] = await Promise.all([
|
|
24
|
+
invokeLoader({ loaderKey, args }),
|
|
25
|
+
import("./loader-schemas")
|
|
26
|
+
]);
|
|
27
|
+
return schemas.junipProductReviewsLoaderOutputSchema.parse(loadedData);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
return /* @__PURE__ */ jsx(Fragment, { children: children(data) });
|
|
31
|
+
}
|
|
32
|
+
function JunipReviewsLoader({
|
|
33
|
+
loaderKey,
|
|
34
|
+
productId,
|
|
35
|
+
perPage,
|
|
36
|
+
children,
|
|
37
|
+
fallback
|
|
38
|
+
}) {
|
|
39
|
+
return /* @__PURE__ */ jsx(
|
|
40
|
+
LoaderErrorBoundary,
|
|
41
|
+
{
|
|
42
|
+
fallback: fallback ?? null,
|
|
43
|
+
resetKey: `${loaderKey}:${productId}:${perPage ?? ""}`,
|
|
44
|
+
children: /* @__PURE__ */ jsx(Suspense, { fallback: fallback ?? null, children: /* @__PURE__ */ jsx(
|
|
45
|
+
JunipReviewsLoaderInner,
|
|
46
|
+
{
|
|
47
|
+
loaderKey,
|
|
48
|
+
productId,
|
|
49
|
+
perPage,
|
|
50
|
+
children
|
|
51
|
+
}
|
|
52
|
+
) })
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
JunipReviewsLoader
|
|
58
|
+
};
|
package/loaders/loader-keys.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ export declare const DATA_LOADER_KEYS: {
|
|
|
37
37
|
readonly LOOX_PRODUCT_REVIEW_AGGREGATE: "loox.product_review_aggregate";
|
|
38
38
|
readonly JUDGEME_PRODUCT_REVIEWS: "judgeme.product_reviews";
|
|
39
39
|
readonly JUDGEME_PRODUCT_REVIEW_AGGREGATE: "judgeme.product_review_aggregate";
|
|
40
|
+
readonly JUNIP_PRODUCT_REVIEWS: "junip.product_reviews";
|
|
41
|
+
readonly JUNIP_PRODUCT_REVIEW_AGGREGATE: "junip.product_review_aggregate";
|
|
40
42
|
readonly STATSIG_EXPERIMENT: "statsig.experiment";
|
|
41
43
|
readonly CONTENTFUL_ENTRY: "contentful.entry";
|
|
42
44
|
readonly CONTENTFUL_ENTRIES: "contentful.entries";
|
package/loaders/loader-keys.js
CHANGED
|
@@ -26,6 +26,8 @@ const DATA_LOADER_KEYS = {
|
|
|
26
26
|
LOOX_PRODUCT_REVIEW_AGGREGATE: "loox.product_review_aggregate",
|
|
27
27
|
JUDGEME_PRODUCT_REVIEWS: "judgeme.product_reviews",
|
|
28
28
|
JUDGEME_PRODUCT_REVIEW_AGGREGATE: "judgeme.product_review_aggregate",
|
|
29
|
+
JUNIP_PRODUCT_REVIEWS: "junip.product_reviews",
|
|
30
|
+
JUNIP_PRODUCT_REVIEW_AGGREGATE: "junip.product_review_aggregate",
|
|
29
31
|
STATSIG_EXPERIMENT: "statsig.experiment",
|
|
30
32
|
CONTENTFUL_ENTRY: "contentful.entry",
|
|
31
33
|
CONTENTFUL_ENTRIES: "contentful.entries"
|
|
@@ -983,6 +983,33 @@ export declare const judgemeProductReviewAggregateLoaderOutputSchema: z.ZodObjec
|
|
|
983
983
|
totalReviews: z.ZodNumber;
|
|
984
984
|
starDistribution: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
985
985
|
}, z.core.$strip>;
|
|
986
|
+
export declare const junipReviewLoaderItemSchema: z.ZodObject<{
|
|
987
|
+
id: z.ZodString;
|
|
988
|
+
title: z.ZodNullable<z.ZodString>;
|
|
989
|
+
content: z.ZodNullable<z.ZodString>;
|
|
990
|
+
score: z.ZodNumber;
|
|
991
|
+
createdAt: z.ZodString;
|
|
992
|
+
verifiedBuyer: z.ZodBoolean;
|
|
993
|
+
reviewerName: z.ZodNullable<z.ZodString>;
|
|
994
|
+
photoUrls: z.ZodArray<z.ZodString>;
|
|
995
|
+
}, z.core.$strip>;
|
|
996
|
+
export declare const junipProductReviewsLoaderOutputSchema: z.ZodObject<{
|
|
997
|
+
reviews: z.ZodArray<z.ZodObject<{
|
|
998
|
+
id: z.ZodString;
|
|
999
|
+
title: z.ZodNullable<z.ZodString>;
|
|
1000
|
+
content: z.ZodNullable<z.ZodString>;
|
|
1001
|
+
score: z.ZodNumber;
|
|
1002
|
+
createdAt: z.ZodString;
|
|
1003
|
+
verifiedBuyer: z.ZodBoolean;
|
|
1004
|
+
reviewerName: z.ZodNullable<z.ZodString>;
|
|
1005
|
+
photoUrls: z.ZodArray<z.ZodString>;
|
|
1006
|
+
}, z.core.$strip>>;
|
|
1007
|
+
}, z.core.$strip>;
|
|
1008
|
+
export declare const junipProductReviewAggregateLoaderOutputSchema: z.ZodObject<{
|
|
1009
|
+
averageScore: z.ZodNumber;
|
|
1010
|
+
totalReviews: z.ZodNumber;
|
|
1011
|
+
starDistribution: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
1012
|
+
}, z.core.$strip>;
|
|
986
1013
|
export declare const loyaltyLionEarningRuleVariantSchema: z.ZodObject<{
|
|
987
1014
|
tierId: z.ZodNullable<z.ZodNumber>;
|
|
988
1015
|
title: z.ZodString;
|
|
@@ -328,6 +328,24 @@ const judgemeProductReviewAggregateLoaderOutputSchema = z.object({
|
|
|
328
328
|
totalReviews: z.number(),
|
|
329
329
|
starDistribution: z.record(z.string(), z.number())
|
|
330
330
|
});
|
|
331
|
+
const junipReviewLoaderItemSchema = z.object({
|
|
332
|
+
id: z.string(),
|
|
333
|
+
title: z.string().nullable(),
|
|
334
|
+
content: z.string().nullable(),
|
|
335
|
+
score: z.number(),
|
|
336
|
+
createdAt: z.string(),
|
|
337
|
+
verifiedBuyer: z.boolean(),
|
|
338
|
+
reviewerName: z.string().nullable(),
|
|
339
|
+
photoUrls: z.array(z.string())
|
|
340
|
+
});
|
|
341
|
+
const junipProductReviewsLoaderOutputSchema = z.object({
|
|
342
|
+
reviews: z.array(junipReviewLoaderItemSchema)
|
|
343
|
+
});
|
|
344
|
+
const junipProductReviewAggregateLoaderOutputSchema = z.object({
|
|
345
|
+
averageScore: z.number(),
|
|
346
|
+
totalReviews: z.number(),
|
|
347
|
+
starDistribution: z.record(z.string(), z.number())
|
|
348
|
+
});
|
|
331
349
|
const loyaltyLionEarningRuleVariantSchema = z.object({
|
|
332
350
|
tierId: z.number().nullable(),
|
|
333
351
|
title: z.string(),
|
|
@@ -476,6 +494,9 @@ export {
|
|
|
476
494
|
judgemeProductReviewAggregateLoaderOutputSchema,
|
|
477
495
|
judgemeProductReviewsLoaderOutputSchema,
|
|
478
496
|
judgemeReviewLoaderItemSchema,
|
|
497
|
+
junipProductReviewAggregateLoaderOutputSchema,
|
|
498
|
+
junipProductReviewsLoaderOutputSchema,
|
|
499
|
+
junipReviewLoaderItemSchema,
|
|
479
500
|
levantaProductFullSchema,
|
|
480
501
|
looxProductReviewAggregateLoaderOutputSchema,
|
|
481
502
|
looxProductReviewsLoaderOutputSchema,
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@replohq/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"reploBuild": {
|
|
5
5
|
"packageName": "@replohq/sdk",
|
|
6
|
-
"version": "2.
|
|
6
|
+
"version": "2.9.0",
|
|
7
7
|
"branch": "HEAD",
|
|
8
|
-
"commit": "
|
|
9
|
-
"builtAt": "2026-10-
|
|
8
|
+
"commit": "9b8b9783f1040bce19d91ce9adc8385204be0b93",
|
|
9
|
+
"builtAt": "2026-10-26T04:07:50.620Z"
|
|
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",
|
|
@@ -137,6 +137,14 @@
|
|
|
137
137
|
"types": "./loaders/judgeme-reviews-loader.d.ts",
|
|
138
138
|
"default": "./loaders/judgeme-reviews-loader.js"
|
|
139
139
|
},
|
|
140
|
+
"./loaders/junip-review-aggregate-loader": {
|
|
141
|
+
"types": "./loaders/junip-review-aggregate-loader.d.ts",
|
|
142
|
+
"default": "./loaders/junip-review-aggregate-loader.js"
|
|
143
|
+
},
|
|
144
|
+
"./loaders/junip-reviews-loader": {
|
|
145
|
+
"types": "./loaders/junip-reviews-loader.d.ts",
|
|
146
|
+
"default": "./loaders/junip-reviews-loader.js"
|
|
147
|
+
},
|
|
140
148
|
"./loaders/kaching-bundles-loader": {
|
|
141
149
|
"types": "./loaders/kaching-bundles-loader.d.ts",
|
|
142
150
|
"default": "./loaders/kaching-bundles-loader.js"
|