@mestra-dev/contract 0.0.37 → 0.0.39
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 +360 -43
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -98,7 +98,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
readonly name: "Files";
|
|
101
|
-
readonly description: "S3 file upload (presigned POST to a temporary `.tmp` key), confirm (magic-byte validation then promote to final key), profile and workspace picture upload/confirm/delete, comment attachment upload/confirm, list task comment files with download URLs, folder create/delete, list (includes pin metadata; excludes `.tmp` objects), pin/unpin, download, 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.";
|
|
101
|
+
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, 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.";
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
104
|
readonly name: "Chat";
|
|
@@ -1451,7 +1451,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
1451
1451
|
readonly type: "string";
|
|
1452
1452
|
readonly minLength: 1;
|
|
1453
1453
|
readonly maxLength: 200;
|
|
1454
|
-
readonly description: "Safe file name (no path separators, not `.tmp`).";
|
|
1454
|
+
readonly description: "Safe leaf file name (no path separators, not `.tmp`).";
|
|
1455
1455
|
readonly example: "invoice-2026.pdf";
|
|
1456
1456
|
};
|
|
1457
1457
|
readonly contentType: {
|
|
@@ -1468,6 +1468,13 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
1468
1468
|
readonly format: "uuid";
|
|
1469
1469
|
readonly description: "Workspace identifier.";
|
|
1470
1470
|
};
|
|
1471
|
+
readonly folder: {
|
|
1472
|
+
readonly type: "string";
|
|
1473
|
+
readonly minLength: 1;
|
|
1474
|
+
readonly maxLength: 800;
|
|
1475
|
+
readonly description: "Optional nested folder path under `{workspace}/folders/` (e.g. `a/b`). Each segment is a safe name; max depth 10. The folder marker must already exist via `/files/create-folder`. Omitting uploads to the workspace root.";
|
|
1476
|
+
readonly example: "contracts/2026";
|
|
1477
|
+
};
|
|
1471
1478
|
};
|
|
1472
1479
|
};
|
|
1473
1480
|
readonly ConfirmFileRequest: {
|
|
@@ -1481,7 +1488,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
1481
1488
|
readonly type: "string";
|
|
1482
1489
|
readonly minLength: 1;
|
|
1483
1490
|
readonly maxLength: 200;
|
|
1484
|
-
readonly description: "Original file name used for `/files/upload` (without the `.tmp` suffix).";
|
|
1491
|
+
readonly description: "Original leaf file name used for `/files/upload` (without the `.tmp` suffix).";
|
|
1485
1492
|
readonly example: "invoice-2026.pdf";
|
|
1486
1493
|
};
|
|
1487
1494
|
readonly workspace: {
|
|
@@ -1489,6 +1496,13 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
1489
1496
|
readonly format: "uuid";
|
|
1490
1497
|
readonly description: "Workspace identifier.";
|
|
1491
1498
|
};
|
|
1499
|
+
readonly folder: {
|
|
1500
|
+
readonly type: "string";
|
|
1501
|
+
readonly minLength: 1;
|
|
1502
|
+
readonly maxLength: 800;
|
|
1503
|
+
readonly description: "Same optional nested folder path passed to `/files/upload`.";
|
|
1504
|
+
readonly example: "contracts/2026";
|
|
1505
|
+
};
|
|
1492
1506
|
};
|
|
1493
1507
|
};
|
|
1494
1508
|
readonly ConfirmFileSuccess: {
|
|
@@ -1504,8 +1518,8 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
1504
1518
|
};
|
|
1505
1519
|
readonly key: {
|
|
1506
1520
|
readonly type: "string";
|
|
1507
|
-
readonly description: "Final S3 object key after promotion (`{workspace}/{filename}`).";
|
|
1508
|
-
readonly example: "550e8400-e29b-41d4-a716-446655440000/invoice-2026.pdf";
|
|
1521
|
+
readonly description: "Final S3 object key after promotion (`{workspace}/{filename}` or `{workspace}/folders/{folder}/{filename}`).";
|
|
1522
|
+
readonly example: "550e8400-e29b-41d4-a716-446655440000/folders/contracts/2026/invoice-2026.pdf";
|
|
1509
1523
|
};
|
|
1510
1524
|
};
|
|
1511
1525
|
};
|
|
@@ -1531,8 +1545,8 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
1531
1545
|
};
|
|
1532
1546
|
readonly key: {
|
|
1533
1547
|
readonly type: "string";
|
|
1534
|
-
readonly description: "Temporary S3 object key (
|
|
1535
|
-
readonly example: "550e8400-e29b-41d4-a716-446655440000/invoice-2026.pdf.tmp";
|
|
1548
|
+
readonly description: "Temporary S3 object key (`.tmp` suffix). Call `/files/confirm` after upload. Root: `{workspace}/{filename}.tmp`. Folder: `{workspace}/folders/{folder}/{filename}.tmp`.";
|
|
1549
|
+
readonly example: "550e8400-e29b-41d4-a716-446655440000/folders/contracts/2026/invoice-2026.pdf.tmp";
|
|
1536
1550
|
};
|
|
1537
1551
|
readonly maxSize: {
|
|
1538
1552
|
readonly type: "integer";
|
|
@@ -1876,16 +1890,25 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
1876
1890
|
};
|
|
1877
1891
|
readonly name: {
|
|
1878
1892
|
readonly type: "string";
|
|
1879
|
-
readonly
|
|
1880
|
-
readonly
|
|
1893
|
+
readonly minLength: 1;
|
|
1894
|
+
readonly maxLength: 800;
|
|
1895
|
+
readonly description: "Nested folder path under `{workspace}/folders/` (e.g. `contracts` or `contracts/2026`). Each segment is a safe name; max depth 10.";
|
|
1896
|
+
readonly example: "contracts/2026";
|
|
1881
1897
|
};
|
|
1882
1898
|
};
|
|
1883
1899
|
};
|
|
1900
|
+
readonly WorkspaceRelativeFilePath: {
|
|
1901
|
+
readonly type: "string";
|
|
1902
|
+
readonly minLength: 1;
|
|
1903
|
+
readonly maxLength: 800;
|
|
1904
|
+
readonly description: "Path after `{workspace}/`. Root file: `invoice.pdf`. Folder file: `folders/contracts/2026/invoice.pdf`. Not a full S3 key; no leading slash; not `.tmp`.";
|
|
1905
|
+
readonly example: "folders/contracts/2026/invoice-2026.pdf";
|
|
1906
|
+
};
|
|
1884
1907
|
readonly PinFileRequest: {
|
|
1885
1908
|
readonly type: "object";
|
|
1886
1909
|
readonly required: readonly [
|
|
1887
1910
|
"workspace",
|
|
1888
|
-
"
|
|
1911
|
+
"path",
|
|
1889
1912
|
"pin"
|
|
1890
1913
|
];
|
|
1891
1914
|
readonly properties: {
|
|
@@ -1894,10 +1917,8 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
1894
1917
|
readonly format: "uuid";
|
|
1895
1918
|
readonly description: "Workspace identifier (used for access check).";
|
|
1896
1919
|
};
|
|
1897
|
-
readonly
|
|
1898
|
-
readonly
|
|
1899
|
-
readonly description: "Full S3 object key to pin or unpin (as returned by list or upload).";
|
|
1900
|
-
readonly example: "550e8400-e29b-41d4-a716-446655440000/invoice-2026.pdf";
|
|
1920
|
+
readonly path: {
|
|
1921
|
+
readonly $ref: "#/components/schemas/WorkspaceRelativeFilePath";
|
|
1901
1922
|
};
|
|
1902
1923
|
readonly pin: {
|
|
1903
1924
|
readonly type: "boolean";
|
|
@@ -1945,7 +1966,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
1945
1966
|
readonly key: {
|
|
1946
1967
|
readonly type: "string";
|
|
1947
1968
|
readonly description: "S3 prefix key for the empty folder (`{workspace}/folders/{name}/`).";
|
|
1948
|
-
readonly example: "550e8400-e29b-41d4-a716-446655440000/folders/contracts/";
|
|
1969
|
+
readonly example: "550e8400-e29b-41d4-a716-446655440000/folders/contracts/2026/";
|
|
1949
1970
|
};
|
|
1950
1971
|
};
|
|
1951
1972
|
};
|
|
@@ -1991,6 +2012,43 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
1991
2012
|
};
|
|
1992
2013
|
};
|
|
1993
2014
|
};
|
|
2015
|
+
readonly StorageUsageSuccess: {
|
|
2016
|
+
readonly type: "object";
|
|
2017
|
+
readonly required: readonly [
|
|
2018
|
+
"success",
|
|
2019
|
+
"usedBytes",
|
|
2020
|
+
"filesBytes",
|
|
2021
|
+
"commentsBytes",
|
|
2022
|
+
"limitBytes"
|
|
2023
|
+
];
|
|
2024
|
+
readonly properties: {
|
|
2025
|
+
readonly success: {
|
|
2026
|
+
readonly type: "boolean";
|
|
2027
|
+
readonly const: true;
|
|
2028
|
+
};
|
|
2029
|
+
readonly usedBytes: {
|
|
2030
|
+
readonly type: "integer";
|
|
2031
|
+
readonly description: "Total finalized storage in bytes (`filesBytes` + `commentsBytes`). Excludes `.tmp` objects.";
|
|
2032
|
+
readonly example: 348320;
|
|
2033
|
+
};
|
|
2034
|
+
readonly filesBytes: {
|
|
2035
|
+
readonly type: "integer";
|
|
2036
|
+
readonly description: "Finalized workspace file storage under `{workspace}/` (root files and folders). Excludes `.tmp`.";
|
|
2037
|
+
readonly example: 248320;
|
|
2038
|
+
};
|
|
2039
|
+
readonly commentsBytes: {
|
|
2040
|
+
readonly type: "integer";
|
|
2041
|
+
readonly description: "Finalized comment attachment storage under `{workspace}_comments/`. Excludes `.tmp`.";
|
|
2042
|
+
readonly example: 100000;
|
|
2043
|
+
};
|
|
2044
|
+
readonly limitBytes: {
|
|
2045
|
+
readonly type: "integer";
|
|
2046
|
+
readonly nullable: true;
|
|
2047
|
+
readonly description: "Plan storage limit in bytes for this workspace, or null when no subscription/limit is configured. Applies to the combined total.";
|
|
2048
|
+
readonly example: 1073741824;
|
|
2049
|
+
};
|
|
2050
|
+
};
|
|
2051
|
+
};
|
|
1994
2052
|
readonly DownloadFileSuccess: {
|
|
1995
2053
|
readonly type: "object";
|
|
1996
2054
|
readonly required: readonly [
|
|
@@ -2018,7 +2076,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
2018
2076
|
readonly type: "object";
|
|
2019
2077
|
readonly required: readonly [
|
|
2020
2078
|
"workspace",
|
|
2021
|
-
"
|
|
2079
|
+
"path"
|
|
2022
2080
|
];
|
|
2023
2081
|
readonly properties: {
|
|
2024
2082
|
readonly workspace: {
|
|
@@ -2026,10 +2084,8 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
2026
2084
|
readonly format: "uuid";
|
|
2027
2085
|
readonly description: "Workspace identifier (used for access check).";
|
|
2028
2086
|
};
|
|
2029
|
-
readonly
|
|
2030
|
-
readonly
|
|
2031
|
-
readonly description: "Full S3 object key to delete (as returned by list or upload).";
|
|
2032
|
-
readonly example: "550e8400-e29b-41d4-a716-446655440000/invoice-2026.pdf";
|
|
2087
|
+
readonly path: {
|
|
2088
|
+
readonly $ref: "#/components/schemas/WorkspaceRelativeFilePath";
|
|
2033
2089
|
};
|
|
2034
2090
|
};
|
|
2035
2091
|
};
|
|
@@ -2080,6 +2136,49 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
2080
2136
|
};
|
|
2081
2137
|
};
|
|
2082
2138
|
};
|
|
2139
|
+
readonly MoveFileRequest: {
|
|
2140
|
+
readonly type: "object";
|
|
2141
|
+
readonly required: readonly [
|
|
2142
|
+
"workspace",
|
|
2143
|
+
"from",
|
|
2144
|
+
"to"
|
|
2145
|
+
];
|
|
2146
|
+
readonly properties: {
|
|
2147
|
+
readonly workspace: {
|
|
2148
|
+
readonly type: "string";
|
|
2149
|
+
readonly format: "uuid";
|
|
2150
|
+
readonly description: "Workspace identifier.";
|
|
2151
|
+
};
|
|
2152
|
+
readonly from: {
|
|
2153
|
+
readonly $ref: "#/components/schemas/WorkspaceRelativeFilePath";
|
|
2154
|
+
};
|
|
2155
|
+
readonly to: {
|
|
2156
|
+
readonly $ref: "#/components/schemas/WorkspaceRelativeFilePath";
|
|
2157
|
+
};
|
|
2158
|
+
};
|
|
2159
|
+
};
|
|
2160
|
+
readonly MoveFileSuccess: {
|
|
2161
|
+
readonly type: "object";
|
|
2162
|
+
readonly required: readonly [
|
|
2163
|
+
"success",
|
|
2164
|
+
"from",
|
|
2165
|
+
"to"
|
|
2166
|
+
];
|
|
2167
|
+
readonly properties: {
|
|
2168
|
+
readonly success: {
|
|
2169
|
+
readonly type: "boolean";
|
|
2170
|
+
readonly const: true;
|
|
2171
|
+
};
|
|
2172
|
+
readonly from: {
|
|
2173
|
+
readonly type: "string";
|
|
2174
|
+
readonly description: "Source full S3 object key.";
|
|
2175
|
+
};
|
|
2176
|
+
readonly to: {
|
|
2177
|
+
readonly type: "string";
|
|
2178
|
+
readonly description: "Destination full S3 object key.";
|
|
2179
|
+
};
|
|
2180
|
+
};
|
|
2181
|
+
};
|
|
2083
2182
|
readonly MatrixLoginResponse: {
|
|
2084
2183
|
readonly type: "object";
|
|
2085
2184
|
readonly description: "Raw Matrix login payload returned directly (not wrapped). Existing tenants are looked up by JWT `userId` + workspace. On first login, Synapse `/login` response is returned and the access token is persisted on the tenant. On subsequent calls, a cached payload is synthesized from the stored token with `device_id` `MESTRA_{tenantId}` and `well_known.m.homeserver.base_url`. Workspace owners use Matrix localpart `owner_{emailLocalPart}-{workspaceId}`; other collaborators use `{emailLocalPart}-{workspaceId}`.";
|
|
@@ -10655,7 +10754,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
10655
10754
|
"Files"
|
|
10656
10755
|
];
|
|
10657
10756
|
readonly summary: "Create presigned S3 upload";
|
|
10658
|
-
readonly description: "Returns a presigned POST URL and form fields for uploading a file to S3 (max 15 MB, 5-minute expiry).
|
|
10757
|
+
readonly description: "Returns a presigned POST URL and form fields for uploading a file to S3 (max 15 MB, 5-minute expiry). Root object key is `{workspace}/{filename}.tmp`. With optional `folder`, key is `{workspace}/folders/{folder}/{filename}.tmp` and the folder marker must already exist. Only JPEG, PNG, WebP, and PDF content types are accepted. After the multipart upload succeeds, call `/files/confirm` with the same `filename` and `folder` to validate magic bytes and promote the object. Temporary objects are excluded from list results. Requires active workspace access and write access to crm::files.";
|
|
10659
10758
|
readonly security: readonly [
|
|
10660
10759
|
never
|
|
10661
10760
|
];
|
|
@@ -10711,7 +10810,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
10711
10810
|
};
|
|
10712
10811
|
};
|
|
10713
10812
|
readonly 404: {
|
|
10714
|
-
readonly description: "Workspace not found.";
|
|
10813
|
+
readonly description: "Workspace or destination folder not found.";
|
|
10715
10814
|
readonly content: {
|
|
10716
10815
|
readonly "application/json": {
|
|
10717
10816
|
readonly schema: {
|
|
@@ -10729,7 +10828,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
10729
10828
|
"Files"
|
|
10730
10829
|
];
|
|
10731
10830
|
readonly summary: "Confirm and promote a temporary upload";
|
|
10732
|
-
readonly description: "Reads the temporary object
|
|
10831
|
+
readonly description: "Reads the temporary object (root or under `folders/{folder}/`), verifies size (<= 15 MB) and real file type (JPEG, PNG, WebP, or PDF), promotes it to the final key, and deletes the temporary object. On failure, the temporary object is deleted. Requires workspace access.";
|
|
10733
10832
|
readonly security: readonly [
|
|
10734
10833
|
never
|
|
10735
10834
|
];
|
|
@@ -10785,7 +10884,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
10785
10884
|
};
|
|
10786
10885
|
};
|
|
10787
10886
|
readonly 404: {
|
|
10788
|
-
readonly description: "Workspace not found.";
|
|
10887
|
+
readonly description: "Workspace or destination folder not found.";
|
|
10789
10888
|
readonly content: {
|
|
10790
10889
|
readonly "application/json": {
|
|
10791
10890
|
readonly schema: {
|
|
@@ -10803,7 +10902,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
10803
10902
|
"Files"
|
|
10804
10903
|
];
|
|
10805
10904
|
readonly summary: "Create an empty S3 folder";
|
|
10806
|
-
readonly description: "Creates an empty folder marker in S3 at `{workspace}/folders/{name}/`. Requires workspace access.";
|
|
10905
|
+
readonly description: "Creates an empty folder marker in S3 at `{workspace}/folders/{name}/`. `name` may be nested (e.g. `contracts/2026`). Requires workspace access.";
|
|
10807
10906
|
readonly security: readonly [
|
|
10808
10907
|
never
|
|
10809
10908
|
];
|
|
@@ -10877,7 +10976,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
10877
10976
|
"Files"
|
|
10878
10977
|
];
|
|
10879
10978
|
readonly summary: "Delete an S3 folder and its contents";
|
|
10880
|
-
readonly description: "Deletes all objects under `{workspace}/folders/{name}/` in paginated batches. Requires workspace access.";
|
|
10979
|
+
readonly description: "Deletes all objects under `{workspace}/folders/{name}/` in paginated batches. `name` may be nested. Requires workspace access.";
|
|
10881
10980
|
readonly security: readonly [
|
|
10882
10981
|
never
|
|
10883
10982
|
];
|
|
@@ -11021,13 +11120,13 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
11021
11120
|
};
|
|
11022
11121
|
};
|
|
11023
11122
|
};
|
|
11024
|
-
readonly "/files/
|
|
11123
|
+
readonly "/files/usage/{workspace}": {
|
|
11025
11124
|
readonly get: {
|
|
11026
11125
|
readonly tags: readonly [
|
|
11027
11126
|
"Files"
|
|
11028
11127
|
];
|
|
11029
|
-
readonly summary: "Get
|
|
11030
|
-
readonly description: "Returns
|
|
11128
|
+
readonly summary: "Get workspace storage usage";
|
|
11129
|
+
readonly description: "Returns finalized storage usage broken down by workspace files (`filesBytes`) and comment attachments (`commentsBytes`), plus the combined total and plan limit. Temporary `.tmp` objects are excluded. Requires workspace access and read access to crm::files.";
|
|
11031
11130
|
readonly security: readonly [
|
|
11032
11131
|
never
|
|
11033
11132
|
];
|
|
@@ -11041,15 +11140,81 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
11041
11140
|
readonly format: "uuid";
|
|
11042
11141
|
};
|
|
11043
11142
|
readonly description: "Workspace identifier.";
|
|
11044
|
-
}
|
|
11143
|
+
}
|
|
11144
|
+
];
|
|
11145
|
+
readonly responses: {
|
|
11146
|
+
readonly 200: {
|
|
11147
|
+
readonly description: "Storage usage returned.";
|
|
11148
|
+
readonly content: {
|
|
11149
|
+
readonly "application/json": {
|
|
11150
|
+
readonly schema: {
|
|
11151
|
+
readonly $ref: "#/components/schemas/StorageUsageSuccess";
|
|
11152
|
+
};
|
|
11153
|
+
};
|
|
11154
|
+
};
|
|
11155
|
+
};
|
|
11156
|
+
readonly 401: {
|
|
11157
|
+
readonly description: "Unauthorized - Missing or invalid access token.";
|
|
11158
|
+
readonly content: {
|
|
11159
|
+
readonly "application/json": {
|
|
11160
|
+
readonly schema: {
|
|
11161
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
11162
|
+
};
|
|
11163
|
+
};
|
|
11164
|
+
};
|
|
11165
|
+
};
|
|
11166
|
+
readonly 403: {
|
|
11167
|
+
readonly description: "Forbidden - Token issuer is not 'access' or user lacks workspace access.";
|
|
11168
|
+
readonly content: {
|
|
11169
|
+
readonly "application/json": {
|
|
11170
|
+
readonly schema: {
|
|
11171
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
11172
|
+
};
|
|
11173
|
+
};
|
|
11174
|
+
};
|
|
11175
|
+
};
|
|
11176
|
+
readonly 404: {
|
|
11177
|
+
readonly description: "Workspace not found.";
|
|
11178
|
+
readonly content: {
|
|
11179
|
+
readonly "application/json": {
|
|
11180
|
+
readonly schema: {
|
|
11181
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
11182
|
+
};
|
|
11183
|
+
};
|
|
11184
|
+
};
|
|
11185
|
+
};
|
|
11186
|
+
};
|
|
11187
|
+
};
|
|
11188
|
+
};
|
|
11189
|
+
readonly "/files/download/{workspace}": {
|
|
11190
|
+
readonly get: {
|
|
11191
|
+
readonly tags: readonly [
|
|
11192
|
+
"Files"
|
|
11193
|
+
];
|
|
11194
|
+
readonly summary: "Get presigned download URL";
|
|
11195
|
+
readonly description: "Returns a presigned GET URL for `{workspace}/{path}` (5-minute expiry). Pass the workspace-relative path as the `path` query parameter (root leaf or `folders/...`). Requires workspace access.";
|
|
11196
|
+
readonly security: readonly [
|
|
11197
|
+
never
|
|
11198
|
+
];
|
|
11199
|
+
readonly parameters: readonly [
|
|
11045
11200
|
{
|
|
11046
|
-
readonly name: "
|
|
11201
|
+
readonly name: "workspace";
|
|
11047
11202
|
readonly in: "path";
|
|
11048
11203
|
readonly required: true;
|
|
11049
11204
|
readonly schema: {
|
|
11050
11205
|
readonly type: "string";
|
|
11206
|
+
readonly format: "uuid";
|
|
11207
|
+
};
|
|
11208
|
+
readonly description: "Workspace identifier.";
|
|
11209
|
+
},
|
|
11210
|
+
{
|
|
11211
|
+
readonly name: "path";
|
|
11212
|
+
readonly in: "query";
|
|
11213
|
+
readonly required: true;
|
|
11214
|
+
readonly schema: {
|
|
11215
|
+
readonly $ref: "#/components/schemas/WorkspaceRelativeFilePath";
|
|
11051
11216
|
};
|
|
11052
|
-
readonly description: "
|
|
11217
|
+
readonly description: "Workspace-relative file path after the workspace prefix.";
|
|
11053
11218
|
}
|
|
11054
11219
|
];
|
|
11055
11220
|
readonly responses: {
|
|
@@ -11064,7 +11229,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
11064
11229
|
};
|
|
11065
11230
|
};
|
|
11066
11231
|
readonly 400: {
|
|
11067
|
-
readonly description: "Invalid workspace id.";
|
|
11232
|
+
readonly description: "Invalid workspace id or file path.";
|
|
11068
11233
|
readonly content: {
|
|
11069
11234
|
readonly "application/json": {
|
|
11070
11235
|
readonly schema: {
|
|
@@ -11112,7 +11277,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
11112
11277
|
"Files"
|
|
11113
11278
|
];
|
|
11114
11279
|
readonly summary: "Pin or unpin a file";
|
|
11115
|
-
readonly description: "Sets S3 object user metadata `pin` to `true` or `false` on
|
|
11280
|
+
readonly description: "Sets S3 object user metadata `pin` to `true` or `false` on `{workspace}/{path}` via copy-in-place with MetadataDirective REPLACE. Requires workspace access.";
|
|
11116
11281
|
readonly security: readonly [
|
|
11117
11282
|
never
|
|
11118
11283
|
];
|
|
@@ -11185,8 +11350,8 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
11185
11350
|
readonly tags: readonly [
|
|
11186
11351
|
"Files"
|
|
11187
11352
|
];
|
|
11188
|
-
readonly summary: "Delete a file by
|
|
11189
|
-
readonly description: "Deletes
|
|
11353
|
+
readonly summary: "Delete a file by workspace-relative path";
|
|
11354
|
+
readonly description: "Deletes the S3 object at `{workspace}/{path}`. Verifies the object exists before deletion and confirms removal afterward. Requires workspace access.";
|
|
11190
11355
|
readonly security: readonly [
|
|
11191
11356
|
never
|
|
11192
11357
|
];
|
|
@@ -11242,7 +11407,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
11242
11407
|
};
|
|
11243
11408
|
};
|
|
11244
11409
|
readonly 404: {
|
|
11245
|
-
readonly description: "File not found
|
|
11410
|
+
readonly description: "File or workspace not found.";
|
|
11246
11411
|
readonly content: {
|
|
11247
11412
|
readonly "application/json": {
|
|
11248
11413
|
readonly schema: {
|
|
@@ -11252,7 +11417,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
11252
11417
|
};
|
|
11253
11418
|
};
|
|
11254
11419
|
readonly 500: {
|
|
11255
|
-
readonly description: "Delete
|
|
11420
|
+
readonly description: "Delete failed (object still present after delete).";
|
|
11256
11421
|
readonly content: {
|
|
11257
11422
|
readonly "application/json": {
|
|
11258
11423
|
readonly schema: {
|
|
@@ -11264,6 +11429,90 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
11264
11429
|
};
|
|
11265
11430
|
};
|
|
11266
11431
|
};
|
|
11432
|
+
readonly "/files/move": {
|
|
11433
|
+
readonly post: {
|
|
11434
|
+
readonly tags: readonly [
|
|
11435
|
+
"Files"
|
|
11436
|
+
];
|
|
11437
|
+
readonly summary: "Move a file within a workspace";
|
|
11438
|
+
readonly description: "Copies `{workspace}/{from}` to `{workspace}/{to}` (preserving content type and metadata including pin), then deletes the source. Destination must not already exist (409). If `to` is under `folders/`, the parent folder marker must exist. Requires workspace access and write access to crm::files.";
|
|
11439
|
+
readonly security: readonly [
|
|
11440
|
+
never
|
|
11441
|
+
];
|
|
11442
|
+
readonly requestBody: {
|
|
11443
|
+
readonly required: true;
|
|
11444
|
+
readonly content: {
|
|
11445
|
+
readonly "application/json": {
|
|
11446
|
+
readonly schema: {
|
|
11447
|
+
readonly $ref: "#/components/schemas/MoveFileRequest";
|
|
11448
|
+
};
|
|
11449
|
+
};
|
|
11450
|
+
};
|
|
11451
|
+
};
|
|
11452
|
+
readonly responses: {
|
|
11453
|
+
readonly 200: {
|
|
11454
|
+
readonly description: "File moved successfully.";
|
|
11455
|
+
readonly content: {
|
|
11456
|
+
readonly "application/json": {
|
|
11457
|
+
readonly schema: {
|
|
11458
|
+
readonly $ref: "#/components/schemas/MoveFileSuccess";
|
|
11459
|
+
};
|
|
11460
|
+
};
|
|
11461
|
+
};
|
|
11462
|
+
};
|
|
11463
|
+
readonly 400: {
|
|
11464
|
+
readonly description: "Invalid request payload.";
|
|
11465
|
+
readonly content: {
|
|
11466
|
+
readonly "application/json": {
|
|
11467
|
+
readonly schema: {
|
|
11468
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
11469
|
+
};
|
|
11470
|
+
};
|
|
11471
|
+
};
|
|
11472
|
+
};
|
|
11473
|
+
readonly 401: {
|
|
11474
|
+
readonly description: "Unauthorized - Missing or invalid access token.";
|
|
11475
|
+
readonly content: {
|
|
11476
|
+
readonly "application/json": {
|
|
11477
|
+
readonly schema: {
|
|
11478
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
11479
|
+
};
|
|
11480
|
+
};
|
|
11481
|
+
};
|
|
11482
|
+
};
|
|
11483
|
+
readonly 403: {
|
|
11484
|
+
readonly description: "Forbidden - Token issuer is not 'access' or user lacks workspace access.";
|
|
11485
|
+
readonly content: {
|
|
11486
|
+
readonly "application/json": {
|
|
11487
|
+
readonly schema: {
|
|
11488
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
11489
|
+
};
|
|
11490
|
+
};
|
|
11491
|
+
};
|
|
11492
|
+
};
|
|
11493
|
+
readonly 404: {
|
|
11494
|
+
readonly description: "Source file, destination folder, or workspace not found.";
|
|
11495
|
+
readonly content: {
|
|
11496
|
+
readonly "application/json": {
|
|
11497
|
+
readonly schema: {
|
|
11498
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
11499
|
+
};
|
|
11500
|
+
};
|
|
11501
|
+
};
|
|
11502
|
+
};
|
|
11503
|
+
readonly 409: {
|
|
11504
|
+
readonly description: "Destination already exists.";
|
|
11505
|
+
readonly content: {
|
|
11506
|
+
readonly "application/json": {
|
|
11507
|
+
readonly schema: {
|
|
11508
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
11509
|
+
};
|
|
11510
|
+
};
|
|
11511
|
+
};
|
|
11512
|
+
};
|
|
11513
|
+
};
|
|
11514
|
+
};
|
|
11515
|
+
};
|
|
11267
11516
|
readonly "/files/upload-to-comment": {
|
|
11268
11517
|
readonly post: {
|
|
11269
11518
|
readonly tags: readonly [
|
|
@@ -17861,6 +18110,14 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
17861
18110
|
};
|
|
17862
18111
|
outputFormat: "json";
|
|
17863
18112
|
status: 400;
|
|
18113
|
+
} | {
|
|
18114
|
+
input: {};
|
|
18115
|
+
output: {
|
|
18116
|
+
success: false;
|
|
18117
|
+
error: string;
|
|
18118
|
+
};
|
|
18119
|
+
outputFormat: "json";
|
|
18120
|
+
status: 404;
|
|
17864
18121
|
} | {
|
|
17865
18122
|
input: {};
|
|
17866
18123
|
output: {
|
|
@@ -17878,6 +18135,14 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
17878
18135
|
} & {
|
|
17879
18136
|
"/confirm": {
|
|
17880
18137
|
$post: {
|
|
18138
|
+
input: {};
|
|
18139
|
+
output: {
|
|
18140
|
+
success: false;
|
|
18141
|
+
error: string;
|
|
18142
|
+
};
|
|
18143
|
+
outputFormat: "json";
|
|
18144
|
+
status: 404;
|
|
18145
|
+
} | {
|
|
17881
18146
|
input: {};
|
|
17882
18147
|
output: {
|
|
17883
18148
|
success: true;
|
|
@@ -17959,13 +18224,30 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
17959
18224
|
};
|
|
17960
18225
|
};
|
|
17961
18226
|
} & {
|
|
17962
|
-
"/
|
|
18227
|
+
"/usage/:workspace": {
|
|
18228
|
+
$get: {
|
|
18229
|
+
input: {
|
|
18230
|
+
param: {
|
|
18231
|
+
workspace: string;
|
|
18232
|
+
};
|
|
18233
|
+
};
|
|
18234
|
+
output: {
|
|
18235
|
+
success: true;
|
|
18236
|
+
usedBytes: number;
|
|
18237
|
+
filesBytes: number;
|
|
18238
|
+
commentsBytes: number;
|
|
18239
|
+
limitBytes: number | null;
|
|
18240
|
+
};
|
|
18241
|
+
outputFormat: "json";
|
|
18242
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
18243
|
+
};
|
|
18244
|
+
};
|
|
18245
|
+
} & {
|
|
18246
|
+
"/download/:workspace": {
|
|
17963
18247
|
$get: {
|
|
17964
18248
|
input: {
|
|
17965
18249
|
param: {
|
|
17966
18250
|
workspace: string;
|
|
17967
|
-
} & {
|
|
17968
|
-
fileKey: string;
|
|
17969
18251
|
};
|
|
17970
18252
|
};
|
|
17971
18253
|
output: {
|
|
@@ -17978,8 +18260,6 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
17978
18260
|
input: {
|
|
17979
18261
|
param: {
|
|
17980
18262
|
workspace: string;
|
|
17981
|
-
} & {
|
|
17982
|
-
fileKey: string;
|
|
17983
18263
|
};
|
|
17984
18264
|
};
|
|
17985
18265
|
output: {
|
|
@@ -18050,6 +18330,43 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
18050
18330
|
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
18051
18331
|
};
|
|
18052
18332
|
};
|
|
18333
|
+
} & {
|
|
18334
|
+
"/move": {
|
|
18335
|
+
$post: {
|
|
18336
|
+
input: {};
|
|
18337
|
+
output: {
|
|
18338
|
+
success: false;
|
|
18339
|
+
error: never;
|
|
18340
|
+
};
|
|
18341
|
+
outputFormat: "json";
|
|
18342
|
+
status: 400;
|
|
18343
|
+
} | {
|
|
18344
|
+
input: {};
|
|
18345
|
+
output: {
|
|
18346
|
+
success: false;
|
|
18347
|
+
error: string;
|
|
18348
|
+
};
|
|
18349
|
+
outputFormat: "json";
|
|
18350
|
+
status: 404;
|
|
18351
|
+
} | {
|
|
18352
|
+
input: {};
|
|
18353
|
+
output: {
|
|
18354
|
+
success: false;
|
|
18355
|
+
error: string;
|
|
18356
|
+
};
|
|
18357
|
+
outputFormat: "json";
|
|
18358
|
+
status: 409;
|
|
18359
|
+
} | {
|
|
18360
|
+
input: {};
|
|
18361
|
+
output: {
|
|
18362
|
+
success: true;
|
|
18363
|
+
from: string;
|
|
18364
|
+
to: string;
|
|
18365
|
+
};
|
|
18366
|
+
outputFormat: "json";
|
|
18367
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
18368
|
+
};
|
|
18369
|
+
};
|
|
18053
18370
|
} & {
|
|
18054
18371
|
"/upload-to-comment": {
|
|
18055
18372
|
$post: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mestra-dev/contract",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.39",
|
|
4
4
|
"description": "Types-only Hono AppType contract for the Mestra auth API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/bun": "^1.3.14",
|
|
29
29
|
"dts-bundle-generator": "^9.5.1",
|
|
30
|
-
"hono": "^4.
|
|
31
|
-
"typescript": "^5.
|
|
30
|
+
"hono": "^4.13.1",
|
|
31
|
+
"typescript": "^5.9.3"
|
|
32
32
|
}
|
|
33
33
|
}
|