@replohq/sdk 2.11.0 → 2.12.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/README.md +1 -0
- package/_vendor/schemas/loaderKeys.mjs +1 -0
- package/lib/buildMetadata.js +3 -3
- package/loaders/loader-keys.d.ts +1 -0
- package/loaders/loader-keys.js +1 -0
- package/loaders/loader-output.js +2 -0
- package/loaders/loader-outputs.d.ts +2 -1
- package/loaders/loader-schemas.d.ts +20 -0
- package/loaders/loader-schemas.js +4 -0
- package/loaders/shop-loader.d.ts +17 -0
- package/loaders/shop-loader.js +45 -0
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -101,6 +101,7 @@ Use these public loader components and keys for each configured integration:
|
|
|
101
101
|
| Shopify Storefront | `CollectionProductsLoader` | `SHOPIFY_COLLECTION_PRODUCTS` |
|
|
102
102
|
| Shopify Storefront | `MetaobjectLoader` | `SHOPIFY_METAOBJECT` |
|
|
103
103
|
| Shopify Storefront | `MetaobjectsLoader` | `SHOPIFY_METAOBJECTS` |
|
|
104
|
+
| Shopify Storefront | `ShopLoader` | `SHOPIFY_SHOP` |
|
|
104
105
|
| Okendo | `OkendoReviewsLoader` | `OKENDO_PRODUCT_REVIEWS` |
|
|
105
106
|
| Okendo | `OkendoReviewAggregateLoader` | `OKENDO_PRODUCT_REVIEW_AGGREGATE` |
|
|
106
107
|
| Rebuy | `RebuyRecommendationsLoader` | `REBUY_RECOMMENDATIONS` |
|
|
@@ -5,6 +5,7 @@ var DATA_LOADER_KEYS = {
|
|
|
5
5
|
SHOPIFY_COLLECTION_PRODUCTS: "shopify_storefront.collection_products",
|
|
6
6
|
SHOPIFY_METAOBJECT: "shopify_storefront.metaobject",
|
|
7
7
|
SHOPIFY_METAOBJECTS: "shopify_storefront.metaobjects",
|
|
8
|
+
SHOPIFY_SHOP: "shopify_storefront.shop",
|
|
8
9
|
SHOPIFY_KACHING_BUNDLES: "shopify_storefront.kaching_bundles",
|
|
9
10
|
REPLO_PRODUCT: "replo_products.product",
|
|
10
11
|
OKENDO_PRODUCT_REVIEWS: "okendo.product_reviews",
|
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.12.0",
|
|
4
4
|
"branch": "HEAD",
|
|
5
|
-
"commit": "
|
|
6
|
-
"builtAt": "2026-10-
|
|
5
|
+
"commit": "3979195a451aa6e4c83a6eb0e1ec8eff5b2f8b81",
|
|
6
|
+
"builtAt": "2026-10-29T23:04:10.969Z"
|
|
7
7
|
};
|
package/loaders/loader-keys.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export declare const DATA_LOADER_KEYS: {
|
|
|
16
16
|
readonly SHOPIFY_COLLECTION_PRODUCTS: "shopify_storefront.collection_products";
|
|
17
17
|
readonly SHOPIFY_METAOBJECT: "shopify_storefront.metaobject";
|
|
18
18
|
readonly SHOPIFY_METAOBJECTS: "shopify_storefront.metaobjects";
|
|
19
|
+
readonly SHOPIFY_SHOP: "shopify_storefront.shop";
|
|
19
20
|
readonly SHOPIFY_KACHING_BUNDLES: "shopify_storefront.kaching_bundles";
|
|
20
21
|
readonly REPLO_PRODUCT: "replo_products.product";
|
|
21
22
|
readonly OKENDO_PRODUCT_REVIEWS: "okendo.product_reviews";
|
package/loaders/loader-keys.js
CHANGED
|
@@ -5,6 +5,7 @@ const DATA_LOADER_KEYS = {
|
|
|
5
5
|
SHOPIFY_COLLECTION_PRODUCTS: "shopify_storefront.collection_products",
|
|
6
6
|
SHOPIFY_METAOBJECT: "shopify_storefront.metaobject",
|
|
7
7
|
SHOPIFY_METAOBJECTS: "shopify_storefront.metaobjects",
|
|
8
|
+
SHOPIFY_SHOP: "shopify_storefront.shop",
|
|
8
9
|
SHOPIFY_KACHING_BUNDLES: "shopify_storefront.kaching_bundles",
|
|
9
10
|
REPLO_PRODUCT: "replo_products.product",
|
|
10
11
|
OKENDO_PRODUCT_REVIEWS: "okendo.product_reviews",
|
package/loaders/loader-output.js
CHANGED
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
shopifyKachingBundlesLoaderOutputSchema,
|
|
34
34
|
shopifyMetaobjectLoaderOutputSchema,
|
|
35
35
|
shopifyMetaobjectsLoaderOutputSchema,
|
|
36
|
+
shopifyShopLoaderOutputSchema,
|
|
36
37
|
statsigExperimentLoaderOutputSchema,
|
|
37
38
|
yotpoProductReviewAggregateLoaderOutputSchema,
|
|
38
39
|
yotpoProductReviewsLoaderOutputSchema
|
|
@@ -44,6 +45,7 @@ const LOADER_OUTPUT_SCHEMAS = {
|
|
|
44
45
|
[DATA_LOADER_KEYS.SHOPIFY_COLLECTION_PRODUCTS]: paginatedProductsSchema,
|
|
45
46
|
[DATA_LOADER_KEYS.SHOPIFY_METAOBJECT]: shopifyMetaobjectLoaderOutputSchema,
|
|
46
47
|
[DATA_LOADER_KEYS.SHOPIFY_METAOBJECTS]: shopifyMetaobjectsLoaderOutputSchema,
|
|
48
|
+
[DATA_LOADER_KEYS.SHOPIFY_SHOP]: shopifyShopLoaderOutputSchema,
|
|
47
49
|
[DATA_LOADER_KEYS.SHOPIFY_KACHING_BUNDLES]: shopifyKachingBundlesLoaderOutputSchema,
|
|
48
50
|
[DATA_LOADER_KEYS.REPLO_PRODUCT]: fullProductSchema,
|
|
49
51
|
[DATA_LOADER_KEYS.OKENDO_PRODUCT_REVIEWS]: okendoReviewsOutputSchema,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type * as z from "zod";
|
|
2
2
|
import type { okendoReviewAggregateOutputSchema, okendoReviewsOutputSchema, rebuyRecommendationsOutputSchema, smileEarningRulesOutputSchema, smileRewardsOutputSchema, smileVipTiersOutputSchema } from "./integration-loader-schemas";
|
|
3
3
|
import type { DATA_LOADER_KEYS, DataLoaderKey } from "./loader-keys";
|
|
4
|
-
import type { ContentfulEntriesLoaderOutput, ContentfulEntryLoaderOutput, FullCollection, FullProduct, judgemeProductReviewAggregateLoaderOutputSchema, judgemeProductReviewsLoaderOutputSchema, junipProductReviewAggregateLoaderOutputSchema, junipProductReviewsLoaderOutputSchema, LevantaProductFull, looxProductReviewAggregateLoaderOutputSchema, looxProductReviewsLoaderOutputSchema, loyaltyLionEarningRulesLoaderOutputSchema, loyaltyLionPointsForPriceLoaderOutputSchema, loyaltyLionRewardsLoaderOutputSchema, loyaltyLionTiersLoaderOutputSchema, PaginatedProducts, reviewsIoProductReviewAggregateLoaderOutputSchema, reviewsIoProductReviewsLoaderOutputSchema, ShopifyIntegrationDetails, ShopifyKachingBundlesLoaderOutput, ShopifyMetaobjectLoaderOutput, ShopifyMetaobjectsLoaderOutput, StatsigExperimentAssignment, yotpoProductReviewAggregateLoaderOutputSchema, yotpoProductReviewsLoaderOutputSchema } from "./loader-schemas";
|
|
4
|
+
import type { ContentfulEntriesLoaderOutput, ContentfulEntryLoaderOutput, FullCollection, FullProduct, judgemeProductReviewAggregateLoaderOutputSchema, judgemeProductReviewsLoaderOutputSchema, junipProductReviewAggregateLoaderOutputSchema, junipProductReviewsLoaderOutputSchema, LevantaProductFull, looxProductReviewAggregateLoaderOutputSchema, looxProductReviewsLoaderOutputSchema, loyaltyLionEarningRulesLoaderOutputSchema, loyaltyLionPointsForPriceLoaderOutputSchema, loyaltyLionRewardsLoaderOutputSchema, loyaltyLionTiersLoaderOutputSchema, PaginatedProducts, reviewsIoProductReviewAggregateLoaderOutputSchema, reviewsIoProductReviewsLoaderOutputSchema, ShopifyIntegrationDetails, ShopifyKachingBundlesLoaderOutput, ShopifyMetaobjectLoaderOutput, ShopifyMetaobjectsLoaderOutput, ShopifyShopLoaderOutput, StatsigExperimentAssignment, yotpoProductReviewAggregateLoaderOutputSchema, yotpoProductReviewsLoaderOutputSchema } from "./loader-schemas";
|
|
5
5
|
type LoaderOutputByKeyName = {
|
|
6
6
|
SHOPIFY_INTEGRATION_DETAILS: ShopifyIntegrationDetails;
|
|
7
7
|
SHOPIFY_PRODUCT: FullProduct;
|
|
@@ -9,6 +9,7 @@ type LoaderOutputByKeyName = {
|
|
|
9
9
|
SHOPIFY_COLLECTION_PRODUCTS: PaginatedProducts;
|
|
10
10
|
SHOPIFY_METAOBJECT: ShopifyMetaobjectLoaderOutput;
|
|
11
11
|
SHOPIFY_METAOBJECTS: ShopifyMetaobjectsLoaderOutput;
|
|
12
|
+
SHOPIFY_SHOP: ShopifyShopLoaderOutput;
|
|
12
13
|
SHOPIFY_KACHING_BUNDLES: ShopifyKachingBundlesLoaderOutput;
|
|
13
14
|
REPLO_PRODUCT: FullProduct;
|
|
14
15
|
OKENDO_PRODUCT_REVIEWS: z.infer<typeof okendoReviewsOutputSchema>;
|
|
@@ -1268,6 +1268,26 @@ export declare const shopifyMetaobjectsLoaderOutputSchema: z.ZodObject<{
|
|
|
1268
1268
|
endCursor: z.ZodNullable<z.ZodString>;
|
|
1269
1269
|
}, z.core.$strip>;
|
|
1270
1270
|
}, z.core.$strip>;
|
|
1271
|
+
export declare const shopifyShopLoaderOutputSchema: z.ZodObject<{
|
|
1272
|
+
metafields: z.ZodArray<z.ZodObject<{
|
|
1273
|
+
key: z.ZodString;
|
|
1274
|
+
namespace: z.ZodString;
|
|
1275
|
+
type: z.ZodString;
|
|
1276
|
+
value: z.ZodString;
|
|
1277
|
+
reference: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1278
|
+
kind: z.ZodLiteral<"image">;
|
|
1279
|
+
url: z.ZodNullable<z.ZodString>;
|
|
1280
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1281
|
+
kind: z.ZodLiteral<"file">;
|
|
1282
|
+
url: z.ZodNullable<z.ZodString>;
|
|
1283
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1284
|
+
kind: z.ZodLiteral<"video">;
|
|
1285
|
+
url: z.ZodNullable<z.ZodString>;
|
|
1286
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
1287
|
+
}, z.core.$strip>], "kind">>>;
|
|
1288
|
+
}, z.core.$strip>>;
|
|
1289
|
+
}, z.core.$strip>;
|
|
1290
|
+
export type ShopifyShopLoaderOutput = z.infer<typeof shopifyShopLoaderOutputSchema>;
|
|
1271
1291
|
export declare const shopifyKachingBundlesLoaderOutputSchema: z.ZodObject<{
|
|
1272
1292
|
bundles: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1273
1293
|
}, z.core.$strip>;
|
|
@@ -469,6 +469,9 @@ const shopifyMetaobjectsLoaderOutputSchema = z.object({
|
|
|
469
469
|
endCursor: z.string().nullable()
|
|
470
470
|
})
|
|
471
471
|
}).describe("ShopifyMetaobjectsLoaderOutput");
|
|
472
|
+
const shopifyShopLoaderOutputSchema = z.object({
|
|
473
|
+
metafields: z.array(metafieldSchema)
|
|
474
|
+
}).describe("ShopifyShopLoaderOutput");
|
|
472
475
|
const shopifyKachingBundlesLoaderOutputSchema = z.object({
|
|
473
476
|
bundles: z.record(z.string(), z.unknown()).nullable()
|
|
474
477
|
}).describe("ShopifyKachingBundles");
|
|
@@ -535,6 +538,7 @@ export {
|
|
|
535
538
|
shopifyKachingBundlesLoaderOutputSchema,
|
|
536
539
|
shopifyMetaobjectLoaderOutputSchema,
|
|
537
540
|
shopifyMetaobjectsLoaderOutputSchema,
|
|
541
|
+
shopifyShopLoaderOutputSchema,
|
|
538
542
|
statsigExperimentLoaderOutputSchema,
|
|
539
543
|
storefrontMetaobjectSchema,
|
|
540
544
|
variantSchema,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { DATA_LOADER_KEYS } from "./loader-keys";
|
|
3
|
+
import type { LoaderKeyProp } from "./loader-outputs";
|
|
4
|
+
import type { ShopifyShopLoaderOutput } from "./loader-schemas";
|
|
5
|
+
type LoaderKey = (typeof DATA_LOADER_KEYS)["SHOPIFY_SHOP"];
|
|
6
|
+
type MetafieldIdentifier = {
|
|
7
|
+
namespace: string;
|
|
8
|
+
key: string;
|
|
9
|
+
};
|
|
10
|
+
type ShopLoaderProps = {
|
|
11
|
+
loaderKey: LoaderKeyProp<LoaderKey>;
|
|
12
|
+
metafieldIdentifiers: MetafieldIdentifier[];
|
|
13
|
+
children: (data: ShopifyShopLoaderOutput) => ReactNode;
|
|
14
|
+
fallback: ReactNode;
|
|
15
|
+
};
|
|
16
|
+
export declare function ShopLoader({ loaderKey, metafieldIdentifiers, children, fallback, }: ShopLoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
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 ShopLoaderInner({
|
|
8
|
+
loaderKey,
|
|
9
|
+
metafieldIdentifiers,
|
|
10
|
+
children
|
|
11
|
+
}) {
|
|
12
|
+
const args = { metafieldIdentifiers };
|
|
13
|
+
const { data } = useSuspenseQuery({
|
|
14
|
+
queryKey: [loaderKey, args],
|
|
15
|
+
queryFn: () => {
|
|
16
|
+
return invokeLoader({ loaderKey, args });
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
return /* @__PURE__ */ jsx(Fragment, { children: children(data) });
|
|
20
|
+
}
|
|
21
|
+
function ShopLoader({
|
|
22
|
+
loaderKey,
|
|
23
|
+
metafieldIdentifiers,
|
|
24
|
+
children,
|
|
25
|
+
fallback
|
|
26
|
+
}) {
|
|
27
|
+
return /* @__PURE__ */ jsx(
|
|
28
|
+
LoaderErrorBoundary,
|
|
29
|
+
{
|
|
30
|
+
fallback,
|
|
31
|
+
resetKey: `${loaderKey}:${JSON.stringify(metafieldIdentifiers)}`,
|
|
32
|
+
children: /* @__PURE__ */ jsx(Suspense, { fallback, children: /* @__PURE__ */ jsx(
|
|
33
|
+
ShopLoaderInner,
|
|
34
|
+
{
|
|
35
|
+
loaderKey,
|
|
36
|
+
metafieldIdentifiers,
|
|
37
|
+
children
|
|
38
|
+
}
|
|
39
|
+
) })
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
ShopLoader
|
|
45
|
+
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@replohq/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0",
|
|
4
4
|
"reploBuild": {
|
|
5
5
|
"packageName": "@replohq/sdk",
|
|
6
|
-
"version": "2.
|
|
6
|
+
"version": "2.12.0",
|
|
7
7
|
"branch": "HEAD",
|
|
8
|
-
"commit": "
|
|
9
|
-
"builtAt": "2026-10-
|
|
8
|
+
"commit": "3979195a451aa6e4c83a6eb0e1ec8eff5b2f8b81",
|
|
9
|
+
"builtAt": "2026-10-29T23:04:10.969Z"
|
|
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",
|
|
@@ -209,6 +209,10 @@
|
|
|
209
209
|
"types": "./loaders/reviews-io-reviews-loader.d.ts",
|
|
210
210
|
"default": "./loaders/reviews-io-reviews-loader.js"
|
|
211
211
|
},
|
|
212
|
+
"./loaders/shop-loader": {
|
|
213
|
+
"types": "./loaders/shop-loader.d.ts",
|
|
214
|
+
"default": "./loaders/shop-loader.js"
|
|
215
|
+
},
|
|
212
216
|
"./loaders/shopify-integration-details-loader": {
|
|
213
217
|
"types": "./loaders/shopify-integration-details-loader.d.ts",
|
|
214
218
|
"default": "./loaders/shopify-integration-details-loader.js"
|