@mdxui/do 3.0.0 → 4.0.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 +80 -275
- package/dist/app/index.d.ts +125 -125
- package/dist/app/index.js +8 -7
- package/dist/breadcrumbs-C9Qn3S7d.d.ts +81 -0
- package/dist/capnweb-client-Bq78FtEA.d.ts +229 -0
- package/dist/chunk-3XKYQRXY.js +192 -0
- package/dist/chunk-3XKYQRXY.js.map +1 -0
- package/dist/{chunk-JWKIONEO.js → chunk-5SHZZC7L.js} +3 -3
- package/dist/{chunk-JWKIONEO.js.map → chunk-5SHZZC7L.js.map} +1 -1
- package/dist/{chunk-YGIBMNRH.js → chunk-7UFINK3Q.js} +30 -27
- package/dist/chunk-7UFINK3Q.js.map +1 -0
- package/dist/{chunk-5AWTQDRF.js → chunk-JJLAES6W.js} +2 -2
- package/dist/{chunk-5AWTQDRF.js.map → chunk-JJLAES6W.js.map} +1 -1
- package/dist/{chunk-NTSEARBC.js → chunk-KT52UU3U.js} +473 -203
- package/dist/chunk-KT52UU3U.js.map +1 -0
- package/dist/{chunk-EQVOEEQO.js → chunk-LJIWB7KE.js} +2 -2
- package/dist/{chunk-EQVOEEQO.js.map → chunk-LJIWB7KE.js.map} +1 -1
- package/dist/{chunk-IESVTECE.js → chunk-NA652ART.js} +64 -4
- package/dist/chunk-NA652ART.js.map +1 -0
- package/dist/chunk-OVLO7UOH.js +1071 -0
- package/dist/chunk-OVLO7UOH.js.map +1 -0
- package/dist/chunk-WMNT4OIE.js +249 -0
- package/dist/chunk-WMNT4OIE.js.map +1 -0
- package/dist/components/index.d.ts +20 -1
- package/dist/components/index.js +2 -1
- package/dist/{config-CmZBQQaT.d.ts → config-CxvpD8Y6.d.ts} +2 -13
- package/dist/{do-C-t9UgjT.d.ts → do-D27i5bU0.d.ts} +2 -1
- package/dist/{errors-B4Oyyj4Z.d.ts → errors-DratdVIz.d.ts} +1 -1
- package/dist/hooks/index.d.ts +30 -3
- package/dist/hooks/index.js +4 -4
- package/dist/hooks/things/index.d.ts +2 -2
- package/dist/hooks/things/index.js +3 -3
- package/dist/index.d.ts +76 -14
- package/dist/index.js +9 -8
- package/dist/lib/index.d.ts +703 -5
- package/dist/lib/index.js +2 -2
- package/dist/providers/index.d.ts +7 -123
- package/dist/providers/index.js +2 -2
- package/dist/{query-keys-BC901wog.d.ts → query-keys-CZNFikIi.d.ts} +3 -3
- package/dist/schemas/index.d.ts +5 -5
- package/dist/{thing-BVhCTzOi.d.ts → thing-BF25aUtJ.d.ts} +68 -68
- package/dist/types/index.d.ts +445 -445
- package/dist/views/index.d.ts +1 -1
- package/dist/views/index.js +6 -6
- package/package.json +2 -2
- package/dist/chunk-FO3N7SXV.js +0 -469
- package/dist/chunk-FO3N7SXV.js.map +0 -1
- package/dist/chunk-IESVTECE.js.map +0 -1
- package/dist/chunk-NTSEARBC.js.map +0 -1
- package/dist/chunk-OWEAW4U6.js +0 -116
- package/dist/chunk-OWEAW4U6.js.map +0 -1
- package/dist/chunk-YGIBMNRH.js.map +0 -1
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export { A as APIError, D as DEFAULT_REQUEST_TIMEOUT, F as FetchWithTimeoutOptions, N as NetworkError, R as RetryConfig, S as SyncError, V as ValidationError,
|
|
2
|
-
export { P as Pagination, Q as QueryKeys, a as agentsKeys, c as createQueryKeys, r as relationshipsKeys, t as thingsKeys, w as workflowsKeys } from '../query-keys-
|
|
1
|
+
export { A as APIError, D as DEFAULT_REQUEST_TIMEOUT, F as FetchWithTimeoutOptions, N as NetworkError, R as RetryConfig, S as SyncError, V as ValidationError, c as camelToTitle, a as capitalize, b as cn, v as createFetchWithTimeout, d as debounce, f as fetchWithTimeout, e as formatBytes, g as formatDate, h as formatDateTime, i as formatDuration, j as formatNumber, k as formatRelativeTime, l as formatSemanticId, m as generateId, n as groupBy, o as isAPIError, p as isNetworkError, q as isSyncError, r as isValidationError, s as parseSemanticId, u as retryWithBackoff, t as truncate } from '../errors-DratdVIz.js';
|
|
2
|
+
export { P as Pagination, Q as QueryKeys, a as agentsKeys, c as createQueryKeys, r as relationshipsKeys, t as thingsKeys, w as workflowsKeys } from '../query-keys-CZNFikIi.js';
|
|
3
|
+
import * as zod from 'zod';
|
|
4
|
+
import { T as Thing, S as SemanticType } from '../thing-BF25aUtJ.js';
|
|
5
|
+
export { $ as $CapnwebContext, c as createCapnwebClient } from '../capnweb-client-Bq78FtEA.js';
|
|
3
6
|
import 'clsx';
|
|
4
|
-
import 'zod';
|
|
5
7
|
import '../schemas/index.js';
|
|
6
|
-
import '../thing-BVhCTzOi.js';
|
|
7
8
|
import '../agents-2_r9e9i7.js';
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -97,4 +98,701 @@ interface HealthCheckResult {
|
|
|
97
98
|
*/
|
|
98
99
|
declare function useHealthCheck(config: HealthCheckConfig): HealthCheckResult;
|
|
99
100
|
|
|
100
|
-
|
|
101
|
+
interface MockClientOptions {
|
|
102
|
+
/** Initial data to populate the store */
|
|
103
|
+
initialData?: Thing[];
|
|
104
|
+
/** Simulated network delay in ms (default: 100) */
|
|
105
|
+
delay?: number;
|
|
106
|
+
/** Whether to log operations (default: false) */
|
|
107
|
+
verbose?: boolean;
|
|
108
|
+
}
|
|
109
|
+
interface MockStore {
|
|
110
|
+
things: Map<string, Thing>;
|
|
111
|
+
deletedThings: Set<string>;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Create a mock client that matches the DOClient interface
|
|
115
|
+
*/
|
|
116
|
+
declare function createMockClient(options?: MockClientOptions): {
|
|
117
|
+
/**
|
|
118
|
+
* Namespace operations
|
|
119
|
+
*/
|
|
120
|
+
Namespace: {
|
|
121
|
+
list(_params?: {
|
|
122
|
+
includeSystem?: boolean;
|
|
123
|
+
}): Promise<{
|
|
124
|
+
id: string;
|
|
125
|
+
name: string;
|
|
126
|
+
}[]>;
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* Schema operations
|
|
130
|
+
*/
|
|
131
|
+
Schema: {
|
|
132
|
+
discover(_params?: {
|
|
133
|
+
ns?: string;
|
|
134
|
+
}): Promise<{
|
|
135
|
+
namespaces: string[];
|
|
136
|
+
types: string[];
|
|
137
|
+
schemas: string[];
|
|
138
|
+
}>;
|
|
139
|
+
get(params: {
|
|
140
|
+
ns?: string;
|
|
141
|
+
type: string;
|
|
142
|
+
}): Promise<{
|
|
143
|
+
label: string;
|
|
144
|
+
id: string;
|
|
145
|
+
name: string;
|
|
146
|
+
namespace: string;
|
|
147
|
+
properties: {
|
|
148
|
+
label: string;
|
|
149
|
+
name: string;
|
|
150
|
+
description: string;
|
|
151
|
+
required: boolean;
|
|
152
|
+
rangeIncludes: string[];
|
|
153
|
+
domainIncludes: string[];
|
|
154
|
+
isArray: boolean;
|
|
155
|
+
defaultValue?: unknown;
|
|
156
|
+
}[];
|
|
157
|
+
parentTypes: string[];
|
|
158
|
+
subtypes: string[];
|
|
159
|
+
description?: string | undefined;
|
|
160
|
+
examples?: zod.objectOutputType<{
|
|
161
|
+
'@context': zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodRecord<zod.ZodString, zod.ZodUnknown>]>>;
|
|
162
|
+
'@type': zod.ZodOptional<zod.ZodString>;
|
|
163
|
+
'@id': zod.ZodOptional<zod.ZodString>;
|
|
164
|
+
}, zod.ZodTypeAny, "passthrough">[] | undefined;
|
|
165
|
+
}>;
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* Thing operations
|
|
169
|
+
*/
|
|
170
|
+
Thing: {
|
|
171
|
+
types(params: {
|
|
172
|
+
ns?: string;
|
|
173
|
+
includeSystem?: boolean;
|
|
174
|
+
}): Promise<{
|
|
175
|
+
name: string;
|
|
176
|
+
ns: string;
|
|
177
|
+
}[]>;
|
|
178
|
+
list(params: {
|
|
179
|
+
ns?: string;
|
|
180
|
+
type?: string;
|
|
181
|
+
limit?: number;
|
|
182
|
+
offset?: number;
|
|
183
|
+
}): Promise<{
|
|
184
|
+
data: {
|
|
185
|
+
data: {
|
|
186
|
+
'@context'?: string | Record<string, unknown> | undefined;
|
|
187
|
+
'@type'?: string | undefined;
|
|
188
|
+
'@id'?: string | undefined;
|
|
189
|
+
} & {
|
|
190
|
+
[k: string]: unknown;
|
|
191
|
+
};
|
|
192
|
+
id: string;
|
|
193
|
+
type: string;
|
|
194
|
+
name: string;
|
|
195
|
+
ns: string;
|
|
196
|
+
ts: Date;
|
|
197
|
+
createdAt: Date;
|
|
198
|
+
updatedAt: Date;
|
|
199
|
+
variant?: string | undefined;
|
|
200
|
+
createdBy?: string | undefined;
|
|
201
|
+
updatedBy?: string | undefined;
|
|
202
|
+
deletedAt?: Date | null | undefined;
|
|
203
|
+
}[];
|
|
204
|
+
total: number;
|
|
205
|
+
}>;
|
|
206
|
+
get(params: {
|
|
207
|
+
ns?: string;
|
|
208
|
+
type: string;
|
|
209
|
+
id: string;
|
|
210
|
+
}): Promise<{
|
|
211
|
+
data: {
|
|
212
|
+
'@context'?: string | Record<string, unknown> | undefined;
|
|
213
|
+
'@type'?: string | undefined;
|
|
214
|
+
'@id'?: string | undefined;
|
|
215
|
+
} & {
|
|
216
|
+
[k: string]: unknown;
|
|
217
|
+
};
|
|
218
|
+
id: string;
|
|
219
|
+
type: string;
|
|
220
|
+
name: string;
|
|
221
|
+
ns: string;
|
|
222
|
+
ts: Date;
|
|
223
|
+
createdAt: Date;
|
|
224
|
+
updatedAt: Date;
|
|
225
|
+
variant?: string | undefined;
|
|
226
|
+
createdBy?: string | undefined;
|
|
227
|
+
updatedBy?: string | undefined;
|
|
228
|
+
deletedAt?: Date | null | undefined;
|
|
229
|
+
} | null>;
|
|
230
|
+
create(params: {
|
|
231
|
+
ns?: string;
|
|
232
|
+
type: string;
|
|
233
|
+
name?: string;
|
|
234
|
+
data: unknown;
|
|
235
|
+
}): Promise<{
|
|
236
|
+
data: {
|
|
237
|
+
'@context'?: string | Record<string, unknown> | undefined;
|
|
238
|
+
'@type'?: string | undefined;
|
|
239
|
+
'@id'?: string | undefined;
|
|
240
|
+
} & {
|
|
241
|
+
[k: string]: unknown;
|
|
242
|
+
};
|
|
243
|
+
id: string;
|
|
244
|
+
type: string;
|
|
245
|
+
name: string;
|
|
246
|
+
ns: string;
|
|
247
|
+
ts: Date;
|
|
248
|
+
createdAt: Date;
|
|
249
|
+
updatedAt: Date;
|
|
250
|
+
variant?: string | undefined;
|
|
251
|
+
createdBy?: string | undefined;
|
|
252
|
+
updatedBy?: string | undefined;
|
|
253
|
+
deletedAt?: Date | null | undefined;
|
|
254
|
+
}>;
|
|
255
|
+
update(params: {
|
|
256
|
+
ns?: string;
|
|
257
|
+
type: string;
|
|
258
|
+
id: string;
|
|
259
|
+
data: unknown;
|
|
260
|
+
}): Promise<{
|
|
261
|
+
data: {
|
|
262
|
+
'@context'?: string | Record<string, unknown> | undefined;
|
|
263
|
+
'@type'?: string | undefined;
|
|
264
|
+
'@id'?: string | undefined;
|
|
265
|
+
} & {
|
|
266
|
+
[k: string]: unknown;
|
|
267
|
+
};
|
|
268
|
+
id: string;
|
|
269
|
+
type: string;
|
|
270
|
+
name: string;
|
|
271
|
+
ns: string;
|
|
272
|
+
ts: Date;
|
|
273
|
+
createdAt: Date;
|
|
274
|
+
updatedAt: Date;
|
|
275
|
+
variant?: string | undefined;
|
|
276
|
+
createdBy?: string | undefined;
|
|
277
|
+
updatedBy?: string | undefined;
|
|
278
|
+
deletedAt?: Date | null | undefined;
|
|
279
|
+
}>;
|
|
280
|
+
delete(params: {
|
|
281
|
+
ns?: string;
|
|
282
|
+
type: string;
|
|
283
|
+
id: string;
|
|
284
|
+
hard?: boolean;
|
|
285
|
+
}): Promise<{
|
|
286
|
+
success: boolean;
|
|
287
|
+
}>;
|
|
288
|
+
versions(_params: {
|
|
289
|
+
ns?: string;
|
|
290
|
+
type: string;
|
|
291
|
+
id: string;
|
|
292
|
+
}): Promise<never[]>;
|
|
293
|
+
stats(_params: {
|
|
294
|
+
ns?: string;
|
|
295
|
+
type?: string;
|
|
296
|
+
}): Promise<{
|
|
297
|
+
total: number;
|
|
298
|
+
byType: Record<string, number>;
|
|
299
|
+
}>;
|
|
300
|
+
};
|
|
301
|
+
/**
|
|
302
|
+
* SQL operations (mock implementation)
|
|
303
|
+
*/
|
|
304
|
+
SQL: {
|
|
305
|
+
execute(params: {
|
|
306
|
+
query: string;
|
|
307
|
+
params?: unknown[];
|
|
308
|
+
}): Promise<{
|
|
309
|
+
rows: {
|
|
310
|
+
id: string;
|
|
311
|
+
ns: string;
|
|
312
|
+
type: string;
|
|
313
|
+
name: string;
|
|
314
|
+
createdAt: Date;
|
|
315
|
+
updatedAt: Date;
|
|
316
|
+
data: string;
|
|
317
|
+
}[];
|
|
318
|
+
columns: {
|
|
319
|
+
name: string;
|
|
320
|
+
type: string;
|
|
321
|
+
}[];
|
|
322
|
+
rowsAffected: number;
|
|
323
|
+
executionTimeMs: number;
|
|
324
|
+
}>;
|
|
325
|
+
};
|
|
326
|
+
dup: () => /*elided*/ any;
|
|
327
|
+
onRpcBroken: (_callback: (error: unknown) => void) => void;
|
|
328
|
+
[Symbol.dispose]: () => void;
|
|
329
|
+
_store: MockStore;
|
|
330
|
+
_reset: () => void;
|
|
331
|
+
};
|
|
332
|
+
/**
|
|
333
|
+
* Create a mock client context - factory function matching DOClient interface
|
|
334
|
+
*/
|
|
335
|
+
declare function $MockContext(options?: MockClientOptions): {
|
|
336
|
+
/**
|
|
337
|
+
* Namespace operations
|
|
338
|
+
*/
|
|
339
|
+
Namespace: {
|
|
340
|
+
list(_params?: {
|
|
341
|
+
includeSystem?: boolean;
|
|
342
|
+
}): Promise<{
|
|
343
|
+
id: string;
|
|
344
|
+
name: string;
|
|
345
|
+
}[]>;
|
|
346
|
+
};
|
|
347
|
+
/**
|
|
348
|
+
* Schema operations
|
|
349
|
+
*/
|
|
350
|
+
Schema: {
|
|
351
|
+
discover(_params?: {
|
|
352
|
+
ns?: string;
|
|
353
|
+
}): Promise<{
|
|
354
|
+
namespaces: string[];
|
|
355
|
+
types: string[];
|
|
356
|
+
schemas: string[];
|
|
357
|
+
}>;
|
|
358
|
+
get(params: {
|
|
359
|
+
ns?: string;
|
|
360
|
+
type: string;
|
|
361
|
+
}): Promise<{
|
|
362
|
+
label: string;
|
|
363
|
+
id: string;
|
|
364
|
+
name: string;
|
|
365
|
+
namespace: string;
|
|
366
|
+
properties: {
|
|
367
|
+
label: string;
|
|
368
|
+
name: string;
|
|
369
|
+
description: string;
|
|
370
|
+
required: boolean;
|
|
371
|
+
rangeIncludes: string[];
|
|
372
|
+
domainIncludes: string[];
|
|
373
|
+
isArray: boolean;
|
|
374
|
+
defaultValue?: unknown;
|
|
375
|
+
}[];
|
|
376
|
+
parentTypes: string[];
|
|
377
|
+
subtypes: string[];
|
|
378
|
+
description?: string | undefined;
|
|
379
|
+
examples?: zod.objectOutputType<{
|
|
380
|
+
'@context': zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodRecord<zod.ZodString, zod.ZodUnknown>]>>;
|
|
381
|
+
'@type': zod.ZodOptional<zod.ZodString>;
|
|
382
|
+
'@id': zod.ZodOptional<zod.ZodString>;
|
|
383
|
+
}, zod.ZodTypeAny, "passthrough">[] | undefined;
|
|
384
|
+
}>;
|
|
385
|
+
};
|
|
386
|
+
/**
|
|
387
|
+
* Thing operations
|
|
388
|
+
*/
|
|
389
|
+
Thing: {
|
|
390
|
+
types(params: {
|
|
391
|
+
ns?: string;
|
|
392
|
+
includeSystem?: boolean;
|
|
393
|
+
}): Promise<{
|
|
394
|
+
name: string;
|
|
395
|
+
ns: string;
|
|
396
|
+
}[]>;
|
|
397
|
+
list(params: {
|
|
398
|
+
ns?: string;
|
|
399
|
+
type?: string;
|
|
400
|
+
limit?: number;
|
|
401
|
+
offset?: number;
|
|
402
|
+
}): Promise<{
|
|
403
|
+
data: {
|
|
404
|
+
data: {
|
|
405
|
+
'@context'?: string | Record<string, unknown> | undefined;
|
|
406
|
+
'@type'?: string | undefined;
|
|
407
|
+
'@id'?: string | undefined;
|
|
408
|
+
} & {
|
|
409
|
+
[k: string]: unknown;
|
|
410
|
+
};
|
|
411
|
+
id: string;
|
|
412
|
+
type: string;
|
|
413
|
+
name: string;
|
|
414
|
+
ns: string;
|
|
415
|
+
ts: Date;
|
|
416
|
+
createdAt: Date;
|
|
417
|
+
updatedAt: Date;
|
|
418
|
+
variant?: string | undefined;
|
|
419
|
+
createdBy?: string | undefined;
|
|
420
|
+
updatedBy?: string | undefined;
|
|
421
|
+
deletedAt?: Date | null | undefined;
|
|
422
|
+
}[];
|
|
423
|
+
total: number;
|
|
424
|
+
}>;
|
|
425
|
+
get(params: {
|
|
426
|
+
ns?: string;
|
|
427
|
+
type: string;
|
|
428
|
+
id: string;
|
|
429
|
+
}): Promise<{
|
|
430
|
+
data: {
|
|
431
|
+
'@context'?: string | Record<string, unknown> | undefined;
|
|
432
|
+
'@type'?: string | undefined;
|
|
433
|
+
'@id'?: string | undefined;
|
|
434
|
+
} & {
|
|
435
|
+
[k: string]: unknown;
|
|
436
|
+
};
|
|
437
|
+
id: string;
|
|
438
|
+
type: string;
|
|
439
|
+
name: string;
|
|
440
|
+
ns: string;
|
|
441
|
+
ts: Date;
|
|
442
|
+
createdAt: Date;
|
|
443
|
+
updatedAt: Date;
|
|
444
|
+
variant?: string | undefined;
|
|
445
|
+
createdBy?: string | undefined;
|
|
446
|
+
updatedBy?: string | undefined;
|
|
447
|
+
deletedAt?: Date | null | undefined;
|
|
448
|
+
} | null>;
|
|
449
|
+
create(params: {
|
|
450
|
+
ns?: string;
|
|
451
|
+
type: string;
|
|
452
|
+
name?: string;
|
|
453
|
+
data: unknown;
|
|
454
|
+
}): Promise<{
|
|
455
|
+
data: {
|
|
456
|
+
'@context'?: string | Record<string, unknown> | undefined;
|
|
457
|
+
'@type'?: string | undefined;
|
|
458
|
+
'@id'?: string | undefined;
|
|
459
|
+
} & {
|
|
460
|
+
[k: string]: unknown;
|
|
461
|
+
};
|
|
462
|
+
id: string;
|
|
463
|
+
type: string;
|
|
464
|
+
name: string;
|
|
465
|
+
ns: string;
|
|
466
|
+
ts: Date;
|
|
467
|
+
createdAt: Date;
|
|
468
|
+
updatedAt: Date;
|
|
469
|
+
variant?: string | undefined;
|
|
470
|
+
createdBy?: string | undefined;
|
|
471
|
+
updatedBy?: string | undefined;
|
|
472
|
+
deletedAt?: Date | null | undefined;
|
|
473
|
+
}>;
|
|
474
|
+
update(params: {
|
|
475
|
+
ns?: string;
|
|
476
|
+
type: string;
|
|
477
|
+
id: string;
|
|
478
|
+
data: unknown;
|
|
479
|
+
}): Promise<{
|
|
480
|
+
data: {
|
|
481
|
+
'@context'?: string | Record<string, unknown> | undefined;
|
|
482
|
+
'@type'?: string | undefined;
|
|
483
|
+
'@id'?: string | undefined;
|
|
484
|
+
} & {
|
|
485
|
+
[k: string]: unknown;
|
|
486
|
+
};
|
|
487
|
+
id: string;
|
|
488
|
+
type: string;
|
|
489
|
+
name: string;
|
|
490
|
+
ns: string;
|
|
491
|
+
ts: Date;
|
|
492
|
+
createdAt: Date;
|
|
493
|
+
updatedAt: Date;
|
|
494
|
+
variant?: string | undefined;
|
|
495
|
+
createdBy?: string | undefined;
|
|
496
|
+
updatedBy?: string | undefined;
|
|
497
|
+
deletedAt?: Date | null | undefined;
|
|
498
|
+
}>;
|
|
499
|
+
delete(params: {
|
|
500
|
+
ns?: string;
|
|
501
|
+
type: string;
|
|
502
|
+
id: string;
|
|
503
|
+
hard?: boolean;
|
|
504
|
+
}): Promise<{
|
|
505
|
+
success: boolean;
|
|
506
|
+
}>;
|
|
507
|
+
versions(_params: {
|
|
508
|
+
ns?: string;
|
|
509
|
+
type: string;
|
|
510
|
+
id: string;
|
|
511
|
+
}): Promise<never[]>;
|
|
512
|
+
stats(_params: {
|
|
513
|
+
ns?: string;
|
|
514
|
+
type?: string;
|
|
515
|
+
}): Promise<{
|
|
516
|
+
total: number;
|
|
517
|
+
byType: Record<string, number>;
|
|
518
|
+
}>;
|
|
519
|
+
};
|
|
520
|
+
/**
|
|
521
|
+
* SQL operations (mock implementation)
|
|
522
|
+
*/
|
|
523
|
+
SQL: {
|
|
524
|
+
execute(params: {
|
|
525
|
+
query: string;
|
|
526
|
+
params?: unknown[];
|
|
527
|
+
}): Promise<{
|
|
528
|
+
rows: {
|
|
529
|
+
id: string;
|
|
530
|
+
ns: string;
|
|
531
|
+
type: string;
|
|
532
|
+
name: string;
|
|
533
|
+
createdAt: Date;
|
|
534
|
+
updatedAt: Date;
|
|
535
|
+
data: string;
|
|
536
|
+
}[];
|
|
537
|
+
columns: {
|
|
538
|
+
name: string;
|
|
539
|
+
type: string;
|
|
540
|
+
}[];
|
|
541
|
+
rowsAffected: number;
|
|
542
|
+
executionTimeMs: number;
|
|
543
|
+
}>;
|
|
544
|
+
};
|
|
545
|
+
dup: () => /*elided*/ any;
|
|
546
|
+
onRpcBroken: (_callback: (error: unknown) => void) => void;
|
|
547
|
+
[Symbol.dispose]: () => void;
|
|
548
|
+
_store: MockStore;
|
|
549
|
+
_reset: () => void;
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* JSON-RPC Client for DO Admin API
|
|
554
|
+
*
|
|
555
|
+
* This client wraps the JSON-RPC API exposed by DO admin servers,
|
|
556
|
+
* translating the standard Thing/Schema interface to the server's
|
|
557
|
+
* actual RPC methods.
|
|
558
|
+
*
|
|
559
|
+
* Auto-discovers available types and endpoints from the server.
|
|
560
|
+
*
|
|
561
|
+
* @module
|
|
562
|
+
*/
|
|
563
|
+
/** SQL execution result */
|
|
564
|
+
interface SQLResult {
|
|
565
|
+
rows: Record<string, unknown>[];
|
|
566
|
+
columns: {
|
|
567
|
+
name: string;
|
|
568
|
+
type: string;
|
|
569
|
+
}[];
|
|
570
|
+
rowsAffected?: number;
|
|
571
|
+
executionTimeMs?: number;
|
|
572
|
+
}
|
|
573
|
+
interface JsonRpcClientOptions {
|
|
574
|
+
/** Auth token to include in Authorization header */
|
|
575
|
+
authToken?: string;
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Create a JSON-RPC compatible client that matches the DOClient interface
|
|
579
|
+
*/
|
|
580
|
+
declare function createJsonRpcClient(baseUrl: string, options?: JsonRpcClientOptions): {
|
|
581
|
+
/**
|
|
582
|
+
* Namespace operations
|
|
583
|
+
*/
|
|
584
|
+
Namespace: {
|
|
585
|
+
list(_params?: {
|
|
586
|
+
includeSystem?: boolean;
|
|
587
|
+
}): Promise<{
|
|
588
|
+
id: string;
|
|
589
|
+
name: string;
|
|
590
|
+
}[]>;
|
|
591
|
+
};
|
|
592
|
+
/**
|
|
593
|
+
* Schema operations
|
|
594
|
+
*/
|
|
595
|
+
Schema: {
|
|
596
|
+
discover(_params?: {
|
|
597
|
+
ns?: string;
|
|
598
|
+
}): Promise<{
|
|
599
|
+
namespaces: string[];
|
|
600
|
+
types: string[];
|
|
601
|
+
schemas: string[];
|
|
602
|
+
}>;
|
|
603
|
+
get(params: {
|
|
604
|
+
ns?: string;
|
|
605
|
+
type: string;
|
|
606
|
+
}): Promise<unknown>;
|
|
607
|
+
};
|
|
608
|
+
/**
|
|
609
|
+
* Thing operations (maps to REST endpoints)
|
|
610
|
+
*/
|
|
611
|
+
Thing: {
|
|
612
|
+
types(params: {
|
|
613
|
+
ns?: string;
|
|
614
|
+
includeSystem?: boolean;
|
|
615
|
+
}): Promise<{
|
|
616
|
+
name: string;
|
|
617
|
+
ns: string;
|
|
618
|
+
}[]>;
|
|
619
|
+
list(params: {
|
|
620
|
+
ns?: string;
|
|
621
|
+
type?: string;
|
|
622
|
+
limit?: number;
|
|
623
|
+
offset?: number;
|
|
624
|
+
}): Promise<{
|
|
625
|
+
data: unknown[];
|
|
626
|
+
total: number;
|
|
627
|
+
}>;
|
|
628
|
+
get(params: {
|
|
629
|
+
ns?: string;
|
|
630
|
+
type: string;
|
|
631
|
+
id: string;
|
|
632
|
+
}): Promise<unknown>;
|
|
633
|
+
create(params: {
|
|
634
|
+
ns?: string;
|
|
635
|
+
type: string;
|
|
636
|
+
data: unknown;
|
|
637
|
+
}): Promise<unknown>;
|
|
638
|
+
update(params: {
|
|
639
|
+
ns?: string;
|
|
640
|
+
type: string;
|
|
641
|
+
id: string;
|
|
642
|
+
data: unknown;
|
|
643
|
+
}): Promise<unknown>;
|
|
644
|
+
delete(params: {
|
|
645
|
+
ns?: string;
|
|
646
|
+
type: string;
|
|
647
|
+
id: string;
|
|
648
|
+
hard?: boolean;
|
|
649
|
+
}): Promise<{
|
|
650
|
+
success: boolean;
|
|
651
|
+
}>;
|
|
652
|
+
versions(_params: {
|
|
653
|
+
ns?: string;
|
|
654
|
+
type: string;
|
|
655
|
+
id: string;
|
|
656
|
+
}): Promise<never[]>;
|
|
657
|
+
stats(_params: {
|
|
658
|
+
ns?: string;
|
|
659
|
+
type?: string;
|
|
660
|
+
}): Promise<{
|
|
661
|
+
total: number;
|
|
662
|
+
byType: Record<string, number>;
|
|
663
|
+
}>;
|
|
664
|
+
};
|
|
665
|
+
/**
|
|
666
|
+
* SQL operations
|
|
667
|
+
*/
|
|
668
|
+
SQL: {
|
|
669
|
+
execute(params: {
|
|
670
|
+
query: string;
|
|
671
|
+
params?: unknown[];
|
|
672
|
+
}): Promise<SQLResult>;
|
|
673
|
+
};
|
|
674
|
+
dup: () => /*elided*/ any;
|
|
675
|
+
onRpcBroken: (_callback: (error: unknown) => void) => void;
|
|
676
|
+
[Symbol.dispose]: () => void;
|
|
677
|
+
};
|
|
678
|
+
/**
|
|
679
|
+
* Create a client context - factory function matching $Context interface
|
|
680
|
+
*/
|
|
681
|
+
declare function $JsonRpcContext(url: string, options?: JsonRpcClientOptions): {
|
|
682
|
+
/**
|
|
683
|
+
* Namespace operations
|
|
684
|
+
*/
|
|
685
|
+
Namespace: {
|
|
686
|
+
list(_params?: {
|
|
687
|
+
includeSystem?: boolean;
|
|
688
|
+
}): Promise<{
|
|
689
|
+
id: string;
|
|
690
|
+
name: string;
|
|
691
|
+
}[]>;
|
|
692
|
+
};
|
|
693
|
+
/**
|
|
694
|
+
* Schema operations
|
|
695
|
+
*/
|
|
696
|
+
Schema: {
|
|
697
|
+
discover(_params?: {
|
|
698
|
+
ns?: string;
|
|
699
|
+
}): Promise<{
|
|
700
|
+
namespaces: string[];
|
|
701
|
+
types: string[];
|
|
702
|
+
schemas: string[];
|
|
703
|
+
}>;
|
|
704
|
+
get(params: {
|
|
705
|
+
ns?: string;
|
|
706
|
+
type: string;
|
|
707
|
+
}): Promise<unknown>;
|
|
708
|
+
};
|
|
709
|
+
/**
|
|
710
|
+
* Thing operations (maps to REST endpoints)
|
|
711
|
+
*/
|
|
712
|
+
Thing: {
|
|
713
|
+
types(params: {
|
|
714
|
+
ns?: string;
|
|
715
|
+
includeSystem?: boolean;
|
|
716
|
+
}): Promise<{
|
|
717
|
+
name: string;
|
|
718
|
+
ns: string;
|
|
719
|
+
}[]>;
|
|
720
|
+
list(params: {
|
|
721
|
+
ns?: string;
|
|
722
|
+
type?: string;
|
|
723
|
+
limit?: number;
|
|
724
|
+
offset?: number;
|
|
725
|
+
}): Promise<{
|
|
726
|
+
data: unknown[];
|
|
727
|
+
total: number;
|
|
728
|
+
}>;
|
|
729
|
+
get(params: {
|
|
730
|
+
ns?: string;
|
|
731
|
+
type: string;
|
|
732
|
+
id: string;
|
|
733
|
+
}): Promise<unknown>;
|
|
734
|
+
create(params: {
|
|
735
|
+
ns?: string;
|
|
736
|
+
type: string;
|
|
737
|
+
data: unknown;
|
|
738
|
+
}): Promise<unknown>;
|
|
739
|
+
update(params: {
|
|
740
|
+
ns?: string;
|
|
741
|
+
type: string;
|
|
742
|
+
id: string;
|
|
743
|
+
data: unknown;
|
|
744
|
+
}): Promise<unknown>;
|
|
745
|
+
delete(params: {
|
|
746
|
+
ns?: string;
|
|
747
|
+
type: string;
|
|
748
|
+
id: string;
|
|
749
|
+
hard?: boolean;
|
|
750
|
+
}): Promise<{
|
|
751
|
+
success: boolean;
|
|
752
|
+
}>;
|
|
753
|
+
versions(_params: {
|
|
754
|
+
ns?: string;
|
|
755
|
+
type: string;
|
|
756
|
+
id: string;
|
|
757
|
+
}): Promise<never[]>;
|
|
758
|
+
stats(_params: {
|
|
759
|
+
ns?: string;
|
|
760
|
+
type?: string;
|
|
761
|
+
}): Promise<{
|
|
762
|
+
total: number;
|
|
763
|
+
byType: Record<string, number>;
|
|
764
|
+
}>;
|
|
765
|
+
};
|
|
766
|
+
/**
|
|
767
|
+
* SQL operations
|
|
768
|
+
*/
|
|
769
|
+
SQL: {
|
|
770
|
+
execute(params: {
|
|
771
|
+
query: string;
|
|
772
|
+
params?: unknown[];
|
|
773
|
+
}): Promise<SQLResult>;
|
|
774
|
+
};
|
|
775
|
+
dup: () => /*elided*/ any;
|
|
776
|
+
onRpcBroken: (_callback: (error: unknown) => void) => void;
|
|
777
|
+
[Symbol.dispose]: () => void;
|
|
778
|
+
};
|
|
779
|
+
|
|
780
|
+
/**
|
|
781
|
+
* Mock Data Generators for DO Admin
|
|
782
|
+
*
|
|
783
|
+
* Generates realistic mock data for Things, Schemas, and other entities.
|
|
784
|
+
* Used by the mock client for demo/development mode.
|
|
785
|
+
*
|
|
786
|
+
* @module
|
|
787
|
+
*/
|
|
788
|
+
|
|
789
|
+
declare const MOCK_TYPES: string[];
|
|
790
|
+
declare function generateMockSchema(typeName: string): SemanticType;
|
|
791
|
+
declare function generateMockThing(type: string, id?: string): Thing;
|
|
792
|
+
declare function generateMockThings(type: string, count: number): Thing[];
|
|
793
|
+
/**
|
|
794
|
+
* Generate initial mock data set with various types
|
|
795
|
+
*/
|
|
796
|
+
declare function generateInitialMockData(): Thing[];
|
|
797
|
+
|
|
798
|
+
export { $JsonRpcContext, $MockContext, type HealthCheckConfig, type HealthCheckResult, MOCK_TYPES, createJsonRpcClient, createMockClient, deriveRpcUrl, generateInitialMockData, generateMockSchema, generateMockThing, generateMockThings, useHealthCheck };
|