@vertesia/common 0.51.0 → 0.54.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/package.json +3 -3
- package/src/apikey.ts +1 -1
- package/src/common.ts +3 -0
- package/src/index.ts +1 -1
- package/src/integrations.ts +1 -1
- package/src/interaction.ts +263 -40
- package/src/meters.ts +9 -3
- package/src/payload.ts +15 -3
- package/src/plugin.ts +12 -0
- package/src/project.ts +8 -0
- package/src/prompt.ts +1 -1
- package/src/query.ts +5 -3
- package/src/runs.ts +11 -2
- package/src/store/activity-catalog.ts +2 -2
- package/src/store/agent.ts +1 -1
- package/src/store/collections.ts +9 -3
- package/src/store/common.ts +21 -1
- package/src/store/doc-analyzer.ts +80 -20
- package/src/store/dsl-workflow.ts +9 -9
- package/src/store/index.ts +1 -0
- package/src/store/signals.ts +5 -0
- package/src/store/store.ts +118 -52
- package/src/store/workflow.ts +173 -67
- package/src/user.ts +0 -2
- package/src/utils/schemas.ts +18 -1
- package/lib/cjs/Progress.js +0 -61
- package/lib/cjs/Progress.js.map +0 -1
- package/lib/cjs/access-control.js +0 -39
- package/lib/cjs/access-control.js.map +0 -1
- package/lib/cjs/analytics.js +0 -3
- package/lib/cjs/analytics.js.map +0 -1
- package/lib/cjs/apikey.js +0 -15
- package/lib/cjs/apikey.js.map +0 -1
- package/lib/cjs/common.js +0 -3
- package/lib/cjs/common.js.map +0 -1
- package/lib/cjs/environment.js +0 -116
- package/lib/cjs/environment.js.map +0 -1
- package/lib/cjs/facets.js +0 -3
- package/lib/cjs/facets.js.map +0 -1
- package/lib/cjs/index.js +0 -40
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/integrations.js +0 -11
- package/lib/cjs/integrations.js.map +0 -1
- package/lib/cjs/interaction.js +0 -63
- package/lib/cjs/interaction.js.map +0 -1
- package/lib/cjs/meters.js +0 -13
- package/lib/cjs/meters.js.map +0 -1
- package/lib/cjs/package.json +0 -3
- package/lib/cjs/payload.js +0 -3
- package/lib/cjs/payload.js.map +0 -1
- package/lib/cjs/project.js +0 -50
- package/lib/cjs/project.js.map +0 -1
- package/lib/cjs/prompt.js +0 -21
- package/lib/cjs/prompt.js.map +0 -1
- package/lib/cjs/query.js +0 -3
- package/lib/cjs/query.js.map +0 -1
- package/lib/cjs/refs.js +0 -12
- package/lib/cjs/refs.js.map +0 -1
- package/lib/cjs/runs.js +0 -3
- package/lib/cjs/runs.js.map +0 -1
- package/lib/cjs/store/activity-catalog.js +0 -3
- package/lib/cjs/store/activity-catalog.js.map +0 -1
- package/lib/cjs/store/agent.js +0 -3
- package/lib/cjs/store/agent.js.map +0 -1
- package/lib/cjs/store/collections.js +0 -9
- package/lib/cjs/store/collections.js.map +0 -1
- package/lib/cjs/store/common.js +0 -3
- package/lib/cjs/store/common.js.map +0 -1
- package/lib/cjs/store/doc-analyzer.js +0 -3
- package/lib/cjs/store/doc-analyzer.js.map +0 -1
- package/lib/cjs/store/dsl-workflow.js +0 -5
- package/lib/cjs/store/dsl-workflow.js.map +0 -1
- package/lib/cjs/store/index.js +0 -27
- package/lib/cjs/store/index.js.map +0 -1
- package/lib/cjs/store/object-types.js +0 -98
- package/lib/cjs/store/object-types.js.map +0 -1
- package/lib/cjs/store/store.js +0 -18
- package/lib/cjs/store/store.js.map +0 -1
- package/lib/cjs/store/temporalio.js +0 -44
- package/lib/cjs/store/temporalio.js.map +0 -1
- package/lib/cjs/store/workflow.js +0 -24
- package/lib/cjs/store/workflow.js.map +0 -1
- package/lib/cjs/training.js +0 -14
- package/lib/cjs/training.js.map +0 -1
- package/lib/cjs/transient-tokens.js +0 -9
- package/lib/cjs/transient-tokens.js.map +0 -1
- package/lib/cjs/user.js +0 -17
- package/lib/cjs/user.js.map +0 -1
- package/lib/cjs/utils/advanced-content-processing.js +0 -25
- package/lib/cjs/utils/advanced-content-processing.js.map +0 -1
- package/lib/cjs/utils/auth.js +0 -15
- package/lib/cjs/utils/auth.js.map +0 -1
- package/lib/cjs/utils/schemas.js +0 -48
- package/lib/cjs/utils/schemas.js.map +0 -1
- package/lib/esm/Progress.js +0 -57
- package/lib/esm/Progress.js.map +0 -1
- package/lib/esm/access-control.js +0 -36
- package/lib/esm/access-control.js.map +0 -1
- package/lib/esm/analytics.js +0 -2
- package/lib/esm/analytics.js.map +0 -1
- package/lib/esm/apikey.js +0 -12
- package/lib/esm/apikey.js.map +0 -1
- package/lib/esm/common.js +0 -2
- package/lib/esm/common.js.map +0 -1
- package/lib/esm/environment.js +0 -113
- package/lib/esm/environment.js.map +0 -1
- package/lib/esm/facets.js +0 -2
- package/lib/esm/facets.js.map +0 -1
- package/lib/esm/index.js +0 -24
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/integrations.js +0 -8
- package/lib/esm/integrations.js.map +0 -1
- package/lib/esm/interaction.js +0 -60
- package/lib/esm/interaction.js.map +0 -1
- package/lib/esm/meters.js +0 -10
- package/lib/esm/meters.js.map +0 -1
- package/lib/esm/payload.js +0 -2
- package/lib/esm/payload.js.map +0 -1
- package/lib/esm/project.js +0 -46
- package/lib/esm/project.js.map +0 -1
- package/lib/esm/prompt.js +0 -18
- package/lib/esm/prompt.js.map +0 -1
- package/lib/esm/query.js +0 -2
- package/lib/esm/query.js.map +0 -1
- package/lib/esm/refs.js +0 -9
- package/lib/esm/refs.js.map +0 -1
- package/lib/esm/runs.js +0 -2
- package/lib/esm/runs.js.map +0 -1
- package/lib/esm/store/activity-catalog.js +0 -2
- package/lib/esm/store/activity-catalog.js.map +0 -1
- package/lib/esm/store/agent.js +0 -2
- package/lib/esm/store/agent.js.map +0 -1
- package/lib/esm/store/collections.js +0 -6
- package/lib/esm/store/collections.js.map +0 -1
- package/lib/esm/store/common.js +0 -2
- package/lib/esm/store/common.js.map +0 -1
- package/lib/esm/store/doc-analyzer.js +0 -2
- package/lib/esm/store/doc-analyzer.js.map +0 -1
- package/lib/esm/store/dsl-workflow.js +0 -2
- package/lib/esm/store/dsl-workflow.js.map +0 -1
- package/lib/esm/store/index.js +0 -11
- package/lib/esm/store/index.js.map +0 -1
- package/lib/esm/store/object-types.js +0 -95
- package/lib/esm/store/object-types.js.map +0 -1
- package/lib/esm/store/store.js +0 -15
- package/lib/esm/store/store.js.map +0 -1
- package/lib/esm/store/temporalio.js +0 -41
- package/lib/esm/store/temporalio.js.map +0 -1
- package/lib/esm/store/workflow.js +0 -21
- package/lib/esm/store/workflow.js.map +0 -1
- package/lib/esm/training.js +0 -11
- package/lib/esm/training.js.map +0 -1
- package/lib/esm/transient-tokens.js +0 -6
- package/lib/esm/transient-tokens.js.map +0 -1
- package/lib/esm/user.js +0 -14
- package/lib/esm/user.js.map +0 -1
- package/lib/esm/utils/advanced-content-processing.js +0 -19
- package/lib/esm/utils/advanced-content-processing.js.map +0 -1
- package/lib/esm/utils/auth.js +0 -11
- package/lib/esm/utils/auth.js.map +0 -1
- package/lib/esm/utils/schemas.js +0 -44
- package/lib/esm/utils/schemas.js.map +0 -1
- package/lib/tsconfig.tsbuildinfo +0 -1
- package/lib/types/Progress.d.ts +0 -22
- package/lib/types/Progress.d.ts.map +0 -1
- package/lib/types/access-control.d.ts +0 -57
- package/lib/types/access-control.d.ts.map +0 -1
- package/lib/types/analytics.d.ts +0 -37
- package/lib/types/analytics.d.ts.map +0 -1
- package/lib/types/apikey.d.ts +0 -55
- package/lib/types/apikey.d.ts.map +0 -1
- package/lib/types/common.d.ts +0 -29
- package/lib/types/common.d.ts.map +0 -1
- package/lib/types/environment.d.ts +0 -81
- package/lib/types/environment.d.ts.map +0 -1
- package/lib/types/facets.d.ts +0 -35
- package/lib/types/facets.d.ts.map +0 -1
- package/lib/types/index.d.ts +0 -24
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/integrations.d.ts +0 -24
- package/lib/types/integrations.d.ts.map +0 -1
- package/lib/types/interaction.d.ts +0 -230
- package/lib/types/interaction.d.ts.map +0 -1
- package/lib/types/meters.d.ts +0 -17
- package/lib/types/meters.d.ts.map +0 -1
- package/lib/types/payload.d.ts +0 -50
- package/lib/types/payload.d.ts.map +0 -1
- package/lib/types/project.d.ts +0 -96
- package/lib/types/project.d.ts.map +0 -1
- package/lib/types/prompt.d.ts +0 -71
- package/lib/types/prompt.d.ts.map +0 -1
- package/lib/types/query.d.ts +0 -77
- package/lib/types/query.d.ts.map +0 -1
- package/lib/types/refs.d.ts +0 -20
- package/lib/types/refs.d.ts.map +0 -1
- package/lib/types/runs.d.ts +0 -25
- package/lib/types/runs.d.ts.map +0 -1
- package/lib/types/store/activity-catalog.d.ts +0 -27
- package/lib/types/store/activity-catalog.d.ts.map +0 -1
- package/lib/types/store/agent.d.ts +0 -19
- package/lib/types/store/agent.d.ts.map +0 -1
- package/lib/types/store/collections.d.ts +0 -55
- package/lib/types/store/collections.d.ts.map +0 -1
- package/lib/types/store/common.d.ts +0 -11
- package/lib/types/store/common.d.ts.map +0 -1
- package/lib/types/store/doc-analyzer.d.ts +0 -84
- package/lib/types/store/doc-analyzer.d.ts.map +0 -1
- package/lib/types/store/dsl-workflow.d.ts +0 -239
- package/lib/types/store/dsl-workflow.d.ts.map +0 -1
- package/lib/types/store/index.d.ts +0 -11
- package/lib/types/store/index.d.ts.map +0 -1
- package/lib/types/store/object-types.d.ts +0 -24
- package/lib/types/store/object-types.d.ts.map +0 -1
- package/lib/types/store/store.d.ts +0 -211
- package/lib/types/store/store.d.ts.map +0 -1
- package/lib/types/store/temporalio.d.ts +0 -17
- package/lib/types/store/temporalio.d.ts.map +0 -1
- package/lib/types/store/workflow.d.ts +0 -147
- package/lib/types/store/workflow.d.ts.map +0 -1
- package/lib/types/training.d.ts +0 -39
- package/lib/types/training.d.ts.map +0 -1
- package/lib/types/transient-tokens.d.ts +0 -28
- package/lib/types/transient-tokens.d.ts.map +0 -1
- package/lib/types/user.d.ts +0 -116
- package/lib/types/user.d.ts.map +0 -1
- package/lib/types/utils/advanced-content-processing.d.ts +0 -16
- package/lib/types/utils/advanced-content-processing.d.ts.map +0 -1
- package/lib/types/utils/auth.d.ts +0 -4
- package/lib/types/utils/auth.d.ts.map +0 -1
- package/lib/types/utils/schemas.d.ts +0 -6
- package/lib/types/utils/schemas.d.ts.map +0 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
export type TsPropType = "string" | "number" | "boolean" | "record" | "object" | "array" | "enum" | "literal" | "union" | "promise" | "any";
|
1
|
+
export type TsPropType = "string" | "number" | "boolean" | "record" | "object" | "array" | "enum" | "literal" | "union" | "promise" | "any" | "void";
|
2
2
|
|
3
3
|
// generic types are replaced by "any"
|
4
4
|
export interface ActivityTypeDefinition {
|
@@ -12,7 +12,7 @@ export interface ActivityTypeDefinition {
|
|
12
12
|
value: string | boolean | number | null;
|
13
13
|
// in case of objects
|
14
14
|
members?: ActivityPropertyDefinition[];
|
15
|
-
// in case of arrays or promises will be
|
15
|
+
// in case of arrays or promises will be innerType (i.e. the element type for arrays)
|
16
16
|
innerType?: ActivityTypeDefinition;
|
17
17
|
// in case of enums the enum values will be here
|
18
18
|
enum?: string[] | number[] | undefined;
|
package/src/store/agent.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
export interface CreateAgentDeploymentRequest {
|
2
2
|
/**
|
3
|
-
* The agent ID is composed from the agent organization and the
|
3
|
+
* The agent ID is composed from the agent organization and the agent name, separated by a slash.
|
4
4
|
* Example: vertesia/docgen-agent
|
5
5
|
*/
|
6
6
|
agentId: string;
|
package/src/store/collections.ts
CHANGED
@@ -2,8 +2,8 @@ import { BaseObject } from "./common.js";
|
|
2
2
|
import { ColumnLayout, ContentObjectTypeRef } from "./store.js";
|
3
3
|
|
4
4
|
export enum CollectionStatus {
|
5
|
-
active =
|
6
|
-
archived =
|
5
|
+
active = "active",
|
6
|
+
archived = "archived",
|
7
7
|
}
|
8
8
|
|
9
9
|
export interface CreateCollectionPayload {
|
@@ -16,13 +16,14 @@ export interface CreateCollectionPayload {
|
|
16
16
|
properties?: Record<string, any>;
|
17
17
|
parent?: string | null;
|
18
18
|
table_layout?: ColumnLayout[] | null;
|
19
|
+
allowed_types?: string[];
|
19
20
|
}
|
20
21
|
|
21
22
|
export interface CollectionItem extends BaseObject {
|
22
23
|
/**
|
23
24
|
* A flag to indicate if the collection is dynamic or static.
|
24
25
|
* If the collection is dynamic, the members are determined by a query using the query field.
|
25
|
-
*
|
26
|
+
* If the collection is static, the members are explicitly defined using the members array.
|
26
27
|
*/
|
27
28
|
dynamic: boolean;
|
28
29
|
status: CollectionStatus;
|
@@ -37,6 +38,11 @@ export interface CollectionItem extends BaseObject {
|
|
37
38
|
* The layout defined in the type could serve as a fallback if not defined here.
|
38
39
|
*/
|
39
40
|
table_layout?: ColumnLayout[];
|
41
|
+
|
42
|
+
/**
|
43
|
+
* The allowed types for the collection.
|
44
|
+
*/
|
45
|
+
allowed_types?: string[];
|
40
46
|
}
|
41
47
|
|
42
48
|
export interface Collection extends CollectionItem {
|
package/src/store/common.ts
CHANGED
@@ -1,10 +1,30 @@
|
|
1
|
+
/**
|
2
|
+
* Base interface for all domain objects in the system.
|
3
|
+
* Provides common properties shared across all business entities.
|
4
|
+
*/
|
1
5
|
export interface BaseObject {
|
6
|
+
/** Unique identifier for the object */
|
2
7
|
id: string;
|
8
|
+
|
9
|
+
/** Human-readable name or title */
|
3
10
|
name: string;
|
11
|
+
|
12
|
+
/** Optional detailed description of the object */
|
4
13
|
description?: string;
|
14
|
+
|
15
|
+
/** Optional array of categorization tags */
|
5
16
|
tags?: string[];
|
17
|
+
|
18
|
+
/** Identifier of the user who last modified the object */
|
6
19
|
updated_by: string;
|
20
|
+
|
21
|
+
/** Identifier of the user who created the object */
|
7
22
|
created_by: string;
|
23
|
+
|
24
|
+
/** ISO timestamp of when the object was created */
|
8
25
|
created_at: string;
|
26
|
+
|
27
|
+
/** ISO timestamp of when the object was last updated */
|
9
28
|
updated_at: string;
|
10
|
-
|
29
|
+
|
30
|
+
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { WorkflowExecutionPayload,
|
1
|
+
import { WorkflowExecutionPayload, WorkflowRunStatus } from "./workflow.js";
|
2
2
|
|
3
3
|
export interface PdfToRichtextOptions {
|
4
4
|
features: string[];
|
@@ -6,9 +6,8 @@ export interface PdfToRichtextOptions {
|
|
6
6
|
[key: string]: any;
|
7
7
|
}
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
vars: PdfToRichtextOptions
|
9
|
+
export interface PdfToRichTextWorkflowPayload extends Omit<WorkflowExecutionPayload, "vars"> {
|
10
|
+
vars: PdfToRichtextOptions;
|
12
11
|
}
|
13
12
|
|
14
13
|
/**
|
@@ -17,16 +16,17 @@ export interface PdfToRichTextWorkflowParams extends Omit<WorkflowExecutionPaylo
|
|
17
16
|
export interface DocImage {
|
18
17
|
id?: string;
|
19
18
|
page_number?: number;
|
20
|
-
image_number?: number;
|
21
|
-
title?: string;
|
22
|
-
url?: string;
|
23
19
|
description?: string;
|
24
20
|
is_meaningful?: boolean;
|
25
21
|
width?: number;
|
26
22
|
height?: number;
|
27
|
-
path?: string;
|
28
23
|
}
|
29
24
|
|
25
|
+
/**
|
26
|
+
* The export type formats for tables.
|
27
|
+
*/
|
28
|
+
export type ExportTableFormats = 'json' | 'csv' | 'xml';
|
29
|
+
|
30
30
|
/**
|
31
31
|
* Represents a table in a document that has been analyzed
|
32
32
|
*/
|
@@ -58,28 +58,22 @@ export interface DocTableJson extends DocTable {
|
|
58
58
|
/**
|
59
59
|
* Represents a document analysis run status
|
60
60
|
*/
|
61
|
-
export interface DocAnalyzeRunStatusResponse {
|
62
|
-
workflow_id: string | null;
|
63
|
-
run_id: string | null;
|
64
|
-
status: WorkflowExecutionStatus;
|
61
|
+
export interface DocAnalyzeRunStatusResponse extends WorkflowRunStatus {
|
65
62
|
progress?: DocAnalyzerProgress;
|
66
63
|
}
|
67
64
|
|
68
|
-
|
69
65
|
export interface DocAnalyzerResultResponse {
|
70
66
|
document?: string;
|
71
67
|
tables?: DocTableCsv[] | DocTableJson[];
|
72
68
|
images?: DocImage[];
|
73
|
-
parts?: { id: string, title: string }[];
|
74
69
|
annotated?: string | null;
|
75
70
|
}
|
76
71
|
|
77
|
-
|
78
72
|
export interface DocAnalyzerProgress {
|
79
|
-
pages: DocAnalyzerProgressStatus
|
80
|
-
images: DocAnalyzerProgressStatus
|
81
|
-
tables: DocAnalyzerProgressStatus
|
82
|
-
visuals: DocAnalyzerProgressStatus
|
73
|
+
pages: DocAnalyzerProgressStatus;
|
74
|
+
images: DocAnalyzerProgressStatus;
|
75
|
+
tables: DocAnalyzerProgressStatus;
|
76
|
+
visuals: DocAnalyzerProgressStatus;
|
83
77
|
started_at?: number;
|
84
78
|
percent: number;
|
85
79
|
}
|
@@ -89,4 +83,70 @@ interface DocAnalyzerProgressStatus {
|
|
89
83
|
processed: number;
|
90
84
|
success: number;
|
91
85
|
failed: number;
|
92
|
-
}
|
86
|
+
}
|
87
|
+
|
88
|
+
/**
|
89
|
+
* Adapt Tables Parameters, part of the request
|
90
|
+
*/
|
91
|
+
export interface AdaptTablesParams {
|
92
|
+
/**
|
93
|
+
* JSON Schema to to convert the table into
|
94
|
+
*/
|
95
|
+
target_schema: string;
|
96
|
+
|
97
|
+
/**
|
98
|
+
* Natural language description of the type item the table are composed of
|
99
|
+
*/
|
100
|
+
item_name: string;
|
101
|
+
|
102
|
+
/**
|
103
|
+
* Natural language description of the type of table or item to convert
|
104
|
+
*/
|
105
|
+
instructions?: string;
|
106
|
+
|
107
|
+
/**
|
108
|
+
* Format to return the data in (csv, json)
|
109
|
+
*/
|
110
|
+
format?: "csv" | "json";
|
111
|
+
|
112
|
+
/**
|
113
|
+
* Process the table as a whole or by page
|
114
|
+
*/
|
115
|
+
process_as?: "page" | "table";
|
116
|
+
|
117
|
+
/**
|
118
|
+
* Process the table as a CSV file
|
119
|
+
*/
|
120
|
+
process_as_csv?: boolean;
|
121
|
+
}
|
122
|
+
|
123
|
+
interface DocAnalyzerRequestBase {
|
124
|
+
synchronous?: boolean;
|
125
|
+
|
126
|
+
notify_endpoints?: string[];
|
127
|
+
|
128
|
+
/**
|
129
|
+
* What environment to use to run the request
|
130
|
+
* If none specified the project embedded environment will be used
|
131
|
+
*/
|
132
|
+
environment?: string;
|
133
|
+
}
|
134
|
+
|
135
|
+
export interface AdaptTablesRequest extends DocAnalyzerRequestBase, AdaptTablesParams {}
|
136
|
+
|
137
|
+
/**
|
138
|
+
* Get Adapted Tables Request
|
139
|
+
* @param raw If true, the raw data will be returned
|
140
|
+
* @param format The format to return the data in (csv, json)
|
141
|
+
*/
|
142
|
+
export interface GetAdaptedTablesRequestQuery {
|
143
|
+
raw?: boolean;
|
144
|
+
format: "csv" | "json";
|
145
|
+
}
|
146
|
+
/**
|
147
|
+
* The adapted table result format
|
148
|
+
*/
|
149
|
+
export interface AdaptedTable {
|
150
|
+
comment?: string;
|
151
|
+
data: Record<string, any>[];
|
152
|
+
}
|
@@ -16,7 +16,7 @@ export interface DSLWorkflowExecutionPayload extends WorkflowExecutionPayload {
|
|
16
16
|
}
|
17
17
|
|
18
18
|
/**
|
19
|
-
* The payload for a DSL
|
19
|
+
* The payload for a DSL activity options.
|
20
20
|
*
|
21
21
|
* @see ActivityOptions in @temporalio/common
|
22
22
|
*/
|
@@ -58,7 +58,7 @@ export interface ActivityFetchSpec {
|
|
58
58
|
*/
|
59
59
|
type: "document" | "document_type" | "interaction_run";
|
60
60
|
/**
|
61
|
-
* An
|
61
|
+
* An optional URI to the data source.
|
62
62
|
*/
|
63
63
|
source?: string;
|
64
64
|
/**
|
@@ -72,13 +72,13 @@ export interface ActivityFetchSpec {
|
|
72
72
|
select?: string;
|
73
73
|
|
74
74
|
/**
|
75
|
-
* The number of results to return. If the result is
|
75
|
+
* The number of results to return. If the result is limited to 1 the result will be a single object
|
76
76
|
*/
|
77
77
|
limit?: number;
|
78
78
|
|
79
79
|
/**
|
80
80
|
* How to handle not found objects.
|
81
|
-
* 1. ignore - Ignore and return an empty array for multi objects query (or undefined for single object query) or empty array for multiple
|
81
|
+
* 1. ignore - Ignore and return an empty array for multi objects query (or undefined for single object query) or empty array for multiple objects throw an error.
|
82
82
|
* 2. throw - Throw an error if the object or no objects are found.
|
83
83
|
*/
|
84
84
|
on_not_found?: "ignore" | "throw";
|
@@ -107,7 +107,7 @@ export interface DSLActivitySpec<PARAMS extends Record<string, any> = Record<str
|
|
107
107
|
description?: string;
|
108
108
|
/**
|
109
109
|
* Activities parameters. These parameters can be either literals
|
110
|
-
* (hardcoded strings, numbers, booleans,
|
110
|
+
* (hardcoded strings, numbers, booleans, objects, arrays etc.), either
|
111
111
|
* references to the workflow variables.
|
112
112
|
* The workflow variables are built from the workflow params (e.g. the workflow configuration)
|
113
113
|
* and from the result of the previous activities.
|
@@ -116,14 +116,14 @@ export interface DSLActivitySpec<PARAMS extends Record<string, any> = Record<str
|
|
116
116
|
/**
|
117
117
|
* The name of the workflow variable that will store the result of the activity
|
118
118
|
* If not specified the result will not be stored
|
119
|
-
* The parameters describe how the actual parameters will be obtained from the
|
119
|
+
* The parameters describe how the actual parameters will be obtained from the workflow execution vars.
|
120
120
|
* since it may contain references to workflow execution vars.
|
121
121
|
*/
|
122
122
|
output?: string;
|
123
123
|
|
124
124
|
/**
|
125
125
|
* A JSON expression which evaluate to true or false similar to mongo matches.
|
126
|
-
* We support
|
126
|
+
* We support for now basic expression like: $true, $false, $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $regexp
|
127
127
|
* {$eq: {name: value}},
|
128
128
|
* Ex: {$eq: {wfVarName: value}}
|
129
129
|
*/
|
@@ -186,7 +186,7 @@ export interface DSLChildWorkflowStep extends DSLWorkflowStepBase {
|
|
186
186
|
/**
|
187
187
|
* The name of the workflow variable that will store the result of the child workflow (if async the workflow id is stored)
|
188
188
|
* If not specified the result will not be stored
|
189
|
-
* The parameters describe how the actual parameters will be obtained from the
|
189
|
+
* The parameters describe how the actual parameters will be obtained from the workflow execution vars.
|
190
190
|
* since it may contain references to workflow execution vars.
|
191
191
|
*/
|
192
192
|
output?: string;
|
@@ -257,7 +257,7 @@ export interface DSLWorkflowSpecWithActivities extends DSLWorkflowSpecBase {
|
|
257
257
|
}
|
258
258
|
|
259
259
|
/**
|
260
|
-
* activities and steps fields are
|
260
|
+
* activities and steps fields are mutually exclusive
|
261
261
|
* steps was added after activities and may contain a mix of activities and other tasks like exec child workflows.
|
262
262
|
* For backward compatibility we keep the activities field as a fallback but one should use one or the other not both.
|
263
263
|
*/
|
package/src/store/index.ts
CHANGED
package/src/store/store.ts
CHANGED
@@ -1,18 +1,17 @@
|
|
1
|
-
import { SearchPayload } from
|
2
|
-
import { SupportedEmbeddingTypes } from
|
3
|
-
import { ComplexSearchQuery } from
|
4
|
-
import { BaseObject } from
|
5
|
-
import { RenditionProperties } from
|
1
|
+
import { SearchPayload } from "../payload.js";
|
2
|
+
import { SupportedEmbeddingTypes } from "../project.js";
|
3
|
+
import { ComplexSearchQuery } from "../query.js";
|
4
|
+
import { BaseObject } from "./common.js";
|
5
|
+
import { RenditionProperties } from "./index.js";
|
6
6
|
|
7
7
|
export enum ContentObjectStatus {
|
8
|
-
created =
|
9
|
-
processing =
|
10
|
-
completed =
|
11
|
-
failed =
|
12
|
-
archived =
|
8
|
+
created = "created",
|
9
|
+
processing = "processing", // the was created and still processing
|
10
|
+
completed = "completed",
|
11
|
+
failed = "failed",
|
12
|
+
archived = "archived",
|
13
13
|
}
|
14
14
|
|
15
|
-
|
16
15
|
export interface Embedding {
|
17
16
|
model: string; //the model used to generate this embedding
|
18
17
|
values: number[];
|
@@ -28,8 +27,7 @@ export interface ContentObject<T = any> extends ContentObjectItem<T> {
|
|
28
27
|
transcript?: Transcript;
|
29
28
|
}
|
30
29
|
|
31
|
-
|
32
|
-
export type ContentNature = 'video' | 'image' | 'audio' | 'document' | 'code' | 'other';
|
30
|
+
export type ContentNature = "video" | "image" | "audio" | "document" | "code" | "other";
|
33
31
|
|
34
32
|
export interface Dimensions {
|
35
33
|
width: number;
|
@@ -48,12 +46,10 @@ export interface GenerationRunMetadata {
|
|
48
46
|
target?: string;
|
49
47
|
}
|
50
48
|
|
51
|
-
|
52
|
-
|
53
49
|
export interface ContentMetadata {
|
54
50
|
// Common fields for all media types
|
55
51
|
type?: ContentNature;
|
56
|
-
size?: number;
|
52
|
+
size?: number; // in bytes
|
57
53
|
languages?: string[];
|
58
54
|
location?: Location;
|
59
55
|
generation_runs: GenerationRunMetadata[];
|
@@ -63,25 +59,25 @@ export interface ContentMetadata {
|
|
63
59
|
// Example of type-specific metadata interfaces (optional, for better type safety)
|
64
60
|
export interface TemporalMediaMetadata extends ContentMetadata {
|
65
61
|
duration?: number; // in seconds
|
66
|
-
transcript?: Transcript
|
62
|
+
transcript?: Transcript;
|
67
63
|
}
|
68
64
|
|
69
65
|
export interface ImageMetadata extends ContentMetadata {
|
70
|
-
type:
|
66
|
+
type: "image";
|
71
67
|
dimensions?: Dimensions;
|
72
68
|
}
|
73
69
|
|
74
70
|
export interface AudioMetadata extends TemporalMediaMetadata {
|
75
|
-
type:
|
71
|
+
type: "audio";
|
76
72
|
}
|
77
73
|
|
78
74
|
export interface VideoMetadata extends TemporalMediaMetadata {
|
79
|
-
type:
|
75
|
+
type: "video";
|
80
76
|
dimensions?: Dimensions;
|
81
77
|
}
|
82
78
|
|
83
79
|
export interface DocumentMetadata extends ContentMetadata {
|
84
|
-
type:
|
80
|
+
type: "document";
|
85
81
|
page_count?: number;
|
86
82
|
content_processor?: {
|
87
83
|
type?: string;
|
@@ -91,7 +87,7 @@ export interface DocumentMetadata extends ContentMetadata {
|
|
91
87
|
image_count: number;
|
92
88
|
zone_count: number;
|
93
89
|
needs_ocr_count?: number;
|
94
|
-
}
|
90
|
+
};
|
95
91
|
}
|
96
92
|
|
97
93
|
export interface Transcript {
|
@@ -101,12 +97,12 @@ export interface Transcript {
|
|
101
97
|
}
|
102
98
|
|
103
99
|
export interface TranscriptSegment {
|
104
|
-
start: number
|
105
|
-
text: string
|
106
|
-
speaker?: number
|
107
|
-
end?: number
|
108
|
-
|
109
|
-
|
100
|
+
start: number;
|
101
|
+
text: string;
|
102
|
+
speaker?: number;
|
103
|
+
end?: number;
|
104
|
+
confidence?: number;
|
105
|
+
language?: string;
|
110
106
|
}
|
111
107
|
|
112
108
|
export interface ContentSource {
|
@@ -120,34 +116,99 @@ export interface ContentSource {
|
|
120
116
|
etag?: string;
|
121
117
|
}
|
122
118
|
|
119
|
+
/**
|
120
|
+
*
|
121
|
+
*/
|
122
|
+
export interface RevisionInfo {
|
123
|
+
/** Direct parent revision id (omit on the first revision) */
|
124
|
+
parent?: string;
|
125
|
+
|
126
|
+
/** The root revision id (omit on the first revision) */
|
127
|
+
root: string;
|
128
|
+
|
129
|
+
/** True if this revision is the head revision */
|
130
|
+
head: boolean;
|
131
|
+
|
132
|
+
/** Human‑friendly tag or state ("v1.2", "approved") */
|
133
|
+
label?: string;
|
134
|
+
|
135
|
+
/** Extra parents when two branches are merged (leave undefined until needed) */
|
136
|
+
//merge_parents?: string[]; //maybe later
|
137
|
+
|
138
|
+
/** Pointer to a diff / patch blob if you store deltas instead of full content */
|
139
|
+
//delta_ref?: string;
|
140
|
+
}
|
141
|
+
|
123
142
|
/**
|
124
143
|
* The content object item is a simplified version of the ContentObject that is returned by the store API when listing objects.
|
125
144
|
*/
|
126
|
-
export interface ContentObjectItem<T = any
|
127
|
-
root?: string; // the ID of the root parent object. The root object doesn't have the root field set.
|
145
|
+
export interface ContentObjectItem<T = Record<string, any>> extends BaseObject {
|
128
146
|
parent: string; // the id of the direct parent object. The root object doesn't have the parent field set.
|
147
|
+
|
148
|
+
/** An optional path based location for the object */
|
129
149
|
location: string; // the path of the parent object
|
150
|
+
|
151
|
+
/**
|
152
|
+
* Object status.
|
153
|
+
* - created: the object was created and is being processed
|
154
|
+
* - processing: the object is being processed
|
155
|
+
* - completed: the object was processed and is ready to use
|
156
|
+
* - failed: the object processing failed
|
157
|
+
* - archived: the object was archived and is no longer available
|
158
|
+
*/
|
130
159
|
status: ContentObjectStatus;
|
131
|
-
|
160
|
+
|
161
|
+
/**
|
162
|
+
* Object type id.
|
163
|
+
*/
|
132
164
|
type?: ContentObjectTypeRef;
|
133
|
-
|
165
|
+
|
166
|
+
/**
|
167
|
+
* Content source information, typically a link to an object store
|
168
|
+
*/
|
134
169
|
content: ContentSource;
|
170
|
+
|
171
|
+
/**
|
172
|
+
* External identifier for integration with other systems
|
173
|
+
*/
|
135
174
|
external_id?: string;
|
136
|
-
|
175
|
+
|
176
|
+
/** The object properties. This is a JSON object that describes the object, matching the object type schema */
|
177
|
+
properties: T; // a JSON object that describes the object
|
178
|
+
|
179
|
+
/** Technical metadata of the object */
|
137
180
|
metadata?: VideoMetadata | AudioMetadata | ImageMetadata | DocumentMetadata | ContentMetadata;
|
181
|
+
|
182
|
+
/** Token information */
|
138
183
|
tokens?: {
|
139
184
|
count: number; // the number of tokens in the text
|
140
185
|
encoding: string; // the encoding used to calculate the tokens
|
141
186
|
etag: string; //the etag of the text used for the token count
|
142
187
|
};
|
188
|
+
|
189
|
+
/**
|
190
|
+
* Revision information. This is used to track the history of the object.
|
191
|
+
*/
|
192
|
+
revision: RevisionInfo; // the revision info of the object
|
193
|
+
|
194
|
+
/**
|
195
|
+
* Soft delete flag. When true, the object should be considered deleted
|
196
|
+
* but is still retained in the database for historical purposes.
|
197
|
+
*/
|
198
|
+
is_deleted?: boolean;
|
199
|
+
|
200
|
+
/**
|
201
|
+
* Soft lock flag. When true, the object should be considered read-only
|
202
|
+
* and modification attempts should be rejected.
|
203
|
+
*/
|
204
|
+
is_locked?: boolean;
|
143
205
|
}
|
144
206
|
|
145
207
|
/**
|
146
|
-
* When creating from an uploaded file the content
|
208
|
+
* When creating from an uploaded file the content should be an URL to the uploaded file
|
147
209
|
*/
|
148
|
-
export interface CreateContentObjectPayload<T = any>
|
149
|
-
|
150
|
-
| 'owner'>> {
|
210
|
+
export interface CreateContentObjectPayload<T = any>
|
211
|
+
extends Partial<Omit<ContentObject<T>, "id" | "root" | "created_at" | "updated_at" | "type" | "owner">> {
|
151
212
|
id?: string; // An optional existing object ID to be replaced by the new one
|
152
213
|
type?: string; // the object type ID
|
153
214
|
generation_run_info?: GenerationRunMetadata;
|
@@ -158,7 +219,7 @@ export interface ContentObjectTypeRef {
|
|
158
219
|
name: string;
|
159
220
|
}
|
160
221
|
|
161
|
-
export interface ComplexSearchPayload extends Omit<SearchPayload,
|
222
|
+
export interface ComplexSearchPayload extends Omit<SearchPayload, "query"> {
|
162
223
|
query?: ComplexSearchQuery;
|
163
224
|
}
|
164
225
|
|
@@ -185,21 +246,28 @@ export interface ColumnLayout {
|
|
185
246
|
*/
|
186
247
|
default?: any;
|
187
248
|
}
|
188
|
-
export interface ContentObjectType extends ContentObjectTypeItem {
|
189
|
-
object_schema?: Record<string, any>; // an optional JSON schema for the object properties.
|
190
|
-
}
|
249
|
+
export interface ContentObjectType extends ContentObjectTypeItem {}
|
191
250
|
export interface ContentObjectTypeItem extends BaseObject {
|
192
251
|
is_chunkable?: boolean;
|
252
|
+
/**
|
253
|
+
* This is only included in ContentObjectTypeItem if explicitly requested
|
254
|
+
* It is always included in ContentObjectType
|
255
|
+
*/
|
193
256
|
table_layout?: ColumnLayout[];
|
257
|
+
/**
|
258
|
+
* this is only included in ContentObjectTypeItem if explicitly requested
|
259
|
+
* It is always included in ContentObjectType
|
260
|
+
*/
|
261
|
+
object_schema?: Record<string, any>; // an optional JSON schema for the object properties.
|
194
262
|
}
|
195
263
|
|
196
|
-
export interface CreateContentObjectTypePayload
|
197
|
-
}
|
264
|
+
export interface CreateContentObjectTypePayload
|
265
|
+
extends Omit<ContentObjectType, "id" | "created_at" | "updated_at" | "created_by" | "updated_by"> {}
|
198
266
|
|
199
267
|
export enum WorkflowRuleInputType {
|
200
|
-
single =
|
201
|
-
multiple =
|
202
|
-
none =
|
268
|
+
single = "single",
|
269
|
+
multiple = "multiple",
|
270
|
+
none = "none",
|
203
271
|
}
|
204
272
|
export interface WorkflowRuleItem extends BaseObject {
|
205
273
|
// the name of the workflow function
|
@@ -229,18 +297,16 @@ export interface WorkflowRule extends WorkflowRuleItem {
|
|
229
297
|
customer_override?: boolean;
|
230
298
|
}
|
231
299
|
|
232
|
-
|
233
300
|
export interface CreateWorkflowRulePayload extends UploadWorkflowRulePayload {
|
234
301
|
name: string; // required
|
235
302
|
endpoint: string; // required
|
236
303
|
}
|
237
|
-
export interface UploadWorkflowRulePayload
|
238
|
-
}
|
304
|
+
export interface UploadWorkflowRulePayload
|
305
|
+
extends Partial<Omit<WorkflowRule, "id" | "created_at" | "updated_at" | "owner">> {}
|
239
306
|
|
240
307
|
export interface GetRenditionResponse {
|
241
|
-
|
242
|
-
|
243
|
-
rendition?: ContentObject<RenditionProperties> //TODO add <Rendition>
|
308
|
+
status: "found" | "generating" | "failed";
|
309
|
+
rendition?: ContentObject<RenditionProperties>; //TODO add <Rendition>
|
244
310
|
workflow_run_id?: string;
|
245
311
|
}
|
246
312
|
|