@things-factory/dataset 6.1.63 → 6.1.66
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": "@things-factory/dataset",
|
3
|
-
"version": "6.1.
|
3
|
+
"version": "6.1.66",
|
4
4
|
"main": "dist-server/index.js",
|
5
5
|
"browser": "dist-client/index.js",
|
6
6
|
"things-factory": true,
|
@@ -36,19 +36,19 @@
|
|
36
36
|
"@operato/shell": "^1.0.1",
|
37
37
|
"@operato/styles": "^1.0.0",
|
38
38
|
"@operato/utils": "^1.0.1",
|
39
|
-
"@things-factory/auth-base": "^6.1.
|
40
|
-
"@things-factory/aws-base": "^6.1.
|
41
|
-
"@things-factory/board-service": "^6.1.
|
42
|
-
"@things-factory/env": "^6.1.
|
43
|
-
"@things-factory/organization": "^6.1.
|
44
|
-
"@things-factory/scheduler-client": "^6.1.
|
45
|
-
"@things-factory/shell": "^6.1.
|
46
|
-
"@things-factory/work-shift": "^6.1.
|
47
|
-
"@things-factory/worklist": "^6.1.
|
39
|
+
"@things-factory/auth-base": "^6.1.66",
|
40
|
+
"@things-factory/aws-base": "^6.1.66",
|
41
|
+
"@things-factory/board-service": "^6.1.66",
|
42
|
+
"@things-factory/env": "^6.1.66",
|
43
|
+
"@things-factory/organization": "^6.1.66",
|
44
|
+
"@things-factory/scheduler-client": "^6.1.66",
|
45
|
+
"@things-factory/shell": "^6.1.66",
|
46
|
+
"@things-factory/work-shift": "^6.1.66",
|
47
|
+
"@things-factory/worklist": "^6.1.66",
|
48
48
|
"cron-parser": "^4.3.0",
|
49
49
|
"moment-timezone": "^0.5.40",
|
50
50
|
"simple-statistics": "^7.8.3",
|
51
51
|
"statistics": "^3.3.0"
|
52
52
|
},
|
53
|
-
"gitHead": "
|
53
|
+
"gitHead": "86447edc189a8432999c6dcfce0e32ee7dbd3e5f"
|
54
54
|
}
|
@@ -124,33 +124,35 @@ export async function createDataSample(dataSample: NewDataSample, context: Resol
|
|
124
124
|
for (let files of filesArray) {
|
125
125
|
let paths = []
|
126
126
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
127
|
+
if (files instanceof Array) {
|
128
|
+
for (let file of files) {
|
129
|
+
if (file) {
|
130
|
+
const attachment = await createAttachment(
|
131
|
+
null,
|
132
|
+
{
|
133
|
+
attachment: {
|
134
|
+
file: file.file,
|
135
|
+
refType: DataSample.name
|
136
|
+
}
|
137
|
+
},
|
138
|
+
context
|
139
|
+
)
|
140
|
+
|
141
|
+
const fetched = await tx.getRepository(Attachment).findOneBy({ id: attachment.id })
|
142
|
+
if (fetched) {
|
143
|
+
attachments.push(fetched)
|
144
|
+
paths.push({
|
145
|
+
id: fetched.id,
|
146
|
+
mimetype: fetched.mimetype,
|
147
|
+
name: fetched.name,
|
148
|
+
fullpath: fetched.fullpath
|
149
|
+
})
|
150
|
+
} else {
|
151
|
+
throw `Failed to save file(${attachment.name})`
|
152
|
+
}
|
149
153
|
} else {
|
150
|
-
|
154
|
+
paths.push(null)
|
151
155
|
}
|
152
|
-
} else {
|
153
|
-
paths.push(null)
|
154
156
|
}
|
155
157
|
}
|
156
158
|
|