@mestra-dev/contract 0.0.76 → 0.0.78

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +165 -1
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -3345,6 +3345,66 @@ declare const routes: import("hono/hono-base").HonoBase<{
3345
3345
  };
3346
3346
  };
3347
3347
  };
3348
+ readonly BillingHistoryInvoice: {
3349
+ readonly type: "object";
3350
+ readonly required: readonly [
3351
+ "id",
3352
+ "workspaceId",
3353
+ "workspaceName",
3354
+ "planName",
3355
+ "interval",
3356
+ "billingCycles",
3357
+ "createdAt",
3358
+ "amountKopecks",
3359
+ "currency",
3360
+ "status"
3361
+ ];
3362
+ readonly properties: {
3363
+ readonly id: {
3364
+ readonly type: "string";
3365
+ readonly format: "uuid";
3366
+ };
3367
+ readonly workspaceId: {
3368
+ readonly type: "string";
3369
+ readonly format: "uuid";
3370
+ };
3371
+ readonly workspaceName: {
3372
+ readonly type: "string";
3373
+ };
3374
+ readonly planName: {
3375
+ readonly type: "string";
3376
+ };
3377
+ readonly interval: {
3378
+ readonly $ref: "#/components/schemas/BillingInterval";
3379
+ };
3380
+ readonly billingCycles: {
3381
+ readonly $ref: "#/components/schemas/BillingCycles";
3382
+ };
3383
+ readonly createdAt: {
3384
+ readonly type: "string";
3385
+ readonly format: "date-time";
3386
+ };
3387
+ readonly amountKopecks: {
3388
+ readonly type: "integer";
3389
+ readonly description: "Full invoice amount in kopecks.";
3390
+ };
3391
+ readonly currency: {
3392
+ readonly type: "string";
3393
+ readonly enum: readonly [
3394
+ "RUB"
3395
+ ];
3396
+ };
3397
+ readonly status: {
3398
+ readonly type: "string";
3399
+ readonly enum: readonly [
3400
+ "pending",
3401
+ "paid",
3402
+ "canceled",
3403
+ "failed"
3404
+ ];
3405
+ };
3406
+ };
3407
+ };
3348
3408
  readonly BillingInvoice: {
3349
3409
  readonly type: "object";
3350
3410
  readonly required: readonly [
@@ -5459,7 +5519,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
5459
5519
  "Workspace"
5460
5520
  ];
5461
5521
  readonly summary: "Get workspace billing state";
5462
- readonly description: "Owner-only. For a frozen Free trial, includes usage and plan-fit recommendations. Paid workspaces receive subscription and pending-invoice state only.";
5522
+ readonly description: "Owner-only. If a pending invoice has a YooKassa payment that already succeeded, this GET confirms it (so post-checkout polling does not wait on the webhook). For a frozen Free trial, includes usage and plan-fit recommendations. Paid workspaces receive subscription and pending-invoice state only.";
5463
5523
  readonly security: readonly [
5464
5524
  never
5465
5525
  ];
@@ -6784,6 +6844,77 @@ declare const routes: import("hono/hono-base").HonoBase<{
6784
6844
  };
6785
6845
  };
6786
6846
  };
6847
+ readonly "/payments/history": {
6848
+ readonly get: {
6849
+ readonly tags: readonly [
6850
+ "Payments"
6851
+ ];
6852
+ readonly summary: "List billing history for the signed-in owner";
6853
+ readonly description: "Returns every subscription invoice for workspaces owned by the caller, newest first. Includes invoices for soft-deleted workspaces. Optional month=YYYY-MM filters by invoice creation month (UTC).";
6854
+ readonly security: readonly [
6855
+ never
6856
+ ];
6857
+ readonly parameters: readonly [
6858
+ {
6859
+ readonly name: "month";
6860
+ readonly in: "query";
6861
+ readonly required: false;
6862
+ readonly schema: {
6863
+ readonly type: "string";
6864
+ readonly pattern: "^\\d{4}-(0[1-9]|1[0-2])$";
6865
+ readonly example: "2026-07";
6866
+ };
6867
+ readonly description: "Filter invoices created in this UTC month. Omit for all months.";
6868
+ }
6869
+ ];
6870
+ readonly responses: {
6871
+ readonly 200: {
6872
+ readonly description: "Invoice history.";
6873
+ readonly content: {
6874
+ readonly "application/json": {
6875
+ readonly schema: {
6876
+ readonly type: "object";
6877
+ readonly required: readonly [
6878
+ "success",
6879
+ "invoices"
6880
+ ];
6881
+ readonly properties: {
6882
+ readonly success: {
6883
+ readonly type: "boolean";
6884
+ readonly const: true;
6885
+ };
6886
+ readonly invoices: {
6887
+ readonly type: "array";
6888
+ readonly items: any;
6889
+ };
6890
+ };
6891
+ };
6892
+ };
6893
+ };
6894
+ };
6895
+ readonly 400: {
6896
+ readonly description: "Invalid month query.";
6897
+ readonly content: {
6898
+ readonly "application/json": {
6899
+ readonly schema: {
6900
+ readonly $ref: "#/components/schemas/ErrorResponse";
6901
+ };
6902
+ };
6903
+ };
6904
+ };
6905
+ readonly 401: {
6906
+ readonly description: "Unauthorized.";
6907
+ readonly content: {
6908
+ readonly "application/json": {
6909
+ readonly schema: {
6910
+ readonly $ref: "#/components/schemas/ErrorResponse";
6911
+ };
6912
+ };
6913
+ };
6914
+ };
6915
+ };
6916
+ };
6917
+ };
6787
6918
  readonly "/payments/invoice/{invoiceId}/pay": {
6788
6919
  readonly post: {
6789
6920
  readonly tags: readonly [
@@ -19308,6 +19439,39 @@ declare const routes: import("hono/hono-base").HonoBase<{
19308
19439
  };
19309
19440
  };
19310
19441
  }, "/notifications"> | import("hono/types").MergeSchemaPath<{
19442
+ "/history": {
19443
+ $get: {
19444
+ input: {};
19445
+ output: {
19446
+ success: false;
19447
+ error: {
19448
+ [x: string]: import("hono/utils/types").JSONValue;
19449
+ };
19450
+ };
19451
+ outputFormat: "json";
19452
+ status: 400;
19453
+ } | {
19454
+ input: {};
19455
+ output: {
19456
+ success: true;
19457
+ invoices: {
19458
+ createdAt: string;
19459
+ id: string;
19460
+ workspaceId: string;
19461
+ workspaceName: string;
19462
+ planName: string;
19463
+ interval: string;
19464
+ billingCycles: number;
19465
+ amountKopecks: number;
19466
+ currency: string;
19467
+ status: string;
19468
+ }[];
19469
+ };
19470
+ outputFormat: "json";
19471
+ status: 200;
19472
+ };
19473
+ };
19474
+ } & {
19311
19475
  "/invoice/:invoiceId/pay": {
19312
19476
  $post: {
19313
19477
  input: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mestra-dev/contract",
3
- "version": "0.0.76",
3
+ "version": "0.0.78",
4
4
  "description": "Types-only Hono AppType contract for the Mestra auth API",
5
5
  "type": "module",
6
6
  "sideEffects": false,