@protobase/cli 0.126.1 → 0.126.2

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.
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.126.1";
2
+ var version = "0.126.2";
3
3
  //#endregion
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/cli",
3
- "version": "0.126.1",
3
+ "version": "0.126.2",
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,13 +43,13 @@
43
43
  "dependencies": {
44
44
  "@better-auth/core": "^1.7.12",
45
45
  "@hono/node-server": "^2.1.3",
46
- "@protobase/config": "0.126.1",
47
- "@protobase/layout": "0.126.1",
48
- "@protobase/query": "0.126.1",
49
- "@protobase/schema": "0.126.1",
50
- "@protobase/server": "0.126.1",
51
- "@protobase/ui": "0.126.1",
52
- "@protobase/workflows": "0.126.1",
46
+ "@protobase/config": "0.126.2",
47
+ "@protobase/layout": "0.126.2",
48
+ "@protobase/query": "0.126.2",
49
+ "@protobase/schema": "0.126.2",
50
+ "@protobase/server": "0.126.2",
51
+ "@protobase/ui": "0.126.2",
52
+ "@protobase/workflows": "0.126.2",
53
53
  "@react-email/render": "^2.1.0",
54
54
  "@scalar/hono-api-reference": "^0.12.10",
55
55
  "@sentry/vite-plugin": "^11.10.0",
@@ -17,6 +17,7 @@ Mail the app sends, the PDF documents it makes, and forms for people without an
17
17
  - [Mail from your own mailbox](../reference/email.md#from-someones-own-mailbox) (beta): People link their Gmail on the account page, and the app's functions send mail from it; an action offers to connect the mailbox right there when the link is missing or expired.
18
18
  - [From addresses](../reference/email.md#from-addresses): Each send-as address is a record on the person's mailbox, with a display name, a signature of its own and a state. With the optional `gmail.settings.basic` scope, Gmail lists them and says which it really sends from, and the app refuses to send from an address Gmail would replace. The app sends from the record it names, or the person's default.
19
19
  - [Verifying a From address](../reference/email.md#verifying-a-from-address) (beta): The app plugs in its own way to prove a From address its mailbox provider cannot vouch for, such as a hosting platform's test-mail check: a verifier sends one test message through the person's mailbox, and its proof makes the address verified until it runs out. Verifications wait, survive a restart and settle once, by the app's own check each minute or by a report carrying the verification's secret.
20
+ - [Sharing a From address](../reference/email.md#sharing-a-from-address) (beta): The owner of a verified From address, such as a team's billing address, shares it with the app's other senders, or with organizations those in an organization with them. They pick it like their own and send from it through the owner's mailbox, which stays hidden from them, until it is unshared or no longer verified.
20
21
  - [A From address on a record](../reference/email.md#a-from-address-on-a-record) (beta): A field such as a client's "Send from" is a dropdown of the person's addresses with their states, and an address a record holds cannot be removed.
21
22
  - [Public forms](../reference/forms.md#what-the-visitor-sees): A form at its own address lets people without an account create a record, such as a contact request.
22
23
  - [Bot check](../reference/forms.md#bot-check): Each submission passes a check in the browser, without a third-party service or a puzzle.
@@ -89,4 +89,14 @@ A Gmail account may send as other addresses of yours, such as a company address
89
89
  await personalMail.send({ sender_address_id: sender.id, to, subject, text })
90
90
  ```
91
91
 
92
- The app sends only from the caller's own From addresses: any other is refused before anything is sent. [From addresses](../reference/email.md#from-addresses) has the details.
92
+ The app sends only from the caller's own From addresses and those shared with them: any other is refused before anything is sent. [From addresses](../reference/email.md#from-addresses) has the details.
93
+
94
+ ## 6. Sharing a From address
95
+
96
+ A team's address, such as `billing@shop.example`, can go out through one person's Gmail for the whole team.
97
+
98
+ 1. **Prove it first:** only a **Verified** address can be shared, as Gmail's list or one of the app's [verifiers](../reference/email.md#verifying-a-from-address) says.
99
+ 2. **Share it:** on the account page, under **From addresses**, choose **Edit** on the address, turn on **Share with the app's other senders**, and save. It shows **Shared**.
100
+ 3. **Your colleagues pick it:** it shows in their From dropdowns after their own addresses, marked **shared**, and `personalMail.sender('billing@shop.example')` finds it for them. With organizations on, only people in an organization with you see it. They never see your own address or mailbox.
101
+
102
+ Mail they send from it goes out through your Gmail, so it lands in your **Sent** folder. It stops going out the moment you unshare or remove it, it is no longer verified, or your Gmail link expires: then they are told you must connect Gmail again. [Sharing a From address](../reference/email.md#sharing-a-from-address) has the details.
@@ -443,12 +443,12 @@ export default defineFunction(async (request, { personalMail }) => {
443
443
 
444
444
  - **`send({ sender_address_id, ... })`:** sends from that record's address, with its display name, through that record's own mailbox connection, so From and mailbox cannot disagree. `null` sends from the mailbox's own address with no From header, and leaving it out sends from the default address, else the mailbox's own. A message that names its own `from` or `sender`, or a `From` or `Sender` header, is a mistake that rejects. An address no listing has read yet is listed first, when its provider can list.
445
445
  - **Refusals,** each sending nothing:
446
- - An id that is not one of the caller's, unknown or removed alike, answers `404` (`sender-address-not-found`).
446
+ - An id that is not one of the caller's, unknown or removed alike, answers `404` (`sender-address-not-found`), as does one someone else did not [share](#sharing-a-from-address) with them.
447
447
  - A `failed` address answers `409` with `code: "sender_address_failed"`, and a `pending` one `sender_address_pending`.
448
448
  - An address on no connection the person can send through answers `sender_address_detached`.
449
449
  - An `unverified` one is sent.
450
- - **`sender(address?)`:** the record an address stands for, matched without regard to case: `id` (null for the mailbox's own address), `address`, `name` when it has one, `signature` when it has its own, `state`, and `ownerId`, whose mailbox it goes through. Without an address, the default. An address that is not the caller's is refused with a `MailSenderRefusedError` (`403`); one on two of their connections with `sender_address_ambiguous`.
451
- - **`senders()`:** every address the caller may choose, such as for a send dialog: their mailbox's own, then their records, each with its id and state.
450
+ - **`sender(address?)`:** the record an address stands for, matched without regard to case: `id` (null for the mailbox's own address), `address`, `name` when it has one, `signature` when it has its own, `state`, and `ownerId`, whose mailbox it goes through. One someone else shared with the caller comes after their own, with `shared: true` and no `ownerId`. Without an address, the default. An address that is neither the caller's nor shared with them is refused with a `MailSenderRefusedError` (`403`); one on two of their connections, or shared by two people, with `sender_address_ambiguous`.
451
+ - **`senders()`:** every address the caller may choose, such as for a send dialog: their mailbox's own, then their records, each with its id and state, then those shared with them.
452
452
  - **`refresh()`:** reads the send-as addresses of each of the caller's mailboxes whose provider can list them, and answers how each went: `listed`, `not_permitted` with `missing_scopes`, or `error` with `link_expired` or `listing_failed`. A connection that fails changes nothing and stops none of the others.
453
453
  - **The mailbox's own address** is the one its provider's ID token names; Google gives it with the `email` scope sign-in asks for.
454
454
  - **The account page's calls:**
@@ -461,7 +461,6 @@ export default defineFunction(async (request, { personalMail }) => {
461
461
  Each acts on the signed-in person's own addresses and connections only: any other id answers `404` before anything is done.
462
462
  - **Upgrading:** an address entered before From addresses were records goes on its owner's Gmail connection when they had exactly one. With none or several it shows **No mailbox**, and the person removes it and adds it again.
463
463
  - <gap>An address on a mailbox linked without `gmail.settings.basic` cannot be checked before each send because only a [verification](#verifying-a-from-address) started from the account page is implemented for it.</gap>
464
- - <gap>An address cannot be shared with others who send mail because proving that the person owns the address is not implemented.</gap>
465
464
 
466
465
  ### Verifying a From address
467
466
 
@@ -514,10 +513,27 @@ const testMailVerifier: SenderAddressVerifier = {
514
513
  - `POST .../mail-senders/verify { id }` starts each verifier on one of the person's addresses on a connection they can send through, and answers its `verifications`.
515
514
  - Staff signed in as the person cannot start one.
516
515
 
516
+ ### Sharing a From address
517
+
518
+ :::caution[Beta]
519
+ <gap>The owner cannot be told when someone sends from an address they shared because notifying the owner is not implemented.</gap>
520
+ :::
521
+
522
+ An address can be shared with the app's other senders, such as a team's billing address: they pick it like one of their own and send from it, through its owner's mailbox. Only the owner shares or unshares it, on the account page, under **Edit**, with **Share with the app's other senders**.
523
+
524
+ - **Only a verified address:** sharing one that is not `verified`, by its provider's listing or a [verifier](#verifying-a-from-address)'s proof, is refused with a `409` (`MAIL_SENDER_NOT_VERIFIED`), and the dialog says to prove it first. Sharing records when it was shared and no proof of its own: every read works the state out again, as for the owner.
525
+ - **Who sees it:** with [organizations](auth.md#organizations), the people who share an organization with the owner; without them, everyone who sends mail in the app. They see its id, address and display name only, never the owner's address, id or mailbox.
526
+ - **Sending:** `send({ sender_address_id })` with a shared address's id goes out through the owner's mailbox, From that address, with its display name, while it is shared, still `verified` and its owner still in reach. Otherwise it answers `404` (`sender-address-not-found`), as for an address that is not theirs. When the owner's mailbox is gone or its link expired, it answers `409` with `code: "sender_address_owner_unlinked"`: the owner must connect their mailbox again, so no connect offer is made to the sender.
527
+ - **Adding never shares,** and removing an address unshares it: added again, it is the owner's alone until they share it again. Unsharing always works.
528
+ - **The account page's calls:**
529
+ - `GET /api/auth/account/mail-senders` gives each shared address of the person's a `sharedAt`, and lists those others shared with them as `shared`, each `{ id, address, name? }`.
530
+ - `POST .../mail-senders/share { id }` shares one of the person's addresses, and `POST .../mail-senders/unshare { id }` makes it theirs alone again; each answers the address. Any other id answers `404`.
531
+ - Staff signed in as the person can do neither.
532
+
517
533
  ### A From address on a record
518
534
 
519
535
  :::caution[Beta]
520
- A removal refused over records does not say which records hold the address; and since addresses cannot be shared yet, everyone else sees an address on a shared record as not available.
536
+ A removal refused over records does not say which records hold the address, and everyone an address is not [shared](#sharing-a-from-address) with sees it on a shared record as not available.
521
537
  :::
522
538
 
523
539
  A record can hold the address its mail goes out from, such as a client's or the seller's "Send from": declare the field with `f.mailSender()`, on a `text` column, and send from it with `send({ sender_address_id: (await personalMail.sender(value)).id })`.
@@ -526,7 +542,7 @@ A record can hold the address its mail goes out from, such as a client's or the
526
542
  send_from: f.mailSender().optional(),
527
543
  ```
528
544
 
529
- - **The form:** a dropdown of the signed-in person's addresses, their mailbox's own first, then their records, each as `Name <address>` when it has a name, followed by its state unless it is verified. An address mail cannot go out from, one `failed` or `pending`, shows but cannot be chosen, unless the record holds it already. The empty choice, **Sender's default address**, stores `null`: mail goes out from the default address of whoever sends it.
545
+ - **The form:** a dropdown of the signed-in person's addresses, their mailbox's own first, then their records, then the addresses others [shared](#sharing-a-from-address) with them, marked **shared**, each as `Name <address>` when it has a name, followed by its state unless it is verified. An address mail cannot go out from, one `failed` or `pending`, shows but cannot be chosen, unless the record holds it already. The empty choice, **Sender's default address**, stores `null`: mail goes out from the default address of whoever sends it.
530
546
  - **Saving:** a create or update may only set an address the saving person may send from, by the rule `send` uses; the address is stored as their sender spells it. Any other is refused with a `400` naming the field and the address. A visitor, and anyone on an app without personal mail, can set none.
531
547
  - **An address no longer offered,** such as one another person entered, still shows, marked **not available**, with a link to the account page. Saving other fields, or giving the same address again, leaves it as it is.
532
548
  - **Read views** show the address, with its name when it is one of the reader's.
@@ -538,7 +554,7 @@ send_from: f.mailSender().optional(),
538
554
 
539
555
  The refusal names no records, since they may be records the person cannot read, such as another organization's. It is in the language the request's `Accept-Language` asks for. The address is matched without regard to case, as sending matches it, so an index on the column's `lower()` serves it.
540
556
  - <gap>A refused removal cannot name the records that hold the address because checking which of them the person may read is not implemented.</gap>
541
- - <gap>A mail sender field cannot offer addresses shared with the person, nor refuse unsharing one a record holds, because sharing an address is not implemented.</gap>
557
+ - **Unsharing an address in use** always works: a record that holds it keeps it, shows it as not available to everyone else, and a send from it is refused.
542
558
 
543
559
  ## In a bundle
544
560