@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.
Files changed (231) hide show
  1. package/package.json +3 -3
  2. package/src/apikey.ts +1 -1
  3. package/src/common.ts +3 -0
  4. package/src/index.ts +1 -1
  5. package/src/integrations.ts +1 -1
  6. package/src/interaction.ts +263 -40
  7. package/src/meters.ts +9 -3
  8. package/src/payload.ts +15 -3
  9. package/src/plugin.ts +12 -0
  10. package/src/project.ts +8 -0
  11. package/src/prompt.ts +1 -1
  12. package/src/query.ts +5 -3
  13. package/src/runs.ts +11 -2
  14. package/src/store/activity-catalog.ts +2 -2
  15. package/src/store/agent.ts +1 -1
  16. package/src/store/collections.ts +9 -3
  17. package/src/store/common.ts +21 -1
  18. package/src/store/doc-analyzer.ts +80 -20
  19. package/src/store/dsl-workflow.ts +9 -9
  20. package/src/store/index.ts +1 -0
  21. package/src/store/signals.ts +5 -0
  22. package/src/store/store.ts +118 -52
  23. package/src/store/workflow.ts +173 -67
  24. package/src/user.ts +0 -2
  25. package/src/utils/schemas.ts +18 -1
  26. package/lib/cjs/Progress.js +0 -61
  27. package/lib/cjs/Progress.js.map +0 -1
  28. package/lib/cjs/access-control.js +0 -39
  29. package/lib/cjs/access-control.js.map +0 -1
  30. package/lib/cjs/analytics.js +0 -3
  31. package/lib/cjs/analytics.js.map +0 -1
  32. package/lib/cjs/apikey.js +0 -15
  33. package/lib/cjs/apikey.js.map +0 -1
  34. package/lib/cjs/common.js +0 -3
  35. package/lib/cjs/common.js.map +0 -1
  36. package/lib/cjs/environment.js +0 -116
  37. package/lib/cjs/environment.js.map +0 -1
  38. package/lib/cjs/facets.js +0 -3
  39. package/lib/cjs/facets.js.map +0 -1
  40. package/lib/cjs/index.js +0 -40
  41. package/lib/cjs/index.js.map +0 -1
  42. package/lib/cjs/integrations.js +0 -11
  43. package/lib/cjs/integrations.js.map +0 -1
  44. package/lib/cjs/interaction.js +0 -63
  45. package/lib/cjs/interaction.js.map +0 -1
  46. package/lib/cjs/meters.js +0 -13
  47. package/lib/cjs/meters.js.map +0 -1
  48. package/lib/cjs/package.json +0 -3
  49. package/lib/cjs/payload.js +0 -3
  50. package/lib/cjs/payload.js.map +0 -1
  51. package/lib/cjs/project.js +0 -50
  52. package/lib/cjs/project.js.map +0 -1
  53. package/lib/cjs/prompt.js +0 -21
  54. package/lib/cjs/prompt.js.map +0 -1
  55. package/lib/cjs/query.js +0 -3
  56. package/lib/cjs/query.js.map +0 -1
  57. package/lib/cjs/refs.js +0 -12
  58. package/lib/cjs/refs.js.map +0 -1
  59. package/lib/cjs/runs.js +0 -3
  60. package/lib/cjs/runs.js.map +0 -1
  61. package/lib/cjs/store/activity-catalog.js +0 -3
  62. package/lib/cjs/store/activity-catalog.js.map +0 -1
  63. package/lib/cjs/store/agent.js +0 -3
  64. package/lib/cjs/store/agent.js.map +0 -1
  65. package/lib/cjs/store/collections.js +0 -9
  66. package/lib/cjs/store/collections.js.map +0 -1
  67. package/lib/cjs/store/common.js +0 -3
  68. package/lib/cjs/store/common.js.map +0 -1
  69. package/lib/cjs/store/doc-analyzer.js +0 -3
  70. package/lib/cjs/store/doc-analyzer.js.map +0 -1
  71. package/lib/cjs/store/dsl-workflow.js +0 -5
  72. package/lib/cjs/store/dsl-workflow.js.map +0 -1
  73. package/lib/cjs/store/index.js +0 -27
  74. package/lib/cjs/store/index.js.map +0 -1
  75. package/lib/cjs/store/object-types.js +0 -98
  76. package/lib/cjs/store/object-types.js.map +0 -1
  77. package/lib/cjs/store/store.js +0 -18
  78. package/lib/cjs/store/store.js.map +0 -1
  79. package/lib/cjs/store/temporalio.js +0 -44
  80. package/lib/cjs/store/temporalio.js.map +0 -1
  81. package/lib/cjs/store/workflow.js +0 -24
  82. package/lib/cjs/store/workflow.js.map +0 -1
  83. package/lib/cjs/training.js +0 -14
  84. package/lib/cjs/training.js.map +0 -1
  85. package/lib/cjs/transient-tokens.js +0 -9
  86. package/lib/cjs/transient-tokens.js.map +0 -1
  87. package/lib/cjs/user.js +0 -17
  88. package/lib/cjs/user.js.map +0 -1
  89. package/lib/cjs/utils/advanced-content-processing.js +0 -25
  90. package/lib/cjs/utils/advanced-content-processing.js.map +0 -1
  91. package/lib/cjs/utils/auth.js +0 -15
  92. package/lib/cjs/utils/auth.js.map +0 -1
  93. package/lib/cjs/utils/schemas.js +0 -48
  94. package/lib/cjs/utils/schemas.js.map +0 -1
  95. package/lib/esm/Progress.js +0 -57
  96. package/lib/esm/Progress.js.map +0 -1
  97. package/lib/esm/access-control.js +0 -36
  98. package/lib/esm/access-control.js.map +0 -1
  99. package/lib/esm/analytics.js +0 -2
  100. package/lib/esm/analytics.js.map +0 -1
  101. package/lib/esm/apikey.js +0 -12
  102. package/lib/esm/apikey.js.map +0 -1
  103. package/lib/esm/common.js +0 -2
  104. package/lib/esm/common.js.map +0 -1
  105. package/lib/esm/environment.js +0 -113
  106. package/lib/esm/environment.js.map +0 -1
  107. package/lib/esm/facets.js +0 -2
  108. package/lib/esm/facets.js.map +0 -1
  109. package/lib/esm/index.js +0 -24
  110. package/lib/esm/index.js.map +0 -1
  111. package/lib/esm/integrations.js +0 -8
  112. package/lib/esm/integrations.js.map +0 -1
  113. package/lib/esm/interaction.js +0 -60
  114. package/lib/esm/interaction.js.map +0 -1
  115. package/lib/esm/meters.js +0 -10
  116. package/lib/esm/meters.js.map +0 -1
  117. package/lib/esm/payload.js +0 -2
  118. package/lib/esm/payload.js.map +0 -1
  119. package/lib/esm/project.js +0 -46
  120. package/lib/esm/project.js.map +0 -1
  121. package/lib/esm/prompt.js +0 -18
  122. package/lib/esm/prompt.js.map +0 -1
  123. package/lib/esm/query.js +0 -2
  124. package/lib/esm/query.js.map +0 -1
  125. package/lib/esm/refs.js +0 -9
  126. package/lib/esm/refs.js.map +0 -1
  127. package/lib/esm/runs.js +0 -2
  128. package/lib/esm/runs.js.map +0 -1
  129. package/lib/esm/store/activity-catalog.js +0 -2
  130. package/lib/esm/store/activity-catalog.js.map +0 -1
  131. package/lib/esm/store/agent.js +0 -2
  132. package/lib/esm/store/agent.js.map +0 -1
  133. package/lib/esm/store/collections.js +0 -6
  134. package/lib/esm/store/collections.js.map +0 -1
  135. package/lib/esm/store/common.js +0 -2
  136. package/lib/esm/store/common.js.map +0 -1
  137. package/lib/esm/store/doc-analyzer.js +0 -2
  138. package/lib/esm/store/doc-analyzer.js.map +0 -1
  139. package/lib/esm/store/dsl-workflow.js +0 -2
  140. package/lib/esm/store/dsl-workflow.js.map +0 -1
  141. package/lib/esm/store/index.js +0 -11
  142. package/lib/esm/store/index.js.map +0 -1
  143. package/lib/esm/store/object-types.js +0 -95
  144. package/lib/esm/store/object-types.js.map +0 -1
  145. package/lib/esm/store/store.js +0 -15
  146. package/lib/esm/store/store.js.map +0 -1
  147. package/lib/esm/store/temporalio.js +0 -41
  148. package/lib/esm/store/temporalio.js.map +0 -1
  149. package/lib/esm/store/workflow.js +0 -21
  150. package/lib/esm/store/workflow.js.map +0 -1
  151. package/lib/esm/training.js +0 -11
  152. package/lib/esm/training.js.map +0 -1
  153. package/lib/esm/transient-tokens.js +0 -6
  154. package/lib/esm/transient-tokens.js.map +0 -1
  155. package/lib/esm/user.js +0 -14
  156. package/lib/esm/user.js.map +0 -1
  157. package/lib/esm/utils/advanced-content-processing.js +0 -19
  158. package/lib/esm/utils/advanced-content-processing.js.map +0 -1
  159. package/lib/esm/utils/auth.js +0 -11
  160. package/lib/esm/utils/auth.js.map +0 -1
  161. package/lib/esm/utils/schemas.js +0 -44
  162. package/lib/esm/utils/schemas.js.map +0 -1
  163. package/lib/tsconfig.tsbuildinfo +0 -1
  164. package/lib/types/Progress.d.ts +0 -22
  165. package/lib/types/Progress.d.ts.map +0 -1
  166. package/lib/types/access-control.d.ts +0 -57
  167. package/lib/types/access-control.d.ts.map +0 -1
  168. package/lib/types/analytics.d.ts +0 -37
  169. package/lib/types/analytics.d.ts.map +0 -1
  170. package/lib/types/apikey.d.ts +0 -55
  171. package/lib/types/apikey.d.ts.map +0 -1
  172. package/lib/types/common.d.ts +0 -29
  173. package/lib/types/common.d.ts.map +0 -1
  174. package/lib/types/environment.d.ts +0 -81
  175. package/lib/types/environment.d.ts.map +0 -1
  176. package/lib/types/facets.d.ts +0 -35
  177. package/lib/types/facets.d.ts.map +0 -1
  178. package/lib/types/index.d.ts +0 -24
  179. package/lib/types/index.d.ts.map +0 -1
  180. package/lib/types/integrations.d.ts +0 -24
  181. package/lib/types/integrations.d.ts.map +0 -1
  182. package/lib/types/interaction.d.ts +0 -230
  183. package/lib/types/interaction.d.ts.map +0 -1
  184. package/lib/types/meters.d.ts +0 -17
  185. package/lib/types/meters.d.ts.map +0 -1
  186. package/lib/types/payload.d.ts +0 -50
  187. package/lib/types/payload.d.ts.map +0 -1
  188. package/lib/types/project.d.ts +0 -96
  189. package/lib/types/project.d.ts.map +0 -1
  190. package/lib/types/prompt.d.ts +0 -71
  191. package/lib/types/prompt.d.ts.map +0 -1
  192. package/lib/types/query.d.ts +0 -77
  193. package/lib/types/query.d.ts.map +0 -1
  194. package/lib/types/refs.d.ts +0 -20
  195. package/lib/types/refs.d.ts.map +0 -1
  196. package/lib/types/runs.d.ts +0 -25
  197. package/lib/types/runs.d.ts.map +0 -1
  198. package/lib/types/store/activity-catalog.d.ts +0 -27
  199. package/lib/types/store/activity-catalog.d.ts.map +0 -1
  200. package/lib/types/store/agent.d.ts +0 -19
  201. package/lib/types/store/agent.d.ts.map +0 -1
  202. package/lib/types/store/collections.d.ts +0 -55
  203. package/lib/types/store/collections.d.ts.map +0 -1
  204. package/lib/types/store/common.d.ts +0 -11
  205. package/lib/types/store/common.d.ts.map +0 -1
  206. package/lib/types/store/doc-analyzer.d.ts +0 -84
  207. package/lib/types/store/doc-analyzer.d.ts.map +0 -1
  208. package/lib/types/store/dsl-workflow.d.ts +0 -239
  209. package/lib/types/store/dsl-workflow.d.ts.map +0 -1
  210. package/lib/types/store/index.d.ts +0 -11
  211. package/lib/types/store/index.d.ts.map +0 -1
  212. package/lib/types/store/object-types.d.ts +0 -24
  213. package/lib/types/store/object-types.d.ts.map +0 -1
  214. package/lib/types/store/store.d.ts +0 -211
  215. package/lib/types/store/store.d.ts.map +0 -1
  216. package/lib/types/store/temporalio.d.ts +0 -17
  217. package/lib/types/store/temporalio.d.ts.map +0 -1
  218. package/lib/types/store/workflow.d.ts +0 -147
  219. package/lib/types/store/workflow.d.ts.map +0 -1
  220. package/lib/types/training.d.ts +0 -39
  221. package/lib/types/training.d.ts.map +0 -1
  222. package/lib/types/transient-tokens.d.ts +0 -28
  223. package/lib/types/transient-tokens.d.ts.map +0 -1
  224. package/lib/types/user.d.ts +0 -116
  225. package/lib/types/user.d.ts.map +0 -1
  226. package/lib/types/utils/advanced-content-processing.d.ts +0 -16
  227. package/lib/types/utils/advanced-content-processing.d.ts.map +0 -1
  228. package/lib/types/utils/auth.d.ts +0 -4
  229. package/lib/types/utils/auth.d.ts.map +0 -1
  230. package/lib/types/utils/schemas.d.ts +0 -6
  231. 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 innertype (i.e. the element type for arrays)
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;
@@ -1,6 +1,6 @@
1
1
  export interface CreateAgentDeploymentRequest {
2
2
  /**
3
- * The agent ID is composed from the agent organization and the agen name, separated by a slash.
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;
@@ -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 = 'active',
6
- archived = '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
- * Id the collection is static, the members are explicitly defined jusing the members array.
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 {
@@ -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, WorkflowExecutionStatus } from "./workflow.js";
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
- export interface PdfToRichTextWorkflowParams extends Omit<WorkflowExecutionPayload, "vars"> {
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 acitivty options.
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 optinal URI to the data source.
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 limitedto 1 the result will be a single object
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 objectthrow an error.
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, obejcts, arrays etc.), either
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 worlkfow execution vars.
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 fow now basic expreion like: $true, $false, $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $regexp
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 worlkfow execution vars.
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 mutally exclusive
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
  */
@@ -8,3 +8,4 @@ export * from "./object-types.js";
8
8
  export * from "./store.js";
9
9
  export * from "./temporalio.js";
10
10
  export * from "./workflow.js";
11
+ export * from "./signals.js";
@@ -0,0 +1,5 @@
1
+ export interface UserInputSignal {
2
+ message: string;
3
+ metadata?: Record<string, any>;
4
+ auth_token?: string;
5
+ }
@@ -1,18 +1,17 @@
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';
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 = 'created',
9
- processing = 'processing', // the was created and still processing
10
- completed = 'completed',
11
- failed = 'failed',
12
- archived = '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; // in bytes
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: 'image';
66
+ type: "image";
71
67
  dimensions?: Dimensions;
72
68
  }
73
69
 
74
70
  export interface AudioMetadata extends TemporalMediaMetadata {
75
- type: 'audio';
71
+ type: "audio";
76
72
  }
77
73
 
78
74
  export interface VideoMetadata extends TemporalMediaMetadata {
79
- type: 'video';
75
+ type: "video";
80
76
  dimensions?: Dimensions;
81
77
  }
82
78
 
83
79
  export interface DocumentMetadata extends ContentMetadata {
84
- type: 'document';
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
- language?: string
109
- confidence?: number
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> extends BaseObject {
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
- // A ref to the object type
160
+
161
+ /**
162
+ * Object type id.
163
+ */
132
164
  type?: ContentObjectTypeRef;
133
- // the content source URL and type
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
- properties: T | Record<string, any>; // a JSON object that describes the object
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 shouild be an URL to the uploaded file
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> extends Partial<Omit<ContentObject<T>,
149
- 'id' | 'root' | 'created_at' | 'updated_at' | 'type'
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, 'query'> {
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 extends Omit<ContentObjectType, 'id' | 'created_at' | 'updated_at' | 'created_by' | 'updated_by'> {
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 = 'single',
201
- multiple = 'multiple',
202
- none = '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 extends Partial<Omit<WorkflowRule, 'id' | 'created_at' | 'updated_at' | 'owner'>> {
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
- status: 'found' | 'generating' | 'failed';
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