zpan-cloud-sdk 1.0.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.
@@ -0,0 +1,3111 @@
1
+ import { hc } from 'hono/client';
2
+ import { z } from 'zod';
3
+ import { S as StoreType, a as StoreStatus, P as ProductType, D as Deliverable, C as CommerceOrder, b as PaymentProvider, c as adminUserListQuerySchema, d as adminUserPatchSchema, e as billingPortalSessionSchema, f as createOrderSchema, g as createProductSchema, h as giftCardCampaignCreateSchema, i as giftCardCampaignListQuerySchema, j as giftCardCreateSchema, k as giftCardListQuerySchema, l as giftCardPatchSchema, o as orderPatchSchema, p as pairingActionSchema, m as createPairingSchema, n as paymentSchema, q as productListQuerySchema, r as CommerceProduct, s as CommerceStore, t as storePatchSchema, u as updateProductSchema, v as usageEventCreateSchema, w as walletRedemptionSchema } from './schemas-R0lkMmfq.js';
4
+ export { x as CommerceOrderItem, y as CommercePayment, z as CreateOrderRequest, A as CreatePaymentRequest, B as CreateProductRequest, E as ProductMetadata, F as ProductPrice, U as UpdateProductRequest, G as accountBillingQuerySchema, H as accountUsagePeriodSchema, I as accountUsageQuerySchema, J as deliverableSchema, K as orderListQuerySchema, L as paginationQuerySchema, M as productMetadataSchema, N as productPriceSchema } from './schemas-R0lkMmfq.js';
5
+ import * as hono_utils_types from 'hono/utils/types';
6
+ import * as hono_hono_base from 'hono/hono-base';
7
+ import * as hono_utils_http_status from 'hono/utils/http-status';
8
+ import * as hono_types from 'hono/types';
9
+
10
+ type UsageResource = 'traffic_egress';
11
+ interface UsageResourceSummary {
12
+ used: number;
13
+ included: number;
14
+ overageBytes: number;
15
+ overageGb: number;
16
+ }
17
+ interface UsageSummary {
18
+ period: string;
19
+ resources: Record<UsageResource, UsageResourceSummary>;
20
+ nextReset: string;
21
+ }
22
+
23
+ type MembershipTier = 'none' | 'silver' | 'gold' | 'premier';
24
+ type PairingStatus = 'pending' | 'approved' | 'denied' | 'expired';
25
+ interface LicenseAssertion {
26
+ type: 'zpan.license';
27
+ issuer: string;
28
+ subject: string;
29
+ accountId: string;
30
+ instanceId: string;
31
+ storeId: string;
32
+ edition: 'pro';
33
+ authorizedHosts: string[];
34
+ licenseValidUntil: number;
35
+ issuedAt: number;
36
+ notBefore: number;
37
+ expiresAt: number;
38
+ }
39
+
40
+ interface AccountOverview {
41
+ activeLicenses: number;
42
+ membershipTier: MembershipTier;
43
+ latestBillingDate: string | null;
44
+ }
45
+ interface BoundLicense {
46
+ id: string;
47
+ name: string;
48
+ url: string;
49
+ version: string | null;
50
+ plan: string;
51
+ lastSeenAt: string | null;
52
+ }
53
+ type MembershipViewState = 'inactive' | 'active' | 'renewal_due' | 'expired';
54
+ type MembershipStatus = 'inactive' | 'active' | 'expired';
55
+ type MembershipPrimaryAction = 'subscribe' | 'renew' | 'manage';
56
+ interface MembershipStripeChannel {
57
+ status: string;
58
+ billingInterval: string | null;
59
+ renewsAt: string | null;
60
+ cancelAtPeriodEnd: boolean;
61
+ }
62
+ interface MembershipOverview {
63
+ state: MembershipViewState;
64
+ tier: MembershipTier;
65
+ membershipStatus: MembershipStatus;
66
+ expiresAt: string | null;
67
+ cumulativeMonths: number;
68
+ proIncluded: boolean;
69
+ primaryAction: MembershipPrimaryAction;
70
+ stripeSubscription: MembershipStripeChannel | null;
71
+ channel: 'stripe' | 'gift';
72
+ }
73
+ type BillingOrderStatus = 'pending' | 'paid' | 'fulfilled' | 'failed' | 'canceled' | 'refunded';
74
+ type BillingOrderPaymentStatus = 'unpaid' | 'pending' | 'paid' | 'failed' | 'refunded' | 'canceled';
75
+ type BillingOrderFulfillmentStatus = 'pending' | 'fulfilled' | 'failed' | 'canceled';
76
+ type BillingRecordKind = 'store_item' | 'store_subscription' | 'mixed_order';
77
+ interface BillingRecordItem {
78
+ name: string;
79
+ productType: string;
80
+ quantity: number;
81
+ deliverable: Record<string, unknown>;
82
+ recurring: boolean;
83
+ }
84
+ interface BillingRecord {
85
+ id: string;
86
+ title: string;
87
+ kind: BillingRecordKind;
88
+ items: BillingRecordItem[];
89
+ orderStatus: BillingOrderStatus;
90
+ paymentStatus: BillingOrderPaymentStatus;
91
+ fulfillmentStatus: BillingOrderFulfillmentStatus;
92
+ amountLabel: string | null;
93
+ occurredAt: string;
94
+ paidAt: string | null;
95
+ fulfilledAt: string | null;
96
+ }
97
+ interface BillingSummary {
98
+ totalRecords: number;
99
+ stripeRecords: number;
100
+ walletBalanceAmount: number;
101
+ walletCurrency: string | null;
102
+ latestAt: string | null;
103
+ }
104
+ interface WalletBalance {
105
+ id: string;
106
+ walletId: string | null;
107
+ storeId: string;
108
+ customerId: string | null;
109
+ currency: string;
110
+ availableAmount: number;
111
+ pendingAmount: number;
112
+ stripeCustomerId: string | null;
113
+ updatedAt: string;
114
+ }
115
+ interface WalletLedgerEntry {
116
+ id: string;
117
+ walletId: string | null;
118
+ storeId: string;
119
+ customerId: string | null;
120
+ currency: string;
121
+ amount: number;
122
+ direction: 'credit' | 'debit';
123
+ status: 'posted' | 'pending' | 'released' | 'refunded';
124
+ sourceType: 'gift_card_redemption' | 'order_payment' | 'stripe_invoice' | 'adjustment' | 'refund';
125
+ sourceId: string | null;
126
+ orderId: string | null;
127
+ paymentId: string | null;
128
+ stripeCustomerBalanceTransactionId: string | null;
129
+ createdAt: string;
130
+ }
131
+ interface OffsetPage<T> {
132
+ items: T[];
133
+ total: number;
134
+ limit: number;
135
+ offset: number;
136
+ }
137
+ interface AccountWallet extends OffsetPage<WalletLedgerEntry> {
138
+ balances: WalletBalance[];
139
+ }
140
+ interface BillingOverview {
141
+ summary: BillingSummary;
142
+ walletBalances: WalletBalance[];
143
+ walletLedger: OffsetPage<WalletLedgerEntry>;
144
+ items: BillingRecord[];
145
+ total: number;
146
+ limit: number;
147
+ offset: number;
148
+ }
149
+
150
+ type StoreGiftCard = {
151
+ id: string;
152
+ storeId: string;
153
+ campaignId: string | null;
154
+ code: string | null;
155
+ codeLast4: string;
156
+ amount: number;
157
+ currency: string;
158
+ status: 'active' | 'redeemed' | 'disabled' | 'expired' | 'revoked';
159
+ expiresAt: string | null;
160
+ createdAt: string;
161
+ updatedAt: string;
162
+ disabledAt: string | null;
163
+ revokedAt: string | null;
164
+ createdByAdmin: string;
165
+ };
166
+ type GiftCardCampaign = {
167
+ id: string;
168
+ storeId: string;
169
+ name: string;
170
+ status: 'active' | 'disabled' | 'ended';
171
+ startsAt: string | null;
172
+ expiresAt: string | null;
173
+ createdByAdmin: string;
174
+ createdAt: string;
175
+ updatedAt: string;
176
+ };
177
+ type CreateGiftCardRequest = {
178
+ amount: number;
179
+ currency: string;
180
+ expires_at?: string | null;
181
+ campaignId?: string | null;
182
+ };
183
+ type CreateGiftCardsRequest = CreateGiftCardRequest & {
184
+ count?: number;
185
+ };
186
+
187
+ declare const pairingsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
188
+ "/": {
189
+ $post: {
190
+ input: {
191
+ json: {
192
+ instanceId: string;
193
+ instanceName: string;
194
+ instanceHost: string;
195
+ };
196
+ };
197
+ output: {
198
+ code: string;
199
+ pairingUrl: string;
200
+ expiresAt: string;
201
+ };
202
+ outputFormat: "json";
203
+ status: 201;
204
+ };
205
+ };
206
+ } & {
207
+ "/:code/preview": {
208
+ $get: {
209
+ input: {
210
+ param: {
211
+ code: string;
212
+ };
213
+ };
214
+ output: {
215
+ licenseId: string;
216
+ licenseName: string;
217
+ licenseHost: string;
218
+ };
219
+ outputFormat: "json";
220
+ status: hono_utils_http_status.ContentfulStatusCode;
221
+ };
222
+ };
223
+ } & {
224
+ "/:code": {
225
+ $get: {
226
+ input: {
227
+ param: {
228
+ code: string;
229
+ };
230
+ };
231
+ output: {
232
+ status: Extract<PairingStatus, "pending" | "denied" | "expired">;
233
+ } | {
234
+ status: "approved";
235
+ refreshToken: string;
236
+ certificate: string;
237
+ binding: {
238
+ id: string;
239
+ instanceId: string;
240
+ storeId: string;
241
+ authorizedHosts: string[];
242
+ };
243
+ account: {
244
+ id: string;
245
+ email: string;
246
+ };
247
+ };
248
+ outputFormat: "json";
249
+ status: hono_utils_http_status.ContentfulStatusCode;
250
+ };
251
+ };
252
+ } & {
253
+ "/:code": {
254
+ $patch: {
255
+ input: {
256
+ json: {
257
+ action: "approve" | "deny";
258
+ };
259
+ } & {
260
+ param: {
261
+ code: string;
262
+ };
263
+ };
264
+ output: {
265
+ status: "approved" | "denied";
266
+ };
267
+ outputFormat: "json";
268
+ status: hono_utils_http_status.ContentfulStatusCode;
269
+ };
270
+ };
271
+ }, "/", "/:code">;
272
+ declare const entitlementsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
273
+ "/": {
274
+ $post: {
275
+ input: {};
276
+ output: {
277
+ certificate: string;
278
+ refreshToken: string;
279
+ nextRefreshAfter: string;
280
+ binding: {
281
+ id: string;
282
+ instanceId: string;
283
+ storeId: string;
284
+ authorizedHosts: string[];
285
+ };
286
+ account: {
287
+ id: string;
288
+ email: string;
289
+ };
290
+ };
291
+ outputFormat: "json";
292
+ status: 201;
293
+ };
294
+ };
295
+ }, "/", "/">;
296
+ declare const licensesRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
297
+ "/": {
298
+ $get: {
299
+ input: {
300
+ query: {
301
+ limit?: string | undefined;
302
+ offset?: string | undefined;
303
+ };
304
+ };
305
+ output: {
306
+ items: {
307
+ id: string;
308
+ name: string;
309
+ url: string;
310
+ version: string | null;
311
+ plan: string;
312
+ lastSeenAt: string | null;
313
+ }[];
314
+ total: number;
315
+ limit: number;
316
+ offset: number;
317
+ };
318
+ outputFormat: "json";
319
+ status: hono_utils_http_status.ContentfulStatusCode;
320
+ };
321
+ };
322
+ } & {
323
+ "/:id": {
324
+ $delete: {
325
+ input: {
326
+ param: {
327
+ id: string;
328
+ };
329
+ };
330
+ output: null;
331
+ outputFormat: "body";
332
+ status: 204;
333
+ };
334
+ };
335
+ }, "/", "/:id">;
336
+ declare const accountOverviewRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
337
+ "/": {
338
+ $get: {
339
+ input: {};
340
+ output: {
341
+ activeLicenses: number;
342
+ membershipTier: MembershipTier;
343
+ latestBillingDate: string | null;
344
+ };
345
+ outputFormat: "json";
346
+ status: hono_utils_http_status.ContentfulStatusCode;
347
+ };
348
+ };
349
+ }, "/", "/">;
350
+ declare const accountMembershipRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
351
+ "/": {
352
+ $get: {
353
+ input: {};
354
+ output: {
355
+ state: MembershipViewState;
356
+ tier: MembershipTier;
357
+ membershipStatus: MembershipStatus;
358
+ expiresAt: string | null;
359
+ cumulativeMonths: number;
360
+ proIncluded: boolean;
361
+ primaryAction: MembershipPrimaryAction;
362
+ stripeSubscription: {
363
+ status: string;
364
+ billingInterval: string | null;
365
+ renewsAt: string | null;
366
+ cancelAtPeriodEnd: boolean;
367
+ } | null;
368
+ channel: "stripe" | "gift";
369
+ };
370
+ outputFormat: "json";
371
+ status: hono_utils_http_status.ContentfulStatusCode;
372
+ };
373
+ };
374
+ }, "/", "/">;
375
+ declare const accountBillingRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
376
+ "/": {
377
+ $get: {
378
+ input: {
379
+ query: {
380
+ limit?: string | undefined;
381
+ offset?: string | undefined;
382
+ };
383
+ };
384
+ output: {
385
+ summary: {
386
+ totalRecords: number;
387
+ stripeRecords: number;
388
+ walletBalanceAmount: number;
389
+ walletCurrency: string | null;
390
+ latestAt: string | null;
391
+ };
392
+ walletBalances: {
393
+ id: string;
394
+ walletId: string | null;
395
+ storeId: string;
396
+ customerId: string | null;
397
+ currency: string;
398
+ availableAmount: number;
399
+ pendingAmount: number;
400
+ stripeCustomerId: string | null;
401
+ updatedAt: string;
402
+ }[];
403
+ walletLedger: {
404
+ items: {
405
+ id: string;
406
+ walletId: string | null;
407
+ storeId: string;
408
+ customerId: string | null;
409
+ currency: string;
410
+ amount: number;
411
+ direction: "credit" | "debit";
412
+ status: "posted" | "pending" | "released" | "refunded";
413
+ sourceType: "gift_card_redemption" | "order_payment" | "stripe_invoice" | "adjustment" | "refund";
414
+ sourceId: string | null;
415
+ orderId: string | null;
416
+ paymentId: string | null;
417
+ stripeCustomerBalanceTransactionId: string | null;
418
+ createdAt: string;
419
+ }[];
420
+ total: number;
421
+ limit: number;
422
+ offset: number;
423
+ };
424
+ items: {
425
+ id: string;
426
+ title: string;
427
+ kind: BillingRecordKind;
428
+ items: {
429
+ name: string;
430
+ productType: string;
431
+ quantity: number;
432
+ deliverable: {
433
+ [x: string]: hono_utils_types.JSONValue;
434
+ };
435
+ recurring: boolean;
436
+ }[];
437
+ orderStatus: BillingOrderStatus;
438
+ paymentStatus: BillingOrderPaymentStatus;
439
+ fulfillmentStatus: BillingOrderFulfillmentStatus;
440
+ amountLabel: string | null;
441
+ occurredAt: string;
442
+ paidAt: string | null;
443
+ fulfilledAt: string | null;
444
+ }[];
445
+ total: number;
446
+ limit: number;
447
+ offset: number;
448
+ };
449
+ outputFormat: "json";
450
+ status: hono_utils_http_status.ContentfulStatusCode;
451
+ };
452
+ };
453
+ }, "/", "/">;
454
+ declare const accountUsageRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
455
+ "/usage": {
456
+ $get: {
457
+ input: {
458
+ query: {
459
+ customerId: string | string[];
460
+ };
461
+ };
462
+ output: {
463
+ period: string;
464
+ resources: {
465
+ traffic_egress: {
466
+ used: number;
467
+ included: number;
468
+ overageBytes: number;
469
+ overageGb: number;
470
+ };
471
+ };
472
+ nextReset: string;
473
+ };
474
+ outputFormat: "json";
475
+ status: hono_utils_http_status.ContentfulStatusCode;
476
+ };
477
+ };
478
+ } & {
479
+ "/usage/:period": {
480
+ $get: {
481
+ input: {
482
+ query: {
483
+ customerId: string | string[];
484
+ };
485
+ } & {
486
+ param: {
487
+ period: string;
488
+ };
489
+ };
490
+ output: {
491
+ period: string;
492
+ resources: {
493
+ traffic_egress: {
494
+ used: number;
495
+ included: number;
496
+ overageBytes: number;
497
+ overageGb: number;
498
+ };
499
+ };
500
+ nextReset: string;
501
+ };
502
+ outputFormat: "json";
503
+ status: hono_utils_http_status.ContentfulStatusCode;
504
+ };
505
+ };
506
+ }, "/", "/usage/:period">;
507
+ declare const accountWalletRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
508
+ "/": {
509
+ $get: {
510
+ input: {
511
+ query: {
512
+ limit?: string | undefined;
513
+ offset?: string | undefined;
514
+ };
515
+ };
516
+ output: {
517
+ balances: {
518
+ id: string;
519
+ walletId: string | null;
520
+ storeId: string;
521
+ customerId: string | null;
522
+ currency: string;
523
+ availableAmount: number;
524
+ pendingAmount: number;
525
+ stripeCustomerId: string | null;
526
+ updatedAt: string;
527
+ }[];
528
+ items: {
529
+ id: string;
530
+ walletId: string | null;
531
+ storeId: string;
532
+ customerId: string | null;
533
+ currency: string;
534
+ amount: number;
535
+ direction: "credit" | "debit";
536
+ status: "posted" | "pending" | "released" | "refunded";
537
+ sourceType: "gift_card_redemption" | "order_payment" | "stripe_invoice" | "adjustment" | "refund";
538
+ sourceId: string | null;
539
+ orderId: string | null;
540
+ paymentId: string | null;
541
+ stripeCustomerBalanceTransactionId: string | null;
542
+ createdAt: string;
543
+ }[];
544
+ total: number;
545
+ limit: number;
546
+ offset: number;
547
+ };
548
+ outputFormat: "json";
549
+ status: hono_utils_http_status.ContentfulStatusCode;
550
+ };
551
+ };
552
+ } & {
553
+ "/redeem": {
554
+ $post: {
555
+ input: {
556
+ json: {
557
+ codes: string[];
558
+ };
559
+ };
560
+ output: {
561
+ redeemedAmount: number;
562
+ currency: string | null;
563
+ failures: {
564
+ code: string;
565
+ error: string;
566
+ }[];
567
+ };
568
+ outputFormat: "json";
569
+ status: hono_utils_http_status.ContentfulStatusCode;
570
+ };
571
+ };
572
+ }, "/", "/redeem">;
573
+ declare const storeProductsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
574
+ "/": {
575
+ $get: {
576
+ input: {
577
+ query: {
578
+ type?: string | undefined;
579
+ limit?: string | undefined;
580
+ offset?: string | undefined;
581
+ status?: string | undefined;
582
+ };
583
+ };
584
+ output: {
585
+ items: {
586
+ id: string;
587
+ storeId: string;
588
+ type: ProductType;
589
+ name: string;
590
+ description: string | null;
591
+ active: boolean;
592
+ sortOrder: number;
593
+ metadata: {
594
+ deliverable: {
595
+ [x: string]: hono_utils_types.JSONValue;
596
+ };
597
+ };
598
+ prices: {
599
+ id?: string | undefined;
600
+ currency: string;
601
+ amount: number;
602
+ lookupKey?: string | null | undefined;
603
+ nickname?: string | null | undefined;
604
+ recurring?: {
605
+ interval: "day" | "week" | "month" | "year";
606
+ intervalCount: number;
607
+ usageType?: "licensed" | "metered" | undefined;
608
+ } | null | undefined;
609
+ metadata?: {
610
+ [x: string]: string;
611
+ } | undefined;
612
+ }[];
613
+ createdAt: string;
614
+ updatedAt: string;
615
+ }[];
616
+ total: number;
617
+ limit: number;
618
+ offset: number;
619
+ };
620
+ outputFormat: "json";
621
+ status: hono_utils_http_status.ContentfulStatusCode;
622
+ };
623
+ };
624
+ } & {
625
+ "/": {
626
+ $post: {
627
+ input: {
628
+ json: {
629
+ type: "store_item";
630
+ name: string;
631
+ metadata: {
632
+ deliverable: Deliverable;
633
+ };
634
+ prices: {
635
+ currency: string;
636
+ amount: number;
637
+ id?: string | undefined;
638
+ lookupKey?: string | null | undefined;
639
+ nickname?: string | null | undefined;
640
+ recurring?: {
641
+ interval: "day" | "week" | "month" | "year";
642
+ intervalCount: number;
643
+ usageType?: "licensed" | "metered" | undefined;
644
+ } | null | undefined;
645
+ metadata?: Record<string, string> | undefined;
646
+ }[];
647
+ description?: string | null | undefined;
648
+ active?: boolean | undefined;
649
+ sortOrder?: number | undefined;
650
+ };
651
+ };
652
+ output: {
653
+ id: string;
654
+ storeId: string;
655
+ type: ProductType;
656
+ name: string;
657
+ description: string | null;
658
+ active: boolean;
659
+ sortOrder: number;
660
+ metadata: {
661
+ deliverable: {
662
+ [x: string]: hono_utils_types.JSONValue;
663
+ };
664
+ };
665
+ prices: {
666
+ id?: string | undefined;
667
+ currency: string;
668
+ amount: number;
669
+ lookupKey?: string | null | undefined;
670
+ nickname?: string | null | undefined;
671
+ recurring?: {
672
+ interval: "day" | "week" | "month" | "year";
673
+ intervalCount: number;
674
+ usageType?: "licensed" | "metered" | undefined;
675
+ } | null | undefined;
676
+ metadata?: {
677
+ [x: string]: string;
678
+ } | undefined;
679
+ }[];
680
+ createdAt: string;
681
+ updatedAt: string;
682
+ };
683
+ outputFormat: "json";
684
+ status: 201;
685
+ };
686
+ };
687
+ } & {
688
+ "/:productId": {
689
+ $get: {
690
+ input: {
691
+ param: {
692
+ productId: string;
693
+ };
694
+ };
695
+ output: {
696
+ id: string;
697
+ storeId: string;
698
+ type: ProductType;
699
+ name: string;
700
+ description: string | null;
701
+ active: boolean;
702
+ sortOrder: number;
703
+ metadata: {
704
+ deliverable: {
705
+ [x: string]: hono_utils_types.JSONValue;
706
+ };
707
+ };
708
+ prices: {
709
+ id?: string | undefined;
710
+ currency: string;
711
+ amount: number;
712
+ lookupKey?: string | null | undefined;
713
+ nickname?: string | null | undefined;
714
+ recurring?: {
715
+ interval: "day" | "week" | "month" | "year";
716
+ intervalCount: number;
717
+ usageType?: "licensed" | "metered" | undefined;
718
+ } | null | undefined;
719
+ metadata?: {
720
+ [x: string]: string;
721
+ } | undefined;
722
+ }[];
723
+ createdAt: string;
724
+ updatedAt: string;
725
+ };
726
+ outputFormat: "json";
727
+ status: hono_utils_http_status.ContentfulStatusCode;
728
+ };
729
+ };
730
+ } & {
731
+ "/:productId": {
732
+ $patch: {
733
+ input: {
734
+ json: {
735
+ type?: "store_item" | undefined;
736
+ name?: string | undefined;
737
+ description?: string | null | undefined;
738
+ active?: boolean | undefined;
739
+ sortOrder?: number | undefined;
740
+ metadata?: {
741
+ deliverable: Deliverable;
742
+ } | undefined;
743
+ prices?: {
744
+ currency: string;
745
+ amount: number;
746
+ id?: string | undefined;
747
+ lookupKey?: string | null | undefined;
748
+ nickname?: string | null | undefined;
749
+ recurring?: {
750
+ interval: "day" | "week" | "month" | "year";
751
+ intervalCount: number;
752
+ usageType?: "licensed" | "metered" | undefined;
753
+ } | null | undefined;
754
+ metadata?: Record<string, string> | undefined;
755
+ }[] | undefined;
756
+ };
757
+ } & {
758
+ param: {
759
+ productId: string;
760
+ };
761
+ };
762
+ output: {
763
+ id: string;
764
+ storeId: string;
765
+ type: ProductType;
766
+ name: string;
767
+ description: string | null;
768
+ active: boolean;
769
+ sortOrder: number;
770
+ metadata: {
771
+ deliverable: {
772
+ [x: string]: hono_utils_types.JSONValue;
773
+ };
774
+ };
775
+ prices: {
776
+ id?: string | undefined;
777
+ currency: string;
778
+ amount: number;
779
+ lookupKey?: string | null | undefined;
780
+ nickname?: string | null | undefined;
781
+ recurring?: {
782
+ interval: "day" | "week" | "month" | "year";
783
+ intervalCount: number;
784
+ usageType?: "licensed" | "metered" | undefined;
785
+ } | null | undefined;
786
+ metadata?: {
787
+ [x: string]: string;
788
+ } | undefined;
789
+ }[];
790
+ createdAt: string;
791
+ updatedAt: string;
792
+ };
793
+ outputFormat: "json";
794
+ status: hono_utils_http_status.ContentfulStatusCode;
795
+ };
796
+ };
797
+ } & {
798
+ "/:productId": {
799
+ $delete: {
800
+ input: {
801
+ param: {
802
+ productId: string;
803
+ };
804
+ };
805
+ output: null;
806
+ outputFormat: "body";
807
+ status: 204;
808
+ };
809
+ };
810
+ }, "/", "/:productId">;
811
+ declare const storeGiftCardsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
812
+ "/campaigns": {
813
+ $get: {
814
+ input: {
815
+ query: {
816
+ limit?: string | undefined;
817
+ offset?: string | undefined;
818
+ status?: GiftCardCampaign["status"] | undefined;
819
+ };
820
+ };
821
+ output: {
822
+ items: {
823
+ id: string;
824
+ storeId: string;
825
+ name: string;
826
+ status: "active" | "disabled" | "ended";
827
+ startsAt: string | null;
828
+ expiresAt: string | null;
829
+ createdByAdmin: string;
830
+ createdAt: string;
831
+ updatedAt: string;
832
+ }[];
833
+ total: number;
834
+ limit: number;
835
+ offset: number;
836
+ };
837
+ outputFormat: "json";
838
+ status: hono_utils_http_status.ContentfulStatusCode;
839
+ };
840
+ };
841
+ } & {
842
+ "/campaigns": {
843
+ $post: {
844
+ input: {
845
+ json: {
846
+ name: string;
847
+ startsAt?: string | null | undefined;
848
+ expiresAt?: string | null | undefined;
849
+ };
850
+ };
851
+ output: {
852
+ id: string;
853
+ storeId: string;
854
+ name: string;
855
+ status: "active" | "disabled" | "ended";
856
+ startsAt: string | null;
857
+ expiresAt: string | null;
858
+ createdByAdmin: string;
859
+ createdAt: string;
860
+ updatedAt: string;
861
+ };
862
+ outputFormat: "json";
863
+ status: 201;
864
+ };
865
+ };
866
+ } & {
867
+ "/": {
868
+ $get: {
869
+ input: {
870
+ query: {
871
+ limit?: string | undefined;
872
+ offset?: string | undefined;
873
+ status?: StoreGiftCard["status"] | undefined;
874
+ campaignId?: string | undefined;
875
+ };
876
+ };
877
+ output: {
878
+ items: {
879
+ id: string;
880
+ storeId: string;
881
+ campaignId: string | null;
882
+ code: string | null;
883
+ codeLast4: string;
884
+ amount: number;
885
+ currency: string;
886
+ status: "active" | "redeemed" | "disabled" | "expired" | "revoked";
887
+ expiresAt: string | null;
888
+ createdAt: string;
889
+ updatedAt: string;
890
+ disabledAt: string | null;
891
+ revokedAt: string | null;
892
+ createdByAdmin: string;
893
+ }[];
894
+ total: number;
895
+ limit: number;
896
+ offset: number;
897
+ };
898
+ outputFormat: "json";
899
+ status: hono_utils_http_status.ContentfulStatusCode;
900
+ };
901
+ };
902
+ } & {
903
+ "/": {
904
+ $post: {
905
+ input: {
906
+ json: {
907
+ amount: number;
908
+ currency: string;
909
+ count: number;
910
+ expiresAt?: string | null | undefined;
911
+ campaignId?: string | null | undefined;
912
+ };
913
+ };
914
+ output: {
915
+ id: string;
916
+ storeId: string;
917
+ campaignId: string | null;
918
+ code: string | null;
919
+ codeLast4: string;
920
+ amount: number;
921
+ currency: string;
922
+ status: "active" | "redeemed" | "disabled" | "expired" | "revoked";
923
+ expiresAt: string | null;
924
+ createdAt: string;
925
+ updatedAt: string;
926
+ disabledAt: string | null;
927
+ revokedAt: string | null;
928
+ createdByAdmin: string;
929
+ }[];
930
+ outputFormat: "json";
931
+ status: 201;
932
+ };
933
+ };
934
+ } & {
935
+ "/:code": {
936
+ $get: {
937
+ input: {
938
+ param: {
939
+ code: string;
940
+ };
941
+ };
942
+ output: {
943
+ id: string;
944
+ storeId: string;
945
+ campaignId: string | null;
946
+ code: string | null;
947
+ codeLast4: string;
948
+ amount: number;
949
+ currency: string;
950
+ status: "active" | "redeemed" | "disabled" | "expired" | "revoked";
951
+ expiresAt: string | null;
952
+ createdAt: string;
953
+ updatedAt: string;
954
+ disabledAt: string | null;
955
+ revokedAt: string | null;
956
+ createdByAdmin: string;
957
+ };
958
+ outputFormat: "json";
959
+ status: hono_utils_http_status.ContentfulStatusCode;
960
+ };
961
+ };
962
+ } & {
963
+ "/:code": {
964
+ $patch: {
965
+ input: {
966
+ json: {
967
+ disabled?: boolean | undefined;
968
+ revoked?: true | undefined;
969
+ };
970
+ } & {
971
+ param: {
972
+ code: string;
973
+ };
974
+ };
975
+ output: null;
976
+ outputFormat: "body";
977
+ status: 204;
978
+ };
979
+ };
980
+ } & {
981
+ "/:code": {
982
+ $delete: {
983
+ input: {
984
+ param: {
985
+ code: string;
986
+ };
987
+ };
988
+ output: null;
989
+ outputFormat: "body";
990
+ status: 204;
991
+ };
992
+ };
993
+ }, "/", "/:code">;
994
+ declare const usageEventsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
995
+ "/": {
996
+ $post: {
997
+ input: {
998
+ json: {
999
+ resource: "traffic_egress";
1000
+ customerId: string;
1001
+ quantity?: number | undefined;
1002
+ bytes?: number | undefined;
1003
+ idempotencyKey?: string | undefined;
1004
+ eventId?: string | undefined;
1005
+ };
1006
+ };
1007
+ output: {
1008
+ resource: UsageResource;
1009
+ quantity: number;
1010
+ duplicate: boolean;
1011
+ };
1012
+ outputFormat: "json";
1013
+ status: 201;
1014
+ };
1015
+ };
1016
+ }, "/", "/">;
1017
+ declare const storeOrdersRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
1018
+ "/": {
1019
+ $get: {
1020
+ input: {
1021
+ query: {
1022
+ limit?: string | undefined;
1023
+ offset?: string | undefined;
1024
+ paymentStatus?: CommerceOrder["paymentStatus"] | undefined;
1025
+ fulfillmentStatus?: CommerceOrder["fulfillmentStatus"] | undefined;
1026
+ customerId?: string | undefined;
1027
+ };
1028
+ };
1029
+ output: {
1030
+ items: {
1031
+ id: string;
1032
+ storeId: string;
1033
+ buyerAccountId: string | null;
1034
+ target: {
1035
+ [x: string]: hono_utils_types.JSONValue;
1036
+ } | null;
1037
+ status: "pending" | "paid" | "fulfilled" | "failed" | "canceled" | "refunded";
1038
+ paymentStatus: "unpaid" | "pending" | "paid" | "failed" | "refunded" | "canceled";
1039
+ fulfillmentStatus: "pending" | "fulfilled" | "failed" | "canceled";
1040
+ subtotalAmount: number;
1041
+ discountAmount: number;
1042
+ totalAmount: number;
1043
+ currency: string;
1044
+ items: {
1045
+ id: string;
1046
+ orderId: string;
1047
+ productId: string;
1048
+ productType: string;
1049
+ name: string;
1050
+ description: string | null;
1051
+ quantity: number;
1052
+ unitAmount: number;
1053
+ totalAmount: number;
1054
+ fulfillmentPayload: {
1055
+ [x: string]: hono_utils_types.JSONValue;
1056
+ };
1057
+ }[];
1058
+ payments?: {
1059
+ id: string;
1060
+ orderId: string;
1061
+ provider: PaymentProvider;
1062
+ amount: number;
1063
+ currency: string;
1064
+ status: "pending" | "paid" | "failed" | "refunded" | "canceled";
1065
+ providerSessionId: string | null;
1066
+ providerPaymentIntentId: string | null;
1067
+ createdAt: string;
1068
+ paidAt: string | null;
1069
+ }[] | undefined;
1070
+ createdAt: string;
1071
+ paidAt: string | null;
1072
+ fulfilledAt: string | null;
1073
+ canceledAt: string | null;
1074
+ }[];
1075
+ total: number;
1076
+ limit: number;
1077
+ offset: number;
1078
+ };
1079
+ outputFormat: "json";
1080
+ status: hono_utils_http_status.ContentfulStatusCode;
1081
+ };
1082
+ };
1083
+ } & {
1084
+ "/": {
1085
+ $post: {
1086
+ input: {
1087
+ json: {
1088
+ items: {
1089
+ productId: string;
1090
+ quantity: number;
1091
+ priceId?: string | undefined;
1092
+ }[];
1093
+ currency: string;
1094
+ target?: Record<string, unknown> | null | undefined;
1095
+ deliveryCallbackUrl?: string | undefined;
1096
+ idempotencyKey?: string | null | undefined;
1097
+ };
1098
+ };
1099
+ output: {
1100
+ id: string;
1101
+ storeId: string;
1102
+ buyerAccountId: string | null;
1103
+ target: {
1104
+ [x: string]: hono_utils_types.JSONValue;
1105
+ } | null;
1106
+ status: "pending" | "paid" | "fulfilled" | "failed" | "canceled" | "refunded";
1107
+ paymentStatus: "unpaid" | "pending" | "paid" | "failed" | "refunded" | "canceled";
1108
+ fulfillmentStatus: "pending" | "fulfilled" | "failed" | "canceled";
1109
+ subtotalAmount: number;
1110
+ discountAmount: number;
1111
+ totalAmount: number;
1112
+ currency: string;
1113
+ items: {
1114
+ id: string;
1115
+ orderId: string;
1116
+ productId: string;
1117
+ productType: string;
1118
+ name: string;
1119
+ description: string | null;
1120
+ quantity: number;
1121
+ unitAmount: number;
1122
+ totalAmount: number;
1123
+ fulfillmentPayload: {
1124
+ [x: string]: hono_utils_types.JSONValue;
1125
+ };
1126
+ }[];
1127
+ payments?: {
1128
+ id: string;
1129
+ orderId: string;
1130
+ provider: PaymentProvider;
1131
+ amount: number;
1132
+ currency: string;
1133
+ status: "pending" | "paid" | "failed" | "refunded" | "canceled";
1134
+ providerSessionId: string | null;
1135
+ providerPaymentIntentId: string | null;
1136
+ createdAt: string;
1137
+ paidAt: string | null;
1138
+ }[] | undefined;
1139
+ createdAt: string;
1140
+ paidAt: string | null;
1141
+ fulfilledAt: string | null;
1142
+ canceledAt: string | null;
1143
+ };
1144
+ outputFormat: "json";
1145
+ status: 201;
1146
+ };
1147
+ };
1148
+ } & {
1149
+ "/:orderId": {
1150
+ $get: {
1151
+ input: {
1152
+ param: {
1153
+ orderId: string;
1154
+ };
1155
+ };
1156
+ output: {
1157
+ id: string;
1158
+ storeId: string;
1159
+ buyerAccountId: string | null;
1160
+ target: {
1161
+ [x: string]: hono_utils_types.JSONValue;
1162
+ } | null;
1163
+ status: "pending" | "paid" | "fulfilled" | "failed" | "canceled" | "refunded";
1164
+ paymentStatus: "unpaid" | "pending" | "paid" | "failed" | "refunded" | "canceled";
1165
+ fulfillmentStatus: "pending" | "fulfilled" | "failed" | "canceled";
1166
+ subtotalAmount: number;
1167
+ discountAmount: number;
1168
+ totalAmount: number;
1169
+ currency: string;
1170
+ items: {
1171
+ id: string;
1172
+ orderId: string;
1173
+ productId: string;
1174
+ productType: string;
1175
+ name: string;
1176
+ description: string | null;
1177
+ quantity: number;
1178
+ unitAmount: number;
1179
+ totalAmount: number;
1180
+ fulfillmentPayload: {
1181
+ [x: string]: hono_utils_types.JSONValue;
1182
+ };
1183
+ }[];
1184
+ payments?: {
1185
+ id: string;
1186
+ orderId: string;
1187
+ provider: PaymentProvider;
1188
+ amount: number;
1189
+ currency: string;
1190
+ status: "pending" | "paid" | "failed" | "refunded" | "canceled";
1191
+ providerSessionId: string | null;
1192
+ providerPaymentIntentId: string | null;
1193
+ createdAt: string;
1194
+ paidAt: string | null;
1195
+ }[] | undefined;
1196
+ createdAt: string;
1197
+ paidAt: string | null;
1198
+ fulfilledAt: string | null;
1199
+ canceledAt: string | null;
1200
+ };
1201
+ outputFormat: "json";
1202
+ status: hono_utils_http_status.ContentfulStatusCode;
1203
+ };
1204
+ };
1205
+ } & {
1206
+ "/:orderId": {
1207
+ $patch: {
1208
+ input: {
1209
+ json: {
1210
+ status: "canceled";
1211
+ };
1212
+ } & {
1213
+ param: {
1214
+ orderId: string;
1215
+ };
1216
+ };
1217
+ output: {
1218
+ id: string;
1219
+ storeId: string;
1220
+ buyerAccountId: string | null;
1221
+ target: {
1222
+ [x: string]: hono_utils_types.JSONValue;
1223
+ } | null;
1224
+ status: "pending" | "paid" | "fulfilled" | "failed" | "canceled" | "refunded";
1225
+ paymentStatus: "unpaid" | "pending" | "paid" | "failed" | "refunded" | "canceled";
1226
+ fulfillmentStatus: "pending" | "fulfilled" | "failed" | "canceled";
1227
+ subtotalAmount: number;
1228
+ discountAmount: number;
1229
+ totalAmount: number;
1230
+ currency: string;
1231
+ items: {
1232
+ id: string;
1233
+ orderId: string;
1234
+ productId: string;
1235
+ productType: string;
1236
+ name: string;
1237
+ description: string | null;
1238
+ quantity: number;
1239
+ unitAmount: number;
1240
+ totalAmount: number;
1241
+ fulfillmentPayload: {
1242
+ [x: string]: hono_utils_types.JSONValue;
1243
+ };
1244
+ }[];
1245
+ payments?: {
1246
+ id: string;
1247
+ orderId: string;
1248
+ provider: PaymentProvider;
1249
+ amount: number;
1250
+ currency: string;
1251
+ status: "pending" | "paid" | "failed" | "refunded" | "canceled";
1252
+ providerSessionId: string | null;
1253
+ providerPaymentIntentId: string | null;
1254
+ createdAt: string;
1255
+ paidAt: string | null;
1256
+ }[] | undefined;
1257
+ createdAt: string;
1258
+ paidAt: string | null;
1259
+ fulfilledAt: string | null;
1260
+ canceledAt: string | null;
1261
+ };
1262
+ outputFormat: "json";
1263
+ status: hono_utils_http_status.ContentfulStatusCode;
1264
+ };
1265
+ };
1266
+ } & {
1267
+ "/:orderId/payments": {
1268
+ $post: {
1269
+ input: {
1270
+ json: {
1271
+ successUrl?: string | undefined;
1272
+ cancelUrl?: string | undefined;
1273
+ };
1274
+ } & {
1275
+ param: {
1276
+ orderId: string;
1277
+ };
1278
+ };
1279
+ output: {
1280
+ paymentId?: string | undefined;
1281
+ orderId: string;
1282
+ url: string | null;
1283
+ status: "pending" | "paid";
1284
+ reused?: boolean | undefined;
1285
+ };
1286
+ outputFormat: "json";
1287
+ status: 201;
1288
+ };
1289
+ };
1290
+ }, "/", "/:orderId/payments">;
1291
+ declare const adminLicensesRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
1292
+ "/": {
1293
+ $get: {
1294
+ input: {
1295
+ query: {
1296
+ limit?: string | undefined;
1297
+ offset?: string | undefined;
1298
+ accountId?: string | undefined;
1299
+ host?: string | undefined;
1300
+ };
1301
+ };
1302
+ output: {
1303
+ items: {
1304
+ id: string;
1305
+ name: string;
1306
+ url: string;
1307
+ version: string | null;
1308
+ plan: string;
1309
+ lastSeenAt: string | null;
1310
+ }[];
1311
+ total: number;
1312
+ limit: number;
1313
+ offset: number;
1314
+ };
1315
+ outputFormat: "json";
1316
+ status: hono_utils_http_status.ContentfulStatusCode;
1317
+ };
1318
+ };
1319
+ } & {
1320
+ "/:id": {
1321
+ $delete: {
1322
+ input: {
1323
+ param: {
1324
+ id: string;
1325
+ };
1326
+ };
1327
+ output: null;
1328
+ outputFormat: "body";
1329
+ status: 204;
1330
+ };
1331
+ };
1332
+ }, "/", "/:id">;
1333
+ declare const adminStoresRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
1334
+ "/": {
1335
+ $get: {
1336
+ input: {
1337
+ query: {
1338
+ limit?: string | undefined;
1339
+ offset?: string | undefined;
1340
+ };
1341
+ };
1342
+ output: {
1343
+ items: {
1344
+ id: string;
1345
+ type: StoreType;
1346
+ name: string;
1347
+ ownerAccountId: string | null;
1348
+ boundLicenseId: string | null;
1349
+ status: StoreStatus;
1350
+ createdAt: string;
1351
+ updatedAt: string;
1352
+ }[];
1353
+ total: number;
1354
+ limit: number;
1355
+ offset: number;
1356
+ };
1357
+ outputFormat: "json";
1358
+ status: hono_utils_http_status.ContentfulStatusCode;
1359
+ };
1360
+ };
1361
+ } & {
1362
+ "/:storeId": {
1363
+ $get: {
1364
+ input: {
1365
+ param: {
1366
+ storeId: string;
1367
+ };
1368
+ };
1369
+ output: {
1370
+ id: string;
1371
+ type: StoreType;
1372
+ name: string;
1373
+ ownerAccountId: string | null;
1374
+ boundLicenseId: string | null;
1375
+ status: StoreStatus;
1376
+ createdAt: string;
1377
+ updatedAt: string;
1378
+ };
1379
+ outputFormat: "json";
1380
+ status: hono_utils_http_status.ContentfulStatusCode;
1381
+ };
1382
+ };
1383
+ } & {
1384
+ "/:storeId": {
1385
+ $patch: {
1386
+ input: {
1387
+ json: {
1388
+ name?: string | undefined;
1389
+ status?: "active" | "disabled" | undefined;
1390
+ };
1391
+ } & {
1392
+ param: {
1393
+ storeId: string;
1394
+ };
1395
+ };
1396
+ output: {
1397
+ id: string;
1398
+ type: StoreType;
1399
+ name: string;
1400
+ ownerAccountId: string | null;
1401
+ boundLicenseId: string | null;
1402
+ status: StoreStatus;
1403
+ createdAt: string;
1404
+ updatedAt: string;
1405
+ };
1406
+ outputFormat: "json";
1407
+ status: hono_utils_http_status.ContentfulStatusCode;
1408
+ };
1409
+ };
1410
+ }, "/", "/:storeId">;
1411
+ declare const adminUsersRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
1412
+ "/": {
1413
+ $get: {
1414
+ input: {
1415
+ query: {
1416
+ limit?: string | undefined;
1417
+ offset?: string | undefined;
1418
+ search?: string | undefined;
1419
+ membershipTier?: MembershipTier | undefined;
1420
+ };
1421
+ };
1422
+ output: {
1423
+ items: {
1424
+ id: string;
1425
+ name: string;
1426
+ email: string;
1427
+ emailVerified: boolean;
1428
+ image: string | null;
1429
+ createdAt: string;
1430
+ updatedAt: string;
1431
+ role: "user" | "admin";
1432
+ membershipTier: MembershipTier;
1433
+ membershipStatus: "active" | "inactive" | "expired";
1434
+ }[];
1435
+ total: number;
1436
+ limit: number;
1437
+ offset: number;
1438
+ };
1439
+ outputFormat: "json";
1440
+ status: hono_utils_http_status.ContentfulStatusCode;
1441
+ };
1442
+ };
1443
+ } & {
1444
+ "/:id": {
1445
+ $patch: {
1446
+ input: {
1447
+ json: {
1448
+ role?: "user" | "admin" | undefined;
1449
+ membershipTier?: "none" | "silver" | "gold" | "premier" | undefined;
1450
+ membershipStatus?: "active" | "inactive" | "expired" | undefined;
1451
+ };
1452
+ } & {
1453
+ param: {
1454
+ id: string;
1455
+ };
1456
+ };
1457
+ output: {
1458
+ id: string;
1459
+ name: string;
1460
+ email: string;
1461
+ emailVerified: boolean;
1462
+ image: string | null;
1463
+ createdAt: string;
1464
+ updatedAt: string;
1465
+ role: "user" | "admin";
1466
+ membershipTier: MembershipTier;
1467
+ membershipStatus: "active" | "inactive" | "expired";
1468
+ };
1469
+ outputFormat: "json";
1470
+ status: hono_utils_http_status.ContentfulStatusCode;
1471
+ };
1472
+ };
1473
+ }, "/", "/:id">;
1474
+ declare const apiApp: hono_hono_base.HonoBase<hono_types.BlankEnv, hono_types.BlankSchema | hono_types.MergeSchemaPath<{
1475
+ "/": {
1476
+ $post: {
1477
+ input: {
1478
+ json: {
1479
+ instanceId: string;
1480
+ instanceName: string;
1481
+ instanceHost: string;
1482
+ };
1483
+ };
1484
+ output: {
1485
+ code: string;
1486
+ pairingUrl: string;
1487
+ expiresAt: string;
1488
+ };
1489
+ outputFormat: "json";
1490
+ status: 201;
1491
+ };
1492
+ };
1493
+ } & {
1494
+ "/:code/preview": {
1495
+ $get: {
1496
+ input: {
1497
+ param: {
1498
+ code: string;
1499
+ };
1500
+ };
1501
+ output: {
1502
+ licenseId: string;
1503
+ licenseName: string;
1504
+ licenseHost: string;
1505
+ };
1506
+ outputFormat: "json";
1507
+ status: hono_utils_http_status.ContentfulStatusCode;
1508
+ };
1509
+ };
1510
+ } & {
1511
+ "/:code": {
1512
+ $get: {
1513
+ input: {
1514
+ param: {
1515
+ code: string;
1516
+ };
1517
+ };
1518
+ output: {
1519
+ status: Extract<PairingStatus, "pending" | "denied" | "expired">;
1520
+ } | {
1521
+ status: "approved";
1522
+ refreshToken: string;
1523
+ certificate: string;
1524
+ binding: {
1525
+ id: string;
1526
+ instanceId: string;
1527
+ storeId: string;
1528
+ authorizedHosts: string[];
1529
+ };
1530
+ account: {
1531
+ id: string;
1532
+ email: string;
1533
+ };
1534
+ };
1535
+ outputFormat: "json";
1536
+ status: hono_utils_http_status.ContentfulStatusCode;
1537
+ };
1538
+ };
1539
+ } & {
1540
+ "/:code": {
1541
+ $patch: {
1542
+ input: {
1543
+ json: {
1544
+ action: "approve" | "deny";
1545
+ };
1546
+ } & {
1547
+ param: {
1548
+ code: string;
1549
+ };
1550
+ };
1551
+ output: {
1552
+ status: "approved" | "denied";
1553
+ };
1554
+ outputFormat: "json";
1555
+ status: hono_utils_http_status.ContentfulStatusCode;
1556
+ };
1557
+ };
1558
+ }, "/pairings"> | hono_types.MergeSchemaPath<{
1559
+ "/": {
1560
+ $post: {
1561
+ input: {};
1562
+ output: {
1563
+ certificate: string;
1564
+ refreshToken: string;
1565
+ nextRefreshAfter: string;
1566
+ binding: {
1567
+ id: string;
1568
+ instanceId: string;
1569
+ storeId: string;
1570
+ authorizedHosts: string[];
1571
+ };
1572
+ account: {
1573
+ id: string;
1574
+ email: string;
1575
+ };
1576
+ };
1577
+ outputFormat: "json";
1578
+ status: 201;
1579
+ };
1580
+ };
1581
+ }, "/entitlements"> | hono_types.MergeSchemaPath<{
1582
+ "/": {
1583
+ $get: {
1584
+ input: {};
1585
+ output: {
1586
+ state: MembershipViewState;
1587
+ tier: MembershipTier;
1588
+ membershipStatus: MembershipStatus;
1589
+ expiresAt: string | null;
1590
+ cumulativeMonths: number;
1591
+ proIncluded: boolean;
1592
+ primaryAction: MembershipPrimaryAction;
1593
+ stripeSubscription: {
1594
+ status: string;
1595
+ billingInterval: string | null;
1596
+ renewsAt: string | null;
1597
+ cancelAtPeriodEnd: boolean;
1598
+ } | null;
1599
+ channel: "stripe" | "gift";
1600
+ };
1601
+ outputFormat: "json";
1602
+ status: hono_utils_http_status.ContentfulStatusCode;
1603
+ };
1604
+ };
1605
+ }, "/accounts/me/membership"> | hono_types.MergeSchemaPath<{
1606
+ "/": {
1607
+ $get: {
1608
+ input: {
1609
+ query: {
1610
+ limit?: string | undefined;
1611
+ offset?: string | undefined;
1612
+ };
1613
+ };
1614
+ output: {
1615
+ summary: {
1616
+ totalRecords: number;
1617
+ stripeRecords: number;
1618
+ walletBalanceAmount: number;
1619
+ walletCurrency: string | null;
1620
+ latestAt: string | null;
1621
+ };
1622
+ walletBalances: {
1623
+ id: string;
1624
+ walletId: string | null;
1625
+ storeId: string;
1626
+ customerId: string | null;
1627
+ currency: string;
1628
+ availableAmount: number;
1629
+ pendingAmount: number;
1630
+ stripeCustomerId: string | null;
1631
+ updatedAt: string;
1632
+ }[];
1633
+ walletLedger: {
1634
+ items: {
1635
+ id: string;
1636
+ walletId: string | null;
1637
+ storeId: string;
1638
+ customerId: string | null;
1639
+ currency: string;
1640
+ amount: number;
1641
+ direction: "credit" | "debit";
1642
+ status: "posted" | "pending" | "released" | "refunded";
1643
+ sourceType: "gift_card_redemption" | "order_payment" | "stripe_invoice" | "adjustment" | "refund";
1644
+ sourceId: string | null;
1645
+ orderId: string | null;
1646
+ paymentId: string | null;
1647
+ stripeCustomerBalanceTransactionId: string | null;
1648
+ createdAt: string;
1649
+ }[];
1650
+ total: number;
1651
+ limit: number;
1652
+ offset: number;
1653
+ };
1654
+ items: {
1655
+ id: string;
1656
+ title: string;
1657
+ kind: BillingRecordKind;
1658
+ items: {
1659
+ name: string;
1660
+ productType: string;
1661
+ quantity: number;
1662
+ deliverable: {
1663
+ [x: string]: hono_utils_types.JSONValue;
1664
+ };
1665
+ recurring: boolean;
1666
+ }[];
1667
+ orderStatus: BillingOrderStatus;
1668
+ paymentStatus: BillingOrderPaymentStatus;
1669
+ fulfillmentStatus: BillingOrderFulfillmentStatus;
1670
+ amountLabel: string | null;
1671
+ occurredAt: string;
1672
+ paidAt: string | null;
1673
+ fulfilledAt: string | null;
1674
+ }[];
1675
+ total: number;
1676
+ limit: number;
1677
+ offset: number;
1678
+ };
1679
+ outputFormat: "json";
1680
+ status: hono_utils_http_status.ContentfulStatusCode;
1681
+ };
1682
+ };
1683
+ }, "/accounts/me/billing"> | hono_types.MergeSchemaPath<{
1684
+ "/usage": {
1685
+ $get: {
1686
+ input: {
1687
+ query: {
1688
+ customerId: string | string[];
1689
+ };
1690
+ };
1691
+ output: {
1692
+ period: string;
1693
+ resources: {
1694
+ traffic_egress: {
1695
+ used: number;
1696
+ included: number;
1697
+ overageBytes: number;
1698
+ overageGb: number;
1699
+ };
1700
+ };
1701
+ nextReset: string;
1702
+ };
1703
+ outputFormat: "json";
1704
+ status: hono_utils_http_status.ContentfulStatusCode;
1705
+ };
1706
+ };
1707
+ } & {
1708
+ "/usage/:period": {
1709
+ $get: {
1710
+ input: {
1711
+ query: {
1712
+ customerId: string | string[];
1713
+ };
1714
+ } & {
1715
+ param: {
1716
+ period: string;
1717
+ };
1718
+ };
1719
+ output: {
1720
+ period: string;
1721
+ resources: {
1722
+ traffic_egress: {
1723
+ used: number;
1724
+ included: number;
1725
+ overageBytes: number;
1726
+ overageGb: number;
1727
+ };
1728
+ };
1729
+ nextReset: string;
1730
+ };
1731
+ outputFormat: "json";
1732
+ status: hono_utils_http_status.ContentfulStatusCode;
1733
+ };
1734
+ };
1735
+ }, "/accounts/me"> | hono_types.MergeSchemaPath<{
1736
+ "/": {
1737
+ $get: {
1738
+ input: {
1739
+ query: {
1740
+ limit?: string | undefined;
1741
+ offset?: string | undefined;
1742
+ };
1743
+ };
1744
+ output: {
1745
+ balances: {
1746
+ id: string;
1747
+ walletId: string | null;
1748
+ storeId: string;
1749
+ customerId: string | null;
1750
+ currency: string;
1751
+ availableAmount: number;
1752
+ pendingAmount: number;
1753
+ stripeCustomerId: string | null;
1754
+ updatedAt: string;
1755
+ }[];
1756
+ items: {
1757
+ id: string;
1758
+ walletId: string | null;
1759
+ storeId: string;
1760
+ customerId: string | null;
1761
+ currency: string;
1762
+ amount: number;
1763
+ direction: "credit" | "debit";
1764
+ status: "posted" | "pending" | "released" | "refunded";
1765
+ sourceType: "gift_card_redemption" | "order_payment" | "stripe_invoice" | "adjustment" | "refund";
1766
+ sourceId: string | null;
1767
+ orderId: string | null;
1768
+ paymentId: string | null;
1769
+ stripeCustomerBalanceTransactionId: string | null;
1770
+ createdAt: string;
1771
+ }[];
1772
+ total: number;
1773
+ limit: number;
1774
+ offset: number;
1775
+ };
1776
+ outputFormat: "json";
1777
+ status: hono_utils_http_status.ContentfulStatusCode;
1778
+ };
1779
+ };
1780
+ } & {
1781
+ "/redeem": {
1782
+ $post: {
1783
+ input: {
1784
+ json: {
1785
+ codes: string[];
1786
+ };
1787
+ };
1788
+ output: {
1789
+ redeemedAmount: number;
1790
+ currency: string | null;
1791
+ failures: {
1792
+ code: string;
1793
+ error: string;
1794
+ }[];
1795
+ };
1796
+ outputFormat: "json";
1797
+ status: hono_utils_http_status.ContentfulStatusCode;
1798
+ };
1799
+ };
1800
+ }, "/accounts/me/wallet"> | hono_types.MergeSchemaPath<{
1801
+ "/": {
1802
+ $get: {
1803
+ input: {
1804
+ query: {
1805
+ limit?: string | undefined;
1806
+ offset?: string | undefined;
1807
+ };
1808
+ };
1809
+ output: {
1810
+ items: {
1811
+ id: string;
1812
+ name: string;
1813
+ url: string;
1814
+ version: string | null;
1815
+ plan: string;
1816
+ lastSeenAt: string | null;
1817
+ }[];
1818
+ total: number;
1819
+ limit: number;
1820
+ offset: number;
1821
+ };
1822
+ outputFormat: "json";
1823
+ status: hono_utils_http_status.ContentfulStatusCode;
1824
+ };
1825
+ };
1826
+ } & {
1827
+ "/:id": {
1828
+ $delete: {
1829
+ input: {
1830
+ param: {
1831
+ id: string;
1832
+ };
1833
+ };
1834
+ output: null;
1835
+ outputFormat: "body";
1836
+ status: 204;
1837
+ };
1838
+ };
1839
+ }, "/licenses"> | hono_types.MergeSchemaPath<{
1840
+ "/": {
1841
+ $get: {
1842
+ input: {};
1843
+ output: {
1844
+ activeLicenses: number;
1845
+ membershipTier: MembershipTier;
1846
+ latestBillingDate: string | null;
1847
+ };
1848
+ outputFormat: "json";
1849
+ status: hono_utils_http_status.ContentfulStatusCode;
1850
+ };
1851
+ };
1852
+ }, "/accounts/me/overview"> | hono_types.MergeSchemaPath<{
1853
+ "/": {
1854
+ $get: {
1855
+ input: {
1856
+ query: {
1857
+ type?: string | undefined;
1858
+ limit?: string | undefined;
1859
+ offset?: string | undefined;
1860
+ status?: string | undefined;
1861
+ };
1862
+ };
1863
+ output: {
1864
+ items: {
1865
+ id: string;
1866
+ storeId: string;
1867
+ type: ProductType;
1868
+ name: string;
1869
+ description: string | null;
1870
+ active: boolean;
1871
+ sortOrder: number;
1872
+ metadata: {
1873
+ deliverable: {
1874
+ [x: string]: hono_utils_types.JSONValue;
1875
+ };
1876
+ };
1877
+ prices: {
1878
+ id?: string | undefined;
1879
+ currency: string;
1880
+ amount: number;
1881
+ lookupKey?: string | null | undefined;
1882
+ nickname?: string | null | undefined;
1883
+ recurring?: {
1884
+ interval: "day" | "week" | "month" | "year";
1885
+ intervalCount: number;
1886
+ usageType?: "licensed" | "metered" | undefined;
1887
+ } | null | undefined;
1888
+ metadata?: {
1889
+ [x: string]: string;
1890
+ } | undefined;
1891
+ }[];
1892
+ createdAt: string;
1893
+ updatedAt: string;
1894
+ }[];
1895
+ total: number;
1896
+ limit: number;
1897
+ offset: number;
1898
+ };
1899
+ outputFormat: "json";
1900
+ status: hono_utils_http_status.ContentfulStatusCode;
1901
+ };
1902
+ };
1903
+ } & {
1904
+ "/": {
1905
+ $post: {
1906
+ input: {
1907
+ json: {
1908
+ type: "store_item";
1909
+ name: string;
1910
+ metadata: {
1911
+ deliverable: Deliverable;
1912
+ };
1913
+ prices: {
1914
+ currency: string;
1915
+ amount: number;
1916
+ id?: string | undefined;
1917
+ lookupKey?: string | null | undefined;
1918
+ nickname?: string | null | undefined;
1919
+ recurring?: {
1920
+ interval: "day" | "week" | "month" | "year";
1921
+ intervalCount: number;
1922
+ usageType?: "licensed" | "metered" | undefined;
1923
+ } | null | undefined;
1924
+ metadata?: Record<string, string> | undefined;
1925
+ }[];
1926
+ description?: string | null | undefined;
1927
+ active?: boolean | undefined;
1928
+ sortOrder?: number | undefined;
1929
+ };
1930
+ };
1931
+ output: {
1932
+ id: string;
1933
+ storeId: string;
1934
+ type: ProductType;
1935
+ name: string;
1936
+ description: string | null;
1937
+ active: boolean;
1938
+ sortOrder: number;
1939
+ metadata: {
1940
+ deliverable: {
1941
+ [x: string]: hono_utils_types.JSONValue;
1942
+ };
1943
+ };
1944
+ prices: {
1945
+ id?: string | undefined;
1946
+ currency: string;
1947
+ amount: number;
1948
+ lookupKey?: string | null | undefined;
1949
+ nickname?: string | null | undefined;
1950
+ recurring?: {
1951
+ interval: "day" | "week" | "month" | "year";
1952
+ intervalCount: number;
1953
+ usageType?: "licensed" | "metered" | undefined;
1954
+ } | null | undefined;
1955
+ metadata?: {
1956
+ [x: string]: string;
1957
+ } | undefined;
1958
+ }[];
1959
+ createdAt: string;
1960
+ updatedAt: string;
1961
+ };
1962
+ outputFormat: "json";
1963
+ status: 201;
1964
+ };
1965
+ };
1966
+ } & {
1967
+ "/:productId": {
1968
+ $get: {
1969
+ input: {
1970
+ param: {
1971
+ productId: string;
1972
+ };
1973
+ };
1974
+ output: {
1975
+ id: string;
1976
+ storeId: string;
1977
+ type: ProductType;
1978
+ name: string;
1979
+ description: string | null;
1980
+ active: boolean;
1981
+ sortOrder: number;
1982
+ metadata: {
1983
+ deliverable: {
1984
+ [x: string]: hono_utils_types.JSONValue;
1985
+ };
1986
+ };
1987
+ prices: {
1988
+ id?: string | undefined;
1989
+ currency: string;
1990
+ amount: number;
1991
+ lookupKey?: string | null | undefined;
1992
+ nickname?: string | null | undefined;
1993
+ recurring?: {
1994
+ interval: "day" | "week" | "month" | "year";
1995
+ intervalCount: number;
1996
+ usageType?: "licensed" | "metered" | undefined;
1997
+ } | null | undefined;
1998
+ metadata?: {
1999
+ [x: string]: string;
2000
+ } | undefined;
2001
+ }[];
2002
+ createdAt: string;
2003
+ updatedAt: string;
2004
+ };
2005
+ outputFormat: "json";
2006
+ status: hono_utils_http_status.ContentfulStatusCode;
2007
+ };
2008
+ };
2009
+ } & {
2010
+ "/:productId": {
2011
+ $patch: {
2012
+ input: {
2013
+ json: {
2014
+ type?: "store_item" | undefined;
2015
+ name?: string | undefined;
2016
+ description?: string | null | undefined;
2017
+ active?: boolean | undefined;
2018
+ sortOrder?: number | undefined;
2019
+ metadata?: {
2020
+ deliverable: Deliverable;
2021
+ } | undefined;
2022
+ prices?: {
2023
+ currency: string;
2024
+ amount: number;
2025
+ id?: string | undefined;
2026
+ lookupKey?: string | null | undefined;
2027
+ nickname?: string | null | undefined;
2028
+ recurring?: {
2029
+ interval: "day" | "week" | "month" | "year";
2030
+ intervalCount: number;
2031
+ usageType?: "licensed" | "metered" | undefined;
2032
+ } | null | undefined;
2033
+ metadata?: Record<string, string> | undefined;
2034
+ }[] | undefined;
2035
+ };
2036
+ } & {
2037
+ param: {
2038
+ productId: string;
2039
+ };
2040
+ };
2041
+ output: {
2042
+ id: string;
2043
+ storeId: string;
2044
+ type: ProductType;
2045
+ name: string;
2046
+ description: string | null;
2047
+ active: boolean;
2048
+ sortOrder: number;
2049
+ metadata: {
2050
+ deliverable: {
2051
+ [x: string]: hono_utils_types.JSONValue;
2052
+ };
2053
+ };
2054
+ prices: {
2055
+ id?: string | undefined;
2056
+ currency: string;
2057
+ amount: number;
2058
+ lookupKey?: string | null | undefined;
2059
+ nickname?: string | null | undefined;
2060
+ recurring?: {
2061
+ interval: "day" | "week" | "month" | "year";
2062
+ intervalCount: number;
2063
+ usageType?: "licensed" | "metered" | undefined;
2064
+ } | null | undefined;
2065
+ metadata?: {
2066
+ [x: string]: string;
2067
+ } | undefined;
2068
+ }[];
2069
+ createdAt: string;
2070
+ updatedAt: string;
2071
+ };
2072
+ outputFormat: "json";
2073
+ status: hono_utils_http_status.ContentfulStatusCode;
2074
+ };
2075
+ };
2076
+ } & {
2077
+ "/:productId": {
2078
+ $delete: {
2079
+ input: {
2080
+ param: {
2081
+ productId: string;
2082
+ };
2083
+ };
2084
+ output: null;
2085
+ outputFormat: "body";
2086
+ status: 204;
2087
+ };
2088
+ };
2089
+ }, "/stores/:storeId/products"> | hono_types.MergeSchemaPath<{
2090
+ "/campaigns": {
2091
+ $get: {
2092
+ input: {
2093
+ query: {
2094
+ limit?: string | undefined;
2095
+ offset?: string | undefined;
2096
+ status?: GiftCardCampaign["status"] | undefined;
2097
+ };
2098
+ };
2099
+ output: {
2100
+ items: {
2101
+ id: string;
2102
+ storeId: string;
2103
+ name: string;
2104
+ status: "active" | "disabled" | "ended";
2105
+ startsAt: string | null;
2106
+ expiresAt: string | null;
2107
+ createdByAdmin: string;
2108
+ createdAt: string;
2109
+ updatedAt: string;
2110
+ }[];
2111
+ total: number;
2112
+ limit: number;
2113
+ offset: number;
2114
+ };
2115
+ outputFormat: "json";
2116
+ status: hono_utils_http_status.ContentfulStatusCode;
2117
+ };
2118
+ };
2119
+ } & {
2120
+ "/campaigns": {
2121
+ $post: {
2122
+ input: {
2123
+ json: {
2124
+ name: string;
2125
+ startsAt?: string | null | undefined;
2126
+ expiresAt?: string | null | undefined;
2127
+ };
2128
+ };
2129
+ output: {
2130
+ id: string;
2131
+ storeId: string;
2132
+ name: string;
2133
+ status: "active" | "disabled" | "ended";
2134
+ startsAt: string | null;
2135
+ expiresAt: string | null;
2136
+ createdByAdmin: string;
2137
+ createdAt: string;
2138
+ updatedAt: string;
2139
+ };
2140
+ outputFormat: "json";
2141
+ status: 201;
2142
+ };
2143
+ };
2144
+ } & {
2145
+ "/": {
2146
+ $get: {
2147
+ input: {
2148
+ query: {
2149
+ limit?: string | undefined;
2150
+ offset?: string | undefined;
2151
+ status?: StoreGiftCard["status"] | undefined;
2152
+ campaignId?: string | undefined;
2153
+ };
2154
+ };
2155
+ output: {
2156
+ items: {
2157
+ id: string;
2158
+ storeId: string;
2159
+ campaignId: string | null;
2160
+ code: string | null;
2161
+ codeLast4: string;
2162
+ amount: number;
2163
+ currency: string;
2164
+ status: "active" | "redeemed" | "disabled" | "expired" | "revoked";
2165
+ expiresAt: string | null;
2166
+ createdAt: string;
2167
+ updatedAt: string;
2168
+ disabledAt: string | null;
2169
+ revokedAt: string | null;
2170
+ createdByAdmin: string;
2171
+ }[];
2172
+ total: number;
2173
+ limit: number;
2174
+ offset: number;
2175
+ };
2176
+ outputFormat: "json";
2177
+ status: hono_utils_http_status.ContentfulStatusCode;
2178
+ };
2179
+ };
2180
+ } & {
2181
+ "/": {
2182
+ $post: {
2183
+ input: {
2184
+ json: {
2185
+ amount: number;
2186
+ currency: string;
2187
+ count: number;
2188
+ expiresAt?: string | null | undefined;
2189
+ campaignId?: string | null | undefined;
2190
+ };
2191
+ };
2192
+ output: {
2193
+ id: string;
2194
+ storeId: string;
2195
+ campaignId: string | null;
2196
+ code: string | null;
2197
+ codeLast4: string;
2198
+ amount: number;
2199
+ currency: string;
2200
+ status: "active" | "redeemed" | "disabled" | "expired" | "revoked";
2201
+ expiresAt: string | null;
2202
+ createdAt: string;
2203
+ updatedAt: string;
2204
+ disabledAt: string | null;
2205
+ revokedAt: string | null;
2206
+ createdByAdmin: string;
2207
+ }[];
2208
+ outputFormat: "json";
2209
+ status: 201;
2210
+ };
2211
+ };
2212
+ } & {
2213
+ "/:code": {
2214
+ $get: {
2215
+ input: {
2216
+ param: {
2217
+ code: string;
2218
+ };
2219
+ };
2220
+ output: {
2221
+ id: string;
2222
+ storeId: string;
2223
+ campaignId: string | null;
2224
+ code: string | null;
2225
+ codeLast4: string;
2226
+ amount: number;
2227
+ currency: string;
2228
+ status: "active" | "redeemed" | "disabled" | "expired" | "revoked";
2229
+ expiresAt: string | null;
2230
+ createdAt: string;
2231
+ updatedAt: string;
2232
+ disabledAt: string | null;
2233
+ revokedAt: string | null;
2234
+ createdByAdmin: string;
2235
+ };
2236
+ outputFormat: "json";
2237
+ status: hono_utils_http_status.ContentfulStatusCode;
2238
+ };
2239
+ };
2240
+ } & {
2241
+ "/:code": {
2242
+ $patch: {
2243
+ input: {
2244
+ json: {
2245
+ disabled?: boolean | undefined;
2246
+ revoked?: true | undefined;
2247
+ };
2248
+ } & {
2249
+ param: {
2250
+ code: string;
2251
+ };
2252
+ };
2253
+ output: null;
2254
+ outputFormat: "body";
2255
+ status: 204;
2256
+ };
2257
+ };
2258
+ } & {
2259
+ "/:code": {
2260
+ $delete: {
2261
+ input: {
2262
+ param: {
2263
+ code: string;
2264
+ };
2265
+ };
2266
+ output: null;
2267
+ outputFormat: "body";
2268
+ status: 204;
2269
+ };
2270
+ };
2271
+ }, "/stores/:storeId/gift-cards"> | hono_types.MergeSchemaPath<{
2272
+ "/": {
2273
+ $post: {
2274
+ input: {
2275
+ json: {
2276
+ resource: "traffic_egress";
2277
+ customerId: string;
2278
+ quantity?: number | undefined;
2279
+ bytes?: number | undefined;
2280
+ idempotencyKey?: string | undefined;
2281
+ eventId?: string | undefined;
2282
+ };
2283
+ };
2284
+ output: {
2285
+ resource: UsageResource;
2286
+ quantity: number;
2287
+ duplicate: boolean;
2288
+ };
2289
+ outputFormat: "json";
2290
+ status: 201;
2291
+ };
2292
+ };
2293
+ }, "/stores/:storeId/billing/usage-events"> | hono_types.MergeSchemaPath<{
2294
+ "/": {
2295
+ $get: {
2296
+ input: {
2297
+ query: {
2298
+ limit?: string | undefined;
2299
+ offset?: string | undefined;
2300
+ paymentStatus?: CommerceOrder["paymentStatus"] | undefined;
2301
+ fulfillmentStatus?: CommerceOrder["fulfillmentStatus"] | undefined;
2302
+ customerId?: string | undefined;
2303
+ };
2304
+ };
2305
+ output: {
2306
+ items: {
2307
+ id: string;
2308
+ storeId: string;
2309
+ buyerAccountId: string | null;
2310
+ target: {
2311
+ [x: string]: hono_utils_types.JSONValue;
2312
+ } | null;
2313
+ status: "pending" | "paid" | "fulfilled" | "failed" | "canceled" | "refunded";
2314
+ paymentStatus: "unpaid" | "pending" | "paid" | "failed" | "refunded" | "canceled";
2315
+ fulfillmentStatus: "pending" | "fulfilled" | "failed" | "canceled";
2316
+ subtotalAmount: number;
2317
+ discountAmount: number;
2318
+ totalAmount: number;
2319
+ currency: string;
2320
+ items: {
2321
+ id: string;
2322
+ orderId: string;
2323
+ productId: string;
2324
+ productType: string;
2325
+ name: string;
2326
+ description: string | null;
2327
+ quantity: number;
2328
+ unitAmount: number;
2329
+ totalAmount: number;
2330
+ fulfillmentPayload: {
2331
+ [x: string]: hono_utils_types.JSONValue;
2332
+ };
2333
+ }[];
2334
+ payments?: {
2335
+ id: string;
2336
+ orderId: string;
2337
+ provider: PaymentProvider;
2338
+ amount: number;
2339
+ currency: string;
2340
+ status: "pending" | "paid" | "failed" | "refunded" | "canceled";
2341
+ providerSessionId: string | null;
2342
+ providerPaymentIntentId: string | null;
2343
+ createdAt: string;
2344
+ paidAt: string | null;
2345
+ }[] | undefined;
2346
+ createdAt: string;
2347
+ paidAt: string | null;
2348
+ fulfilledAt: string | null;
2349
+ canceledAt: string | null;
2350
+ }[];
2351
+ total: number;
2352
+ limit: number;
2353
+ offset: number;
2354
+ };
2355
+ outputFormat: "json";
2356
+ status: hono_utils_http_status.ContentfulStatusCode;
2357
+ };
2358
+ };
2359
+ } & {
2360
+ "/": {
2361
+ $post: {
2362
+ input: {
2363
+ json: {
2364
+ items: {
2365
+ productId: string;
2366
+ quantity: number;
2367
+ priceId?: string | undefined;
2368
+ }[];
2369
+ currency: string;
2370
+ target?: Record<string, unknown> | null | undefined;
2371
+ deliveryCallbackUrl?: string | undefined;
2372
+ idempotencyKey?: string | null | undefined;
2373
+ };
2374
+ };
2375
+ output: {
2376
+ id: string;
2377
+ storeId: string;
2378
+ buyerAccountId: string | null;
2379
+ target: {
2380
+ [x: string]: hono_utils_types.JSONValue;
2381
+ } | null;
2382
+ status: "pending" | "paid" | "fulfilled" | "failed" | "canceled" | "refunded";
2383
+ paymentStatus: "unpaid" | "pending" | "paid" | "failed" | "refunded" | "canceled";
2384
+ fulfillmentStatus: "pending" | "fulfilled" | "failed" | "canceled";
2385
+ subtotalAmount: number;
2386
+ discountAmount: number;
2387
+ totalAmount: number;
2388
+ currency: string;
2389
+ items: {
2390
+ id: string;
2391
+ orderId: string;
2392
+ productId: string;
2393
+ productType: string;
2394
+ name: string;
2395
+ description: string | null;
2396
+ quantity: number;
2397
+ unitAmount: number;
2398
+ totalAmount: number;
2399
+ fulfillmentPayload: {
2400
+ [x: string]: hono_utils_types.JSONValue;
2401
+ };
2402
+ }[];
2403
+ payments?: {
2404
+ id: string;
2405
+ orderId: string;
2406
+ provider: PaymentProvider;
2407
+ amount: number;
2408
+ currency: string;
2409
+ status: "pending" | "paid" | "failed" | "refunded" | "canceled";
2410
+ providerSessionId: string | null;
2411
+ providerPaymentIntentId: string | null;
2412
+ createdAt: string;
2413
+ paidAt: string | null;
2414
+ }[] | undefined;
2415
+ createdAt: string;
2416
+ paidAt: string | null;
2417
+ fulfilledAt: string | null;
2418
+ canceledAt: string | null;
2419
+ };
2420
+ outputFormat: "json";
2421
+ status: 201;
2422
+ };
2423
+ };
2424
+ } & {
2425
+ "/:orderId": {
2426
+ $get: {
2427
+ input: {
2428
+ param: {
2429
+ orderId: string;
2430
+ };
2431
+ };
2432
+ output: {
2433
+ id: string;
2434
+ storeId: string;
2435
+ buyerAccountId: string | null;
2436
+ target: {
2437
+ [x: string]: hono_utils_types.JSONValue;
2438
+ } | null;
2439
+ status: "pending" | "paid" | "fulfilled" | "failed" | "canceled" | "refunded";
2440
+ paymentStatus: "unpaid" | "pending" | "paid" | "failed" | "refunded" | "canceled";
2441
+ fulfillmentStatus: "pending" | "fulfilled" | "failed" | "canceled";
2442
+ subtotalAmount: number;
2443
+ discountAmount: number;
2444
+ totalAmount: number;
2445
+ currency: string;
2446
+ items: {
2447
+ id: string;
2448
+ orderId: string;
2449
+ productId: string;
2450
+ productType: string;
2451
+ name: string;
2452
+ description: string | null;
2453
+ quantity: number;
2454
+ unitAmount: number;
2455
+ totalAmount: number;
2456
+ fulfillmentPayload: {
2457
+ [x: string]: hono_utils_types.JSONValue;
2458
+ };
2459
+ }[];
2460
+ payments?: {
2461
+ id: string;
2462
+ orderId: string;
2463
+ provider: PaymentProvider;
2464
+ amount: number;
2465
+ currency: string;
2466
+ status: "pending" | "paid" | "failed" | "refunded" | "canceled";
2467
+ providerSessionId: string | null;
2468
+ providerPaymentIntentId: string | null;
2469
+ createdAt: string;
2470
+ paidAt: string | null;
2471
+ }[] | undefined;
2472
+ createdAt: string;
2473
+ paidAt: string | null;
2474
+ fulfilledAt: string | null;
2475
+ canceledAt: string | null;
2476
+ };
2477
+ outputFormat: "json";
2478
+ status: hono_utils_http_status.ContentfulStatusCode;
2479
+ };
2480
+ };
2481
+ } & {
2482
+ "/:orderId": {
2483
+ $patch: {
2484
+ input: {
2485
+ json: {
2486
+ status: "canceled";
2487
+ };
2488
+ } & {
2489
+ param: {
2490
+ orderId: string;
2491
+ };
2492
+ };
2493
+ output: {
2494
+ id: string;
2495
+ storeId: string;
2496
+ buyerAccountId: string | null;
2497
+ target: {
2498
+ [x: string]: hono_utils_types.JSONValue;
2499
+ } | null;
2500
+ status: "pending" | "paid" | "fulfilled" | "failed" | "canceled" | "refunded";
2501
+ paymentStatus: "unpaid" | "pending" | "paid" | "failed" | "refunded" | "canceled";
2502
+ fulfillmentStatus: "pending" | "fulfilled" | "failed" | "canceled";
2503
+ subtotalAmount: number;
2504
+ discountAmount: number;
2505
+ totalAmount: number;
2506
+ currency: string;
2507
+ items: {
2508
+ id: string;
2509
+ orderId: string;
2510
+ productId: string;
2511
+ productType: string;
2512
+ name: string;
2513
+ description: string | null;
2514
+ quantity: number;
2515
+ unitAmount: number;
2516
+ totalAmount: number;
2517
+ fulfillmentPayload: {
2518
+ [x: string]: hono_utils_types.JSONValue;
2519
+ };
2520
+ }[];
2521
+ payments?: {
2522
+ id: string;
2523
+ orderId: string;
2524
+ provider: PaymentProvider;
2525
+ amount: number;
2526
+ currency: string;
2527
+ status: "pending" | "paid" | "failed" | "refunded" | "canceled";
2528
+ providerSessionId: string | null;
2529
+ providerPaymentIntentId: string | null;
2530
+ createdAt: string;
2531
+ paidAt: string | null;
2532
+ }[] | undefined;
2533
+ createdAt: string;
2534
+ paidAt: string | null;
2535
+ fulfilledAt: string | null;
2536
+ canceledAt: string | null;
2537
+ };
2538
+ outputFormat: "json";
2539
+ status: hono_utils_http_status.ContentfulStatusCode;
2540
+ };
2541
+ };
2542
+ } & {
2543
+ "/:orderId/payments": {
2544
+ $post: {
2545
+ input: {
2546
+ json: {
2547
+ successUrl?: string | undefined;
2548
+ cancelUrl?: string | undefined;
2549
+ };
2550
+ } & {
2551
+ param: {
2552
+ orderId: string;
2553
+ };
2554
+ };
2555
+ output: {
2556
+ paymentId?: string | undefined;
2557
+ orderId: string;
2558
+ url: string | null;
2559
+ status: "pending" | "paid";
2560
+ reused?: boolean | undefined;
2561
+ };
2562
+ outputFormat: "json";
2563
+ status: 201;
2564
+ };
2565
+ };
2566
+ }, "/stores/:storeId/orders"> | hono_types.MergeSchemaPath<{
2567
+ "/": {
2568
+ $post: {
2569
+ input: {
2570
+ json: {
2571
+ customerId: string;
2572
+ returnUrl: string;
2573
+ };
2574
+ };
2575
+ output: {
2576
+ url: string;
2577
+ };
2578
+ outputFormat: "json";
2579
+ status: hono_utils_http_status.ContentfulStatusCode;
2580
+ };
2581
+ };
2582
+ }, "/stores/:storeId/billing/portal-sessions"> | hono_types.MergeSchemaPath<{
2583
+ "/balances": {
2584
+ $get: {
2585
+ input: {
2586
+ query: {
2587
+ limit?: string | undefined;
2588
+ offset?: string | undefined;
2589
+ };
2590
+ };
2591
+ output: {
2592
+ items: {
2593
+ id: string;
2594
+ walletId: string | null;
2595
+ storeId: string;
2596
+ customerId: string | null;
2597
+ currency: string;
2598
+ availableAmount: number;
2599
+ pendingAmount: number;
2600
+ stripeCustomerId: string | null;
2601
+ updatedAt: string;
2602
+ }[];
2603
+ total: number;
2604
+ limit: number;
2605
+ offset: number;
2606
+ };
2607
+ outputFormat: "json";
2608
+ status: hono_utils_http_status.ContentfulStatusCode;
2609
+ };
2610
+ };
2611
+ } & {
2612
+ "/transactions": {
2613
+ $get: {
2614
+ input: {
2615
+ query: {
2616
+ limit?: string | undefined;
2617
+ offset?: string | undefined;
2618
+ };
2619
+ };
2620
+ output: {
2621
+ items: {
2622
+ id: string;
2623
+ walletId: string | null;
2624
+ storeId: string;
2625
+ customerId: string | null;
2626
+ currency: string;
2627
+ amount: number;
2628
+ direction: "credit" | "debit";
2629
+ status: "posted" | "pending" | "released" | "refunded";
2630
+ sourceType: "gift_card_redemption" | "order_payment" | "stripe_invoice" | "adjustment" | "refund";
2631
+ sourceId: string | null;
2632
+ orderId: string | null;
2633
+ paymentId: string | null;
2634
+ stripeCustomerBalanceTransactionId: string | null;
2635
+ createdAt: string;
2636
+ }[];
2637
+ total: number;
2638
+ limit: number;
2639
+ offset: number;
2640
+ };
2641
+ outputFormat: "json";
2642
+ status: hono_utils_http_status.ContentfulStatusCode;
2643
+ };
2644
+ };
2645
+ } & {
2646
+ "/redemptions": {
2647
+ $post: {
2648
+ input: {
2649
+ json: {
2650
+ codes: string[];
2651
+ };
2652
+ };
2653
+ output: {
2654
+ redeemedAmount: number;
2655
+ currency: string | null;
2656
+ failures: {
2657
+ code: string;
2658
+ error: string;
2659
+ }[];
2660
+ };
2661
+ outputFormat: "json";
2662
+ status: 201;
2663
+ };
2664
+ };
2665
+ }, "/stores/:storeId/wallets/:customerId"> | hono_types.MergeSchemaPath<{
2666
+ "/": {
2667
+ $get: {
2668
+ input: {
2669
+ query: {
2670
+ limit?: string | undefined;
2671
+ offset?: string | undefined;
2672
+ accountId?: string | undefined;
2673
+ host?: string | undefined;
2674
+ };
2675
+ };
2676
+ output: {
2677
+ items: {
2678
+ id: string;
2679
+ name: string;
2680
+ url: string;
2681
+ version: string | null;
2682
+ plan: string;
2683
+ lastSeenAt: string | null;
2684
+ }[];
2685
+ total: number;
2686
+ limit: number;
2687
+ offset: number;
2688
+ };
2689
+ outputFormat: "json";
2690
+ status: hono_utils_http_status.ContentfulStatusCode;
2691
+ };
2692
+ };
2693
+ } & {
2694
+ "/:id": {
2695
+ $delete: {
2696
+ input: {
2697
+ param: {
2698
+ id: string;
2699
+ };
2700
+ };
2701
+ output: null;
2702
+ outputFormat: "body";
2703
+ status: 204;
2704
+ };
2705
+ };
2706
+ }, "/admin/licenses"> | hono_types.MergeSchemaPath<{
2707
+ "/": {
2708
+ $get: {
2709
+ input: {
2710
+ query: {
2711
+ limit?: string | undefined;
2712
+ offset?: string | undefined;
2713
+ };
2714
+ };
2715
+ output: {
2716
+ items: {
2717
+ id: string;
2718
+ type: StoreType;
2719
+ name: string;
2720
+ ownerAccountId: string | null;
2721
+ boundLicenseId: string | null;
2722
+ status: StoreStatus;
2723
+ createdAt: string;
2724
+ updatedAt: string;
2725
+ }[];
2726
+ total: number;
2727
+ limit: number;
2728
+ offset: number;
2729
+ };
2730
+ outputFormat: "json";
2731
+ status: hono_utils_http_status.ContentfulStatusCode;
2732
+ };
2733
+ };
2734
+ } & {
2735
+ "/:storeId": {
2736
+ $get: {
2737
+ input: {
2738
+ param: {
2739
+ storeId: string;
2740
+ };
2741
+ };
2742
+ output: {
2743
+ id: string;
2744
+ type: StoreType;
2745
+ name: string;
2746
+ ownerAccountId: string | null;
2747
+ boundLicenseId: string | null;
2748
+ status: StoreStatus;
2749
+ createdAt: string;
2750
+ updatedAt: string;
2751
+ };
2752
+ outputFormat: "json";
2753
+ status: hono_utils_http_status.ContentfulStatusCode;
2754
+ };
2755
+ };
2756
+ } & {
2757
+ "/:storeId": {
2758
+ $patch: {
2759
+ input: {
2760
+ json: {
2761
+ name?: string | undefined;
2762
+ status?: "active" | "disabled" | undefined;
2763
+ };
2764
+ } & {
2765
+ param: {
2766
+ storeId: string;
2767
+ };
2768
+ };
2769
+ output: {
2770
+ id: string;
2771
+ type: StoreType;
2772
+ name: string;
2773
+ ownerAccountId: string | null;
2774
+ boundLicenseId: string | null;
2775
+ status: StoreStatus;
2776
+ createdAt: string;
2777
+ updatedAt: string;
2778
+ };
2779
+ outputFormat: "json";
2780
+ status: hono_utils_http_status.ContentfulStatusCode;
2781
+ };
2782
+ };
2783
+ }, "/admin/stores"> | hono_types.MergeSchemaPath<{
2784
+ "/": {
2785
+ $get: {
2786
+ input: {
2787
+ query: {
2788
+ limit?: string | undefined;
2789
+ offset?: string | undefined;
2790
+ search?: string | undefined;
2791
+ membershipTier?: MembershipTier | undefined;
2792
+ };
2793
+ };
2794
+ output: {
2795
+ items: {
2796
+ id: string;
2797
+ name: string;
2798
+ email: string;
2799
+ emailVerified: boolean;
2800
+ image: string | null;
2801
+ createdAt: string;
2802
+ updatedAt: string;
2803
+ role: "user" | "admin";
2804
+ membershipTier: MembershipTier;
2805
+ membershipStatus: "active" | "inactive" | "expired";
2806
+ }[];
2807
+ total: number;
2808
+ limit: number;
2809
+ offset: number;
2810
+ };
2811
+ outputFormat: "json";
2812
+ status: hono_utils_http_status.ContentfulStatusCode;
2813
+ };
2814
+ };
2815
+ } & {
2816
+ "/:id": {
2817
+ $patch: {
2818
+ input: {
2819
+ json: {
2820
+ role?: "user" | "admin" | undefined;
2821
+ membershipTier?: "none" | "silver" | "gold" | "premier" | undefined;
2822
+ membershipStatus?: "active" | "inactive" | "expired" | undefined;
2823
+ };
2824
+ } & {
2825
+ param: {
2826
+ id: string;
2827
+ };
2828
+ };
2829
+ output: {
2830
+ id: string;
2831
+ name: string;
2832
+ email: string;
2833
+ emailVerified: boolean;
2834
+ image: string | null;
2835
+ createdAt: string;
2836
+ updatedAt: string;
2837
+ role: "user" | "admin";
2838
+ membershipTier: MembershipTier;
2839
+ membershipStatus: "active" | "inactive" | "expired";
2840
+ };
2841
+ outputFormat: "json";
2842
+ status: hono_utils_http_status.ContentfulStatusCode;
2843
+ };
2844
+ };
2845
+ }, "/admin/users">, "/", "/">;
2846
+ type AppType = typeof apiApp;
2847
+ type PairingsRoute = typeof pairingsRouter;
2848
+ type EntitlementsRoute = typeof entitlementsRouter;
2849
+ type AccountMembershipRoute = typeof accountMembershipRouter;
2850
+ type AccountBillingRoute = typeof accountBillingRouter;
2851
+ type AccountUsageRoute = typeof accountUsageRouter;
2852
+ type AccountWalletRoute = typeof accountWalletRouter;
2853
+ type UsageEventsRoute = typeof usageEventsRouter;
2854
+ type LicensesRoute = typeof licensesRouter;
2855
+ type AccountOverviewRoute = typeof accountOverviewRouter;
2856
+ type StoreProductsRoute = typeof storeProductsRouter;
2857
+ type StoreGiftCardsRoute = typeof storeGiftCardsRouter;
2858
+ type StoreOrdersRoute = typeof storeOrdersRouter;
2859
+ type AdminLicensesRoute = typeof adminLicensesRouter;
2860
+ type AdminStoresRoute = typeof adminStoresRouter;
2861
+ type AdminUsersRoute = typeof adminUsersRouter;
2862
+
2863
+ type CloudClient = ReturnType<typeof hc<AppType>>;
2864
+ type CloudClientOptions = {
2865
+ baseUrl: string;
2866
+ token?: string;
2867
+ credentials?: RequestCredentials;
2868
+ headers?: HeadersInit;
2869
+ };
2870
+ declare function createCloudClient(options: CloudClientOptions): CloudClient;
2871
+
2872
+ declare const storeFulfillmentEventSchema: z.ZodObject<{
2873
+ eventId: z.ZodString;
2874
+ eventType: z.ZodEnum<{
2875
+ "store.order_item.fulfilled": "store.order_item.fulfilled";
2876
+ "store.subscription.renewed": "store.subscription.renewed";
2877
+ "store.subscription.updated": "store.subscription.updated";
2878
+ "store.subscription.canceled": "store.subscription.canceled";
2879
+ "store.subscription.expired": "store.subscription.expired";
2880
+ }>;
2881
+ orderId: z.ZodString;
2882
+ orderItemId: z.ZodString;
2883
+ productId: z.ZodString;
2884
+ productName: z.ZodString;
2885
+ quantity: z.ZodNumber;
2886
+ deliverable: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2887
+ target: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2888
+ context: z.ZodObject<{
2889
+ storeId: z.ZodString;
2890
+ paymentProvider: z.ZodNullable<z.ZodEnum<{
2891
+ stripe: "stripe";
2892
+ gift_card: "gift_card";
2893
+ wallet: "wallet";
2894
+ }>>;
2895
+ stripePriceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2896
+ stripePriceLookupKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2897
+ stripePriceRecurring: z.ZodOptional<z.ZodUnknown>;
2898
+ stripePriceMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2899
+ stripeSubscriptionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2900
+ stripeInvoiceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2901
+ billingPeriodStart: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2902
+ billingPeriodEnd: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2903
+ }, z.core.$strip>;
2904
+ occurredAt: z.ZodString;
2905
+ }, z.core.$strip>;
2906
+ declare const zpanCloudEventSchema: z.ZodObject<{
2907
+ eventId: z.ZodString;
2908
+ eventType: z.ZodEnum<{
2909
+ "store.order_item.fulfilled": "store.order_item.fulfilled";
2910
+ "store.subscription.renewed": "store.subscription.renewed";
2911
+ "store.subscription.updated": "store.subscription.updated";
2912
+ "store.subscription.canceled": "store.subscription.canceled";
2913
+ "store.subscription.expired": "store.subscription.expired";
2914
+ }>;
2915
+ orderId: z.ZodString;
2916
+ orderItemId: z.ZodString;
2917
+ productId: z.ZodString;
2918
+ productName: z.ZodString;
2919
+ quantity: z.ZodNumber;
2920
+ deliverable: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2921
+ target: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2922
+ context: z.ZodObject<{
2923
+ storeId: z.ZodString;
2924
+ paymentProvider: z.ZodNullable<z.ZodEnum<{
2925
+ stripe: "stripe";
2926
+ gift_card: "gift_card";
2927
+ wallet: "wallet";
2928
+ }>>;
2929
+ stripePriceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2930
+ stripePriceLookupKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2931
+ stripePriceRecurring: z.ZodOptional<z.ZodUnknown>;
2932
+ stripePriceMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2933
+ stripeSubscriptionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2934
+ stripeInvoiceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2935
+ billingPeriodStart: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2936
+ billingPeriodEnd: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2937
+ }, z.core.$strip>;
2938
+ occurredAt: z.ZodString;
2939
+ }, z.core.$strip>;
2940
+
2941
+ type Page<T> = {
2942
+ items: T[];
2943
+ total: number;
2944
+ limit: number;
2945
+ offset: number;
2946
+ };
2947
+ type PaginationQuery = {
2948
+ limit?: string;
2949
+ offset?: string;
2950
+ };
2951
+ type PairingCreateRequest = z.infer<typeof createPairingSchema>;
2952
+ type PairingCreateResponse = {
2953
+ code: string;
2954
+ pairingUrl: string;
2955
+ expiresAt: string;
2956
+ };
2957
+ type PairingPreview = {
2958
+ licenseId: string;
2959
+ licenseName: string;
2960
+ licenseHost: string;
2961
+ };
2962
+ type PairingPollResponse = {
2963
+ status: Extract<PairingStatus, 'pending' | 'denied' | 'expired'>;
2964
+ } | {
2965
+ status: 'approved';
2966
+ refreshToken: string;
2967
+ certificate: string;
2968
+ binding: {
2969
+ id: string;
2970
+ instanceId: string;
2971
+ storeId: string;
2972
+ authorizedHosts: string[];
2973
+ };
2974
+ account: {
2975
+ id: string;
2976
+ email: string;
2977
+ };
2978
+ };
2979
+ type PairingActionRequest = z.infer<typeof pairingActionSchema>;
2980
+ type PairingActionResponse = {
2981
+ status: 'approved' | 'denied';
2982
+ };
2983
+ type EntitlementRefreshResponse = {
2984
+ certificate: string;
2985
+ refreshToken: string;
2986
+ nextRefreshAfter: string;
2987
+ binding: {
2988
+ id: string;
2989
+ instanceId: string;
2990
+ storeId: string;
2991
+ authorizedHosts: string[];
2992
+ };
2993
+ account: {
2994
+ id: string;
2995
+ email: string;
2996
+ };
2997
+ };
2998
+ type ProductListQuery = Partial<Record<keyof z.infer<typeof productListQuerySchema>, string>>;
2999
+ type CreateProductInput = z.infer<typeof createProductSchema>;
3000
+ type UpdateProductInput = z.infer<typeof updateProductSchema>;
3001
+ type OrderListQuery = PaginationQuery & {
3002
+ paymentStatus?: CommerceOrder['paymentStatus'];
3003
+ fulfillmentStatus?: CommerceOrder['fulfillmentStatus'];
3004
+ customerId?: string;
3005
+ };
3006
+ type CreateOrderInput = z.infer<typeof createOrderSchema>;
3007
+ type OrderPatchRequest = z.infer<typeof orderPatchSchema>;
3008
+ type PaymentCreateResponse = {
3009
+ paymentId?: string;
3010
+ orderId: string;
3011
+ url: string | null;
3012
+ status: 'pending' | 'paid';
3013
+ reused?: boolean;
3014
+ };
3015
+ type PaymentCreateRequest = z.infer<typeof paymentSchema>;
3016
+ type BillingPortalSessionRequest = z.infer<typeof billingPortalSessionSchema>;
3017
+ type BillingPortalSessionResponse = {
3018
+ url: string;
3019
+ };
3020
+ type GiftCardListQuery = PaginationQuery & {
3021
+ status?: StoreGiftCard['status'];
3022
+ campaignId?: string;
3023
+ };
3024
+ type GiftCardCampaignListQuery = PaginationQuery & {
3025
+ status?: GiftCardCampaign['status'];
3026
+ };
3027
+ type GiftCardCreateRequest = z.infer<typeof giftCardCreateSchema>;
3028
+ type GiftCardPatchRequest = z.infer<typeof giftCardPatchSchema>;
3029
+ type GiftCardCampaignCreateRequest = z.infer<typeof giftCardCampaignCreateSchema>;
3030
+ type GiftCardListInput = z.infer<typeof giftCardListQuerySchema>;
3031
+ type GiftCardCampaignListInput = z.infer<typeof giftCardCampaignListQuerySchema>;
3032
+ type UsageEventCreateRequest = z.infer<typeof usageEventCreateSchema>;
3033
+ type UsageEventCreateResponse = {
3034
+ resource: UsageResource;
3035
+ quantity: number;
3036
+ duplicate: boolean;
3037
+ };
3038
+ type WalletRedemptionRequest = z.infer<typeof walletRedemptionSchema>;
3039
+ type WalletRedemptionResponse = {
3040
+ redeemedAmount: number;
3041
+ currency: string | null;
3042
+ failures: Array<{
3043
+ code: string;
3044
+ error: string;
3045
+ }>;
3046
+ };
3047
+ type StorePatchRequest = z.infer<typeof storePatchSchema>;
3048
+ type AdminUser = {
3049
+ id: string;
3050
+ name: string;
3051
+ email: string;
3052
+ emailVerified: boolean;
3053
+ image: string | null;
3054
+ createdAt: string;
3055
+ updatedAt: string;
3056
+ role: 'user' | 'admin';
3057
+ membershipTier: MembershipTier;
3058
+ membershipStatus: 'active' | 'inactive' | 'expired';
3059
+ };
3060
+ type AdminUserListQuery = PaginationQuery & {
3061
+ search?: string;
3062
+ membershipTier?: MembershipTier;
3063
+ };
3064
+ type AdminUserPatchRequest = z.infer<typeof adminUserPatchSchema>;
3065
+ type AdminUserListInput = z.infer<typeof adminUserListQuerySchema>;
3066
+ type AdminLicenseListQuery = PaginationQuery & {
3067
+ accountId?: string;
3068
+ host?: string;
3069
+ };
3070
+ type LicenseAssertionResponse = LicenseAssertion;
3071
+ type AccountOverviewResponse = AccountOverview;
3072
+ type AccountMembershipResponse = MembershipOverview;
3073
+ type AccountBillingResponse = BillingOverview;
3074
+ type AccountWalletResponse = AccountWallet;
3075
+ type LicenseListResponse = Page<BoundLicense>;
3076
+ type StoreListResponse = Page<CommerceStore>;
3077
+ type ProductListResponse = Page<CommerceProduct>;
3078
+ type OrderListResponse = Page<CommerceOrder>;
3079
+ type GiftCardListResponse = Page<StoreGiftCard>;
3080
+ type GiftCardCampaignListResponse = Page<GiftCardCampaign>;
3081
+ type WalletBalanceListResponse = Page<WalletBalance>;
3082
+ type WalletLedgerResponse = Page<WalletLedgerEntry>;
3083
+ type UsageSummaryResponse = UsageSummary;
3084
+
3085
+ type StoreFulfillmentEvent = {
3086
+ eventId: string;
3087
+ eventType: 'store.order_item.fulfilled' | 'store.subscription.renewed' | 'store.subscription.updated' | 'store.subscription.canceled' | 'store.subscription.expired';
3088
+ orderId: string;
3089
+ orderItemId: string;
3090
+ productId: string;
3091
+ productName: string;
3092
+ quantity: number;
3093
+ deliverable: Record<string, unknown>;
3094
+ target: Record<string, unknown> | null;
3095
+ context: {
3096
+ storeId: string;
3097
+ paymentProvider: 'stripe' | 'gift_card' | 'wallet' | null;
3098
+ stripePriceId?: string | null;
3099
+ stripePriceLookupKey?: string | null;
3100
+ stripePriceRecurring?: unknown;
3101
+ stripePriceMetadata?: Record<string, string>;
3102
+ stripeSubscriptionId?: string | null;
3103
+ stripeInvoiceId?: string | null;
3104
+ billingPeriodStart?: string | null;
3105
+ billingPeriodEnd?: string | null;
3106
+ };
3107
+ occurredAt: string;
3108
+ };
3109
+ type ZpanCloudEvent = StoreFulfillmentEvent;
3110
+
3111
+ export { type AccountBillingResponse, type AccountBillingRoute, type AccountMembershipResponse, type AccountMembershipRoute, type AccountOverview, type AccountOverviewResponse, type AccountOverviewRoute, type AccountUsageRoute, type AccountWallet, type AccountWalletResponse, type AccountWalletRoute, type AdminLicenseListQuery, type AdminLicensesRoute, type AdminStoresRoute, type AdminUser, type AdminUserListInput, type AdminUserListQuery, type AdminUserPatchRequest, type AdminUsersRoute, type AppType, type BillingOrderFulfillmentStatus, type BillingOrderPaymentStatus, type BillingOrderStatus, type BillingOverview, type BillingPortalSessionRequest, type BillingPortalSessionResponse, type BillingRecord, type BillingRecordItem, type BillingRecordKind, type BillingSummary, type BoundLicense, type CloudClient, type CloudClientOptions, CommerceOrder, CommerceProduct, CommerceStore, type CreateGiftCardRequest, type CreateGiftCardsRequest, type CreateOrderInput, type CreateProductInput, Deliverable, type EntitlementRefreshResponse, type EntitlementsRoute, type GiftCardCampaign, type GiftCardCampaignCreateRequest, type GiftCardCampaignListInput, type GiftCardCampaignListQuery, type GiftCardCampaignListResponse, type GiftCardCreateRequest, type GiftCardListInput, type GiftCardListQuery, type GiftCardListResponse, type GiftCardPatchRequest, type LicenseAssertion, type LicenseAssertionResponse, type LicenseListResponse, type LicensesRoute, type MembershipOverview, type MembershipPrimaryAction, type MembershipStatus, type MembershipStripeChannel, type MembershipTier, type MembershipViewState, type OffsetPage, type OrderListQuery, type OrderListResponse, type OrderPatchRequest, type Page, type PaginationQuery, type PairingActionRequest, type PairingActionResponse, type PairingCreateRequest, type PairingCreateResponse, type PairingPollResponse, type PairingPreview, type PairingStatus, type PairingsRoute, type PaymentCreateRequest, type PaymentCreateResponse, PaymentProvider, type ProductListQuery, type ProductListResponse, ProductType, type StoreFulfillmentEvent, type StoreGiftCard, type StoreGiftCardsRoute, type StoreListResponse, type StoreOrdersRoute, type StorePatchRequest, type StoreProductsRoute, StoreStatus, StoreType, type UpdateProductInput, type UsageEventCreateRequest, type UsageEventCreateResponse, type UsageEventsRoute, type UsageResource, type UsageResourceSummary, type UsageSummary, type UsageSummaryResponse, type WalletBalance, type WalletBalanceListResponse, type WalletLedgerEntry, type WalletLedgerResponse, type WalletRedemptionRequest, type WalletRedemptionResponse, type ZpanCloudEvent, adminUserListQuerySchema, adminUserPatchSchema, billingPortalSessionSchema, createCloudClient, createOrderSchema, createPairingSchema, createProductSchema, giftCardCampaignCreateSchema, giftCardCampaignListQuerySchema, giftCardCreateSchema, giftCardListQuerySchema, giftCardPatchSchema, orderPatchSchema, pairingActionSchema, paymentSchema, productListQuerySchema, storeFulfillmentEventSchema, storePatchSchema, updateProductSchema, usageEventCreateSchema, walletRedemptionSchema, zpanCloudEventSchema };