@lls/store 24.11.0 → 24.12.0-07282d1b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +348 -217
  2. package/package.json +12 -9
package/lib/index.js CHANGED
@@ -733,29 +733,20 @@ var require_normalizr = __commonJS({
733
733
  // src/index.ts
734
734
  init_define_import_meta();
735
735
 
736
- // src/selectors/auth.ts
737
- init_define_import_meta();
738
- import _ from "lodash/fp.js";
739
- var getAuth = _.get("auth");
740
- var getIsLogged = _.flow(_.get("auth.id"), _.negate(_.isNil));
741
- var getToken = _.get("auth.token");
742
-
743
- // src/selectors/school.ts
736
+ // src/selectors/academy.ts
744
737
  init_define_import_meta();
745
- import { makeEntitiesFilter, pipe } from "@lls/utils";
746
- import _2 from "lodash/fp.js";
747
738
 
748
739
  // src/selectors/crud.ts
749
740
  init_define_import_meta();
750
741
  import { createSearchSelector, makeGetAllEntities, makeGetEntityById } from "@lls/utils";
751
742
  import { useMemo } from "react";
752
743
  import { useSelector } from "react-redux";
753
- var crud = (entityName, { search: search31 }) => {
744
+ var crud = (entityName, { search: search35 }) => {
754
745
  const getElements = makeGetAllEntities(entityName);
755
746
  const makeSearchElements = () => createSearchSelector(
756
747
  makeGetAllEntities(entityName),
757
748
  (_state, params) => params,
758
- (elements, params) => search31(params)(elements)
749
+ (elements, params) => search35(params)(elements)
759
750
  );
760
751
  const methodName = `${entityName.charAt(0).toUpperCase()}${entityName.slice(1)}`;
761
752
  const getElementById = makeGetEntityById(entityName);
@@ -765,7 +756,7 @@ var crud = (entityName, { search: search31 }) => {
765
756
  [`search${methodName}`]: makeSearchElements(),
766
757
  [`get${methodName.replace(/s$/, "")}`]: getElementById,
767
758
  [`makeSearch${methodName}`]: makeSearchElements,
768
- [`filter${methodName}`]: search31,
759
+ [`filter${methodName}`]: search35,
769
760
  [`useSearch${methodName}`]: useSearch
770
761
  };
771
762
  return back;
@@ -777,23 +768,44 @@ var makeUseSearch = (makeSearchElements) => {
777
768
  };
778
769
  };
779
770
 
780
- // src/selectors/school.ts
781
- var search = ({ ids, academyIds, sortByQuery }) => {
782
- return (schools) => pipe(
783
- schools,
784
- makeEntitiesFilter({ id: ids, academy: academyIds }),
785
- _2.isFunction(sortByQuery) ? sortByQuery : sortByQuery ? _2.sortBy(sortByQuery) : _2.identity
786
- );
787
- };
788
- var { getSchools, getSchool, useSearchSchools } = crud("schools", {
789
- search
771
+ // src/selectors/academy.ts
772
+ var search = (_nosearch) => (academies) => academies;
773
+ var { getAcademies, getAcademie: getAcademy } = crud("academies", { search });
774
+
775
+ // src/selectors/auth.ts
776
+ init_define_import_meta();
777
+ import _ from "lodash/fp.js";
778
+ var getAuth = _.get("auth");
779
+ var getIsLogged = _.flow(_.get("auth.id"), _.negate(_.isNil));
780
+ var getToken = _.get("auth.token");
781
+
782
+ // src/selectors/builderIo.ts
783
+ init_define_import_meta();
784
+ import { makeEntitiesFilter } from "@lls/utils";
785
+ var search2 = ({ modelIds, subjects, schoolTypes }) => makeEntitiesFilter(
786
+ {
787
+ modelId: modelIds
788
+ },
789
+ subjects && ((builderIo2) => !!builderIo2?.data?.subjects?.some((x) => subjects.includes(x))),
790
+ schoolTypes && ((builderIo2) => !!builderIo2?.data?.schoolTypes?.some((x) => schoolTypes.includes(x)))
791
+ );
792
+ var { getBuilderIos, getBuilderIo, useSearchBuilderIos } = crud("builderIos", {
793
+ search: search2
794
+ });
795
+
796
+ // src/selectors/circonscription.ts
797
+ init_define_import_meta();
798
+ import _2 from "lodash/fp.js";
799
+ var search3 = (_params) => _2.identity;
800
+ var { getCirconscriptions } = crud("circonscriptions", {
801
+ search: search3
790
802
  });
791
803
 
792
804
  // src/selectors/book.ts
793
805
  init_define_import_meta();
794
- import { createSearchSelector as createSearchSelector2, makeEntitiesFilter as makeEntitiesFilter2, makeGetEntityById as makeGetEntityById2, pipe as pipe2 } from "@lls/utils";
806
+ import { createSearchSelector as createSearchSelector2, makeEntitiesFilter as makeEntitiesFilter2, makeGetEntityById as makeGetEntityById2, pipe } from "@lls/utils";
795
807
  import _3 from "lodash/fp.js";
796
- var search2 = ({
808
+ var search4 = ({
797
809
  ids,
798
810
  levelIds,
799
811
  subjectIds,
@@ -810,7 +822,7 @@ var search2 = ({
810
822
  isRenewed,
811
823
  isPrimary
812
824
  }) => {
813
- return (books) => pipe2(
825
+ return (books) => pipe(
814
826
  books,
815
827
  makeEntitiesFilter2({
816
828
  id: ids,
@@ -832,7 +844,7 @@ var search2 = ({
832
844
  );
833
845
  };
834
846
  var { getBooks, getBook, filterBooks, useSearchBooks, makeSearchBooks } = crud("books", {
835
- search: search2
847
+ search: search4
836
848
  });
837
849
  var makeSearchValidBooks = () => createSearchSelector2(makeSearchBooks(), (books) => _3.filter({ valid: true, hasNewDesign: true }, books));
838
850
  var useSearchValidBooks = makeUseSearch(makeSearchValidBooks);
@@ -842,21 +854,21 @@ var makeGetBook = () => makeGetEntityById2("books");
842
854
  init_define_import_meta();
843
855
  var import_reselect = __toESM(require_lib(), 1);
844
856
  import { makeEntitiesFilter as makeEntitiesFilter3 } from "@lls/utils";
845
- var search3 = ({ ids, schoolIds }) => makeEntitiesFilter3({
857
+ var search5 = ({ ids, schoolIds }) => makeEntitiesFilter3({
846
858
  schools: schoolIds,
847
859
  id: ids
848
860
  });
849
861
  var { getUsers, getUser, useSearchUsers } = crud("users", {
850
- search: search3
862
+ search: search5
851
863
  });
852
864
  var makeGetCurrentUser = () => (0, import_reselect.createSelector)(getAuth, getUsers, (auth2, users) => users?.find((user2) => user2?.id === auth2?.id));
853
865
  var getCurrentUser = makeGetCurrentUser();
854
866
 
855
867
  // src/selectors/chapter.ts
856
868
  init_define_import_meta();
857
- import { makeEntitiesFilter as makeEntitiesFilter4, pipe as pipe3 } from "@lls/utils";
869
+ import { makeEntitiesFilter as makeEntitiesFilter4, pipe as pipe2 } from "@lls/utils";
858
870
  import _4 from "lodash/fp.js";
859
- var search4 = ({ bookIds, ids, hasTeacherBook, sortByQuery }) => (chapters) => pipe3(
871
+ var search6 = ({ bookIds, ids, hasTeacherBook, sortByQuery }) => (chapters) => pipe2(
860
872
  chapters,
861
873
  makeEntitiesFilter4(
862
874
  {
@@ -868,14 +880,14 @@ var search4 = ({ bookIds, ids, hasTeacherBook, sortByQuery }) => (chapters) => p
868
880
  _4.isFunction(sortByQuery) ? sortByQuery : sortByQuery ? _4.sortBy(sortByQuery) : _4.identity
869
881
  );
870
882
  var { getChapters, getChapter, useSearchChapters } = crud("chapters", {
871
- search: search4
883
+ search: search6
872
884
  });
873
885
 
874
886
  // src/selectors/page.ts
875
887
  init_define_import_meta();
876
- import { makeEntitiesFilter as makeEntitiesFilter5, pipe as pipe4 } from "@lls/utils";
888
+ import { makeEntitiesFilter as makeEntitiesFilter5, pipe as pipe3 } from "@lls/utils";
877
889
  import _5 from "lodash/fp.js";
878
- var search5 = ({
890
+ var search7 = ({
879
891
  ids,
880
892
  chapterIds,
881
893
  isValid,
@@ -899,7 +911,7 @@ var search5 = ({
899
911
  sortByQuery
900
912
  }) => {
901
913
  let pageById = false;
902
- return (pages) => pipe4(
914
+ return (pages) => pipe3(
903
915
  pages,
904
916
  makeEntitiesFilter5(
905
917
  {
@@ -932,26 +944,26 @@ var search5 = ({
932
944
  );
933
945
  };
934
946
  var { getPages, getPage, filterPages, useSearchPages, makeSearchPages } = crud("pages", {
935
- search: search5
947
+ search: search7
936
948
  });
937
- var { getDrafts, getDraft, useSearchDrafts } = crud("drafts", { search: search5 });
949
+ var { getDrafts, getDraft, useSearchDrafts } = crud("drafts", { search: search7 });
938
950
  var searchModifiedPages = (params) => {
939
- return (pages) => search5({ ...params, isOriginal: false })(pages);
951
+ return (pages) => search7({ ...params, isOriginal: false })(pages);
940
952
  };
941
953
  var { useSearchPages: useSearchModifiedPages } = crud("pages", { search: searchModifiedPages });
942
954
 
943
955
  // src/selectors/collection.ts
944
956
  init_define_import_meta();
945
957
  import _6 from "lodash/fp.js";
946
- var search6 = (_params) => _6.identity;
958
+ var search8 = (_params) => _6.identity;
947
959
  var { getCollections, getCollection, useSearchCollections } = crud("collections", {
948
- search: search6
960
+ search: search8
949
961
  });
950
962
 
951
963
  // src/selectors/communityProject.ts
952
964
  init_define_import_meta();
953
965
  import { makeEntitiesFilter as makeEntitiesFilter6 } from "@lls/utils";
954
- var search7 = ({
966
+ var search9 = ({
955
967
  slugs,
956
968
  isFeatured,
957
969
  projectTypes
@@ -961,36 +973,44 @@ var search7 = ({
961
973
  projectTypes
962
974
  });
963
975
  var { getCommunityProjects, getCommunityProject, useSearchCommunityProjects } = crud("communityProjects", {
964
- search: search7
976
+ search: search9
965
977
  });
966
978
 
967
979
  // src/selectors/contact.ts
968
980
  init_define_import_meta();
969
981
  import _7 from "lodash/fp.js";
970
- var search8 = (_params) => _7.identity;
982
+ var search10 = (_params) => _7.identity;
971
983
  var { getContacts, getContact, useSearchContacts } = crud("contacts", {
972
- search: search8
984
+ search: search10
973
985
  });
974
986
 
975
987
  // src/selectors/copyNotification.ts
976
988
  init_define_import_meta();
977
989
  import { createSearchSelector as createSearchSelector3, makeEntitiesFilter as makeEntitiesFilter7, makeGetAllEntities as makeGetAllEntities2 } from "@lls/utils";
978
- var search9 = ({ ids, read, pageIds }) => {
990
+ var search11 = ({ ids, read, pageIds }) => {
979
991
  return makeEntitiesFilter7({ read, id: ids, page: pageIds });
980
992
  };
981
993
  var makeSearchCopyNotifications = () => createSearchSelector3(
982
- [makeGetCurrentUser(), makeGetAllEntities2("copyNotifications"), (_19, params) => params],
994
+ [makeGetCurrentUser(), makeGetAllEntities2("copyNotifications"), (_21, params) => params],
983
995
  (currentUser, copyNotifications, { pageIds, read }) => {
984
996
  const ids = currentUser?.copyNotifications;
985
- return search9({ ids, read, pageIds })(copyNotifications);
997
+ return search11({ ids, read, pageIds })(copyNotifications);
986
998
  }
987
999
  );
988
1000
  var useSearchCopyNotifications = makeUseSearch(makeSearchCopyNotifications);
989
1001
 
990
- // src/selectors/document.ts
1002
+ // src/selectors/docTemplate.ts
991
1003
  init_define_import_meta();
992
1004
  import { makeEntitiesFilter as makeEntitiesFilter8 } from "@lls/utils";
993
- var search10 = ({
1005
+ var search12 = ({ ids }) => makeEntitiesFilter8({
1006
+ id: ids
1007
+ });
1008
+ var { useSearchDocTemplates, getDocTemplate } = crud("docTemplates", { search: search12 });
1009
+
1010
+ // src/selectors/document.ts
1011
+ init_define_import_meta();
1012
+ import { makeEntitiesFilter as makeEntitiesFilter9 } from "@lls/utils";
1013
+ var search13 = ({
994
1014
  ids,
995
1015
  uuids,
996
1016
  resourceIds,
@@ -999,7 +1019,7 @@ var search10 = ({
999
1019
  documentTypes,
1000
1020
  subDocumentTypes
1001
1021
  }) => {
1002
- return makeEntitiesFilter8({
1022
+ return makeEntitiesFilter9({
1003
1023
  id: ids,
1004
1024
  resourceId: resourceIds,
1005
1025
  levels: levelIds,
@@ -1009,21 +1029,43 @@ var search10 = ({
1009
1029
  subDocumentType: subDocumentTypes
1010
1030
  });
1011
1031
  };
1012
- var { useSearchDocuments } = crud("documents", {
1013
- search: search10
1032
+ var { useSearchDocuments, getDocument } = crud("documents", {
1033
+ search: search13
1034
+ });
1035
+
1036
+ // src/selectors/documentType.ts
1037
+ init_define_import_meta();
1038
+ import { makeEntitiesFilter as makeEntitiesFilter10 } from "@lls/utils";
1039
+ var search14 = ({ ids }) => {
1040
+ return makeEntitiesFilter10({
1041
+ id: ids
1042
+ });
1043
+ };
1044
+ var searchSubDocumentType = ({
1045
+ ids
1046
+ }) => {
1047
+ return makeEntitiesFilter10({
1048
+ id: ids
1049
+ });
1050
+ };
1051
+ var { getSubDocumentTypes, useSearchSubDocumentTypes } = crud("subDocumentTypes", {
1052
+ search: searchSubDocumentType
1053
+ });
1054
+ var { getDocumentTypes, getDocumentType, useSearchDocumentTypes } = crud("documentTypes", {
1055
+ search: search14
1014
1056
  });
1015
1057
 
1016
1058
  // src/selectors/drawerNotification.ts
1017
1059
  init_define_import_meta();
1018
- import { createSearchSelector as createSearchSelector4, makeEntitiesFilter as makeEntitiesFilter9, makeGetAllEntities as makeGetAllEntities3 } from "@lls/utils";
1019
- var search11 = ({ ids, read, pageIds }) => {
1020
- return makeEntitiesFilter9({ read, id: ids, page: pageIds });
1060
+ import { createSearchSelector as createSearchSelector4, makeEntitiesFilter as makeEntitiesFilter11, makeGetAllEntities as makeGetAllEntities3 } from "@lls/utils";
1061
+ var search15 = ({ ids, read, pageIds }) => {
1062
+ return makeEntitiesFilter11({ read, id: ids, page: pageIds });
1021
1063
  };
1022
1064
  var makeSearchDrawerNotifications = () => createSearchSelector4(
1023
- [makeGetCurrentUser(), makeGetAllEntities3("drawerNotifications"), (_19, params) => params],
1065
+ [makeGetCurrentUser(), makeGetAllEntities3("drawerNotifications"), (_21, params) => params],
1024
1066
  (currentUser, drawerNotifications, { read, pageIds }) => {
1025
1067
  const ids = currentUser?.drawerNotifications;
1026
- return search11({ ids, read, pageIds })(drawerNotifications);
1068
+ return search15({ ids, read, pageIds })(drawerNotifications);
1027
1069
  }
1028
1070
  );
1029
1071
  var useSearchDrawerNotifications = makeUseSearch(makeSearchDrawerNotifications);
@@ -1036,44 +1078,49 @@ var getFaqs = makeGetAllEntities4("faq");
1036
1078
  // src/selectors/garDivision.ts
1037
1079
  init_define_import_meta();
1038
1080
  import _8 from "lodash/fp.js";
1039
- var search12 = (_params) => _8.identity;
1081
+ var search16 = (_params) => _8.identity;
1040
1082
  var { getGarDivisions, getGarDivision, useSearchGarDivisions } = crud("garDivisions", {
1041
- search: search12
1083
+ search: search16
1042
1084
  });
1043
1085
 
1086
+ // src/selectors/globalRights.ts
1087
+ init_define_import_meta();
1088
+ import _9 from "lodash/fp.js";
1089
+ var getGlobalRights = _9.get("entities.globalRights");
1090
+
1044
1091
  // src/selectors/group.ts
1045
1092
  init_define_import_meta();
1046
1093
  var import_reselect2 = __toESM(require_lib(), 1);
1047
- import { makeEntitiesFilter as makeEntitiesFilter10 } from "@lls/utils";
1048
- import _9 from "lodash/fp.js";
1049
- var search13 = ({ ownerIds }) => _9.flow(makeEntitiesFilter10({ owner: ownerIds }), _9.orderBy("createdAt", ["desc"]));
1094
+ import { makeEntitiesFilter as makeEntitiesFilter12 } from "@lls/utils";
1095
+ import _10 from "lodash/fp.js";
1096
+ var search17 = ({ ownerIds }) => _10.flow(makeEntitiesFilter12({ owner: ownerIds }), _10.orderBy("createdAt", ["desc"]));
1050
1097
  var { getGroups, getGroup, useSearchGroups } = crud("groups", {
1051
- search: search13
1098
+ search: search17
1052
1099
  });
1053
1100
  var getUserGroups = (0, import_reselect2.createSelector)(
1054
1101
  [getGroups, getCurrentUser],
1055
- (groups, currentUser) => search13({ ownerIds: [currentUser?.id] })(groups)
1102
+ (groups, currentUser) => search17({ ownerIds: [currentUser?.id] })(groups)
1056
1103
  );
1057
1104
 
1058
1105
  // src/selectors/level.ts
1059
1106
  init_define_import_meta();
1060
1107
  var import_reselect3 = __toESM(require_lib(), 1);
1061
- import { createSearchSelector as createSearchSelector5, makeEntitiesFilter as makeEntitiesFilter12, makeGetAllEntities as makeGetAllEntities5 } from "@lls/utils";
1062
- import _10 from "lodash/fp.js";
1108
+ import { createSearchSelector as createSearchSelector5, makeEntitiesFilter as makeEntitiesFilter14, makeGetAllEntities as makeGetAllEntities5 } from "@lls/utils";
1109
+ import _11 from "lodash/fp.js";
1063
1110
 
1064
1111
  // src/selectors/schoolType.ts
1065
1112
  init_define_import_meta();
1066
- import { makeEntitiesFilter as makeEntitiesFilter11 } from "@lls/utils";
1067
- var search14 = ({ slugs }) => makeEntitiesFilter11({ slug: slugs });
1113
+ import { makeEntitiesFilter as makeEntitiesFilter13 } from "@lls/utils";
1114
+ var search18 = ({ slugs }) => makeEntitiesFilter13({ slug: slugs });
1068
1115
  var { getSchoolTypes, getSchoolType, useSearchSchoolTypes, makeSearchSchoolTypes, searchSchoolTypes } = crud(
1069
1116
  "schoolTypes",
1070
1117
  {
1071
- search: search14
1118
+ search: search18
1072
1119
  }
1073
1120
  );
1074
1121
 
1075
1122
  // src/selectors/level.ts
1076
- var search15 = ({
1123
+ var search19 = ({
1077
1124
  ids,
1078
1125
  slugs,
1079
1126
  isPreSchool,
@@ -1083,8 +1130,8 @@ var search15 = ({
1083
1130
  isGenHighSchool,
1084
1131
  isElementarySchool,
1085
1132
  schoolTypes
1086
- }) => _10.flow(
1087
- makeEntitiesFilter12({
1133
+ }) => _11.flow(
1134
+ makeEntitiesFilter14({
1088
1135
  id: ids,
1089
1136
  slug: slugs,
1090
1137
  isPreSchool,
@@ -1095,7 +1142,7 @@ var search15 = ({
1095
1142
  isElementarySchool,
1096
1143
  schoolTypes
1097
1144
  }),
1098
- _10.orderBy("order", "desc")
1145
+ _11.orderBy("order", "desc")
1099
1146
  );
1100
1147
  var makeSearchLevels = () => {
1101
1148
  const searchSchoolTypes2 = makeSearchSchoolTypes();
@@ -1103,38 +1150,60 @@ var makeSearchLevels = () => {
1103
1150
  makeGetAllEntities5("levels"),
1104
1151
  (state, { schoolTypes }) => schoolTypes ? searchSchoolTypes2(state, { slugs: schoolTypes }) : void 0,
1105
1152
  (_state, params) => params,
1106
- (levels, schoolTypes, params) => search15({ ...params, schoolTypes: schoolTypes?.length ? schoolTypes?.map(({ id }) => id) : void 0 })(levels)
1153
+ (levels, schoolTypes, params) => search19({ ...params, schoolTypes: schoolTypes?.length ? schoolTypes?.map(({ id }) => id) : void 0 })(levels)
1107
1154
  );
1108
1155
  };
1109
- var crudLevels = crud("levels", { search: search15 });
1156
+ var crudLevels = crud("levels", { search: search19 });
1110
1157
  var { getLevel, searchLevels } = crudLevels;
1111
1158
  var getLevels = (0, import_reselect3.createSelector)(
1112
1159
  crudLevels.getLevels,
1113
- _10.orderBy("order", "desc")
1160
+ _11.orderBy("order", "desc")
1114
1161
  );
1115
1162
  var useSearchLevels = makeUseSearch(makeSearchLevels);
1116
1163
 
1164
+ // src/selectors/lexicalFlower.ts
1165
+ init_define_import_meta();
1166
+ import { makeEntitiesFilter as makeEntitiesFilter15 } from "@lls/utils";
1167
+ var search20 = ({ ids }) => makeEntitiesFilter15({ id: ids });
1168
+ var { getLexicalFlowers, useSearchLexicalFlowers } = crud("lexicalFlowers", {
1169
+ search: search20
1170
+ });
1171
+
1172
+ // src/selectors/license.ts
1173
+ init_define_import_meta();
1174
+ import { makeEntitiesFilter as makeEntitiesFilter16 } from "@lls/utils";
1175
+ var search21 = ({ reference }) => makeEntitiesFilter16({ reference });
1176
+ var { getLicenses, getLicense, searchLicenses } = crud("licenses", { search: search21 });
1177
+
1117
1178
  // src/selectors/mainNotification.ts
1118
1179
  init_define_import_meta();
1119
1180
  var import_reselect4 = __toESM(require_lib(), 1);
1120
- import { makeEntitiesFilter as makeEntitiesFilter13, makeGetAllEntities as makeGetAllEntities6 } from "@lls/utils";
1121
- import _11 from "lodash/fp.js";
1122
- var search16 = ({ ids }) => makeEntitiesFilter13({ id: ids });
1181
+ import { makeEntitiesFilter as makeEntitiesFilter17, makeGetAllEntities as makeGetAllEntities6 } from "@lls/utils";
1182
+ import _12 from "lodash/fp.js";
1183
+ var search22 = ({ ids }) => makeEntitiesFilter17({ id: ids });
1123
1184
  var getMainNotifications = (0, import_reselect4.createSelector)(
1124
- [_11.flow(makeGetCurrentUser(), _11.get("mainNotifications")), makeGetAllEntities6("mainNotifications")],
1125
- (userNotifications, notifications) => search16({ ids: userNotifications })(notifications)
1185
+ [_12.flow(makeGetCurrentUser(), _12.get("mainNotifications")), makeGetAllEntities6("mainNotifications")],
1186
+ (userNotifications, notifications) => search22({ ids: userNotifications })(notifications)
1126
1187
  );
1127
1188
 
1189
+ // src/selectors/method.ts
1190
+ init_define_import_meta();
1191
+ import { makeEntitiesFilter as makeEntitiesFilter18 } from "@lls/utils";
1192
+ var search23 = ({ ids, uris }) => makeEntitiesFilter18({ id: ids, uri: uris });
1193
+ var { getMethods, useSearchMethods } = crud("methods", {
1194
+ search: search23
1195
+ });
1196
+
1128
1197
  // src/selectors/news.ts
1129
1198
  init_define_import_meta();
1130
- import { makeEntitiesFilter as makeEntitiesFilter14 } from "@lls/utils";
1131
- var search17 = ({ ids }) => makeEntitiesFilter14({ id: ids });
1199
+ import { makeEntitiesFilter as makeEntitiesFilter19 } from "@lls/utils";
1200
+ var search24 = ({ ids }) => makeEntitiesFilter19({ id: ids });
1132
1201
  var {
1133
1202
  getNews: getAllNews,
1134
1203
  getNew: getNews,
1135
1204
  useSearchNews
1136
1205
  } = crud("news", {
1137
- search: search17
1206
+ search: search24
1138
1207
  });
1139
1208
 
1140
1209
  // src/selectors/panorama.ts
@@ -1144,26 +1213,18 @@ var getPanorama = makeGetEntityById3("panoramas");
1144
1213
 
1145
1214
  // src/selectors/premiumResource.ts
1146
1215
  init_define_import_meta();
1147
- import { makeEntitiesFilter as makeEntitiesFilter15 } from "@lls/utils";
1148
- var search18 = ({ bookIds }) => makeEntitiesFilter15({ book: bookIds });
1216
+ import { makeEntitiesFilter as makeEntitiesFilter20 } from "@lls/utils";
1217
+ var search25 = ({ bookIds }) => makeEntitiesFilter20({ book: bookIds });
1149
1218
  var { getPremiumResources, getPremiumResource, useSearchPremiumResources } = crud("premiumResources", {
1150
- search: search18
1151
- });
1152
-
1153
- // src/selectors/lexicalFlower.ts
1154
- init_define_import_meta();
1155
- import { makeEntitiesFilter as makeEntitiesFilter16 } from "@lls/utils";
1156
- var search19 = ({ ids }) => makeEntitiesFilter16({ id: ids });
1157
- var { getLexicalFlowers, useSearchLexicalFlowers } = crud("lexicalFlowers", {
1158
- search: search19
1219
+ search: search25
1159
1220
  });
1160
1221
 
1161
1222
  // src/selectors/product.ts
1162
1223
  init_define_import_meta();
1163
- import _12 from "lodash/fp.js";
1164
- import { createSearchSelector as createSearchSelector6, makeEntitiesFilter as makeEntitiesFilter17, makeGetAllEntities as makeGetAllEntities7 } from "@lls/utils";
1224
+ import _13 from "lodash/fp.js";
1225
+ import { createSearchSelector as createSearchSelector6, makeEntitiesFilter as makeEntitiesFilter21, makeGetAllEntities as makeGetAllEntities7 } from "@lls/utils";
1165
1226
  var getProducts = makeGetAllEntities7("products");
1166
- var search20 = ({
1227
+ var search26 = ({
1167
1228
  ids,
1168
1229
  eans,
1169
1230
  isAdoptant,
@@ -1173,7 +1234,7 @@ var search20 = ({
1173
1234
  productTypes
1174
1235
  }) => {
1175
1236
  let bookIds;
1176
- const filter = makeEntitiesFilter17(
1237
+ const filter = makeEntitiesFilter21(
1177
1238
  {
1178
1239
  id: ids,
1179
1240
  ean: eans,
@@ -1184,7 +1245,7 @@ var search20 = ({
1184
1245
  levelIds || subjectIds ? (product2) => !!product2?.books?.some((bookId) => bookIds.has(bookId)) : false
1185
1246
  );
1186
1247
  return (products, books) => {
1187
- bookIds = new Set(_12.flow(_12.map("id"), _12.map(_12.parseInt(10)))(books));
1248
+ bookIds = new Set(_13.flow(_13.map("id"), _13.map(_13.parseInt(10)))(books));
1188
1249
  return filter(products);
1189
1250
  };
1190
1251
  };
@@ -1194,33 +1255,57 @@ var makeSearchProducts = () => {
1194
1255
  makeGetAllEntities7("products"),
1195
1256
  (state, { levelIds, subjectIds }) => searchBooks(state, { levelIds, subjectIds }),
1196
1257
  (_state, params) => params,
1197
- (products, books, params) => search20(params)(products, books)
1258
+ (products, books, params) => search26(params)(products, books)
1198
1259
  );
1199
1260
  };
1200
1261
  var useSearchProducts = makeUseSearch(makeSearchProducts);
1201
1262
 
1263
+ // src/selectors/promotionalInsert.ts
1264
+ init_define_import_meta();
1265
+ import { pipe as pipe4 } from "@lls/utils";
1266
+ import _14 from "lodash/fp.js";
1267
+ var search27 = ({ sortByQuery }) => (promotionalInserts) => pipe4(promotionalInserts, _14.isFunction(sortByQuery) ? sortByQuery : sortByQuery ? _14.sortBy(sortByQuery) : _14.identity);
1268
+ var { getPromotionalInserts, getPromotionalInsert, useSearchPromotionalInserts } = crud("promotionalInserts", {
1269
+ search: search27
1270
+ });
1271
+
1202
1272
  // src/selectors/resource.ts
1203
1273
  init_define_import_meta();
1204
- import { makeEntitiesFilter as makeEntitiesFilter18 } from "@lls/utils";
1205
- var search21 = ({ chapterIds }) => makeEntitiesFilter18({
1274
+ import { makeEntitiesFilter as makeEntitiesFilter22 } from "@lls/utils";
1275
+ var search28 = ({ chapterIds }) => makeEntitiesFilter22({
1206
1276
  chapter: chapterIds
1207
1277
  });
1208
1278
  var { getResources, getResource, useSearchResources } = crud("resources", {
1209
- search: search21
1279
+ search: search28
1280
+ });
1281
+
1282
+ // src/selectors/school.ts
1283
+ init_define_import_meta();
1284
+ import { makeEntitiesFilter as makeEntitiesFilter23, pipe as pipe5 } from "@lls/utils";
1285
+ import _15 from "lodash/fp.js";
1286
+ var search29 = ({ ids, academyIds, sortByQuery }) => {
1287
+ return (schools) => pipe5(
1288
+ schools,
1289
+ makeEntitiesFilter23({ id: ids, academy: academyIds }),
1290
+ _15.isFunction(sortByQuery) ? sortByQuery : sortByQuery ? _15.sortBy(sortByQuery) : _15.identity
1291
+ );
1292
+ };
1293
+ var { getSchools, getSchool, useSearchSchools } = crud("schools", {
1294
+ search: search29
1210
1295
  });
1211
1296
 
1212
1297
  // src/selectors/sharedPage.ts
1213
1298
  init_define_import_meta();
1214
- import { createSearchSelector as createSearchSelector7, makeEntitiesFilter as makeEntitiesFilter19 } from "@lls/utils";
1215
- import _13 from "lodash/fp.js";
1216
- var search22 = ({
1299
+ import { createSearchSelector as createSearchSelector7, makeEntitiesFilter as makeEntitiesFilter24 } from "@lls/utils";
1300
+ import _16 from "lodash/fp.js";
1301
+ var search30 = ({
1217
1302
  parentIds,
1218
1303
  userIds,
1219
1304
  bookIds,
1220
1305
  isCreatedFromScratch,
1221
1306
  isLearningAssessment,
1222
1307
  ids
1223
- }) => makeEntitiesFilter19({
1308
+ }) => makeEntitiesFilter24({
1224
1309
  id: ids,
1225
1310
  parent: parentIds,
1226
1311
  user: userIds,
@@ -1229,7 +1314,7 @@ var search22 = ({
1229
1314
  isCreatedFromScratch
1230
1315
  });
1231
1316
  var { getSharedPages, getSharedPage, useSearchSharedPages } = crud("sharedPages", {
1232
- search: search22
1317
+ search: search30
1233
1318
  });
1234
1319
  var makeSearchCurrentUserSharedPages = () => createSearchSelector7(
1235
1320
  getCurrentUser,
@@ -1237,24 +1322,24 @@ var makeSearchCurrentUserSharedPages = () => createSearchSelector7(
1237
1322
  (__, params) => params,
1238
1323
  (user2, sharedPages, params) => {
1239
1324
  const sharedUserPageIds = user2?.sharedPages ?? [];
1240
- return search22({ ...params, ids: _13.intersection(sharedUserPageIds, params.ids || sharedUserPageIds) })(sharedPages);
1325
+ return search30({ ...params, ids: _16.intersection(sharedUserPageIds, params.ids || sharedUserPageIds) })(sharedPages);
1241
1326
  }
1242
1327
  );
1243
1328
  var useSearchCurrentUserSharedPages = makeUseSearch(makeSearchCurrentUserSharedPages);
1244
1329
 
1245
1330
  // src/selectors/student.ts
1246
1331
  init_define_import_meta();
1247
- import { makeEntitiesFilter as makeEntitiesFilter20 } from "@lls/utils";
1248
- var search23 = ({ ids }) => makeEntitiesFilter20({ id: ids });
1332
+ import { makeEntitiesFilter as makeEntitiesFilter25 } from "@lls/utils";
1333
+ var search31 = ({ ids }) => makeEntitiesFilter25({ id: ids });
1249
1334
  var { getStudents, getStudent, useSearchStudents } = crud("students", {
1250
- search: search23
1335
+ search: search31
1251
1336
  });
1252
1337
 
1253
1338
  // src/selectors/subject.ts
1254
1339
  init_define_import_meta();
1255
- import { limitToTeacherSubjects, makeEntitiesFilter as makeEntitiesFilter21, pipe as pipe5 } from "@lls/utils";
1256
- import _14 from "lodash/fp.js";
1257
- var search24 = ({
1340
+ import { limitToTeacherSubjects, makeEntitiesFilter as makeEntitiesFilter26, pipe as pipe6 } from "@lls/utils";
1341
+ import _17 from "lodash/fp.js";
1342
+ var search32 = ({
1258
1343
  ids,
1259
1344
  slugs,
1260
1345
  isTeacherSubject,
@@ -1263,9 +1348,9 @@ var search24 = ({
1263
1348
  hasBooks,
1264
1349
  names,
1265
1350
  sortByQuery
1266
- }) => (subjects) => pipe5(
1351
+ }) => (subjects) => pipe6(
1267
1352
  subjects,
1268
- makeEntitiesFilter21(
1353
+ makeEntitiesFilter26(
1269
1354
  {
1270
1355
  id: ids,
1271
1356
  slug: slugs,
@@ -1273,94 +1358,42 @@ var search24 = ({
1273
1358
  hasBooks,
1274
1359
  schoolTypes
1275
1360
  },
1276
- !_14.isNil(hasNewsletterUrl) && ((subject2) => Boolean(subject2?.newsletterUrl) === hasNewsletterUrl)
1361
+ !_17.isNil(hasNewsletterUrl) && ((subject2) => Boolean(subject2?.newsletterUrl) === hasNewsletterUrl)
1277
1362
  ),
1278
- (subjects2) => _14.isNil(isTeacherSubject) ? subjects2 : limitToTeacherSubjects(subjects2),
1279
- _14.isFunction(sortByQuery) ? sortByQuery : sortByQuery ? _14.sortBy(sortByQuery) : _14.identity
1363
+ (subjects2) => _17.isNil(isTeacherSubject) ? subjects2 : limitToTeacherSubjects(subjects2),
1364
+ _17.isFunction(sortByQuery) ? sortByQuery : sortByQuery ? _17.sortBy(sortByQuery) : _17.identity
1280
1365
  );
1281
1366
  var { getSubjects, getSubject, useSearchSubjects, makeSearchSubjects } = crud("subjects", {
1282
- search: search24
1367
+ search: search32
1283
1368
  });
1284
1369
 
1285
1370
  // src/selectors/teacher.ts
1286
1371
  init_define_import_meta();
1287
- import { makeEntitiesFilter as makeEntitiesFilter22 } from "@lls/utils";
1288
- var search25 = ({ ids, schoolIds }) => makeEntitiesFilter22({
1372
+ import { makeEntitiesFilter as makeEntitiesFilter27 } from "@lls/utils";
1373
+ var search33 = ({ ids, schoolIds }) => makeEntitiesFilter27({
1289
1374
  id: ids,
1290
1375
  schools: schoolIds
1291
1376
  });
1292
1377
  var { getTeachers, getTeacher, useSearchTeachers } = crud("teachers", {
1293
- search: search25
1294
- });
1295
-
1296
- // src/selectors/method.ts
1297
- init_define_import_meta();
1298
- import { makeEntitiesFilter as makeEntitiesFilter23 } from "@lls/utils";
1299
- var search26 = ({ ids, uris }) => makeEntitiesFilter23({ id: ids, uri: uris });
1300
- var { getMethods, useSearchMethods } = crud("methods", {
1301
- search: search26
1378
+ search: search33
1302
1379
  });
1303
1380
 
1304
1381
  // src/selectors/tool.ts
1305
1382
  init_define_import_meta();
1306
- import { makeEntitiesFilter as makeEntitiesFilter24 } from "@lls/utils";
1307
- var search27 = ({ ids, locked, bookIds }) => makeEntitiesFilter24({
1383
+ import { makeEntitiesFilter as makeEntitiesFilter28 } from "@lls/utils";
1384
+ var search34 = ({ ids, locked, bookIds }) => makeEntitiesFilter28({
1308
1385
  id: ids,
1309
1386
  locked,
1310
1387
  books: bookIds
1311
1388
  });
1312
1389
  var { getTools, getTool, useSearchTools } = crud("tools", {
1313
- search: search27
1314
- });
1315
-
1316
- // src/selectors/builderIo.ts
1317
- init_define_import_meta();
1318
- import { makeEntitiesFilter as makeEntitiesFilter25 } from "@lls/utils";
1319
- var search28 = ({ modelIds, subjects, schoolTypes }) => makeEntitiesFilter25(
1320
- {
1321
- modelId: modelIds
1322
- },
1323
- subjects && ((builderIo2) => !!builderIo2?.data?.subjects?.some((x) => subjects.includes(x))),
1324
- schoolTypes && ((builderIo2) => !!builderIo2?.data?.schoolTypes?.some((x) => schoolTypes.includes(x)))
1325
- );
1326
- var { getBuilderIos, getBuilderIo, useSearchBuilderIos } = crud("builderIos", {
1327
- search: search28
1328
- });
1329
-
1330
- // src/selectors/circonscription.ts
1331
- init_define_import_meta();
1332
- import _15 from "lodash/fp.js";
1333
- var search29 = (_params) => _15.identity;
1334
- var { getCirconscriptions } = crud("circonscriptions", {
1335
- search: search29
1336
- });
1337
-
1338
- // src/selectors/documentType.ts
1339
- init_define_import_meta();
1340
- import { makeEntitiesFilter as makeEntitiesFilter26 } from "@lls/utils";
1341
- var search30 = ({ ids }) => {
1342
- return makeEntitiesFilter26({
1343
- id: ids
1344
- });
1345
- };
1346
- var searchSubDocumentType = ({
1347
- ids
1348
- }) => {
1349
- return makeEntitiesFilter26({
1350
- id: ids
1351
- });
1352
- };
1353
- var { getSubDocumentTypes, useSearchSubDocumentTypes } = crud("subDocumentTypes", {
1354
- search: searchSubDocumentType
1355
- });
1356
- var { getDocumentTypes, getDocumentType, useSearchDocumentTypes } = crud("documentTypes", {
1357
- search: search30
1390
+ search: search34
1358
1391
  });
1359
1392
 
1360
1393
  // src/reducers/entities.ts
1361
1394
  init_define_import_meta();
1362
1395
  import { makeReducer } from "@lls/utils";
1363
- import _16 from "lodash/fp.js";
1396
+ import _18 from "lodash/fp.js";
1364
1397
 
1365
1398
  // src/actions/index.ts
1366
1399
  init_define_import_meta();
@@ -1383,16 +1416,16 @@ var resetAuth = makeActionCreator(actionTypes.RESET_AUTH);
1383
1416
  // src/reducers/entities.ts
1384
1417
  var deleteEntityReducer = (state, payload) => {
1385
1418
  const { path } = payload;
1386
- return _16.omit(path, state);
1419
+ return _18.omit(path, state);
1387
1420
  };
1388
1421
  var updateEntityReducer = (state, payload) => {
1389
1422
  const { path, entity } = payload;
1390
- const currentEntity = _16.get(path, state);
1391
- return _16.set(path, _16.merge(currentEntity, entity), state);
1423
+ const currentEntity = _18.get(path, state);
1424
+ return _18.set(path, _18.merge(currentEntity, entity), state);
1392
1425
  };
1393
1426
  var setEntityReducer = (state, payload) => {
1394
1427
  const { path, entity } = payload;
1395
- return _16.set(path, entity, state);
1428
+ return _18.set(path, entity, state);
1396
1429
  };
1397
1430
  var setEntitiesReducer = (state, payload) => {
1398
1431
  if (typeof payload !== "object") return state;
@@ -1413,7 +1446,7 @@ var setEntitiesReducer = (state, payload) => {
1413
1446
  }
1414
1447
  const diff = Object.keys(entity).some((prop) => {
1415
1448
  const value = entity[prop];
1416
- if (!_16.isEqual(state[entityName]?.[id]?.[prop], value)) {
1449
+ if (!_18.isEqual(state[entityName]?.[id]?.[prop], value)) {
1417
1450
  return true;
1418
1451
  }
1419
1452
  });
@@ -1445,7 +1478,7 @@ var entities_default = entities;
1445
1478
  // src/reducers/auth.ts
1446
1479
  init_define_import_meta();
1447
1480
  import { makeReducer as makeReducer2 } from "@lls/utils";
1448
- import _17 from "lodash/fp.js";
1481
+ import _19 from "lodash/fp.js";
1449
1482
  var initialState = {
1450
1483
  id: void 0,
1451
1484
  role: null,
@@ -1458,15 +1491,15 @@ var initialState = {
1458
1491
  llsUserId: null
1459
1492
  };
1460
1493
  var auth = makeReducer2(initialState, {
1461
- [actionTypes.SET_AUTH]: _17.assign,
1462
- [actionTypes.RESET_AUTH]: _17.constant(initialState)
1494
+ [actionTypes.SET_AUTH]: _19.assign,
1495
+ [actionTypes.RESET_AUTH]: _19.constant(initialState)
1463
1496
  });
1464
1497
  var auth_default = auth;
1465
1498
 
1466
1499
  // src/schema/index.ts
1467
1500
  init_define_import_meta();
1468
1501
  var import_normalizr = __toESM(require_normalizr(), 1);
1469
- import _18 from "lodash/fp.js";
1502
+ import _20 from "lodash/fp.js";
1470
1503
  var document = new import_normalizr.schema.Entity("documents");
1471
1504
  var documentType = new import_normalizr.schema.Entity("documentTypes");
1472
1505
  var subDocumentType = new import_normalizr.schema.Entity("subDocumentTypes");
@@ -1485,6 +1518,14 @@ var product = new import_normalizr.schema.Entity("products");
1485
1518
  var communityProjects = new import_normalizr.schema.Entity("communityProjects");
1486
1519
  var builderIo = new import_normalizr.schema.Entity("builderIos");
1487
1520
  var lexicalFlower = new import_normalizr.schema.Entity("lexicalFlowers");
1521
+ var globalRights = new import_normalizr.schema.Entity(
1522
+ "globalRights",
1523
+ {},
1524
+ {
1525
+ idAttribute: (_21, __, key) => key
1526
+ // Use keys from globalRights(anonymous, classroom, connected, teacher) as Id
1527
+ }
1528
+ );
1488
1529
  var grammarRule = new import_normalizr.schema.Entity("grammarRules", {}, { idAttribute: "objectID" });
1489
1530
  var mainNotification = new import_normalizr.schema.Entity("mainNotifications");
1490
1531
  var explorerResult = new import_normalizr.schema.Entity("explorerResults", {}, { idAttribute: "resourceId" });
@@ -1504,6 +1545,19 @@ var panorama = new import_normalizr.schema.Entity("panoramas");
1504
1545
  var premiumResource = new import_normalizr.schema.Entity("premiumResources");
1505
1546
  var garDivision = new import_normalizr.schema.Entity("garDivisions");
1506
1547
  var circonscription = new import_normalizr.schema.Entity("circonscriptions");
1548
+ var promotionalInsert = new import_normalizr.schema.Entity("promotionalInserts");
1549
+ var academy = new import_normalizr.schema.Entity("academies");
1550
+ var docTemplate = new import_normalizr.schema.Entity("docTemplates");
1551
+ var thematic = new import_normalizr.schema.Entity("thematics");
1552
+ var connector = new import_normalizr.schema.Entity("connectors");
1553
+ var license = new import_normalizr.schema.Entity("licenses");
1554
+ var subscription = new import_normalizr.schema.Entity("subscriptions");
1555
+ var miniUrls = new import_normalizr.schema.Entity("miniUrls", {}, { idAttribute: "path" });
1556
+ var notions = new import_normalizr.schema.Entity("notions");
1557
+ var words = new import_normalizr.schema.Entity("words");
1558
+ var opportunity = new import_normalizr.schema.Entity("opportunities");
1559
+ var formula = new import_normalizr.schema.Entity("formulas");
1560
+ var prompt = new import_normalizr.schema.Entity("prompts");
1507
1561
  var define = (el, scheme) => {
1508
1562
  el.define(scheme);
1509
1563
  return scheme;
@@ -1520,14 +1574,32 @@ var bookSchema = define(book, {
1520
1574
  subjects: [subject],
1521
1575
  textbooks: [book],
1522
1576
  educationalGuides: [book],
1577
+ parts: [book],
1523
1578
  tools: [tool],
1524
1579
  workbooks: [book],
1525
- workplans: [book]
1580
+ workplans: [book],
1581
+ parent: [book]
1582
+ });
1583
+ var academySchema = define(academy, {
1584
+ schools: [school]
1585
+ });
1586
+ var docTemplateSchema = define(docTemplate, {
1587
+ book
1588
+ });
1589
+ var promotionalInsertSchema = define(promotionalInsert, {
1590
+ subjects: [subject],
1591
+ levels: [level]
1526
1592
  });
1527
1593
  var garDivisionSchema = define(garDivision, {
1528
1594
  students: [user],
1529
1595
  school
1530
1596
  });
1597
+ var licenseSchema = define(license, {
1598
+ school,
1599
+ user,
1600
+ books: [book],
1601
+ subscriptions: [subscription]
1602
+ });
1531
1603
  var documentTypeSchema = define(documentType, {
1532
1604
  subTypes: [subDocumentType]
1533
1605
  });
@@ -1559,6 +1631,7 @@ var pageSchema = define(page, {
1559
1631
  });
1560
1632
  var userSchema = define(user, {
1561
1633
  books: [book],
1634
+ booksContributedTo: [book],
1562
1635
  booksV2: [book],
1563
1636
  contacts: [contact],
1564
1637
  copies: [page],
@@ -1569,6 +1642,7 @@ var userSchema = define(user, {
1569
1642
  lastBooksViewed: [book],
1570
1643
  lastPagesViewed: [page],
1571
1644
  levels: [level],
1645
+ lexicalFlowers: { hits: [lexicalFlower] },
1572
1646
  mainNotifications: [mainNotification],
1573
1647
  pages: [page],
1574
1648
  schools: [school],
@@ -1577,8 +1651,7 @@ var userSchema = define(user, {
1577
1651
  subjects: [subject],
1578
1652
  teachers: [teacher],
1579
1653
  userPages: [page],
1580
- userBookPages: [page],
1581
- lexicalFlowers: { hits: [lexicalFlower] }
1654
+ userBookPages: [page]
1582
1655
  });
1583
1656
  var notificationSchema = define(mainNotification, { page });
1584
1657
  drawerNotification.define({ page });
@@ -1591,11 +1664,11 @@ var toolSchema = define(tool, {
1591
1664
  books: [book]
1592
1665
  });
1593
1666
  var sharedPageSchema = define(sharedPage, {
1594
- user,
1667
+ book,
1595
1668
  chapter,
1669
+ originalPage: page,
1596
1670
  parent: page,
1597
- book,
1598
- originalPage: page
1671
+ user
1599
1672
  });
1600
1673
  var studentSchema = define(student, {
1601
1674
  levels: [level]
@@ -1612,7 +1685,10 @@ var groupSchema = define(group, {
1612
1685
  students: [student]
1613
1686
  });
1614
1687
  var schoolSchema = define(school, {
1615
- groups: [group]
1688
+ groups: [group],
1689
+ teachers: [user],
1690
+ students: [user],
1691
+ users: [user]
1616
1692
  });
1617
1693
  var methodSchema = define(method, {
1618
1694
  book
@@ -1630,54 +1706,75 @@ var levelSchema = define(level, {
1630
1706
  });
1631
1707
  var querySchema = {
1632
1708
  viewer: {
1633
- addCorrectionsToGroup: group,
1634
- addCorrectionsToStudents: page,
1635
- addPageAppreciation: page,
1636
- addStudentToGroup: group,
1709
+ academies: { hits: [academy] },
1637
1710
  books: { hits: [book] },
1638
- methods: { hits: [method] },
1639
1711
  chapters: { hits: [chapter] },
1640
- createEstimate: quote,
1641
- createGroup: group,
1642
- createPage: page,
1643
- createUser: user,
1644
- createLexicalFlower: lexicalFlower,
1712
+ collections: { hits: [collection] },
1713
+ connectors: { hits: [connector] },
1714
+ docTemplates: { hits: [docTemplate] },
1645
1715
  documents: { hits: [document] },
1646
1716
  documentTypes: { hits: [documentType] },
1647
- subDocumentTypes: { hits: [subDocumentType] },
1717
+ educationalGuides: { hits: [book] },
1648
1718
  explorerResults: [explorerResult],
1719
+ globalRights: new import_normalizr.schema.Values(globalRights),
1649
1720
  levels: [level],
1721
+ licenses: { hits: [license] },
1722
+ methods: { hits: [method] },
1650
1723
  me: user,
1651
- // mutations
1724
+ miniUrls: [miniUrls],
1725
+ notions: { hits: [notions] },
1652
1726
  pages: { hits: [page] },
1653
1727
  panoramas: [panorama],
1654
1728
  parents: { hits: [page] },
1655
1729
  //pages alias
1656
1730
  product: { hits: [product] },
1731
+ promotionalInserts: { hits: [promotionalInsert] },
1732
+ prompts: { hits: [prompt] },
1733
+ resources: { hits: [resource] },
1734
+ schools: { hits: [school] },
1657
1735
  schoolTypes: { hits: [schoolType] },
1736
+ subDocumentTypes: { hits: [subDocumentType] },
1737
+ subjects: { hits: [subject] },
1738
+ textbooks: { hits: [book] },
1739
+ thematics: { hits: [thematic] },
1740
+ tools: { hits: [tool] },
1741
+ words: { hits: [words] },
1742
+ workbooks: { hits: [book] },
1743
+ workplans: { hits: [book] },
1744
+ // mutations
1745
+ addCorrectionsToGroup: group,
1746
+ addCorrectionsToStudents: page,
1747
+ addPageAppreciation: page,
1748
+ addStudentToGroup: group,
1749
+ createEstimate: quote,
1750
+ createGroup: group,
1751
+ createPage: page,
1752
+ createUser: user,
1753
+ createLexicalFlower: lexicalFlower,
1658
1754
  sharePageToGroup: page,
1659
1755
  sharePageToUsers: page,
1660
- subjects: { hits: [subject] },
1661
1756
  updateCopyNotification: copyNotification,
1662
1757
  updateDrawerNotification: drawerNotification,
1663
1758
  updateGroup: group,
1759
+ updateLexicalFlower: lexicalFlower,
1664
1760
  updateMainNotification: mainNotification,
1665
1761
  updatePage: page,
1666
1762
  updateTrialUser: user,
1667
1763
  updateUserLastActivitySeenAt: user,
1668
- updateUser: user,
1669
- updateLexicalFlower: lexicalFlower
1764
+ updateUser: user
1670
1765
  },
1671
1766
  auth: {
1672
1767
  user
1673
1768
  },
1674
1769
  marketing: {
1675
- addLikeFaq: faq,
1770
+ builderIos: [builderIo],
1771
+ circonscriptions: [circonscription],
1676
1772
  communityProjects: [communityProjects],
1677
- createAnalytics: analytic,
1678
1773
  faq: [faq],
1679
- builderIos: [builderIo],
1680
- circonscriptions: [circonscription]
1774
+ news: { hits: [news] },
1775
+ // mutations
1776
+ addLikeFaq: faq,
1777
+ createAnalytics: analytic
1681
1778
  },
1682
1779
  static: {
1683
1780
  projetVoltaire: {
@@ -1685,12 +1782,36 @@ var querySchema = {
1685
1782
  }
1686
1783
  }
1687
1784
  };
1688
- var normalizeData = _18.flow((data) => (0, import_normalizr.normalize)(data, querySchema));
1785
+ var augmentNormalizeSchema = (augmentSchemaFn) => {
1786
+ const augmentedSchema = augmentSchemaFn({
1787
+ connector,
1788
+ formula,
1789
+ license,
1790
+ opportunity,
1791
+ user,
1792
+ docTemplate,
1793
+ document,
1794
+ documentType,
1795
+ school,
1796
+ book,
1797
+ chapter,
1798
+ page
1799
+ });
1800
+ const overridingKeys = Object.keys(augmentedSchema).filter((key) => key in querySchema);
1801
+ if (overridingKeys.length) {
1802
+ throw new Error(`can not override schema with existing ${overridingKeys}. implement them in viewer instead`);
1803
+ }
1804
+ return _20.flow((data) => (0, import_normalizr.normalize)(data, { ...augmentedSchema, ...querySchema }));
1805
+ };
1806
+ var normalizeData = _20.flow((data) => (0, import_normalizr.normalize)(data, querySchema));
1689
1807
  export {
1808
+ augmentNormalizeSchema,
1690
1809
  auth_default as authReducer,
1691
1810
  entities_default as entitiesReducer,
1692
1811
  filterBooks,
1693
1812
  filterPages,
1813
+ getAcademies,
1814
+ getAcademy,
1694
1815
  getAllNews,
1695
1816
  getAuth,
1696
1817
  getBook,
@@ -1707,6 +1828,8 @@ export {
1707
1828
  getContact,
1708
1829
  getContacts,
1709
1830
  getCurrentUser,
1831
+ getDocTemplate,
1832
+ getDocument,
1710
1833
  getDocumentType,
1711
1834
  getDocumentTypes,
1712
1835
  getDraft,
@@ -1714,12 +1837,15 @@ export {
1714
1837
  getFaqs,
1715
1838
  getGarDivision,
1716
1839
  getGarDivisions,
1840
+ getGlobalRights,
1717
1841
  getGroup,
1718
1842
  getGroups,
1719
1843
  getIsLogged,
1720
1844
  getLevel,
1721
1845
  getLevels,
1722
1846
  getLexicalFlowers,
1847
+ getLicense,
1848
+ getLicenses,
1723
1849
  getMainNotifications,
1724
1850
  getMethods,
1725
1851
  getNews,
@@ -1729,6 +1855,8 @@ export {
1729
1855
  getPremiumResource,
1730
1856
  getPremiumResources,
1731
1857
  getProducts,
1858
+ getPromotionalInsert,
1859
+ getPromotionalInserts,
1732
1860
  getResource,
1733
1861
  getResources,
1734
1862
  getSchool,
@@ -1763,6 +1891,7 @@ export {
1763
1891
  normalizeData,
1764
1892
  querySchema,
1765
1893
  searchLevels,
1894
+ searchLicenses,
1766
1895
  searchSchoolTypes,
1767
1896
  setEntitiesReducer,
1768
1897
  useSearchBooks,
@@ -1773,6 +1902,7 @@ export {
1773
1902
  useSearchContacts,
1774
1903
  useSearchCopyNotifications,
1775
1904
  useSearchCurrentUserSharedPages,
1905
+ useSearchDocTemplates,
1776
1906
  useSearchDocumentTypes,
1777
1907
  useSearchDocuments,
1778
1908
  useSearchDrafts,
@@ -1787,6 +1917,7 @@ export {
1787
1917
  useSearchPages,
1788
1918
  useSearchPremiumResources,
1789
1919
  useSearchProducts,
1920
+ useSearchPromotionalInserts,
1790
1921
  useSearchResources,
1791
1922
  useSearchSchoolTypes,
1792
1923
  useSearchSchools,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@lls/store",
3
3
  "description": "model de donnée et selecteurs",
4
4
  "homepage": "https://github.com/lelivrescolaire/monorepo/tree/dev/libs/store",
5
- "version": "24.11.0",
5
+ "version": "24.12.0-07282d1b",
6
6
  "type": "module",
7
7
  "types": "./lib/builttypes/store/src/index.d.ts",
8
8
  "exports": {
@@ -23,6 +23,7 @@
23
23
  },
24
24
  "keywords": [],
25
25
  "peerDependencies": {
26
+ "@lls/common": "*",
26
27
  "@lls/utils": "*",
27
28
  "lodash": "*",
28
29
  "react": "*",
@@ -32,24 +33,26 @@
32
33
  "devDependencies": {
33
34
  "@biomejs/biome": "1.9.4",
34
35
  "@happy-dom/global-registrator": "15.11.0",
35
- "@testing-library/react": "16.0.1",
36
- "@types/lodash": "4.17.13",
37
- "@types/node": "22.9.0",
36
+ "@testing-library/react": "16.2.0",
37
+ "@types/lodash": "4.17.14",
38
+ "@types/node": "22.10.7",
38
39
  "@types/react": "18.3.12",
39
40
  "@types/react-redux": "7.1.34",
40
- "@vitejs/plugin-react-swc": "3.7.1",
41
+ "@vitejs/plugin-react-swc": "3.7.2",
41
42
  "esbuild": "0.24.0",
42
43
  "happy-dom": "15.11.0",
43
44
  "lodash": "4.17.21",
44
45
  "react": "18.3.1",
46
+ "react-dom": "18.3.1",
45
47
  "react-redux": "8.1.2",
46
48
  "redux": "5.0.1",
47
49
  "reselect": "4.1.8",
48
- "typescript": "5.6.3",
50
+ "typescript": "5.7.3",
49
51
  "vite": "5.4.11",
50
- "vite-tsconfig-paths": "5.1.3",
51
- "@lls/vitescripts": "24.11.0",
52
- "@lls/utils": "24.11.0"
52
+ "vite-tsconfig-paths": "5.1.4",
53
+ "@lls/common": "24.12.0-07282d1b",
54
+ "@lls/utils": "24.12.0-07282d1b",
55
+ "@lls/vitescripts": "24.12.0-07282d1b"
53
56
  },
54
57
  "license": "ISC",
55
58
  "dependencies": {