@distilled.cloud/surrealdb 0.0.0 → 1.0.0-rc.9
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/LICENSE +201 -0
- package/lib/credentials.d.ts +30 -0
- package/lib/credentials.d.ts.map +1 -0
- package/lib/credentials.js +36 -0
- package/lib/credentials.js.map +1 -0
- package/lib/errors.d.ts +36 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +26 -0
- package/lib/errors.js.map +1 -0
- package/lib/index.d.ts +23 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +27 -0
- package/lib/index.js.map +1 -0
- package/lib/pagination.d.ts +10 -0
- package/lib/pagination.d.ts.map +1 -0
- package/lib/pagination.js +10 -0
- package/lib/pagination.js.map +1 -0
- package/lib/protocol.d.ts +18 -0
- package/lib/protocol.d.ts.map +1 -0
- package/lib/protocol.js +49 -0
- package/lib/protocol.js.map +1 -0
- package/lib/retry.d.ts +32 -0
- package/lib/retry.d.ts.map +1 -0
- package/lib/retry.js +32 -0
- package/lib/retry.js.map +1 -0
- package/lib/services/index.d.ts +2 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/index.js +3 -0
- package/lib/services/index.js.map +1 -0
- package/lib/services/surrealdb.d.ts +290 -0
- package/lib/services/surrealdb.d.ts.map +1 -0
- package/lib/services/surrealdb.js +307 -0
- package/lib/services/surrealdb.js.map +1 -0
- package/lib/traits.d.ts +11 -0
- package/lib/traits.d.ts.map +1 -0
- package/lib/traits.js +11 -0
- package/lib/traits.js.map +1 -0
- package/package.json +77 -6
- package/src/credentials.ts +58 -0
- package/src/errors.ts +50 -0
- package/src/index.ts +30 -0
- package/src/pagination.ts +9 -0
- package/src/protocol.ts +72 -0
- package/src/retry.ts +54 -0
- package/src/services/index.ts +2 -0
- package/src/services/surrealdb.ts +729 -0
- package/src/traits.ts +44 -0
|
@@ -0,0 +1,729 @@
|
|
|
1
|
+
// AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-surrealdb). Do not edit.
|
|
2
|
+
import * as S from "@distilled.cloud/core/schema";
|
|
3
|
+
import * as API from "@distilled.cloud/core/api";
|
|
4
|
+
import * as T from "../traits.ts";
|
|
5
|
+
import {
|
|
6
|
+
SurrealdbProtocol,
|
|
7
|
+
type SurrealdbOpError,
|
|
8
|
+
type SurrealdbOpContext,
|
|
9
|
+
} from "../protocol.ts";
|
|
10
|
+
import { UnknownSurrealdbError } from "../errors.ts";
|
|
11
|
+
import * as Retry from "../retry.ts";
|
|
12
|
+
|
|
13
|
+
export type { SurrealdbOpError, SurrealdbOpContext };
|
|
14
|
+
|
|
15
|
+
export interface CreateSqlRequest {
|
|
16
|
+
/** Sets the selected Namespace for queries */
|
|
17
|
+
nS?: string;
|
|
18
|
+
/** Sets the selected Database for queries */
|
|
19
|
+
dB?: string;
|
|
20
|
+
body: string;
|
|
21
|
+
}
|
|
22
|
+
export const CreateSqlRequest = /*@__PURE__*/ S.suspend(() =>
|
|
23
|
+
S.Struct({
|
|
24
|
+
nS: S.optional(S.String.pipe(T.Header("NS"))),
|
|
25
|
+
dB: S.optional(S.String.pipe(T.Header("DB"))),
|
|
26
|
+
body: S.String.pipe(T.HttpBody()),
|
|
27
|
+
}).pipe(T.Http({ method: "POST", uri: "/sql", code: 200 })),
|
|
28
|
+
).annotate({
|
|
29
|
+
identifier: "CreateSqlRequest",
|
|
30
|
+
}) as any as S.Schema<CreateSqlRequest>;
|
|
31
|
+
|
|
32
|
+
export interface CreateSqlResponse {}
|
|
33
|
+
export const CreateSqlResponse = /*@__PURE__*/ S.suspend(() =>
|
|
34
|
+
S.Struct({}),
|
|
35
|
+
).annotate({
|
|
36
|
+
identifier: "CreateSqlResponse",
|
|
37
|
+
}) as any as S.Schema<CreateSqlResponse>;
|
|
38
|
+
|
|
39
|
+
export interface DeleteKeyRequest {
|
|
40
|
+
/** The table of the records to delete */
|
|
41
|
+
table: string;
|
|
42
|
+
/** Sets the selected Namespace for queries */
|
|
43
|
+
nS?: string;
|
|
44
|
+
/** Sets the selected Database for queries */
|
|
45
|
+
dB?: string;
|
|
46
|
+
}
|
|
47
|
+
export const DeleteKeyRequest = /*@__PURE__*/ S.suspend(() =>
|
|
48
|
+
S.Struct({
|
|
49
|
+
table: S.String.pipe(T.Label()),
|
|
50
|
+
nS: S.optional(S.String.pipe(T.Header("NS"))),
|
|
51
|
+
dB: S.optional(S.String.pipe(T.Header("DB"))),
|
|
52
|
+
}).pipe(T.Http({ method: "DELETE", uri: "/key/{table}", code: 200 })),
|
|
53
|
+
).annotate({
|
|
54
|
+
identifier: "DeleteKeyRequest",
|
|
55
|
+
}) as any as S.Schema<DeleteKeyRequest>;
|
|
56
|
+
|
|
57
|
+
export interface DeleteKeyResponse {}
|
|
58
|
+
export const DeleteKeyResponse = /*@__PURE__*/ S.suspend(() =>
|
|
59
|
+
S.Struct({}),
|
|
60
|
+
).annotate({
|
|
61
|
+
identifier: "DeleteKeyResponse",
|
|
62
|
+
}) as any as S.Schema<DeleteKeyResponse>;
|
|
63
|
+
|
|
64
|
+
export interface DeleteKeyByIdRequest {
|
|
65
|
+
/** The table of the record to delete */
|
|
66
|
+
table: string;
|
|
67
|
+
/** The id of the record to delete */
|
|
68
|
+
id: string;
|
|
69
|
+
/** Sets the selected Namespace for queries */
|
|
70
|
+
nS?: string;
|
|
71
|
+
/** Sets the selected Database for queries */
|
|
72
|
+
dB?: string;
|
|
73
|
+
}
|
|
74
|
+
export const DeleteKeyByIdRequest = /*@__PURE__*/ S.suspend(() =>
|
|
75
|
+
S.Struct({
|
|
76
|
+
table: S.String.pipe(T.Label()),
|
|
77
|
+
id: S.String.pipe(T.Label()),
|
|
78
|
+
nS: S.optional(S.String.pipe(T.Header("NS"))),
|
|
79
|
+
dB: S.optional(S.String.pipe(T.Header("DB"))),
|
|
80
|
+
}).pipe(T.Http({ method: "DELETE", uri: "/key/{table}/{id}", code: 200 })),
|
|
81
|
+
).annotate({
|
|
82
|
+
identifier: "DeleteKeyByIdRequest",
|
|
83
|
+
}) as any as S.Schema<DeleteKeyByIdRequest>;
|
|
84
|
+
|
|
85
|
+
export interface DeleteKeyByIdResponse {}
|
|
86
|
+
export const DeleteKeyByIdResponse = /*@__PURE__*/ S.suspend(() =>
|
|
87
|
+
S.Struct({}),
|
|
88
|
+
).annotate({
|
|
89
|
+
identifier: "DeleteKeyByIdResponse",
|
|
90
|
+
}) as any as S.Schema<DeleteKeyByIdResponse>;
|
|
91
|
+
|
|
92
|
+
export interface GetExportRequest {
|
|
93
|
+
/** Sets the selected Namespace for queries */
|
|
94
|
+
nS?: string;
|
|
95
|
+
/** Sets the selected Database for queries */
|
|
96
|
+
dB?: string;
|
|
97
|
+
}
|
|
98
|
+
export const GetExportRequest = /*@__PURE__*/ S.suspend(() =>
|
|
99
|
+
S.Struct({
|
|
100
|
+
nS: S.optional(S.String.pipe(T.Header("NS"))),
|
|
101
|
+
dB: S.optional(S.String.pipe(T.Header("DB"))),
|
|
102
|
+
}).pipe(T.Http({ method: "GET", uri: "/export", code: 200 })),
|
|
103
|
+
).annotate({
|
|
104
|
+
identifier: "GetExportRequest",
|
|
105
|
+
}) as any as S.Schema<GetExportRequest>;
|
|
106
|
+
|
|
107
|
+
export interface GetExportResponse {}
|
|
108
|
+
export const GetExportResponse = /*@__PURE__*/ S.suspend(() =>
|
|
109
|
+
S.Struct({}),
|
|
110
|
+
).annotate({
|
|
111
|
+
identifier: "GetExportResponse",
|
|
112
|
+
}) as any as S.Schema<GetExportResponse>;
|
|
113
|
+
|
|
114
|
+
export interface GetHealthRequest {}
|
|
115
|
+
export const GetHealthRequest = /*@__PURE__*/ S.suspend(() =>
|
|
116
|
+
S.Struct({}).pipe(T.Http({ method: "GET", uri: "/health", code: 200 })),
|
|
117
|
+
).annotate({
|
|
118
|
+
identifier: "GetHealthRequest",
|
|
119
|
+
}) as any as S.Schema<GetHealthRequest>;
|
|
120
|
+
|
|
121
|
+
export interface GetHealthResponse {}
|
|
122
|
+
export const GetHealthResponse = /*@__PURE__*/ S.suspend(() =>
|
|
123
|
+
S.Struct({}),
|
|
124
|
+
).annotate({
|
|
125
|
+
identifier: "GetHealthResponse",
|
|
126
|
+
}) as any as S.Schema<GetHealthResponse>;
|
|
127
|
+
|
|
128
|
+
export interface GetKeyRequest {
|
|
129
|
+
/** The table of the records to select */
|
|
130
|
+
table: string;
|
|
131
|
+
/** The number of record results to fetch */
|
|
132
|
+
limit?: number;
|
|
133
|
+
/** The number of record results to skip */
|
|
134
|
+
start?: number;
|
|
135
|
+
/** A comma-separated list of specific fields to retrieve for each record */
|
|
136
|
+
fields?: string;
|
|
137
|
+
/** Sets the selected Namespace for queries */
|
|
138
|
+
nS?: string;
|
|
139
|
+
/** Sets the selected Database for queries */
|
|
140
|
+
dB?: string;
|
|
141
|
+
}
|
|
142
|
+
export const GetKeyRequest = /*@__PURE__*/ S.suspend(() =>
|
|
143
|
+
S.Struct({
|
|
144
|
+
table: S.String.pipe(T.Label()),
|
|
145
|
+
limit: S.optional(S.Number.pipe(T.Query())),
|
|
146
|
+
start: S.optional(S.Number.pipe(T.Query())),
|
|
147
|
+
fields: S.optional(S.String.pipe(T.Query())),
|
|
148
|
+
nS: S.optional(S.String.pipe(T.Header("NS"))),
|
|
149
|
+
dB: S.optional(S.String.pipe(T.Header("DB"))),
|
|
150
|
+
}).pipe(T.Http({ method: "GET", uri: "/key/{table}", code: 200 })),
|
|
151
|
+
).annotate({ identifier: "GetKeyRequest" }) as any as S.Schema<GetKeyRequest>;
|
|
152
|
+
|
|
153
|
+
export interface GetKeyResponse {}
|
|
154
|
+
export const GetKeyResponse = /*@__PURE__*/ S.suspend(() =>
|
|
155
|
+
S.Struct({}),
|
|
156
|
+
).annotate({ identifier: "GetKeyResponse" }) as any as S.Schema<GetKeyResponse>;
|
|
157
|
+
|
|
158
|
+
export interface GetKeyByIdRequest {
|
|
159
|
+
/** The table of the record to select */
|
|
160
|
+
table: string;
|
|
161
|
+
/** The id of the record to select */
|
|
162
|
+
id: string;
|
|
163
|
+
/** Sets the selected Namespace for queries */
|
|
164
|
+
nS?: string;
|
|
165
|
+
/** Sets the selected Database for queries */
|
|
166
|
+
dB?: string;
|
|
167
|
+
}
|
|
168
|
+
export const GetKeyByIdRequest = /*@__PURE__*/ S.suspend(() =>
|
|
169
|
+
S.Struct({
|
|
170
|
+
table: S.String.pipe(T.Label()),
|
|
171
|
+
id: S.String.pipe(T.Label()),
|
|
172
|
+
nS: S.optional(S.String.pipe(T.Header("NS"))),
|
|
173
|
+
dB: S.optional(S.String.pipe(T.Header("DB"))),
|
|
174
|
+
}).pipe(T.Http({ method: "GET", uri: "/key/{table}/{id}", code: 200 })),
|
|
175
|
+
).annotate({
|
|
176
|
+
identifier: "GetKeyByIdRequest",
|
|
177
|
+
}) as any as S.Schema<GetKeyByIdRequest>;
|
|
178
|
+
|
|
179
|
+
export interface GetKeyByIdResponseBodyItemResultItem {
|
|
180
|
+
id?: string;
|
|
181
|
+
some?: boolean;
|
|
182
|
+
}
|
|
183
|
+
export const GetKeyByIdResponseBodyItemResultItem = /*@__PURE__*/ S.suspend(
|
|
184
|
+
() =>
|
|
185
|
+
S.Struct({
|
|
186
|
+
id: S.optional(S.String),
|
|
187
|
+
some: S.optional(S.Boolean),
|
|
188
|
+
}),
|
|
189
|
+
).annotate({
|
|
190
|
+
identifier: "GetKeyByIdResponseBodyItemResultItem",
|
|
191
|
+
}) as any as S.Schema<GetKeyByIdResponseBodyItemResultItem>;
|
|
192
|
+
|
|
193
|
+
export type GetKeyByIdResponseBodyItemResultList =
|
|
194
|
+
Array<GetKeyByIdResponseBodyItemResultItem>;
|
|
195
|
+
export const GetKeyByIdResponseBodyItemResultList = /*@__PURE__*/ S.Array(
|
|
196
|
+
GetKeyByIdResponseBodyItemResultItem,
|
|
197
|
+
) as any as S.Schema<GetKeyByIdResponseBodyItemResultList>;
|
|
198
|
+
|
|
199
|
+
export interface GetKeyByIdResponseBodyItem {
|
|
200
|
+
result?: GetKeyByIdResponseBodyItemResultList;
|
|
201
|
+
status?: string;
|
|
202
|
+
time?: string;
|
|
203
|
+
}
|
|
204
|
+
export const GetKeyByIdResponseBodyItem = /*@__PURE__*/ S.suspend(() =>
|
|
205
|
+
S.Struct({
|
|
206
|
+
result: S.optional(GetKeyByIdResponseBodyItemResultList),
|
|
207
|
+
status: S.optional(S.String),
|
|
208
|
+
time: S.optional(S.String),
|
|
209
|
+
}),
|
|
210
|
+
).annotate({
|
|
211
|
+
identifier: "GetKeyByIdResponseBodyItem",
|
|
212
|
+
}) as any as S.Schema<GetKeyByIdResponseBodyItem>;
|
|
213
|
+
|
|
214
|
+
export type GetKeyByIdResponseBodyList = Array<GetKeyByIdResponseBodyItem>;
|
|
215
|
+
export const GetKeyByIdResponseBodyList = /*@__PURE__*/ S.Array(
|
|
216
|
+
GetKeyByIdResponseBodyItem,
|
|
217
|
+
) as any as S.Schema<GetKeyByIdResponseBodyList>;
|
|
218
|
+
|
|
219
|
+
export type GetKeyByIdResponse = GetKeyByIdResponseBodyList;
|
|
220
|
+
export const GetKeyByIdResponse = /*@__PURE__*/ S.suspend(() =>
|
|
221
|
+
GetKeyByIdResponseBodyList.pipe(T.RawResponseRoot()),
|
|
222
|
+
).annotate({
|
|
223
|
+
identifier: "GetKeyByIdResponse",
|
|
224
|
+
}) as any as S.Schema<GetKeyByIdResponse>;
|
|
225
|
+
|
|
226
|
+
export interface GetStatusRequest {}
|
|
227
|
+
export const GetStatusRequest = /*@__PURE__*/ S.suspend(() =>
|
|
228
|
+
S.Struct({}).pipe(T.Http({ method: "GET", uri: "/status", code: 200 })),
|
|
229
|
+
).annotate({
|
|
230
|
+
identifier: "GetStatusRequest",
|
|
231
|
+
}) as any as S.Schema<GetStatusRequest>;
|
|
232
|
+
|
|
233
|
+
export interface GetStatusResponse {}
|
|
234
|
+
export const GetStatusResponse = /*@__PURE__*/ S.suspend(() =>
|
|
235
|
+
S.Struct({}),
|
|
236
|
+
).annotate({
|
|
237
|
+
identifier: "GetStatusResponse",
|
|
238
|
+
}) as any as S.Schema<GetStatusResponse>;
|
|
239
|
+
|
|
240
|
+
export interface GetVersionRequest {}
|
|
241
|
+
export const GetVersionRequest = /*@__PURE__*/ S.suspend(() =>
|
|
242
|
+
S.Struct({}).pipe(T.Http({ method: "GET", uri: "/version", code: 200 })),
|
|
243
|
+
).annotate({
|
|
244
|
+
identifier: "GetVersionRequest",
|
|
245
|
+
}) as any as S.Schema<GetVersionRequest>;
|
|
246
|
+
|
|
247
|
+
export interface GetVersionResponse {}
|
|
248
|
+
export const GetVersionResponse = /*@__PURE__*/ S.suspend(() =>
|
|
249
|
+
S.Struct({}),
|
|
250
|
+
).annotate({
|
|
251
|
+
identifier: "GetVersionResponse",
|
|
252
|
+
}) as any as S.Schema<GetVersionResponse>;
|
|
253
|
+
|
|
254
|
+
export interface ImportRequest {
|
|
255
|
+
/** Sets the selected Namespace for queries */
|
|
256
|
+
nS?: string;
|
|
257
|
+
/** Sets the selected Database for queries */
|
|
258
|
+
dB?: string;
|
|
259
|
+
body: string;
|
|
260
|
+
}
|
|
261
|
+
export const ImportRequest = /*@__PURE__*/ S.suspend(() =>
|
|
262
|
+
S.Struct({
|
|
263
|
+
nS: S.optional(S.String.pipe(T.Header("NS"))),
|
|
264
|
+
dB: S.optional(S.String.pipe(T.Header("DB"))),
|
|
265
|
+
body: S.String.pipe(T.HttpBody()),
|
|
266
|
+
}).pipe(T.Http({ method: "POST", uri: "/import", code: 200 })),
|
|
267
|
+
).annotate({ identifier: "ImportRequest" }) as any as S.Schema<ImportRequest>;
|
|
268
|
+
|
|
269
|
+
export interface ImportResponse {}
|
|
270
|
+
export const ImportResponse = /*@__PURE__*/ S.suspend(() =>
|
|
271
|
+
S.Struct({}),
|
|
272
|
+
).annotate({ identifier: "ImportResponse" }) as any as S.Schema<ImportResponse>;
|
|
273
|
+
|
|
274
|
+
/** Record content */
|
|
275
|
+
export type PutKeyRequestBodyMap = { [key: string]: unknown | undefined };
|
|
276
|
+
export const PutKeyRequestBodyMap = /*@__PURE__*/ S.Record(
|
|
277
|
+
S.String,
|
|
278
|
+
S.Unknown,
|
|
279
|
+
) as any as S.Schema<PutKeyRequestBodyMap>;
|
|
280
|
+
|
|
281
|
+
export interface PutKeyRequest {
|
|
282
|
+
/** The table of the records to update */
|
|
283
|
+
table: string;
|
|
284
|
+
/** Sets the selected Namespace for queries */
|
|
285
|
+
nS?: string;
|
|
286
|
+
/** Sets the selected Database for queries */
|
|
287
|
+
dB?: string;
|
|
288
|
+
body: PutKeyRequestBodyMap;
|
|
289
|
+
}
|
|
290
|
+
export const PutKeyRequest = /*@__PURE__*/ S.suspend(() =>
|
|
291
|
+
S.Struct({
|
|
292
|
+
table: S.String.pipe(T.Label()),
|
|
293
|
+
nS: S.optional(S.String.pipe(T.Header("NS"))),
|
|
294
|
+
dB: S.optional(S.String.pipe(T.Header("DB"))),
|
|
295
|
+
body: PutKeyRequestBodyMap.pipe(T.HttpBody()),
|
|
296
|
+
}).pipe(T.Http({ method: "PUT", uri: "/key/{table}", code: 200 })),
|
|
297
|
+
).annotate({ identifier: "PutKeyRequest" }) as any as S.Schema<PutKeyRequest>;
|
|
298
|
+
|
|
299
|
+
export interface PutKeyResponse {}
|
|
300
|
+
export const PutKeyResponse = /*@__PURE__*/ S.suspend(() =>
|
|
301
|
+
S.Struct({}),
|
|
302
|
+
).annotate({ identifier: "PutKeyResponse" }) as any as S.Schema<PutKeyResponse>;
|
|
303
|
+
|
|
304
|
+
/** Record content */
|
|
305
|
+
export type PutKeyByIdRequestBodyMap = { [key: string]: unknown | undefined };
|
|
306
|
+
export const PutKeyByIdRequestBodyMap = /*@__PURE__*/ S.Record(
|
|
307
|
+
S.String,
|
|
308
|
+
S.Unknown,
|
|
309
|
+
) as any as S.Schema<PutKeyByIdRequestBodyMap>;
|
|
310
|
+
|
|
311
|
+
export interface PutKeyByIdRequest {
|
|
312
|
+
/** The table of the record to update */
|
|
313
|
+
table: string;
|
|
314
|
+
/** The id of the record to update */
|
|
315
|
+
id: string;
|
|
316
|
+
tags?: string;
|
|
317
|
+
/** Sets the selected Namespace for queries */
|
|
318
|
+
nS?: string;
|
|
319
|
+
/** Sets the selected Database for queries */
|
|
320
|
+
dB?: string;
|
|
321
|
+
body: PutKeyByIdRequestBodyMap;
|
|
322
|
+
}
|
|
323
|
+
export const PutKeyByIdRequest = /*@__PURE__*/ S.suspend(() =>
|
|
324
|
+
S.Struct({
|
|
325
|
+
table: S.String.pipe(T.Label()),
|
|
326
|
+
id: S.String.pipe(T.Label()),
|
|
327
|
+
tags: S.optional(S.String.pipe(T.Query())),
|
|
328
|
+
nS: S.optional(S.String.pipe(T.Header("NS"))),
|
|
329
|
+
dB: S.optional(S.String.pipe(T.Header("DB"))),
|
|
330
|
+
body: PutKeyByIdRequestBodyMap.pipe(T.HttpBody()),
|
|
331
|
+
}).pipe(T.Http({ method: "PUT", uri: "/key/{table}/{id}", code: 200 })),
|
|
332
|
+
).annotate({
|
|
333
|
+
identifier: "PutKeyByIdRequest",
|
|
334
|
+
}) as any as S.Schema<PutKeyByIdRequest>;
|
|
335
|
+
|
|
336
|
+
export interface PutKeyByIdResponse {}
|
|
337
|
+
export const PutKeyByIdResponse = /*@__PURE__*/ S.suspend(() =>
|
|
338
|
+
S.Struct({}),
|
|
339
|
+
).annotate({
|
|
340
|
+
identifier: "PutKeyByIdResponse",
|
|
341
|
+
}) as any as S.Schema<PutKeyByIdResponse>;
|
|
342
|
+
|
|
343
|
+
/** Record content */
|
|
344
|
+
export type UpdateKeyRequestBodyMap = { [key: string]: unknown | undefined };
|
|
345
|
+
export const UpdateKeyRequestBodyMap = /*@__PURE__*/ S.Record(
|
|
346
|
+
S.String,
|
|
347
|
+
S.Unknown,
|
|
348
|
+
) as any as S.Schema<UpdateKeyRequestBodyMap>;
|
|
349
|
+
|
|
350
|
+
export interface UpdateKeyRequest {
|
|
351
|
+
/** The table of the record to create */
|
|
352
|
+
table: string;
|
|
353
|
+
/** Sets the selected Namespace for queries */
|
|
354
|
+
nS?: string;
|
|
355
|
+
/** Sets the selected Database for queries */
|
|
356
|
+
dB?: string;
|
|
357
|
+
body: UpdateKeyRequestBodyMap;
|
|
358
|
+
}
|
|
359
|
+
export const UpdateKeyRequest = /*@__PURE__*/ S.suspend(() =>
|
|
360
|
+
S.Struct({
|
|
361
|
+
table: S.String.pipe(T.Label()),
|
|
362
|
+
nS: S.optional(S.String.pipe(T.Header("NS"))),
|
|
363
|
+
dB: S.optional(S.String.pipe(T.Header("DB"))),
|
|
364
|
+
body: UpdateKeyRequestBodyMap.pipe(T.HttpBody()),
|
|
365
|
+
}).pipe(T.Http({ method: "POST", uri: "/key/{table}", code: 200 })),
|
|
366
|
+
).annotate({
|
|
367
|
+
identifier: "UpdateKeyRequest",
|
|
368
|
+
}) as any as S.Schema<UpdateKeyRequest>;
|
|
369
|
+
|
|
370
|
+
export interface UpdateKeyResponse {}
|
|
371
|
+
export const UpdateKeyResponse = /*@__PURE__*/ S.suspend(() =>
|
|
372
|
+
S.Struct({}),
|
|
373
|
+
).annotate({
|
|
374
|
+
identifier: "UpdateKeyResponse",
|
|
375
|
+
}) as any as S.Schema<UpdateKeyResponse>;
|
|
376
|
+
|
|
377
|
+
/** Record content */
|
|
378
|
+
export type UpdateKeyByIdRequestBodyMap = {
|
|
379
|
+
[key: string]: unknown | undefined;
|
|
380
|
+
};
|
|
381
|
+
export const UpdateKeyByIdRequestBodyMap = /*@__PURE__*/ S.Record(
|
|
382
|
+
S.String,
|
|
383
|
+
S.Unknown,
|
|
384
|
+
) as any as S.Schema<UpdateKeyByIdRequestBodyMap>;
|
|
385
|
+
|
|
386
|
+
export interface UpdateKeyByIdRequest {
|
|
387
|
+
/** The table of the record to create */
|
|
388
|
+
table: string;
|
|
389
|
+
/** The id of the record to create */
|
|
390
|
+
id: string;
|
|
391
|
+
/** Sets the selected Namespace for queries */
|
|
392
|
+
nS?: string;
|
|
393
|
+
/** Sets the selected Database for queries */
|
|
394
|
+
dB?: string;
|
|
395
|
+
body: UpdateKeyByIdRequestBodyMap;
|
|
396
|
+
}
|
|
397
|
+
export const UpdateKeyByIdRequest = /*@__PURE__*/ S.suspend(() =>
|
|
398
|
+
S.Struct({
|
|
399
|
+
table: S.String.pipe(T.Label()),
|
|
400
|
+
id: S.String.pipe(T.Label()),
|
|
401
|
+
nS: S.optional(S.String.pipe(T.Header("NS"))),
|
|
402
|
+
dB: S.optional(S.String.pipe(T.Header("DB"))),
|
|
403
|
+
body: UpdateKeyByIdRequestBodyMap.pipe(T.HttpBody()),
|
|
404
|
+
}).pipe(T.Http({ method: "POST", uri: "/key/{table}/{id}", code: 200 })),
|
|
405
|
+
).annotate({
|
|
406
|
+
identifier: "UpdateKeyByIdRequest",
|
|
407
|
+
}) as any as S.Schema<UpdateKeyByIdRequest>;
|
|
408
|
+
|
|
409
|
+
export interface UpdateKeyByIdResponse {}
|
|
410
|
+
export const UpdateKeyByIdResponse = /*@__PURE__*/ S.suspend(() =>
|
|
411
|
+
S.Struct({}),
|
|
412
|
+
).annotate({
|
|
413
|
+
identifier: "UpdateKeyByIdResponse",
|
|
414
|
+
}) as any as S.Schema<UpdateKeyByIdResponse>;
|
|
415
|
+
|
|
416
|
+
/** Fields to merge into the record */
|
|
417
|
+
export type UpdateKeyByIdRequestBodyMap2 = {
|
|
418
|
+
[key: string]: unknown | undefined;
|
|
419
|
+
};
|
|
420
|
+
export const UpdateKeyByIdRequestBodyMap2 = /*@__PURE__*/ S.Record(
|
|
421
|
+
S.String,
|
|
422
|
+
S.Unknown,
|
|
423
|
+
) as any as S.Schema<UpdateKeyByIdRequestBodyMap2>;
|
|
424
|
+
|
|
425
|
+
export interface UpdateKeyByIdRequest2 {
|
|
426
|
+
/** The table of the record to update */
|
|
427
|
+
table: string;
|
|
428
|
+
/** The id of the record to update */
|
|
429
|
+
id: string;
|
|
430
|
+
/** Sets the selected Namespace for queries */
|
|
431
|
+
nS?: string;
|
|
432
|
+
/** Sets the selected Database for queries */
|
|
433
|
+
dB?: string;
|
|
434
|
+
body: UpdateKeyByIdRequestBodyMap2;
|
|
435
|
+
}
|
|
436
|
+
export const UpdateKeyByIdRequest2 = /*@__PURE__*/ S.suspend(() =>
|
|
437
|
+
S.Struct({
|
|
438
|
+
table: S.String.pipe(T.Label()),
|
|
439
|
+
id: S.String.pipe(T.Label()),
|
|
440
|
+
nS: S.optional(S.String.pipe(T.Header("NS"))),
|
|
441
|
+
dB: S.optional(S.String.pipe(T.Header("DB"))),
|
|
442
|
+
body: UpdateKeyByIdRequestBodyMap2.pipe(T.HttpBody()),
|
|
443
|
+
}).pipe(T.Http({ method: "PATCH", uri: "/key/{table}/{id}", code: 200 })),
|
|
444
|
+
).annotate({
|
|
445
|
+
identifier: "UpdateKeyByIdRequest2",
|
|
446
|
+
}) as any as S.Schema<UpdateKeyByIdRequest2>;
|
|
447
|
+
|
|
448
|
+
export interface UpdateKeyById2Response {}
|
|
449
|
+
export const UpdateKeyById2Response = /*@__PURE__*/ S.suspend(() =>
|
|
450
|
+
S.Struct({}),
|
|
451
|
+
).annotate({
|
|
452
|
+
identifier: "UpdateKeyById2Response",
|
|
453
|
+
}) as any as S.Schema<UpdateKeyById2Response>;
|
|
454
|
+
|
|
455
|
+
/** Fields to merge into each record */
|
|
456
|
+
export type UpdateKeyByTableRequestBodyMap = {
|
|
457
|
+
[key: string]: unknown | undefined;
|
|
458
|
+
};
|
|
459
|
+
export const UpdateKeyByTableRequestBodyMap = /*@__PURE__*/ S.Record(
|
|
460
|
+
S.String,
|
|
461
|
+
S.Unknown,
|
|
462
|
+
) as any as S.Schema<UpdateKeyByTableRequestBodyMap>;
|
|
463
|
+
|
|
464
|
+
export interface UpdateKeyByTableRequest {
|
|
465
|
+
/** The table of the records to update */
|
|
466
|
+
table: string;
|
|
467
|
+
/** Sets the selected Namespace for queries */
|
|
468
|
+
nS?: string;
|
|
469
|
+
/** Sets the selected Database for queries */
|
|
470
|
+
dB?: string;
|
|
471
|
+
body: UpdateKeyByTableRequestBodyMap;
|
|
472
|
+
}
|
|
473
|
+
export const UpdateKeyByTableRequest = /*@__PURE__*/ S.suspend(() =>
|
|
474
|
+
S.Struct({
|
|
475
|
+
table: S.String.pipe(T.Label()),
|
|
476
|
+
nS: S.optional(S.String.pipe(T.Header("NS"))),
|
|
477
|
+
dB: S.optional(S.String.pipe(T.Header("DB"))),
|
|
478
|
+
body: UpdateKeyByTableRequestBodyMap.pipe(T.HttpBody()),
|
|
479
|
+
}).pipe(T.Http({ method: "PATCH", uri: "/key/{table}", code: 200 })),
|
|
480
|
+
).annotate({
|
|
481
|
+
identifier: "UpdateKeyByTableRequest",
|
|
482
|
+
}) as any as S.Schema<UpdateKeyByTableRequest>;
|
|
483
|
+
|
|
484
|
+
export interface UpdateKeyByTableResponse {}
|
|
485
|
+
export const UpdateKeyByTableResponse = /*@__PURE__*/ S.suspend(() =>
|
|
486
|
+
S.Struct({}),
|
|
487
|
+
).annotate({
|
|
488
|
+
identifier: "UpdateKeyByTableResponse",
|
|
489
|
+
}) as any as S.Schema<UpdateKeyByTableResponse>;
|
|
490
|
+
|
|
491
|
+
export type CreateSqlError = SurrealdbOpError;
|
|
492
|
+
/** Run SurrealQL queries against SurrealDB The SQL endpoint enables running advanced SurrealQL queries. This HTTP endpoint expects the HTTP body to be one or more SurrealQL statements, separated by a semicolon. */
|
|
493
|
+
export const createSql: API.OperationMethod<
|
|
494
|
+
CreateSqlRequest,
|
|
495
|
+
CreateSqlResponse,
|
|
496
|
+
CreateSqlError,
|
|
497
|
+
SurrealdbOpContext
|
|
498
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
499
|
+
input: CreateSqlRequest,
|
|
500
|
+
output: CreateSqlResponse,
|
|
501
|
+
errors: [UnknownSurrealdbError],
|
|
502
|
+
protocol: SurrealdbProtocol,
|
|
503
|
+
retry: Retry.Retry,
|
|
504
|
+
}));
|
|
505
|
+
|
|
506
|
+
export type DeleteKeyError = SurrealdbOpError;
|
|
507
|
+
/** Delete all records from a table This HTTP RESTful endpoint deletes all records from a specific table in the database. It is equivalent to running: ``` sql DELETE type::table($table); ``` */
|
|
508
|
+
export const deleteKey: API.OperationMethod<
|
|
509
|
+
DeleteKeyRequest,
|
|
510
|
+
DeleteKeyResponse,
|
|
511
|
+
DeleteKeyError,
|
|
512
|
+
SurrealdbOpContext
|
|
513
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
514
|
+
input: DeleteKeyRequest,
|
|
515
|
+
output: DeleteKeyResponse,
|
|
516
|
+
errors: [UnknownSurrealdbError],
|
|
517
|
+
protocol: SurrealdbProtocol,
|
|
518
|
+
retry: Retry.Retry,
|
|
519
|
+
}));
|
|
520
|
+
|
|
521
|
+
export type DeleteKeyByIdError = SurrealdbOpError;
|
|
522
|
+
/** Delete a specific record from a table This HTTP RESTful endpoint deletes a specific record from a table in the database. It is equivalent to running: ``` sql DELETE type::thing($table, $id); ``` */
|
|
523
|
+
export const deleteKeyById: API.OperationMethod<
|
|
524
|
+
DeleteKeyByIdRequest,
|
|
525
|
+
DeleteKeyByIdResponse,
|
|
526
|
+
DeleteKeyByIdError,
|
|
527
|
+
SurrealdbOpContext
|
|
528
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
529
|
+
input: DeleteKeyByIdRequest,
|
|
530
|
+
output: DeleteKeyByIdResponse,
|
|
531
|
+
errors: [UnknownSurrealdbError],
|
|
532
|
+
protocol: SurrealdbProtocol,
|
|
533
|
+
retry: Retry.Retry,
|
|
534
|
+
}));
|
|
535
|
+
|
|
536
|
+
export type GetExportError = SurrealdbOpError;
|
|
537
|
+
/** Export SurrealQL data from SurrealDB Exports SurrealQL data from a local or remote SurrealDB server. */
|
|
538
|
+
export const getExport: API.OperationMethod<
|
|
539
|
+
GetExportRequest,
|
|
540
|
+
GetExportResponse,
|
|
541
|
+
GetExportError,
|
|
542
|
+
SurrealdbOpContext
|
|
543
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
544
|
+
input: GetExportRequest,
|
|
545
|
+
output: GetExportResponse,
|
|
546
|
+
errors: [UnknownSurrealdbError],
|
|
547
|
+
protocol: SurrealdbProtocol,
|
|
548
|
+
retry: Retry.Retry,
|
|
549
|
+
}));
|
|
550
|
+
|
|
551
|
+
export type GetHealthError = SurrealdbOpError;
|
|
552
|
+
/** Fetch the health of a SurrealDB server Checks the health status of a local or remote SurrealDB server and storage engine. */
|
|
553
|
+
export const getHealth: API.OperationMethod<
|
|
554
|
+
GetHealthRequest,
|
|
555
|
+
GetHealthResponse,
|
|
556
|
+
GetHealthError,
|
|
557
|
+
SurrealdbOpContext
|
|
558
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
559
|
+
input: GetHealthRequest,
|
|
560
|
+
output: GetHealthResponse,
|
|
561
|
+
errors: [UnknownSurrealdbError],
|
|
562
|
+
protocol: SurrealdbProtocol,
|
|
563
|
+
retry: Retry.Retry,
|
|
564
|
+
}));
|
|
565
|
+
|
|
566
|
+
export type GetKeyError = SurrealdbOpError;
|
|
567
|
+
/** Select all records from a table This HTTP RESTful endpoint selects all records from a specific table in the database. It is equivalent to running: ``` sql SELECT * FROM type::table($table); ``` */
|
|
568
|
+
export const getKey: API.OperationMethod<
|
|
569
|
+
GetKeyRequest,
|
|
570
|
+
GetKeyResponse,
|
|
571
|
+
GetKeyError,
|
|
572
|
+
SurrealdbOpContext
|
|
573
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
574
|
+
input: GetKeyRequest,
|
|
575
|
+
output: GetKeyResponse,
|
|
576
|
+
errors: [UnknownSurrealdbError],
|
|
577
|
+
protocol: SurrealdbProtocol,
|
|
578
|
+
retry: Retry.Retry,
|
|
579
|
+
}));
|
|
580
|
+
|
|
581
|
+
export type GetKeyByIdError = SurrealdbOpError;
|
|
582
|
+
/** Select a specific record from a table This HTTP RESTful endpoint selects a specific record from a table in the database. It is equivalent to running: ``` sql SELECT * FROM type::thing($table, $id); ``` */
|
|
583
|
+
export const getKeyById: API.OperationMethod<
|
|
584
|
+
GetKeyByIdRequest,
|
|
585
|
+
GetKeyByIdResponse,
|
|
586
|
+
GetKeyByIdError,
|
|
587
|
+
SurrealdbOpContext
|
|
588
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
589
|
+
input: GetKeyByIdRequest,
|
|
590
|
+
output: GetKeyByIdResponse,
|
|
591
|
+
errors: [UnknownSurrealdbError],
|
|
592
|
+
protocol: SurrealdbProtocol,
|
|
593
|
+
retry: Retry.Retry,
|
|
594
|
+
}));
|
|
595
|
+
|
|
596
|
+
export type GetStatusError = SurrealdbOpError;
|
|
597
|
+
/** Fetch the status of a SurrealDB server Checks the connection status of a local or remote SurrealDB server. */
|
|
598
|
+
export const getStatus: API.OperationMethod<
|
|
599
|
+
GetStatusRequest,
|
|
600
|
+
GetStatusResponse,
|
|
601
|
+
GetStatusError,
|
|
602
|
+
SurrealdbOpContext
|
|
603
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
604
|
+
input: GetStatusRequest,
|
|
605
|
+
output: GetStatusResponse,
|
|
606
|
+
errors: [UnknownSurrealdbError],
|
|
607
|
+
protocol: SurrealdbProtocol,
|
|
608
|
+
retry: Retry.Retry,
|
|
609
|
+
}));
|
|
610
|
+
|
|
611
|
+
export type GetVersionError = SurrealdbOpError;
|
|
612
|
+
/** Fetch the version of a SurrealDB server Returns the version of a local or remote SurrealDB database server. */
|
|
613
|
+
export const getVersion: API.OperationMethod<
|
|
614
|
+
GetVersionRequest,
|
|
615
|
+
GetVersionResponse,
|
|
616
|
+
GetVersionError,
|
|
617
|
+
SurrealdbOpContext
|
|
618
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
619
|
+
input: GetVersionRequest,
|
|
620
|
+
output: GetVersionResponse,
|
|
621
|
+
errors: [UnknownSurrealdbError],
|
|
622
|
+
protocol: SurrealdbProtocol,
|
|
623
|
+
retry: Retry.Retry,
|
|
624
|
+
}));
|
|
625
|
+
|
|
626
|
+
export type ImportError = SurrealdbOpError;
|
|
627
|
+
/** Import SurrealQL data into SurrealDB Imports SurrealQL data into a local or remote SurrealDB server. */
|
|
628
|
+
export const Import: API.OperationMethod<
|
|
629
|
+
ImportRequest,
|
|
630
|
+
ImportResponse,
|
|
631
|
+
ImportError,
|
|
632
|
+
SurrealdbOpContext
|
|
633
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
634
|
+
input: ImportRequest,
|
|
635
|
+
output: ImportResponse,
|
|
636
|
+
errors: [UnknownSurrealdbError],
|
|
637
|
+
protocol: SurrealdbProtocol,
|
|
638
|
+
retry: Retry.Retry,
|
|
639
|
+
}));
|
|
640
|
+
|
|
641
|
+
export type PutKeyError = SurrealdbOpError;
|
|
642
|
+
/** Update all records in a table This HTTP RESTful endpoint updates all records in a specific table in the database. It replaces the record content with the supplied request data, and is equivalent to running: ``` sql UPDATE type::table($table) CONTENT $body; ``` */
|
|
643
|
+
export const putKey: API.OperationMethod<
|
|
644
|
+
PutKeyRequest,
|
|
645
|
+
PutKeyResponse,
|
|
646
|
+
PutKeyError,
|
|
647
|
+
SurrealdbOpContext
|
|
648
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
649
|
+
input: PutKeyRequest,
|
|
650
|
+
output: PutKeyResponse,
|
|
651
|
+
errors: [UnknownSurrealdbError],
|
|
652
|
+
protocol: SurrealdbProtocol,
|
|
653
|
+
retry: Retry.Retry,
|
|
654
|
+
}));
|
|
655
|
+
|
|
656
|
+
export type PutKeyByIdError = SurrealdbOpError;
|
|
657
|
+
/** Update a specific record in a table This HTTP RESTful endpoint updates a specific record in a table in the database. The supplied request body is used as the content of the record, and is equivalent to running: ``` sql UPDATE type::thing($table, $id) CONTENT $body; ``` */
|
|
658
|
+
export const putKeyById: API.OperationMethod<
|
|
659
|
+
PutKeyByIdRequest,
|
|
660
|
+
PutKeyByIdResponse,
|
|
661
|
+
PutKeyByIdError,
|
|
662
|
+
SurrealdbOpContext
|
|
663
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
664
|
+
input: PutKeyByIdRequest,
|
|
665
|
+
output: PutKeyByIdResponse,
|
|
666
|
+
errors: [UnknownSurrealdbError],
|
|
667
|
+
protocol: SurrealdbProtocol,
|
|
668
|
+
retry: Retry.Retry,
|
|
669
|
+
}));
|
|
670
|
+
|
|
671
|
+
export type UpdateKeyError = SurrealdbOpError;
|
|
672
|
+
/** Create a new record in a table This HTTP RESTful endpoint creates a record in a specific table in the database. The supplied request body is used as the content of the record, and is equivalent to running: ``` sql CREATE type::table($table) CONTENT $body; ``` */
|
|
673
|
+
export const updateKey: API.OperationMethod<
|
|
674
|
+
UpdateKeyRequest,
|
|
675
|
+
UpdateKeyResponse,
|
|
676
|
+
UpdateKeyError,
|
|
677
|
+
SurrealdbOpContext
|
|
678
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
679
|
+
input: UpdateKeyRequest,
|
|
680
|
+
output: UpdateKeyResponse,
|
|
681
|
+
errors: [UnknownSurrealdbError],
|
|
682
|
+
protocol: SurrealdbProtocol,
|
|
683
|
+
retry: Retry.Retry,
|
|
684
|
+
}));
|
|
685
|
+
|
|
686
|
+
export type UpdateKeyByIdError = SurrealdbOpError;
|
|
687
|
+
/** Create a specific record in a table This HTTP RESTful endpoint creates a specific record in a table in the database. The supplied request body is used as the content of the record, and is equivalent to running: ``` sql CREATE type::thing($table, $id) CONTENT $body; ``` */
|
|
688
|
+
export const updateKeyById: API.OperationMethod<
|
|
689
|
+
UpdateKeyByIdRequest,
|
|
690
|
+
UpdateKeyByIdResponse,
|
|
691
|
+
UpdateKeyByIdError,
|
|
692
|
+
SurrealdbOpContext
|
|
693
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
694
|
+
input: UpdateKeyByIdRequest,
|
|
695
|
+
output: UpdateKeyByIdResponse,
|
|
696
|
+
errors: [UnknownSurrealdbError],
|
|
697
|
+
protocol: SurrealdbProtocol,
|
|
698
|
+
retry: Retry.Retry,
|
|
699
|
+
}));
|
|
700
|
+
|
|
701
|
+
export type UpdateKeyById2Error = SurrealdbOpError;
|
|
702
|
+
/** Update a specific record in a table This HTTP RESTful endpoint updates a specific record in a table in the database. It merges the supplied request data with the records in the table, and is equivalent to running: ``` sql UPDATE type::thing($table, $id) MERGE $body; ``` */
|
|
703
|
+
export const updateKeyById2: API.OperationMethod<
|
|
704
|
+
UpdateKeyByIdRequest2,
|
|
705
|
+
UpdateKeyById2Response,
|
|
706
|
+
UpdateKeyById2Error,
|
|
707
|
+
SurrealdbOpContext
|
|
708
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
709
|
+
input: UpdateKeyByIdRequest2,
|
|
710
|
+
output: UpdateKeyById2Response,
|
|
711
|
+
errors: [UnknownSurrealdbError],
|
|
712
|
+
protocol: SurrealdbProtocol,
|
|
713
|
+
retry: Retry.Retry,
|
|
714
|
+
}));
|
|
715
|
+
|
|
716
|
+
export type UpdateKeyByTableError = SurrealdbOpError;
|
|
717
|
+
/** Update all records in a table This HTTP RESTful endpoint updates all records in a specific table in the database. It merges the supplied request data with the records in the table, and is equivalent to running: ``` sql UPDATE type::table($table) MERGE $body; ``` */
|
|
718
|
+
export const updateKeyByTable: API.OperationMethod<
|
|
719
|
+
UpdateKeyByTableRequest,
|
|
720
|
+
UpdateKeyByTableResponse,
|
|
721
|
+
UpdateKeyByTableError,
|
|
722
|
+
SurrealdbOpContext
|
|
723
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
724
|
+
input: UpdateKeyByTableRequest,
|
|
725
|
+
output: UpdateKeyByTableResponse,
|
|
726
|
+
errors: [UnknownSurrealdbError],
|
|
727
|
+
protocol: SurrealdbProtocol,
|
|
728
|
+
retry: Retry.Retry,
|
|
729
|
+
}));
|