@vertesia/common 0.50.0 → 0.51.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 (112) hide show
  1. package/lib/cjs/Progress.js +61 -0
  2. package/lib/cjs/Progress.js.map +1 -0
  3. package/lib/cjs/environment.js.map +1 -1
  4. package/lib/cjs/index.js +3 -0
  5. package/lib/cjs/index.js.map +1 -1
  6. package/lib/cjs/integrations.js +1 -0
  7. package/lib/cjs/integrations.js.map +1 -1
  8. package/lib/cjs/interaction.js +1 -1
  9. package/lib/cjs/interaction.js.map +1 -1
  10. package/lib/cjs/meters.js +13 -0
  11. package/lib/cjs/meters.js.map +1 -0
  12. package/lib/cjs/store/collections.js +9 -0
  13. package/lib/cjs/store/collections.js.map +1 -0
  14. package/lib/cjs/store/doc-analyzer.js +3 -0
  15. package/lib/cjs/store/doc-analyzer.js.map +1 -0
  16. package/lib/cjs/store/index.js +2 -0
  17. package/lib/cjs/store/index.js.map +1 -1
  18. package/lib/cjs/store/store.js.map +1 -1
  19. package/lib/cjs/store/workflow.js.map +1 -1
  20. package/lib/cjs/user.js +6 -1
  21. package/lib/cjs/user.js.map +1 -1
  22. package/lib/cjs/utils/advanced-content-processing.js +25 -0
  23. package/lib/cjs/utils/advanced-content-processing.js.map +1 -0
  24. package/lib/esm/Progress.js +57 -0
  25. package/lib/esm/Progress.js.map +1 -0
  26. package/lib/esm/environment.js.map +1 -1
  27. package/lib/esm/index.js +3 -0
  28. package/lib/esm/index.js.map +1 -1
  29. package/lib/esm/integrations.js +1 -0
  30. package/lib/esm/integrations.js.map +1 -1
  31. package/lib/esm/interaction.js +1 -1
  32. package/lib/esm/interaction.js.map +1 -1
  33. package/lib/esm/meters.js +10 -0
  34. package/lib/esm/meters.js.map +1 -0
  35. package/lib/esm/store/collections.js +6 -0
  36. package/lib/esm/store/collections.js.map +1 -0
  37. package/lib/esm/store/doc-analyzer.js +2 -0
  38. package/lib/esm/store/doc-analyzer.js.map +1 -0
  39. package/lib/esm/store/index.js +2 -0
  40. package/lib/esm/store/index.js.map +1 -1
  41. package/lib/esm/store/store.js.map +1 -1
  42. package/lib/esm/store/workflow.js.map +1 -1
  43. package/lib/esm/user.js +5 -0
  44. package/lib/esm/user.js.map +1 -1
  45. package/lib/esm/utils/advanced-content-processing.js +19 -0
  46. package/lib/esm/utils/advanced-content-processing.js.map +1 -0
  47. package/lib/tsconfig.tsbuildinfo +1 -1
  48. package/lib/types/Progress.d.ts +22 -0
  49. package/lib/types/Progress.d.ts.map +1 -0
  50. package/lib/types/access-control.d.ts +1 -0
  51. package/lib/types/analytics.d.ts +1 -0
  52. package/lib/types/apikey.d.ts +1 -0
  53. package/lib/types/common.d.ts +1 -0
  54. package/lib/types/environment.d.ts +4 -2
  55. package/lib/types/environment.d.ts.map +1 -1
  56. package/lib/types/facets.d.ts +1 -0
  57. package/lib/types/index.d.ts +4 -0
  58. package/lib/types/index.d.ts.map +1 -1
  59. package/lib/types/integrations.d.ts +7 -1
  60. package/lib/types/integrations.d.ts.map +1 -1
  61. package/lib/types/interaction.d.ts +9 -12
  62. package/lib/types/interaction.d.ts.map +1 -1
  63. package/lib/types/meters.d.ts +17 -0
  64. package/lib/types/meters.d.ts.map +1 -0
  65. package/lib/types/payload.d.ts +1 -0
  66. package/lib/types/project.d.ts +1 -0
  67. package/lib/types/prompt.d.ts +1 -0
  68. package/lib/types/query.d.ts +3 -0
  69. package/lib/types/query.d.ts.map +1 -1
  70. package/lib/types/refs.d.ts +1 -0
  71. package/lib/types/runs.d.ts +1 -0
  72. package/lib/types/store/activity-catalog.d.ts +2 -1
  73. package/lib/types/store/activity-catalog.d.ts.map +1 -1
  74. package/lib/types/store/agent.d.ts +1 -0
  75. package/lib/types/store/collections.d.ts +55 -0
  76. package/lib/types/store/collections.d.ts.map +1 -0
  77. package/lib/types/store/common.d.ts +1 -0
  78. package/lib/types/store/doc-analyzer.d.ts +84 -0
  79. package/lib/types/store/doc-analyzer.d.ts.map +1 -0
  80. package/lib/types/store/dsl-workflow.d.ts +1 -0
  81. package/lib/types/store/index.d.ts +3 -0
  82. package/lib/types/store/index.d.ts.map +1 -1
  83. package/lib/types/store/object-types.d.ts +1 -0
  84. package/lib/types/store/store.d.ts +11 -11
  85. package/lib/types/store/store.d.ts.map +1 -1
  86. package/lib/types/store/temporalio.d.ts +1 -0
  87. package/lib/types/store/workflow.d.ts +26 -13
  88. package/lib/types/store/workflow.d.ts.map +1 -1
  89. package/lib/types/training.d.ts +1 -0
  90. package/lib/types/transient-tokens.d.ts +1 -0
  91. package/lib/types/user.d.ts +11 -0
  92. package/lib/types/user.d.ts.map +1 -1
  93. package/lib/types/utils/advanced-content-processing.d.ts +16 -0
  94. package/lib/types/utils/advanced-content-processing.d.ts.map +1 -0
  95. package/lib/types/utils/auth.d.ts +1 -0
  96. package/lib/types/utils/schemas.d.ts +1 -0
  97. package/package.json +3 -2
  98. package/src/Progress.ts +57 -0
  99. package/src/environment.ts +3 -2
  100. package/src/index.ts +4 -0
  101. package/src/integrations.ts +8 -1
  102. package/src/interaction.ts +7 -15
  103. package/src/meters.ts +24 -0
  104. package/src/query.ts +2 -0
  105. package/src/store/activity-catalog.ts +1 -1
  106. package/src/store/collections.ts +62 -0
  107. package/src/store/doc-analyzer.ts +92 -0
  108. package/src/store/index.ts +2 -0
  109. package/src/store/store.ts +12 -11
  110. package/src/store/workflow.ts +55 -38
  111. package/src/user.ts +13 -0
  112. package/src/utils/advanced-content-processing.ts +32 -0
@@ -17,6 +17,7 @@ export interface InteractionExecutionError {
17
17
  export interface InteractionRef {
18
18
  id: string;
19
19
  name: string;
20
+ parent?: string;
20
21
  description?: string;
21
22
  status: InteractionStatus;
22
23
  visibility?: InteractionVisibility;
@@ -25,7 +26,7 @@ export interface InteractionRef {
25
26
  prompts?: PromptSegmentDef<PromptTemplateRef>[];
26
27
  updated_at: Date;
27
28
  }
28
- export const InteractionRefPopulate = "id name description status version visibility tags updated_at prompts";
29
+ export const InteractionRefPopulate = "id name parent description status version visibility tags updated_at prompts";
29
30
 
30
31
  export interface InteractionRefWithSchema
31
32
  extends Omit<InteractionRef, "prompts"> {
@@ -93,7 +94,7 @@ export interface CachePolicy {
93
94
  ttl: number;
94
95
  }
95
96
  export type InteractionVisibility = 'public' | 'private';
96
- export interface Interaction extends ModelOptions {
97
+ export interface Interaction {
97
98
  readonly id: string;
98
99
  name: string;
99
100
  endpoint: string;
@@ -105,9 +106,11 @@ export interface Interaction extends ModelOptions {
105
106
  version: number;
106
107
  tags: string[];
107
108
  test_data?: JSONObject;
109
+ interaction_schema?: JSONSchema4 | SchemaRef;
108
110
  result_schema?: JSONSchema4 | SchemaRef;
109
111
  cache_policy?: CachePolicy;
110
112
  model: string;
113
+ model_options?: ModelOptions;
111
114
  prompts: PromptSegmentDef[];
112
115
  output_modality?: Modalities;
113
116
  environment: string | ExecutionEnvironmentRef;
@@ -139,21 +142,9 @@ export interface InteractionUpdatePayload
139
142
  Omit<
140
143
  Interaction,
141
144
  "result_schema" | "id" | "created_at" | "updated_at" | "created_by" | "updated_by" | "project"
142
- | "temperature" | "max_tokens" | "stop_sequence" | "top_k" | "top_p" | "presence_penalty" | "frequency_penalty" | "top_logprobs"
143
145
  >
144
146
  > {
145
147
  result_schema?: JSONSchema4 | null;
146
-
147
- // Change ModelOptions properties to include null as a possible type
148
- // Null values indicate that the property should be cleared.
149
- temperature?: number | null;
150
- max_tokens?: number | null;
151
- stop_sequence?: string[] | null;
152
- top_k?: number | null;
153
- top_p?: number | null;
154
- top_logprobs?: number | null;
155
- presence_penalty?: number | null;
156
- frequency_penalty?: number | null;
157
148
  }
158
149
 
159
150
  export interface InteractionPublishPayload {
@@ -276,12 +267,13 @@ export const ConfigModesOptions: Record<ConfigModes, ConfigModesDescription> = {
276
267
  [ConfigModes.INTERACTION_CONFIG_ONLY]: ConfigModesDescription.INTERACTION_CONFIG_ONLY,
277
268
  }
278
269
 
279
- export interface InteractionExecutionConfiguration extends ModelOptions {
270
+ export interface InteractionExecutionConfiguration {
280
271
  environment?: string;
281
272
  model?: string;
282
273
  do_validate?: boolean;
283
274
  run_data?: RunDataStorageLevel;
284
275
  configMode?: ConfigModes;
276
+ model_options?: ModelOptions;
285
277
  }
286
278
 
287
279
  export interface GenerateInteractionPayload {
package/src/meters.ts ADDED
@@ -0,0 +1,24 @@
1
+
2
+
3
+
4
+
5
+
6
+ export interface MeterAdjustment {
7
+ meter: string;
8
+ value: string;
9
+ identifier?: string;
10
+ }
11
+
12
+
13
+ export interface AdjustMetersMeterWorkflowParams {
14
+ adjustments: MeterAdjustment[];
15
+ }
16
+
17
+ export enum MeterNames {
18
+ analyzed_pages = 'analyzed_pages',
19
+ extracted_tables = 'extracted_tables',
20
+ analyzed_images = 'analyzed_images',
21
+ input_token_used = 'input_token_used',
22
+ output_token_used = 'output_token_used',
23
+ task_run = 'task_run',
24
+ }
package/src/query.ts CHANGED
@@ -69,6 +69,8 @@ export interface RunSearchQuery extends SimpleSearchQuery {
69
69
  object?: string;
70
70
  start?: string;
71
71
  end?: string;
72
+ finish_reason?: string;
73
+ created_by?: string;
72
74
  }
73
75
 
74
76
  export interface WorkflowExecutionSearchQuery extends SimpleSearchQuery {
@@ -9,7 +9,7 @@ export interface ActivityTypeDefinition {
9
9
  // in case of primitive literals will be the value
10
10
  // or nested objects / arrays will be "object" or "array"
11
11
  // for record this is Record<type,type>
12
- value: string | boolean | number;
12
+ value: string | boolean | number | null;
13
13
  // in case of objects
14
14
  members?: ActivityPropertyDefinition[];
15
15
  // in case of arrays or promises will be innertype (i.e. the element type for arrays)
@@ -0,0 +1,62 @@
1
+ import { BaseObject } from "./common.js";
2
+ import { ColumnLayout, ContentObjectTypeRef } from "./store.js";
3
+
4
+ export enum CollectionStatus {
5
+ active = 'active',
6
+ archived = 'archived'
7
+ }
8
+
9
+ export interface CreateCollectionPayload {
10
+ name: string;
11
+ dynamic: boolean;
12
+ description?: string;
13
+ tags?: string[];
14
+ type?: string;
15
+ query?: Record<string, any>;
16
+ properties?: Record<string, any>;
17
+ parent?: string | null;
18
+ table_layout?: ColumnLayout[] | null;
19
+ }
20
+
21
+ export interface CollectionItem extends BaseObject {
22
+ /**
23
+ * A flag to indicate if the collection is dynamic or static.
24
+ * 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
+ */
27
+ dynamic: boolean;
28
+ status: CollectionStatus;
29
+ // A ref to the object type
30
+ type?: ContentObjectTypeRef;
31
+ /**
32
+ * The parent collection if any
33
+ */
34
+ parent?: string | null;
35
+ /**
36
+ * The table layout to use for the collection.
37
+ * The layout defined in the type could serve as a fallback if not defined here.
38
+ */
39
+ table_layout?: ColumnLayout[];
40
+ }
41
+
42
+ export interface Collection extends CollectionItem {
43
+ properties: Record<string, any>;
44
+ query?: Record<string, any>;
45
+ }
46
+
47
+ export interface StaticCollection extends Collection {
48
+ dynamic: false;
49
+ members: string[];
50
+ query: never;
51
+ }
52
+
53
+ export interface DynamicCollection extends Collection {
54
+ dynamic: true;
55
+ }
56
+
57
+ export interface CollectionSearchPayload {
58
+ dynamic?: boolean;
59
+ status?: CollectionStatus;
60
+ limit?: number;
61
+ offset?: number;
62
+ }
@@ -0,0 +1,92 @@
1
+ import { WorkflowExecutionPayload, WorkflowExecutionStatus } from "./workflow.js";
2
+
3
+ export interface PdfToRichtextOptions {
4
+ features: string[];
5
+ debug?: boolean;
6
+ [key: string]: any;
7
+ }
8
+
9
+
10
+ export interface PdfToRichTextWorkflowParams extends Omit<WorkflowExecutionPayload, "vars"> {
11
+ vars: PdfToRichtextOptions
12
+ }
13
+
14
+ /**
15
+ * Represents a image in a document that has been analyzed
16
+ */
17
+ export interface DocImage {
18
+ id?: string;
19
+ page_number?: number;
20
+ image_number?: number;
21
+ title?: string;
22
+ url?: string;
23
+ description?: string;
24
+ is_meaningful?: boolean;
25
+ width?: number;
26
+ height?: number;
27
+ path?: string;
28
+ }
29
+
30
+ /**
31
+ * Represents a table in a document that has been analyzed
32
+ */
33
+ export interface DocTable {
34
+ page_number?: number;
35
+ table_number?: number;
36
+ title?: string;
37
+ format: "application/csv" | "application/json";
38
+ }
39
+
40
+ /**
41
+ * Represents a table in a document that has been analyzed in CSV format
42
+ */
43
+ export interface DocTableCsv extends DocTable {
44
+ format: "application/csv";
45
+ title?: string;
46
+ data: string;
47
+ }
48
+
49
+ /**
50
+ * Represents a table in a document that has been analyzed in JSON format
51
+ */
52
+ export interface DocTableJson extends DocTable {
53
+ format: "application/json";
54
+ title?: string;
55
+ data: Object[];
56
+ }
57
+
58
+ /**
59
+ * Represents a document analysis run status
60
+ */
61
+ export interface DocAnalyzeRunStatusResponse {
62
+ workflow_id: string | null;
63
+ run_id: string | null;
64
+ status: WorkflowExecutionStatus;
65
+ progress?: DocAnalyzerProgress;
66
+ }
67
+
68
+
69
+ export interface DocAnalyzerResultResponse {
70
+ document?: string;
71
+ tables?: DocTableCsv[] | DocTableJson[];
72
+ images?: DocImage[];
73
+ parts?: { id: string, title: string }[];
74
+ annotated?: string | null;
75
+ }
76
+
77
+
78
+ export interface DocAnalyzerProgress {
79
+ pages: DocAnalyzerProgressStatus,
80
+ images: DocAnalyzerProgressStatus,
81
+ tables: DocAnalyzerProgressStatus,
82
+ visuals: DocAnalyzerProgressStatus,
83
+ started_at?: number;
84
+ percent: number;
85
+ }
86
+
87
+ interface DocAnalyzerProgressStatus {
88
+ total: number;
89
+ processed: number;
90
+ success: number;
91
+ failed: number;
92
+ }
@@ -1,6 +1,8 @@
1
1
  export * from "./activity-catalog.js";
2
2
  export * from "./agent.js";
3
+ export * from "./collections.js";
3
4
  export * from "./common.js";
5
+ export * from "./doc-analyzer.js";
4
6
  export * from "./dsl-workflow.js";
5
7
  export * from "./object-types.js";
6
8
  export * from "./store.js";
@@ -48,11 +48,13 @@ export interface GenerationRunMetadata {
48
48
  target?: string;
49
49
  }
50
50
 
51
+
52
+
51
53
  export interface ContentMetadata {
52
54
  // Common fields for all media types
53
55
  type?: ContentNature;
54
56
  size?: number; // in bytes
55
- language?: string;
57
+ languages?: string[];
56
58
  location?: Location;
57
59
  generation_runs: GenerationRunMetadata[];
58
60
  etag?: string;
@@ -81,6 +83,15 @@ export interface VideoMetadata extends TemporalMediaMetadata {
81
83
  export interface DocumentMetadata extends ContentMetadata {
82
84
  type: 'document';
83
85
  page_count?: number;
86
+ content_processor?: {
87
+ type?: string;
88
+ features_requested?: string[];
89
+ zones_requested?: string[];
90
+ table_count?: number;
91
+ image_count: number;
92
+ zone_count: number;
93
+ needs_ocr_count?: number;
94
+ }
84
95
  }
85
96
 
86
97
  export interface Transcript {
@@ -129,7 +140,6 @@ export interface ContentObjectItem<T = any> extends BaseObject {
129
140
  encoding: string; // the encoding used to calculate the tokens
130
141
  etag: string; //the etag of the text used for the token count
131
142
  };
132
- run?: string; // the ID of the interaction run that created the object
133
143
  }
134
144
 
135
145
  /**
@@ -177,18 +187,9 @@ export interface ColumnLayout {
177
187
  }
178
188
  export interface ContentObjectType extends ContentObjectTypeItem {
179
189
  object_schema?: Record<string, any>; // an optional JSON schema for the object properties.
180
- table_layout?: ColumnLayout[]; // an optional table layout for the object properties.
181
190
  }
182
191
  export interface ContentObjectTypeItem extends BaseObject {
183
192
  is_chunkable?: boolean;
184
- }
185
- /**
186
- * Used to list types with their table layout if any
187
- */
188
- export interface ContentObjectTypeLayout {
189
- id: string;
190
- name: string;
191
- description?: string;
192
193
  table_layout?: ColumnLayout[];
193
194
  }
194
195
 
@@ -9,32 +9,57 @@ export enum ContentEventName {
9
9
  }
10
10
 
11
11
 
12
- export interface WorkflowExecutionPayload {
13
- /**
14
- * The event which started the workflow who created the activity.
15
- */
16
- event: ContentEventName;
17
-
18
- /**
19
- * The ref of the user who initiated the workflow.
20
- */
21
- initiated_by: string;
12
+ export interface WorkflowExecutionBaseParams<T=Record<string, any>> {
13
+
14
+ /**
15
+ * The ref of the user who initiated the workflow.
16
+ */
17
+ initiated_by?: string;
18
+
19
+ /**
20
+ * The account ID of the user who created the activity.
21
+ * This is usefull to select the right database to work on.
22
+ */
23
+ account_id: string;
24
+
25
+ /**
26
+ * The project ID of the account who created the activity.
27
+ */
28
+ project_id: string;
29
+
30
+ /**
31
+ * The vars field is mainly used to pass the user input to the workflow.
32
+ * The user input ar custom user options that can be used to configure the workflow.
33
+ * You can see the user input as the arguments for a command line app.
34
+ *
35
+ * In the case of workflows started by events (e.g. using a a workflow rule) the user input vars will be initialized with the workflow rule configuration field.
36
+ *
37
+ * In case of dsl workflows the worflow execution payload vars will be applied over the default vars values stored in the DSL vars field.
38
+ */
39
+ vars: T;
40
+
41
+ /**
42
+ * Auth Token to access Zeno and Composable from the workers
43
+ */
44
+ auth_token?: string;
45
+
46
+ /**
47
+ * The configuration for the workflow execution.
48
+ */
49
+ config?: {
50
+ studio_url: string;
51
+ store_url: string;
52
+ enabled_integrations?: string[]; //list of enabled integrations
53
+ }
54
+
55
+ }
22
56
 
23
- /**
24
- * The account ID of the user who created the activity.
25
- * This is usefull to select the right database to work on.
26
- */
27
- account_id: string;
28
57
 
58
+ export interface WorkflowExecutionPayload<T=Record<string, any>> extends WorkflowExecutionBaseParams<T> {
29
59
  /**
30
- * The project ID of the account who created the activity.
31
- */
32
- project_id: string;
33
-
34
- /**
35
- * The Unix timestamp when the workflow was started.
60
+ * The event which started the workflow who created the activity.
36
61
  */
37
- timestamp: number;
62
+ event: ContentEventName;
38
63
 
39
64
  /*
40
65
  * The Workflow Rule ID if any. If the workflow was started by a rule this field will contain the rule ID
@@ -42,27 +67,17 @@ export interface WorkflowExecutionPayload {
42
67
  */
43
68
  wf_rule_name?: string;
44
69
 
45
- /**
46
- * The vars field is mainly used to pass the user input to the workflow.
47
- * The user input ar custom user options that can be used to configure the workflow.
48
- * You can see the user input as the arguments for a command line app.
49
- *
50
- * In the case of workflows started by events (e.g. using a a workflow rule) the user input vars will be initialized with the workflow rule configuration field.
51
- *
52
- * In case of dsl workflows the worflow execution payload vars will be applied over the default vars values stored in the DSL vars field.
53
- */
54
- vars: Record<string, any>;
55
-
56
- /**
57
- * Auth Token to access Zeno and Composable from the workers
58
- */
59
- auth_token: string;
60
-
61
70
  /**
62
71
  * The ID of the target objects processed by the workflow.
63
72
  */
64
73
  objectIds: string[];
65
74
 
75
+ /**
76
+ * Auth Token to access Zeno and Composable from the workers
77
+ */
78
+ auth_token: string;
79
+
80
+
66
81
  /**
67
82
  * The configuration for the workflow execution.
68
83
  */
@@ -88,6 +103,7 @@ export interface ListWorkflowRunsPayload {
88
103
  end?: string;
89
104
  status?: string;
90
105
  search_term?: string;
106
+ initiated_by?: string;
91
107
  }
92
108
 
93
109
  interface WorkflowRunEvent {
@@ -122,6 +138,7 @@ export interface WorkflowRun {
122
138
  execution_duration?: number,
123
139
  run_id?: string,
124
140
  workflow_id?: string,
141
+ initiated_by?: string,
125
142
  raw?: any
126
143
  }
127
144
 
package/src/user.ts CHANGED
@@ -31,6 +31,16 @@ export enum Datacenters {
31
31
  azure = 'azure'
32
32
  }
33
33
 
34
+ export enum BillingMethod {
35
+ stripe = 'stripe',
36
+ invoice ='invoice'
37
+ }
38
+
39
+
40
+ interface AccountBilling {
41
+ method: BillingMethod;
42
+ stripe_customer_id?: string;
43
+ }
34
44
  export interface Account {
35
45
  id: string;
36
46
  name: string;
@@ -49,6 +59,8 @@ export interface Account {
49
59
 
50
60
  datacenter: string;
51
61
 
62
+ billing: AccountBilling;
63
+
52
64
  created_by: string;
53
65
  updated_by: string;
54
66
  created_at: string;
@@ -58,6 +70,7 @@ export interface Account {
58
70
  export interface UpdateAccountPayload {
59
71
  name?: string;
60
72
  email_domains?: string[];
73
+ billing?: AccountBilling;
61
74
  }
62
75
 
63
76
  export interface AccountRef {
@@ -0,0 +1,32 @@
1
+ import mime from 'mime';
2
+
3
+
4
+ const ADVANCED_PROCESSING_PREFIX = 'magic-pdf';
5
+
6
+ export interface AdvancedProcessingObjectFileParams {
7
+ objectId: string;
8
+ fileId: string;
9
+ prefix?: string;
10
+ contentType?: string;
11
+ path?: any;
12
+ }
13
+
14
+ /**
15
+ *
16
+ * Advanced content processing only
17
+ * generate a file path based on object ID and file role
18
+ *
19
+ * @returns
20
+ */
21
+ export function getPathForAdvancedProcessingFile({ objectId, prefix, fileId, contentType }: AdvancedProcessingObjectFileParams) {
22
+
23
+ const extension = contentType ? `.${mime.getExtension(contentType)}` : '';
24
+ const p = prefix ? `${prefix}/` : '';
25
+
26
+ let path = `${ADVANCED_PROCESSING_PREFIX}/${objectId}/${p}${fileId}`;
27
+ if (!path.endsWith(extension)) {
28
+ path += extension;
29
+ }
30
+
31
+ return path;
32
+ }