@vertesia/common 0.70.0 → 0.72.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 (84) hide show
  1. package/lib/cjs/access-control.js +4 -0
  2. package/lib/cjs/access-control.js.map +1 -1
  3. package/lib/cjs/apikey.js.map +1 -1
  4. package/lib/cjs/project.js +1 -2
  5. package/lib/cjs/project.js.map +1 -1
  6. package/lib/cjs/refs.js +1 -0
  7. package/lib/cjs/refs.js.map +1 -1
  8. package/lib/cjs/store/store.js.map +1 -1
  9. package/lib/cjs/store/workflow.js.map +1 -1
  10. package/lib/cjs/user.js +1 -2
  11. package/lib/cjs/user.js.map +1 -1
  12. package/lib/esm/access-control.js +4 -0
  13. package/lib/esm/access-control.js.map +1 -1
  14. package/lib/esm/apikey.js.map +1 -1
  15. package/lib/esm/project.js +1 -2
  16. package/lib/esm/project.js.map +1 -1
  17. package/lib/esm/refs.js +1 -0
  18. package/lib/esm/refs.js.map +1 -1
  19. package/lib/esm/store/store.js.map +1 -1
  20. package/lib/esm/store/workflow.js.map +1 -1
  21. package/lib/esm/user.js +0 -1
  22. package/lib/esm/user.js.map +1 -1
  23. package/lib/tsconfig.tsbuildinfo +1 -1
  24. package/lib/types/Progress.d.ts +1 -0
  25. package/lib/types/access-control.d.ts +7 -2
  26. package/lib/types/access-control.d.ts.map +1 -1
  27. package/lib/types/analytics.d.ts +1 -0
  28. package/lib/types/apikey.d.ts +9 -3
  29. package/lib/types/apikey.d.ts.map +1 -1
  30. package/lib/types/apps.d.ts +8 -15
  31. package/lib/types/apps.d.ts.map +1 -1
  32. package/lib/types/common.d.ts +1 -0
  33. package/lib/types/environment.d.ts +1 -0
  34. package/lib/types/facets.d.ts +1 -0
  35. package/lib/types/group.d.ts +1 -0
  36. package/lib/types/index.d.ts +1 -0
  37. package/lib/types/integrations.d.ts +1 -0
  38. package/lib/types/interaction.d.ts +1 -0
  39. package/lib/types/json-schema.d.ts +1 -0
  40. package/lib/types/json.d.ts +1 -0
  41. package/lib/types/meters.d.ts +1 -0
  42. package/lib/types/model_utility.d.ts +1 -0
  43. package/lib/types/payload.d.ts +1 -0
  44. package/lib/types/project.d.ts +2 -2
  45. package/lib/types/project.d.ts.map +1 -1
  46. package/lib/types/prompt.d.ts +1 -0
  47. package/lib/types/query.d.ts +1 -0
  48. package/lib/types/refs.d.ts +2 -0
  49. package/lib/types/refs.d.ts.map +1 -1
  50. package/lib/types/runs.d.ts +1 -0
  51. package/lib/types/store/activity-catalog.d.ts +1 -0
  52. package/lib/types/store/agent.d.ts +1 -0
  53. package/lib/types/store/collections.d.ts +1 -0
  54. package/lib/types/store/common.d.ts +1 -0
  55. package/lib/types/store/doc-analyzer.d.ts +1 -0
  56. package/lib/types/store/dsl-workflow.d.ts +1 -0
  57. package/lib/types/store/index.d.ts +1 -0
  58. package/lib/types/store/object-types.d.ts +1 -0
  59. package/lib/types/store/signals.d.ts +1 -0
  60. package/lib/types/store/store.d.ts +7 -0
  61. package/lib/types/store/store.d.ts.map +1 -1
  62. package/lib/types/store/temporalio.d.ts +1 -0
  63. package/lib/types/store/workflow.d.ts +9 -0
  64. package/lib/types/store/workflow.d.ts.map +1 -1
  65. package/lib/types/tenant.d.ts +1 -0
  66. package/lib/types/training.d.ts +1 -0
  67. package/lib/types/transient-tokens.d.ts +3 -2
  68. package/lib/types/transient-tokens.d.ts.map +1 -1
  69. package/lib/types/user.d.ts +2 -2
  70. package/lib/types/user.d.ts.map +1 -1
  71. package/lib/types/utils/auth.d.ts +1 -0
  72. package/lib/types/utils/schemas.d.ts +1 -0
  73. package/lib/vertesia-common.js +1 -1
  74. package/lib/vertesia-common.js.map +1 -1
  75. package/package.json +1 -1
  76. package/src/access-control.ts +6 -1
  77. package/src/apikey.ts +9 -3
  78. package/src/apps.ts +7 -17
  79. package/src/project.ts +1 -2
  80. package/src/refs.ts +1 -0
  81. package/src/store/store.ts +7 -0
  82. package/src/store/workflow.ts +10 -0
  83. package/src/transient-tokens.ts +2 -2
  84. package/src/user.ts +1 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertesia/common",
3
- "version": "0.70.0",
3
+ "version": "0.72.0",
4
4
  "type": "module",
5
5
  "types": "./lib/types/index.d.ts",
6
6
  "files": [
@@ -41,6 +41,11 @@ export enum Permission {
41
41
 
42
42
  workflow_run = "workflow:run",
43
43
  workflow_admin = "workflow:admin",
44
+
45
+ /**
46
+ * whether the user has access to Sutdio App.
47
+ */
48
+ studio_access = "studio:access",
44
49
  }
45
50
 
46
51
  export enum AccessControlResourceType {
@@ -81,7 +86,7 @@ export interface ACEUpdatePayload extends Partial<ACECreatePayload> {
81
86
 
82
87
  export interface AcesQueryOptions {
83
88
 
84
- level?: 'resource' | 'project' | 'account'
89
+ level?: 'resource' | 'project' | 'projects' | 'account'
85
90
  resource?: string
86
91
  principal?: string
87
92
  role?: string
package/src/apikey.ts CHANGED
@@ -58,10 +58,16 @@ export interface AuthTokenPayload {
58
58
  project_roles?: ProjectRoles[];
59
59
 
60
60
  /**
61
- * The roles of the user in the application it has access
62
- * The key is the unique app name (kebab-case) and the value a list of roles.
61
+ * The app names enabled for this token. Defaults to an empty array if no apps are enabled.
63
62
  */
64
- apps_roles: Record<string, string[]>,
63
+ apps: string[];
64
+
65
+ /**
66
+ * The user ID (if any) attached to the token.
67
+ * This is set when the token is a user token or an agent token running as a user.
68
+ * Not set for impersonating tokens like project tokens.
69
+ */
70
+ user_id?: string;
65
71
 
66
72
  /** groups */
67
73
  groups?: UserGroupRef[]; //group ids
package/src/apps.ts CHANGED
@@ -1,9 +1,4 @@
1
1
 
2
- export interface AppRef {
3
- id: string;
4
- name: string;
5
- }
6
-
7
2
  export interface AppUIConfig {
8
3
  /**
9
4
  * The source URL of the app. The src can be a template which contain
@@ -12,10 +7,11 @@ export interface AppUIConfig {
12
7
  */
13
8
  src: string;
14
9
  /**
15
- * Whether the app should be loaded as part of the host layout
16
- * or in a new tab.
10
+ * The isolation strategy. If not specified it defaults to shadow
11
+ * - shadow - use Shadow DOM to fully isolate the plugin from the host.
12
+ * - css - use CSS processing (like prefixing or other isolation techniques). Ligther but plugins may conflict with the host
17
13
  */
18
- external?: boolean;
14
+ isolation?: "shadow" | "css";
19
15
  }
20
16
 
21
17
  export interface AppManifestData {
@@ -25,18 +21,11 @@ export interface AppManifestData {
25
21
  */
26
22
  name: string;
27
23
 
28
- /**
29
- * Which account is ownning the app.
30
- * The property is defined only for customer apps.
31
- * THis is always undefined for vertesia apps.
32
- */
33
- account?: string;
34
-
35
24
  /**
36
25
  * Whether the app is private to the owner account.
37
26
  * If true the account property must be defined.
38
27
  */
39
- private?: boolean;
28
+ private: boolean;
40
29
 
41
30
  title: string;
42
31
  description: string;
@@ -47,7 +36,7 @@ export interface AppManifestData {
47
36
  */
48
37
  icon?: string;
49
38
 
50
- status: "beta" | "stable" | "deprecated" | "hidden"
39
+ status: "beta" | "stable" | "deprecated"
51
40
 
52
41
  ui?: AppUIConfig
53
42
 
@@ -60,6 +49,7 @@ export interface AppManifestData {
60
49
  }
61
50
  export interface AppManifest extends AppManifestData {
62
51
  id: string;
52
+ account: string;
63
53
  created_at: string;
64
54
  updated_at: string;
65
55
  }
package/src/project.ts CHANGED
@@ -17,8 +17,7 @@ export enum ProjectRoles {
17
17
  reader = "reader", // can only read (browse)
18
18
  billing = "billing", // can only manage billings
19
19
  member = "member", // can only access, but no specific permissions
20
- app_user = "app_user", // can access and perform read/write operations in the context of an app
21
- app_reader = "app_reader", // can access and perform read operations in the context of an app
20
+ app_member = "app_member", // used to mark an user have access to an application. does not provide any permission on its own
22
21
  }
23
22
 
24
23
  export function isRoleIncludedIn(role: string, includingRole: string) {
package/src/refs.ts CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  export enum ResolvableRefType {
4
4
  project = "Project",
5
+ projects = "Projects",
5
6
  environment = "Environment",
6
7
  user = "User",
7
8
  account = "Account",
@@ -81,6 +81,12 @@ export interface VideoMetadata extends TemporalMediaMetadata {
81
81
  dimensions?: Dimensions;
82
82
  }
83
83
 
84
+ export interface TextSection {
85
+ description: string; // the description of the section
86
+ first_line_index: number;
87
+ last_line_index: number;
88
+ }
89
+
84
90
  export interface DocumentMetadata extends ContentMetadata {
85
91
  type: "document";
86
92
  page_count?: number;
@@ -93,6 +99,7 @@ export interface DocumentMetadata extends ContentMetadata {
93
99
  zone_count: number;
94
100
  needs_ocr_count?: number;
95
101
  };
102
+ sections?: TextSection[]; // List of sections with descriptions and line indexes
96
103
  }
97
104
 
98
105
  export interface Transcript {
@@ -66,6 +66,16 @@ export interface WorkflowExecutionBaseParams<T = Record<string, any>> {
66
66
  run_id: string;
67
67
  workflow_id: string;
68
68
  };
69
+
70
+ /**
71
+ * Whether to route resource intensive tasks to a heavy load queue. Managed by the application.
72
+ */
73
+ _enable_heavy_task_routing?: boolean;
74
+
75
+ /**
76
+ * The suffix to append to the task queue name for heavy load routing. Managed by the application.
77
+ */
78
+ _heavy_task_queue_suffix?: string;
69
79
  }
70
80
 
71
81
  export interface WorkflowExecutionPayload<T = Record<string, any>> extends WorkflowExecutionBaseParams<T> {
@@ -1,4 +1,4 @@
1
- import { ProjectRoles } from "./project.js";
1
+ import { ProjectRef, ProjectRoles } from "./project.js";
2
2
  import { AccountRef } from "./user.js";
3
3
 
4
4
 
@@ -25,6 +25,6 @@ export interface UserInviteTokenData {
25
25
  email: string;
26
26
  role: ProjectRoles;
27
27
  account: AccountRef;
28
- projects?: string[];
28
+ project: ProjectRef;
29
29
  invitedBy: { name: string, email: string; };
30
30
  }
package/src/user.ts CHANGED
@@ -81,12 +81,10 @@ export interface AccountRef {
81
81
  }
82
82
  export const AccountRefPopulate = "id name";
83
83
 
84
- export const AppRefPopulate = "id name";
85
-
86
84
  export interface InviteUserRequestPayload {
87
85
  email: string;
88
86
  role: ProjectRoles;
89
- projects?: string[];
87
+ project: string;
90
88
  }
91
89
 
92
90
  export interface InviteUserResponsePayload {