@openfn/project 0.8.1 → 0.9.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.
- package/dist/index.js +22 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -286,6 +286,10 @@ function jsonToYaml(json) {
|
|
|
286
286
|
}
|
|
287
287
|
|
|
288
288
|
// src/serialize/to-app-state.ts
|
|
289
|
+
var defaultJobProps = {
|
|
290
|
+
keychain_credential_id: null,
|
|
291
|
+
project_credential_id: null
|
|
292
|
+
};
|
|
289
293
|
function to_app_state_default(project, options = {}) {
|
|
290
294
|
const { uuid, endpoint, env, ...rest } = project.openfn ?? {};
|
|
291
295
|
const state = omitBy(
|
|
@@ -341,12 +345,10 @@ var mapWorkflow = (workflow) => {
|
|
|
341
345
|
node = omitBy(pick(s, ["name", "adaptor"]), isNil);
|
|
342
346
|
const { uuid: uuid2, ...otherOpenFnProps } = s.openfn ?? {};
|
|
343
347
|
node.id = uuid2;
|
|
344
|
-
Object.assign(node, otherOpenFnProps);
|
|
345
348
|
if (s.expression) {
|
|
346
349
|
node.body = s.expression;
|
|
347
350
|
}
|
|
348
|
-
node
|
|
349
|
-
node.keychain_credential_id = null;
|
|
351
|
+
Object.assign(node, defaultJobProps, otherOpenFnProps);
|
|
350
352
|
wfState.jobs.push(node);
|
|
351
353
|
}
|
|
352
354
|
Object.keys(s.next ?? {}).forEach((next) => {
|
|
@@ -1400,6 +1402,17 @@ import { readFileSync as readFileSync2 } from "node:fs";
|
|
|
1400
1402
|
import { grammar } from "ohm-js";
|
|
1401
1403
|
import { isNil as isNil3, set } from "lodash-es";
|
|
1402
1404
|
var parser;
|
|
1405
|
+
var expectedNodeProps = [
|
|
1406
|
+
// TODO need to clarify adaptor/adaptors confusion
|
|
1407
|
+
"adaptor",
|
|
1408
|
+
"adaptors",
|
|
1409
|
+
"expression",
|
|
1410
|
+
"condition",
|
|
1411
|
+
"label",
|
|
1412
|
+
"type",
|
|
1413
|
+
"disabled",
|
|
1414
|
+
"name"
|
|
1415
|
+
];
|
|
1403
1416
|
var initOperations = (options = {}) => {
|
|
1404
1417
|
let nodes = {};
|
|
1405
1418
|
const uuidMap = options.uuidMap ?? {};
|
|
@@ -1473,7 +1486,12 @@ var initOperations = (options = {}) => {
|
|
|
1473
1486
|
const name = nameNode.sourceString;
|
|
1474
1487
|
const node = buildNode(name);
|
|
1475
1488
|
props.buildWorkflow().forEach(([key, value]) => {
|
|
1476
|
-
|
|
1489
|
+
if (expectedNodeProps.includes(key)) {
|
|
1490
|
+
nodes[name][key] = value;
|
|
1491
|
+
} else {
|
|
1492
|
+
nodes[name].openfn ??= {};
|
|
1493
|
+
nodes[name].openfn[key] = value;
|
|
1494
|
+
}
|
|
1477
1495
|
});
|
|
1478
1496
|
return node;
|
|
1479
1497
|
},
|