@e22m4u/js-repository 0.8.0 → 0.8.1

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 (83) hide show
  1. package/README.md +164 -123
  2. package/dist/cjs/index.cjs +86 -1
  3. package/eslint.config.js +2 -1
  4. package/package.json +15 -8
  5. package/src/adapter/adapter-loader.d.ts +16 -0
  6. package/src/adapter/adapter-registry.d.ts +14 -0
  7. package/src/adapter/adapter.d.ts +153 -0
  8. package/src/adapter/builtin/memory-adapter.d.ts +148 -0
  9. package/src/adapter/builtin/memory-adapter.js +1 -1
  10. package/src/adapter/decorator/data-sanitizing-decorator.d.ts +14 -0
  11. package/src/adapter/decorator/default-values-decorator.d.ts +14 -0
  12. package/src/adapter/decorator/fields-filtering-decorator.d.ts +14 -0
  13. package/src/adapter/decorator/inclusion-decorator.d.ts +14 -0
  14. package/src/adapter/decorator/index.d.ts +5 -0
  15. package/src/adapter/decorator/property-uniqueness-decorator.d.ts +14 -0
  16. package/src/adapter/index.d.ts +3 -0
  17. package/src/database-schema.d.ts +37 -0
  18. package/src/definition/datasource/datasource-definition-validator.d.ts +14 -0
  19. package/src/definition/datasource/datasource-definition.d.ts +8 -0
  20. package/src/definition/datasource/index.d.ts +2 -0
  21. package/src/definition/definition-registry.d.ts +50 -0
  22. package/src/definition/index.d.ts +3 -0
  23. package/src/definition/model/index.d.ts +6 -0
  24. package/src/definition/model/index.js +1 -0
  25. package/src/definition/model/model-data-sanitizer.d.ts +15 -0
  26. package/src/definition/model/model-definition-utils.d.ts +180 -0
  27. package/src/definition/model/model-definition-validator.d.ts +14 -0
  28. package/src/definition/model/model-definition.d.ts +28 -0
  29. package/src/definition/model/model-definition.js +1 -0
  30. package/src/definition/model/properties/data-type.d.ts +16 -0
  31. package/src/definition/model/properties/index.d.ts +6 -0
  32. package/src/definition/model/properties/index.js +1 -0
  33. package/src/definition/model/properties/primary-keys-definition-validator.d.ts +15 -0
  34. package/src/definition/model/properties/properties-definition-validator.d.ts +15 -0
  35. package/src/definition/model/properties/property-definition.d.ts +23 -0
  36. package/src/definition/model/properties/property-definition.js +1 -0
  37. package/src/definition/model/properties/property-uniqueness-validator.d.ts +31 -0
  38. package/src/definition/model/properties/property-uniqueness.d.ts +14 -0
  39. package/src/definition/model/relations/index.d.ts +3 -0
  40. package/src/definition/model/relations/index.js +1 -0
  41. package/src/definition/model/relations/relation-definition.d.ts +236 -0
  42. package/src/definition/model/relations/relation-definition.js +1 -0
  43. package/src/definition/model/relations/relation-type.d.ts +14 -0
  44. package/src/definition/model/relations/relations-definition-validator.d.ts +15 -0
  45. package/src/errors/index.d.ts +3 -0
  46. package/src/errors/invalid-argument-error.d.ts +6 -0
  47. package/src/errors/invalid-operator-value-error.d.ts +13 -0
  48. package/src/errors/not-implemented-error.d.ts +6 -0
  49. package/src/filter/fields-clause-tool.d.ts +38 -0
  50. package/src/filter/filter-clause.d.ts +348 -0
  51. package/src/filter/include-clause-tool.d.ts +55 -0
  52. package/src/filter/index.d.ts +7 -0
  53. package/src/filter/operator-clause-tool.d.ts +224 -0
  54. package/src/filter/order-clause-tool.d.ts +32 -0
  55. package/src/filter/slice-clause-tool.d.ts +30 -0
  56. package/src/filter/where-clause-tool.d.ts +23 -0
  57. package/src/index.d.ts +9 -0
  58. package/src/index.js +1 -0
  59. package/src/relations/belongs-to-resolver.d.ts +46 -0
  60. package/src/relations/has-many-resolver.d.ts +67 -0
  61. package/src/relations/has-one-resolver.d.ts +67 -0
  62. package/src/relations/index.d.ts +4 -0
  63. package/src/relations/references-many-resolver.d.ts +27 -0
  64. package/src/repository/index.d.ts +2 -0
  65. package/src/repository/repository-registry.d.ts +29 -0
  66. package/src/repository/repository.d.ts +183 -0
  67. package/src/types.d.ts +43 -0
  68. package/src/types.js +1 -0
  69. package/src/utils/capitalize.d.ts +6 -0
  70. package/src/utils/clone-deep.d.ts +6 -0
  71. package/src/utils/exclude-object-keys.d.ts +10 -0
  72. package/src/utils/get-value-by-path.d.ts +12 -0
  73. package/src/utils/index.d.ts +12 -0
  74. package/src/utils/is-deep-equal.d.ts +10 -0
  75. package/src/utils/is-plain-object.d.ts +6 -0
  76. package/src/utils/is-promise.d.ts +10 -0
  77. package/src/utils/like-to-regexp.d.ts +14 -0
  78. package/src/utils/model-name-to-model-key.d.ts +6 -0
  79. package/src/utils/select-object-keys.d.ts +10 -0
  80. package/src/utils/singularize.d.ts +6 -0
  81. package/src/utils/string-to-regexp.d.ts +10 -0
  82. package/tsconfig.json +14 -0
  83. package/jsconfig.json +0 -7
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -45,6 +46,7 @@ function isPromise(value) {
45
46
  }
46
47
  var init_is_promise = __esm({
47
48
  "src/utils/is-promise.js"() {
49
+ "use strict";
48
50
  __name(isPromise, "isPromise");
49
51
  }
50
52
  });
@@ -56,6 +58,7 @@ function capitalize(string) {
56
58
  }
57
59
  var init_capitalize = __esm({
58
60
  "src/utils/capitalize.js"() {
61
+ "use strict";
59
62
  __name(capitalize, "capitalize");
60
63
  }
61
64
  });
@@ -99,6 +102,7 @@ function cloneDeep(value) {
99
102
  }
100
103
  var init_clone_deep = __esm({
101
104
  "src/utils/clone-deep.js"() {
105
+ "use strict";
102
106
  __name(cloneDeep, "cloneDeep");
103
107
  }
104
108
  });
@@ -122,6 +126,7 @@ function singularize(noun) {
122
126
  }
123
127
  var init_singularize = __esm({
124
128
  "src/utils/singularize.js"() {
129
+ "use strict";
125
130
  __name(singularize, "singularize");
126
131
  }
127
132
  });
@@ -170,6 +175,7 @@ function isDeepEqual(firstValue, secondValue) {
170
175
  }
171
176
  var init_is_deep_equal = __esm({
172
177
  "src/utils/is-deep-equal.js"() {
178
+ "use strict";
173
179
  __name(isDeepEqual, "isDeepEqual");
174
180
  }
175
181
  });
@@ -178,6 +184,7 @@ var init_is_deep_equal = __esm({
178
184
  var import_js_format, _NotImplementedError, NotImplementedError;
179
185
  var init_not_implemented_error = __esm({
180
186
  "src/errors/not-implemented-error.js"() {
187
+ "use strict";
181
188
  import_js_format = require("@e22m4u/js-format");
182
189
  _NotImplementedError = class _NotImplementedError extends import_js_format.Errorf {
183
190
  };
@@ -190,6 +197,7 @@ var init_not_implemented_error = __esm({
190
197
  var import_js_format2, _InvalidArgumentError, InvalidArgumentError;
191
198
  var init_invalid_argument_error = __esm({
192
199
  "src/errors/invalid-argument-error.js"() {
200
+ "use strict";
193
201
  import_js_format2 = require("@e22m4u/js-format");
194
202
  _InvalidArgumentError = class _InvalidArgumentError extends import_js_format2.Errorf {
195
203
  };
@@ -202,6 +210,7 @@ var init_invalid_argument_error = __esm({
202
210
  var import_js_format3, _InvalidOperatorValueError, InvalidOperatorValueError;
203
211
  var init_invalid_operator_value_error = __esm({
204
212
  "src/errors/invalid-operator-value-error.js"() {
213
+ "use strict";
205
214
  import_js_format3 = require("@e22m4u/js-format");
206
215
  _InvalidOperatorValueError = class _InvalidOperatorValueError extends Error {
207
216
  /**
@@ -230,6 +239,7 @@ var init_invalid_operator_value_error = __esm({
230
239
  // src/errors/index.js
231
240
  var init_errors = __esm({
232
241
  "src/errors/index.js"() {
242
+ "use strict";
233
243
  init_not_implemented_error();
234
244
  init_invalid_argument_error();
235
245
  init_invalid_operator_value_error();
@@ -271,6 +281,7 @@ function likeToRegexp(pattern, isCaseInsensitive = false) {
271
281
  }
272
282
  var init_like_to_regexp = __esm({
273
283
  "src/utils/like-to-regexp.js"() {
284
+ "use strict";
274
285
  init_errors();
275
286
  __name(likeToRegexp, "likeToRegexp");
276
287
  }
@@ -284,6 +295,7 @@ function isPlainObject(value) {
284
295
  }
285
296
  var init_is_plain_object = __esm({
286
297
  "src/utils/is-plain-object.js"() {
298
+ "use strict";
287
299
  __name(isPlainObject, "isPlainObject");
288
300
  }
289
301
  });
@@ -297,6 +309,7 @@ function stringToRegexp(pattern, flags = void 0) {
297
309
  }
298
310
  var init_string_to_regexp = __esm({
299
311
  "src/utils/string-to-regexp.js"() {
312
+ "use strict";
300
313
  __name(stringToRegexp, "stringToRegexp");
301
314
  }
302
315
  });
@@ -319,6 +332,7 @@ function getValueByPath(obj, path, orElse = void 0) {
319
332
  }
320
333
  var init_get_value_by_path = __esm({
321
334
  "src/utils/get-value-by-path.js"() {
335
+ "use strict";
322
336
  __name(getValueByPath, "getValueByPath");
323
337
  }
324
338
  });
@@ -351,6 +365,7 @@ function selectObjectKeys(obj, keys) {
351
365
  }
352
366
  var init_select_object_keys = __esm({
353
367
  "src/utils/select-object-keys.js"() {
368
+ "use strict";
354
369
  init_errors();
355
370
  __name(selectObjectKeys, "selectObjectKeys");
356
371
  }
@@ -370,6 +385,7 @@ function excludeObjectKeys(obj, keys) {
370
385
  }
371
386
  var init_exclude_object_keys = __esm({
372
387
  "src/utils/exclude-object-keys.js"() {
388
+ "use strict";
373
389
  init_errors();
374
390
  __name(excludeObjectKeys, "excludeObjectKeys");
375
391
  }
@@ -386,6 +402,7 @@ function modelNameToModelKey(modelName) {
386
402
  }
387
403
  var init_model_name_to_model_key = __esm({
388
404
  "src/utils/model-name-to-model-key.js"() {
405
+ "use strict";
389
406
  init_errors();
390
407
  __name(modelNameToModelKey, "modelNameToModelKey");
391
408
  }
@@ -394,6 +411,7 @@ var init_model_name_to_model_key = __esm({
394
411
  // src/utils/index.js
395
412
  var init_utils = __esm({
396
413
  "src/utils/index.js"() {
414
+ "use strict";
397
415
  init_is_promise();
398
416
  init_capitalize();
399
417
  init_clone_deep();
@@ -413,6 +431,7 @@ var init_utils = __esm({
413
431
  var import_js_service, _SliceClauseTool, SliceClauseTool;
414
432
  var init_slice_clause_tool = __esm({
415
433
  "src/filter/slice-clause-tool.js"() {
434
+ "use strict";
416
435
  import_js_service = require("@e22m4u/js-service");
417
436
  init_errors();
418
437
  _SliceClauseTool = class _SliceClauseTool extends import_js_service.Service {
@@ -495,6 +514,7 @@ function compareFn(a, b) {
495
514
  var import_js_service2, _OrderClauseTool, OrderClauseTool;
496
515
  var init_order_clause_tool = __esm({
497
516
  "src/filter/order-clause-tool.js"() {
517
+ "use strict";
498
518
  import_js_service2 = require("@e22m4u/js-service");
499
519
  init_utils();
500
520
  init_errors();
@@ -573,6 +593,7 @@ var init_order_clause_tool = __esm({
573
593
  var import_js_service3, _OperatorClauseTool, OperatorClauseTool;
574
594
  var init_operator_clause_tool = __esm({
575
595
  "src/filter/operator-clause-tool.js"() {
596
+ "use strict";
576
597
  import_js_service3 = require("@e22m4u/js-service");
577
598
  init_utils();
578
599
  init_errors();
@@ -1034,6 +1055,7 @@ var init_operator_clause_tool = __esm({
1034
1055
  var import_js_service4, _WhereClauseTool, WhereClauseTool;
1035
1056
  var init_where_clause_tool = __esm({
1036
1057
  "src/filter/where-clause-tool.js"() {
1058
+ "use strict";
1037
1059
  import_js_service4 = require("@e22m4u/js-service");
1038
1060
  init_errors();
1039
1061
  init_operator_clause_tool();
@@ -1179,6 +1201,7 @@ var init_where_clause_tool = __esm({
1179
1201
  var RelationType;
1180
1202
  var init_relation_type = __esm({
1181
1203
  "src/definition/model/relations/relation-type.js"() {
1204
+ "use strict";
1182
1205
  RelationType = {
1183
1206
  BELONGS_TO: "belongsTo",
1184
1207
  HAS_ONE: "hasOne",
@@ -1188,10 +1211,18 @@ var init_relation_type = __esm({
1188
1211
  }
1189
1212
  });
1190
1213
 
1214
+ // src/definition/model/relations/relation-definition.js
1215
+ var init_relation_definition = __esm({
1216
+ "src/definition/model/relations/relation-definition.js"() {
1217
+ "use strict";
1218
+ }
1219
+ });
1220
+
1191
1221
  // src/definition/model/relations/relations-definition-validator.js
1192
1222
  var import_js_service5, _RelationsDefinitionValidator, RelationsDefinitionValidator;
1193
1223
  var init_relations_definition_validator = __esm({
1194
1224
  "src/definition/model/relations/relations-definition-validator.js"() {
1225
+ "use strict";
1195
1226
  import_js_service5 = require("@e22m4u/js-service");
1196
1227
  init_relation_type();
1197
1228
  init_errors();
@@ -1580,7 +1611,9 @@ var init_relations_definition_validator = __esm({
1580
1611
  // src/definition/model/relations/index.js
1581
1612
  var init_relations = __esm({
1582
1613
  "src/definition/model/relations/index.js"() {
1614
+ "use strict";
1583
1615
  init_relation_type();
1616
+ init_relation_definition();
1584
1617
  init_relations_definition_validator();
1585
1618
  }
1586
1619
  });
@@ -1589,6 +1622,7 @@ var init_relations = __esm({
1589
1622
  var DataType;
1590
1623
  var init_data_type = __esm({
1591
1624
  "src/definition/model/properties/data-type.js"() {
1625
+ "use strict";
1592
1626
  DataType = {
1593
1627
  ANY: "any",
1594
1628
  STRING: "string",
@@ -1600,10 +1634,18 @@ var init_data_type = __esm({
1600
1634
  }
1601
1635
  });
1602
1636
 
1637
+ // src/definition/model/properties/property-definition.js
1638
+ var init_property_definition = __esm({
1639
+ "src/definition/model/properties/property-definition.js"() {
1640
+ "use strict";
1641
+ }
1642
+ });
1643
+
1603
1644
  // src/definition/model/properties/property-uniqueness.js
1604
1645
  var PropertyUniqueness;
1605
1646
  var init_property_uniqueness = __esm({
1606
1647
  "src/definition/model/properties/property-uniqueness.js"() {
1648
+ "use strict";
1607
1649
  PropertyUniqueness = {
1608
1650
  STRICT: "strict",
1609
1651
  SPARSE: "sparse",
@@ -1616,6 +1658,7 @@ var init_property_uniqueness = __esm({
1616
1658
  var import_js_service6, _DefinitionRegistry, DefinitionRegistry;
1617
1659
  var init_definition_registry = __esm({
1618
1660
  "src/definition/definition-registry.js"() {
1661
+ "use strict";
1619
1662
  import_js_service6 = require("@e22m4u/js-service");
1620
1663
  init_utils();
1621
1664
  init_errors();
@@ -1718,6 +1761,7 @@ var init_definition_registry = __esm({
1718
1761
  var import_js_service7, import_js_empty_values, DEFAULT_PRIMARY_KEY_PROPERTY_NAME, _ModelDefinitionUtils, ModelDefinitionUtils;
1719
1762
  var init_model_definition_utils = __esm({
1720
1763
  "src/definition/model/model-definition-utils.js"() {
1764
+ "use strict";
1721
1765
  import_js_service7 = require("@e22m4u/js-service");
1722
1766
  init_properties();
1723
1767
  import_js_empty_values = require("@e22m4u/js-empty-values");
@@ -2130,6 +2174,7 @@ var init_model_definition_utils = __esm({
2130
2174
  var import_js_service8, import_js_empty_values2, _PropertyUniquenessValidator, PropertyUniquenessValidator;
2131
2175
  var init_property_uniqueness_validator = __esm({
2132
2176
  "src/definition/model/properties/property-uniqueness-validator.js"() {
2177
+ "use strict";
2133
2178
  init_data_type();
2134
2179
  import_js_service8 = require("@e22m4u/js-service");
2135
2180
  init_utils();
@@ -2249,6 +2294,7 @@ var init_property_uniqueness_validator = __esm({
2249
2294
  var import_js_service9, _PrimaryKeysDefinitionValidator, PrimaryKeysDefinitionValidator;
2250
2295
  var init_primary_keys_definition_validator = __esm({
2251
2296
  "src/definition/model/properties/primary-keys-definition-validator.js"() {
2297
+ "use strict";
2252
2298
  import_js_service9 = require("@e22m4u/js-service");
2253
2299
  init_errors();
2254
2300
  init_model_definition_utils();
@@ -2300,6 +2346,7 @@ var init_primary_keys_definition_validator = __esm({
2300
2346
  var import_js_service10, _PropertiesDefinitionValidator, PropertiesDefinitionValidator;
2301
2347
  var init_properties_definition_validator = __esm({
2302
2348
  "src/definition/model/properties/properties-definition-validator.js"() {
2349
+ "use strict";
2303
2350
  import_js_service10 = require("@e22m4u/js-service");
2304
2351
  init_data_type();
2305
2352
  init_utils();
@@ -2523,7 +2570,9 @@ var init_properties_definition_validator = __esm({
2523
2570
  // src/definition/model/properties/index.js
2524
2571
  var init_properties = __esm({
2525
2572
  "src/definition/model/properties/index.js"() {
2573
+ "use strict";
2526
2574
  init_data_type();
2575
+ init_property_definition();
2527
2576
  init_property_uniqueness();
2528
2577
  init_property_uniqueness_validator();
2529
2578
  init_properties_definition_validator();
@@ -2531,10 +2580,18 @@ var init_properties = __esm({
2531
2580
  }
2532
2581
  });
2533
2582
 
2583
+ // src/definition/model/model-definition.js
2584
+ var init_model_definition = __esm({
2585
+ "src/definition/model/model-definition.js"() {
2586
+ "use strict";
2587
+ }
2588
+ });
2589
+
2534
2590
  // src/definition/model/model-data-sanitizer.js
2535
2591
  var import_js_service11, _ModelDataSanitizer, ModelDataSanitizer;
2536
2592
  var init_model_data_sanitizer = __esm({
2537
2593
  "src/definition/model/model-data-sanitizer.js"() {
2594
+ "use strict";
2538
2595
  import_js_service11 = require("@e22m4u/js-service");
2539
2596
  init_errors();
2540
2597
  init_model_definition_utils();
@@ -2571,6 +2628,7 @@ var init_model_data_sanitizer = __esm({
2571
2628
  var import_js_service12, _ModelDefinitionValidator, ModelDefinitionValidator;
2572
2629
  var init_model_definition_validator = __esm({
2573
2630
  "src/definition/model/model-definition-validator.js"() {
2631
+ "use strict";
2574
2632
  import_js_service12 = require("@e22m4u/js-service");
2575
2633
  init_errors();
2576
2634
  init_relations();
@@ -2646,8 +2704,10 @@ var init_model_definition_validator = __esm({
2646
2704
  // src/definition/model/index.js
2647
2705
  var init_model = __esm({
2648
2706
  "src/definition/model/index.js"() {
2707
+ "use strict";
2649
2708
  init_relations();
2650
2709
  init_properties();
2710
+ init_model_definition();
2651
2711
  init_model_data_sanitizer();
2652
2712
  init_model_definition_utils();
2653
2713
  init_model_definition_validator();
@@ -2658,6 +2718,7 @@ var init_model = __esm({
2658
2718
  var import_js_service13, _DatasourceDefinitionValidator, DatasourceDefinitionValidator;
2659
2719
  var init_datasource_definition_validator = __esm({
2660
2720
  "src/definition/datasource/datasource-definition-validator.js"() {
2721
+ "use strict";
2661
2722
  import_js_service13 = require("@e22m4u/js-service");
2662
2723
  init_errors();
2663
2724
  _DatasourceDefinitionValidator = class _DatasourceDefinitionValidator extends import_js_service13.Service {
@@ -2693,6 +2754,7 @@ var init_datasource_definition_validator = __esm({
2693
2754
  // src/definition/datasource/index.js
2694
2755
  var init_datasource = __esm({
2695
2756
  "src/definition/datasource/index.js"() {
2757
+ "use strict";
2696
2758
  init_datasource_definition_validator();
2697
2759
  }
2698
2760
  });
@@ -2700,6 +2762,7 @@ var init_datasource = __esm({
2700
2762
  // src/definition/index.js
2701
2763
  var init_definition = __esm({
2702
2764
  "src/definition/index.js"() {
2765
+ "use strict";
2703
2766
  init_model();
2704
2767
  init_datasource();
2705
2768
  init_definition_registry();
@@ -2710,6 +2773,7 @@ var init_definition = __esm({
2710
2773
  var import_js_service14, _FieldsClauseTool, FieldsClauseTool;
2711
2774
  var init_fields_clause_tool = __esm({
2712
2775
  "src/filter/fields-clause-tool.js"() {
2776
+ "use strict";
2713
2777
  import_js_service14 = require("@e22m4u/js-service");
2714
2778
  init_utils();
2715
2779
  init_errors();
@@ -2801,6 +2865,7 @@ var init_fields_clause_tool = __esm({
2801
2865
  var import_js_service15, _InclusionDecorator, InclusionDecorator;
2802
2866
  var init_inclusion_decorator = __esm({
2803
2867
  "src/adapter/decorator/inclusion-decorator.js"() {
2868
+ "use strict";
2804
2869
  init_adapter();
2805
2870
  import_js_service15 = require("@e22m4u/js-service");
2806
2871
  init_filter();
@@ -2889,6 +2954,7 @@ var init_inclusion_decorator = __esm({
2889
2954
  var import_js_service16, _DefaultValuesDecorator, DefaultValuesDecorator;
2890
2955
  var init_default_values_decorator = __esm({
2891
2956
  "src/adapter/decorator/default-values-decorator.js"() {
2957
+ "use strict";
2892
2958
  init_adapter();
2893
2959
  import_js_service16 = require("@e22m4u/js-service");
2894
2960
  init_errors();
@@ -2953,6 +3019,7 @@ var init_default_values_decorator = __esm({
2953
3019
  var import_js_service17, _DataSanitizingDecorator, DataSanitizingDecorator;
2954
3020
  var init_data_sanitizing_decorator = __esm({
2955
3021
  "src/adapter/decorator/data-sanitizing-decorator.js"() {
3022
+ "use strict";
2956
3023
  init_adapter();
2957
3024
  import_js_service17 = require("@e22m4u/js-service");
2958
3025
  init_errors();
@@ -3007,6 +3074,7 @@ var init_data_sanitizing_decorator = __esm({
3007
3074
  var import_js_service18, _FieldsFilteringDecorator, FieldsFilteringDecorator;
3008
3075
  var init_fields_filtering_decorator = __esm({
3009
3076
  "src/adapter/decorator/fields-filtering-decorator.js"() {
3077
+ "use strict";
3010
3078
  init_adapter();
3011
3079
  import_js_service18 = require("@e22m4u/js-service");
3012
3080
  init_filter();
@@ -3089,6 +3157,7 @@ var init_fields_filtering_decorator = __esm({
3089
3157
  var import_js_service19, _PropertyUniquenessDecorator, PropertyUniquenessDecorator;
3090
3158
  var init_property_uniqueness_decorator = __esm({
3091
3159
  "src/adapter/decorator/property-uniqueness-decorator.js"() {
3160
+ "use strict";
3092
3161
  init_adapter();
3093
3162
  import_js_service19 = require("@e22m4u/js-service");
3094
3163
  init_errors();
@@ -3163,6 +3232,7 @@ var init_property_uniqueness_decorator = __esm({
3163
3232
  // src/adapter/decorator/index.js
3164
3233
  var init_decorator = __esm({
3165
3234
  "src/adapter/decorator/index.js"() {
3235
+ "use strict";
3166
3236
  init_inclusion_decorator();
3167
3237
  init_default_values_decorator();
3168
3238
  init_data_sanitizing_decorator();
@@ -3175,6 +3245,7 @@ var init_decorator = __esm({
3175
3245
  var import_js_service20, ADAPTER_CLASS_NAME, _Adapter, Adapter;
3176
3246
  var init_adapter = __esm({
3177
3247
  "src/adapter/adapter.js"() {
3248
+ "use strict";
3178
3249
  import_js_service20 = require("@e22m4u/js-service");
3179
3250
  init_errors();
3180
3251
  init_decorator();
@@ -3382,9 +3453,10 @@ __export(memory_adapter_exports, {
3382
3453
  var _MemoryAdapter, MemoryAdapter;
3383
3454
  var init_memory_adapter = __esm({
3384
3455
  "src/adapter/builtin/memory-adapter.js"() {
3456
+ "use strict";
3385
3457
  init_adapter();
3386
- init_utils();
3387
3458
  init_errors();
3459
+ init_utils();
3388
3460
  init_definition();
3389
3461
  init_filter();
3390
3462
  _MemoryAdapter = class _MemoryAdapter extends Adapter {
@@ -3797,6 +3869,7 @@ function findAdapterCtorInModule(module2) {
3797
3869
  var import_js_service21, _AdapterLoader, AdapterLoader;
3798
3870
  var init_adapter_loader = __esm({
3799
3871
  "src/adapter/adapter-loader.js"() {
3872
+ "use strict";
3800
3873
  import_js_service21 = require("@e22m4u/js-service");
3801
3874
  init_errors();
3802
3875
  init_adapter();
@@ -3845,6 +3918,7 @@ var init_adapter_loader = __esm({
3845
3918
  var import_js_service22, _AdapterRegistry, AdapterRegistry;
3846
3919
  var init_adapter_registry = __esm({
3847
3920
  "src/adapter/adapter-registry.js"() {
3921
+ "use strict";
3848
3922
  init_adapter();
3849
3923
  import_js_service22 = require("@e22m4u/js-service");
3850
3924
  init_adapter_loader();
@@ -3883,6 +3957,7 @@ var init_adapter_registry = __esm({
3883
3957
  // src/adapter/index.js
3884
3958
  var init_adapter2 = __esm({
3885
3959
  "src/adapter/index.js"() {
3960
+ "use strict";
3886
3961
  init_adapter();
3887
3962
  init_adapter_loader();
3888
3963
  init_adapter_registry();
@@ -3893,6 +3968,7 @@ var init_adapter2 = __esm({
3893
3968
  var import_js_service23, _Repository, Repository;
3894
3969
  var init_repository = __esm({
3895
3970
  "src/repository/repository.js"() {
3971
+ "use strict";
3896
3972
  import_js_service23 = require("@e22m4u/js-service");
3897
3973
  init_errors();
3898
3974
  init_definition();
@@ -4094,6 +4170,7 @@ var init_repository = __esm({
4094
4170
  var import_js_service24, _RepositoryRegistry, RepositoryRegistry;
4095
4171
  var init_repository_registry = __esm({
4096
4172
  "src/repository/repository-registry.js"() {
4173
+ "use strict";
4097
4174
  import_js_service24 = require("@e22m4u/js-service");
4098
4175
  init_repository();
4099
4176
  init_utils();
@@ -4149,6 +4226,7 @@ var init_repository_registry = __esm({
4149
4226
  // src/repository/index.js
4150
4227
  var init_repository2 = __esm({
4151
4228
  "src/repository/index.js"() {
4229
+ "use strict";
4152
4230
  init_repository();
4153
4231
  init_repository_registry();
4154
4232
  }
@@ -4158,6 +4236,7 @@ var init_repository2 = __esm({
4158
4236
  var import_js_service25, _HasOneResolver, HasOneResolver;
4159
4237
  var init_has_one_resolver = __esm({
4160
4238
  "src/relations/has-one-resolver.js"() {
4239
+ "use strict";
4161
4240
  import_js_service25 = require("@e22m4u/js-service");
4162
4241
  init_utils();
4163
4242
  init_errors();
@@ -4411,6 +4490,7 @@ var init_has_one_resolver = __esm({
4411
4490
  var import_js_service26, _HasManyResolver, HasManyResolver;
4412
4491
  var init_has_many_resolver = __esm({
4413
4492
  "src/relations/has-many-resolver.js"() {
4493
+ "use strict";
4414
4494
  import_js_service26 = require("@e22m4u/js-service");
4415
4495
  init_utils();
4416
4496
  init_errors();
@@ -4674,6 +4754,7 @@ var init_has_many_resolver = __esm({
4674
4754
  var import_js_service27, _BelongsToResolver, BelongsToResolver;
4675
4755
  var init_belongs_to_resolver = __esm({
4676
4756
  "src/relations/belongs-to-resolver.js"() {
4757
+ "use strict";
4677
4758
  import_js_service27 = require("@e22m4u/js-service");
4678
4759
  init_errors();
4679
4760
  init_utils();
@@ -4880,6 +4961,7 @@ var init_belongs_to_resolver = __esm({
4880
4961
  var import_js_service28, _ReferencesManyResolver, ReferencesManyResolver;
4881
4962
  var init_references_many_resolver = __esm({
4882
4963
  "src/relations/references-many-resolver.js"() {
4964
+ "use strict";
4883
4965
  import_js_service28 = require("@e22m4u/js-service");
4884
4966
  init_errors();
4885
4967
  init_utils();
@@ -4978,6 +5060,7 @@ var init_references_many_resolver = __esm({
4978
5060
  // src/relations/index.js
4979
5061
  var init_relations2 = __esm({
4980
5062
  "src/relations/index.js"() {
5063
+ "use strict";
4981
5064
  init_has_one_resolver();
4982
5065
  init_has_many_resolver();
4983
5066
  init_belongs_to_resolver();
@@ -4989,6 +5072,7 @@ var init_relations2 = __esm({
4989
5072
  var import_js_service29, _IncludeClauseTool, IncludeClauseTool;
4990
5073
  var init_include_clause_tool = __esm({
4991
5074
  "src/filter/include-clause-tool.js"() {
5075
+ "use strict";
4992
5076
  import_js_service29 = require("@e22m4u/js-service");
4993
5077
  init_where_clause_tool();
4994
5078
  init_order_clause_tool();
@@ -5323,6 +5407,7 @@ var init_include_clause_tool = __esm({
5323
5407
  // src/filter/index.js
5324
5408
  var init_filter = __esm({
5325
5409
  "src/filter/index.js"() {
5410
+ "use strict";
5326
5411
  init_slice_clause_tool();
5327
5412
  init_order_clause_tool();
5328
5413
  init_where_clause_tool();
package/eslint.config.js CHANGED
@@ -7,6 +7,7 @@ import eslintPrettierConfig from 'eslint-config-prettier';
7
7
  import eslintChaiExpectPlugin from 'eslint-plugin-chai-expect';
8
8
 
9
9
  export default [{
10
+ files: ['src/**/*.js'],
10
11
  languageOptions: {
11
12
  globals: {
12
13
  ...globals.node,
@@ -28,6 +29,7 @@ export default [{
28
29
  ...eslintChaiExpectPlugin.configs['recommended-flat'].rules,
29
30
  ...eslintJsdocPlugin.configs['flat/recommended-error'].rules,
30
31
  'no-duplicate-imports': 'error',
32
+ 'import/export': 0,
31
33
  'jsdoc/reject-any-type': 0,
32
34
  'jsdoc/reject-function-type': 0,
33
35
  'jsdoc/require-param-description': 0,
@@ -35,5 +37,4 @@ export default [{
35
37
  'jsdoc/require-property-description': 0,
36
38
  'jsdoc/tag-lines': ['error', 'any', {startLines: 1}],
37
39
  },
38
- files: ['src/**/*.js'],
39
40
  }];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e22m4u/js-repository",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Реализация репозитория для работы с базами данных",
5
5
  "author": "Mikhail Evstropov <e22m4u@yandex.ru>",
6
6
  "license": "MIT",
@@ -18,9 +18,11 @@
18
18
  "url": "git+https://gitrepos.ru/e22m4u/js-repository.git"
19
19
  },
20
20
  "type": "module",
21
+ "types": "./src/index.d.ts",
21
22
  "module": "./src/index.js",
22
23
  "main": "./dist/cjs/index.cjs",
23
24
  "exports": {
25
+ "types": "./src/index.d.ts",
24
26
  "import": "./src/index.js",
25
27
  "require": "./dist/cjs/index.cjs"
26
28
  },
@@ -28,8 +30,8 @@
28
30
  "node": ">=12"
29
31
  },
30
32
  "scripts": {
31
- "lint": "eslint ./src",
32
- "lint:fix": "eslint ./src --fix",
33
+ "lint": "tsc && eslint ./src",
34
+ "lint:fix": "tsc && eslint ./src --fix",
33
35
  "format": "prettier --write \"./src/**/*.js\"",
34
36
  "test": "npm run lint && c8 --reporter=text-summary mocha --bail",
35
37
  "test:coverage": "npm run lint && c8 --reporter=text mocha --bail",
@@ -37,13 +39,17 @@
37
39
  "prepare": "husky"
38
40
  },
39
41
  "dependencies": {
40
- "@e22m4u/js-empty-values": "~0.2.0",
41
- "@e22m4u/js-format": "~0.3.0",
42
- "@e22m4u/js-service": "~0.4.6"
42
+ "@e22m4u/js-empty-values": "~0.2.1",
43
+ "@e22m4u/js-format": "~0.3.1",
44
+ "@e22m4u/js-service": "~0.5.1"
43
45
  },
44
46
  "devDependencies": {
45
47
  "@commitlint/cli": "~20.1.0",
46
48
  "@commitlint/config-conventional": "~20.0.0",
49
+ "@types/chai": "~5.2.3",
50
+ "@types/chai-as-promised": "~8.0.2",
51
+ "@types/chai-spies": "~1.0.6",
52
+ "@types/mocha": "~10.0.10",
47
53
  "c8": "~10.1.3",
48
54
  "chai": "~6.2.1",
49
55
  "chai-as-promised": "~8.0.2",
@@ -57,7 +63,8 @@
57
63
  "eslint-plugin-mocha": "~11.2.0",
58
64
  "husky": "~9.1.7",
59
65
  "mocha": "~11.7.5",
60
- "prettier": "~3.7.3",
61
- "rimraf": "~6.1.2"
66
+ "prettier": "~3.7.4",
67
+ "rimraf": "~6.1.2",
68
+ "typescript": "~5.9.3"
62
69
  }
63
70
  }
@@ -0,0 +1,16 @@
1
+ import {Adapter} from './adapter.js';
2
+ import {AnyObject} from '../types.js';
3
+ import {Service} from '@e22m4u/js-service';
4
+
5
+ /**
6
+ * Adapter loader.
7
+ */
8
+ export declare class AdapterLoader extends Service {
9
+ /**
10
+ * Load by name.
11
+ *
12
+ * @param adapterName
13
+ * @param settings
14
+ */
15
+ loadByName(adapterName: string, settings?: AnyObject): Promise<Adapter>;
16
+ }
@@ -0,0 +1,14 @@
1
+ import {Adapter} from './adapter.js';
2
+ import {Service} from '@e22m4u/js-service';
3
+
4
+ /**
5
+ * Adapter registry.
6
+ */
7
+ export declare class AdapterRegistry extends Service {
8
+ /**
9
+ * Get adapter.
10
+ *
11
+ * @param datasourceName
12
+ */
13
+ getAdapter(datasourceName: string): Promise<Adapter>;
14
+ }