@protobase/cli 0.66.15 → 0.66.16
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/cli/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/cli",
|
|
3
|
-
"version": "0.66.
|
|
3
|
+
"version": "0.66.16",
|
|
4
4
|
"description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@better-auth/core": "^1.7.12",
|
|
45
45
|
"@hono/node-server": "^2.1.3",
|
|
46
|
-
"@protobase/config": "0.66.
|
|
47
|
-
"@protobase/layout": "0.66.
|
|
48
|
-
"@protobase/query": "0.66.
|
|
49
|
-
"@protobase/schema": "0.66.
|
|
50
|
-
"@protobase/server": "0.66.
|
|
51
|
-
"@protobase/ui": "0.66.
|
|
46
|
+
"@protobase/config": "0.66.16",
|
|
47
|
+
"@protobase/layout": "0.66.16",
|
|
48
|
+
"@protobase/query": "0.66.16",
|
|
49
|
+
"@protobase/schema": "0.66.16",
|
|
50
|
+
"@protobase/server": "0.66.16",
|
|
51
|
+
"@protobase/ui": "0.66.16",
|
|
52
52
|
"@react-email/render": "^2.1.0",
|
|
53
53
|
"@scalar/hono-api-reference": "^0.12.10",
|
|
54
54
|
"@sentry/vite-plugin": "^11.10.0",
|
|
@@ -27,4 +27,4 @@ The list page of each resource, with its columns, filters, charts, search, expor
|
|
|
27
27
|
- [Favorites](../reference/ui-config.md#favorites): A heart on each card saves the record to the user's favorites, which a list page can show.
|
|
28
28
|
- [Sign-in prompts](../reference/ui-config.md#sign-in-prompts): Visitors who are not signed in see what signing in gives them, in place of a list or when they press favorite or save search.
|
|
29
29
|
- [Export to Excel and CSV](../reference/ui-config.md#exports): Any list, or the selected rows, is saved as an Excel or CSV file with the columns the user picks.
|
|
30
|
-
- [Import from a
|
|
30
|
+
- [Import from a file](../reference/ui-config.md#importing-records): Records are created or updated from Excel, CSV or JSON. Every row is checked before anything is saved, and refused rows can be downloaded to fix.
|
|
@@ -15,6 +15,8 @@ Save the spreadsheet as it is (`.xlsx`), or as **CSV UTF-8**. Its first row name
|
|
|
15
15
|
| Hoogland Fietsen | Leiden | NL | Lead | inkoop@hoogland.test |
|
|
16
16
|
| De Spaak | Delft | NL | lead | |
|
|
17
17
|
|
|
18
|
+
Data exported from another tool as JSON imports the same way: an array of objects, whose keys name the columns, such as `[{"Name": "Hoogland Fietsen", "City": "Leiden"}]`.
|
|
19
|
+
|
|
18
20
|
Open **Companies**, press **Import** and choose the file. Each column whose header is a field's label or name is mapped already: Country is the label the companies' view gives `country_code`, a relation whose column holds each country's key. Map other columns, or leave them at **Do not import**. Set **Numbers** and **Dates** to how the file writes them. Fields a new company needs that no column fills are named above **Check rows**, which waits for them.
|
|
19
21
|
|
|
20
22
|
**Check rows** reads the whole file and writes nothing. It shows the first rows as they will be saved and lists each row with a problem, such as a country no record has or a status that is none of Lead, Active and Dormant (`lead` is fine: case and spacing do not count). Those rows are skipped. An empty Email is saved empty; an empty cell is never filled with a default.
|
|
@@ -577,16 +577,16 @@ view<typeof auditLog>('audit_log').export(false)
|
|
|
577
577
|
|
|
578
578
|
## Importing records
|
|
579
579
|
|
|
580
|
-
A list page offers **Import** beside **New** to a user who may create the resource's records; `.import(false)` on the view turns it off. It opens a dialog that creates or updates records from an Excel workbook (`.xlsx`)
|
|
580
|
+
A list page offers **Import** beside **New** to a user who may create the resource's records; `.import(false)` on the view turns it off. It opens a dialog that creates or updates records from an Excel workbook (`.xlsx`), a CSV file (UTF-8, its delimiter a comma, semicolon or tab, found from the first line) or a JSON file (`.json`, UTF-8) that holds an array of objects. See [Importing records from a spreadsheet](../guides/import-records.md) for a walk through.
|
|
581
581
|
|
|
582
582
|
```ts
|
|
583
583
|
view<typeof invoices>('invoices').import(false)
|
|
584
584
|
```
|
|
585
585
|
|
|
586
|
-
1. **File.** The first row names the columns; a workbook with several sheets asks which one to read.
|
|
587
|
-
2. **Columns.** A column whose header is a field's label or name, ignoring case and spacing, fills that field; each mapping can be changed, or the column skipped. The fields are those the import can write: not read-only, not the tenant, not JSON
|
|
586
|
+
1. **File.** The first row names the columns; a workbook with several sheets asks which one to read. In a JSON file each object is a row and the columns are the objects' keys, in the order they first appear; a key an object lacks is an empty cell. Strings, numbers and booleans are kept as the file states them, so `"007"` stays text, and a nested object or array is a JSON value. A whole number past 2^53 keeps its digits as text where the browser gives JSON parsing the number's source text. <gap>Import cannot keep every digit of a whole number past 2^53 in a browser without JSON source text access because a JSON parser of its own is not implemented.</gap> A file that is not an array of objects is refused. <gap>Import cannot read JSON Lines or an array inside a JSON object because readers for those shapes are not implemented.</gap> A Web Worker reads the file, so a large file does not hold up the page, and the file itself never goes to the server: only the writes of its rows do. A CSV and a sheet's rows are read as they stream in, so they are never held whole in memory; a JSON file is read whole, so its size is bounded by the browser's memory.
|
|
587
|
+
2. **Columns.** A column whose header is a field's label or name, ignoring case and spacing, fills that field; each mapping can be changed, or the column skipped. The fields are those the import can write: not read-only, not the tenant, not files, JSON fields only from a JSON file, and relations to records with a key of one field. The fields a new record needs (not optional, without a default) that no column fills are listed, and a create waits for them. A relation's column holds the related record's key, or the value of a field the user picks under it, such as a customer's email. **Numbers** and **Dates** say how the file writes what text leaves open: `1,234.56` or `1.234,56`, the day or the month first; they start from the browser's language. Dates written as `2026-12-31` read the same either way, and a time without a zone is the browser's.
|
|
588
588
|
3. **Rows.** **Create** makes a record of each row. A user who may also update records can choose **Update**, which finds each row's record by a column the user picks, holding its key or a field no two records share (filterable, not sensitive), and skips a row that finds none, or **Create or update**, which creates that record instead.
|
|
589
|
-
4. **Check.** The whole file is read and every row converted before anything is written: the first rows as they will be saved, and each row's problems, also as a file to download. Nothing is guessed: an empty cell is `null`, never the field's default; numbers and dates in the chosen formats, true or false (`true`, `false`, `yes`, `no`, `1`, `0`), enum values by their [value labels](#names-and-columns) or values,
|
|
589
|
+
4. **Check.** The whole file is read and every row converted before anything is written: the first rows as they will be saved, and each row's problems, also as a file to download. Nothing is guessed: an empty cell is `null`, never the field's default; numbers and dates in the chosen formats, true or false (`true`, `false`, `yes`, `no`, `1`, `0`), enum values by their [value labels](#names-and-columns) or values, related records found by exactly one match, and a JSON file's values in a JSON field as they are convert, and anything else is a problem on its row, such as a nested value mapped to a field that is not JSON. The import skips those rows.
|
|
590
590
|
5. **Import.** The rows are written in batches of 100 with [`POST /api/v1:batchWrite`](api.md#batch-writes), so the server validates each and checks the user's access as it does a single write; an update is sent with the ETag `*`. Each batch is a transaction of its own, so an import is not all or nothing: a row the server refuses is set aside with the server's reason, and the rest of its batch is sent again. **Cancel import** stops between two batches, keeping what was written, and so does an error such as an expired session. The summary counts the rows created, updated, skipped (with problems in the file) and failed (refused by the server), and downloads the rows not imported as a CSV, the file's own columns followed by each row's line in the file and its problems, to fix and import again.
|
|
591
591
|
|
|
592
592
|
## Create pages
|