@openfn/cli 1.7.1 → 1.8.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.
@@ -1526,7 +1526,8 @@ import {
1526
1526
  getConfig as getConfig2,
1527
1527
  getProject,
1528
1528
  getSpec,
1529
- getStateFromProjectPayload
1529
+ getStateFromProjectPayload,
1530
+ syncRemoteSpec
1530
1531
  } from "@openfn/deploy";
1531
1532
  async function pullHandler(options, logger) {
1532
1533
  try {
@@ -1556,10 +1557,6 @@ async function pullHandler(options, logger) {
1556
1557
  process.exit(1);
1557
1558
  }
1558
1559
  const state = getStateFromProjectPayload(project);
1559
- await fs4.writeFile(
1560
- path7.resolve(config.statePath),
1561
- JSON.stringify(state, null, 2)
1562
- );
1563
1560
  logger.always("Downloading the project spec (as YAML) from the server.");
1564
1561
  const queryParams = new URLSearchParams();
1565
1562
  queryParams.append("id", options.projectId);
@@ -1587,7 +1584,17 @@ async function pullHandler(options, logger) {
1587
1584
  }
1588
1585
  const resolvedPath = path7.resolve(config.specPath);
1589
1586
  logger.debug("reading spec from", resolvedPath);
1590
- await fs4.writeFile(resolvedPath, res.body);
1587
+ const updatedSpec = await syncRemoteSpec(
1588
+ await res.text(),
1589
+ state,
1590
+ config,
1591
+ logger
1592
+ );
1593
+ await fs4.writeFile(
1594
+ path7.resolve(config.statePath),
1595
+ JSON.stringify(state, null, 2)
1596
+ );
1597
+ await fs4.writeFile(resolvedPath, updatedSpec);
1591
1598
  const spec = await getSpec(resolvedPath);
1592
1599
  if (spec.errors.length > 0) {
1593
1600
  logger.error("ERROR: invalid spec");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfn/cli",
3
- "version": "1.7.1",
3
+ "version": "1.8.0",
4
4
  "description": "CLI devtools for the openfn toolchain.",
5
5
  "engines": {
6
6
  "node": ">=18",
@@ -48,10 +48,10 @@
48
48
  "ws": "^8.14.1",
49
49
  "yargs": "^17.7.2",
50
50
  "@openfn/compiler": "0.3.0",
51
- "@openfn/deploy": "0.5.0",
51
+ "@openfn/deploy": "0.6.0",
52
52
  "@openfn/describe-package": "0.1.0",
53
- "@openfn/runtime": "1.4.1",
54
- "@openfn/logger": "1.0.1"
53
+ "@openfn/logger": "1.0.1",
54
+ "@openfn/runtime": "1.4.1"
55
55
  },
56
56
  "files": [
57
57
  "dist",