@rebasepro/client 0.11.1-canary.gfadf355 → 0.12.0

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,42 +1,14 @@
1
1
  import type { Transport } from "./transport";
2
- /** A single permission entry scoping an API key to a collection and its allowed operations. */
3
- export interface ApiKeyPermission {
4
- collection: string;
5
- operations: ("read" | "write" | "delete")[];
6
- }
7
- /** An API key with the secret portion masked (returned by list / get / update). */
8
- export interface ApiKeyMasked {
9
- id: string;
10
- name: string;
11
- key_prefix: string;
12
- permissions: ApiKeyPermission[];
13
- admin: boolean;
14
- rate_limit: number | null;
15
- created_by: string;
16
- created_at: string;
17
- updated_at: string;
18
- last_used_at: string | null;
19
- expires_at: string | null;
20
- revoked_at: string | null;
21
- }
22
- /** An API key including the full secret (returned only on creation). */
23
- export interface ApiKeyWithSecret extends ApiKeyMasked {
24
- key: string;
25
- }
26
- /** Payload for creating a new API key. */
27
- export interface CreateApiKeyRequest {
28
- name: string;
29
- permissions: ApiKeyPermission[];
30
- rate_limit?: number | null;
31
- expires_at?: string | null;
32
- }
33
- /** Payload for updating an existing API key. */
34
- export interface UpdateApiKeyRequest {
35
- name?: string;
36
- permissions?: ApiKeyPermission[];
37
- rate_limit?: number | null;
38
- expires_at?: string | null;
39
- }
2
+ /**
3
+ * These were re-declared here, under a comment saying they lived in the server
4
+ * package rather than in `@rebasepro/types`. That stopped being true, and the
5
+ * copy drifted: it never gained `admin`, the flag that grants a key the `admin`
6
+ * role — admin routes plus the RLS `default_admin` policies — so the SDK could
7
+ * describe every kind of key except a privileged one, and
8
+ * `createKey({ …, admin: true })` was an excess-property error.
9
+ */
10
+ export type { ApiKeyPermission, ApiKeyMasked, ApiKeyWithSecret, CreateApiKeyRequest, UpdateApiKeyRequest } from "@rebasepro/types";
11
+ import type { ApiKeyMasked, ApiKeyWithSecret, CreateApiKeyRequest, UpdateApiKeyRequest } from "@rebasepro/types";
40
12
  /** Options for the `createApiKeys` factory. */
41
13
  export interface CreateApiKeysOptions {
42
14
  apiKeysPath?: string;
@@ -27,14 +27,8 @@ export interface FunctionsClient {
27
27
  */
28
28
  invoke<T = unknown>(name: string, payload?: unknown, options?: FunctionInvokeOptions): Promise<T>;
29
29
  }
30
- export interface FunctionInvokeOptions {
31
- /** HTTP method defaults to `"POST"`. */
32
- method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
33
- /** Sub-path appended after the function name, e.g. `"status/123"`. */
34
- path?: string;
35
- /** Extra headers merged into the request (auth is still injected automatically). */
36
- headers?: Record<string, string>;
37
- }
30
+ export type { FunctionInvokeOptions } from "@rebasepro/types";
31
+ import type { FunctionInvokeOptions } from "@rebasepro/types";
38
32
  /**
39
33
  * Create a `FunctionsClient` backed by the given transport.
40
34
  *