@blotout/qinto-cli 0.1.15 → 0.1.17

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
@@ -128,6 +128,48 @@ qinto app publish --site example.com # …and install it on a site
128
128
  qinto app status my-app --site example.com # desired vs deployed state
129
129
  ```
130
130
 
131
+ ### Get a developer organization
132
+
133
+ **A team is not an organization.** A team owns sites and installs apps; an organization owns the apps you write. Membership in a
134
+ team — even as its owner — gives you nothing in any organization, and switching the active team does not change that. Until your
135
+ account belongs to an organization, `qinto app register` refuses with one of:
136
+
137
+ ```
138
+ This credential has no organizations. Log in with `qinto login` first.
139
+ Organization <name> is not available to this credential.
140
+ ```
141
+
142
+ Neither is fixed by logging in again. `qinto whoami` says which case you are in — it prints an `Organizations:` block listing each
143
+ organization and your role in it, and prints no such block when you belong to none.
144
+
145
+ **The CLI cannot create an organization; the Qinto platform does.** Open it in a browser and click **Developer** in the sidebar,
146
+ or go straight to the Developer area:
147
+
148
+ | Environment | Developer area |
149
+ | --- | --- |
150
+ | `production` | `https://portal.qinto.io/developer` |
151
+ | `sandbox` | `https://portal.qinto.tech/developer` |
152
+
153
+ **Opening that page is the whole step.** The first visit creates a personal organization named after your email address and makes
154
+ you its owner — nothing is approved, granted, or provisioned by anyone else. Use the organization switcher at the top of the
155
+ Developer sidebar to rename it, or **Create organization** to add another (one per customer or product, say).
156
+
157
+ To publish under an organization that already exists — a company's, rather than your own — one of its owners invites you under
158
+ **Developer → Organization members** and you accept the emailed link. An organization cannot be joined by naming its id.
159
+
160
+ Back in the terminal the organization appears immediately: the CLI reads it from the API on every call, so **no new login is
161
+ needed**. Pass it by id or name with `--org`.
162
+
163
+ ```sh
164
+ qinto whoami # confirm the Organizations block now lists it
165
+ qinto app register ./my-app --org "Acme Inc."
166
+ ```
167
+
168
+ If `whoami` still lists no organization when you know you belong to one, the login is too narrow rather than the organization
169
+ missing: your account identity needs the `profile` scope and every `qinto app` command needs `developer`. A plain `qinto login`
170
+ requests both, a login narrowed with `--scopes` may not, and `whoami` names it — `Authenticated with an OAuth token without the
171
+ profile scope.` Run `qinto login --reauthorize` and grant them.
172
+
131
173
  ### Scaffold — `qinto app create [dir]`
132
174
 
133
175
  Asks for the app name, proposes a slug derived from it that you confirm or replace, and asks which template to start from. It
@@ -168,8 +210,9 @@ declares only its build tooling.
168
210
 
169
211
  ### Register — `qinto app register [dir]`
170
212
 
171
- Registers the slug under an organization. `create --register` calls it for you; run it directly to register an app you scaffolded
172
- earlier or wrote by hand. The slug is immutable and unique inside the organization.
213
+ Registers the slug under an organization — see [Get a developer organization](#get-a-developer-organization) when you have none.
214
+ `create --register` calls it for you; run it directly to register an app you scaffolded earlier or wrote by hand. The slug is
215
+ immutable and unique inside the organization.
173
216
 
174
217
  The slug, name, and description come from `qinto.app.jsonc` — the one in `dir`, or the one in the current directory when you pass
175
218
  no `dir`. Pass `--slug`, `--name`, and `--description` only for an app that has no manifest yet; alongside a manifest they are
@@ -220,8 +263,19 @@ goes caller → the site worker's broker → callee, each app in its own worker.
220
263
  apps are mounted; a `private` one is refused with `403 forbidden` until you approve it under **App-to-app approvals** on the
221
264
  callee's page, exactly as a site manager does on a deployed site.
222
265
 
266
+ **An app you call but do not have is mocked for you.** When a mounted app's `rpc.calls` names a slug nothing mounts, `dev`
267
+ scaffolds `mocks/<slug>.ts` inside the calling app — one exported function per function it exposes — and mounts it under that
268
+ slug. `ctx.apps.call('resend', 'send', args)` then takes the real path: caller → broker → the mock's own worker, with no `if` in
269
+ your code and nothing to change when the real app arrives beside you.
270
+
271
+ If you are logged in, the mock is typed: `dev` fetches the app's published rpc contract, writes it next to the stub as
272
+ `mocks/<slug>.rpc.json`, generates `mocks/<slug>.types.ts` from it, and the platform validates every call and result against it —
273
+ so a mock that lies about its shape fails locally the way the real app would. Commit all three files; the sidecar keeps the mock
274
+ typed offline and for anyone else who checks the app out. Without a contract (not logged in, or the app is unpublished) the stub
275
+ takes and returns `unknown` and the terminal says why.
276
+
223
277
  An app folder added or removed while `dev` is running is not picked up — it says so and asks for a restart. A save inside a
224
- mounted app rebuilds that app alone.
278
+ mounted app rebuilds that app and every mock alongside it.
225
279
 
226
280
  Declared `server.schedules` fire on their own while `dev` runs — at the cron's minute, in UTC, with `scheduledTime` set to that
227
281
  instant, exactly as the deployed sweep dispatches them. Each schedule on the app's console page also has a **Run now** button,
@@ -489,7 +543,7 @@ digest is what the version is finalized against. Every field and option is docum
489
543
  | `variables` | Up to 32 per-install settings a team fills in — `plain` or `secret`, `text`/`password`/`toggle`. |
490
544
  | `appVariables` | Up to 16 settings you fill in once for the whole app with `qinto app var set` / `qinto app secret set`. |
491
545
  | `endpoints` | Up to 16 HTTP routes served at `https://<site>/app/<slug><path>`. |
492
- | `rpc` | Functions this app `exposes` to other apps, and the ones it `calls` on them. |
546
+ | `rpc` | Functions this app `exposes` to other apps, and the ones it `calls` on them. Each exposed one is built with `defineRpc`, and publish uploads its argument and result schemas as the version's contract. |
493
547
  | `events` | The push topics this app broadcasts to every app on the site. |
494
548
  | `ui` | `dir` holding the built panel, and the `build` command that produces it. |
495
549
  | `install` | `multiple: true` to let a site install the app more than once, plus a `labelHint`. |