@replohq/sdk 1.20.1 → 1.21.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/lib/buildMetadata.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const BUILD_METADATA = {
|
|
2
2
|
"packageName": "@replohq/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0",
|
|
4
4
|
"branch": "HEAD",
|
|
5
|
-
"commit": "
|
|
6
|
-
"builtAt": "2026-10-
|
|
5
|
+
"commit": "bd37110ed5ca1a7902f9975bafa8169dd3bd3068",
|
|
6
|
+
"builtAt": "2026-10-17T07:52:13.133Z"
|
|
7
7
|
};
|
|
@@ -391,15 +391,53 @@ export declare const productSchema: z.ZodObject<{
|
|
|
391
391
|
}, z.core.$strip>>>;
|
|
392
392
|
}, z.core.$strip>;
|
|
393
393
|
export type Product = z.infer<typeof productSchema>;
|
|
394
|
+
export declare const okendoReviewMediaSchema: z.ZodObject<{
|
|
395
|
+
type: z.ZodString;
|
|
396
|
+
thumbnailUrl: z.ZodOptional<z.ZodString>;
|
|
397
|
+
largeUrl: z.ZodOptional<z.ZodString>;
|
|
398
|
+
fullSizeUrl: z.ZodOptional<z.ZodString>;
|
|
399
|
+
largePortraitThumbnailUrl: z.ZodOptional<z.ZodString>;
|
|
400
|
+
videoPosterUrl: z.ZodOptional<z.ZodString>;
|
|
401
|
+
videoWebmUrl: z.ZodOptional<z.ZodString>;
|
|
402
|
+
alt: z.ZodOptional<z.ZodString>;
|
|
403
|
+
}, z.core.$strip>;
|
|
394
404
|
export declare const okendoReviewSchema: z.ZodObject<{
|
|
395
405
|
id: z.ZodString;
|
|
396
406
|
title: z.ZodOptional<z.ZodString>;
|
|
397
407
|
body: z.ZodOptional<z.ZodString>;
|
|
398
408
|
rating: z.ZodOptional<z.ZodNumber>;
|
|
399
409
|
productName: z.ZodOptional<z.ZodString>;
|
|
410
|
+
productVariantName: z.ZodOptional<z.ZodString>;
|
|
400
411
|
reviewerName: z.ZodOptional<z.ZodString>;
|
|
412
|
+
reviewerIsVerified: z.ZodOptional<z.ZodBoolean>;
|
|
413
|
+
reviewerLocation: z.ZodOptional<z.ZodString>;
|
|
414
|
+
reviewerCountryCode: z.ZodOptional<z.ZodString>;
|
|
415
|
+
reviewerAvatarUrl: z.ZodOptional<z.ZodString>;
|
|
416
|
+
reviewerVerifiedStatus: z.ZodOptional<z.ZodString>;
|
|
417
|
+
reviewerSocialConnection: z.ZodOptional<z.ZodString>;
|
|
418
|
+
source: z.ZodOptional<z.ZodString>;
|
|
401
419
|
dateCreated: z.ZodOptional<z.ZodString>;
|
|
402
420
|
status: z.ZodOptional<z.ZodString>;
|
|
421
|
+
isRecommended: z.ZodOptional<z.ZodBoolean>;
|
|
422
|
+
helpfulCount: z.ZodOptional<z.ZodNumber>;
|
|
423
|
+
media: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
424
|
+
type: z.ZodString;
|
|
425
|
+
thumbnailUrl: z.ZodOptional<z.ZodString>;
|
|
426
|
+
largeUrl: z.ZodOptional<z.ZodString>;
|
|
427
|
+
fullSizeUrl: z.ZodOptional<z.ZodString>;
|
|
428
|
+
largePortraitThumbnailUrl: z.ZodOptional<z.ZodString>;
|
|
429
|
+
videoPosterUrl: z.ZodOptional<z.ZodString>;
|
|
430
|
+
videoWebmUrl: z.ZodOptional<z.ZodString>;
|
|
431
|
+
alt: z.ZodOptional<z.ZodString>;
|
|
432
|
+
}, z.core.$strip>>>;
|
|
433
|
+
attributes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
434
|
+
title: z.ZodString;
|
|
435
|
+
value: z.ZodString;
|
|
436
|
+
}, z.core.$strip>>>;
|
|
437
|
+
reply: z.ZodOptional<z.ZodObject<{
|
|
438
|
+
body: z.ZodString;
|
|
439
|
+
dateCreated: z.ZodOptional<z.ZodString>;
|
|
440
|
+
}, z.core.$strip>>;
|
|
403
441
|
}, z.core.$strip>;
|
|
404
442
|
export declare const fullVariantSchema: z.ZodObject<{
|
|
405
443
|
id: z.ZodString;
|
|
@@ -147,15 +147,44 @@ const productSchema = z.object({
|
|
|
147
147
|
requiresSellingPlan: z.boolean().optional(),
|
|
148
148
|
metafields: z.array(metafieldSchema).optional()
|
|
149
149
|
});
|
|
150
|
+
const okendoReviewMediaSchema = z.object({
|
|
151
|
+
type: z.string().describe('Okendo media type, e.g. "image" or "video"'),
|
|
152
|
+
thumbnailUrl: z.string().optional(),
|
|
153
|
+
largeUrl: z.string().optional(),
|
|
154
|
+
fullSizeUrl: z.string().optional().describe("Full-size image, or the MP4 for a video"),
|
|
155
|
+
largePortraitThumbnailUrl: z.string().optional(),
|
|
156
|
+
videoPosterUrl: z.string().optional(),
|
|
157
|
+
videoWebmUrl: z.string().optional(),
|
|
158
|
+
alt: z.string().optional()
|
|
159
|
+
}).describe("OkendoReviewMedia");
|
|
150
160
|
const okendoReviewSchema = z.object({
|
|
151
161
|
id: z.string(),
|
|
152
162
|
title: z.string().optional(),
|
|
153
163
|
body: z.string().optional(),
|
|
154
164
|
rating: z.number().optional(),
|
|
155
165
|
productName: z.string().optional(),
|
|
166
|
+
productVariantName: z.string().optional().describe('Variant the reviewer bought, e.g. "30-day supply"'),
|
|
156
167
|
reviewerName: z.string().optional(),
|
|
168
|
+
reviewerIsVerified: z.boolean().optional().describe("Okendo's verified-buyer flag"),
|
|
169
|
+
reviewerLocation: z.string().optional().describe("Reviewer's country name, when shared"),
|
|
170
|
+
reviewerCountryCode: z.string().optional(),
|
|
171
|
+
reviewerAvatarUrl: z.string().optional(),
|
|
172
|
+
reviewerVerifiedStatus: z.string().optional().describe(
|
|
173
|
+
`Okendo's label for the verification, e.g. "Verified Reviewer"; Okendo's widget shows "Verified Buyer" when absent`
|
|
174
|
+
),
|
|
175
|
+
reviewerSocialConnection: z.string().optional().describe('Social account the reviewer signed in with, e.g. "google"'),
|
|
176
|
+
source: z.string().optional().describe(
|
|
177
|
+
'Where the review came from, e.g. "shopify-shop" for one imported from the Shop app'
|
|
178
|
+
),
|
|
157
179
|
dateCreated: z.string().optional(),
|
|
158
|
-
status: z.string().optional()
|
|
180
|
+
status: z.string().optional(),
|
|
181
|
+
isRecommended: z.boolean().optional(),
|
|
182
|
+
helpfulCount: z.number().optional(),
|
|
183
|
+
media: z.array(okendoReviewMediaSchema).optional(),
|
|
184
|
+
attributes: z.array(z.object({ title: z.string(), value: z.string() })).optional().describe(
|
|
185
|
+
"Product and reviewer attributes the reviewer answered, e.g. Age: 31-35"
|
|
186
|
+
),
|
|
187
|
+
reply: z.object({ body: z.string(), dateCreated: z.string().optional() }).optional().describe("The store's public reply")
|
|
159
188
|
}).describe("OkendoReview");
|
|
160
189
|
const fullVariantSchema = z.object({
|
|
161
190
|
id: z.string(),
|
|
@@ -392,6 +421,7 @@ export {
|
|
|
392
421
|
mediaImageSchema,
|
|
393
422
|
mediaSchema,
|
|
394
423
|
metafieldSchema,
|
|
424
|
+
okendoReviewMediaSchema,
|
|
395
425
|
okendoReviewSchema,
|
|
396
426
|
optionValueSchema,
|
|
397
427
|
optionValueSwatchSchema,
|
|
@@ -7,17 +7,56 @@ declare const okendoReviewsOutputSchema: z.ZodObject<{
|
|
|
7
7
|
body: z.ZodOptional<z.ZodString>;
|
|
8
8
|
rating: z.ZodOptional<z.ZodNumber>;
|
|
9
9
|
productName: z.ZodOptional<z.ZodString>;
|
|
10
|
+
productVariantName: z.ZodOptional<z.ZodString>;
|
|
10
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>;
|
|
11
19
|
dateCreated: z.ZodOptional<z.ZodString>;
|
|
12
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>>;
|
|
13
41
|
}, z.core.$strip>>;
|
|
42
|
+
nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
14
43
|
}, z.core.$strip>;
|
|
15
44
|
type OkendoReviewsData = z.infer<typeof okendoReviewsOutputSchema>;
|
|
45
|
+
/** Sort orders Okendo supports; `has_media desc` puts reviews with photos or videos first. */
|
|
46
|
+
export type OkendoReviewOrder = "date desc" | "date asc" | "rating desc" | "rating asc" | "helpful desc" | "has_media desc";
|
|
16
47
|
type OkendoReviewsLoaderProps = {
|
|
17
48
|
loaderKey: string;
|
|
18
49
|
shopifyProductId: string;
|
|
50
|
+
/** Reviews per page, 1-100 (Okendo's default is 25) */
|
|
51
|
+
limit?: number;
|
|
52
|
+
orderBy?: OkendoReviewOrder;
|
|
53
|
+
/**
|
|
54
|
+
* `nextCursor` from the previous page's data. Render one loader per page,
|
|
55
|
+
* passing each page's cursor to the next, to build "Show more".
|
|
56
|
+
*/
|
|
57
|
+
cursor?: string;
|
|
19
58
|
children: (data: OkendoReviewsData) => ReactNode;
|
|
20
59
|
fallback?: ReactNode;
|
|
21
60
|
};
|
|
22
|
-
export declare function OkendoReviewsLoader({ loaderKey, shopifyProductId, children, fallback, }: OkendoReviewsLoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
export declare function OkendoReviewsLoader({ loaderKey, shopifyProductId, limit, orderBy, cursor, children, fallback, }: OkendoReviewsLoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
23
62
|
export {};
|
|
@@ -7,20 +7,22 @@ import { invokeLoader } from "./invoke-loader";
|
|
|
7
7
|
import { LoaderErrorBoundary } from "./loader-error-boundary";
|
|
8
8
|
import { okendoReviewSchema } from "./loader-schemas";
|
|
9
9
|
const okendoReviewsOutputSchema = z.object({
|
|
10
|
-
reviews: z.array(okendoReviewSchema)
|
|
10
|
+
reviews: z.array(okendoReviewSchema),
|
|
11
|
+
nextCursor: z.string().nullish()
|
|
11
12
|
});
|
|
12
13
|
function OkendoReviewsLoaderInner({
|
|
13
14
|
loaderKey,
|
|
14
15
|
shopifyProductId,
|
|
16
|
+
limit,
|
|
17
|
+
orderBy,
|
|
18
|
+
cursor,
|
|
15
19
|
children
|
|
16
20
|
}) {
|
|
21
|
+
const args = { shopifyProductId, limit, orderBy, cursor };
|
|
17
22
|
const queryResult = useSuspenseQuery({
|
|
18
|
-
queryKey: [loaderKey,
|
|
23
|
+
queryKey: [loaderKey, args],
|
|
19
24
|
queryFn: async () => {
|
|
20
|
-
const loadedData = await invokeLoader({
|
|
21
|
-
loaderKey,
|
|
22
|
-
args: { shopifyProductId }
|
|
23
|
-
});
|
|
25
|
+
const loadedData = await invokeLoader({ loaderKey, args });
|
|
24
26
|
return okendoReviewsOutputSchema.parse(loadedData);
|
|
25
27
|
}
|
|
26
28
|
});
|
|
@@ -29,6 +31,9 @@ function OkendoReviewsLoaderInner({
|
|
|
29
31
|
function OkendoReviewsLoader({
|
|
30
32
|
loaderKey,
|
|
31
33
|
shopifyProductId,
|
|
34
|
+
limit,
|
|
35
|
+
orderBy,
|
|
36
|
+
cursor,
|
|
32
37
|
children,
|
|
33
38
|
fallback
|
|
34
39
|
}) {
|
|
@@ -36,12 +41,15 @@ function OkendoReviewsLoader({
|
|
|
36
41
|
LoaderErrorBoundary,
|
|
37
42
|
{
|
|
38
43
|
fallback: fallback ?? null,
|
|
39
|
-
resetKey: `${loaderKey}:${shopifyProductId}`,
|
|
44
|
+
resetKey: `${loaderKey}:${shopifyProductId}:${limit}:${orderBy}:${cursor}`,
|
|
40
45
|
children: /* @__PURE__ */ jsx(Suspense, { fallback: fallback ?? null, children: /* @__PURE__ */ jsx(
|
|
41
46
|
OkendoReviewsLoaderInner,
|
|
42
47
|
{
|
|
43
48
|
loaderKey,
|
|
44
49
|
shopifyProductId,
|
|
50
|
+
limit,
|
|
51
|
+
orderBy,
|
|
52
|
+
cursor,
|
|
45
53
|
children
|
|
46
54
|
}
|
|
47
55
|
) })
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@replohq/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0",
|
|
4
4
|
"reploBuild": {
|
|
5
5
|
"packageName": "@replohq/sdk",
|
|
6
|
-
"version": "1.
|
|
6
|
+
"version": "1.21.0",
|
|
7
7
|
"branch": "HEAD",
|
|
8
|
-
"commit": "
|
|
9
|
-
"builtAt": "2026-10-
|
|
8
|
+
"commit": "bd37110ed5ca1a7902f9975bafa8169dd3bd3068",
|
|
9
|
+
"builtAt": "2026-10-17T07:52:13.133Z"
|
|
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",
|