@coherentglobal/wasm-runner 0.0.65 → 0.0.67
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.
|
@@ -128,9 +128,9 @@ try {
|
|
|
128
128
|
|
|
129
129
|
let isAsync = typeof instance._is_async === 'function' && instance._is_async(wb);
|
|
130
130
|
|
|
131
|
-
|
|
132
|
-
const isMetadataSubSvc =
|
|
133
|
-
const isFormSpecSubSvc =
|
|
131
|
+
const hasSubServices = req?.request_meta?.service_category && req?.request_meta?.service_category.split(',').map(d => d.toLowerCase())
|
|
132
|
+
const isMetadataSubSvc = hasSubServices.some(c => c === 'metadata') && metadata !== undefined;
|
|
133
|
+
const isFormSpecSubSvc = hasSubServices.some(c => c === 'formspec') && formspec !== undefined;
|
|
134
134
|
const isAsyncCheck = isAsync === 1 || isAsync === true || isAsync === 'true'
|
|
135
135
|
|
|
136
136
|
let result
|
|
@@ -156,15 +156,16 @@ try {
|
|
|
156
156
|
result.response_data = {}
|
|
157
157
|
}
|
|
158
158
|
const imageOutputs = metadata.ImageOutputs.reduce( (prev, curr) => {
|
|
159
|
-
if(!curr
|
|
160
|
-
prev[curr.ImageName] = curr
|
|
159
|
+
if(!curr?.ImageName) return prev
|
|
160
|
+
prev[curr.ImageName] = curr?.Base64Content || ""
|
|
161
161
|
return prev
|
|
162
162
|
}, {})
|
|
163
163
|
const metadataOutput = {
|
|
164
164
|
...metadata?.Outputs,
|
|
165
|
-
...imageOutputs
|
|
165
|
+
...imageOutputs,
|
|
166
|
+
...result.response_data.outputs
|
|
166
167
|
}
|
|
167
|
-
result.response_data.outputs = Object.assign({},
|
|
168
|
+
result.response_data.outputs = Object.assign({}, metadataOutput);
|
|
168
169
|
return rawString ? JSON.stringify(result) : result;
|
|
169
170
|
}
|
|
170
171
|
|
|
@@ -204,15 +205,16 @@ try {
|
|
|
204
205
|
result.response_data = {}
|
|
205
206
|
}
|
|
206
207
|
const imageOutputs = metadata.ImageOutputs.reduce( (prev, curr) => {
|
|
207
|
-
if(!curr
|
|
208
|
-
prev[curr.ImageName] = curr
|
|
208
|
+
if(!curr?.ImageName) return prev
|
|
209
|
+
prev[curr.ImageName] = curr?.Base64Content || ""
|
|
209
210
|
return prev
|
|
210
211
|
}, {})
|
|
211
212
|
const metadataOutput = {
|
|
212
213
|
...metadata?.Outputs,
|
|
213
|
-
...imageOutputs
|
|
214
|
+
...imageOutputs,
|
|
215
|
+
...result.response_data.outputs
|
|
214
216
|
}
|
|
215
|
-
result.response_data.outputs = Object.assign({},
|
|
217
|
+
result.response_data.outputs = Object.assign({}, metadataOutput);
|
|
216
218
|
return rawString ? JSON.stringify(result) : result;
|
|
217
219
|
}
|
|
218
220
|
|
|
@@ -252,15 +254,16 @@ try {
|
|
|
252
254
|
result.response_data = {}
|
|
253
255
|
}
|
|
254
256
|
const imageOutputs = metadata.ImageOutputs.reduce( (prev, curr) => {
|
|
255
|
-
if(!curr
|
|
256
|
-
prev[curr.ImageName] = curr
|
|
257
|
+
if(!curr?.ImageName) return prev
|
|
258
|
+
prev[curr.ImageName] = curr?.Base64Content || ""
|
|
257
259
|
return prev
|
|
258
260
|
}, {})
|
|
259
261
|
const metadataOutput = {
|
|
260
262
|
...metadata?.Outputs,
|
|
261
|
-
...imageOutputs
|
|
263
|
+
...imageOutputs,
|
|
264
|
+
...result.response_data.outputs
|
|
262
265
|
}
|
|
263
|
-
result.response_data.outputs = Object.assign({},
|
|
266
|
+
result.response_data.outputs = Object.assign({}, metadataOutput);
|
|
264
267
|
return rawString ? JSON.stringify(result) : result;
|
|
265
268
|
}
|
|
266
269
|
|