@golemio/fypr 0.0.1 → 1.0.0-dev.2304909032

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/LICENSE ADDED
@@ -0,0 +1,11 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 Operátor ICT, a.s.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10
+
11
+ Source: http://opensource.org/licenses/MIT
package/README.md ADDED
@@ -0,0 +1,42 @@
1
+ <div align="center">
2
+ <p>
3
+ <a href="https://operatorict.cz">
4
+ <img src="https://gitlab.com/operator-ict/golemio/code/modules/core/-/raw/development/.assets/oict_logo.png" alt="oict" width="100px" height="100px" />
5
+ </a>
6
+ <a href="https://golemio.cz">
7
+ <img src="https://gitlab.com/operator-ict/golemio/code/modules/core/-/raw/development/.assets/golemio_logo.png" alt="golemio" width="100px" height="100px" />
8
+ </a>
9
+ </p>
10
+
11
+ <h1>@golemio/fypr</h1>
12
+
13
+ <p>
14
+ <a href="https://gitlab.com/operator-ict/golemio/code/modules/fypr/commits/master">
15
+ <img src="https://gitlab.com/operator-ict/golemio/code/modules/fypr/badges/master/pipeline.svg" alt="pipeline">
16
+ </a>
17
+ <a href="https://gitlab.com/operator-ict/golemio/code/modules/fypr/commits/master">
18
+ <img src="https://gitlab.com/operator-ict/golemio/code/modules/fypr/badges/master/coverage.svg" alt="coverage">
19
+ </a>
20
+ <a href="./LICENSE">
21
+ <img src="https://img.shields.io/npm/l/@golemio/fypr" alt="license">
22
+ </a>
23
+ </p>
24
+
25
+ <p>
26
+ <a href="#installation">Installation</a> · <a href="./docs">Documentation</a> · <a href="https://operator-ict.gitlab.io/golemio/code/modules/fypr">TypeDoc</a>
27
+ </p>
28
+ </div>
29
+
30
+ This module is intended for use with Golemio services. Refer [here](https://gitlab.com/operator-ict/golemio/code/modules/core/-/blob/master/README.md) for further information on usage, local development and more.
31
+
32
+ ## Installation
33
+
34
+ The APIs may be unstable. Therefore, we recommend to install this module as an exact version.
35
+
36
+ ```bash
37
+ # Latest version
38
+ npm install --save-exact @golemio/fypr@latest
39
+
40
+ # Development version
41
+ npm install --save-exact @golemio/fypr@dev
42
+ ```
@@ -0,0 +1 @@
1
+ { "schema": "fypr" }
@@ -0,0 +1,7 @@
1
+ -- TODO: Fill in tables to truncate and sequences to restart
2
+
3
+ -- TRUNCATE
4
+ -- "table1",
5
+ -- "table2";
6
+
7
+ -- ALTER SEQUENCE table1_id_seq RESTART;
@@ -0,0 +1 @@
1
+ { "schema": "fypr, public" }
@@ -0,0 +1,3 @@
1
+ export * as IntegrationEngine from "./integration-engine/index";
2
+ export * as OutputGateway from "./output-gateway/index";
3
+ export * as SchemaDefinitions from "./schema-definitions/index";
package/dist/index.js ADDED
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.SchemaDefinitions = exports.OutputGateway = exports.IntegrationEngine = void 0;
37
+ // Library exports
38
+ exports.IntegrationEngine = __importStar(require("./integration-engine/index"));
39
+ exports.OutputGateway = __importStar(require("./output-gateway/index"));
40
+ exports.SchemaDefinitions = __importStar(require("./schema-definitions/index"));
41
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAAkB;AAClB,gFAA+C;AAC/C,wEAA2C;AAC3C,gFAAgD"}
@@ -0,0 +1,2 @@
1
+ import { AbstractWorker } from "@golemio/core/dist/integration-engine/workers";
2
+ export declare const workers: Array<new () => AbstractWorker>;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.workers = void 0;
4
+ exports.workers = [
5
+ // TODO
6
+ ];
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/integration-engine/index.ts"],"names":[],"mappings":";;;AAEa,QAAA,OAAO,GAAoC;AACpD,OAAO;CACV,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { AbstractRouter } from "@golemio/core/dist/helpers/routing/AbstractRouter";
2
+ export declare const routers: AbstractRouter[];
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.routers = void 0;
4
+ exports.routers = [
5
+ // TODO
6
+ ];
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/output-gateway/index.ts"],"names":[],"mappings":";;;AAEa,QAAA,OAAO,GAAqB;AACrC,OAAO;CACV,CAAC"}
@@ -0,0 +1,2 @@
1
+ declare const _default: {};
2
+ export default _default;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // TODO
4
+ exports.default = {};
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema-definitions/index.ts"],"names":[],"mappings":";;AAAA,OAAO;AACP,kBAAe,EAAE,CAAC"}
@@ -0,0 +1,17 @@
1
+ asyncapi: 3.0.0
2
+
3
+ info:
4
+ title: FYPR
5
+ version: 1.0.0
6
+ description: FYPR
7
+
8
+ # TODO channels:
9
+
10
+ # TODO operations:
11
+
12
+ components:
13
+ messages:
14
+ emptyMessage:
15
+ title: Empty message
16
+
17
+ # TODO schemas:
@@ -0,0 +1,100 @@
1
+ # Implementační dokumentace modulu *fypr*
2
+
3
+ ## Záměr
4
+
5
+ Modul slouží k ukládání a poskytování informací o fyzických informačních prvcích systému Čitelná Praha.
6
+
7
+
8
+
9
+ ## Vstupní data
10
+
11
+ ### Data aktivně stahujeme
12
+
13
+ TODO: Popis dat, jak je pomocí cronu a integration-engine stahujeme. Pokud jsou data stahována z více zdrojů, každý zdroj je popsán zvlášť.
14
+
15
+ #### *Název datového zdroje*
16
+
17
+ - zdroj dat
18
+ - url
19
+ - paramtery dotazu
20
+ - formát dat
21
+ - protokol
22
+ - datový typ
23
+ - odkaz na validační schéma
24
+ - příklad vstupních dat
25
+ - (volitelně) vstupní parametry, hlavičky, atd.
26
+ - frekvence stahování
27
+ - cron definice
28
+ - název rabbitmq fronty
29
+ - popis / název fronty, která vyvolá proces integrace, ve které je zdroj dat obsažen
30
+
31
+
32
+
33
+ ## Zpracování dat / transformace
34
+
35
+ TODO: Popis transformace a případného obohacení dat. Zaměřeno hlavně na workery a jejich metody.
36
+
37
+ ### *Název workeru*
38
+
39
+ Stručný popis workeru.
40
+
41
+ #### *Název metody workeru*
42
+
43
+ - vstupní rabbitmq fronta
44
+ - název
45
+ - parametry
46
+ - (volitelně) závislé fronty (do kterých jsou odesílány zprávy z metody workeru)
47
+ - název
48
+ - parametry
49
+ - datové zdroje
50
+ - výčet datových zdrojů
51
+ - transformace
52
+ - odkaz na transformaci dat, případně stručný popis tranformace
53
+ - (volitelně) obohacení dat
54
+ - popis, pokud se data obohacují a jak
55
+ - data modely
56
+ - výčet datových modelů, kam se data ukládájí
57
+
58
+
59
+
60
+ ## Uložení dat
61
+
62
+ Popis ukládání dat.
63
+
64
+ ### Obecné
65
+
66
+ - typ databáze
67
+ - PSQL
68
+ - databázové schéma
69
+ - TODO: popis tabulek nebo odkaz na obrázek s databázovým schématem
70
+ - retence dat
71
+ - TODO: popis zachovávání a promazávání dat
72
+
73
+ ### *Název datového modelu*
74
+
75
+ - schéma a název tabulky / kolekce
76
+ - struktura tabulky / kolekce
77
+ - odkaz na schéma, případně na migrační skripty
78
+ - ukázka dat
79
+
80
+
81
+
82
+ ## Output API
83
+
84
+ Popis output-api.
85
+
86
+ ### Obecné
87
+
88
+ - OpenAPI v3 dokumentace
89
+ - zdrojový soubor: [openapi-output.yaml](./openapi-output.yaml)
90
+ - rabin: <https://rabin.golemio.cz/pid/docs/openapi/>
91
+ - golem: <https://api.golemio.cz/pid/docs/openapi/>
92
+ - TODO: veřejné / neveřejné endpointy
93
+ - api je veřejné nebo neveřejné, případně seznam vežejných a neveřejných endpointů
94
+
95
+ #### *Název endpointu*
96
+
97
+ - zdrojové tabulky
98
+ - (volitlně) nestandardní dodatečná transformace
99
+ - (volitelně) nestandardní url a query parametry
100
+ - ukázka dat (pokud není součástí OpenAPI)
package/docs/index.md ADDED
@@ -0,0 +1,3 @@
1
+ # @golemio/fypr
2
+
3
+ This module is intended for use with Golemio services.
@@ -0,0 +1,95 @@
1
+ openapi: 3.0.3
2
+
3
+ info:
4
+ title: 🗿 FYPR API
5
+ description: >-
6
+ <p>
7
+ This is a placeholder description that is automatically replaced in the build process, see <a href="https://gitlab.com/operator-ict/golemio/code/vp/output-gateway/-/blob/development/docs/openapi-header.yaml" target="_blank">/vp/output-gateway/docs/openapi-header.yaml</a>.
8
+ </p>
9
+ version: 1.0.0
10
+ contact:
11
+ name: Golemio Prague Data Platform
12
+ email: golemio@operatorict.cz
13
+ url: https://golemio.cz
14
+
15
+ servers:
16
+ - url: https://api.golemio.cz
17
+ description: Main (production) server
18
+ - url: https://rabin.golemio.cz
19
+ description: Test (development) server
20
+
21
+ tags:
22
+ - name: 🗿 FYPR (v1)
23
+ description: Data about physical (on-site) information elements of the Legible Prague system in form of an API.
24
+
25
+ paths:
26
+ # TODO: Replace status with actual endpoints
27
+ /status:
28
+ get:
29
+ tags:
30
+ - 🗿 FYPR (v1)
31
+ responses:
32
+ "200":
33
+ description: OK
34
+
35
+ components:
36
+ headers:
37
+ LastModified:
38
+ description: Timestamp of the latest resource update.
39
+ schema:
40
+ type: string
41
+ example: "2024-08-12T12:40:30.000Z"
42
+ CacheControlNoCache:
43
+ description: Cache control directive for caching proxies
44
+ schema:
45
+ type: string
46
+ example: no-store, no-cache, must-revalidate
47
+
48
+ responses:
49
+ BadRequestError:
50
+ description: Bad request - invalid query parameters
51
+ content:
52
+ application/json:
53
+ schema:
54
+ type: object
55
+ properties:
56
+ error_message:
57
+ type: string
58
+ example: "Bad request"
59
+ nullable: false
60
+ error_status:
61
+ type: integer
62
+ example: 400
63
+ nullable: false
64
+ error_info:
65
+ type: string
66
+ example: "{...}"
67
+ nullable: true
68
+ required:
69
+ - error_message
70
+ - error_status
71
+
72
+ UnauthorizedError:
73
+ description: API key is missing or invalid
74
+ headers:
75
+ WWW_Authenticate:
76
+ schema:
77
+ type: string
78
+ content:
79
+ application/json:
80
+ schema:
81
+ type: object
82
+ properties:
83
+ error_message:
84
+ type: string
85
+ example: "Unauthorized. Failed to authenticate user."
86
+ nullable: false
87
+ error_status:
88
+ type: integer
89
+ example: 401
90
+ nullable: false
91
+ required:
92
+ - error_message
93
+ - error_status
94
+
95
+ # TODO schemas:
package/package.json CHANGED
@@ -1,12 +1,81 @@
1
1
  {
2
- "name": "@golemio/fypr",
3
- "version": "0.0.1",
4
- "description": "",
5
- "license": "MIT",
6
- "author": "",
7
- "type": "commonjs",
8
- "main": "index.js",
9
- "scripts": {
10
- "test": "echo \"Error: no test specified\" && exit 1"
11
- }
2
+ "name": "@golemio/fypr",
3
+ "version": "1.0.0-dev.2304909032",
4
+ "description": "Golemio FYPR Module",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "directories": {
8
+ "doc": "docs"
9
+ },
10
+ "scripts": {
11
+ "build": "rimraf ./dist && tspc -p ./tsconfig.build.json",
12
+ "build-minimal": "run-s 'build -- --sourceMap false --declaration false'",
13
+ "build-watch": "run-s 'build -- --watch --preserveWatchOutput'",
14
+ "pretest": "golemio import-db-data",
15
+ "test": "cross-env NODE_ENV='test' TZ='UTC' mocha --exit --check-leaks --timeout 120000 --reporter-option maxDiffSize=0 -r ts-node/register -r tsconfig-paths/register --file 'test/setup.ts' -r dotenv/config 'test/**/*.test.ts'",
16
+ "test-debug": "run-s 'test -- --inspect-brk=9230'",
17
+ "apidocs-test": "npm run apidocs-test-output",
18
+ "apidocs-test-output": "cross-env NODE_ENV=test golemio swagger api-test --oas docs/openapi-output.yaml --script test/api-docs/output-gateway/server.js --config test/api-docs/output-gateway/portman-config.json --filter test/api-docs/output-gateway/portman-filter.json",
19
+ "code-coverage": "nyc run-s 'test -- -r source-map-support/register'",
20
+ "format:check-staged": "pretty-quick --staged --pattern '**/*.ts'",
21
+ "generate-docs": "typedoc --out docs/typedoc src",
22
+ "lint": "eslint --cache \"{src,test}/**/*.ts\"",
23
+ "validate-dependencies": "dependency-cruiser --config .dependency-cruiser.js src"
24
+ },
25
+ "keywords": [
26
+ "golemio"
27
+ ],
28
+ "author": "Operator ICT, a.s.",
29
+ "license": "MIT",
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "https://gitlab.com/operator-ict/golemio/code/modules/fypr"
33
+ },
34
+ "engines": {
35
+ "node": ">=20.0.0",
36
+ "npm": ">=8.0.0"
37
+ },
38
+ "devDependencies": {
39
+ "@apideck/portman": "^1.26.5",
40
+ "@commitlint/cli": "^11.0.0",
41
+ "@commitlint/config-conventional": "^11.0.0",
42
+ "@golemio/cli": "1.11.0",
43
+ "@golemio/core": "3.0.2",
44
+ "@golemio/eslint-config": "1.1.2",
45
+ "@swc/core": "^1.15.11",
46
+ "@types/chai": "^5.2.3",
47
+ "@types/chai-as-promised": "^8.0.2",
48
+ "@types/mocha": "^10.0.10",
49
+ "@types/node": "^20.12.7",
50
+ "@types/pg-copy-streams": "^1.2.5",
51
+ "@types/sinon": "^21.0.0",
52
+ "@types/supertest": "^2.0.10",
53
+ "body-parser": "^1.20.3",
54
+ "body-parser-xml": "^2.0.5",
55
+ "chai": "^6.2.2",
56
+ "chai-as-promised": "^8.0.2",
57
+ "cross-env": "^7.0.3",
58
+ "dependency-cruiser": "^17.3.7",
59
+ "dotenv": "^8.2.0",
60
+ "eslint": "^8.1.1",
61
+ "husky": "^4.3.7",
62
+ "mocha": "^11.7.5",
63
+ "npm-run-all": "^4.1.5",
64
+ "nyc": "^17.1.0",
65
+ "prettier": "2.5.1",
66
+ "pretty-quick": "^3.1.0",
67
+ "rimraf": "^3.0.2",
68
+ "sinon": "^21.0.1",
69
+ "source-map-support": "0.5.21",
70
+ "supertest": "^7.1.4",
71
+ "ts-node": "^10.9.2",
72
+ "ts-patch": "3.3.0",
73
+ "tsconfig-paths": "^4.2.0",
74
+ "typedoc": "^0.28.14",
75
+ "typescript": "5.9.3",
76
+ "typescript-transform-paths": "^3.5.5"
77
+ },
78
+ "peerDependencies": {
79
+ "@golemio/core": ">=3.0.2"
80
+ }
12
81
  }