@digo-labs/backend 0.1.8 → 0.2.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/dist/index.d.cts +438 -2
- package/package.json +4 -3
package/dist/index.d.cts
CHANGED
|
@@ -237,7 +237,10 @@ declare const bedrockRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, hono_t
|
|
|
237
237
|
temperature?: number | undefined;
|
|
238
238
|
maxTokens?: number | undefined;
|
|
239
239
|
stopSequences?: string[] | undefined;
|
|
240
|
-
|
|
240
|
+
guardrail?: {
|
|
241
|
+
id: string;
|
|
242
|
+
version: string;
|
|
243
|
+
} | undefined;
|
|
241
244
|
};
|
|
242
245
|
};
|
|
243
246
|
output: {};
|
|
@@ -247,10 +250,443 @@ declare const bedrockRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, hono_t
|
|
|
247
250
|
};
|
|
248
251
|
}, "/ai">, "/", "/">;
|
|
249
252
|
|
|
253
|
+
declare const devicesRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
|
|
254
|
+
"devices-create": {
|
|
255
|
+
$post: {
|
|
256
|
+
input: {
|
|
257
|
+
json: {
|
|
258
|
+
name: string;
|
|
259
|
+
tier?: "user" | "org" | undefined;
|
|
260
|
+
expiresInDays?: number | undefined;
|
|
261
|
+
};
|
|
262
|
+
};
|
|
263
|
+
output: {
|
|
264
|
+
device: {
|
|
265
|
+
id: string;
|
|
266
|
+
app: string;
|
|
267
|
+
name: string;
|
|
268
|
+
tier: "user" | "org";
|
|
269
|
+
createdBy: string;
|
|
270
|
+
createdAt: string;
|
|
271
|
+
lastSeenAt: string | null;
|
|
272
|
+
expiresAt: string;
|
|
273
|
+
revokedAt: string | null;
|
|
274
|
+
};
|
|
275
|
+
key: string;
|
|
276
|
+
};
|
|
277
|
+
outputFormat: "json";
|
|
278
|
+
status: hono_utils_http_status.ContentfulStatusCode;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
} & {
|
|
282
|
+
"devices-list": {
|
|
283
|
+
$post: {
|
|
284
|
+
input: {
|
|
285
|
+
json: Record<string, never>;
|
|
286
|
+
};
|
|
287
|
+
output: {
|
|
288
|
+
devices: {
|
|
289
|
+
id: string;
|
|
290
|
+
app: string;
|
|
291
|
+
name: string;
|
|
292
|
+
tier: "user" | "org";
|
|
293
|
+
createdBy: string;
|
|
294
|
+
createdAt: string;
|
|
295
|
+
lastSeenAt: string | null;
|
|
296
|
+
expiresAt: string;
|
|
297
|
+
revokedAt: string | null;
|
|
298
|
+
}[];
|
|
299
|
+
};
|
|
300
|
+
outputFormat: "json";
|
|
301
|
+
status: hono_utils_http_status.ContentfulStatusCode;
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
} & {
|
|
305
|
+
"devices-revoke": {
|
|
306
|
+
$post: {
|
|
307
|
+
input: {
|
|
308
|
+
json: {
|
|
309
|
+
id: string;
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
output: {
|
|
313
|
+
success: boolean;
|
|
314
|
+
};
|
|
315
|
+
outputFormat: "json";
|
|
316
|
+
status: hono_utils_http_status.ContentfulStatusCode;
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
} & {
|
|
320
|
+
"devices-me": {
|
|
321
|
+
$post: {
|
|
322
|
+
input: {
|
|
323
|
+
json: Record<string, never>;
|
|
324
|
+
};
|
|
325
|
+
output: {
|
|
326
|
+
device: {
|
|
327
|
+
id: string;
|
|
328
|
+
app: string;
|
|
329
|
+
name: string;
|
|
330
|
+
tier: "user" | "org";
|
|
331
|
+
createdBy: string;
|
|
332
|
+
createdAt: string;
|
|
333
|
+
lastSeenAt: string | null;
|
|
334
|
+
expiresAt: string;
|
|
335
|
+
revokedAt: string | null;
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
outputFormat: "json";
|
|
339
|
+
status: hono_utils_http_status.ContentfulStatusCode;
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
}, "/", "devices-me">;
|
|
343
|
+
|
|
344
|
+
declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
|
|
345
|
+
"jobs-get": {
|
|
346
|
+
$post: {
|
|
347
|
+
input: {
|
|
348
|
+
json: {
|
|
349
|
+
id: string;
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
output: {
|
|
353
|
+
job: {
|
|
354
|
+
id: string;
|
|
355
|
+
key: string;
|
|
356
|
+
status: "checking" | "running" | "done" | "rejected" | "failed" | "cancelled";
|
|
357
|
+
verdict: "reject" | "review" | "pass" | null;
|
|
358
|
+
checks: {
|
|
359
|
+
type: "rekognition" | "bedrock";
|
|
360
|
+
target: string;
|
|
361
|
+
verdict: "reject" | "review" | "pass";
|
|
362
|
+
labels: string[];
|
|
363
|
+
reason: string | null;
|
|
364
|
+
}[];
|
|
365
|
+
tasks: {
|
|
366
|
+
key: string;
|
|
367
|
+
endpoint: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fake:echo";
|
|
368
|
+
status: "done" | "rejected" | "failed" | "cancelled" | "pending" | "submitted" | "saving";
|
|
369
|
+
attempt: number;
|
|
370
|
+
outputPath: string;
|
|
371
|
+
verdict: "reject" | "review" | "pass" | null;
|
|
372
|
+
checks: {
|
|
373
|
+
type: "rekognition" | "bedrock";
|
|
374
|
+
target: string;
|
|
375
|
+
verdict: "reject" | "review" | "pass";
|
|
376
|
+
labels: string[];
|
|
377
|
+
reason: string | null;
|
|
378
|
+
}[];
|
|
379
|
+
error: string | null;
|
|
380
|
+
estimatedUsd: number;
|
|
381
|
+
}[];
|
|
382
|
+
createdAt: string;
|
|
383
|
+
updatedAt: string;
|
|
384
|
+
};
|
|
385
|
+
};
|
|
386
|
+
outputFormat: "json";
|
|
387
|
+
status: hono_utils_http_status.ContentfulStatusCode;
|
|
388
|
+
};
|
|
389
|
+
};
|
|
390
|
+
} | (hono_types.MergeSchemaPath<{
|
|
391
|
+
"jobs-create": {
|
|
392
|
+
$post: {
|
|
393
|
+
input: {
|
|
394
|
+
json: {
|
|
395
|
+
key: string;
|
|
396
|
+
tasks: {
|
|
397
|
+
key: string;
|
|
398
|
+
endpoint: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fake:echo";
|
|
399
|
+
input: Record<string, unknown>;
|
|
400
|
+
output: {
|
|
401
|
+
path: string;
|
|
402
|
+
};
|
|
403
|
+
priority?: number | undefined;
|
|
404
|
+
}[];
|
|
405
|
+
inputs?: Record<string, string> | undefined;
|
|
406
|
+
checks?: ({
|
|
407
|
+
type: "rekognition";
|
|
408
|
+
input?: string | undefined;
|
|
409
|
+
reject?: string[] | undefined;
|
|
410
|
+
review?: string[] | undefined;
|
|
411
|
+
minConfidence?: number | undefined;
|
|
412
|
+
} | {
|
|
413
|
+
type: "bedrock";
|
|
414
|
+
prompt: string;
|
|
415
|
+
input?: string | undefined;
|
|
416
|
+
guardrail?: {
|
|
417
|
+
id: string;
|
|
418
|
+
version: string;
|
|
419
|
+
} | undefined;
|
|
420
|
+
model?: string | undefined;
|
|
421
|
+
})[] | undefined;
|
|
422
|
+
onReview?: "reject" | "continue" | undefined;
|
|
423
|
+
outputChecks?: ({
|
|
424
|
+
type: "rekognition";
|
|
425
|
+
input?: string | undefined;
|
|
426
|
+
reject?: string[] | undefined;
|
|
427
|
+
review?: string[] | undefined;
|
|
428
|
+
minConfidence?: number | undefined;
|
|
429
|
+
} | {
|
|
430
|
+
type: "bedrock";
|
|
431
|
+
prompt: string;
|
|
432
|
+
input?: string | undefined;
|
|
433
|
+
guardrail?: {
|
|
434
|
+
id: string;
|
|
435
|
+
version: string;
|
|
436
|
+
} | undefined;
|
|
437
|
+
model?: string | undefined;
|
|
438
|
+
})[] | undefined;
|
|
439
|
+
};
|
|
440
|
+
};
|
|
441
|
+
output: {
|
|
442
|
+
job: {
|
|
443
|
+
id: string;
|
|
444
|
+
key: string;
|
|
445
|
+
status: "checking" | "running" | "done" | "rejected" | "failed" | "cancelled";
|
|
446
|
+
verdict: "reject" | "review" | "pass" | null;
|
|
447
|
+
checks: {
|
|
448
|
+
type: "rekognition" | "bedrock";
|
|
449
|
+
target: string;
|
|
450
|
+
verdict: "reject" | "review" | "pass";
|
|
451
|
+
labels: string[];
|
|
452
|
+
reason: string | null;
|
|
453
|
+
}[];
|
|
454
|
+
tasks: {
|
|
455
|
+
key: string;
|
|
456
|
+
endpoint: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fake:echo";
|
|
457
|
+
status: "done" | "rejected" | "failed" | "cancelled" | "pending" | "submitted" | "saving";
|
|
458
|
+
attempt: number;
|
|
459
|
+
outputPath: string;
|
|
460
|
+
verdict: "reject" | "review" | "pass" | null;
|
|
461
|
+
checks: {
|
|
462
|
+
type: "rekognition" | "bedrock";
|
|
463
|
+
target: string;
|
|
464
|
+
verdict: "reject" | "review" | "pass";
|
|
465
|
+
labels: string[];
|
|
466
|
+
reason: string | null;
|
|
467
|
+
}[];
|
|
468
|
+
error: string | null;
|
|
469
|
+
estimatedUsd: number;
|
|
470
|
+
}[];
|
|
471
|
+
createdAt: string;
|
|
472
|
+
updatedAt: string;
|
|
473
|
+
};
|
|
474
|
+
};
|
|
475
|
+
outputFormat: "json";
|
|
476
|
+
status: hono_utils_http_status.ContentfulStatusCode;
|
|
477
|
+
};
|
|
478
|
+
};
|
|
479
|
+
} & {
|
|
480
|
+
"jobs-add": {
|
|
481
|
+
$post: {
|
|
482
|
+
input: {
|
|
483
|
+
json: {
|
|
484
|
+
id: string;
|
|
485
|
+
tasks: {
|
|
486
|
+
key: string;
|
|
487
|
+
endpoint: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fake:echo";
|
|
488
|
+
input: Record<string, unknown>;
|
|
489
|
+
output: {
|
|
490
|
+
path: string;
|
|
491
|
+
};
|
|
492
|
+
priority?: number | undefined;
|
|
493
|
+
}[];
|
|
494
|
+
};
|
|
495
|
+
};
|
|
496
|
+
output: {
|
|
497
|
+
job: {
|
|
498
|
+
id: string;
|
|
499
|
+
key: string;
|
|
500
|
+
status: "checking" | "running" | "done" | "rejected" | "failed" | "cancelled";
|
|
501
|
+
verdict: "reject" | "review" | "pass" | null;
|
|
502
|
+
checks: {
|
|
503
|
+
type: "rekognition" | "bedrock";
|
|
504
|
+
target: string;
|
|
505
|
+
verdict: "reject" | "review" | "pass";
|
|
506
|
+
labels: string[];
|
|
507
|
+
reason: string | null;
|
|
508
|
+
}[];
|
|
509
|
+
tasks: {
|
|
510
|
+
key: string;
|
|
511
|
+
endpoint: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fake:echo";
|
|
512
|
+
status: "done" | "rejected" | "failed" | "cancelled" | "pending" | "submitted" | "saving";
|
|
513
|
+
attempt: number;
|
|
514
|
+
outputPath: string;
|
|
515
|
+
verdict: "reject" | "review" | "pass" | null;
|
|
516
|
+
checks: {
|
|
517
|
+
type: "rekognition" | "bedrock";
|
|
518
|
+
target: string;
|
|
519
|
+
verdict: "reject" | "review" | "pass";
|
|
520
|
+
labels: string[];
|
|
521
|
+
reason: string | null;
|
|
522
|
+
}[];
|
|
523
|
+
error: string | null;
|
|
524
|
+
estimatedUsd: number;
|
|
525
|
+
}[];
|
|
526
|
+
createdAt: string;
|
|
527
|
+
updatedAt: string;
|
|
528
|
+
};
|
|
529
|
+
};
|
|
530
|
+
outputFormat: "json";
|
|
531
|
+
status: hono_utils_http_status.ContentfulStatusCode;
|
|
532
|
+
};
|
|
533
|
+
};
|
|
534
|
+
} & {
|
|
535
|
+
"jobs-check": {
|
|
536
|
+
$post: {
|
|
537
|
+
input: {
|
|
538
|
+
json: {
|
|
539
|
+
id: string;
|
|
540
|
+
taskKey: string;
|
|
541
|
+
checks: ({
|
|
542
|
+
type: "rekognition";
|
|
543
|
+
input?: string | undefined;
|
|
544
|
+
reject?: string[] | undefined;
|
|
545
|
+
review?: string[] | undefined;
|
|
546
|
+
minConfidence?: number | undefined;
|
|
547
|
+
} | {
|
|
548
|
+
type: "bedrock";
|
|
549
|
+
prompt: string;
|
|
550
|
+
input?: string | undefined;
|
|
551
|
+
guardrail?: {
|
|
552
|
+
id: string;
|
|
553
|
+
version: string;
|
|
554
|
+
} | undefined;
|
|
555
|
+
model?: string | undefined;
|
|
556
|
+
})[];
|
|
557
|
+
};
|
|
558
|
+
};
|
|
559
|
+
output: {
|
|
560
|
+
verdict: "reject" | "review" | "pass";
|
|
561
|
+
checks: {
|
|
562
|
+
type: "rekognition" | "bedrock";
|
|
563
|
+
target: string;
|
|
564
|
+
verdict: "reject" | "review" | "pass";
|
|
565
|
+
labels: string[];
|
|
566
|
+
reason: string | null;
|
|
567
|
+
}[];
|
|
568
|
+
};
|
|
569
|
+
outputFormat: "json";
|
|
570
|
+
status: hono_utils_http_status.ContentfulStatusCode;
|
|
571
|
+
};
|
|
572
|
+
};
|
|
573
|
+
} & {
|
|
574
|
+
"jobs-cancel": {
|
|
575
|
+
$post: {
|
|
576
|
+
input: {
|
|
577
|
+
json: {
|
|
578
|
+
id: string;
|
|
579
|
+
};
|
|
580
|
+
};
|
|
581
|
+
output: {
|
|
582
|
+
job: {
|
|
583
|
+
id: string;
|
|
584
|
+
key: string;
|
|
585
|
+
status: "checking" | "running" | "done" | "rejected" | "failed" | "cancelled";
|
|
586
|
+
verdict: "reject" | "review" | "pass" | null;
|
|
587
|
+
checks: {
|
|
588
|
+
type: "rekognition" | "bedrock";
|
|
589
|
+
target: string;
|
|
590
|
+
verdict: "reject" | "review" | "pass";
|
|
591
|
+
labels: string[];
|
|
592
|
+
reason: string | null;
|
|
593
|
+
}[];
|
|
594
|
+
tasks: {
|
|
595
|
+
key: string;
|
|
596
|
+
endpoint: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fake:echo";
|
|
597
|
+
status: "done" | "rejected" | "failed" | "cancelled" | "pending" | "submitted" | "saving";
|
|
598
|
+
attempt: number;
|
|
599
|
+
outputPath: string;
|
|
600
|
+
verdict: "reject" | "review" | "pass" | null;
|
|
601
|
+
checks: {
|
|
602
|
+
type: "rekognition" | "bedrock";
|
|
603
|
+
target: string;
|
|
604
|
+
verdict: "reject" | "review" | "pass";
|
|
605
|
+
labels: string[];
|
|
606
|
+
reason: string | null;
|
|
607
|
+
}[];
|
|
608
|
+
error: string | null;
|
|
609
|
+
estimatedUsd: number;
|
|
610
|
+
}[];
|
|
611
|
+
createdAt: string;
|
|
612
|
+
updatedAt: string;
|
|
613
|
+
};
|
|
614
|
+
};
|
|
615
|
+
outputFormat: "json";
|
|
616
|
+
status: hono_utils_http_status.ContentfulStatusCode;
|
|
617
|
+
};
|
|
618
|
+
};
|
|
619
|
+
}, "/ai"> & {
|
|
620
|
+
"jobs-get": {
|
|
621
|
+
$post: {
|
|
622
|
+
input: {
|
|
623
|
+
json: {
|
|
624
|
+
id: string;
|
|
625
|
+
};
|
|
626
|
+
};
|
|
627
|
+
output: {
|
|
628
|
+
job: {
|
|
629
|
+
id: string;
|
|
630
|
+
key: string;
|
|
631
|
+
status: "checking" | "running" | "done" | "rejected" | "failed" | "cancelled";
|
|
632
|
+
verdict: "reject" | "review" | "pass" | null;
|
|
633
|
+
checks: {
|
|
634
|
+
type: "rekognition" | "bedrock";
|
|
635
|
+
target: string;
|
|
636
|
+
verdict: "reject" | "review" | "pass";
|
|
637
|
+
labels: string[];
|
|
638
|
+
reason: string | null;
|
|
639
|
+
}[];
|
|
640
|
+
tasks: {
|
|
641
|
+
key: string;
|
|
642
|
+
endpoint: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fake:echo";
|
|
643
|
+
status: "done" | "rejected" | "failed" | "cancelled" | "pending" | "submitted" | "saving";
|
|
644
|
+
attempt: number;
|
|
645
|
+
outputPath: string;
|
|
646
|
+
verdict: "reject" | "review" | "pass" | null;
|
|
647
|
+
checks: {
|
|
648
|
+
type: "rekognition" | "bedrock";
|
|
649
|
+
target: string;
|
|
650
|
+
verdict: "reject" | "review" | "pass";
|
|
651
|
+
labels: string[];
|
|
652
|
+
reason: string | null;
|
|
653
|
+
}[];
|
|
654
|
+
error: string | null;
|
|
655
|
+
estimatedUsd: number;
|
|
656
|
+
}[];
|
|
657
|
+
createdAt: string;
|
|
658
|
+
updatedAt: string;
|
|
659
|
+
};
|
|
660
|
+
};
|
|
661
|
+
outputFormat: "json";
|
|
662
|
+
status: hono_utils_http_status.ContentfulStatusCode;
|
|
663
|
+
};
|
|
664
|
+
};
|
|
665
|
+
}), "/", "jobs-get">;
|
|
666
|
+
|
|
667
|
+
declare const realtimeRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
|
|
668
|
+
"realtime-token": {
|
|
669
|
+
$post: {
|
|
670
|
+
input: {
|
|
671
|
+
json: Record<string, never>;
|
|
672
|
+
};
|
|
673
|
+
output: {
|
|
674
|
+
token: string;
|
|
675
|
+
expiresAt: number;
|
|
676
|
+
};
|
|
677
|
+
outputFormat: "json";
|
|
678
|
+
status: hono_utils_http_status.ContentfulStatusCode;
|
|
679
|
+
};
|
|
680
|
+
};
|
|
681
|
+
}, "/", "realtime-token">;
|
|
682
|
+
|
|
250
683
|
declare const app: Hono<hono_types.BlankEnv, hono_types.BlankSchema, "/">;
|
|
251
684
|
type DmxRouter = typeof dmxRouter;
|
|
252
685
|
type StorageRouter = typeof storageRouter;
|
|
253
686
|
type DatabaseRouter = typeof databaseRouter;
|
|
254
687
|
type BedrockRouter = typeof bedrockRouter;
|
|
688
|
+
type DevicesRouter = typeof devicesRouter;
|
|
689
|
+
type AiJobsRouter = typeof aiJobsRouter;
|
|
690
|
+
type RealtimeRouter = typeof realtimeRouter;
|
|
255
691
|
|
|
256
|
-
export { type BedrockRouter, type DatabaseRouter, type DmxRouter, type StorageRouter, app as default };
|
|
692
|
+
export { type AiJobsRouter, type BedrockRouter, type DatabaseRouter, type DevicesRouter, type DmxRouter, type RealtimeRouter, type StorageRouter, app as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digo-labs/backend",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"types": "./dist/index.d.cts",
|
|
@@ -37,11 +37,12 @@
|
|
|
37
37
|
]
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@digo-labs/common": "^0.
|
|
40
|
+
"@digo-labs/common": "^0.2.0"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@aws-sdk/client-bedrock": "^3.1035.0",
|
|
44
44
|
"@aws-sdk/client-bedrock-runtime": "^3.1035.0",
|
|
45
|
+
"@aws-sdk/client-rekognition": "^3.1078.0",
|
|
45
46
|
"@aws-sdk/client-s3": "^3.1032.0",
|
|
46
47
|
"@aws-sdk/s3-request-presigner": "^3.1032.0",
|
|
47
48
|
"@hono/node-server": "^1.19.14",
|
|
@@ -60,4 +61,4 @@
|
|
|
60
61
|
"drizzle-kit": "^0.31.10",
|
|
61
62
|
"tsup": "^8.5.0"
|
|
62
63
|
}
|
|
63
|
-
}
|
|
64
|
+
}
|