FE-831: Kontur.Focus module (#16)

This commit is contained in:
Rinat Arsaev 2019-05-06 13:53:24 +03:00 committed by GitHub
parent 24174d66fe
commit 18b96140f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 642 additions and 13 deletions

4
.gitignore vendored
View File

@ -37,6 +37,7 @@ npm-debug.log
yarn-error.log
testem.log
/typings
/*.log
# System Files
.DS_Store
@ -45,3 +46,6 @@ Thumbs.db
# Swagger Codegen
swagger-codegen-cli.jar
src/app/api/**/swagger-codegen
# Kontur.Focus Model
src/app/kontur-focus/**/gen-model

View File

@ -6,3 +6,5 @@ build_utils
coverage
src/app/api/**/swagger-codegen
schemes
src/app/**/gen-model

View File

@ -26,7 +26,7 @@ BUILD_IMAGE_TAG := f3732d29a5e622aabf80542b5138b3631a726adb
GIT_SSH_COMMAND :=
DOCKER_RUN_OPTS = -e GIT_SSH_COMMAND='$(GIT_SSH_COMMAND)'
CALL_W_CONTAINER := init check lint test build clean submodules
CALL_W_CONTAINER := init check lint test build clean submodules compile
.PHONY: $(CALL_W_CONTAINER)
@ -41,7 +41,9 @@ $(SUBTARGETS): %/.git: %
submodules: $(SUBTARGETS)
init: swagger-compile
init: npm-init compile
npm-init:
npm ci
build: check lint
@ -61,12 +63,23 @@ test:
SWAGGER_SWAG_V3_DIR = 'src/app/api/capi/swagger-codegen'
SWAGGER_CLI = 'swagger-codegen-cli.jar'
swagger-init:
wget http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.4/swagger-codegen-cli-2.4.4.jar -O $(SWAGGER_CLI)
swagger-clean:
rm -rf $(SWAGGER_SWAG_V3_DIR)
swagger-compile: swagger-init swagger-clean
swagger-compile:
java -jar $(SWAGGER_CLI) generate -l typescript-angular --additional-properties ngVersion=7 -i schemes/swag/v3/swagger.yaml -o $(SWAGGER_SWAG_V3_DIR)
swagger: swagger-init swagger-clean swagger-compile
KONTUR_FOCUS_MODEL_DIR = src/app/kontur-focus/gen-model
KONTUR_FOCUS_API = req req/mon monList analytics contacts egrDetails egrDetails/mon licences buh fssp govPurchasesOfParticipant govPurchasesOfCustomer stat
kontur-focus-clean:
rm -rf $(KONTUR_FOCUS_MODEL_DIR)
kontur-focus-compile:
$(foreach req,$(KONTUR_FOCUS_API),\
mkdir -p $(shell dirname $(KONTUR_FOCUS_MODEL_DIR)/$(req).ts);\
npm run quicktype -- https://focus-api.kontur.ru/api3/$(req)/schema -o $(KONTUR_FOCUS_MODEL_DIR)/$(req).ts;\
)
kontur-focus: kontur-focus-clean kontur-focus-compile
compile: swagger kontur-focus

View File

@ -18,7 +18,7 @@ npm ci
# Generate swagger
make wc_shell
make swagger-compile
make compile
```
## Development server

494
package-lock.json generated
View File

@ -707,6 +707,23 @@
"integrity": "sha512-gxpEUhTS1sGA63EGQGuA+WESPR/6tz6ng7tSHFCmaTJK/cGK8y37cBTspX+U2xCAue2IQVvF6Z0oigmjwD8YGQ==",
"dev": true
},
"@babel/runtime": {
"version": "7.4.4",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.4.tgz",
"integrity": "sha512-w0+uT71b6Yi7i5SE0co4NioIpSYS6lLiXvCzWzGSKvpK5vdQtCbICHMj+gbAKAOtxiV6HsVh/MBdaF9EQ6faSg==",
"dev": true,
"requires": {
"regenerator-runtime": "^0.13.2"
},
"dependencies": {
"regenerator-runtime": {
"version": "0.13.2",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz",
"integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==",
"dev": true
}
}
},
"@babel/template": {
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.0.tgz",
@ -777,6 +794,236 @@
}
}
},
"@mark.probst/typescript-json-schema": {
"version": "0.32.0",
"resolved": "https://registry.npmjs.org/@mark.probst/typescript-json-schema/-/typescript-json-schema-0.32.0.tgz",
"integrity": "sha512-OoD+5D7Mka80FIcmvPyuAKV7g5Of5S04R74S4DTAG8pr9REDWySUh9pOloro7SNFwWt/+2f90wyP+DtGHykVfg==",
"dev": true,
"requires": {
"glob": "~7.1.3",
"json-stable-stringify": "^1.0.1",
"typescript": "~3.2.1",
"yargs": "^12.0.5"
},
"dependencies": {
"ansi-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
"dev": true
},
"camelcase": {
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
"dev": true
},
"cliui": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz",
"integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==",
"dev": true,
"requires": {
"string-width": "^2.1.1",
"strip-ansi": "^4.0.0",
"wrap-ansi": "^2.0.0"
}
},
"cross-spawn": {
"version": "6.0.5",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
"integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
"dev": true,
"requires": {
"nice-try": "^1.0.4",
"path-key": "^2.0.1",
"semver": "^5.5.0",
"shebang-command": "^1.2.0",
"which": "^1.2.9"
}
},
"execa": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
"integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
"dev": true,
"requires": {
"cross-spawn": "^6.0.0",
"get-stream": "^4.0.0",
"is-stream": "^1.1.0",
"npm-run-path": "^2.0.0",
"p-finally": "^1.0.0",
"signal-exit": "^3.0.0",
"strip-eof": "^1.0.0"
}
},
"find-up": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
"integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
"dev": true,
"requires": {
"locate-path": "^3.0.0"
}
},
"get-stream": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
"integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
"dev": true,
"requires": {
"pump": "^3.0.0"
}
},
"invert-kv": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz",
"integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==",
"dev": true
},
"is-fullwidth-code-point": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
"integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
"dev": true
},
"lcid": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz",
"integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==",
"dev": true,
"requires": {
"invert-kv": "^2.0.0"
}
},
"locate-path": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
"integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
"dev": true,
"requires": {
"p-locate": "^3.0.0",
"path-exists": "^3.0.0"
}
},
"os-locale": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz",
"integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==",
"dev": true,
"requires": {
"execa": "^1.0.0",
"lcid": "^2.0.0",
"mem": "^4.0.0"
}
},
"p-limit": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz",
"integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==",
"dev": true,
"requires": {
"p-try": "^2.0.0"
}
},
"p-locate": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
"integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
"dev": true,
"requires": {
"p-limit": "^2.0.0"
}
},
"p-try": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
"dev": true
},
"pump": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
"integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
"dev": true,
"requires": {
"end-of-stream": "^1.1.0",
"once": "^1.3.1"
}
},
"string-width": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
"integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
"dev": true,
"requires": {
"is-fullwidth-code-point": "^2.0.0",
"strip-ansi": "^4.0.0"
}
},
"strip-ansi": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
"integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
"dev": true,
"requires": {
"ansi-regex": "^3.0.0"
}
},
"typescript": {
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.4.tgz",
"integrity": "sha512-0RNDbSdEokBeEAkgNbxJ+BLwSManFy9TeXz8uW+48j/xhEXv1ePME60olyzw2XzUqUBNAYFeJadIqAgNqIACwg==",
"dev": true
},
"which-module": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
"integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=",
"dev": true
},
"yargs": {
"version": "12.0.5",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz",
"integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==",
"dev": true,
"requires": {
"cliui": "^4.0.0",
"decamelize": "^1.2.0",
"find-up": "^3.0.0",
"get-caller-file": "^1.0.1",
"os-locale": "^3.0.0",
"require-directory": "^2.1.1",
"require-main-filename": "^1.0.1",
"set-blocking": "^2.0.0",
"string-width": "^2.0.0",
"which-module": "^2.0.0",
"y18n": "^3.2.1 || ^4.0.0",
"yargs-parser": "^11.1.1"
}
},
"yargs-parser": {
"version": "11.1.1",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz",
"integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==",
"dev": true,
"requires": {
"camelcase": "^5.0.0",
"decamelize": "^1.2.0"
}
}
}
},
"@mark.probst/unicode-properties": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@mark.probst/unicode-properties/-/unicode-properties-1.1.0.tgz",
"integrity": "sha512-7AQsO0hMmpqDledV7AhBuSYqYPFsKP9PaltMecX9nlnsyFxqtsqUg9/pvB2L/jxvskrDrNkdKYz2KTbQznCtng==",
"dev": true,
"requires": {
"brfs": "^1.4.0",
"unicode-trie": "^0.3.0"
}
},
"@ngtools/webpack": {
"version": "7.1.4",
"resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-7.1.4.tgz",
@ -1549,6 +1796,15 @@
"integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=",
"dev": true
},
"array-back": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz",
"integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==",
"dev": true,
"requires": {
"typical": "^2.6.1"
}
},
"array-find-index": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz",
@ -2661,6 +2917,12 @@
}
}
},
"collection-utils": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/collection-utils/-/collection-utils-1.0.1.tgz",
"integrity": "sha512-LA2YTIlR7biSpXkKYwwuzGjwL5rjWEZVOSnvdUc7gObvWe4WkjxOpfrdhoP7Hs09YWDVfg0Mal9BpAqLfVEzQg==",
"dev": true
},
"collection-visit": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz",
@ -2710,6 +2972,29 @@
"delayed-stream": "~1.0.0"
}
},
"command-line-args": {
"version": "4.0.7",
"resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-4.0.7.tgz",
"integrity": "sha512-aUdPvQRAyBvQd2n7jXcsMDz68ckBJELXNzBybCHOibUWEg0mWTnaYCSRU8h9R+aNRSvDihJtssSRCiDRpLaezA==",
"dev": true,
"requires": {
"array-back": "^2.0.0",
"find-replace": "^1.0.3",
"typical": "^2.6.1"
}
},
"command-line-usage": {
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-5.0.5.tgz",
"integrity": "sha512-d8NrGylA5oCXSbGoKz05FkehDAzSmIm4K03S5VDh4d5lZAtTWfc3D1RuETtuQCn8129nYfJfDdF7P/lwcz1BlA==",
"dev": true,
"requires": {
"array-back": "^2.0.0",
"chalk": "^2.4.1",
"table-layout": "^0.4.3",
"typical": "^2.6.1"
}
},
"commander": {
"version": "2.20.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz",
@ -3230,6 +3515,12 @@
"resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz",
"integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU="
},
"deep-extend": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
"dev": true
},
"deep-is": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
@ -4258,6 +4549,27 @@
"pkg-dir": "^2.0.0"
}
},
"find-replace": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/find-replace/-/find-replace-1.0.3.tgz",
"integrity": "sha1-uI5zZNLZyVlVnziMZmcNYTBEH6A=",
"dev": true,
"requires": {
"array-back": "^1.0.4",
"test-value": "^2.1.0"
},
"dependencies": {
"array-back": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz",
"integrity": "sha1-ZEun8JX3/898Q7Xw3DnTwfA8Bjs=",
"dev": true,
"requires": {
"typical": "^2.6.0"
}
}
}
},
"find-up": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
@ -5173,6 +5485,15 @@
"integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==",
"dev": true
},
"graphql": {
"version": "0.11.7",
"resolved": "https://registry.npmjs.org/graphql/-/graphql-0.11.7.tgz",
"integrity": "sha512-x7uDjyz8Jx+QPbpCFCMQ8lltnQa4p4vSYHx6ADe8rVYRTdsyhCJbvSty5DAsLVmU6cGakl+r8HQYolKHxk/tiw==",
"dev": true,
"requires": {
"iterall": "1.1.3"
}
},
"hammerjs": {
"version": "2.0.8",
"resolved": "https://registry.npmjs.org/hammerjs/-/hammerjs-2.0.8.tgz",
@ -5999,6 +6320,12 @@
"integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=",
"dev": true
},
"is-url": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz",
"integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==",
"dev": true
},
"is-utf8": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
@ -6420,6 +6747,12 @@
"handlebars": "^4.1.0"
}
},
"iterall": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/iterall/-/iterall-1.1.3.tgz",
"integrity": "sha512-Cu/kb+4HiNSejAPhSaN1VukdNTTi/r4/e+yykqjlG/IW+1gZH5b4+Bq3whDX4tvbYugta3r8KTMUiqT3fIGxuQ==",
"dev": true
},
"jasmine": {
"version": "2.8.0",
"resolved": "https://registry.npmjs.org/jasmine/-/jasmine-2.8.0.tgz",
@ -6521,6 +6854,15 @@
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
"dev": true
},
"json-stable-stringify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz",
"integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=",
"dev": true,
"requires": {
"jsonify": "~0.0.0"
}
},
"json-stringify-safe": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
@ -6539,6 +6881,12 @@
"integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=",
"dev": true
},
"jsonify": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz",
"integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=",
"dev": true
},
"jsonparse": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz",
@ -6868,6 +7216,12 @@
"dev": true,
"optional": true
},
"lodash.padend": {
"version": "4.6.1",
"resolved": "https://registry.npmjs.org/lodash.padend/-/lodash.padend-4.6.1.tgz",
"integrity": "sha1-U8y6BH0G4VjTEfRdpiX05J5vFm4=",
"dev": true
},
"lodash.tail": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/lodash.tail/-/lodash.tail-4.1.1.tgz",
@ -8062,6 +8416,16 @@
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
"dev": true
},
"node-fetch": {
"version": "1.7.3",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz",
"integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==",
"dev": true,
"requires": {
"encoding": "^0.1.11",
"is-stream": "^1.0.1"
}
},
"node-fetch-npm": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.2.tgz",
@ -9004,6 +9368,12 @@
"find-up": "^2.1.0"
}
},
"pluralize": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz",
"integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==",
"dev": true
},
"png-js": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/png-js/-/png-js-0.1.1.tgz",
@ -9364,6 +9734,34 @@
"integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==",
"dev": true
},
"quicktype": {
"version": "15.0.184",
"resolved": "https://registry.npmjs.org/quicktype/-/quicktype-15.0.184.tgz",
"integrity": "sha512-11JCldUStYDJMECFiC9t3Lya6n8RJs3iaA7JGHbbwE07KmJT2Yw9bFNZB3HwlbT3iRdlUOASqDWJEjffya8ptg==",
"dev": true,
"requires": {
"@mark.probst/typescript-json-schema": "~0.32.0",
"@mark.probst/unicode-properties": "~1.1.0",
"chalk": "^2.4.1",
"collection-utils": "^1.0.1",
"command-line-args": "^4.0.6",
"command-line-usage": "^5.0.5",
"graphql": "^0.11.7",
"is-url": "^1.2.4",
"js-base64": "^2.4.3",
"lodash": "^4.17.10",
"moment": "^2.22.1",
"node-fetch": "^1.7.1",
"pako": "^1.0.6",
"pluralize": "^7.0.0",
"stream-json": "1.1.3",
"string-to-stream": "^1.1.0",
"urijs": "^1.19.1",
"uuid": "^3.2.1",
"wordwrap": "^1.0.0",
"yaml": "^1.5.0"
}
},
"quote-stream": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/quote-stream/-/quote-stream-1.0.2.tgz",
@ -9576,6 +9974,12 @@
"strip-indent": "^1.0.1"
}
},
"reduce-flatten": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-1.0.1.tgz",
"integrity": "sha1-JYx479FT3fk8tWEjf2EYTzaW4yc=",
"dev": true
},
"reflect-metadata": {
"version": "0.1.13",
"resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz",
@ -10734,6 +11138,12 @@
"readable-stream": "^2.0.2"
}
},
"stream-chain": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/stream-chain/-/stream-chain-2.1.0.tgz",
"integrity": "sha512-PAUXdRGm0G8P0+/+JEd3O9kfmB9kwmr2nKIc5zhcsHn0KdBByD5PJ2po21iDzc+TZsOSEbU8j4JbAevJsZkLyQ==",
"dev": true
},
"stream-each": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz",
@ -10757,6 +11167,15 @@
"xtend": "^4.0.0"
}
},
"stream-json": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/stream-json/-/stream-json-1.1.3.tgz",
"integrity": "sha512-y+ChhCov2A5nDqC2aZ6HKXs3OvDlvAp0Ps3BF1P/Iv8tUZJQQsMVaSzk0WryVTVoGITKv01UYahCXMpAs7I0lQ==",
"dev": true,
"requires": {
"stream-chain": "^2.0.3"
}
},
"stream-shift": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz",
@ -10792,6 +11211,16 @@
}
}
},
"string-to-stream": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string-to-stream/-/string-to-stream-1.1.1.tgz",
"integrity": "sha512-QySF2+3Rwq0SdO3s7BAp4x+c3qsClpPQ6abAmb0DGViiSBAkT5kL6JT2iyzEVP+T1SmzHrQD1TwlP9QAHCc+Sw==",
"dev": true,
"requires": {
"inherits": "^2.0.1",
"readable-stream": "^2.1.0"
}
},
"string-width": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
@ -10921,6 +11350,19 @@
"integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==",
"dev": true
},
"table-layout": {
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/table-layout/-/table-layout-0.4.4.tgz",
"integrity": "sha512-uNaR3SRMJwfdp9OUr36eyEi6LLsbcTqTO/hfTsNviKsNeyMBPICJCC7QXRF3+07bAP6FRwA8rczJPBqXDc0CkQ==",
"dev": true,
"requires": {
"array-back": "^2.0.0",
"deep-extend": "~0.6.0",
"lodash.padend": "^4.6.1",
"typical": "^2.6.1",
"wordwrapjs": "^3.0.0"
}
},
"tapable": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz",
@ -11139,6 +11581,27 @@
}
}
},
"test-value": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/test-value/-/test-value-2.1.0.tgz",
"integrity": "sha1-Edpv9nDzRxpztiXKTz/c97t0gpE=",
"dev": true,
"requires": {
"array-back": "^1.0.3",
"typical": "^2.6.0"
},
"dependencies": {
"array-back": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz",
"integrity": "sha1-ZEun8JX3/898Q7Xw3DnTwfA8Bjs=",
"dev": true,
"requires": {
"typical": "^2.6.0"
}
}
}
},
"through": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
@ -11394,6 +11857,12 @@
"integrity": "sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA==",
"dev": true
},
"typical": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/typical/-/typical-2.6.1.tgz",
"integrity": "sha1-XAgOXWYcu+OCWdLnCjxyU+hziB0=",
"dev": true
},
"uglify-js": {
"version": "3.5.6",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.6.tgz",
@ -11587,6 +12056,12 @@
"punycode": "^2.1.0"
}
},
"urijs": {
"version": "1.19.1",
"resolved": "https://registry.npmjs.org/urijs/-/urijs-1.19.1.tgz",
"integrity": "sha512-xVrGVi94ueCJNrBSTjWqjvtgvl3cyOTThp2zaMaFNGp3F542TR6sM3f2o8RqZl+AwteClSVmoCyt0ka4RjQOQg==",
"dev": true
},
"urix": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz",
@ -12205,6 +12680,16 @@
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
"integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus="
},
"wordwrapjs": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-3.0.0.tgz",
"integrity": "sha512-mO8XtqyPvykVCsrwj5MlOVWvSnCdT+C+QVbm6blradR7JExAhbkZ7hZ9A+9NUtwzSqrlUo9a67ws0EiILrvRpw==",
"dev": true,
"requires": {
"reduce-flatten": "^1.0.1",
"typical": "^2.6.1"
}
},
"worker-farm": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.6.0.tgz",
@ -12294,6 +12779,15 @@
"integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=",
"dev": true
},
"yaml": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.5.0.tgz",
"integrity": "sha512-nKxSWOa7vxAP2pikrGxbkZsG/garQseRiLn9mIDjzwoQsyVy7ZWIpLoARejnINGGLA4fttuzRFFNxxbsztdJgw==",
"dev": true,
"requires": {
"@babel/runtime": "^7.4.3"
}
},
"yargs": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz",

View File

@ -9,7 +9,8 @@
"lint": "ng lint",
"e2e": "ng e2e",
"prettier": "prettier \"**/*.{html,js,ts,css,md,json,prettierrc,svg}\" --write",
"check": "prettier \"**/*.{html,js,ts,css,md,json,prettierrc,svg}\" --list-different"
"check": "prettier \"**/*.{html,js,ts,css,md,json,prettierrc,svg}\" --list-different",
"quicktype": "quicktype -s schema --just-types"
},
"private": true,
"dependencies": {
@ -63,6 +64,7 @@
"ngx-build-plus": "^7.2.3",
"prettier": "~1.15.2",
"protractor": "~5.4.0",
"quicktype": "^15.0.184",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.1.6"

View File

@ -1,12 +1,15 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
type Config = typeof import('../../assets/appConfig.json');
type AppConfig = typeof import('../../assets/appConfig.json');
// tslint:disable-next-line:no-empty-interface
interface Config extends AppConfig {}
@Injectable()
export class ConfigService {
export class ConfigService implements Config {
api: Config['api'];
daData: Config['daData'];
konturFocus: Config['konturFocus'];
constructor(private http: HttpClient) {}

View File

@ -30,7 +30,7 @@ export class DaDataService {
}
return this.http
.post<SuggestionResult<T>>(
`${this.config.daData.suggestionsAPIUrl}/${type}`,
`${this.config.daData.suggestionsApiUrl}/${type}`,
{ query, ...(params as object) },
this.options
)

View File

@ -32,7 +32,7 @@ class SimpleDaDataAutocompleteComponent {
describe('DshDadata', () => {
const config = {
token: 'Token AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
suggestionsAPIUrl: 'https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest'
suggestionsApiUrl: 'https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest'
};
const suggestions = {

View File

@ -0,0 +1,10 @@
import { NgModule } from '@angular/core';
import { KonturFocusService } from './kontur-focus.service';
@NgModule({
imports: [],
declarations: [],
entryComponents: [],
providers: [KonturFocusService]
})
export class KonturFocusModule {}

View File

@ -0,0 +1,98 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { ConfigService } from '../config/config.service';
import { Req, BriefReport } from './gen-model/req';
import { Analytics } from './gen-model/analytics';
import { Contacts } from './gen-model/contacts';
import { Licences } from './gen-model/licences';
import { Buh } from './gen-model/buh';
import { Fssp } from './gen-model/fssp';
import { Stat } from './gen-model/stat';
import { GovPurchasesOfParticipant } from './gen-model/govPurchasesOfParticipant';
import { GovPurchasesOfCustomer } from './gen-model/govPurchasesOfCustomer';
interface InnOgrn {
inn?: string;
ogrn?: string;
}
interface Skip {
skip?: number;
}
type InnOgrnList = Partial<Record<keyof InnOgrn, string | string[]>>;
type PDF = any;
@Injectable()
export class KonturFocusService {
constructor(private http: HttpClient, private config: ConfigService) {}
private request<T>(method: 'get', url: string, params?: any): Observable<T> {
return this.http.request<T>(method, `${this.config.konturFocus.apiV3Url}/${url}`, {
params
});
}
private innOgrnToString({ inn, ogrn, ...rest }: InnOgrnList): InnOgrn {
return {
...rest,
inn: Array.isArray(inn) ? inn.join(',') : inn,
ogrn: Array.isArray(ogrn) ? ogrn.join(',') : ogrn
};
}
req(params: InnOgrnList): Observable<Req> {
return this.request('get', 'req', this.innOgrnToString(params));
}
excerpt(params: InnOgrn): Observable<PDF> {
return this.request('get', 'excerpt', params);
}
briefReport(params: InnOgrnList): Observable<BriefReport> {
return this.request('get', 'briefReport', this.innOgrnToString(params));
}
analytics(params: InnOgrnList): Observable<Analytics> {
return this.request('get', 'analytics', this.innOgrnToString(params));
}
contacts(params: InnOgrnList): Observable<Contacts> {
return this.request('get', 'contacts', this.innOgrnToString(params));
}
egrDetails(params: InnOgrnList): Observable<Contacts> {
return this.request('get', 'egrDetails', this.innOgrnToString(params));
}
licences(params: InnOgrnList): Observable<Licences> {
return this.request('get', 'licences', this.innOgrnToString(params));
}
buh(params: InnOgrnList): Observable<Buh> {
return this.request('get', 'buh', this.innOgrnToString(params));
}
fssp(params: InnOgrn & Skip): Observable<Fssp> {
return this.request('get', 'fssp', this.innOgrnToString(params));
}
govPurchasesOfParticipant(params: InnOgrn & Skip): Observable<GovPurchasesOfParticipant> {
return this.request('get', 'govPurchasesOfParticipant', this.innOgrnToString(params));
}
govPurchasesOfCustomer(params: InnOgrn & Skip): Observable<GovPurchasesOfCustomer> {
return this.request('get', 'govPurchasesOfCustomer', this.innOgrnToString(params));
}
finan(params: InnOgrn): Observable<PDF> {
return this.request('get', 'finan', this.innOgrnToString(params));
}
stat(): Observable<Stat> {
return this.request('get', 'stat');
}
}

View File

@ -4,6 +4,9 @@
},
"daData": {
"token": "Token 513f29a0891d00336496240b5cee89afe8fafde7",
"suggestionsAPIUrl": "https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest"
"suggestionsApiUrl": "https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest"
},
"konturFocus": {
"apiV3Url": "https://focus-api.kontur.ru/api3"
}
}