@backwrite/sdk 0.1.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/package.json +23 -0
- package/src/client.ts +309 -0
- package/src/index.ts +54 -0
- package/src/operations.ts +1008 -0
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@backwrite/sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Backwrite Platform API SDK — typed operations generated from the published OpenAPI 3.1 contract",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./src/index.ts",
|
|
7
|
+
"types": "./src/index.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./src/index.ts",
|
|
10
|
+
"./operations": "./src/operations.ts",
|
|
11
|
+
"./client": "./src/client.ts"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"src"
|
|
15
|
+
],
|
|
16
|
+
"keywords": [
|
|
17
|
+
"backwrite",
|
|
18
|
+
"platform-api",
|
|
19
|
+
"openapi"
|
|
20
|
+
],
|
|
21
|
+
"author": "Backwrite <backwrite@backwrite.dev>",
|
|
22
|
+
"license": "Apache-2.0"
|
|
23
|
+
}
|
package/src/client.ts
ADDED
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
//! The hand-written SDK runtime for TypeScript: transport, envelope
|
|
2
|
+
//! unwrapping, and error typing.
|
|
3
|
+
//!
|
|
4
|
+
//! The generated operation layer (`operations.ts`) holds one function per
|
|
5
|
+
//! OpenAPI `operationId`. Everything the contract cannot express — base URL
|
|
6
|
+
//! resolution, credential selection, envelope handling, error classes,
|
|
7
|
+
//! idempotency keys, retry-after observance — lives here and stays identical
|
|
8
|
+
//! for every generated call.
|
|
9
|
+
//!
|
|
10
|
+
//! Envelope transparency (platform API §5/§7): every response body is
|
|
11
|
+
//! `{ "data": ..., "request_id": "..." }` on success and
|
|
12
|
+
//! `{ "error": { "code", "message", "details?", "retry_after?" }, "request_id" }`
|
|
13
|
+
//! on failure. `request()` unwraps `data` by default so callers operate on
|
|
14
|
+
//! the payload itself; `raw: true` returns the full envelope (and the
|
|
15
|
+
//! `request_id` needed to correlate with server logs).
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* A structured API failure. Every non-2xx response is raised as this class,
|
|
19
|
+
* so `instanceof BackwriteApiError` is the single catch boundary and the
|
|
20
|
+
* platform error code (e.g. `BRANCH_NOT_READY`) is always machine-readable.
|
|
21
|
+
*/
|
|
22
|
+
export class BackwriteApiError extends Error {
|
|
23
|
+
/** HTTP status of the failed response. */
|
|
24
|
+
readonly status: number;
|
|
25
|
+
/** Platform error code from the envelope (`RATE_LIMITED`, `NOT_FOUND`, …). */
|
|
26
|
+
readonly code: string;
|
|
27
|
+
/** Structured details object when the server supplied one. */
|
|
28
|
+
readonly details?: unknown;
|
|
29
|
+
/** Seconds to wait before retrying, when the server sent `retry_after`. */
|
|
30
|
+
readonly retryAfter?: number;
|
|
31
|
+
/** Correlation id echoed by the server for this request. */
|
|
32
|
+
readonly requestId?: string;
|
|
33
|
+
|
|
34
|
+
constructor(
|
|
35
|
+
status: number,
|
|
36
|
+
code: string,
|
|
37
|
+
message: string,
|
|
38
|
+
options: { details?: unknown; retryAfter?: number; requestId?: string } = {},
|
|
39
|
+
) {
|
|
40
|
+
super(`${code} (${status}): ${message}`);
|
|
41
|
+
this.name = "BackwriteApiError";
|
|
42
|
+
this.status = status;
|
|
43
|
+
this.code = code;
|
|
44
|
+
this.details = options.details;
|
|
45
|
+
this.retryAfter = options.retryAfter;
|
|
46
|
+
this.requestId = options.requestId;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Query values must survive URL serialization unchanged. */
|
|
51
|
+
export type QueryValue = string | number | boolean;
|
|
52
|
+
|
|
53
|
+
/** Options every generated operation accepts beyond its path parameters. */
|
|
54
|
+
export interface RequestOptions {
|
|
55
|
+
/**
|
|
56
|
+
* JSON-serializable request body. Non-JSON payloads (binary uploads such
|
|
57
|
+
* as multipart storage parts) pass bytes and are sent with an
|
|
58
|
+
* octet-stream content type.
|
|
59
|
+
*/
|
|
60
|
+
body?: unknown;
|
|
61
|
+
/** Enables A6 replay semantics on mutating endpoints. */
|
|
62
|
+
idempotencyKey?: string;
|
|
63
|
+
/** Return the full envelope (with `request_id`) instead of `data`. */
|
|
64
|
+
raw?: boolean;
|
|
65
|
+
/** Abort signal forwarded to the underlying fetch. */
|
|
66
|
+
signal?: AbortSignal;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface BackwriteClientOptions {
|
|
70
|
+
/** Base URL of the gateway, e.g. `https://api.example.backwrite.dev`. */
|
|
71
|
+
baseUrl: string;
|
|
72
|
+
/** API key (`bwk_…`); anonymous calls may omit it. */
|
|
73
|
+
apiKey?: string;
|
|
74
|
+
/** Custom fetch (testing, proxies). Defaults to globalThis.fetch. */
|
|
75
|
+
fetch?: typeof fetch;
|
|
76
|
+
/** Request timeout in milliseconds. */
|
|
77
|
+
timeoutMs?: number;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
type Envelope = {
|
|
81
|
+
data?: unknown;
|
|
82
|
+
request_id?: string;
|
|
83
|
+
error?: {
|
|
84
|
+
code: string;
|
|
85
|
+
message?: string;
|
|
86
|
+
details?: unknown;
|
|
87
|
+
retry_after?: number;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
function isBinaryBody(body: unknown): body is ArrayBuffer | Uint8Array {
|
|
92
|
+
return body instanceof ArrayBuffer || body instanceof Uint8Array;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function buildUrl(baseUrl: string, path: string, query: Record<string, QueryValue>): URL {
|
|
96
|
+
const url = new URL(path, baseUrl);
|
|
97
|
+
for (const [key, value] of Object.entries(query)) {
|
|
98
|
+
url.searchParams.set(key, String(value));
|
|
99
|
+
}
|
|
100
|
+
return url;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The platform client. One instance per credential; the generated operation
|
|
105
|
+
* functions are pure adapters over `request()`.
|
|
106
|
+
*/
|
|
107
|
+
export class BackwriteClient {
|
|
108
|
+
private readonly baseUrl: string;
|
|
109
|
+
private readonly apiKey?: string;
|
|
110
|
+
private readonly doFetch: typeof fetch;
|
|
111
|
+
private readonly timeoutMs?: number;
|
|
112
|
+
/** Correlation id of the most recent completed request, if the server echoed one. */
|
|
113
|
+
lastRequestId?: string;
|
|
114
|
+
|
|
115
|
+
constructor(options: BackwriteClientOptions) {
|
|
116
|
+
if (!options.baseUrl) throw new Error("BackwriteClient: baseUrl is required");
|
|
117
|
+
this.baseUrl = options.baseUrl.replace(/\/+$/, "");
|
|
118
|
+
this.apiKey = options.apiKey;
|
|
119
|
+
this.doFetch = options.fetch ?? globalThis.fetch.bind(globalThis);
|
|
120
|
+
this.timeoutMs = options.timeoutMs;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Execute one platform call and transparently unwrap the envelope.
|
|
125
|
+
*
|
|
126
|
+
* Success → the `data` payload (or the full envelope with `raw`).
|
|
127
|
+
* Failure → BackwriteApiError carrying the platform error code.
|
|
128
|
+
*/
|
|
129
|
+
async request<T = unknown>(
|
|
130
|
+
method: "GET" | "PUT" | "POST" | "DELETE" | "PATCH",
|
|
131
|
+
path: string,
|
|
132
|
+
options: RequestOptions & { query?: Record<string, QueryValue> } = {},
|
|
133
|
+
): Promise<T> {
|
|
134
|
+
const url = buildUrl(this.baseUrl, path, options.query ?? {});
|
|
135
|
+
|
|
136
|
+
const headers: Record<string, string> = {};
|
|
137
|
+
if (this.apiKey) headers["authorization"] = `Bearer ${this.apiKey}`;
|
|
138
|
+
if (options.idempotencyKey) headers["idempotency-key"] = options.idempotencyKey;
|
|
139
|
+
|
|
140
|
+
let payload: BodyInit | undefined;
|
|
141
|
+
if (options.body !== undefined) {
|
|
142
|
+
if (isBinaryBody(options.body)) {
|
|
143
|
+
headers["content-type"] = "application/octet-stream";
|
|
144
|
+
payload = options.body;
|
|
145
|
+
} else if (typeof options.body === "string") {
|
|
146
|
+
headers["content-type"] = "application/json";
|
|
147
|
+
payload = options.body;
|
|
148
|
+
} else {
|
|
149
|
+
headers["content-type"] = "application/json";
|
|
150
|
+
payload = JSON.stringify(options.body);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const controller = this.timeoutMs !== undefined ? new AbortController() : undefined;
|
|
155
|
+
const timer =
|
|
156
|
+
controller && this.timeoutMs !== undefined
|
|
157
|
+
? setTimeout(() => controller.abort(), this.timeoutMs)
|
|
158
|
+
: undefined;
|
|
159
|
+
if (controller && options.signal) {
|
|
160
|
+
options.signal.addEventListener("abort", () => controller.abort(), { once: true });
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
try {
|
|
164
|
+
const response = await this.doFetch(url, {
|
|
165
|
+
method,
|
|
166
|
+
headers,
|
|
167
|
+
body: payload,
|
|
168
|
+
signal: controller?.signal ?? options.signal,
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
const text = await response.text();
|
|
172
|
+
const requestId =
|
|
173
|
+
response.headers.get("x-request-id") ??
|
|
174
|
+
(text ? ((safeParse(text) as Envelope | null)?.request_id ?? undefined) : undefined);
|
|
175
|
+
if (requestId) this.lastRequestId = requestId;
|
|
176
|
+
|
|
177
|
+
const parsed: Envelope | null = text ? safeParse(text) : null;
|
|
178
|
+
|
|
179
|
+
if (!response.ok) {
|
|
180
|
+
const err = parsed?.error;
|
|
181
|
+
throw new BackwriteApiError(
|
|
182
|
+
response.status,
|
|
183
|
+
err?.code ?? `HTTP_${response.status}`,
|
|
184
|
+
err?.message ?? (response.statusText || "request failed"),
|
|
185
|
+
{
|
|
186
|
+
details: err?.details,
|
|
187
|
+
retryAfter: err?.retry_after,
|
|
188
|
+
requestId,
|
|
189
|
+
},
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if (options.raw) {
|
|
194
|
+
// The correlation id always reaches the caller in raw mode: from the
|
|
195
|
+
// body when stamped, else from the x-request-id header (parity with
|
|
196
|
+
// the Python runtime).
|
|
197
|
+
const envelope = (parsed ?? {}) as Record<string, unknown> & T;
|
|
198
|
+
if (
|
|
199
|
+
envelope &&
|
|
200
|
+
typeof envelope === "object" &&
|
|
201
|
+
(envelope as Record<string, unknown>).request_id === undefined &&
|
|
202
|
+
requestId !== undefined
|
|
203
|
+
) {
|
|
204
|
+
return { ...envelope, request_id: requestId } as T;
|
|
205
|
+
}
|
|
206
|
+
return envelope as T;
|
|
207
|
+
}
|
|
208
|
+
// Non-JSON 2xx (e.g. metrics text) surfaces as-is through data-less envelopes.
|
|
209
|
+
if (parsed === null) return text as unknown as T;
|
|
210
|
+
return parsed.data as T;
|
|
211
|
+
} finally {
|
|
212
|
+
if (timer !== undefined) clearTimeout(timer);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/** Execute arbitrary SQL query or migration on default or target branch. */
|
|
217
|
+
async query(
|
|
218
|
+
projectId: string,
|
|
219
|
+
sql: string,
|
|
220
|
+
options: { branchId?: string; view?: string } = {},
|
|
221
|
+
): Promise<{
|
|
222
|
+
success: boolean;
|
|
223
|
+
columns: string[];
|
|
224
|
+
rows: (string | null)[][];
|
|
225
|
+
summary: string;
|
|
226
|
+
execution_time_ms: number;
|
|
227
|
+
error?: string;
|
|
228
|
+
}> {
|
|
229
|
+
const path = options.branchId
|
|
230
|
+
? `/v1/projects/${encodeURIComponent(projectId)}/branches/${encodeURIComponent(options.branchId)}/query`
|
|
231
|
+
: `/v1/projects/${encodeURIComponent(projectId)}/query`;
|
|
232
|
+
return (await this.request("POST", path, {
|
|
233
|
+
body: { sql, view: options.view ?? "raw" },
|
|
234
|
+
})) as {
|
|
235
|
+
success: boolean;
|
|
236
|
+
columns: string[];
|
|
237
|
+
rows: (string | null)[][];
|
|
238
|
+
summary: string;
|
|
239
|
+
execution_time_ms: number;
|
|
240
|
+
error?: string;
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/** Introspect entire relational database schema in a single call. */
|
|
245
|
+
async getSchema(
|
|
246
|
+
projectId: string,
|
|
247
|
+
options: { branchId?: string } = {},
|
|
248
|
+
): Promise<{
|
|
249
|
+
branch_id: string;
|
|
250
|
+
database: string;
|
|
251
|
+
tables: Array<{
|
|
252
|
+
schema: string;
|
|
253
|
+
name: string;
|
|
254
|
+
type: string;
|
|
255
|
+
columns: Array<{
|
|
256
|
+
name: string;
|
|
257
|
+
data_type: string;
|
|
258
|
+
udt_name: string;
|
|
259
|
+
nullable: boolean;
|
|
260
|
+
default: string | null;
|
|
261
|
+
position: number;
|
|
262
|
+
is_pk: boolean;
|
|
263
|
+
is_unique: boolean;
|
|
264
|
+
}>;
|
|
265
|
+
primary_key: string[];
|
|
266
|
+
foreign_keys: Array<{
|
|
267
|
+
constraint_name: string;
|
|
268
|
+
column: string;
|
|
269
|
+
foreign_schema: string;
|
|
270
|
+
foreign_table: string;
|
|
271
|
+
foreign_column: string;
|
|
272
|
+
on_delete: string | null;
|
|
273
|
+
on_update: string | null;
|
|
274
|
+
}>;
|
|
275
|
+
indexes: Array<{
|
|
276
|
+
name: string;
|
|
277
|
+
definition: string;
|
|
278
|
+
is_primary: boolean;
|
|
279
|
+
is_unique: boolean;
|
|
280
|
+
}>;
|
|
281
|
+
policies: Array<{
|
|
282
|
+
name: string;
|
|
283
|
+
permissive: string;
|
|
284
|
+
roles: string[];
|
|
285
|
+
cmd: string;
|
|
286
|
+
qual: string;
|
|
287
|
+
with_check: string;
|
|
288
|
+
}>;
|
|
289
|
+
}>;
|
|
290
|
+
enums: Array<{
|
|
291
|
+
schema: string;
|
|
292
|
+
name: string;
|
|
293
|
+
values: string[];
|
|
294
|
+
}>;
|
|
295
|
+
}> {
|
|
296
|
+
const path = options.branchId
|
|
297
|
+
? `/v1/projects/${encodeURIComponent(projectId)}/branches/${encodeURIComponent(options.branchId)}/schema`
|
|
298
|
+
: `/v1/projects/${encodeURIComponent(projectId)}/schema`;
|
|
299
|
+
return (await this.request("GET", path)) as any;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
function safeParse(text: string): Envelope | null {
|
|
304
|
+
try {
|
|
305
|
+
return JSON.parse(text) as Envelope;
|
|
306
|
+
} catch {
|
|
307
|
+
return null;
|
|
308
|
+
}
|
|
309
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
//! Backwrite TypeScript SDK entrypoint.
|
|
2
|
+
//!
|
|
3
|
+
//! `BackwriteClient` is the hand-written runtime (transport, envelope
|
|
4
|
+
//! unwrapping, typed errors). The generated layer in `operations` adds one
|
|
5
|
+
//! typed function per OpenAPI operation; `bindOperations` attaches them to
|
|
6
|
+
//! the client prototype so `client.listBranches(...)` style calls work
|
|
7
|
+
//! directly while the standalone functions remain available.
|
|
8
|
+
|
|
9
|
+
import { BackwriteClient, BackwriteApiError, RequestOptions } from "./client.js";
|
|
10
|
+
import * as operations from "./operations.js";
|
|
11
|
+
import { OPERATION_META } from "./operations.js";
|
|
12
|
+
|
|
13
|
+
export { BackwriteClient, BackwriteApiError };
|
|
14
|
+
export type { RequestOptions };
|
|
15
|
+
export { operations, OPERATION_META };
|
|
16
|
+
|
|
17
|
+
type RequestLike = (
|
|
18
|
+
method: "GET" | "PUT" | "POST" | "DELETE" | "PATCH",
|
|
19
|
+
path: string,
|
|
20
|
+
options?: RequestOptions & { query?: Record<string, string | number | boolean> },
|
|
21
|
+
) => Promise<unknown>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Attach every generated operation as a prototype method named in camelCase
|
|
25
|
+
* (e.g. `getBranchCredentials`, `putStorageObject`). The generated module's
|
|
26
|
+
* function signature already takes the client as its first argument, so the
|
|
27
|
+
* binding is a pure partial application — no logic duplication.
|
|
28
|
+
*/
|
|
29
|
+
export function bindOperations(client: BackwriteClient): BackwriteClient {
|
|
30
|
+
const target = client as unknown as Record<string, unknown>;
|
|
31
|
+
for (const [name, fn] of Object.entries(operations)) {
|
|
32
|
+
if (typeof fn !== "function") continue;
|
|
33
|
+
target[name] = (fn as (c: BackwriteClient, ...rest: unknown[]) => unknown).bind(null, client);
|
|
34
|
+
}
|
|
35
|
+
return client;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Convenience constructor: returns a client with operations pre-bound.
|
|
40
|
+
*
|
|
41
|
+
* ```ts
|
|
42
|
+
* const bw = createBackwriteClient(process.env.BACKWRITE_URL!, process.env.BACKWRITE_SERVICE_KEY!);
|
|
43
|
+
* const branch = await bw.getBranchCredentials("br_…");
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export function createBackwriteClient(
|
|
47
|
+
baseUrl: string,
|
|
48
|
+
apiKey?: string,
|
|
49
|
+
options: Partial<ConstructorParameters<typeof BackwriteClient>[0]> = {},
|
|
50
|
+
): BackwriteClient {
|
|
51
|
+
return bindOperations(new BackwriteClient({ baseUrl, apiKey, ...options }));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export type { RequestLike };
|
|
@@ -0,0 +1,1008 @@
|
|
|
1
|
+
// GENERATED FILE — do not edit by hand.
|
|
2
|
+
// Source: Backwrite Platform API OpenAPI 1.0.0. Regenerate with scripts/generate_sdks.py.
|
|
3
|
+
|
|
4
|
+
import type { BackwriteClient } from "./client.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Liveness
|
|
8
|
+
* Credential class: platform.
|
|
9
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
10
|
+
*/
|
|
11
|
+
export function getHealth(client: BackwriteClient, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
12
|
+
return client.request("GET", `/healthz`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Prometheus metrics
|
|
17
|
+
* Credential class: platform.
|
|
18
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
19
|
+
*/
|
|
20
|
+
export function getMetrics(client: BackwriteClient, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
21
|
+
return client.request("GET", `/metrics`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* This document
|
|
26
|
+
* Credential class: platform.
|
|
27
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
28
|
+
*/
|
|
29
|
+
export function getOpenApiDocument(client: BackwriteClient, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
30
|
+
return client.request("GET", `/openapi.json`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Active wire-proxy sessions
|
|
35
|
+
* Credential class: platform.
|
|
36
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
37
|
+
*/
|
|
38
|
+
export function listAdminSessions(client: BackwriteClient, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
39
|
+
return client.request("GET", `/v1/admin/sessions`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The branch's database credential material
|
|
44
|
+
* Credential class: platform.
|
|
45
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
46
|
+
*/
|
|
47
|
+
export function getBranchCredentials(client: BackwriteClient, branch_id: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
48
|
+
return client.request("GET", `/v1/branches/${encodeURIComponent(branch_id)}/credentials`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Read a cache entry
|
|
53
|
+
* Credential class: cache.
|
|
54
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
55
|
+
*/
|
|
56
|
+
export function getCacheEntry(client: BackwriteClient, branch_id: string, key: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
57
|
+
return client.request("GET", `/v1/cache/${encodeURIComponent(branch_id)}/entries/${encodeURIComponent(key)}`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Write a cache entry (JSON body, optional TTL)
|
|
62
|
+
* Credential class: cache.
|
|
63
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
64
|
+
*/
|
|
65
|
+
export function putCacheEntry(client: BackwriteClient, branch_id: string, key: string, body: unknown, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
66
|
+
return client.request("PUT", `/v1/cache/${encodeURIComponent(branch_id)}/entries/${encodeURIComponent(key)}`, { body: body, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Delete a cache entry
|
|
71
|
+
* Credential class: cache.
|
|
72
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
73
|
+
*/
|
|
74
|
+
export function deleteCacheEntry(client: BackwriteClient, branch_id: string, key: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
75
|
+
return client.request("DELETE", `/v1/cache/${encodeURIComponent(branch_id)}/entries/${encodeURIComponent(key)}`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Atomically increment a numeric entry
|
|
80
|
+
* Credential class: cache.
|
|
81
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
82
|
+
*/
|
|
83
|
+
export function incrementCacheEntry(client: BackwriteClient, branch_id: string, key: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
84
|
+
return client.request("POST", `/v1/cache/${encodeURIComponent(branch_id)}/entries/${encodeURIComponent(key)}/increment`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Read one connection
|
|
89
|
+
* Credential class: connections.
|
|
90
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
91
|
+
*/
|
|
92
|
+
export function getConnection(client: BackwriteClient, connection_id: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
93
|
+
return client.request("GET", `/v1/connections/${encodeURIComponent(connection_id)}`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Revoke a connection (terminal, idempotent)
|
|
98
|
+
* Credential class: connections.
|
|
99
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
100
|
+
*/
|
|
101
|
+
export function revokeConnection(client: BackwriteClient, connection_id: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
102
|
+
return client.request("DELETE", `/v1/connections/${encodeURIComponent(connection_id)}`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Rotate a connection's credential
|
|
107
|
+
* Credential class: connections.
|
|
108
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
109
|
+
*/
|
|
110
|
+
export function rotateConnection(client: BackwriteClient, connection_id: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
111
|
+
return client.request("POST", `/v1/connections/${encodeURIComponent(connection_id)}/rotate`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Run a table/RPC operation against the branch
|
|
116
|
+
* Credential class: data-api.
|
|
117
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
118
|
+
*/
|
|
119
|
+
export function runDataOperation(client: BackwriteClient, branch_id: string, body: unknown, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
120
|
+
return client.request("POST", `/v1/data/${encodeURIComponent(branch_id)}`, { body: body, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* List projects visible to the credential
|
|
125
|
+
* Credential class: discovery.
|
|
126
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
127
|
+
*/
|
|
128
|
+
export function listProjects(client: BackwriteClient, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
129
|
+
return client.request("GET", `/v1/projects`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* List a project's live branches
|
|
134
|
+
* Credential class: discovery.
|
|
135
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
136
|
+
*/
|
|
137
|
+
export function listProjectBranches(client: BackwriteClient, project_id: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
138
|
+
return client.request("GET", `/v1/projects/${encodeURIComponent(project_id)}/branches`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Connection endpoints for one branch
|
|
143
|
+
* Credential class: discovery.
|
|
144
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
145
|
+
*/
|
|
146
|
+
export function getBranchConnection(client: BackwriteClient, project_id: string, branch_id: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
147
|
+
return client.request("GET", `/v1/projects/${encodeURIComponent(project_id)}/branches/${encodeURIComponent(branch_id)}/connection`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Runtime-specific connection profiles
|
|
152
|
+
* Credential class: discovery.
|
|
153
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
154
|
+
*/
|
|
155
|
+
export function getBranchConnectionProfiles(client: BackwriteClient, project_id: string, branch_id: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
156
|
+
return client.request("GET", `/v1/projects/${encodeURIComponent(project_id)}/branches/${encodeURIComponent(branch_id)}/connection-profiles`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* The .env document for this branch
|
|
161
|
+
* Credential class: discovery.
|
|
162
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
163
|
+
*/
|
|
164
|
+
export function getBranchEnvDocument(client: BackwriteClient, project_id: string, branch_id: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
165
|
+
return client.request("GET", `/v1/projects/${encodeURIComponent(project_id)}/branches/${encodeURIComponent(branch_id)}/env`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* List the project's connections
|
|
170
|
+
* Credential class: connections.
|
|
171
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
172
|
+
*/
|
|
173
|
+
export function listConnections(client: BackwriteClient, project_id: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
174
|
+
return client.request("GET", `/v1/projects/${encodeURIComponent(project_id)}/connections`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Create a connection grant
|
|
179
|
+
* Credential class: connections.
|
|
180
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
181
|
+
*/
|
|
182
|
+
export function createConnection(client: BackwriteClient, project_id: string, body: unknown, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
183
|
+
return client.request("POST", `/v1/projects/${encodeURIComponent(project_id)}/connections`, { body: body, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* A project's connectivity summary
|
|
188
|
+
* Credential class: discovery.
|
|
189
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
190
|
+
*/
|
|
191
|
+
export function getProjectConnectivity(client: BackwriteClient, project_id: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
192
|
+
return client.request("GET", `/v1/projects/${encodeURIComponent(project_id)}/connectivity`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Enqueue a message
|
|
197
|
+
* Credential class: queues.
|
|
198
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
199
|
+
*/
|
|
200
|
+
export function enqueueQueueMessage(client: BackwriteClient, branch_id: string, queue: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
201
|
+
return client.request("POST", `/v1/queues/${encodeURIComponent(branch_id)}/${encodeURIComponent(queue)}`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Delete (drain) a queue
|
|
206
|
+
* Credential class: queues.
|
|
207
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
208
|
+
*/
|
|
209
|
+
export function deleteQueue(client: BackwriteClient, branch_id: string, queue: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
210
|
+
return client.request("DELETE", `/v1/queues/${encodeURIComponent(branch_id)}/${encodeURIComponent(queue)}`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Acknowledge / nak / term messages
|
|
215
|
+
* Credential class: queues.
|
|
216
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
217
|
+
*/
|
|
218
|
+
export function ackQueueMessages(client: BackwriteClient, branch_id: string, queue: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
219
|
+
return client.request("POST", `/v1/queues/${encodeURIComponent(branch_id)}/${encodeURIComponent(queue)}/ack`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Fetch a batch (pull consumer)
|
|
224
|
+
* Credential class: queues.
|
|
225
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
226
|
+
*/
|
|
227
|
+
export function fetchQueueMessages(client: BackwriteClient, branch_id: string, queue: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
228
|
+
return client.request("POST", `/v1/queues/${encodeURIComponent(branch_id)}/${encodeURIComponent(queue)}/fetch`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Queue depth and consumer state
|
|
233
|
+
* Credential class: queues.
|
|
234
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
235
|
+
*/
|
|
236
|
+
export function getQueueStats(client: BackwriteClient, branch_id: string, queue: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
237
|
+
return client.request("GET", `/v1/queues/${encodeURIComponent(branch_id)}/${encodeURIComponent(queue)}/stats`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Open a realtime change stream (WebSocket upgrade)
|
|
242
|
+
* Credential class: realtime.
|
|
243
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
244
|
+
*/
|
|
245
|
+
export function openRealtimeStream(client: BackwriteClient, branch_id: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
246
|
+
return client.request("GET", `/v1/realtime/${encodeURIComponent(branch_id)}`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* List vector indexes
|
|
251
|
+
* Credential class: search.
|
|
252
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
253
|
+
*/
|
|
254
|
+
export function listSearchIndexes(client: BackwriteClient, branch_id: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
255
|
+
return client.request("GET", `/v1/search/${encodeURIComponent(branch_id)}/indexes`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Create a vector index
|
|
260
|
+
* Credential class: search.
|
|
261
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
262
|
+
*/
|
|
263
|
+
export function createSearchIndex(client: BackwriteClient, branch_id: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
264
|
+
return client.request("POST", `/v1/search/${encodeURIComponent(branch_id)}/indexes`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Index descriptor and stats
|
|
269
|
+
* Credential class: search.
|
|
270
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
271
|
+
*/
|
|
272
|
+
export function getSearchIndex(client: BackwriteClient, branch_id: string, index: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
273
|
+
return client.request("GET", `/v1/search/${encodeURIComponent(branch_id)}/indexes/${encodeURIComponent(index)}`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Delete a vector index
|
|
278
|
+
* Credential class: search.
|
|
279
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
280
|
+
*/
|
|
281
|
+
export function deleteSearchIndex(client: BackwriteClient, branch_id: string, index: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
282
|
+
return client.request("DELETE", `/v1/search/${encodeURIComponent(branch_id)}/indexes/${encodeURIComponent(index)}`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* k-nearest-neighbour query
|
|
287
|
+
* Credential class: search.
|
|
288
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
289
|
+
*/
|
|
290
|
+
export function querySearchIndex(client: BackwriteClient, branch_id: string, index: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
291
|
+
return client.request("POST", `/v1/search/${encodeURIComponent(branch_id)}/indexes/${encodeURIComponent(index)}/query`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Upsert vectors
|
|
296
|
+
* Credential class: search.
|
|
297
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
298
|
+
*/
|
|
299
|
+
export function upsertSearchVectors(client: BackwriteClient, branch_id: string, index: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
300
|
+
return client.request("POST", `/v1/search/${encodeURIComponent(branch_id)}/indexes/${encodeURIComponent(index)}/upsert`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* List lifecycle rules
|
|
305
|
+
* Credential class: storage.
|
|
306
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
307
|
+
*/
|
|
308
|
+
export function listLifecycleRules(client: BackwriteClient, branch_id: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
309
|
+
return client.request("GET", `/v1/storage/${encodeURIComponent(branch_id)}/lifecycle`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Register (upsert) a lifecycle rule
|
|
314
|
+
* Credential class: storage.
|
|
315
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
316
|
+
*/
|
|
317
|
+
export function putLifecycleRule(client: BackwriteClient, branch_id: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
318
|
+
return client.request("PUT", `/v1/storage/${encodeURIComponent(branch_id)}/lifecycle`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Delete a lifecycle rule
|
|
323
|
+
* Credential class: storage.
|
|
324
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
325
|
+
*/
|
|
326
|
+
export function deleteLifecycleRule(client: BackwriteClient, branch_id: string, rule_id: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
327
|
+
return client.request("DELETE", `/v1/storage/${encodeURIComponent(branch_id)}/lifecycle/${encodeURIComponent(rule_id)}`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Initiate a multipart upload
|
|
332
|
+
* Credential class: storage.
|
|
333
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
334
|
+
*/
|
|
335
|
+
export function createMultipartUpload(client: BackwriteClient, branch_id: string, object: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
336
|
+
return client.request("POST", `/v1/storage/${encodeURIComponent(branch_id)}/multipart/:object`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Abort a multipart upload
|
|
341
|
+
* Credential class: storage.
|
|
342
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
343
|
+
*/
|
|
344
|
+
export function abortMultipartUpload(client: BackwriteClient, branch_id: string, object: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
345
|
+
return client.request("DELETE", `/v1/storage/${encodeURIComponent(branch_id)}/multipart/:object`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Complete a multipart upload
|
|
350
|
+
* Credential class: storage.
|
|
351
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
352
|
+
*/
|
|
353
|
+
export function completeMultipartUpload(client: BackwriteClient, branch_id: string, object: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
354
|
+
return client.request("POST", `/v1/storage/${encodeURIComponent(branch_id)}/multipart/:object/complete`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Upload one part (≤16 MiB)
|
|
359
|
+
* Credential class: storage.
|
|
360
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
361
|
+
*/
|
|
362
|
+
export function uploadMultipartPart(client: BackwriteClient, branch_id: string, object: string, part: string, body: unknown, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
363
|
+
return client.request("PUT", `/v1/storage/${encodeURIComponent(branch_id)}/multipart/:object/parts/:part`, { body: body, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* List objects under a prefix
|
|
368
|
+
* Credential class: storage.
|
|
369
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
370
|
+
*/
|
|
371
|
+
export function listStorageObjects(client: BackwriteClient, branch_id: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
372
|
+
return client.request("GET", `/v1/storage/${encodeURIComponent(branch_id)}/objects`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Download an object
|
|
377
|
+
* Credential class: storage.
|
|
378
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
379
|
+
*/
|
|
380
|
+
export function getStorageObject(client: BackwriteClient, branch_id: string, object: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
381
|
+
return client.request("GET", `/v1/storage/${encodeURIComponent(branch_id)}/objects/${encodeURIComponent(object)}`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Upload an object (raw bytes body)
|
|
386
|
+
* Credential class: storage.
|
|
387
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
388
|
+
*/
|
|
389
|
+
export function putStorageObject(client: BackwriteClient, branch_id: string, object: string, body: unknown, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
390
|
+
return client.request("PUT", `/v1/storage/${encodeURIComponent(branch_id)}/objects/${encodeURIComponent(object)}`, { body: body, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Delete an object
|
|
395
|
+
* Credential class: storage.
|
|
396
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
397
|
+
*/
|
|
398
|
+
export function deleteStorageObject(client: BackwriteClient, branch_id: string, object: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
399
|
+
return client.request("DELETE", `/v1/storage/${encodeURIComponent(branch_id)}/objects/${encodeURIComponent(object)}`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Mint a presigned URL
|
|
404
|
+
* Credential class: storage.
|
|
405
|
+
* Returns the envelope's `data` directly; throws BackwriteApiError on failure.
|
|
406
|
+
*/
|
|
407
|
+
export function presignStorageObject(client: BackwriteClient, branch_id: string, object: string, opts: { idempotencyKey?: string; raw?: boolean; signal?: AbortSignal } = {}): Promise<unknown> {
|
|
408
|
+
return client.request("POST", `/v1/storage/${encodeURIComponent(branch_id)}/presign/${encodeURIComponent(object)}`, { body: undefined, idempotencyKey: opts.idempotencyKey, raw: opts.raw, signal: opts.signal });
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/** Operation metadata: id → {method, pathTemplate, paramSpecs}. */
|
|
412
|
+
export const OPERATION_META = {
|
|
413
|
+
"getHealth": {
|
|
414
|
+
"method": "GET",
|
|
415
|
+
"path": "/healthz",
|
|
416
|
+
"params": []
|
|
417
|
+
},
|
|
418
|
+
"getMetrics": {
|
|
419
|
+
"method": "GET",
|
|
420
|
+
"path": "/metrics",
|
|
421
|
+
"params": []
|
|
422
|
+
},
|
|
423
|
+
"getOpenApiDocument": {
|
|
424
|
+
"method": "GET",
|
|
425
|
+
"path": "/openapi.json",
|
|
426
|
+
"params": []
|
|
427
|
+
},
|
|
428
|
+
"listAdminSessions": {
|
|
429
|
+
"method": "GET",
|
|
430
|
+
"path": "/v1/admin/sessions",
|
|
431
|
+
"params": []
|
|
432
|
+
},
|
|
433
|
+
"getBranchCredentials": {
|
|
434
|
+
"method": "GET",
|
|
435
|
+
"path": "/v1/branches/{branch_id}/credentials",
|
|
436
|
+
"params": [
|
|
437
|
+
{
|
|
438
|
+
"name": "branch_id",
|
|
439
|
+
"location": "path",
|
|
440
|
+
"required": true
|
|
441
|
+
}
|
|
442
|
+
]
|
|
443
|
+
},
|
|
444
|
+
"getCacheEntry": {
|
|
445
|
+
"method": "GET",
|
|
446
|
+
"path": "/v1/cache/{branch_id}/entries/{key}",
|
|
447
|
+
"params": [
|
|
448
|
+
{
|
|
449
|
+
"name": "branch_id",
|
|
450
|
+
"location": "path",
|
|
451
|
+
"required": true
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
"name": "key",
|
|
455
|
+
"location": "path",
|
|
456
|
+
"required": true
|
|
457
|
+
}
|
|
458
|
+
]
|
|
459
|
+
},
|
|
460
|
+
"putCacheEntry": {
|
|
461
|
+
"method": "PUT",
|
|
462
|
+
"path": "/v1/cache/{branch_id}/entries/{key}",
|
|
463
|
+
"params": [
|
|
464
|
+
{
|
|
465
|
+
"name": "branch_id",
|
|
466
|
+
"location": "path",
|
|
467
|
+
"required": true
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"name": "key",
|
|
471
|
+
"location": "path",
|
|
472
|
+
"required": true
|
|
473
|
+
}
|
|
474
|
+
]
|
|
475
|
+
},
|
|
476
|
+
"deleteCacheEntry": {
|
|
477
|
+
"method": "DELETE",
|
|
478
|
+
"path": "/v1/cache/{branch_id}/entries/{key}",
|
|
479
|
+
"params": [
|
|
480
|
+
{
|
|
481
|
+
"name": "branch_id",
|
|
482
|
+
"location": "path",
|
|
483
|
+
"required": true
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
"name": "key",
|
|
487
|
+
"location": "path",
|
|
488
|
+
"required": true
|
|
489
|
+
}
|
|
490
|
+
]
|
|
491
|
+
},
|
|
492
|
+
"incrementCacheEntry": {
|
|
493
|
+
"method": "POST",
|
|
494
|
+
"path": "/v1/cache/{branch_id}/entries/{key}/increment",
|
|
495
|
+
"params": [
|
|
496
|
+
{
|
|
497
|
+
"name": "branch_id",
|
|
498
|
+
"location": "path",
|
|
499
|
+
"required": true
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
"name": "key",
|
|
503
|
+
"location": "path",
|
|
504
|
+
"required": true
|
|
505
|
+
}
|
|
506
|
+
]
|
|
507
|
+
},
|
|
508
|
+
"getConnection": {
|
|
509
|
+
"method": "GET",
|
|
510
|
+
"path": "/v1/connections/{connection_id}",
|
|
511
|
+
"params": [
|
|
512
|
+
{
|
|
513
|
+
"name": "connection_id",
|
|
514
|
+
"location": "path",
|
|
515
|
+
"required": true
|
|
516
|
+
}
|
|
517
|
+
]
|
|
518
|
+
},
|
|
519
|
+
"revokeConnection": {
|
|
520
|
+
"method": "DELETE",
|
|
521
|
+
"path": "/v1/connections/{connection_id}",
|
|
522
|
+
"params": [
|
|
523
|
+
{
|
|
524
|
+
"name": "connection_id",
|
|
525
|
+
"location": "path",
|
|
526
|
+
"required": true
|
|
527
|
+
}
|
|
528
|
+
]
|
|
529
|
+
},
|
|
530
|
+
"rotateConnection": {
|
|
531
|
+
"method": "POST",
|
|
532
|
+
"path": "/v1/connections/{connection_id}/rotate",
|
|
533
|
+
"params": [
|
|
534
|
+
{
|
|
535
|
+
"name": "connection_id",
|
|
536
|
+
"location": "path",
|
|
537
|
+
"required": true
|
|
538
|
+
}
|
|
539
|
+
]
|
|
540
|
+
},
|
|
541
|
+
"runDataOperation": {
|
|
542
|
+
"method": "POST",
|
|
543
|
+
"path": "/v1/data/{branch_id}",
|
|
544
|
+
"params": [
|
|
545
|
+
{
|
|
546
|
+
"name": "branch_id",
|
|
547
|
+
"location": "path",
|
|
548
|
+
"required": true
|
|
549
|
+
}
|
|
550
|
+
]
|
|
551
|
+
},
|
|
552
|
+
"listProjects": {
|
|
553
|
+
"method": "GET",
|
|
554
|
+
"path": "/v1/projects",
|
|
555
|
+
"params": []
|
|
556
|
+
},
|
|
557
|
+
"listProjectBranches": {
|
|
558
|
+
"method": "GET",
|
|
559
|
+
"path": "/v1/projects/{project_id}/branches",
|
|
560
|
+
"params": [
|
|
561
|
+
{
|
|
562
|
+
"name": "project_id",
|
|
563
|
+
"location": "path",
|
|
564
|
+
"required": true
|
|
565
|
+
}
|
|
566
|
+
]
|
|
567
|
+
},
|
|
568
|
+
"getBranchConnection": {
|
|
569
|
+
"method": "GET",
|
|
570
|
+
"path": "/v1/projects/{project_id}/branches/{branch_id}/connection",
|
|
571
|
+
"params": [
|
|
572
|
+
{
|
|
573
|
+
"name": "project_id",
|
|
574
|
+
"location": "path",
|
|
575
|
+
"required": true
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
"name": "branch_id",
|
|
579
|
+
"location": "path",
|
|
580
|
+
"required": true
|
|
581
|
+
}
|
|
582
|
+
]
|
|
583
|
+
},
|
|
584
|
+
"getBranchConnectionProfiles": {
|
|
585
|
+
"method": "GET",
|
|
586
|
+
"path": "/v1/projects/{project_id}/branches/{branch_id}/connection-profiles",
|
|
587
|
+
"params": [
|
|
588
|
+
{
|
|
589
|
+
"name": "project_id",
|
|
590
|
+
"location": "path",
|
|
591
|
+
"required": true
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
"name": "branch_id",
|
|
595
|
+
"location": "path",
|
|
596
|
+
"required": true
|
|
597
|
+
}
|
|
598
|
+
]
|
|
599
|
+
},
|
|
600
|
+
"getBranchEnvDocument": {
|
|
601
|
+
"method": "GET",
|
|
602
|
+
"path": "/v1/projects/{project_id}/branches/{branch_id}/env",
|
|
603
|
+
"params": [
|
|
604
|
+
{
|
|
605
|
+
"name": "project_id",
|
|
606
|
+
"location": "path",
|
|
607
|
+
"required": true
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
"name": "branch_id",
|
|
611
|
+
"location": "path",
|
|
612
|
+
"required": true
|
|
613
|
+
}
|
|
614
|
+
]
|
|
615
|
+
},
|
|
616
|
+
"listConnections": {
|
|
617
|
+
"method": "GET",
|
|
618
|
+
"path": "/v1/projects/{project_id}/connections",
|
|
619
|
+
"params": [
|
|
620
|
+
{
|
|
621
|
+
"name": "project_id",
|
|
622
|
+
"location": "path",
|
|
623
|
+
"required": true
|
|
624
|
+
}
|
|
625
|
+
]
|
|
626
|
+
},
|
|
627
|
+
"createConnection": {
|
|
628
|
+
"method": "POST",
|
|
629
|
+
"path": "/v1/projects/{project_id}/connections",
|
|
630
|
+
"params": [
|
|
631
|
+
{
|
|
632
|
+
"name": "project_id",
|
|
633
|
+
"location": "path",
|
|
634
|
+
"required": true
|
|
635
|
+
}
|
|
636
|
+
]
|
|
637
|
+
},
|
|
638
|
+
"getProjectConnectivity": {
|
|
639
|
+
"method": "GET",
|
|
640
|
+
"path": "/v1/projects/{project_id}/connectivity",
|
|
641
|
+
"params": [
|
|
642
|
+
{
|
|
643
|
+
"name": "project_id",
|
|
644
|
+
"location": "path",
|
|
645
|
+
"required": true
|
|
646
|
+
}
|
|
647
|
+
]
|
|
648
|
+
},
|
|
649
|
+
"enqueueQueueMessage": {
|
|
650
|
+
"method": "POST",
|
|
651
|
+
"path": "/v1/queues/{branch_id}/{queue}",
|
|
652
|
+
"params": [
|
|
653
|
+
{
|
|
654
|
+
"name": "branch_id",
|
|
655
|
+
"location": "path",
|
|
656
|
+
"required": true
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
"name": "queue",
|
|
660
|
+
"location": "path",
|
|
661
|
+
"required": true
|
|
662
|
+
}
|
|
663
|
+
]
|
|
664
|
+
},
|
|
665
|
+
"deleteQueue": {
|
|
666
|
+
"method": "DELETE",
|
|
667
|
+
"path": "/v1/queues/{branch_id}/{queue}",
|
|
668
|
+
"params": [
|
|
669
|
+
{
|
|
670
|
+
"name": "branch_id",
|
|
671
|
+
"location": "path",
|
|
672
|
+
"required": true
|
|
673
|
+
},
|
|
674
|
+
{
|
|
675
|
+
"name": "queue",
|
|
676
|
+
"location": "path",
|
|
677
|
+
"required": true
|
|
678
|
+
}
|
|
679
|
+
]
|
|
680
|
+
},
|
|
681
|
+
"ackQueueMessages": {
|
|
682
|
+
"method": "POST",
|
|
683
|
+
"path": "/v1/queues/{branch_id}/{queue}/ack",
|
|
684
|
+
"params": [
|
|
685
|
+
{
|
|
686
|
+
"name": "branch_id",
|
|
687
|
+
"location": "path",
|
|
688
|
+
"required": true
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
"name": "queue",
|
|
692
|
+
"location": "path",
|
|
693
|
+
"required": true
|
|
694
|
+
}
|
|
695
|
+
]
|
|
696
|
+
},
|
|
697
|
+
"fetchQueueMessages": {
|
|
698
|
+
"method": "POST",
|
|
699
|
+
"path": "/v1/queues/{branch_id}/{queue}/fetch",
|
|
700
|
+
"params": [
|
|
701
|
+
{
|
|
702
|
+
"name": "branch_id",
|
|
703
|
+
"location": "path",
|
|
704
|
+
"required": true
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
"name": "queue",
|
|
708
|
+
"location": "path",
|
|
709
|
+
"required": true
|
|
710
|
+
}
|
|
711
|
+
]
|
|
712
|
+
},
|
|
713
|
+
"getQueueStats": {
|
|
714
|
+
"method": "GET",
|
|
715
|
+
"path": "/v1/queues/{branch_id}/{queue}/stats",
|
|
716
|
+
"params": [
|
|
717
|
+
{
|
|
718
|
+
"name": "branch_id",
|
|
719
|
+
"location": "path",
|
|
720
|
+
"required": true
|
|
721
|
+
},
|
|
722
|
+
{
|
|
723
|
+
"name": "queue",
|
|
724
|
+
"location": "path",
|
|
725
|
+
"required": true
|
|
726
|
+
}
|
|
727
|
+
]
|
|
728
|
+
},
|
|
729
|
+
"openRealtimeStream": {
|
|
730
|
+
"method": "GET",
|
|
731
|
+
"path": "/v1/realtime/{branch_id}",
|
|
732
|
+
"params": [
|
|
733
|
+
{
|
|
734
|
+
"name": "branch_id",
|
|
735
|
+
"location": "path",
|
|
736
|
+
"required": true
|
|
737
|
+
}
|
|
738
|
+
]
|
|
739
|
+
},
|
|
740
|
+
"listSearchIndexes": {
|
|
741
|
+
"method": "GET",
|
|
742
|
+
"path": "/v1/search/{branch_id}/indexes",
|
|
743
|
+
"params": [
|
|
744
|
+
{
|
|
745
|
+
"name": "branch_id",
|
|
746
|
+
"location": "path",
|
|
747
|
+
"required": true
|
|
748
|
+
}
|
|
749
|
+
]
|
|
750
|
+
},
|
|
751
|
+
"createSearchIndex": {
|
|
752
|
+
"method": "POST",
|
|
753
|
+
"path": "/v1/search/{branch_id}/indexes",
|
|
754
|
+
"params": [
|
|
755
|
+
{
|
|
756
|
+
"name": "branch_id",
|
|
757
|
+
"location": "path",
|
|
758
|
+
"required": true
|
|
759
|
+
}
|
|
760
|
+
]
|
|
761
|
+
},
|
|
762
|
+
"getSearchIndex": {
|
|
763
|
+
"method": "GET",
|
|
764
|
+
"path": "/v1/search/{branch_id}/indexes/{index}",
|
|
765
|
+
"params": [
|
|
766
|
+
{
|
|
767
|
+
"name": "branch_id",
|
|
768
|
+
"location": "path",
|
|
769
|
+
"required": true
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
"name": "index",
|
|
773
|
+
"location": "path",
|
|
774
|
+
"required": true
|
|
775
|
+
}
|
|
776
|
+
]
|
|
777
|
+
},
|
|
778
|
+
"deleteSearchIndex": {
|
|
779
|
+
"method": "DELETE",
|
|
780
|
+
"path": "/v1/search/{branch_id}/indexes/{index}",
|
|
781
|
+
"params": [
|
|
782
|
+
{
|
|
783
|
+
"name": "branch_id",
|
|
784
|
+
"location": "path",
|
|
785
|
+
"required": true
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
"name": "index",
|
|
789
|
+
"location": "path",
|
|
790
|
+
"required": true
|
|
791
|
+
}
|
|
792
|
+
]
|
|
793
|
+
},
|
|
794
|
+
"querySearchIndex": {
|
|
795
|
+
"method": "POST",
|
|
796
|
+
"path": "/v1/search/{branch_id}/indexes/{index}/query",
|
|
797
|
+
"params": [
|
|
798
|
+
{
|
|
799
|
+
"name": "branch_id",
|
|
800
|
+
"location": "path",
|
|
801
|
+
"required": true
|
|
802
|
+
},
|
|
803
|
+
{
|
|
804
|
+
"name": "index",
|
|
805
|
+
"location": "path",
|
|
806
|
+
"required": true
|
|
807
|
+
}
|
|
808
|
+
]
|
|
809
|
+
},
|
|
810
|
+
"upsertSearchVectors": {
|
|
811
|
+
"method": "POST",
|
|
812
|
+
"path": "/v1/search/{branch_id}/indexes/{index}/upsert",
|
|
813
|
+
"params": [
|
|
814
|
+
{
|
|
815
|
+
"name": "branch_id",
|
|
816
|
+
"location": "path",
|
|
817
|
+
"required": true
|
|
818
|
+
},
|
|
819
|
+
{
|
|
820
|
+
"name": "index",
|
|
821
|
+
"location": "path",
|
|
822
|
+
"required": true
|
|
823
|
+
}
|
|
824
|
+
]
|
|
825
|
+
},
|
|
826
|
+
"listLifecycleRules": {
|
|
827
|
+
"method": "GET",
|
|
828
|
+
"path": "/v1/storage/{branch_id}/lifecycle",
|
|
829
|
+
"params": [
|
|
830
|
+
{
|
|
831
|
+
"name": "branch_id",
|
|
832
|
+
"location": "path",
|
|
833
|
+
"required": true
|
|
834
|
+
}
|
|
835
|
+
]
|
|
836
|
+
},
|
|
837
|
+
"putLifecycleRule": {
|
|
838
|
+
"method": "PUT",
|
|
839
|
+
"path": "/v1/storage/{branch_id}/lifecycle",
|
|
840
|
+
"params": [
|
|
841
|
+
{
|
|
842
|
+
"name": "branch_id",
|
|
843
|
+
"location": "path",
|
|
844
|
+
"required": true
|
|
845
|
+
}
|
|
846
|
+
]
|
|
847
|
+
},
|
|
848
|
+
"deleteLifecycleRule": {
|
|
849
|
+
"method": "DELETE",
|
|
850
|
+
"path": "/v1/storage/{branch_id}/lifecycle/{rule_id}",
|
|
851
|
+
"params": [
|
|
852
|
+
{
|
|
853
|
+
"name": "branch_id",
|
|
854
|
+
"location": "path",
|
|
855
|
+
"required": true
|
|
856
|
+
},
|
|
857
|
+
{
|
|
858
|
+
"name": "rule_id",
|
|
859
|
+
"location": "path",
|
|
860
|
+
"required": true
|
|
861
|
+
}
|
|
862
|
+
]
|
|
863
|
+
},
|
|
864
|
+
"createMultipartUpload": {
|
|
865
|
+
"method": "POST",
|
|
866
|
+
"path": "/v1/storage/{branch_id}/multipart/:object",
|
|
867
|
+
"params": [
|
|
868
|
+
{
|
|
869
|
+
"name": "branch_id",
|
|
870
|
+
"location": "path",
|
|
871
|
+
"required": true
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
"name": "object",
|
|
875
|
+
"location": "path",
|
|
876
|
+
"required": true
|
|
877
|
+
}
|
|
878
|
+
]
|
|
879
|
+
},
|
|
880
|
+
"abortMultipartUpload": {
|
|
881
|
+
"method": "DELETE",
|
|
882
|
+
"path": "/v1/storage/{branch_id}/multipart/:object",
|
|
883
|
+
"params": [
|
|
884
|
+
{
|
|
885
|
+
"name": "branch_id",
|
|
886
|
+
"location": "path",
|
|
887
|
+
"required": true
|
|
888
|
+
},
|
|
889
|
+
{
|
|
890
|
+
"name": "object",
|
|
891
|
+
"location": "path",
|
|
892
|
+
"required": true
|
|
893
|
+
}
|
|
894
|
+
]
|
|
895
|
+
},
|
|
896
|
+
"completeMultipartUpload": {
|
|
897
|
+
"method": "POST",
|
|
898
|
+
"path": "/v1/storage/{branch_id}/multipart/:object/complete",
|
|
899
|
+
"params": [
|
|
900
|
+
{
|
|
901
|
+
"name": "branch_id",
|
|
902
|
+
"location": "path",
|
|
903
|
+
"required": true
|
|
904
|
+
},
|
|
905
|
+
{
|
|
906
|
+
"name": "object",
|
|
907
|
+
"location": "path",
|
|
908
|
+
"required": true
|
|
909
|
+
}
|
|
910
|
+
]
|
|
911
|
+
},
|
|
912
|
+
"uploadMultipartPart": {
|
|
913
|
+
"method": "PUT",
|
|
914
|
+
"path": "/v1/storage/{branch_id}/multipart/:object/parts/:part",
|
|
915
|
+
"params": [
|
|
916
|
+
{
|
|
917
|
+
"name": "branch_id",
|
|
918
|
+
"location": "path",
|
|
919
|
+
"required": true
|
|
920
|
+
},
|
|
921
|
+
{
|
|
922
|
+
"name": "object",
|
|
923
|
+
"location": "path",
|
|
924
|
+
"required": true
|
|
925
|
+
},
|
|
926
|
+
{
|
|
927
|
+
"name": "part",
|
|
928
|
+
"location": "path",
|
|
929
|
+
"required": true
|
|
930
|
+
}
|
|
931
|
+
]
|
|
932
|
+
},
|
|
933
|
+
"listStorageObjects": {
|
|
934
|
+
"method": "GET",
|
|
935
|
+
"path": "/v1/storage/{branch_id}/objects",
|
|
936
|
+
"params": [
|
|
937
|
+
{
|
|
938
|
+
"name": "branch_id",
|
|
939
|
+
"location": "path",
|
|
940
|
+
"required": true
|
|
941
|
+
}
|
|
942
|
+
]
|
|
943
|
+
},
|
|
944
|
+
"getStorageObject": {
|
|
945
|
+
"method": "GET",
|
|
946
|
+
"path": "/v1/storage/{branch_id}/objects/{object}",
|
|
947
|
+
"params": [
|
|
948
|
+
{
|
|
949
|
+
"name": "branch_id",
|
|
950
|
+
"location": "path",
|
|
951
|
+
"required": true
|
|
952
|
+
},
|
|
953
|
+
{
|
|
954
|
+
"name": "object",
|
|
955
|
+
"location": "path",
|
|
956
|
+
"required": true
|
|
957
|
+
}
|
|
958
|
+
]
|
|
959
|
+
},
|
|
960
|
+
"putStorageObject": {
|
|
961
|
+
"method": "PUT",
|
|
962
|
+
"path": "/v1/storage/{branch_id}/objects/{object}",
|
|
963
|
+
"params": [
|
|
964
|
+
{
|
|
965
|
+
"name": "branch_id",
|
|
966
|
+
"location": "path",
|
|
967
|
+
"required": true
|
|
968
|
+
},
|
|
969
|
+
{
|
|
970
|
+
"name": "object",
|
|
971
|
+
"location": "path",
|
|
972
|
+
"required": true
|
|
973
|
+
}
|
|
974
|
+
]
|
|
975
|
+
},
|
|
976
|
+
"deleteStorageObject": {
|
|
977
|
+
"method": "DELETE",
|
|
978
|
+
"path": "/v1/storage/{branch_id}/objects/{object}",
|
|
979
|
+
"params": [
|
|
980
|
+
{
|
|
981
|
+
"name": "branch_id",
|
|
982
|
+
"location": "path",
|
|
983
|
+
"required": true
|
|
984
|
+
},
|
|
985
|
+
{
|
|
986
|
+
"name": "object",
|
|
987
|
+
"location": "path",
|
|
988
|
+
"required": true
|
|
989
|
+
}
|
|
990
|
+
]
|
|
991
|
+
},
|
|
992
|
+
"presignStorageObject": {
|
|
993
|
+
"method": "POST",
|
|
994
|
+
"path": "/v1/storage/{branch_id}/presign/{object}",
|
|
995
|
+
"params": [
|
|
996
|
+
{
|
|
997
|
+
"name": "branch_id",
|
|
998
|
+
"location": "path",
|
|
999
|
+
"required": true
|
|
1000
|
+
},
|
|
1001
|
+
{
|
|
1002
|
+
"name": "object",
|
|
1003
|
+
"location": "path",
|
|
1004
|
+
"required": true
|
|
1005
|
+
}
|
|
1006
|
+
]
|
|
1007
|
+
}
|
|
1008
|
+
} as const;
|