@poli-page/cli 0.11.0 → 0.13.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/README.md +141 -40
- package/dist/api-client.d.ts +85 -8
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +157 -4
- package/dist/api-client.js.map +1 -1
- package/dist/cloud-context.d.ts +1 -1
- package/dist/cloud-context.js +1 -1
- package/dist/commands/auth.d.ts +4 -0
- package/dist/commands/auth.d.ts.map +1 -1
- package/dist/commands/auth.js +6 -2
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/clone.d.ts +32 -0
- package/dist/commands/clone.d.ts.map +1 -0
- package/dist/commands/clone.js +266 -0
- package/dist/commands/clone.js.map +1 -0
- package/dist/commands/dev.d.ts +57 -4
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +318 -46
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/env.d.ts.map +1 -1
- package/dist/commands/env.js +11 -4
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +14 -9
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/link.d.ts +41 -2
- package/dist/commands/link.d.ts.map +1 -1
- package/dist/commands/link.js +107 -16
- package/dist/commands/link.js.map +1 -1
- package/dist/commands/new.d.ts.map +1 -1
- package/dist/commands/new.js +1 -7
- package/dist/commands/new.js.map +1 -1
- package/dist/commands/publish.js +2 -2
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/sync.d.ts +52 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +224 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -0
- package/dist/constants.js.map +1 -1
- package/dist/credentials.d.ts +6 -1
- package/dist/credentials.d.ts.map +1 -1
- package/dist/credentials.js +28 -10
- package/dist/credentials.js.map +1 -1
- package/dist/dev-page.d.ts.map +1 -1
- package/dist/dev-page.js +24 -0
- package/dist/dev-page.js.map +1 -1
- package/dist/draft-bases.d.ts +54 -0
- package/dist/draft-bases.d.ts.map +1 -0
- package/dist/draft-bases.js +253 -0
- package/dist/draft-bases.js.map +1 -0
- package/dist/draft-files.d.ts +96 -0
- package/dist/draft-files.d.ts.map +1 -0
- package/dist/draft-files.js +447 -0
- package/dist/draft-files.js.map +1 -0
- package/dist/exit-codes.d.ts +4 -3
- package/dist/exit-codes.d.ts.map +1 -1
- package/dist/exit-codes.js +9 -5
- package/dist/exit-codes.js.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +6 -3
- package/dist/program.js.map +1 -1
- package/dist/project-files.d.ts +8 -1
- package/dist/project-files.d.ts.map +1 -1
- package/dist/project-files.js +22 -1
- package/dist/project-files.js.map +1 -1
- package/dist/project-sync.d.ts +88 -16
- package/dist/project-sync.d.ts.map +1 -1
- package/dist/project-sync.js +283 -46
- package/dist/project-sync.js.map +1 -1
- package/dist/slug.d.ts +8 -0
- package/dist/slug.d.ts.map +1 -0
- package/dist/slug.js +15 -0
- package/dist/slug.js.map +1 -0
- package/dist/sync-engine.d.ts +14 -9
- package/dist/sync-engine.d.ts.map +1 -1
- package/dist/sync-engine.js +26 -29
- package/dist/sync-engine.js.map +1 -1
- package/package.json +1 -1
- package/dist/commands/watch.d.ts +0 -29
- package/dist/commands/watch.d.ts.map +0 -1
- package/dist/commands/watch.js +0 -108
- package/dist/commands/watch.js.map +0 -1
package/README.md
CHANGED
|
@@ -85,7 +85,8 @@ poli dev
|
|
|
85
85
|
```
|
|
86
86
|
|
|
87
87
|
`poli dev` is the code-first alternative to the desktop editor. If you only want
|
|
88
|
-
the sync half, without a browser, use `poli
|
|
88
|
+
the sync half, without a browser, use `poli dev --no-preview`. To start from a
|
|
89
|
+
project that already exists in the cloud, `poli clone <org>/<project>`.
|
|
89
90
|
|
|
90
91
|
---
|
|
91
92
|
|
|
@@ -126,11 +127,11 @@ Standard keys and service keys share the `pp_<environment>_…` format; the CLI
|
|
|
126
127
|
- a **standard key** renders only. `poli publish` refuses it before any upload (exit `5`).
|
|
127
128
|
- a **service key** (recommended for CI) also publishes, into its own environment only: `--env` is still required and must name the environment in the key (exit `2` otherwise). Its role decides on a protected environment: an `admin` service key can publish to one, a `developer` one gets `ENVIRONMENT_PROTECTED` (exit `5`). Nothing prompts.
|
|
128
129
|
|
|
129
|
-
The other workspace commands (`link`, `
|
|
130
|
+
The other workspace commands (`link`, `clone`, `sync`, `dev`) need `poli login`.
|
|
130
131
|
|
|
131
132
|
### Precedence
|
|
132
133
|
|
|
133
|
-
When **both** `~/.polipage/credentials` (a session) and `POLI_PAGE_API_KEY` are set, **the key wins** for every command that accepts either credential (`whoami`, `publish`, `render`, `documents`): a set key is an explicit choice, so exporting a `pp_sandbox_…` key makes those commands act as that key, not as your full session. The session-only commands (`link`, `
|
|
134
|
+
When **both** `~/.polipage/credentials` (a session) and `POLI_PAGE_API_KEY` are set, **the key wins** for every command that accepts either credential (`whoami`, `publish`, `render`, `documents`): a set key is an explicit choice, so exporting a `pp_sandbox_…` key makes those commands act as that key, not as your full session. The session-only commands (`link`, `clone`, `sync`, `dev`, `env`) keep using your session. While the key wins, what it cannot do is refused even though a session is stored: `poli render <name>` (the draft), `poli render <name>@<environment>` for another environment than the key's, `poli publish` with a standard key, with an `--env` other than the key's or with a key of another organization than the linked one, and any of those commands with a malformed key fail, and their error says to unset `POLI_PAGE_API_KEY` to use the session. In a terminal, `poli whoami` says when the key is used instead of a stored session (its JSON is the `GET /v1/me` response, unchanged), and `poli publish` prints which credential it used (`Auth:` in its summary, `credential` in its JSON). `poli login` does not refuse if the env var is set: it shows an info-message and proceeds, but the key keeps winning until you unset it.
|
|
134
135
|
|
|
135
136
|
---
|
|
136
137
|
|
|
@@ -170,13 +171,13 @@ poli init --starter getting-started my-start # writes ./my-start
|
|
|
170
171
|
|
|
171
172
|
Writes the whole `getting-started/` project of [`poli-page/templates`](https://github.com/poli-page/templates) (templates, mocks, `poli-page.json`, `tailwind.css`, fonts and images) into `dir` (default: `./getting-started`). The files come from the public templates repo — the same source your org's `getting-started` project was created from — nothing is downloaded from the cloud.
|
|
172
173
|
|
|
173
|
-
When you are logged in, the folder is linked to the **existing** `getting-started` project of your organization (it never creates a cloud project). If you belong to several organizations, pass `--org <slug>` (or pick one at the prompt). Logged out, or when the organization has no `getting-started` project, the starter is written unlinked and the command tells you how to link it (`poli login`, then `poli link`).
|
|
174
|
+
When you are logged in, the folder is linked to the **existing** `getting-started` project of your organization (it never creates a cloud project). Linking forgets the folder's [draft bases](#draft-bases), so the first `poli dev` or `poli sync` compares the starter with that project's draft and reports each file that differs as a [conflict](#conflicts) instead of sending the starter over it. If you belong to several organizations, pass `--org <slug>` (or pick one at the prompt). Logged out, or when the organization has no `getting-started` project, the starter is written unlinked and the command tells you how to link it (`poli login`, then `poli link`). When you are only a viewer on that project, it writes nothing and exits `5`: linking syncs the folder to the project's draft, which needs the developer role.
|
|
174
175
|
|
|
175
176
|
A non-empty target directory is refused unless you pass `--force`. Then:
|
|
176
177
|
|
|
177
178
|
```bash
|
|
178
179
|
cd getting-started
|
|
179
|
-
poli
|
|
180
|
+
poli dev --no-preview # sync each save to the cloud draft
|
|
180
181
|
poli publish --env sandbox # publish the project to the sandbox environment
|
|
181
182
|
```
|
|
182
183
|
|
|
@@ -186,6 +187,26 @@ Piped, or with `--json`, it prints `{ starter, projectDir, link }` as JSON inste
|
|
|
186
187
|
|
|
187
188
|
Flags: `--starter <name>`, `--org <slug>`, `--force`, `--json`, plus `--source` and `--no-cache` as above.
|
|
188
189
|
|
|
190
|
+
#### `poli clone <org>/<project> [dir]`
|
|
191
|
+
|
|
192
|
+
Write the cloud draft of an existing project into a new folder, linked to it and ready for `poli dev`. `<org>` and `<project>` are slugs, as in the editor's URL; `dir` defaults to the project slug.
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
poli clone acme/invoices # writes ./invoices
|
|
196
|
+
poli clone acme/invoices my-invoices # writes ./my-invoices
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
- The target must not exist, or be an empty directory (dot files such as `.git` are allowed). A symbolic link is refused.
|
|
200
|
+
- The target must not be inside a Poli Page project: when its parent folder, or any folder above it, holds a `poli-page.json`, the clone is refused (exit `2`) rather than nesting one project in another. When that project, or the target folder itself, already is a clone of `<org>/<project>`, it says so: run `poli sync` there instead.
|
|
201
|
+
- It needs `poli login` and edit access to the project: a project you can only view exits `5`; one that does not exist or that you cannot see exits `2`.
|
|
202
|
+
- Every path of the draft is checked before anything is written: a path outside the project file set, or one some systems cannot hold (`:`, a reserved name such as `con`, a name ending in `.` or a space), refuses the clone. A draft over 1000 files or 20 MiB is refused too.
|
|
203
|
+
- Every file is downloaded and checked against the size and SHA-256 the draft lists before the first write. Any failure removes what the clone wrote (the folder, when it created it), so you can run it again.
|
|
204
|
+
- A listing it refuses (an unsafe path, over the caps) or a download that fails or does not match exits `3`.
|
|
205
|
+
- The written `poli-page.json` gets the `cloud:` block, the folder is recorded as a [confirmed link](#confirmed-links), and every file gets its [draft base](#draft-bases): `poli dev` syncs it without asking and without overwriting anyone's change.
|
|
206
|
+
- Piped, or with `--json`, it prints `{ dir, orgSlug, projectSlug, files }`.
|
|
207
|
+
|
|
208
|
+
Stopping a clone while it writes the files (Ctrl-C) can leave a partial folder: delete it before you run `poli clone` again.
|
|
209
|
+
|
|
189
210
|
#### `poli new <name>`
|
|
190
211
|
|
|
191
212
|
Create a new template inside an existing project from a remote starter.
|
|
@@ -211,7 +232,7 @@ Flags:
|
|
|
211
232
|
|
|
212
233
|
Opens your browser for the device authorization flow and stores the session token at `~/.polipage/credentials`.
|
|
213
234
|
|
|
214
|
-
It first prints the API host it logs into. The browser opens only an `https` page on the API's own site (`poli.page` or a subdomain; a local page when the API is local): any other verification URL the API sends is printed, not opened, and login exits `3`. The API URL is stored in the credentials file only when you chose it: `--api-url`, your own `POLI_API_URL`, or the `apiUrl` an earlier login stored. A `poli-page.json` `cloud.apiUrl` is never stored.
|
|
235
|
+
It first prints the API host it logs into. The browser opens only an `https` page on the API's own site (`poli.page` or a subdomain; a local page when the API is local): any other verification URL the API sends is printed, not opened, and login exits `3`. A login not confirmed in the browser before the device code expires exits `4`. The API URL is stored in the credentials file only when you chose it: `--api-url`, your own `POLI_API_URL`, or the `apiUrl` an earlier login stored. A `poli-page.json` `cloud.apiUrl` is never stored.
|
|
215
236
|
|
|
216
237
|
#### `poli logout`
|
|
217
238
|
|
|
@@ -246,45 +267,95 @@ Flag: `--json` to dump the raw `/v1/me` payload (or, in `session-no-org` mode, `
|
|
|
246
267
|
|
|
247
268
|
#### `poli link`
|
|
248
269
|
|
|
249
|
-
Pick an organization, create the cloud project, and write the `cloud:` section into `poli-page.json` with the four fields the API needs (`orgSlug`, `orgId`, `projectSlug`, `projectId`). No API key is stored in the manifest
|
|
270
|
+
Pick an organization, create the cloud project, and write the `cloud:` section into `poli-page.json` with the four fields the API needs (`orgSlug`, `orgId`, `projectSlug`, `projectId`). No API key is stored in the manifest: the file is safe to commit. It also records the folder as a [confirmed link](#confirmed-links) on this machine, so `poli dev` and `poli sync` sync it without asking, and forgets the folder's [draft bases](#draft-bases): linking never sends the folder over a draft.
|
|
250
271
|
|
|
251
272
|
The organization is the one `--org <slug>` names; an unknown or empty slug fails with exit `2`, listing your organizations. Without `--org`, an account with a single organization uses it, and one with several asks in a terminal; when it cannot ask (stdin or stdout not a TTY, e.g. in CI or a script), it exits `2`, listing the slugs, and tells you to pass `--org <slug>`.
|
|
252
273
|
|
|
253
274
|
```bash
|
|
254
275
|
poli link --org acme
|
|
276
|
+
poli link --org acme --access restricted # only you (and the owners and admins) can see it
|
|
277
|
+
poli link --org acme --team design # restricted to your team "design"
|
|
255
278
|
```
|
|
256
279
|
|
|
257
|
-
|
|
280
|
+
| Flag | Meaning |
|
|
281
|
+
| ------------------ | ---------------------------------------------------------------------------------------------------- |
|
|
282
|
+
| `--org <slug>` | Organization to link to, without a prompt. |
|
|
283
|
+
| `--existing` | Link to the project of the same name if the organization already has one, without asking. |
|
|
284
|
+
| `--project <slug>` | Link to the existing project of this slug (when its slug is not the one its name gives). |
|
|
285
|
+
| `--access <mode>` | `open` or `restricted`: the access of the project the link creates. |
|
|
286
|
+
| `--team <slug>` | Restrict the project the link creates to this team, one you belong to. Implies `--access restricted`. |
|
|
287
|
+
|
|
288
|
+
**Project access.** `--access` and `--team` apply only when `poli link` creates the project. Without either, no access is sent: the organization's setting for new projects applies, else the project is open to every member. A restricted project is visible only to the organization's owners and admins and to the members and teams granted access; when the created project is restricted, `poli link` adds the line `Access: restricted. Only the organization's owners and admins, and the members and teams granted access, can see it.` Restricting needs the Pro plan or above: below it, the API refuses with `PROJECT_ACCESS_REQUIRES_PRO` (exit `5`). These are refused with exit `2` before anything is written:
|
|
289
|
+
|
|
290
|
+
- an `--access` other than `open` or `restricted`, or `--team` with `--access open`, before any request;
|
|
291
|
+
- a `--team` that is not a team of the organization, or one you are not a member of (the message lists your teams);
|
|
292
|
+
- `--access` or `--team` when the organization already has the project: link without them, then change its access in the dashboard (project Access tab).
|
|
293
|
+
|
|
294
|
+
A project you can see may be one you are only a viewer on: linking syncs the folder to its draft, which needs the developer role, so `poli link` refuses it with exit `5` and writes nothing. A restricted project you cannot see is not listed, so `poli link` tries to create one of the same slug and the API refuses it: the command says the project may exist without being visible to you, and exits `3`. Ask an owner or admin of the organization for access, or rename the project (`project.name` in `poli-page.json`).
|
|
295
|
+
|
|
296
|
+
When the organization already has a project whose slug is the one `project.name` gives (say, a teammate's), `poli link` links to it instead of creating one. Its draft is someone's work, so it first names the project and organization and asks; a no leaves the folder unlinked (exit `1`). When it cannot ask (stdin or stdout not a TTY, e.g. its output piped), it refuses with exit `2` and writes nothing, unless you pass `--existing`, which links to that project without asking. In a script, pass both: `poli link --org <slug> --existing`. `poli init --starter` is not affected: it links only to the organization's existing starter project. Linking to an existing project sends nothing: the first `poli dev` or `poli sync` compares the folder with its draft, sends only the files the draft does not have, and reports each file that differs as a [conflict](#conflicts).
|
|
297
|
+
|
|
298
|
+
The slug `project.name` gives is the API's: accents dropped, lowercase letters and digits, every run of anything else one `-` (`Société Générale` gives `societe-generale`). For a project whose slug is not that one, name it: `poli link --org <slug> --project <project-slug>` links to that existing project without asking and never creates one. A slug that is none of the organization's projects you can see exits `2`; a project you are a viewer on exits `5`.
|
|
258
299
|
|
|
259
300
|
The new cloud project is created from the files [`poli publish`](#poli-publish) would send (regular files only, never a symlink), restricted to the templates and mocks the manifest names, `tailwind.css`, the image files under `assets/images/` and `assets/icons/` and the font files under `assets/fonts/`; partials and other files reach the project on the first sync or publish. A template or mock file the manifest names that is not in that set (missing, symlinked, outside `templates/<name>/`, or under a `node_modules`, `.git`, `output`, `dist` or `.poli` folder, e.g. a template named `output`) fails the link before the project is created.
|
|
260
301
|
|
|
261
302
|
#### Confirmed links
|
|
262
303
|
|
|
263
|
-
A `cloud:` block can come with a cloned repository, and every sync
|
|
304
|
+
A `cloud:` block can come with a cloned repository, and every sync writes to the cloud draft of the project it names. So `poli dev` and `poli sync` sync only a folder whose link you confirmed on this machine. The confirmed links are kept per user in `~/.polipage/links.json` (mode `0600`), keyed by the folder's real path and the project id; `poli link` and `poli init --starter` (when it links) write them, `poli unlink` removes the folder's. The first time you run `poli dev` or `poli sync` in a folder that is not there, or whose `projectId` changed, the command names the organization and project and asks once; a yes is recorded, a no stops the command before any sync. Without a terminal to ask in (stdin or stdout not a TTY), it refuses with exit `2`.
|
|
305
|
+
|
|
306
|
+
Before syncing, `poli dev` and `poli sync` also check with the API that the manifest's `orgSlug`, `orgId`, `projectId` and `projectSlug` all name the same project (sync writes to `projectId` in the `orgSlug` organization; render and publish address `projectSlug` with `orgId`). A manifest whose ids disagree, or whose `orgSlug` names none of your organizations, is refused before any write (exit `6`); `poli publish` with a session refuses it too.
|
|
307
|
+
|
|
308
|
+
#### Draft bases
|
|
264
309
|
|
|
265
|
-
|
|
310
|
+
Next to the confirmed links, `~/.polipage/draft-bases.json` (mode `0600`) keeps, per folder (its real path) and project id, the SHA-256 of each file's bytes as the draft and the folder last agreed on it, and the [conflicts](#conflicts) not resolved yet. Every sync sends each change with that base, and the API refuses the whole sync when a file changed in the draft since (someone else's change is never overwritten). `poli clone` writes the folder's bases; `poli link`, `poli init --starter` and `poli unlink` forget them. A linked folder with none (just linked, or linked by an older CLI) is reconciled by the next `poli dev` or `poli sync` before anything is sent: a file with the draft's bytes (for `poli-page.json`, the same content the API stores, whatever its formatting and `cloud:` block) gets its base, a file only the folder has is sent as new, and a file that differs, or one only the draft has, is a conflict. Deleting the file is safe: the next sync reconciles.
|
|
266
311
|
|
|
267
312
|
#### `poli unlink`
|
|
268
313
|
|
|
269
|
-
Removes the `cloud:` section from `poli-page.json`, even one whose ids are invalid, and forgets the folder's [confirmed link](#confirmed-links), so a `cloud:` block that comes back later (a pull, a checkout) is asked about again. Local files are preserved.
|
|
314
|
+
Removes the `cloud:` section from `poli-page.json`, even one whose ids are invalid, and forgets the folder's [confirmed link](#confirmed-links) and [draft bases](#draft-bases), so a `cloud:` block that comes back later (a pull, a checkout) is asked about again. Local files are preserved.
|
|
315
|
+
|
|
316
|
+
#### `poli dev --no-preview`
|
|
317
|
+
|
|
318
|
+
Syncs each save to the cloud draft, with no server, no browser and no render: [`poli dev`](#poli-dev-template)'s sync, start-up and conflict handling, for when the editor or another tool shows the result. It needs no TTY, so it runs in a script or next to another dev server. A template argument, `--port`, `--data` or `--no-open` with it exits `2`: they only configure the preview.
|
|
319
|
+
|
|
320
|
+
```bash
|
|
321
|
+
poli dev --no-preview
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
It syncs the same file set as [`poli publish`](#poli-publish), each file with its encoding (`base64` for assets, `utf8` otherwise), 300 ms after the last save. A file whose name some systems cannot hold (`:`, a reserved name such as `con`, a name ending in `.` or a space) is named once and never sent nor deleted. Network errors are retried with an exponential backoff (1s up to 30s), `503 ORGANIZATION_MIGRATING` after 5 seconds; other errors are shown and the next save retries. A sync answered `PROJECT_NOT_FOUND` (the project was deleted, or restricted without you) or `PROJECT_ROLE_REQUIRED` (your role on it was lowered) stops the command with that message, exit `2` or `5`, instead of failing on every save.
|
|
270
325
|
|
|
271
|
-
#### `poli
|
|
326
|
+
#### `poli sync`
|
|
272
327
|
|
|
273
|
-
|
|
328
|
+
Syncs the folder with its cloud draft once, and settles [conflicts](#conflicts). A folder with no [draft bases](#draft-bases) is reconciled first.
|
|
274
329
|
|
|
275
330
|
```bash
|
|
276
|
-
poli
|
|
331
|
+
poli sync # send what changed since the last sync
|
|
332
|
+
poli sync --keep-mine -- templates/invoice/invoice.html # settle a conflict with your file
|
|
333
|
+
poli sync --take-theirs -- tailwind.css # settle it with the draft's file
|
|
277
334
|
```
|
|
278
335
|
|
|
279
|
-
|
|
336
|
+
- `--keep-mine <path...>`: your files win: each is sent over the draft's (a file the draft deleted is sent as new, and a file you do not have is deleted from the draft).
|
|
337
|
+
- `--take-theirs <path...>`: the draft's files win: each replaces yours (for `poli-page.json`, the fields the API stores; your `cloud:` block and other keys stay), or your file is deleted when the draft deleted it. A file that changed again, in the draft or here, since the conflict was reported is not written and stays in conflict.
|
|
338
|
+
- Put `--` before the paths so none is read as a flag. Every path must be an open conflict: one that is not, or a path given to both flags, exits `2` with no flag applied.
|
|
339
|
+
- Conflicts left: printed with the two commands that settle them, exit `7`.
|
|
340
|
+
- Piped, or with `--json`, it prints `{ synced, conflicts }` (`synced`: the files sent; `conflicts`: `{ path, remoteSha256 }`, `remoteSha256` `null` when the draft deleted the file).
|
|
341
|
+
- Network errors are retried 4 times (1, 2, 4 then 8 s apart), then it exits `3`, so a script or a CI job never hangs on a network that is down. Ctrl-C stops it between requests and during a wait, with exit `130` (`143` on SIGTERM), the shell's codes for an interrupted command; a second Ctrl-C exits at once.
|
|
342
|
+
|
|
343
|
+
#### Conflicts
|
|
280
344
|
|
|
281
|
-
|
|
282
|
-
- `503 ORGANIZATION_MIGRATING` → 5-second retry
|
|
283
|
-
- Other API errors → logged, watch continues, next save retries
|
|
345
|
+
A file changed both here and in the cloud draft since the last sync (by a teammate, the editor or another machine) is a conflict: nothing is overwritten, `poli sync` still sends every other change, and the file stays out of every sync until it is settled. A file whose bytes are the same on both sides is not one. A file found by the reconciliation of a folder with no [draft bases](#draft-bases) is said to differ from the cloud draft: nobody knows which side changed it.
|
|
284
346
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
347
|
+
- `poli dev` in a terminal asks for each file: **Keep mine**, **Take the cloud's** or **Skip for now** (left out for the session, listed in the status line and on the preview page). A file the draft has and this folder does not (deleted here, or never synced) is asked with **Keep mine (delete it from the draft)**, and **Skip for now** as the default.
|
|
348
|
+
- In the printed list, such a file is marked `(not in this folder: keep-mine deletes it from the draft)`.
|
|
349
|
+
- `poli dev` without a terminal (piped, `concurrently`, a Procfile) and `poli sync` print the files and the commands that settle them, then exit `7`:
|
|
350
|
+
|
|
351
|
+
```
|
|
352
|
+
1 file(s) changed both here and in the cloud draft since the last sync:
|
|
353
|
+
templates/invoice/invoice.html
|
|
354
|
+
Keep your version:
|
|
355
|
+
poli sync --keep-mine -- templates/invoice/invoice.html
|
|
356
|
+
Or take the cloud's:
|
|
357
|
+
poli sync --take-theirs -- templates/invoice/invoice.html
|
|
358
|
+
```
|
|
288
359
|
|
|
289
360
|
### Live development
|
|
290
361
|
|
|
@@ -311,6 +382,7 @@ poli dev -d ./big.json # render every template against your own data
|
|
|
311
382
|
| `-p, --port <n>` | `7654` | Port to bind on `127.0.0.1`. Walks upwards when it is busy. |
|
|
312
383
|
| `-d, --data <path>` | the template mock | JSON data file, same shape as `poli render -d`; saving it re-renders when it is inside the project. |
|
|
313
384
|
| `--no-open` | opens the browser | Skip launching a browser on start. |
|
|
385
|
+
| `--no-preview` | preview | Only sync: see [`poli dev --no-preview`](#poli-dev---no-preview). |
|
|
314
386
|
| `[template]` | first in manifest | Which template to show first. |
|
|
315
387
|
|
|
316
388
|
The served page gives you:
|
|
@@ -334,8 +406,8 @@ The served page gives you:
|
|
|
334
406
|
|
|
335
407
|
Notes:
|
|
336
408
|
|
|
337
|
-
- **No TTY required.**
|
|
338
|
-
|
|
409
|
+
- **No TTY required.** `poli dev` is a server and runs happily with its stdout
|
|
410
|
+
piped, so you can compose it into your own dev script:
|
|
339
411
|
|
|
340
412
|
```json
|
|
341
413
|
{ "scripts": { "dev": "concurrently \"poli dev --no-open\" \"vite\"" } }
|
|
@@ -349,11 +421,15 @@ Notes:
|
|
|
349
421
|
- Only its own page can change the view: a `POST` from another site (or from
|
|
350
422
|
any client that sends neither `Sec-Fetch-Site: same-origin` nor the server's
|
|
351
423
|
own `Origin`) gets a `403`, and no other site can frame the page.
|
|
352
|
-
- On start it
|
|
353
|
-
|
|
424
|
+
- On start it sends the files changed since the last sync, including those
|
|
425
|
+
changed while it was stopped, so the first render reflects your local files.
|
|
426
|
+
A folder with no [draft bases](#draft-bases) is reconciled first: nothing is
|
|
427
|
+
sent over the draft, and each file that differs is a [conflict](#conflicts).
|
|
354
428
|
- Failures are surfaced, not fatal: a render that errors, a rejected sync, a
|
|
355
429
|
broken `poli-page.json`, or a dropped connection leave the server up and the
|
|
356
|
-
page serving.
|
|
430
|
+
page serving. Losing access to the project is the exception: a sync answered
|
|
431
|
+
`PROJECT_NOT_FOUND` or `PROJECT_ROLE_REQUIRED` stops `poli dev` with that
|
|
432
|
+
message (exit `2` or `5`), since no later sync could succeed.
|
|
357
433
|
- `Ctrl-C` (or `SIGTERM`) closes the watcher, every SSE connection, and the
|
|
358
434
|
port.
|
|
359
435
|
|
|
@@ -378,8 +454,8 @@ poli publish --env live --yes # protected environment, no prompt (scripts)
|
|
|
378
454
|
|
|
379
455
|
- **Environment names** are 1-20 characters: lowercase letters, digits and single inner hyphens, starting with a letter. A name that breaks this rule is refused before any call (exit `2`). An environment that does not exist in the organization is refused with the list of the ones that do (exit `2`).
|
|
380
456
|
- **The bundle** is the project file set: `poli-page.json`, `tailwind.css`, the `.html`, `.json` and `.css` files under `templates/<slug>/`, the `.html` files under `partials/`, the `.png`, `.jpg`, `.jpeg`, `.gif`, `.webp` and `.svg` files under `assets/images/` and `assets/icons/` (the image types the engine renders), and the `.woff2`, `.woff`, `.ttf` and `.otf` files under `assets/fonts/`, extensions in any letter case. Anything else (`.gitignore`, `README.md`, `*.log`, `.DS_Store`) is left out, a file of another type under `assets/images/` or `assets/icons/` with a warning that names it (but not `.gitkeep`, `.keep`, `.DS_Store`, `Thumbs.db` or `desktop.ini`), and so is every `node_modules/`, `.git/`, `output/`, `dist/` and `.poli/` directory at any depth. Assets are sent base64-encoded, every other file as UTF-8. A bundle over 5 MiB, or a message over 500 characters, is refused before any call (exit `2`).
|
|
381
|
-
- **Limits.** Only `poli-page.json`, `tailwind.css`, `templates/`, `partials/` and `assets/` are walked, and every file's size is checked before any is read. A file over 4 MiB, more than 1000 files, or files adding up to more than 5 MiB fail the command before any call, naming the file or the limit (exit `2`); nothing is sent. These are the API's limits, and `poli link`, `poli
|
|
382
|
-
- **Protected environments** (`live` by default) accept a publish
|
|
457
|
+
- **Limits.** Only `poli-page.json`, `tailwind.css`, `templates/`, `partials/` and `assets/` are walked, and every file's size is checked before any is read. A file over 4 MiB, more than 1000 files, or files adding up to more than 5 MiB fail the command before any call, naming the file or the limit (exit `2`); nothing is sent. These are the API's limits, and `poli link`, `poli dev` and `poli sync` apply them too.
|
|
458
|
+
- **Protected environments** (`live` by default) accept a publish only with the maintainer role on the project: an owner or admin of the organization, or a member with maintainer access on the project. In a terminal, `poli publish` asks for confirmation first; without a TTY it needs `--yes`. `CI=true` does not stand in for `--yes`. Without the role, the API refuses with `ENVIRONMENT_PROTECTED` (exit `5`).
|
|
383
459
|
- **With a service key** (`POLI_PAGE_API_KEY`; the key wins over a `poli login` session when both are there): the CLI calls `GET /v1/me`, then publishes to the manifest's `cloud.projectSlug` with no organization header, since the key carries its organization. `--env` must name the key's own environment, or the publish is refused before any upload, naming it (exit `2`). When the manifest has a `cloud.orgId`, the key must belong to that organization (the one `GET /v1/me` names), or the publish is refused before any upload, naming both organizations (exit `2`): the key would otherwise publish to a project of the same slug in its own organization. A standard key is refused with "Standard API keys can only render. Use a service key or `poli login`." (exit `5`); with a session stored, the standard-key, `--env` and organization refusals all say to unset `POLI_PAGE_API_KEY` to use the session instead. There is no prompt and no environment check on the CLI side: the API applies the protected-environment rule, and a service key without the `admin` role gets `ENVIRONMENT_PROTECTED` (exit `5`).
|
|
384
460
|
- **One publish at a time** per project and environment: while one runs, a second gets `PUBLISH_IN_PROGRESS` (exit `3`). It is not retried; run it again once the first one is done.
|
|
385
461
|
|
|
@@ -414,7 +490,7 @@ Outside a linked folder, or with `--org` naming another organization, it lists t
|
|
|
414
490
|
|
|
415
491
|
#### `poli env remove-project <environment>`
|
|
416
492
|
|
|
417
|
-
Removes the linked project from an environment: the environment's copy of the project is deleted, and the documents rendered from it are kept. The draft and the other environments are untouched, nothing is written to the publish log, and renders of the project in that environment then get `PROJECT_NOT_IN_ENVIRONMENT` until a later `poli publish --env <environment>` adds it back.
|
|
493
|
+
Removes the linked project from an environment: the environment's copy of the project is deleted, and the documents rendered from it are kept. The draft and the other environments are untouched, nothing is written to the publish log, and renders of the project in that environment then get `PROJECT_NOT_IN_ENVIRONMENT` until a later `poli publish --env <environment>` adds it back. It needs the maintainer role on the project: an owner or admin of the organization, or a member with maintainer access on the project, in every environment.
|
|
418
494
|
|
|
419
495
|
```bash
|
|
420
496
|
poli env remove-project staging # asks you to type the project slug
|
|
@@ -427,7 +503,7 @@ poli env remove-project staging --yes # scripts: no prompt
|
|
|
427
503
|
| `--json` | Print `{ org, project, environment }` (also the default when stdout is not a TTY). |
|
|
428
504
|
|
|
429
505
|
- **Confirmation.** In a terminal, you type the project slug (`cloud.projectSlug` in `poli-page.json`); anything else aborts and nothing is sent. Without a TTY the command needs `--yes` and otherwise exits `2`; `CI=true` does not stand in for `--yes` here.
|
|
430
|
-
- **Errors.**
|
|
506
|
+
- **Errors.** Without the maintainer role on the project, the API answers `PROJECT_ROLE_REQUIRED` (exit `5`, maintainer role required). A project that does not exist or that you cannot access (`PROJECT_NOT_FOUND`) exits `2`. A project that is not published in the environment (`PROJECT_NOT_IN_ENVIRONMENT`) or an environment the organization does not have (`ENVIRONMENT_NOT_FOUND`) exits `2`. While a publish or another removal of the same project and environment runs (`PUBLISH_IN_PROGRESS`), while the project is being transferred (`TRANSFER_IN_PROGRESS`), or when the environment is read-only (`ENVIRONMENT_READ_ONLY`), it exits `3`.
|
|
431
507
|
|
|
432
508
|
### Render
|
|
433
509
|
|
|
@@ -612,9 +688,9 @@ Every command that returns a payload (renders, descriptors, publishes) follows t
|
|
|
612
688
|
|
|
613
689
|
Either the summary **or** the JSON — never both at once. Errors always go to stderr with a clear message.
|
|
614
690
|
|
|
615
|
-
Commands that take this contract: `render`, `documents get`, `documents preview`, `documents thumbnails`, `whoami`, `publish`, `env list`, `env remove-project`, `init --starter`.
|
|
691
|
+
Commands that take this contract: `render`, `documents get`, `documents preview`, `documents thumbnails`, `whoami`, `publish`, `env list`, `env remove-project`, `init --starter`, `clone`, `sync`.
|
|
616
692
|
|
|
617
|
-
Imperative commands (`init` without `--starter`, `new`, `link`, `unlink`, `logout`, `documents delete`, `
|
|
693
|
+
Imperative commands (`init` without `--starter`, `new`, `link`, `unlink`, `logout`, `documents delete`, `login`) don't have a JSON payload to forward: they just acknowledge with a `✓` line on success.
|
|
618
694
|
|
|
619
695
|
---
|
|
620
696
|
|
|
@@ -623,12 +699,13 @@ Imperative commands (`init` without `--starter`, `new`, `link`, `unlink`, `logou
|
|
|
623
699
|
| Code | Meaning |
|
|
624
700
|
| ---- | ------------------------------------------------------------------------------------------------------ |
|
|
625
701
|
| `0` | Success |
|
|
626
|
-
| `1` | Recoverable inconsistency (already
|
|
627
|
-
| `2` | Invalid usage (bad args, template not found, project not published in that environment, non-TTY context where TTY is required) |
|
|
702
|
+
| `1` | Recoverable inconsistency (already linked) |
|
|
703
|
+
| `2` | Invalid usage (bad args, template not found, project not published in that environment, `PROJECT_NOT_FOUND`, non-TTY context where TTY is required) |
|
|
628
704
|
| `3` | Network / API error (timeout, 5xx, unspecified 4xx) |
|
|
629
|
-
| `4` | Not authenticated: run `poli login` or set `POLI_PAGE_API_KEY`; or the API answered `MISSING_API_KEY`, `INVALID_API_KEY` or `API_KEY_EXPIRED` |
|
|
630
|
-
| `5` | Not authorized (insufficient role, protected environment, `PROJECT_OUT_OF_SCOPE`, `THUMBNAILS_NOT_AVAILABLE`) |
|
|
705
|
+
| `4` | Not authenticated: run `poli login` or set `POLI_PAGE_API_KEY`; or the API answered `MISSING_API_KEY`, `INVALID_API_KEY` or `API_KEY_EXPIRED`; or `poli login` timed out |
|
|
706
|
+
| `5` | Not authorized (insufficient role, protected environment, `PROJECT_OUT_OF_SCOPE`, `PROJECT_ROLE_REQUIRED`, `PROJECT_ACCESS_REQUIRES_PRO`, `THUMBNAILS_NOT_AVAILABLE`) |
|
|
631
707
|
| `6` | Invalid local state (no project, invalid `poli-page.json`, project not linked, empty folder where required) |
|
|
708
|
+
| `7` | Conflict: files changed both here and in the cloud draft, not settled (see [conflicts](#conflicts)) |
|
|
632
709
|
|
|
633
710
|
These map to the centralised `ExitCode` constants in `src/exit-codes.ts`. Every handler routes errors through `errorToExitCode(err)`.
|
|
634
711
|
|
|
@@ -755,13 +832,33 @@ The key passed its expiry date (`API_KEY_EXPIRED`). Create a new key on the dash
|
|
|
755
832
|
|
|
756
833
|
The key is limited to some projects and this folder's project is not one of them (`PROJECT_OUT_OF_SCOPE`). Use a key that includes the project, or create one on the dashboard's API keys page. Exit code `5`.
|
|
757
834
|
|
|
835
|
+
### `Project not found: it does not exist in this organization, or it is restricted and you have no access to it...`
|
|
836
|
+
|
|
837
|
+
The API answered `PROJECT_NOT_FOUND`: the project does not exist, or it is restricted and you are not among the members and teams granted access. Check the project slug, or ask an owner or admin of the organization for access. In a linked folder whose project was deleted, run `poli unlink`, then `poli link`. `poli dev` stops on it instead of failing on every save. Exit code `2`.
|
|
838
|
+
|
|
839
|
+
### `Your role on this project is too low: this needs the <role> role...`
|
|
840
|
+
|
|
841
|
+
The API answered `PROJECT_ROLE_REQUIRED`: on a restricted project, the grants decide what you can do (`viewer` renders and reads documents, `developer` syncs the draft and publishes into unprotected environments, `maintainer` also publishes into protected environments and removes the project from an environment). Ask a maintainer of the project, or an owner or admin of the organization, to grant you the role the message names. `poli dev` stops on it instead of failing on every save. Exit code `5`.
|
|
842
|
+
|
|
843
|
+
### `Restricting a project needs the Pro plan or above...`
|
|
844
|
+
|
|
845
|
+
The API answered `PROJECT_ACCESS_REQUIRES_PRO` to `poli link --access restricted` or `--team`. Link without them, or upgrade the organization in the dashboard (Billing). Exit code `5`.
|
|
846
|
+
|
|
847
|
+
### `You are a viewer on "<org>/<project>": linking syncs this folder to its draft, which needs the developer role...`
|
|
848
|
+
|
|
849
|
+
`poli link` or `poli init --starter` found the project, but you are only a viewer on it. Nothing was written. Ask a maintainer of the project, or an owner or admin of the organization, for the developer role. Exit code `5`.
|
|
850
|
+
|
|
851
|
+
### `Organization "<org>" already has a project "<slug>" that you cannot see: it is restricted...`
|
|
852
|
+
|
|
853
|
+
`poli link` saw no project of that slug, so it tried to create one, and the API answered `SLUG_ALREADY_EXISTS`: the project exists, restricted, and you have no access to it. Ask an owner or admin of the organization for access, or rename the project (`project.name` in `poli-page.json`) and run `poli link` again. Exit code `3`.
|
|
854
|
+
|
|
758
855
|
### `This folder isn't linked to a cloud project. Run \`poli link\` first.`
|
|
759
856
|
|
|
760
857
|
You're in session mode and the local manifest has no `cloud:` block. Either run `poli link`, or switch to api-key mode with `POLI_PAGE_API_KEY=pp_<environment>_…` (which carries the org context implicitly). Exit code `6`.
|
|
761
858
|
|
|
762
859
|
### `This folder is linked to project "<name>" (<slug>) of organization "<name>" (<slug>), a link you have not confirmed on this machine...`
|
|
763
860
|
|
|
764
|
-
`poli
|
|
861
|
+
`poli dev` or `poli sync` found a `cloud:` block (from a cloned repository, say) that is not in your `~/.polipage/links.json`, and had no terminal to ask in. Run the command once in a terminal and answer yes, or run `poli unlink`, then `poli link`. Exit code `2`. See [confirmed links](#confirmed-links).
|
|
765
862
|
|
|
766
863
|
### `The cloud block of poli-page.json names more than one project: ...`
|
|
767
864
|
|
|
@@ -785,7 +882,7 @@ The API renders the draft for a `poli login` session only. The CLI refuses a dra
|
|
|
785
882
|
|
|
786
883
|
### `Environment "<env>" is protected...` (`403 ENVIRONMENT_PROTECTED`)
|
|
787
884
|
|
|
788
|
-
`poli publish --env <env>` to a protected environment (`live` by default) by someone
|
|
885
|
+
`poli publish --env <env>` to a protected environment (`live` by default) by someone without the maintainer role on the project (owners and admins of the organization have it, members only when granted maintainer access to the project), or with a service key without the `admin` role. Ask a maintainer of the project to publish, or use an `admin` service key. Exit code `5`.
|
|
789
886
|
|
|
790
887
|
Without a terminal, `Environment "<env>" is protected. Pass --yes to publish to it without a prompt.` means the confirmation could not be asked: pass `--yes` (`CI=true` does not count as `--yes`). Exit code `2`.
|
|
791
888
|
|
|
@@ -801,11 +898,15 @@ Thumbnails via `poli documents thumbnails` are a paid-tier feature. Upgrade to S
|
|
|
801
898
|
|
|
802
899
|
Your org has crossed the monthly cap on `live` PDF renders (counted across `poli render` in any environment other than `sandbox` and `poli documents thumbnails` on a document of such an environment). Wait until the next billing period or raise the cap from your dashboard. Exit code `3`.
|
|
803
900
|
|
|
901
|
+
### `N file(s) changed both here and in the cloud draft since the last sync`
|
|
902
|
+
|
|
903
|
+
Someone changed these files in the cloud draft since your last sync, and you changed them too. Nothing was overwritten. Keep yours or take the draft's with the `poli sync` command printed under the message, or run `poli dev` in a terminal to be asked. Exit code `7`. See [conflicts](#conflicts).
|
|
904
|
+
|
|
804
905
|
### `503 ORGANIZATION_MIGRATING`
|
|
805
906
|
|
|
806
|
-
Your org is being migrated to a new tier. `poli
|
|
907
|
+
Your org is being migrated to a new tier. `poli dev` and `poli sync` retry automatically after 5s. Other commands surface the error: retry by hand once the migration completes (typically under a minute).
|
|
807
908
|
|
|
808
|
-
### `poli
|
|
909
|
+
### `poli dev` doesn't sync on save
|
|
809
910
|
|
|
810
911
|
Make sure the file is in the project file set, as [`poli publish`](#poli-publish) defines the bundle (only some file types count under each folder, e.g. `templates/<slug>/logo.svg` does not): no other file triggers a sync, except the `poli dev --data` file. The watcher does not follow symlinks: a file reached through a symlinked directory is not watched. The watcher uses `chokidar` v5; if your editor saves via "atomic write + rename" (some Vim setups), the rename event fires within the debounce window and triggers a sync.
|
|
811
912
|
|
package/dist/api-client.d.ts
CHANGED
|
@@ -3,7 +3,9 @@ export declare class ApiError extends Error {
|
|
|
3
3
|
readonly code: string;
|
|
4
4
|
readonly httpStatus: number;
|
|
5
5
|
readonly retryAfter?: number | undefined;
|
|
6
|
-
|
|
6
|
+
/** The parsed response body of an error answer, kept as received (never trusted). */
|
|
7
|
+
body: unknown;
|
|
8
|
+
constructor(code: string, httpStatus: number, message: string, retryAfter?: number | undefined, body?: unknown);
|
|
7
9
|
}
|
|
8
10
|
export declare class QuotaExceededError extends ApiError {
|
|
9
11
|
constructor(message: string, retryAfter?: number);
|
|
@@ -68,6 +70,42 @@ export declare class ApiKeyExpiredError extends ApiError {
|
|
|
68
70
|
export declare class ProjectOutOfScopeError extends ApiError {
|
|
69
71
|
constructor(_message?: string, retryAfter?: number);
|
|
70
72
|
}
|
|
73
|
+
/** A project role, lowest first (project access design: viewer < developer < maintainer). */
|
|
74
|
+
export type ProjectRole = 'viewer' | 'developer' | 'maintainer';
|
|
75
|
+
export type ProjectAccess = 'open' | 'restricted';
|
|
76
|
+
export declare const PROJECT_ACCESS_MESSAGES: {
|
|
77
|
+
readonly PROJECT_NOT_FOUND: "Project not found: it does not exist in this organization, or it is restricted and you have no access to it. Check the project slug, or ask an owner or admin of the organization for access. In a linked folder whose project is gone, run `poli unlink`, then `poli link`.";
|
|
78
|
+
readonly PROJECT_ROLE_REQUIRED: (requiredRole: ProjectRole | null) => string;
|
|
79
|
+
readonly PROJECT_ACCESS_REQUIRES_PRO: "Restricting a project needs the Pro plan or above. Run `poli link` without `--access restricted` or `--team`, or upgrade the organization in the dashboard (Billing).";
|
|
80
|
+
};
|
|
81
|
+
/** `404 PROJECT_NOT_FOUND`: no such project, or a restricted one the caller cannot access. Exits 2. */
|
|
82
|
+
export declare class ProjectNotFoundError extends ApiError {
|
|
83
|
+
constructor(_message?: string, retryAfter?: number, body?: unknown);
|
|
84
|
+
}
|
|
85
|
+
/** `403 PROJECT_ROLE_REQUIRED`: the caller's role on the project is below the action's. Exits 5. */
|
|
86
|
+
export declare class ProjectRoleRequiredError extends ApiError {
|
|
87
|
+
/** The body's `requiredRole`, kept only when it is a known role (the body is untrusted). */
|
|
88
|
+
readonly requiredRole: ProjectRole | null;
|
|
89
|
+
constructor(_message?: string, retryAfter?: number, body?: unknown);
|
|
90
|
+
}
|
|
91
|
+
/** `403 PROJECT_ACCESS_REQUIRES_PRO`: restricting a project needs Pro and above. Exits 5. */
|
|
92
|
+
export declare class ProjectAccessRequiresProError extends ApiError {
|
|
93
|
+
constructor(_message?: string, retryAfter?: number, body?: unknown);
|
|
94
|
+
}
|
|
95
|
+
export interface DraftConflict {
|
|
96
|
+
path: string;
|
|
97
|
+
/** The cloud's current hash of the file, or `null` when it no longer exists there. */
|
|
98
|
+
remoteSha256: string | null;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* `409 DRAFT_CONFLICT`: the sync touched files someone else changed since
|
|
102
|
+
* their base. Nothing was written. Exits 7.
|
|
103
|
+
*/
|
|
104
|
+
export declare class DraftConflictError extends ApiError {
|
|
105
|
+
readonly exitCode = 7;
|
|
106
|
+
readonly conflicts: DraftConflict[];
|
|
107
|
+
constructor(message: string, retryAfter?: number, body?: unknown);
|
|
108
|
+
}
|
|
71
109
|
export interface DeviceRequestResult {
|
|
72
110
|
deviceCode: string;
|
|
73
111
|
userCode: string;
|
|
@@ -105,11 +143,17 @@ export interface ProjectFileEntry {
|
|
|
105
143
|
path: string;
|
|
106
144
|
encoding: 'utf8' | 'base64';
|
|
107
145
|
content: string;
|
|
146
|
+
/** The hash the CLI last saw on the cloud; `null` = the file was absent. Omitted = unconditional. */
|
|
147
|
+
baseSha256?: string | null;
|
|
108
148
|
}
|
|
109
149
|
export interface PatchFilesBody {
|
|
110
150
|
added: ProjectFileEntry[];
|
|
111
151
|
modified: ProjectFileEntry[];
|
|
112
|
-
|
|
152
|
+
/** A path is an unconditional delete; the object form carries the base the CLI last saw. */
|
|
153
|
+
deleted: Array<string | {
|
|
154
|
+
path: string;
|
|
155
|
+
baseSha256: string | null;
|
|
156
|
+
}>;
|
|
113
157
|
}
|
|
114
158
|
/** `POST /v1/projects/:project/publish` body: the whole local project. */
|
|
115
159
|
export interface PublishBody {
|
|
@@ -165,6 +209,20 @@ export interface ProjectEnvironmentState {
|
|
|
165
209
|
}
|
|
166
210
|
export interface PatchFilesResult {
|
|
167
211
|
syncedAt: string;
|
|
212
|
+
/** The cloud's hash of every file this sync wrote. */
|
|
213
|
+
files: Array<{
|
|
214
|
+
path: string;
|
|
215
|
+
sha256: string;
|
|
216
|
+
}>;
|
|
217
|
+
}
|
|
218
|
+
/** One file of the cloud draft, with a short-lived presigned download URL. */
|
|
219
|
+
export interface DraftFile {
|
|
220
|
+
path: string;
|
|
221
|
+
size: number;
|
|
222
|
+
sha256: string;
|
|
223
|
+
/** Presigned: never log or print it. */
|
|
224
|
+
url: string;
|
|
225
|
+
expiresAt: string;
|
|
168
226
|
}
|
|
169
227
|
export interface DocumentDescriptor {
|
|
170
228
|
documentId: string;
|
|
@@ -233,6 +291,19 @@ export interface MeResponse {
|
|
|
233
291
|
lifecycleStatus: string;
|
|
234
292
|
} | null;
|
|
235
293
|
}
|
|
294
|
+
export interface ProjectSummary {
|
|
295
|
+
id: string;
|
|
296
|
+
name: string;
|
|
297
|
+
slug: string;
|
|
298
|
+
access?: ProjectAccess;
|
|
299
|
+
role?: ProjectRole;
|
|
300
|
+
}
|
|
301
|
+
export interface TeamSummary {
|
|
302
|
+
id: string;
|
|
303
|
+
name: string;
|
|
304
|
+
slug: string;
|
|
305
|
+
isMember: boolean;
|
|
306
|
+
}
|
|
236
307
|
export interface ApiClient {
|
|
237
308
|
signIn(email: string, password: string): Promise<{
|
|
238
309
|
user: UserInfo;
|
|
@@ -251,20 +322,26 @@ export interface ApiClient {
|
|
|
251
322
|
name: string;
|
|
252
323
|
slug: string;
|
|
253
324
|
}>>;
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
325
|
+
/**
|
|
326
|
+
* The projects the caller can see. `access` and `role` are absent from an
|
|
327
|
+
* API older than project-level access.
|
|
328
|
+
*/
|
|
329
|
+
listProjects(session: string, orgId: string): Promise<ProjectSummary[]>;
|
|
330
|
+
/** `GET …/teams`: the organization's teams; `isMember` says whether the caller is in one. */
|
|
331
|
+
listTeams(session: string, orgId: string): Promise<TeamSummary[]>;
|
|
332
|
+
/** The payload may carry `access` and `teamId` (project access at creation). */
|
|
259
333
|
createProject(session: string, orgId: string, payload: Record<string, unknown>): Promise<{
|
|
260
334
|
id: string;
|
|
335
|
+
access?: ProjectAccess;
|
|
261
336
|
}>;
|
|
262
337
|
patchFiles(session: string, orgId: string, projectId: string, body: PatchFilesBody): Promise<PatchFilesResult>;
|
|
338
|
+
/** `GET …/projects/:id/files`: the draft's files with presigned download URLs. */
|
|
339
|
+
listDraftFiles(session: string, orgId: string, projectId: string): Promise<DraftFile[]>;
|
|
263
340
|
listEnvironments(authorization: string, orgId: string): Promise<EnvironmentInfo[]>;
|
|
264
341
|
getProjectEnvironments(session: string, orgId: string, projectId: string): Promise<ProjectEnvironmentState[]>;
|
|
265
342
|
/**
|
|
266
343
|
* Deletes the environment's copy of the project (its documents are kept);
|
|
267
|
-
* session only,
|
|
344
|
+
* session only, maintainer role on the project. Answers `204`.
|
|
268
345
|
*/
|
|
269
346
|
removeProjectFromEnvironment(session: string, orgId: string, projectId: string, environment: string): Promise<void>;
|
|
270
347
|
/** `orgIdHeader` is the session's organization; an API key carries its own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