@mestra-dev/contract 0.0.96 → 0.0.98

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 +277 -574
  2. package/package.json +5 -2
package/dist/index.d.ts CHANGED
@@ -26,7 +26,7 @@ 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.5";
29
+ readonly version: "1.5.6";
30
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).";
31
31
  };
32
32
  readonly servers: readonly [
@@ -86,7 +86,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
86
86
  },
87
87
  {
88
88
  readonly name: "Customers";
89
- readonly description: "Customer management endpoints";
89
+ readonly description: "Category-specific customer create. Real-estate workspaces persist leads on customer_real_estates. List, get, update, delete, and get-tasks are not currently exposed.";
90
90
  },
91
91
  {
92
92
  readonly name: "Events";
@@ -1944,22 +1944,17 @@ declare const routes: import("hono/hono-base").HonoBase<{
1944
1944
  readonly required: readonly [
1945
1945
  "key",
1946
1946
  "filename",
1947
- "commentId",
1948
1947
  "size",
1949
1948
  "downloadUrl"
1950
1949
  ];
1951
1950
  readonly properties: {
1952
1951
  readonly key: {
1953
1952
  readonly type: "string";
1954
- readonly description: "Full S3 object key.";
1953
+ readonly description: "Full S3 object key (`{workspace}_services/{serviceId}/{filename}`).";
1955
1954
  };
1956
1955
  readonly filename: {
1957
1956
  readonly type: "string";
1958
- readonly description: "File name segment after the first path component under the service prefix.";
1959
- };
1960
- readonly commentId: {
1961
- readonly type: "string";
1962
- readonly description: "First path segment under `{workspace}_services/{serviceId}/`. Kept as `commentId` to match the response payload.";
1957
+ readonly description: "File name under `{workspace}_services/{serviceId}/`.";
1963
1958
  };
1964
1959
  readonly size: {
1965
1960
  readonly type: "integer";
@@ -3026,56 +3021,138 @@ declare const routes: import("hono/hono-base").HonoBase<{
3026
3021
  readonly type: "string";
3027
3022
  readonly format: "uuid";
3028
3023
  };
3024
+ readonly type: {
3025
+ readonly type: "string";
3026
+ readonly nullable: true;
3027
+ readonly enum: readonly [
3028
+ "buyer",
3029
+ "seller",
3030
+ "tenant",
3031
+ "landlord",
3032
+ "investor",
3033
+ "agent"
3034
+ ];
3035
+ };
3029
3036
  readonly name: {
3030
3037
  readonly type: "string";
3031
3038
  };
3032
- readonly email: {
3039
+ readonly companyName: {
3033
3040
  readonly type: "string";
3034
- readonly format: "email";
3035
3041
  readonly nullable: true;
3036
3042
  };
3037
- readonly website: {
3043
+ readonly phone: {
3038
3044
  readonly type: "string";
3039
3045
  readonly nullable: true;
3046
+ readonly description: "E.164 phone number.";
3040
3047
  };
3041
- readonly type: {
3048
+ readonly telegram: {
3042
3049
  readonly type: "string";
3043
3050
  readonly nullable: true;
3044
- readonly description: "Customer type/classification.";
3045
3051
  };
3046
- readonly description: {
3052
+ readonly whatsapp: {
3047
3053
  readonly type: "string";
3048
3054
  readonly nullable: true;
3055
+ readonly description: "E.164 WhatsApp number.";
3049
3056
  };
3050
- readonly active: {
3051
- readonly type: "boolean";
3057
+ readonly email: {
3058
+ readonly type: "string";
3059
+ readonly format: "email";
3052
3060
  readonly nullable: true;
3053
3061
  };
3054
- readonly phone: {
3062
+ readonly leadSource: {
3055
3063
  readonly type: "string";
3056
3064
  readonly nullable: true;
3057
- readonly description: "Personal or primary contact phone.";
3065
+ readonly enum: readonly [
3066
+ "cian",
3067
+ "avito",
3068
+ "vk",
3069
+ "yandex",
3070
+ "website",
3071
+ "referral",
3072
+ "walk_in"
3073
+ ];
3074
+ };
3075
+ readonly budgetMin: {
3076
+ readonly type: "integer";
3077
+ readonly nullable: true;
3078
+ };
3079
+ readonly budgetMax: {
3080
+ readonly type: "integer";
3081
+ readonly nullable: true;
3082
+ };
3083
+ readonly inHandBudget: {
3084
+ readonly type: "integer";
3085
+ readonly nullable: true;
3086
+ };
3087
+ readonly installmentBudget: {
3088
+ readonly type: "integer";
3089
+ readonly nullable: true;
3090
+ };
3091
+ readonly minArea: {
3092
+ readonly type: "integer";
3093
+ readonly nullable: true;
3094
+ };
3095
+ readonly maxArea: {
3096
+ readonly type: "integer";
3097
+ readonly nullable: true;
3098
+ };
3099
+ readonly roomsCount: {
3100
+ readonly type: "integer";
3101
+ readonly nullable: true;
3102
+ };
3103
+ readonly preferredDistricts: {
3104
+ readonly type: "array";
3105
+ readonly nullable: true;
3106
+ readonly items: {
3107
+ readonly type: "string";
3108
+ };
3058
3109
  };
3059
- readonly companyPhone: {
3110
+ readonly propertyType: {
3060
3111
  readonly type: "string";
3061
3112
  readonly nullable: true;
3062
- readonly description: "Company phone number.";
3063
3113
  };
3064
- readonly companyAddress: {
3114
+ readonly maxMetroDistance: {
3115
+ readonly type: "integer";
3116
+ readonly nullable: true;
3117
+ };
3118
+ readonly dealStatus: {
3065
3119
  readonly type: "string";
3066
3120
  readonly nullable: true;
3067
- readonly description: "Company address.";
3121
+ readonly enum: readonly [
3122
+ "just_browsing",
3123
+ "serious_buyer",
3124
+ "mortgage_approved",
3125
+ "signed_contract",
3126
+ "closed_deal"
3127
+ ];
3068
3128
  };
3069
- readonly address: {
3129
+ readonly preferredPaymentMethod: {
3070
3130
  readonly type: "string";
3071
3131
  readonly nullable: true;
3132
+ readonly enum: readonly [
3133
+ "full_payment",
3134
+ "mortgage",
3135
+ "installment"
3136
+ ];
3137
+ };
3138
+ readonly childrenCount: {
3139
+ readonly type: "integer";
3140
+ readonly nullable: true;
3141
+ };
3142
+ readonly hasPets: {
3143
+ readonly type: "boolean";
3144
+ readonly nullable: true;
3145
+ };
3146
+ readonly carsCount: {
3147
+ readonly type: "integer";
3148
+ readonly nullable: true;
3072
3149
  };
3073
3150
  readonly birthDate: {
3074
3151
  readonly type: "string";
3075
3152
  readonly format: "date-time";
3076
3153
  readonly nullable: true;
3077
3154
  };
3078
- readonly utmSource: {
3155
+ readonly notes: {
3079
3156
  readonly type: "string";
3080
3157
  readonly nullable: true;
3081
3158
  };
@@ -3108,7 +3185,11 @@ declare const routes: import("hono/hono-base").HonoBase<{
3108
3185
  readonly const: true;
3109
3186
  };
3110
3187
  readonly customer: {
3111
- readonly $ref: "#/components/schemas/Customer";
3188
+ readonly type: "array";
3189
+ readonly items: {
3190
+ readonly $ref: "#/components/schemas/Customer";
3191
+ };
3192
+ readonly description: "Created customer(s) from insert returning.";
3112
3193
  };
3113
3194
  };
3114
3195
  };
@@ -8838,374 +8919,27 @@ declare const routes: import("hono/hono-base").HonoBase<{
8838
8919
  readonly description: "Comment identifier to update.";
8839
8920
  };
8840
8921
  readonly content: {
8841
- readonly type: "string";
8842
- readonly description: "New comment content.";
8843
- };
8844
- };
8845
- };
8846
- };
8847
- };
8848
- };
8849
- readonly responses: {
8850
- readonly 200: {
8851
- readonly description: "Comment updated successfully.";
8852
- readonly content: {
8853
- readonly "application/json": {
8854
- readonly schema: {
8855
- readonly $ref: "#/components/schemas/SimpleSuccess";
8856
- };
8857
- };
8858
- };
8859
- };
8860
- readonly 400: {
8861
- readonly description: "Invalid request payload.";
8862
- readonly content: {
8863
- readonly "application/json": {
8864
- readonly schema: {
8865
- readonly $ref: "#/components/schemas/ErrorResponse";
8866
- };
8867
- };
8868
- };
8869
- };
8870
- readonly 401: {
8871
- readonly description: "Unauthorized - Missing or invalid access token.";
8872
- readonly content: {
8873
- readonly "application/json": {
8874
- readonly schema: {
8875
- readonly $ref: "#/components/schemas/ErrorResponse";
8876
- };
8877
- };
8878
- };
8879
- };
8880
- readonly 403: {
8881
- readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access, or user lacks write access to crm::tasks resource.";
8882
- readonly content: {
8883
- readonly "application/json": {
8884
- readonly schema: {
8885
- readonly $ref: "#/components/schemas/ErrorResponse";
8886
- };
8887
- };
8888
- };
8889
- };
8890
- readonly 404: {
8891
- readonly description: "Task not found or comment not found.";
8892
- readonly content: {
8893
- readonly "application/json": {
8894
- readonly schema: {
8895
- readonly $ref: "#/components/schemas/ErrorResponse";
8896
- };
8897
- };
8898
- };
8899
- };
8900
- };
8901
- };
8902
- };
8903
- readonly "/event/stream": {
8904
- readonly get: {
8905
- readonly tags: readonly [
8906
- "Events"
8907
- ];
8908
- readonly summary: "Subscribe to Server-Sent Events stream";
8909
- readonly description: "Establishes an authenticated Server-Sent Events (SSE) connection for real-time event streaming. The connection sends a connected event immediately, keepalive events every 30 seconds, and stream events published through NATS. Stream events are filtered by the authenticated user's userId.";
8910
- readonly security: readonly [
8911
- never
8912
- ];
8913
- readonly responses: {
8914
- readonly 200: {
8915
- readonly description: "SSE stream established successfully.";
8916
- readonly content: {
8917
- readonly "text/event-stream": {
8918
- readonly schema: {
8919
- readonly type: "string";
8920
- readonly description: "Server-Sent Events stream. Events include 'connected', 'keepalive', and 'stream' event types.";
8921
- readonly example: "event: connected\ndata: {\"message\":\"Connected\",\"time\":1234567890}\n\n";
8922
- };
8923
- };
8924
- };
8925
- readonly headers: {
8926
- readonly "Content-Type": {
8927
- readonly schema: {
8928
- readonly type: "string";
8929
- readonly example: "text/event-stream";
8930
- };
8931
- readonly description: "SSE content type header.";
8932
- };
8933
- readonly "Cache-Control": {
8934
- readonly schema: {
8935
- readonly type: "string";
8936
- readonly example: "no-cache";
8937
- };
8938
- readonly description: "Cache control header for SSE.";
8939
- };
8940
- readonly Connection: {
8941
- readonly schema: {
8942
- readonly type: "string";
8943
- readonly example: "keep-alive";
8944
- };
8945
- readonly description: "Connection header for SSE.";
8946
- };
8947
- };
8948
- };
8949
- readonly 401: {
8950
- readonly description: "Unauthorized - Missing or invalid access token.";
8951
- readonly content: {
8952
- readonly "application/json": {
8953
- readonly schema: {
8954
- readonly $ref: "#/components/schemas/ErrorResponse";
8955
- };
8956
- };
8957
- };
8958
- };
8959
- readonly 403: {
8960
- readonly description: "Forbidden - Token issuer is not 'access'.";
8961
- readonly content: {
8962
- readonly "application/json": {
8963
- readonly schema: {
8964
- readonly $ref: "#/components/schemas/ErrorResponse";
8965
- };
8966
- };
8967
- };
8968
- };
8969
- };
8970
- };
8971
- };
8972
- readonly "/customers/create": {
8973
- readonly post: {
8974
- readonly tags: readonly [
8975
- "Customers"
8976
- ];
8977
- readonly summary: "Create a new customer";
8978
- readonly description: "Creates a customer in the specified workspace. Requires workspace access and write access to crm::customers resource.";
8979
- readonly security: readonly [
8980
- never
8981
- ];
8982
- readonly requestBody: {
8983
- readonly required: true;
8984
- readonly content: {
8985
- readonly "application/json": {
8986
- readonly schema: {
8987
- readonly type: "object";
8988
- readonly required: readonly [
8989
- "workspace",
8990
- "name"
8991
- ];
8992
- readonly properties: {
8993
- readonly workspace: {
8994
- readonly type: "string";
8995
- readonly format: "uuid";
8996
- readonly description: "Workspace identifier where the customer is created.";
8997
- };
8998
- readonly name: {
8999
- readonly type: "string";
9000
- readonly description: "Customer name.";
9001
- };
9002
- readonly email: {
9003
- readonly type: "string";
9004
- readonly format: "email";
9005
- readonly nullable: true;
9006
- readonly description: "Customer email address (optional).";
9007
- };
9008
- readonly phone: {
9009
- readonly type: "string";
9010
- readonly description: "Customer phone number.";
9011
- };
9012
- readonly companyPhone: {
9013
- readonly type: "string";
9014
- readonly description: "Company phone number.";
9015
- };
9016
- readonly companyAddress: {
9017
- readonly type: "string";
9018
- readonly description: "Company address.";
9019
- };
9020
- readonly address: {
9021
- readonly type: "string";
9022
- readonly description: "Customer address.";
9023
- };
9024
- readonly website: {
9025
- readonly type: "string";
9026
- readonly description: "Customer website.";
9027
- };
9028
- readonly type: {
9029
- readonly type: "string";
9030
- readonly description: "Customer type/classification.";
9031
- };
9032
- readonly description: {
9033
- readonly type: "string";
9034
- readonly description: "Customer description.";
9035
- };
9036
- readonly active: {
9037
- readonly type: "boolean";
9038
- readonly description: "Whether the customer is active.";
9039
- };
9040
- readonly birthDate: {
9041
- readonly type: "string";
9042
- readonly format: "date-time";
9043
- readonly description: "Customer birth date.";
9044
- };
9045
- readonly utmSource: {
9046
- readonly type: "string";
9047
- readonly description: "UTM source attribution string.";
9048
- };
9049
- };
9050
- };
9051
- };
9052
- };
9053
- };
9054
- readonly responses: {
9055
- readonly 201: {
9056
- readonly description: "Customer created successfully.";
9057
- readonly content: {
9058
- readonly "application/json": {
9059
- readonly schema: {
9060
- readonly $ref: "#/components/schemas/CreateCustomerSuccess";
9061
- };
9062
- };
9063
- };
9064
- };
9065
- readonly 400: {
9066
- readonly description: "Invalid request payload.";
9067
- readonly content: {
9068
- readonly "application/json": {
9069
- readonly schema: {
9070
- readonly $ref: "#/components/schemas/ErrorResponse";
9071
- };
9072
- };
9073
- };
9074
- };
9075
- readonly 401: {
9076
- readonly description: "Unauthorized - Missing or invalid access token.";
9077
- readonly content: {
9078
- readonly "application/json": {
9079
- readonly schema: {
9080
- readonly $ref: "#/components/schemas/ErrorResponse";
9081
- };
9082
- };
9083
- };
9084
- };
9085
- readonly 403: {
9086
- readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access, or user lacks write access to crm::customers resource.";
9087
- readonly content: {
9088
- readonly "application/json": {
9089
- readonly schema: {
9090
- readonly $ref: "#/components/schemas/ErrorResponse";
9091
- };
9092
- };
9093
- };
9094
- };
9095
- };
9096
- };
9097
- };
9098
- readonly "/customers/list/{workspace}": {
9099
- readonly get: {
9100
- readonly tags: readonly [
9101
- "Customers"
9102
- ];
9103
- readonly summary: "List customers for a workspace";
9104
- readonly description: "Returns all customers in the specified workspace. Requires workspace access and read access to crm::customers resource.";
9105
- readonly security: readonly [
9106
- never
9107
- ];
9108
- readonly parameters: readonly [
9109
- {
9110
- readonly name: "workspace";
9111
- readonly in: "path";
9112
- readonly required: true;
9113
- readonly description: "Workspace identifier to retrieve customers for.";
9114
- readonly schema: {
9115
- readonly type: "string";
9116
- readonly format: "uuid";
9117
- };
9118
- }
9119
- ];
9120
- readonly responses: {
9121
- readonly 200: {
9122
- readonly description: "Customers fetched successfully.";
9123
- readonly content: {
9124
- readonly "application/json": {
9125
- readonly schema: {
9126
- readonly $ref: "#/components/schemas/ListCustomersSuccess";
9127
- };
9128
- };
9129
- };
9130
- };
9131
- readonly 400: {
9132
- readonly description: "Invalid workspace id.";
9133
- readonly content: {
9134
- readonly "application/json": {
9135
- readonly schema: {
9136
- readonly $ref: "#/components/schemas/ErrorResponse";
9137
- };
9138
- };
9139
- };
9140
- };
9141
- readonly 401: {
9142
- readonly description: "Unauthorized - Missing or invalid access token.";
9143
- readonly content: {
9144
- readonly "application/json": {
9145
- readonly schema: {
9146
- readonly $ref: "#/components/schemas/ErrorResponse";
9147
- };
9148
- };
9149
- };
9150
- };
9151
- readonly 403: {
9152
- readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access, or user lacks read access to crm::customers resource.";
9153
- readonly content: {
9154
- readonly "application/json": {
9155
- readonly schema: {
9156
- readonly $ref: "#/components/schemas/ErrorResponse";
9157
- };
9158
- };
9159
- };
9160
- };
9161
- };
9162
- };
9163
- };
9164
- readonly "/customers/get/{workspace}/{customerId}": {
9165
- readonly get: {
9166
- readonly tags: readonly [
9167
- "Customers"
9168
- ];
9169
- readonly summary: "Get a single customer";
9170
- readonly description: "Returns a single customer by ID from the specified workspace. Requires workspace access and read access to crm::customers resource.";
9171
- readonly security: readonly [
9172
- never
9173
- ];
9174
- readonly parameters: readonly [
9175
- {
9176
- readonly name: "workspace";
9177
- readonly in: "path";
9178
- readonly required: true;
9179
- readonly description: "Workspace identifier where the customer belongs.";
9180
- readonly schema: {
9181
- readonly type: "string";
9182
- readonly format: "uuid";
9183
- };
9184
- },
9185
- {
9186
- readonly name: "customerId";
9187
- readonly in: "path";
9188
- readonly required: true;
9189
- readonly description: "Customer identifier to retrieve.";
9190
- readonly schema: {
9191
- readonly type: "string";
9192
- readonly format: "uuid";
8922
+ readonly type: "string";
8923
+ readonly description: "New comment content.";
8924
+ };
8925
+ };
8926
+ };
9193
8927
  };
9194
- }
9195
- ];
8928
+ };
8929
+ };
9196
8930
  readonly responses: {
9197
8931
  readonly 200: {
9198
- readonly description: "Customer fetched successfully.";
8932
+ readonly description: "Comment updated successfully.";
9199
8933
  readonly content: {
9200
8934
  readonly "application/json": {
9201
8935
  readonly schema: {
9202
- readonly $ref: "#/components/schemas/GetCustomerSuccess";
8936
+ readonly $ref: "#/components/schemas/SimpleSuccess";
9203
8937
  };
9204
8938
  };
9205
8939
  };
9206
8940
  };
9207
8941
  readonly 400: {
9208
- readonly description: "Invalid workspace id or customer id.";
8942
+ readonly description: "Invalid request payload.";
9209
8943
  readonly content: {
9210
8944
  readonly "application/json": {
9211
8945
  readonly schema: {
@@ -9225,7 +8959,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
9225
8959
  };
9226
8960
  };
9227
8961
  readonly 403: {
9228
- readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access, or user lacks read access to crm::customers resource.";
8962
+ readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access, or user lacks write access to crm::tasks resource.";
9229
8963
  readonly content: {
9230
8964
  readonly "application/json": {
9231
8965
  readonly schema: {
@@ -9235,7 +8969,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
9235
8969
  };
9236
8970
  };
9237
8971
  readonly 404: {
9238
- readonly description: "Customer not found.";
8972
+ readonly description: "Task not found or comment not found.";
9239
8973
  readonly content: {
9240
8974
  readonly "application/json": {
9241
8975
  readonly schema: {
@@ -9247,75 +8981,54 @@ declare const routes: import("hono/hono-base").HonoBase<{
9247
8981
  };
9248
8982
  };
9249
8983
  };
9250
- readonly "/customers/delete": {
9251
- readonly post: {
8984
+ readonly "/event/stream": {
8985
+ readonly get: {
9252
8986
  readonly tags: readonly [
9253
- "Customers"
8987
+ "Events"
9254
8988
  ];
9255
- readonly summary: "Delete a customer";
9256
- readonly description: "Deletes a customer from the specified workspace. Requires workspace access and write access to crm::customers resource.";
8989
+ readonly summary: "Subscribe to Server-Sent Events stream";
8990
+ readonly description: "Establishes an authenticated Server-Sent Events (SSE) connection for real-time event streaming. The connection sends a connected event immediately, keepalive events every 30 seconds, and stream events published through NATS. Stream events are filtered by the authenticated user's userId.";
9257
8991
  readonly security: readonly [
9258
8992
  never
9259
8993
  ];
9260
- readonly requestBody: {
9261
- readonly required: true;
9262
- readonly content: {
9263
- readonly "application/json": {
9264
- readonly schema: {
9265
- readonly type: "object";
9266
- readonly required: readonly [
9267
- "customerId",
9268
- "workspace"
9269
- ];
9270
- readonly properties: {
9271
- readonly customerId: {
9272
- readonly type: "string";
9273
- readonly format: "uuid";
9274
- readonly description: "Customer identifier to delete.";
9275
- };
9276
- readonly workspace: {
9277
- readonly type: "string";
9278
- readonly format: "uuid";
9279
- readonly description: "Workspace identifier where the customer belongs.";
9280
- };
9281
- };
9282
- };
9283
- };
9284
- };
9285
- };
9286
8994
  readonly responses: {
9287
8995
  readonly 200: {
9288
- readonly description: "Customer deleted successfully.";
8996
+ readonly description: "SSE stream established successfully.";
9289
8997
  readonly content: {
9290
- readonly "application/json": {
8998
+ readonly "text/event-stream": {
9291
8999
  readonly schema: {
9292
- readonly $ref: "#/components/schemas/SimpleSuccess";
9000
+ readonly type: "string";
9001
+ readonly description: "Server-Sent Events stream. Events include 'connected', 'keepalive', and 'stream' event types.";
9002
+ readonly example: "event: connected\ndata: {\"message\":\"Connected\",\"time\":1234567890}\n\n";
9293
9003
  };
9294
9004
  };
9295
9005
  };
9296
- };
9297
- readonly 400: {
9298
- readonly description: "Invalid request payload.";
9299
- readonly content: {
9300
- readonly "application/json": {
9006
+ readonly headers: {
9007
+ readonly "Content-Type": {
9301
9008
  readonly schema: {
9302
- readonly $ref: "#/components/schemas/ErrorResponse";
9009
+ readonly type: "string";
9010
+ readonly example: "text/event-stream";
9303
9011
  };
9012
+ readonly description: "SSE content type header.";
9304
9013
  };
9305
- };
9306
- };
9307
- readonly 401: {
9308
- readonly description: "Unauthorized - Missing or invalid access token.";
9309
- readonly content: {
9310
- readonly "application/json": {
9014
+ readonly "Cache-Control": {
9311
9015
  readonly schema: {
9312
- readonly $ref: "#/components/schemas/ErrorResponse";
9016
+ readonly type: "string";
9017
+ readonly example: "no-cache";
9018
+ };
9019
+ readonly description: "Cache control header for SSE.";
9020
+ };
9021
+ readonly Connection: {
9022
+ readonly schema: {
9023
+ readonly type: "string";
9024
+ readonly example: "keep-alive";
9313
9025
  };
9026
+ readonly description: "Connection header for SSE.";
9314
9027
  };
9315
9028
  };
9316
9029
  };
9317
- readonly 403: {
9318
- readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access, or user lacks write access to crm::customers resource.";
9030
+ readonly 401: {
9031
+ readonly description: "Unauthorized - Missing or invalid access token.";
9319
9032
  readonly content: {
9320
9033
  readonly "application/json": {
9321
9034
  readonly schema: {
@@ -9324,8 +9037,8 @@ declare const routes: import("hono/hono-base").HonoBase<{
9324
9037
  };
9325
9038
  };
9326
9039
  };
9327
- readonly 404: {
9328
- readonly description: "Customer not found.";
9040
+ readonly 403: {
9041
+ readonly description: "Forbidden - Token issuer is not 'access'.";
9329
9042
  readonly content: {
9330
9043
  readonly "application/json": {
9331
9044
  readonly schema: {
@@ -9337,13 +9050,13 @@ declare const routes: import("hono/hono-base").HonoBase<{
9337
9050
  };
9338
9051
  };
9339
9052
  };
9340
- readonly "/customers/update": {
9053
+ readonly "/customers/create": {
9341
9054
  readonly post: {
9342
9055
  readonly tags: readonly [
9343
9056
  "Customers"
9344
9057
  ];
9345
- readonly summary: "Update a customer";
9346
- readonly description: "Updates a customer's details in the specified workspace. Requires workspace access and write access to crm::customers resource.";
9058
+ readonly summary: "Create a new customer";
9059
+ readonly description: "Creates a category-specific customer in the specified workspace. Real-estate workspaces persist a lead on customer_real_estates. Requires workspace access, write access to crm::customers, and billing capacity for customers. Other workspace categories return 400.";
9347
9060
  readonly security: readonly [
9348
9061
  never
9349
9062
  ];
@@ -9354,68 +9067,136 @@ declare const routes: import("hono/hono-base").HonoBase<{
9354
9067
  readonly schema: {
9355
9068
  readonly type: "object";
9356
9069
  readonly required: readonly [
9357
- "customerId",
9358
- "workspace"
9070
+ "workspace",
9071
+ "name"
9359
9072
  ];
9360
9073
  readonly properties: {
9361
- readonly customerId: {
9362
- readonly type: "string";
9363
- readonly format: "uuid";
9364
- readonly description: "Customer identifier to update.";
9365
- };
9366
9074
  readonly workspace: {
9367
9075
  readonly type: "string";
9368
9076
  readonly format: "uuid";
9369
- readonly description: "Workspace identifier where the customer belongs.";
9077
+ readonly description: "Workspace identifier where the customer is created.";
9370
9078
  };
9371
9079
  readonly name: {
9372
9080
  readonly type: "string";
9373
- readonly description: "Updated customer name.";
9081
+ readonly description: "Customer name.";
9374
9082
  };
9375
- readonly email: {
9083
+ readonly type: {
9084
+ readonly type: "string";
9085
+ readonly enum: readonly [
9086
+ "buyer",
9087
+ "seller",
9088
+ "tenant",
9089
+ "landlord",
9090
+ "investor",
9091
+ "agent"
9092
+ ];
9093
+ };
9094
+ readonly companyName: {
9376
9095
  readonly type: "string";
9377
- readonly description: "Updated customer email address (optional, any string).";
9378
9096
  };
9379
9097
  readonly phone: {
9380
9098
  readonly type: "string";
9381
- readonly description: "Updated customer phone number.";
9099
+ readonly description: "E.164 phone number.";
9382
9100
  };
9383
- readonly companyPhone: {
9101
+ readonly telegram: {
9384
9102
  readonly type: "string";
9385
- readonly description: "Updated company phone number.";
9386
9103
  };
9387
- readonly companyAddress: {
9104
+ readonly whatsapp: {
9388
9105
  readonly type: "string";
9389
- readonly description: "Updated company address.";
9106
+ readonly description: "E.164 WhatsApp number.";
9390
9107
  };
9391
- readonly address: {
9108
+ readonly email: {
9392
9109
  readonly type: "string";
9393
- readonly description: "Updated customer address.";
9110
+ readonly format: "email";
9394
9111
  };
9395
- readonly website: {
9112
+ readonly leadSource: {
9396
9113
  readonly type: "string";
9397
- readonly description: "Updated customer website.";
9114
+ readonly enum: readonly [
9115
+ "cian",
9116
+ "avito",
9117
+ "vk",
9118
+ "yandex",
9119
+ "website",
9120
+ "referral",
9121
+ "walk_in"
9122
+ ];
9398
9123
  };
9399
- readonly type: {
9124
+ readonly budgetMin: {
9125
+ readonly type: "number";
9126
+ readonly minimum: 0;
9127
+ };
9128
+ readonly budgetMax: {
9129
+ readonly type: "number";
9130
+ readonly minimum: 0;
9131
+ };
9132
+ readonly inHandBudget: {
9133
+ readonly type: "number";
9134
+ readonly minimum: 0;
9135
+ };
9136
+ readonly installmentBudget: {
9137
+ readonly type: "number";
9138
+ readonly minimum: 0;
9139
+ };
9140
+ readonly minArea: {
9141
+ readonly type: "number";
9142
+ readonly minimum: 0;
9143
+ };
9144
+ readonly maxArea: {
9145
+ readonly type: "number";
9146
+ readonly minimum: 0;
9147
+ };
9148
+ readonly roomsCount: {
9149
+ readonly type: "integer";
9150
+ readonly minimum: 0;
9151
+ };
9152
+ readonly preferredDistricts: {
9153
+ readonly type: "array";
9154
+ readonly items: {
9155
+ readonly type: "string";
9156
+ };
9157
+ };
9158
+ readonly propertyType: {
9400
9159
  readonly type: "string";
9401
- readonly description: "Updated customer type/classification.";
9402
9160
  };
9403
- readonly description: {
9161
+ readonly maxMetroDistance: {
9162
+ readonly type: "number";
9163
+ readonly minimum: 0;
9164
+ };
9165
+ readonly dealStatus: {
9166
+ readonly type: "string";
9167
+ readonly enum: readonly [
9168
+ "just_browsing",
9169
+ "serious_buyer",
9170
+ "mortgage_approved",
9171
+ "signed_contract",
9172
+ "closed_deal"
9173
+ ];
9174
+ };
9175
+ readonly preferredPaymentMethod: {
9404
9176
  readonly type: "string";
9405
- readonly description: "Updated customer description.";
9177
+ readonly enum: readonly [
9178
+ "full_payment",
9179
+ "mortgage",
9180
+ "installment"
9181
+ ];
9406
9182
  };
9407
- readonly active: {
9183
+ readonly childrenCount: {
9184
+ readonly type: "integer";
9185
+ readonly minimum: 0;
9186
+ };
9187
+ readonly hasPets: {
9408
9188
  readonly type: "boolean";
9409
- readonly description: "Whether the customer is active.";
9189
+ };
9190
+ readonly carsCount: {
9191
+ readonly type: "integer";
9192
+ readonly minimum: 0;
9410
9193
  };
9411
9194
  readonly birthDate: {
9412
9195
  readonly type: "string";
9413
9196
  readonly format: "date-time";
9414
- readonly description: "Customer birth date.";
9415
9197
  };
9416
- readonly utmSource: {
9198
+ readonly notes: {
9417
9199
  readonly type: "string";
9418
- readonly description: "UTM source attribution string.";
9419
9200
  };
9420
9201
  };
9421
9202
  };
@@ -9423,48 +9204,18 @@ declare const routes: import("hono/hono-base").HonoBase<{
9423
9204
  };
9424
9205
  };
9425
9206
  readonly responses: {
9426
- readonly 200: {
9427
- readonly description: "Customer updated successfully.";
9207
+ readonly 201: {
9208
+ readonly description: "Customer created successfully.";
9428
9209
  readonly content: {
9429
9210
  readonly "application/json": {
9430
9211
  readonly schema: {
9431
- readonly $ref: "#/components/schemas/UpdateCustomerSuccess";
9212
+ readonly $ref: "#/components/schemas/CreateCustomerSuccess";
9432
9213
  };
9433
9214
  };
9434
9215
  };
9435
9216
  };
9436
9217
  readonly 400: {
9437
- readonly description: "Invalid request payload.";
9438
- readonly content: {
9439
- readonly "application/json": {
9440
- readonly schema: {
9441
- readonly $ref: "#/components/schemas/ErrorResponse";
9442
- };
9443
- };
9444
- };
9445
- };
9446
- readonly 401: {
9447
- readonly description: "Unauthorized - Missing or invalid access token.";
9448
- readonly content: {
9449
- readonly "application/json": {
9450
- readonly schema: {
9451
- readonly $ref: "#/components/schemas/ErrorResponse";
9452
- };
9453
- };
9454
- };
9455
- };
9456
- readonly 403: {
9457
- readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access, or user lacks write access to crm::customers resource.";
9458
- readonly content: {
9459
- readonly "application/json": {
9460
- readonly schema: {
9461
- readonly $ref: "#/components/schemas/ErrorResponse";
9462
- };
9463
- };
9464
- };
9465
- };
9466
- readonly 404: {
9467
- readonly description: "Customer not found.";
9218
+ readonly description: "Invalid request payload or unsupported workspace category.";
9468
9219
  readonly content: {
9469
9220
  readonly "application/json": {
9470
9221
  readonly schema: {
@@ -9473,66 +9224,6 @@ declare const routes: import("hono/hono-base").HonoBase<{
9473
9224
  };
9474
9225
  };
9475
9226
  };
9476
- };
9477
- };
9478
- };
9479
- readonly "/customers/get-tasks/{workspace}/{customerId}": {
9480
- readonly get: {
9481
- readonly tags: readonly [
9482
- "Customers"
9483
- ];
9484
- readonly summary: "List tasks for a customer";
9485
- readonly description: "Returns tasks linked to a customer in the specified workspace. Requires workspace access and read access to crm::tasks resource.";
9486
- readonly security: readonly [
9487
- never
9488
- ];
9489
- readonly parameters: readonly [
9490
- {
9491
- readonly name: "workspace";
9492
- readonly in: "path";
9493
- readonly required: true;
9494
- readonly description: "Workspace identifier where the customer belongs.";
9495
- readonly schema: {
9496
- readonly type: "string";
9497
- readonly format: "uuid";
9498
- };
9499
- },
9500
- {
9501
- readonly name: "customerId";
9502
- readonly in: "path";
9503
- readonly required: true;
9504
- readonly description: "Customer identifier to retrieve tasks for.";
9505
- readonly schema: {
9506
- readonly type: "string";
9507
- readonly format: "uuid";
9508
- };
9509
- }
9510
- ];
9511
- readonly responses: {
9512
- readonly 200: {
9513
- readonly description: "Customer tasks fetched successfully.";
9514
- readonly content: {
9515
- readonly "application/json": {
9516
- readonly schema: {
9517
- readonly type: "object";
9518
- readonly required: readonly [
9519
- "success",
9520
- "tasks"
9521
- ];
9522
- readonly properties: {
9523
- readonly success: {
9524
- readonly type: "boolean";
9525
- readonly const: true;
9526
- };
9527
- readonly tasks: {
9528
- readonly type: "array";
9529
- readonly items: any;
9530
- };
9531
- };
9532
- };
9533
- };
9534
- };
9535
- };
9536
9227
  readonly 401: {
9537
9228
  readonly description: "Unauthorized - Missing or invalid access token.";
9538
9229
  readonly content: {
@@ -9544,7 +9235,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
9544
9235
  };
9545
9236
  };
9546
9237
  readonly 403: {
9547
- readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access, or user lacks read access to crm::tasks resource.";
9238
+ readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access, write access to crm::customers, or billing capacity for customers.";
9548
9239
  readonly content: {
9549
9240
  readonly "application/json": {
9550
9241
  readonly schema: {
@@ -15571,6 +15262,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
15571
15262
  deleted_at: string | null;
15572
15263
  verified_at: string | null;
15573
15264
  suspended_at: string | null;
15265
+ roomsCount: number | null;
15574
15266
  propertyType: string | null;
15575
15267
  propertyStatus: string | null;
15576
15268
  commercialType: string | null;
@@ -15601,7 +15293,6 @@ declare const routes: import("hono/hono-base").HonoBase<{
15601
15293
  alternativeRUBCurrency: boolean | null;
15602
15294
  alternativeUSDCurrency: boolean | null;
15603
15295
  estimatedDeliveryDate: string | null;
15604
- roomsCount: number | null;
15605
15296
  bathroomsCount: number | null;
15606
15297
  bedroomsCount: number | null;
15607
15298
  totalArea: number | null;
@@ -15942,7 +15633,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
15942
15633
  input: {};
15943
15634
  output: {
15944
15635
  success: false;
15945
- error: never;
15636
+ error: string;
15946
15637
  };
15947
15638
  outputFormat: "json";
15948
15639
  status: 400;
@@ -15955,22 +15646,35 @@ declare const routes: import("hono/hono-base").HonoBase<{
15955
15646
  type: string | null;
15956
15647
  created_at: string;
15957
15648
  name: string;
15958
- active: boolean | null;
15959
15649
  email: string | null;
15960
15650
  workspaceId: string;
15961
- description: string | null;
15651
+ companyName: string | null;
15962
15652
  updated_at: string | null;
15963
15653
  deleted_at: string | null;
15964
15654
  verified_at: string | null;
15965
15655
  suspended_at: string | null;
15966
15656
  phone: string | null;
15967
- website: string | null;
15968
- companyPhone: string | null;
15969
- companyAddress: string | null;
15970
- address: string | null;
15971
15657
  birthDate: string | null;
15972
- utmSource: string | null;
15973
- };
15658
+ telegram: string | null;
15659
+ whatsapp: string | null;
15660
+ leadSource: string | null;
15661
+ budgetMin: number | null;
15662
+ budgetMax: number | null;
15663
+ inHandBudget: number | null;
15664
+ installmentBudget: number | null;
15665
+ minArea: number | null;
15666
+ maxArea: number | null;
15667
+ roomsCount: number | null;
15668
+ preferredDistricts: string[] | null;
15669
+ propertyType: string | null;
15670
+ maxMetroDistance: number | null;
15671
+ dealStatus: string | null;
15672
+ preferredPaymentMethod: string | null;
15673
+ childrenCount: number | null;
15674
+ hasPets: boolean | null;
15675
+ carsCount: number | null;
15676
+ notes: string | null;
15677
+ }[];
15974
15678
  };
15975
15679
  outputFormat: "json";
15976
15680
  status: 201;
@@ -20502,7 +20206,6 @@ declare const routes: import("hono/hono-base").HonoBase<{
20502
20206
  files: {
20503
20207
  key: string;
20504
20208
  filename: string;
20505
- commentId: string;
20506
20209
  size: number;
20507
20210
  lastModified: string | null;
20508
20211
  downloadUrl: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mestra-dev/contract",
3
- "version": "0.0.96",
3
+ "version": "0.0.98",
4
4
  "description": "Types-only Hono AppType contract for the Mestra auth API",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -24,10 +24,13 @@
24
24
  "peerDependencies": {
25
25
  "hono": "^4.12.32"
26
26
  },
27
+ "overrides": {
28
+ "typescript": "5.9.3"
29
+ },
27
30
  "devDependencies": {
28
31
  "@types/bun": "^1.3.14",
29
32
  "dts-bundle-generator": "^9.5.1",
30
33
  "hono": "^4.13.3",
31
- "typescript": "^5.9.3"
34
+ "typescript": "5.9.3"
32
35
  }
33
36
  }