@punks/backend-entity-manager 0.0.4 → 0.0.6

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.
package/dist/cjs/index.js CHANGED
@@ -66,6 +66,21 @@ exports.SortDirection = void 0;
66
66
  SortDirection[SortDirection["Desc"] = 1] = "Desc";
67
67
  })(exports.SortDirection || (exports.SortDirection = {}));
68
68
 
69
+ class NestEntityActions {
70
+ // todo: resolve entity name from decorator
71
+ constructor(entityName, registry) {
72
+ this.services = registry.resolveEntityServicesCollection(entityName);
73
+ }
74
+ get provider() {
75
+ if (!this.actionsInstance) {
76
+ this.actionsInstance =
77
+ this.services.resolveEntityActions();
78
+ }
79
+ this.services.resolveEntityActions;
80
+ return this.actionsInstance;
81
+ }
82
+ }
83
+
69
84
  class NestEntityManager {
70
85
  // todo: resolve entity name from decorator
71
86
  constructor(entityName, registry) {
@@ -2050,7 +2065,7 @@ dist.uid = uid;
2050
2065
 
2051
2066
  Object.defineProperty(injectable_decorator, "__esModule", { value: true });
2052
2067
  injectable_decorator.mixin = injectable_decorator.Injectable = void 0;
2053
- const uid_1$3 = dist;
2068
+ const uid_1$2 = dist;
2054
2069
  const constants_1$e = constants$2;
2055
2070
  /**
2056
2071
  * Decorator that marks a class as a [provider](https://docs.nestjs.com/providers).
@@ -2092,7 +2107,7 @@ injectable_decorator.Injectable = Injectable;
2092
2107
  */
2093
2108
  function mixin(mixinClass) {
2094
2109
  Object.defineProperty(mixinClass, 'name', {
2095
- value: (0, uid_1$3.uid)(21),
2110
+ value: (0, uid_1$2.uid)(21),
2096
2111
  });
2097
2112
  Injectable()(mixinClass);
2098
2113
  return mixinClass;
@@ -2889,7 +2904,7 @@ assignCustomMetadata_util.assignCustomParameterMetadata = assignCustomParameterM
2889
2904
 
2890
2905
  Object.defineProperty(createRouteParamMetadata_decorator, "__esModule", { value: true });
2891
2906
  createRouteParamMetadata_decorator.createParamDecorator = void 0;
2892
- const uid_1$2 = dist;
2907
+ const uid_1$1 = dist;
2893
2908
  const constants_1$5 = constants$2;
2894
2909
  const assign_custom_metadata_util_1 = assignCustomMetadata_util;
2895
2910
  const shared_utils_1$f = shared_utils;
@@ -2901,7 +2916,7 @@ const shared_utils_1$f = shared_utils;
2901
2916
  * @publicApi
2902
2917
  */
2903
2918
  function createParamDecorator(factory, enhancers = []) {
2904
- const paramtype = (0, uid_1$2.uid)(21);
2919
+ const paramtype = (0, uid_1$1.uid)(21);
2905
2920
  return (data, ...pipes) => (target, key, index) => {
2906
2921
  const args = Reflect.getMetadata(constants_1$5.ROUTE_ARGS_METADATA, target.constructor, key) || {};
2907
2922
  const isPipe = (pipe) => pipe &&
@@ -5135,8 +5150,8 @@ var randomStringGenerator_util = {};
5135
5150
 
5136
5151
  Object.defineProperty(randomStringGenerator_util, "__esModule", { value: true });
5137
5152
  randomStringGenerator_util.randomStringGenerator = void 0;
5138
- const uid_1$1 = dist;
5139
- const randomStringGenerator = () => (0, uid_1$1.uid)(21);
5153
+ const uid_1 = dist;
5154
+ const randomStringGenerator = () => (0, uid_1.uid)(21);
5140
5155
  randomStringGenerator_util.randomStringGenerator = randomStringGenerator;
5141
5156
 
5142
5157
  var constants$1 = {};
@@ -31211,25 +31226,6 @@ STATIC_CONTEXT = constants.STATIC_CONTEXT = Object.freeze({
31211
31226
  id: STATIC_CONTEXT_ID,
31212
31227
  });
31213
31228
 
31214
- var modulesContainer = {};
31215
-
31216
- Object.defineProperty(modulesContainer, "__esModule", { value: true });
31217
- var ModulesContainer_1 = modulesContainer.ModulesContainer = void 0;
31218
- const uid_1 = dist;
31219
- class ModulesContainer extends Map {
31220
- constructor() {
31221
- super(...arguments);
31222
- this._applicationId = (0, uid_1.uid)(21);
31223
- }
31224
- get applicationId() {
31225
- return this._applicationId;
31226
- }
31227
- getById(id) {
31228
- return Array.from(this.values()).find(moduleRef => moduleRef.id === id);
31229
- }
31230
- }
31231
- ModulesContainer_1 = modulesContainer.ModulesContainer = ModulesContainer;
31232
-
31233
31229
  var metadataScanner = {};
31234
31230
 
31235
31231
  Object.defineProperty(metadataScanner, "__esModule", { value: true });
@@ -48545,8 +48541,9 @@ const withMetaAtKey = (key) => (component) => {
48545
48541
  return lodash.exports.some(metaTargets, (x) => Reflect.getMetadata(key, x));
48546
48542
  };
48547
48543
  let DiscoveryService = class DiscoveryService {
48548
- constructor(modulesContainer, metadataScanner) {
48549
- this.modulesContainer = modulesContainer;
48544
+ constructor(
48545
+ // private readonly modulesContainer: ModulesContainer,
48546
+ metadataScanner) {
48550
48547
  this.metadataScanner = metadataScanner;
48551
48548
  }
48552
48549
  /**
@@ -48669,7 +48666,7 @@ let DiscoveryService = class DiscoveryService {
48669
48666
  };
48670
48667
  }
48671
48668
  async discover(component) {
48672
- const modulesMap = [...this.modulesContainer.entries()];
48669
+ const modulesMap = this.getModuleEntries();
48673
48670
  return Promise.all(
48674
48671
  // @ts-ignore
48675
48672
  lodash.exports.flatMap(modulesMap, ([key, nestModule]) => {
@@ -48679,11 +48676,15 @@ let DiscoveryService = class DiscoveryService {
48679
48676
  .map((component) => this.toDiscoveredClass(nestModule, component));
48680
48677
  }));
48681
48678
  }
48679
+ getModuleEntries() {
48680
+ // todo: restore
48681
+ // return [...this.modulesContainer.entries()]
48682
+ return new Map();
48683
+ }
48682
48684
  };
48683
48685
  DiscoveryService = __decorate([
48684
48686
  common.Injectable(),
48685
- __metadata("design:paramtypes", [ModulesContainer_1,
48686
- MetadataScanner_1])
48687
+ __metadata("design:paramtypes", [MetadataScanner_1])
48687
48688
  ], DiscoveryService);
48688
48689
  /**
48689
48690
  * Exposes a query API over top of the NestJS Module container
@@ -48794,6 +48795,7 @@ exports.EntityManagerSymbols = EntityManagerSymbols;
48794
48795
  exports.EntityNotFoundException = EntityNotFoundException;
48795
48796
  exports.EntityOperationUnauthorizedException = EntityOperationUnauthorizedException;
48796
48797
  exports.MultipleEntitiesFoundException = MultipleEntitiesFoundException;
48798
+ exports.NestEntityActions = NestEntityActions;
48797
48799
  exports.NestEntityManager = NestEntityManager;
48798
48800
  exports.NestTypeOrmQueryBuilder = NestTypeOrmQueryBuilder;
48799
48801
  exports.NestTypeOrmRepository = NestTypeOrmRepository;