@mestra-dev/contract 0.0.140 → 0.0.141
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 +381 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -26,8 +26,8 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
26
26
|
readonly openapi: "3.0.3";
|
|
27
27
|
readonly info: {
|
|
28
28
|
readonly title: "Auth Service API";
|
|
29
|
-
readonly version: "1.5.
|
|
30
|
-
readonly description: "OpenAPI specification for the Auth, Integrations, Workspace, Payments, Tasks, Templates, Tags, Comments, Assignees, Chat, Events, Billings, Files, and Notifications endpoints exposed by the k3-core platform. Unhandled HTTPException and unexpected errors are normalized by the global error handler to `{ success: false, error: string }` (status preserved for HTTPException; 500 otherwise).";
|
|
29
|
+
readonly version: "1.5.11";
|
|
30
|
+
readonly description: "OpenAPI specification for the Auth, Integrations, Workspace, Payments, Tasks, Templates, Tags, Comments, Assignees, Chat, Events, Billings, CInvoices, Files, and Notifications endpoints exposed by the k3-core platform. Unhandled HTTPException and unexpected errors are normalized by the global error handler to `{ success: false, error: string }` (status preserved for HTTPException; 500 otherwise).";
|
|
31
31
|
};
|
|
32
32
|
readonly servers: readonly [
|
|
33
33
|
{
|
|
@@ -96,6 +96,10 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
96
96
|
readonly name: "Billings";
|
|
97
97
|
readonly description: "Billing/requisite management endpoints";
|
|
98
98
|
},
|
|
99
|
+
{
|
|
100
|
+
readonly name: "CInvoices";
|
|
101
|
+
readonly description: "Customer invoice create for real-estate workspaces. Requires workspace access and write access to crm::customers. Seller billing, customer, and service must belong to the workspace.";
|
|
102
|
+
},
|
|
99
103
|
{
|
|
100
104
|
readonly name: "Files";
|
|
101
105
|
readonly description: "S3 file upload (presigned POST to a temporary `.tmp` key), confirm (magic-byte validation then promote to final key), optional nested folder destination under `{workspace}/folders/{path}/`, profile and workspace picture upload/confirm/delete, comment attachment upload/confirm, list task comment files with download URLs, service file upload/confirm/delete, list service files with download URLs, folder create/delete (nested paths), list (includes pin metadata; excludes `.tmp` objects), storage usage, pin/unpin, download by relative path, move, and file delete. General uploads accept JPEG/PNG/WebP/PDF; profile/workspace pictures accept JPEG/PNG only (0.5 MB). Workspace file routes require active collaborator status and crm::files access; comment attachments require crm::tasks write/read; service files require crm::services write/read.";
|
|
@@ -4025,6 +4029,153 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
4025
4029
|
};
|
|
4026
4030
|
};
|
|
4027
4031
|
};
|
|
4032
|
+
readonly CInvoice: {
|
|
4033
|
+
readonly type: "object";
|
|
4034
|
+
readonly required: readonly [
|
|
4035
|
+
"id",
|
|
4036
|
+
"workspaceId",
|
|
4037
|
+
"invoiceId",
|
|
4038
|
+
"serviceId",
|
|
4039
|
+
"SellerBillingId",
|
|
4040
|
+
"customerId",
|
|
4041
|
+
"date",
|
|
4042
|
+
"language",
|
|
4043
|
+
"currency",
|
|
4044
|
+
"vatOption",
|
|
4045
|
+
"unitName",
|
|
4046
|
+
"unitPrice",
|
|
4047
|
+
"unitQuantity",
|
|
4048
|
+
"created_by"
|
|
4049
|
+
];
|
|
4050
|
+
readonly properties: {
|
|
4051
|
+
readonly id: {
|
|
4052
|
+
readonly type: "string";
|
|
4053
|
+
readonly format: "uuid";
|
|
4054
|
+
};
|
|
4055
|
+
readonly workspaceId: {
|
|
4056
|
+
readonly type: "string";
|
|
4057
|
+
readonly format: "uuid";
|
|
4058
|
+
};
|
|
4059
|
+
readonly invoiceId: {
|
|
4060
|
+
readonly type: "string";
|
|
4061
|
+
readonly description: "User-facing invoice number.";
|
|
4062
|
+
};
|
|
4063
|
+
readonly serviceId: {
|
|
4064
|
+
readonly type: "string";
|
|
4065
|
+
readonly format: "uuid";
|
|
4066
|
+
readonly description: "Real-estate service identifier (service_real_estates).";
|
|
4067
|
+
};
|
|
4068
|
+
readonly SellerBillingId: {
|
|
4069
|
+
readonly type: "string";
|
|
4070
|
+
readonly format: "uuid";
|
|
4071
|
+
readonly description: "Seller billing/requisites identifier.";
|
|
4072
|
+
};
|
|
4073
|
+
readonly customerId: {
|
|
4074
|
+
readonly type: "string";
|
|
4075
|
+
readonly format: "uuid";
|
|
4076
|
+
readonly description: "Real-estate customer identifier (customer_real_estates).";
|
|
4077
|
+
};
|
|
4078
|
+
readonly date: {
|
|
4079
|
+
readonly type: "string";
|
|
4080
|
+
readonly format: "date-time";
|
|
4081
|
+
};
|
|
4082
|
+
readonly language: {
|
|
4083
|
+
readonly type: "string";
|
|
4084
|
+
readonly enum: readonly [
|
|
4085
|
+
"ru",
|
|
4086
|
+
"en"
|
|
4087
|
+
];
|
|
4088
|
+
};
|
|
4089
|
+
readonly currency: {
|
|
4090
|
+
readonly type: "string";
|
|
4091
|
+
readonly enum: readonly [
|
|
4092
|
+
"RUB",
|
|
4093
|
+
"USD",
|
|
4094
|
+
"EUR"
|
|
4095
|
+
];
|
|
4096
|
+
};
|
|
4097
|
+
readonly vatOption: {
|
|
4098
|
+
readonly type: "string";
|
|
4099
|
+
readonly enum: readonly [
|
|
4100
|
+
"vat_included",
|
|
4101
|
+
"vat_excluded"
|
|
4102
|
+
];
|
|
4103
|
+
};
|
|
4104
|
+
readonly vatRate: {
|
|
4105
|
+
readonly type: "integer";
|
|
4106
|
+
readonly nullable: true;
|
|
4107
|
+
readonly minimum: 0;
|
|
4108
|
+
readonly maximum: 100;
|
|
4109
|
+
};
|
|
4110
|
+
readonly buyerInn: {
|
|
4111
|
+
readonly type: "string";
|
|
4112
|
+
readonly nullable: true;
|
|
4113
|
+
};
|
|
4114
|
+
readonly buyerKpp: {
|
|
4115
|
+
readonly type: "string";
|
|
4116
|
+
readonly nullable: true;
|
|
4117
|
+
};
|
|
4118
|
+
readonly unitName: {
|
|
4119
|
+
readonly type: "string";
|
|
4120
|
+
};
|
|
4121
|
+
readonly unitPrice: {
|
|
4122
|
+
readonly type: "integer";
|
|
4123
|
+
readonly minimum: 0;
|
|
4124
|
+
};
|
|
4125
|
+
readonly unitQuantity: {
|
|
4126
|
+
readonly type: "integer";
|
|
4127
|
+
readonly minimum: 1;
|
|
4128
|
+
};
|
|
4129
|
+
readonly notes: {
|
|
4130
|
+
readonly type: "string";
|
|
4131
|
+
readonly nullable: true;
|
|
4132
|
+
};
|
|
4133
|
+
readonly discount: {
|
|
4134
|
+
readonly type: "integer";
|
|
4135
|
+
readonly nullable: true;
|
|
4136
|
+
readonly minimum: 0;
|
|
4137
|
+
};
|
|
4138
|
+
readonly created_by: {
|
|
4139
|
+
readonly type: "string";
|
|
4140
|
+
readonly format: "uuid";
|
|
4141
|
+
};
|
|
4142
|
+
readonly created_at: {
|
|
4143
|
+
readonly type: "string";
|
|
4144
|
+
readonly format: "date-time";
|
|
4145
|
+
readonly nullable: true;
|
|
4146
|
+
};
|
|
4147
|
+
readonly updated_at: {
|
|
4148
|
+
readonly type: "string";
|
|
4149
|
+
readonly format: "date-time";
|
|
4150
|
+
readonly nullable: true;
|
|
4151
|
+
};
|
|
4152
|
+
readonly deleted_at: {
|
|
4153
|
+
readonly type: "string";
|
|
4154
|
+
readonly format: "date-time";
|
|
4155
|
+
readonly nullable: true;
|
|
4156
|
+
};
|
|
4157
|
+
};
|
|
4158
|
+
};
|
|
4159
|
+
readonly CreateCInvoiceSuccess: {
|
|
4160
|
+
readonly type: "object";
|
|
4161
|
+
readonly required: readonly [
|
|
4162
|
+
"success",
|
|
4163
|
+
"cinvoice"
|
|
4164
|
+
];
|
|
4165
|
+
readonly properties: {
|
|
4166
|
+
readonly success: {
|
|
4167
|
+
readonly type: "boolean";
|
|
4168
|
+
readonly const: true;
|
|
4169
|
+
};
|
|
4170
|
+
readonly cinvoice: {
|
|
4171
|
+
readonly type: "array";
|
|
4172
|
+
readonly items: {
|
|
4173
|
+
readonly $ref: "#/components/schemas/CInvoice";
|
|
4174
|
+
};
|
|
4175
|
+
readonly description: "Created invoice(s) from insert returning.";
|
|
4176
|
+
};
|
|
4177
|
+
};
|
|
4178
|
+
};
|
|
4028
4179
|
readonly BillingInterval: {
|
|
4029
4180
|
readonly type: "string";
|
|
4030
4181
|
readonly enum: readonly [
|
|
@@ -12084,6 +12235,181 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
12084
12235
|
};
|
|
12085
12236
|
};
|
|
12086
12237
|
};
|
|
12238
|
+
readonly "/cinvoices/create": {
|
|
12239
|
+
readonly post: {
|
|
12240
|
+
readonly tags: readonly [
|
|
12241
|
+
"CInvoices"
|
|
12242
|
+
];
|
|
12243
|
+
readonly summary: "Create a customer invoice";
|
|
12244
|
+
readonly description: "Creates a customer invoice in the specified workspace. Real-estate workspaces require an existing seller billing, customer_real_estates lead, and service_real_estates listing in the same workspace. created_by is taken from the access token. Requires workspace access and write access to crm::customers. Other workspace categories return 400.";
|
|
12245
|
+
readonly security: readonly [
|
|
12246
|
+
never
|
|
12247
|
+
];
|
|
12248
|
+
readonly requestBody: {
|
|
12249
|
+
readonly required: true;
|
|
12250
|
+
readonly content: {
|
|
12251
|
+
readonly "application/json": {
|
|
12252
|
+
readonly schema: {
|
|
12253
|
+
readonly type: "object";
|
|
12254
|
+
readonly required: readonly [
|
|
12255
|
+
"workspace",
|
|
12256
|
+
"invoiceId",
|
|
12257
|
+
"serviceId",
|
|
12258
|
+
"SellerBillingId",
|
|
12259
|
+
"customerId",
|
|
12260
|
+
"date",
|
|
12261
|
+
"language",
|
|
12262
|
+
"currency",
|
|
12263
|
+
"vatOption",
|
|
12264
|
+
"unitName",
|
|
12265
|
+
"unitPrice",
|
|
12266
|
+
"unitQuantity"
|
|
12267
|
+
];
|
|
12268
|
+
readonly properties: {
|
|
12269
|
+
readonly workspace: {
|
|
12270
|
+
readonly type: "string";
|
|
12271
|
+
readonly format: "uuid";
|
|
12272
|
+
readonly description: "Workspace identifier where the invoice is created.";
|
|
12273
|
+
};
|
|
12274
|
+
readonly invoiceId: {
|
|
12275
|
+
readonly type: "string";
|
|
12276
|
+
readonly description: "User-facing invoice number.";
|
|
12277
|
+
};
|
|
12278
|
+
readonly serviceId: {
|
|
12279
|
+
readonly type: "string";
|
|
12280
|
+
readonly format: "uuid";
|
|
12281
|
+
readonly description: "Real-estate service identifier.";
|
|
12282
|
+
};
|
|
12283
|
+
readonly SellerBillingId: {
|
|
12284
|
+
readonly type: "string";
|
|
12285
|
+
readonly format: "uuid";
|
|
12286
|
+
readonly description: "Seller billing/requisites identifier.";
|
|
12287
|
+
};
|
|
12288
|
+
readonly customerId: {
|
|
12289
|
+
readonly type: "string";
|
|
12290
|
+
readonly format: "uuid";
|
|
12291
|
+
readonly description: "Real-estate customer identifier.";
|
|
12292
|
+
};
|
|
12293
|
+
readonly date: {
|
|
12294
|
+
readonly type: "string";
|
|
12295
|
+
readonly format: "date-time";
|
|
12296
|
+
readonly description: "Invoice date.";
|
|
12297
|
+
};
|
|
12298
|
+
readonly language: {
|
|
12299
|
+
readonly type: "string";
|
|
12300
|
+
readonly enum: readonly [
|
|
12301
|
+
"ru",
|
|
12302
|
+
"en"
|
|
12303
|
+
];
|
|
12304
|
+
};
|
|
12305
|
+
readonly currency: {
|
|
12306
|
+
readonly type: "string";
|
|
12307
|
+
readonly enum: readonly [
|
|
12308
|
+
"RUB",
|
|
12309
|
+
"USD",
|
|
12310
|
+
"EUR"
|
|
12311
|
+
];
|
|
12312
|
+
};
|
|
12313
|
+
readonly vatOption: {
|
|
12314
|
+
readonly type: "string";
|
|
12315
|
+
readonly enum: readonly [
|
|
12316
|
+
"vat_included",
|
|
12317
|
+
"vat_excluded"
|
|
12318
|
+
];
|
|
12319
|
+
};
|
|
12320
|
+
readonly vatRate: {
|
|
12321
|
+
readonly type: "integer";
|
|
12322
|
+
readonly minimum: 0;
|
|
12323
|
+
readonly maximum: 100;
|
|
12324
|
+
readonly description: "VAT rate (0-100).";
|
|
12325
|
+
};
|
|
12326
|
+
readonly buyerInn: {
|
|
12327
|
+
readonly type: "string";
|
|
12328
|
+
readonly description: "Buyer INN (tax ID).";
|
|
12329
|
+
};
|
|
12330
|
+
readonly buyerKpp: {
|
|
12331
|
+
readonly type: "string";
|
|
12332
|
+
readonly description: "Buyer KPP.";
|
|
12333
|
+
};
|
|
12334
|
+
readonly unitName: {
|
|
12335
|
+
readonly type: "string";
|
|
12336
|
+
readonly description: "Line-item name.";
|
|
12337
|
+
};
|
|
12338
|
+
readonly unitPrice: {
|
|
12339
|
+
readonly type: "integer";
|
|
12340
|
+
readonly minimum: 0;
|
|
12341
|
+
readonly description: "Unit price in the invoice currency's minor units.";
|
|
12342
|
+
};
|
|
12343
|
+
readonly unitQuantity: {
|
|
12344
|
+
readonly type: "integer";
|
|
12345
|
+
readonly minimum: 1;
|
|
12346
|
+
};
|
|
12347
|
+
readonly notes: {
|
|
12348
|
+
readonly type: "string";
|
|
12349
|
+
};
|
|
12350
|
+
readonly discount: {
|
|
12351
|
+
readonly type: "integer";
|
|
12352
|
+
readonly minimum: 0;
|
|
12353
|
+
};
|
|
12354
|
+
};
|
|
12355
|
+
};
|
|
12356
|
+
};
|
|
12357
|
+
};
|
|
12358
|
+
};
|
|
12359
|
+
readonly responses: {
|
|
12360
|
+
readonly 201: {
|
|
12361
|
+
readonly description: "Invoice created successfully.";
|
|
12362
|
+
readonly content: {
|
|
12363
|
+
readonly "application/json": {
|
|
12364
|
+
readonly schema: {
|
|
12365
|
+
readonly $ref: "#/components/schemas/CreateCInvoiceSuccess";
|
|
12366
|
+
};
|
|
12367
|
+
};
|
|
12368
|
+
};
|
|
12369
|
+
};
|
|
12370
|
+
readonly 400: {
|
|
12371
|
+
readonly description: "Invalid request payload or unsupported workspace category.";
|
|
12372
|
+
readonly content: {
|
|
12373
|
+
readonly "application/json": {
|
|
12374
|
+
readonly schema: {
|
|
12375
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
12376
|
+
};
|
|
12377
|
+
};
|
|
12378
|
+
};
|
|
12379
|
+
};
|
|
12380
|
+
readonly 401: {
|
|
12381
|
+
readonly description: "Unauthorized - Missing or invalid access token.";
|
|
12382
|
+
readonly content: {
|
|
12383
|
+
readonly "application/json": {
|
|
12384
|
+
readonly schema: {
|
|
12385
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
12386
|
+
};
|
|
12387
|
+
};
|
|
12388
|
+
};
|
|
12389
|
+
};
|
|
12390
|
+
readonly 403: {
|
|
12391
|
+
readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access, or user lacks write access to crm::customers resource.";
|
|
12392
|
+
readonly content: {
|
|
12393
|
+
readonly "application/json": {
|
|
12394
|
+
readonly schema: {
|
|
12395
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
12396
|
+
};
|
|
12397
|
+
};
|
|
12398
|
+
};
|
|
12399
|
+
};
|
|
12400
|
+
readonly 404: {
|
|
12401
|
+
readonly description: "Workspace, billing, customer, or service not found.";
|
|
12402
|
+
readonly content: {
|
|
12403
|
+
readonly "application/json": {
|
|
12404
|
+
readonly schema: {
|
|
12405
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
12406
|
+
};
|
|
12407
|
+
};
|
|
12408
|
+
};
|
|
12409
|
+
};
|
|
12410
|
+
};
|
|
12411
|
+
};
|
|
12412
|
+
};
|
|
12087
12413
|
readonly "/tags/list/{workspace}": {
|
|
12088
12414
|
readonly get: {
|
|
12089
12415
|
readonly tags: readonly [
|
|
@@ -17694,6 +18020,59 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
17694
18020
|
};
|
|
17695
18021
|
};
|
|
17696
18022
|
}, "/billings"> | import("hono/types").MergeSchemaPath<{
|
|
18023
|
+
"/create": {
|
|
18024
|
+
$post: {
|
|
18025
|
+
input: {};
|
|
18026
|
+
output: {
|
|
18027
|
+
success: false;
|
|
18028
|
+
error: string;
|
|
18029
|
+
};
|
|
18030
|
+
outputFormat: "json";
|
|
18031
|
+
status: 404;
|
|
18032
|
+
} | {
|
|
18033
|
+
input: {};
|
|
18034
|
+
output: {
|
|
18035
|
+
success: false;
|
|
18036
|
+
error: string;
|
|
18037
|
+
};
|
|
18038
|
+
outputFormat: "json";
|
|
18039
|
+
status: 400;
|
|
18040
|
+
} | {
|
|
18041
|
+
input: {};
|
|
18042
|
+
output: {
|
|
18043
|
+
success: true;
|
|
18044
|
+
cinvoice: {
|
|
18045
|
+
id: string;
|
|
18046
|
+
created_at: string;
|
|
18047
|
+
invoiceId: string;
|
|
18048
|
+
workspaceId: string;
|
|
18049
|
+
created_by: string;
|
|
18050
|
+
customerId: string;
|
|
18051
|
+
serviceId: string;
|
|
18052
|
+
vatRate: number | null;
|
|
18053
|
+
SellerBillingId: string;
|
|
18054
|
+
date: string;
|
|
18055
|
+
language: string;
|
|
18056
|
+
currency: string;
|
|
18057
|
+
vatOption: string;
|
|
18058
|
+
unitName: string;
|
|
18059
|
+
unitPrice: number;
|
|
18060
|
+
unitQuantity: number;
|
|
18061
|
+
updated_at: string | null;
|
|
18062
|
+
deleted_at: string | null;
|
|
18063
|
+
verified_at: string | null;
|
|
18064
|
+
suspended_at: string | null;
|
|
18065
|
+
notes: string | null;
|
|
18066
|
+
buyerInn: string | null;
|
|
18067
|
+
buyerKpp: string | null;
|
|
18068
|
+
discount: number | null;
|
|
18069
|
+
}[];
|
|
18070
|
+
};
|
|
18071
|
+
outputFormat: "json";
|
|
18072
|
+
status: 201;
|
|
18073
|
+
};
|
|
18074
|
+
};
|
|
18075
|
+
}, "/cinvoices"> | import("hono/types").MergeSchemaPath<{
|
|
17697
18076
|
"/list/:workspace": {
|
|
17698
18077
|
$get: {
|
|
17699
18078
|
input: {
|