@getxflow/cli 0.20.1 → 0.20.2

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.
@@ -210,7 +210,7 @@ async function list() {
210
210
  const orgs = (0, credentials_1.listOrgs)(client.apiUrl);
211
211
  if (client.source === 'active' && orgs.length > 1) {
212
212
  const name = orgs.find((org) => org.active)?.name;
213
- (0, ui_1.note)((0, ui_1.dim)(` Projects of ${name ? `"${name}"` : 'the active organization'} alone: the rest of xflow org answer after org switch`));
213
+ (0, ui_1.note)((0, ui_1.dim)(` Projects of ${name ? `"${name}"` : 'the active organization'} only. For another organization: xflow org switch <name or id>`));
214
214
  }
215
215
  }
216
216
  async function get(args) {
package/dist/help.js CHANGED
@@ -175,13 +175,14 @@ project, the flag therefore goes somewhere else than the folder does. An id hand
175
175
  ${(0, ui_1.bold)('projects get')} or ${(0, ui_1.bold)('link')} behaves the same way: typed by hand, it is not redirected
176
176
  by a config lying around either.
177
177
 
178
- The id is echoed back on every run. It is the one place a project is named by hand,
179
- and a wrong id answers "not found" on a read but works on a write.
178
+ The id is echoed back on every run, with the organization that holds the project. It
179
+ is the one place a project is named by hand, and a wrong id answers "not found" on a
180
+ read but works on a write.
180
181
 
181
182
  With several organizations signed in, the one holding the project is looked for on
182
183
  every call: there is no folder to write the answer into, and a second place to
183
- remember it would be a second thing to keep true. One ${(0, ui_1.bold)('xflow org switch')} to the
184
- right organization spares that search.`,
184
+ remember it would be a second thing to keep true. When most calls go to one project,
185
+ ${(0, ui_1.bold)('xflow org switch')} to its organization skips that search.`,
185
186
  projects: `${(0, ui_1.bold)('xflow projects')}: the projects of the organization
186
187
 
187
188
  xflow projects list every project, its versions state and age
package/dist/session.js CHANGED
@@ -103,10 +103,6 @@ async function connectProject(projectId, root, config) {
103
103
  (0, ui_1.note)((0, ui_1.dim)(` The project belongs to "${hit.name ?? hit.organizationId}", not to the active organization: the folder is bound to it`));
104
104
  }
105
105
  }
106
- else if (hit.organizationId !== session.organizationId) {
107
- // Nothing was written down, so the next command pays for the same search.
108
- (0, ui_1.note)((0, ui_1.dim)(` The project belongs to "${hit.name ?? hit.organizationId}": xflow org switch spares the next command this search`));
109
- }
110
106
  return {
111
107
  apiUrl: session.apiUrl,
112
108
  token: hit.token,
@@ -144,11 +140,14 @@ async function projectTarget(args, options) {
144
140
  if (!isProjectId(named)) {
145
141
  throw new errors_1.CliError(`--project takes a project id, got "${named}"`, 'The ids: xflow projects list');
146
142
  }
143
+ const client = await connectProject(named, null);
147
144
  // Echoed back on every human run: the flag is the only place the id is typed by
148
- // hand, and a wrong one answers 404 on a read and works on a write. Under --json
145
+ // hand, and a wrong one answers 404 on a read and works on a write. The
146
+ // organization is named too, since it may not be the active one. Under --json
149
147
  // the line is silenced with the rest, where the payload is the whole answer.
150
- (0, ui_1.note)((0, ui_1.dim)(` Project ${named} (--project)`));
151
- return { projectId: named, client: await connectProject(named, null), root: null };
148
+ const org = (0, credentials_1.listOrgs)(client.apiUrl).find((entry) => entry.organizationId === client.organizationId);
149
+ (0, ui_1.note)((0, ui_1.dim)(` Project ${named}${org ? ` of "${org.name ?? org.organizationId}"` : ''} (--project)`));
150
+ return { projectId: named, client, root: null };
152
151
  }
153
152
  const { root, config } = (0, config_1.requireProject)();
154
153
  const client = options?.probe === true ? await connectProject(config.projectId, root, config) : connect(config);
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.20.1';
5
+ exports.CLI_VERSION = '0.20.2';
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.20.1",
3
+ "version": "0.20.2",
4
4
  "description": "CLI for the XFlow platform: source sync, deployment and publishing of applications",
5
5
  "license": "UNLICENSED",
6
6
  "engines": {
@@ -22,7 +22,7 @@ contains the fix.
22
22
 
23
23
  ## Keeping these instructions current
24
24
 
25
- These instructions ship with xflow CLI 0.20.1, so the copy you are reading can be older than
25
+ These instructions ship with xflow CLI 0.20.2, so the copy you are reading can be older than
26
26
  the CLI answering your commands.
27
27
 
28
28
  When the CLI says this file does not match it, run `xflow skills --refresh` and then **read