poad 2.69.0 → 2.70.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "poad",
3
- "version": "2.69.0",
3
+ "version": "2.70.0",
4
4
  "engine": "0.28.0",
5
5
  "runner": "0.5.0",
6
6
  "main": "index.js",
package/project/logs.js CHANGED
@@ -2,7 +2,7 @@
2
2
  // poad logs les 100 dernières lignes, tous services
3
3
  // poad logs data auth seulement ces services (gateway, data, auth,
4
4
  // storage, meta, functions, flows, postgres,
5
- // logs, engine, mailpit, keycloak, valkey)
5
+ // files, logs, engine, mailpit, keycloak, valkey)
6
6
  // poad logs level=warn warn, error et fatal
7
7
  // poad logs since=15m depuis 15 minutes (s, m, h, d)
8
8
  // poad logs request=6f1c… tout le chemin d'une requête (début de l'id suffit)
package/project/source.js CHANGED
@@ -8,7 +8,7 @@
8
8
  // poad source link <table> --url https://… | --storage bucket/chemin [--format f] [--delimiter ;] [--no-header]
9
9
  // [--encoding e] [--root a.b] [--columns a,b]
10
10
  // table distante sur fichier (mode virtual, engine 0.67.0+) : CSV, JSON, JSON-L,
11
- // GeoJSON ou Parquet lu par DuckDB dans Postgres à chaque requête, rien n'est copié
11
+ // GeoJSON ou Parquet lu par poad-files dans Postgres à chaque requête, rien n'est copié
12
12
  // poad source test <nom> table liée ou distante : vérifie l'adresse (garde des adresses internes),
13
13
  // rebranche, lit une ligne par Postgres
14
14
  // poad source pull <nom> [--force] rapatrie la déclaration d'une source (créée dans la console
@@ -54,7 +54,7 @@ const FINAL = ['completed', 'failed', 'cancelled'];
54
54
  const USAGE = 'Usage: poad source ls | refresh <name> [--force] [--detach] | import <file> [--table <table>] [--name <source>] | link <table> --host <host> --database <db> --remote <schema.table> --credential <name> | link <table> --url <https://…> | --storage <bucket>/<path> | test <name> | pull <name> [--force] [--stdout], and --env <name> | --project <id> for poad.io';
55
55
  const LINK_USAGE = 'Usage: poad source link <table> --host <host> --database <db> --remote <schema.table> --credential <name> [--port <port>] [--sslmode require|verify-full|disable] [--columns <col,…>] [--env <name>]\n or: poad source link <table> --url <https://…> | --storage <bucket>/<path> [--format csv|json|jsonl|geojson|parquet] [--delimiter <c>] [--no-header] [--encoding utf-8|latin-1|utf-16] [--root <a.b>] [--columns <col,…>] [--env <name>]';
56
56
  const SSLMODES = ['require', 'verify-full', 'disable'];
57
- /** Formats d'une table distante sur fichier (meta, engine 0.67.0 : lus par DuckDB) */
57
+ /** Formats d'une table distante sur fichier (meta, engine 0.67.0 : lus par DuckDB ; 0.68.0 : par poad-files) */
58
58
  const REMOTE_FORMATS = ['csv', 'json', 'jsonl', 'geojson', 'parquet'];
59
59
  const REMOTE_ENCODINGS = ['utf-8', 'latin-1', 'iso-8859-1', 'windows-1252', 'utf-16'];
60
60
  const BUCKET_RE = /^[a-z0-9][a-z0-9._-]{0,62}$/;
@@ -192,7 +192,7 @@ const sourceLines = (s, width = 0) => {
192
192
  return [chalk.redBright(` ✖ ${name} ${s.file}`), chalk.redBright(` ${first.line ? `line ${first.line}: ` : first.path ? `${first.path}: ` : ''}${first.message || 'invalid declaration'}${more}`)];
193
193
  }
194
194
  if (s.mode === 'virtual' && (s.remote || (s.origin && s.origin.kind === 'file'))) {
195
- // Table distante sur fichier : DuckDB relit le fichier à chaque requête ; branchée (user mapping posé) ou non
195
+ // Table distante sur fichier : poad-files relit le fichier à chaque requête ; branchée ou non (adresse refusée)
196
196
  const attached = Boolean(s.remote && s.remote.attached) && s.table_exists !== false;
197
197
  const where = (s.remote && s.remote.location) || remoteLocation(s.origin);
198
198
  const format = (s.remote && s.remote.format) || (s.origin && s.origin.format) || '';
@@ -607,7 +607,7 @@ const main = async (args = {}, raw, deps = {}) => {
607
607
  if (json) return console.log(JSON.stringify(r, null, 2));
608
608
  const ms = typeof r.duration_ms === 'number' ? ` (${Math.round(r.duration_ms)} ms)` : '';
609
609
  if (r.location) {
610
- // Table distante sur fichier : lue par Postgres (DuckDB), à l'emplacement rendu sans query string
610
+ // Table distante sur fichier : lue par Postgres (poad-files), à l'emplacement rendu sans query string
611
611
  console.log(`${chalk.greenBright('✔')} ${chalk.bold(name)} ${chalk.grey(`the remote file is readable${ms}, ${remoteLocation({ url: /^https?:/.test(r.location) ? r.location : null, storage: null }) || r.location}`)}`);
612
612
  if (r.table) console.log(chalk.grey(` ${r.table}: read by Postgres, nothing copied${typeof r.sample_rows === 'number' ? `, ${r.sample_rows ? 'rows found' : 'no row'}` : ''}`));
613
613
  return;
@@ -622,7 +622,7 @@ const main = async (args = {}, raw, deps = {}) => {
622
622
  // (utilisateur et mot de passe) est déjà dans le coffre : poad credential, ou l'écran Credentials ; jamais ici.
623
623
  // Table distante sur fichier (engine 0.67.0) : l'engine vérifie l'adresse (garde des adresses internes) ou l'objet du
624
624
  // Stockage, lit un échantillon et propose les colonnes ; puis la déclaration (poad/sources/<table>.yaml) et la
625
- // migration de la table étrangère (duckdb_fdw) sont écrites. Rien n'est copié : chaque requête relit le fichier.
625
+ // migration de la table étrangère (file_fdw) sont écrites. Rien n'est copié : chaque requête relit le fichier.
626
626
  const linkFile = async (o) => {
627
627
  const t = await ready();
628
628
  if (!t) return;
@@ -97,7 +97,7 @@ const sheets = {
97
97
  logs: {
98
98
  usage: ['poad logs [service …] [<filter>=<value> …] [-f] [--json]'],
99
99
  text: [
100
- 'Unified logs of the project (every service, the project functions and flow steps), the latest 100 lines by default. Services: gateway, data, auth, storage, meta, functions, flows, postgres, logs, engine, mailpit, keycloak, valkey, ai.',
100
+ 'Unified logs of the project (every service, the project functions and flow steps), the latest 100 lines by default. Services: gateway, data, auth, storage, meta, functions, flows, postgres, files (remote tables, engine 0.68.0+), logs, engine, mailpit, keycloak, valkey, ai.',
101
101
  ],
102
102
  options: [
103
103
  ['level=warn', 'warn, error and fatal'],
@@ -298,7 +298,7 @@ const sheets = {
298
298
  ['import <file>', 'load a CSV, JSON, GeoJSON, JSONL, ICS, XLSX, ODS, XML, KML, KMZ or GPX file (.gz accepted, no size limit) into a table: the file goes to the system bucket poad-sources (resumable upload when the storage offers it), the engine reads a sample, proposes the columns and a key, declares an imported source (origin kind: upload) and loads it, streamed; a source is named after its table (poad/sources/<table>.yaml); the source already exists: a new version, same path, then the load. --table <name> (default: the file name; cleaned: lowercase, accents removed, spaces → _, leading digit → t_), --name <source> (kept for compatibility: an existing source of that name gets a new version, otherwise ignored), --key <col,…>, --existing (load into an existing table), --format and --root when the guess is wrong. ICS, XLSX, ODS, XML, KML, KMZ and GPX are read by the source-read step itself (engine with meta 1.43.0): --sheet <name or position> and --header <row, or none> for a spreadsheet (default: the first sheet that has rows, first row with two cells or more), --records <path> for XML (channel/item; RSS and Atom are found alone), --expand-until <YYYY-MM-DD> for a calendar (one row per occurrence of repeated events instead of one row per event), --kinds wpt,rte,trk for GPX; what the reader chose is written in the declaration (origin.<format>)'],
299
299
  ['--key-generated <kind>', 'import, new table without a natural key: poad adds an id column first, key: { generated: <kind> } in the declaration. uuid (gen_random_uuid()) or identity (sequential bigint): each new version replaces the whole table content in one transaction (the API never sees it empty), under the deletion guard on the net row loss; hash: SHA-256 of the row values, an unchanged row keeps its id (a modified row is removed then added)'],
300
300
  ['link <table>', 'a linked table (mode virtual, engine 0.66.0+): a table of another PostgreSQL database read on every query through a foreign table (postgres_fdw), nothing copied. The engine checks the host (internal addresses refused: private network, localhost, link-local, the engine), connects read-only with the credential (a "Database login" of the vault: user and password, never on the command line), proposes the columns of --remote <schema.table> (--columns keeps some of them, remote names), then writes poad/sources/<table>.yaml and the migration of the foreign table. Private: never served by the API'],
301
- ['link <table> --url | --storage', 'a remote table over a file (mode virtual, engine 0.67.0+): a CSV, JSON (array, --root for where the rows are), JSON-L, GeoJSON (geometry as PostGIS geometry) or Parquet file (.gz accepted) read by DuckDB inside Postgres (duckdb_fdw) on every query, nothing copied: select, where, join with the tables of the project, aggregates; filters are pushed to the file reader. --url <https://…> (internal addresses refused: private network, localhost, link-local, NAT64, the engine, another poad project; no credential, no secret in the address) or --storage <bucket>/<path> (an object of the project storage, local or S3). The engine reads a sample, proposes the columns (--columns keeps some of them, field names), then writes poad/sources/<table>.yaml and the migration of the foreign table. Private: never served by the API'],
301
+ ['link <table> --url | --storage', 'a remote table over a file (mode virtual, engine 0.67.0+): a CSV, JSON (array, --root for where the rows are), JSON-L, GeoJSON (geometry as PostGIS geometry) or Parquet file (.gz accepted) read by poad-files inside Postgres (file_fdw, engine 0.68.0; DuckDB in 0.67.0) on every query, nothing copied: select, where, join with the tables of the project, aggregates; filters are pushed to the file reader. --url <https://…> (internal addresses refused: private network, localhost, link-local, NAT64, the engine, another poad project; no credential, no secret in the address) or --storage <bucket>/<path> (an object of the project storage, local or S3). The engine reads a sample, proposes the columns (--columns keeps some of them, field names), then writes poad/sources/<table>.yaml and the migration of the foreign table. Private: never served by the API Separator, header, encoding, decimal comma and dd/mm/yyyy dates are detected and written to the declaration; --delimiter, --no-header and --encoding only override the detection. A ZIP archive holding one file is read as that file (entry: in the declaration when it holds several).'],
302
302
  ['test <name>', 'a linked or remote table: check the address again, reattach it and read one row through Postgres (duration, location without its query string); exit code 1 if it cannot be read'],
303
303
  ['pull <name>', 'write the declaration of a source into poad/sources/<name>.yaml: with --env, a source created in the console of poad.io (kept in the project database); commit it, then poad deploy'],
304
304
  ['--force', 'refresh: lift the deletion guard (safety.maxDeletePercent) for this run: the source is right even though many rows go away; pull: replace an existing poad/sources/<name>.yaml'],