@rebasepro/types 0.34.2 → 0.35.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.
@@ -1,4 +1,4 @@
1
- import type { User } from "../users/index.js";
1
+ import type { ImportUserInput, ImportUsersResult, User } from "../users/index.js";
2
2
  import type { ResourceRef } from "../types/resources.js";
3
3
  import type { RebaseSdkData } from "./data.js";
4
4
  import type { EmailService } from "./email.js";
@@ -166,6 +166,13 @@ export interface AdminUser {
166
166
  * it signs in nowhere and the tokens it holds are refused.
167
167
  */
168
168
  disabled?: boolean;
169
+ /**
170
+ * The roles in {@link roles} that the platform hosting this backend granted
171
+ * — on Rebase Cloud, `admin` given by the console's "Open admin panel" —
172
+ * and takes back when it removes the person's access. Absent when none
173
+ * did; a role granted by hand in the app is never listed.
174
+ */
175
+ platformRoles?: string[];
169
176
  metadata?: Record<string, any>;
170
177
  createdAt: string;
171
178
  updatedAt: string;
@@ -250,6 +257,14 @@ export interface AdminAPI {
250
257
  invitationSent?: boolean;
251
258
  emailDeliveryFailed?: boolean;
252
259
  }>;
260
+ /**
261
+ * Accounts from another system, keeping their ids; no password, no email.
262
+ * An id or email already taken is `skipped`, never updated. At most
263
+ * `MAX_USERS_PER_IMPORT` (100) per call.
264
+ */
265
+ importUsers(users: ImportUserInput[], options?: {
266
+ dryRun?: boolean;
267
+ }): Promise<ImportUsersResult>;
253
268
  updateUser(uid: string, data: {
254
269
  email?: string;
255
270
  displayName?: string;
@@ -557,6 +572,13 @@ export interface RebaseClient<DB = unknown> {
557
572
  schema?: SchemaAPI;
558
573
  /** Custom backend functions API */
559
574
  functions?: FunctionsAPI;
575
+ /**
576
+ * Call a SQL function the backend declares with `defineRpc` — `POST
577
+ * /rpc/<name>` with the named arguments as the JSON body — as the caller.
578
+ * Resolves to the function's result: an array for a set-returning
579
+ * function, the row or the value for any other, `null` for `void`.
580
+ */
581
+ rpc?<T = unknown, A extends Record<string, unknown> = Record<string, unknown>>(name: string, args?: A): Promise<T>;
560
582
  /** The project's service keys. Requires `keys:read` / `keys:write`. */
561
583
  apiKeys?: ApiKeysAPI;
562
584
  /** The signed-in person's own API keys, when the backend enables `auth.personalKeys`. */