bem-ai-sdk 0.2.0 → 0.4.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 +16 -0
- package/client.d.mts +13 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +13 -0
- package/client.d.ts.map +1 -1
- package/client.js +13 -0
- package/client.js.map +1 -1
- package/client.mjs +13 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/functions/functions.d.mts +233 -14
- package/resources/functions/functions.d.mts.map +1 -1
- package/resources/functions/functions.d.ts +233 -14
- package/resources/functions/functions.d.ts.map +1 -1
- package/resources/functions/functions.js.map +1 -1
- package/resources/functions/functions.mjs.map +1 -1
- package/resources/functions/versions.d.mts +45 -1
- package/resources/functions/versions.d.mts.map +1 -1
- package/resources/functions/versions.d.ts +45 -1
- package/resources/functions/versions.d.ts.map +1 -1
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/infer-schema.d.mts +133 -0
- package/resources/infer-schema.d.mts.map +1 -0
- package/resources/infer-schema.d.ts +133 -0
- package/resources/infer-schema.d.ts.map +1 -0
- package/resources/infer-schema.js +54 -0
- package/resources/infer-schema.js.map +1 -0
- package/resources/infer-schema.mjs +50 -0
- package/resources/infer-schema.mjs.map +1 -0
- package/resources/workflows/workflows.d.mts +58 -15
- package/resources/workflows/workflows.d.mts.map +1 -1
- package/resources/workflows/workflows.d.ts +58 -15
- package/resources/workflows/workflows.d.ts.map +1 -1
- package/resources/workflows/workflows.js +17 -7
- package/resources/workflows/workflows.js.map +1 -1
- package/resources/workflows/workflows.mjs +18 -8
- package/resources/workflows/workflows.mjs.map +1 -1
- package/src/client.ts +19 -0
- package/src/resources/functions/functions.ts +287 -8
- package/src/resources/functions/versions.ts +60 -0
- package/src/resources/index.ts +1 -0
- package/src/resources/infer-schema.ts +160 -0
- package/src/resources/workflows/workflows.ts +104 -17
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from '../../core/pagination';
|
|
16
16
|
import { buildHeaders } from '../../internal/headers';
|
|
17
17
|
import { RequestOptions } from '../../internal/request-options';
|
|
18
|
-
import {
|
|
18
|
+
import { maybeMultipartFormRequestOptions } from '../../internal/uploads';
|
|
19
19
|
import { path } from '../../internal/utils/path';
|
|
20
20
|
|
|
21
21
|
/**
|
|
@@ -70,16 +70,25 @@ export class Workflows extends APIResource {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
|
-
* **Invoke a workflow
|
|
73
|
+
* **Invoke a workflow.**
|
|
74
74
|
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
75
|
+
* Submit the input file as either a multipart form request or a JSON request with
|
|
76
|
+
* base64-encoded file content. The workflow name is derived from the URL path.
|
|
77
|
+
*
|
|
78
|
+
* ## Input Formats
|
|
79
|
+
*
|
|
80
|
+
* - **Multipart form** (`multipart/form-data`): attach the file directly via the
|
|
81
|
+
* `file` or `files` fields. Set `wait` in the form body to control synchronous
|
|
82
|
+
* behaviour.
|
|
83
|
+
* - **JSON** (`application/json`): base64-encode the file content and set it in
|
|
84
|
+
* `input.singleFile.inputContent` or `input.batchFiles.inputs[*].inputContent`.
|
|
85
|
+
* Pass `wait=true` as a query parameter to control synchronous behaviour.
|
|
77
86
|
*
|
|
78
87
|
* ## Synchronous vs Asynchronous
|
|
79
88
|
*
|
|
80
89
|
* By default the call is created asynchronously and this endpoint returns
|
|
81
|
-
* `202 Accepted` immediately with a `pending` call object. Set
|
|
82
|
-
*
|
|
90
|
+
* `202 Accepted` immediately with a `pending` call object. Set `wait` to `true` to
|
|
91
|
+
* block until the call completes (up to 30 seconds):
|
|
83
92
|
*
|
|
84
93
|
* - On success: returns `200 OK` with the completed call, `outputs` populated
|
|
85
94
|
* - On failure: returns `500 Internal Server Error` with the call and an `error`
|
|
@@ -93,12 +102,13 @@ export class Workflows extends APIResource {
|
|
|
93
102
|
*/
|
|
94
103
|
call(
|
|
95
104
|
workflowName: string,
|
|
96
|
-
|
|
105
|
+
params: WorkflowCallParams,
|
|
97
106
|
options?: RequestOptions,
|
|
98
107
|
): APIPromise<CallsAPI.CallGetResponse> {
|
|
108
|
+
const { wait, ...body } = params;
|
|
99
109
|
return this._client.post(
|
|
100
110
|
path`/v3/workflows/${workflowName}/call`,
|
|
101
|
-
|
|
111
|
+
maybeMultipartFormRequestOptions({ query: { wait }, body, ...options }, this._client),
|
|
102
112
|
);
|
|
103
113
|
}
|
|
104
114
|
|
|
@@ -498,25 +508,102 @@ export interface WorkflowListParams extends WorkflowsPageParams {
|
|
|
498
508
|
|
|
499
509
|
export interface WorkflowCallParams {
|
|
500
510
|
/**
|
|
501
|
-
*
|
|
511
|
+
* Body param: Input to the workflow call. Provide exactly one of `singleFile` or
|
|
512
|
+
* `batchFiles`.
|
|
502
513
|
*/
|
|
503
|
-
|
|
514
|
+
input: WorkflowCallParams.Input;
|
|
504
515
|
|
|
505
516
|
/**
|
|
506
|
-
*
|
|
517
|
+
* Query param: When `true`, the endpoint blocks until the call completes (up to 30
|
|
518
|
+
* seconds) and returns the finished call object. Default: `false`.
|
|
507
519
|
*/
|
|
508
|
-
|
|
520
|
+
wait?: boolean;
|
|
509
521
|
|
|
510
522
|
/**
|
|
511
|
-
*
|
|
523
|
+
* Body param: Your reference ID for tracking this call.
|
|
512
524
|
*/
|
|
513
|
-
|
|
525
|
+
callReferenceID?: string;
|
|
526
|
+
}
|
|
514
527
|
|
|
528
|
+
export namespace WorkflowCallParams {
|
|
515
529
|
/**
|
|
516
|
-
*
|
|
517
|
-
* returns the finished call object. Default: `false`.
|
|
530
|
+
* Input to the workflow call. Provide exactly one of `singleFile` or `batchFiles`.
|
|
518
531
|
*/
|
|
519
|
-
|
|
532
|
+
export interface Input {
|
|
533
|
+
batchFiles?: Input.BatchFiles;
|
|
534
|
+
|
|
535
|
+
singleFile?: Input.SingleFile;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
export namespace Input {
|
|
539
|
+
export interface BatchFiles {
|
|
540
|
+
inputs?: Array<BatchFiles.Input>;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
export namespace BatchFiles {
|
|
544
|
+
export interface Input {
|
|
545
|
+
/**
|
|
546
|
+
* Base64-encoded file content
|
|
547
|
+
*/
|
|
548
|
+
inputContent: string;
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* The input type of the content you're sending for transformation.
|
|
552
|
+
*/
|
|
553
|
+
inputType:
|
|
554
|
+
| 'csv'
|
|
555
|
+
| 'docx'
|
|
556
|
+
| 'email'
|
|
557
|
+
| 'heic'
|
|
558
|
+
| 'html'
|
|
559
|
+
| 'jpeg'
|
|
560
|
+
| 'json'
|
|
561
|
+
| 'heif'
|
|
562
|
+
| 'm4a'
|
|
563
|
+
| 'mp3'
|
|
564
|
+
| 'pdf'
|
|
565
|
+
| 'png'
|
|
566
|
+
| 'text'
|
|
567
|
+
| 'wav'
|
|
568
|
+
| 'webp'
|
|
569
|
+
| 'xls'
|
|
570
|
+
| 'xlsx'
|
|
571
|
+
| 'xml';
|
|
572
|
+
|
|
573
|
+
itemReferenceID?: string;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
export interface SingleFile {
|
|
578
|
+
/**
|
|
579
|
+
* Base64-encoded file content
|
|
580
|
+
*/
|
|
581
|
+
inputContent: string;
|
|
582
|
+
|
|
583
|
+
/**
|
|
584
|
+
* The input type of the content you're sending for transformation.
|
|
585
|
+
*/
|
|
586
|
+
inputType:
|
|
587
|
+
| 'csv'
|
|
588
|
+
| 'docx'
|
|
589
|
+
| 'email'
|
|
590
|
+
| 'heic'
|
|
591
|
+
| 'html'
|
|
592
|
+
| 'jpeg'
|
|
593
|
+
| 'json'
|
|
594
|
+
| 'heif'
|
|
595
|
+
| 'm4a'
|
|
596
|
+
| 'mp3'
|
|
597
|
+
| 'pdf'
|
|
598
|
+
| 'png'
|
|
599
|
+
| 'text'
|
|
600
|
+
| 'wav'
|
|
601
|
+
| 'webp'
|
|
602
|
+
| 'xls'
|
|
603
|
+
| 'xlsx'
|
|
604
|
+
| 'xml';
|
|
605
|
+
}
|
|
606
|
+
}
|
|
520
607
|
}
|
|
521
608
|
|
|
522
609
|
export interface WorkflowCopyParams {
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.4.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.4.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.4.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.4.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|