@protobase/client 0.54.0 → 0.54.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.
package/dist/auth.d.ts CHANGED
@@ -2,7 +2,7 @@ import { DeviceSession } from "./account-profile.js";
2
2
  import { SignInPolicy, SignInPolicyState } from "./sign-in-policy.js";
3
3
  import { AccountSignIn, AuthenticatorSetup, ConnectedApp, Passkey } from "./account-security.js";
4
4
  import { ConnectingClient } from "./connect.js";
5
- import { CurrentOrganization, InvitationPreview, InvitationSent, Organization, OrganizationInvitation, OrganizationMember, OrganizationRole, OrganizationsFound } from "./organizations.js";
5
+ import { CurrentOrganization, InvitationPreview, InvitationSent, Organization, OrganizationInvitation, OrganizationMember, OrganizationPerson, OrganizationRole, OrganizationsFound } from "./organizations.js";
6
6
  import { ActiveRole } from "./roles.js";
7
7
  import { AuthUser, RoleLabel, SetupStatus, SignInResult, TwoFactorMethod } from "./auth-types.js";
8
8
  import { AppUser, UserInvitation, UserInvitationSent, UsersFound } from "./users.js";
@@ -107,6 +107,7 @@ export declare const createAuthSession: (options?: AuthSessionOptions) => {
107
107
  remove: (organizationId: string) => Promise<Organization>;
108
108
  leave: (organizationId: string) => Promise<unknown>;
109
109
  members: (organizationId: string) => Promise<OrganizationMember[]>;
110
+ people: () => Promise<OrganizationPerson[]>;
110
111
  setRole: (organizationId: string, memberId: string, role: OrganizationRole) => Promise<unknown>;
111
112
  setAppRoles: (memberId: string, appRoles: string[]) => Promise<unknown>;
112
113
  removeMember: (organizationId: string, memberId: string) => Promise<unknown>;
package/dist/index.d.ts CHANGED
@@ -14,7 +14,7 @@ import { DeviceSession } from "./account-profile.js";
14
14
  import { SignInPolicy, SignInPolicyClient, SignInPolicyState, SignInRule, StaffAccessRule } from "./sign-in-policy.js";
15
15
  import { AccountSecurity, AccountSignIn, AuthenticatorSetup, ConnectedApp, Passkey, RequiredSetup } from "./account-security.js";
16
16
  import { ConnectClient, ConnectingClient } from "./connect.js";
17
- import { CurrentOrganization, InvitationPreview, InvitationSent, Organization, OrganizationInvitation, OrganizationMember, OrganizationRole, OrganizationsClient, OrganizationsFound } from "./organizations.js";
17
+ import { CurrentOrganization, InvitationPreview, InvitationSent, Organization, OrganizationInvitation, OrganizationMember, OrganizationPerson, OrganizationRole, OrganizationsClient, OrganizationsFound } from "./organizations.js";
18
18
  import { ActiveRole, RoleOption, RolesClient } from "./roles.js";
19
19
  import { AuthUser, PlatformSignIn, RoleLabel, SamlSignIn, SetupStatus, SignInMethod, SignInResult, TwoFactorMethod } from "./auth-types.js";
20
20
  import { AppUser, UserInvitation, UserInvitationSent, UsersClient, UsersFound } from "./users.js";
@@ -24,4 +24,4 @@ import { AuthSession, AuthSessionOptions, createAuthSession, tokenExpiry } from
24
24
  import { createStaticSession } from "./static-session.js";
25
25
  import { AssistantClient, AssistantClientOptions, AssistantConnection, createAssistantClient } from "./assistant.js";
26
26
  import { RuntimeClient, RuntimeClientOptions, RuntimeLastUpdate, RuntimePolicy, RuntimeStatus, RuntimeUpdateStage, createRuntimeClient } from "./runtime.js";
27
- export { type AccountSecurity, type AccountSignIn, type ActiveRole, type Aggregate, type AggregateGroup, type AggregateParams, type AggregateSplitTotal, ApiError, type AppUser, type AssistantClient, type AssistantClientOptions, type AssistantConnection, AuthError, type AuthSession, type AuthSessionOptions, type AuthUser, type AuthenticatorSetup, type BatchOp, type BatchRef, type BatchResult, type Client, type ClientOptions, type CommentPage, type CommentPerson, type ConnectClient, type ConnectedApp, type ConnectingClient, type CurrentOrganization, type DeviceSession, type DevicesClient, type Facet, type FilterInput, type FormChallenge, type FormProof, type Histogram, type HistogramBucket, type HistoryChange, type HistoryPage, type InboxNotification, type InboxPage, type InvitationPreview, type InvitationSent, type InvokeOptions, type ListPage, type ListParams, type LiveChange, type LiveHandlers, type MapBounds, type MapBucket, type MapLayerModel, type MapParams, type MapResult, type MentionableUser, type Meta, type MetaResult, type NotificationHistoryClient, type Organization, type OrganizationInvitation, type OrganizationMember, type OrganizationRole, type OrganizationsClient, type OrganizationsFound, type Passkey, type PlatformSignIn, type PluginRef, PreconditionFailedError, type ProblemDetails, type ProblemError, type PublicForm, type RecordComment, type RecordOf, type RecordPermissions, type RecordPhotos, type RegisteredDevice, type RelatedLabels, type RequiredSetup, type ResourcePermissions, type ResourceRef, type RoleLabel, type RoleOption, type RolesClient, type RuntimeClient, type RuntimeClientOptions, type RuntimeLastUpdate, type RuntimePolicy, type RuntimeStatus, type RuntimeUpdateStage, type SamlSignIn, type Series, type SeriesParams, type SeriesPoint, type SetupStatus, type SignInMethod, type SignInPolicy, type SignInPolicyClient, type SignInPolicyState, type SignInResult, type SignInRule, type SourceMeta, type SourceRef, type StaffAccessRule, type StaffSignIn, type StaffSignInClient, type Stored, type StoredFile, type StoredFileVariant, type TwoFactorMethod, type UploadOptions, type UploadProgress, type UploadResult, type UserInvitation, type UserInvitationSent, type UsersClient, type UsersFound, type WebDeviceRegistration, createAssistantClient, createAuthSession, createClient, createRuntimeClient, createStaticSession, fileUrl, filterText, isApiError, listWire, routedClient, sourceMeta, tokenExpiry };
27
+ export { type AccountSecurity, type AccountSignIn, type ActiveRole, type Aggregate, type AggregateGroup, type AggregateParams, type AggregateSplitTotal, ApiError, type AppUser, type AssistantClient, type AssistantClientOptions, type AssistantConnection, AuthError, type AuthSession, type AuthSessionOptions, type AuthUser, type AuthenticatorSetup, type BatchOp, type BatchRef, type BatchResult, type Client, type ClientOptions, type CommentPage, type CommentPerson, type ConnectClient, type ConnectedApp, type ConnectingClient, type CurrentOrganization, type DeviceSession, type DevicesClient, type Facet, type FilterInput, type FormChallenge, type FormProof, type Histogram, type HistogramBucket, type HistoryChange, type HistoryPage, type InboxNotification, type InboxPage, type InvitationPreview, type InvitationSent, type InvokeOptions, type ListPage, type ListParams, type LiveChange, type LiveHandlers, type MapBounds, type MapBucket, type MapLayerModel, type MapParams, type MapResult, type MentionableUser, type Meta, type MetaResult, type NotificationHistoryClient, type Organization, type OrganizationInvitation, type OrganizationMember, type OrganizationPerson, type OrganizationRole, type OrganizationsClient, type OrganizationsFound, type Passkey, type PlatformSignIn, type PluginRef, PreconditionFailedError, type ProblemDetails, type ProblemError, type PublicForm, type RecordComment, type RecordOf, type RecordPermissions, type RecordPhotos, type RegisteredDevice, type RelatedLabels, type RequiredSetup, type ResourcePermissions, type ResourceRef, type RoleLabel, type RoleOption, type RolesClient, type RuntimeClient, type RuntimeClientOptions, type RuntimeLastUpdate, type RuntimePolicy, type RuntimeStatus, type RuntimeUpdateStage, type SamlSignIn, type Series, type SeriesParams, type SeriesPoint, type SetupStatus, type SignInMethod, type SignInPolicy, type SignInPolicyClient, type SignInPolicyState, type SignInResult, type SignInRule, type SourceMeta, type SourceRef, type StaffAccessRule, type StaffSignIn, type StaffSignInClient, type Stored, type StoredFile, type StoredFileVariant, type TwoFactorMethod, type UploadOptions, type UploadProgress, type UploadResult, type UserInvitation, type UserInvitationSent, type UsersClient, type UsersFound, type WebDeviceRegistration, createAssistantClient, createAuthSession, createClient, createRuntimeClient, createStaticSession, fileUrl, filterText, isApiError, listWire, routedClient, sourceMeta, tokenExpiry };
@@ -25,6 +25,12 @@ export type CurrentOrganization = {
25
25
  memberId?: string;
26
26
  globalRoles: string[];
27
27
  };
28
+ /** A member as every member of the organization sees them: their user id, name and photo, without their address. */
29
+ export type OrganizationPerson = {
30
+ id: string;
31
+ name: string;
32
+ image?: string;
33
+ };
28
34
  export type OrganizationMember = {
29
35
  id: string;
30
36
  userId: string;
@@ -98,6 +104,8 @@ export declare const organizationsClient: (client: BetterAuthClient, refreshToke
98
104
  remove: (organizationId: string) => Promise<Organization>;
99
105
  leave: (organizationId: string) => Promise<unknown>;
100
106
  members: (organizationId: string) => Promise<OrganizationMember[]>;
107
+ /** The people of the organization the session works in, for any of its members; rejects for anyone else. */
108
+ people: () => Promise<OrganizationPerson[]>;
101
109
  setRole: (organizationId: string, memberId: string, role: OrganizationRole) => Promise<unknown>;
102
110
  /** Sets a member's app roles; only the roles the person may give can change. */
103
111
  setAppRoles: (memberId: string, appRoles: string[]) => Promise<unknown>;
@@ -66,6 +66,8 @@ const organizationsClient = (client, refreshToken) => {
66
66
  organizationId,
67
67
  limit: "1000"
68
68
  } })).members.map(member),
69
+ /** The people of the organization the session works in, for any of its members; rejects for anyone else. */
70
+ people: async () => (await call("/organization/people", "Could not read the people")).people,
69
71
  setRole: (organizationId, memberId, role) => call("/organization/update-member-role", "Could not change the role", { body: {
70
72
  organizationId,
71
73
  memberId,
@@ -138,6 +138,7 @@ const createStaticSession = (token, user = {
138
138
  remove: unsupported("delete an organization"),
139
139
  leave: unsupported("leave an organization"),
140
140
  members: async () => [],
141
+ people: async () => [],
141
142
  setRole: unsupported("change a role"),
142
143
  setAppRoles: unsupported("change app roles"),
143
144
  removeMember: unsupported("remove a member"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/client",
3
- "version": "0.54.0",
3
+ "version": "0.54.2",
4
4
  "description": "Typed fetch client for the Protobase REST API.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -30,8 +30,8 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@better-auth/passkey": "^1.7.12",
33
- "@protobase/layout": "0.54.0",
34
- "@protobase/schema": "0.54.0",
33
+ "@protobase/layout": "0.54.2",
34
+ "@protobase/schema": "0.54.2",
35
35
  "@simplewebauthn/browser": "^13.3.0",
36
36
  "better-auth": "^1.7.12"
37
37
  }