@openfn/project 0.12.0 → 0.12.1

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.d.ts CHANGED
@@ -58,6 +58,7 @@ declare class Workflow {
58
58
  getUUIDMap(): Record<string, string>;
59
59
  getVersionHash(): string;
60
60
  pushHistory(versionHash: string): void;
61
+ get history(): string[];
61
62
  canMergeInto(target: Workflow): boolean;
62
63
  }
63
64
 
@@ -108,6 +109,8 @@ declare class Workspace {
108
109
  constructor(workspacePath: string, logger?: Logger, validate?: boolean);
109
110
  loadProject(): void;
110
111
  list(): Project[];
112
+ get projectsPath(): string;
113
+ get workflowsPath(): string;
111
114
  /** Get a project by its alias, id or UUID. Can also include a UUID */
112
115
  get(nameyThing: string): Project | null;
113
116
  getProjectPath(id: string): string | undefined;
package/dist/index.js CHANGED
@@ -236,6 +236,9 @@ var Workflow = class {
236
236
  pushHistory(versionHash) {
237
237
  this.workflow.history?.push(versionHash);
238
238
  }
239
+ get history() {
240
+ return this.workflow.history ?? [];
241
+ }
239
242
  // return true if the current workflow can be merged into the target workflow without losing any changes
240
243
  canMergeInto(target) {
241
244
  const thisHistory = this.workflow.history?.concat(this.getVersionHash()) ?? [];
@@ -934,7 +937,7 @@ function baseMerge(target, source, sourceKeys, assigns = {}) {
934
937
  return assign(target, { ...pickedSource, ...assigns });
935
938
  }
936
939
 
937
- // src/merge/merge-node.ts
940
+ // src/merge/merge-workflow.ts
938
941
  var clone2 = (obj) => JSON.parse(JSON.stringify(obj));
939
942
  function mergeWorkflows(source, target, mappings) {
940
943
  const targetNodes = {};
@@ -979,6 +982,7 @@ function mergeWorkflows(source, target, mappings) {
979
982
  return {
980
983
  ...target,
981
984
  ...newSource,
985
+ history: source.history ?? target.history,
982
986
  openfn: {
983
987
  ...target.openfn,
984
988
  ...source.openfn,
@@ -1623,6 +1627,12 @@ var Workspace = class {
1623
1627
  list() {
1624
1628
  return this.projects;
1625
1629
  }
1630
+ get projectsPath() {
1631
+ return path4.join(this.root, this.config.dirs.projects);
1632
+ }
1633
+ get workflowsPath() {
1634
+ return path4.join(this.root, this.config.dirs.workflows);
1635
+ }
1626
1636
  /** Get a project by its alias, id or UUID. Can also include a UUID */
1627
1637
  get(nameyThing) {
1628
1638
  return match_project_default(nameyThing, this.projects);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfn/project",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "Read, serialize, replicate and sync OpenFn projects",
5
5
  "type": "module",
6
6
  "exports": {