@getxflow/cli 0.17.0 → 0.19.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/commands/deploy.js +11 -1
- package/dist/help.js +10 -7
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/skills/xflow/SKILL.md +13 -8
|
@@ -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/commands/deploy.js
CHANGED
|
@@ -229,8 +229,18 @@ async function deployments(args) {
|
|
|
229
229
|
(0, ui_1.formatAge)(d.deployed_at ?? d.created_at),
|
|
230
230
|
// Plain text only: a padded cell with ANSI codes would skew every column after it.
|
|
231
231
|
d.comment && d.comment.length > 60 ? `${d.comment.slice(0, 59)}…` : (d.comment ?? ''),
|
|
232
|
-
|
|
232
|
+
// pages_kept === false marks a build the storage cleanup has stripped:
|
|
233
|
+
// rollback refuses it, so saying so here saves the agent a call. Older
|
|
234
|
+
// platforms omit the field, and then the column stays as it was.
|
|
235
|
+
[
|
|
236
|
+
d.is_dev ? (0, ui_1.bold)('dev') : '',
|
|
237
|
+
d.is_live ? (0, ui_1.bold)('live') : '',
|
|
238
|
+
d.pages_kept === false ? 'no pages' : '',
|
|
239
|
+
]
|
|
240
|
+
.filter(Boolean)
|
|
241
|
+
.join(' '),
|
|
233
242
|
]));
|
|
234
243
|
(0, ui_1.note)((0, ui_1.dim)(' Serve the pages of an earlier build: xflow rollback <number>'));
|
|
244
|
+
(0, ui_1.note)((0, ui_1.dim)(' Pages live for the three latest builds; "no pages" marks the rest'));
|
|
235
245
|
(0, ui_1.note)((0, ui_1.dim)(' Fetch the code of a build: xflow pull --revision <its revision> --into ../copy'));
|
|
236
246
|
}
|
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.19.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.19.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
|
|
|
@@ -139,9 +139,13 @@ functions. The code of that build is a separate fetch (`xflow pull --revision N
|
|
|
139
139
|
../old-version`, kept outside the project folder); building it over the current one needs
|
|
140
140
|
`--force` and a human typing the project name, so you cannot do it on your own.
|
|
141
141
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
142
|
+
Pages are kept for the **three latest successful builds** plus whatever dev and live show.
|
|
143
|
+
Older versions stay in the history with `pages_kept` false: you can read what they were and
|
|
144
|
+
which revision they came from, but you cannot open or roll back to them. The history itself
|
|
145
|
+
holds the **last 30 builds** and the sources the **last 50 revisions** (a revision a live
|
|
146
|
+
version was built from is never deleted). Three builds is the whole rollback depth and on an
|
|
147
|
+
active project it is a matter of hours, so it is not a backup: keep anything you must not
|
|
148
|
+
lose in your own git repository.
|
|
145
149
|
|
|
146
150
|
**The only link you give a person is the project page**, `https://app.getxflow.com/projects/<id>`,
|
|
147
151
|
which the CLI prints for you. Refer to builds by their number ("version 481203 is built,
|
|
@@ -396,10 +400,11 @@ something. To use the account in code, link it and deploy.
|
|
|
396
400
|
Two refusals do need a person, and different ones: `connections:link` right — the owner of the
|
|
397
401
|
key grants it where the key permissions live; `not granted to you` — ask whoever connected the account.
|
|
398
402
|
|
|
399
|
-
`{NAME}` in the path or in a header value is filled in from the fields of the connection
|
|
400
|
-
names
|
|
401
|
-
|
|
402
|
-
|
|
403
|
+
`{NAME}` in the path or in a header value is filled in from the fields of the connection.
|
|
404
|
+
**Take the names from `xflow connections`**, which prints them in braces for every account,
|
|
405
|
+
linked or not: an invented name is left in the text as you typed it and the request goes out
|
|
406
|
+
anyway, into somebody's live account. `xflow env` is not that list. Only the hosts of that
|
|
407
|
+
connector are reachable and a refusal lists them.
|
|
403
408
|
|
|
404
409
|
**Ask for the shape, not the volume.** One day and `limit=1` is enough to learn what the
|
|
405
410
|
fields are called; the answer is printed head first and says when there is more. The whole
|