@lls/store 24.1.57-2fe8a3de → 24.1.57-3bf4faf5

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 +3 -681
  2. package/package.json +3 -6
package/lib/index.js CHANGED
@@ -1,493 +1,4 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __esm = (fn, res) => function __init() {
8
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
9
- };
10
- var __commonJS = (cb, mod) => function __require() {
11
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
-
30
- // <define:import.meta>
31
- var init_define_import_meta = __esm({
32
- "<define:import.meta>"() {
33
- }
34
- });
35
-
36
- // ../../node_modules/.pnpm/normalizr@3.6.2/node_modules/normalizr/dist/normalizr.js
37
- var require_normalizr = __commonJS({
38
- "../../node_modules/.pnpm/normalizr@3.6.2/node_modules/normalizr/dist/normalizr.js"(exports) {
39
- "use strict";
40
- init_define_import_meta();
41
- Object.defineProperty(exports, "__esModule", { value: true });
42
- function _defineProperties(target, props) {
43
- for (var i = 0; i < props.length; i++) {
44
- var descriptor = props[i];
45
- descriptor.enumerable = descriptor.enumerable || false;
46
- descriptor.configurable = true;
47
- if ("value" in descriptor) descriptor.writable = true;
48
- Object.defineProperty(target, descriptor.key, descriptor);
49
- }
50
- }
51
- function _createClass(Constructor, protoProps, staticProps) {
52
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
53
- if (staticProps) _defineProperties(Constructor, staticProps);
54
- return Constructor;
55
- }
56
- function _extends() {
57
- _extends = Object.assign || function(target) {
58
- for (var i = 1; i < arguments.length; i++) {
59
- var source = arguments[i];
60
- for (var key in source) {
61
- if (Object.prototype.hasOwnProperty.call(source, key)) {
62
- target[key] = source[key];
63
- }
64
- }
65
- }
66
- return target;
67
- };
68
- return _extends.apply(this, arguments);
69
- }
70
- function _inheritsLoose(subClass, superClass) {
71
- subClass.prototype = Object.create(superClass.prototype);
72
- subClass.prototype.constructor = subClass;
73
- subClass.__proto__ = superClass;
74
- }
75
- function isImmutable(object) {
76
- return !!(object && typeof object.hasOwnProperty === "function" && (object.hasOwnProperty("__ownerID") || // Immutable.Map
77
- object._map && object._map.hasOwnProperty("__ownerID")));
78
- }
79
- function denormalizeImmutable(schema3, input, unvisit) {
80
- return Object.keys(schema3).reduce(function(object, key) {
81
- var stringKey = "" + key;
82
- if (object.has(stringKey)) {
83
- return object.set(stringKey, unvisit(object.get(stringKey), schema3[stringKey]));
84
- } else {
85
- return object;
86
- }
87
- }, input);
88
- }
89
- var getDefaultGetId = function getDefaultGetId2(idAttribute) {
90
- return function(input) {
91
- return isImmutable(input) ? input.get(idAttribute) : input[idAttribute];
92
- };
93
- };
94
- var EntitySchema = /* @__PURE__ */ function() {
95
- function EntitySchema2(key, definition, options) {
96
- if (definition === void 0) {
97
- definition = {};
98
- }
99
- if (options === void 0) {
100
- options = {};
101
- }
102
- if (!key || typeof key !== "string") {
103
- throw new Error("Expected a string key for Entity, but found " + key + ".");
104
- }
105
- var _options = options, _options$idAttribute = _options.idAttribute, idAttribute = _options$idAttribute === void 0 ? "id" : _options$idAttribute, _options$mergeStrateg = _options.mergeStrategy, mergeStrategy = _options$mergeStrateg === void 0 ? function(entityA, entityB) {
106
- return _extends({}, entityA, entityB);
107
- } : _options$mergeStrateg, _options$processStrat = _options.processStrategy, processStrategy = _options$processStrat === void 0 ? function(input) {
108
- return _extends({}, input);
109
- } : _options$processStrat, _options$fallbackStra = _options.fallbackStrategy, fallbackStrategy = _options$fallbackStra === void 0 ? function(key2, schema3) {
110
- return void 0;
111
- } : _options$fallbackStra;
112
- this._key = key;
113
- this._getId = typeof idAttribute === "function" ? idAttribute : getDefaultGetId(idAttribute);
114
- this._idAttribute = idAttribute;
115
- this._mergeStrategy = mergeStrategy;
116
- this._processStrategy = processStrategy;
117
- this._fallbackStrategy = fallbackStrategy;
118
- this.define(definition);
119
- }
120
- var _proto = EntitySchema2.prototype;
121
- _proto.define = function define2(definition) {
122
- this.schema = Object.keys(definition).reduce(function(entitySchema, key) {
123
- var _extends2;
124
- var schema3 = definition[key];
125
- return _extends({}, entitySchema, (_extends2 = {}, _extends2[key] = schema3, _extends2));
126
- }, this.schema || {});
127
- };
128
- _proto.getId = function getId(input, parent, key) {
129
- return this._getId(input, parent, key);
130
- };
131
- _proto.merge = function merge(entityA, entityB) {
132
- return this._mergeStrategy(entityA, entityB);
133
- };
134
- _proto.fallback = function fallback(id, schema3) {
135
- return this._fallbackStrategy(id, schema3);
136
- };
137
- _proto.normalize = function normalize3(input, parent, key, visit2, addEntity, visitedEntities) {
138
- var _this = this;
139
- var id = this.getId(input, parent, key);
140
- var entityType = this.key;
141
- if (!(entityType in visitedEntities)) {
142
- visitedEntities[entityType] = {};
143
- }
144
- if (!(id in visitedEntities[entityType])) {
145
- visitedEntities[entityType][id] = [];
146
- }
147
- if (visitedEntities[entityType][id].some(function(entity) {
148
- return entity === input;
149
- })) {
150
- return id;
151
- }
152
- visitedEntities[entityType][id].push(input);
153
- var processedEntity = this._processStrategy(input, parent, key);
154
- Object.keys(this.schema).forEach(function(key2) {
155
- if (processedEntity.hasOwnProperty(key2) && typeof processedEntity[key2] === "object") {
156
- var schema3 = _this.schema[key2];
157
- var resolvedSchema = typeof schema3 === "function" ? schema3(input) : schema3;
158
- processedEntity[key2] = visit2(processedEntity[key2], processedEntity, key2, resolvedSchema, addEntity, visitedEntities);
159
- }
160
- });
161
- addEntity(this, processedEntity, input, parent, key);
162
- return id;
163
- };
164
- _proto.denormalize = function denormalize2(entity, unvisit) {
165
- var _this2 = this;
166
- if (isImmutable(entity)) {
167
- return denormalizeImmutable(this.schema, entity, unvisit);
168
- }
169
- Object.keys(this.schema).forEach(function(key) {
170
- if (entity.hasOwnProperty(key)) {
171
- var schema3 = _this2.schema[key];
172
- entity[key] = unvisit(entity[key], schema3);
173
- }
174
- });
175
- return entity;
176
- };
177
- _createClass(EntitySchema2, [{
178
- key: "key",
179
- get: function get() {
180
- return this._key;
181
- }
182
- }, {
183
- key: "idAttribute",
184
- get: function get() {
185
- return this._idAttribute;
186
- }
187
- }]);
188
- return EntitySchema2;
189
- }();
190
- var PolymorphicSchema = /* @__PURE__ */ function() {
191
- function PolymorphicSchema2(definition, schemaAttribute) {
192
- if (schemaAttribute) {
193
- this._schemaAttribute = typeof schemaAttribute === "string" ? function(input) {
194
- return input[schemaAttribute];
195
- } : schemaAttribute;
196
- }
197
- this.define(definition);
198
- }
199
- var _proto = PolymorphicSchema2.prototype;
200
- _proto.define = function define2(definition) {
201
- this.schema = definition;
202
- };
203
- _proto.getSchemaAttribute = function getSchemaAttribute(input, parent, key) {
204
- return !this.isSingleSchema && this._schemaAttribute(input, parent, key);
205
- };
206
- _proto.inferSchema = function inferSchema(input, parent, key) {
207
- if (this.isSingleSchema) {
208
- return this.schema;
209
- }
210
- var attr = this.getSchemaAttribute(input, parent, key);
211
- return this.schema[attr];
212
- };
213
- _proto.normalizeValue = function normalizeValue(value, parent, key, visit2, addEntity, visitedEntities) {
214
- var schema3 = this.inferSchema(value, parent, key);
215
- if (!schema3) {
216
- return value;
217
- }
218
- var normalizedValue = visit2(value, parent, key, schema3, addEntity, visitedEntities);
219
- return this.isSingleSchema || normalizedValue === void 0 || normalizedValue === null ? normalizedValue : {
220
- id: normalizedValue,
221
- schema: this.getSchemaAttribute(value, parent, key)
222
- };
223
- };
224
- _proto.denormalizeValue = function denormalizeValue(value, unvisit) {
225
- var schemaKey = isImmutable(value) ? value.get("schema") : value.schema;
226
- if (!this.isSingleSchema && !schemaKey) {
227
- return value;
228
- }
229
- var id = this.isSingleSchema ? void 0 : isImmutable(value) ? value.get("id") : value.id;
230
- var schema3 = this.isSingleSchema ? this.schema : this.schema[schemaKey];
231
- return unvisit(id || value, schema3);
232
- };
233
- _createClass(PolymorphicSchema2, [{
234
- key: "isSingleSchema",
235
- get: function get() {
236
- return !this._schemaAttribute;
237
- }
238
- }]);
239
- return PolymorphicSchema2;
240
- }();
241
- var UnionSchema = /* @__PURE__ */ function(_PolymorphicSchema) {
242
- _inheritsLoose(UnionSchema2, _PolymorphicSchema);
243
- function UnionSchema2(definition, schemaAttribute) {
244
- if (!schemaAttribute) {
245
- throw new Error('Expected option "schemaAttribute" not found on UnionSchema.');
246
- }
247
- return _PolymorphicSchema.call(this, definition, schemaAttribute) || this;
248
- }
249
- var _proto = UnionSchema2.prototype;
250
- _proto.normalize = function normalize3(input, parent, key, visit2, addEntity, visitedEntities) {
251
- return this.normalizeValue(input, parent, key, visit2, addEntity, visitedEntities);
252
- };
253
- _proto.denormalize = function denormalize2(input, unvisit) {
254
- return this.denormalizeValue(input, unvisit);
255
- };
256
- return UnionSchema2;
257
- }(PolymorphicSchema);
258
- var ValuesSchema = /* @__PURE__ */ function(_PolymorphicSchema) {
259
- _inheritsLoose(ValuesSchema2, _PolymorphicSchema);
260
- function ValuesSchema2() {
261
- return _PolymorphicSchema.apply(this, arguments) || this;
262
- }
263
- var _proto = ValuesSchema2.prototype;
264
- _proto.normalize = function normalize3(input, parent, key, visit2, addEntity, visitedEntities) {
265
- var _this = this;
266
- return Object.keys(input).reduce(function(output, key2, index) {
267
- var _extends2;
268
- var value = input[key2];
269
- return value !== void 0 && value !== null ? _extends({}, output, (_extends2 = {}, _extends2[key2] = _this.normalizeValue(value, input, key2, visit2, addEntity, visitedEntities), _extends2)) : output;
270
- }, {});
271
- };
272
- _proto.denormalize = function denormalize2(input, unvisit) {
273
- var _this2 = this;
274
- return Object.keys(input).reduce(function(output, key) {
275
- var _extends3;
276
- var entityOrId = input[key];
277
- return _extends({}, output, (_extends3 = {}, _extends3[key] = _this2.denormalizeValue(entityOrId, unvisit), _extends3));
278
- }, {});
279
- };
280
- return ValuesSchema2;
281
- }(PolymorphicSchema);
282
- var validateSchema = function validateSchema2(definition) {
283
- var isArray = Array.isArray(definition);
284
- if (isArray && definition.length > 1) {
285
- throw new Error("Expected schema definition to be a single schema, but found " + definition.length + ".");
286
- }
287
- return definition[0];
288
- };
289
- var getValues = function getValues2(input) {
290
- return Array.isArray(input) ? input : Object.keys(input).map(function(key) {
291
- return input[key];
292
- });
293
- };
294
- var normalize2 = function normalize3(schema3, input, parent, key, visit2, addEntity, visitedEntities) {
295
- schema3 = validateSchema(schema3);
296
- var values = getValues(input);
297
- return values.map(function(value, index) {
298
- return visit2(value, parent, key, schema3, addEntity, visitedEntities);
299
- });
300
- };
301
- var denormalize = function denormalize2(schema3, input, unvisit) {
302
- schema3 = validateSchema(schema3);
303
- return input && input.map ? input.map(function(entityOrId) {
304
- return unvisit(entityOrId, schema3);
305
- }) : input;
306
- };
307
- var ArraySchema = /* @__PURE__ */ function(_PolymorphicSchema) {
308
- _inheritsLoose(ArraySchema2, _PolymorphicSchema);
309
- function ArraySchema2() {
310
- return _PolymorphicSchema.apply(this, arguments) || this;
311
- }
312
- var _proto = ArraySchema2.prototype;
313
- _proto.normalize = function normalize3(input, parent, key, visit2, addEntity, visitedEntities) {
314
- var _this = this;
315
- var values = getValues(input);
316
- return values.map(function(value, index) {
317
- return _this.normalizeValue(value, parent, key, visit2, addEntity, visitedEntities);
318
- }).filter(function(value) {
319
- return value !== void 0 && value !== null;
320
- });
321
- };
322
- _proto.denormalize = function denormalize2(input, unvisit) {
323
- var _this2 = this;
324
- return input && input.map ? input.map(function(value) {
325
- return _this2.denormalizeValue(value, unvisit);
326
- }) : input;
327
- };
328
- return ArraySchema2;
329
- }(PolymorphicSchema);
330
- var _normalize = function normalize3(schema3, input, parent, key, visit2, addEntity, visitedEntities) {
331
- var object = _extends({}, input);
332
- Object.keys(schema3).forEach(function(key2) {
333
- var localSchema = schema3[key2];
334
- var resolvedLocalSchema = typeof localSchema === "function" ? localSchema(input) : localSchema;
335
- var value = visit2(input[key2], input, key2, resolvedLocalSchema, addEntity, visitedEntities);
336
- if (value === void 0 || value === null) {
337
- delete object[key2];
338
- } else {
339
- object[key2] = value;
340
- }
341
- });
342
- return object;
343
- };
344
- var _denormalize = function denormalize2(schema3, input, unvisit) {
345
- if (isImmutable(input)) {
346
- return denormalizeImmutable(schema3, input, unvisit);
347
- }
348
- var object = _extends({}, input);
349
- Object.keys(schema3).forEach(function(key) {
350
- if (object[key] != null) {
351
- object[key] = unvisit(object[key], schema3[key]);
352
- }
353
- });
354
- return object;
355
- };
356
- var ObjectSchema = /* @__PURE__ */ function() {
357
- function ObjectSchema2(definition) {
358
- this.define(definition);
359
- }
360
- var _proto = ObjectSchema2.prototype;
361
- _proto.define = function define2(definition) {
362
- this.schema = Object.keys(definition).reduce(function(entitySchema, key) {
363
- var _extends2;
364
- var schema3 = definition[key];
365
- return _extends({}, entitySchema, (_extends2 = {}, _extends2[key] = schema3, _extends2));
366
- }, this.schema || {});
367
- };
368
- _proto.normalize = function normalize3() {
369
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
370
- args[_key] = arguments[_key];
371
- }
372
- return _normalize.apply(void 0, [this.schema].concat(args));
373
- };
374
- _proto.denormalize = function denormalize2() {
375
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
376
- args[_key2] = arguments[_key2];
377
- }
378
- return _denormalize.apply(void 0, [this.schema].concat(args));
379
- };
380
- return ObjectSchema2;
381
- }();
382
- var visit = function visit2(value, parent, key, schema3, addEntity, visitedEntities) {
383
- if (typeof value !== "object" || !value) {
384
- return value;
385
- }
386
- if (typeof schema3 === "object" && (!schema3.normalize || typeof schema3.normalize !== "function")) {
387
- var method = Array.isArray(schema3) ? normalize2 : _normalize;
388
- return method(schema3, value, parent, key, visit2, addEntity, visitedEntities);
389
- }
390
- return schema3.normalize(value, parent, key, visit2, addEntity, visitedEntities);
391
- };
392
- var addEntities = function addEntities2(entities2) {
393
- return function(schema3, processedEntity, value, parent, key) {
394
- var schemaKey = schema3.key;
395
- var id = schema3.getId(value, parent, key);
396
- if (!(schemaKey in entities2)) {
397
- entities2[schemaKey] = {};
398
- }
399
- var existingEntity = entities2[schemaKey][id];
400
- if (existingEntity) {
401
- entities2[schemaKey][id] = schema3.merge(existingEntity, processedEntity);
402
- } else {
403
- entities2[schemaKey][id] = processedEntity;
404
- }
405
- };
406
- };
407
- var schema2 = {
408
- Array: ArraySchema,
409
- Entity: EntitySchema,
410
- Object: ObjectSchema,
411
- Union: UnionSchema,
412
- Values: ValuesSchema
413
- };
414
- var normalize$1 = function normalize3(input, schema3) {
415
- if (!input || typeof input !== "object") {
416
- throw new Error('Unexpected input given to normalize. Expected type to be "object", found "' + (input === null ? "null" : typeof input) + '".');
417
- }
418
- var entities2 = {};
419
- var addEntity = addEntities(entities2);
420
- var visitedEntities = {};
421
- var result = visit(input, input, null, schema3, addEntity, visitedEntities);
422
- return {
423
- entities: entities2,
424
- result
425
- };
426
- };
427
- var unvisitEntity = function unvisitEntity2(id, schema3, unvisit, getEntity, cache) {
428
- var entity = getEntity(id, schema3);
429
- if (entity === void 0 && schema3 instanceof EntitySchema) {
430
- entity = schema3.fallback(id, schema3);
431
- }
432
- if (typeof entity !== "object" || entity === null) {
433
- return entity;
434
- }
435
- if (!cache[schema3.key]) {
436
- cache[schema3.key] = {};
437
- }
438
- if (!cache[schema3.key][id]) {
439
- var entityCopy = isImmutable(entity) ? entity : _extends({}, entity);
440
- cache[schema3.key][id] = entityCopy;
441
- cache[schema3.key][id] = schema3.denormalize(entityCopy, unvisit);
442
- }
443
- return cache[schema3.key][id];
444
- };
445
- var getUnvisit = function getUnvisit2(entities2) {
446
- var cache = {};
447
- var getEntity = getEntities(entities2);
448
- return function unvisit(input, schema3) {
449
- if (typeof schema3 === "object" && (!schema3.denormalize || typeof schema3.denormalize !== "function")) {
450
- var method = Array.isArray(schema3) ? denormalize : _denormalize;
451
- return method(schema3, input, unvisit);
452
- }
453
- if (input === void 0 || input === null) {
454
- return input;
455
- }
456
- if (schema3 instanceof EntitySchema) {
457
- return unvisitEntity(input, schema3, unvisit, getEntity, cache);
458
- }
459
- return schema3.denormalize(input, unvisit);
460
- };
461
- };
462
- var getEntities = function getEntities2(entities2) {
463
- var isImmutable$1 = isImmutable(entities2);
464
- return function(entityOrId, schema3) {
465
- var schemaKey = schema3.key;
466
- if (typeof entityOrId === "object") {
467
- return entityOrId;
468
- }
469
- if (isImmutable$1) {
470
- return entities2.getIn([schemaKey, entityOrId.toString()]);
471
- }
472
- return entities2[schemaKey] && entities2[schemaKey][entityOrId];
473
- };
474
- };
475
- var denormalize$1 = function denormalize2(input, schema3, entities2) {
476
- if (typeof input !== "undefined") {
477
- return getUnvisit(entities2)(input, schema3);
478
- }
479
- };
480
- exports.denormalize = denormalize$1;
481
- exports.normalize = normalize$1;
482
- exports.schema = schema2;
483
- }
484
- });
485
-
486
- // src/index.ts
487
- init_define_import_meta();
488
-
489
1
  // src/selectors/school.ts
490
- init_define_import_meta();
491
2
  import {
492
3
  createSearchSelector,
493
4
  filterEntitiesSimpleFieldByValues,
@@ -506,12 +17,10 @@ var searchSchools = createSearchSelector(
506
17
  );
507
18
 
508
19
  // src/reducers/entities.ts
509
- init_define_import_meta();
510
20
  import { makeReducer } from "@lls/utils";
511
21
  import _2 from "lodash/fp.js";
512
22
 
513
23
  // ../core/src/actions/index.ts
514
- init_define_import_meta();
515
24
  import { makeActionCreator } from "@lls/utils";
516
25
  var actionTypes = {
517
26
  DELETE_ENTITY: "DELETE_ENTITY",
@@ -619,199 +128,12 @@ var entities = makeReducer(
619
128
  var entities_default = entities;
620
129
 
621
130
  // src/schema/index.ts
622
- init_define_import_meta();
623
- var import_normalizr = __toESM(require_normalizr(), 1);
624
- import _3 from "lodash/fp.js";
625
- var document = new import_normalizr.schema.Entity("documents", {}, { idAttribute: "resourceId" });
626
- var subject = new import_normalizr.schema.Entity("subjects");
627
- var level = new import_normalizr.schema.Entity("levels");
628
- var book = new import_normalizr.schema.Entity("books");
629
- var tool = new import_normalizr.schema.Entity("tools");
630
- var chapter = new import_normalizr.schema.Entity("chapters");
631
- var page = new import_normalizr.schema.Entity("pages");
632
- var resource = new import_normalizr.schema.Entity("resources");
633
- var user = new import_normalizr.schema.Entity("users");
634
- var school = new import_normalizr.schema.Entity("schools");
635
- var teacher = new import_normalizr.schema.Entity("teachers");
636
- var faq = new import_normalizr.schema.Entity("faq");
637
- var product = new import_normalizr.schema.Entity("products");
638
- var communityProjects = new import_normalizr.schema.Entity("communityProjects");
639
- var grammarRule = new import_normalizr.schema.Entity("grammarRules", {}, { idAttribute: "objectID" });
640
- var mainNotification = new import_normalizr.schema.Entity("mainNotifications");
641
- var explorerResult = new import_normalizr.schema.Entity("explorerResults", {}, { idAttribute: "resourceId" });
642
- var drawerNotification = new import_normalizr.schema.Entity("drawerNotifications");
643
- var copyNotification = new import_normalizr.schema.Entity("copyNotifications");
644
- var quote = new import_normalizr.schema.Entity("quotes");
645
- var group = new import_normalizr.schema.Entity("groups");
646
- var analytic = new import_normalizr.schema.Entity("analytics");
647
- var contact = new import_normalizr.schema.Entity("contact");
648
- var collection = new import_normalizr.schema.Entity("collections");
649
- var sharedPage = new import_normalizr.schema.Entity("sharedPages");
650
- var student = new import_normalizr.schema.Entity("students");
651
- var news = new import_normalizr.schema.Entity("news");
652
- var schoolType = new import_normalizr.schema.Entity("schoolTypes");
653
- var panorama = new import_normalizr.schema.Entity("panoramas");
654
- var premiumResource = new import_normalizr.schema.Entity("premiumResources");
655
- var garDivision = new import_normalizr.schema.Entity("garDivisions");
656
- var define = (el, scheme) => {
657
- el.define(scheme);
658
- return scheme;
659
- };
660
- var bookSchema = define(book, {
661
- chapters: [chapter],
662
- collection,
663
- firstValidPage: page,
664
- levels: [level],
665
- news: [news],
666
- oldBook: book,
667
- premiumResources: [premiumResource],
668
- revisionPages: [page],
669
- subjects: [subject],
670
- textbooks: [book],
671
- tools: [tool],
672
- workbooks: [book],
673
- workplans: [book]
674
- });
675
- var garDivisionSchema = define(garDivision, {
676
- students: [user],
677
- school
678
- });
679
- var chapterSchema = define(chapter, {
680
- book,
681
- oldBook: book,
682
- oldChapter: chapter,
683
- pages: [page],
684
- resources: [resource]
685
- });
686
- var pageSchema = define(page, {
687
- book,
688
- chapter,
689
- oldBook: book,
690
- oldChapter: chapter,
691
- oldLesson: page,
692
- originalPage: page,
693
- parent: page,
694
- sharedGroups: [group],
695
- sharedTeacher: user,
696
- sharedUsers: [user],
697
- user
698
- });
699
- var userSchema = define(user, {
700
- books: [book],
701
- booksV2: [book],
702
- contacts: [contact],
703
- copies: [page],
704
- copyNotifications: [copyNotification],
705
- drawerNotifications: [drawerNotification],
706
- garDivisions: [garDivision],
707
- groups: [group],
708
- lastBooksViewed: [book],
709
- lastPagesViewed: [page],
710
- levels: [level],
711
- mainNotifications: [mainNotification],
712
- pages: [page],
713
- schools: [school],
714
- sharedPages: [sharedPage],
715
- students: [student],
716
- subjects: [subject],
717
- teachers: [teacher],
718
- userPages: [page]
719
- });
720
- var notificationSchema = define(mainNotification, { page });
721
- drawerNotification.define({ page });
722
- copyNotification.define({ page });
723
- var resourceSchema = define(resource, {
724
- chapter,
725
- page
726
- });
727
- var toolSchema = define(tool, {
728
- books: [book]
729
- });
730
- var sharedPageSchema = define(sharedPage, {
731
- user,
732
- chapter,
733
- parent: page,
734
- book,
735
- originalPage: page
736
- });
737
- var studentSchema = define(student, {
738
- levels: [level]
739
- });
740
- var teacherSchema = define(teacher, {
741
- schools: [school],
742
- subjects: [subject]
743
- });
744
- var productSchema = define(product, {
745
- books: [book]
746
- });
747
- var groupSchema = define(group, {
748
- owner: teacher,
749
- students: [student]
750
- });
751
- var newsSchema = define(news, {
752
- books: [book],
753
- subjects: [subject],
754
- levels: [level]
755
- });
756
- var premiumResourceSchema = define(premiumResource, {
757
- book
758
- });
759
- var querySchema = {
760
- viewer: {
761
- addCorrectionsToGroup: group,
762
- addCorrectionsToStudents: page,
763
- addPageAppreciation: page,
764
- addStudentToGroup: group,
765
- books: { hits: [book] },
766
- chapters: { hits: [chapter] },
767
- createEstimate: quote,
768
- createGroup: group,
769
- createPage: page,
770
- createUser: user,
771
- documents: { hits: [document] },
772
- explorerResults: [explorerResult],
773
- levels: [level],
774
- me: user,
775
- // mutations
776
- pages: { hits: [page] },
777
- panoramas: [panorama],
778
- parents: { hits: [page] },
779
- //pages alias
780
- product: { hits: [product] },
781
- schoolTypes: { hits: [schoolType] },
782
- sharePageToGroup: page,
783
- sharePageToUsers: page,
784
- subjects: { hits: [subject] },
785
- updateCopyNotification: copyNotification,
786
- updateDrawerNotification: drawerNotification,
787
- updateGroup: group,
788
- updateMainNotification: mainNotification,
789
- updatePage: page,
790
- updateTrialUser: user,
791
- updateUserLastActivitySeenAt: user,
792
- updateUser: user
793
- },
794
- auth: {
795
- user
796
- },
797
- marketing: {
798
- addLikeFaq: faq,
799
- communityProjects: [communityProjects],
800
- createAnalytics: analytic,
801
- faq: [faq]
802
- },
803
- static: {
804
- projetVoltaire: {
805
- grammarRules: [grammarRule]
806
- }
807
- }
808
- };
809
- var normalizeData = _3.flow((data) => (0, import_normalizr.normalize)(data, querySchema));
131
+ var schema = "TODO";
132
+ var schema_default = schema;
810
133
  export {
811
134
  entities_default as entitiesReducer,
812
135
  getSchool,
813
136
  getSchools,
814
- normalizeData,
815
- querySchema,
137
+ schema_default as schema,
816
138
  searchSchools
817
139
  };
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.1.57-2fe8a3de",
5
+ "version": "24.1.57-3bf4faf5",
6
6
  "type": "module",
7
7
  "types": "./lib/builttypes/store/src/index.d.ts",
8
8
  "exports": {
@@ -41,13 +41,10 @@
41
41
  "vite": "5.3.3",
42
42
  "vite-tsconfig-paths": "4.3.2",
43
43
  "vitest": "2.0.0",
44
- "@lls/utils": "24.1.57-2fe8a3de",
45
- "@lls/vitescripts": "24.1.57-2fe8a3de"
44
+ "@lls/utils": "24.1.57-3bf4faf5",
45
+ "@lls/vitescripts": "24.1.57-3bf4faf5"
46
46
  },
47
47
  "license": "ISC",
48
- "dependencies": {
49
- "normalizr": "3.6.2"
50
- },
51
48
  "scripts": {
52
49
  "build": "node build.mjs",
53
50
  "lint": "pnpm biome check --apply src __tests__",