@blotout/qinto-cli 0.1.13 → 0.1.14

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/README.md CHANGED
@@ -234,10 +234,13 @@ Three surfaces, one per side of the product:
234
234
  declares. It renders the same form the Qinto platform
235
235
  does — text, toggle, and write-only secrets — and an install stays `inactive`, receiving nothing, until every `required`
236
236
  variable is filled in. Adding an install is offered only for an app whose manifest sets `install.multiple`, and the last
237
- install is never removable — uninstall the app instead.
237
+ install is never removable — uninstall the app instead. **Analytics → ID graph** opens the visitor's anon, alias and person
238
+ objects exactly as the platform's page does: paste an anon id, an email or a person id and read its keys and tables as your
239
+ app writes into them.
238
240
  - **The demo site** is the customer's page. It loads `q.js` from the local site worker and drives every method the tag exposes —
239
241
  `track`, `identify`, `consent`, `alias`, `getSession` — then shows which app bundles `q.js` carried and which installs
240
- activated. Its **Events** panel has a button for each of the eleven standard events in
242
+ activated. Its **Visitor** panel shows the browser's anon id, the one to paste into the ID graph page, and the person id
243
+ once `identify` links one. Its **Events** panel has a button for each of the eleven standard events in
241
244
  [the standard events reference](https://docs.qinto.io): selecting one loads its documented payload into an editable box,
242
245
  and **Track it** sends whatever is in it, so you can fire the real shape or your own. Every event reaches your hooks;
243
246
  only one carrying a numeric `value` and a non-empty `orderId` — `Purchase`, among the standard ones — is also recorded as a
@@ -305,18 +308,18 @@ now. When it closes, the public URL stops being advertised and the loopback one
305
308
  new on every run, so a vendor has to be told the new one each time. A named tunnel keeps one hostname. `dev` reads it from **your
306
309
  own Cloudflare account**, never from anything Qinto holds.
307
310
 
308
- In the Cloudflare dashboard, create a tunnel and give it a **public hostname pointing at `http://127.0.0.1:4310`** — the port
309
- `--worker-port` sets. Then run `qinto app dev --tunnel-name <name>`. The first time, `dev` asks for the two things it needs and
310
- tells you how to make them:
311
+ Run `qinto app dev --tunnel-name <name>`. The first time, `dev` asks for the two things it needs and tells you how to make them:
311
312
 
312
313
  ```
313
314
  A named tunnel is read from your own Cloudflare account, and qinto has no credentials for it yet.
314
315
 
315
316
  1. Open https://dash.cloudflare.com/profile/api-tokens
316
317
  2. Select Create Token, then Create Custom Token.
317
- 3. Under Permissions, add one row: Account > Cloudflare Tunnel > Edit
318
- That is the only permission qinto needs. Do not add more.
319
- 4. Under Account Resources, select the account that holds the tunnel.
318
+ 3. Under Permissions, add: Account > Cloudflare Tunnel > Edit
319
+ To let qinto create the tunnel for you, also add: Zone > Zone > Read and Zone > DNS > Edit
320
+ Nothing more: the token is saved on this machine.
321
+ (An account-owned token lists the first row as Cloudflare One Connector: cloudflared, or Argo Tunnel (Legacy).)
322
+ 4. Under Account Resources, select the account that holds the tunnel; under Zone Resources, the zone its hostname is on.
320
323
  5. Create the token and copy it — Cloudflare shows it once.
321
324
 
322
325
  Your account ID is the last part of the dashboard URL:
@@ -330,6 +333,28 @@ saved pair and overwrite nothing — that is how CI, or a second account, runs.
330
333
  rather than paired with a credential from somewhere else. `--no-input`, and a run with no terminal, say what to set instead of
331
334
  prompting.
332
335
 
336
+ **A tunnel that does not exist yet is created for you.** When the account has no tunnel under that name, `dev` says so and asks
337
+ whether to create it. Say yes and it asks for the public hostname a vendor should call — a zone on that account or a name one
338
+ level below it, such as `hooks.example.com`; Universal SSL covers no deeper name, so a deeper one is refused before anything is
339
+ made — then makes the tunnel under the name you gave `--tunnel-name`, routes that hostname to
340
+ `http://127.0.0.1:4310` (the port `--worker-port` sets), and adds the proxied CNAME record for it to your zone. The zone is found
341
+ from the hostname, so nothing is created when no zone on the account holds it; a failure after the tunnel exists — a DNS record
342
+ already on that name, or a token without the zone rows — removes the tunnel again, so a fixed token or a different hostname is a
343
+ clean retry. `dev` never deletes a DNS record: when the record's write got no readable answer, it names the record to check in the
344
+ dashboard instead. From then on the tunnel is found by name and nothing is asked. Say no and `dev` prints the dashboard steps
345
+ instead:
346
+
347
+ ```
348
+ To create the tunnel "hooks" yourself:
349
+ 1. Open https://one.dash.cloudflare.com/<account-id>/networks/tunnels and select Create a tunnel.
350
+ 2. Choose Cloudflared and name it "hooks". Skip installing a connector — qinto runs cloudflared for you.
351
+ 3. Under Public Hostnames, add the hostname a vendor should call, with service http://127.0.0.1:4310 (the port --worker-port sets).
352
+ Then run the command again.
353
+ ```
354
+
355
+ `--no-input`, and a run with no terminal, print the same steps rather than creating anything: making a tunnel and a DNS record
356
+ in your account is a question, and a run that promised no prompts cannot ask it.
357
+
333
358
  `dev` looks the tunnel up by name and runs it on the token it fetched. cloudflared reads ingress rules top to bottom and stops at
334
359
  the first match, so the rule that decides a hostname is often not the rule naming it — an earlier catch-all, wildcard, or
335
360
  same-hostname rule takes the request first. A hostname is advertised only when **every rule that can take it points at your worker
@@ -358,7 +383,7 @@ browser, `curl` or the vendor will read. By the time the URL is printed it works
358
383
  **Only the site worker is exposed** — the same worker, and the same code, that faces the internet on a deployed site. The console
359
384
  is never tunneled: it installs apps and shows your variables, and it answers a loopback `Host` and nothing else.
360
385
 
361
- Two things behave differently from a deployed site, and `dev` says so rather than letting you discover them:
386
+ Four things behave differently from a deployed site, and `dev` says so rather than letting you discover them:
362
387
 
363
388
  - **`ai`, `vectorize`, and a `hyperdrive` with no local database URL are not bound.** Each needs a Cloudflare account or a
364
389
  database only you can name, so the app boots without those bindings and the start-up banner lists them. Give a hyperdrive its
@@ -366,6 +391,15 @@ Two things behave differently from a deployed site, and `dev` says so rather tha
366
391
  - **Two mounted apps cannot bind the same hyperdrive name to different databases.** workerd names a hyperdrive connection after
367
392
  the binding — your app's own `env.DATABASE` — and keeps the first of a name, so the second app's binding is reported inert
368
393
  instead of silently reaching the first app's database. Rename the binding, or point both at one database.
394
+ - **A `pipeline` writes to a local catalog, not to Cloudflare.** `send()` checks each record against the manifest schema, runs
395
+ the sink `select` on SQLite and appends the rows to `namespace.table` under `~/.qinto/dev/<hash>/catalog/`; `query.catalog`
396
+ reads them back with SQLite plus `to_timestamp_millis`, `date_trunc` and the `json_get_*` functions. The banner prints the
397
+ directory so `sqlite3` can open it, and `--reset` clears it.
398
+ - **An `analytics_engine` dataset is a local SQLite file.** `writeDataPoint` stores the point with the columns Analytics Engine
399
+ gives it, and `query.analytics` reads it back through the same statement gate the platform applies, plus the documented
400
+ Analytics Engine functions — a name outside that list is refused locally rather than answered by SQLite, so a query that runs
401
+ here runs deployed. The one thing it cannot reproduce is the throw: a point that breaks a documented limit is reported on the
402
+ terminal and dropped, where a deployed hook would throw. The banner prints the file, and `--reset` clears it.
369
403
 
370
404
  **The UI panel.** When your manifest declares a `ui` block, `dev` runs its build with the same base path a published panel is
371
405
  served under — `/<appId>/<version>/` — and serves the result on its own port (`--ui-port`, default 4302); every mounted app's