@constructor-io/constructorio-connect-cli 1.9.1 → 1.9.2

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.
@@ -26,6 +26,10 @@ export declare class Execute extends Command {
26
26
  static examples: string[];
27
27
  input: ExecuteInputFlags;
28
28
  run(): Promise<void>;
29
+ /**
30
+ * Returns the template type, which is always equal to the folder name of the template path.
31
+ */
32
+ private getTemplateType;
29
33
  private parseFlags;
30
34
  private getTemplateExecInput;
31
35
  private calculateConnectionId;
@@ -1 +1 @@
1
- {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../src/commands/execute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,OAAO,EAAE,MAAM,aAAa,CAAC;AA6B7C,eAAO,MAAM,qBAAqB;;;;;CAKxB,CAAC;AAEX;;;GAGG;AACH,UAAU,iBAAiB;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAYD,qBAAa,OAAQ,SAAQ,OAAO;IAClC,MAAM,CAAC,KAAK;;;;;MAgBV;IAEF,MAAM,CAAC,WAAW,SACkK;IAEpL,MAAM,CAAC,QAAQ,WAOb;IAEF,KAAK,EAAE,iBAAiB,CAAM;IAExB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;YA+BZ,UAAU;YAsBV,oBAAoB;YA+CpB,qBAAqB;YA0BrB,wBAAwB;CAevC"}
1
+ {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../src/commands/execute.ts"],"names":[],"mappings":"AAEA,OAAO,EAAS,OAAO,EAAE,MAAM,aAAa,CAAC;AA6B7C,eAAO,MAAM,qBAAqB;;;;;CAKxB,CAAC;AAEX;;;GAGG;AACH,UAAU,iBAAiB;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAYD,qBAAa,OAAQ,SAAQ,OAAO;IAClC,MAAM,CAAC,KAAK;;;;;MAgBV;IAEF,MAAM,CAAC,WAAW,SACkK;IAEpL,MAAM,CAAC,QAAQ,WAOb;IAEF,KAAK,EAAE,iBAAiB,CAAM;IAExB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAgC1B;;OAEG;IACH,OAAO,CAAC,eAAe;YAKT,UAAU;YAsBV,oBAAoB;YA+CpB,qBAAqB;YA0BrB,wBAAwB;CAevC"}
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.Execute = exports.executePromptMessages = void 0;
7
+ const os_1 = __importDefault(require("os"));
4
8
  const core_1 = require("@oclif/core");
5
9
  const errors_1 = require("@oclif/core/lib/errors");
6
10
  const file_loaders_1 = require("../helpers/file-loaders");
@@ -63,6 +67,7 @@ class Execute extends core_1.Command {
63
67
  ? (0, file_loaders_1.getExternalDataFixture)(templateInput.externalDataPath)
64
68
  : {},
65
69
  connectionId: templateInput.connectionId,
70
+ templateType: this.getTemplateType(templateInput.templatePath),
66
71
  });
67
72
  (0, render_template_result_1.renderTemplateResult)(result);
68
73
  if (!result?.success) {
@@ -73,6 +78,13 @@ class Execute extends core_1.Command {
73
78
  (0, render_repeat_input_1.renderRepeatInput)(this, this.input);
74
79
  }
75
80
  }
81
+ /**
82
+ * Returns the template type, which is always equal to the folder name of the template path.
83
+ */
84
+ getTemplateType(templatePath) {
85
+ const platformFileDelimiter = os_1.default.platform() === "win32" ? "\\" : "/";
86
+ return templatePath.split(platformFileDelimiter)?.[0];
87
+ }
76
88
  async parseFlags() {
77
89
  const { flags } = await this.parse(Execute);
78
90
  if (flags["template-path"]) {
@@ -1 +1 @@
1
- {"version":3,"file":"execute-template.d.ts","sourceRoot":"","sources":["../../src/functions/execute-template.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,YAAY,qEAMf,CAAC;AAEX,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,mBAAmB,gCAoBjE"}
1
+ {"version":3,"file":"execute-template.d.ts","sourceRoot":"","sources":["../../src/functions/execute-template.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,YAAY,qEAMf,CAAC;AAEX,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,mBAAmB,gCAqBjE"}
@@ -39,6 +39,7 @@ async function executeTemplate(options) {
39
39
  template: (0, file_loaders_1.getJSONataTemplate)(name).toString(),
40
40
  helpers: (await (0, template_source_code_1.getHelpersSourceCode)(config.helpers)) ?? "",
41
41
  connectionId: connection.id,
42
+ templateType: options.type,
42
43
  targetData: fixture,
43
44
  showLogs: false,
44
45
  externalData,
@@ -1,11 +1,12 @@
1
1
  import { type TemplateExecutionSuccessResponse, type TemplateExecutionErrorResponse } from "../types";
2
- export declare function sendTemplateExecuteRequest({ template, helpers, targetData, externalData, connectionId, showLogs, }: Args): Promise<TemplateExecutionSuccessResponse | TemplateExecutionErrorResponse>;
2
+ export declare function sendTemplateExecuteRequest({ template, helpers, targetData, externalData, connectionId, templateType, showLogs, }: Args): Promise<TemplateExecutionSuccessResponse | TemplateExecutionErrorResponse>;
3
3
  interface Args {
4
4
  template: string;
5
5
  helpers: string;
6
6
  targetData: any;
7
7
  externalData: any;
8
8
  connectionId: string;
9
+ templateType: string;
9
10
  showLogs?: boolean;
10
11
  }
11
12
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"send-template-execute-request.d.ts","sourceRoot":"","sources":["../../src/http/send-template-execute-request.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,gCAAgC,EACrC,KAAK,8BAA8B,EACpC,MAAM,UAAU,CAAC;AAIlB,wBAAsB,0BAA0B,CAAC,EAC/C,QAAQ,EACR,OAAO,EACP,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,QAAe,GAChB,EAAE,IAAI,GAAG,OAAO,CACf,gCAAgC,GAAG,8BAA8B,CAClE,CA6BA;AAED,UAAU,IAAI;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,GAAG,CAAC;IAChB,YAAY,EAAE,GAAG,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
1
+ {"version":3,"file":"send-template-execute-request.d.ts","sourceRoot":"","sources":["../../src/http/send-template-execute-request.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,gCAAgC,EACrC,KAAK,8BAA8B,EACpC,MAAM,UAAU,CAAC;AAIlB,wBAAsB,0BAA0B,CAAC,EAC/C,QAAQ,EACR,OAAO,EACP,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,QAAe,GAChB,EAAE,IAAI,GAAG,OAAO,CACf,gCAAgC,GAAG,8BAA8B,CAClE,CA8BA;AAED,UAAU,IAAI;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,GAAG,CAAC;IAChB,YAAY,EAAE,GAAG,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
@@ -5,15 +5,16 @@ const axios_1 = require("axios");
5
5
  const errors_1 = require("@oclif/core/lib/errors");
6
6
  const ux_action_1 = require("../helpers/ux-action");
7
7
  const http_client_1 = require("./http-client");
8
- async function sendTemplateExecuteRequest({ template, helpers, targetData, externalData, connectionId, showLogs = true, }) {
8
+ async function sendTemplateExecuteRequest({ template, helpers, targetData, externalData, connectionId, templateType, showLogs = true, }) {
9
9
  const client = await (0, http_client_1.getHttpClient)();
10
10
  const httpRequest = async () => {
11
11
  return (await client.patch("templates/standalone/execute", {
12
- raw_template: template,
13
12
  helpers,
13
+ raw_template: template,
14
14
  target_data: targetData,
15
15
  external_data: externalData,
16
16
  connection_id: connectionId,
17
+ template_type: templateType,
17
18
  })).data;
18
19
  };
19
20
  try {
package/dist/version.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- declare const _default: "1.9.1";
1
+ declare const _default: "1.9.2";
2
2
  export default _default;
3
3
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = '1.9.1';
3
+ exports.default = '1.9.2';
@@ -171,5 +171,5 @@
171
171
  ]
172
172
  }
173
173
  },
174
- "version": "1.9.1"
174
+ "version": "1.9.2"
175
175
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructor-io/constructorio-connect-cli",
3
- "version": "1.9.1",
3
+ "version": "1.9.2",
4
4
  "description": "CLI tool to enable users to interface with the Constructor Connect Ecosystem",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -82,7 +82,7 @@
82
82
  "@types/mock-fs": "^4.13.4",
83
83
  "cross-env": "^7.0.3",
84
84
  "eslint": "^8.57.0",
85
- "eslint-config-prettier": "^9.1.0",
85
+ "eslint-config-prettier": "^10.0.1",
86
86
  "eslint-config-standard-with-typescript": "^43.0.1",
87
87
  "eslint-plugin-import": "^2.29.1",
88
88
  "eslint-plugin-prettier": "^5.1.3",