@digo-labs/backend 0.1.9 → 0.2.1

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