@tailor-platform/function-types 0.7.2 → 0.8.0

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/package.json +1 -1
  2. package/tailor.d.ts +26 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/function-types",
3
- "version": "0.7.2",
3
+ "version": "0.8.0",
4
4
  "description": "TypeScript types for Tailor Platform Function service",
5
5
  "repository": {
6
6
  "type": "git",
package/tailor.d.ts CHANGED
@@ -117,7 +117,7 @@ declare namespace tailor.iconv {
117
117
  */
118
118
  declare class TailorDBFileError extends Error {
119
119
  name: 'TailorDBFileError';
120
- code?: 'INVALID_PARAMS' | 'INVALID_DATA_TYPE' | 'OPERATION_FAILED' | 'DELETE_FAILED' | 'STREAM_OPEN_FAILED' | 'STREAM_READ_ERROR' | 'STREAM_ERROR';
120
+ code?: 'INVALID_PARAMS' | 'INVALID_DATA_TYPE' | 'OPERATION_FAILED' | 'DELETE_FAILED' | 'STREAM_OPEN_FAILED' | 'STREAM_READ_ERROR' | 'STREAM_ERROR' | 'FILE_TOO_LARGE';
121
121
  cause?: unknown;
122
122
  }
123
123
 
@@ -135,6 +135,8 @@ interface UploadMetadata {
135
135
  interface DownloadMetadata {
136
136
  contentType: string;
137
137
  fileSize: number;
138
+ sha256sum: string;
139
+ lastUploadedAt: string;
138
140
  }
139
141
 
140
142
  /**
@@ -179,6 +181,14 @@ interface FileDownloadResponse {
179
181
  metadata: DownloadMetadata;
180
182
  }
181
183
 
184
+ /**
185
+ * Download as Base64 response interface
186
+ */
187
+ interface FileDownloadAsBase64Response {
188
+ data: string;
189
+ metadata: DownloadMetadata;
190
+ }
191
+
182
192
  /**
183
193
  * Stream chunk types
184
194
  */
@@ -213,6 +223,7 @@ interface TailorDBFileAPI {
213
223
 
214
224
  /**
215
225
  * Download a file from TailorDB
226
+ * @throws {TailorDBFileError} FILE_TOO_LARGE if file exceeds 10MB - use openDownloadStream() for large files
216
227
  */
217
228
  download(
218
229
  namespace: string,
@@ -221,6 +232,20 @@ interface TailorDBFileAPI {
221
232
  recordId: string
222
233
  ): Promise<FileDownloadResponse>;
223
234
 
235
+ /**
236
+ * Download a file from TailorDB as Base64 string
237
+ * Unlike download which returns decoded binary data (Uint8Array),
238
+ * this returns the raw Base64-encoded string for use cases requiring
239
+ * Base64 format (e.g., embedding in JSON responses, data URIs)
240
+ * @throws {TailorDBFileError} FILE_TOO_LARGE if file exceeds 10MB - use openDownloadStream() for large files
241
+ */
242
+ downloadAsBase64(
243
+ namespace: string,
244
+ typeName: string,
245
+ fieldName: string,
246
+ recordId: string
247
+ ): Promise<FileDownloadAsBase64Response>;
248
+
224
249
  /**
225
250
  * Delete a file from TailorDB
226
251
  */