@lls/store 24.12.0 → 24.13.0-010b0272

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 +382 -229
  2. package/package.json +14 -12
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
736
+ // src/selectors/academy.ts
737
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
744
- 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: search36 }) => {
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) => search36(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}`]: search36,
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"), (_20, params) => params],
994
+ [makeGetCurrentUser(), makeGetAllEntities2("copyNotifications"), (_22, 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,
@@ -1010,20 +1030,42 @@ var search10 = ({
1010
1030
  });
1011
1031
  };
1012
1032
  var { useSearchDocuments, getDocument } = crud("documents", {
1013
- search: search10
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"), (_20, params) => params],
1065
+ [makeGetCurrentUser(), makeGetAllEntities3("drawerNotifications"), (_22, 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,58 @@ 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 _12 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, pipe as pipe4 } from "@lls/utils";
1114
+ import _11 from "lodash/fp.js";
1115
+ var search18 = ({ slugs, sortByQuery }) => {
1116
+ return (books) => pipe4(
1117
+ books,
1118
+ makeEntitiesFilter13({
1119
+ slug: slugs
1120
+ }),
1121
+ _11.isFunction(sortByQuery) ? sortByQuery : sortByQuery ? _11.sortBy(sortByQuery) : _11.sortBy("order")
1122
+ );
1123
+ };
1068
1124
  var { getSchoolTypes, getSchoolType, useSearchSchoolTypes, makeSearchSchoolTypes, searchSchoolTypes } = crud(
1069
1125
  "schoolTypes",
1070
1126
  {
1071
- search: search14
1127
+ search: search18
1072
1128
  }
1073
1129
  );
1074
1130
 
1075
1131
  // src/selectors/level.ts
1076
- var search15 = ({
1132
+ var search19 = ({
1077
1133
  ids,
1078
1134
  slugs,
1079
1135
  isPreSchool,
@@ -1083,8 +1139,8 @@ var search15 = ({
1083
1139
  isGenHighSchool,
1084
1140
  isElementarySchool,
1085
1141
  schoolTypes
1086
- }) => _10.flow(
1087
- makeEntitiesFilter12({
1142
+ }) => _12.flow(
1143
+ makeEntitiesFilter14({
1088
1144
  id: ids,
1089
1145
  slug: slugs,
1090
1146
  isPreSchool,
@@ -1095,7 +1151,7 @@ var search15 = ({
1095
1151
  isElementarySchool,
1096
1152
  schoolTypes
1097
1153
  }),
1098
- _10.orderBy("order", "desc")
1154
+ _12.orderBy("order", "desc")
1099
1155
  );
1100
1156
  var makeSearchLevels = () => {
1101
1157
  const searchSchoolTypes2 = makeSearchSchoolTypes();
@@ -1103,38 +1159,70 @@ var makeSearchLevels = () => {
1103
1159
  makeGetAllEntities5("levels"),
1104
1160
  (state, { schoolTypes }) => schoolTypes ? searchSchoolTypes2(state, { slugs: schoolTypes }) : void 0,
1105
1161
  (_state, params) => params,
1106
- (levels, schoolTypes, params) => search15({ ...params, schoolTypes: schoolTypes?.length ? schoolTypes?.map(({ id }) => id) : void 0 })(levels)
1162
+ (levels, schoolTypes, params) => search19({ ...params, schoolTypes: schoolTypes?.length ? schoolTypes?.map(({ id }) => id) : void 0 })(levels)
1107
1163
  );
1108
1164
  };
1109
- var crudLevels = crud("levels", { search: search15 });
1165
+ var crudLevels = crud("levels", { search: search19 });
1110
1166
  var { getLevel, searchLevels } = crudLevels;
1111
1167
  var getLevels = (0, import_reselect3.createSelector)(
1112
1168
  crudLevels.getLevels,
1113
- _10.orderBy("order", "desc")
1169
+ _12.orderBy("order", "desc")
1114
1170
  );
1115
1171
  var useSearchLevels = makeUseSearch(makeSearchLevels);
1116
1172
 
1173
+ // src/selectors/lexicalFlower.ts
1174
+ init_define_import_meta();
1175
+ import { makeEntitiesFilter as makeEntitiesFilter15 } from "@lls/utils";
1176
+ var search20 = ({ ids }) => makeEntitiesFilter15({ id: ids });
1177
+ var { getLexicalFlowers, useSearchLexicalFlowers } = crud("lexicalFlowers", {
1178
+ search: search20
1179
+ });
1180
+
1181
+ // src/selectors/license.ts
1182
+ init_define_import_meta();
1183
+ import { makeEntitiesFilter as makeEntitiesFilter16 } from "@lls/utils";
1184
+ var search21 = ({ reference }) => makeEntitiesFilter16({ reference });
1185
+ var { getLicenses, getLicense, searchLicenses } = crud("licenses", { search: search21 });
1186
+
1187
+ // src/selectors/marketingWord.ts
1188
+ init_define_import_meta();
1189
+ import { makeEntitiesFilter as makeEntitiesFilter17 } from "@lls/utils";
1190
+ var search22 = ({ bookUris }) => makeEntitiesFilter17({
1191
+ bookUri: bookUris
1192
+ });
1193
+ var { useSearchMarketingWords } = crud("marketingWords", {
1194
+ search: search22
1195
+ });
1196
+
1117
1197
  // src/selectors/mainNotification.ts
1118
1198
  init_define_import_meta();
1119
1199
  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 });
1200
+ import { makeEntitiesFilter as makeEntitiesFilter18, makeGetAllEntities as makeGetAllEntities6 } from "@lls/utils";
1201
+ import _13 from "lodash/fp.js";
1202
+ var search23 = ({ ids }) => makeEntitiesFilter18({ id: ids });
1123
1203
  var getMainNotifications = (0, import_reselect4.createSelector)(
1124
- [_11.flow(makeGetCurrentUser(), _11.get("mainNotifications")), makeGetAllEntities6("mainNotifications")],
1125
- (userNotifications, notifications) => search16({ ids: userNotifications })(notifications)
1204
+ [_13.flow(makeGetCurrentUser(), _13.get("mainNotifications")), makeGetAllEntities6("mainNotifications")],
1205
+ (userNotifications, notifications) => search23({ ids: userNotifications })(notifications)
1126
1206
  );
1127
1207
 
1208
+ // src/selectors/method.ts
1209
+ init_define_import_meta();
1210
+ import { makeEntitiesFilter as makeEntitiesFilter19 } from "@lls/utils";
1211
+ var search24 = ({ ids, uris }) => makeEntitiesFilter19({ id: ids, uri: uris });
1212
+ var { getMethods, useSearchMethods } = crud("methods", {
1213
+ search: search24
1214
+ });
1215
+
1128
1216
  // src/selectors/news.ts
1129
1217
  init_define_import_meta();
1130
- import { makeEntitiesFilter as makeEntitiesFilter14 } from "@lls/utils";
1131
- var search17 = ({ ids }) => makeEntitiesFilter14({ id: ids });
1218
+ import { makeEntitiesFilter as makeEntitiesFilter20 } from "@lls/utils";
1219
+ var search25 = ({ ids }) => makeEntitiesFilter20({ id: ids });
1132
1220
  var {
1133
1221
  getNews: getAllNews,
1134
1222
  getNew: getNews,
1135
1223
  useSearchNews
1136
1224
  } = crud("news", {
1137
- search: search17
1225
+ search: search25
1138
1226
  });
1139
1227
 
1140
1228
  // src/selectors/panorama.ts
@@ -1144,26 +1232,18 @@ var getPanorama = makeGetEntityById3("panoramas");
1144
1232
 
1145
1233
  // src/selectors/premiumResource.ts
1146
1234
  init_define_import_meta();
1147
- import { makeEntitiesFilter as makeEntitiesFilter15 } from "@lls/utils";
1148
- var search18 = ({ bookIds }) => makeEntitiesFilter15({ book: bookIds });
1235
+ import { makeEntitiesFilter as makeEntitiesFilter21 } from "@lls/utils";
1236
+ var search26 = ({ bookIds }) => makeEntitiesFilter21({ book: bookIds });
1149
1237
  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
1238
+ search: search26
1159
1239
  });
1160
1240
 
1161
1241
  // src/selectors/product.ts
1162
1242
  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";
1243
+ import _14 from "lodash/fp.js";
1244
+ import { createSearchSelector as createSearchSelector6, makeEntitiesFilter as makeEntitiesFilter22, makeGetAllEntities as makeGetAllEntities7 } from "@lls/utils";
1165
1245
  var getProducts = makeGetAllEntities7("products");
1166
- var search20 = ({
1246
+ var search27 = ({
1167
1247
  ids,
1168
1248
  eans,
1169
1249
  isAdoptant,
@@ -1173,7 +1253,7 @@ var search20 = ({
1173
1253
  productTypes
1174
1254
  }) => {
1175
1255
  let bookIds;
1176
- const filter = makeEntitiesFilter17(
1256
+ const filter = makeEntitiesFilter22(
1177
1257
  {
1178
1258
  id: ids,
1179
1259
  ean: eans,
@@ -1184,7 +1264,7 @@ var search20 = ({
1184
1264
  levelIds || subjectIds ? (product2) => !!product2?.books?.some((bookId) => bookIds.has(bookId)) : false
1185
1265
  );
1186
1266
  return (products, books) => {
1187
- bookIds = new Set(_12.flow(_12.map("id"), _12.map(_12.parseInt(10)))(books));
1267
+ bookIds = new Set(_14.flow(_14.map("id"), _14.map(_14.parseInt(10)))(books));
1188
1268
  return filter(products);
1189
1269
  };
1190
1270
  };
@@ -1194,33 +1274,57 @@ var makeSearchProducts = () => {
1194
1274
  makeGetAllEntities7("products"),
1195
1275
  (state, { levelIds, subjectIds }) => searchBooks(state, { levelIds, subjectIds }),
1196
1276
  (_state, params) => params,
1197
- (products, books, params) => search20(params)(products, books)
1277
+ (products, books, params) => search27(params)(products, books)
1198
1278
  );
1199
1279
  };
1200
1280
  var useSearchProducts = makeUseSearch(makeSearchProducts);
1201
1281
 
1282
+ // src/selectors/promotionalInsert.ts
1283
+ init_define_import_meta();
1284
+ import { pipe as pipe5 } from "@lls/utils";
1285
+ import _15 from "lodash/fp.js";
1286
+ var search28 = ({ sortByQuery }) => (promotionalInserts) => pipe5(promotionalInserts, _15.isFunction(sortByQuery) ? sortByQuery : sortByQuery ? _15.sortBy(sortByQuery) : _15.identity);
1287
+ var { getPromotionalInserts, getPromotionalInsert, useSearchPromotionalInserts } = crud("promotionalInserts", {
1288
+ search: search28
1289
+ });
1290
+
1202
1291
  // src/selectors/resource.ts
1203
1292
  init_define_import_meta();
1204
- import { makeEntitiesFilter as makeEntitiesFilter18 } from "@lls/utils";
1205
- var search21 = ({ chapterIds }) => makeEntitiesFilter18({
1293
+ import { makeEntitiesFilter as makeEntitiesFilter23 } from "@lls/utils";
1294
+ var search29 = ({ chapterIds }) => makeEntitiesFilter23({
1206
1295
  chapter: chapterIds
1207
1296
  });
1208
1297
  var { getResources, getResource, useSearchResources } = crud("resources", {
1209
- search: search21
1298
+ search: search29
1299
+ });
1300
+
1301
+ // src/selectors/school.ts
1302
+ init_define_import_meta();
1303
+ import { makeEntitiesFilter as makeEntitiesFilter24, pipe as pipe6 } from "@lls/utils";
1304
+ import _16 from "lodash/fp.js";
1305
+ var search30 = ({ ids, academyIds, sortByQuery }) => {
1306
+ return (schools) => pipe6(
1307
+ schools,
1308
+ makeEntitiesFilter24({ id: ids, academy: academyIds }),
1309
+ _16.isFunction(sortByQuery) ? sortByQuery : sortByQuery ? _16.sortBy(sortByQuery) : _16.identity
1310
+ );
1311
+ };
1312
+ var { getSchools, getSchool, useSearchSchools, makeSearchSchools } = crud("schools", {
1313
+ search: search30
1210
1314
  });
1211
1315
 
1212
1316
  // src/selectors/sharedPage.ts
1213
1317
  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 = ({
1318
+ import { createSearchSelector as createSearchSelector7, makeEntitiesFilter as makeEntitiesFilter25 } from "@lls/utils";
1319
+ import _17 from "lodash/fp.js";
1320
+ var search31 = ({
1217
1321
  parentIds,
1218
1322
  userIds,
1219
1323
  bookIds,
1220
1324
  isCreatedFromScratch,
1221
1325
  isLearningAssessment,
1222
1326
  ids
1223
- }) => makeEntitiesFilter19({
1327
+ }) => makeEntitiesFilter25({
1224
1328
  id: ids,
1225
1329
  parent: parentIds,
1226
1330
  user: userIds,
@@ -1229,7 +1333,7 @@ var search22 = ({
1229
1333
  isCreatedFromScratch
1230
1334
  });
1231
1335
  var { getSharedPages, getSharedPage, useSearchSharedPages } = crud("sharedPages", {
1232
- search: search22
1336
+ search: search31
1233
1337
  });
1234
1338
  var makeSearchCurrentUserSharedPages = () => createSearchSelector7(
1235
1339
  getCurrentUser,
@@ -1237,24 +1341,24 @@ var makeSearchCurrentUserSharedPages = () => createSearchSelector7(
1237
1341
  (__, params) => params,
1238
1342
  (user2, sharedPages, params) => {
1239
1343
  const sharedUserPageIds = user2?.sharedPages ?? [];
1240
- return search22({ ...params, ids: _13.intersection(sharedUserPageIds, params.ids || sharedUserPageIds) })(sharedPages);
1344
+ return search31({ ...params, ids: _17.intersection(sharedUserPageIds, params.ids || sharedUserPageIds) })(sharedPages);
1241
1345
  }
1242
1346
  );
1243
1347
  var useSearchCurrentUserSharedPages = makeUseSearch(makeSearchCurrentUserSharedPages);
1244
1348
 
1245
1349
  // src/selectors/student.ts
1246
1350
  init_define_import_meta();
1247
- import { makeEntitiesFilter as makeEntitiesFilter20 } from "@lls/utils";
1248
- var search23 = ({ ids }) => makeEntitiesFilter20({ id: ids });
1351
+ import { makeEntitiesFilter as makeEntitiesFilter26 } from "@lls/utils";
1352
+ var search32 = ({ ids }) => makeEntitiesFilter26({ id: ids });
1249
1353
  var { getStudents, getStudent, useSearchStudents } = crud("students", {
1250
- search: search23
1354
+ search: search32
1251
1355
  });
1252
1356
 
1253
1357
  // src/selectors/subject.ts
1254
1358
  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 = ({
1359
+ import { limitToTeacherSubjects, makeEntitiesFilter as makeEntitiesFilter27, pipe as pipe7 } from "@lls/utils";
1360
+ import _18 from "lodash/fp.js";
1361
+ var search33 = ({
1258
1362
  ids,
1259
1363
  slugs,
1260
1364
  isTeacherSubject,
@@ -1263,9 +1367,9 @@ var search24 = ({
1263
1367
  hasBooks,
1264
1368
  names,
1265
1369
  sortByQuery
1266
- }) => (subjects) => pipe5(
1370
+ }) => (subjects) => pipe7(
1267
1371
  subjects,
1268
- makeEntitiesFilter21(
1372
+ makeEntitiesFilter27(
1269
1373
  {
1270
1374
  id: ids,
1271
1375
  slug: slugs,
@@ -1273,100 +1377,38 @@ var search24 = ({
1273
1377
  hasBooks,
1274
1378
  schoolTypes
1275
1379
  },
1276
- !_14.isNil(hasNewsletterUrl) && ((subject2) => Boolean(subject2?.newsletterUrl) === hasNewsletterUrl)
1380
+ !_18.isNil(hasNewsletterUrl) && ((subject2) => Boolean(subject2?.newsletterUrl) === hasNewsletterUrl)
1277
1381
  ),
1278
- (subjects2) => _14.isNil(isTeacherSubject) ? subjects2 : limitToTeacherSubjects(subjects2),
1279
- _14.isFunction(sortByQuery) ? sortByQuery : sortByQuery ? _14.sortBy(sortByQuery) : _14.identity
1382
+ (subjects2) => _18.isNil(isTeacherSubject) ? subjects2 : limitToTeacherSubjects(subjects2),
1383
+ _18.isFunction(sortByQuery) ? sortByQuery : sortByQuery ? _18.sortBy(sortByQuery) : _18.sortBy("name")
1280
1384
  );
1281
1385
  var { getSubjects, getSubject, useSearchSubjects, makeSearchSubjects } = crud("subjects", {
1282
- search: search24
1386
+ search: search33
1283
1387
  });
1284
1388
 
1285
1389
  // src/selectors/teacher.ts
1286
1390
  init_define_import_meta();
1287
- import { makeEntitiesFilter as makeEntitiesFilter22 } from "@lls/utils";
1288
- var search25 = ({ ids, schoolIds }) => makeEntitiesFilter22({
1391
+ import { makeEntitiesFilter as makeEntitiesFilter28 } from "@lls/utils";
1392
+ var search34 = ({ ids, schoolIds }) => makeEntitiesFilter28({
1289
1393
  id: ids,
1290
1394
  schools: schoolIds
1291
1395
  });
1292
1396
  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
1397
+ search: search34
1302
1398
  });
1303
1399
 
1304
1400
  // src/selectors/tool.ts
1305
1401
  init_define_import_meta();
1306
- import { makeEntitiesFilter as makeEntitiesFilter24 } from "@lls/utils";
1307
- var search27 = ({ ids, locked, bookIds }) => makeEntitiesFilter24({
1402
+ import { makeEntitiesFilter as makeEntitiesFilter29 } from "@lls/utils";
1403
+ var search35 = ({ ids, locked, bookIds }) => makeEntitiesFilter29({
1308
1404
  id: ids,
1309
1405
  locked,
1310
1406
  books: bookIds
1311
1407
  });
1312
1408
  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
1409
+ search: search35
1358
1410
  });
1359
1411
 
1360
- // src/selectors/globalRights.ts
1361
- init_define_import_meta();
1362
- import _16 from "lodash/fp.js";
1363
- var getGlobalRights = _16.get("entities.globalRights");
1364
-
1365
- // src/reducers/entities.ts
1366
- init_define_import_meta();
1367
- import { makeReducer } from "@lls/utils";
1368
- import _17 from "lodash/fp.js";
1369
-
1370
1412
  // src/actions/index.ts
1371
1413
  init_define_import_meta();
1372
1414
  import { makeActionCreator } from "@lls/utils";
@@ -1375,6 +1417,7 @@ var actionTypes = {
1375
1417
  UPDATE_ENTITY: "UPDATE_ENTITY",
1376
1418
  SET_ENTITY: "SET_ENTITY",
1377
1419
  SET_ENTITIES: "SET_ENTITIES",
1420
+ REPLACE_ENTITIES: "REPLACE_ENTITIES",
1378
1421
  RESET_AUTH: "RESET_AUTH",
1379
1422
  SET_AUTH: "SET_AUTH"
1380
1423
  };
@@ -1382,22 +1425,29 @@ var deleteEntity = makeActionCreator(actionTypes.DELETE_ENTITY);
1382
1425
  var updateEntity = makeActionCreator(actionTypes.UPDATE_ENTITY);
1383
1426
  var setEntity = makeActionCreator(actionTypes.SET_ENTITY);
1384
1427
  var setEntities = makeActionCreator(actionTypes.SET_ENTITIES);
1428
+ var replaceEntities = makeActionCreator(actionTypes.REPLACE_ENTITIES);
1385
1429
  var setAuth = makeActionCreator(actionTypes.SET_AUTH);
1386
1430
  var resetAuth = makeActionCreator(actionTypes.RESET_AUTH);
1387
1431
 
1388
1432
  // src/reducers/entities.ts
1433
+ init_define_import_meta();
1434
+ import { makeReducer } from "@lls/utils";
1435
+ import _19 from "lodash/fp.js";
1389
1436
  var deleteEntityReducer = (state, payload) => {
1390
1437
  const { path } = payload;
1391
- return _17.omit(path, state);
1438
+ return _19.omit(path, state);
1392
1439
  };
1393
1440
  var updateEntityReducer = (state, payload) => {
1394
1441
  const { path, entity } = payload;
1395
- const currentEntity = _17.get(path, state);
1396
- return _17.set(path, _17.merge(currentEntity, entity), state);
1442
+ const currentEntity = _19.get(path, state);
1443
+ return _19.set(path, _19.merge(currentEntity, entity), state);
1397
1444
  };
1398
1445
  var setEntityReducer = (state, payload) => {
1399
1446
  const { path, entity } = payload;
1400
- return _17.set(path, entity, state);
1447
+ return _19.set(path, entity, state);
1448
+ };
1449
+ var replaceEntitiesReducer = (_state, payload) => {
1450
+ return payload;
1401
1451
  };
1402
1452
  var setEntitiesReducer = (state, payload) => {
1403
1453
  if (typeof payload !== "object") return state;
@@ -1418,7 +1468,7 @@ var setEntitiesReducer = (state, payload) => {
1418
1468
  }
1419
1469
  const diff = Object.keys(entity).some((prop) => {
1420
1470
  const value = entity[prop];
1421
- if (!_17.isEqual(state[entityName]?.[id]?.[prop], value)) {
1471
+ if (!_19.isEqual(state[entityName]?.[id]?.[prop], value)) {
1422
1472
  return true;
1423
1473
  }
1424
1474
  });
@@ -1442,7 +1492,8 @@ var entities = makeReducer(
1442
1492
  [actionTypes.DELETE_ENTITY]: deleteEntityReducer,
1443
1493
  [actionTypes.UPDATE_ENTITY]: updateEntityReducer,
1444
1494
  [actionTypes.SET_ENTITY]: setEntityReducer,
1445
- [actionTypes.SET_ENTITIES]: setEntitiesReducer
1495
+ [actionTypes.SET_ENTITIES]: setEntitiesReducer,
1496
+ [actionTypes.REPLACE_ENTITIES]: replaceEntitiesReducer
1446
1497
  }
1447
1498
  );
1448
1499
  var entities_default = entities;
@@ -1450,7 +1501,7 @@ var entities_default = entities;
1450
1501
  // src/reducers/auth.ts
1451
1502
  init_define_import_meta();
1452
1503
  import { makeReducer as makeReducer2 } from "@lls/utils";
1453
- import _18 from "lodash/fp.js";
1504
+ import _20 from "lodash/fp.js";
1454
1505
  var initialState = {
1455
1506
  id: void 0,
1456
1507
  role: null,
@@ -1460,18 +1511,19 @@ var initialState = {
1460
1511
  isPremium: null,
1461
1512
  userPages: null,
1462
1513
  username: null,
1463
- llsUserId: null
1514
+ llsUserId: null,
1515
+ allowedBooks: null
1464
1516
  };
1465
1517
  var auth = makeReducer2(initialState, {
1466
- [actionTypes.SET_AUTH]: _18.assign,
1467
- [actionTypes.RESET_AUTH]: _18.constant(initialState)
1518
+ [actionTypes.SET_AUTH]: _20.assign,
1519
+ [actionTypes.RESET_AUTH]: _20.constant(initialState)
1468
1520
  });
1469
1521
  var auth_default = auth;
1470
1522
 
1471
1523
  // src/schema/index.ts
1472
1524
  init_define_import_meta();
1473
1525
  var import_normalizr = __toESM(require_normalizr(), 1);
1474
- import _19 from "lodash/fp.js";
1526
+ import _21 from "lodash/fp.js";
1475
1527
  var document = new import_normalizr.schema.Entity("documents");
1476
1528
  var documentType = new import_normalizr.schema.Entity("documentTypes");
1477
1529
  var subDocumentType = new import_normalizr.schema.Entity("subDocumentTypes");
@@ -1494,7 +1546,7 @@ var globalRights = new import_normalizr.schema.Entity(
1494
1546
  "globalRights",
1495
1547
  {},
1496
1548
  {
1497
- idAttribute: (_20, __, key) => key
1549
+ idAttribute: (_22, __, key) => key
1498
1550
  // Use keys from globalRights(anonymous, classroom, connected, teacher) as Id
1499
1551
  }
1500
1552
  );
@@ -1517,6 +1569,20 @@ var panorama = new import_normalizr.schema.Entity("panoramas");
1517
1569
  var premiumResource = new import_normalizr.schema.Entity("premiumResources");
1518
1570
  var garDivision = new import_normalizr.schema.Entity("garDivisions");
1519
1571
  var circonscription = new import_normalizr.schema.Entity("circonscriptions");
1572
+ var promotionalInsert = new import_normalizr.schema.Entity("promotionalInserts");
1573
+ var academy = new import_normalizr.schema.Entity("academies");
1574
+ var docTemplate = new import_normalizr.schema.Entity("docTemplates");
1575
+ var thematic = new import_normalizr.schema.Entity("thematics");
1576
+ var connector = new import_normalizr.schema.Entity("connectors");
1577
+ var license = new import_normalizr.schema.Entity("licenses");
1578
+ var subscription = new import_normalizr.schema.Entity("subscriptions");
1579
+ var miniUrls = new import_normalizr.schema.Entity("miniUrls", {}, { idAttribute: "path" });
1580
+ var notions = new import_normalizr.schema.Entity("notions");
1581
+ var words = new import_normalizr.schema.Entity("words");
1582
+ var marketingWord = new import_normalizr.schema.Entity("marketingWords");
1583
+ var opportunity = new import_normalizr.schema.Entity("opportunities");
1584
+ var formula = new import_normalizr.schema.Entity("formulas");
1585
+ var prompt = new import_normalizr.schema.Entity("prompts");
1520
1586
  var define = (el, scheme) => {
1521
1587
  el.define(scheme);
1522
1588
  return scheme;
@@ -1533,14 +1599,33 @@ var bookSchema = define(book, {
1533
1599
  subjects: [subject],
1534
1600
  textbooks: [book],
1535
1601
  educationalGuides: [book],
1602
+ parts: [book],
1536
1603
  tools: [tool],
1537
1604
  workbooks: [book],
1538
- workplans: [book]
1605
+ workplans: [book],
1606
+ parent: [book]
1607
+ });
1608
+ var academySchema = define(academy, {
1609
+ schools: [school]
1610
+ });
1611
+ var docTemplateSchema = define(docTemplate, {
1612
+ book
1613
+ });
1614
+ var promotionalInsertSchema = define(promotionalInsert, {
1615
+ subjects: [subject],
1616
+ levels: [level]
1539
1617
  });
1540
1618
  var garDivisionSchema = define(garDivision, {
1541
1619
  students: [user],
1542
1620
  school
1543
1621
  });
1622
+ var licenseSchema = define(license, {
1623
+ school,
1624
+ user,
1625
+ books: [book],
1626
+ adoptantBooks: [book],
1627
+ subscriptions: [subscription]
1628
+ });
1544
1629
  var documentTypeSchema = define(documentType, {
1545
1630
  subTypes: [subDocumentType]
1546
1631
  });
@@ -1572,6 +1657,7 @@ var pageSchema = define(page, {
1572
1657
  });
1573
1658
  var userSchema = define(user, {
1574
1659
  books: [book],
1660
+ booksContributedTo: [book],
1575
1661
  booksV2: [book],
1576
1662
  contacts: [contact],
1577
1663
  copies: [page],
@@ -1582,6 +1668,7 @@ var userSchema = define(user, {
1582
1668
  lastBooksViewed: [book],
1583
1669
  lastPagesViewed: [page],
1584
1670
  levels: [level],
1671
+ lexicalFlowers: { hits: [lexicalFlower] },
1585
1672
  mainNotifications: [mainNotification],
1586
1673
  pages: [page],
1587
1674
  schools: [school],
@@ -1590,8 +1677,7 @@ var userSchema = define(user, {
1590
1677
  subjects: [subject],
1591
1678
  teachers: [teacher],
1592
1679
  userPages: [page],
1593
- userBookPages: [page],
1594
- lexicalFlowers: { hits: [lexicalFlower] }
1680
+ userBookPages: [page]
1595
1681
  });
1596
1682
  var notificationSchema = define(mainNotification, { page });
1597
1683
  drawerNotification.define({ page });
@@ -1604,11 +1690,11 @@ var toolSchema = define(tool, {
1604
1690
  books: [book]
1605
1691
  });
1606
1692
  var sharedPageSchema = define(sharedPage, {
1607
- user,
1693
+ book,
1608
1694
  chapter,
1695
+ originalPage: page,
1609
1696
  parent: page,
1610
- book,
1611
- originalPage: page
1697
+ user
1612
1698
  });
1613
1699
  var studentSchema = define(student, {
1614
1700
  levels: [level]
@@ -1625,7 +1711,11 @@ var groupSchema = define(group, {
1625
1711
  students: [student]
1626
1712
  });
1627
1713
  var schoolSchema = define(school, {
1628
- groups: [group]
1714
+ groups: [group],
1715
+ teachers: [user],
1716
+ students: [user],
1717
+ users: [user],
1718
+ academy
1629
1719
  });
1630
1720
  var methodSchema = define(method, {
1631
1721
  book
@@ -1643,55 +1733,76 @@ var levelSchema = define(level, {
1643
1733
  });
1644
1734
  var querySchema = {
1645
1735
  viewer: {
1646
- addCorrectionsToGroup: group,
1647
- addCorrectionsToStudents: page,
1648
- addPageAppreciation: page,
1649
- addStudentToGroup: group,
1736
+ academies: { hits: [academy] },
1650
1737
  books: { hits: [book] },
1651
- methods: { hits: [method] },
1652
1738
  chapters: { hits: [chapter] },
1653
- createEstimate: quote,
1654
- createGroup: group,
1655
- createPage: page,
1656
- createUser: user,
1657
- createLexicalFlower: lexicalFlower,
1739
+ collections: { hits: [collection] },
1740
+ connectors: { hits: [connector] },
1741
+ docTemplates: { hits: [docTemplate] },
1658
1742
  documents: { hits: [document] },
1659
1743
  documentTypes: { hits: [documentType] },
1660
- subDocumentTypes: { hits: [subDocumentType] },
1744
+ educationalGuides: { hits: [book] },
1661
1745
  explorerResults: [explorerResult],
1662
- levels: [level],
1663
1746
  globalRights: new import_normalizr.schema.Values(globalRights),
1747
+ levels: [level],
1748
+ licenses: { hits: [license] },
1749
+ methods: { hits: [method] },
1664
1750
  me: user,
1665
- // mutations
1751
+ miniUrls: [miniUrls],
1752
+ notions: { hits: [notions] },
1666
1753
  pages: { hits: [page] },
1667
1754
  panoramas: [panorama],
1668
1755
  parents: { hits: [page] },
1669
1756
  //pages alias
1670
1757
  product: { hits: [product] },
1758
+ promotionalInserts: { hits: [promotionalInsert] },
1759
+ prompts: { hits: [prompt] },
1760
+ resources: { hits: [resource] },
1761
+ schools: { hits: [school] },
1671
1762
  schoolTypes: { hits: [schoolType] },
1763
+ subDocumentTypes: { hits: [subDocumentType] },
1764
+ subjects: { hits: [subject] },
1765
+ textbooks: { hits: [book] },
1766
+ thematics: { hits: [thematic] },
1767
+ tools: { hits: [tool] },
1768
+ words: { hits: [words] },
1769
+ workbooks: { hits: [book] },
1770
+ workplans: { hits: [book] },
1771
+ // mutations
1772
+ addCorrectionsToGroup: group,
1773
+ addCorrectionsToStudents: page,
1774
+ addPageAppreciation: page,
1775
+ addStudentToGroup: group,
1776
+ createEstimate: quote,
1777
+ createGroup: group,
1778
+ createPage: page,
1779
+ createUser: user,
1780
+ createLexicalFlower: lexicalFlower,
1672
1781
  sharePageToGroup: page,
1673
1782
  sharePageToUsers: page,
1674
- subjects: { hits: [subject] },
1675
1783
  updateCopyNotification: copyNotification,
1676
1784
  updateDrawerNotification: drawerNotification,
1677
1785
  updateGroup: group,
1786
+ updateLexicalFlower: lexicalFlower,
1678
1787
  updateMainNotification: mainNotification,
1679
1788
  updatePage: page,
1680
1789
  updateTrialUser: user,
1681
1790
  updateUserLastActivitySeenAt: user,
1682
- updateUser: user,
1683
- updateLexicalFlower: lexicalFlower
1791
+ updateUser: user
1684
1792
  },
1685
1793
  auth: {
1686
1794
  user
1687
1795
  },
1688
1796
  marketing: {
1689
- addLikeFaq: faq,
1797
+ builderIos: [builderIo],
1798
+ circonscriptions: [circonscription],
1690
1799
  communityProjects: [communityProjects],
1691
- createAnalytics: analytic,
1692
1800
  faq: [faq],
1693
- builderIos: [builderIo],
1694
- circonscriptions: [circonscription]
1801
+ news: { hits: [news] },
1802
+ getRandomWord: marketingWord,
1803
+ // mutations
1804
+ addLikeFaq: faq,
1805
+ createAnalytics: analytic
1695
1806
  },
1696
1807
  static: {
1697
1808
  projetVoltaire: {
@@ -1699,12 +1810,38 @@ var querySchema = {
1699
1810
  }
1700
1811
  }
1701
1812
  };
1702
- var normalizeData = _19.flow((data) => (0, import_normalizr.normalize)(data, querySchema));
1813
+ var augmentNormalizeSchema = (augmentSchemaFn) => {
1814
+ const augmentedSchema = augmentSchemaFn({
1815
+ connector,
1816
+ formula,
1817
+ license,
1818
+ opportunity,
1819
+ user,
1820
+ docTemplate,
1821
+ document,
1822
+ documentType,
1823
+ school,
1824
+ book,
1825
+ chapter,
1826
+ page
1827
+ });
1828
+ const overridingKeys = Object.keys(augmentedSchema).filter((key) => key in querySchema);
1829
+ if (overridingKeys.length) {
1830
+ throw new Error(`can not override schema with existing ${overridingKeys}. implement them in viewer instead`);
1831
+ }
1832
+ return _21.flow((data) => (0, import_normalizr.normalize)(data, { ...augmentedSchema, ...querySchema }));
1833
+ };
1834
+ var normalizeData = _21.flow((data) => (0, import_normalizr.normalize)(data, querySchema));
1703
1835
  export {
1836
+ actionTypes,
1837
+ augmentNormalizeSchema,
1704
1838
  auth_default as authReducer,
1839
+ deleteEntity,
1705
1840
  entities_default as entitiesReducer,
1706
1841
  filterBooks,
1707
1842
  filterPages,
1843
+ getAcademies,
1844
+ getAcademy,
1708
1845
  getAllNews,
1709
1846
  getAuth,
1710
1847
  getBook,
@@ -1721,6 +1858,7 @@ export {
1721
1858
  getContact,
1722
1859
  getContacts,
1723
1860
  getCurrentUser,
1861
+ getDocTemplate,
1724
1862
  getDocument,
1725
1863
  getDocumentType,
1726
1864
  getDocumentTypes,
@@ -1736,6 +1874,8 @@ export {
1736
1874
  getLevel,
1737
1875
  getLevels,
1738
1876
  getLexicalFlowers,
1877
+ getLicense,
1878
+ getLicenses,
1739
1879
  getMainNotifications,
1740
1880
  getMethods,
1741
1881
  getNews,
@@ -1745,6 +1885,8 @@ export {
1745
1885
  getPremiumResource,
1746
1886
  getPremiumResources,
1747
1887
  getProducts,
1888
+ getPromotionalInsert,
1889
+ getPromotionalInserts,
1748
1890
  getResource,
1749
1891
  getResources,
1750
1892
  getSchool,
@@ -1773,14 +1915,22 @@ export {
1773
1915
  makeSearchLevels,
1774
1916
  makeSearchPages,
1775
1917
  makeSearchSchoolTypes,
1918
+ makeSearchSchools,
1776
1919
  makeSearchSubjects,
1777
1920
  makeSearchValidBooks,
1778
1921
  makeUseSearch,
1779
1922
  normalizeData,
1780
1923
  querySchema,
1924
+ replaceEntities,
1925
+ resetAuth,
1781
1926
  searchLevels,
1927
+ searchLicenses,
1782
1928
  searchSchoolTypes,
1929
+ setAuth,
1930
+ setEntities,
1783
1931
  setEntitiesReducer,
1932
+ setEntity,
1933
+ updateEntity,
1784
1934
  useSearchBooks,
1785
1935
  useSearchBuilderIos,
1786
1936
  useSearchChapters,
@@ -1789,6 +1939,7 @@ export {
1789
1939
  useSearchContacts,
1790
1940
  useSearchCopyNotifications,
1791
1941
  useSearchCurrentUserSharedPages,
1942
+ useSearchDocTemplates,
1792
1943
  useSearchDocumentTypes,
1793
1944
  useSearchDocuments,
1794
1945
  useSearchDrafts,
@@ -1797,12 +1948,14 @@ export {
1797
1948
  useSearchGroups,
1798
1949
  useSearchLevels,
1799
1950
  useSearchLexicalFlowers,
1951
+ useSearchMarketingWords,
1800
1952
  useSearchMethods,
1801
1953
  useSearchModifiedPages,
1802
1954
  useSearchNews,
1803
1955
  useSearchPages,
1804
1956
  useSearchPremiumResources,
1805
1957
  useSearchProducts,
1958
+ useSearchPromotionalInserts,
1806
1959
  useSearchResources,
1807
1960
  useSearchSchoolTypes,
1808
1961
  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.12.0",
5
+ "version": "24.13.0-010b0272",
6
6
  "type": "module",
7
7
  "types": "./lib/builttypes/store/src/index.d.ts",
8
8
  "exports": {
@@ -23,8 +23,8 @@
23
23
  },
24
24
  "keywords": [],
25
25
  "peerDependencies": {
26
- "@lls/utils": "*",
27
26
  "@lls/common": "*",
27
+ "@lls/utils": "*",
28
28
  "lodash": "*",
29
29
  "react": "*",
30
30
  "react-redux": "*",
@@ -33,25 +33,27 @@
33
33
  "devDependencies": {
34
34
  "@biomejs/biome": "1.9.4",
35
35
  "@happy-dom/global-registrator": "15.11.0",
36
- "@testing-library/react": "16.0.1",
37
- "@types/lodash": "4.17.13",
38
- "@types/node": "22.9.0",
36
+ "@testing-library/react": "16.2.0",
37
+ "@types/lodash": "4.17.14",
38
+ "@types/node": "22.10.7",
39
39
  "@types/react": "18.3.12",
40
40
  "@types/react-redux": "7.1.34",
41
- "@vitejs/plugin-react-swc": "3.7.1",
41
+ "@vitejs/plugin-react-swc": "3.7.2",
42
42
  "esbuild": "0.24.0",
43
43
  "happy-dom": "15.11.0",
44
44
  "lodash": "4.17.21",
45
+ "nock": "14.0.1",
45
46
  "react": "18.3.1",
47
+ "react-dom": "18.3.1",
46
48
  "react-redux": "8.1.2",
47
49
  "redux": "5.0.1",
48
50
  "reselect": "4.1.8",
49
- "typescript": "5.6.3",
51
+ "typescript": "5.7.3",
50
52
  "vite": "5.4.11",
51
- "vite-tsconfig-paths": "5.1.3",
52
- "@lls/common": "24.12.0",
53
- "@lls/utils": "24.12.0",
54
- "@lls/vitescripts": "24.12.0"
53
+ "vite-tsconfig-paths": "5.1.4",
54
+ "@lls/common": "24.13.0-010b0272",
55
+ "@lls/utils": "24.13.0-010b0272",
56
+ "@lls/vitescripts": "24.13.0-010b0272"
55
57
  },
56
58
  "license": "ISC",
57
59
  "dependencies": {
@@ -61,6 +63,6 @@
61
63
  "build": "node build.mjs",
62
64
  "lint": "pnpm biome check --apply src __tests__",
63
65
  "dts": "pnpm tsc --project tsconfig.production.json",
64
- "test": "bun test"
66
+ "test": "bun test --bail"
65
67
  }
66
68
  }