@mestra-dev/contract 0.0.146 → 0.0.147
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +347 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4364,6 +4364,8 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
4364
4364
|
"interval",
|
|
4365
4365
|
"billingCycles",
|
|
4366
4366
|
"createdAt",
|
|
4367
|
+
"subtotalKopecks",
|
|
4368
|
+
"discountKopecks",
|
|
4367
4369
|
"amountKopecks",
|
|
4368
4370
|
"currency",
|
|
4369
4371
|
"status"
|
|
@@ -4403,9 +4405,21 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
4403
4405
|
readonly type: "string";
|
|
4404
4406
|
readonly format: "date-time";
|
|
4405
4407
|
};
|
|
4408
|
+
readonly subtotalKopecks: {
|
|
4409
|
+
readonly type: "integer";
|
|
4410
|
+
readonly description: "Price before the coupon discount, in kopecks.";
|
|
4411
|
+
};
|
|
4412
|
+
readonly discountKopecks: {
|
|
4413
|
+
readonly type: "integer";
|
|
4414
|
+
readonly description: "Applied coupon discount, in kopecks.";
|
|
4415
|
+
};
|
|
4416
|
+
readonly couponCode: {
|
|
4417
|
+
readonly type: "string";
|
|
4418
|
+
readonly nullable: true;
|
|
4419
|
+
};
|
|
4406
4420
|
readonly amountKopecks: {
|
|
4407
4421
|
readonly type: "integer";
|
|
4408
|
-
readonly description: "
|
|
4422
|
+
readonly description: "Payable invoice amount after any coupon discount, in kopecks.";
|
|
4409
4423
|
};
|
|
4410
4424
|
readonly currency: {
|
|
4411
4425
|
readonly type: "string";
|
|
@@ -4437,6 +4451,8 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
4437
4451
|
"seats",
|
|
4438
4452
|
"interval",
|
|
4439
4453
|
"billingCycles",
|
|
4454
|
+
"subtotalKopecks",
|
|
4455
|
+
"discountKopecks",
|
|
4440
4456
|
"amountKopecks",
|
|
4441
4457
|
"currency"
|
|
4442
4458
|
];
|
|
@@ -4485,9 +4501,21 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
4485
4501
|
readonly billingCycles: {
|
|
4486
4502
|
readonly $ref: "#/components/schemas/BillingCycles";
|
|
4487
4503
|
};
|
|
4504
|
+
readonly subtotalKopecks: {
|
|
4505
|
+
readonly type: "integer";
|
|
4506
|
+
readonly description: "Price before the coupon discount, in kopecks.";
|
|
4507
|
+
};
|
|
4508
|
+
readonly discountKopecks: {
|
|
4509
|
+
readonly type: "integer";
|
|
4510
|
+
readonly description: "Applied coupon discount, in kopecks.";
|
|
4511
|
+
};
|
|
4512
|
+
readonly couponCode: {
|
|
4513
|
+
readonly type: "string";
|
|
4514
|
+
readonly nullable: true;
|
|
4515
|
+
};
|
|
4488
4516
|
readonly amountKopecks: {
|
|
4489
4517
|
readonly type: "integer";
|
|
4490
|
-
readonly description: "
|
|
4518
|
+
readonly description: "Payable invoice amount after any coupon discount, in kopecks.";
|
|
4491
4519
|
};
|
|
4492
4520
|
readonly currency: {
|
|
4493
4521
|
readonly type: "string";
|
|
@@ -8212,6 +8240,112 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
8212
8240
|
};
|
|
8213
8241
|
};
|
|
8214
8242
|
};
|
|
8243
|
+
readonly "/payments/invoice/{invoiceId}/coupon": {
|
|
8244
|
+
readonly post: {
|
|
8245
|
+
readonly tags: readonly [
|
|
8246
|
+
"Payments"
|
|
8247
|
+
];
|
|
8248
|
+
readonly summary: "Apply a coupon to a pending invoice";
|
|
8249
|
+
readonly description: "Workspace owner only. Applies a fixed or percentage coupon before checkout begins. Coupon attempts are rate limited; invalid codes intentionally return the same response.";
|
|
8250
|
+
readonly security: readonly [
|
|
8251
|
+
never
|
|
8252
|
+
];
|
|
8253
|
+
readonly parameters: readonly [
|
|
8254
|
+
{
|
|
8255
|
+
readonly name: "invoiceId";
|
|
8256
|
+
readonly in: "path";
|
|
8257
|
+
readonly required: true;
|
|
8258
|
+
readonly schema: {
|
|
8259
|
+
readonly type: "string";
|
|
8260
|
+
readonly format: "uuid";
|
|
8261
|
+
};
|
|
8262
|
+
}
|
|
8263
|
+
];
|
|
8264
|
+
readonly requestBody: {
|
|
8265
|
+
readonly required: true;
|
|
8266
|
+
readonly content: {
|
|
8267
|
+
readonly "application/json": {
|
|
8268
|
+
readonly schema: {
|
|
8269
|
+
readonly type: "object";
|
|
8270
|
+
readonly required: readonly [
|
|
8271
|
+
"code"
|
|
8272
|
+
];
|
|
8273
|
+
readonly properties: {
|
|
8274
|
+
readonly code: {
|
|
8275
|
+
readonly type: "string";
|
|
8276
|
+
readonly minLength: 3;
|
|
8277
|
+
readonly maxLength: 64;
|
|
8278
|
+
readonly pattern: "^[A-Za-z0-9_-]+$";
|
|
8279
|
+
};
|
|
8280
|
+
};
|
|
8281
|
+
};
|
|
8282
|
+
};
|
|
8283
|
+
};
|
|
8284
|
+
};
|
|
8285
|
+
readonly responses: {
|
|
8286
|
+
readonly 200: {
|
|
8287
|
+
readonly description: "Coupon applied.";
|
|
8288
|
+
readonly content: {
|
|
8289
|
+
readonly "application/json": {
|
|
8290
|
+
readonly schema: {
|
|
8291
|
+
readonly type: "object";
|
|
8292
|
+
readonly properties: {
|
|
8293
|
+
readonly success: {
|
|
8294
|
+
readonly type: "boolean";
|
|
8295
|
+
readonly const: true;
|
|
8296
|
+
};
|
|
8297
|
+
readonly invoice: {
|
|
8298
|
+
readonly type: "object";
|
|
8299
|
+
readonly properties: any;
|
|
8300
|
+
};
|
|
8301
|
+
};
|
|
8302
|
+
};
|
|
8303
|
+
};
|
|
8304
|
+
};
|
|
8305
|
+
};
|
|
8306
|
+
readonly 400: {
|
|
8307
|
+
readonly description: "Coupon cannot be applied.";
|
|
8308
|
+
readonly content: {
|
|
8309
|
+
readonly "application/json": {
|
|
8310
|
+
readonly schema: {
|
|
8311
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
8312
|
+
};
|
|
8313
|
+
};
|
|
8314
|
+
};
|
|
8315
|
+
};
|
|
8316
|
+
readonly 403: {
|
|
8317
|
+
readonly description: "Unauthorized.";
|
|
8318
|
+
readonly content: {
|
|
8319
|
+
readonly "application/json": {
|
|
8320
|
+
readonly schema: {
|
|
8321
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
8322
|
+
};
|
|
8323
|
+
};
|
|
8324
|
+
};
|
|
8325
|
+
};
|
|
8326
|
+
readonly 409: {
|
|
8327
|
+
readonly description: "Invoice is no longer eligible for a coupon.";
|
|
8328
|
+
readonly content: {
|
|
8329
|
+
readonly "application/json": {
|
|
8330
|
+
readonly schema: {
|
|
8331
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
8332
|
+
};
|
|
8333
|
+
};
|
|
8334
|
+
};
|
|
8335
|
+
};
|
|
8336
|
+
readonly 429: {
|
|
8337
|
+
readonly description: "Too many coupon attempts.";
|
|
8338
|
+
readonly content: {
|
|
8339
|
+
readonly "application/json": {
|
|
8340
|
+
readonly schema: {
|
|
8341
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
8342
|
+
};
|
|
8343
|
+
};
|
|
8344
|
+
};
|
|
8345
|
+
};
|
|
8346
|
+
};
|
|
8347
|
+
};
|
|
8348
|
+
};
|
|
8215
8349
|
readonly "/payments/upgrade": {
|
|
8216
8350
|
readonly post: {
|
|
8217
8351
|
readonly tags: readonly [
|
|
@@ -16406,6 +16540,176 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
16406
16540
|
status: 400 | 404;
|
|
16407
16541
|
};
|
|
16408
16542
|
};
|
|
16543
|
+
} & {
|
|
16544
|
+
"/admin/coupons": {
|
|
16545
|
+
$get: {
|
|
16546
|
+
input: {};
|
|
16547
|
+
output: {
|
|
16548
|
+
success: false;
|
|
16549
|
+
error: string;
|
|
16550
|
+
};
|
|
16551
|
+
outputFormat: "json";
|
|
16552
|
+
status: 401;
|
|
16553
|
+
} | {
|
|
16554
|
+
input: {};
|
|
16555
|
+
output: {
|
|
16556
|
+
success: true;
|
|
16557
|
+
coupons: {
|
|
16558
|
+
id: string;
|
|
16559
|
+
code: string;
|
|
16560
|
+
discountType: string;
|
|
16561
|
+
fixedKopecks: number | null;
|
|
16562
|
+
percent: number | null;
|
|
16563
|
+
active: boolean;
|
|
16564
|
+
expiresAt: string | null;
|
|
16565
|
+
maxRedemptions: number | null;
|
|
16566
|
+
redemptionCount: number;
|
|
16567
|
+
createdAt: string;
|
|
16568
|
+
}[];
|
|
16569
|
+
};
|
|
16570
|
+
outputFormat: "json";
|
|
16571
|
+
status: 200;
|
|
16572
|
+
};
|
|
16573
|
+
};
|
|
16574
|
+
} & {
|
|
16575
|
+
"/admin/coupons": {
|
|
16576
|
+
$post: {
|
|
16577
|
+
input: {};
|
|
16578
|
+
output: {
|
|
16579
|
+
success: false;
|
|
16580
|
+
error: string;
|
|
16581
|
+
};
|
|
16582
|
+
outputFormat: "json";
|
|
16583
|
+
status: 401;
|
|
16584
|
+
} | {
|
|
16585
|
+
input: {};
|
|
16586
|
+
output: {
|
|
16587
|
+
success: true;
|
|
16588
|
+
coupon: {
|
|
16589
|
+
expiresAt: string | null;
|
|
16590
|
+
id: string;
|
|
16591
|
+
created_at: string;
|
|
16592
|
+
active: boolean;
|
|
16593
|
+
code: string;
|
|
16594
|
+
updated_at: string | null;
|
|
16595
|
+
deleted_at: string | null;
|
|
16596
|
+
verified_at: string | null;
|
|
16597
|
+
suspended_at: string | null;
|
|
16598
|
+
discountType: string;
|
|
16599
|
+
fixedKopecks: number | null;
|
|
16600
|
+
percent: number | null;
|
|
16601
|
+
maxRedemptions: number | null;
|
|
16602
|
+
redemptionCount: number;
|
|
16603
|
+
createdBy: string;
|
|
16604
|
+
};
|
|
16605
|
+
};
|
|
16606
|
+
outputFormat: "json";
|
|
16607
|
+
status: 201;
|
|
16608
|
+
} | {
|
|
16609
|
+
input: {};
|
|
16610
|
+
output: {
|
|
16611
|
+
success: false;
|
|
16612
|
+
error: string;
|
|
16613
|
+
};
|
|
16614
|
+
outputFormat: "json";
|
|
16615
|
+
status: 400 | 409;
|
|
16616
|
+
};
|
|
16617
|
+
};
|
|
16618
|
+
} & {
|
|
16619
|
+
"/admin/coupons/:couponId": {
|
|
16620
|
+
$patch: {
|
|
16621
|
+
input: {
|
|
16622
|
+
param: {
|
|
16623
|
+
couponId: string;
|
|
16624
|
+
};
|
|
16625
|
+
};
|
|
16626
|
+
output: {
|
|
16627
|
+
success: false;
|
|
16628
|
+
error: string;
|
|
16629
|
+
};
|
|
16630
|
+
outputFormat: "json";
|
|
16631
|
+
status: 401;
|
|
16632
|
+
} | {
|
|
16633
|
+
input: {
|
|
16634
|
+
param: {
|
|
16635
|
+
couponId: string;
|
|
16636
|
+
};
|
|
16637
|
+
};
|
|
16638
|
+
output: {
|
|
16639
|
+
success: true;
|
|
16640
|
+
coupon: {
|
|
16641
|
+
updated_at: string | null;
|
|
16642
|
+
deleted_at: string | null;
|
|
16643
|
+
verified_at: string | null;
|
|
16644
|
+
suspended_at: string | null;
|
|
16645
|
+
created_at: string;
|
|
16646
|
+
id: string;
|
|
16647
|
+
code: string;
|
|
16648
|
+
discountType: string;
|
|
16649
|
+
fixedKopecks: number | null;
|
|
16650
|
+
percent: number | null;
|
|
16651
|
+
active: boolean;
|
|
16652
|
+
expiresAt: string | null;
|
|
16653
|
+
maxRedemptions: number | null;
|
|
16654
|
+
redemptionCount: number;
|
|
16655
|
+
createdBy: string;
|
|
16656
|
+
};
|
|
16657
|
+
};
|
|
16658
|
+
outputFormat: "json";
|
|
16659
|
+
status: 200;
|
|
16660
|
+
} | {
|
|
16661
|
+
input: {
|
|
16662
|
+
param: {
|
|
16663
|
+
couponId: string;
|
|
16664
|
+
};
|
|
16665
|
+
};
|
|
16666
|
+
output: {
|
|
16667
|
+
success: false;
|
|
16668
|
+
error: string;
|
|
16669
|
+
};
|
|
16670
|
+
outputFormat: "json";
|
|
16671
|
+
status: 400 | 404;
|
|
16672
|
+
};
|
|
16673
|
+
};
|
|
16674
|
+
} & {
|
|
16675
|
+
"/admin/coupons/:couponId": {
|
|
16676
|
+
$delete: {
|
|
16677
|
+
input: {
|
|
16678
|
+
param: {
|
|
16679
|
+
couponId: string;
|
|
16680
|
+
};
|
|
16681
|
+
};
|
|
16682
|
+
output: {
|
|
16683
|
+
success: false;
|
|
16684
|
+
error: string;
|
|
16685
|
+
};
|
|
16686
|
+
outputFormat: "json";
|
|
16687
|
+
status: 401;
|
|
16688
|
+
} | {
|
|
16689
|
+
input: {
|
|
16690
|
+
param: {
|
|
16691
|
+
couponId: string;
|
|
16692
|
+
};
|
|
16693
|
+
};
|
|
16694
|
+
output: {
|
|
16695
|
+
success: true;
|
|
16696
|
+
};
|
|
16697
|
+
outputFormat: "json";
|
|
16698
|
+
status: 200;
|
|
16699
|
+
} | {
|
|
16700
|
+
input: {
|
|
16701
|
+
param: {
|
|
16702
|
+
couponId: string;
|
|
16703
|
+
};
|
|
16704
|
+
};
|
|
16705
|
+
output: {
|
|
16706
|
+
success: false;
|
|
16707
|
+
error: string;
|
|
16708
|
+
};
|
|
16709
|
+
outputFormat: "json";
|
|
16710
|
+
status: 404;
|
|
16711
|
+
};
|
|
16712
|
+
};
|
|
16409
16713
|
} & {
|
|
16410
16714
|
"/create": {
|
|
16411
16715
|
$post: {
|
|
@@ -16516,6 +16820,9 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
16516
16820
|
interval: string;
|
|
16517
16821
|
billingCycles: number;
|
|
16518
16822
|
amountKopecks: number;
|
|
16823
|
+
subtotalKopecks: number;
|
|
16824
|
+
discountKopecks: number;
|
|
16825
|
+
couponCode: string | null;
|
|
16519
16826
|
currency: string;
|
|
16520
16827
|
periodStart: string;
|
|
16521
16828
|
periodEnd: string;
|
|
@@ -23159,6 +23466,9 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
23159
23466
|
planName: string;
|
|
23160
23467
|
interval: string;
|
|
23161
23468
|
billingCycles: number;
|
|
23469
|
+
subtotalKopecks: number;
|
|
23470
|
+
discountKopecks: number;
|
|
23471
|
+
couponCode: string | null;
|
|
23162
23472
|
amountKopecks: number;
|
|
23163
23473
|
currency: string;
|
|
23164
23474
|
status: string;
|
|
@@ -23197,6 +23507,41 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
23197
23507
|
status: 400 | 403 | 404 | 409 | 502 | 503;
|
|
23198
23508
|
};
|
|
23199
23509
|
};
|
|
23510
|
+
} & {
|
|
23511
|
+
"/invoice/:invoiceId/coupon": {
|
|
23512
|
+
$post: {
|
|
23513
|
+
input: {
|
|
23514
|
+
param: {
|
|
23515
|
+
invoiceId: string;
|
|
23516
|
+
};
|
|
23517
|
+
};
|
|
23518
|
+
output: {
|
|
23519
|
+
success: true;
|
|
23520
|
+
invoice: {
|
|
23521
|
+
id: string;
|
|
23522
|
+
subtotalKopecks: number;
|
|
23523
|
+
discountKopecks: number;
|
|
23524
|
+
amountKopecks: number;
|
|
23525
|
+
couponCode: string | null;
|
|
23526
|
+
status: string;
|
|
23527
|
+
};
|
|
23528
|
+
};
|
|
23529
|
+
outputFormat: "json";
|
|
23530
|
+
status: 200;
|
|
23531
|
+
} | {
|
|
23532
|
+
input: {
|
|
23533
|
+
param: {
|
|
23534
|
+
invoiceId: string;
|
|
23535
|
+
};
|
|
23536
|
+
};
|
|
23537
|
+
output: {
|
|
23538
|
+
success: false;
|
|
23539
|
+
error: string;
|
|
23540
|
+
};
|
|
23541
|
+
outputFormat: "json";
|
|
23542
|
+
status: 400 | 403 | 404 | 409;
|
|
23543
|
+
};
|
|
23544
|
+
};
|
|
23200
23545
|
} & {
|
|
23201
23546
|
"/upgrade": {
|
|
23202
23547
|
$post: {
|