@openfn/cli 1.5.0 → 1.6.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.js CHANGED
@@ -401,6 +401,13 @@ var skipAdaptorValidation = {
401
401
  default: false
402
402
  }
403
403
  };
404
+ var snapshots = {
405
+ name: "snapshots",
406
+ yargs: {
407
+ description: "List of snapshot ids to pull",
408
+ array: true
409
+ }
410
+ };
404
411
  var statePath = {
405
412
  name: "state-path",
406
413
  yargs: {
@@ -679,7 +686,14 @@ var command_default7 = {
679
686
  };
680
687
 
681
688
  // src/pull/command.ts
682
- var options7 = [statePath, projectPath, configPath, log, logJson];
689
+ var options7 = [
690
+ statePath,
691
+ projectPath,
692
+ configPath,
693
+ log,
694
+ logJson,
695
+ snapshots
696
+ ];
683
697
  var pullCommand = {
684
698
  command: "pull [projectId]",
685
699
  describe: "Pull a project's state and spec from a Lightning Instance to the local directory",
@@ -1542,7 +1542,11 @@ async function pullHandler(options, logger) {
1542
1542
  logger.always(
1543
1543
  "Downloading existing project state (as JSON) from the server."
1544
1544
  );
1545
- const { data: project } = await getProject(config, options.projectId);
1545
+ const { data: project } = await getProject(
1546
+ config,
1547
+ options.projectId,
1548
+ options.snapshots
1549
+ );
1546
1550
  if (!project) {
1547
1551
  logger.error("ERROR: Project not found.");
1548
1552
  logger.warn(
@@ -1557,8 +1561,13 @@ async function pullHandler(options, logger) {
1557
1561
  JSON.stringify(state, null, 2)
1558
1562
  );
1559
1563
  logger.always("Downloading the project spec (as YAML) from the server.");
1564
+ const queryParams = new URLSearchParams();
1565
+ queryParams.append("id", options.projectId);
1566
+ options.snapshots?.forEach(
1567
+ (snapshot) => queryParams.append("snapshots[]", snapshot)
1568
+ );
1560
1569
  const url2 = new URL(
1561
- `api/provision/yaml?id=${options.projectId}`,
1570
+ `api/provision/yaml?${queryParams.toString()}`,
1562
1571
  config.endpoint
1563
1572
  );
1564
1573
  logger.debug("Fetching project spec from", url2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfn/cli",
3
- "version": "1.5.0",
3
+ "version": "1.6.1",
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.1.4",
51
- "@openfn/logger": "1.0.1",
52
- "@openfn/runtime": "1.4.0",
51
+ "@openfn/deploy": "0.5.0",
53
52
  "@openfn/describe-package": "0.1.0",
54
- "@openfn/deploy": "0.4.7"
53
+ "@openfn/logger": "1.0.1",
54
+ "@openfn/runtime": "1.4.0"
55
55
  },
56
56
  "files": [
57
57
  "dist",