@constructor-io/constructorio-connect-cli 1.13.3 → 1.15.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.
- package/README.md +9 -3
- package/boilerplate-repo/.github/workflows/deploy.yml +8 -3
- package/boilerplate-repo/README.md +7 -7
- package/dist/commands/deploy.d.ts +3 -0
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +23 -2
- package/dist/commands/execute.d.ts +1 -1
- package/dist/commands/execute.js +7 -7
- package/dist/functions/execute-template.d.ts +2 -2
- package/dist/functions/execute-template.d.ts.map +1 -1
- package/dist/functions/execute-template.js +6 -6
- package/dist/helpers/file-loaders.d.ts +1 -1
- package/dist/helpers/file-loaders.d.ts.map +1 -1
- package/dist/helpers/file-loaders.js +2 -2
- package/dist/http/send-template-execute-request.d.ts +3 -3
- package/dist/http/send-template-execute-request.d.ts.map +1 -1
- package/dist/http/send-template-execute-request.js +3 -3
- package/dist/prompt-data/get-external-data-files.d.ts +1 -1
- package/dist/prompt-data/get-external-data-files.d.ts.map +1 -1
- package/dist/prompt-data/get-external-data-files.js +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/oclif.manifest.json +13 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -43,18 +43,22 @@ With the new repository initialized, you can start developing your catalog integ
|
|
|
43
43
|
|
|
44
44
|
## `constructorio-connect-cli deploy ENV`
|
|
45
45
|
|
|
46
|
-
Deploys all templates defined on the `connectrc.js` file to the specified environment.
|
|
46
|
+
Deploys all templates defined on the `connectrc.js` file to the specified environment, after running tests ('--force' to skip).
|
|
47
47
|
|
|
48
48
|
```
|
|
49
49
|
USAGE
|
|
50
|
-
$ constructorio-connect-cli deploy ENV
|
|
50
|
+
$ constructorio-connect-cli deploy ENV [-f]
|
|
51
51
|
|
|
52
52
|
ARGUMENTS
|
|
53
53
|
ENV (development|qa|production|demo) The target Constructor environment to deploy to.
|
|
54
54
|
|
|
55
|
+
FLAGS
|
|
56
|
+
-f, --force Skip tests before deploying
|
|
57
|
+
|
|
55
58
|
DESCRIPTION
|
|
56
59
|
|
|
57
|
-
Deploys all templates defined on the `connectrc.js` file to the specified environment
|
|
60
|
+
Deploys all templates defined on the `connectrc.js` file to the specified environment, after running tests ('--force'
|
|
61
|
+
to skip).
|
|
58
62
|
|
|
59
63
|
The script will use the `CONNECT_AUTH_TOKEN` environment variable to authenticate with Constructor.
|
|
60
64
|
|
|
@@ -64,6 +68,8 @@ EXAMPLES
|
|
|
64
68
|
$ constructorio-connect-cli deploy qa
|
|
65
69
|
|
|
66
70
|
$ constructorio-connect-cli deploy production
|
|
71
|
+
|
|
72
|
+
$ constructorio-connect-cli deploy production --force
|
|
67
73
|
```
|
|
68
74
|
|
|
69
75
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
#
|
|
6
6
|
# This workflow can be triggered from the GitHub Actions tab. Just open the actions tab,
|
|
7
7
|
# select the workflow, and click the "Run workflow" button. Then, select your desired
|
|
8
|
-
# environment and confirm the deployment.
|
|
8
|
+
# environment, select if you want to skip tests and confirm the deployment.
|
|
9
9
|
#
|
|
10
10
|
# Only one deployment per environment can run at a time. If a deployment is already in
|
|
11
11
|
# progress, triggering a new deployment will cancel the previous one.
|
|
@@ -27,6 +27,11 @@ on:
|
|
|
27
27
|
- qa
|
|
28
28
|
- production
|
|
29
29
|
- demo
|
|
30
|
+
force:
|
|
31
|
+
description: Skip tests during deployment
|
|
32
|
+
required: false
|
|
33
|
+
type: boolean
|
|
34
|
+
default: false
|
|
30
35
|
|
|
31
36
|
concurrency:
|
|
32
37
|
group: deploy-${{ github.event.inputs.environment }}
|
|
@@ -48,12 +53,12 @@ jobs:
|
|
|
48
53
|
- name: Setup node
|
|
49
54
|
uses: actions/setup-node@v4
|
|
50
55
|
with:
|
|
51
|
-
node-version:
|
|
56
|
+
node-version: "18.18.0"
|
|
52
57
|
|
|
53
58
|
- name: Install dependencies
|
|
54
59
|
run: npm ci
|
|
55
60
|
|
|
56
61
|
- name: Deploy
|
|
57
|
-
run: IS_CI=true npm run deploy ${{ github.event.inputs.environment }}
|
|
62
|
+
run: IS_CI=true npm run deploy ${{ github.event.inputs.environment }} ${{ github.event.inputs.force && '--force' || '' }}
|
|
58
63
|
env:
|
|
59
64
|
CONNECT_AUTH_TOKEN: ${{ secrets.CONNECT_AUTH_TOKEN }}
|
|
@@ -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 `
|
|
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
|
-
|
|
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":
|
|
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 :=
|
|
355
|
-
$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 :=
|
|
369
|
-
$parentId :=
|
|
368
|
+
$color := data.color;
|
|
369
|
+
$parentId := data.parent.id;
|
|
370
370
|
|
|
371
371
|
{
|
|
372
372
|
"item_id": $join([$parentId, '-', $color]);
|
|
@@ -3,6 +3,9 @@ export default class Deploy extends RefreshConnectionsCommand {
|
|
|
3
3
|
static args: {
|
|
4
4
|
env: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
|
+
static flags: {
|
|
7
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
};
|
|
6
9
|
static description: string;
|
|
7
10
|
static examples: string[];
|
|
8
11
|
runCommand(): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAE1E,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,yBAAyB;IAC3D,MAAM,CAAC,IAAI;;MAMT;IAEF,MAAM,CAAC,KAAK;;MAKV;IAEF,MAAM,CAAC,WAAW,SAGqF;IAEvG,MAAM,CAAC,QAAQ,WAKb;IAEI,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC;CA+DjC"}
|
package/dist/commands/deploy.js
CHANGED
|
@@ -13,6 +13,7 @@ const ux_action_1 = require("../helpers/ux-action");
|
|
|
13
13
|
const deploy_request_1 = require("../http/deploy-request");
|
|
14
14
|
const render_tip_1 = require("../rendering/render-tip");
|
|
15
15
|
const refresh_connections_command_1 = require("./refresh-connections-command");
|
|
16
|
+
const child_process_1 = require("child_process");
|
|
16
17
|
class Deploy extends refresh_connections_command_1.RefreshConnectionsCommand {
|
|
17
18
|
static args = {
|
|
18
19
|
env: core_1.Args.string({
|
|
@@ -21,17 +22,37 @@ class Deploy extends refresh_connections_command_1.RefreshConnectionsCommand {
|
|
|
21
22
|
required: true,
|
|
22
23
|
}),
|
|
23
24
|
};
|
|
25
|
+
static flags = {
|
|
26
|
+
force: core_1.Flags.boolean({
|
|
27
|
+
char: "f",
|
|
28
|
+
description: "Skip tests before deploying",
|
|
29
|
+
}),
|
|
30
|
+
};
|
|
24
31
|
static description = `
|
|
25
|
-
Deploys all templates defined on the \`connectrc.js\` file to the specified environment.
|
|
32
|
+
Deploys all templates defined on the \`connectrc.js\` file to the specified environment, after running tests ('--force' to skip).
|
|
26
33
|
|
|
27
34
|
The script will use the \`CONNECT_AUTH_TOKEN\` environment variable to authenticate with Constructor.`;
|
|
28
35
|
static examples = [
|
|
29
36
|
"$ <%= config.bin %> deploy development",
|
|
30
37
|
"$ <%= config.bin %> deploy qa",
|
|
31
38
|
"$ <%= config.bin %> deploy production",
|
|
39
|
+
"$ <%= config.bin %> deploy production --force",
|
|
32
40
|
];
|
|
33
41
|
async runCommand() {
|
|
34
|
-
const { args } = await this.parse(Deploy);
|
|
42
|
+
const { flags, args } = await this.parse(Deploy);
|
|
43
|
+
if (!flags.force) {
|
|
44
|
+
try {
|
|
45
|
+
(0, child_process_1.execSync)("npm run test", {
|
|
46
|
+
stdio: "inherit",
|
|
47
|
+
cwd: process.cwd(),
|
|
48
|
+
});
|
|
49
|
+
this.log(`\n`);
|
|
50
|
+
}
|
|
51
|
+
catch (_) {
|
|
52
|
+
this.log(`\n${kleur_1.default.red("❌ Tests failed!")}\n`);
|
|
53
|
+
throw new errors_1.CLIError(`Tests failed. Fix the tests or use --force to deploy anyway.`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
35
56
|
const config = await (0, ux_action_1.uxAction)("📡 Reading your config", async () => {
|
|
36
57
|
return await (0, config_1.getRepositoryConfigFile)();
|
|
37
58
|
})();
|
|
@@ -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
|
|
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
|
/**
|
package/dist/commands/execute.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
? (0, file_loaders_1.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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":"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,
|
|
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
|
|
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,
|
|
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
|
-
|
|
44
|
+
data: fixture,
|
|
45
45
|
showLogs: false,
|
|
46
|
-
|
|
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.
|
|
77
|
-
options.
|
|
76
|
+
if (!options.external) {
|
|
77
|
+
options.external = {};
|
|
78
78
|
}
|
|
79
79
|
return options;
|
|
80
80
|
}
|
|
@@ -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
|
|
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,MAAM,iBAAiB,SAqBP,MAAM,sCAjB3B,CAAC;AAEH,eAAO,MAAM,
|
|
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,MAAM,iBAAiB,SAqBP,MAAM,sCAjB3B,CAAC;AAEH,eAAO,MAAM,kBAAkB,SAeR,MAAM,sCAX3B,CAAC;AAEH,eAAO,MAAM,kBAAkB,SASR,MAAM;;0DAN3B,CAAC;AAEH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,CAAC,SAAS,GAAG,EAAE,EAAE,EACnD,MAAM,EACN,UAAU,EACV,WAAgB,GACjB,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,CAkB9C;AAED,UAAU,IAAI,CAAC,CAAC,EAAE,CAAC,SAAS,GAAG,EAAE;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,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.
|
|
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.
|
|
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"],
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type TemplateExecutionSuccessResponse, type TemplateExecutionErrorResponse } from "../types";
|
|
2
|
-
export declare function sendTemplateExecuteRequest({ template, helpers,
|
|
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
|
-
|
|
7
|
-
|
|
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,
|
|
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,
|
|
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
|
-
|
|
15
|
-
|
|
14
|
+
data,
|
|
15
|
+
external,
|
|
16
16
|
connection_id: connectionId,
|
|
17
17
|
template_type: templateType,
|
|
18
18
|
})).data;
|
|
@@ -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,
|
|
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.
|
|
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
|
|
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)
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/oclif.manifest.json
CHANGED
|
@@ -15,13 +15,22 @@
|
|
|
15
15
|
"required": true
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
|
-
"description": "\n Deploys all templates defined on the `connectrc.js` file to the specified environment.\n\n The script will use the `CONNECT_AUTH_TOKEN` environment variable to authenticate with Constructor.",
|
|
18
|
+
"description": "\n Deploys all templates defined on the `connectrc.js` file to the specified environment, after running tests ('--force' to skip).\n\n The script will use the `CONNECT_AUTH_TOKEN` environment variable to authenticate with Constructor.",
|
|
19
19
|
"examples": [
|
|
20
20
|
"$ <%= config.bin %> deploy development",
|
|
21
21
|
"$ <%= config.bin %> deploy qa",
|
|
22
|
-
"$ <%= config.bin %> deploy production"
|
|
22
|
+
"$ <%= config.bin %> deploy production",
|
|
23
|
+
"$ <%= config.bin %> deploy production --force"
|
|
23
24
|
],
|
|
24
|
-
"flags": {
|
|
25
|
+
"flags": {
|
|
26
|
+
"force": {
|
|
27
|
+
"char": "f",
|
|
28
|
+
"description": "Skip tests before deploying",
|
|
29
|
+
"name": "force",
|
|
30
|
+
"allowNo": false,
|
|
31
|
+
"type": "boolean"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
25
34
|
"hasDynamicHelp": false,
|
|
26
35
|
"hiddenAliases": [],
|
|
27
36
|
"id": "deploy",
|
|
@@ -190,5 +199,5 @@
|
|
|
190
199
|
]
|
|
191
200
|
}
|
|
192
201
|
},
|
|
193
|
-
"version": "1.
|
|
202
|
+
"version": "1.15.0"
|
|
194
203
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructor-io/constructorio-connect-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.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.
|
|
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",
|