@open-loyalty/mcp-server 1.0.3 → 1.1.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/dist/client/http.d.ts +5 -0
- package/dist/client/http.js +52 -3
- package/dist/config.d.ts +16 -2
- package/dist/config.js +28 -10
- package/dist/http.js +135 -62
- package/dist/server.js +8 -5
- package/dist/tools/achievement.d.ts +14 -0
- package/dist/tools/achievement.js +22 -15
- package/dist/tools/admin.d.ts +12 -0
- package/dist/tools/admin.js +12 -0
- package/dist/tools/analytics.d.ts +18 -0
- package/dist/tools/analytics.js +28 -19
- package/dist/tools/apikey.d.ts +7 -0
- package/dist/tools/apikey.js +7 -0
- package/dist/tools/audit.d.ts +4 -0
- package/dist/tools/audit.js +4 -0
- package/dist/tools/badge.d.ts +8 -0
- package/dist/tools/badge.js +13 -9
- package/dist/tools/campaign.d.ts +41 -16
- package/dist/tools/campaign.js +38 -25
- package/dist/tools/export.d.ts +8 -0
- package/dist/tools/export.js +13 -8
- package/dist/tools/import.d.ts +6 -0
- package/dist/tools/import.js +10 -6
- package/dist/tools/index.d.ts +3 -11
- package/dist/tools/index.js +4 -470
- package/dist/tools/member.d.ts +21 -0
- package/dist/tools/member.js +56 -62
- package/dist/tools/points.d.ts +12 -0
- package/dist/tools/points.js +30 -29
- package/dist/tools/reward.d.ts +18 -0
- package/dist/tools/reward.js +56 -66
- package/dist/tools/role.d.ts +20 -1
- package/dist/tools/role.js +13 -0
- package/dist/tools/segment.d.ts +19 -0
- package/dist/tools/segment.js +29 -19
- package/dist/tools/store.d.ts +8 -0
- package/dist/tools/store.js +8 -0
- package/dist/tools/tierset.d.ts +12 -0
- package/dist/tools/tierset.js +19 -13
- package/dist/tools/transaction.d.ts +12 -4
- package/dist/tools/transaction.js +13 -9
- package/dist/tools/wallet-type.d.ts +4 -0
- package/dist/tools/wallet-type.js +7 -5
- package/dist/tools/webhook.d.ts +17 -4
- package/dist/tools/webhook.js +58 -15
- package/dist/types/schemas/achievement.d.ts +0 -297
- package/dist/types/schemas/achievement.js +0 -13
- package/dist/types/schemas/admin.d.ts +10 -97
- package/dist/types/schemas/admin.js +0 -38
- package/dist/types/schemas/badge.d.ts +0 -37
- package/dist/types/schemas/badge.js +0 -11
- package/dist/types/schemas/campaign.d.ts +0 -648
- package/dist/types/schemas/campaign.js +0 -18
- package/dist/types/schemas/export.d.ts +0 -17
- package/dist/types/schemas/export.js +0 -7
- package/dist/types/schemas/member.d.ts +37 -176
- package/dist/types/schemas/member.js +0 -27
- package/dist/types/schemas/points.d.ts +0 -63
- package/dist/types/schemas/points.js +0 -22
- package/dist/types/schemas/reward.d.ts +0 -73
- package/dist/types/schemas/reward.js +0 -25
- package/dist/types/schemas/role.d.ts +0 -100
- package/dist/types/schemas/role.js +0 -29
- package/dist/types/schemas/segment.d.ts +0 -58
- package/dist/types/schemas/segment.js +0 -17
- package/dist/types/schemas/tierset.d.ts +0 -176
- package/dist/types/schemas/tierset.js +0 -27
- package/dist/types/schemas/transaction.d.ts +23 -254
- package/dist/types/schemas/transaction.js +0 -7
- package/dist/types/schemas/webhook.d.ts +0 -58
- package/dist/types/schemas/webhook.js +0 -12
- package/dist/utils/payload.d.ts +12 -0
- package/dist/utils/payload.js +14 -0
- package/package.json +3 -1
|
@@ -143,106 +143,6 @@ export declare const RoleListItemSchema: z.ZodObject<{
|
|
|
143
143
|
stores?: string[] | undefined;
|
|
144
144
|
}>;
|
|
145
145
|
export type RoleListItem = z.infer<typeof RoleListItemSchema>;
|
|
146
|
-
/**
|
|
147
|
-
* Role Permission Input Schema.
|
|
148
|
-
* Used when creating/updating a role.
|
|
149
|
-
*/
|
|
150
|
-
export declare const RolePermissionInputSchema: z.ZodObject<{
|
|
151
|
-
resource: z.ZodString;
|
|
152
|
-
access: z.ZodString;
|
|
153
|
-
filterQuery: z.ZodOptional<z.ZodString>;
|
|
154
|
-
}, "strip", z.ZodTypeAny, {
|
|
155
|
-
resource: string;
|
|
156
|
-
access: string;
|
|
157
|
-
filterQuery?: string | undefined;
|
|
158
|
-
}, {
|
|
159
|
-
resource: string;
|
|
160
|
-
access: string;
|
|
161
|
-
filterQuery?: string | undefined;
|
|
162
|
-
}>;
|
|
163
|
-
export type RolePermissionInput = z.infer<typeof RolePermissionInputSchema>;
|
|
164
|
-
/**
|
|
165
|
-
* Role Create Input Schema.
|
|
166
|
-
* Input for POST /api/acl/role - uses { role: {...} } wrapper
|
|
167
|
-
*/
|
|
168
|
-
export declare const RoleCreateInputSchema: z.ZodObject<{
|
|
169
|
-
name: z.ZodString;
|
|
170
|
-
default: z.ZodOptional<z.ZodBoolean>;
|
|
171
|
-
permissions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
172
|
-
resource: z.ZodString;
|
|
173
|
-
access: z.ZodString;
|
|
174
|
-
filterQuery: z.ZodOptional<z.ZodString>;
|
|
175
|
-
}, "strip", z.ZodTypeAny, {
|
|
176
|
-
resource: string;
|
|
177
|
-
access: string;
|
|
178
|
-
filterQuery?: string | undefined;
|
|
179
|
-
}, {
|
|
180
|
-
resource: string;
|
|
181
|
-
access: string;
|
|
182
|
-
filterQuery?: string | undefined;
|
|
183
|
-
}>, "many">>;
|
|
184
|
-
stores: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
185
|
-
}, "strip", z.ZodTypeAny, {
|
|
186
|
-
name: string;
|
|
187
|
-
default?: boolean | undefined;
|
|
188
|
-
permissions?: {
|
|
189
|
-
resource: string;
|
|
190
|
-
access: string;
|
|
191
|
-
filterQuery?: string | undefined;
|
|
192
|
-
}[] | undefined;
|
|
193
|
-
stores?: string[] | undefined;
|
|
194
|
-
}, {
|
|
195
|
-
name: string;
|
|
196
|
-
default?: boolean | undefined;
|
|
197
|
-
permissions?: {
|
|
198
|
-
resource: string;
|
|
199
|
-
access: string;
|
|
200
|
-
filterQuery?: string | undefined;
|
|
201
|
-
}[] | undefined;
|
|
202
|
-
stores?: string[] | undefined;
|
|
203
|
-
}>;
|
|
204
|
-
export type RoleCreateInput = z.infer<typeof RoleCreateInputSchema>;
|
|
205
|
-
/**
|
|
206
|
-
* Role Update Input Schema.
|
|
207
|
-
* Input for PUT /api/acl/role/{roleId}
|
|
208
|
-
*/
|
|
209
|
-
export declare const RoleUpdateInputSchema: z.ZodObject<{
|
|
210
|
-
name: z.ZodOptional<z.ZodString>;
|
|
211
|
-
default: z.ZodOptional<z.ZodBoolean>;
|
|
212
|
-
permissions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
213
|
-
resource: z.ZodString;
|
|
214
|
-
access: z.ZodString;
|
|
215
|
-
filterQuery: z.ZodOptional<z.ZodString>;
|
|
216
|
-
}, "strip", z.ZodTypeAny, {
|
|
217
|
-
resource: string;
|
|
218
|
-
access: string;
|
|
219
|
-
filterQuery?: string | undefined;
|
|
220
|
-
}, {
|
|
221
|
-
resource: string;
|
|
222
|
-
access: string;
|
|
223
|
-
filterQuery?: string | undefined;
|
|
224
|
-
}>, "many">>;
|
|
225
|
-
stores: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
226
|
-
}, "strip", z.ZodTypeAny, {
|
|
227
|
-
name?: string | undefined;
|
|
228
|
-
default?: boolean | undefined;
|
|
229
|
-
permissions?: {
|
|
230
|
-
resource: string;
|
|
231
|
-
access: string;
|
|
232
|
-
filterQuery?: string | undefined;
|
|
233
|
-
}[] | undefined;
|
|
234
|
-
stores?: string[] | undefined;
|
|
235
|
-
}, {
|
|
236
|
-
name?: string | undefined;
|
|
237
|
-
default?: boolean | undefined;
|
|
238
|
-
permissions?: {
|
|
239
|
-
resource: string;
|
|
240
|
-
access: string;
|
|
241
|
-
filterQuery?: string | undefined;
|
|
242
|
-
}[] | undefined;
|
|
243
|
-
stores?: string[] | undefined;
|
|
244
|
-
}>;
|
|
245
|
-
export type RoleUpdateInput = z.infer<typeof RoleUpdateInputSchema>;
|
|
246
146
|
/**
|
|
247
147
|
* ACL Resource Schema.
|
|
248
148
|
* Represents an available ACL resource from GET /api/acl/resources
|
|
@@ -36,35 +36,6 @@ export const RoleListItemSchema = z.object({
|
|
|
36
36
|
permissions: z.array(RolePermissionSchema).optional().describe("Permissions assigned to this role."),
|
|
37
37
|
stores: z.array(z.string()).optional().describe("Store codes this role has access to."),
|
|
38
38
|
});
|
|
39
|
-
/**
|
|
40
|
-
* Role Permission Input Schema.
|
|
41
|
-
* Used when creating/updating a role.
|
|
42
|
-
*/
|
|
43
|
-
export const RolePermissionInputSchema = z.object({
|
|
44
|
-
resource: z.string().describe("Resource name (e.g., ANALYTICS, EVENTS)."),
|
|
45
|
-
access: z.string().describe("Access level (e.g., VIEW, MODIFY)."),
|
|
46
|
-
filterQuery: z.string().optional().describe("Optional filter query."),
|
|
47
|
-
});
|
|
48
|
-
/**
|
|
49
|
-
* Role Create Input Schema.
|
|
50
|
-
* Input for POST /api/acl/role - uses { role: {...} } wrapper
|
|
51
|
-
*/
|
|
52
|
-
export const RoleCreateInputSchema = z.object({
|
|
53
|
-
name: z.string().describe("Role name (required)."),
|
|
54
|
-
default: z.boolean().optional().describe("Whether this is a default role for new admins."),
|
|
55
|
-
permissions: z.array(RolePermissionInputSchema).optional().describe("Permissions to assign."),
|
|
56
|
-
stores: z.array(z.string()).optional().describe("Store codes to assign access."),
|
|
57
|
-
});
|
|
58
|
-
/**
|
|
59
|
-
* Role Update Input Schema.
|
|
60
|
-
* Input for PUT /api/acl/role/{roleId}
|
|
61
|
-
*/
|
|
62
|
-
export const RoleUpdateInputSchema = z.object({
|
|
63
|
-
name: z.string().optional().describe("Role name."),
|
|
64
|
-
default: z.boolean().optional().describe("Whether this is a default role."),
|
|
65
|
-
permissions: z.array(RolePermissionInputSchema).optional().describe("Permissions to assign."),
|
|
66
|
-
stores: z.array(z.string()).optional().describe("Store codes to assign access."),
|
|
67
|
-
});
|
|
68
39
|
/**
|
|
69
40
|
* ACL Resource Schema.
|
|
70
41
|
* Represents an available ACL resource from GET /api/acl/resources
|
|
@@ -532,61 +532,3 @@ export declare const SegmentListItemSchema: z.ZodObject<{
|
|
|
532
532
|
customersCount?: number | undefined;
|
|
533
533
|
}>;
|
|
534
534
|
export type SegmentListItem = z.infer<typeof SegmentListItemSchema>;
|
|
535
|
-
/**
|
|
536
|
-
* Segment Create Input Schema.
|
|
537
|
-
* Matches the POST /api/{storeCode}/segment body structure.
|
|
538
|
-
* IMPORTANT: Request must be wrapped as { segment: {...} }
|
|
539
|
-
*/
|
|
540
|
-
export declare const SegmentCreateInputSchema: z.ZodObject<{
|
|
541
|
-
name: z.ZodString;
|
|
542
|
-
description: z.ZodOptional<z.ZodString>;
|
|
543
|
-
active: z.ZodOptional<z.ZodBoolean>;
|
|
544
|
-
parts: z.ZodArray<z.ZodObject<{
|
|
545
|
-
segmentPartId: z.ZodOptional<z.ZodString>;
|
|
546
|
-
criteria: z.ZodArray<z.ZodObject<{
|
|
547
|
-
type: z.ZodString;
|
|
548
|
-
criterionId: z.ZodOptional<z.ZodString>;
|
|
549
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
550
|
-
type: z.ZodString;
|
|
551
|
-
criterionId: z.ZodOptional<z.ZodString>;
|
|
552
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
553
|
-
type: z.ZodString;
|
|
554
|
-
criterionId: z.ZodOptional<z.ZodString>;
|
|
555
|
-
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
556
|
-
}, "strip", z.ZodTypeAny, {
|
|
557
|
-
criteria: z.objectOutputType<{
|
|
558
|
-
type: z.ZodString;
|
|
559
|
-
criterionId: z.ZodOptional<z.ZodString>;
|
|
560
|
-
}, z.ZodTypeAny, "passthrough">[];
|
|
561
|
-
segmentPartId?: string | undefined;
|
|
562
|
-
}, {
|
|
563
|
-
criteria: z.objectInputType<{
|
|
564
|
-
type: z.ZodString;
|
|
565
|
-
criterionId: z.ZodOptional<z.ZodString>;
|
|
566
|
-
}, z.ZodTypeAny, "passthrough">[];
|
|
567
|
-
segmentPartId?: string | undefined;
|
|
568
|
-
}>, "many">;
|
|
569
|
-
}, "strip", z.ZodTypeAny, {
|
|
570
|
-
name: string;
|
|
571
|
-
parts: {
|
|
572
|
-
criteria: z.objectOutputType<{
|
|
573
|
-
type: z.ZodString;
|
|
574
|
-
criterionId: z.ZodOptional<z.ZodString>;
|
|
575
|
-
}, z.ZodTypeAny, "passthrough">[];
|
|
576
|
-
segmentPartId?: string | undefined;
|
|
577
|
-
}[];
|
|
578
|
-
active?: boolean | undefined;
|
|
579
|
-
description?: string | undefined;
|
|
580
|
-
}, {
|
|
581
|
-
name: string;
|
|
582
|
-
parts: {
|
|
583
|
-
criteria: z.objectInputType<{
|
|
584
|
-
type: z.ZodString;
|
|
585
|
-
criterionId: z.ZodOptional<z.ZodString>;
|
|
586
|
-
}, z.ZodTypeAny, "passthrough">[];
|
|
587
|
-
segmentPartId?: string | undefined;
|
|
588
|
-
}[];
|
|
589
|
-
active?: boolean | undefined;
|
|
590
|
-
description?: string | undefined;
|
|
591
|
-
}>;
|
|
592
|
-
export type SegmentCreateInput = z.infer<typeof SegmentCreateInputSchema>;
|
|
@@ -95,20 +95,3 @@ export const SegmentListItemSchema = z.object({
|
|
|
95
95
|
customersCount: z.number().optional(),
|
|
96
96
|
createdAt: z.string().optional(),
|
|
97
97
|
});
|
|
98
|
-
/**
|
|
99
|
-
* Segment Create Input Schema.
|
|
100
|
-
* Matches the POST /api/{storeCode}/segment body structure.
|
|
101
|
-
* IMPORTANT: Request must be wrapped as { segment: {...} }
|
|
102
|
-
*/
|
|
103
|
-
export const SegmentCreateInputSchema = z.object({
|
|
104
|
-
name: z.string().describe("Segment name (required)."),
|
|
105
|
-
description: z.string().optional().describe("Segment description."),
|
|
106
|
-
active: z.boolean().optional().describe("Whether segment is active (default: false)."),
|
|
107
|
-
parts: z.array(z.object({
|
|
108
|
-
segmentPartId: z.string().optional().describe("Part ID (optional, generated if not provided)."),
|
|
109
|
-
criteria: z.array(z.object({
|
|
110
|
-
type: z.string().describe("Criterion type."),
|
|
111
|
-
criterionId: z.string().optional().describe("Criterion ID (optional)."),
|
|
112
|
-
}).passthrough()).describe("Criteria for this part."),
|
|
113
|
-
})).describe("Segment parts. Parts use OR logic, criteria within parts use AND logic."),
|
|
114
|
-
});
|
|
@@ -363,179 +363,7 @@ export declare const TierSetListResponseSchema: z.ZodObject<{
|
|
|
363
363
|
[k: string]: unknown;
|
|
364
364
|
};
|
|
365
365
|
}>;
|
|
366
|
-
export declare const TierSetConditionInputSchema: z.ZodObject<{
|
|
367
|
-
attribute: z.ZodEnum<["activeUnits", "totalEarnedUnits", "totalSpending", "monthsSinceJoiningProgram", "cumulatedEarnedUnits"]>;
|
|
368
|
-
walletType: z.ZodOptional<z.ZodString>;
|
|
369
|
-
}, "strip", z.ZodTypeAny, {
|
|
370
|
-
attribute: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits";
|
|
371
|
-
walletType?: string | undefined;
|
|
372
|
-
}, {
|
|
373
|
-
attribute: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits";
|
|
374
|
-
walletType?: string | undefined;
|
|
375
|
-
}>;
|
|
376
366
|
export declare const DowngradeModeEnum: z.ZodEnum<["none", "automatic", "x_days"]>;
|
|
377
|
-
export declare const TierSetCreateInputSchema: z.ZodObject<{
|
|
378
|
-
storeCode: z.ZodString;
|
|
379
|
-
name: z.ZodString;
|
|
380
|
-
description: z.ZodOptional<z.ZodString>;
|
|
381
|
-
conditions: z.ZodArray<z.ZodObject<{
|
|
382
|
-
attribute: z.ZodEnum<["activeUnits", "totalEarnedUnits", "totalSpending", "monthsSinceJoiningProgram", "cumulatedEarnedUnits"]>;
|
|
383
|
-
walletType: z.ZodOptional<z.ZodString>;
|
|
384
|
-
}, "strip", z.ZodTypeAny, {
|
|
385
|
-
attribute: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits";
|
|
386
|
-
walletType?: string | undefined;
|
|
387
|
-
}, {
|
|
388
|
-
attribute: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits";
|
|
389
|
-
walletType?: string | undefined;
|
|
390
|
-
}>, "many">;
|
|
391
|
-
downgrade: z.ZodOptional<z.ZodObject<{
|
|
392
|
-
mode: z.ZodEnum<["none", "automatic", "x_days"]>;
|
|
393
|
-
days: z.ZodOptional<z.ZodNumber>;
|
|
394
|
-
}, "strip", z.ZodTypeAny, {
|
|
395
|
-
mode: "none" | "automatic" | "x_days";
|
|
396
|
-
days?: number | undefined;
|
|
397
|
-
}, {
|
|
398
|
-
mode: "none" | "automatic" | "x_days";
|
|
399
|
-
days?: number | undefined;
|
|
400
|
-
}>>;
|
|
401
|
-
active: z.ZodOptional<z.ZodBoolean>;
|
|
402
|
-
}, "strip", z.ZodTypeAny, {
|
|
403
|
-
name: string;
|
|
404
|
-
conditions: {
|
|
405
|
-
attribute: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits";
|
|
406
|
-
walletType?: string | undefined;
|
|
407
|
-
}[];
|
|
408
|
-
storeCode: string;
|
|
409
|
-
active?: boolean | undefined;
|
|
410
|
-
description?: string | undefined;
|
|
411
|
-
downgrade?: {
|
|
412
|
-
mode: "none" | "automatic" | "x_days";
|
|
413
|
-
days?: number | undefined;
|
|
414
|
-
} | undefined;
|
|
415
|
-
}, {
|
|
416
|
-
name: string;
|
|
417
|
-
conditions: {
|
|
418
|
-
attribute: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits";
|
|
419
|
-
walletType?: string | undefined;
|
|
420
|
-
}[];
|
|
421
|
-
storeCode: string;
|
|
422
|
-
active?: boolean | undefined;
|
|
423
|
-
description?: string | undefined;
|
|
424
|
-
downgrade?: {
|
|
425
|
-
mode: "none" | "automatic" | "x_days";
|
|
426
|
-
days?: number | undefined;
|
|
427
|
-
} | undefined;
|
|
428
|
-
}>;
|
|
429
|
-
export declare const TierInputSchema: z.ZodObject<{
|
|
430
|
-
levelId: z.ZodOptional<z.ZodString>;
|
|
431
|
-
name: z.ZodString;
|
|
432
|
-
description: z.ZodOptional<z.ZodString>;
|
|
433
|
-
active: z.ZodOptional<z.ZodBoolean>;
|
|
434
|
-
conditions: z.ZodArray<z.ZodObject<{
|
|
435
|
-
conditionId: z.ZodString;
|
|
436
|
-
attribute: z.ZodOptional<z.ZodEnum<["activeUnits", "totalEarnedUnits", "totalSpending", "monthsSinceJoiningProgram", "cumulatedEarnedUnits"]>>;
|
|
437
|
-
value: z.ZodNumber;
|
|
438
|
-
}, "strip", z.ZodTypeAny, {
|
|
439
|
-
value: number;
|
|
440
|
-
conditionId: string;
|
|
441
|
-
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
442
|
-
}, {
|
|
443
|
-
value: number;
|
|
444
|
-
conditionId: string;
|
|
445
|
-
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
446
|
-
}>, "many">;
|
|
447
|
-
}, "strip", z.ZodTypeAny, {
|
|
448
|
-
name: string;
|
|
449
|
-
conditions: {
|
|
450
|
-
value: number;
|
|
451
|
-
conditionId: string;
|
|
452
|
-
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
453
|
-
}[];
|
|
454
|
-
active?: boolean | undefined;
|
|
455
|
-
description?: string | undefined;
|
|
456
|
-
levelId?: string | undefined;
|
|
457
|
-
}, {
|
|
458
|
-
name: string;
|
|
459
|
-
conditions: {
|
|
460
|
-
value: number;
|
|
461
|
-
conditionId: string;
|
|
462
|
-
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
463
|
-
}[];
|
|
464
|
-
active?: boolean | undefined;
|
|
465
|
-
description?: string | undefined;
|
|
466
|
-
levelId?: string | undefined;
|
|
467
|
-
}>;
|
|
468
|
-
export declare const TierSetUpdateTiersInputSchema: z.ZodObject<{
|
|
469
|
-
storeCode: z.ZodString;
|
|
470
|
-
tierSetId: z.ZodString;
|
|
471
|
-
tiers: z.ZodArray<z.ZodObject<{
|
|
472
|
-
levelId: z.ZodOptional<z.ZodString>;
|
|
473
|
-
name: z.ZodString;
|
|
474
|
-
description: z.ZodOptional<z.ZodString>;
|
|
475
|
-
active: z.ZodOptional<z.ZodBoolean>;
|
|
476
|
-
conditions: z.ZodArray<z.ZodObject<{
|
|
477
|
-
conditionId: z.ZodString;
|
|
478
|
-
attribute: z.ZodOptional<z.ZodEnum<["activeUnits", "totalEarnedUnits", "totalSpending", "monthsSinceJoiningProgram", "cumulatedEarnedUnits"]>>;
|
|
479
|
-
value: z.ZodNumber;
|
|
480
|
-
}, "strip", z.ZodTypeAny, {
|
|
481
|
-
value: number;
|
|
482
|
-
conditionId: string;
|
|
483
|
-
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
484
|
-
}, {
|
|
485
|
-
value: number;
|
|
486
|
-
conditionId: string;
|
|
487
|
-
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
488
|
-
}>, "many">;
|
|
489
|
-
}, "strip", z.ZodTypeAny, {
|
|
490
|
-
name: string;
|
|
491
|
-
conditions: {
|
|
492
|
-
value: number;
|
|
493
|
-
conditionId: string;
|
|
494
|
-
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
495
|
-
}[];
|
|
496
|
-
active?: boolean | undefined;
|
|
497
|
-
description?: string | undefined;
|
|
498
|
-
levelId?: string | undefined;
|
|
499
|
-
}, {
|
|
500
|
-
name: string;
|
|
501
|
-
conditions: {
|
|
502
|
-
value: number;
|
|
503
|
-
conditionId: string;
|
|
504
|
-
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
505
|
-
}[];
|
|
506
|
-
active?: boolean | undefined;
|
|
507
|
-
description?: string | undefined;
|
|
508
|
-
levelId?: string | undefined;
|
|
509
|
-
}>, "many">;
|
|
510
|
-
}, "strip", z.ZodTypeAny, {
|
|
511
|
-
tierSetId: string;
|
|
512
|
-
tiers: {
|
|
513
|
-
name: string;
|
|
514
|
-
conditions: {
|
|
515
|
-
value: number;
|
|
516
|
-
conditionId: string;
|
|
517
|
-
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
518
|
-
}[];
|
|
519
|
-
active?: boolean | undefined;
|
|
520
|
-
description?: string | undefined;
|
|
521
|
-
levelId?: string | undefined;
|
|
522
|
-
}[];
|
|
523
|
-
storeCode: string;
|
|
524
|
-
}, {
|
|
525
|
-
tierSetId: string;
|
|
526
|
-
tiers: {
|
|
527
|
-
name: string;
|
|
528
|
-
conditions: {
|
|
529
|
-
value: number;
|
|
530
|
-
conditionId: string;
|
|
531
|
-
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
532
|
-
}[];
|
|
533
|
-
active?: boolean | undefined;
|
|
534
|
-
description?: string | undefined;
|
|
535
|
-
levelId?: string | undefined;
|
|
536
|
-
}[];
|
|
537
|
-
storeCode: string;
|
|
538
|
-
}>;
|
|
539
367
|
export type TierSetAttribute = z.infer<typeof TierSetAttributeEnum>;
|
|
540
368
|
export type TierSetCondition = z.infer<typeof TierSetConditionSchema>;
|
|
541
369
|
export type TierCondition = z.infer<typeof TierConditionSchema>;
|
|
@@ -545,8 +373,4 @@ export type TierSet = z.infer<typeof TierSetSchema>;
|
|
|
545
373
|
export type TierSetListItem = z.infer<typeof TierSetListItemSchema>;
|
|
546
374
|
export type TierSetListResponse = z.infer<typeof TierSetListResponseSchema>;
|
|
547
375
|
export type TierListResponse = z.infer<typeof TierListResponseSchema>;
|
|
548
|
-
export type TierSetConditionInput = z.infer<typeof TierSetConditionInputSchema>;
|
|
549
|
-
export type TierSetCreateInput = z.infer<typeof TierSetCreateInputSchema>;
|
|
550
|
-
export type TierInput = z.infer<typeof TierInputSchema>;
|
|
551
|
-
export type TierSetUpdateTiersInput = z.infer<typeof TierSetUpdateTiersInputSchema>;
|
|
552
376
|
export type DowngradeMode = z.infer<typeof DowngradeModeEnum>;
|
|
@@ -57,31 +57,4 @@ export const TierSetListResponseSchema = z.object({
|
|
|
57
57
|
items: z.array(TierSetListItemSchema),
|
|
58
58
|
total: TotalSchema,
|
|
59
59
|
});
|
|
60
|
-
export const TierSetConditionInputSchema = z.object({
|
|
61
|
-
attribute: TierSetAttributeEnum,
|
|
62
|
-
walletType: z.string().optional(),
|
|
63
|
-
});
|
|
64
60
|
export const DowngradeModeEnum = z.enum(["none", "automatic", "x_days"]);
|
|
65
|
-
export const TierSetCreateInputSchema = z.object({
|
|
66
|
-
storeCode: z.string(),
|
|
67
|
-
name: z.string(),
|
|
68
|
-
description: z.string().optional(),
|
|
69
|
-
conditions: z.array(TierSetConditionInputSchema),
|
|
70
|
-
downgrade: z.object({
|
|
71
|
-
mode: DowngradeModeEnum,
|
|
72
|
-
days: z.number().optional(),
|
|
73
|
-
}).optional(),
|
|
74
|
-
active: z.boolean().optional(),
|
|
75
|
-
});
|
|
76
|
-
export const TierInputSchema = z.object({
|
|
77
|
-
levelId: z.string().optional(),
|
|
78
|
-
name: z.string(),
|
|
79
|
-
description: z.string().optional(),
|
|
80
|
-
active: z.boolean().optional(),
|
|
81
|
-
conditions: z.array(TierConditionSchema),
|
|
82
|
-
});
|
|
83
|
-
export const TierSetUpdateTiersInputSchema = z.object({
|
|
84
|
-
storeCode: z.string(),
|
|
85
|
-
tierSetId: z.string(),
|
|
86
|
-
tiers: z.array(TierInputSchema),
|
|
87
|
-
});
|