@openhi/constructs 0.0.162 → 0.0.164
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/lib/{chunk-WOTU36P3.mjs → chunk-WFTDH2NM.mjs} +3 -2
- package/lib/chunk-WFTDH2NM.mjs.map +1 -0
- package/lib/{chunk-MLFMW5IF.mjs → chunk-XHG4SODS.mjs} +9 -5
- package/lib/chunk-XHG4SODS.mjs.map +1 -0
- package/lib/{chunk-7TRO2STL.mjs → chunk-ZODGX37H.mjs} +543 -46
- package/lib/chunk-ZODGX37H.mjs.map +1 -0
- package/lib/{events-TG654e7L.d.mts → events-dO9nxnPa.d.mts} +89 -4
- package/lib/{events-TG654e7L.d.ts → events-dO9nxnPa.d.ts} +89 -4
- package/lib/index.d.mts +1 -1
- package/lib/index.d.ts +90 -5
- package/lib/index.js +335 -52
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +46 -2
- package/lib/index.mjs.map +1 -1
- package/lib/pre-token-generation.handler.js +1 -0
- package/lib/pre-token-generation.handler.js.map +1 -1
- package/lib/pre-token-generation.handler.mjs +1 -1
- package/lib/provision-default-workspace.handler.js +9 -4
- package/lib/provision-default-workspace.handler.js.map +1 -1
- package/lib/provision-default-workspace.handler.mjs +2 -2
- package/lib/rest-api-lambda.handler.js +292 -287
- package/lib/rest-api-lambda.handler.js.map +1 -1
- package/lib/rest-api-lambda.handler.mjs +2 -2
- package/lib/seed-demo-data.handler.d.mts +4 -2
- package/lib/seed-demo-data.handler.d.ts +4 -2
- package/lib/seed-demo-data.handler.js +553 -74
- package/lib/seed-demo-data.handler.js.map +1 -1
- package/lib/seed-demo-data.handler.mjs +2 -2
- package/package.json +13 -13
- package/lib/chunk-7TRO2STL.mjs.map +0 -1
- package/lib/chunk-MLFMW5IF.mjs.map +0 -1
- package/lib/chunk-WOTU36P3.mjs.map +0 -1
|
@@ -785,59 +785,59 @@ var OPENHI_RESOURCE_URN_SYSTEM = "http://openhi.org/";
|
|
|
785
785
|
var DEMO_PERIOD = { start: "2026-01-01T00:00:00Z" };
|
|
786
786
|
var PLACEHOLDER_TENANT_ID = "placeholder-tenant-id";
|
|
787
787
|
var PLACEHOLDER_WORKSPACE_ID = "placeholder-workspace-id";
|
|
788
|
-
var ON_SITE_DEMO_TENANT_ID = "
|
|
789
|
-
var ON_SITE_DEMO_WORKSPACE_ID = "
|
|
788
|
+
var ON_SITE_DEMO_TENANT_ID = "01KDVDNKKD34R8DX97HRR0N69J";
|
|
789
|
+
var ON_SITE_DEMO_WORKSPACE_ID = "01KDVDPKNJ9MZYC1PH8S4VTC7S";
|
|
790
790
|
var DEV_USERS = [
|
|
791
791
|
{
|
|
792
|
-
id: "
|
|
792
|
+
id: "01KDVDZC15D5R37PTBR2WVHH94",
|
|
793
793
|
email: "russell@codedrifters.com",
|
|
794
794
|
firstName: "Russell",
|
|
795
795
|
lastName: "Ingram"
|
|
796
796
|
},
|
|
797
797
|
{
|
|
798
|
-
id: "
|
|
798
|
+
id: "01KDVDZWMSYTKC0MHRPYKCNDF3",
|
|
799
799
|
email: "cameron@codedrifters.com",
|
|
800
800
|
firstName: "Cameron",
|
|
801
801
|
lastName: "Childress"
|
|
802
802
|
},
|
|
803
803
|
{
|
|
804
|
-
id: "
|
|
804
|
+
id: "01KDVE1C1CK58EHD8C5SSGWJQW",
|
|
805
805
|
email: "neelima@codedrifters.com",
|
|
806
806
|
firstName: "Neelima",
|
|
807
807
|
lastName: "Ramaraju"
|
|
808
808
|
},
|
|
809
809
|
{
|
|
810
|
-
id: "
|
|
810
|
+
id: "01KDVE1W7T37E4SV629R2XC0EY",
|
|
811
811
|
email: "garon@codedrifters.com",
|
|
812
812
|
firstName: "Garon",
|
|
813
813
|
lastName: "Bailey"
|
|
814
814
|
},
|
|
815
815
|
{
|
|
816
|
-
id: "
|
|
816
|
+
id: "01KDVE31S7PDWE2PED771VAQP6",
|
|
817
817
|
email: "dave@codedrifters.com",
|
|
818
818
|
firstName: "Dave",
|
|
819
819
|
lastName: "Finlay"
|
|
820
820
|
},
|
|
821
821
|
{
|
|
822
|
-
id: "
|
|
822
|
+
id: "01KDVE4PZ61JTFT4S80KZ1BM4K",
|
|
823
823
|
email: "drew@codedrifters.com",
|
|
824
824
|
firstName: "Drew",
|
|
825
825
|
lastName: "Morris"
|
|
826
826
|
},
|
|
827
827
|
{
|
|
828
|
-
id: "
|
|
828
|
+
id: "01KDVE69RQ4GK8APBG1FFS0P5S",
|
|
829
829
|
email: "jessica@codedrifters.com",
|
|
830
830
|
firstName: "Jessica",
|
|
831
831
|
lastName: "Branks"
|
|
832
832
|
},
|
|
833
833
|
{
|
|
834
|
-
id: "
|
|
834
|
+
id: "01KDVE7Q07TCMSS154HGKZWCYY",
|
|
835
835
|
email: "jared@codedrifters.com",
|
|
836
836
|
firstName: "Jared",
|
|
837
837
|
lastName: "Trotter"
|
|
838
838
|
},
|
|
839
839
|
{
|
|
840
|
-
id: "
|
|
840
|
+
id: "01KDVE8HWP9H361ZBQ4M1D5PGK",
|
|
841
841
|
email: "goddess@codedrifters.com",
|
|
842
842
|
firstName: "Goddess",
|
|
843
843
|
lastName: "Culberson"
|
|
@@ -852,25 +852,33 @@ var DEV_USERS = [
|
|
|
852
852
|
// out of band, and the seeded Cognito user picks it up via
|
|
853
853
|
// AdminSetUserPassword on every seed run.
|
|
854
854
|
{
|
|
855
|
-
id: "
|
|
855
|
+
id: "01KDVE99B649JPDTB8BX15XZVH",
|
|
856
856
|
email: "e2e-admin-console@codedrifters.com",
|
|
857
857
|
firstName: "E2E",
|
|
858
858
|
lastName: "AdminConsole"
|
|
859
859
|
}
|
|
860
860
|
];
|
|
861
|
+
var DEMO_WOUND_CARE_TENANT_ID = "01KDVDQTK67CT2EEJ9DNMYSX05";
|
|
862
|
+
var DEMO_WOUND_CARE_WORKSPACE_ID = "01KDVDRVPEDF48EAZCRSR7QSW5";
|
|
863
|
+
var DEMO_PRIMARY_CARE_TENANT_ID = "01KDVDTC89KK3422W49AXCDW3Q";
|
|
864
|
+
var DEMO_PRIMARY_CARE_WORKSPACE_ID = "01KDVDVEMA0TEFDGPX6TDRJ857";
|
|
865
|
+
var DEMO_MIXED_TENANT_ID = "01KDVDWQFMN07BY8QSVZQA5AS9";
|
|
866
|
+
var DEMO_MIXED_WORKSPACE_WOUND_CARE_ID = "01KDVDXJSHA1C3B1NY1QEZRMK2";
|
|
867
|
+
var DEMO_MIXED_WORKSPACE_PRIMARY_CARE_ID = "01KDVDYQBFSRE80N3PZQXWEB3Y";
|
|
868
|
+
var PLACEHOLDER_TENANT_SPEC = {
|
|
869
|
+
scenario: "placeholder",
|
|
870
|
+
tenantId: PLACEHOLDER_TENANT_ID,
|
|
871
|
+
tenantName: "OpenHI Placeholder Tenant",
|
|
872
|
+
workspaces: [
|
|
873
|
+
{
|
|
874
|
+
id: PLACEHOLDER_WORKSPACE_ID,
|
|
875
|
+
name: "OpenHI Placeholder Workspace",
|
|
876
|
+
roleSuffix: "workspace"
|
|
877
|
+
}
|
|
878
|
+
]
|
|
879
|
+
};
|
|
861
880
|
var DEMO_TENANT_SPECS = [
|
|
862
|
-
|
|
863
|
-
scenario: "placeholder",
|
|
864
|
-
tenantId: PLACEHOLDER_TENANT_ID,
|
|
865
|
-
tenantName: "OpenHI Placeholder Tenant",
|
|
866
|
-
workspaces: [
|
|
867
|
-
{
|
|
868
|
-
id: PLACEHOLDER_WORKSPACE_ID,
|
|
869
|
-
name: "OpenHI Placeholder Workspace",
|
|
870
|
-
roleSuffix: "workspace"
|
|
871
|
-
}
|
|
872
|
-
]
|
|
873
|
-
},
|
|
881
|
+
PLACEHOLDER_TENANT_SPEC,
|
|
874
882
|
{
|
|
875
883
|
scenario: "on-site-demo",
|
|
876
884
|
tenantId: ON_SITE_DEMO_TENANT_ID,
|
|
@@ -885,11 +893,11 @@ var DEMO_TENANT_SPECS = [
|
|
|
885
893
|
},
|
|
886
894
|
{
|
|
887
895
|
scenario: "demo-wound-care",
|
|
888
|
-
tenantId:
|
|
896
|
+
tenantId: DEMO_WOUND_CARE_TENANT_ID,
|
|
889
897
|
tenantName: "Cedarbrook Wound Healing Institute",
|
|
890
898
|
workspaces: [
|
|
891
899
|
{
|
|
892
|
-
id:
|
|
900
|
+
id: DEMO_WOUND_CARE_WORKSPACE_ID,
|
|
893
901
|
name: "Cedarbrook Outpatient Wound Clinic",
|
|
894
902
|
roleSuffix: "workspace"
|
|
895
903
|
}
|
|
@@ -897,11 +905,11 @@ var DEMO_TENANT_SPECS = [
|
|
|
897
905
|
},
|
|
898
906
|
{
|
|
899
907
|
scenario: "demo-primary-care",
|
|
900
|
-
tenantId:
|
|
908
|
+
tenantId: DEMO_PRIMARY_CARE_TENANT_ID,
|
|
901
909
|
tenantName: "Maple Ridge Family Medicine",
|
|
902
910
|
workspaces: [
|
|
903
911
|
{
|
|
904
|
-
id:
|
|
912
|
+
id: DEMO_PRIMARY_CARE_WORKSPACE_ID,
|
|
905
913
|
name: "Maple Ridge Main Street Office",
|
|
906
914
|
roleSuffix: "workspace"
|
|
907
915
|
}
|
|
@@ -909,22 +917,249 @@ var DEMO_TENANT_SPECS = [
|
|
|
909
917
|
},
|
|
910
918
|
{
|
|
911
919
|
scenario: "demo-mixed",
|
|
912
|
-
tenantId:
|
|
920
|
+
tenantId: DEMO_MIXED_TENANT_ID,
|
|
913
921
|
tenantName: "Northbridge Health Network",
|
|
914
922
|
workspaces: [
|
|
915
923
|
{
|
|
916
|
-
id:
|
|
924
|
+
id: DEMO_MIXED_WORKSPACE_WOUND_CARE_ID,
|
|
917
925
|
name: "Northbridge Wound Care Center",
|
|
918
926
|
roleSuffix: "workspace-wound-care"
|
|
919
927
|
},
|
|
920
928
|
{
|
|
921
|
-
id:
|
|
929
|
+
id: DEMO_MIXED_WORKSPACE_PRIMARY_CARE_ID,
|
|
922
930
|
name: "Northbridge Family Practice",
|
|
923
931
|
roleSuffix: "workspace-primary-care"
|
|
924
932
|
}
|
|
925
933
|
]
|
|
926
934
|
}
|
|
927
935
|
];
|
|
936
|
+
var ON_SITE_WOUNDS_TENANT_ID = "01KDY03CJBF6FWQG9B8WXYXXS6";
|
|
937
|
+
var ON_SITE_WOUNDS_OKLAHOMA_WORKSPACE_ID = "01KDY03KW88CNSGKNB89M7FS2X";
|
|
938
|
+
var ON_SITE_WOUNDS_TEXAS_WORKSPACE_ID = "01KDY04FCGYXVQGS24S0NG1ETM";
|
|
939
|
+
var ON_SITE_MEDICAL_TENANT_ID = "01KDY063WE34DWA3J5260BSEME";
|
|
940
|
+
var ON_SITE_MEDICAL_OKLAHOMA_WORKSPACE_ID = "01KDY06QV8DKYJJZ7X1DP0GGDD";
|
|
941
|
+
var ON_SITE_MEDICAL_TEXAS_WORKSPACE_ID = "01KDY074RZXRZS5K9TBRCVVSX1";
|
|
942
|
+
var ON_SITE_CLINIC_TENANT_ID = "01KDY07XGSMPX7AAM6ZJN8HWS2";
|
|
943
|
+
var ON_SITE_CLINIC_OKLAHOMA_WORKSPACE_ID = "01KDY08F0J7DPTM7XZKV72QFNV";
|
|
944
|
+
var ON_SITE_CLINIC_TEXAS_WORKSPACE_ID = "01KDY0A1YYY5TT4A1SP96KTF0G";
|
|
945
|
+
var ON_SITE_UAT_TENANT_SPECS = [
|
|
946
|
+
{
|
|
947
|
+
scenario: "on-site-wounds",
|
|
948
|
+
tenantId: ON_SITE_WOUNDS_TENANT_ID,
|
|
949
|
+
tenantName: "On-Site Wounds",
|
|
950
|
+
workspaces: [
|
|
951
|
+
{
|
|
952
|
+
id: ON_SITE_WOUNDS_OKLAHOMA_WORKSPACE_ID,
|
|
953
|
+
name: "Oklahoma",
|
|
954
|
+
roleSuffix: "workspace-oklahoma"
|
|
955
|
+
},
|
|
956
|
+
{
|
|
957
|
+
id: ON_SITE_WOUNDS_TEXAS_WORKSPACE_ID,
|
|
958
|
+
name: "Texas",
|
|
959
|
+
roleSuffix: "workspace-texas"
|
|
960
|
+
}
|
|
961
|
+
]
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
scenario: "on-site-medical",
|
|
965
|
+
tenantId: ON_SITE_MEDICAL_TENANT_ID,
|
|
966
|
+
tenantName: "On-Site Medical",
|
|
967
|
+
workspaces: [
|
|
968
|
+
{
|
|
969
|
+
id: ON_SITE_MEDICAL_OKLAHOMA_WORKSPACE_ID,
|
|
970
|
+
name: "Oklahoma",
|
|
971
|
+
roleSuffix: "workspace-oklahoma"
|
|
972
|
+
},
|
|
973
|
+
{
|
|
974
|
+
id: ON_SITE_MEDICAL_TEXAS_WORKSPACE_ID,
|
|
975
|
+
name: "Texas",
|
|
976
|
+
roleSuffix: "workspace-texas"
|
|
977
|
+
}
|
|
978
|
+
]
|
|
979
|
+
},
|
|
980
|
+
{
|
|
981
|
+
scenario: "on-site-clinic",
|
|
982
|
+
tenantId: ON_SITE_CLINIC_TENANT_ID,
|
|
983
|
+
tenantName: "On-Site Clinic",
|
|
984
|
+
workspaces: [
|
|
985
|
+
{
|
|
986
|
+
id: ON_SITE_CLINIC_OKLAHOMA_WORKSPACE_ID,
|
|
987
|
+
name: "Oklahoma",
|
|
988
|
+
roleSuffix: "workspace-oklahoma"
|
|
989
|
+
},
|
|
990
|
+
{
|
|
991
|
+
id: ON_SITE_CLINIC_TEXAS_WORKSPACE_ID,
|
|
992
|
+
name: "Texas",
|
|
993
|
+
roleSuffix: "workspace-texas"
|
|
994
|
+
}
|
|
995
|
+
]
|
|
996
|
+
}
|
|
997
|
+
];
|
|
998
|
+
var ON_SITE_TESTERS = [
|
|
999
|
+
{
|
|
1000
|
+
id: "01KE0JG26M0CGFFP9P71PJHXKZ",
|
|
1001
|
+
email: "kim@onsitewounds.com",
|
|
1002
|
+
displayName: "Kim Leland, RN",
|
|
1003
|
+
given: "Kim",
|
|
1004
|
+
family: "Leland",
|
|
1005
|
+
role: import_types.PLATFORM_ROLE_CODE.TENANT_ADMIN
|
|
1006
|
+
},
|
|
1007
|
+
{
|
|
1008
|
+
id: "01KE0JH2X6XCJAY8FVJKKKHBGK",
|
|
1009
|
+
email: "kera@onsitewounds.com",
|
|
1010
|
+
displayName: "Kera Morris",
|
|
1011
|
+
given: "Kera",
|
|
1012
|
+
family: "Morris",
|
|
1013
|
+
role: import_types.PLATFORM_ROLE_CODE.TENANT_ADMIN
|
|
1014
|
+
},
|
|
1015
|
+
{
|
|
1016
|
+
id: "01KE0JHPB9K6AJNDYFDE17SQXT",
|
|
1017
|
+
email: "nicole@onsitemed.com",
|
|
1018
|
+
displayName: "Nicole Smith",
|
|
1019
|
+
given: "Nicole",
|
|
1020
|
+
family: "Smith",
|
|
1021
|
+
role: import_types.PLATFORM_ROLE_CODE.TENANT_ADMIN
|
|
1022
|
+
},
|
|
1023
|
+
{
|
|
1024
|
+
id: "01KE0JJKAV56ECSSYHNZENCTTW",
|
|
1025
|
+
email: "sidney@onsitewounds.com",
|
|
1026
|
+
displayName: "Sidney Vaughn",
|
|
1027
|
+
given: "Sidney",
|
|
1028
|
+
family: "Vaughn",
|
|
1029
|
+
role: import_types.PLATFORM_ROLE_CODE.TENANT_USER
|
|
1030
|
+
},
|
|
1031
|
+
{
|
|
1032
|
+
id: "01KE0JKX2ZK5H93JFFP1V8T3MF",
|
|
1033
|
+
email: "chelsea@onsitewounds.com",
|
|
1034
|
+
displayName: "Chelsea Romine",
|
|
1035
|
+
given: "Chelsea",
|
|
1036
|
+
family: "Romine",
|
|
1037
|
+
role: import_types.PLATFORM_ROLE_CODE.TENANT_USER
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
id: "01KE0JMWHW7HYB8DZD4J70PVSD",
|
|
1041
|
+
email: "drmetheny@onsitewounds.com",
|
|
1042
|
+
displayName: "Dr. Heidi Metheny",
|
|
1043
|
+
given: "Heidi",
|
|
1044
|
+
family: "Metheny",
|
|
1045
|
+
role: import_types.PLATFORM_ROLE_CODE.TENANT_USER
|
|
1046
|
+
},
|
|
1047
|
+
{
|
|
1048
|
+
id: "01KE0JP9GEJR7JT0GNAB502DBV",
|
|
1049
|
+
email: "drtucker@onsitewounds.com",
|
|
1050
|
+
displayName: "Dr. Tucker",
|
|
1051
|
+
family: "Tucker",
|
|
1052
|
+
role: import_types.PLATFORM_ROLE_CODE.TENANT_USER
|
|
1053
|
+
},
|
|
1054
|
+
{
|
|
1055
|
+
id: "01KE0JPMV1X8Y5DQS3MYEJQP3T",
|
|
1056
|
+
email: "drwright@onsitewounds.com",
|
|
1057
|
+
displayName: "Dr. Wright",
|
|
1058
|
+
family: "Wright",
|
|
1059
|
+
role: import_types.PLATFORM_ROLE_CODE.TENANT_USER
|
|
1060
|
+
},
|
|
1061
|
+
{
|
|
1062
|
+
id: "01KE0JQ18T3BGQZWK1SRY5J73K",
|
|
1063
|
+
email: "lauren@onsitewounds.com",
|
|
1064
|
+
displayName: "Lauren",
|
|
1065
|
+
given: "Lauren",
|
|
1066
|
+
role: import_types.PLATFORM_ROLE_CODE.TENANT_USER
|
|
1067
|
+
},
|
|
1068
|
+
{
|
|
1069
|
+
id: "01KE0JQBG3X26EHWKBT71AYT6Y",
|
|
1070
|
+
email: "caity.np@onsitewounds.com",
|
|
1071
|
+
displayName: "Caity",
|
|
1072
|
+
given: "Caity",
|
|
1073
|
+
role: import_types.PLATFORM_ROLE_CODE.TENANT_USER
|
|
1074
|
+
},
|
|
1075
|
+
{
|
|
1076
|
+
id: "01KE0JS0VC6SDB9Q0S1XTKC031",
|
|
1077
|
+
email: "shelly@onsitewounds.com",
|
|
1078
|
+
displayName: "Shelly",
|
|
1079
|
+
given: "Shelly",
|
|
1080
|
+
role: import_types.PLATFORM_ROLE_CODE.TENANT_USER
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
id: "01KE0JS90A94R4E2M1K6HMB0K6",
|
|
1084
|
+
email: "kimi@onsitewounds.com",
|
|
1085
|
+
displayName: "Kimi",
|
|
1086
|
+
given: "Kimi",
|
|
1087
|
+
role: import_types.PLATFORM_ROLE_CODE.TENANT_USER
|
|
1088
|
+
},
|
|
1089
|
+
{
|
|
1090
|
+
id: "01KE0JSH6B4A5SPJ65V1PQEHZA",
|
|
1091
|
+
email: "erika@onsitemed.com",
|
|
1092
|
+
displayName: "Erika Fernandez, MA",
|
|
1093
|
+
given: "Erika",
|
|
1094
|
+
family: "Fernandez",
|
|
1095
|
+
role: import_types.PLATFORM_ROLE_CODE.TENANT_USER
|
|
1096
|
+
},
|
|
1097
|
+
{
|
|
1098
|
+
id: "01KE0JSQ6CWSCJS25PJEKQWGWM",
|
|
1099
|
+
email: "dr.nguyen@onsiteprimary.com",
|
|
1100
|
+
displayName: "Dr. Nguyen",
|
|
1101
|
+
family: "Nguyen",
|
|
1102
|
+
role: import_types.PLATFORM_ROLE_CODE.TENANT_USER
|
|
1103
|
+
},
|
|
1104
|
+
// Extended UAT roster — all `tenant-admin` for now (tenant-scoped
|
|
1105
|
+
// only; no platform/system-admin). Members of all three on-site
|
|
1106
|
+
// tenants + both workspaces in each, and of the placeholder tenant.
|
|
1107
|
+
{
|
|
1108
|
+
id: "01KSSZ3K6BNZB6D18TTK5TQ9FA",
|
|
1109
|
+
email: "ashton@onsitewounds.com",
|
|
1110
|
+
displayName: "Ashton",
|
|
1111
|
+
given: "Ashton",
|
|
1112
|
+
role: import_types.PLATFORM_ROLE_CODE.TENANT_ADMIN
|
|
1113
|
+
},
|
|
1114
|
+
{
|
|
1115
|
+
id: "01KSSZ3K6C8B7SWHHRVA2HPWNA",
|
|
1116
|
+
email: "debbie@onsitewounds.com",
|
|
1117
|
+
displayName: "Debbie",
|
|
1118
|
+
given: "Debbie",
|
|
1119
|
+
role: import_types.PLATFORM_ROLE_CODE.TENANT_ADMIN
|
|
1120
|
+
},
|
|
1121
|
+
{
|
|
1122
|
+
id: "01KSSZ3K6CMEHW5EG2P474VDFE",
|
|
1123
|
+
email: "kim.berkey@onsiteprimary.com",
|
|
1124
|
+
displayName: "Kim Berkey",
|
|
1125
|
+
given: "Kim",
|
|
1126
|
+
family: "Berkey",
|
|
1127
|
+
role: import_types.PLATFORM_ROLE_CODE.TENANT_ADMIN
|
|
1128
|
+
},
|
|
1129
|
+
{
|
|
1130
|
+
id: "01KSSZ3K6CYF9FXAS515YEZEB0",
|
|
1131
|
+
email: "fanniesha@onsitewounds.com",
|
|
1132
|
+
displayName: "Fanniesha",
|
|
1133
|
+
given: "Fanniesha",
|
|
1134
|
+
role: import_types.PLATFORM_ROLE_CODE.TENANT_ADMIN
|
|
1135
|
+
},
|
|
1136
|
+
{
|
|
1137
|
+
id: "01KSSZ3K6CDZ90PF1BQBWX55YT",
|
|
1138
|
+
email: "brittany.jones@onsitewounds.com",
|
|
1139
|
+
displayName: "Brittany Jones",
|
|
1140
|
+
given: "Brittany",
|
|
1141
|
+
family: "Jones",
|
|
1142
|
+
role: import_types.PLATFORM_ROLE_CODE.TENANT_ADMIN
|
|
1143
|
+
},
|
|
1144
|
+
{
|
|
1145
|
+
id: "01KSSZ3K6C145GCG0ZH03DQJ0R",
|
|
1146
|
+
email: "sabrina@onsiteprimary.com",
|
|
1147
|
+
displayName: "Sabrina",
|
|
1148
|
+
given: "Sabrina",
|
|
1149
|
+
role: import_types.PLATFORM_ROLE_CODE.TENANT_ADMIN
|
|
1150
|
+
},
|
|
1151
|
+
{
|
|
1152
|
+
id: "01KSSZ3K6CQZBJGVME470DJQFP",
|
|
1153
|
+
email: "stacey.cauthen@onsitewounds.com",
|
|
1154
|
+
displayName: "Stacey Cauthen",
|
|
1155
|
+
given: "Stacey",
|
|
1156
|
+
family: "Cauthen",
|
|
1157
|
+
role: import_types.PLATFORM_ROLE_CODE.TENANT_ADMIN
|
|
1158
|
+
}
|
|
1159
|
+
];
|
|
1160
|
+
var onSiteTenantMembershipId = (userId, tenantId) => `onsite-membership-${userId}-${tenantId}`;
|
|
1161
|
+
var onSiteWorkspaceMembershipId = (userId, workspaceId) => `onsite-membership-${userId}-ws-${workspaceId}`;
|
|
1162
|
+
var onSiteRoleAssignmentId = (userId, tenantId, roleCode) => `onsite-roleassignment-${userId}-${tenantId}-${roleCode}`;
|
|
928
1163
|
var demoMembershipId = (devUserId, tenantId) => `demo-membership-${devUserId}-${tenantId}`;
|
|
929
1164
|
var demoRoleAssignmentId = (devUserId, tenantId, roleCode) => `demo-roleassignment-${devUserId}-${tenantId}-${roleCode}`;
|
|
930
1165
|
var demoScenarioIdentifier = (scenario, roleSuffix) => ({
|
|
@@ -4453,26 +4688,26 @@ var DEMO_DATA_PLANE_FIXTURES = [
|
|
|
4453
4688
|
ON_SITE_DEMO_FIXTURES,
|
|
4454
4689
|
buildWoundCareFixtures(
|
|
4455
4690
|
"demo-wound-care",
|
|
4456
|
-
|
|
4457
|
-
|
|
4691
|
+
DEMO_WOUND_CARE_TENANT_ID,
|
|
4692
|
+
DEMO_WOUND_CARE_WORKSPACE_ID,
|
|
4458
4693
|
"demo-wound-care"
|
|
4459
4694
|
),
|
|
4460
4695
|
buildPrimaryCareFixtures(
|
|
4461
4696
|
"demo-primary-care",
|
|
4462
|
-
|
|
4463
|
-
|
|
4697
|
+
DEMO_PRIMARY_CARE_TENANT_ID,
|
|
4698
|
+
DEMO_PRIMARY_CARE_WORKSPACE_ID,
|
|
4464
4699
|
"demo-primary-care"
|
|
4465
4700
|
),
|
|
4466
4701
|
buildWoundCareFixtures(
|
|
4467
4702
|
"demo-mixed",
|
|
4468
|
-
|
|
4469
|
-
|
|
4703
|
+
DEMO_MIXED_TENANT_ID,
|
|
4704
|
+
DEMO_MIXED_WORKSPACE_WOUND_CARE_ID,
|
|
4470
4705
|
"demo-mixed-wound-care"
|
|
4471
4706
|
),
|
|
4472
4707
|
buildPrimaryCareFixtures(
|
|
4473
4708
|
"demo-mixed",
|
|
4474
|
-
|
|
4475
|
-
|
|
4709
|
+
DEMO_MIXED_TENANT_ID,
|
|
4710
|
+
DEMO_MIXED_WORKSPACE_PRIMARY_CARE_ID,
|
|
4476
4711
|
"demo-mixed-primary-care"
|
|
4477
4712
|
)
|
|
4478
4713
|
];
|
|
@@ -6401,6 +6636,7 @@ var ConflictError = class extends DomainError {
|
|
|
6401
6636
|
|
|
6402
6637
|
// src/data/operations/control/membership/membership-create-operation.ts
|
|
6403
6638
|
var import_types5 = require("@openhi/types");
|
|
6639
|
+
var import_ulid = require("ulid");
|
|
6404
6640
|
|
|
6405
6641
|
// src/data/operations/control/membership/membership-user-projection.ts
|
|
6406
6642
|
var import_types3 = require("@openhi/types");
|
|
@@ -6682,7 +6918,7 @@ function extractCancellationReasons(err) {
|
|
|
6682
6918
|
async function createMembershipOperation(params) {
|
|
6683
6919
|
const { context, body, tableName } = params;
|
|
6684
6920
|
const service = getDynamoControlService(tableName);
|
|
6685
|
-
const id = body.id ??
|
|
6921
|
+
const id = body.id ?? (0, import_ulid.ulid)();
|
|
6686
6922
|
const parsedResource = typeof body.resource === "string" ? JSON.parse(body.resource) : body.resource ?? {};
|
|
6687
6923
|
const lastUpdated = context.date ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
6688
6924
|
const vid = `1`;
|
|
@@ -6811,6 +7047,7 @@ async function getRoleByIdOperation(params) {
|
|
|
6811
7047
|
|
|
6812
7048
|
// src/data/operations/control/roleassignment/roleassignment-create-operation.ts
|
|
6813
7049
|
var import_types8 = require("@openhi/types");
|
|
7050
|
+
var import_ulid2 = require("ulid");
|
|
6814
7051
|
|
|
6815
7052
|
// src/data/operations/control/roleassignment/roleassignment-user-projection.ts
|
|
6816
7053
|
var import_types6 = require("@openhi/types");
|
|
@@ -6932,7 +7169,7 @@ async function assertUserHasTenantMembershipOperation(params) {
|
|
|
6932
7169
|
async function createRoleAssignmentOperation(params) {
|
|
6933
7170
|
const { context, body, tableName } = params;
|
|
6934
7171
|
const service = getDynamoControlService(tableName);
|
|
6935
|
-
const id = body.id ??
|
|
7172
|
+
const id = body.id ?? (0, import_ulid2.ulid)();
|
|
6936
7173
|
const parsedResource = typeof body.resource === "string" ? JSON.parse(body.resource) : body.resource ?? {};
|
|
6937
7174
|
const lastUpdated = context.date ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
6938
7175
|
const vid = `1`;
|
|
@@ -7048,10 +7285,11 @@ async function createRoleAssignmentOperation(params) {
|
|
|
7048
7285
|
|
|
7049
7286
|
// src/data/operations/control/tenant/tenant-create-operation.ts
|
|
7050
7287
|
var import_types9 = require("@openhi/types");
|
|
7288
|
+
var import_ulid3 = require("ulid");
|
|
7051
7289
|
async function createTenantOperation(params) {
|
|
7052
7290
|
const { context, body, tableName } = params;
|
|
7053
7291
|
const service = getDynamoControlService(tableName);
|
|
7054
|
-
const id = body.id ??
|
|
7292
|
+
const id = body.id ?? (0, import_ulid3.ulid)();
|
|
7055
7293
|
const lastUpdated = context.date;
|
|
7056
7294
|
const vid = lastUpdated.replace(/[-:T.Z]/g, "").slice(0, 12) || Date.now().toString(36);
|
|
7057
7295
|
const parsedResource = typeof body.resource === "string" ? JSON.parse(body.resource) : body.resource ?? {};
|
|
@@ -7070,6 +7308,7 @@ async function createTenantOperation(params) {
|
|
|
7070
7308
|
|
|
7071
7309
|
// src/data/operations/control/workspace/workspace-create-operation.ts
|
|
7072
7310
|
var import_types11 = require("@openhi/types");
|
|
7311
|
+
var import_ulid4 = require("ulid");
|
|
7073
7312
|
|
|
7074
7313
|
// src/data/dynamo/dynamo-data-service.ts
|
|
7075
7314
|
var import_electrodb16 = require("electrodb");
|
|
@@ -8229,7 +8468,7 @@ async function createWorkspaceOperation(params) {
|
|
|
8229
8468
|
const { context, body, tableName } = params;
|
|
8230
8469
|
const { tenantId } = context;
|
|
8231
8470
|
const service = getDynamoControlService(tableName);
|
|
8232
|
-
const id = body.id ??
|
|
8471
|
+
const id = body.id ?? (0, import_ulid4.ulid)();
|
|
8233
8472
|
const lastUpdated = context.date;
|
|
8234
8473
|
const vid = lastUpdated.replace(/[-:T.Z]/g, "").slice(0, 12) || Date.now().toString(36);
|
|
8235
8474
|
const parsedResource = typeof body.resource === "string" ? JSON.parse(body.resource) : body.resource ?? {};
|
|
@@ -8258,11 +8497,11 @@ async function createWorkspaceOperation(params) {
|
|
|
8258
8497
|
}
|
|
8259
8498
|
|
|
8260
8499
|
// src/data/operations/data/account/account-create-operation.ts
|
|
8261
|
-
var
|
|
8500
|
+
var import_ulid5 = require("ulid");
|
|
8262
8501
|
async function createAccountOperation(params) {
|
|
8263
8502
|
const { context, body, tableName } = params;
|
|
8264
8503
|
const { tenantId, workspaceId, date, actorId, actorName } = context;
|
|
8265
|
-
const id = body.id ?? (0,
|
|
8504
|
+
const id = body.id ?? (0, import_ulid5.ulid)();
|
|
8266
8505
|
const meta = {
|
|
8267
8506
|
...body.meta ?? {},
|
|
8268
8507
|
lastUpdated: date,
|
|
@@ -8293,11 +8532,11 @@ async function createAccountOperation(params) {
|
|
|
8293
8532
|
}
|
|
8294
8533
|
|
|
8295
8534
|
// src/data/operations/data/appointment/appointment-create-operation.ts
|
|
8296
|
-
var
|
|
8535
|
+
var import_ulid6 = require("ulid");
|
|
8297
8536
|
async function createAppointmentOperation(params) {
|
|
8298
8537
|
const { context, body, tableName } = params;
|
|
8299
8538
|
const { tenantId, workspaceId, date, actorId, actorName } = context;
|
|
8300
|
-
const id = body.id ?? (0,
|
|
8539
|
+
const id = body.id ?? (0, import_ulid6.ulid)();
|
|
8301
8540
|
const meta = {
|
|
8302
8541
|
...body.meta ?? {},
|
|
8303
8542
|
lastUpdated: date,
|
|
@@ -8328,11 +8567,11 @@ async function createAppointmentOperation(params) {
|
|
|
8328
8567
|
}
|
|
8329
8568
|
|
|
8330
8569
|
// src/data/operations/data/claim/claim-create-operation.ts
|
|
8331
|
-
var
|
|
8570
|
+
var import_ulid7 = require("ulid");
|
|
8332
8571
|
async function createClaimOperation(params) {
|
|
8333
8572
|
const { context, body, tableName } = params;
|
|
8334
8573
|
const { tenantId, workspaceId, date, actorId, actorName } = context;
|
|
8335
|
-
const id = body.id ?? (0,
|
|
8574
|
+
const id = body.id ?? (0, import_ulid7.ulid)();
|
|
8336
8575
|
const meta = {
|
|
8337
8576
|
...body.meta ?? {},
|
|
8338
8577
|
lastUpdated: date,
|
|
@@ -8363,11 +8602,11 @@ async function createClaimOperation(params) {
|
|
|
8363
8602
|
}
|
|
8364
8603
|
|
|
8365
8604
|
// src/data/operations/data/condition/condition-create-operation.ts
|
|
8366
|
-
var
|
|
8605
|
+
var import_ulid8 = require("ulid");
|
|
8367
8606
|
async function createConditionOperation(params) {
|
|
8368
8607
|
const { context, body, tableName } = params;
|
|
8369
8608
|
const { tenantId, workspaceId, date, actorId, actorName } = context;
|
|
8370
|
-
const id = body.id ?? (0,
|
|
8609
|
+
const id = body.id ?? (0, import_ulid8.ulid)();
|
|
8371
8610
|
const meta = {
|
|
8372
8611
|
...body.meta ?? {},
|
|
8373
8612
|
lastUpdated: date,
|
|
@@ -8398,11 +8637,11 @@ async function createConditionOperation(params) {
|
|
|
8398
8637
|
}
|
|
8399
8638
|
|
|
8400
8639
|
// src/data/operations/data/coverage/coverage-create-operation.ts
|
|
8401
|
-
var
|
|
8640
|
+
var import_ulid9 = require("ulid");
|
|
8402
8641
|
async function createCoverageOperation(params) {
|
|
8403
8642
|
const { context, body, tableName } = params;
|
|
8404
8643
|
const { tenantId, workspaceId, date, actorId, actorName } = context;
|
|
8405
|
-
const id = body.id ?? (0,
|
|
8644
|
+
const id = body.id ?? (0, import_ulid9.ulid)();
|
|
8406
8645
|
const meta = {
|
|
8407
8646
|
...body.meta ?? {},
|
|
8408
8647
|
lastUpdated: date,
|
|
@@ -8433,11 +8672,11 @@ async function createCoverageOperation(params) {
|
|
|
8433
8672
|
}
|
|
8434
8673
|
|
|
8435
8674
|
// src/data/operations/data/encounter/encounter-create-operation.ts
|
|
8436
|
-
var
|
|
8675
|
+
var import_ulid10 = require("ulid");
|
|
8437
8676
|
async function createEncounterOperation(params) {
|
|
8438
8677
|
const { context, body, tableName } = params;
|
|
8439
8678
|
const { tenantId, workspaceId, date, actorId, actorName } = context;
|
|
8440
|
-
const id = body.id ?? (0,
|
|
8679
|
+
const id = body.id ?? (0, import_ulid10.ulid)();
|
|
8441
8680
|
const meta = {
|
|
8442
8681
|
...body.meta ?? {},
|
|
8443
8682
|
lastUpdated: date,
|
|
@@ -8468,11 +8707,11 @@ async function createEncounterOperation(params) {
|
|
|
8468
8707
|
}
|
|
8469
8708
|
|
|
8470
8709
|
// src/data/operations/data/location/location-create-operation.ts
|
|
8471
|
-
var
|
|
8710
|
+
var import_ulid11 = require("ulid");
|
|
8472
8711
|
async function createLocationOperation(params) {
|
|
8473
8712
|
const { context, body, tableName } = params;
|
|
8474
8713
|
const { tenantId, workspaceId, date, actorId, actorName } = context;
|
|
8475
|
-
const id = body.id ?? (0,
|
|
8714
|
+
const id = body.id ?? (0, import_ulid11.ulid)();
|
|
8476
8715
|
const meta = {
|
|
8477
8716
|
...body.meta ?? {},
|
|
8478
8717
|
lastUpdated: date,
|
|
@@ -8503,11 +8742,11 @@ async function createLocationOperation(params) {
|
|
|
8503
8742
|
}
|
|
8504
8743
|
|
|
8505
8744
|
// src/data/operations/data/observation/observation-create-operation.ts
|
|
8506
|
-
var
|
|
8745
|
+
var import_ulid12 = require("ulid");
|
|
8507
8746
|
async function createObservationOperation(params) {
|
|
8508
8747
|
const { context, body, tableName } = params;
|
|
8509
8748
|
const { tenantId, workspaceId, date, actorId, actorName } = context;
|
|
8510
|
-
const id = body.id ?? (0,
|
|
8749
|
+
const id = body.id ?? (0, import_ulid12.ulid)();
|
|
8511
8750
|
const meta = {
|
|
8512
8751
|
...body.meta ?? {},
|
|
8513
8752
|
lastUpdated: date,
|
|
@@ -8538,11 +8777,11 @@ async function createObservationOperation(params) {
|
|
|
8538
8777
|
}
|
|
8539
8778
|
|
|
8540
8779
|
// src/data/operations/data/organization/organization-create-operation.ts
|
|
8541
|
-
var
|
|
8780
|
+
var import_ulid13 = require("ulid");
|
|
8542
8781
|
async function createOrganizationOperation(params) {
|
|
8543
8782
|
const { context, body, tableName } = params;
|
|
8544
8783
|
const { tenantId, workspaceId, date, actorId, actorName } = context;
|
|
8545
|
-
const id = body.id ?? (0,
|
|
8784
|
+
const id = body.id ?? (0, import_ulid13.ulid)();
|
|
8546
8785
|
const meta = {
|
|
8547
8786
|
...body.meta ?? {},
|
|
8548
8787
|
lastUpdated: date,
|
|
@@ -8573,11 +8812,11 @@ async function createOrganizationOperation(params) {
|
|
|
8573
8812
|
}
|
|
8574
8813
|
|
|
8575
8814
|
// src/data/operations/data/patient/patient-create-operation.ts
|
|
8576
|
-
var
|
|
8815
|
+
var import_ulid14 = require("ulid");
|
|
8577
8816
|
async function createPatientOperation(params) {
|
|
8578
8817
|
const { context, body, tableName } = params;
|
|
8579
8818
|
const { tenantId, workspaceId, date, actorId, actorName } = context;
|
|
8580
|
-
const id = body.id ?? (0,
|
|
8819
|
+
const id = body.id ?? (0, import_ulid14.ulid)();
|
|
8581
8820
|
const meta = {
|
|
8582
8821
|
...body.meta ?? {},
|
|
8583
8822
|
lastUpdated: date,
|
|
@@ -8608,11 +8847,11 @@ async function createPatientOperation(params) {
|
|
|
8608
8847
|
}
|
|
8609
8848
|
|
|
8610
8849
|
// src/data/operations/data/paymentnotice/paymentnotice-create-operation.ts
|
|
8611
|
-
var
|
|
8850
|
+
var import_ulid15 = require("ulid");
|
|
8612
8851
|
async function createPaymentNoticeOperation(params) {
|
|
8613
8852
|
const { context, body, tableName } = params;
|
|
8614
8853
|
const { tenantId, workspaceId, date, actorId, actorName } = context;
|
|
8615
|
-
const id = body.id ?? (0,
|
|
8854
|
+
const id = body.id ?? (0, import_ulid15.ulid)();
|
|
8616
8855
|
const meta = {
|
|
8617
8856
|
...body.meta ?? {},
|
|
8618
8857
|
lastUpdated: date,
|
|
@@ -8643,11 +8882,11 @@ async function createPaymentNoticeOperation(params) {
|
|
|
8643
8882
|
}
|
|
8644
8883
|
|
|
8645
8884
|
// src/data/operations/data/practitioner/practitioner-create-operation.ts
|
|
8646
|
-
var
|
|
8885
|
+
var import_ulid16 = require("ulid");
|
|
8647
8886
|
async function createPractitionerOperation(params) {
|
|
8648
8887
|
const { context, body, tableName } = params;
|
|
8649
8888
|
const { tenantId, workspaceId, date, actorId, actorName } = context;
|
|
8650
|
-
const id = body.id ?? (0,
|
|
8889
|
+
const id = body.id ?? (0, import_ulid16.ulid)();
|
|
8651
8890
|
const meta = {
|
|
8652
8891
|
...body.meta ?? {},
|
|
8653
8892
|
lastUpdated: date,
|
|
@@ -8678,11 +8917,11 @@ async function createPractitionerOperation(params) {
|
|
|
8678
8917
|
}
|
|
8679
8918
|
|
|
8680
8919
|
// src/data/operations/data/procedure/procedure-create-operation.ts
|
|
8681
|
-
var
|
|
8920
|
+
var import_ulid17 = require("ulid");
|
|
8682
8921
|
async function createProcedureOperation(params) {
|
|
8683
8922
|
const { context, body, tableName } = params;
|
|
8684
8923
|
const { tenantId, workspaceId, date, actorId, actorName } = context;
|
|
8685
|
-
const id = body.id ?? (0,
|
|
8924
|
+
const id = body.id ?? (0, import_ulid17.ulid)();
|
|
8686
8925
|
const meta = {
|
|
8687
8926
|
...body.meta ?? {},
|
|
8688
8927
|
lastUpdated: date,
|
|
@@ -8855,6 +9094,204 @@ var upsertUser = async (context, user, cognitoSub) => {
|
|
|
8855
9094
|
lastUpdated: context.date ?? (/* @__PURE__ */ new Date()).toISOString()
|
|
8856
9095
|
}).go();
|
|
8857
9096
|
};
|
|
9097
|
+
var buildTesterName = (tester) => ({
|
|
9098
|
+
text: tester.displayName,
|
|
9099
|
+
...tester.given !== void 0 ? { given: [tester.given] } : {},
|
|
9100
|
+
...tester.family !== void 0 ? { family: tester.family } : {}
|
|
9101
|
+
});
|
|
9102
|
+
var testerUserResourceBody = (tester, cognitoSub) => ({
|
|
9103
|
+
resourceType: "User",
|
|
9104
|
+
id: tester.id,
|
|
9105
|
+
name: [buildTesterName(tester)],
|
|
9106
|
+
telecom: [{ system: "email", value: tester.email }],
|
|
9107
|
+
status: "active",
|
|
9108
|
+
cognitoSub,
|
|
9109
|
+
currentTenant: { reference: `Tenant/${ON_SITE_WOUNDS_TENANT_ID}` },
|
|
9110
|
+
currentWorkspace: {
|
|
9111
|
+
reference: `Workspace/${ON_SITE_WOUNDS_OKLAHOMA_WORKSPACE_ID}`
|
|
9112
|
+
}
|
|
9113
|
+
});
|
|
9114
|
+
var upsertTesterUser = async (context, tester, cognitoSub) => {
|
|
9115
|
+
const service = getDynamoControlService();
|
|
9116
|
+
const resource = testerUserResourceBody(tester, cognitoSub);
|
|
9117
|
+
const summary = JSON.stringify((0, import_types12.extractSummary)(resource));
|
|
9118
|
+
await service.entities.user.put({
|
|
9119
|
+
id: tester.id,
|
|
9120
|
+
cognitoSub,
|
|
9121
|
+
resource: JSON.stringify(resource),
|
|
9122
|
+
summary,
|
|
9123
|
+
vid: "1",
|
|
9124
|
+
lastUpdated: context.date ?? (/* @__PURE__ */ new Date()).toISOString()
|
|
9125
|
+
}).go();
|
|
9126
|
+
};
|
|
9127
|
+
var onSiteTenantMembershipBody = (spec, userId, membershipId) => ({
|
|
9128
|
+
identifier: [
|
|
9129
|
+
demoScenarioIdentifier(spec.scenario, `membership-${userId}`),
|
|
9130
|
+
openhiResourceIdentifier({
|
|
9131
|
+
tenantId: spec.tenantId,
|
|
9132
|
+
workspaceId: "",
|
|
9133
|
+
resourceType: "Membership",
|
|
9134
|
+
id: membershipId
|
|
9135
|
+
})
|
|
9136
|
+
],
|
|
9137
|
+
user: { reference: `User/${userId}`, type: "User" },
|
|
9138
|
+
tenant: { reference: `Tenant/${spec.tenantId}`, type: "Tenant" },
|
|
9139
|
+
period: DEMO_PERIOD
|
|
9140
|
+
});
|
|
9141
|
+
var onSiteWorkspaceMembershipBody = (spec, workspace, userId, membershipId) => ({
|
|
9142
|
+
identifier: [
|
|
9143
|
+
demoScenarioIdentifier(
|
|
9144
|
+
spec.scenario,
|
|
9145
|
+
`membership-${userId}-${workspace.roleSuffix}`
|
|
9146
|
+
),
|
|
9147
|
+
openhiResourceIdentifier({
|
|
9148
|
+
tenantId: spec.tenantId,
|
|
9149
|
+
workspaceId: workspace.id,
|
|
9150
|
+
resourceType: "Membership",
|
|
9151
|
+
id: membershipId
|
|
9152
|
+
})
|
|
9153
|
+
],
|
|
9154
|
+
user: { reference: `User/${userId}`, type: "User" },
|
|
9155
|
+
tenant: { reference: `Tenant/${spec.tenantId}`, type: "Tenant" },
|
|
9156
|
+
workspace: { reference: `Workspace/${workspace.id}`, type: "Workspace" },
|
|
9157
|
+
period: DEMO_PERIOD
|
|
9158
|
+
});
|
|
9159
|
+
var onSiteRoleAssignmentBody = (spec, userId, roleCode, roleAssignmentId) => ({
|
|
9160
|
+
identifier: [
|
|
9161
|
+
demoScenarioIdentifier(
|
|
9162
|
+
spec.scenario,
|
|
9163
|
+
`roleassignment-${userId}-${roleCode}`
|
|
9164
|
+
),
|
|
9165
|
+
openhiResourceIdentifier({
|
|
9166
|
+
tenantId: spec.tenantId,
|
|
9167
|
+
workspaceId: "",
|
|
9168
|
+
resourceType: "RoleAssignment",
|
|
9169
|
+
id: roleAssignmentId
|
|
9170
|
+
})
|
|
9171
|
+
],
|
|
9172
|
+
user: { reference: `User/${userId}`, type: "User" },
|
|
9173
|
+
role: { reference: `Role/${idForRoleCode(roleCode)}`, type: "Role" },
|
|
9174
|
+
tenant: { reference: `Tenant/${spec.tenantId}`, type: "Tenant" },
|
|
9175
|
+
period: DEMO_PERIOD
|
|
9176
|
+
});
|
|
9177
|
+
var seedOnSiteUatForPrincipal = async (failures, baseContext, userId, role) => {
|
|
9178
|
+
for (const spec of ON_SITE_UAT_TENANT_SPECS) {
|
|
9179
|
+
const tenantContext = {
|
|
9180
|
+
...baseContext,
|
|
9181
|
+
tenantId: spec.tenantId
|
|
9182
|
+
};
|
|
9183
|
+
const scope = `${userId}@${spec.tenantId}`;
|
|
9184
|
+
const tenantMembershipId = onSiteTenantMembershipId(userId, spec.tenantId);
|
|
9185
|
+
await tryRun(
|
|
9186
|
+
failures,
|
|
9187
|
+
"phase-2",
|
|
9188
|
+
scope,
|
|
9189
|
+
"Membership",
|
|
9190
|
+
tenantMembershipId,
|
|
9191
|
+
() => createMembershipOperation({
|
|
9192
|
+
context: tenantContext,
|
|
9193
|
+
body: {
|
|
9194
|
+
id: tenantMembershipId,
|
|
9195
|
+
resource: onSiteTenantMembershipBody(
|
|
9196
|
+
spec,
|
|
9197
|
+
userId,
|
|
9198
|
+
tenantMembershipId
|
|
9199
|
+
)
|
|
9200
|
+
}
|
|
9201
|
+
})
|
|
9202
|
+
);
|
|
9203
|
+
for (const workspace of spec.workspaces) {
|
|
9204
|
+
const wsMembershipId = onSiteWorkspaceMembershipId(userId, workspace.id);
|
|
9205
|
+
await tryRun(
|
|
9206
|
+
failures,
|
|
9207
|
+
"phase-2",
|
|
9208
|
+
scope,
|
|
9209
|
+
"Membership",
|
|
9210
|
+
wsMembershipId,
|
|
9211
|
+
() => createMembershipOperation({
|
|
9212
|
+
context: tenantContext,
|
|
9213
|
+
body: {
|
|
9214
|
+
id: wsMembershipId,
|
|
9215
|
+
resource: onSiteWorkspaceMembershipBody(
|
|
9216
|
+
spec,
|
|
9217
|
+
workspace,
|
|
9218
|
+
userId,
|
|
9219
|
+
wsMembershipId
|
|
9220
|
+
)
|
|
9221
|
+
}
|
|
9222
|
+
})
|
|
9223
|
+
);
|
|
9224
|
+
}
|
|
9225
|
+
const raId = onSiteRoleAssignmentId(userId, spec.tenantId, role);
|
|
9226
|
+
await tryRun(
|
|
9227
|
+
failures,
|
|
9228
|
+
"phase-2",
|
|
9229
|
+
scope,
|
|
9230
|
+
"RoleAssignment",
|
|
9231
|
+
raId,
|
|
9232
|
+
() => createRoleAssignmentOperation({
|
|
9233
|
+
context: tenantContext,
|
|
9234
|
+
body: {
|
|
9235
|
+
id: raId,
|
|
9236
|
+
resource: onSiteRoleAssignmentBody(spec, userId, role, raId)
|
|
9237
|
+
}
|
|
9238
|
+
})
|
|
9239
|
+
);
|
|
9240
|
+
}
|
|
9241
|
+
};
|
|
9242
|
+
var seedPlaceholderTenantForPrincipal = async (failures, baseContext, userId, role) => {
|
|
9243
|
+
const tenantContext = {
|
|
9244
|
+
...baseContext,
|
|
9245
|
+
tenantId: PLACEHOLDER_TENANT_SPEC.tenantId
|
|
9246
|
+
};
|
|
9247
|
+
const scope = `${userId}@${PLACEHOLDER_TENANT_SPEC.tenantId}`;
|
|
9248
|
+
const tenantMembershipId = onSiteTenantMembershipId(
|
|
9249
|
+
userId,
|
|
9250
|
+
PLACEHOLDER_TENANT_SPEC.tenantId
|
|
9251
|
+
);
|
|
9252
|
+
await tryRun(
|
|
9253
|
+
failures,
|
|
9254
|
+
"phase-2",
|
|
9255
|
+
scope,
|
|
9256
|
+
"Membership",
|
|
9257
|
+
tenantMembershipId,
|
|
9258
|
+
() => createMembershipOperation({
|
|
9259
|
+
context: tenantContext,
|
|
9260
|
+
body: {
|
|
9261
|
+
id: tenantMembershipId,
|
|
9262
|
+
resource: onSiteTenantMembershipBody(
|
|
9263
|
+
PLACEHOLDER_TENANT_SPEC,
|
|
9264
|
+
userId,
|
|
9265
|
+
tenantMembershipId
|
|
9266
|
+
)
|
|
9267
|
+
}
|
|
9268
|
+
})
|
|
9269
|
+
);
|
|
9270
|
+
const raId = onSiteRoleAssignmentId(
|
|
9271
|
+
userId,
|
|
9272
|
+
PLACEHOLDER_TENANT_SPEC.tenantId,
|
|
9273
|
+
role
|
|
9274
|
+
);
|
|
9275
|
+
await tryRun(
|
|
9276
|
+
failures,
|
|
9277
|
+
"phase-2",
|
|
9278
|
+
scope,
|
|
9279
|
+
"RoleAssignment",
|
|
9280
|
+
raId,
|
|
9281
|
+
() => createRoleAssignmentOperation({
|
|
9282
|
+
context: tenantContext,
|
|
9283
|
+
body: {
|
|
9284
|
+
id: raId,
|
|
9285
|
+
resource: onSiteRoleAssignmentBody(
|
|
9286
|
+
PLACEHOLDER_TENANT_SPEC,
|
|
9287
|
+
userId,
|
|
9288
|
+
role,
|
|
9289
|
+
raId
|
|
9290
|
+
)
|
|
9291
|
+
}
|
|
9292
|
+
})
|
|
9293
|
+
);
|
|
9294
|
+
};
|
|
8858
9295
|
var seedWorkspaceDataPlane = async (baseContext, group, failures) => {
|
|
8859
9296
|
const workspaceContext = {
|
|
8860
9297
|
...baseContext,
|
|
@@ -9042,9 +9479,9 @@ var seedWorkspaceDataPlane = async (baseContext, group, failures) => {
|
|
|
9042
9479
|
}
|
|
9043
9480
|
};
|
|
9044
9481
|
var seedDemoGraph = async (params) => {
|
|
9045
|
-
const { baseContext, devUsers, cognito } = params;
|
|
9482
|
+
const { baseContext, devUsers, cognito, onSiteTesters = [] } = params;
|
|
9046
9483
|
const failures = [];
|
|
9047
|
-
for (const spec of DEMO_TENANT_SPECS) {
|
|
9484
|
+
for (const spec of [...DEMO_TENANT_SPECS, ...ON_SITE_UAT_TENANT_SPECS]) {
|
|
9048
9485
|
const tenantContext = {
|
|
9049
9486
|
...baseContext,
|
|
9050
9487
|
tenantId: spec.tenantId
|
|
@@ -9174,6 +9611,47 @@ var seedDemoGraph = async (params) => {
|
|
|
9174
9611
|
}
|
|
9175
9612
|
})
|
|
9176
9613
|
);
|
|
9614
|
+
await seedOnSiteUatForPrincipal(
|
|
9615
|
+
failures,
|
|
9616
|
+
baseContext,
|
|
9617
|
+
user.id,
|
|
9618
|
+
import_types12.PLATFORM_ROLE_CODE.TENANT_ADMIN
|
|
9619
|
+
);
|
|
9620
|
+
}
|
|
9621
|
+
for (const tester of onSiteTesters) {
|
|
9622
|
+
let cognitoSub;
|
|
9623
|
+
try {
|
|
9624
|
+
cognitoSub = await cognito.ensureUser(tester.email);
|
|
9625
|
+
} catch (err) {
|
|
9626
|
+
failures.push({
|
|
9627
|
+
phase: "phase-2",
|
|
9628
|
+
scope: tester.id,
|
|
9629
|
+
resourceType: "CognitoUser",
|
|
9630
|
+
resourceId: tester.email,
|
|
9631
|
+
error: err
|
|
9632
|
+
});
|
|
9633
|
+
continue;
|
|
9634
|
+
}
|
|
9635
|
+
await tryRun(
|
|
9636
|
+
failures,
|
|
9637
|
+
"phase-2",
|
|
9638
|
+
tester.id,
|
|
9639
|
+
"User",
|
|
9640
|
+
tester.id,
|
|
9641
|
+
() => upsertTesterUser(baseContext, tester, cognitoSub)
|
|
9642
|
+
);
|
|
9643
|
+
await seedPlaceholderTenantForPrincipal(
|
|
9644
|
+
failures,
|
|
9645
|
+
baseContext,
|
|
9646
|
+
tester.id,
|
|
9647
|
+
tester.role
|
|
9648
|
+
);
|
|
9649
|
+
await seedOnSiteUatForPrincipal(
|
|
9650
|
+
failures,
|
|
9651
|
+
baseContext,
|
|
9652
|
+
tester.id,
|
|
9653
|
+
tester.role
|
|
9654
|
+
);
|
|
9177
9655
|
}
|
|
9178
9656
|
for (const group of DEMO_DATA_PLANE_FIXTURES) {
|
|
9179
9657
|
try {
|
|
@@ -9192,7 +9670,7 @@ var seedDemoGraph = async (params) => {
|
|
|
9192
9670
|
throw aggregateFailureError(failures);
|
|
9193
9671
|
}
|
|
9194
9672
|
};
|
|
9195
|
-
var runSeedDemoData = async (event, deps, devUsers) => {
|
|
9673
|
+
var runSeedDemoData = async (event, deps, devUsers, onSiteTesters = []) => {
|
|
9196
9674
|
const parsed = (0, import_workflows3.parseWorkflowEvent)(event, import_workflows.PlatformSystemDataSeededV1);
|
|
9197
9675
|
const recordResult = await deps.dedupClient.recordIfAbsent({
|
|
9198
9676
|
consumerName: SEED_DEMO_DATA_CONSUMER_NAME,
|
|
@@ -9216,7 +9694,8 @@ var runSeedDemoData = async (event, deps, devUsers) => {
|
|
|
9216
9694
|
await deps.seedDemoGraph({
|
|
9217
9695
|
baseContext,
|
|
9218
9696
|
devUsers,
|
|
9219
|
-
cognito: deps.cognito
|
|
9697
|
+
cognito: deps.cognito,
|
|
9698
|
+
onSiteTesters
|
|
9220
9699
|
});
|
|
9221
9700
|
} catch (err) {
|
|
9222
9701
|
await deps.dedupClient.markFailed({
|
|
@@ -9370,7 +9849,7 @@ var productionDependencies = () => {
|
|
|
9370
9849
|
cognito
|
|
9371
9850
|
};
|
|
9372
9851
|
};
|
|
9373
|
-
var handler = async (event) => runSeedDemoData(event, productionDependencies(), DEV_USERS);
|
|
9852
|
+
var handler = async (event) => runSeedDemoData(event, productionDependencies(), DEV_USERS, ON_SITE_TESTERS);
|
|
9374
9853
|
// Annotate the CommonJS export names for ESM import in node:
|
|
9375
9854
|
0 && (module.exports = {
|
|
9376
9855
|
SEED_DEMO_DATA_USER_POOL_ID_ENV_VAR,
|