@replohq/sdk 1.20.1 → 1.21.1
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/contentCollection.d.ts +1 -1
- package/_vendor/schemas/contentCollection.mjs +1 -1
- package/_vendor/schemas/contentEntry.d.ts +1 -1
- package/_vendor/schemas/contentEntry.mjs +2 -2
- package/_vendor/schemas/contentManifest.d.ts +1 -1
- package/_vendor/schemas/contentManifest.mjs +3 -3
- package/_vendor/schemas/errors.d.ts +2 -2
- package/_vendor/schemas/money.d.ts +1 -1
- package/_vendor/schemas/money.mjs +5 -5
- package/_vendor/schemas/routing/locale.d.ts +1 -1
- package/_vendor/schemas/routing/locale.mjs +2 -2
- package/_vendor/schemas/routing/rules.d.ts +1 -1
- package/_vendor/schemas/routing/rules.mjs +2 -2
- package/analytics/sinks/converge-event-mapper.js +1 -1
- package/analytics/sinks/elevar-sink.js +1 -1
- package/analytics/sinks/x-sink.js +1 -1
- package/analytics/utils/analytics-products.d.ts +1 -1
- package/analytics/utils/analytics-products.js +1 -1
- package/cart/buy-now-action.js +1 -1
- package/cart/cart-schema.d.ts +1 -1
- package/cart/cart-schema.js +1 -1
- package/{chunk-NDJ5N6HI.mjs → chunk-AQG3256R.mjs} +1 -1
- package/{chunk-GZWV5XKV.mjs → chunk-CQYCPDPI.mjs} +20 -20
- package/{chunk-EUQVEPSD.mjs → chunk-RQ76VK3L.mjs} +1 -1
- package/consent/consent-platform.js +1 -1
- package/consent/cookie.js +1 -1
- package/content.d.ts +1 -1
- package/content.js +1 -1
- package/env.js +1 -1
- package/gateways/canopy-api.d.ts +1 -1
- package/gateways/canopy-api.js +1 -1
- package/integrations/mailchimp.d.ts +1 -1
- package/integrations/mailchimp.js +1 -1
- package/lib/buildMetadata.js +3 -3
- package/loaders/loader-schemas.d.ts +39 -1
- package/loaders/loader-schemas.js +32 -2
- package/loaders/okendo-review-aggregate-loader.d.ts +1 -1
- package/loaders/okendo-review-aggregate-loader.js +1 -1
- package/loaders/okendo-reviews-loader.d.ts +41 -2
- package/loaders/okendo-reviews-loader.js +16 -8
- package/loaders/preview-placeholder.js +1 -1
- package/loaders/rebuy-recommendations-loader.d.ts +1 -1
- package/loaders/rebuy-recommendations-loader.js +1 -1
- package/loaders/smile-earning-rules-loader.d.ts +1 -1
- package/loaders/smile-earning-rules-loader.js +1 -1
- package/loaders/smile-rewards-loader.d.ts +1 -1
- package/loaders/smile-rewards-loader.js +1 -1
- package/loaders/smile-vip-tiers-loader.d.ts +1 -1
- package/loaders/smile-vip-tiers-loader.js +1 -1
- package/orders/order-status-schema.d.ts +1 -1
- package/orders/order-status-schema.js +1 -1
- package/package.json +4 -4
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { CONTENT_BUILTIN_FIELD_ROLES, CONTENT_COLLECTION_SCHEMA_FILENAME, CONTENT_COUPLED_VALUE_PARENTS, CONTENT_DIRNAME, CONTENT_ENTRY_FILE_EXTENSION, CONTENT_ENTRY_PUBLISHED_FILE_EXTENSION, CONTENT_MANIFEST_FILENAME, CONTENT_MAX_SLUG_LENGTH, CONTENT_PRIVATE_VALUE_KEYS, CONTENT_RELATED_VALUE_STORAGE_KEY, CONTENT_RESERVED_COLLECTION_SLUGS, CONTENT_RESERVED_ENTRY_SLUGS, CONTENT_SEO_VALUE_KEYS, CONTENT_SLUG_PATTERN, LEGACY_CONTENT_ENTRY_STATUSES, contentCollectionColorSchema, contentCollectionFieldSchema, contentCollectionFieldTypeSchema, contentCollectionFileSchema, contentSlugSchema, formatContentEntryRef, getContentEntryFileSlug, getContentEntryPublishState, getContentEntryRoute, getContentFieldRole, getContentFieldValueSchema, getOrderedContentFields, getPublishedContentFields, isContentPrivateValueKey, isContentReservedCollectionSlug, isContentReservedEntrySlug, isContentSeoValueKey, isSafeContentUrl, isValidContentSlug, parseContentEntryRef } from '../../chunk-
|
|
1
|
+
export { CONTENT_BUILTIN_FIELD_ROLES, CONTENT_COLLECTION_SCHEMA_FILENAME, CONTENT_COUPLED_VALUE_PARENTS, CONTENT_DIRNAME, CONTENT_ENTRY_FILE_EXTENSION, CONTENT_ENTRY_PUBLISHED_FILE_EXTENSION, CONTENT_MANIFEST_FILENAME, CONTENT_MAX_SLUG_LENGTH, CONTENT_PRIVATE_VALUE_KEYS, CONTENT_RELATED_VALUE_STORAGE_KEY, CONTENT_RESERVED_COLLECTION_SLUGS, CONTENT_RESERVED_ENTRY_SLUGS, CONTENT_SEO_VALUE_KEYS, CONTENT_SLUG_PATTERN, LEGACY_CONTENT_ENTRY_STATUSES, contentCollectionColorSchema, contentCollectionFieldSchema, contentCollectionFieldTypeSchema, contentCollectionFileSchema, contentSlugSchema, formatContentEntryRef, getContentEntryFileSlug, getContentEntryPublishState, getContentEntryRoute, getContentFieldRole, getContentFieldValueSchema, getOrderedContentFields, getPublishedContentFields, isContentPrivateValueKey, isContentReservedCollectionSlug, isContentReservedEntrySlug, isContentSeoValueKey, isSafeContentUrl, isValidContentSlug, parseContentEntryRef } from '../../chunk-RQ76VK3L.mjs';
|
|
2
2
|
import '../../chunk-UJCSKKID.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { contentCollectionFieldSchema, LegacyContentEntryStatus } from "./contentCollection";
|
|
2
|
-
import
|
|
2
|
+
import * as z from "zod";
|
|
3
3
|
export declare const CONTENT_MANAGED_ENTRY_VALUE_KEYS: readonly ["slug", "title", "status", "author", "authorInitials", "excerpt", "coverImage", "coverImageAlt", "tags", "updatedAt", "publishedAt", "archivedAt", "seoTitle", "seoDescription", "related", "scratchpad", "backlinks"];
|
|
4
4
|
export declare const contentEntryFrontmatterSchema: z.ZodObject<{
|
|
5
5
|
slug: z.ZodOptional<z.ZodUnknown>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { CONTENT_MANAGED_ENTRY_VALUE_KEYS, contentEntryFrontmatterSchema, convertLegacyContentEntryDocument, getContentEntryFieldValidationIssues, getContentRenderableEntryValues, parseContentEntryDocument, serializeContentEntryDocument } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
export { CONTENT_MANAGED_ENTRY_VALUE_KEYS, contentEntryFrontmatterSchema, convertLegacyContentEntryDocument, getContentEntryFieldValidationIssues, getContentRenderableEntryValues, parseContentEntryDocument, serializeContentEntryDocument } from '../../chunk-CQYCPDPI.mjs';
|
|
2
|
+
import '../../chunk-RQ76VK3L.mjs';
|
|
3
3
|
import '../../chunk-ACQS4AG5.mjs';
|
|
4
4
|
import '../../chunk-SSBIMQES.mjs';
|
|
5
5
|
import '../../chunk-UJCSKKID.mjs';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { parseContentEntryDocument, getContentRenderableEntryValues, getContentEntryFieldValidationIssues } from '../../chunk-
|
|
2
|
-
import { isValidContentSlug, CONTENT_COLLECTION_SCHEMA_FILENAME, CONTENT_ENTRY_FILE_EXTENSION, contentCollectionFileSchema, CONTENT_ENTRY_PUBLISHED_FILE_EXTENSION } from '../../chunk-
|
|
1
|
+
import { parseContentEntryDocument, getContentRenderableEntryValues, getContentEntryFieldValidationIssues } from '../../chunk-CQYCPDPI.mjs';
|
|
2
|
+
import { isValidContentSlug, CONTENT_COLLECTION_SCHEMA_FILENAME, CONTENT_ENTRY_FILE_EXTENSION, contentCollectionFileSchema, CONTENT_ENTRY_PUBLISHED_FILE_EXTENSION } from '../../chunk-RQ76VK3L.mjs';
|
|
3
3
|
import { parseJsonOrNull } from '../../chunk-C37TXOGI.mjs';
|
|
4
4
|
import '../../chunk-VVB7BEDE.mjs';
|
|
5
5
|
import '../../chunk-ACQS4AG5.mjs';
|
|
6
6
|
import '../../chunk-EUIVDITZ.mjs';
|
|
7
7
|
import '../../chunk-SSBIMQES.mjs';
|
|
8
8
|
import '../../chunk-UJCSKKID.mjs';
|
|
9
|
-
import
|
|
9
|
+
import * as z from 'zod';
|
|
10
10
|
|
|
11
11
|
var contentManifestSchema = z.object({
|
|
12
12
|
files: z.record(z.string(), z.string())
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ErrorUserFacingDetails, ErrorUserFacingDetailsWithMessage } from "./generated/errors";
|
|
2
|
-
import
|
|
2
|
+
import * as z from "zod";
|
|
3
3
|
/**
|
|
4
4
|
* Config to use for any standard error we throw in Replo
|
|
5
5
|
*/
|
|
@@ -485,6 +485,6 @@ export declare class IframeRpcChannelConfigurationError extends IframeRpcChannel
|
|
|
485
485
|
export declare class IframeRpcChannelInvalidInputError extends IframeRpcChannelError {
|
|
486
486
|
constructor({ method, cause }: {
|
|
487
487
|
method: string;
|
|
488
|
-
cause: ZodError;
|
|
488
|
+
cause: z.ZodError;
|
|
489
489
|
});
|
|
490
490
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ReploError } from '../../chunk-
|
|
1
|
+
import { ReploError } from '../../chunk-AQG3256R.mjs';
|
|
2
2
|
import '../../chunk-HFKL4ZR5.mjs';
|
|
3
3
|
import '../../chunk-EUIVDITZ.mjs';
|
|
4
4
|
import '../../chunk-SSBIMQES.mjs';
|
|
5
5
|
import { __commonJS, __toESM } from '../../chunk-UJCSKKID.mjs';
|
|
6
|
-
import
|
|
6
|
+
import * as z from 'zod';
|
|
7
7
|
|
|
8
8
|
var require_first_match = __commonJS({
|
|
9
9
|
"../../node_modules/.pnpm/first-match@0.0.1/node_modules/first-match/index.js"(exports, module) {
|
|
@@ -1816,9 +1816,9 @@ var require_currency_codes = __commonJS({
|
|
|
1816
1816
|
}) || []).indexOf(country2) > -1;
|
|
1817
1817
|
});
|
|
1818
1818
|
};
|
|
1819
|
-
var
|
|
1819
|
+
var number2 = function(number3) {
|
|
1820
1820
|
return first(data, function(c) {
|
|
1821
|
-
return c.number === String(
|
|
1821
|
+
return c.number === String(number3);
|
|
1822
1822
|
});
|
|
1823
1823
|
};
|
|
1824
1824
|
var codes = function() {
|
|
@@ -1846,7 +1846,7 @@ var require_currency_codes = __commonJS({
|
|
|
1846
1846
|
};
|
|
1847
1847
|
exports.code = code;
|
|
1848
1848
|
exports.country = country;
|
|
1849
|
-
exports.number =
|
|
1849
|
+
exports.number = number2;
|
|
1850
1850
|
exports.codes = codes;
|
|
1851
1851
|
exports.numbers = numbers;
|
|
1852
1852
|
exports.countries = countries;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ReploError } from '../../../chunk-
|
|
1
|
+
import { ReploError } from '../../../chunk-AQG3256R.mjs';
|
|
2
2
|
import '../../../chunk-HFKL4ZR5.mjs';
|
|
3
3
|
import '../../../chunk-EUIVDITZ.mjs';
|
|
4
4
|
import '../../../chunk-SSBIMQES.mjs';
|
|
5
5
|
import '../../../chunk-UJCSKKID.mjs';
|
|
6
|
-
import
|
|
6
|
+
import * as z from 'zod';
|
|
7
7
|
|
|
8
8
|
var LocaleRoutingValidationError = class extends ReploError {
|
|
9
9
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReploError } from "../errors";
|
|
2
|
-
import
|
|
2
|
+
import * as z from "zod";
|
|
3
3
|
export declare class RedirectRuleValidationError extends ReploError {
|
|
4
4
|
}
|
|
5
5
|
export declare const redirectStatusSchema: z.ZodUnion<readonly [z.ZodLiteral<301>, z.ZodLiteral<302>, z.ZodLiteral<307>, z.ZodLiteral<308>]>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { getParamSegment, getRouteParams, hasRouteParam, matchSource } from '../../../chunk-VPEVERWE.mjs';
|
|
2
|
-
import { ReploError } from '../../../chunk-
|
|
2
|
+
import { ReploError } from '../../../chunk-AQG3256R.mjs';
|
|
3
3
|
import '../../../chunk-HFKL4ZR5.mjs';
|
|
4
4
|
import '../../../chunk-EUIVDITZ.mjs';
|
|
5
5
|
import '../../../chunk-SSBIMQES.mjs';
|
|
6
6
|
import '../../../chunk-UJCSKKID.mjs';
|
|
7
|
-
import
|
|
7
|
+
import * as z from 'zod';
|
|
8
8
|
|
|
9
9
|
function parseUrl(value, base) {
|
|
10
10
|
try {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { filterUndefined } from "../../_vendor/replo-utils/lib/object.mjs";
|
|
2
|
-
import
|
|
2
|
+
import * as z from "zod";
|
|
3
3
|
import { isXEventIdForPixel } from "../../consent/script-snippets";
|
|
4
4
|
import { legacyResourceId } from "../utils/analytics-products";
|
|
5
5
|
import { createEventQueue } from "../utils/analytics-utils";
|
package/cart/buy-now-action.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use server";
|
|
2
2
|
import { headers } from "next/headers";
|
|
3
3
|
import { v4 as uuidv4 } from "uuid";
|
|
4
|
-
import
|
|
4
|
+
import * as z from "zod";
|
|
5
5
|
import { getEnv } from "../env";
|
|
6
6
|
import { CanopyError } from "../lib/canopy-error";
|
|
7
7
|
import { getCheckoutProvider } from "../lib/integration-utils";
|
package/cart/cart-schema.d.ts
CHANGED
package/cart/cart-schema.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CONTENT_SEO_VALUE_KEYS, CONTENT_RELATED_VALUE_STORAGE_KEY, CONTENT_PRIVATE_VALUE_KEYS, isContentPrivateValueKey, LEGACY_CONTENT_ENTRY_STATUSES, getContentFieldValueSchema } from './chunk-
|
|
1
|
+
import { CONTENT_SEO_VALUE_KEYS, CONTENT_RELATED_VALUE_STORAGE_KEY, CONTENT_PRIVATE_VALUE_KEYS, isContentPrivateValueKey, LEGACY_CONTENT_ENTRY_STATUSES, getContentFieldValueSchema } from './chunk-RQ76VK3L.mjs';
|
|
2
2
|
import { pickBy_default } from './chunk-ACQS4AG5.mjs';
|
|
3
3
|
import { stringify, parseDocument } from 'yaml';
|
|
4
|
-
import
|
|
4
|
+
import * as z2 from 'zod';
|
|
5
5
|
|
|
6
|
-
var frontmatterDataSchema =
|
|
6
|
+
var frontmatterDataSchema = z2.record(z2.string(), z2.unknown());
|
|
7
7
|
var CONTENT_FRONTMATTER_PATTERN = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?/u;
|
|
8
8
|
function parseContentFrontmatterYaml(yamlText) {
|
|
9
9
|
try {
|
|
@@ -55,23 +55,23 @@ var CONTENT_MANAGED_ENTRY_VALUE_KEYS = [
|
|
|
55
55
|
CONTENT_RELATED_VALUE_STORAGE_KEY,
|
|
56
56
|
...CONTENT_PRIVATE_VALUE_KEYS
|
|
57
57
|
];
|
|
58
|
-
var contentEntryFrontmatterSchema =
|
|
59
|
-
slug:
|
|
60
|
-
title:
|
|
61
|
-
author:
|
|
62
|
-
authorInitials:
|
|
63
|
-
excerpt:
|
|
64
|
-
coverImage:
|
|
65
|
-
coverImageAlt:
|
|
66
|
-
tags:
|
|
67
|
-
updatedAt:
|
|
68
|
-
publishedAt:
|
|
69
|
-
archivedAt:
|
|
70
|
-
seoTitle:
|
|
71
|
-
seoDescription:
|
|
72
|
-
related:
|
|
73
|
-
scratchpad:
|
|
74
|
-
backlinks:
|
|
58
|
+
var contentEntryFrontmatterSchema = z2.object({
|
|
59
|
+
slug: z2.unknown().optional(),
|
|
60
|
+
title: z2.string().nullish(),
|
|
61
|
+
author: z2.string().nullish(),
|
|
62
|
+
authorInitials: z2.string().nullish(),
|
|
63
|
+
excerpt: z2.string().nullish(),
|
|
64
|
+
coverImage: z2.string().nullish(),
|
|
65
|
+
coverImageAlt: z2.string().nullish(),
|
|
66
|
+
tags: z2.array(z2.string()).nullish(),
|
|
67
|
+
updatedAt: z2.string().nullish(),
|
|
68
|
+
publishedAt: z2.string().nullish(),
|
|
69
|
+
archivedAt: z2.string().nullish(),
|
|
70
|
+
seoTitle: z2.string().nullish(),
|
|
71
|
+
seoDescription: z2.string().nullish(),
|
|
72
|
+
related: z2.array(z2.string()).nullish(),
|
|
73
|
+
scratchpad: z2.unknown().optional(),
|
|
74
|
+
backlinks: z2.unknown().optional()
|
|
75
75
|
}).passthrough();
|
|
76
76
|
function parseContentEntryDocument(raw) {
|
|
77
77
|
const frontmatter = parseContentFrontmatter(raw);
|
package/consent/cookie.js
CHANGED
package/content.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { Metadata } from "next";
|
|
|
3
3
|
import type { ReactNode } from "react";
|
|
4
4
|
import type { contentCollectionFieldSchema } from "./_vendor/schemas/contentCollection";
|
|
5
5
|
import type { ContentManifest } from "./_vendor/schemas/contentManifest";
|
|
6
|
-
import
|
|
6
|
+
import * as z from "zod";
|
|
7
7
|
/** Public name for the shared collection-field contract. */
|
|
8
8
|
export type ContentField = z.infer<typeof contentCollectionFieldSchema>;
|
|
9
9
|
export interface ContentEntry {
|
package/content.js
CHANGED
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
getContentManifestCollectionSlugs,
|
|
31
31
|
getContentManifestEntrySlugs
|
|
32
32
|
} from "./_vendor/schemas/contentManifest.mjs";
|
|
33
|
-
import
|
|
33
|
+
import * as z from "zod";
|
|
34
34
|
function createContentSource({
|
|
35
35
|
contentDirectory = getDefaultContentDirectory(),
|
|
36
36
|
contentManifest
|
package/env.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getCloudflareContext } from "@opennextjs/cloudflare";
|
|
2
2
|
import JSONC from "tiny-jsonc";
|
|
3
|
-
import
|
|
3
|
+
import * as z from "zod";
|
|
4
4
|
import { CanopyError } from "./lib/canopy-error";
|
|
5
5
|
const envSchema = z.object({
|
|
6
6
|
CANOPY_API_HOST: z.string().min(1),
|
package/gateways/canopy-api.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Cart } from "../cart/cart-schema";
|
|
2
2
|
import type { StorefrontCountryCode } from "../loaders/markets";
|
|
3
|
-
import
|
|
3
|
+
import * as z from "zod";
|
|
4
4
|
import { CanopyError } from "../lib/canopy-error";
|
|
5
5
|
type CanopyApiGatewayErrorConfig = {
|
|
6
6
|
message: string;
|
package/gateways/canopy-api.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { useMutation } from "@tanstack/react-query";
|
|
4
4
|
import { parseJsonOrNull } from "../_vendor/replo-utils/lib/json.mjs";
|
|
5
|
-
import
|
|
5
|
+
import * as z from "zod";
|
|
6
6
|
import { CanopyError } from "../lib/canopy-error";
|
|
7
7
|
import { useCanopyClientConfig } from "../providers/canopy-client-config";
|
|
8
8
|
const mailchimpSubscribeErrorCodeSchema = z.enum([
|
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.1",
|
|
4
4
|
"branch": "HEAD",
|
|
5
|
-
"commit": "
|
|
6
|
-
"builtAt": "2026-10-
|
|
5
|
+
"commit": "c2722877665042cdbb579483c39be734395d2833",
|
|
6
|
+
"builtAt": "2026-10-18T22:08:53.056Z"
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from "zod";
|
|
2
2
|
export declare const imageSchema: z.ZodObject<{
|
|
3
3
|
url: z.ZodString;
|
|
4
4
|
altText: z.ZodNullable<z.ZodString>;
|
|
@@ -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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from "zod";
|
|
2
2
|
const imageSchema = z.object({
|
|
3
3
|
url: z.string(),
|
|
4
4
|
altText: z.string().nullable(),
|
|
@@ -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,
|
|
@@ -2,7 +2,7 @@
|
|
|
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
|
|
5
|
+
import * as z from "zod";
|
|
6
6
|
import { invokeLoader } from "./invoke-loader";
|
|
7
7
|
import { LoaderErrorBoundary } from "./loader-error-boundary";
|
|
8
8
|
const okendoReviewAggregateOutputSchema = z.object({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import
|
|
2
|
+
import * as z from "zod";
|
|
3
3
|
declare const okendoReviewsOutputSchema: z.ZodObject<{
|
|
4
4
|
reviews: z.ZodArray<z.ZodObject<{
|
|
5
5
|
id: z.ZodString;
|
|
@@ -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 {};
|
|
@@ -2,25 +2,27 @@
|
|
|
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
|
|
5
|
+
import * as z from "zod";
|
|
6
6
|
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
|
) })
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect } from "react";
|
|
2
|
-
import
|
|
2
|
+
import * as z from "zod";
|
|
3
3
|
import { DATA_LOADER_KEYS } from "./loader-keys";
|
|
4
4
|
const PLACEHOLDER_RENDER_MESSAGE_TYPE = "replo:preview:placeholder-render";
|
|
5
5
|
const UNFILLED_ROUTE_PARAM_RE = /^\[{1,2}(?:\.\.\.)?[^\]]+\]{1,2}$/;
|
|
@@ -2,7 +2,7 @@
|
|
|
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
|
|
5
|
+
import * as z from "zod";
|
|
6
6
|
import { invokeLoader } from "./invoke-loader";
|
|
7
7
|
import { LoaderErrorBoundary } from "./loader-error-boundary";
|
|
8
8
|
import { productSchema } from "./loader-schemas";
|
|
@@ -2,7 +2,7 @@
|
|
|
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
|
|
5
|
+
import * as z from "zod";
|
|
6
6
|
import { invokeLoader } from "./invoke-loader";
|
|
7
7
|
import { LoaderErrorBoundary } from "./loader-error-boundary";
|
|
8
8
|
const smileEarningRuleSchema = z.object({
|
|
@@ -2,7 +2,7 @@
|
|
|
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
|
|
5
|
+
import * as z from "zod";
|
|
6
6
|
import { invokeLoader } from "./invoke-loader";
|
|
7
7
|
import { LoaderErrorBoundary } from "./loader-error-boundary";
|
|
8
8
|
const smileRewardSchema = z.object({
|
|
@@ -2,7 +2,7 @@
|
|
|
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
|
|
5
|
+
import * as z from "zod";
|
|
6
6
|
import { invokeLoader } from "./invoke-loader";
|
|
7
7
|
import { LoaderErrorBoundary } from "./loader-error-boundary";
|
|
8
8
|
const smileVipTierSchema = z.object({
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@replohq/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.1",
|
|
4
4
|
"reploBuild": {
|
|
5
5
|
"packageName": "@replohq/sdk",
|
|
6
|
-
"version": "1.
|
|
6
|
+
"version": "1.21.1",
|
|
7
7
|
"branch": "HEAD",
|
|
8
|
-
"commit": "
|
|
9
|
-
"builtAt": "2026-10-
|
|
8
|
+
"commit": "c2722877665042cdbb579483c39be734395d2833",
|
|
9
|
+
"builtAt": "2026-10-18T22:08:53.056Z"
|
|
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",
|