@diia-inhouse/providers 1.30.0

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 (30) hide show
  1. package/LICENCE.md +287 -0
  2. package/README.md +93 -0
  3. package/dist/index.js +19 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/interfaces/providers/drrp/index.js +70 -0
  6. package/dist/interfaces/providers/drrp/index.js.map +1 -0
  7. package/dist/interfaces/providers/drrp/publicServiceDrrpExtGroup.js +3 -0
  8. package/dist/interfaces/providers/drrp/publicServiceDrrpExtGroup.js.map +1 -0
  9. package/dist/interfaces/providers/drrp/publicServiceDrrpExtSearch.js +43 -0
  10. package/dist/interfaces/providers/drrp/publicServiceDrrpExtSearch.js.map +1 -0
  11. package/dist/interfaces/providers/drrp/publicServiceDrrpGetActualAtu.js +3 -0
  12. package/dist/interfaces/providers/drrp/publicServiceDrrpGetActualAtu.js.map +1 -0
  13. package/dist/interfaces/providers/index.js +21 -0
  14. package/dist/interfaces/providers/index.js.map +1 -0
  15. package/dist/providers/drrp/index.js +373 -0
  16. package/dist/providers/drrp/index.js.map +1 -0
  17. package/dist/providers/index.js +18 -0
  18. package/dist/providers/index.js.map +1 -0
  19. package/dist/types/index.d.ts +2 -0
  20. package/dist/types/interfaces/providers/drrp/index.d.ts +168 -0
  21. package/dist/types/interfaces/providers/drrp/publicServiceDrrpExtGroup.d.ts +54 -0
  22. package/dist/types/interfaces/providers/drrp/publicServiceDrrpExtSearch.d.ts +144 -0
  23. package/dist/types/interfaces/providers/drrp/publicServiceDrrpGetActualAtu.d.ts +7 -0
  24. package/dist/types/interfaces/providers/index.d.ts +4 -0
  25. package/dist/types/providers/drrp/index.d.ts +41 -0
  26. package/dist/types/providers/index.d.ts +1 -0
  27. package/dist/types/validation/drrp/index.d.ts +7 -0
  28. package/dist/validation/drrp/index.js +26 -0
  29. package/dist/validation/drrp/index.js.map +1 -0
  30. package/package.json +78 -0
@@ -0,0 +1,144 @@
1
+ import { DrrpError, RealtyAddress, RealtyLimitation, RealtyMortgage, RealtyProperty, RealtyState, RealtyType } from '.';
2
+ export declare enum DrrpSearchType {
3
+ Object = "1",
4
+ Subject = "2"
5
+ }
6
+ export declare enum DrrpSearchAlgorithm {
7
+ Partial = "1",
8
+ Complete = "2"
9
+ }
10
+ export interface PublicServiceDrrpExtSearchRequest {
11
+ entity: 'rrpExch_external';
12
+ method: 'search';
13
+ searchParams: PublicServiceDrrpSubjectRequest | PublicServiceDrrpObjectRequest;
14
+ }
15
+ export interface PublicServiceDrrpExtSearchResponse {
16
+ entity: 'rrpExch_external';
17
+ method: 'search';
18
+ resultID: number;
19
+ ID: number;
20
+ resultData: string;
21
+ resultMessage?: string;
22
+ }
23
+ export interface DrrpSearchSubjectInfo {
24
+ sbjType: string;
25
+ sbjName?: string;
26
+ sbjCode?: string;
27
+ seriesNum?: string;
28
+ idEddr?: string;
29
+ codeAbsence?: string;
30
+ dcSearchAlgorithm?: DrrpSearchAlgorithm;
31
+ dcSbjRlNames?: string;
32
+ }
33
+ export interface PublicServiceDrrpSubjectRequest {
34
+ isShowHistoricalNames: boolean;
35
+ isSuspend?: boolean;
36
+ searchType: DrrpSearchType.Subject;
37
+ subjectSearchInfo: DrrpSearchSubjectInfo;
38
+ }
39
+ export declare enum DcGroupType {
40
+ Apartment = "1",
41
+ LandPlot = "2"
42
+ }
43
+ export declare enum DcHouseType {
44
+ House = "1",
45
+ LandPlot = "2"
46
+ }
47
+ export declare enum DcBuildingType {
48
+ Building = "1",
49
+ Section = "2"
50
+ }
51
+ export declare enum DcObjectNumType {
52
+ Garage = "1",
53
+ Apartment = "2",
54
+ Room = "3",
55
+ Quartets = "4",
56
+ Block = "5",
57
+ Section = "6"
58
+ }
59
+ export declare enum DcRoomType {
60
+ Room = "1",
61
+ Quartets = "2"
62
+ }
63
+ export interface DrrpGroupResultItem {
64
+ ID: number;
65
+ dcGroupType: DcGroupType;
66
+ name: string;
67
+ addressDetail?: DrrpGroupResultAddressDetail[];
68
+ }
69
+ export interface DrrpGroupResultAddressDetail {
70
+ atuAtuID: number;
71
+ house?: string;
72
+ dcHouseType?: DcHouseType | string;
73
+ building?: string;
74
+ dcBuildingType?: DcBuildingType | string;
75
+ objectNum?: string;
76
+ dcObjectNumType?: DcObjectNumType | string;
77
+ room?: string;
78
+ dcRoomType?: DcRoomType | string;
79
+ }
80
+ interface PublicServiceDrrpSubjectFailedResponse {
81
+ error: DrrpError;
82
+ }
83
+ interface PublicServiceDrrpSubjectSuccessResponse {
84
+ reportResultID: number;
85
+ groupResult: DrrpGroupResultItem[];
86
+ }
87
+ export type PublicServiceDrrpSubjectResponse = PublicServiceDrrpSubjectFailedResponse | PublicServiceDrrpSubjectSuccessResponse;
88
+ export interface DrrpSearchObjectInfo {
89
+ realtyRnNum?: string;
90
+ cadNum?: string;
91
+ objectIdentifier?: string;
92
+ realtyAddressInfo?: {
93
+ atuID?: number;
94
+ houseType?: DcHouseType;
95
+ house?: string;
96
+ buildingType?: DcBuildingType;
97
+ building?: string;
98
+ objectNumType?: string;
99
+ objectNum?: string;
100
+ roomType?: string;
101
+ room?: string;
102
+ };
103
+ }
104
+ export interface PublicServiceDrrpObjectRequest {
105
+ isShowHistoricalNames: boolean;
106
+ isSuspend?: boolean;
107
+ searchType: DrrpSearchType.Object;
108
+ objectSearchInfo: DrrpSearchObjectInfo;
109
+ }
110
+ export interface Realty {
111
+ regNum: string;
112
+ regDate: string;
113
+ dcReTypeOnm: string;
114
+ reType: RealtyType | string;
115
+ reTypeExtension?: string;
116
+ reSubType?: string;
117
+ reSubTypeExtension?: string;
118
+ reState: RealtyState;
119
+ Cost?: number;
120
+ isResidentialBuilding: '0' | '1';
121
+ sectionType: string;
122
+ region: string;
123
+ techDescription?: string;
124
+ area?: number;
125
+ livingArea?: number;
126
+ readinessPercent?: number;
127
+ objectIdentifier?: string;
128
+ additional?: string;
129
+ properties: RealtyProperty[];
130
+ realtyAddress: RealtyAddress[];
131
+ limitation?: RealtyLimitation[];
132
+ mortgage?: RealtyMortgage[];
133
+ }
134
+ export interface PublicServiceDrrpObjectResponse {
135
+ realty: Realty[];
136
+ oldRealty: unknown[];
137
+ oldMortgageJson: unknown[];
138
+ oldLimitationJson: unknown[];
139
+ }
140
+ export interface SubjectInfoResult {
141
+ reportResultID: number;
142
+ groupResult: DrrpGroupResultItem[];
143
+ }
144
+ export {};
@@ -0,0 +1,7 @@
1
+ export interface PublicServiceDrrpActualAtuIdRequest {
2
+ atuID: number;
3
+ }
4
+ export interface PublicServiceDrrpActualAtuIdResponse {
5
+ atuID?: number;
6
+ actualAtuID?: number[];
7
+ }
@@ -0,0 +1,4 @@
1
+ export * from './drrp';
2
+ export * from './drrp/publicServiceDrrpExtGroup';
3
+ export * from './drrp/publicServiceDrrpExtSearch';
4
+ export * from './drrp/publicServiceDrrpGetActualAtu';
@@ -0,0 +1,41 @@
1
+ import { ExternalCommunicator } from '@diia-inhouse/diia-queue';
2
+ import { Logger } from '@diia-inhouse/types';
3
+ import { DrrpConfig, DrrpExtSearchRequestOptions, DrrpRequestOptions, OwnershipType, PropertyOwnerInfo, RealtyProperty } from '../../interfaces/providers/drrp';
4
+ import { SubjectInfoClarifyingResult } from '../../interfaces/providers/drrp/publicServiceDrrpExtGroup';
5
+ import { Realty, SubjectInfoResult } from '../../interfaces/providers/drrp/publicServiceDrrpExtSearch';
6
+ export declare class DrrpProvider {
7
+ private readonly logger;
8
+ private readonly external;
9
+ private readonly drrpConfig;
10
+ constructor(logger: Logger, external: ExternalCommunicator, drrpConfig?: DrrpConfig);
11
+ getSubjectInfo(itn: string, ops?: DrrpExtSearchRequestOptions): Promise<SubjectInfoResult>;
12
+ getSubjectInfoClarifying(reportResultId: number, groupId: number, ops?: DrrpRequestOptions): Promise<SubjectInfoClarifyingResult>;
13
+ getObjectInfo(realtyId: string, ops?: DrrpExtSearchRequestOptions): Promise<Realty | undefined>;
14
+ getActualAtuId(atuId: number, ops?: DrrpRequestOptions): Promise<number>;
15
+ getActualAtuIds(atuId: number, ops?: DrrpRequestOptions): Promise<number[]>;
16
+ /** @deprecated use getOwnershipType */
17
+ isSoleOwner(owners: Pick<RealtyProperty, 'prCommonKind' | 'subjects' | 'partSize'>[]): boolean;
18
+ /** @deprecated use isInvalidOwnersData */
19
+ checkOwnersShares(owners: Pick<RealtyProperty, 'partSize' | 'prCommonKind'>[]): boolean;
20
+ /**
21
+ * @see {@link https://diia.atlassian.net/wiki/spaces/DIIA/pages/1283620916/BRD.036001002.+.v.01.001#5.2.1-%D0%86%D0%BD%D1%84%D0%BE%D1%80%D0%BC%D1%83%D0%B2%D0%B0%D0%BD%D0%BD%D1%8F-%D0%BA%D0%BE%D1%80%D0%B8%D1%81%D1%82%D1%83%D0%B2%D0%B0%D1%87%D0%B0-%D0%BF%D1%80%D0%BE-%D0%BD%D0%B5%D0%BC%D0%BE%D0%B6%D0%BB%D0%B8%D0%B2%D1%96%D1%81%D1%82%D1%8C-%D0%BF%D0%BE%D0%B4%D0%B0%D1%87%D1%96-%D0%B7%D0%B0%D1%8F%D0%B2%D0%B8%2C-%D1%87%D0%B5%D1%80%D0%B5%D0%B7-%D0%B2%D1%96%D0%B4%D1%81%D1%83%D1%82%D0%BD%D1%96%D1%81%D1%82%D1%8C-%D0%B2-%D0%94%D0%A0%D0%A0%D0%9F-%D0%B2%D1%96%D0%B4%D0%BE%D0%BC%D0%BE%D1%81%D1%82%D0%B5%D0%B9%2C-%D1%89%D0%BE%D0%B4%D0%BE-%D0%B2%D1%81%D1%96%D1%85-%D1%81%D0%BF%D1%96%D0%B2%D0%B2%D0%BB%D0%B0%D1%81%D0%BD%D0%B8%D0%BA%D1%96%D0%B2 documentation page}
22
+ */
23
+ isInvalidOwnersData(realty: Realty): boolean;
24
+ extractIndividualOwners(realty: Realty): PropertyOwnerInfo[];
25
+ getOwnershipType(realty: Realty, itn: string, invalidDataProcessCode?: number): OwnershipType | never;
26
+ /**
27
+ * @see {@link https://diia.atlassian.net/wiki/spaces/DIIA/pages/1283620916/BRD.036001002.+.v.01.001#5.3.2-%D0%92%D0%B8%D0%B7%D0%BD%D0%B0%D1%87%D0%B5%D0%BD%D0%BD%D1%8F%2C-%D1%89%D0%BE-%D0%B7%D0%B0%D1%8F%D0%B2%D0%BD%D0%B8%D0%BA-%D1%94-%D0%BE%D0%B4%D0%BD%D0%BE%D0%BE%D1%81%D1%96%D0%B1%D0%BD%D0%B8%D0%BC-%D0%B2%D0%BB%D0%B0%D1%81%D0%BD%D0%B8%D0%BA%D0%BE%D0%BC-%D0%BE%D0%B1%D1%80%D0%B0%D0%BD%D0%BE%D0%B3%D0%BE-%D0%BE%D0%B1%CA%BC%D1%94%D0%BA%D1%82%D0%B0-%D0%BD%D0%B5%D1%80%D1%83%D1%85%D0%BE%D0%BC%D0%BE%D1%81%D1%82%D1%96 documentation page}
28
+ */
29
+ private isSingleOwnershipType;
30
+ /**
31
+ * @see {@link https://diia.atlassian.net/wiki/spaces/DIIA/pages/1283620916/BRD.036001002.+.v.01.001#5.3.3-%D0%92%D1%96%D0%B4%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%BD%D1%8F-%D0%B5%D0%BA%D1%80%D0%B0%D0%BD%D0%B0-%E2%80%9C%D0%A1%D0%BF%D1%96%D0%B2%D0%B2%D0%BB%D0%B0%D1%81%D0%BD%D0%B8%D0%BA%D0%B8-%D0%BC%D0%B0%D0%B9%D0%BD%D0%B0%E2%80%9C--%D1%83-%D1%81%D1%82%D0%B0%D0%BD%D1%96-%D0%BF%D1%96%D0%B4%D1%82%D0%B2%D0%B5%D1%80%D0%B4%D0%B6%D0%B5%D0%BD%D0%BD%D1%8F-%D0%BF%D0%B5%D1%80%D0%B5%D0%BB%D1%96%D0%BA%D1%83-%D1%81%D0%BF%D1%96%D0%B2%D0%B2%D0%BB%D0%B0%D1%81%D0%BD%D0%B8%D0%BA%D1%96%D0%B2-%D0%BC%D0%B0%D0%B9%D0%BD%D0%B0 documentation page}
32
+ */
33
+ private isCommonSharedOwnershipType;
34
+ /**
35
+ * @see {@link https://diia.atlassian.net/wiki/spaces/DIIA/pages/1283620916/BRD.036001002.+.v.01.001#5.3.4-%D0%92%D1%96%D0%B4%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%BD%D1%8F-%D0%B5%D0%BA%D1%80%D0%B0%D0%BD%D0%B0-%E2%80%9C%D0%A1%D0%BF%D1%96%D0%B2%D0%B2%D0%BB%D0%B0%D1%81%D0%BD%D0%B8%D0%BA%D0%B8-%D0%BC%D0%B0%D0%B9%D0%BD%D0%B0%E2%80%9C--%D1%83-%D1%81%D1%82%D0%B0%D0%BD%D1%96-%D0%B2%D0%B8%D0%B1%D0%BE%D1%80%D1%83-%D1%82%D0%B8%D0%BF%D0%B0-%D0%B7%D0%B0%D1%8F%D0%B2%D0%B8-(%D0%BE%D0%B4%D0%BD%D0%BE%D0%BE%D1%81%D1%96%D0%B1%D0%BD%D0%B0-%D0%B0%D0%B1%D0%BE-%D1%81%D0%BF%D1%96%D0%BB%D1%8C%D0%BD%D0%B0) documentation page}
36
+ */
37
+ private isCommonPartialOwnershipType;
38
+ private countPartSizeSum;
39
+ private makeExtSearchRequest;
40
+ private request;
41
+ }
@@ -0,0 +1 @@
1
+ export * from './drrp';
@@ -0,0 +1,7 @@
1
+ import { ValidationSchema } from '@diia-inhouse/validators';
2
+ import { PublicServiceDrrpExtGroupResponse } from '../../interfaces/providers/drrp/publicServiceDrrpExtGroup';
3
+ import { PublicServiceDrrpExtSearchResponse } from '../../interfaces/providers/drrp/publicServiceDrrpExtSearch';
4
+ import { PublicServiceDrrpActualAtuIdResponse } from '../../interfaces/providers/drrp/publicServiceDrrpGetActualAtu';
5
+ export declare const drrpExtGroupResultValidationSchema: ValidationSchema<PublicServiceDrrpExtGroupResponse>;
6
+ export declare const drrpExtSearchResultValidationSchema: ValidationSchema<PublicServiceDrrpExtSearchResponse>;
7
+ export declare const drrpActualAtuValidationSchema: ValidationSchema<PublicServiceDrrpActualAtuIdResponse>;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.drrpActualAtuValidationSchema = exports.drrpExtSearchResultValidationSchema = exports.drrpExtGroupResultValidationSchema = void 0;
4
+ exports.drrpExtGroupResultValidationSchema = {
5
+ resultData: { type: 'string' },
6
+ resultMessage: { type: 'string', optional: true },
7
+ entity: { type: 'string' },
8
+ method: { type: 'string' },
9
+ reportResultID: { type: 'number' },
10
+ groupID: { type: 'number' },
11
+ resultID: { type: 'number' },
12
+ ID: { type: 'number' },
13
+ };
14
+ exports.drrpExtSearchResultValidationSchema = {
15
+ resultData: { type: 'string' },
16
+ resultMessage: { type: 'string', optional: true },
17
+ entity: { type: 'string' },
18
+ method: { type: 'string' },
19
+ resultID: { type: 'number' },
20
+ ID: { type: 'number' },
21
+ };
22
+ exports.drrpActualAtuValidationSchema = {
23
+ atuID: { type: 'number', optional: true },
24
+ actualAtuID: { type: 'array', optional: true, items: 'number' },
25
+ };
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/validation/drrp/index.ts"],"names":[],"mappings":";;;AAMa,QAAA,kCAAkC,GAAwD;IACnG,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC9B,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;IACjD,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC1B,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC1B,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAClC,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC3B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC5B,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;CACzB,CAAA;AAEY,QAAA,mCAAmC,GAAyD;IACrG,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC9B,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;IACjD,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC1B,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC1B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC5B,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;CACzB,CAAA;AAEY,QAAA,6BAA6B,GAA2D;IACjG,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;IACzC,WAAW,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE;CAClE,CAAA"}
package/package.json ADDED
@@ -0,0 +1,78 @@
1
+ {
2
+ "name": "@diia-inhouse/providers",
3
+ "version": "1.30.0",
4
+ "description": "common providers",
5
+ "author": "Diia",
6
+ "main": "dist/index.js",
7
+ "types": "dist/types/index.d.ts",
8
+ "engines": {
9
+ "node": ">=18"
10
+ },
11
+ "scripts": {
12
+ "build": "tsc",
13
+ "prebuild": "rimraf dist",
14
+ "prepare": "npm run build",
15
+ "semantic-release": "semantic-release",
16
+ "start": "npm run build && node dist/index.js",
17
+ "lint": "eslint --ext .ts . && prettier --check .",
18
+ "lint-fix": "eslint --ext .ts --fix && prettier --write .",
19
+ "lint:lockfile": "lockfile-lint --path package-lock.json --allowed-hosts registry.npmjs.org --validate-https",
20
+ "test": "jest",
21
+ "test:unit": "npm run test --selectProjects unit --",
22
+ "test:coverage": "npm run test --selectProjects unit --coverage --",
23
+ "find-circulars": "madge --circular --extensions ts ./"
24
+ },
25
+ "files": [
26
+ "dist"
27
+ ],
28
+ "keywords": [],
29
+ "dependencies": {
30
+ "@diia-inhouse/diia-logger": "2.15.0",
31
+ "@diia-inhouse/diia-queue": "7.3.0",
32
+ "@diia-inhouse/env": "1.16.0",
33
+ "@diia-inhouse/errors": "1.9.0",
34
+ "@diia-inhouse/redis": "2.12.0",
35
+ "@diia-inhouse/types": "6.24.0",
36
+ "@diia-inhouse/utils": "3.5.0",
37
+ "@diia-inhouse/validators": "1.17.0",
38
+ "lodash": "4.17.21",
39
+ "math-expression-evaluator": "2.0.4",
40
+ "type-fest": "4.18.2"
41
+ },
42
+ "devDependencies": {
43
+ "@diia-inhouse/configs": "1.31.1",
44
+ "@diia-inhouse/diia-metrics": "3.11.0",
45
+ "@diia-inhouse/eslint-config": "5.1.0",
46
+ "@diia-inhouse/test": "6.3.0",
47
+ "@types/lodash": "4.14.201",
48
+ "jest-mock-extended": "3.0.5",
49
+ "lockfile-lint": "4.13.2",
50
+ "madge": "7.0.0",
51
+ "protobufjs": "7.2.5",
52
+ "rimraf": "5.0.7"
53
+ },
54
+ "jest": {
55
+ "preset": "@diia-inhouse/configs/dist/jest"
56
+ },
57
+ "commitlint": {
58
+ "extends": "@diia-inhouse/configs/dist/commitlint"
59
+ },
60
+ "eslintConfig": {
61
+ "extends": "@diia-inhouse/eslint-config",
62
+ "parserOptions": {
63
+ "project": [
64
+ "./tsconfig.json",
65
+ "./tests/tsconfig.json"
66
+ ]
67
+ }
68
+ },
69
+ "release": {
70
+ "extends": "@diia-inhouse/configs/dist/semantic-release/package",
71
+ "branches": [
72
+ "main"
73
+ ]
74
+ },
75
+ "prettier": "@diia-inhouse/eslint-config/prettier",
76
+ "repository": "https://github.com/diia-open-source/be-pkg-providers.git",
77
+ "licence": "SEE LICENCE IN LICENCE.md"
78
+ }