@getxflow/cli 0.13.0 → 0.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.
@@ -211,10 +211,10 @@ function looksJson(headers) {
211
211
  * credentials. For looking at what an API returns without deploying a function for it.
212
212
  */
213
213
  async function connectionsCall(args) {
214
- const alias = args.words[1];
214
+ const connection = args.words[1];
215
215
  const path = args.words[2];
216
- if (!alias) {
217
- throw new errors_1.CliError('A connection is required', 'Its alias in this project: xflow connections');
216
+ if (!connection) {
217
+ throw new errors_1.CliError('A connection is required', 'Its alias in this project, or its name from the first column of xflow connections');
218
218
  }
219
219
  if (!path) {
220
220
  throw new errors_1.CliError('A path is required', 'For example: xflow connections call WB /api/v1/supplier/stocks?dateFrom=2026-09-01');
@@ -235,7 +235,7 @@ async function connectionsCall(args) {
235
235
  const data = await (0, api_1.apiJson)(client, `/api/v1/projects/${projectId}/connections/call`, {
236
236
  method: 'POST',
237
237
  body: {
238
- connection: alias,
238
+ connection,
239
239
  path,
240
240
  method: (0, args_1.flagString)(args, 'method') ?? (body ? 'POST' : 'GET'),
241
241
  ...(body ? { body: body.text } : {}),
@@ -250,6 +250,10 @@ async function connectionsCall(args) {
250
250
  return;
251
251
  }
252
252
  const { request, response } = data;
253
+ // Named the account only when it was not called by its alias: with several accounts of one
254
+ // service under the same name, the alias is the only thing the caller already knew.
255
+ if (!data.alias)
256
+ (0, ui_1.note)((0, ui_1.dim)(` ${data.label} (${data.connection_id}), not linked to this project`));
253
257
  (0, ui_1.note)((0, ui_1.dim)(` ${request.method} ${request.url}`));
254
258
  for (const line of allHeaders(request.headers))
255
259
  (0, ui_1.note)((0, ui_1.dim)(` ${line}`));
package/dist/help.js CHANGED
@@ -367,7 +367,7 @@ the platform into the function.
367
367
  xflow connections link <name> --as ALIAS
368
368
  hand its credentials to the functions
369
369
  xflow connections unlink <ALIAS> take them away again
370
- xflow connections call <ALIAS> <path>
370
+ xflow connections call <name> <path>
371
371
  ask that API something, once, without deploying
372
372
 
373
373
  Every row says whether the connection is linked to this project (its alias) and what
@@ -426,11 +426,16 @@ fields are called, while the whole dataset belongs in a cloud function. ${(0, ui
426
426
  prints the envelope for a pipe: ${(0, ui_1.bold)("--json | jq '.response.body | keys'")} gives the
427
427
  field names without the body ever entering your context.
428
428
 
429
- Only an account already linked to this project can be called, because its credentials
430
- already reach the functions of that project: the command saves a deploy, it does not widen
431
- what you may touch. An account that is merely available has to be linked first, and that is
432
- a separate right and a personal grant. The call also goes out for real: ${(0, ui_1.bold)('POST')} and
433
- ${(0, ui_1.bold)('DELETE')} change things in somebody's live account, and no flag will undo that.`,
429
+ An account linked to this project is called by its alias. One that is only available is
430
+ called by its name, and no linking is needed: what the command asks is that you could have
431
+ linked it yourself, which needs the ${(0, ui_1.bold)('connections:link')} right and the account being
432
+ granted to you personally. Either way nothing widens: linked credentials already reach the
433
+ functions of this project, and an account you may link you may also read by deploying a
434
+ function into it. An account granted to somebody else stays out of reach, and the refusal
435
+ says which of the two is missing, the right or the grant.
436
+
437
+ The call goes out for real: ${(0, ui_1.bold)('POST')} and ${(0, ui_1.bold)('DELETE')} change things in
438
+ somebody's live account, and no flag will undo that.`,
434
439
  schedules: `${(0, ui_1.bold)('xflow schedules')}: running functions on a timer
435
440
 
436
441
  A schedule is a Yandex timer trigger: it calls the function itself, with no
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.13.0';
5
+ exports.CLI_VERSION = '0.14.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getxflow/cli",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "CLI for the XFlow platform: source sync, deployment and publishing of applications",
5
5
  "license": "UNLICENSED",
6
6
  "engines": {
@@ -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.13.0. They travel inside the package, so the copy
27
+ These instructions ship with xflow CLI 0.14.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
 
@@ -364,7 +364,8 @@ naming rules and the flags. Unlink refuses while a function still reads one of t
364
364
  variables and names those functions, so read that list before reaching for `--force`.
365
365
 
366
366
  Linking needs the `connections:link` right on the key, and only accounts granted to the
367
- owner of the key personally can be linked at all. If the right was taken away, say so and
367
+ owner of the key personally can be linked at all; the same right covers calling an unlinked
368
+ account. If the right was taken away, say so and
368
369
  ask the person to turn it back on in the platform settings under Developers: a key cannot
369
370
  grant it to itself. Connecting a new account and switching one off stay with a person too.
370
371
 
@@ -374,15 +375,20 @@ Before writing a function against an unfamiliar API, find out what it actually a
374
375
 
375
376
  ```
376
377
  xflow connections call WB /api/v1/supplier/stocks?dateFrom=2026-09-01
378
+ xflow connections call "Яндекс Метрика" /management/v1/counters
377
379
  xflow connections call OZON /v1/product/list --method POST --data '{}' \
378
380
  --header '{"Client-Id":"{CLIENT_ID}"}'
379
381
  ```
380
382
 
381
- The platform attaches the credentials and makes the request itself, so no deploy is needed
382
- and the key never reaches you. Only an account already linked to this project can be called:
383
- its credentials already reach that project's functions, so this saves a deploy rather than
384
- widening what you may touch. An account that is only `available, not linked` has to be linked
385
- first, and that stays a decision for a person.
383
+ The platform attaches the credentials and makes the request itself, so no deploy is needed and
384
+ the key never reaches you. A linked account is called by its alias, an `available, not linked`
385
+ one by its name: **linking first is not needed to look**, so do not ask a person about that.
386
+
387
+ **Calling is looking, not wiring**: no variable reaches the functions because you called
388
+ something. To use the account in code, link it and deploy.
389
+
390
+ Two refusals do need a person, and different ones: `connections:link` right — the owner of the
391
+ key grants it under Developers; `not granted to you` — ask whoever connected the account.
386
392
 
387
393
  `{NAME}` in the path or in a header value is filled in from the fields of the connection: the
388
394
  names are what `xflow env` shows without the alias in front, so `OZON_CLIENT_ID` is written