@mestra-dev/contract 0.0.8 → 0.0.10
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 +362 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -88,7 +88,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
90
|
readonly name: "Files";
|
|
91
|
-
readonly description: "S3 file upload (presigned POST), profile picture upload/confirm/delete, comment attachment upload, list task comment files with download URLs, folder create/delete, list (includes pin metadata), pin/unpin, download, and file delete. General uploads accept JPEG/PNG/WebP/PDF; profile pictures accept JPEG/PNG only (0.5 MB).";
|
|
91
|
+
readonly description: "S3 file upload (presigned POST), profile and workspace picture upload/confirm/delete, comment attachment upload, list task comment files with download URLs, folder create/delete, list (includes pin metadata), pin/unpin, download, and file delete. General uploads accept JPEG/PNG/WebP/PDF; profile/workspace pictures accept JPEG/PNG only (0.5 MB).";
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
94
|
readonly name: "Chat";
|
|
@@ -715,6 +715,11 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
715
715
|
readonly category: {
|
|
716
716
|
readonly $ref: "#/components/schemas/WorkspaceCategory";
|
|
717
717
|
};
|
|
718
|
+
readonly picture: {
|
|
719
|
+
readonly type: "string";
|
|
720
|
+
readonly nullable: true;
|
|
721
|
+
readonly description: "Presigned workspace avatar URL (7-day expiry, refreshed periodically); empty string when unset.";
|
|
722
|
+
};
|
|
718
723
|
readonly created_at: {
|
|
719
724
|
readonly type: "string";
|
|
720
725
|
readonly format: "date-time";
|
|
@@ -1235,7 +1240,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
1235
1240
|
"image/jpeg",
|
|
1236
1241
|
"image/png"
|
|
1237
1242
|
];
|
|
1238
|
-
readonly description: "Allowed MIME type declared for
|
|
1243
|
+
readonly description: "Allowed MIME type declared for temporary profile or workspace picture uploads.";
|
|
1239
1244
|
};
|
|
1240
1245
|
readonly UploadFileRequest: {
|
|
1241
1246
|
readonly type: "object";
|
|
@@ -1471,6 +1476,73 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
1471
1476
|
};
|
|
1472
1477
|
};
|
|
1473
1478
|
};
|
|
1479
|
+
readonly UploadWorkspacePictureRequest: {
|
|
1480
|
+
readonly type: "object";
|
|
1481
|
+
readonly required: readonly [
|
|
1482
|
+
"workspace",
|
|
1483
|
+
"contentType"
|
|
1484
|
+
];
|
|
1485
|
+
readonly properties: {
|
|
1486
|
+
readonly workspace: {
|
|
1487
|
+
readonly type: "string";
|
|
1488
|
+
readonly format: "uuid";
|
|
1489
|
+
readonly description: "Workspace identifier.";
|
|
1490
|
+
};
|
|
1491
|
+
readonly contentType: {
|
|
1492
|
+
readonly $ref: "#/components/schemas/ProfileImageContentType";
|
|
1493
|
+
};
|
|
1494
|
+
};
|
|
1495
|
+
};
|
|
1496
|
+
readonly WorkspacePictureWorkspaceRequest: {
|
|
1497
|
+
readonly type: "object";
|
|
1498
|
+
readonly required: readonly [
|
|
1499
|
+
"workspace"
|
|
1500
|
+
];
|
|
1501
|
+
readonly properties: {
|
|
1502
|
+
readonly workspace: {
|
|
1503
|
+
readonly type: "string";
|
|
1504
|
+
readonly format: "uuid";
|
|
1505
|
+
readonly description: "Workspace identifier.";
|
|
1506
|
+
};
|
|
1507
|
+
};
|
|
1508
|
+
};
|
|
1509
|
+
readonly ConfirmWorkspacePictureSuccess: {
|
|
1510
|
+
readonly type: "object";
|
|
1511
|
+
readonly required: readonly [
|
|
1512
|
+
"success",
|
|
1513
|
+
"url"
|
|
1514
|
+
];
|
|
1515
|
+
readonly properties: {
|
|
1516
|
+
readonly success: {
|
|
1517
|
+
readonly type: "boolean";
|
|
1518
|
+
readonly const: true;
|
|
1519
|
+
};
|
|
1520
|
+
readonly url: {
|
|
1521
|
+
readonly type: "string";
|
|
1522
|
+
readonly description: "Presigned GET URL for `profiles/workspaces/{workspace}/avatar.webp` (WebP response content type, 7-day expiry). Also saved on the workspace.";
|
|
1523
|
+
};
|
|
1524
|
+
};
|
|
1525
|
+
};
|
|
1526
|
+
readonly DeleteWorkspacePictureSuccess: {
|
|
1527
|
+
readonly type: "object";
|
|
1528
|
+
readonly required: readonly [
|
|
1529
|
+
"success",
|
|
1530
|
+
"message"
|
|
1531
|
+
];
|
|
1532
|
+
readonly properties: {
|
|
1533
|
+
readonly success: {
|
|
1534
|
+
readonly type: "boolean";
|
|
1535
|
+
readonly const: true;
|
|
1536
|
+
};
|
|
1537
|
+
readonly message: {
|
|
1538
|
+
readonly type: "string";
|
|
1539
|
+
readonly enum: readonly [
|
|
1540
|
+
"Workspace picture deleted successfully",
|
|
1541
|
+
"Workspace picture already deleted"
|
|
1542
|
+
];
|
|
1543
|
+
};
|
|
1544
|
+
};
|
|
1545
|
+
};
|
|
1474
1546
|
readonly CreateFolderRequest: {
|
|
1475
1547
|
readonly type: "object";
|
|
1476
1548
|
readonly required: readonly [
|
|
@@ -9618,6 +9690,222 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
9618
9690
|
};
|
|
9619
9691
|
};
|
|
9620
9692
|
};
|
|
9693
|
+
readonly "/files/upload-workspace-picture": {
|
|
9694
|
+
readonly post: {
|
|
9695
|
+
readonly tags: readonly [
|
|
9696
|
+
"Files"
|
|
9697
|
+
];
|
|
9698
|
+
readonly summary: "Create presigned upload for workspace picture";
|
|
9699
|
+
readonly description: "Returns a presigned POST URL and form fields for uploading a temporary workspace picture to `profiles/workspaces/{workspace}/temp` (max 0.5 MB, 5-minute expiry). Accepts JPEG and PNG. After the multipart upload succeeds, call `/files/confirm-workspace-picture` to validate, optimize, and persist the image. Requires workspace access and write access to crm::general.";
|
|
9700
|
+
readonly security: readonly [
|
|
9701
|
+
never
|
|
9702
|
+
];
|
|
9703
|
+
readonly requestBody: {
|
|
9704
|
+
readonly required: true;
|
|
9705
|
+
readonly content: {
|
|
9706
|
+
readonly "application/json": {
|
|
9707
|
+
readonly schema: {
|
|
9708
|
+
readonly $ref: "#/components/schemas/UploadWorkspacePictureRequest";
|
|
9709
|
+
};
|
|
9710
|
+
};
|
|
9711
|
+
};
|
|
9712
|
+
};
|
|
9713
|
+
readonly responses: {
|
|
9714
|
+
readonly 200: {
|
|
9715
|
+
readonly description: "Presigned workspace picture upload created.";
|
|
9716
|
+
readonly content: {
|
|
9717
|
+
readonly "application/json": {
|
|
9718
|
+
readonly schema: {
|
|
9719
|
+
readonly allOf: readonly [
|
|
9720
|
+
{
|
|
9721
|
+
readonly $ref: "#/components/schemas/PresignedUploadSuccess";
|
|
9722
|
+
}
|
|
9723
|
+
];
|
|
9724
|
+
readonly description: "key is `profiles/workspaces/{workspace}/temp`; maxSize is 524288 (0.5 MB).";
|
|
9725
|
+
};
|
|
9726
|
+
};
|
|
9727
|
+
};
|
|
9728
|
+
};
|
|
9729
|
+
readonly 400: {
|
|
9730
|
+
readonly description: "Invalid request payload or unsupported content type.";
|
|
9731
|
+
readonly content: {
|
|
9732
|
+
readonly "application/json": {
|
|
9733
|
+
readonly schema: {
|
|
9734
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
9735
|
+
};
|
|
9736
|
+
};
|
|
9737
|
+
};
|
|
9738
|
+
};
|
|
9739
|
+
readonly 401: {
|
|
9740
|
+
readonly description: "Unauthorized - Missing or invalid access token.";
|
|
9741
|
+
};
|
|
9742
|
+
readonly 403: {
|
|
9743
|
+
readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access, or user lacks write access to crm::general.";
|
|
9744
|
+
readonly content: {
|
|
9745
|
+
readonly "application/json": {
|
|
9746
|
+
readonly schema: {
|
|
9747
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
9748
|
+
};
|
|
9749
|
+
};
|
|
9750
|
+
};
|
|
9751
|
+
};
|
|
9752
|
+
readonly 404: {
|
|
9753
|
+
readonly description: "Workspace not found.";
|
|
9754
|
+
readonly content: {
|
|
9755
|
+
readonly "application/json": {
|
|
9756
|
+
readonly schema: {
|
|
9757
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
9758
|
+
};
|
|
9759
|
+
};
|
|
9760
|
+
};
|
|
9761
|
+
};
|
|
9762
|
+
};
|
|
9763
|
+
};
|
|
9764
|
+
};
|
|
9765
|
+
readonly "/files/confirm-workspace-picture": {
|
|
9766
|
+
readonly post: {
|
|
9767
|
+
readonly tags: readonly [
|
|
9768
|
+
"Files"
|
|
9769
|
+
];
|
|
9770
|
+
readonly summary: "Confirm and persist an uploaded workspace picture";
|
|
9771
|
+
readonly description: "Reads the temporary object at `profiles/workspaces/{workspace}/temp`, verifies size (<= 0.5 MB) and real image type (JPEG, PNG, or WebP), resizes it to a 512x512 WebP avatar (cover fit, without enlargement, input pixel limit 4096x4096), stores it privately at `profiles/workspaces/{workspace}/avatar.webp`, deletes the temporary object, creates a 7-day presigned GET URL for the avatar, and saves that URL on the workspace. On failure, the temporary object is deleted and the workspace picture is cleared. Requires workspace access and write access to crm::general.";
|
|
9772
|
+
readonly security: readonly [
|
|
9773
|
+
never
|
|
9774
|
+
];
|
|
9775
|
+
readonly requestBody: {
|
|
9776
|
+
readonly required: true;
|
|
9777
|
+
readonly content: {
|
|
9778
|
+
readonly "application/json": {
|
|
9779
|
+
readonly schema: {
|
|
9780
|
+
readonly $ref: "#/components/schemas/WorkspacePictureWorkspaceRequest";
|
|
9781
|
+
};
|
|
9782
|
+
};
|
|
9783
|
+
};
|
|
9784
|
+
};
|
|
9785
|
+
readonly responses: {
|
|
9786
|
+
readonly 200: {
|
|
9787
|
+
readonly description: "Workspace picture confirmed and saved successfully.";
|
|
9788
|
+
readonly content: {
|
|
9789
|
+
readonly "application/json": {
|
|
9790
|
+
readonly schema: {
|
|
9791
|
+
readonly $ref: "#/components/schemas/ConfirmWorkspacePictureSuccess";
|
|
9792
|
+
};
|
|
9793
|
+
};
|
|
9794
|
+
};
|
|
9795
|
+
};
|
|
9796
|
+
readonly 400: {
|
|
9797
|
+
readonly description: "Temporary object missing, file too large, invalid image type, or processing failed.";
|
|
9798
|
+
readonly content: {
|
|
9799
|
+
readonly "application/json": {
|
|
9800
|
+
readonly schema: {
|
|
9801
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
9802
|
+
};
|
|
9803
|
+
};
|
|
9804
|
+
};
|
|
9805
|
+
};
|
|
9806
|
+
readonly 401: {
|
|
9807
|
+
readonly description: "Unauthorized - Missing or invalid access token.";
|
|
9808
|
+
};
|
|
9809
|
+
readonly 403: {
|
|
9810
|
+
readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access, or user lacks write access to crm::general.";
|
|
9811
|
+
readonly content: {
|
|
9812
|
+
readonly "application/json": {
|
|
9813
|
+
readonly schema: {
|
|
9814
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
9815
|
+
};
|
|
9816
|
+
};
|
|
9817
|
+
};
|
|
9818
|
+
};
|
|
9819
|
+
readonly 404: {
|
|
9820
|
+
readonly description: "Workspace not found.";
|
|
9821
|
+
readonly content: {
|
|
9822
|
+
readonly "application/json": {
|
|
9823
|
+
readonly schema: {
|
|
9824
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
9825
|
+
};
|
|
9826
|
+
};
|
|
9827
|
+
};
|
|
9828
|
+
};
|
|
9829
|
+
};
|
|
9830
|
+
};
|
|
9831
|
+
};
|
|
9832
|
+
readonly "/files/delete-workspace-picture": {
|
|
9833
|
+
readonly post: {
|
|
9834
|
+
readonly tags: readonly [
|
|
9835
|
+
"Files"
|
|
9836
|
+
];
|
|
9837
|
+
readonly summary: "Delete a workspace picture";
|
|
9838
|
+
readonly description: "Deletes `profiles/workspaces/{workspace}/avatar.webp` from S3 when present and clears the picture on the workspace. If the object is already missing, still clears the stored value and returns success with message `Workspace picture already deleted`. Requires workspace access and write access to crm::general.";
|
|
9839
|
+
readonly security: readonly [
|
|
9840
|
+
never
|
|
9841
|
+
];
|
|
9842
|
+
readonly requestBody: {
|
|
9843
|
+
readonly required: true;
|
|
9844
|
+
readonly content: {
|
|
9845
|
+
readonly "application/json": {
|
|
9846
|
+
readonly schema: {
|
|
9847
|
+
readonly $ref: "#/components/schemas/WorkspacePictureWorkspaceRequest";
|
|
9848
|
+
};
|
|
9849
|
+
};
|
|
9850
|
+
};
|
|
9851
|
+
};
|
|
9852
|
+
readonly responses: {
|
|
9853
|
+
readonly 200: {
|
|
9854
|
+
readonly description: "Workspace picture deleted, or already absent and cleared from the workspace.";
|
|
9855
|
+
readonly content: {
|
|
9856
|
+
readonly "application/json": {
|
|
9857
|
+
readonly schema: {
|
|
9858
|
+
readonly $ref: "#/components/schemas/DeleteWorkspacePictureSuccess";
|
|
9859
|
+
};
|
|
9860
|
+
};
|
|
9861
|
+
};
|
|
9862
|
+
};
|
|
9863
|
+
readonly 400: {
|
|
9864
|
+
readonly description: "Invalid request payload.";
|
|
9865
|
+
readonly content: {
|
|
9866
|
+
readonly "application/json": {
|
|
9867
|
+
readonly schema: {
|
|
9868
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
9869
|
+
};
|
|
9870
|
+
};
|
|
9871
|
+
};
|
|
9872
|
+
};
|
|
9873
|
+
readonly 401: {
|
|
9874
|
+
readonly description: "Unauthorized - Missing or invalid access token.";
|
|
9875
|
+
};
|
|
9876
|
+
readonly 403: {
|
|
9877
|
+
readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access, or user lacks write access to crm::general.";
|
|
9878
|
+
readonly content: {
|
|
9879
|
+
readonly "application/json": {
|
|
9880
|
+
readonly schema: {
|
|
9881
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
9882
|
+
};
|
|
9883
|
+
};
|
|
9884
|
+
};
|
|
9885
|
+
};
|
|
9886
|
+
readonly 404: {
|
|
9887
|
+
readonly description: "Workspace not found.";
|
|
9888
|
+
readonly content: {
|
|
9889
|
+
readonly "application/json": {
|
|
9890
|
+
readonly schema: {
|
|
9891
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
9892
|
+
};
|
|
9893
|
+
};
|
|
9894
|
+
};
|
|
9895
|
+
};
|
|
9896
|
+
readonly 500: {
|
|
9897
|
+
readonly description: "Failed to delete the workspace picture object.";
|
|
9898
|
+
readonly content: {
|
|
9899
|
+
readonly "application/json": {
|
|
9900
|
+
readonly schema: {
|
|
9901
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
9902
|
+
};
|
|
9903
|
+
};
|
|
9904
|
+
};
|
|
9905
|
+
};
|
|
9906
|
+
};
|
|
9907
|
+
};
|
|
9908
|
+
};
|
|
9621
9909
|
readonly "/chat/start": {
|
|
9622
9910
|
readonly post: {
|
|
9623
9911
|
readonly tags: readonly [
|
|
@@ -15210,6 +15498,78 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
15210
15498
|
status: 500;
|
|
15211
15499
|
};
|
|
15212
15500
|
};
|
|
15501
|
+
} & {
|
|
15502
|
+
"/upload-workspace-picture": {
|
|
15503
|
+
$post: {
|
|
15504
|
+
input: {};
|
|
15505
|
+
output: {
|
|
15506
|
+
success: false;
|
|
15507
|
+
error: never;
|
|
15508
|
+
};
|
|
15509
|
+
outputFormat: "json";
|
|
15510
|
+
status: 400;
|
|
15511
|
+
} | {
|
|
15512
|
+
input: {};
|
|
15513
|
+
output: {
|
|
15514
|
+
url: string;
|
|
15515
|
+
fields: {
|
|
15516
|
+
[x: string]: string;
|
|
15517
|
+
};
|
|
15518
|
+
key: string;
|
|
15519
|
+
maxSize: number;
|
|
15520
|
+
};
|
|
15521
|
+
outputFormat: "json";
|
|
15522
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
15523
|
+
};
|
|
15524
|
+
};
|
|
15525
|
+
} & {
|
|
15526
|
+
"/confirm-workspace-picture": {
|
|
15527
|
+
$post: {
|
|
15528
|
+
input: {};
|
|
15529
|
+
output: {
|
|
15530
|
+
success: true;
|
|
15531
|
+
url: string;
|
|
15532
|
+
};
|
|
15533
|
+
outputFormat: "json";
|
|
15534
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
15535
|
+
} | {
|
|
15536
|
+
input: {};
|
|
15537
|
+
output: {
|
|
15538
|
+
success: false;
|
|
15539
|
+
error: string;
|
|
15540
|
+
};
|
|
15541
|
+
outputFormat: "json";
|
|
15542
|
+
status: 400;
|
|
15543
|
+
};
|
|
15544
|
+
};
|
|
15545
|
+
} & {
|
|
15546
|
+
"/delete-workspace-picture": {
|
|
15547
|
+
$post: {
|
|
15548
|
+
input: {};
|
|
15549
|
+
output: {
|
|
15550
|
+
success: false;
|
|
15551
|
+
error: never;
|
|
15552
|
+
};
|
|
15553
|
+
outputFormat: "json";
|
|
15554
|
+
status: 400;
|
|
15555
|
+
} | {
|
|
15556
|
+
input: {};
|
|
15557
|
+
output: {
|
|
15558
|
+
success: true;
|
|
15559
|
+
message: string;
|
|
15560
|
+
};
|
|
15561
|
+
outputFormat: "json";
|
|
15562
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
15563
|
+
} | {
|
|
15564
|
+
input: {};
|
|
15565
|
+
output: {
|
|
15566
|
+
success: false;
|
|
15567
|
+
error: string;
|
|
15568
|
+
};
|
|
15569
|
+
outputFormat: "json";
|
|
15570
|
+
status: 500;
|
|
15571
|
+
};
|
|
15572
|
+
};
|
|
15213
15573
|
}, "/files"> | import("hono/types").MergeSchemaPath<{
|
|
15214
15574
|
"/start": {
|
|
15215
15575
|
$post: {
|