@tailor-platform/function-types 0.6.1 → 0.7.1
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 +7 -0
- package/package.json +6 -2
- package/tailor.d.ts +60 -2
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# @tailor-platform/function-types
|
|
2
|
+
|
|
3
|
+
## 0.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#106](https://github.com/tailor-platform/function/pull/106) [`30c9875`](https://github.com/tailor-platform/function/commit/30c9875b25ab5f5eea8686fc9dcacbbbb0e1a00e) Thanks [@remiposo](https://github.com/remiposo)! - add CHANGELOG.md
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tailor-platform/function-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "TypeScript types for Tailor Platform Function service",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,5 +8,9 @@
|
|
|
8
8
|
"directory": "packages/types"
|
|
9
9
|
},
|
|
10
10
|
"types": "./tailor.d.ts",
|
|
11
|
-
"author": ""
|
|
11
|
+
"author": "",
|
|
12
|
+
"files": [
|
|
13
|
+
"tailor.d.ts",
|
|
14
|
+
"CHANGELOG.md"
|
|
15
|
+
]
|
|
12
16
|
}
|
package/tailor.d.ts
CHANGED
|
@@ -85,8 +85,8 @@ declare namespace tailor.iconv {
|
|
|
85
85
|
*/
|
|
86
86
|
function decode<T extends string>(
|
|
87
87
|
buffer: Uint8Array | ArrayBuffer,
|
|
88
|
-
encoding:
|
|
89
|
-
):
|
|
88
|
+
encoding: string
|
|
89
|
+
): string;
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
92
|
* Encode string to buffer
|
|
@@ -251,3 +251,61 @@ interface TailorDBFileAPI {
|
|
|
251
251
|
recordId: string
|
|
252
252
|
): Promise<FileStreamIterator>;
|
|
253
253
|
}
|
|
254
|
+
|
|
255
|
+
declare namespace tailor.workflow {
|
|
256
|
+
/**
|
|
257
|
+
* Specifies the machine user that should be used to execute the workflow.
|
|
258
|
+
* This allows workflows to run with specific authentication context.
|
|
259
|
+
*/
|
|
260
|
+
interface AuthInvoker {
|
|
261
|
+
/** The namespace where the machine user is defined */
|
|
262
|
+
namespace: string;
|
|
263
|
+
/** The name of the machine user to use for workflow execution */
|
|
264
|
+
machineUserName: string;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Options for triggering a workflow
|
|
269
|
+
*/
|
|
270
|
+
interface TriggerWorkflowOptions {
|
|
271
|
+
/** Optional authentication invoker to specify which machine user should execute the workflow */
|
|
272
|
+
authInvoker?: AuthInvoker;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Triggers a workflow and returns its execution ID.
|
|
277
|
+
*
|
|
278
|
+
* @param workflow_name - The name of the workflow to trigger
|
|
279
|
+
* @param args - Optional arguments to pass to the workflow
|
|
280
|
+
* @param options - Optional configuration including authentication settings
|
|
281
|
+
* @returns A Promise that resolves to the workflow execution ID (UUID format)
|
|
282
|
+
*
|
|
283
|
+
* @example
|
|
284
|
+
* ```typescript
|
|
285
|
+
* // Basic usage
|
|
286
|
+
* const executionId = await tailor.workflow.triggerWorkflow('myWorkflow', { data: 'value' });
|
|
287
|
+
*
|
|
288
|
+
* // With authentication invoker
|
|
289
|
+
* const executionId = await tailor.workflow.triggerWorkflow(
|
|
290
|
+
* 'myWorkflow',
|
|
291
|
+
* { data: 'value' },
|
|
292
|
+
* { authInvoker: { namespace: 'myNamespace', machineUserName: 'myUser' } }
|
|
293
|
+
* );
|
|
294
|
+
* ```
|
|
295
|
+
*/
|
|
296
|
+
function triggerWorkflow(
|
|
297
|
+
workflow_name: string,
|
|
298
|
+
args?: any,
|
|
299
|
+
options?: TriggerWorkflowOptions
|
|
300
|
+
): Promise<string>;
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Triggers a job function and returns its result.
|
|
304
|
+
*
|
|
305
|
+
* @param job_name - The name of the job function to trigger
|
|
306
|
+
* @param args - Optional arguments to pass to the job function
|
|
307
|
+
* @returns The result returned by the job function. The return type depends on the specific job function
|
|
308
|
+
implementation.
|
|
309
|
+
*/
|
|
310
|
+
function triggerJobFunction(job_name: string, args?: any): any;
|
|
311
|
+
}
|