@offerkit/sdk 0.2.4 → 0.2.5
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/dist/index.cjs +1898 -0
- package/dist/index.d.cts +3246 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +72 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +19 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../contract/src/router.ts","../src/index.ts"],"mappings":";;;;;cAwBa,QAAA;+DAgCZ,iBAAA,CAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEW,QAAA,UAAkB,QAAA;;;UCpDb,UAAA;;EAEf,OAAA;EDgBW;ECdX,MAAA;;EAEA,KAAA,UAAe,KAAA;AAAA;AAAA,KAGL,MAAA,GAAS,oBAAA,CAAqB,QAAA;AAAA,iBAE1B,YAAA,CAAa,OAAA,EAAS,UAAA,GAAa,MAAA;AAAA,UAalC,oBAAA;;EAEf,gBAAA;;EAEA,GAAA;AAAA;;;;;;;iBASc,aAAA,CACd,OAAA,UACA,SAAA,UACA,MAAA,UACA,OAAA,GAAS,oBAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1103,6 +1103,20 @@ declare const contract: {
|
|
|
1103
1103
|
bulk: _$_orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1104
1104
|
campaignId: z.ZodString;
|
|
1105
1105
|
count: z.ZodNumber;
|
|
1106
|
+
discount: z.ZodOptional<z.ZodObject<{
|
|
1107
|
+
type: z.ZodEnum<{
|
|
1108
|
+
AMOUNT: "AMOUNT";
|
|
1109
|
+
PERCENTAGE: "PERCENTAGE";
|
|
1110
|
+
}>;
|
|
1111
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
1112
|
+
percent: z.ZodOptional<z.ZodNumber>;
|
|
1113
|
+
maxDiscountAmount: z.ZodOptional<z.ZodNumber>;
|
|
1114
|
+
appliesTo: z.ZodOptional<z.ZodObject<{
|
|
1115
|
+
productIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1116
|
+
collectionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1117
|
+
}, z.core.$strip>>;
|
|
1118
|
+
}, z.core.$strip>>;
|
|
1119
|
+
giftBalance: z.ZodOptional<z.ZodNumber>;
|
|
1106
1120
|
}, z.core.$strip>, z.ZodObject<{
|
|
1107
1121
|
campaignId: z.ZodString;
|
|
1108
1122
|
generated: z.ZodNumber;
|
|
@@ -1131,13 +1145,16 @@ declare const contract: {
|
|
|
1131
1145
|
message: z.ZodOptional<z.ZodString>;
|
|
1132
1146
|
explanations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1133
1147
|
code: z.ZodEnum<{
|
|
1148
|
+
campaign_inactive: "campaign_inactive";
|
|
1134
1149
|
currency_mismatch: "currency_mismatch";
|
|
1150
|
+
no_discount_effect: "no_discount_effect";
|
|
1135
1151
|
exclusivity_lost: "exclusivity_lost";
|
|
1136
1152
|
zero_after_running_total: "zero_after_running_total";
|
|
1137
1153
|
voucher_not_found: "voucher_not_found";
|
|
1138
1154
|
voucher_disabled: "voucher_disabled";
|
|
1139
1155
|
voucher_expired: "voucher_expired";
|
|
1140
1156
|
redemption_limit_reached: "redemption_limit_reached";
|
|
1157
|
+
validation_failed: "validation_failed";
|
|
1141
1158
|
gift_balance_zero: "gift_balance_zero";
|
|
1142
1159
|
order_required: "order_required";
|
|
1143
1160
|
gift_card_stacking_unsupported: "gift_card_stacking_unsupported";
|
|
@@ -1272,13 +1289,16 @@ declare const contract: {
|
|
|
1272
1289
|
message: z.ZodOptional<z.ZodString>;
|
|
1273
1290
|
explanations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1274
1291
|
code: z.ZodEnum<{
|
|
1292
|
+
campaign_inactive: "campaign_inactive";
|
|
1275
1293
|
currency_mismatch: "currency_mismatch";
|
|
1294
|
+
no_discount_effect: "no_discount_effect";
|
|
1276
1295
|
exclusivity_lost: "exclusivity_lost";
|
|
1277
1296
|
zero_after_running_total: "zero_after_running_total";
|
|
1278
1297
|
voucher_not_found: "voucher_not_found";
|
|
1279
1298
|
voucher_disabled: "voucher_disabled";
|
|
1280
1299
|
voucher_expired: "voucher_expired";
|
|
1281
1300
|
redemption_limit_reached: "redemption_limit_reached";
|
|
1301
|
+
validation_failed: "validation_failed";
|
|
1282
1302
|
gift_balance_zero: "gift_balance_zero";
|
|
1283
1303
|
order_required: "order_required";
|
|
1284
1304
|
gift_card_stacking_unsupported: "gift_card_stacking_unsupported";
|
|
@@ -1337,13 +1357,16 @@ declare const contract: {
|
|
|
1337
1357
|
message: z.ZodOptional<z.ZodString>;
|
|
1338
1358
|
explanations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1339
1359
|
code: z.ZodEnum<{
|
|
1360
|
+
campaign_inactive: "campaign_inactive";
|
|
1340
1361
|
currency_mismatch: "currency_mismatch";
|
|
1362
|
+
no_discount_effect: "no_discount_effect";
|
|
1341
1363
|
exclusivity_lost: "exclusivity_lost";
|
|
1342
1364
|
zero_after_running_total: "zero_after_running_total";
|
|
1343
1365
|
voucher_not_found: "voucher_not_found";
|
|
1344
1366
|
voucher_disabled: "voucher_disabled";
|
|
1345
1367
|
voucher_expired: "voucher_expired";
|
|
1346
1368
|
redemption_limit_reached: "redemption_limit_reached";
|
|
1369
|
+
validation_failed: "validation_failed";
|
|
1347
1370
|
gift_balance_zero: "gift_balance_zero";
|
|
1348
1371
|
order_required: "order_required";
|
|
1349
1372
|
gift_card_stacking_unsupported: "gift_card_stacking_unsupported";
|
|
@@ -2474,6 +2497,55 @@ declare const contract: {
|
|
|
2474
2497
|
next: z.ZodOptional<z.ZodString>;
|
|
2475
2498
|
prev: z.ZodOptional<z.ZodString>;
|
|
2476
2499
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
2500
|
+
listProgramConversions: _$_orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
2501
|
+
params: z.ZodObject<{
|
|
2502
|
+
programId: z.ZodString;
|
|
2503
|
+
}, z.core.$strip>;
|
|
2504
|
+
query: z.ZodObject<{
|
|
2505
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
2506
|
+
limit: z.ZodDefault<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>>;
|
|
2507
|
+
}, z.core.$strip>;
|
|
2508
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2509
|
+
data: z.ZodArray<z.ZodObject<{
|
|
2510
|
+
id: z.ZodString;
|
|
2511
|
+
codeId: z.ZodString;
|
|
2512
|
+
refereeCustomerId: z.ZodString;
|
|
2513
|
+
status: z.ZodEnum<{
|
|
2514
|
+
converted: "converted";
|
|
2515
|
+
rejected: "rejected";
|
|
2516
|
+
}>;
|
|
2517
|
+
convertedAt: z.ZodString;
|
|
2518
|
+
conversionEventId: z.ZodNullable<z.ZodString>;
|
|
2519
|
+
referrerOutcome: z.ZodObject<{
|
|
2520
|
+
kind: z.ZodEnum<{
|
|
2521
|
+
custom: "custom";
|
|
2522
|
+
discount: "discount";
|
|
2523
|
+
gift_card: "gift_card";
|
|
2524
|
+
loyalty_points: "loyalty_points";
|
|
2525
|
+
}>;
|
|
2526
|
+
voucherCode: z.ZodOptional<z.ZodString>;
|
|
2527
|
+
loyaltyTransactionId: z.ZodOptional<z.ZodString>;
|
|
2528
|
+
payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2529
|
+
}, z.core.$strip>;
|
|
2530
|
+
refereeOutcome: z.ZodObject<{
|
|
2531
|
+
kind: z.ZodEnum<{
|
|
2532
|
+
custom: "custom";
|
|
2533
|
+
discount: "discount";
|
|
2534
|
+
gift_card: "gift_card";
|
|
2535
|
+
loyalty_points: "loyalty_points";
|
|
2536
|
+
}>;
|
|
2537
|
+
voucherCode: z.ZodOptional<z.ZodString>;
|
|
2538
|
+
loyaltyTransactionId: z.ZodOptional<z.ZodString>;
|
|
2539
|
+
payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2540
|
+
}, z.core.$strip>;
|
|
2541
|
+
createdAt: z.ZodString;
|
|
2542
|
+
updatedAt: z.ZodString;
|
|
2543
|
+
code: z.ZodString;
|
|
2544
|
+
referrerCustomerId: z.ZodString;
|
|
2545
|
+
}, z.core.$strip>>;
|
|
2546
|
+
next: z.ZodOptional<z.ZodString>;
|
|
2547
|
+
prev: z.ZodOptional<z.ZodString>;
|
|
2548
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
2477
2549
|
getByCode: _$_orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
2478
2550
|
params: z.ZodObject<{
|
|
2479
2551
|
code: z.ZodString;
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../contract/src/router.ts","../src/index.ts"],"mappings":";;;;;cAwBa,QAAA;+DAgCZ,iBAAA,CAAA,MAAA
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../contract/src/router.ts","../src/index.ts"],"mappings":";;;;;cAwBa,QAAA;+DAgCZ,iBAAA,CAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,OAAA;EDgBW;ECdX,MAAA;;EAEA,KAAA,UAAe,KAAA;AAAA;AAAA,KAGL,MAAA,GAAS,oBAAA,CAAqB,QAAA;AAAA,iBAE1B,YAAA,CAAa,OAAA,EAAS,UAAA,GAAa,MAAA;AAAA,UAalC,oBAAA;;EAEf,gBAAA;;EAEA,GAAA;AAAA;;;;;;;iBASc,aAAA,CACd,OAAA,UACA,SAAA,UACA,MAAA,UACA,OAAA,GAAS,oBAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -676,6 +676,10 @@ const referralConversionOutput = z.object({
|
|
|
676
676
|
createdAt: z.string().datetime(),
|
|
677
677
|
updatedAt: z.string().datetime()
|
|
678
678
|
});
|
|
679
|
+
const referralProgramConversionOutput = referralConversionOutput.extend({
|
|
680
|
+
code: z.string(),
|
|
681
|
+
referrerCustomerId: z.string().uuid()
|
|
682
|
+
});
|
|
679
683
|
const referralIssueInput = z.object({
|
|
680
684
|
programId: z.string().uuid(),
|
|
681
685
|
referrerCustomerId: z.string().uuid(),
|
|
@@ -758,6 +762,15 @@ const referrals = {
|
|
|
758
762
|
params: z.object({ codeId: z.string().uuid() }),
|
|
759
763
|
query: paginationInput
|
|
760
764
|
})).output(paginatedOutput(referralConversionOutput)),
|
|
765
|
+
listProgramConversions: oc.route({
|
|
766
|
+
method: "GET",
|
|
767
|
+
path: "/referral-programs/{programId}/conversions",
|
|
768
|
+
summary: "List conversions in a referral program",
|
|
769
|
+
inputStructure: "detailed"
|
|
770
|
+
}).input(z.object({
|
|
771
|
+
params: z.object({ programId: z.string().uuid() }),
|
|
772
|
+
query: paginationInput
|
|
773
|
+
})).output(paginatedOutput(referralProgramConversionOutput)),
|
|
761
774
|
getByCode: oc.route({
|
|
762
775
|
method: "GET",
|
|
763
776
|
path: "/referrals/{code}",
|
|
@@ -833,7 +846,9 @@ const voucherUpdateInput = voucherCreateInput.omit({
|
|
|
833
846
|
}).partial().extend({ active: z.boolean().optional() });
|
|
834
847
|
const voucherBulkCreateInput = z.object({
|
|
835
848
|
campaignId: z.string().uuid(),
|
|
836
|
-
count: z.number().int().min(1).max(1e5)
|
|
849
|
+
count: z.number().int().min(1).max(1e5),
|
|
850
|
+
discount: voucherDiscount.optional(),
|
|
851
|
+
giftBalance: z.number().int().min(1).optional()
|
|
837
852
|
});
|
|
838
853
|
//#endregion
|
|
839
854
|
//#region ../contract/src/schemas/redemption.ts
|
|
@@ -870,11 +885,14 @@ const breakdownEntry = z.object({
|
|
|
870
885
|
const redemptionExplanation = z.object({
|
|
871
886
|
code: z.enum([
|
|
872
887
|
"voucher_not_found",
|
|
888
|
+
"campaign_inactive",
|
|
873
889
|
"voucher_disabled",
|
|
874
890
|
"voucher_expired",
|
|
875
891
|
"redemption_limit_reached",
|
|
892
|
+
"validation_failed",
|
|
876
893
|
"currency_mismatch",
|
|
877
894
|
"gift_balance_zero",
|
|
895
|
+
"no_discount_effect",
|
|
878
896
|
"order_required",
|
|
879
897
|
"exclusivity_lost",
|
|
880
898
|
"zero_after_running_total",
|