@supacloud/js 0.29.0 → 0.31.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,3 +1,4 @@
1
+ type FetchTransport = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
1
2
  export type SupaCloudOAuthFetchOptions = {
2
3
  /**
3
4
  * Public OAuth client identifier registered with SupAuth. Leave empty for a
@@ -11,7 +12,7 @@ export type SupaCloudOAuthFetchOptions = {
11
12
  */
12
13
  tokenEndpoint?: string;
13
14
  /** Injectable transport for tests or runtimes with a custom fetch. */
14
- fetch?: typeof fetch;
15
+ fetch?: FetchTransport;
15
16
  };
16
17
  /**
17
18
  * Adapts Supabase Auth's built-in refresh request to SupAuth's OAuth token
@@ -22,4 +23,5 @@ export type SupaCloudOAuthFetchOptions = {
22
23
  * global: { fetch: createSupaCloudOAuthFetch({ clientId }) },
23
24
  * });
24
25
  */
25
- export declare function createSupaCloudOAuthFetch(options?: SupaCloudOAuthFetchOptions): typeof fetch;
26
+ export declare function createSupaCloudOAuthFetch(options?: SupaCloudOAuthFetchOptions): FetchTransport;
27
+ export {};
@@ -0,0 +1,2 @@
1
+ export type FetchTransport = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
2
+ export declare function createBoundedRpcFetch(path: RegExp, failure: () => Error, fetchImpl?: FetchTransport): FetchTransport;
@@ -0,0 +1,6 @@
1
+ import { type FetchTransport } from "./bounded-rpc-fetch.js";
2
+ export interface SupaCloudCommandFetchOptions {
3
+ fetch?: FetchTransport;
4
+ }
5
+ /** Install in Supabase's global.fetch to bound command responses before JSON parsing. */
6
+ export declare function createSupaCloudCommandFetch(options?: SupaCloudCommandFetchOptions): FetchTransport;
@@ -1,4 +1,13 @@
1
1
  import { type CommandLookup, type CommandStatus } from "@supacloud/contracts";
2
+ import { SupaCloudApiError } from "./api-error.js";
3
+ export declare class SupaCloudCommandReadError extends SupaCloudApiError {
4
+ readonly mutationMayHaveApplied = false;
5
+ constructor();
6
+ }
7
+ export declare class SupaCloudCommandSubmitError extends SupaCloudApiError {
8
+ readonly mutationMayHaveApplied: boolean;
9
+ constructor(mutationMayHaveApplied?: boolean);
10
+ }
2
11
  /** Narrow, validated boundary compatible with the Supabase RPC client. */
3
12
  export interface CommandRpcClient {
4
13
  rpc(functionName: string, args: {
@@ -6,6 +15,7 @@ export interface CommandRpcClient {
6
15
  }): PromiseLike<{
7
16
  data: unknown;
8
17
  error: unknown;
18
+ status?: number;
9
19
  }>;
10
20
  }
11
21
  export interface SupaCloudCommandSubmitRequest {
package/dist/index.d.ts CHANGED
@@ -2,56 +2,22 @@ import type { SupabaseClient } from "@supabase/supabase-js";
2
2
  import { SupaCloudWorkflowsClient } from "./workflows.js";
3
3
  import { SupaCloudCommandsClient } from "./commands.js";
4
4
  import { SupaCloudArtifactsClient } from "./artifacts.js";
5
+ import { SupaCloudApiError } from "./api-error.js";
6
+ import { type FetchTransport } from "./bounded-rpc-fetch.js";
7
+ import { SupaCloudOAuthClientsClient } from "./oauth-clients.js";
8
+ import { SupaCloudOAuthServerClient } from "./oauth-server.js";
9
+ import { type SupaCloudQueueJson, type SupaCloudQueueMessage, type SupaCloudQueueSendResult, type SupaCloudQueueMutationResult } from "./queue-rpc.js";
10
+ export { SupaCloudApiError } from "./api-error.js";
11
+ export { SupaCloudQueueError, type SupaCloudQueueJson, type SupaCloudQueueMessage, type SupaCloudQueueSendResult, type SupaCloudQueueMutationResult, } from "./queue-rpc.js";
12
+ export * from "./oauth-clients.js";
13
+ export * from "./oauth-server.js";
5
14
  export { createSupaCloudOAuthFetch, type SupaCloudOAuthFetchOptions, } from "./auth-fetch.js";
6
15
  export * from "./workflows.js";
16
+ export { createSupaCloudWorkflowFetch, type SupaCloudWorkflowFetchOptions } from "./workflow-fetch.js";
17
+ export { createSupaCloudCommandFetch, type SupaCloudCommandFetchOptions } from "./command-fetch.js";
18
+ export { createSupaCloudArtifactFetch, type SupaCloudArtifactFetchOptions } from "./artifact-fetch.js";
7
19
  export * from "./commands.js";
8
20
  export * from "./artifacts.js";
9
- export declare const SUPACLOUD_JS_VERSION = "0.27.1";
10
- export type SupaCloudCapability = {
11
- available: boolean;
12
- source: string;
13
- version: string | null;
14
- reason_code: string | null;
15
- authority_project_ref?: string;
16
- managed_by_owner?: boolean;
17
- [key: string]: unknown;
18
- };
19
- export type SupaCloudProjectCapabilities = {
20
- project_ref: string;
21
- auth_runtime: string;
22
- schema_version: number;
23
- platform_version?: string;
24
- environment?: string;
25
- storage_backend?: string;
26
- capabilities: Record<string, SupaCloudCapability>;
27
- [key: string]: unknown;
28
- };
29
- export type SupaCloudEnvironmentInfo = {
30
- projectRef: string;
31
- platformVersion: string;
32
- environment: string;
33
- schemaVersion: number;
34
- authRuntime: string;
35
- storageBackend?: string;
36
- capabilities: Record<string, SupaCloudCapability>;
37
- [key: string]: unknown;
38
- };
39
- export type SupaCloudStoragePlatformConstraints = {
40
- max_upload_size_bytes: number;
41
- max_upload_size_mb: number;
42
- tus_max_size_bytes: number;
43
- tus_chunk_max_size_bytes: number;
44
- streaming_upload_supported: boolean;
45
- };
46
- export type SupaCloudStorageUploadConstraints = {
47
- bucketId: string;
48
- fileSizeLimit: number | null;
49
- allowedMimeTypes: string[] | null;
50
- };
51
- export type SupaCloudUploadValidationResult = {
52
- valid: boolean;
53
- error?: string;
54
- };
55
21
  export type SupaCloudTaskStatus = "pending" | "leased" | "running" | "retry_scheduled" | "succeeded" | "failed" | "dead_lettered" | "cancelled" | "queued" | "processing" | "completed";
56
22
  export type SupaCloudTaskLogEntry = {
57
23
  timestamp: string;
@@ -74,7 +40,23 @@ export type SupaCloudTaskResultDecoder<TResult> = (value: unknown) => TResult;
74
40
  export type SupaCloudTaskDecoder<TResult> = SupaCloudTaskResultDecoder<TResult>;
75
41
  export type SupaCloudTaskDetail<TResult = unknown> = {
76
42
  id: string;
43
+ project_ref: string;
77
44
  status: SupaCloudTaskStatus | string;
45
+ task_type?: string;
46
+ executor?: {
47
+ kind: string;
48
+ version: string;
49
+ definition: string;
50
+ run_id: string;
51
+ native_status: string;
52
+ };
53
+ capabilities?: {
54
+ cancel: boolean;
55
+ retry: boolean;
56
+ };
57
+ blocked_reason?: string | null;
58
+ total_steps?: number;
59
+ finished_steps?: number;
78
60
  function_slug?: string | null;
79
61
  function_version?: string | null;
80
62
  attempt?: number | null;
@@ -111,7 +93,9 @@ export type SupaCloudTaskListFilters = {
111
93
  export type SupaCloudTaskSubmitOptions = {
112
94
  body?: string | Blob | ArrayBuffer | FormData | File | ReadableStream<Uint8Array> | Record<string, unknown>;
113
95
  headers?: Record<string, string>;
96
+ /** @deprecated Configure retry policy on the platform; this compatibility field is ignored. */
114
97
  retries?: number;
98
+ /** @deprecated Configure execution timeout on the platform; this compatibility field is ignored. */
115
99
  timeoutSec?: number;
116
100
  idempotencyKey?: string;
117
101
  method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
@@ -170,33 +154,6 @@ export type SupaCloudQueueListFilters = {
170
154
  dlq?: boolean;
171
155
  limit?: number;
172
156
  };
173
- export type SupaCloudQueueMessage = {
174
- id: string;
175
- msg_id: number;
176
- read_ct?: number;
177
- enqueued_at?: string | null;
178
- vt?: string | null;
179
- message?: Record<string, unknown>;
180
- payload: Record<string, unknown>;
181
- status?: string;
182
- queue_name?: string;
183
- task_type?: string;
184
- [key: string]: unknown;
185
- };
186
- export type SupaCloudQueueSendResult = {
187
- id: string;
188
- msg_id: number;
189
- queue_name: string;
190
- status: "pending";
191
- payload: Record<string, unknown>;
192
- };
193
- export type SupaCloudQueueMutationResult = {
194
- id: string;
195
- msg_id: number;
196
- queue_name: string;
197
- status: "archived" | "deleted" | "released";
198
- success: boolean;
199
- };
200
157
  export type SupaCloudQueueStats = {
201
158
  queue_name: string;
202
159
  queue_length: number;
@@ -223,82 +180,20 @@ export type SupaCloudQueueSettings = {
223
180
  rate_limit_per_minute: number;
224
181
  };
225
182
  export type SupaCloudQueueSettingsUpdate = Partial<SupaCloudQueueSettings>;
226
- export type SupaCloudSupAuthAdminMode = "sso" | "token" | "auto";
227
- export type SupaCloudSupAuthStorageBucket = {
228
- id: string;
229
- public?: boolean;
230
- fileSizeLimit?: number;
231
- allowedMimeTypes?: string[];
232
- };
233
- export type SupaCloudSupAuthProvisionOptions = {
234
- authDomain?: string;
235
- apiDomain?: string;
236
- adminMode?: SupaCloudSupAuthAdminMode;
237
- adminSsoClientId?: string;
238
- runtimeUrl?: string;
239
- supaOAuthUrl?: string;
240
- storageBuckets?: SupaCloudSupAuthStorageBucket[];
241
- metadata?: Record<string, unknown>;
242
- };
243
- export type SupaCloudSupAuthReconcileOptions = {
244
- dryRun?: boolean;
245
- force?: boolean;
246
- };
247
- export type SupaCloudSupAuthStepResult = {
248
- step: string;
249
- status: "pending" | "running" | "succeeded" | "failed" | "skipped" | string;
250
- message?: string;
251
- details?: Record<string, unknown>;
252
- };
253
- export type SupaCloudSupAuthProvisionResult = {
254
- projectRef: string;
255
- status: "pending" | "running" | "succeeded" | "failed" | string;
256
- steps?: SupaCloudSupAuthStepResult[];
257
- raw?: unknown;
258
- };
259
- export type SupaCloudSupAuthReconcileResult = {
260
- projectRef: string;
261
- changed: boolean;
262
- dryRun?: boolean;
263
- steps?: SupaCloudSupAuthStepResult[];
264
- raw?: unknown;
265
- };
266
- export type SupaCloudSupAuthRollbackResult = {
267
- projectRef: string;
268
- status: "succeeded" | "failed" | string;
269
- steps?: SupaCloudSupAuthStepResult[];
270
- raw?: unknown;
271
- };
272
- export type SupaCloudSupAuthClientConfig = {
273
- projectRef: string;
274
- supabaseUrl: string;
275
- anonKey?: string | null;
276
- authUrl: string;
277
- restUrl: string;
278
- storageUrl: string;
279
- realtimeUrl: string;
280
- functionsUrl: string;
281
- issuer?: string | null;
282
- jwksUrl?: string | null;
283
- metadata?: Record<string, unknown>;
284
- };
285
- export type SupaCloudSupAuthVerificationCheck = {
286
- name: string;
287
- status: "pass" | "fail" | "warn" | string;
288
- message?: string;
289
- details?: Record<string, unknown>;
290
- };
291
- export type SupaCloudSupAuthVerification = {
292
- projectRef: string;
293
- healthy: boolean;
294
- checks: SupaCloudSupAuthVerificationCheck[];
295
- };
296
183
  export type SupaCloudTaskWaitOptions = {
297
184
  intervalMs?: number;
298
185
  signal?: AbortSignal;
299
186
  };
300
187
  export type SupaCloudTaskSubscribeState = "connecting" | "realtime" | "polling" | "closed";
188
+ export type SupaCloudTaskSubscription = {
189
+ readonly connectionState: SupaCloudTaskSubscribeState;
190
+ unsubscribe: () => void;
191
+ };
301
192
  export type SupaCloudTaskSubscribeOptions<TResult = unknown> = {
193
+ realtime?: {
194
+ schema: string;
195
+ table: string;
196
+ };
302
197
  pollingIntervalMs?: number;
303
198
  realtimeTimeoutMs?: number;
304
199
  reconcileIntervalMs?: number;
@@ -309,10 +204,6 @@ export type SupaCloudTaskSubscribeOptions<TResult = unknown> = {
309
204
  onError?: (error: unknown) => void;
310
205
  stopOnTerminal?: boolean;
311
206
  };
312
- export type SupaCloudTaskSubscription = {
313
- readonly connectionState: SupaCloudTaskSubscribeState;
314
- unsubscribe: () => void;
315
- };
316
207
  export type SupaCloudTaskReceipt<TResult = unknown> = {
317
208
  taskId: string;
318
209
  status: string;
@@ -329,83 +220,28 @@ export type SupaCloudClientOptions<TClient extends SupabaseClient = SupabaseClie
329
220
  getAccessToken?: () => Promise<string | null> | string | null;
330
221
  pollingIntervalMs?: number;
331
222
  };
332
- export type SupaCloudOAuthServerStatus = {
333
- project_ref: string;
334
- organization_id?: string;
335
- account_isolated: boolean;
336
- enabled: boolean;
337
- allow_dynamic_registration: boolean;
338
- issuer: string;
339
- authorization_path?: string;
340
- discovery_url: string;
341
- oauth_authorization_server_metadata_url?: string;
342
- jwks_url: string;
343
- authorization_endpoint: string;
344
- token_endpoint: string;
345
- userinfo_endpoint?: string;
346
- registration_endpoint?: string;
347
- signing_alg?: string;
348
- oidc_id_token_ready?: boolean;
349
- migration_status?: string;
350
- warnings?: string[];
351
- };
352
- export type SupaCloudOAuthClientType = "public" | "confidential";
353
- export type SupaCloudOAuthClientAuthMethod = "none" | "client_secret_basic" | "client_secret_post";
354
- export type SupaCloudOAuthClient = {
355
- client_id: string;
356
- client_secret?: string;
357
- client_type?: SupaCloudOAuthClientType | string;
358
- redirect_uris?: string[];
359
- token_endpoint_auth_method?: SupaCloudOAuthClientAuthMethod | string;
360
- grant_types?: string[];
361
- response_types?: string[];
362
- client_name?: string;
363
- client_uri?: string;
364
- logo_uri?: string;
365
- registration_type?: string;
366
- created_at?: string;
367
- updated_at?: string;
368
- [key: string]: unknown;
369
- };
370
- export type SupaCloudOAuthClientList = {
371
- clients?: SupaCloudOAuthClient[];
372
- [key: string]: unknown;
373
- };
374
- export type SupaCloudOAuthClientCreate = {
375
- redirect_uris: string[];
376
- client_type?: SupaCloudOAuthClientType;
377
- token_endpoint_auth_method?: SupaCloudOAuthClientAuthMethod;
378
- grant_types?: string[];
379
- client_name?: string;
380
- client_uri?: string;
381
- logo_uri?: string;
382
- };
383
- export type SupaCloudOAuthClientUpdate = Partial<Omit<SupaCloudOAuthClientCreate, "client_type">>;
384
- export type SupaCloudAuthorizeUrlOptions = {
385
- clientId: string;
386
- redirectUri: string;
387
- scope?: string | string[];
388
- state?: string;
389
- codeChallenge?: string;
390
- codeChallengeMethod?: "S256" | "plain";
391
- nonce?: string;
392
- responseType?: "code";
393
- resource?: string;
394
- };
395
223
  export declare class SupaCloudTaskSubmitError extends Error {
224
+ readonly code = "TASK_SUBMIT_UNCONFIRMED";
225
+ readonly mutationMayHaveApplied = true;
396
226
  readonly responseBody: unknown;
397
227
  constructor(message: string, responseBody: unknown);
398
228
  }
399
- export declare class SupaCloudApiError extends Error {
400
- readonly status: number;
401
- readonly code: string | null;
402
- readonly responseBody: unknown;
403
- constructor(message: string, status: number, responseBody: unknown);
229
+ export interface SupaCloudTaskFetchOptions {
230
+ functionUrls: readonly string[];
231
+ fetch?: FetchTransport;
232
+ }
233
+ export declare function createSupaCloudTaskFetch(options: SupaCloudTaskFetchOptions): FetchTransport;
234
+ type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
235
+ type ResponseDecoder<T> = (value: unknown) => T;
236
+ export declare class SupaCloudTaskResponseError extends SupaCloudApiError {
237
+ readonly mutationMayHaveApplied: boolean;
238
+ constructor(operation: "get" | "cancel" | "retry");
404
239
  }
405
240
  export type SupaCloudTaskDecodeOperation = "get" | "list" | "wait" | "cancel" | "retry" | "subscribe";
406
241
  /**
407
- * A caller-supplied result decoder failed. Decoder errors are sanitized so
408
- * application result values and decoder implementation details are not leaked.
242
+ * A caller-supplied result decoder failed. The original decoder error and
243
+ * response value are intentionally not retained because either may contain
244
+ * secrets or unbounded application data.
409
245
  */
410
246
  export declare class SupaCloudTaskDecoderError extends SupaCloudApiError {
411
247
  readonly operation: SupaCloudTaskDecodeOperation;
@@ -413,39 +249,50 @@ export declare class SupaCloudTaskDecoderError extends SupaCloudApiError {
413
249
  readonly mutationMayHaveApplied: boolean;
414
250
  constructor(operation: SupaCloudTaskDecodeOperation);
415
251
  }
416
- /** Compatibility spelling for callers that use the shorter decode term. */
252
+ /** Compatibility spelling for callers that refer to decoding rather than decoding contracts. */
417
253
  export { SupaCloudTaskDecoderError as SupaCloudTaskDecodeError };
418
- type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
419
- type ResponseDecoder<T> = (value: unknown) => T;
254
+ export declare class SupaCloudTaskAuthenticationError extends SupaCloudApiError {
255
+ readonly mutationMayHaveApplied = false;
256
+ constructor(code?: "TASK_AUTH_INVALID" | "TASK_AUTH_TIMEOUT");
257
+ }
420
258
  declare class SupaCloudManagementClient<TClient extends SupabaseClient = SupabaseClient> {
421
259
  protected readonly options: Required<SupaCloudClientOptions<TClient>>;
422
260
  constructor(options: Required<SupaCloudClientOptions<TClient>>);
423
- protected resolveAccessToken(): Promise<string>;
424
- protected request<T>(path: string, method: HttpMethod, body: unknown, decode: ResponseDecoder<T>): Promise<T>;
261
+ protected resolveAccessToken(_signal?: AbortSignal): Promise<string>;
262
+ protected request<T>(path: string, method: HttpMethod, body: unknown, decode: ResponseDecoder<T>, transport?: FetchTransport, signal?: AbortSignal): Promise<T>;
425
263
  }
426
264
  declare class SupaCloudTasksClient<TClient extends SupabaseClient = SupabaseClient> extends SupaCloudManagementClient<TClient> {
265
+ protected resolveAccessToken(signal?: AbortSignal): Promise<string>;
266
+ protected request<T>(path: string, method: HttpMethod, body: unknown, decode: ResponseDecoder<T>, _transport?: FetchTransport, signal?: AbortSignal): Promise<T>;
427
267
  private createReceipt;
428
268
  private createTypedReceipt;
269
+ private submitInternal;
429
270
  submit(functionName: string, options?: SupaCloudTaskSubmitOptions): Promise<SupaCloudTaskReceipt<unknown>>;
430
271
  submitTyped<TResult>(functionName: string, decoder: SupaCloudTaskResultDecoder<TResult>, options?: SupaCloudTaskSubmitOptions): Promise<SupaCloudTaskReceipt<TResult>>;
431
272
  submitTyped<TResult>(functionName: string, options: SupaCloudTaskSubmitOptions, decoder: SupaCloudTaskResultDecoder<TResult>): Promise<SupaCloudTaskReceipt<TResult>>;
432
- get(taskId: string): Promise<SupaCloudTaskDetail>;
433
- getTyped<TResult>(taskId: string, decoder: SupaCloudTaskResultDecoder<TResult>): Promise<SupaCloudTaskDetail<TResult>>;
434
- list(filters?: SupaCloudTaskListFilters): Promise<SupaCloudTaskDetail[]>;
273
+ private getInternal;
274
+ get(taskId: string, signal?: AbortSignal): Promise<SupaCloudTaskDetail<unknown>>;
275
+ getTyped<TResult>(taskId: string, decoder: SupaCloudTaskResultDecoder<TResult>, signal?: AbortSignal): Promise<SupaCloudTaskDetail<TResult>>;
276
+ getTyped<TResult>(taskId: string, signal: AbortSignal | undefined, decoder: SupaCloudTaskResultDecoder<TResult>): Promise<SupaCloudTaskDetail<TResult>>;
277
+ list(filters?: SupaCloudTaskListFilters): Promise<SupaCloudTaskDetail<unknown>[]>;
435
278
  listTyped<TResult>(decoder: SupaCloudTaskResultDecoder<TResult>, filters?: SupaCloudTaskListFilters): Promise<SupaCloudTaskDetail<TResult>[]>;
436
279
  listTyped<TResult>(filters: SupaCloudTaskListFilters, decoder: SupaCloudTaskResultDecoder<TResult>): Promise<SupaCloudTaskDetail<TResult>[]>;
437
- cancel(taskId: string): Promise<SupaCloudTaskDetail>;
280
+ private cancelInternal;
281
+ cancel(taskId: string): Promise<SupaCloudTaskDetail<unknown>>;
438
282
  cancelTyped<TResult>(taskId: string, decoder: SupaCloudTaskResultDecoder<TResult>): Promise<SupaCloudTaskDetail<TResult>>;
439
- retry(taskId: string): Promise<SupaCloudTaskDetail>;
283
+ private retryInternal;
284
+ retry(taskId: string): Promise<SupaCloudTaskDetail<unknown>>;
440
285
  retryTyped<TResult>(taskId: string, decoder: SupaCloudTaskResultDecoder<TResult>): Promise<SupaCloudTaskDetail<TResult>>;
441
- listDlq(limit?: number): Promise<SupaCloudTaskDetail[]>;
286
+ listDlq(limit?: number): Promise<SupaCloudTaskDetail<unknown>[]>;
442
287
  listDlqTyped<TResult>(decoder: SupaCloudTaskResultDecoder<TResult>, limit?: number): Promise<SupaCloudTaskDetail<TResult>[]>;
443
- wait(taskId: string, options?: SupaCloudTaskWaitOptions): Promise<SupaCloudTaskDetail>;
288
+ private waitInternal;
289
+ wait(taskId: string, options?: SupaCloudTaskWaitOptions): Promise<SupaCloudTaskDetail<unknown>>;
444
290
  waitTyped<TResult>(taskId: string, decoder: SupaCloudTaskResultDecoder<TResult>, options?: SupaCloudTaskWaitOptions): Promise<SupaCloudTaskDetail<TResult>>;
445
291
  waitTyped<TResult>(taskId: string, options: SupaCloudTaskWaitOptions, decoder: SupaCloudTaskResultDecoder<TResult>): Promise<SupaCloudTaskDetail<TResult>>;
446
292
  subscribe(taskId: string, options: SupaCloudTaskSubscribeOptions): SupaCloudTaskSubscription;
447
293
  subscribeTyped<TResult>(taskId: string, decoder: SupaCloudTaskResultDecoder<TResult>, options: SupaCloudTaskSubscribeOptions<TResult>): SupaCloudTaskSubscription;
448
294
  subscribeTyped<TResult>(taskId: string, options: SupaCloudTaskSubscribeOptions<TResult>, decoder: SupaCloudTaskResultDecoder<TResult>): SupaCloudTaskSubscription;
295
+ private subscribeTypedInternal;
449
296
  private subscribeInternal;
450
297
  }
451
298
  declare class SupaCloudQueueClient<TClient extends SupabaseClient = SupabaseClient> extends SupaCloudManagementClient<TClient> {
@@ -453,8 +300,8 @@ declare class SupaCloudQueueClient<TClient extends SupabaseClient = SupabaseClie
453
300
  constructor(options: Required<SupaCloudClientOptions<TClient>>, name: string);
454
301
  private get encodedName();
455
302
  private rpc;
456
- send(payload?: Record<string, unknown>, options?: SupaCloudQueueSendOptions): Promise<SupaCloudQueueSendResult>;
457
- sendBatch(messages: Record<string, unknown>[], options?: SupaCloudQueueSendOptions): Promise<SupaCloudQueueSendResult[]>;
303
+ send(payload?: SupaCloudQueueJson, options?: SupaCloudQueueSendOptions): Promise<SupaCloudQueueSendResult>;
304
+ sendBatch(messages: SupaCloudQueueJson[], options?: SupaCloudQueueSendOptions): Promise<SupaCloudQueueSendResult[]>;
458
305
  read(options?: SupaCloudQueueReceiveOptions): Promise<SupaCloudQueueMessage[]>;
459
306
  receive(options?: SupaCloudQueueReceiveOptions): Promise<SupaCloudQueueMessage | null>;
460
307
  pop(): Promise<SupaCloudQueueMessage | null>;
@@ -491,64 +338,19 @@ declare class SupaCloudQueuesClient<TClient extends SupabaseClient = SupabaseCli
491
338
  create(queueName: string, options?: SupaCloudQueueCreateOptions): Promise<SupaCloudQueueInfo>;
492
339
  drop(queueName: string): Promise<void>;
493
340
  }
494
- declare class SupaCloudOAuthServerClient<TClient extends SupabaseClient = SupabaseClient> extends SupaCloudManagementClient<TClient> {
495
- getStatus(): Promise<SupaCloudOAuthServerStatus>;
496
- migrateToOidc(options?: {
497
- allowDynamicRegistration?: boolean;
498
- authorizationPath?: string;
499
- }): Promise<SupaCloudOAuthServerStatus>;
500
- getDiscovery(): Promise<Record<string, unknown>>;
501
- getJwks(): Promise<Record<string, unknown>>;
502
- buildAuthorizeUrl(options: SupaCloudAuthorizeUrlOptions): Promise<string>;
503
- }
504
- declare class SupaCloudOAuthClientsClient<TClient extends SupabaseClient = SupabaseClient> extends SupaCloudManagementClient<TClient> {
505
- list(): Promise<SupaCloudOAuthClientList>;
506
- create(input: SupaCloudOAuthClientCreate): Promise<SupaCloudOAuthClient>;
507
- get(clientId: string): Promise<SupaCloudOAuthClient>;
508
- update(clientId: string, patch: SupaCloudOAuthClientUpdate): Promise<SupaCloudOAuthClient>;
509
- delete(clientId: string): Promise<void>;
510
- regenerateSecret(clientId: string): Promise<SupaCloudOAuthClient>;
511
- }
512
- declare class SupaCloudSupAuthClient<TClient extends SupabaseClient = SupabaseClient> extends SupaCloudManagementClient<TClient> {
513
- private get basePath();
514
- provision(options?: SupaCloudSupAuthProvisionOptions): Promise<SupaCloudSupAuthProvisionResult>;
515
- reconcile(options?: SupaCloudSupAuthReconcileOptions): Promise<SupaCloudSupAuthReconcileResult>;
516
- rollback(): Promise<SupaCloudSupAuthRollbackResult>;
517
- getClientConfig(): Promise<SupaCloudSupAuthClientConfig>;
518
- verify(): Promise<SupaCloudSupAuthVerification>;
519
- }
520
- export declare class SupaCloudCapabilitiesClient<TClient extends SupabaseClient = SupabaseClient> extends SupaCloudManagementClient<TClient> {
521
- get(): Promise<SupaCloudProjectCapabilities>;
522
- isAvailable(capabilityKey: string): Promise<boolean>;
523
- getVersion(): Promise<string>;
524
- getEnvironment(): Promise<SupaCloudEnvironmentInfo>;
525
- }
526
- export declare class SupaCloudStorageClient<TClient extends SupabaseClient = SupabaseClient> extends SupaCloudManagementClient<TClient> {
527
- getPlatformConstraints(): Promise<SupaCloudStoragePlatformConstraints>;
528
- getUploadConstraints(bucketId: string): Promise<SupaCloudStorageUploadConstraints>;
529
- validateUpload(bucketId: string, file: {
530
- size: number;
531
- type?: string;
532
- }): Promise<SupaCloudUploadValidationResult>;
533
- }
534
341
  export declare function createSupaCloudClient<TClient extends SupabaseClient = SupabaseClient>(options: SupaCloudClientOptions<TClient>): {
535
342
  supabase: TClient;
536
343
  projectRef: string;
537
344
  managementApiUrl: string;
538
345
  auth: {
539
- oauthServer: SupaCloudOAuthServerClient<TClient>;
540
- oauthClients: SupaCloudOAuthClientsClient<TClient>;
346
+ oauthServer: SupaCloudOAuthServerClient;
347
+ oauthClients: SupaCloudOAuthClientsClient;
541
348
  };
542
349
  tasks: SupaCloudTasksClient<TClient>;
543
350
  workflows: SupaCloudWorkflowsClient<TClient>;
544
351
  commands: SupaCloudCommandsClient<TClient>;
545
352
  artifacts: SupaCloudArtifactsClient<TClient>;
546
- supauth: SupaCloudSupAuthClient<TClient>;
547
353
  queues: SupaCloudQueuesClient<TClient>;
548
- capabilities: SupaCloudCapabilitiesClient<TClient>;
549
- storage: SupaCloudStorageClient<TClient>;
550
- getEnvironment: () => Promise<SupaCloudEnvironmentInfo>;
551
- getVersion: () => Promise<string>;
552
354
  queue: (name: string) => SupaCloudQueueClient<TClient>;
553
355
  functions: {
554
356
  invokeBackground: (functionName: string, submitOptions?: SupaCloudTaskSubmitOptions) => Promise<SupaCloudTaskReceipt<unknown>>;