@supacloud/js 0.29.0 → 0.30.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.
- package/README.md +373 -104
- package/dist/api-error.d.ts +6 -0
- package/dist/artifact-fetch.d.ts +6 -0
- package/dist/artifact-link.d.ts +8 -0
- package/dist/artifact-read.d.ts +13 -0
- package/dist/artifact-register.d.ts +14 -0
- package/dist/artifact-rpc.d.ts +2 -0
- package/dist/artifacts.d.ts +3 -0
- package/dist/auth-fetch.d.ts +4 -2
- package/dist/bounded-rpc-fetch.d.ts +2 -0
- package/dist/command-fetch.d.ts +6 -0
- package/dist/commands.d.ts +10 -0
- package/dist/index.d.ts +65 -278
- package/dist/index.js +3000 -668
- package/dist/oauth-clients.d.ts +95 -0
- package/dist/oauth-server.d.ts +104 -0
- package/dist/queue-rpc.d.ts +54 -0
- package/dist/workflow-advance.d.ts +8 -0
- package/dist/workflow-attempt.d.ts +4 -0
- package/dist/workflow-cancel.d.ts +14 -0
- package/dist/workflow-claim.d.ts +12 -0
- package/dist/workflow-complete.d.ts +8 -0
- package/dist/workflow-events.d.ts +14 -0
- package/dist/workflow-fail.d.ts +8 -0
- package/dist/workflow-fetch.d.ts +9 -0
- package/dist/workflow-json.d.ts +2 -0
- package/dist/workflow-retry.d.ts +8 -0
- package/dist/workflow-rpc.d.ts +6 -0
- package/dist/workflow-run.d.ts +8 -0
- package/dist/workflow-start.d.ts +8 -0
- package/dist/workflow-timestamp.d.ts +1 -0
- package/dist/workflows.d.ts +9 -0
- package/package.json +2 -2
package/dist/auth-fetch.d.ts
CHANGED
|
@@ -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?:
|
|
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):
|
|
26
|
+
export declare function createSupaCloudOAuthFetch(options?: SupaCloudOAuthFetchOptions): FetchTransport;
|
|
27
|
+
export {};
|
|
@@ -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;
|
package/dist/commands.d.ts
CHANGED
|
@@ -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,6 +40,7 @@ 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;
|
|
78
45
|
function_slug?: string | null;
|
|
79
46
|
function_version?: string | null;
|
|
@@ -111,7 +78,9 @@ export type SupaCloudTaskListFilters = {
|
|
|
111
78
|
export type SupaCloudTaskSubmitOptions = {
|
|
112
79
|
body?: string | Blob | ArrayBuffer | FormData | File | ReadableStream<Uint8Array> | Record<string, unknown>;
|
|
113
80
|
headers?: Record<string, string>;
|
|
81
|
+
/** @deprecated Configure retry policy on the platform; this compatibility field is ignored. */
|
|
114
82
|
retries?: number;
|
|
83
|
+
/** @deprecated Configure execution timeout on the platform; this compatibility field is ignored. */
|
|
115
84
|
timeoutSec?: number;
|
|
116
85
|
idempotencyKey?: string;
|
|
117
86
|
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
@@ -170,33 +139,6 @@ export type SupaCloudQueueListFilters = {
|
|
|
170
139
|
dlq?: boolean;
|
|
171
140
|
limit?: number;
|
|
172
141
|
};
|
|
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
142
|
export type SupaCloudQueueStats = {
|
|
201
143
|
queue_name: string;
|
|
202
144
|
queue_length: number;
|
|
@@ -223,82 +165,20 @@ export type SupaCloudQueueSettings = {
|
|
|
223
165
|
rate_limit_per_minute: number;
|
|
224
166
|
};
|
|
225
167
|
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
168
|
export type SupaCloudTaskWaitOptions = {
|
|
297
169
|
intervalMs?: number;
|
|
298
170
|
signal?: AbortSignal;
|
|
299
171
|
};
|
|
300
172
|
export type SupaCloudTaskSubscribeState = "connecting" | "realtime" | "polling" | "closed";
|
|
173
|
+
export type SupaCloudTaskSubscription = {
|
|
174
|
+
readonly connectionState: SupaCloudTaskSubscribeState;
|
|
175
|
+
unsubscribe: () => void;
|
|
176
|
+
};
|
|
301
177
|
export type SupaCloudTaskSubscribeOptions<TResult = unknown> = {
|
|
178
|
+
realtime?: {
|
|
179
|
+
schema: string;
|
|
180
|
+
table: string;
|
|
181
|
+
};
|
|
302
182
|
pollingIntervalMs?: number;
|
|
303
183
|
realtimeTimeoutMs?: number;
|
|
304
184
|
reconcileIntervalMs?: number;
|
|
@@ -309,10 +189,6 @@ export type SupaCloudTaskSubscribeOptions<TResult = unknown> = {
|
|
|
309
189
|
onError?: (error: unknown) => void;
|
|
310
190
|
stopOnTerminal?: boolean;
|
|
311
191
|
};
|
|
312
|
-
export type SupaCloudTaskSubscription = {
|
|
313
|
-
readonly connectionState: SupaCloudTaskSubscribeState;
|
|
314
|
-
unsubscribe: () => void;
|
|
315
|
-
};
|
|
316
192
|
export type SupaCloudTaskReceipt<TResult = unknown> = {
|
|
317
193
|
taskId: string;
|
|
318
194
|
status: string;
|
|
@@ -329,83 +205,28 @@ export type SupaCloudClientOptions<TClient extends SupabaseClient = SupabaseClie
|
|
|
329
205
|
getAccessToken?: () => Promise<string | null> | string | null;
|
|
330
206
|
pollingIntervalMs?: number;
|
|
331
207
|
};
|
|
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
208
|
export declare class SupaCloudTaskSubmitError extends Error {
|
|
209
|
+
readonly code = "TASK_SUBMIT_UNCONFIRMED";
|
|
210
|
+
readonly mutationMayHaveApplied = true;
|
|
396
211
|
readonly responseBody: unknown;
|
|
397
212
|
constructor(message: string, responseBody: unknown);
|
|
398
213
|
}
|
|
399
|
-
export
|
|
400
|
-
readonly
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
214
|
+
export interface SupaCloudTaskFetchOptions {
|
|
215
|
+
functionUrls: readonly string[];
|
|
216
|
+
fetch?: FetchTransport;
|
|
217
|
+
}
|
|
218
|
+
export declare function createSupaCloudTaskFetch(options: SupaCloudTaskFetchOptions): FetchTransport;
|
|
219
|
+
type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
220
|
+
type ResponseDecoder<T> = (value: unknown) => T;
|
|
221
|
+
export declare class SupaCloudTaskResponseError extends SupaCloudApiError {
|
|
222
|
+
readonly mutationMayHaveApplied: boolean;
|
|
223
|
+
constructor(operation: "get" | "cancel" | "retry");
|
|
404
224
|
}
|
|
405
225
|
export type SupaCloudTaskDecodeOperation = "get" | "list" | "wait" | "cancel" | "retry" | "subscribe";
|
|
406
226
|
/**
|
|
407
|
-
* A caller-supplied result decoder failed.
|
|
408
|
-
*
|
|
227
|
+
* A caller-supplied result decoder failed. The original decoder error and
|
|
228
|
+
* response value are intentionally not retained because either may contain
|
|
229
|
+
* secrets or unbounded application data.
|
|
409
230
|
*/
|
|
410
231
|
export declare class SupaCloudTaskDecoderError extends SupaCloudApiError {
|
|
411
232
|
readonly operation: SupaCloudTaskDecodeOperation;
|
|
@@ -413,39 +234,50 @@ export declare class SupaCloudTaskDecoderError extends SupaCloudApiError {
|
|
|
413
234
|
readonly mutationMayHaveApplied: boolean;
|
|
414
235
|
constructor(operation: SupaCloudTaskDecodeOperation);
|
|
415
236
|
}
|
|
416
|
-
/** Compatibility spelling for callers that
|
|
237
|
+
/** Compatibility spelling for callers that refer to decoding rather than decoding contracts. */
|
|
417
238
|
export { SupaCloudTaskDecoderError as SupaCloudTaskDecodeError };
|
|
418
|
-
|
|
419
|
-
|
|
239
|
+
export declare class SupaCloudTaskAuthenticationError extends SupaCloudApiError {
|
|
240
|
+
readonly mutationMayHaveApplied = false;
|
|
241
|
+
constructor(code?: "TASK_AUTH_INVALID" | "TASK_AUTH_TIMEOUT");
|
|
242
|
+
}
|
|
420
243
|
declare class SupaCloudManagementClient<TClient extends SupabaseClient = SupabaseClient> {
|
|
421
244
|
protected readonly options: Required<SupaCloudClientOptions<TClient>>;
|
|
422
245
|
constructor(options: Required<SupaCloudClientOptions<TClient>>);
|
|
423
|
-
protected resolveAccessToken(): Promise<string>;
|
|
424
|
-
protected request<T>(path: string, method: HttpMethod, body: unknown, decode: ResponseDecoder<T
|
|
246
|
+
protected resolveAccessToken(_signal?: AbortSignal): Promise<string>;
|
|
247
|
+
protected request<T>(path: string, method: HttpMethod, body: unknown, decode: ResponseDecoder<T>, transport?: FetchTransport, signal?: AbortSignal): Promise<T>;
|
|
425
248
|
}
|
|
426
249
|
declare class SupaCloudTasksClient<TClient extends SupabaseClient = SupabaseClient> extends SupaCloudManagementClient<TClient> {
|
|
250
|
+
protected resolveAccessToken(signal?: AbortSignal): Promise<string>;
|
|
251
|
+
protected request<T>(path: string, method: HttpMethod, body: unknown, decode: ResponseDecoder<T>, _transport?: FetchTransport, signal?: AbortSignal): Promise<T>;
|
|
427
252
|
private createReceipt;
|
|
428
253
|
private createTypedReceipt;
|
|
254
|
+
private submitInternal;
|
|
429
255
|
submit(functionName: string, options?: SupaCloudTaskSubmitOptions): Promise<SupaCloudTaskReceipt<unknown>>;
|
|
430
256
|
submitTyped<TResult>(functionName: string, decoder: SupaCloudTaskResultDecoder<TResult>, options?: SupaCloudTaskSubmitOptions): Promise<SupaCloudTaskReceipt<TResult>>;
|
|
431
257
|
submitTyped<TResult>(functionName: string, options: SupaCloudTaskSubmitOptions, decoder: SupaCloudTaskResultDecoder<TResult>): Promise<SupaCloudTaskReceipt<TResult>>;
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
258
|
+
private getInternal;
|
|
259
|
+
get(taskId: string, signal?: AbortSignal): Promise<SupaCloudTaskDetail<unknown>>;
|
|
260
|
+
getTyped<TResult>(taskId: string, decoder: SupaCloudTaskResultDecoder<TResult>, signal?: AbortSignal): Promise<SupaCloudTaskDetail<TResult>>;
|
|
261
|
+
getTyped<TResult>(taskId: string, signal: AbortSignal | undefined, decoder: SupaCloudTaskResultDecoder<TResult>): Promise<SupaCloudTaskDetail<TResult>>;
|
|
262
|
+
list(filters?: SupaCloudTaskListFilters): Promise<SupaCloudTaskDetail<unknown>[]>;
|
|
435
263
|
listTyped<TResult>(decoder: SupaCloudTaskResultDecoder<TResult>, filters?: SupaCloudTaskListFilters): Promise<SupaCloudTaskDetail<TResult>[]>;
|
|
436
264
|
listTyped<TResult>(filters: SupaCloudTaskListFilters, decoder: SupaCloudTaskResultDecoder<TResult>): Promise<SupaCloudTaskDetail<TResult>[]>;
|
|
437
|
-
|
|
265
|
+
private cancelInternal;
|
|
266
|
+
cancel(taskId: string): Promise<SupaCloudTaskDetail<unknown>>;
|
|
438
267
|
cancelTyped<TResult>(taskId: string, decoder: SupaCloudTaskResultDecoder<TResult>): Promise<SupaCloudTaskDetail<TResult>>;
|
|
439
|
-
|
|
268
|
+
private retryInternal;
|
|
269
|
+
retry(taskId: string): Promise<SupaCloudTaskDetail<unknown>>;
|
|
440
270
|
retryTyped<TResult>(taskId: string, decoder: SupaCloudTaskResultDecoder<TResult>): Promise<SupaCloudTaskDetail<TResult>>;
|
|
441
|
-
listDlq(limit?: number): Promise<SupaCloudTaskDetail[]>;
|
|
271
|
+
listDlq(limit?: number): Promise<SupaCloudTaskDetail<unknown>[]>;
|
|
442
272
|
listDlqTyped<TResult>(decoder: SupaCloudTaskResultDecoder<TResult>, limit?: number): Promise<SupaCloudTaskDetail<TResult>[]>;
|
|
443
|
-
|
|
273
|
+
private waitInternal;
|
|
274
|
+
wait(taskId: string, options?: SupaCloudTaskWaitOptions): Promise<SupaCloudTaskDetail<unknown>>;
|
|
444
275
|
waitTyped<TResult>(taskId: string, decoder: SupaCloudTaskResultDecoder<TResult>, options?: SupaCloudTaskWaitOptions): Promise<SupaCloudTaskDetail<TResult>>;
|
|
445
276
|
waitTyped<TResult>(taskId: string, options: SupaCloudTaskWaitOptions, decoder: SupaCloudTaskResultDecoder<TResult>): Promise<SupaCloudTaskDetail<TResult>>;
|
|
446
277
|
subscribe(taskId: string, options: SupaCloudTaskSubscribeOptions): SupaCloudTaskSubscription;
|
|
447
278
|
subscribeTyped<TResult>(taskId: string, decoder: SupaCloudTaskResultDecoder<TResult>, options: SupaCloudTaskSubscribeOptions<TResult>): SupaCloudTaskSubscription;
|
|
448
279
|
subscribeTyped<TResult>(taskId: string, options: SupaCloudTaskSubscribeOptions<TResult>, decoder: SupaCloudTaskResultDecoder<TResult>): SupaCloudTaskSubscription;
|
|
280
|
+
private subscribeTypedInternal;
|
|
449
281
|
private subscribeInternal;
|
|
450
282
|
}
|
|
451
283
|
declare class SupaCloudQueueClient<TClient extends SupabaseClient = SupabaseClient> extends SupaCloudManagementClient<TClient> {
|
|
@@ -453,8 +285,8 @@ declare class SupaCloudQueueClient<TClient extends SupabaseClient = SupabaseClie
|
|
|
453
285
|
constructor(options: Required<SupaCloudClientOptions<TClient>>, name: string);
|
|
454
286
|
private get encodedName();
|
|
455
287
|
private rpc;
|
|
456
|
-
send(payload?:
|
|
457
|
-
sendBatch(messages:
|
|
288
|
+
send(payload?: SupaCloudQueueJson, options?: SupaCloudQueueSendOptions): Promise<SupaCloudQueueSendResult>;
|
|
289
|
+
sendBatch(messages: SupaCloudQueueJson[], options?: SupaCloudQueueSendOptions): Promise<SupaCloudQueueSendResult[]>;
|
|
458
290
|
read(options?: SupaCloudQueueReceiveOptions): Promise<SupaCloudQueueMessage[]>;
|
|
459
291
|
receive(options?: SupaCloudQueueReceiveOptions): Promise<SupaCloudQueueMessage | null>;
|
|
460
292
|
pop(): Promise<SupaCloudQueueMessage | null>;
|
|
@@ -491,64 +323,19 @@ declare class SupaCloudQueuesClient<TClient extends SupabaseClient = SupabaseCli
|
|
|
491
323
|
create(queueName: string, options?: SupaCloudQueueCreateOptions): Promise<SupaCloudQueueInfo>;
|
|
492
324
|
drop(queueName: string): Promise<void>;
|
|
493
325
|
}
|
|
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
326
|
export declare function createSupaCloudClient<TClient extends SupabaseClient = SupabaseClient>(options: SupaCloudClientOptions<TClient>): {
|
|
535
327
|
supabase: TClient;
|
|
536
328
|
projectRef: string;
|
|
537
329
|
managementApiUrl: string;
|
|
538
330
|
auth: {
|
|
539
|
-
oauthServer: SupaCloudOAuthServerClient
|
|
540
|
-
oauthClients: SupaCloudOAuthClientsClient
|
|
331
|
+
oauthServer: SupaCloudOAuthServerClient;
|
|
332
|
+
oauthClients: SupaCloudOAuthClientsClient;
|
|
541
333
|
};
|
|
542
334
|
tasks: SupaCloudTasksClient<TClient>;
|
|
543
335
|
workflows: SupaCloudWorkflowsClient<TClient>;
|
|
544
336
|
commands: SupaCloudCommandsClient<TClient>;
|
|
545
337
|
artifacts: SupaCloudArtifactsClient<TClient>;
|
|
546
|
-
supauth: SupaCloudSupAuthClient<TClient>;
|
|
547
338
|
queues: SupaCloudQueuesClient<TClient>;
|
|
548
|
-
capabilities: SupaCloudCapabilitiesClient<TClient>;
|
|
549
|
-
storage: SupaCloudStorageClient<TClient>;
|
|
550
|
-
getEnvironment: () => Promise<SupaCloudEnvironmentInfo>;
|
|
551
|
-
getVersion: () => Promise<string>;
|
|
552
339
|
queue: (name: string) => SupaCloudQueueClient<TClient>;
|
|
553
340
|
functions: {
|
|
554
341
|
invokeBackground: (functionName: string, submitOptions?: SupaCloudTaskSubmitOptions) => Promise<SupaCloudTaskReceipt<unknown>>;
|