@stewardhq/sdk 0.2.0 → 0.5.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 +123 -88
- package/dist/_chunks/errors.js +1 -1
- package/dist/_chunks/events.d.ts +315 -4
- package/dist/_chunks/events.js +1155 -9
- package/dist/_chunks/index.d.ts +3473 -90
- package/dist/_chunks/locale.d.ts +269 -1
- package/dist/_chunks/src.js +842 -24
- package/dist/_chunks/validators.d.ts +45 -1
- package/dist/_chunks/validators.js +128 -27
- package/dist/contract.d.ts +4 -4
- package/dist/contract.js +4 -4
- package/dist/index.d.ts +436 -22
- package/dist/index.js +1659 -26
- package/dist/server.d.ts +44 -6
- package/dist/server.js +29 -2
- package/package.json +4 -10
- package/dist/_chunks/steward.d.ts +0 -189
- package/dist/_chunks/steward.js +0 -560
- package/dist/testing/fixtures/events/LOCK.json +0 -27
- package/dist/testing/fixtures/events/account.deleted.json +0 -36
- package/dist/testing/fixtures/events/account.state_changed.json +0 -53
- package/dist/testing/fixtures/events/account.updated.json +0 -37
- package/dist/testing/fixtures/events/checkout.completed.json +0 -36
- package/dist/testing/fixtures/events/checkout.expired.json +0 -26
- package/dist/testing/fixtures/events/checkout.failed.json +0 -27
- package/dist/testing/fixtures/events/invoice.created.json +0 -37
- package/dist/testing/fixtures/events/invoice.issued.json +0 -38
- package/dist/testing/fixtures/events/invoice.voided.json +0 -39
- package/dist/testing/fixtures/events/subscription.activated.json +0 -40
- package/dist/testing/fixtures/events/subscription.cancel_scheduled.json +0 -38
- package/dist/testing/fixtures/events/subscription.canceled.json +0 -29
- package/dist/testing/fixtures/events/subscription.expired.json +0 -27
- package/dist/testing/fixtures/events/subscription.payment_failed.json +0 -38
- package/dist/testing/fixtures/events/subscription.reactivated.json +0 -36
- package/dist/testing/fixtures/events/subscription.renewed.json +0 -39
- package/dist/testing/fixtures/events/subscription.suspended.json +0 -36
- package/dist/testing/fixtures/events/subscription.terminated.json +0 -28
- package/dist/testing.d.ts +0 -626
- package/dist/testing.js +0 -3638
package/dist/_chunks/events.d.ts
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region ../contract/src/accounts.d.ts
|
|
3
|
+
declare const AccountLocaleSchema: z.ZodEnum<{
|
|
4
|
+
tr: "tr";
|
|
5
|
+
en: "en";
|
|
6
|
+
}>;
|
|
3
7
|
declare const AccountUpsertInputSchema: z.ZodObject<{
|
|
4
8
|
displayName: z.ZodString;
|
|
5
9
|
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
10
|
+
notificationEmails: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodEmail>, z.ZodTransform<string[], string[]>>>;
|
|
11
|
+
locale: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
12
|
+
tr: "tr";
|
|
13
|
+
en: "en";
|
|
14
|
+
}>>>;
|
|
6
15
|
}, z.core.$strip>;
|
|
7
16
|
type AccountUpsertInput = z.input<typeof AccountUpsertInputSchema>;
|
|
8
17
|
declare const BillingProfileKindSchema: z.ZodEnum<{
|
|
@@ -95,7 +104,10 @@ declare const AccountDunningStateSchema: z.ZodObject<{
|
|
|
95
104
|
nextActionAt: z.ZodNullable<z.ZodISODateTime>;
|
|
96
105
|
}, z.core.$strip>;
|
|
97
106
|
type AccountDunningState = z.infer<typeof AccountDunningStateSchema>;
|
|
98
|
-
/**
|
|
107
|
+
/**
|
|
108
|
+
* Change applied at the period end (`POST /v1/subscriptions/:id/change`, MF9). Null until then.
|
|
109
|
+
* `price: "current"` on the same plan shows the same `planCode`/`interval` with the new `amountMinor`.
|
|
110
|
+
*/
|
|
99
111
|
declare const AccountScheduledChangeSchema: z.ZodObject<{
|
|
100
112
|
planCode: z.ZodString;
|
|
101
113
|
interval: z.ZodEnum<{
|
|
@@ -103,6 +115,7 @@ declare const AccountScheduledChangeSchema: z.ZodObject<{
|
|
|
103
115
|
year: "year";
|
|
104
116
|
}>;
|
|
105
117
|
effectiveAt: z.ZodISODateTime;
|
|
118
|
+
amountMinor: z.ZodOptional<z.ZodNumber>;
|
|
106
119
|
}, z.core.$strip>;
|
|
107
120
|
type AccountScheduledChange = z.infer<typeof AccountScheduledChangeSchema>;
|
|
108
121
|
declare const AccountSubscriptionStateSchema: z.ZodObject<{
|
|
@@ -137,6 +150,7 @@ declare const AccountSubscriptionStateSchema: z.ZodObject<{
|
|
|
137
150
|
year: "year";
|
|
138
151
|
}>;
|
|
139
152
|
effectiveAt: z.ZodISODateTime;
|
|
153
|
+
amountMinor: z.ZodOptional<z.ZodNumber>;
|
|
140
154
|
}, z.core.$strip>>;
|
|
141
155
|
}, z.core.$strip>;
|
|
142
156
|
type AccountSubscriptionState = z.infer<typeof AccountSubscriptionStateSchema>;
|
|
@@ -154,6 +168,52 @@ declare const AccountOpenCheckoutSchema: z.ZodObject<{
|
|
|
154
168
|
expiresAt: z.ZodISODateTime;
|
|
155
169
|
}, z.core.$strip>;
|
|
156
170
|
type AccountOpenCheckout = z.infer<typeof AccountOpenCheckoutSchema>;
|
|
171
|
+
/**
|
|
172
|
+
* An unpaid invoice of the account (billing core, M22/M34): renewal or final invoices written
|
|
173
|
+
* before payment. Account level (not under a subscription) so the final invoice of an ended
|
|
174
|
+
* subscription stays visible; the product can show a banner before `dueAt`.
|
|
175
|
+
*/
|
|
176
|
+
declare const AccountOpenInvoiceSchema: z.ZodObject<{
|
|
177
|
+
id: z.ZodUUID;
|
|
178
|
+
subscriptionId: z.ZodNullable<z.ZodUUID>;
|
|
179
|
+
billingReason: z.ZodEnum<{
|
|
180
|
+
subscription_create: "subscription_create";
|
|
181
|
+
subscription_cycle: "subscription_cycle";
|
|
182
|
+
subscription_update: "subscription_update";
|
|
183
|
+
purchase: "purchase";
|
|
184
|
+
manual: "manual";
|
|
185
|
+
}>;
|
|
186
|
+
totalMinor: z.ZodNumber;
|
|
187
|
+
currency: z.ZodString;
|
|
188
|
+
dueAt: z.ZodISODateTime;
|
|
189
|
+
}, z.core.$strip>;
|
|
190
|
+
type AccountOpenInvoice = z.infer<typeof AccountOpenInvoiceSchema>;
|
|
191
|
+
/**
|
|
192
|
+
* Low-churn meter facts of the account state (metering, M13; Polar `active_meters`, coarse). One
|
|
193
|
+
* entry per catalog meter. Balances and period bounds are NOT here (they change with every event;
|
|
194
|
+
* read them with `GET /v1/accounts/:ref/meters`): this block changes when the plan changes, a
|
|
195
|
+
* threshold is crossed or a new period resets the standing — never per event.
|
|
196
|
+
*/
|
|
197
|
+
declare const AccountMeterStateSchema: z.ZodObject<{
|
|
198
|
+
includedUnits: z.ZodNullable<z.ZodNumber>;
|
|
199
|
+
billable: z.ZodBoolean;
|
|
200
|
+
standing: z.ZodEnum<{
|
|
201
|
+
ok: "ok";
|
|
202
|
+
low: "low";
|
|
203
|
+
exhausted: "exhausted";
|
|
204
|
+
}>;
|
|
205
|
+
}, z.core.$strip>;
|
|
206
|
+
type AccountMeterState = z.infer<typeof AccountMeterStateSchema>;
|
|
207
|
+
declare const AccountMetersStateSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
208
|
+
includedUnits: z.ZodNullable<z.ZodNumber>;
|
|
209
|
+
billable: z.ZodBoolean;
|
|
210
|
+
standing: z.ZodEnum<{
|
|
211
|
+
ok: "ok";
|
|
212
|
+
low: "low";
|
|
213
|
+
exhausted: "exhausted";
|
|
214
|
+
}>;
|
|
215
|
+
}, z.core.$strip>>;
|
|
216
|
+
type AccountMetersState = z.infer<typeof AccountMetersStateSchema>;
|
|
157
217
|
/** Fatura profili özeti: yalnızca var mı ve türü (alanlar PII, burada yok). */
|
|
158
218
|
declare const AccountProfileStateSchema: z.ZodObject<{
|
|
159
219
|
present: z.ZodBoolean;
|
|
@@ -207,6 +267,7 @@ declare const AccountStateSchema: z.ZodObject<{
|
|
|
207
267
|
year: "year";
|
|
208
268
|
}>;
|
|
209
269
|
effectiveAt: z.ZodISODateTime;
|
|
270
|
+
amountMinor: z.ZodOptional<z.ZodNumber>;
|
|
210
271
|
}, z.core.$strip>>;
|
|
211
272
|
}, z.core.$strip>>;
|
|
212
273
|
openCheckout: z.ZodNullable<z.ZodObject<{
|
|
@@ -228,6 +289,71 @@ declare const AccountStateSchema: z.ZodObject<{
|
|
|
228
289
|
company: "company";
|
|
229
290
|
}>>;
|
|
230
291
|
}, z.core.$strip>;
|
|
292
|
+
subscriptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
293
|
+
id: z.ZodUUID;
|
|
294
|
+
status: z.ZodEnum<{
|
|
295
|
+
active: "active";
|
|
296
|
+
suspended: "suspended";
|
|
297
|
+
past_due: "past_due";
|
|
298
|
+
canceled: "canceled";
|
|
299
|
+
expired: "expired";
|
|
300
|
+
}>;
|
|
301
|
+
planCode: z.ZodString;
|
|
302
|
+
interval: z.ZodEnum<{
|
|
303
|
+
month: "month";
|
|
304
|
+
year: "year";
|
|
305
|
+
}>;
|
|
306
|
+
amountMinor: z.ZodNumber;
|
|
307
|
+
currency: z.ZodString;
|
|
308
|
+
currentPeriodEnd: z.ZodNullable<z.ZodISODateTime>;
|
|
309
|
+
cancelAt: z.ZodNullable<z.ZodISODateTime>;
|
|
310
|
+
cancelAtPeriodEnd: z.ZodBoolean;
|
|
311
|
+
pastDueSince: z.ZodNullable<z.ZodISODateTime>;
|
|
312
|
+
currentPeriodStart: z.ZodNullable<z.ZodISODateTime>;
|
|
313
|
+
dunning: z.ZodNullable<z.ZodObject<{
|
|
314
|
+
step: z.ZodNumber;
|
|
315
|
+
nextActionAt: z.ZodNullable<z.ZodISODateTime>;
|
|
316
|
+
}, z.core.$strip>>;
|
|
317
|
+
scheduledChange: z.ZodNullable<z.ZodObject<{
|
|
318
|
+
planCode: z.ZodString;
|
|
319
|
+
interval: z.ZodEnum<{
|
|
320
|
+
month: "month";
|
|
321
|
+
year: "year";
|
|
322
|
+
}>;
|
|
323
|
+
effectiveAt: z.ZodISODateTime;
|
|
324
|
+
amountMinor: z.ZodOptional<z.ZodNumber>;
|
|
325
|
+
}, z.core.$strip>>;
|
|
326
|
+
}, z.core.$strip>>>;
|
|
327
|
+
openInvoices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
328
|
+
id: z.ZodUUID;
|
|
329
|
+
subscriptionId: z.ZodNullable<z.ZodUUID>;
|
|
330
|
+
billingReason: z.ZodEnum<{
|
|
331
|
+
subscription_create: "subscription_create";
|
|
332
|
+
subscription_cycle: "subscription_cycle";
|
|
333
|
+
subscription_update: "subscription_update";
|
|
334
|
+
purchase: "purchase";
|
|
335
|
+
manual: "manual";
|
|
336
|
+
}>;
|
|
337
|
+
totalMinor: z.ZodNumber;
|
|
338
|
+
currency: z.ZodString;
|
|
339
|
+
dueAt: z.ZodISODateTime;
|
|
340
|
+
}, z.core.$strip>>>;
|
|
341
|
+
benefits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
342
|
+
code: z.ZodNullable<z.ZodString>;
|
|
343
|
+
type: z.ZodString;
|
|
344
|
+
properties: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
345
|
+
source: z.ZodString;
|
|
346
|
+
grantedAt: z.ZodISODateTime;
|
|
347
|
+
}, z.core.$strip>>>;
|
|
348
|
+
meters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
349
|
+
includedUnits: z.ZodNullable<z.ZodNumber>;
|
|
350
|
+
billable: z.ZodBoolean;
|
|
351
|
+
standing: z.ZodEnum<{
|
|
352
|
+
ok: "ok";
|
|
353
|
+
low: "low";
|
|
354
|
+
exhausted: "exhausted";
|
|
355
|
+
}>;
|
|
356
|
+
}, z.core.$strip>>>;
|
|
231
357
|
}, z.core.$strip>;
|
|
232
358
|
type AccountState = z.infer<typeof AccountStateSchema>;
|
|
233
359
|
declare const AccountSchema: z.ZodObject<{
|
|
@@ -263,6 +389,11 @@ declare const AccountSchema: z.ZodObject<{
|
|
|
263
389
|
cancelAt: z.ZodNullable<z.ZodISODateTime>;
|
|
264
390
|
}, z.core.$strip>>;
|
|
265
391
|
}, z.core.$strip>;
|
|
392
|
+
notificationEmails: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
393
|
+
locale: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
394
|
+
tr: "tr";
|
|
395
|
+
en: "en";
|
|
396
|
+
}>>>;
|
|
266
397
|
}, z.core.$strip>;
|
|
267
398
|
type Account = z.infer<typeof AccountSchema>;
|
|
268
399
|
declare const AccountDeleteResponseSchema: z.ZodObject<{
|
|
@@ -313,6 +444,7 @@ declare const EVENT_DETAIL_SCHEMAS: {
|
|
|
313
444
|
paymentId: z.ZodNullable<z.ZodUUID>;
|
|
314
445
|
attempt: z.ZodNumber;
|
|
315
446
|
nextRetryAt: z.ZodNullable<z.ZodISODateTime>;
|
|
447
|
+
invoiceId: z.ZodOptional<z.ZodUUID>;
|
|
316
448
|
subscriptionId: z.ZodUUID;
|
|
317
449
|
}, z.core.$strip>;
|
|
318
450
|
readonly "subscription.suspended": z.ZodObject<{
|
|
@@ -372,6 +504,94 @@ declare const EVENT_DETAIL_SCHEMAS: {
|
|
|
372
504
|
deletedAt: z.ZodISODateTime;
|
|
373
505
|
actorRef: z.ZodNullable<z.ZodString>;
|
|
374
506
|
}, z.core.$strip>;
|
|
507
|
+
readonly "invoice.paid": z.ZodObject<{
|
|
508
|
+
invoiceId: z.ZodUUID;
|
|
509
|
+
subscriptionId: z.ZodNullable<z.ZodUUID>;
|
|
510
|
+
paymentId: z.ZodUUID;
|
|
511
|
+
billingReason: z.ZodNullable<z.ZodEnum<{
|
|
512
|
+
subscription_create: "subscription_create";
|
|
513
|
+
subscription_cycle: "subscription_cycle";
|
|
514
|
+
subscription_update: "subscription_update";
|
|
515
|
+
purchase: "purchase";
|
|
516
|
+
manual: "manual";
|
|
517
|
+
}>>;
|
|
518
|
+
totalMinor: z.ZodNumber;
|
|
519
|
+
currency: z.ZodString;
|
|
520
|
+
paidAt: z.ZodISODateTime;
|
|
521
|
+
}, z.core.$strip>;
|
|
522
|
+
readonly "benefit_grant.created": z.ZodObject<{
|
|
523
|
+
grantId: z.ZodUUID;
|
|
524
|
+
benefit: z.ZodObject<{
|
|
525
|
+
code: z.ZodNullable<z.ZodString>;
|
|
526
|
+
type: z.ZodString;
|
|
527
|
+
properties: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
528
|
+
source: z.ZodString;
|
|
529
|
+
grantedAt: z.ZodISODateTime;
|
|
530
|
+
}, z.core.$strip>;
|
|
531
|
+
}, z.core.$strip>;
|
|
532
|
+
readonly "benefit_grant.updated": z.ZodObject<{
|
|
533
|
+
previousProperties: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
534
|
+
grantId: z.ZodUUID;
|
|
535
|
+
benefit: z.ZodObject<{
|
|
536
|
+
code: z.ZodNullable<z.ZodString>;
|
|
537
|
+
type: z.ZodString;
|
|
538
|
+
properties: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
539
|
+
source: z.ZodString;
|
|
540
|
+
grantedAt: z.ZodISODateTime;
|
|
541
|
+
}, z.core.$strip>;
|
|
542
|
+
}, z.core.$strip>;
|
|
543
|
+
readonly "benefit_grant.revoked": z.ZodObject<{
|
|
544
|
+
revokedAt: z.ZodISODateTime;
|
|
545
|
+
grantId: z.ZodUUID;
|
|
546
|
+
benefit: z.ZodObject<{
|
|
547
|
+
code: z.ZodNullable<z.ZodString>;
|
|
548
|
+
type: z.ZodString;
|
|
549
|
+
properties: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
550
|
+
source: z.ZodString;
|
|
551
|
+
grantedAt: z.ZodISODateTime;
|
|
552
|
+
}, z.core.$strip>;
|
|
553
|
+
}, z.core.$strip>;
|
|
554
|
+
readonly "benefit_grant.cycled": z.ZodObject<{
|
|
555
|
+
periodStart: z.ZodISODateTime;
|
|
556
|
+
periodEnd: z.ZodISODateTime;
|
|
557
|
+
grantId: z.ZodUUID;
|
|
558
|
+
benefit: z.ZodObject<{
|
|
559
|
+
code: z.ZodNullable<z.ZodString>;
|
|
560
|
+
type: z.ZodString;
|
|
561
|
+
properties: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
562
|
+
source: z.ZodString;
|
|
563
|
+
grantedAt: z.ZodISODateTime;
|
|
564
|
+
}, z.core.$strip>;
|
|
565
|
+
}, z.core.$strip>;
|
|
566
|
+
readonly "meter.threshold_crossed": z.ZodObject<{
|
|
567
|
+
meter: z.ZodString;
|
|
568
|
+
standing: z.ZodEnum<{
|
|
569
|
+
ok: "ok";
|
|
570
|
+
low: "low";
|
|
571
|
+
exhausted: "exhausted";
|
|
572
|
+
}>;
|
|
573
|
+
previous: z.ZodEnum<{
|
|
574
|
+
ok: "ok";
|
|
575
|
+
low: "low";
|
|
576
|
+
exhausted: "exhausted";
|
|
577
|
+
}>;
|
|
578
|
+
periodStart: z.ZodISODateTime;
|
|
579
|
+
periodEnd: z.ZodISODateTime;
|
|
580
|
+
consumedUnits: z.ZodNumber;
|
|
581
|
+
creditedUnits: z.ZodNumber;
|
|
582
|
+
}, z.core.$strip>;
|
|
583
|
+
readonly "meter.period_closed": z.ZodObject<{
|
|
584
|
+
periodStart: z.ZodISODateTime;
|
|
585
|
+
periodEnd: z.ZodISODateTime;
|
|
586
|
+
subscriptionId: z.ZodNullable<z.ZodUUID>;
|
|
587
|
+
meters: z.ZodArray<z.ZodObject<{
|
|
588
|
+
meter: z.ZodString;
|
|
589
|
+
consumedUnits: z.ZodNumber;
|
|
590
|
+
creditedUnits: z.ZodNumber;
|
|
591
|
+
overageUnits: z.ZodNumber;
|
|
592
|
+
}, z.core.$strip>>;
|
|
593
|
+
meterChargeId: z.ZodNullable<z.ZodUUID>;
|
|
594
|
+
}, z.core.$strip>;
|
|
375
595
|
};
|
|
376
596
|
type EventType = keyof typeof EVENT_DETAIL_SCHEMAS;
|
|
377
597
|
/** Tüm event tipleri (yenileri dahil). */
|
|
@@ -383,9 +603,11 @@ declare const EVENT_TYPES: EventType[];
|
|
|
383
603
|
declare const LEGACY_EVENT_TYPES: readonly ["account.updated", "checkout.completed", "checkout.failed", "checkout.expired", "subscription.activated", "subscription.renewed", "subscription.payment_failed", "subscription.suspended", "subscription.reactivated", "subscription.cancel_scheduled", "subscription.canceled", "subscription.expired", "subscription.terminated", "invoice.created", "invoice.issued"];
|
|
384
604
|
type LegacyEventType = (typeof LEGACY_EVENT_TYPES)[number];
|
|
385
605
|
/** `account.state_changed.detail.cause` — bilinen değerler; küme açık. */
|
|
386
|
-
type AccountStateChangeCause = LegacyEventType | "account.upserted" | "billing_profile.updated" | "checkout.opened" | "checkout.initialize_failed" | "checkout.canceled" | "grant.created" | "grant.revoked" | "grant.window_applied" | "dunning.advanced" | "dunning_policy.updated" | "payment.recorded" | "catalog.synced" | "account.refreshed" | "grant.plan_set" | "resync" | "account.deleted" | (string & Record<never, never>);
|
|
387
|
-
type FullStateEventType = "account.state_changed" | "account.deleted";
|
|
606
|
+
type AccountStateChangeCause = LegacyEventType | "account.upserted" | "billing_profile.updated" | "checkout.opened" | "checkout.initialize_failed" | "checkout.canceled" | "grant.created" | "grant.revoked" | "grant.window_applied" | "dunning.advanced" | "dunning_policy.updated" | "payment.recorded" | "catalog.synced" | "account.refreshed" | "grant.plan_set" | "resync" | "account.deleted" | "invoice.paid" | "subscription.period_advanced" | "subscription.uncanceled" | "subscription.change_scheduled" | "invoice.waived" | "invoice.payment_reminder" | "meter.threshold_crossed" | "meter.period_rolled" | "credits.granted" | (string & Record<never, never>);
|
|
607
|
+
type FullStateEventType = "account.state_changed" | "account.deleted" | "invoice.paid" | "benefit_grant.created" | "benefit_grant.updated" | "benefit_grant.revoked" | "benefit_grant.cycled" | "meter.threshold_crossed" | "meter.period_closed";
|
|
388
608
|
type AccountSchemaOf<T extends EventType> = T extends FullStateEventType ? typeof AccountStateSchema : typeof EntitlementSnapshotSchema;
|
|
609
|
+
/** Event types whose `data.account` is the full `AccountState` (the others: the entitlement snapshot). */
|
|
610
|
+
declare const FULL_STATE_EVENT_TYPES: ReadonlySet<string>;
|
|
389
611
|
declare function envelope<T extends EventType>(type: T): z.ZodObject<{
|
|
390
612
|
id: z.ZodString;
|
|
391
613
|
type: z.ZodLiteral<T>;
|
|
@@ -432,6 +654,7 @@ declare function envelope<T extends EventType>(type: T): z.ZodObject<{
|
|
|
432
654
|
paymentId: z.ZodNullable<z.ZodUUID>;
|
|
433
655
|
attempt: z.ZodNumber;
|
|
434
656
|
nextRetryAt: z.ZodNullable<z.ZodISODateTime>;
|
|
657
|
+
invoiceId: z.ZodOptional<z.ZodUUID>;
|
|
435
658
|
subscriptionId: z.ZodUUID;
|
|
436
659
|
}, z.core.$strip>;
|
|
437
660
|
readonly "subscription.suspended": z.ZodObject<{
|
|
@@ -491,6 +714,94 @@ declare function envelope<T extends EventType>(type: T): z.ZodObject<{
|
|
|
491
714
|
deletedAt: z.ZodISODateTime;
|
|
492
715
|
actorRef: z.ZodNullable<z.ZodString>;
|
|
493
716
|
}, z.core.$strip>;
|
|
717
|
+
readonly "invoice.paid": z.ZodObject<{
|
|
718
|
+
invoiceId: z.ZodUUID;
|
|
719
|
+
subscriptionId: z.ZodNullable<z.ZodUUID>;
|
|
720
|
+
paymentId: z.ZodUUID;
|
|
721
|
+
billingReason: z.ZodNullable<z.ZodEnum<{
|
|
722
|
+
subscription_create: "subscription_create";
|
|
723
|
+
subscription_cycle: "subscription_cycle";
|
|
724
|
+
subscription_update: "subscription_update";
|
|
725
|
+
purchase: "purchase";
|
|
726
|
+
manual: "manual";
|
|
727
|
+
}>>;
|
|
728
|
+
totalMinor: z.ZodNumber;
|
|
729
|
+
currency: z.ZodString;
|
|
730
|
+
paidAt: z.ZodISODateTime;
|
|
731
|
+
}, z.core.$strip>;
|
|
732
|
+
readonly "benefit_grant.created": z.ZodObject<{
|
|
733
|
+
grantId: z.ZodUUID;
|
|
734
|
+
benefit: z.ZodObject<{
|
|
735
|
+
code: z.ZodNullable<z.ZodString>;
|
|
736
|
+
type: z.ZodString;
|
|
737
|
+
properties: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
738
|
+
source: z.ZodString;
|
|
739
|
+
grantedAt: z.ZodISODateTime;
|
|
740
|
+
}, z.core.$strip>;
|
|
741
|
+
}, z.core.$strip>;
|
|
742
|
+
readonly "benefit_grant.updated": z.ZodObject<{
|
|
743
|
+
previousProperties: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
744
|
+
grantId: z.ZodUUID;
|
|
745
|
+
benefit: z.ZodObject<{
|
|
746
|
+
code: z.ZodNullable<z.ZodString>;
|
|
747
|
+
type: z.ZodString;
|
|
748
|
+
properties: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
749
|
+
source: z.ZodString;
|
|
750
|
+
grantedAt: z.ZodISODateTime;
|
|
751
|
+
}, z.core.$strip>;
|
|
752
|
+
}, z.core.$strip>;
|
|
753
|
+
readonly "benefit_grant.revoked": z.ZodObject<{
|
|
754
|
+
revokedAt: z.ZodISODateTime;
|
|
755
|
+
grantId: z.ZodUUID;
|
|
756
|
+
benefit: z.ZodObject<{
|
|
757
|
+
code: z.ZodNullable<z.ZodString>;
|
|
758
|
+
type: z.ZodString;
|
|
759
|
+
properties: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
760
|
+
source: z.ZodString;
|
|
761
|
+
grantedAt: z.ZodISODateTime;
|
|
762
|
+
}, z.core.$strip>;
|
|
763
|
+
}, z.core.$strip>;
|
|
764
|
+
readonly "benefit_grant.cycled": z.ZodObject<{
|
|
765
|
+
periodStart: z.ZodISODateTime;
|
|
766
|
+
periodEnd: z.ZodISODateTime;
|
|
767
|
+
grantId: z.ZodUUID;
|
|
768
|
+
benefit: z.ZodObject<{
|
|
769
|
+
code: z.ZodNullable<z.ZodString>;
|
|
770
|
+
type: z.ZodString;
|
|
771
|
+
properties: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
772
|
+
source: z.ZodString;
|
|
773
|
+
grantedAt: z.ZodISODateTime;
|
|
774
|
+
}, z.core.$strip>;
|
|
775
|
+
}, z.core.$strip>;
|
|
776
|
+
readonly "meter.threshold_crossed": z.ZodObject<{
|
|
777
|
+
meter: z.ZodString;
|
|
778
|
+
standing: z.ZodEnum<{
|
|
779
|
+
ok: "ok";
|
|
780
|
+
low: "low";
|
|
781
|
+
exhausted: "exhausted";
|
|
782
|
+
}>;
|
|
783
|
+
previous: z.ZodEnum<{
|
|
784
|
+
ok: "ok";
|
|
785
|
+
low: "low";
|
|
786
|
+
exhausted: "exhausted";
|
|
787
|
+
}>;
|
|
788
|
+
periodStart: z.ZodISODateTime;
|
|
789
|
+
periodEnd: z.ZodISODateTime;
|
|
790
|
+
consumedUnits: z.ZodNumber;
|
|
791
|
+
creditedUnits: z.ZodNumber;
|
|
792
|
+
}, z.core.$strip>;
|
|
793
|
+
readonly "meter.period_closed": z.ZodObject<{
|
|
794
|
+
periodStart: z.ZodISODateTime;
|
|
795
|
+
periodEnd: z.ZodISODateTime;
|
|
796
|
+
subscriptionId: z.ZodNullable<z.ZodUUID>;
|
|
797
|
+
meters: z.ZodArray<z.ZodObject<{
|
|
798
|
+
meter: z.ZodString;
|
|
799
|
+
consumedUnits: z.ZodNumber;
|
|
800
|
+
creditedUnits: z.ZodNumber;
|
|
801
|
+
overageUnits: z.ZodNumber;
|
|
802
|
+
}, z.core.$strip>>;
|
|
803
|
+
meterChargeId: z.ZodNullable<z.ZodUUID>;
|
|
804
|
+
}, z.core.$strip>;
|
|
494
805
|
}[T];
|
|
495
806
|
}, z.core.$strip>;
|
|
496
807
|
}, z.core.$strip>;
|
|
@@ -534,4 +845,4 @@ declare const PingSchema: z.ZodObject<{
|
|
|
534
845
|
}, z.core.$strip>;
|
|
535
846
|
type Ping = z.infer<typeof PingSchema>;
|
|
536
847
|
//#endregion
|
|
537
|
-
export {
|
|
848
|
+
export { EntitlementSnapshot as $, AccountMeterState as A, AccountScheduledChange as B, Account as C, AccountDunningStateSchema as D, AccountDunningState as E, AccountOpenCheckoutSchema as F, AccountSubscriptionState as G, AccountSchema as H, AccountOpenInvoice as I, AccountUpsertInputSchema as J, AccountSubscriptionStateSchema as K, AccountOpenInvoiceSchema as L, AccountMetersState as M, AccountMetersStateSchema as N, AccountInclude as O, AccountOpenCheckout as P, BillingProfileSchema as Q, AccountProfileState as R, AccessStateSchema as S, AccountDeleteResponseSchema as T, AccountState as U, AccountScheduledChangeSchema as V, AccountStateSchema as W, BillingProfileInput as X, BillingProfile as Y, BillingProfileKindSchema as Z, Ping as _, BillingEvent as a, ACCOUNT_INCLUDES as b, EVENT_DETAIL_SCHEMAS as c, EventIdSchema as d, EntitlementSnapshotSchema as et, EventType as f, PING_EVENT_TYPE as g, LegacyEventType as h, ApiVersionSchema as i, SubscriptionSummarySchema as it, AccountMeterStateSchema as j, AccountLocaleSchema as k, EVENT_TYPES as l, LEGACY_EVENT_TYPES as m, AnyBillingEvent as n, SubscriptionStatusSchema as nt, BillingEventOf as o, FULL_STATE_EVENT_TYPES as p, AccountUpsertInput as q, AnyBillingEventSchema as r, SubscriptionSummary as rt, BillingEventSchema as s, AccountStateChangeCause as t, SubscriptionStatus as tt, EventDetail as u, PingSchema as v, AccountDeleteResponse as w, AccessState as x, isEventType as y, AccountProfileStateSchema as z };
|