@vertesia/workflow 1.1.0 → 1.1.1-dev.20260505.163000Z

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertesia/workflow",
3
- "version": "1.1.0",
3
+ "version": "1.1.1-dev.20260505.163000Z",
4
4
  "type": "module",
5
5
  "description": "Vertesia workflow DSL",
6
6
  "main": "./lib/esm/index.js",
@@ -18,7 +18,7 @@
18
18
  "@temporalio/testing": "^1.11.5",
19
19
  "@temporalio/worker": "^1.11.5",
20
20
  "@types/jsonwebtoken": "^9.0.10",
21
- "@types/node": "^25.6.0",
21
+ "@types/node": "^24.1.0",
22
22
  "@types/papaparse": "^5.5.1",
23
23
  "@types/tmp": "^0.2.6",
24
24
  "ts-dual-module": "^0.6.3",
@@ -43,11 +43,11 @@
43
43
  "tmp": "^0.2.4",
44
44
  "tmp-promise": "^3.0.3",
45
45
  "yaml": "^2.6.0",
46
- "@llumiverse/common": "1.1.0",
47
- "@vertesia/client": "1.1.0",
48
- "@vertesia/common": "1.1.0",
49
- "@vertesia/memory": "1.1.0",
50
- "@vertesia/api-fetch-client": "1.1.0"
46
+ "@llumiverse/common": "1.1.1-dev.20260505.151157Z",
47
+ "@vertesia/client": "1.1.1-dev.20260505.163000Z",
48
+ "@vertesia/api-fetch-client": "1.1.1-dev.20260505.163000Z",
49
+ "@vertesia/memory": "1.1.1-dev.20260505.163000Z",
50
+ "@vertesia/common": "1.1.1-dev.20260505.163000Z"
51
51
  },
52
52
  "ts_dual_module": {
53
53
  "outDir": "lib",
@@ -55,6 +55,7 @@
55
55
  "activities": "./activities/index.js",
56
56
  "dsl-activities": "./activities/index-dsl.js",
57
57
  "workflows": "./workflows",
58
+ "bulk-import": "./bulk-import",
58
59
  "workflows-bundle": "./workflows-bundle.js",
59
60
  "vars": "./vars"
60
61
  }
@@ -85,6 +86,11 @@
85
86
  "import": "./lib/esm/workflows.js",
86
87
  "require": "./lib/cjs/workflows.js"
87
88
  },
89
+ "./bulk-import": {
90
+ "types": "./lib/types/bulk-import.d.ts",
91
+ "import": "./lib/esm/bulk-import.js",
92
+ "require": "./lib/cjs/bulk-import.js"
93
+ },
88
94
  "./dsl": {
89
95
  "types": "./lib/types/dsl.d.ts",
90
96
  "import": "./lib/esm/dsl.js",
@@ -126,6 +132,9 @@
126
132
  "workflows": [
127
133
  "./lib/types/workflows.d.ts"
128
134
  ],
135
+ "bulk-import": [
136
+ "./lib/types/bulk-import.d.ts"
137
+ ],
129
138
  "dsl": [
130
139
  "./lib/types/dsl.d.ts"
131
140
  ],
@@ -0,0 +1,127 @@
1
+ import type {
2
+ CreateCollectionPayload,
3
+ CreateContentObjectPayload,
4
+ } from '@vertesia/common';
5
+
6
+ export enum ItemTypes {
7
+ CONTENT_OBJECT = 'ContentObject',
8
+ COLLECTION = 'Collection',
9
+ METADATA = 'Metadata',
10
+ STORAGE_OBJECT = 'StorageObject',
11
+ FILE = 'File',
12
+ }
13
+
14
+ export interface BaseItem {
15
+ kind: ItemTypes;
16
+ }
17
+
18
+ export interface ContentObjectSourceItem extends BaseItem {
19
+ kind: ItemTypes.CONTENT_OBJECT | ItemTypes.FILE;
20
+ object_id?: string;
21
+ data: CreateContentObjectPayload;
22
+ options: {
23
+ collection_id?: string;
24
+ };
25
+ }
26
+
27
+ export interface CollectionSourceItem extends BaseItem {
28
+ kind: ItemTypes.COLLECTION;
29
+ object_id?: string;
30
+ data: CreateCollectionPayload;
31
+ }
32
+
33
+ export interface MetadataSourceItem extends BaseItem {
34
+ kind: ItemTypes.METADATA;
35
+ object_id?: string;
36
+ data: Omit<CreateContentObjectPayload, 'content'>;
37
+ options: {
38
+ collection_id?: string;
39
+ };
40
+ }
41
+
42
+ export interface StorageObjectSourceItem extends BaseItem {
43
+ kind: ItemTypes.STORAGE_OBJECT;
44
+ filename: string;
45
+ targetPath: string;
46
+ sourceUrl: string;
47
+ mimeType: string;
48
+ }
49
+
50
+ export type SourceItem =
51
+ | ContentObjectSourceItem
52
+ | CollectionSourceItem
53
+ | MetadataSourceItem
54
+ | StorageObjectSourceItem;
55
+
56
+ export interface SourceItemBatch {
57
+ index: number;
58
+ files: SourceItem[];
59
+ }
60
+
61
+ export interface SourceItemBatches {
62
+ batches: SourceItemBatch[];
63
+ }
64
+
65
+ export interface BatchGenerationParams {
66
+ batchSize?: number;
67
+ startPosition: number;
68
+ endPosition: number;
69
+ }
70
+
71
+ export interface ImportedSourceItem<T extends BaseItem = SourceItem> {
72
+ id: string;
73
+ item: T;
74
+ isUpdate: boolean;
75
+ }
76
+
77
+ export interface PartitionGenerationParams {
78
+ partitionSize: number;
79
+ }
80
+
81
+ export interface Partition {
82
+ size: number;
83
+ startPosition: number;
84
+ endPosition: number;
85
+ }
86
+
87
+ export interface Partitions {
88
+ totalSize: number;
89
+ partitions: Partition[];
90
+ }
91
+
92
+ export interface BulkImportParams {
93
+ maxConcurrentBatches?: number;
94
+ maxConcurrentPartitions?: number;
95
+ batchSize?: number;
96
+ partitionSize?: number;
97
+ dryRun?: boolean;
98
+ updateByContentSource?: boolean;
99
+ }
100
+
101
+ export interface PartitionError {
102
+ partitionIndex: number;
103
+ errorCount: number;
104
+ }
105
+
106
+ export interface BulkImportResult {
107
+ totalItems: number;
108
+ processedItems: number;
109
+ createdItems: number;
110
+ updatedItems: number;
111
+ totalBatches: number;
112
+ completedBatches: number;
113
+ errors: PartitionError[];
114
+ resultUri: string;
115
+ }
116
+
117
+ export interface BatchError {
118
+ batchIndex: number;
119
+ index: number;
120
+ item: SourceItem;
121
+ msg: string;
122
+ }
123
+
124
+ export interface AssembledResults {
125
+ importedItems: ImportedSourceItem[];
126
+ errors: BatchError[];
127
+ }