@getxflow/cli 0.17.0 → 0.18.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/dist/commands/connections.js +12 -0
- package/dist/help.js +10 -7
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/skills/xflow/SKILL.md +6 -5
|
@@ -32,6 +32,14 @@ function state(row) {
|
|
|
32
32
|
return 'linked';
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* The names of a connection as they are written in a call, braces and all. Ready to paste:
|
|
37
|
+
* guessing one costs a real request to somebody's live account, since an unknown name is
|
|
38
|
+
* left in the text and the request still goes out.
|
|
39
|
+
*/
|
|
40
|
+
function placeholders(row) {
|
|
41
|
+
return (row.substitutes ?? []).map((name) => `{${name}}`).join(' ');
|
|
42
|
+
}
|
|
35
43
|
function endpoint(projectId) {
|
|
36
44
|
return `/api/v1/projects/${projectId}/connections`;
|
|
37
45
|
}
|
|
@@ -69,6 +77,7 @@ async function connectionsList(args) {
|
|
|
69
77
|
row.label,
|
|
70
78
|
row.connector_key ?? '-',
|
|
71
79
|
row.alias ?? '-',
|
|
80
|
+
placeholders(row) || '-',
|
|
72
81
|
state(row),
|
|
73
82
|
]));
|
|
74
83
|
const variables = data.connections.flatMap((row) => row.env);
|
|
@@ -76,6 +85,9 @@ async function connectionsList(args) {
|
|
|
76
85
|
(0, ui_1.note)((0, ui_1.dim)(` The functions get: ${variables.join(', ')}`));
|
|
77
86
|
(0, ui_1.note)((0, ui_1.dim)(' A change reaches a function on its next deploy: xflow deploy'));
|
|
78
87
|
}
|
|
88
|
+
if (data.connections.some((row) => placeholders(row))) {
|
|
89
|
+
(0, ui_1.note)((0, ui_1.dim)(' The fourth column is what a call fills in: xflow connections call <name> <path>'));
|
|
90
|
+
}
|
|
79
91
|
if (data.connections.some((row) => !row.alias)) {
|
|
80
92
|
(0, ui_1.note)((0, ui_1.dim)(' To link one: xflow connections link <name> --as ALIAS'));
|
|
81
93
|
}
|
package/dist/help.js
CHANGED
|
@@ -372,9 +372,10 @@ the platform into the function.
|
|
|
372
372
|
xflow connections call <name> <path>
|
|
373
373
|
ask that API something, once, without deploying
|
|
374
374
|
|
|
375
|
-
Every row says whether the connection is linked to this project (its alias)
|
|
376
|
-
|
|
377
|
-
|
|
375
|
+
Every row says whether the connection is linked to this project (its alias), which of
|
|
376
|
+
its fields a call can fill in (${(0, ui_1.bold)('{CLIENT_ID}')} and the like) and what state the
|
|
377
|
+
access is in. ${(0, ui_1.bold)('available, not linked')} is the useful one: the account exists in
|
|
378
|
+
the organization, but this project gets nothing from it yet: link it.
|
|
378
379
|
|
|
379
380
|
Both commands take the name of the connection, the first column of the list, and both
|
|
380
381
|
also take its identifier. ${(0, ui_1.bold)('unlink')} takes the alias as well, and prefers it: the
|
|
@@ -420,10 +421,12 @@ refusal lists them. ${(0, ui_1.bold)('--method')} defaults to GET, or to POST wh
|
|
|
420
421
|
${(0, ui_1.bold)('{NAME}')} in the path or in a header value is filled in by the platform from the
|
|
421
422
|
fields of the connection. That is how the two-header APIs are called: Ozon wants
|
|
422
423
|
${(0, ui_1.bold)('Client-Id')} beside its key, Yandex Direct wants ${(0, ui_1.bold)('Client-Login')} for an
|
|
423
|
-
agency account, and you never see those values.
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
424
|
+
agency account, and you never see those values. Which names a connection has is the fourth
|
|
425
|
+
column of ${(0, ui_1.bold)('xflow connections')}, printed in braces and the same whether the account
|
|
426
|
+
is linked or not. Do not derive them from ${(0, ui_1.bold)('xflow env')}: that list is the variables
|
|
427
|
+
of a link, and it names both more and less than this one. A name the connection does not
|
|
428
|
+
have is left in the text as you typed it and the request still goes out, so an invented
|
|
429
|
+
name reaches somebody's live account as text.
|
|
427
430
|
|
|
428
431
|
The answer is printed head first, at most a few kilobytes, and it says so when there is
|
|
429
432
|
more. Ask for the shape, not the volume: one day and ${(0, ui_1.bold)('limit=1')} tells you what the
|
package/dist/version.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DEFAULT_API_URL = exports.CLI_VERSION = void 0;
|
|
4
4
|
/** Keep in sync with cli/package.json. */
|
|
5
|
-
exports.CLI_VERSION = '0.
|
|
5
|
+
exports.CLI_VERSION = '0.18.0';
|
|
6
6
|
/** Overridden by XFLOW_API_URL or the `api` field in xflow.json. */
|
|
7
7
|
exports.DEFAULT_API_URL = 'https://app.getxflow.com';
|
package/package.json
CHANGED
package/skills/xflow/SKILL.md
CHANGED
|
@@ -24,7 +24,7 @@ contains the fix.
|
|
|
24
24
|
|
|
25
25
|
## Keeping these instructions current
|
|
26
26
|
|
|
27
|
-
These instructions ship with xflow CLI 0.
|
|
27
|
+
These instructions ship with xflow CLI 0.18.0. They travel inside the package, so the copy
|
|
28
28
|
you are reading can be older than the CLI answering your commands, and nothing about that
|
|
29
29
|
is visible in the text itself.
|
|
30
30
|
|
|
@@ -396,10 +396,11 @@ something. To use the account in code, link it and deploy.
|
|
|
396
396
|
Two refusals do need a person, and different ones: `connections:link` right — the owner of the
|
|
397
397
|
key grants it where the key permissions live; `not granted to you` — ask whoever connected the account.
|
|
398
398
|
|
|
399
|
-
`{NAME}` in the path or in a header value is filled in from the fields of the connection
|
|
400
|
-
names
|
|
401
|
-
|
|
402
|
-
|
|
399
|
+
`{NAME}` in the path or in a header value is filled in from the fields of the connection.
|
|
400
|
+
**Take the names from `xflow connections`**, which prints them in braces for every account,
|
|
401
|
+
linked or not: an invented name is left in the text as you typed it and the request goes out
|
|
402
|
+
anyway, into somebody's live account. `xflow env` is not that list. Only the hosts of that
|
|
403
|
+
connector are reachable and a refusal lists them.
|
|
403
404
|
|
|
404
405
|
**Ask for the shape, not the volume.** One day and `limit=1` is enough to learn what the
|
|
405
406
|
fields are called; the answer is printed head first and says when there is more. The whole
|