@lls/store 24.8.0-2bcc23b2 → 24.8.0-3221f160

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 +19 -51
  2. package/package.json +3 -3
package/lib/index.js CHANGED
@@ -979,7 +979,7 @@ var search9 = ({ ids, read, pageIds }) => {
979
979
  return makeEntitiesFilter7({ read, id: ids, page: pageIds });
980
980
  };
981
981
  var makeSearchCopyNotifications = () => createSearchSelector3(
982
- [makeGetCurrentUser(), makeGetAllEntities2("copyNotifications"), (_19, params) => params],
982
+ [makeGetCurrentUser(), makeGetAllEntities2("copyNotifications"), (_20, params) => params],
983
983
  (currentUser, copyNotifications, { pageIds, read }) => {
984
984
  const ids = currentUser?.copyNotifications;
985
985
  return search9({ ids, read, pageIds })(copyNotifications);
@@ -994,19 +994,13 @@ var search10 = ({
994
994
  ids,
995
995
  uuids,
996
996
  resourceIds,
997
- levelIds,
998
- formats,
999
- documentTypes,
1000
- subDocumentTypes
997
+ levelIds
1001
998
  }) => {
1002
999
  return makeEntitiesFilter8({
1003
1000
  id: ids,
1004
1001
  resourceId: resourceIds,
1005
1002
  levels: levelIds,
1006
- uuidV2: uuids,
1007
- format: formats,
1008
- documentType: documentTypes,
1009
- subDocumentType: subDocumentTypes
1003
+ uuidV2: uuids
1010
1004
  });
1011
1005
  };
1012
1006
  var { useSearchDocuments } = crud("documents", {
@@ -1020,7 +1014,7 @@ var search11 = ({ ids, read, pageIds }) => {
1020
1014
  return makeEntitiesFilter9({ read, id: ids, page: pageIds });
1021
1015
  };
1022
1016
  var makeSearchDrawerNotifications = () => createSearchSelector4(
1023
- [makeGetCurrentUser(), makeGetAllEntities3("drawerNotifications"), (_19, params) => params],
1017
+ [makeGetCurrentUser(), makeGetAllEntities3("drawerNotifications"), (_20, params) => params],
1024
1018
  (currentUser, drawerNotifications, { read, pageIds }) => {
1025
1019
  const ids = currentUser?.drawerNotifications;
1026
1020
  return search11({ ids, read, pageIds })(drawerNotifications);
@@ -1337,30 +1331,16 @@ var { getCirconscriptions } = crud("circonscriptions", {
1337
1331
 
1338
1332
  // src/selectors/documentType.ts
1339
1333
  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", {
1334
+ import _16 from "lodash/fp.js";
1335
+ var search30 = (_params) => _16.identity;
1336
+ var { getDocumentTypes, getDocumentType } = crud("documentTypes", {
1357
1337
  search: search30
1358
1338
  });
1359
1339
 
1360
1340
  // src/reducers/entities.ts
1361
1341
  init_define_import_meta();
1362
1342
  import { makeReducer } from "@lls/utils";
1363
- import _16 from "lodash/fp.js";
1343
+ import _17 from "lodash/fp.js";
1364
1344
 
1365
1345
  // src/actions/index.ts
1366
1346
  init_define_import_meta();
@@ -1383,16 +1363,16 @@ var resetAuth = makeActionCreator(actionTypes.RESET_AUTH);
1383
1363
  // src/reducers/entities.ts
1384
1364
  var deleteEntityReducer = (state, payload) => {
1385
1365
  const { path } = payload;
1386
- return _16.omit(path, state);
1366
+ return _17.omit(path, state);
1387
1367
  };
1388
1368
  var updateEntityReducer = (state, payload) => {
1389
1369
  const { path, entity } = payload;
1390
- const currentEntity = _16.get(path, state);
1391
- return _16.set(path, _16.merge(currentEntity, entity), state);
1370
+ const currentEntity = _17.get(path, state);
1371
+ return _17.set(path, _17.merge(currentEntity, entity), state);
1392
1372
  };
1393
1373
  var setEntityReducer = (state, payload) => {
1394
1374
  const { path, entity } = payload;
1395
- return _16.set(path, entity, state);
1375
+ return _17.set(path, entity, state);
1396
1376
  };
1397
1377
  var setEntitiesReducer = (state, payload) => {
1398
1378
  if (typeof payload !== "object") return state;
@@ -1413,7 +1393,7 @@ var setEntitiesReducer = (state, payload) => {
1413
1393
  }
1414
1394
  const diff = Object.keys(entity).some((prop) => {
1415
1395
  const value = entity[prop];
1416
- if (!_16.isEqual(state[entityName]?.[id]?.[prop], value)) {
1396
+ if (!_17.isEqual(state[entityName]?.[id]?.[prop], value)) {
1417
1397
  return true;
1418
1398
  }
1419
1399
  });
@@ -1445,7 +1425,7 @@ var entities_default = entities;
1445
1425
  // src/reducers/auth.ts
1446
1426
  init_define_import_meta();
1447
1427
  import { makeReducer as makeReducer2 } from "@lls/utils";
1448
- import _17 from "lodash/fp.js";
1428
+ import _18 from "lodash/fp.js";
1449
1429
  var initialState = {
1450
1430
  id: void 0,
1451
1431
  role: null,
@@ -1458,18 +1438,16 @@ var initialState = {
1458
1438
  llsUserId: null
1459
1439
  };
1460
1440
  var auth = makeReducer2(initialState, {
1461
- [actionTypes.SET_AUTH]: _17.assign,
1462
- [actionTypes.RESET_AUTH]: _17.constant(initialState)
1441
+ [actionTypes.SET_AUTH]: _18.assign,
1442
+ [actionTypes.RESET_AUTH]: _18.constant(initialState)
1463
1443
  });
1464
1444
  var auth_default = auth;
1465
1445
 
1466
1446
  // src/schema/index.ts
1467
1447
  init_define_import_meta();
1468
1448
  var import_normalizr = __toESM(require_normalizr(), 1);
1469
- import _18 from "lodash/fp.js";
1449
+ import _19 from "lodash/fp.js";
1470
1450
  var document = new import_normalizr.schema.Entity("documents");
1471
- var documentType = new import_normalizr.schema.Entity("documentTypes");
1472
- var subDocumentType = new import_normalizr.schema.Entity("subDocumentTypes");
1473
1451
  var subject = new import_normalizr.schema.Entity("subjects");
1474
1452
  var level = new import_normalizr.schema.Entity("levels");
1475
1453
  var book = new import_normalizr.schema.Entity("books");
@@ -1528,14 +1506,9 @@ var garDivisionSchema = define(garDivision, {
1528
1506
  students: [user],
1529
1507
  school
1530
1508
  });
1531
- var documentTypeSchema = define(documentType, {
1532
- subTypes: [subDocumentType]
1533
- });
1534
1509
  var documentSchema = define(document, {
1535
1510
  page,
1536
- levels: [level],
1537
- documentType,
1538
- subDocumentType
1511
+ levels: [level]
1539
1512
  });
1540
1513
  var chapterSchema = define(chapter, {
1541
1514
  book,
@@ -1643,8 +1616,6 @@ var querySchema = {
1643
1616
  createUser: user,
1644
1617
  createLexicalFlower: lexicalFlower,
1645
1618
  documents: { hits: [document] },
1646
- documentTypes: { hits: [documentType] },
1647
- subDocumentTypes: { hits: [subDocumentType] },
1648
1619
  explorerResults: [explorerResult],
1649
1620
  levels: [level],
1650
1621
  me: user,
@@ -1685,7 +1656,7 @@ var querySchema = {
1685
1656
  }
1686
1657
  }
1687
1658
  };
1688
- var normalizeData = _18.flow((data) => (0, import_normalizr.normalize)(data, querySchema));
1659
+ var normalizeData = _19.flow((data) => (0, import_normalizr.normalize)(data, querySchema));
1689
1660
  export {
1690
1661
  auth_default as authReducer,
1691
1662
  entities_default as entitiesReducer,
@@ -1739,7 +1710,6 @@ export {
1739
1710
  getSharedPages,
1740
1711
  getStudent,
1741
1712
  getStudents,
1742
- getSubDocumentTypes,
1743
1713
  getSubject,
1744
1714
  getSubjects,
1745
1715
  getTeacher,
@@ -1773,7 +1743,6 @@ export {
1773
1743
  useSearchContacts,
1774
1744
  useSearchCopyNotifications,
1775
1745
  useSearchCurrentUserSharedPages,
1776
- useSearchDocumentTypes,
1777
1746
  useSearchDocuments,
1778
1747
  useSearchDrafts,
1779
1748
  useSearchDrawerNotifications,
@@ -1792,7 +1761,6 @@ export {
1792
1761
  useSearchSchools,
1793
1762
  useSearchSharedPages,
1794
1763
  useSearchStudents,
1795
- useSearchSubDocumentTypes,
1796
1764
  useSearchSubjects,
1797
1765
  useSearchTeachers,
1798
1766
  useSearchTools,
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.8.0-2bcc23b2",
5
+ "version": "24.8.0-3221f160",
6
6
  "type": "module",
7
7
  "types": "./lib/builttypes/store/src/index.d.ts",
8
8
  "exports": {
@@ -48,8 +48,8 @@
48
48
  "typescript": "5.6.3",
49
49
  "vite": "5.4.11",
50
50
  "vite-tsconfig-paths": "5.1.3",
51
- "@lls/utils": "24.8.0-2bcc23b2",
52
- "@lls/vitescripts": "24.8.0-2bcc23b2"
51
+ "@lls/utils": "24.8.0-3221f160",
52
+ "@lls/vitescripts": "24.8.0-3221f160"
53
53
  },
54
54
  "license": "ISC",
55
55
  "dependencies": {