@vertesia/common 0.64.0 → 0.66.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 (65) hide show
  1. package/lib/cjs/access-control.js +16 -8
  2. package/lib/cjs/access-control.js.map +1 -1
  3. package/lib/cjs/apikey.js.map +1 -1
  4. package/lib/cjs/group.js +5 -0
  5. package/lib/cjs/group.js.map +1 -0
  6. package/lib/cjs/index.js +4 -2
  7. package/lib/cjs/index.js.map +1 -1
  8. package/lib/cjs/interaction.js.map +1 -1
  9. package/lib/cjs/model_utility.js +6 -0
  10. package/lib/cjs/model_utility.js.map +1 -0
  11. package/lib/cjs/refs.js +1 -0
  12. package/lib/cjs/refs.js.map +1 -1
  13. package/lib/cjs/store/workflow.js.map +1 -1
  14. package/lib/cjs/user.js.map +1 -1
  15. package/lib/esm/access-control.js +15 -7
  16. package/lib/esm/access-control.js.map +1 -1
  17. package/lib/esm/apikey.js.map +1 -1
  18. package/lib/esm/group.js +2 -0
  19. package/lib/esm/group.js.map +1 -0
  20. package/lib/esm/index.js +4 -2
  21. package/lib/esm/index.js.map +1 -1
  22. package/lib/esm/interaction.js.map +1 -1
  23. package/lib/esm/model_utility.js +2 -0
  24. package/lib/esm/model_utility.js.map +1 -0
  25. package/lib/esm/refs.js +1 -0
  26. package/lib/esm/refs.js.map +1 -1
  27. package/lib/esm/store/workflow.js.map +1 -1
  28. package/lib/esm/user.js.map +1 -1
  29. package/lib/tsconfig.tsbuildinfo +1 -1
  30. package/lib/types/access-control.d.ts +12 -4
  31. package/lib/types/access-control.d.ts.map +1 -1
  32. package/lib/types/apikey.d.ts +3 -0
  33. package/lib/types/apikey.d.ts.map +1 -1
  34. package/lib/types/group.d.ts +21 -0
  35. package/lib/types/group.d.ts.map +1 -0
  36. package/lib/types/index.d.ts +4 -2
  37. package/lib/types/index.d.ts.map +1 -1
  38. package/lib/types/interaction.d.ts +10 -5
  39. package/lib/types/interaction.d.ts.map +1 -1
  40. package/lib/types/model_utility.d.ts +1 -0
  41. package/lib/types/model_utility.d.ts.map +1 -0
  42. package/lib/types/payload.d.ts +2 -3
  43. package/lib/types/payload.d.ts.map +1 -1
  44. package/lib/types/query.d.ts +6 -1
  45. package/lib/types/query.d.ts.map +1 -1
  46. package/lib/types/refs.d.ts +2 -1
  47. package/lib/types/refs.d.ts.map +1 -1
  48. package/lib/types/store/workflow.d.ts +67 -0
  49. package/lib/types/store/workflow.d.ts.map +1 -1
  50. package/lib/types/user.d.ts +1 -0
  51. package/lib/types/user.d.ts.map +1 -1
  52. package/lib/vertesia-common.js +1 -1
  53. package/lib/vertesia-common.js.map +1 -1
  54. package/package.json +2 -2
  55. package/src/access-control.ts +13 -3
  56. package/src/apikey.ts +6 -0
  57. package/src/group.ts +26 -0
  58. package/src/index.ts +5 -2
  59. package/src/interaction.ts +14 -5
  60. package/src/model_utility.ts +1 -0
  61. package/src/payload.ts +2 -4
  62. package/src/query.ts +6 -1
  63. package/src/refs.ts +2 -1
  64. package/src/store/workflow.ts +74 -0
  65. package/src/user.ts +3 -1
package/src/refs.ts CHANGED
@@ -5,7 +5,8 @@ export enum ResolvableRefType {
5
5
  environment = "Environment",
6
6
  user = "User",
7
7
  account = "Account",
8
- interaction = "Interaction"
8
+ interaction = "Interaction",
9
+ userGroup = "UserGroup"
9
10
  }
10
11
 
11
12
  export interface ResolvableRef {
@@ -1,3 +1,6 @@
1
+ import { JSONSchema4 } from "json-schema";
2
+ import { InteractionRef } from "../interaction.js";
3
+
1
4
  export enum ContentEventName {
2
5
  create = "create",
3
6
  change_type = "change_type",
@@ -178,6 +181,16 @@ export interface ListWorkflowRunsPayload {
178
181
  query?: string;
179
182
 
180
183
  type?: string;
184
+
185
+ /**
186
+ * The maximum number of results to return per page.
187
+ */
188
+ page_size?: number;
189
+
190
+ /**
191
+ * The page token for Temporal pagination.
192
+ */
193
+ next_page_token?: string;
181
194
  }
182
195
 
183
196
  interface WorkflowRunEvent {
@@ -195,6 +208,31 @@ interface WorkflowRunEvent {
195
208
  startedEventId?: string;
196
209
  };
197
210
 
211
+ childWorkflow?: {
212
+ workflowId?: string,
213
+ workflowType?: string,
214
+ runId?: string,
215
+ scheduledEventId?: string,
216
+ startedEventId?: string,
217
+ input?: any,
218
+ result?: any,
219
+ };
220
+
221
+ signal?: {
222
+ direction: "receiving" | "sending";
223
+ signalName?: string,
224
+ input?: any,
225
+ sender?: {
226
+ workflowId?: string,
227
+ runId?: string
228
+ }
229
+ recipient?: {
230
+ workflowId?: string,
231
+ runId?: string
232
+ },
233
+ initiatedEventId?: string,
234
+ }
235
+
198
236
  error?: {
199
237
  message?: string;
200
238
  source?: string;
@@ -219,7 +257,10 @@ export interface WorkflowRun {
219
257
  run_id?: string;
220
258
  workflow_id?: string;
221
259
  initiated_by?: string;
260
+ interaction_name?: string;
261
+ input?: any;
222
262
  result?: any;
263
+ error?:any,
223
264
  raw?: any;
224
265
  /**
225
266
  * The Vertesia Workflow Type of this Workflow Run.
@@ -228,6 +269,10 @@ export interface WorkflowRun {
228
269
  * - For non-DSL workflows, the vertesia_type is the name of the Temporal Workflow Type.
229
270
  */
230
271
  vertesia_workflow_type?: string;
272
+ /**
273
+ * An interaction is used to start the agent, the data is stored on temporal "vars"
274
+ */
275
+ interactions?: InteractionRef[];
231
276
  }
232
277
 
233
278
  export interface WorkflowRunWithDetails extends WorkflowRun {
@@ -235,9 +280,38 @@ export interface WorkflowRunWithDetails extends WorkflowRun {
235
280
  memo?: {
236
281
  [key: string]: any;
237
282
  } | null;
283
+ pendingActivities?: {
284
+ activityId?: string;
285
+ activityType?: string;
286
+ attempt: number;
287
+ maximumAttempts: number;
288
+ lastFailure?: string;
289
+ lastStartedTime?: number;
290
+ }[];
238
291
  }
239
292
  export interface ListWorkflowRunsResponse {
240
293
  runs: WorkflowRun[];
294
+ next_page_token?: string;
295
+ has_more?: boolean;
296
+ }
297
+
298
+ export interface ListWorkflowInteractionsResponse {
299
+ workflow_id: string,
300
+ run_id: string,
301
+ interaction: WorkflowInteraction
302
+ }
303
+
304
+ export interface WorkflowInteraction {
305
+ type: string,
306
+ model: string,
307
+ tools: [],
308
+ interaction: string,
309
+ environment: string,
310
+ prompt_data: JSONSchema4,
311
+ interactive: boolean,
312
+ interactionParamsSchema?: JSONSchema4
313
+ debug_mode?: boolean;
314
+ collection_id?: string;
241
315
  }
242
316
 
243
317
  export interface MultiDocumentsInteractionParams extends Omit<WorkflowExecutionPayload, "config"> {
package/src/user.ts CHANGED
@@ -4,6 +4,7 @@ import { ProjectRoles } from "./project.js";
4
4
  export interface UserWithAccounts extends User {
5
5
  accounts: AccountRef[];
6
6
  }
7
+
7
8
  export interface User {
8
9
  id: string;
9
10
  externalId: string;
@@ -15,6 +16,7 @@ export interface User {
15
16
  phone?: string;
16
17
  sign_in_provider?: string;
17
18
  last_selected_account?: string;
19
+ source?: 'firebase' | 'scim';
18
20
  }
19
21
 
20
22
  export interface UserRef {
@@ -33,7 +35,7 @@ export enum Datacenters {
33
35
 
34
36
  export enum BillingMethod {
35
37
  stripe = 'stripe',
36
- invoice ='invoice'
38
+ invoice = 'invoice'
37
39
  }
38
40
 
39
41