@replohq/sdk 2.2.2 → 2.3.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 +4 -0
- package/_vendor/schemas/loaderKeys.mjs +4 -0
- package/lib/buildMetadata.js +3 -3
- package/loaders/loader-keys.d.ts +4 -0
- package/loaders/loader-keys.js +4 -0
- package/loaders/loader-schemas.d.ts +112 -0
- package/loaders/loader-schemas.js +72 -0
- package/loaders/loyaltylion-earning-rules-loader.d.ts +10 -0
- package/loaders/loyaltylion-earning-rules-loader.js +37 -0
- package/loaders/loyaltylion-points-for-price-loader.d.ts +11 -0
- package/loaders/loyaltylion-points-for-price-loader.js +46 -0
- package/loaders/loyaltylion-rewards-loader.d.ts +10 -0
- package/loaders/loyaltylion-rewards-loader.js +35 -0
- package/loaders/loyaltylion-tiers-loader.d.ts +10 -0
- package/loaders/loyaltylion-tiers-loader.js +35 -0
- package/package.json +20 -4
package/README.md
CHANGED
|
@@ -108,6 +108,10 @@ Use these public loader components and keys for each configured integration:
|
|
|
108
108
|
| Smile.io | `SmileVipTiersLoader` | `SMILE_IO_VIP_TIERS` |
|
|
109
109
|
| Smile.io | `SmileEarningRulesLoader` | `SMILE_IO_EARNING_RULES` |
|
|
110
110
|
| Smile.io | `SmileRewardsLoader` | `SMILE_IO_REWARDS` |
|
|
111
|
+
| LoyaltyLion | `LoyaltyLionEarningRulesLoader` | `LOYALTYLION_EARNING_RULES` |
|
|
112
|
+
| LoyaltyLion | `LoyaltyLionRewardsLoader` | `LOYALTYLION_REWARDS` |
|
|
113
|
+
| LoyaltyLion | `LoyaltyLionTiersLoader` | `LOYALTYLION_TIERS` |
|
|
114
|
+
| LoyaltyLion | `LoyaltyLionPointsForPriceLoader` | `LOYALTYLION_POINTS_FOR_PRICE` |
|
|
111
115
|
| Yotpo | `YotpoReviewsLoader` | `YOTPO_PRODUCT_REVIEWS` |
|
|
112
116
|
| Yotpo | `YotpoReviewAggregateLoader` | `YOTPO_PRODUCT_REVIEW_AGGREGATE` |
|
|
113
117
|
| Reviews.io | `ReviewsIoReviewsLoader` | `REVIEWS_IO_PRODUCT_REVIEWS` |
|
|
@@ -16,6 +16,10 @@ var DATA_LOADER_KEYS = {
|
|
|
16
16
|
SMILE_IO_VIP_TIERS: "smile_io.vip_tiers",
|
|
17
17
|
SMILE_IO_EARNING_RULES: "smile_io.earning_rules",
|
|
18
18
|
SMILE_IO_REWARDS: "smile_io.rewards",
|
|
19
|
+
LOYALTYLION_EARNING_RULES: "loyaltylion.earning_rules",
|
|
20
|
+
LOYALTYLION_REWARDS: "loyaltylion.rewards",
|
|
21
|
+
LOYALTYLION_TIERS: "loyaltylion.tiers",
|
|
22
|
+
LOYALTYLION_POINTS_FOR_PRICE: "loyaltylion.points_for_price",
|
|
19
23
|
YOTPO_PRODUCT_REVIEWS: "yotpo.product_reviews",
|
|
20
24
|
YOTPO_PRODUCT_REVIEW_AGGREGATE: "yotpo.product_review_aggregate",
|
|
21
25
|
REVIEWS_IO_PRODUCT_REVIEWS: "reviews_io.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.3.0",
|
|
4
4
|
"branch": "HEAD",
|
|
5
|
-
"commit": "
|
|
6
|
-
"builtAt": "2026-10-
|
|
5
|
+
"commit": "0f7d0830fdc9d0b6c299ee8b9497a749d41aee95",
|
|
6
|
+
"builtAt": "2026-10-21T20:51:42.391Z"
|
|
7
7
|
};
|
package/loaders/loader-keys.d.ts
CHANGED
|
@@ -25,6 +25,10 @@ export declare const DATA_LOADER_KEYS: {
|
|
|
25
25
|
readonly SMILE_IO_VIP_TIERS: "smile_io.vip_tiers";
|
|
26
26
|
readonly SMILE_IO_EARNING_RULES: "smile_io.earning_rules";
|
|
27
27
|
readonly SMILE_IO_REWARDS: "smile_io.rewards";
|
|
28
|
+
readonly LOYALTYLION_EARNING_RULES: "loyaltylion.earning_rules";
|
|
29
|
+
readonly LOYALTYLION_REWARDS: "loyaltylion.rewards";
|
|
30
|
+
readonly LOYALTYLION_TIERS: "loyaltylion.tiers";
|
|
31
|
+
readonly LOYALTYLION_POINTS_FOR_PRICE: "loyaltylion.points_for_price";
|
|
28
32
|
readonly YOTPO_PRODUCT_REVIEWS: "yotpo.product_reviews";
|
|
29
33
|
readonly YOTPO_PRODUCT_REVIEW_AGGREGATE: "yotpo.product_review_aggregate";
|
|
30
34
|
readonly REVIEWS_IO_PRODUCT_REVIEWS: "reviews_io.product_reviews";
|
package/loaders/loader-keys.js
CHANGED
|
@@ -14,6 +14,10 @@ const DATA_LOADER_KEYS = {
|
|
|
14
14
|
SMILE_IO_VIP_TIERS: "smile_io.vip_tiers",
|
|
15
15
|
SMILE_IO_EARNING_RULES: "smile_io.earning_rules",
|
|
16
16
|
SMILE_IO_REWARDS: "smile_io.rewards",
|
|
17
|
+
LOYALTYLION_EARNING_RULES: "loyaltylion.earning_rules",
|
|
18
|
+
LOYALTYLION_REWARDS: "loyaltylion.rewards",
|
|
19
|
+
LOYALTYLION_TIERS: "loyaltylion.tiers",
|
|
20
|
+
LOYALTYLION_POINTS_FOR_PRICE: "loyaltylion.points_for_price",
|
|
17
21
|
YOTPO_PRODUCT_REVIEWS: "yotpo.product_reviews",
|
|
18
22
|
YOTPO_PRODUCT_REVIEW_AGGREGATE: "yotpo.product_review_aggregate",
|
|
19
23
|
REVIEWS_IO_PRODUCT_REVIEWS: "reviews_io.product_reviews",
|
|
@@ -983,6 +983,118 @@ 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 loyaltyLionEarningRuleVariantSchema: z.ZodObject<{
|
|
987
|
+
tierId: z.ZodNullable<z.ZodNumber>;
|
|
988
|
+
title: z.ZodString;
|
|
989
|
+
description: z.ZodNullable<z.ZodString>;
|
|
990
|
+
resultText: z.ZodString;
|
|
991
|
+
points: z.ZodNullable<z.ZodNumber>;
|
|
992
|
+
perCurrencyUnit: z.ZodNullable<z.ZodNumber>;
|
|
993
|
+
}, z.core.$strip>;
|
|
994
|
+
export declare const loyaltyLionEarningRuleSchema: z.ZodObject<{
|
|
995
|
+
id: z.ZodNumber;
|
|
996
|
+
kind: z.ZodString;
|
|
997
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
998
|
+
variants: z.ZodArray<z.ZodObject<{
|
|
999
|
+
tierId: z.ZodNullable<z.ZodNumber>;
|
|
1000
|
+
title: z.ZodString;
|
|
1001
|
+
description: z.ZodNullable<z.ZodString>;
|
|
1002
|
+
resultText: z.ZodString;
|
|
1003
|
+
points: z.ZodNullable<z.ZodNumber>;
|
|
1004
|
+
perCurrencyUnit: z.ZodNullable<z.ZodNumber>;
|
|
1005
|
+
}, z.core.$strip>>;
|
|
1006
|
+
}, z.core.$strip>;
|
|
1007
|
+
export declare const loyaltyLionEarningRulesLoaderOutputSchema: z.ZodObject<{
|
|
1008
|
+
currency: z.ZodString;
|
|
1009
|
+
earningRules: z.ZodArray<z.ZodObject<{
|
|
1010
|
+
id: z.ZodNumber;
|
|
1011
|
+
kind: z.ZodString;
|
|
1012
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
1013
|
+
variants: z.ZodArray<z.ZodObject<{
|
|
1014
|
+
tierId: z.ZodNullable<z.ZodNumber>;
|
|
1015
|
+
title: z.ZodString;
|
|
1016
|
+
description: z.ZodNullable<z.ZodString>;
|
|
1017
|
+
resultText: z.ZodString;
|
|
1018
|
+
points: z.ZodNullable<z.ZodNumber>;
|
|
1019
|
+
perCurrencyUnit: z.ZodNullable<z.ZodNumber>;
|
|
1020
|
+
}, z.core.$strip>>;
|
|
1021
|
+
}, z.core.$strip>>;
|
|
1022
|
+
}, z.core.$strip>;
|
|
1023
|
+
export declare const loyaltyLionRewardVariantSchema: z.ZodObject<{
|
|
1024
|
+
tierId: z.ZodNullable<z.ZodNumber>;
|
|
1025
|
+
title: z.ZodString;
|
|
1026
|
+
description: z.ZodNullable<z.ZodString>;
|
|
1027
|
+
costText: z.ZodString;
|
|
1028
|
+
pointsCost: z.ZodNumber;
|
|
1029
|
+
variableCost: z.ZodBoolean;
|
|
1030
|
+
}, z.core.$strip>;
|
|
1031
|
+
export declare const loyaltyLionRewardSchema: z.ZodObject<{
|
|
1032
|
+
id: z.ZodNumber;
|
|
1033
|
+
kind: z.ZodString;
|
|
1034
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
1035
|
+
variants: z.ZodArray<z.ZodObject<{
|
|
1036
|
+
tierId: z.ZodNullable<z.ZodNumber>;
|
|
1037
|
+
title: z.ZodString;
|
|
1038
|
+
description: z.ZodNullable<z.ZodString>;
|
|
1039
|
+
costText: z.ZodString;
|
|
1040
|
+
pointsCost: z.ZodNumber;
|
|
1041
|
+
variableCost: z.ZodBoolean;
|
|
1042
|
+
}, z.core.$strip>>;
|
|
1043
|
+
}, z.core.$strip>;
|
|
1044
|
+
export declare const loyaltyLionRewardsLoaderOutputSchema: z.ZodObject<{
|
|
1045
|
+
rewards: z.ZodArray<z.ZodObject<{
|
|
1046
|
+
id: z.ZodNumber;
|
|
1047
|
+
kind: z.ZodString;
|
|
1048
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
1049
|
+
variants: z.ZodArray<z.ZodObject<{
|
|
1050
|
+
tierId: z.ZodNullable<z.ZodNumber>;
|
|
1051
|
+
title: z.ZodString;
|
|
1052
|
+
description: z.ZodNullable<z.ZodString>;
|
|
1053
|
+
costText: z.ZodString;
|
|
1054
|
+
pointsCost: z.ZodNumber;
|
|
1055
|
+
variableCost: z.ZodBoolean;
|
|
1056
|
+
}, z.core.$strip>>;
|
|
1057
|
+
}, z.core.$strip>>;
|
|
1058
|
+
}, z.core.$strip>;
|
|
1059
|
+
export declare const loyaltyLionTierSchema: z.ZodObject<{
|
|
1060
|
+
id: z.ZodNumber;
|
|
1061
|
+
name: z.ZodString;
|
|
1062
|
+
position: z.ZodNumber;
|
|
1063
|
+
threshold: z.ZodNullable<z.ZodNumber>;
|
|
1064
|
+
thresholdText: z.ZodNullable<z.ZodString>;
|
|
1065
|
+
benefits: z.ZodArray<z.ZodObject<{
|
|
1066
|
+
id: z.ZodNumber;
|
|
1067
|
+
label: z.ZodString;
|
|
1068
|
+
details: z.ZodNullable<z.ZodString>;
|
|
1069
|
+
}, z.core.$strip>>;
|
|
1070
|
+
}, z.core.$strip>;
|
|
1071
|
+
export declare const loyaltyLionTiersLoaderOutputSchema: z.ZodObject<{
|
|
1072
|
+
boundaryMode: z.ZodNullable<z.ZodEnum<{
|
|
1073
|
+
points: "points";
|
|
1074
|
+
spend: "spend";
|
|
1075
|
+
orders: "orders";
|
|
1076
|
+
}>>;
|
|
1077
|
+
tiers: z.ZodArray<z.ZodObject<{
|
|
1078
|
+
id: z.ZodNumber;
|
|
1079
|
+
name: z.ZodString;
|
|
1080
|
+
position: z.ZodNumber;
|
|
1081
|
+
threshold: z.ZodNullable<z.ZodNumber>;
|
|
1082
|
+
thresholdText: z.ZodNullable<z.ZodString>;
|
|
1083
|
+
benefits: z.ZodArray<z.ZodObject<{
|
|
1084
|
+
id: z.ZodNumber;
|
|
1085
|
+
label: z.ZodString;
|
|
1086
|
+
details: z.ZodNullable<z.ZodString>;
|
|
1087
|
+
}, z.core.$strip>>;
|
|
1088
|
+
}, z.core.$strip>>;
|
|
1089
|
+
}, z.core.$strip>;
|
|
1090
|
+
export declare const loyaltyLionPointsForPriceLoaderOutputSchema: z.ZodObject<{
|
|
1091
|
+
currency: z.ZodString;
|
|
1092
|
+
points: z.ZodArray<z.ZodObject<{
|
|
1093
|
+
tierId: z.ZodNullable<z.ZodNumber>;
|
|
1094
|
+
tierName: z.ZodNullable<z.ZodString>;
|
|
1095
|
+
points: z.ZodNumber;
|
|
1096
|
+
}, z.core.$strip>>;
|
|
1097
|
+
}, z.core.$strip>;
|
|
986
1098
|
export declare const statsigExperimentLoaderOutputSchema: z.ZodObject<{
|
|
987
1099
|
experimentName: z.ZodString;
|
|
988
1100
|
groupName: z.ZodNullable<z.ZodString>;
|
|
@@ -328,6 +328,69 @@ const judgemeProductReviewAggregateLoaderOutputSchema = z.object({
|
|
|
328
328
|
totalReviews: z.number(),
|
|
329
329
|
starDistribution: z.record(z.string(), z.number())
|
|
330
330
|
});
|
|
331
|
+
const loyaltyLionEarningRuleVariantSchema = z.object({
|
|
332
|
+
tierId: z.number().nullable(),
|
|
333
|
+
title: z.string(),
|
|
334
|
+
description: z.string().nullable(),
|
|
335
|
+
resultText: z.string(),
|
|
336
|
+
points: z.number().nullable(),
|
|
337
|
+
perCurrencyUnit: z.number().nullable()
|
|
338
|
+
});
|
|
339
|
+
const loyaltyLionEarningRuleSchema = z.object({
|
|
340
|
+
id: z.number(),
|
|
341
|
+
kind: z.string(),
|
|
342
|
+
imageUrl: z.string().nullable(),
|
|
343
|
+
variants: z.array(loyaltyLionEarningRuleVariantSchema)
|
|
344
|
+
});
|
|
345
|
+
const loyaltyLionEarningRulesLoaderOutputSchema = z.object({
|
|
346
|
+
currency: z.string(),
|
|
347
|
+
earningRules: z.array(loyaltyLionEarningRuleSchema)
|
|
348
|
+
});
|
|
349
|
+
const loyaltyLionRewardVariantSchema = z.object({
|
|
350
|
+
tierId: z.number().nullable(),
|
|
351
|
+
title: z.string(),
|
|
352
|
+
description: z.string().nullable(),
|
|
353
|
+
costText: z.string(),
|
|
354
|
+
pointsCost: z.number(),
|
|
355
|
+
variableCost: z.boolean()
|
|
356
|
+
});
|
|
357
|
+
const loyaltyLionRewardSchema = z.object({
|
|
358
|
+
id: z.number(),
|
|
359
|
+
kind: z.string(),
|
|
360
|
+
imageUrl: z.string().nullable(),
|
|
361
|
+
variants: z.array(loyaltyLionRewardVariantSchema)
|
|
362
|
+
});
|
|
363
|
+
const loyaltyLionRewardsLoaderOutputSchema = z.object({
|
|
364
|
+
rewards: z.array(loyaltyLionRewardSchema)
|
|
365
|
+
});
|
|
366
|
+
const loyaltyLionTierSchema = z.object({
|
|
367
|
+
id: z.number(),
|
|
368
|
+
name: z.string(),
|
|
369
|
+
position: z.number(),
|
|
370
|
+
threshold: z.number().nullable(),
|
|
371
|
+
thresholdText: z.string().nullable(),
|
|
372
|
+
benefits: z.array(
|
|
373
|
+
z.object({
|
|
374
|
+
id: z.number(),
|
|
375
|
+
label: z.string(),
|
|
376
|
+
details: z.string().nullable()
|
|
377
|
+
})
|
|
378
|
+
)
|
|
379
|
+
});
|
|
380
|
+
const loyaltyLionTiersLoaderOutputSchema = z.object({
|
|
381
|
+
boundaryMode: z.enum(["points", "spend", "orders"]).nullable(),
|
|
382
|
+
tiers: z.array(loyaltyLionTierSchema)
|
|
383
|
+
});
|
|
384
|
+
const loyaltyLionPointsForPriceLoaderOutputSchema = z.object({
|
|
385
|
+
currency: z.string(),
|
|
386
|
+
points: z.array(
|
|
387
|
+
z.object({
|
|
388
|
+
tierId: z.number().nullable(),
|
|
389
|
+
tierName: z.string().nullable(),
|
|
390
|
+
points: z.number()
|
|
391
|
+
})
|
|
392
|
+
)
|
|
393
|
+
});
|
|
331
394
|
const statsigExperimentLoaderOutputSchema = z.object({
|
|
332
395
|
experimentName: z.string(),
|
|
333
396
|
groupName: z.string().nullable().describe("The assigned variant group name (e.g. Control, Test)."),
|
|
@@ -418,6 +481,15 @@ export {
|
|
|
418
481
|
looxProductReviewsLoaderOutputSchema,
|
|
419
482
|
looxReviewLoaderItemSchema,
|
|
420
483
|
looxReviewMediaSchema,
|
|
484
|
+
loyaltyLionEarningRuleSchema,
|
|
485
|
+
loyaltyLionEarningRuleVariantSchema,
|
|
486
|
+
loyaltyLionEarningRulesLoaderOutputSchema,
|
|
487
|
+
loyaltyLionPointsForPriceLoaderOutputSchema,
|
|
488
|
+
loyaltyLionRewardSchema,
|
|
489
|
+
loyaltyLionRewardVariantSchema,
|
|
490
|
+
loyaltyLionRewardsLoaderOutputSchema,
|
|
491
|
+
loyaltyLionTierSchema,
|
|
492
|
+
loyaltyLionTiersLoaderOutputSchema,
|
|
421
493
|
mediaImageSchema,
|
|
422
494
|
mediaSchema,
|
|
423
495
|
metafieldSchema,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { z } from "zod";
|
|
3
|
+
import type { loyaltyLionEarningRulesLoaderOutputSchema } from "./loader-schemas";
|
|
4
|
+
export type LoyaltyLionEarningRulesData = z.infer<typeof loyaltyLionEarningRulesLoaderOutputSchema>;
|
|
5
|
+
type LoyaltyLionEarningRulesLoaderProps = {
|
|
6
|
+
children: (data: LoyaltyLionEarningRulesData) => ReactNode;
|
|
7
|
+
fallback?: ReactNode;
|
|
8
|
+
};
|
|
9
|
+
export declare function LoyaltyLionEarningRulesLoader({ children, fallback, }: LoyaltyLionEarningRulesLoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
import { DATA_LOADER_KEYS } from "./loader-keys";
|
|
8
|
+
const loaderKey = DATA_LOADER_KEYS.LOYALTYLION_EARNING_RULES;
|
|
9
|
+
function LoyaltyLionEarningRulesLoaderInner({
|
|
10
|
+
children
|
|
11
|
+
}) {
|
|
12
|
+
const { data } = useSuspenseQuery({
|
|
13
|
+
queryKey: [loaderKey, {}],
|
|
14
|
+
queryFn: async () => {
|
|
15
|
+
const [loadedData, schemas] = await Promise.all([
|
|
16
|
+
invokeLoader({
|
|
17
|
+
loaderKey,
|
|
18
|
+
args: {}
|
|
19
|
+
}),
|
|
20
|
+
import("./loader-schemas")
|
|
21
|
+
]);
|
|
22
|
+
return schemas.loyaltyLionEarningRulesLoaderOutputSchema.parse(
|
|
23
|
+
loadedData
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return /* @__PURE__ */ jsx(Fragment, { children: children(data) });
|
|
28
|
+
}
|
|
29
|
+
function LoyaltyLionEarningRulesLoader({
|
|
30
|
+
children,
|
|
31
|
+
fallback
|
|
32
|
+
}) {
|
|
33
|
+
return /* @__PURE__ */ jsx(LoaderErrorBoundary, { fallback: fallback ?? null, resetKey: loaderKey, children: /* @__PURE__ */ jsx(Suspense, { fallback: fallback ?? null, children: /* @__PURE__ */ jsx(LoyaltyLionEarningRulesLoaderInner, { children }) }) });
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
LoyaltyLionEarningRulesLoader
|
|
37
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { z } from "zod";
|
|
3
|
+
import type { loyaltyLionPointsForPriceLoaderOutputSchema } from "./loader-schemas";
|
|
4
|
+
export type LoyaltyLionPointsForPriceData = z.infer<typeof loyaltyLionPointsForPriceLoaderOutputSchema>;
|
|
5
|
+
type LoyaltyLionPointsForPriceLoaderProps = {
|
|
6
|
+
price: number;
|
|
7
|
+
children: (data: LoyaltyLionPointsForPriceData) => ReactNode;
|
|
8
|
+
fallback?: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export declare function LoyaltyLionPointsForPriceLoader({ price, children, fallback, }: LoyaltyLionPointsForPriceLoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
import { DATA_LOADER_KEYS } from "./loader-keys";
|
|
8
|
+
const loaderKey = DATA_LOADER_KEYS.LOYALTYLION_POINTS_FOR_PRICE;
|
|
9
|
+
function LoyaltyLionPointsForPriceLoaderInner({
|
|
10
|
+
price,
|
|
11
|
+
children
|
|
12
|
+
}) {
|
|
13
|
+
const { data } = useSuspenseQuery({
|
|
14
|
+
queryKey: [loaderKey, { price }],
|
|
15
|
+
queryFn: async () => {
|
|
16
|
+
const [loadedData, schemas] = await Promise.all([
|
|
17
|
+
invokeLoader({
|
|
18
|
+
loaderKey,
|
|
19
|
+
args: { price }
|
|
20
|
+
}),
|
|
21
|
+
import("./loader-schemas")
|
|
22
|
+
]);
|
|
23
|
+
return schemas.loyaltyLionPointsForPriceLoaderOutputSchema.parse(
|
|
24
|
+
loadedData
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
return /* @__PURE__ */ jsx(Fragment, { children: children(data) });
|
|
29
|
+
}
|
|
30
|
+
function LoyaltyLionPointsForPriceLoader({
|
|
31
|
+
price,
|
|
32
|
+
children,
|
|
33
|
+
fallback
|
|
34
|
+
}) {
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
36
|
+
LoaderErrorBoundary,
|
|
37
|
+
{
|
|
38
|
+
fallback: fallback ?? null,
|
|
39
|
+
resetKey: `${loaderKey}:${price}`,
|
|
40
|
+
children: /* @__PURE__ */ jsx(Suspense, { fallback: fallback ?? null, children: /* @__PURE__ */ jsx(LoyaltyLionPointsForPriceLoaderInner, { price, children }) })
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
LoyaltyLionPointsForPriceLoader
|
|
46
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { z } from "zod";
|
|
3
|
+
import type { loyaltyLionRewardsLoaderOutputSchema } from "./loader-schemas";
|
|
4
|
+
export type LoyaltyLionRewardsData = z.infer<typeof loyaltyLionRewardsLoaderOutputSchema>;
|
|
5
|
+
type LoyaltyLionRewardsLoaderProps = {
|
|
6
|
+
children: (data: LoyaltyLionRewardsData) => ReactNode;
|
|
7
|
+
fallback?: ReactNode;
|
|
8
|
+
};
|
|
9
|
+
export declare function LoyaltyLionRewardsLoader({ children, fallback, }: LoyaltyLionRewardsLoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
import { DATA_LOADER_KEYS } from "./loader-keys";
|
|
8
|
+
const loaderKey = DATA_LOADER_KEYS.LOYALTYLION_REWARDS;
|
|
9
|
+
function LoyaltyLionRewardsLoaderInner({
|
|
10
|
+
children
|
|
11
|
+
}) {
|
|
12
|
+
const { data } = useSuspenseQuery({
|
|
13
|
+
queryKey: [loaderKey, {}],
|
|
14
|
+
queryFn: async () => {
|
|
15
|
+
const [loadedData, schemas] = await Promise.all([
|
|
16
|
+
invokeLoader({
|
|
17
|
+
loaderKey,
|
|
18
|
+
args: {}
|
|
19
|
+
}),
|
|
20
|
+
import("./loader-schemas")
|
|
21
|
+
]);
|
|
22
|
+
return schemas.loyaltyLionRewardsLoaderOutputSchema.parse(loadedData);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return /* @__PURE__ */ jsx(Fragment, { children: children(data) });
|
|
26
|
+
}
|
|
27
|
+
function LoyaltyLionRewardsLoader({
|
|
28
|
+
children,
|
|
29
|
+
fallback
|
|
30
|
+
}) {
|
|
31
|
+
return /* @__PURE__ */ jsx(LoaderErrorBoundary, { fallback: fallback ?? null, resetKey: loaderKey, children: /* @__PURE__ */ jsx(Suspense, { fallback: fallback ?? null, children: /* @__PURE__ */ jsx(LoyaltyLionRewardsLoaderInner, { children }) }) });
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
LoyaltyLionRewardsLoader
|
|
35
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { z } from "zod";
|
|
3
|
+
import type { loyaltyLionTiersLoaderOutputSchema } from "./loader-schemas";
|
|
4
|
+
export type LoyaltyLionTiersData = z.infer<typeof loyaltyLionTiersLoaderOutputSchema>;
|
|
5
|
+
type LoyaltyLionTiersLoaderProps = {
|
|
6
|
+
children: (data: LoyaltyLionTiersData) => ReactNode;
|
|
7
|
+
fallback?: ReactNode;
|
|
8
|
+
};
|
|
9
|
+
export declare function LoyaltyLionTiersLoader({ children, fallback, }: LoyaltyLionTiersLoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
import { DATA_LOADER_KEYS } from "./loader-keys";
|
|
8
|
+
const loaderKey = DATA_LOADER_KEYS.LOYALTYLION_TIERS;
|
|
9
|
+
function LoyaltyLionTiersLoaderInner({
|
|
10
|
+
children
|
|
11
|
+
}) {
|
|
12
|
+
const { data } = useSuspenseQuery({
|
|
13
|
+
queryKey: [loaderKey, {}],
|
|
14
|
+
queryFn: async () => {
|
|
15
|
+
const [loadedData, schemas] = await Promise.all([
|
|
16
|
+
invokeLoader({
|
|
17
|
+
loaderKey,
|
|
18
|
+
args: {}
|
|
19
|
+
}),
|
|
20
|
+
import("./loader-schemas")
|
|
21
|
+
]);
|
|
22
|
+
return schemas.loyaltyLionTiersLoaderOutputSchema.parse(loadedData);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return /* @__PURE__ */ jsx(Fragment, { children: children(data) });
|
|
26
|
+
}
|
|
27
|
+
function LoyaltyLionTiersLoader({
|
|
28
|
+
children,
|
|
29
|
+
fallback
|
|
30
|
+
}) {
|
|
31
|
+
return /* @__PURE__ */ jsx(LoaderErrorBoundary, { fallback: fallback ?? null, resetKey: loaderKey, children: /* @__PURE__ */ jsx(Suspense, { fallback: fallback ?? null, children: /* @__PURE__ */ jsx(LoyaltyLionTiersLoaderInner, { children }) }) });
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
LoyaltyLionTiersLoader
|
|
35
|
+
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@replohq/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"reploBuild": {
|
|
5
5
|
"packageName": "@replohq/sdk",
|
|
6
|
-
"version": "2.
|
|
6
|
+
"version": "2.3.0",
|
|
7
7
|
"branch": "HEAD",
|
|
8
|
-
"commit": "
|
|
9
|
-
"builtAt": "2026-10-
|
|
8
|
+
"commit": "0f7d0830fdc9d0b6c299ee8b9497a749d41aee95",
|
|
9
|
+
"builtAt": "2026-10-21T20:51:42.391Z"
|
|
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",
|
|
@@ -145,6 +145,22 @@
|
|
|
145
145
|
"types": "./loaders/loox-reviews-loader.d.ts",
|
|
146
146
|
"default": "./loaders/loox-reviews-loader.js"
|
|
147
147
|
},
|
|
148
|
+
"./loaders/loyaltylion-earning-rules-loader": {
|
|
149
|
+
"types": "./loaders/loyaltylion-earning-rules-loader.d.ts",
|
|
150
|
+
"default": "./loaders/loyaltylion-earning-rules-loader.js"
|
|
151
|
+
},
|
|
152
|
+
"./loaders/loyaltylion-points-for-price-loader": {
|
|
153
|
+
"types": "./loaders/loyaltylion-points-for-price-loader.d.ts",
|
|
154
|
+
"default": "./loaders/loyaltylion-points-for-price-loader.js"
|
|
155
|
+
},
|
|
156
|
+
"./loaders/loyaltylion-rewards-loader": {
|
|
157
|
+
"types": "./loaders/loyaltylion-rewards-loader.d.ts",
|
|
158
|
+
"default": "./loaders/loyaltylion-rewards-loader.js"
|
|
159
|
+
},
|
|
160
|
+
"./loaders/loyaltylion-tiers-loader": {
|
|
161
|
+
"types": "./loaders/loyaltylion-tiers-loader.d.ts",
|
|
162
|
+
"default": "./loaders/loyaltylion-tiers-loader.js"
|
|
163
|
+
},
|
|
148
164
|
"./loaders/metaobject-loader": {
|
|
149
165
|
"types": "./loaders/metaobject-loader.d.ts",
|
|
150
166
|
"default": "./loaders/metaobject-loader.js"
|