@constructor-io/constructorio-connect-cli 1.13.2 → 1.14.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.
Files changed (33) hide show
  1. package/boilerplate-repo/.vscode/launch.json +2 -2
  2. package/boilerplate-repo/.vscode/tasks.json +1 -1
  3. package/boilerplate-repo/README.md +7 -7
  4. package/dist/commands/execute.d.ts +1 -1
  5. package/dist/commands/execute.d.ts.map +1 -1
  6. package/dist/commands/execute.js +7 -7
  7. package/dist/functions/execute-template.d.ts +2 -2
  8. package/dist/functions/execute-template.d.ts.map +1 -1
  9. package/dist/functions/execute-template.js +6 -6
  10. package/dist/helpers/build-config-file.d.ts +3 -4
  11. package/dist/helpers/build-config-file.d.ts.map +1 -1
  12. package/dist/helpers/file-loaders.d.ts +1 -1
  13. package/dist/helpers/file-loaders.d.ts.map +1 -1
  14. package/dist/helpers/file-loaders.js +2 -2
  15. package/dist/helpers/generate-command-input.js +1 -1
  16. package/dist/http/get-connections-request.d.ts +2 -17
  17. package/dist/http/get-connections-request.d.ts.map +1 -1
  18. package/dist/http/send-template-execute-request.d.ts +3 -3
  19. package/dist/http/send-template-execute-request.d.ts.map +1 -1
  20. package/dist/http/send-template-execute-request.js +3 -3
  21. package/dist/prompt-data/filter-connections-by-template.d.ts +2 -3
  22. package/dist/prompt-data/filter-connections-by-template.d.ts.map +1 -1
  23. package/dist/prompt-data/get-external-data-files.d.ts +1 -1
  24. package/dist/prompt-data/get-external-data-files.d.ts.map +1 -1
  25. package/dist/prompt-data/get-external-data-files.js +2 -2
  26. package/dist/prompt-data/select-connections.d.ts +1 -1
  27. package/dist/prompt-data/select-connections.d.ts.map +1 -1
  28. package/dist/types.d.ts +16 -0
  29. package/dist/types.d.ts.map +1 -1
  30. package/dist/version.d.ts +1 -1
  31. package/dist/version.js +1 -1
  32. package/oclif.manifest.json +1 -1
  33. package/package.json +2 -2
@@ -4,9 +4,9 @@
4
4
  {
5
5
  "type": "node",
6
6
  "request": "launch",
7
- "program": "${file}",
7
+ "args": ["--version"], // We're bypassing the debugger to get straight to our task - which is the only way to execute js by hitting F5
8
8
  "name": "Execute template",
9
- "preLaunchTask": "Execute template",
9
+ "postDebugTask": "Execute template", // We do it after so the "node --version" output is not even shown
10
10
  "skipFiles": ["<node_internals>/**"]
11
11
  }
12
12
  ]
@@ -5,7 +5,7 @@
5
5
  "label": "Execute template",
6
6
  "type": "shell",
7
7
  "command": "npm",
8
- "args": ["run", "execute", "--", "--template-path=${file}"],
8
+ "args": ["run", "execute", "--", "--template-path=\"${file}\""],
9
9
  "group": {
10
10
  "kind": "test",
11
11
  "isDefault": true
@@ -207,7 +207,7 @@ EXAMPLES
207
207
 
208
208
  To implement your very own transformers, you just need to edit the `.jsonata` files inside the `templates` folder.
209
209
 
210
- Keep in mind that the template will have access to `externalData` and `targetData`. You can use the `targetData` to access the data that is being ingested, and `externalData` to access the data available in the connector.
210
+ Keep in mind that the template will have access to `external` and `data`. You can use the `data` to access the data that is being ingested, and `external` to access the data available in the connector.
211
211
 
212
212
  Note that all template files must return the expected data types. To know which properties you can override inside `item`, `variation` or `item_group`, take a look into the type definitions:
213
213
 
@@ -227,7 +227,7 @@ We can make this happen returning `{ "remove": true }` whenever we find an item
227
227
  (
228
228
  /* item.jsonata */
229
229
 
230
- targetData.visible
230
+ data.visible
231
231
  ? { "active": true } /* Visible = true => we simply ingest it as an active item */
232
232
  : { "remove": true } /* Visible = false => we don't even ingest it */
233
233
  )
@@ -299,7 +299,7 @@ In the `templates/item.jsonata` file, you can customize how items are transforme
299
299
  "metadata": [
300
300
  {
301
301
  "key": 'id',
302
- "value": targetData.id
302
+ "value": data.id
303
303
  }
304
304
  ]
305
305
  }
@@ -351,8 +351,8 @@ In the `templates/grouping.jsonata` file, you can customize how item groups are
351
351
  ```js
352
352
  /* grouping.jsonata */
353
353
  (
354
- $color := targetData.color;
355
- $id := targetData.id;
354
+ $color := data.color;
355
+ $id := data.id;
356
356
 
357
357
  {
358
358
  "id": $join([$id, '-', $color]);
@@ -365,8 +365,8 @@ We also need to update variations to point to the correct item:
365
365
  ```js
366
366
  /* variation.jsonata */
367
367
  {
368
- $color := targetData.color;
369
- $parentId := targetData.parent.id;
368
+ $color := data.color;
369
+ $parentId := data.parent.id;
370
370
 
371
371
  {
372
372
  "item_id": $join([$parentId, '-', $color]);
@@ -2,7 +2,7 @@ import { RefreshConnectionsCommand } from "./refresh-connections-command";
2
2
  export declare const executePromptMessages: {
3
3
  readonly template: "Select a template to execute";
4
4
  readonly fixture: "Select a catalog fixture to run the template against";
5
- readonly externalData: "Select external data to run the template against";
5
+ readonly external: "Select external data to run the template against";
6
6
  readonly connection: "Select a connection to execute templates against";
7
7
  };
8
8
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../src/commands/execute.ts"],"names":[],"mappings":"AA4BA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAE1E,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,yBAAyB;IACpD,MAAM,CAAC,KAAK;;;;;MAgBV;IAEF,MAAM,CAAC,WAAW,SACkK;IAEpL,MAAM,CAAC,QAAQ,WAOb;IAEF,KAAK,EAAE,iBAAiB,CAAM;IAExB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;YAkCnB,UAAU;YAsBV,oBAAoB;YAoDpB,wBAAwB;YA2BxB,wBAAwB;CAevC"}
1
+ {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../src/commands/execute.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAE1E,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,yBAAyB;IACpD,MAAM,CAAC,KAAK;;;;;MAgBV;IAEF,MAAM,CAAC,WAAW,SACkK;IAEpL,MAAM,CAAC,QAAQ,WAOb;IAEF,KAAK,EAAE,iBAAiB,CAAM;IAExB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;YAkCnB,UAAU;YAsBV,oBAAoB;YAoDpB,wBAAwB;YA2BxB,wBAAwB;CAevC"}
@@ -23,7 +23,7 @@ const refresh_connections_command_1 = require("./refresh-connections-command");
23
23
  exports.executePromptMessages = {
24
24
  template: "Select a template to execute",
25
25
  fixture: "Select a catalog fixture to run the template against",
26
- externalData: "Select external data to run the template against",
26
+ external: "Select external data to run the template against",
27
27
  connection: "Select a connection to execute templates against",
28
28
  };
29
29
  class Execute extends refresh_connections_command_1.RefreshConnectionsCommand {
@@ -60,9 +60,9 @@ class Execute extends refresh_connections_command_1.RefreshConnectionsCommand {
60
60
  const result = await (0, send_template_execute_request_1.sendTemplateExecuteRequest)({
61
61
  template: (0, file_loaders_1.getJSONataTemplate)(templateInput.templatePath).toString(),
62
62
  helpers: (await (0, template_source_code_1.getHelpersSourceCode)(config.helpers)) ?? "",
63
- targetData: (0, file_loaders_1.getCatalogFixture)(templateInput.fixturePath),
64
- externalData: templateInput.externalDataPath
65
- ? (0, file_loaders_1.getExternalDataFixture)(templateInput.externalDataPath)
63
+ data: (0, file_loaders_1.getCatalogFixture)(templateInput.fixturePath),
64
+ external: templateInput.externalPath
65
+ ? (0, file_loaders_1.getExternalFixture)(templateInput.externalPath)
66
66
  : {},
67
67
  connectionId: templateInput.connectionId,
68
68
  templateType: (0, extract_template_type_1.extractTemplateType)(templateInput.templatePath),
@@ -116,11 +116,11 @@ class Execute extends refresh_connections_command_1.RefreshConnectionsCommand {
116
116
  });
117
117
  }
118
118
  if (!this.input["external-data-path"]) {
119
- const choices = (0, get_external_data_files_1.getExternalDataFiles)();
119
+ const choices = (0, get_external_data_files_1.getExternalFiles)();
120
120
  if (choices.length) {
121
121
  this.input["external-data-path"] = await (0, render_prompt_1.renderPrompt)({
122
122
  choices,
123
- promptMessage: exports.executePromptMessages.externalData,
123
+ promptMessage: exports.executePromptMessages.external,
124
124
  emptyMessage: "No external data found",
125
125
  });
126
126
  }
@@ -132,7 +132,7 @@ class Execute extends refresh_connections_command_1.RefreshConnectionsCommand {
132
132
  return {
133
133
  templatePath: this.input["template-path"],
134
134
  fixturePath: this.input["fixture-path"],
135
- externalDataPath: this.input["external-data-path"] ?? "",
135
+ externalPath: this.input["external-data-path"] ?? "",
136
136
  connectionId,
137
137
  };
138
138
  }
@@ -3,11 +3,11 @@ export interface ExecuteTemplateArgs {
3
3
  type: (typeof TYPE_OPTIONS)[number];
4
4
  name: string;
5
5
  fixture?: Record<string, unknown>;
6
- externalData?: Record<string, unknown>;
6
+ external?: Record<string, unknown>;
7
7
  connectionId?: string;
8
8
  }
9
9
  /**
10
- * This will execute a template with the given type, name, fixture, and externalData.
10
+ * This will execute a template with the given type, name, fixture, and external.
11
11
  * It returns an object with the result of the execution, or throws if there is an error.
12
12
  *
13
13
  * The template will be executed against the first connection found, or you can override
@@ -1 +1 @@
1
- {"version":3,"file":"execute-template.d.ts","sourceRoot":"","sources":["../../src/functions/execute-template.ts"],"names":[],"mappings":"AAaA,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,gCAuBjE"}
1
+ {"version":3,"file":"execute-template.d.ts","sourceRoot":"","sources":["../../src/functions/execute-template.ts"],"names":[],"mappings":"AAWA,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,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,mBAAmB,gCAuBjE"}
@@ -21,7 +21,7 @@ exports.TYPE_OPTIONS = [
21
21
  "grouping",
22
22
  ];
23
23
  /**
24
- * This will execute a template with the given type, name, fixture, and externalData.
24
+ * This will execute a template with the given type, name, fixture, and external.
25
25
  * It returns an object with the result of the execution, or throws if there is an error.
26
26
  *
27
27
  * The template will be executed against the first connection found, or you can override
@@ -33,7 +33,7 @@ exports.TYPE_OPTIONS = [
33
33
  * @returns Promise<Record<string, any>>
34
34
  */
35
35
  async function executeTemplate(options) {
36
- const { name, fixture, externalData } = initializeOptions(options);
36
+ const { name, fixture, external } = initializeOptions(options);
37
37
  const connection = await getConnection(options);
38
38
  const config = await (0, config_1.getRepositoryConfigFile)();
39
39
  const result = await (0, send_template_execute_request_1.sendTemplateExecuteRequest)({
@@ -41,9 +41,9 @@ async function executeTemplate(options) {
41
41
  helpers: (await (0, template_source_code_1.getHelpersSourceCode)(config.helpers)) ?? "",
42
42
  connectionId: connection.id,
43
43
  templateType: options.type,
44
- targetData: fixture,
44
+ data: fixture,
45
45
  showLogs: false,
46
- externalData,
46
+ external,
47
47
  });
48
48
  if (!result.success) {
49
49
  throw new Error(`Error executing template: ${result.error.message}`);
@@ -73,8 +73,8 @@ function initializeOptions(options) {
73
73
  if (!options.fixture) {
74
74
  options.fixture = {};
75
75
  }
76
- if (!options.externalData) {
77
- options.externalData = {};
76
+ if (!options.external) {
77
+ options.external = {};
78
78
  }
79
79
  return options;
80
80
  }
@@ -1,17 +1,16 @@
1
- import { type ConnectionResponseDto } from "../http/get-connections-request";
2
- import { type Config, type ConnectionConfigDict } from "../types";
1
+ import { type Connection, type Config, type ConnectionConfigDict } from "../types";
3
2
  /**
4
3
  * Builds the config object from the connections list.
5
4
  * @param connections
6
5
  * @param shouldCreateMappingTemplates
7
6
  * @returns the config object
8
7
  */
9
- export declare function buildConfigFromConnections(connections: ConnectionResponseDto[], shouldCreateMappingTemplates: boolean): Config;
8
+ export declare function buildConfigFromConnections(connections: Connection[], shouldCreateMappingTemplates: boolean): Config;
10
9
  /**
11
10
  * Builds a dictionary of connections from array of connections sorted by environment and name.
12
11
  * @param connections Array of connections
13
12
  * @returns Dictionary of connections
14
13
  */
15
- export declare function buildConnectionsDictFromList(connections: ConnectionResponseDto[]): ConnectionConfigDict;
14
+ export declare function buildConnectionsDictFromList(connections: Connection[]): ConnectionConfigDict;
16
15
  export declare function buildConfigString(config: Config, connections: ConnectionConfigDict): string;
17
16
  //# sourceMappingURL=build-config-file.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-config-file.d.ts","sourceRoot":"","sources":["../../src/helpers/build-config-file.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAQlE;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,qBAAqB,EAAE,EACpC,4BAA4B,EAAE,OAAO,GACpC,MAAM,CAWR;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,qBAAqB,EAAE,GACnC,oBAAoB,CAiCtB;AAmDD,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,oBAAoB,GAChC,MAAM,CAmBR"}
1
+ {"version":3,"file":"build-config-file.d.ts","sourceRoot":"","sources":["../../src/helpers/build-config-file.ts"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,MAAM,EACX,KAAK,oBAAoB,EAC1B,MAAM,UAAU,CAAC;AAQlB;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,UAAU,EAAE,EACzB,4BAA4B,EAAE,OAAO,GACpC,MAAM,CAWR;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,UAAU,EAAE,GACxB,oBAAoB,CAiCtB;AAmDD,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,oBAAoB,GAChC,MAAM,CAmBR"}
@@ -1,6 +1,6 @@
1
1
  import fs from "fs-extra";
2
2
  export declare const getCatalogFixture: (name: string, options?: fs.JsonReadOptions) => any;
3
- export declare const getExternalDataFixture: (name: string, options?: fs.JsonReadOptions) => any;
3
+ export declare const getExternalFixture: (name: string, options?: fs.JsonReadOptions) => any;
4
4
  export declare const getJSONataTemplate: (name: string, options?: BufferEncoding | (fs.ObjectEncodingOptions & {
5
5
  flag?: string | undefined;
6
6
  }) | null | undefined) => string | Buffer<ArrayBufferLike>;
@@ -1 +1 @@
1
- {"version":3,"file":"file-loaders.d.ts","sourceRoot":"","sources":["../../src/helpers/file-loaders.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,UAAU,CAAC;AAI1B,eAAO,MAA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,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC;IAC9C,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB"}
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getJSONataTemplate = exports.getExternalDataFixture = exports.getCatalogFixture = void 0;
6
+ exports.getJSONataTemplate = exports.getExternalFixture = exports.getCatalogFixture = void 0;
7
7
  exports.createFileLoader = createFileLoader;
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const errors_1 = require("@oclif/core/errors");
@@ -14,7 +14,7 @@ exports.getCatalogFixture = createFileLoader({
14
14
  fileLoader: fs_extra_1.default.readJSONSync,
15
15
  suggestions: ["Ensure the file is a valid JSON file"],
16
16
  });
17
- exports.getExternalDataFixture = createFileLoader({
17
+ exports.getExternalFixture = createFileLoader({
18
18
  prefix: path_1.default.join("src", "fixtures", "external_data"),
19
19
  fileLoader: fs_extra_1.default.readJSONSync,
20
20
  suggestions: ["Ensure the file is a valid JSON file"],
@@ -44,7 +44,7 @@ function renderArgs(args) {
44
44
  }
45
45
  function renderInputFlags(input) {
46
46
  return Object.keys(input).reduce((command, flag) => {
47
- command += ` \\\n--${flag}=${input[flag]}`;
47
+ command += ` --${flag}=${input[flag]}`;
48
48
  return command;
49
49
  }, "");
50
50
  }
@@ -1,21 +1,6 @@
1
- export declare function getConnections({ showLogs, }: GetConnectionsOptions): Promise<ConnectionResponseDto[]>;
1
+ import { type Connection } from "../types";
2
+ export declare function getConnections({ showLogs, }: GetConnectionsOptions): Promise<Connection[]>;
2
3
  export interface GetConnectionsOptions {
3
4
  showLogs: boolean;
4
5
  }
5
- export interface ConnectionResponseDto {
6
- id: string;
7
- name: string;
8
- slug: string;
9
- partner: string;
10
- environment: string;
11
- frequent_sync: boolean;
12
- force: boolean;
13
- notification_email?: string | null;
14
- api_key?: string | null;
15
- section: string;
16
- ingestion_type?: string | null;
17
- created_at: string;
18
- updated_at: string;
19
- active: boolean;
20
- }
21
6
  //# sourceMappingURL=get-connections-request.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-connections-request.d.ts","sourceRoot":"","sources":["../../src/http/get-connections-request.ts"],"names":[],"mappings":"AAOA,wBAAsB,cAAc,CAAC,EACnC,QAAQ,GACT,EAAE,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC,CA8B1D;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;IACf,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;CACjB"}
1
+ {"version":3,"file":"get-connections-request.d.ts","sourceRoot":"","sources":["../../src/http/get-connections-request.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAI3C,wBAAsB,cAAc,CAAC,EACnC,QAAQ,GACT,EAAE,qBAAqB,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CA8B/C;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,OAAO,CAAC;CACnB"}
@@ -1,10 +1,10 @@
1
1
  import { type TemplateExecutionSuccessResponse, type TemplateExecutionErrorResponse } from "../types";
2
- export declare function sendTemplateExecuteRequest({ template, helpers, targetData, externalData, connectionId, templateType, showLogs, }: Args): Promise<TemplateExecutionSuccessResponse | TemplateExecutionErrorResponse>;
2
+ export declare function sendTemplateExecuteRequest({ template, helpers, data, external, connectionId, templateType, showLogs, }: Args): Promise<TemplateExecutionSuccessResponse | TemplateExecutionErrorResponse>;
3
3
  interface Args {
4
4
  template: string;
5
5
  helpers: string;
6
- targetData: any;
7
- externalData: any;
6
+ data: any;
7
+ external: any;
8
8
  connectionId: string;
9
9
  templateType: string;
10
10
  showLogs?: boolean;
@@ -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,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"}
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,IAAI,EACJ,QAAQ,EACR,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,IAAI,EAAE,GAAG,CAAC;IACV,QAAQ,EAAE,GAAG,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
@@ -5,14 +5,14 @@ const axios_1 = require("axios");
5
5
  const errors_1 = require("@oclif/core/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, templateType, showLogs = true, }) {
8
+ async function sendTemplateExecuteRequest({ template, helpers, data, external, 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
12
  helpers,
13
13
  raw_template: template,
14
- target_data: targetData,
15
- external_data: externalData,
14
+ data,
15
+ external,
16
16
  connection_id: connectionId,
17
17
  template_type: templateType,
18
18
  })).data;
@@ -1,8 +1,7 @@
1
- import { type TemplatePath } from "../types";
2
- import { type ConnectionResponseDto } from "../http/get-connections-request";
1
+ import { type TemplatePath, type Connection } from "../types";
3
2
  /**
4
3
  * Returns all connections that are associated with a template by checking
5
4
  * the config file.
6
5
  */
7
- export declare function filterConnectionsByTemplate(templatePath: TemplatePath, connections: ConnectionResponseDto[]): Promise<ConnectionResponseDto[]>;
6
+ export declare function filterConnectionsByTemplate(templatePath: TemplatePath, connections: Connection[]): Promise<Connection[]>;
8
7
  //# sourceMappingURL=filter-connections-by-template.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"filter-connections-by-template.d.ts","sourceRoot":"","sources":["../../src/prompt-data/filter-connections-by-template.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAG7E;;;GAGG;AACH,wBAAsB,2BAA2B,CAC/C,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,qBAAqB,EAAE,GACnC,OAAO,CAAC,qBAAqB,EAAE,CAAC,CA+BlC"}
1
+ {"version":3,"file":"filter-connections-by-template.d.ts","sourceRoot":"","sources":["../../src/prompt-data/filter-connections-by-template.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAG9D;;;GAGG;AACH,wBAAsB,2BAA2B,CAC/C,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,UAAU,EAAE,GACxB,OAAO,CAAC,UAAU,EAAE,CAAC,CA+BvB"}
@@ -1,3 +1,3 @@
1
1
  import { type PromptChoices } from "../types";
2
- export declare function getExternalDataFiles(): PromptChoices<string>;
2
+ export declare function getExternalFiles(): PromptChoices<string>;
3
3
  //# sourceMappingURL=get-external-data-files.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-external-data-files.d.ts","sourceRoot":"","sources":["../../src/prompt-data/get-external-data-files.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,oBAAoB,IAAI,aAAa,CAAC,MAAM,CAAC,CAmB5D"}
1
+ {"version":3,"file":"get-external-data-files.d.ts","sourceRoot":"","sources":["../../src/prompt-data/get-external-data-files.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,gBAAgB,IAAI,aAAa,CAAC,MAAM,CAAC,CAmBxD"}
@@ -3,10 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getExternalDataFiles = getExternalDataFiles;
6
+ exports.getExternalFiles = getExternalFiles;
7
7
  const path_1 = __importDefault(require("path"));
8
8
  const find_deep_files_1 = require("../helpers/find-deep-files");
9
- function getExternalDataFiles() {
9
+ function getExternalFiles() {
10
10
  try {
11
11
  const filePath = path_1.default.join("src", "fixtures", "external_data");
12
12
  return (0, find_deep_files_1.findDeepFiles)(filePath)
@@ -1,2 +1,2 @@
1
- export declare const selectConnections: (message?: string) => Promise<import("../http/get-connections-request").ConnectionResponseDto>;
1
+ export declare const selectConnections: (message?: string) => Promise<import("../types").Connection>;
2
2
  //# sourceMappingURL=select-connections.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"select-connections.d.ts","sourceRoot":"","sources":["../../src/prompt-data/select-connections.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB,GAC5B,UAAS,MAAgC,6EA0B1C,CAAC"}
1
+ {"version":3,"file":"select-connections.d.ts","sourceRoot":"","sources":["../../src/prompt-data/select-connections.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB,GAC5B,UAAS,MAAgC,2CA0B1C,CAAC"}
package/dist/types.d.ts CHANGED
@@ -13,6 +13,22 @@ export interface PartialConnection {
13
13
  slug: string;
14
14
  environment: string;
15
15
  }
16
+ export interface Connection {
17
+ id: string;
18
+ name: string;
19
+ slug: string;
20
+ partner: string;
21
+ environment: string;
22
+ frequent_sync: boolean;
23
+ force: boolean;
24
+ notification_email?: string | null;
25
+ api_key?: string | null;
26
+ section: string;
27
+ ingestion_type?: string | null;
28
+ created_at: string;
29
+ updated_at: string;
30
+ active: boolean;
31
+ }
16
32
  export type ConnectionConfigDict = Record<string, PartialConnection>;
17
33
  export type PromptChoices<T> = Array<{
18
34
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","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GAAG,MAAM,CAAC;AAElC,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC"}
package/dist/version.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- declare const _default: "1.13.2";
1
+ declare const _default: "1.14.0";
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.13.2';
3
+ exports.default = '1.14.0';
@@ -190,5 +190,5 @@
190
190
  ]
191
191
  }
192
192
  },
193
- "version": "1.13.2"
193
+ "version": "1.14.0"
194
194
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructor-io/constructorio-connect-cli",
3
- "version": "1.13.2",
3
+ "version": "1.14.0",
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",
@@ -90,7 +90,7 @@
90
90
  "jest": "^29.7.0",
91
91
  "license-checker": "^25.0.1",
92
92
  "mock-fs": "^5.2.0",
93
- "nock": "14.0.4",
93
+ "nock": "14.0.5",
94
94
  "oclif": "^4.17.42",
95
95
  "prettier": "^3.2.5",
96
96
  "prettier-2": "npm:prettier@^2.8.8",