@htilabs/platform-common-models 0.81.0 → 0.82.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.
Files changed (36) hide show
  1. package/README.md +10 -0
  2. package/dist/{index-uz57Fic9.d.ts → index-Bh1zO_Vu.d.ts} +1 -1
  3. package/dist/{index-1pWiqEBC.d.cts → index-XWSYon40.d.cts} +1 -1
  4. package/dist/index.cjs +332 -44
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +4 -4
  7. package/dist/index.d.ts +4 -4
  8. package/dist/index.js +322 -44
  9. package/dist/index.js.map +1 -1
  10. package/dist/information-scope/index.cjs +290 -2
  11. package/dist/information-scope/index.cjs.map +1 -1
  12. package/dist/information-scope/index.d.cts +84 -1
  13. package/dist/information-scope/index.d.ts +84 -1
  14. package/dist/information-scope/index.js +279 -1
  15. package/dist/information-scope/index.js.map +1 -1
  16. package/dist/models/index.d.cts +2 -2
  17. package/dist/models/index.d.ts +2 -2
  18. package/dist/schemas/index.d.cts +25 -25
  19. package/dist/schemas/index.d.ts +25 -25
  20. package/dist/services/index.cjs +290 -2
  21. package/dist/services/index.cjs.map +1 -1
  22. package/dist/services/index.d.cts +1 -1
  23. package/dist/services/index.d.ts +1 -1
  24. package/dist/services/index.js +279 -1
  25. package/dist/services/index.js.map +1 -1
  26. package/dist/validation/index.d.cts +1 -1
  27. package/dist/validation/index.d.ts +1 -1
  28. package/package.json +1 -1
  29. package/src/generated/informationScopeUiCopy.ts +263 -0
  30. package/src/services/__tests__/informationScopeUiCopy.test.ts +128 -0
  31. package/src/services/informationScope.ts +1 -0
  32. package/src/services/informationScopeUiCopy.ts +98 -0
  33. package/dist/{agency-Djp57S71.d.cts → agency-8ufZJJDH.d.cts} +4 -4
  34. package/dist/{agency-BHv54o79.d.ts → agency-CnVTwLeV.d.ts} +4 -4
  35. package/dist/{cvcEntry-DAuhe0cd.d.cts → cvcEntry-D787utvP.d.cts} +8 -8
  36. package/dist/{cvcEntry-DAuhe0cd.d.ts → cvcEntry-D787utvP.d.ts} +8 -8
@@ -20,17 +20,27 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/services/informationScope.ts
21
21
  var informationScope_exports = {};
22
22
  __export(informationScope_exports, {
23
+ INFORMATION_SCOPE_CATEGORY_ORDER: () => INFORMATION_SCOPE_CATEGORY_ORDER,
24
+ INFORMATION_SCOPE_CATEGORY_SUB: () => INFORMATION_SCOPE_CATEGORY_SUB,
23
25
  INFORMATION_SCOPE_POLICY_VERSION_ROW_NOTE: () => INFORMATION_SCOPE_POLICY_VERSION_ROW_NOTE,
24
26
  INFORMATION_SCOPE_READABLE_VERSIONS: () => INFORMATION_SCOPE_READABLE_VERSIONS,
27
+ INFORMATION_SCOPE_ROW_HINT: () => INFORMATION_SCOPE_ROW_HINT,
28
+ INFORMATION_SCOPE_ROW_ORDER: () => INFORMATION_SCOPE_ROW_ORDER,
25
29
  INFORMATION_SCOPE_SYSTEM_INFO: () => INFORMATION_SCOPE_SYSTEM_INFO,
30
+ INFORMATION_SCOPE_UI_COPY_SOURCE: () => INFORMATION_SCOPE_UI_COPY_SOURCE,
26
31
  INFORMATION_SCOPE_VERSION: () => INFORMATION_SCOPE_VERSION,
27
32
  createInformationScopeResolver: () => createInformationScopeResolver,
28
33
  isScopeInstrumentRow: () => isScopeInstrumentRow,
29
34
  isScopeRestRow: () => isScopeRestRow,
30
35
  isSelectableScopeRow: () => isSelectableScopeRow,
31
36
  kindForPerson: () => kindForPerson,
37
+ scopeCategorySub: () => scopeCategorySub,
32
38
  scopeMigrationsFromSot: () => scopeMigrationsFromSot,
33
- scopeRowsFromSot: () => scopeRowsFromSot
39
+ scopeRowDisplayOrder: () => scopeRowDisplayOrder,
40
+ scopeRowHint: () => scopeRowHint,
41
+ scopeRowsFromSot: () => scopeRowsFromSot,
42
+ sortScopeCategories: () => sortScopeCategories,
43
+ sortScopeRows: () => sortScopeRows
34
44
  });
35
45
  module.exports = __toCommonJS(informationScope_exports);
36
46
 
@@ -504,18 +514,296 @@ function scopeMigrationsFromSot(sot) {
504
514
  };
505
515
  });
506
516
  }
517
+
518
+ // src/generated/informationScopeUiCopy.ts
519
+ var INFORMATION_SCOPE_UI_COPY_SOURCE = {
520
+ "order": {
521
+ "repo": "htilabstech/prototype",
522
+ "file": "data/cvcs/core_information_scope.yaml",
523
+ "sha": "395bb7aa"
524
+ },
525
+ "words": {
526
+ "repo": "htilabstech/platform-prototype",
527
+ "file": "src/data.js",
528
+ "sha": "c324f715",
529
+ "line": 33875
530
+ }
531
+ };
532
+ var INFORMATION_SCOPE_CATEGORY_ORDER = [
533
+ "system",
534
+ "notes",
535
+ "identifying",
536
+ "contact",
537
+ "health_accommodation",
538
+ "immigration_legal_status",
539
+ "risk",
540
+ "services",
541
+ "instruments",
542
+ "relationships_household",
543
+ "offenders__identifying",
544
+ "offenders__contact",
545
+ "offenders__health_accommodation",
546
+ "offenders__immigration_legal_status",
547
+ "offenders__risk",
548
+ "offenders__services",
549
+ "offenders__instruments",
550
+ "offenders__relationships_household",
551
+ "family__identifying",
552
+ "family__contact",
553
+ "family__health_accommodation",
554
+ "family__immigration_legal_status",
555
+ "family__risk",
556
+ "family__services",
557
+ "family__instruments",
558
+ "family__relationships_household",
559
+ "others__identifying",
560
+ "others__contact",
561
+ "others__health_accommodation",
562
+ "others__immigration_legal_status",
563
+ "others__risk",
564
+ "others__services",
565
+ "others__instruments",
566
+ "others__relationships_household",
567
+ "network_associations",
568
+ "commercial_activity",
569
+ "investigative_work_product",
570
+ "object_identifiers"
571
+ ];
572
+ var INFORMATION_SCOPE_CATEGORY_SUB = {
573
+ "system": "Session timestamps, source info \u2014 always shared",
574
+ "notes": "The session summary, and notes written in a session or on the case",
575
+ "identifying": "Names, DOB, addresses, identifiers, demographics",
576
+ "contact": "How to reach the person safely: contact info + safety preferences, the Priorities & Safety triage",
577
+ "health_accommodation": "Health status, accommodation needs",
578
+ "immigration_legal_status": "Immigration status, immigration applications",
579
+ "risk": "Indicators, screening outcomes, per-instrument assessment responses, determinations, system involvement \u2014 the people who caused harm are their own branch",
580
+ "services": "Contact history with this agency, service records, service plans + goals \u2014 three tiers of sensitivity",
581
+ "instruments": "Initial Screen, intake screens, assessments, Findings \u2014 a Summary & outcome row and a Full questions, narratives & notes row per instrument",
582
+ "relationships_household": "The client's account of the people around them \u2014 each relationship record, the household roster, pets; each entry names the other person as name + kind and carries nothing else about them",
583
+ "offenders__identifying": "People who caused harm \u2014 the person's own record, grouped by kind (identifying information)",
584
+ "offenders__contact": "People who caused harm \u2014 the person's own record, grouped by kind (contact & safety)",
585
+ "offenders__health_accommodation": "People who caused harm \u2014 the person's own record, grouped by kind (health & accommodation)",
586
+ "offenders__immigration_legal_status": "People who caused harm \u2014 the person's own record, grouped by kind (immigration & legal status)",
587
+ "offenders__risk": "People who caused harm \u2014 the person's own record, grouped by kind (risk-related)",
588
+ "offenders__services": "People who caused harm \u2014 the person's own record, grouped by kind (services & case history)",
589
+ "offenders__instruments": "People who caused harm \u2014 the person's own record, grouped by kind (screens & assessments)",
590
+ "offenders__relationships_household": "People who caused harm \u2014 the person's own record, grouped by kind (relationships & household)",
591
+ "family__identifying": "Eligible family members \u2014 the person's own record, grouped by kind (identifying information)",
592
+ "family__contact": "Eligible family members \u2014 the person's own record, grouped by kind (contact & safety)",
593
+ "family__health_accommodation": "Eligible family members \u2014 the person's own record, grouped by kind (health & accommodation)",
594
+ "family__immigration_legal_status": "Eligible family members \u2014 the person's own record, grouped by kind (immigration & legal status)",
595
+ "family__risk": "Eligible family members \u2014 the person's own record, grouped by kind (risk-related)",
596
+ "family__services": "Eligible family members \u2014 the person's own record, grouped by kind (services & case history)",
597
+ "family__instruments": "Eligible family members \u2014 the person's own record, grouped by kind (screens & assessments)",
598
+ "family__relationships_household": "Eligible family members \u2014 the person's own record, grouped by kind (relationships & household)",
599
+ "others__identifying": "Other people on the case \u2014 the person's own record, grouped by kind (identifying information)",
600
+ "others__contact": "Other people on the case \u2014 the person's own record, grouped by kind (contact & safety)",
601
+ "others__health_accommodation": "Other people on the case \u2014 the person's own record, grouped by kind (health & accommodation)",
602
+ "others__immigration_legal_status": "Other people on the case \u2014 the person's own record, grouped by kind (immigration & legal status)",
603
+ "others__risk": "Other people on the case \u2014 the person's own record, grouped by kind (risk-related)",
604
+ "others__services": "Other people on the case \u2014 the person's own record, grouped by kind (services & case history)",
605
+ "others__instruments": "Other people on the case \u2014 the person's own record, grouped by kind (screens & assessments)",
606
+ "others__relationships_household": "Other people on the case \u2014 the person's own record, grouped by kind (relationships & household)",
607
+ "network_associations": "Personas, network membership, relationships, criminal-org links",
608
+ "commercial_activity": "Ads, listings, posting activity, pricing, business fronts",
609
+ "investigative_work_product": "Analyst determinations, dispositions, case briefs",
610
+ "object_identifiers": "Phone numbers, vehicle identifiers, image hashes, account handles"
611
+ };
612
+ var INFORMATION_SCOPE_ROW_ORDER = {
613
+ "system": [
614
+ "system_info"
615
+ ],
616
+ "notes": [
617
+ "session_summary",
618
+ "case_notes"
619
+ ],
620
+ "identifying": [
621
+ "names",
622
+ "dob",
623
+ "addresses",
624
+ "additional_ids",
625
+ "demographics",
626
+ "identifying__other"
627
+ ],
628
+ "contact": [
629
+ "contact_info",
630
+ "safe_locations",
631
+ "priorities_safety",
632
+ "encounter_location"
633
+ ],
634
+ "health_accommodation": [
635
+ "health_status",
636
+ "accommodation_needs"
637
+ ],
638
+ "immigration_legal_status": [
639
+ "immigration_status",
640
+ "immigration_applications"
641
+ ],
642
+ "risk": [
643
+ "screen_indicators",
644
+ "victimization",
645
+ "system_involvement",
646
+ "derived_risk_signals"
647
+ ],
648
+ "services": [
649
+ "contact_history",
650
+ "service_history",
651
+ "plans_goals"
652
+ ],
653
+ "instruments": [
654
+ "summary_initial_screen",
655
+ "summary_mental_health_screen",
656
+ "summary_behavioral_health_intake",
657
+ "summary_trauma_and_coping_screen",
658
+ "summary_ae_intake",
659
+ "summary_ida",
660
+ "summary_lap",
661
+ "summary_danger_assessment",
662
+ "summary_stalking_assessment",
663
+ "summary_injury_and_strangulation",
664
+ "summary_hope_scale",
665
+ "summary_needs_assessment",
666
+ "summary_tra",
667
+ "summary_findings",
668
+ "full_initial_screen",
669
+ "full_mental_health_screen",
670
+ "full_behavioral_health_intake",
671
+ "full_trauma_and_coping_screen",
672
+ "full_ae_intake",
673
+ "full_ida",
674
+ "full_lap",
675
+ "full_danger_assessment",
676
+ "full_stalking_assessment",
677
+ "full_injury_and_strangulation",
678
+ "full_hope_scale",
679
+ "full_needs_assessment",
680
+ "full_tra",
681
+ "full_findings"
682
+ ],
683
+ "relationships_household": [],
684
+ "offenders__identifying": [],
685
+ "offenders__contact": [
686
+ "offenders__safe_locations"
687
+ ],
688
+ "offenders__health_accommodation": [],
689
+ "offenders__immigration_legal_status": [],
690
+ "offenders__risk": [],
691
+ "offenders__services": [],
692
+ "offenders__instruments": [
693
+ "offenders__instrument_summary",
694
+ "offenders__instrument_full"
695
+ ],
696
+ "offenders__relationships_household": [],
697
+ "family__identifying": [],
698
+ "family__contact": [
699
+ "family__safe_locations"
700
+ ],
701
+ "family__health_accommodation": [],
702
+ "family__immigration_legal_status": [],
703
+ "family__risk": [],
704
+ "family__services": [],
705
+ "family__instruments": [
706
+ "family__instrument_summary",
707
+ "family__instrument_full"
708
+ ],
709
+ "family__relationships_household": [],
710
+ "others__identifying": [],
711
+ "others__contact": [
712
+ "others__safe_locations"
713
+ ],
714
+ "others__health_accommodation": [],
715
+ "others__immigration_legal_status": [],
716
+ "others__risk": [],
717
+ "others__services": [],
718
+ "others__instruments": [
719
+ "others__instrument_summary",
720
+ "others__instrument_full"
721
+ ],
722
+ "others__relationships_household": [],
723
+ "network_associations": [
724
+ "network_membership",
725
+ "persona_links"
726
+ ],
727
+ "commercial_activity": [
728
+ "ad_content",
729
+ "commercial_patterns"
730
+ ],
731
+ "investigative_work_product": [
732
+ "case_determinations",
733
+ "case_lifecycle",
734
+ "case_attachments"
735
+ ],
736
+ "object_identifiers": [
737
+ "phone_identifiers",
738
+ "object_identity_attributes"
739
+ ]
740
+ };
741
+ var INFORMATION_SCOPE_ROW_HINT = {
742
+ "system_info": "Always included",
743
+ "names": "All logged name entries",
744
+ "additional_ids": "Other IDs entered separately",
745
+ "identifying__other": "Living situation \xB7 work & income \xB7 education \xB7 languages \xB7 citizenship \xB7 physical description \xB7 vehicle",
746
+ "safe_locations": "Shelter placements + confidential program addresses",
747
+ "encounter_location": "The session's meetup / incident location \u2014 not the survivor's own addresses (CVC-191 reasons Meet / contact + Incident)",
748
+ "immigration_status": "Visa type + birth country + relevant flags",
749
+ "commercial_patterns": "Pricing, schedule, venues",
750
+ "case_attachments": "Content-dependent \u2014 attachment handling flags govern",
751
+ "object_identity_attributes": "Names, trade names, ages"
752
+ };
753
+
754
+ // src/services/informationScopeUiCopy.ts
755
+ var own = (o, k) => Object.prototype.hasOwnProperty.call(o, k);
756
+ function toKey(codeOrKey) {
757
+ return codeOrKey.replace(/\./g, "__");
758
+ }
759
+ function toCode(key) {
760
+ return key.replace(/__/g, ".");
761
+ }
762
+ function scopeCategorySub(category) {
763
+ const k = toKey(category);
764
+ return own(INFORMATION_SCOPE_CATEGORY_SUB, k) ? INFORMATION_SCOPE_CATEGORY_SUB[k] : void 0;
765
+ }
766
+ function scopeRowHint(row) {
767
+ const k = toKey(row);
768
+ return own(INFORMATION_SCOPE_ROW_HINT, k) ? INFORMATION_SCOPE_ROW_HINT[k] : void 0;
769
+ }
770
+ function scopeRowDisplayOrder(category) {
771
+ const k = toKey(category);
772
+ return own(INFORMATION_SCOPE_ROW_ORDER, k) ? INFORMATION_SCOPE_ROW_ORDER[k].map(toCode) : [];
773
+ }
774
+ function sortScopeRows(category, rows) {
775
+ const k = toKey(category);
776
+ const order = own(INFORMATION_SCOPE_ROW_ORDER, k) ? INFORMATION_SCOPE_ROW_ORDER[k] : [];
777
+ const rank = new Map(order.map((r, i) => [r, i]));
778
+ return rows.map((r, i) => ({ r, i, at: rank.get(toKey(r)) ?? order.length })).sort((a, b) => a.at - b.at || a.i - b.i).map((x) => x.r);
779
+ }
780
+ function sortScopeCategories(categories) {
781
+ const rank = new Map(INFORMATION_SCOPE_CATEGORY_ORDER.map((c, i) => [c, i]));
782
+ const n = INFORMATION_SCOPE_CATEGORY_ORDER.length;
783
+ return categories.map((c, i) => ({ c, i, at: rank.get(toKey(c)) ?? n })).sort((a, b) => a.at - b.at || a.i - b.i).map((x) => x.c);
784
+ }
507
785
  // Annotate the CommonJS export names for ESM import in node:
508
786
  0 && (module.exports = {
787
+ INFORMATION_SCOPE_CATEGORY_ORDER,
788
+ INFORMATION_SCOPE_CATEGORY_SUB,
509
789
  INFORMATION_SCOPE_POLICY_VERSION_ROW_NOTE,
510
790
  INFORMATION_SCOPE_READABLE_VERSIONS,
791
+ INFORMATION_SCOPE_ROW_HINT,
792
+ INFORMATION_SCOPE_ROW_ORDER,
511
793
  INFORMATION_SCOPE_SYSTEM_INFO,
794
+ INFORMATION_SCOPE_UI_COPY_SOURCE,
512
795
  INFORMATION_SCOPE_VERSION,
513
796
  createInformationScopeResolver,
514
797
  isScopeInstrumentRow,
515
798
  isScopeRestRow,
516
799
  isSelectableScopeRow,
517
800
  kindForPerson,
801
+ scopeCategorySub,
518
802
  scopeMigrationsFromSot,
519
- scopeRowsFromSot
803
+ scopeRowDisplayOrder,
804
+ scopeRowHint,
805
+ scopeRowsFromSot,
806
+ sortScopeCategories,
807
+ sortScopeRows
520
808
  });
521
809
  //# sourceMappingURL=index.cjs.map