@getxflow/cli 1.2.2 → 1.4.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/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 = '1.2.2';
5
+ exports.CLI_VERSION = '1.4.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,24 +1,24 @@
1
- {
2
- "name": "@getxflow/cli",
3
- "version": "1.2.2",
4
- "description": "CLI for the XFlow platform: projects with apps, functions and a database; source sync, deployment and publishing",
5
- "license": "UNLICENSED",
6
- "engines": {
7
- "node": ">=20"
8
- },
9
- "bin": {
10
- "xflow": "dist/bin.js"
11
- },
12
- "files": [
13
- "dist",
14
- "skills"
15
- ],
16
- "scripts": {
17
- "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
18
- "build": "npm run clean && tsc -p tsconfig.json",
19
- "prepublishOnly": "npm run build"
20
- },
21
- "publishConfig": {
22
- "access": "public"
23
- }
24
- }
1
+ {
2
+ "name": "@getxflow/cli",
3
+ "version": "1.4.0",
4
+ "description": "CLI for the XFlow platform: projects with apps, functions and a database; source sync, deployment and publishing",
5
+ "license": "UNLICENSED",
6
+ "engines": {
7
+ "node": ">=22"
8
+ },
9
+ "bin": {
10
+ "xflow": "dist/bin.js"
11
+ },
12
+ "files": [
13
+ "dist",
14
+ "skills"
15
+ ],
16
+ "scripts": {
17
+ "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
18
+ "build": "npm run clean && tsc -p tsconfig.json",
19
+ "prepublishOnly": "npm run build"
20
+ },
21
+ "publishConfig": {
22
+ "access": "public"
23
+ }
24
+ }
@@ -12,7 +12,8 @@ address and runs its backend: one database and cloud functions per project.
12
12
  No `xflow.json` in the folder or above it means it is not bound to a project yet:
13
13
  `xflow projects list` names the projects of the organization with their ids, `xflow link <id>`
14
14
  binds the folder to one (an empty folder gets the whole project), and `xflow init` starts a new
15
- project with its first app.
15
+ project with its first app. A person signed in to several organizations names the one that gets it:
16
+ `xflow init <dir> --org <name>` (ask them which one if unsure; `xflow org` lists them).
16
17
 
17
18
  ## First rule
18
19
 
@@ -27,7 +28,7 @@ instead of guessing; give the person https://docs.getxflow.com when they ask how
27
28
 
28
29
  ## Keeping these instructions current
29
30
 
30
- These instructions ship with xflow CLI 1.2.2, so the copy you are reading can be older than
31
+ These instructions ship with xflow CLI 1.4.0, so the copy you are reading can be older than
31
32
  the CLI answering your commands.
32
33
 
33
34
  When the CLI says this file does not match it, run `xflow skills --refresh` and then **read
@@ -62,8 +63,8 @@ the error points away from the cause. The sections below carry the details.
62
63
  name it already holds with different content. A schema change is always a new file.
63
64
  7. When `xflow db migrate` answers `db_write_locked`, or an INSERT or CREATE TABLE in a
64
65
  function fails with `permission denied` (42501), the database is over its plan size and
65
- Postgres itself refuses. Reads, updates and deletes keep working, so the fix is a migration
66
- that deletes data, never a rewrite of the SQL. Write comes back within the hour. The limit
66
+ Postgres itself refuses. Reads, updates and deletes keep working, so the fix is deleting data
67
+ (`xflow db exec` or a migration), never a rewrite of the SQL. Write comes back within the hour. The limit
67
68
  is shared by the organization: `xflow db list` shows the size of each project database.
68
69
  8. Heavy media does not travel with the sources. Photos, video and PDFs go up with
69
70
  `xflow storage push`, not into the repository: the archive is capped at 10 MB.
@@ -117,7 +118,7 @@ people in the organization, database and file storage, function minutes, builds
117
118
  (one count for all projects of the organization) and how often they may run, and which access levels an app may have. Most are finite; a plan
118
119
  may leave one uncapped, and then `whoami` prints `no limit` instead of a ceiling.
119
120
  `xflow whoami` prints every one of them next to what is used, and the rights of your own key
120
- with them: destroying data in a migration, deleting files from storage, moving a database and
121
+ with them: destroying data (a migration or `db exec`), deleting files from storage, moving a database and
121
122
  linking a connected account each need a right. Reading it before a long task turns a refusal
122
123
  halfway through the work into a sentence said before it starts.
123
124
 
@@ -550,6 +551,12 @@ own `limit` asks, 50 without one, 300 at most; `--json` prints long values whole
550
551
  and zsh, cmd.exe wants double ones; a query with quotes of its own goes in a `.sql` file outside
551
552
  the project, `xflow db query ../q.sql`.
552
553
 
554
+ A one-off data fix is `xflow db exec 'update ...'` (or `../fix.sql`), not a migration: one
555
+ INSERT, UPDATE, DELETE or MERGE, saved at once, never re-run, no trace in the migration history.
556
+ Schema changes are refused there. Deleting rows, or updating more than 100 in a table (cascades
557
+ and triggers count), asks for `--allow-destructive`, and deleting also for the right below.
558
+ There is no undo: read the rows with `db query` first.
559
+
553
560
  The platform keeps no database history and no backups, so anything that destroys data
554
561
  (`DROP TABLE`, `DROP COLUMN`, `TRUNCATE`, `DELETE`) needs both the `--allow-destructive` flag and
555
562
  the right to destroy data on the key, which is off by default and only its owner turns on. It is
@@ -582,8 +589,14 @@ An own server comes tuned and guarded, so do not tune it from migrations:
582
589
  scheduled function writing a summary table). A scheduled job that genuinely needs more runs
583
590
  `SET statement_timeout = '5min'` on its own connection. A database that used `citext` or
584
591
  another extension type cannot move back to `platform`.
585
- - A restart on a plan change takes about a minute. Create the `Client` inside the handler, or
586
- keep a `Pool` at module level: a `Client` created at module level dies with the restart.
592
+ - A restart on a plan change takes about a minute.
593
+
594
+ Calls of one project run at the same time in one process. A `Client`, even one made at module
595
+ level, gets its own pooled connection for each call, so `connect()` twice is fine. Keep
596
+ per-request data out of module-level variables. Session state (`SET` without `LOCAL`, temp tables,
597
+ advisory locks) lasts until the call ends, and a transaction left open is rolled back: set what
598
+ the call needs inside the handler. A `Client` that listens for `notification` keeps its own
599
+ connection.
587
600
 
588
601
  ## File storage
589
602