eh-commons 0.0.1-testing.51 → 0.0.1-testing.52

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 (26) hide show
  1. package/dist/index.d.ts +3 -1
  2. package/dist/index.js +5 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/models/dictionary/embedded/dictionary.embedded.d.ts +3 -2
  5. package/dist/models/dictionary/embedded/dictionary.embedded.js +9 -4
  6. package/dist/models/dictionary/embedded/dictionary.embedded.js.map +1 -1
  7. package/dist/models/dictionary/interfaces/dictionary-embedded.interface.d.ts +1 -0
  8. package/dist/models/dtos/author.dto.js.map +1 -1
  9. package/dist/modules/dictionary/dictionary.module.d.ts +2 -0
  10. package/dist/modules/dictionary/dictionary.module.js +24 -0
  11. package/dist/modules/dictionary/dictionary.module.js.map +1 -0
  12. package/dist/modules/dictionary/dtos/dictionary-list.dto.d.ts +10 -0
  13. package/dist/modules/dictionary/dtos/dictionary-list.dto.js +59 -0
  14. package/dist/modules/dictionary/dtos/dictionary-list.dto.js.map +1 -0
  15. package/dist/modules/dictionary/services/dictionary.service.d.ts +18 -0
  16. package/dist/modules/dictionary/services/dictionary.service.js +137 -0
  17. package/dist/modules/dictionary/services/dictionary.service.js.map +1 -0
  18. package/dist/tsconfig.tsbuildinfo +1 -1
  19. package/package.json +4 -2
  20. package/src/index.ts +9 -1
  21. package/src/models/dictionary/embedded/dictionary.embedded.ts +7 -4
  22. package/src/models/dictionary/interfaces/dictionary-embedded.interface.ts +1 -0
  23. package/src/models/dtos/author.dto.ts +1 -1
  24. package/src/modules/dictionary/dictionary.module.ts +11 -0
  25. package/src/modules/dictionary/dtos/dictionary-list.dto.ts +46 -0
  26. package/src/modules/dictionary/services/dictionary.service.ts +177 -0
package/dist/index.d.ts CHANGED
@@ -86,4 +86,6 @@ import { Base } from './models/commons/schemas/base.schema';
86
86
  import { DictionaryEmbedded, DictionaryEmbeddedDocument, DictionaryEmbeddedSchema } from './models/dictionary/embedded/dictionary.embedded';
87
87
  import { IDictionaryEmbedded } from './models/dictionary/interfaces/dictionary-embedded.interface';
88
88
  import { IDictionaryEvent } from './models/dictionary/interfaces/dictionary-event.interface';
89
- export { IsMapOfStringsConstraint, IsRouteConstraint, IsMapOfStrings, IsRoute, HandledException, validationExceptionFactory, BaseExceptionsFilter, RecordDTO, StateParamDTO, RecordState, SortDirection, Sort, Page, SortPage, RESTSort, RESTPaging, RESTRequestBody, RESTPage, RESTResult, RESTError, RESTResponseBody, ConfigUtil, ISession, ISessionUserData, SessionClient, RedisService, SessionService, CacheModule, PermissionGuard, generateUUID, Permission, PermissionsIncludeStrategy, PermissionGuardConfig, ClientPermissions, ValidateMongoIdPipe, escapeRegex, translitGeorgiaToLatin, getRandomNumberFromRange, sizeOfJson, HTTPMethod, LogModule, LogService, LoggerClient, Env, ConsoleLogger, IAddress, Address, AddressSchema, AddressDocument, ClientType, IClient, ContactType, IContact, Contact, ContactSchema, ContactDocument, IGeoLocation, GeoLocation, GeoLocationSchema, GeoLocationDocument, II18n, I18n, I18nSchema, I18nDocument, IPermission, IPerson, Person, PersonSchema, PersonDocument, IRecord, Record, RecordSchema, RecordDocument, IRole, IUserClient, IUser, AuthorDTO, IAuthor, Author, AuthorSchema, IS3File, S3File, S3FileSchema, S3FileDocument, IFileLog, FileLog, FileLogSchema, FileLogDocument, IFileMeta, FileMeta, FileMetaSchema, FileMetaDocument, IFileRecord, FileRecord, FileRecordSchema, FileRecordDocument, IFileState, FileState, FileStateSchema, FileStateDocument, ILogInitiator, LogInitiator, LogInitiatorDocument, LogInitiatorSchema, IS3, S3, S3Document, S3Schema, S3FileState, IDictionarySetting, IDictionary, RESTQueryParams, IMongoPage, ResourceType, ICredentials, IProfInfo, generateSessionKeyword, generateUserClientKeyword, generateUserClientPermissionKeyword, getSortObj, I18nDTO, Base, IBase, DictionaryEmbeddedSchema, DictionaryEmbeddedDocument, DictionaryEmbedded, IDictionaryEmbedded, IDictionaryEvent, };
89
+ import { DictionaryModule } from './modules/dictionary/dictionary.module';
90
+ import { DictionaryService } from './modules/dictionary/services/dictionary.service';
91
+ export { IsMapOfStringsConstraint, IsRouteConstraint, IsMapOfStrings, IsRoute, HandledException, validationExceptionFactory, BaseExceptionsFilter, RecordDTO, StateParamDTO, RecordState, SortDirection, Sort, Page, SortPage, RESTSort, RESTPaging, RESTRequestBody, RESTPage, RESTResult, RESTError, RESTResponseBody, ConfigUtil, ISession, ISessionUserData, SessionClient, RedisService, SessionService, CacheModule, PermissionGuard, generateUUID, Permission, PermissionsIncludeStrategy, PermissionGuardConfig, ClientPermissions, ValidateMongoIdPipe, escapeRegex, translitGeorgiaToLatin, getRandomNumberFromRange, sizeOfJson, HTTPMethod, LogModule, LogService, LoggerClient, Env, ConsoleLogger, IAddress, Address, AddressSchema, AddressDocument, ClientType, IClient, ContactType, IContact, Contact, ContactSchema, ContactDocument, IGeoLocation, GeoLocation, GeoLocationSchema, GeoLocationDocument, II18n, I18n, I18nSchema, I18nDocument, IPermission, IPerson, Person, PersonSchema, PersonDocument, IRecord, Record, RecordSchema, RecordDocument, IRole, IUserClient, IUser, AuthorDTO, IAuthor, Author, AuthorSchema, IS3File, S3File, S3FileSchema, S3FileDocument, IFileLog, FileLog, FileLogSchema, FileLogDocument, IFileMeta, FileMeta, FileMetaSchema, FileMetaDocument, IFileRecord, FileRecord, FileRecordSchema, FileRecordDocument, IFileState, FileState, FileStateSchema, FileStateDocument, ILogInitiator, LogInitiator, LogInitiatorDocument, LogInitiatorSchema, IS3, S3, S3Document, S3Schema, S3FileState, IDictionarySetting, IDictionary, RESTQueryParams, IMongoPage, ResourceType, ICredentials, IProfInfo, generateSessionKeyword, generateUserClientKeyword, generateUserClientPermissionKeyword, getSortObj, I18nDTO, Base, IBase, DictionaryEmbeddedSchema, DictionaryEmbeddedDocument, DictionaryEmbedded, IDictionaryEmbedded, IDictionaryEvent, DictionaryModule, DictionaryService, };
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GeoLocation = exports.ContactSchema = exports.Contact = exports.ContactType = exports.ClientType = exports.AddressSchema = exports.Address = exports.ConsoleLogger = exports.Env = exports.LoggerClient = exports.LogService = exports.LogModule = exports.HTTPMethod = exports.sizeOfJson = exports.getRandomNumberFromRange = exports.translitGeorgiaToLatin = exports.escapeRegex = exports.ValidateMongoIdPipe = exports.ClientPermissions = exports.PermissionGuardConfig = exports.PermissionsIncludeStrategy = exports.Permission = exports.generateUUID = exports.PermissionGuard = exports.CacheModule = exports.SessionService = exports.RedisService = exports.SessionClient = exports.ConfigUtil = exports.RESTResponseBody = exports.RESTError = exports.RESTResult = exports.RESTPage = exports.RESTRequestBody = exports.RESTPaging = exports.RESTSort = exports.SortPage = exports.Page = exports.Sort = exports.SortDirection = exports.RecordState = exports.StateParamDTO = exports.RecordDTO = exports.BaseExceptionsFilter = exports.validationExceptionFactory = exports.HandledException = exports.IsRoute = exports.IsMapOfStrings = exports.IsRouteConstraint = exports.IsMapOfStringsConstraint = void 0;
4
- exports.DictionaryEmbedded = exports.DictionaryEmbeddedSchema = exports.Base = exports.I18nDTO = exports.getSortObj = exports.generateUserClientPermissionKeyword = exports.generateUserClientKeyword = exports.generateSessionKeyword = exports.ResourceType = exports.RESTQueryParams = exports.S3FileState = exports.S3Schema = exports.S3 = exports.LogInitiatorSchema = exports.LogInitiator = exports.FileStateSchema = exports.FileState = exports.FileRecordSchema = exports.FileRecord = exports.FileMetaSchema = exports.FileMeta = exports.FileLogSchema = exports.FileLog = exports.S3FileSchema = exports.S3File = exports.AuthorSchema = exports.Author = exports.AuthorDTO = exports.RecordSchema = exports.Record = exports.PersonSchema = exports.Person = exports.I18nSchema = exports.I18n = exports.GeoLocationSchema = void 0;
4
+ exports.DictionaryService = exports.DictionaryModule = exports.DictionaryEmbedded = exports.DictionaryEmbeddedSchema = exports.Base = exports.I18nDTO = exports.getSortObj = exports.generateUserClientPermissionKeyword = exports.generateUserClientKeyword = exports.generateSessionKeyword = exports.ResourceType = exports.RESTQueryParams = exports.S3FileState = exports.S3Schema = exports.S3 = exports.LogInitiatorSchema = exports.LogInitiator = exports.FileStateSchema = exports.FileState = exports.FileRecordSchema = exports.FileRecord = exports.FileMetaSchema = exports.FileMeta = exports.FileLogSchema = exports.FileLog = exports.S3FileSchema = exports.S3File = exports.AuthorSchema = exports.Author = exports.AuthorDTO = exports.RecordSchema = exports.Record = exports.PersonSchema = exports.Person = exports.I18nSchema = exports.I18n = exports.GeoLocationSchema = void 0;
5
5
  const is_map_of_strings_constraint_1 = require("./constraints/is-map-of-strings.constraint");
6
6
  Object.defineProperty(exports, "IsMapOfStringsConstraint", { enumerable: true, get: function () { return is_map_of_strings_constraint_1.IsMapOfStringsConstraint; } });
7
7
  const is_route_constraint_1 = require("./constraints/is-route.constraint");
@@ -147,4 +147,8 @@ Object.defineProperty(exports, "Base", { enumerable: true, get: function () { re
147
147
  const dictionary_embedded_1 = require("./models/dictionary/embedded/dictionary.embedded");
148
148
  Object.defineProperty(exports, "DictionaryEmbedded", { enumerable: true, get: function () { return dictionary_embedded_1.DictionaryEmbedded; } });
149
149
  Object.defineProperty(exports, "DictionaryEmbeddedSchema", { enumerable: true, get: function () { return dictionary_embedded_1.DictionaryEmbeddedSchema; } });
150
+ const dictionary_module_1 = require("./modules/dictionary/dictionary.module");
151
+ Object.defineProperty(exports, "DictionaryModule", { enumerable: true, get: function () { return dictionary_module_1.DictionaryModule; } });
152
+ const dictionary_service_1 = require("./modules/dictionary/services/dictionary.service");
153
+ Object.defineProperty(exports, "DictionaryService", { enumerable: true, get: function () { return dictionary_service_1.DictionaryService; } });
150
154
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,6FAAsF;AA8JpF,yGA9JO,uDAAwB,OA8JP;AA7J1B,2EAAsE;AA8Jp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OAwEP;AAvEN,yEAAgE;AA6G9D,2FA7GO,6BAAU,OA6GP;AA5GZ,+EAAsE;AA4KpE,6FA5KO,iCAAY,OA4KP;AA3Kd,6EAAoE;AA6GlE,4FA7GO,+BAAW,OA6GP;AA3Gb,8EAIiD;AAkG/C,wFArGA,0BAAO,OAqGA;AACP,8FArGA,gCAAa,OAqGA;AAlGf,4EAA8E;AAiI5E,uFAjIO,wBAAM,OAiIP;AACN,6FAlIe,8BAAY,OAkIf;AAjId,8EAIiD;AAmG/C,wFAtGA,0BAAO,OAsGA;AACP,8FAtGA,gCAAa,OAsGA;AAnGf,wFAIsD;AAkGpD,4FArGA,mCAAW,OAqGA;AACX,kGArGA,yCAAiB,OAqGA;AAlGnB,wEAI8C;AAiG5C,qFApGA,oBAAI,OAoGA;AACJ,2FApGA,0BAAU,OAoGA;AAjGZ,4EAIgD;AAiG9C,uFApGA,wBAAM,OAoGA;AACN,6FApGA,8BAAY,OAoGA;AAjGd,4EAIgD;AAgG9C,uFAnGA,wBAAM,OAmGA;AACN,6FAnGA,8BAAY,OAmGA;AA3Fd,2EAI8C;AAoI5C,uGAvIA,yCAAsB,OAuIA;AACtB,0GAvIA,4CAAyB,OAuIA;AACzB,oHAvIA,sDAAmC,OAuIA;AArIrC,2EAA8D;AAsI5D,2FAtIO,iCAAU,OAsIP;AArIZ,qDAAiD;AAsI/C,wFAtIO,kBAAO,OAsIP;AApIT,sEAA4D;AAqI1D,qFArIO,kBAAI,OAqIP;AApIN,0FAI0D;AAoIxD,mGAvIA,wCAAkB,OAuIA;AAFlB,yGAnIA,8CAAwB,OAmIA;AA/H1B,8EAA0E;AAoIxE,iGApIO,oCAAgB,OAoIP;AAnIlB,yFAAqF;AAoInF,kGApIO,sCAAiB,OAoIP"}
@@ -1,5 +1,5 @@
1
1
  import { HydratedDocument } from 'mongoose';
2
- import { mongo, Schema as MongooseSchema } from 'mongoose';
2
+ import { mongo } from 'mongoose';
3
3
  import { I18n } from '../../util/embedded/i18n.embedded';
4
4
  import { IDictionaryEmbedded } from '../interfaces/dictionary-embedded.interface';
5
5
  import { RecordState } from '../../util/enums/record-state.enum';
@@ -8,9 +8,10 @@ export declare class DictionaryEmbedded implements IDictionaryEmbedded {
8
8
  keyword: string;
9
9
  record: RecordState;
10
10
  originId: mongo.ObjectId;
11
+ originIds: mongo.ObjectId[];
11
12
  dictionaryId: mongo.ObjectId;
12
13
  }
13
- export declare const DictionaryEmbeddedSchema: MongooseSchema<DictionaryEmbedded, import("mongoose").Model<DictionaryEmbedded, any, any, any, import("mongoose").Document<unknown, any, DictionaryEmbedded> & DictionaryEmbedded & {
14
+ export declare const DictionaryEmbeddedSchema: import("mongoose").Schema<DictionaryEmbedded, import("mongoose").Model<DictionaryEmbedded, any, any, any, import("mongoose").Document<unknown, any, DictionaryEmbedded> & DictionaryEmbedded & {
14
15
  _id: import("mongoose").Types.ObjectId;
15
16
  }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, DictionaryEmbedded, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<DictionaryEmbedded>> & import("mongoose").FlatRecord<DictionaryEmbedded> & {
16
17
  _id: import("mongoose").Types.ObjectId;
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.DictionaryEmbeddedSchema = exports.DictionaryEmbedded = void 0;
13
13
  const mongoose_1 = require("@nestjs/mongoose");
14
14
  const mongoose_2 = require("mongoose");
15
+ const mongoose_3 = require("mongoose");
15
16
  const i18n_embedded_1 = require("../../util/embedded/i18n.embedded");
16
17
  const record_state_enum_1 = require("../../util/enums/record-state.enum");
17
18
  let DictionaryEmbedded = class DictionaryEmbedded {
@@ -30,12 +31,16 @@ __decorate([
30
31
  __metadata("design:type", String)
31
32
  ], DictionaryEmbedded.prototype, "record", void 0);
32
33
  __decorate([
33
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.ObjectId, required: false }),
34
- __metadata("design:type", mongoose_2.mongo.ObjectId)
34
+ (0, mongoose_1.Prop)({ type: mongoose_2.SchemaTypes.ObjectId, required: false }),
35
+ __metadata("design:type", mongoose_3.mongo.ObjectId)
35
36
  ], DictionaryEmbedded.prototype, "originId", void 0);
36
37
  __decorate([
37
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.ObjectId, required: false }),
38
- __metadata("design:type", mongoose_2.mongo.ObjectId)
38
+ (0, mongoose_1.Prop)({ type: [mongoose_2.SchemaTypes.ObjectId], required: false }),
39
+ __metadata("design:type", Array)
40
+ ], DictionaryEmbedded.prototype, "originIds", void 0);
41
+ __decorate([
42
+ (0, mongoose_1.Prop)({ type: mongoose_2.SchemaTypes.ObjectId, required: false }),
43
+ __metadata("design:type", mongoose_3.mongo.ObjectId)
39
44
  ], DictionaryEmbedded.prototype, "dictionaryId", void 0);
40
45
  exports.DictionaryEmbedded = DictionaryEmbedded = __decorate([
41
46
  (0, mongoose_1.Schema)({ _id: false })
@@ -1 +1 @@
1
- {"version":3,"file":"dictionary.embedded.js","sourceRoot":"","sources":["../../../../src/models/dictionary/embedded/dictionary.embedded.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA+D;AAE/D,uCAA2D;AAC3D,qEAAqE;AAErE,0EAAiE;AAG1D,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAe9B,CAAA;AAfY,gDAAkB;AAE7B;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,0BAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;8BACrC,oBAAI;iDAAC;AAGZ;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;mDACxB;AAGhB;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,+BAAW,EAAE,CAAC;;kDACvC;AAGpB;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,iBAAc,CAAC,QAAQ,EAAE,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CAAC;;qDAC5B;AAG5B;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,sBAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;8BACxC,gBAAK,CAAC,QAAQ;wDAAC;6BAjBlB,kBAAkB;IAD9B,IAAA,iBAAM,EAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;GACV,kBAAkB,CAkB9B;AAEY,QAAA,wBAAwB,GACnC,wBAAa,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC"}
@@ -3,6 +3,7 @@ import { II18n } from '../../util/interfaces/i18n.interface';
3
3
  import { RecordState } from '../../util/enums/record-state.enum';
4
4
  export interface IDictionaryEmbedded {
5
5
  originId: mongo.ObjectId;
6
+ originIds: mongo.ObjectId[];
6
7
  dictionaryId: mongo.ObjectId;
7
8
  title: II18n;
8
9
  keyword: string;
@@ -1 +1 @@
1
- {"version":3,"file":"author.dto.js","sourceRoot":"","sources":["../../../src/models/dtos/author.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAkE;AAElE,MAAa,SAAS;CAQrB;AARD,8BAQC;AALQ;IAFN,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;yCACU;AAItB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;2CACI"}
1
+ {"version":3,"file":"author.dto.js","sourceRoot":"","sources":["../../../src/models/dtos/author.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAkE;AAElE,MAAa,SAAS;CAQrB;AARD,8BAQC;AALC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;yCACG;AAIf;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;2CACI"}
@@ -0,0 +1,2 @@
1
+ export declare class DictionaryModule {
2
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.DictionaryModule = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const dictionary_service_1 = require("./services/dictionary.service");
12
+ const config_1 = require("@nestjs/config");
13
+ let DictionaryModule = class DictionaryModule {
14
+ };
15
+ exports.DictionaryModule = DictionaryModule;
16
+ exports.DictionaryModule = DictionaryModule = __decorate([
17
+ (0, common_1.Module)({
18
+ imports: [config_1.ConfigModule],
19
+ controllers: [],
20
+ providers: [dictionary_service_1.DictionaryService],
21
+ exports: [dictionary_service_1.DictionaryService],
22
+ })
23
+ ], DictionaryModule);
24
+ //# sourceMappingURL=dictionary.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dictionary.module.js","sourceRoot":"","sources":["../../../src/modules/dictionary/dictionary.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,sEAAkE;AAClE,2CAA8C;AAQvC,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAAG,CAAA;AAAnB,4CAAgB;2BAAhB,gBAAgB;IAN5B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,qBAAY,CAAC;QACvB,WAAW,EAAE,EAAE;QACf,SAAS,EAAE,CAAC,sCAAiB,CAAC;QAC9B,OAAO,EAAE,CAAC,sCAAiB,CAAC;KAC7B,CAAC;GACW,gBAAgB,CAAG"}
@@ -0,0 +1,10 @@
1
+ import { RecordState } from '../../../models/util/enums/record-state.enum';
2
+ export declare class DictionaryListDTO {
3
+ rootOnly: boolean;
4
+ keyword: string;
5
+ title: string;
6
+ parentId: string;
7
+ originId: string;
8
+ recordStates: RecordState[];
9
+ ids: string[];
10
+ }
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.DictionaryListDTO = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ const record_state_enum_1 = require("../../../models/util/enums/record-state.enum");
16
+ const toStringArray = (value) => {
17
+ return typeof value === 'string' ? [value] : value;
18
+ };
19
+ class DictionaryListDTO {
20
+ }
21
+ exports.DictionaryListDTO = DictionaryListDTO;
22
+ __decorate([
23
+ (0, class_validator_1.IsOptional)(),
24
+ (0, class_validator_1.IsBoolean)(),
25
+ __metadata("design:type", Boolean)
26
+ ], DictionaryListDTO.prototype, "rootOnly", void 0);
27
+ __decorate([
28
+ (0, class_validator_1.IsOptional)(),
29
+ (0, class_validator_1.IsString)(),
30
+ __metadata("design:type", String)
31
+ ], DictionaryListDTO.prototype, "keyword", void 0);
32
+ __decorate([
33
+ (0, class_validator_1.IsOptional)(),
34
+ (0, class_validator_1.IsString)(),
35
+ __metadata("design:type", String)
36
+ ], DictionaryListDTO.prototype, "title", void 0);
37
+ __decorate([
38
+ (0, class_validator_1.IsOptional)(),
39
+ (0, class_validator_1.IsMongoId)(),
40
+ __metadata("design:type", String)
41
+ ], DictionaryListDTO.prototype, "parentId", void 0);
42
+ __decorate([
43
+ (0, class_validator_1.IsOptional)(),
44
+ (0, class_validator_1.IsMongoId)(),
45
+ __metadata("design:type", String)
46
+ ], DictionaryListDTO.prototype, "originId", void 0);
47
+ __decorate([
48
+ (0, class_validator_1.IsOptional)(),
49
+ (0, class_validator_1.ArrayUnique)(),
50
+ (0, class_validator_1.IsEnum)(record_state_enum_1.RecordState, { each: true }),
51
+ (0, class_transformer_1.Transform)(({ value }) => toStringArray(value)),
52
+ __metadata("design:type", Array)
53
+ ], DictionaryListDTO.prototype, "recordStates", void 0);
54
+ __decorate([
55
+ (0, class_validator_1.IsOptional)(),
56
+ (0, class_validator_1.IsMongoId)({ each: true }),
57
+ __metadata("design:type", Array)
58
+ ], DictionaryListDTO.prototype, "ids", void 0);
59
+ //# sourceMappingURL=dictionary-list.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dictionary-list.dto.js","sourceRoot":"","sources":["../../../../src/modules/dictionary/dtos/dictionary-list.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAC9C,qDAOyB;AACzB,oFAA2E;AAE3E,MAAM,aAAa,GAAG,CAAC,KAAwB,EAAE,EAAE;IACjD,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AACrD,CAAC,CAAC;AAEF,MAAa,iBAAiB;CA8B7B;AA9BD,8CA8BC;AA3BC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;mDACM;AAIlB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;kDACK;AAIhB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;gDACG;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;mDACK;AAIjB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;mDACK;AAMjB;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,6BAAW,GAAE;IACb,IAAA,wBAAM,EAAC,+BAAW,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACnC,IAAA,6BAAS,EAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;;uDACnB;AAI5B;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;8CACZ"}
@@ -0,0 +1,18 @@
1
+ import { OnModuleInit } from '@nestjs/common';
2
+ import { ConfigService } from '@nestjs/config';
3
+ import { IDictionary } from '../../../models/dictionary/interfaces/dictionary.interface';
4
+ import { ObjectId } from 'mongoose';
5
+ import { DictionaryListDTO } from '../dtos/dictionary-list.dto';
6
+ export declare class DictionaryService implements OnModuleInit {
7
+ private _configService;
8
+ private dctUrl;
9
+ private _instance;
10
+ constructor(_configService: ConfigService);
11
+ validateRequest: () => void;
12
+ onModuleInit(): void;
13
+ findById(id: string | ObjectId): Promise<IDictionary>;
14
+ getEmbededDictionary(dictionary: any): any;
15
+ getEmbededDictionaries(dictionaries: any): any;
16
+ findByIds(ids: string[] | ObjectId[], embedded: true): Promise<any>;
17
+ list(filters: DictionaryListDTO, embedded: true): Promise<any>;
18
+ }
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.DictionaryService = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const config_1 = require("@nestjs/config");
15
+ const rest_wrapper_class_1 = require("../../../models/wrappers/rest-wrapper.class");
16
+ const qs = require("qs");
17
+ const axios_1 = require("axios");
18
+ const dictionary_list_dto_1 = require("../dtos/dictionary-list.dto");
19
+ const class_transformer_1 = require("class-transformer");
20
+ const class_validator_1 = require("class-validator");
21
+ const BASE_URL = 'DICTIONARY__API__BASE_URL';
22
+ let DictionaryService = class DictionaryService {
23
+ constructor(_configService) {
24
+ this._configService = _configService;
25
+ this.validateRequest = () => {
26
+ if (!this.dctUrl) {
27
+ throw new Error(`${BASE_URL} is not defined in the configuration`);
28
+ }
29
+ };
30
+ this._instance = axios_1.default.create({
31
+ baseURL: this._configService.get(BASE_URL),
32
+ timeout: 60000,
33
+ });
34
+ }
35
+ onModuleInit() {
36
+ this.dctUrl = this._configService.get(BASE_URL);
37
+ }
38
+ async findById(id) {
39
+ this.validateRequest();
40
+ try {
41
+ const response = await this._instance.get(`${this.dctUrl}/externals/v1/dictionaries/${id}`);
42
+ if (response.data.errors) {
43
+ if (response.data.errors.length === 0) {
44
+ throw new Error('UNKNOWN_ERROR');
45
+ }
46
+ throw new Error(response.data.errors[0].keyword);
47
+ }
48
+ return response.data.result.data;
49
+ }
50
+ catch (error) {
51
+ if (error instanceof rest_wrapper_class_1.RESTError) {
52
+ throw new Error(`DICTIONARY__API_ERROR. keyword: ${error.keyword}. statusCode: ${error.statusCode}`);
53
+ }
54
+ throw new Error(`DICTIONARY__API_ERROR: ${error.message}`);
55
+ }
56
+ }
57
+ getEmbededDictionary(dictionary) {
58
+ return this.getEmbededDictionaries([dictionary])[0];
59
+ }
60
+ getEmbededDictionaries(dictionaries) {
61
+ return dictionaries.map((v) => {
62
+ return {
63
+ originId: null,
64
+ dictionaryId: v._id,
65
+ title: v.title,
66
+ keyword: v.keyword,
67
+ record: v.keyword,
68
+ };
69
+ });
70
+ }
71
+ async findByIds(ids, embedded) {
72
+ this.validateRequest();
73
+ const query = qs.stringify({
74
+ ids,
75
+ });
76
+ try {
77
+ const response = await this._instance.get(`/externals/v1/dictionaries?${query}`);
78
+ console.log('status', response.status);
79
+ if (response.data.errors) {
80
+ if (response.data.errors.length === 0) {
81
+ throw new Error('UNKNOWN_ERROR');
82
+ }
83
+ throw new Error(response.data.errors[0].keyword);
84
+ }
85
+ if (embedded) {
86
+ return this.getEmbededDictionaries(response.data.result.data);
87
+ }
88
+ return response.data.result.data;
89
+ }
90
+ catch (error) {
91
+ console.log('error error');
92
+ if (error instanceof rest_wrapper_class_1.RESTError) {
93
+ throw new Error(`DICTIONARY__API_ERROR. keyword: ${error.keyword}. statusCode: ${error.statusCode}`);
94
+ }
95
+ if (error.data && error.data.errors) {
96
+ throw new Error(`DICTIONARY__API_ERROR. keyword: ${error.data.errors[0].keyword}. statusCode: ${error.statusCode}`);
97
+ }
98
+ throw new Error(`DICTIONARY__API_ERROR: ${error.message}`);
99
+ }
100
+ }
101
+ async list(filters, embedded) {
102
+ this.validateRequest();
103
+ const filtersInstance = (0, class_transformer_1.plainToInstance)(dictionary_list_dto_1.DictionaryListDTO, filters);
104
+ await (0, class_validator_1.validateOrReject)(filtersInstance);
105
+ const query = qs.stringify(filters);
106
+ try {
107
+ const response = await this._instance.get(`/externals/v1/dictionaries?${query}`);
108
+ console.log('status', response.status);
109
+ if (response.data.errors) {
110
+ if (response.data.errors.length === 0) {
111
+ throw new Error('UNKNOWN_ERROR');
112
+ }
113
+ throw new Error(response.data.errors[0].keyword);
114
+ }
115
+ if (embedded) {
116
+ return this.getEmbededDictionaries(response.data.result.data);
117
+ }
118
+ return response.data.result.data;
119
+ }
120
+ catch (error) {
121
+ console.log('error error');
122
+ if (error instanceof rest_wrapper_class_1.RESTError) {
123
+ throw new Error(`DICTIONARY__API_ERROR. keyword: ${error.keyword}. statusCode: ${error.statusCode}`);
124
+ }
125
+ if (error.data && error.data.errors) {
126
+ throw new Error(`DICTIONARY__API_ERROR. keyword: ${error.data.errors[0].keyword}. statusCode: ${error.statusCode}`);
127
+ }
128
+ throw new Error(`DICTIONARY__API_ERROR: ${error.message}`);
129
+ }
130
+ }
131
+ };
132
+ exports.DictionaryService = DictionaryService;
133
+ exports.DictionaryService = DictionaryService = __decorate([
134
+ (0, common_1.Injectable)(),
135
+ __metadata("design:paramtypes", [config_1.ConfigService])
136
+ ], DictionaryService);
137
+ //# sourceMappingURL=dictionary.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dictionary.service.js","sourceRoot":"","sources":["../../../../src/modules/dictionary/services/dictionary.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA0D;AAC1D,2CAA+C;AAE/C,oFAGqD;AAGrD,yBAAyB;AACzB,iCAA6C;AAE7C,qEAAgE;AAChE,yDAAoD;AACpD,qDAAmD;AAEnD,MAAM,QAAQ,GAAG,2BAA2B,CAAC;AAEtC,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAI5B,YAAoB,cAA6B;QAA7B,mBAAc,GAAd,cAAc,CAAe;QAOjD,oBAAe,GAAG,GAAG,EAAE;YACrB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;gBACjB,MAAM,IAAI,KAAK,CAAC,GAAG,QAAQ,sCAAsC,CAAC,CAAC;YACrE,CAAC;QACH,CAAC,CAAC;QAVA,IAAI,CAAC,SAAS,GAAG,eAAK,CAAC,MAAM,CAAC;YAC5B,OAAO,EAAE,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC;YAC1C,OAAO,EAAE,KAAK;SACf,CAAC,CAAC;IACL,CAAC;IAQD,YAAY;QACV,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,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