@tailor-platform/function-types 0.8.5 → 0.10.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @tailor-platform/function-types
2
2
 
3
+ ## 0.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#189](https://github.com/tailor-platform/function/pull/189) [`2e2f241`](https://github.com/tailor-platform/function/commit/2e2f241b0e9bb1480de7e376abbef3cd27aae30d) Thanks [@dragon3](https://github.com/dragon3)! - Add `tailor.aigateway.get(name)` types for resolving an AI Gateway URL in the caller's workspace.
8
+
9
+ ### Patch Changes
10
+
11
+ - [#180](https://github.com/tailor-platform/function/pull/180) [`a36c24f`](https://github.com/tailor-platform/function/commit/a36c24faa835a350617b4f29c6e848894bcdc1e3) Thanks [@k1LoW](https://github.com/k1LoW)! - Remove non-existent `updatedAt` field from `tailor.idp.User`
12
+
13
+ ## 0.9.0
14
+
15
+ ### Minor Changes
16
+
17
+ - [#178](https://github.com/tailor-platform/function/pull/178) [`1b2e22b`](https://github.com/tailor-platform/function/commit/1b2e22b6f9895fd25df353a4680fb2bd6465b9b7) Thanks [@haru0017](https://github.com/haru0017)! - Add `downloadStream` and `uploadStream` types to `TailorDBFileAPI`. Mark `openDownloadStream` as deprecated.
18
+
3
19
  ## 0.8.5
4
20
 
5
21
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/function-types",
3
- "version": "0.8.5",
3
+ "version": "0.10.0",
4
4
  "description": "TypeScript types for Tailor Platform Function service",
5
5
  "repository": {
6
6
  "type": "git",
package/tailor.d.ts CHANGED
@@ -61,6 +61,27 @@ declare namespace tailor.authconnection {
61
61
  function getConnectionToken(connectionName: string): Promise<any>;
62
62
  }
63
63
 
64
+ declare namespace tailor.aigateway {
65
+ /**
66
+ * AIGateway describes a resolved AI Gateway in the caller's workspace.
67
+ */
68
+ interface AIGateway {
69
+ /**
70
+ * Base URL of the AI Gateway, e.g.
71
+ * `https://my-aigateway-<workspace_hash>.ai.erp.dev`. Requests to this URL
72
+ * are automatically authenticated for the calling workspace.
73
+ */
74
+ url: string;
75
+ }
76
+
77
+ /**
78
+ * get resolves a named AI Gateway in the caller's own workspace and returns
79
+ * it. The gateway's existence is verified at call time, so resolving a name
80
+ * that does not exist rejects rather than failing later inside `fetch`.
81
+ */
82
+ function get(name: string): Promise<AIGateway>;
83
+ }
84
+
64
85
  declare namespace tailor.iconv {
65
86
  /**
66
87
  * Convert string from one encoding to another
@@ -166,6 +187,14 @@ interface FileUploadOptions {
166
187
  contentType?: string;
167
188
  }
168
189
 
190
+ /**
191
+ * Upload stream options interface
192
+ */
193
+ interface FileUploadStreamOptions {
194
+ contentType?: string;
195
+ fileSize?: number;
196
+ }
197
+
169
198
  /**
170
199
  * Upload response interface
171
200
  */
@@ -189,6 +218,14 @@ interface FileDownloadAsBase64Response {
189
218
  metadata: DownloadMetadata;
190
219
  }
191
220
 
221
+ /**
222
+ * Download stream response interface
223
+ */
224
+ interface FileDownloadStreamResponse {
225
+ body: ReadableStream<Uint8Array>;
226
+ metadata: DownloadMetadata;
227
+ }
228
+
192
229
  /**
193
230
  * Stream chunk types
194
231
  */
@@ -223,7 +260,7 @@ interface TailorDBFileAPI {
223
260
 
224
261
  /**
225
262
  * Download a file from TailorDB
226
- * @throws {TailorDBFileError} FILE_TOO_LARGE if file exceeds 10MB - use openDownloadStream() for large files
263
+ * @throws {TailorDBFileError} FILE_TOO_LARGE if file exceeds 10MB - use downloadStream() for large files
227
264
  */
228
265
  download(
229
266
  namespace: string,
@@ -237,7 +274,7 @@ interface TailorDBFileAPI {
237
274
  * Unlike download which returns decoded binary data (Uint8Array),
238
275
  * this returns the raw Base64-encoded string for use cases requiring
239
276
  * 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
277
+ * @throws {TailorDBFileError} FILE_TOO_LARGE if file exceeds 10MB - use downloadStream() for large files
241
278
  */
242
279
  downloadAsBase64(
243
280
  namespace: string,
@@ -268,6 +305,7 @@ interface TailorDBFileAPI {
268
305
 
269
306
  /**
270
307
  * Open a download stream for large files
308
+ * @deprecated Use downloadStream() instead
271
309
  */
272
310
  openDownloadStream(
273
311
  namespace: string,
@@ -275,6 +313,28 @@ interface TailorDBFileAPI {
275
313
  fieldName: string,
276
314
  recordId: string
277
315
  ): Promise<FileStreamIterator>;
316
+
317
+ /**
318
+ * Download a file as a ReadableStream
319
+ */
320
+ downloadStream(
321
+ namespace: string,
322
+ typeName: string,
323
+ fieldName: string,
324
+ recordId: string
325
+ ): Promise<FileDownloadStreamResponse>;
326
+
327
+ /**
328
+ * Upload a file using a ReadableStream
329
+ */
330
+ uploadStream(
331
+ namespace: string,
332
+ typeName: string,
333
+ fieldName: string,
334
+ recordId: string,
335
+ readableStream: ReadableStream<Uint8Array | ArrayBuffer>,
336
+ options?: FileUploadStreamOptions
337
+ ): Promise<FileUploadResponse>;
278
338
  }
279
339
 
280
340
  declare namespace tailor.idp {
@@ -293,7 +353,6 @@ declare namespace tailor.idp {
293
353
  name: string;
294
354
  disabled: boolean;
295
355
  createdAt?: string;
296
- updatedAt?: string;
297
356
  }
298
357
 
299
358
  /**