@frontal-labs/data 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/README.md +41 -0
- package/dist/client.d.ts +29 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/constants.d.ts +21 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/index.cjs +475 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +451 -0
- package/dist/sdk.d.ts +215 -0
- package/dist/sdk.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +65 -0
- package/src/client.ts +77 -0
- package/src/constants.ts +24 -0
- package/src/index.ts +9 -0
- package/src/sdk.ts +441 -0
package/src/sdk.ts
ADDED
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
import {
|
|
2
|
+
asPagePayload,
|
|
3
|
+
createPageResult,
|
|
4
|
+
type HttpClient,
|
|
5
|
+
type PageResult,
|
|
6
|
+
} from "@frontal-labs/core";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Client for the Frontal Data platform's processing subdomains
|
|
10
|
+
* (`/v1/data/*`), each a distinct backend service that shares a common
|
|
11
|
+
* `capabilities`/`health`/`info`/`runs` envelope.
|
|
12
|
+
*
|
|
13
|
+
* Datasets (ingest + catalog), pipelines, and lineage have dedicated packages
|
|
14
|
+
* (`@frontal-labs/datasets`, `@frontal-labs/pipelines`, `@frontal-labs/lineage`);
|
|
15
|
+
* this package covers the remaining subdomains.
|
|
16
|
+
*
|
|
17
|
+
* Paths are written without the leading `/v1` because the client base URL
|
|
18
|
+
* already includes it.
|
|
19
|
+
*/
|
|
20
|
+
export class DataSdk {
|
|
21
|
+
/** Aggregation management subdomain. */
|
|
22
|
+
readonly aggregations: AggregationsNamespace;
|
|
23
|
+
/** Archival policy subdomain. */
|
|
24
|
+
readonly archival: ArchivalNamespace;
|
|
25
|
+
/** Enrichment profile subdomain. */
|
|
26
|
+
readonly enrichment: EnrichmentNamespace;
|
|
27
|
+
/** Data export subdomain. */
|
|
28
|
+
readonly exports: ExportsNamespace;
|
|
29
|
+
/** Normalization profile subdomain. */
|
|
30
|
+
readonly normalization: NormalizationNamespace;
|
|
31
|
+
/** Data quality ruleset subdomain. */
|
|
32
|
+
readonly quality: QualityNamespace;
|
|
33
|
+
/** Serving product subdomain. */
|
|
34
|
+
readonly serving: ServingNamespace;
|
|
35
|
+
/** Stream management subdomain. */
|
|
36
|
+
readonly streams: StreamsNamespace;
|
|
37
|
+
/** Sync job subdomain. */
|
|
38
|
+
readonly sync: SyncNamespace;
|
|
39
|
+
/** Transformation subdomain. */
|
|
40
|
+
readonly transformations: TransformationsNamespace;
|
|
41
|
+
/** Federated query subdomain. */
|
|
42
|
+
readonly query: QueryNamespace;
|
|
43
|
+
/** Schema registry subdomain. */
|
|
44
|
+
readonly schemas: SchemasNamespace;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @param http - The shared HTTP client used for all subdomain requests.
|
|
48
|
+
*/
|
|
49
|
+
constructor(http: HttpClient) {
|
|
50
|
+
this.aggregations = new AggregationsNamespace(http);
|
|
51
|
+
this.archival = new ArchivalNamespace(http);
|
|
52
|
+
this.enrichment = new EnrichmentNamespace(http);
|
|
53
|
+
this.exports = new ExportsNamespace(http);
|
|
54
|
+
this.normalization = new NormalizationNamespace(http);
|
|
55
|
+
this.quality = new QualityNamespace(http);
|
|
56
|
+
this.serving = new ServingNamespace(http);
|
|
57
|
+
this.streams = new StreamsNamespace(http);
|
|
58
|
+
this.sync = new SyncNamespace(http);
|
|
59
|
+
this.transformations = new TransformationsNamespace(http);
|
|
60
|
+
this.query = new QueryNamespace(http);
|
|
61
|
+
this.schemas = new SchemasNamespace(http);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
type Body = Record<string, unknown>;
|
|
66
|
+
interface ListOpts {
|
|
67
|
+
limit?: number;
|
|
68
|
+
cursor?: string;
|
|
69
|
+
[key: string]: unknown;
|
|
70
|
+
}
|
|
71
|
+
type Obj = Record<string, unknown>;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Shared behaviour for every data subdomain: capability/health/info probes and
|
|
75
|
+
* the asynchronous `runs` collection.
|
|
76
|
+
*/
|
|
77
|
+
export class SubdomainBase {
|
|
78
|
+
/**
|
|
79
|
+
* @param http - The shared HTTP client.
|
|
80
|
+
* @param base - The subdomain base path (e.g. `/data/aggregations`).
|
|
81
|
+
*/
|
|
82
|
+
constructor(
|
|
83
|
+
protected readonly http: HttpClient,
|
|
84
|
+
protected readonly base: string
|
|
85
|
+
) {}
|
|
86
|
+
|
|
87
|
+
/** List available capabilities for this subdomain. */
|
|
88
|
+
capabilities(): Promise<Obj> {
|
|
89
|
+
return this.http.get(`${this.base}/capabilities`);
|
|
90
|
+
}
|
|
91
|
+
/** Health check for this subdomain. */
|
|
92
|
+
health(): Promise<Obj> {
|
|
93
|
+
return this.http.get(`${this.base}/health`);
|
|
94
|
+
}
|
|
95
|
+
/** Metadata about this subdomain service. */
|
|
96
|
+
info(): Promise<Obj> {
|
|
97
|
+
return this.http.get(`${this.base}/info`);
|
|
98
|
+
}
|
|
99
|
+
/** List asynchronous runs, with optional cursor-based pagination. */
|
|
100
|
+
async runs(opts: ListOpts = {}): Promise<PageResult<Obj>> {
|
|
101
|
+
const raw = await this.http.get(`${this.base}/runs`, opts);
|
|
102
|
+
return createPageResult(asPagePayload<Obj>(raw), (c) =>
|
|
103
|
+
this.runs({ ...opts, cursor: c })
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
/** Create a new asynchronous run. */
|
|
107
|
+
createRun(input: Body): Promise<Obj> {
|
|
108
|
+
return this.http.post(`${this.base}/runs`, input);
|
|
109
|
+
}
|
|
110
|
+
/** Get a single run by its ID. */
|
|
111
|
+
run(runId: string): Promise<Obj> {
|
|
112
|
+
return this.http.get(`${this.base}/runs/${runId}`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** Aggregation management subdomain (`/data/aggregations`). */
|
|
117
|
+
export class AggregationsNamespace extends SubdomainBase {
|
|
118
|
+
constructor(http: HttpClient) {
|
|
119
|
+
super(http, "/data/aggregations");
|
|
120
|
+
}
|
|
121
|
+
/** List all aggregation definitions. */
|
|
122
|
+
async list(opts: ListOpts = {}): Promise<PageResult<Obj>> {
|
|
123
|
+
const raw = await this.http.get("/data/aggregations/aggregations", opts);
|
|
124
|
+
return createPageResult(asPagePayload<Obj>(raw), (c) =>
|
|
125
|
+
this.list({ ...opts, cursor: c })
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
/** Create a new aggregation definition. */
|
|
129
|
+
create(body: Body): Promise<Obj> {
|
|
130
|
+
return this.http.post("/data/aggregations/aggregations", body);
|
|
131
|
+
}
|
|
132
|
+
/** Get a single aggregation definition by ID. */
|
|
133
|
+
get(id: string): Promise<Obj> {
|
|
134
|
+
return this.http.get(`/data/aggregations/aggregations/${id}`);
|
|
135
|
+
}
|
|
136
|
+
/** Execute an aggregation and return a run result. */
|
|
137
|
+
execute(id: string, body: Body = {}): Promise<Obj> {
|
|
138
|
+
return this.http.post(
|
|
139
|
+
`/data/aggregations/aggregations/${id}/executions`,
|
|
140
|
+
body
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/** Archival policy subdomain (`/data/archival`). */
|
|
146
|
+
export class ArchivalNamespace extends SubdomainBase {
|
|
147
|
+
constructor(http: HttpClient) {
|
|
148
|
+
super(http, "/data/archival");
|
|
149
|
+
}
|
|
150
|
+
/** List all archival policies. */
|
|
151
|
+
async list(opts: ListOpts = {}): Promise<PageResult<Obj>> {
|
|
152
|
+
const raw = await this.http.get("/data/archival/archival/policies", opts);
|
|
153
|
+
return createPageResult(asPagePayload<Obj>(raw), (c) =>
|
|
154
|
+
this.list({ ...opts, cursor: c })
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
/** Create a new archival policy. */
|
|
158
|
+
create(body: Body): Promise<Obj> {
|
|
159
|
+
return this.http.post("/data/archival/archival/policies", body);
|
|
160
|
+
}
|
|
161
|
+
/** Get a single archival policy by ID. */
|
|
162
|
+
get(id: string): Promise<Obj> {
|
|
163
|
+
return this.http.get(`/data/archival/archival/policies/${id}`);
|
|
164
|
+
}
|
|
165
|
+
/** Execute an archival policy. */
|
|
166
|
+
execute(id: string, body: Body = {}): Promise<Obj> {
|
|
167
|
+
return this.http.post(
|
|
168
|
+
`/data/archival/archival/policies/${id}/executions`,
|
|
169
|
+
body
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/** Enrichment profile subdomain (`/data/enrichment`). */
|
|
175
|
+
export class EnrichmentNamespace extends SubdomainBase {
|
|
176
|
+
constructor(http: HttpClient) {
|
|
177
|
+
super(http, "/data/enrichment");
|
|
178
|
+
}
|
|
179
|
+
/** List all enrichment profiles. */
|
|
180
|
+
async list(opts: ListOpts = {}): Promise<PageResult<Obj>> {
|
|
181
|
+
const raw = await this.http.get(
|
|
182
|
+
"/data/enrichment/enrichment/profiles",
|
|
183
|
+
opts
|
|
184
|
+
);
|
|
185
|
+
return createPageResult(asPagePayload<Obj>(raw), (c) =>
|
|
186
|
+
this.list({ ...opts, cursor: c })
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
/** Create a new enrichment profile. */
|
|
190
|
+
create(body: Body): Promise<Obj> {
|
|
191
|
+
return this.http.post("/data/enrichment/enrichment/profiles", body);
|
|
192
|
+
}
|
|
193
|
+
/** Get a single enrichment profile by ID. */
|
|
194
|
+
get(id: string): Promise<Obj> {
|
|
195
|
+
return this.http.get(`/data/enrichment/enrichment/profiles/${id}`);
|
|
196
|
+
}
|
|
197
|
+
/** Execute an enrichment profile. */
|
|
198
|
+
execute(id: string, body: Body = {}): Promise<Obj> {
|
|
199
|
+
return this.http.post(
|
|
200
|
+
`/data/enrichment/enrichment/profiles/${id}/executions`,
|
|
201
|
+
body
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/** Data export subdomain (`/data/exports`). */
|
|
207
|
+
export class ExportsNamespace extends SubdomainBase {
|
|
208
|
+
constructor(http: HttpClient) {
|
|
209
|
+
super(http, "/data/exports");
|
|
210
|
+
}
|
|
211
|
+
/** List all exports. */
|
|
212
|
+
async list(opts: ListOpts = {}): Promise<PageResult<Obj>> {
|
|
213
|
+
const raw = await this.http.get("/data/exports/exports", opts);
|
|
214
|
+
return createPageResult(asPagePayload<Obj>(raw), (c) =>
|
|
215
|
+
this.list({ ...opts, cursor: c })
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
/** Create a new export job. */
|
|
219
|
+
create(body: Body): Promise<Obj> {
|
|
220
|
+
return this.http.post("/data/exports/exports", body);
|
|
221
|
+
}
|
|
222
|
+
/** Get a single export by ID. */
|
|
223
|
+
get(id: string): Promise<Obj> {
|
|
224
|
+
return this.http.get(`/data/exports/exports/${id}`);
|
|
225
|
+
}
|
|
226
|
+
/** Execute an export job. */
|
|
227
|
+
execute(id: string, body: Body = {}): Promise<Obj> {
|
|
228
|
+
return this.http.post(`/data/exports/exports/${id}/executions`, body);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/** Normalization profile subdomain (`/data/normalization`). */
|
|
233
|
+
export class NormalizationNamespace extends SubdomainBase {
|
|
234
|
+
constructor(http: HttpClient) {
|
|
235
|
+
super(http, "/data/normalization");
|
|
236
|
+
}
|
|
237
|
+
/** List all normalization profiles. */
|
|
238
|
+
async list(opts: ListOpts = {}): Promise<PageResult<Obj>> {
|
|
239
|
+
const raw = await this.http.get(
|
|
240
|
+
"/data/normalization/normalization/profiles",
|
|
241
|
+
opts
|
|
242
|
+
);
|
|
243
|
+
return createPageResult(asPagePayload<Obj>(raw), (c) =>
|
|
244
|
+
this.list({ ...opts, cursor: c })
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
/** Create a new normalization profile. */
|
|
248
|
+
create(body: Body): Promise<Obj> {
|
|
249
|
+
return this.http.post("/data/normalization/normalization/profiles", body);
|
|
250
|
+
}
|
|
251
|
+
/** Get a single normalization profile by ID. */
|
|
252
|
+
get(id: string): Promise<Obj> {
|
|
253
|
+
return this.http.get(`/data/normalization/normalization/profiles/${id}`);
|
|
254
|
+
}
|
|
255
|
+
/** Execute a normalization profile. */
|
|
256
|
+
execute(id: string, body: Body = {}): Promise<Obj> {
|
|
257
|
+
return this.http.post(
|
|
258
|
+
`/data/normalization/normalization/profiles/${id}/executions`,
|
|
259
|
+
body
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/** Data quality ruleset subdomain (`/data/quality`). */
|
|
265
|
+
export class QualityNamespace extends SubdomainBase {
|
|
266
|
+
constructor(http: HttpClient) {
|
|
267
|
+
super(http, "/data/quality");
|
|
268
|
+
}
|
|
269
|
+
/** List all quality rulesets. */
|
|
270
|
+
async list(opts: ListOpts = {}): Promise<PageResult<Obj>> {
|
|
271
|
+
const raw = await this.http.get("/data/quality/quality/rulesets", opts);
|
|
272
|
+
return createPageResult(asPagePayload<Obj>(raw), (c) =>
|
|
273
|
+
this.list({ ...opts, cursor: c })
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
/** Create a new quality ruleset. */
|
|
277
|
+
create(body: Body): Promise<Obj> {
|
|
278
|
+
return this.http.post("/data/quality/quality/rulesets", body);
|
|
279
|
+
}
|
|
280
|
+
/** Get a single quality ruleset by ID. */
|
|
281
|
+
get(id: string): Promise<Obj> {
|
|
282
|
+
return this.http.get(`/data/quality/quality/rulesets/${id}`);
|
|
283
|
+
}
|
|
284
|
+
/** Evaluate a ruleset. */
|
|
285
|
+
execute(id: string, body: Body = {}): Promise<Obj> {
|
|
286
|
+
return this.http.post(
|
|
287
|
+
`/data/quality/quality/rulesets/${id}/evaluations`,
|
|
288
|
+
body
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/** Serving product subdomain (`/data/serving`). */
|
|
294
|
+
export class ServingNamespace extends SubdomainBase {
|
|
295
|
+
constructor(http: HttpClient) {
|
|
296
|
+
super(http, "/data/serving");
|
|
297
|
+
}
|
|
298
|
+
/** List all serving products. */
|
|
299
|
+
async list(opts: ListOpts = {}): Promise<PageResult<Obj>> {
|
|
300
|
+
const raw = await this.http.get("/data/serving/serving/products", opts);
|
|
301
|
+
return createPageResult(asPagePayload<Obj>(raw), (c) =>
|
|
302
|
+
this.list({ ...opts, cursor: c })
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
/** Create a new serving product. */
|
|
306
|
+
create(body: Body): Promise<Obj> {
|
|
307
|
+
return this.http.post("/data/serving/serving/products", body);
|
|
308
|
+
}
|
|
309
|
+
/** Get a single serving product by ID. */
|
|
310
|
+
get(id: string): Promise<Obj> {
|
|
311
|
+
return this.http.get(`/data/serving/serving/products/${id}`);
|
|
312
|
+
}
|
|
313
|
+
/** Refresh a serving product. */
|
|
314
|
+
execute(id: string, body: Body = {}): Promise<Obj> {
|
|
315
|
+
return this.http.post(
|
|
316
|
+
`/data/serving/serving/products/${id}/refreshes`,
|
|
317
|
+
body
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/** Stream management subdomain (`/data/streams`). */
|
|
323
|
+
export class StreamsNamespace extends SubdomainBase {
|
|
324
|
+
constructor(http: HttpClient) {
|
|
325
|
+
super(http, "/data/streams");
|
|
326
|
+
}
|
|
327
|
+
/** List all streams. */
|
|
328
|
+
async list(opts: ListOpts = {}): Promise<PageResult<Obj>> {
|
|
329
|
+
const raw = await this.http.get("/data/streams/streams", opts);
|
|
330
|
+
return createPageResult(asPagePayload<Obj>(raw), (c) =>
|
|
331
|
+
this.list({ ...opts, cursor: c })
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
/** Create a new stream. */
|
|
335
|
+
create(body: Body): Promise<Obj> {
|
|
336
|
+
return this.http.post("/data/streams/streams", body);
|
|
337
|
+
}
|
|
338
|
+
/** Get a single stream by ID. */
|
|
339
|
+
get(id: string): Promise<Obj> {
|
|
340
|
+
return this.http.get(`/data/streams/streams/${id}`);
|
|
341
|
+
}
|
|
342
|
+
/** Trigger deliveries for a stream. */
|
|
343
|
+
execute(id: string, body: Body = {}): Promise<Obj> {
|
|
344
|
+
return this.http.post(`/data/streams/streams/${id}/deliveries`, body);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/** Sync job subdomain (`/data/sync`). */
|
|
349
|
+
export class SyncNamespace extends SubdomainBase {
|
|
350
|
+
constructor(http: HttpClient) {
|
|
351
|
+
super(http, "/data/sync");
|
|
352
|
+
}
|
|
353
|
+
/** List all sync jobs. */
|
|
354
|
+
async list(opts: ListOpts = {}): Promise<PageResult<Obj>> {
|
|
355
|
+
const raw = await this.http.get("/data/sync/sync/jobs", opts);
|
|
356
|
+
return createPageResult(asPagePayload<Obj>(raw), (c) =>
|
|
357
|
+
this.list({ ...opts, cursor: c })
|
|
358
|
+
);
|
|
359
|
+
}
|
|
360
|
+
/** Create a new sync job. */
|
|
361
|
+
create(body: Body): Promise<Obj> {
|
|
362
|
+
return this.http.post("/data/sync/sync/jobs", body);
|
|
363
|
+
}
|
|
364
|
+
/** Get a single sync job by ID. */
|
|
365
|
+
get(id: string): Promise<Obj> {
|
|
366
|
+
return this.http.get(`/data/sync/sync/jobs/${id}`);
|
|
367
|
+
}
|
|
368
|
+
/** Execute a sync job. */
|
|
369
|
+
execute(id: string, body: Body = {}): Promise<Obj> {
|
|
370
|
+
return this.http.post(`/data/sync/sync/jobs/${id}/executions`, body);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/** Transformation subdomain (`/data/transformations`). */
|
|
375
|
+
export class TransformationsNamespace extends SubdomainBase {
|
|
376
|
+
constructor(http: HttpClient) {
|
|
377
|
+
super(http, "/data/transformations");
|
|
378
|
+
}
|
|
379
|
+
/** List all transformations. */
|
|
380
|
+
async list(opts: ListOpts = {}): Promise<PageResult<Obj>> {
|
|
381
|
+
const raw = await this.http.get(
|
|
382
|
+
"/data/transformations/transformations",
|
|
383
|
+
opts
|
|
384
|
+
);
|
|
385
|
+
return createPageResult(asPagePayload<Obj>(raw), (c) =>
|
|
386
|
+
this.list({ ...opts, cursor: c })
|
|
387
|
+
);
|
|
388
|
+
}
|
|
389
|
+
/** Create a new transformation. */
|
|
390
|
+
create(body: Body): Promise<Obj> {
|
|
391
|
+
return this.http.post("/data/transformations/transformations", body);
|
|
392
|
+
}
|
|
393
|
+
/** Get a single transformation by ID. */
|
|
394
|
+
get(id: string): Promise<Obj> {
|
|
395
|
+
return this.http.get(`/data/transformations/transformations/${id}`);
|
|
396
|
+
}
|
|
397
|
+
/** Execute a transformation. */
|
|
398
|
+
execute(id: string, body: Body = {}): Promise<Obj> {
|
|
399
|
+
return this.http.post(
|
|
400
|
+
`/data/transformations/transformations/${id}/executions`,
|
|
401
|
+
body
|
|
402
|
+
);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/** Federated query subdomain (`/data/query`). */
|
|
407
|
+
export class QueryNamespace extends SubdomainBase {
|
|
408
|
+
constructor(http: HttpClient) {
|
|
409
|
+
super(http, "/data/query");
|
|
410
|
+
}
|
|
411
|
+
/** Execute a federated query across multiple data sources. */
|
|
412
|
+
federated(body: Body): Promise<Obj> {
|
|
413
|
+
return this.http.post("/data/query/query/federated", body);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/** Data schema registry subdomain (`/data/schemas`). */
|
|
418
|
+
export class SchemasNamespace extends SubdomainBase {
|
|
419
|
+
constructor(http: HttpClient) {
|
|
420
|
+
super(http, "/data/schemas");
|
|
421
|
+
}
|
|
422
|
+
/** List all registered schemas. */
|
|
423
|
+
async list(opts: ListOpts = {}): Promise<PageResult<Obj>> {
|
|
424
|
+
const raw = await this.http.get("/data/schemas/schemas", opts);
|
|
425
|
+
return createPageResult(asPagePayload<Obj>(raw), (c) =>
|
|
426
|
+
this.list({ ...opts, cursor: c })
|
|
427
|
+
);
|
|
428
|
+
}
|
|
429
|
+
/** Register a new schema. */
|
|
430
|
+
create(body: Body): Promise<Obj> {
|
|
431
|
+
return this.http.post("/data/schemas/schemas", body);
|
|
432
|
+
}
|
|
433
|
+
/** Resolve a schema reference to its definition. */
|
|
434
|
+
resolve(body: Body): Promise<Obj> {
|
|
435
|
+
return this.http.post("/data/schemas/schemas/resolve", body);
|
|
436
|
+
}
|
|
437
|
+
/** Get a registered schema by reference. */
|
|
438
|
+
get(schemaRef: string): Promise<Obj> {
|
|
439
|
+
return this.http.get(`/data/schemas/schemas/${schemaRef}`);
|
|
440
|
+
}
|
|
441
|
+
}
|