@digo-labs/backend 0.2.5 → 0.2.7

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 CHANGED
@@ -17,7 +17,7 @@ Patterns are documented in the design system: [Backend Patterns](https://design.
17
17
  npm run dev # tsx watch on port 3000
18
18
  ```
19
19
 
20
- Requires env vars (`DATABASE_URL_MONOREPO` at minimum; `FAL_KEY` for the fal proxy) — the usual workflow is developing apps against the deployed backend instead, which needs nothing locally. See [Environment and Local Backend](https://design.digo-labs.com/docs/guide/environment-and-local-backend).
20
+ Requires env vars (`DATABASE_URL_MONOREPO` at minimum; `FAL_KEY` and `REPLICATE_API_TOKEN` for the proxy and AI jobs, `OPENAI_API_KEY` for AI jobs' OpenAI links) — the usual workflow is developing apps against the deployed backend instead, which needs nothing locally. See [Environment and Local Backend](https://design.digo-labs.com/docs/guide/environment-and-local-backend).
21
21
 
22
22
  ## Build
23
23
 
package/dist/index.d.cts CHANGED
@@ -370,10 +370,11 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
370
370
  verdict: "reject" | "review" | "pass";
371
371
  labels: string[];
372
372
  reason: string | null;
373
+ isFallback?: boolean | undefined;
373
374
  }[];
374
375
  tasks: {
375
376
  key: string;
376
- endpoint: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fake:echo";
377
+ endpoint: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fal:openai/gpt-image-2.6/flare/edit" | "openai:gpt-image-2.5-flare" | "openai:gpt-image-2.5-sunburst" | "openai:gpt-image-2.6-flare" | "replicate:openai/gpt-image-2" | "replicate:openai/gpt-image-2.6-flare" | "replicate:google/nano-banana-pro" | "fake:echo";
377
378
  status: "done" | "rejected" | "failed" | "cancelled" | "pending" | "submitted" | "saving";
378
379
  attempt: number;
379
380
  outputPath: string;
@@ -384,9 +385,11 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
384
385
  verdict: "reject" | "review" | "pass";
385
386
  labels: string[];
386
387
  reason: string | null;
388
+ isFallback?: boolean | undefined;
387
389
  }[];
388
390
  error: "submit failed" | "provider error" | "provider timed out" | "save failed" | null;
389
391
  estimatedUsd: number;
392
+ servedBy?: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fal:openai/gpt-image-2.6/flare/edit" | "openai:gpt-image-2.5-flare" | "openai:gpt-image-2.5-sunburst" | "openai:gpt-image-2.6-flare" | "replicate:openai/gpt-image-2" | "replicate:openai/gpt-image-2.6-flare" | "replicate:google/nano-banana-pro" | "fake:echo" | null | undefined;
390
393
  }[];
391
394
  createdAt: string;
392
395
  updatedAt: string;
@@ -404,12 +407,17 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
404
407
  key: string;
405
408
  tasks: {
406
409
  key: string;
407
- endpoint: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fake:echo";
410
+ endpoint: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fal:openai/gpt-image-2.6/flare/edit" | "openai:gpt-image-2.5-flare" | "openai:gpt-image-2.5-sunburst" | "openai:gpt-image-2.6-flare" | "replicate:openai/gpt-image-2" | "replicate:openai/gpt-image-2.6-flare" | "replicate:google/nano-banana-pro" | "fake:echo";
408
411
  input: Record<string, unknown>;
409
412
  output: {
410
413
  path: string;
411
414
  };
412
415
  priority?: number | undefined;
416
+ fallbacks?: {
417
+ endpoint: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fal:openai/gpt-image-2.6/flare/edit" | "openai:gpt-image-2.5-flare" | "openai:gpt-image-2.5-sunburst" | "openai:gpt-image-2.6-flare" | "replicate:openai/gpt-image-2" | "replicate:openai/gpt-image-2.6-flare" | "replicate:google/nano-banana-pro" | "fake:echo";
418
+ input?: Record<string, unknown> | undefined;
419
+ }[] | undefined;
420
+ fallbackAfter?: number | undefined;
413
421
  }[];
414
422
  inputs?: Record<string, string> | undefined;
415
423
  checks?: ({
@@ -418,6 +426,15 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
418
426
  reject?: string[] | undefined;
419
427
  review?: string[] | undefined;
420
428
  minConfidence?: number | undefined;
429
+ fallback?: {
430
+ type: "bedrock";
431
+ prompt: string;
432
+ model?: string | undefined;
433
+ guardrail?: {
434
+ id: string;
435
+ version: string;
436
+ } | undefined;
437
+ } | undefined;
421
438
  } | {
422
439
  type: "bedrock";
423
440
  prompt: string;
@@ -427,6 +444,15 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
427
444
  version: string;
428
445
  } | undefined;
429
446
  model?: string | undefined;
447
+ fallback?: {
448
+ type: "bedrock";
449
+ prompt: string;
450
+ model?: string | undefined;
451
+ guardrail?: {
452
+ id: string;
453
+ version: string;
454
+ } | undefined;
455
+ } | undefined;
430
456
  })[] | undefined;
431
457
  onReview?: "reject" | "continue" | undefined;
432
458
  outputChecks?: ({
@@ -435,6 +461,15 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
435
461
  reject?: string[] | undefined;
436
462
  review?: string[] | undefined;
437
463
  minConfidence?: number | undefined;
464
+ fallback?: {
465
+ type: "bedrock";
466
+ prompt: string;
467
+ model?: string | undefined;
468
+ guardrail?: {
469
+ id: string;
470
+ version: string;
471
+ } | undefined;
472
+ } | undefined;
438
473
  } | {
439
474
  type: "bedrock";
440
475
  prompt: string;
@@ -444,6 +479,15 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
444
479
  version: string;
445
480
  } | undefined;
446
481
  model?: string | undefined;
482
+ fallback?: {
483
+ type: "bedrock";
484
+ prompt: string;
485
+ model?: string | undefined;
486
+ guardrail?: {
487
+ id: string;
488
+ version: string;
489
+ } | undefined;
490
+ } | undefined;
447
491
  })[] | undefined;
448
492
  };
449
493
  };
@@ -459,10 +503,11 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
459
503
  verdict: "reject" | "review" | "pass";
460
504
  labels: string[];
461
505
  reason: string | null;
506
+ isFallback?: boolean | undefined;
462
507
  }[];
463
508
  tasks: {
464
509
  key: string;
465
- endpoint: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fake:echo";
510
+ endpoint: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fal:openai/gpt-image-2.6/flare/edit" | "openai:gpt-image-2.5-flare" | "openai:gpt-image-2.5-sunburst" | "openai:gpt-image-2.6-flare" | "replicate:openai/gpt-image-2" | "replicate:openai/gpt-image-2.6-flare" | "replicate:google/nano-banana-pro" | "fake:echo";
466
511
  status: "done" | "rejected" | "failed" | "cancelled" | "pending" | "submitted" | "saving";
467
512
  attempt: number;
468
513
  outputPath: string;
@@ -473,9 +518,11 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
473
518
  verdict: "reject" | "review" | "pass";
474
519
  labels: string[];
475
520
  reason: string | null;
521
+ isFallback?: boolean | undefined;
476
522
  }[];
477
523
  error: "submit failed" | "provider error" | "provider timed out" | "save failed" | null;
478
524
  estimatedUsd: number;
525
+ servedBy?: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fal:openai/gpt-image-2.6/flare/edit" | "openai:gpt-image-2.5-flare" | "openai:gpt-image-2.5-sunburst" | "openai:gpt-image-2.6-flare" | "replicate:openai/gpt-image-2" | "replicate:openai/gpt-image-2.6-flare" | "replicate:google/nano-banana-pro" | "fake:echo" | null | undefined;
479
526
  }[];
480
527
  createdAt: string;
481
528
  updatedAt: string;
@@ -493,12 +540,17 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
493
540
  id: string;
494
541
  tasks: {
495
542
  key: string;
496
- endpoint: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fake:echo";
543
+ endpoint: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fal:openai/gpt-image-2.6/flare/edit" | "openai:gpt-image-2.5-flare" | "openai:gpt-image-2.5-sunburst" | "openai:gpt-image-2.6-flare" | "replicate:openai/gpt-image-2" | "replicate:openai/gpt-image-2.6-flare" | "replicate:google/nano-banana-pro" | "fake:echo";
497
544
  input: Record<string, unknown>;
498
545
  output: {
499
546
  path: string;
500
547
  };
501
548
  priority?: number | undefined;
549
+ fallbacks?: {
550
+ endpoint: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fal:openai/gpt-image-2.6/flare/edit" | "openai:gpt-image-2.5-flare" | "openai:gpt-image-2.5-sunburst" | "openai:gpt-image-2.6-flare" | "replicate:openai/gpt-image-2" | "replicate:openai/gpt-image-2.6-flare" | "replicate:google/nano-banana-pro" | "fake:echo";
551
+ input?: Record<string, unknown> | undefined;
552
+ }[] | undefined;
553
+ fallbackAfter?: number | undefined;
502
554
  }[];
503
555
  };
504
556
  };
@@ -514,10 +566,11 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
514
566
  verdict: "reject" | "review" | "pass";
515
567
  labels: string[];
516
568
  reason: string | null;
569
+ isFallback?: boolean | undefined;
517
570
  }[];
518
571
  tasks: {
519
572
  key: string;
520
- endpoint: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fake:echo";
573
+ endpoint: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fal:openai/gpt-image-2.6/flare/edit" | "openai:gpt-image-2.5-flare" | "openai:gpt-image-2.5-sunburst" | "openai:gpt-image-2.6-flare" | "replicate:openai/gpt-image-2" | "replicate:openai/gpt-image-2.6-flare" | "replicate:google/nano-banana-pro" | "fake:echo";
521
574
  status: "done" | "rejected" | "failed" | "cancelled" | "pending" | "submitted" | "saving";
522
575
  attempt: number;
523
576
  outputPath: string;
@@ -528,9 +581,11 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
528
581
  verdict: "reject" | "review" | "pass";
529
582
  labels: string[];
530
583
  reason: string | null;
584
+ isFallback?: boolean | undefined;
531
585
  }[];
532
586
  error: "submit failed" | "provider error" | "provider timed out" | "save failed" | null;
533
587
  estimatedUsd: number;
588
+ servedBy?: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fal:openai/gpt-image-2.6/flare/edit" | "openai:gpt-image-2.5-flare" | "openai:gpt-image-2.5-sunburst" | "openai:gpt-image-2.6-flare" | "replicate:openai/gpt-image-2" | "replicate:openai/gpt-image-2.6-flare" | "replicate:google/nano-banana-pro" | "fake:echo" | null | undefined;
534
589
  }[];
535
590
  createdAt: string;
536
591
  updatedAt: string;
@@ -553,6 +608,15 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
553
608
  reject?: string[] | undefined;
554
609
  review?: string[] | undefined;
555
610
  minConfidence?: number | undefined;
611
+ fallback?: {
612
+ type: "bedrock";
613
+ prompt: string;
614
+ model?: string | undefined;
615
+ guardrail?: {
616
+ id: string;
617
+ version: string;
618
+ } | undefined;
619
+ } | undefined;
556
620
  } | {
557
621
  type: "bedrock";
558
622
  prompt: string;
@@ -562,6 +626,15 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
562
626
  version: string;
563
627
  } | undefined;
564
628
  model?: string | undefined;
629
+ fallback?: {
630
+ type: "bedrock";
631
+ prompt: string;
632
+ model?: string | undefined;
633
+ guardrail?: {
634
+ id: string;
635
+ version: string;
636
+ } | undefined;
637
+ } | undefined;
565
638
  })[];
566
639
  };
567
640
  };
@@ -573,6 +646,7 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
573
646
  verdict: "reject" | "review" | "pass";
574
647
  labels: string[];
575
648
  reason: string | null;
649
+ isFallback?: boolean | undefined;
576
650
  }[];
577
651
  };
578
652
  outputFormat: "json";
@@ -599,10 +673,11 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
599
673
  verdict: "reject" | "review" | "pass";
600
674
  labels: string[];
601
675
  reason: string | null;
676
+ isFallback?: boolean | undefined;
602
677
  }[];
603
678
  tasks: {
604
679
  key: string;
605
- endpoint: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fake:echo";
680
+ endpoint: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fal:openai/gpt-image-2.6/flare/edit" | "openai:gpt-image-2.5-flare" | "openai:gpt-image-2.5-sunburst" | "openai:gpt-image-2.6-flare" | "replicate:openai/gpt-image-2" | "replicate:openai/gpt-image-2.6-flare" | "replicate:google/nano-banana-pro" | "fake:echo";
606
681
  status: "done" | "rejected" | "failed" | "cancelled" | "pending" | "submitted" | "saving";
607
682
  attempt: number;
608
683
  outputPath: string;
@@ -613,9 +688,11 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
613
688
  verdict: "reject" | "review" | "pass";
614
689
  labels: string[];
615
690
  reason: string | null;
691
+ isFallback?: boolean | undefined;
616
692
  }[];
617
693
  error: "submit failed" | "provider error" | "provider timed out" | "save failed" | null;
618
694
  estimatedUsd: number;
695
+ servedBy?: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fal:openai/gpt-image-2.6/flare/edit" | "openai:gpt-image-2.5-flare" | "openai:gpt-image-2.5-sunburst" | "openai:gpt-image-2.6-flare" | "replicate:openai/gpt-image-2" | "replicate:openai/gpt-image-2.6-flare" | "replicate:google/nano-banana-pro" | "fake:echo" | null | undefined;
619
696
  }[];
620
697
  createdAt: string;
621
698
  updatedAt: string;
@@ -645,10 +722,11 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
645
722
  verdict: "reject" | "review" | "pass";
646
723
  labels: string[];
647
724
  reason: string | null;
725
+ isFallback?: boolean | undefined;
648
726
  }[];
649
727
  tasks: {
650
728
  key: string;
651
- endpoint: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fake:echo";
729
+ endpoint: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fal:openai/gpt-image-2.6/flare/edit" | "openai:gpt-image-2.5-flare" | "openai:gpt-image-2.5-sunburst" | "openai:gpt-image-2.6-flare" | "replicate:openai/gpt-image-2" | "replicate:openai/gpt-image-2.6-flare" | "replicate:google/nano-banana-pro" | "fake:echo";
652
730
  status: "done" | "rejected" | "failed" | "cancelled" | "pending" | "submitted" | "saving";
653
731
  attempt: number;
654
732
  outputPath: string;
@@ -659,9 +737,11 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
659
737
  verdict: "reject" | "review" | "pass";
660
738
  labels: string[];
661
739
  reason: string | null;
740
+ isFallback?: boolean | undefined;
662
741
  }[];
663
742
  error: "submit failed" | "provider error" | "provider timed out" | "save failed" | null;
664
743
  estimatedUsd: number;
744
+ servedBy?: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fal:openai/gpt-image-2.6/flare/edit" | "openai:gpt-image-2.5-flare" | "openai:gpt-image-2.5-sunburst" | "openai:gpt-image-2.6-flare" | "replicate:openai/gpt-image-2" | "replicate:openai/gpt-image-2.6-flare" | "replicate:google/nano-banana-pro" | "fake:echo" | null | undefined;
665
745
  }[];
666
746
  createdAt: string;
667
747
  updatedAt: string;
@@ -695,10 +775,11 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
695
775
  verdict: "reject" | "review" | "pass";
696
776
  labels: string[];
697
777
  reason: string | null;
778
+ isFallback?: boolean | undefined;
698
779
  }[];
699
780
  tasks: {
700
781
  key: string;
701
- endpoint: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fake:echo";
782
+ endpoint: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fal:openai/gpt-image-2.6/flare/edit" | "openai:gpt-image-2.5-flare" | "openai:gpt-image-2.5-sunburst" | "openai:gpt-image-2.6-flare" | "replicate:openai/gpt-image-2" | "replicate:openai/gpt-image-2.6-flare" | "replicate:google/nano-banana-pro" | "fake:echo";
702
783
  status: "done" | "rejected" | "failed" | "cancelled" | "pending" | "submitted" | "saving";
703
784
  attempt: number;
704
785
  outputPath: string;
@@ -709,9 +790,11 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
709
790
  verdict: "reject" | "review" | "pass";
710
791
  labels: string[];
711
792
  reason: string | null;
793
+ isFallback?: boolean | undefined;
712
794
  }[];
713
795
  error: "submit failed" | "provider error" | "provider timed out" | "save failed" | null;
714
796
  estimatedUsd: number;
797
+ servedBy?: "fal:openai/gpt-image-2.5/flare/edit" | "fal:openai/gpt-image-2.5/sunburst/edit" | "fal:openai/gpt-image-2.6/flare/edit" | "openai:gpt-image-2.5-flare" | "openai:gpt-image-2.5-sunburst" | "openai:gpt-image-2.6-flare" | "replicate:openai/gpt-image-2" | "replicate:openai/gpt-image-2.6-flare" | "replicate:google/nano-banana-pro" | "fake:echo" | null | undefined;
715
798
  }[];
716
799
  createdAt: string;
717
800
  updatedAt: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digo-labs/backend",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "types": "./dist/index.d.cts",
@@ -38,7 +38,7 @@
38
38
  ]
39
39
  },
40
40
  "peerDependencies": {
41
- "@digo-labs/common": "^0.2.13"
41
+ "@digo-labs/common": "^0.2.15"
42
42
  },
43
43
  "dependencies": {
44
44
  "@aws-sdk/client-bedrock-runtime": "^3.1035.0",