@mestra-dev/contract 0.0.147 → 0.0.149
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 +108 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -8246,7 +8246,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
8246
8246
|
"Payments"
|
|
8247
8247
|
];
|
|
8248
8248
|
readonly summary: "Apply a coupon to a pending invoice";
|
|
8249
|
-
readonly description: "Workspace owner only. Applies a fixed or percentage coupon
|
|
8249
|
+
readonly description: "Workspace owner only. Applies a fixed or percentage coupon. If an unpaid YooKassa checkout exists, it is canceled and replaced with the discounted invoice amount; paid or unresolved provider payments remain blocked. Coupon attempts are rate limited; invalid codes intentionally return the same response.";
|
|
8250
8250
|
readonly security: readonly [
|
|
8251
8251
|
never
|
|
8252
8252
|
];
|
|
@@ -8345,6 +8345,78 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
8345
8345
|
};
|
|
8346
8346
|
};
|
|
8347
8347
|
};
|
|
8348
|
+
readonly delete: {
|
|
8349
|
+
readonly tags: readonly [
|
|
8350
|
+
"Payments"
|
|
8351
|
+
];
|
|
8352
|
+
readonly summary: "Remove a coupon from a pending invoice";
|
|
8353
|
+
readonly description: "Workspace owner only. Removes the invoice redemption and restores the full invoice amount. It is unavailable after YooKassa checkout has started.";
|
|
8354
|
+
readonly security: readonly [
|
|
8355
|
+
never
|
|
8356
|
+
];
|
|
8357
|
+
readonly parameters: readonly [
|
|
8358
|
+
{
|
|
8359
|
+
readonly name: "invoiceId";
|
|
8360
|
+
readonly in: "path";
|
|
8361
|
+
readonly required: true;
|
|
8362
|
+
readonly schema: {
|
|
8363
|
+
readonly type: "string";
|
|
8364
|
+
readonly format: "uuid";
|
|
8365
|
+
};
|
|
8366
|
+
}
|
|
8367
|
+
];
|
|
8368
|
+
readonly responses: {
|
|
8369
|
+
readonly 200: {
|
|
8370
|
+
readonly description: "Coupon removed.";
|
|
8371
|
+
readonly content: {
|
|
8372
|
+
readonly "application/json": {
|
|
8373
|
+
readonly schema: {
|
|
8374
|
+
readonly type: "object";
|
|
8375
|
+
readonly properties: {
|
|
8376
|
+
readonly success: {
|
|
8377
|
+
readonly type: "boolean";
|
|
8378
|
+
readonly const: true;
|
|
8379
|
+
};
|
|
8380
|
+
readonly invoice: {
|
|
8381
|
+
readonly $ref: "#/components/schemas/BillingInvoice";
|
|
8382
|
+
};
|
|
8383
|
+
};
|
|
8384
|
+
};
|
|
8385
|
+
};
|
|
8386
|
+
};
|
|
8387
|
+
};
|
|
8388
|
+
readonly 404: {
|
|
8389
|
+
readonly description: "Invoice not found.";
|
|
8390
|
+
readonly content: {
|
|
8391
|
+
readonly "application/json": {
|
|
8392
|
+
readonly schema: {
|
|
8393
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
8394
|
+
};
|
|
8395
|
+
};
|
|
8396
|
+
};
|
|
8397
|
+
};
|
|
8398
|
+
readonly 409: {
|
|
8399
|
+
readonly description: "No coupon is applied or checkout has started.";
|
|
8400
|
+
readonly content: {
|
|
8401
|
+
readonly "application/json": {
|
|
8402
|
+
readonly schema: {
|
|
8403
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
8404
|
+
};
|
|
8405
|
+
};
|
|
8406
|
+
};
|
|
8407
|
+
};
|
|
8408
|
+
readonly 429: {
|
|
8409
|
+
readonly description: "Too many requests.";
|
|
8410
|
+
readonly content: {
|
|
8411
|
+
readonly "application/json": {
|
|
8412
|
+
readonly schema: {
|
|
8413
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
8414
|
+
};
|
|
8415
|
+
};
|
|
8416
|
+
};
|
|
8417
|
+
};
|
|
8418
|
+
};
|
|
8419
|
+
};
|
|
8348
8420
|
};
|
|
8349
8421
|
readonly "/payments/upgrade": {
|
|
8350
8422
|
readonly post: {
|
|
@@ -23542,6 +23614,41 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
23542
23614
|
status: 400 | 403 | 404 | 409;
|
|
23543
23615
|
};
|
|
23544
23616
|
};
|
|
23617
|
+
} & {
|
|
23618
|
+
"/invoice/:invoiceId/coupon": {
|
|
23619
|
+
$delete: {
|
|
23620
|
+
input: {
|
|
23621
|
+
param: {
|
|
23622
|
+
invoiceId: string;
|
|
23623
|
+
};
|
|
23624
|
+
};
|
|
23625
|
+
output: {
|
|
23626
|
+
success: true;
|
|
23627
|
+
invoice: {
|
|
23628
|
+
id: string;
|
|
23629
|
+
subtotalKopecks: number;
|
|
23630
|
+
discountKopecks: number;
|
|
23631
|
+
amountKopecks: number;
|
|
23632
|
+
couponCode: string | null;
|
|
23633
|
+
status: string;
|
|
23634
|
+
};
|
|
23635
|
+
};
|
|
23636
|
+
outputFormat: "json";
|
|
23637
|
+
status: 200;
|
|
23638
|
+
} | {
|
|
23639
|
+
input: {
|
|
23640
|
+
param: {
|
|
23641
|
+
invoiceId: string;
|
|
23642
|
+
};
|
|
23643
|
+
};
|
|
23644
|
+
output: {
|
|
23645
|
+
success: false;
|
|
23646
|
+
error: string;
|
|
23647
|
+
};
|
|
23648
|
+
outputFormat: "json";
|
|
23649
|
+
status: 400 | 403 | 404 | 409;
|
|
23650
|
+
};
|
|
23651
|
+
};
|
|
23545
23652
|
} & {
|
|
23546
23653
|
"/upgrade": {
|
|
23547
23654
|
$post: {
|