@protobase/cli 0.54.0 → 0.54.1
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.54.
|
|
3
|
+
"version": "0.54.1",
|
|
4
4
|
"description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@better-auth/core": "^1.7.12",
|
|
44
44
|
"@hono/node-server": "^2.1.3",
|
|
45
|
-
"@protobase/config": "0.54.
|
|
46
|
-
"@protobase/layout": "0.54.
|
|
47
|
-
"@protobase/query": "0.54.
|
|
48
|
-
"@protobase/schema": "0.54.
|
|
49
|
-
"@protobase/server": "0.54.
|
|
50
|
-
"@protobase/ui": "0.54.
|
|
45
|
+
"@protobase/config": "0.54.1",
|
|
46
|
+
"@protobase/layout": "0.54.1",
|
|
47
|
+
"@protobase/query": "0.54.1",
|
|
48
|
+
"@protobase/schema": "0.54.1",
|
|
49
|
+
"@protobase/server": "0.54.1",
|
|
50
|
+
"@protobase/ui": "0.54.1",
|
|
51
51
|
"@react-email/render": "^2.1.0",
|
|
52
52
|
"@scalar/hono-api-reference": "^0.12.10",
|
|
53
53
|
"@tailwindcss/vite": "^4.3.3",
|
|
@@ -14,6 +14,7 @@ React components, field types, pages and handlers of your own, loaded as plugins
|
|
|
14
14
|
- [Image carousel](../reference/custom-components.md#image-carousel): Step through screenshots or a record's files in your own components by swiping or with arrows, as cards step through photos.
|
|
15
15
|
- [Assistant parts](../reference/assistant.md#in-the-ui): The assistant's panel, chat messages, composer and action cards for your own components, with a frameless action card for a page that is already framed.
|
|
16
16
|
- [Chat parts](../reference/custom-components.md#chat-parts): A chat between people from the app's parts: messages with their author, avatar, time and a status line, day and new-message lines, a thread that loads earlier messages, keeps the reader's place and jumps to the end when they send, and a composer of several lines with @mentions.
|
|
17
|
+
- [Members' names](../reference/custom-components.md#members-names): The names and photos of the organization's members by user id, for message authors and @mentions in your own components; every member reads them, without email addresses.
|
|
17
18
|
- [Action handlers](../reference/custom-components.md#action-handlers): Your own code for a named action, with the record, the API client and the action's inputs.
|
|
18
19
|
- [Shell slots](../reference/custom-components.md#shell-slots): Your own components in the top bar, in a panel beside every page, or as the sidebar logo.
|
|
19
20
|
- [Plugins](../reference/plugins.md#how-a-plugin-stays-working): Your React code is a plugin that the app loads at start and that keeps working across Protobase releases without changes.
|
|
@@ -597,7 +597,7 @@ It is Better Auth's organization plugin, with its tables named in snake_case (`o
|
|
|
597
597
|
|
|
598
598
|
**Invitations.** Better Auth's `POST /api/auth/organization/invite-member` with `{ organizationId, email, role, appRoles }`; inviting again replaces the earlier invitation, and it works for `invitationDays` (default 7). The email links to `{url}/-/invitation?token=…` (`invitationUrl`), with a token signed with the app's `secret`, since members can read invitation ids; without a mailer, the answer carries the `link` to pass on. The link page shows `GET /api/auth/invitation?token=`, accepts with `POST /api/auth/invitation/accept` for someone signed in as the invited address, and makes an account with `POST /api/auth/invitation/sign-up` (`{ token, name, password? }`) for an address without one. Someone signed in sees the invitations for their own address with Better Auth's `GET /api/auth/organization/list-user-invitations`, on the organizations page, and accepts one there with `POST /api/auth/invitation/accept-own` (`{ invitationId }`). The link page and its sign-up serve [invitations to the app](#users-page) too. [Open sign-up](#open-sign-up) is not available with organizations: an invitation is the address someone vouched for.
|
|
599
599
|
|
|
600
|
-
**Members.** Better Auth's `list-members`, `update-member-role`, `remove-member` and `leave`; `POST /api/auth/organization/set-app-roles` (`{ memberId, appRoles }`); `POST /api/auth/organization/transfer-ownership` (`{ memberId, keepAs? }`) makes a member owner and the caller an admin in one step. `GET /api/auth/organization/current` answers the organization a session works in with the caller's roles there.
|
|
600
|
+
**Members.** Better Auth's `list-members`, `update-member-role`, `remove-member` and `leave`; `POST /api/auth/organization/set-app-roles` (`{ memberId, appRoles }`); `POST /api/auth/organization/transfer-ownership` (`{ memberId, keepAs? }`) makes a member owner and the caller an admin in one step. `GET /api/auth/organization/current` answers the organization a session works in with the caller's roles there. `GET /api/auth/organization/people` answers the members of that organization to any of its members, as `{ people: [{ id, name, image? }] }` with `id` the user id and no email addresses; anyone who is not a member of it, signed out or with a global role only, is refused.
|
|
601
601
|
|
|
602
602
|
**Deleting** an organization (Better Auth's `delete`, owners only) is refused with `409 ORGANIZATION_HAS_RECORDS` while a `.tenant` resource has rows in it; `deleteRecords: 'cascade'` leaves it to the project's foreign keys. The `beforeOrganizationDeleted` [hook](#hooks) may refuse too.
|
|
603
603
|
|
|
@@ -310,6 +310,31 @@ export const Channel = ({ messages, sent, members, onSend, onLoadEarlier }: Chan
|
|
|
310
310
|
)
|
|
311
311
|
```
|
|
312
312
|
|
|
313
|
+
### Members' names
|
|
314
|
+
|
|
315
|
+
The author is a user id, and `useMembers()` from `@protobase/ui` turns it into a name: the members of the organization the signed-in person works in, `{ id, name, image? }` by name, with `id` the user id that `.author()` stores and that `onSend`'s mentions hold. Every member reads it, owners, admins and members alike; it holds no email addresses. It is a TanStack Query result (`data`, `isLoading`, `error`) with `member(id)`, which finds one and, for an id it does not know, such as a newcomer's first message, reads the list again once it is 10 seconds old; it is also read again when the window regains focus and the list is 30 seconds old. It needs [organizations](auth.md#organizations): without them, `error` says so.
|
|
316
|
+
|
|
317
|
+
```tsx
|
|
318
|
+
import { ChatMessage, Composer, MentionedText, useMembers } from '@protobase/ui'
|
|
319
|
+
|
|
320
|
+
export const Message = ({ message }: { message: { author_id: string; body: string; mentions: string[]; sent_at: string } }) => {
|
|
321
|
+
const { member } = useMembers()
|
|
322
|
+
return (
|
|
323
|
+
<ChatMessage author={{ id: message.author_id, name: member(message.author_id)?.name ?? '' }} time={message.sent_at}>
|
|
324
|
+
<MentionedText text={message.body} mentions={message.mentions.map((id) => ({ name: member(id)?.name }))} />
|
|
325
|
+
</ChatMessage>
|
|
326
|
+
)
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export const ChannelComposer = ({ onSend }: { onSend: (text: string, mentions: string[]) => void }) => {
|
|
330
|
+
const { data: members = [] } = useMembers()
|
|
331
|
+
const searchPeople = async (query: string) => members.filter((person) => person.name.toLowerCase().includes(query.toLowerCase())).slice(0, 8)
|
|
332
|
+
return <Composer onSend={onSend} searchPeople={searchPeople} />
|
|
333
|
+
}
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
`searchPeople` filters the list in the browser and shows at most 8, as comments' mentions do. <gap>`useMembers()` cannot page or search on the server because a server-side people resource is not implemented, so the whole list loads in the browser, which suits a team, not thousands of members.</gap> <gap>Old messages of someone who has left the organization cannot show their name because looking up former members is not implemented.</gap> A person who works in an organization without being a member of it, through a global role, gets no list.
|
|
337
|
+
|
|
313
338
|
## Components in the chat
|
|
314
339
|
|
|
315
340
|
The same components draw the assistant's [widget parts](assistant.md#widget-parts): a part names a component, and the dock draws it with the part's props, so one component can sit on a page and in the chat. In the chat there is no record around it, so a component that needs `useLayoutRecord()` works only on pages; take ids as props instead. Besides the API hooks, a widget can read the assistant backend with [`useBackendData`](assistant.md#reading-the-backend-from-a-widget).
|