@rpcbase/db 0.121.0 → 0.123.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/billingStorage.d.ts +7 -0
- package/dist/billingStorage.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +412 -13
- package/dist/index.js.map +1 -1
- package/dist/models/RBTenantSubscriptionEvent.d.ts +376 -5
- package/dist/models/RBTenantSubscriptionEvent.d.ts.map +1 -1
- package/dist/models/RBTenantSubscriptionProjection.d.ts +49 -0
- package/dist/models/RBTenantSubscriptionProjection.d.ts.map +1 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.d.ts.map +1 -1
- package/package.json +4 -2
|
@@ -12,6 +12,24 @@ export declare const ZRBTenantSubscriptionIntervalUnit: z.ZodEnum<{
|
|
|
12
12
|
month: "month";
|
|
13
13
|
year: "year";
|
|
14
14
|
}>;
|
|
15
|
+
export declare const ZRBTenantSubscriptionType: z.ZodEnum<{
|
|
16
|
+
primary: "primary";
|
|
17
|
+
addon: "addon";
|
|
18
|
+
}>;
|
|
19
|
+
export declare const ZRBTenantSubscriptionScope: z.ZodEnum<{
|
|
20
|
+
custom: "custom";
|
|
21
|
+
tenant: "tenant";
|
|
22
|
+
workspace: "workspace";
|
|
23
|
+
shop: "shop";
|
|
24
|
+
}>;
|
|
25
|
+
export declare const ZRBTenantSubscriptionEventType: z.ZodEnum<{
|
|
26
|
+
canceled: "canceled";
|
|
27
|
+
created: "created";
|
|
28
|
+
plan_changed: "plan_changed";
|
|
29
|
+
status_changed: "status_changed";
|
|
30
|
+
resumed: "resumed";
|
|
31
|
+
renewed: "renewed";
|
|
32
|
+
}>;
|
|
15
33
|
export declare const ZRBTenantSubscriptionEventSource: z.ZodEnum<{
|
|
16
34
|
admin: "admin";
|
|
17
35
|
user: "user";
|
|
@@ -23,14 +41,93 @@ export declare const ZRBTenantSubscriptionChangeDirection: z.ZodEnum<{
|
|
|
23
41
|
downgrade: "downgrade";
|
|
24
42
|
lateral: "lateral";
|
|
25
43
|
}>;
|
|
26
|
-
export declare const ZRBTenantSubscriptionEvent: z.ZodObject<{
|
|
44
|
+
export declare const ZRBTenantSubscriptionEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
27
45
|
tenantId: z.ZodString;
|
|
28
46
|
subscriptionId: z.ZodString;
|
|
29
|
-
type: z.ZodString;
|
|
30
47
|
occurredAt: z.ZodDate;
|
|
31
|
-
effectiveAt: z.
|
|
48
|
+
effectiveAt: z.ZodDate;
|
|
49
|
+
subscriptionType: z.ZodEnum<{
|
|
50
|
+
primary: "primary";
|
|
51
|
+
addon: "addon";
|
|
52
|
+
}>;
|
|
53
|
+
parentSubscriptionId: z.ZodOptional<z.ZodString>;
|
|
54
|
+
scope: z.ZodEnum<{
|
|
55
|
+
custom: "custom";
|
|
56
|
+
tenant: "tenant";
|
|
57
|
+
workspace: "workspace";
|
|
58
|
+
shop: "shop";
|
|
59
|
+
}>;
|
|
60
|
+
scopeId: z.ZodOptional<z.ZodString>;
|
|
32
61
|
fromPlanKey: z.ZodOptional<z.ZodString>;
|
|
33
|
-
|
|
62
|
+
fromStatus: z.ZodOptional<z.ZodEnum<{
|
|
63
|
+
trialing: "trialing";
|
|
64
|
+
active: "active";
|
|
65
|
+
past_due: "past_due";
|
|
66
|
+
paused: "paused";
|
|
67
|
+
canceled: "canceled";
|
|
68
|
+
expired: "expired";
|
|
69
|
+
}>>;
|
|
70
|
+
fromModules: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
71
|
+
fromIntervalUnit: z.ZodOptional<z.ZodEnum<{
|
|
72
|
+
month: "month";
|
|
73
|
+
year: "year";
|
|
74
|
+
}>>;
|
|
75
|
+
fromIntervalCount: z.ZodOptional<z.ZodNumber>;
|
|
76
|
+
fromPriceId: z.ZodOptional<z.ZodString>;
|
|
77
|
+
toPriceId: z.ZodOptional<z.ZodString>;
|
|
78
|
+
supersedesEventId: z.ZodOptional<z.ZodString>;
|
|
79
|
+
idempotencyKey: z.ZodString;
|
|
80
|
+
direction: z.ZodOptional<z.ZodEnum<{
|
|
81
|
+
upgrade: "upgrade";
|
|
82
|
+
downgrade: "downgrade";
|
|
83
|
+
lateral: "lateral";
|
|
84
|
+
}>>;
|
|
85
|
+
actorUserId: z.ZodOptional<z.ZodString>;
|
|
86
|
+
source: z.ZodOptional<z.ZodEnum<{
|
|
87
|
+
admin: "admin";
|
|
88
|
+
user: "user";
|
|
89
|
+
system: "system";
|
|
90
|
+
webhook: "webhook";
|
|
91
|
+
}>>;
|
|
92
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
93
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
94
|
+
providerEventId: z.ZodOptional<z.ZodString>;
|
|
95
|
+
providerPayload: z.ZodOptional<z.ZodUnknown>;
|
|
96
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
97
|
+
type: z.ZodLiteral<"created">;
|
|
98
|
+
toPlanKey: z.ZodString;
|
|
99
|
+
toStatus: z.ZodEnum<{
|
|
100
|
+
trialing: "trialing";
|
|
101
|
+
active: "active";
|
|
102
|
+
past_due: "past_due";
|
|
103
|
+
paused: "paused";
|
|
104
|
+
canceled: "canceled";
|
|
105
|
+
expired: "expired";
|
|
106
|
+
}>;
|
|
107
|
+
toModules: z.ZodArray<z.ZodString>;
|
|
108
|
+
toIntervalUnit: z.ZodEnum<{
|
|
109
|
+
month: "month";
|
|
110
|
+
year: "year";
|
|
111
|
+
}>;
|
|
112
|
+
toIntervalCount: z.ZodNumber;
|
|
113
|
+
billingAnchor: z.ZodDate;
|
|
114
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
115
|
+
tenantId: z.ZodString;
|
|
116
|
+
subscriptionId: z.ZodString;
|
|
117
|
+
occurredAt: z.ZodDate;
|
|
118
|
+
effectiveAt: z.ZodDate;
|
|
119
|
+
subscriptionType: z.ZodEnum<{
|
|
120
|
+
primary: "primary";
|
|
121
|
+
addon: "addon";
|
|
122
|
+
}>;
|
|
123
|
+
parentSubscriptionId: z.ZodOptional<z.ZodString>;
|
|
124
|
+
scope: z.ZodEnum<{
|
|
125
|
+
custom: "custom";
|
|
126
|
+
tenant: "tenant";
|
|
127
|
+
workspace: "workspace";
|
|
128
|
+
shop: "shop";
|
|
129
|
+
}>;
|
|
130
|
+
scopeId: z.ZodOptional<z.ZodString>;
|
|
34
131
|
fromStatus: z.ZodOptional<z.ZodEnum<{
|
|
35
132
|
trialing: "trialing";
|
|
36
133
|
active: "active";
|
|
@@ -47,6 +144,62 @@ export declare const ZRBTenantSubscriptionEvent: z.ZodObject<{
|
|
|
47
144
|
canceled: "canceled";
|
|
48
145
|
expired: "expired";
|
|
49
146
|
}>>;
|
|
147
|
+
fromPriceId: z.ZodOptional<z.ZodString>;
|
|
148
|
+
toPriceId: z.ZodOptional<z.ZodString>;
|
|
149
|
+
billingAnchor: z.ZodOptional<z.ZodDate>;
|
|
150
|
+
supersedesEventId: z.ZodOptional<z.ZodString>;
|
|
151
|
+
idempotencyKey: z.ZodString;
|
|
152
|
+
direction: z.ZodOptional<z.ZodEnum<{
|
|
153
|
+
upgrade: "upgrade";
|
|
154
|
+
downgrade: "downgrade";
|
|
155
|
+
lateral: "lateral";
|
|
156
|
+
}>>;
|
|
157
|
+
actorUserId: z.ZodOptional<z.ZodString>;
|
|
158
|
+
source: z.ZodOptional<z.ZodEnum<{
|
|
159
|
+
admin: "admin";
|
|
160
|
+
user: "user";
|
|
161
|
+
system: "system";
|
|
162
|
+
webhook: "webhook";
|
|
163
|
+
}>>;
|
|
164
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
165
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
166
|
+
providerEventId: z.ZodOptional<z.ZodString>;
|
|
167
|
+
providerPayload: z.ZodOptional<z.ZodUnknown>;
|
|
168
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
169
|
+
type: z.ZodLiteral<"plan_changed">;
|
|
170
|
+
fromPlanKey: z.ZodString;
|
|
171
|
+
toPlanKey: z.ZodString;
|
|
172
|
+
fromModules: z.ZodArray<z.ZodString>;
|
|
173
|
+
toModules: z.ZodArray<z.ZodString>;
|
|
174
|
+
fromIntervalUnit: z.ZodEnum<{
|
|
175
|
+
month: "month";
|
|
176
|
+
year: "year";
|
|
177
|
+
}>;
|
|
178
|
+
toIntervalUnit: z.ZodEnum<{
|
|
179
|
+
month: "month";
|
|
180
|
+
year: "year";
|
|
181
|
+
}>;
|
|
182
|
+
fromIntervalCount: z.ZodNumber;
|
|
183
|
+
toIntervalCount: z.ZodNumber;
|
|
184
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
185
|
+
tenantId: z.ZodString;
|
|
186
|
+
subscriptionId: z.ZodString;
|
|
187
|
+
occurredAt: z.ZodDate;
|
|
188
|
+
effectiveAt: z.ZodDate;
|
|
189
|
+
subscriptionType: z.ZodEnum<{
|
|
190
|
+
primary: "primary";
|
|
191
|
+
addon: "addon";
|
|
192
|
+
}>;
|
|
193
|
+
parentSubscriptionId: z.ZodOptional<z.ZodString>;
|
|
194
|
+
scope: z.ZodEnum<{
|
|
195
|
+
custom: "custom";
|
|
196
|
+
tenant: "tenant";
|
|
197
|
+
workspace: "workspace";
|
|
198
|
+
shop: "shop";
|
|
199
|
+
}>;
|
|
200
|
+
scopeId: z.ZodOptional<z.ZodString>;
|
|
201
|
+
fromPlanKey: z.ZodOptional<z.ZodString>;
|
|
202
|
+
toPlanKey: z.ZodOptional<z.ZodString>;
|
|
50
203
|
fromModules: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
51
204
|
toModules: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
52
205
|
fromIntervalUnit: z.ZodOptional<z.ZodEnum<{
|
|
@@ -59,6 +212,11 @@ export declare const ZRBTenantSubscriptionEvent: z.ZodObject<{
|
|
|
59
212
|
}>>;
|
|
60
213
|
fromIntervalCount: z.ZodOptional<z.ZodNumber>;
|
|
61
214
|
toIntervalCount: z.ZodOptional<z.ZodNumber>;
|
|
215
|
+
fromPriceId: z.ZodOptional<z.ZodString>;
|
|
216
|
+
toPriceId: z.ZodOptional<z.ZodString>;
|
|
217
|
+
billingAnchor: z.ZodOptional<z.ZodDate>;
|
|
218
|
+
supersedesEventId: z.ZodOptional<z.ZodString>;
|
|
219
|
+
idempotencyKey: z.ZodString;
|
|
62
220
|
direction: z.ZodOptional<z.ZodEnum<{
|
|
63
221
|
upgrade: "upgrade";
|
|
64
222
|
downgrade: "downgrade";
|
|
@@ -76,7 +234,220 @@ export declare const ZRBTenantSubscriptionEvent: z.ZodObject<{
|
|
|
76
234
|
providerEventId: z.ZodOptional<z.ZodString>;
|
|
77
235
|
providerPayload: z.ZodOptional<z.ZodUnknown>;
|
|
78
236
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
79
|
-
|
|
237
|
+
type: z.ZodLiteral<"status_changed">;
|
|
238
|
+
fromStatus: z.ZodEnum<{
|
|
239
|
+
trialing: "trialing";
|
|
240
|
+
active: "active";
|
|
241
|
+
past_due: "past_due";
|
|
242
|
+
paused: "paused";
|
|
243
|
+
canceled: "canceled";
|
|
244
|
+
expired: "expired";
|
|
245
|
+
}>;
|
|
246
|
+
toStatus: z.ZodEnum<{
|
|
247
|
+
trialing: "trialing";
|
|
248
|
+
active: "active";
|
|
249
|
+
past_due: "past_due";
|
|
250
|
+
paused: "paused";
|
|
251
|
+
canceled: "canceled";
|
|
252
|
+
expired: "expired";
|
|
253
|
+
}>;
|
|
254
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
255
|
+
tenantId: z.ZodString;
|
|
256
|
+
subscriptionId: z.ZodString;
|
|
257
|
+
occurredAt: z.ZodDate;
|
|
258
|
+
effectiveAt: z.ZodDate;
|
|
259
|
+
subscriptionType: z.ZodEnum<{
|
|
260
|
+
primary: "primary";
|
|
261
|
+
addon: "addon";
|
|
262
|
+
}>;
|
|
263
|
+
parentSubscriptionId: z.ZodOptional<z.ZodString>;
|
|
264
|
+
scope: z.ZodEnum<{
|
|
265
|
+
custom: "custom";
|
|
266
|
+
tenant: "tenant";
|
|
267
|
+
workspace: "workspace";
|
|
268
|
+
shop: "shop";
|
|
269
|
+
}>;
|
|
270
|
+
scopeId: z.ZodOptional<z.ZodString>;
|
|
271
|
+
fromPlanKey: z.ZodOptional<z.ZodString>;
|
|
272
|
+
toPlanKey: z.ZodOptional<z.ZodString>;
|
|
273
|
+
fromModules: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
274
|
+
toModules: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
275
|
+
fromIntervalUnit: z.ZodOptional<z.ZodEnum<{
|
|
276
|
+
month: "month";
|
|
277
|
+
year: "year";
|
|
278
|
+
}>>;
|
|
279
|
+
toIntervalUnit: z.ZodOptional<z.ZodEnum<{
|
|
280
|
+
month: "month";
|
|
281
|
+
year: "year";
|
|
282
|
+
}>>;
|
|
283
|
+
fromIntervalCount: z.ZodOptional<z.ZodNumber>;
|
|
284
|
+
toIntervalCount: z.ZodOptional<z.ZodNumber>;
|
|
285
|
+
fromPriceId: z.ZodOptional<z.ZodString>;
|
|
286
|
+
toPriceId: z.ZodOptional<z.ZodString>;
|
|
287
|
+
billingAnchor: z.ZodOptional<z.ZodDate>;
|
|
288
|
+
supersedesEventId: z.ZodOptional<z.ZodString>;
|
|
289
|
+
idempotencyKey: z.ZodString;
|
|
290
|
+
direction: z.ZodOptional<z.ZodEnum<{
|
|
291
|
+
upgrade: "upgrade";
|
|
292
|
+
downgrade: "downgrade";
|
|
293
|
+
lateral: "lateral";
|
|
294
|
+
}>>;
|
|
295
|
+
actorUserId: z.ZodOptional<z.ZodString>;
|
|
296
|
+
source: z.ZodOptional<z.ZodEnum<{
|
|
297
|
+
admin: "admin";
|
|
298
|
+
user: "user";
|
|
299
|
+
system: "system";
|
|
300
|
+
webhook: "webhook";
|
|
301
|
+
}>>;
|
|
302
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
303
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
304
|
+
providerEventId: z.ZodOptional<z.ZodString>;
|
|
305
|
+
providerPayload: z.ZodOptional<z.ZodUnknown>;
|
|
306
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
307
|
+
type: z.ZodLiteral<"resumed">;
|
|
308
|
+
fromStatus: z.ZodEnum<{
|
|
309
|
+
trialing: "trialing";
|
|
310
|
+
active: "active";
|
|
311
|
+
past_due: "past_due";
|
|
312
|
+
paused: "paused";
|
|
313
|
+
canceled: "canceled";
|
|
314
|
+
expired: "expired";
|
|
315
|
+
}>;
|
|
316
|
+
toStatus: z.ZodLiteral<"active">;
|
|
317
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
318
|
+
tenantId: z.ZodString;
|
|
319
|
+
subscriptionId: z.ZodString;
|
|
320
|
+
occurredAt: z.ZodDate;
|
|
321
|
+
effectiveAt: z.ZodDate;
|
|
322
|
+
subscriptionType: z.ZodEnum<{
|
|
323
|
+
primary: "primary";
|
|
324
|
+
addon: "addon";
|
|
325
|
+
}>;
|
|
326
|
+
parentSubscriptionId: z.ZodOptional<z.ZodString>;
|
|
327
|
+
scope: z.ZodEnum<{
|
|
328
|
+
custom: "custom";
|
|
329
|
+
tenant: "tenant";
|
|
330
|
+
workspace: "workspace";
|
|
331
|
+
shop: "shop";
|
|
332
|
+
}>;
|
|
333
|
+
scopeId: z.ZodOptional<z.ZodString>;
|
|
334
|
+
fromPlanKey: z.ZodOptional<z.ZodString>;
|
|
335
|
+
toPlanKey: z.ZodOptional<z.ZodString>;
|
|
336
|
+
fromModules: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
337
|
+
toModules: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
338
|
+
fromIntervalUnit: z.ZodOptional<z.ZodEnum<{
|
|
339
|
+
month: "month";
|
|
340
|
+
year: "year";
|
|
341
|
+
}>>;
|
|
342
|
+
toIntervalUnit: z.ZodOptional<z.ZodEnum<{
|
|
343
|
+
month: "month";
|
|
344
|
+
year: "year";
|
|
345
|
+
}>>;
|
|
346
|
+
fromIntervalCount: z.ZodOptional<z.ZodNumber>;
|
|
347
|
+
toIntervalCount: z.ZodOptional<z.ZodNumber>;
|
|
348
|
+
fromPriceId: z.ZodOptional<z.ZodString>;
|
|
349
|
+
toPriceId: z.ZodOptional<z.ZodString>;
|
|
350
|
+
billingAnchor: z.ZodOptional<z.ZodDate>;
|
|
351
|
+
supersedesEventId: z.ZodOptional<z.ZodString>;
|
|
352
|
+
idempotencyKey: z.ZodString;
|
|
353
|
+
direction: z.ZodOptional<z.ZodEnum<{
|
|
354
|
+
upgrade: "upgrade";
|
|
355
|
+
downgrade: "downgrade";
|
|
356
|
+
lateral: "lateral";
|
|
357
|
+
}>>;
|
|
358
|
+
actorUserId: z.ZodOptional<z.ZodString>;
|
|
359
|
+
source: z.ZodOptional<z.ZodEnum<{
|
|
360
|
+
admin: "admin";
|
|
361
|
+
user: "user";
|
|
362
|
+
system: "system";
|
|
363
|
+
webhook: "webhook";
|
|
364
|
+
}>>;
|
|
365
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
366
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
367
|
+
providerEventId: z.ZodOptional<z.ZodString>;
|
|
368
|
+
providerPayload: z.ZodOptional<z.ZodUnknown>;
|
|
369
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
370
|
+
type: z.ZodLiteral<"canceled">;
|
|
371
|
+
fromStatus: z.ZodEnum<{
|
|
372
|
+
trialing: "trialing";
|
|
373
|
+
active: "active";
|
|
374
|
+
past_due: "past_due";
|
|
375
|
+
paused: "paused";
|
|
376
|
+
canceled: "canceled";
|
|
377
|
+
expired: "expired";
|
|
378
|
+
}>;
|
|
379
|
+
toStatus: z.ZodLiteral<"canceled">;
|
|
380
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
381
|
+
tenantId: z.ZodString;
|
|
382
|
+
subscriptionId: z.ZodString;
|
|
383
|
+
occurredAt: z.ZodDate;
|
|
384
|
+
effectiveAt: z.ZodDate;
|
|
385
|
+
subscriptionType: z.ZodEnum<{
|
|
386
|
+
primary: "primary";
|
|
387
|
+
addon: "addon";
|
|
388
|
+
}>;
|
|
389
|
+
parentSubscriptionId: z.ZodOptional<z.ZodString>;
|
|
390
|
+
scope: z.ZodEnum<{
|
|
391
|
+
custom: "custom";
|
|
392
|
+
tenant: "tenant";
|
|
393
|
+
workspace: "workspace";
|
|
394
|
+
shop: "shop";
|
|
395
|
+
}>;
|
|
396
|
+
scopeId: z.ZodOptional<z.ZodString>;
|
|
397
|
+
fromPlanKey: z.ZodOptional<z.ZodString>;
|
|
398
|
+
toPlanKey: z.ZodOptional<z.ZodString>;
|
|
399
|
+
fromModules: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
400
|
+
toModules: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
401
|
+
fromIntervalUnit: z.ZodOptional<z.ZodEnum<{
|
|
402
|
+
month: "month";
|
|
403
|
+
year: "year";
|
|
404
|
+
}>>;
|
|
405
|
+
toIntervalUnit: z.ZodOptional<z.ZodEnum<{
|
|
406
|
+
month: "month";
|
|
407
|
+
year: "year";
|
|
408
|
+
}>>;
|
|
409
|
+
fromIntervalCount: z.ZodOptional<z.ZodNumber>;
|
|
410
|
+
toIntervalCount: z.ZodOptional<z.ZodNumber>;
|
|
411
|
+
fromPriceId: z.ZodOptional<z.ZodString>;
|
|
412
|
+
toPriceId: z.ZodOptional<z.ZodString>;
|
|
413
|
+
billingAnchor: z.ZodOptional<z.ZodDate>;
|
|
414
|
+
supersedesEventId: z.ZodOptional<z.ZodString>;
|
|
415
|
+
idempotencyKey: z.ZodString;
|
|
416
|
+
direction: z.ZodOptional<z.ZodEnum<{
|
|
417
|
+
upgrade: "upgrade";
|
|
418
|
+
downgrade: "downgrade";
|
|
419
|
+
lateral: "lateral";
|
|
420
|
+
}>>;
|
|
421
|
+
actorUserId: z.ZodOptional<z.ZodString>;
|
|
422
|
+
source: z.ZodOptional<z.ZodEnum<{
|
|
423
|
+
admin: "admin";
|
|
424
|
+
user: "user";
|
|
425
|
+
system: "system";
|
|
426
|
+
webhook: "webhook";
|
|
427
|
+
}>>;
|
|
428
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
429
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
430
|
+
providerEventId: z.ZodOptional<z.ZodString>;
|
|
431
|
+
providerPayload: z.ZodOptional<z.ZodUnknown>;
|
|
432
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
433
|
+
type: z.ZodLiteral<"renewed">;
|
|
434
|
+
fromStatus: z.ZodEnum<{
|
|
435
|
+
trialing: "trialing";
|
|
436
|
+
active: "active";
|
|
437
|
+
past_due: "past_due";
|
|
438
|
+
paused: "paused";
|
|
439
|
+
canceled: "canceled";
|
|
440
|
+
expired: "expired";
|
|
441
|
+
}>;
|
|
442
|
+
toStatus: z.ZodEnum<{
|
|
443
|
+
trialing: "trialing";
|
|
444
|
+
active: "active";
|
|
445
|
+
past_due: "past_due";
|
|
446
|
+
paused: "paused";
|
|
447
|
+
canceled: "canceled";
|
|
448
|
+
expired: "expired";
|
|
449
|
+
}>;
|
|
450
|
+
}, z.core.$strip>], "type">;
|
|
80
451
|
export type IRBTenantSubscriptionEvent = z.infer<typeof ZRBTenantSubscriptionEvent>;
|
|
81
452
|
export declare const RBTenantSubscriptionEventSchema: Schema;
|
|
82
453
|
//# sourceMappingURL=RBTenantSubscriptionEvent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RBTenantSubscriptionEvent.d.ts","sourceRoot":"","sources":["../../src/models/RBTenantSubscriptionEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"RBTenantSubscriptionEvent.d.ts","sourceRoot":"","sources":["../../src/models/RBTenantSubscriptionEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAWvB,eAAO,MAAM,2BAA2B;;;;;;;EAAgC,CAAA;AAExE,eAAO,MAAM,iCAAiC;;;EAAsC,CAAA;AAEpF,eAAO,MAAM,yBAAyB;;;EAA6B,CAAA;AAEnE,eAAO,MAAM,0BAA0B;;;;;EAA8B,CAAA;AAErE,eAAO,MAAM,8BAA8B;;;;;;;EAAmC,CAAA;AAG9E,eAAO,MAAM,gCAAgC;;;;;EAK3C,CAAA;AAEF,eAAO,MAAM,oCAAoC;;;;EAAyC,CAAA;AAkF1F,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAsBrC,CAAA;AAEF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAanF,eAAO,MAAM,+BAA+B,EAAE,MA6D7C,CAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare const ZRBTenantSubscriptionProjection: z.ZodObject<{
|
|
4
|
+
tenantId: z.ZodString;
|
|
5
|
+
subscriptionId: z.ZodString;
|
|
6
|
+
type: z.ZodEnum<{
|
|
7
|
+
primary: "primary";
|
|
8
|
+
addon: "addon";
|
|
9
|
+
}>;
|
|
10
|
+
parentSubscriptionId: z.ZodOptional<z.ZodString>;
|
|
11
|
+
scope: z.ZodEnum<{
|
|
12
|
+
custom: "custom";
|
|
13
|
+
tenant: "tenant";
|
|
14
|
+
workspace: "workspace";
|
|
15
|
+
shop: "shop";
|
|
16
|
+
}>;
|
|
17
|
+
scopeId: z.ZodOptional<z.ZodString>;
|
|
18
|
+
planKey: z.ZodString;
|
|
19
|
+
priceId: z.ZodOptional<z.ZodString>;
|
|
20
|
+
status: z.ZodEnum<{
|
|
21
|
+
trialing: "trialing";
|
|
22
|
+
active: "active";
|
|
23
|
+
past_due: "past_due";
|
|
24
|
+
paused: "paused";
|
|
25
|
+
canceled: "canceled";
|
|
26
|
+
expired: "expired";
|
|
27
|
+
}>;
|
|
28
|
+
intervalUnit: z.ZodEnum<{
|
|
29
|
+
month: "month";
|
|
30
|
+
year: "year";
|
|
31
|
+
}>;
|
|
32
|
+
intervalCount: z.ZodNumber;
|
|
33
|
+
modules: z.ZodArray<z.ZodString>;
|
|
34
|
+
billingAnchor: z.ZodDate;
|
|
35
|
+
currentPeriodStart: z.ZodDate;
|
|
36
|
+
currentPeriodEnd: z.ZodDate;
|
|
37
|
+
cancelAtPeriodEnd: z.ZodBoolean;
|
|
38
|
+
cancelAt: z.ZodOptional<z.ZodDate>;
|
|
39
|
+
canceledAt: z.ZodOptional<z.ZodDate>;
|
|
40
|
+
scheduledPlanKey: z.ZodOptional<z.ZodString>;
|
|
41
|
+
scheduledPlanEffectiveAt: z.ZodOptional<z.ZodDate>;
|
|
42
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
43
|
+
latestEventId: z.ZodString;
|
|
44
|
+
latestEventAt: z.ZodDate;
|
|
45
|
+
projectedAt: z.ZodDate;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
export type IRBTenantSubscriptionProjection = z.infer<typeof ZRBTenantSubscriptionProjection>;
|
|
48
|
+
export declare const RBTenantSubscriptionProjectionSchema: Schema;
|
|
49
|
+
//# sourceMappingURL=RBTenantSubscriptionProjection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RBTenantSubscriptionProjection.d.ts","sourceRoot":"","sources":["../../src/models/RBTenantSubscriptionProjection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAUvB,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyB1C,CAAA;AAEF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA;AAE7F,eAAO,MAAM,oCAAoC,EAAE,MAyBjD,CAAA"}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,kBAAkB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,6BAA6B,CAAA;AAC3C,cAAc,kCAAkC,CAAA;AAChD,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,kBAAkB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rpcbase/db",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.123.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
"build": {
|
|
40
40
|
"command": "../../node_modules/.bin/vite build",
|
|
41
41
|
"dependencies": [
|
|
42
|
-
"../api:build"
|
|
42
|
+
"../api:build",
|
|
43
|
+
"../billing:build"
|
|
43
44
|
],
|
|
44
45
|
"files": [
|
|
45
46
|
"src/**/*",
|
|
@@ -87,6 +88,7 @@
|
|
|
87
88
|
"zod": "^4"
|
|
88
89
|
},
|
|
89
90
|
"dependencies": {
|
|
91
|
+
"@rpcbase/billing": "*",
|
|
90
92
|
"@casl/ability": "6.8.0",
|
|
91
93
|
"@casl/mongoose": "8.0.5"
|
|
92
94
|
},
|