@deepintel-ltd/buildlink-api-contracts 0.2.34 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -24,4 +24,4 @@ const client = initClient(apiContract, {
24
24
 
25
25
  ## Version
26
26
 
27
- Version 0.2.34
27
+ Version 0.3.0
@@ -712,6 +712,465 @@ export declare const hubContract: {
712
712
  }>;
713
713
  };
714
714
  };
715
+ listDevices: {
716
+ pathParams: z.ZodObject<{
717
+ siteId: z.ZodString;
718
+ }, "strip", z.ZodTypeAny, {
719
+ siteId: string;
720
+ }, {
721
+ siteId: string;
722
+ }>;
723
+ summary: "List devices registered on a Hub site";
724
+ method: "GET";
725
+ path: "/hub/sites/:siteId/devices";
726
+ responses: {
727
+ 200: z.ZodObject<{
728
+ data: z.ZodArray<z.ZodObject<{
729
+ type: z.ZodLiteral<"hub-devices">;
730
+ id: z.ZodString;
731
+ attributes: z.ZodObject<Omit<{
732
+ id: z.ZodString;
733
+ hubSiteId: z.ZodString;
734
+ deviceKey: z.ZodString;
735
+ label: z.ZodString;
736
+ lastSeenAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
737
+ isOnline: z.ZodBoolean;
738
+ tamperFlag: z.ZodBoolean;
739
+ createdAt: z.ZodString;
740
+ updatedAt: z.ZodString;
741
+ }, "id">, "strip", z.ZodTypeAny, {
742
+ createdAt: string;
743
+ updatedAt: string;
744
+ isOnline: boolean;
745
+ hubSiteId: string;
746
+ deviceKey: string;
747
+ label: string;
748
+ tamperFlag: boolean;
749
+ lastSeenAt?: string | null | undefined;
750
+ }, {
751
+ createdAt: string;
752
+ updatedAt: string;
753
+ isOnline: boolean;
754
+ hubSiteId: string;
755
+ deviceKey: string;
756
+ label: string;
757
+ tamperFlag: boolean;
758
+ lastSeenAt?: string | null | undefined;
759
+ }>;
760
+ }, "strip", z.ZodTypeAny, {
761
+ id: string;
762
+ type: "hub-devices";
763
+ attributes: {
764
+ createdAt: string;
765
+ updatedAt: string;
766
+ isOnline: boolean;
767
+ hubSiteId: string;
768
+ deviceKey: string;
769
+ label: string;
770
+ tamperFlag: boolean;
771
+ lastSeenAt?: string | null | undefined;
772
+ };
773
+ }, {
774
+ id: string;
775
+ type: "hub-devices";
776
+ attributes: {
777
+ createdAt: string;
778
+ updatedAt: string;
779
+ isOnline: boolean;
780
+ hubSiteId: string;
781
+ deviceKey: string;
782
+ label: string;
783
+ tamperFlag: boolean;
784
+ lastSeenAt?: string | null | undefined;
785
+ };
786
+ }>, "many">;
787
+ meta: z.ZodOptional<z.ZodObject<{
788
+ total: z.ZodOptional<z.ZodNumber>;
789
+ page: z.ZodOptional<z.ZodNumber>;
790
+ size: z.ZodOptional<z.ZodNumber>;
791
+ pages: z.ZodOptional<z.ZodNumber>;
792
+ hasNextPage: z.ZodOptional<z.ZodBoolean>;
793
+ hasPreviousPage: z.ZodOptional<z.ZodBoolean>;
794
+ }, "strip", z.ZodTypeAny, {
795
+ page?: number | undefined;
796
+ total?: number | undefined;
797
+ size?: number | undefined;
798
+ pages?: number | undefined;
799
+ hasNextPage?: boolean | undefined;
800
+ hasPreviousPage?: boolean | undefined;
801
+ }, {
802
+ page?: number | undefined;
803
+ total?: number | undefined;
804
+ size?: number | undefined;
805
+ pages?: number | undefined;
806
+ hasNextPage?: boolean | undefined;
807
+ hasPreviousPage?: boolean | undefined;
808
+ }>>;
809
+ links: z.ZodOptional<z.ZodObject<{
810
+ self: z.ZodString;
811
+ first: z.ZodOptional<z.ZodString>;
812
+ last: z.ZodOptional<z.ZodString>;
813
+ prev: z.ZodOptional<z.ZodString>;
814
+ next: z.ZodOptional<z.ZodString>;
815
+ }, "strip", z.ZodTypeAny, {
816
+ self: string;
817
+ first?: string | undefined;
818
+ last?: string | undefined;
819
+ prev?: string | undefined;
820
+ next?: string | undefined;
821
+ }, {
822
+ self: string;
823
+ first?: string | undefined;
824
+ last?: string | undefined;
825
+ prev?: string | undefined;
826
+ next?: string | undefined;
827
+ }>>;
828
+ }, "strip", z.ZodTypeAny, {
829
+ data: {
830
+ id: string;
831
+ type: "hub-devices";
832
+ attributes: {
833
+ createdAt: string;
834
+ updatedAt: string;
835
+ isOnline: boolean;
836
+ hubSiteId: string;
837
+ deviceKey: string;
838
+ label: string;
839
+ tamperFlag: boolean;
840
+ lastSeenAt?: string | null | undefined;
841
+ };
842
+ }[];
843
+ meta?: {
844
+ page?: number | undefined;
845
+ total?: number | undefined;
846
+ size?: number | undefined;
847
+ pages?: number | undefined;
848
+ hasNextPage?: boolean | undefined;
849
+ hasPreviousPage?: boolean | undefined;
850
+ } | undefined;
851
+ links?: {
852
+ self: string;
853
+ first?: string | undefined;
854
+ last?: string | undefined;
855
+ prev?: string | undefined;
856
+ next?: string | undefined;
857
+ } | undefined;
858
+ }, {
859
+ data: {
860
+ id: string;
861
+ type: "hub-devices";
862
+ attributes: {
863
+ createdAt: string;
864
+ updatedAt: string;
865
+ isOnline: boolean;
866
+ hubSiteId: string;
867
+ deviceKey: string;
868
+ label: string;
869
+ tamperFlag: boolean;
870
+ lastSeenAt?: string | null | undefined;
871
+ };
872
+ }[];
873
+ meta?: {
874
+ page?: number | undefined;
875
+ total?: number | undefined;
876
+ size?: number | undefined;
877
+ pages?: number | undefined;
878
+ hasNextPage?: boolean | undefined;
879
+ hasPreviousPage?: boolean | undefined;
880
+ } | undefined;
881
+ links?: {
882
+ self: string;
883
+ first?: string | undefined;
884
+ last?: string | undefined;
885
+ prev?: string | undefined;
886
+ next?: string | undefined;
887
+ } | undefined;
888
+ }>;
889
+ 401: z.ZodObject<{
890
+ errors: z.ZodArray<z.ZodObject<{
891
+ status: z.ZodString;
892
+ title: z.ZodString;
893
+ detail: z.ZodOptional<z.ZodString>;
894
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
895
+ }, "strip", z.ZodTypeAny, {
896
+ status: string;
897
+ title: string;
898
+ detail?: string | undefined;
899
+ meta?: Record<string, unknown> | undefined;
900
+ }, {
901
+ status: string;
902
+ title: string;
903
+ detail?: string | undefined;
904
+ meta?: Record<string, unknown> | undefined;
905
+ }>, "many">;
906
+ }, "strip", z.ZodTypeAny, {
907
+ errors: {
908
+ status: string;
909
+ title: string;
910
+ detail?: string | undefined;
911
+ meta?: Record<string, unknown> | undefined;
912
+ }[];
913
+ }, {
914
+ errors: {
915
+ status: string;
916
+ title: string;
917
+ detail?: string | undefined;
918
+ meta?: Record<string, unknown> | undefined;
919
+ }[];
920
+ }>;
921
+ 403: z.ZodObject<{
922
+ errors: z.ZodArray<z.ZodObject<{
923
+ status: z.ZodString;
924
+ title: z.ZodString;
925
+ detail: z.ZodOptional<z.ZodString>;
926
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
927
+ }, "strip", z.ZodTypeAny, {
928
+ status: string;
929
+ title: string;
930
+ detail?: string | undefined;
931
+ meta?: Record<string, unknown> | undefined;
932
+ }, {
933
+ status: string;
934
+ title: string;
935
+ detail?: string | undefined;
936
+ meta?: Record<string, unknown> | undefined;
937
+ }>, "many">;
938
+ }, "strip", z.ZodTypeAny, {
939
+ errors: {
940
+ status: string;
941
+ title: string;
942
+ detail?: string | undefined;
943
+ meta?: Record<string, unknown> | undefined;
944
+ }[];
945
+ }, {
946
+ errors: {
947
+ status: string;
948
+ title: string;
949
+ detail?: string | undefined;
950
+ meta?: Record<string, unknown> | undefined;
951
+ }[];
952
+ }>;
953
+ };
954
+ };
955
+ listEvents: {
956
+ pathParams: z.ZodObject<{
957
+ siteId: z.ZodString;
958
+ }, "strip", z.ZodTypeAny, {
959
+ siteId: string;
960
+ }, {
961
+ siteId: string;
962
+ }>;
963
+ summary: "List recent events (latest 100) for a Hub site";
964
+ method: "GET";
965
+ path: "/hub/sites/:siteId/events";
966
+ responses: {
967
+ 200: z.ZodObject<{
968
+ data: z.ZodArray<z.ZodObject<{
969
+ type: z.ZodLiteral<"hub-events">;
970
+ id: z.ZodString;
971
+ attributes: z.ZodObject<Omit<{
972
+ id: z.ZodString;
973
+ hubSiteId: z.ZodString;
974
+ deviceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
975
+ type: z.ZodEnum<["ALERT", "TAMPER", "HEARTBEAT", "HOLD_RELEASE", "DIARY_SYNC"]>;
976
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
977
+ createdAt: z.ZodString;
978
+ }, "id">, "strip", z.ZodTypeAny, {
979
+ createdAt: string;
980
+ type: "ALERT" | "TAMPER" | "HEARTBEAT" | "HOLD_RELEASE" | "DIARY_SYNC";
981
+ payload: Record<string, unknown>;
982
+ hubSiteId: string;
983
+ deviceId?: string | null | undefined;
984
+ }, {
985
+ createdAt: string;
986
+ type: "ALERT" | "TAMPER" | "HEARTBEAT" | "HOLD_RELEASE" | "DIARY_SYNC";
987
+ payload: Record<string, unknown>;
988
+ hubSiteId: string;
989
+ deviceId?: string | null | undefined;
990
+ }>;
991
+ }, "strip", z.ZodTypeAny, {
992
+ id: string;
993
+ type: "hub-events";
994
+ attributes: {
995
+ createdAt: string;
996
+ type: "ALERT" | "TAMPER" | "HEARTBEAT" | "HOLD_RELEASE" | "DIARY_SYNC";
997
+ payload: Record<string, unknown>;
998
+ hubSiteId: string;
999
+ deviceId?: string | null | undefined;
1000
+ };
1001
+ }, {
1002
+ id: string;
1003
+ type: "hub-events";
1004
+ attributes: {
1005
+ createdAt: string;
1006
+ type: "ALERT" | "TAMPER" | "HEARTBEAT" | "HOLD_RELEASE" | "DIARY_SYNC";
1007
+ payload: Record<string, unknown>;
1008
+ hubSiteId: string;
1009
+ deviceId?: string | null | undefined;
1010
+ };
1011
+ }>, "many">;
1012
+ meta: z.ZodOptional<z.ZodObject<{
1013
+ total: z.ZodOptional<z.ZodNumber>;
1014
+ page: z.ZodOptional<z.ZodNumber>;
1015
+ size: z.ZodOptional<z.ZodNumber>;
1016
+ pages: z.ZodOptional<z.ZodNumber>;
1017
+ hasNextPage: z.ZodOptional<z.ZodBoolean>;
1018
+ hasPreviousPage: z.ZodOptional<z.ZodBoolean>;
1019
+ }, "strip", z.ZodTypeAny, {
1020
+ page?: number | undefined;
1021
+ total?: number | undefined;
1022
+ size?: number | undefined;
1023
+ pages?: number | undefined;
1024
+ hasNextPage?: boolean | undefined;
1025
+ hasPreviousPage?: boolean | undefined;
1026
+ }, {
1027
+ page?: number | undefined;
1028
+ total?: number | undefined;
1029
+ size?: number | undefined;
1030
+ pages?: number | undefined;
1031
+ hasNextPage?: boolean | undefined;
1032
+ hasPreviousPage?: boolean | undefined;
1033
+ }>>;
1034
+ links: z.ZodOptional<z.ZodObject<{
1035
+ self: z.ZodString;
1036
+ first: z.ZodOptional<z.ZodString>;
1037
+ last: z.ZodOptional<z.ZodString>;
1038
+ prev: z.ZodOptional<z.ZodString>;
1039
+ next: z.ZodOptional<z.ZodString>;
1040
+ }, "strip", z.ZodTypeAny, {
1041
+ self: string;
1042
+ first?: string | undefined;
1043
+ last?: string | undefined;
1044
+ prev?: string | undefined;
1045
+ next?: string | undefined;
1046
+ }, {
1047
+ self: string;
1048
+ first?: string | undefined;
1049
+ last?: string | undefined;
1050
+ prev?: string | undefined;
1051
+ next?: string | undefined;
1052
+ }>>;
1053
+ }, "strip", z.ZodTypeAny, {
1054
+ data: {
1055
+ id: string;
1056
+ type: "hub-events";
1057
+ attributes: {
1058
+ createdAt: string;
1059
+ type: "ALERT" | "TAMPER" | "HEARTBEAT" | "HOLD_RELEASE" | "DIARY_SYNC";
1060
+ payload: Record<string, unknown>;
1061
+ hubSiteId: string;
1062
+ deviceId?: string | null | undefined;
1063
+ };
1064
+ }[];
1065
+ meta?: {
1066
+ page?: number | undefined;
1067
+ total?: number | undefined;
1068
+ size?: number | undefined;
1069
+ pages?: number | undefined;
1070
+ hasNextPage?: boolean | undefined;
1071
+ hasPreviousPage?: boolean | undefined;
1072
+ } | undefined;
1073
+ links?: {
1074
+ self: string;
1075
+ first?: string | undefined;
1076
+ last?: string | undefined;
1077
+ prev?: string | undefined;
1078
+ next?: string | undefined;
1079
+ } | undefined;
1080
+ }, {
1081
+ data: {
1082
+ id: string;
1083
+ type: "hub-events";
1084
+ attributes: {
1085
+ createdAt: string;
1086
+ type: "ALERT" | "TAMPER" | "HEARTBEAT" | "HOLD_RELEASE" | "DIARY_SYNC";
1087
+ payload: Record<string, unknown>;
1088
+ hubSiteId: string;
1089
+ deviceId?: string | null | undefined;
1090
+ };
1091
+ }[];
1092
+ meta?: {
1093
+ page?: number | undefined;
1094
+ total?: number | undefined;
1095
+ size?: number | undefined;
1096
+ pages?: number | undefined;
1097
+ hasNextPage?: boolean | undefined;
1098
+ hasPreviousPage?: boolean | undefined;
1099
+ } | undefined;
1100
+ links?: {
1101
+ self: string;
1102
+ first?: string | undefined;
1103
+ last?: string | undefined;
1104
+ prev?: string | undefined;
1105
+ next?: string | undefined;
1106
+ } | undefined;
1107
+ }>;
1108
+ 401: z.ZodObject<{
1109
+ errors: z.ZodArray<z.ZodObject<{
1110
+ status: z.ZodString;
1111
+ title: z.ZodString;
1112
+ detail: z.ZodOptional<z.ZodString>;
1113
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1114
+ }, "strip", z.ZodTypeAny, {
1115
+ status: string;
1116
+ title: string;
1117
+ detail?: string | undefined;
1118
+ meta?: Record<string, unknown> | undefined;
1119
+ }, {
1120
+ status: string;
1121
+ title: string;
1122
+ detail?: string | undefined;
1123
+ meta?: Record<string, unknown> | undefined;
1124
+ }>, "many">;
1125
+ }, "strip", z.ZodTypeAny, {
1126
+ errors: {
1127
+ status: string;
1128
+ title: string;
1129
+ detail?: string | undefined;
1130
+ meta?: Record<string, unknown> | undefined;
1131
+ }[];
1132
+ }, {
1133
+ errors: {
1134
+ status: string;
1135
+ title: string;
1136
+ detail?: string | undefined;
1137
+ meta?: Record<string, unknown> | undefined;
1138
+ }[];
1139
+ }>;
1140
+ 403: z.ZodObject<{
1141
+ errors: z.ZodArray<z.ZodObject<{
1142
+ status: z.ZodString;
1143
+ title: z.ZodString;
1144
+ detail: z.ZodOptional<z.ZodString>;
1145
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1146
+ }, "strip", z.ZodTypeAny, {
1147
+ status: string;
1148
+ title: string;
1149
+ detail?: string | undefined;
1150
+ meta?: Record<string, unknown> | undefined;
1151
+ }, {
1152
+ status: string;
1153
+ title: string;
1154
+ detail?: string | undefined;
1155
+ meta?: Record<string, unknown> | undefined;
1156
+ }>, "many">;
1157
+ }, "strip", z.ZodTypeAny, {
1158
+ errors: {
1159
+ status: string;
1160
+ title: string;
1161
+ detail?: string | undefined;
1162
+ meta?: Record<string, unknown> | undefined;
1163
+ }[];
1164
+ }, {
1165
+ errors: {
1166
+ status: string;
1167
+ title: string;
1168
+ detail?: string | undefined;
1169
+ meta?: Record<string, unknown> | undefined;
1170
+ }[];
1171
+ }>;
1172
+ };
1173
+ };
715
1174
  recordEvent: {
716
1175
  pathParams: z.ZodObject<{
717
1176
  siteId: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"hub.d.ts","sourceRoot":"","sources":["../../../src/contracts/hub.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkFtB,CAAC"}
package/contracts/hub.js CHANGED
@@ -39,6 +39,28 @@ export const hubContract = c.router({
39
39
  },
40
40
  summary: 'Register a Hub device',
41
41
  },
42
+ listDevices: {
43
+ method: 'GET',
44
+ path: '/hub/sites/:siteId/devices',
45
+ pathParams: z.object({ siteId: CuidSchema }),
46
+ responses: {
47
+ 200: JsonApiCollectionResponseSchema(HubDeviceResourceSchema),
48
+ 401: JsonApiErrorResponseSchema,
49
+ 403: JsonApiErrorResponseSchema,
50
+ },
51
+ summary: 'List devices registered on a Hub site',
52
+ },
53
+ listEvents: {
54
+ method: 'GET',
55
+ path: '/hub/sites/:siteId/events',
56
+ pathParams: z.object({ siteId: CuidSchema }),
57
+ responses: {
58
+ 200: JsonApiCollectionResponseSchema(HubEventResourceSchema),
59
+ 401: JsonApiErrorResponseSchema,
60
+ 403: JsonApiErrorResponseSchema,
61
+ },
62
+ summary: 'List recent events (latest 100) for a Hub site',
63
+ },
42
64
  recordEvent: {
43
65
  method: 'POST',
44
66
  path: '/hub/sites/:siteId/events',
@@ -1 +1 @@
1
- {"version":3,"file":"hub.js","sourceRoot":"","sources":["../../../src/contracts/hub.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,UAAU,EACV,+BAA+B,EAC/B,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,2BAA2B,EAC3B,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AAExB,MAAM,CAAC,GAAG,YAAY,EAAE,CAAC;AACzB,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,SAAS,EAAE;QACT,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,gCAAgC;QACtC,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;QAC/C,SAAS,EAAE;YACT,GAAG,EAAE,+BAA+B,CAAC,qBAAqB,CAAC;YAC3D,GAAG,EAAE,0BAA0B;YAC/B,GAAG,EAAE,0BAA0B;SAChC;QACD,OAAO,EAAE,gBAAgB;KAC1B;IACD,UAAU,EAAE;QACV,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,gCAAgC;QACtC,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;QAC/C,IAAI,EAAE,0BAA0B;QAChC,SAAS,EAAE;YACT,GAAG,EAAE,qBAAqB,CAAC,qBAAqB,CAAC;YACjD,GAAG,EAAE,0BAA0B;YAC/B,GAAG,EAAE,0BAA0B;SAChC;QACD,OAAO,EAAE,2BAA2B;KACrC;IACD,cAAc,EAAE;QACd,MAAM,EAAE,MAAM;QACd,IAAI,EAA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