@golemio/fcd 1.0.7 → 1.0.8-dev.597064643

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.
@@ -0,0 +1,53 @@
1
+ 'use strict';
2
+
3
+ var dbm;
4
+ var type;
5
+ var seed;
6
+ var fs = require('fs');
7
+ var path = require('path');
8
+ var Promise;
9
+
10
+ /**
11
+ * We receive the dbmigrate dependency from dbmigrate initially.
12
+ * This enables us to not have to rely on NODE_PATH.
13
+ */
14
+ exports.setup = function(options, seedLink) {
15
+ dbm = options.dbmigrate;
16
+ type = dbm.dataType;
17
+ seed = seedLink;
18
+ Promise = options.Promise;
19
+ };
20
+
21
+ exports.up = function(db) {
22
+ var filePath = path.join(__dirname, 'sqls', '20220725054113-fcd-geos-90-up.sql');
23
+ return new Promise( function( resolve, reject ) {
24
+ fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
25
+ if (err) return reject(err);
26
+ console.log('received data: ' + data);
27
+
28
+ resolve(data);
29
+ });
30
+ })
31
+ .then(function(data) {
32
+ return db.runSql(data);
33
+ });
34
+ };
35
+
36
+ exports.down = function(db) {
37
+ var filePath = path.join(__dirname, 'sqls', '20220725054113-fcd-geos-90-down.sql');
38
+ return new Promise( function( resolve, reject ) {
39
+ fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
40
+ if (err) return reject(err);
41
+ console.log('received data: ' + data);
42
+
43
+ resolve(data);
44
+ });
45
+ })
46
+ .then(function(data) {
47
+ return db.runSql(data);
48
+ });
49
+ };
50
+
51
+ exports._meta = {
52
+ "version": 1
53
+ };
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1 @@
1
+ DROP TABLE fcd_geos_90;
@@ -0,0 +1,6 @@
1
+ CREATE TABLE fcd_geos_90 (
2
+ source_identification varchar(100) NOT NULL,
3
+ oriented_route geometry NULL,
4
+ CONSTRAINT fcd_geos_90_pkey PRIMARY KEY (source_identification)
5
+ );
6
+ COMMENT ON TABLE fcd_geos_90 IS 'lookup table for Praha Dopravni, data are prepared manually';
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
package/package.json CHANGED
@@ -1,83 +1,83 @@
1
1
  {
2
- "name": "@golemio/fcd",
3
- "version": "1.0.7",
4
- "description": "Golemio Floating Car Data Module",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "scripts": {
8
- "build": "rimraf ./dist && ttsc -p ./tsconfig.build.json",
9
- "build-minimal": "run-s 'build --sourceMap false --declaration false'",
10
- "build-watch": "run-s 'build --watch --preserveWatchOutput'",
11
- "pretest": "golemio mdb reset --postgres && golemio mdb up --postgres && golemio import-db-data --postgres",
12
- "test": "cross-env NODE_ENV=test TS_NODE_COMPILER='ttypescript' mocha --exit --check-leaks --timeout 120000 -r ts-node/register -r dotenv/config 'test/**/*.test.ts'",
13
- "apidocs-test": "cross-env NODE_ENV=test TS_NODE_COMPILER='ttypescript' ts-node -r dotenv/config test/api-docs/index.ts",
14
- "test-debug": "run-s 'test --inspect-brk=9230'",
15
- "code-coverage": "nyc run-s 'test -r source-map-support/register'",
16
- "generate-docs": "typedoc --out docs/typedoc src",
17
- "lint": "eslint \"{src,test}/**/*.ts\""
18
- },
19
- "keywords": [
20
- "golemio",
21
- "fcd"
22
- ],
23
- "author": "Operator ICT, a.s.",
24
- "license": "MIT",
25
- "repository": {
26
- "type": "git",
27
- "url": "https://gitlab.com/operator-ict/golemio/code/modules/fcd"
28
- },
29
- "devDependencies": {
30
- "@commitlint/cli": "^11.0.0",
31
- "@commitlint/config-conventional": "^11.0.0",
32
- "@golemio/cli": "1.2.2",
33
- "@golemio/core": "1.2.10",
34
- "@golemio/db-common": "1.0.1",
35
- "@golemio/eslint-config": "^1.0.2",
36
- "@ovos-media/ts-transform-paths": "^1.7.18-1",
37
- "@types/body-parser-xml": "^1.1.0",
38
- "@types/chai": "4.2.3",
39
- "@types/chai-as-promised": "7.1.2",
40
- "@types/mocha": "^8.2.0",
41
- "@types/node": "^16.11.35",
42
- "@types/sinon": "^9.0.10",
43
- "@types/supertest": "^2.0.10",
44
- "body-parser": "^1.19.0",
45
- "body-parser-xml": "^2.0.0",
46
- "chai": "4.2.0",
47
- "chai-as-promised": "7.1.1",
48
- "cross-env": "^7.0.3",
49
- "dotenv": "^8.2.0",
50
- "eslint": "^7.17.0",
51
- "husky": "^4.3.7",
52
- "mocha": "^8.2.1",
53
- "npm-run-all": "^4.1.5",
54
- "nyc": "^15.1.0",
55
- "prettier": "^2.2.1",
56
- "pretty-quick": "^3.1.0",
57
- "rimraf": "^3.0.2",
58
- "sinon": "^9.2.3",
59
- "source-map-support": "0.5.19",
60
- "supertest": "^6.0.1",
61
- "ts-node": "^10.7.0",
62
- "ttypescript": "^1.5.13",
63
- "typedoc": "^0.22.15",
64
- "typescript": "4.6.4"
65
- },
66
- "peerDependencies": {
67
- "@golemio/core": "^1.0.5"
68
- },
69
- "dependencies": {
70
- "@apideck/portman": "^1.14.2",
71
- "ajv": "^8.2.0",
72
- "xmldom": "github:xmldom/xmldom#0.7.0"
73
- },
74
- "resolutions": {
75
- "@commitlint/cli/**/trim-newlines": "^3.0.1",
76
- "hosted-git-info": "^3.0.8",
77
- "xmldom": "github:xmldom/xmldom#0.7.0",
78
- "mpath": "^0.8.4",
79
- "minimist": "^1.2.6",
80
- "follow-redirects": "1.14.7",
81
- "xsd2jsonschema/urijs": "^1.19.10"
82
- }
2
+ "name": "@golemio/fcd",
3
+ "version": "1.0.8-dev.597064643",
4
+ "description": "Golemio Floating Car Data Module",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "rimraf ./dist && ttsc -p ./tsconfig.build.json",
9
+ "build-minimal": "run-s 'build --sourceMap false --declaration false'",
10
+ "build-watch": "run-s 'build --watch --preserveWatchOutput'",
11
+ "pretest": "golemio mdb reset --postgres && golemio mdb up --postgres && golemio import-db-data --postgres",
12
+ "test": "cross-env NODE_ENV=test TS_NODE_COMPILER='ttypescript' mocha --exit --check-leaks --timeout 120000 -r ts-node/register -r dotenv/config 'test/**/*.test.ts'",
13
+ "apidocs-test": "cross-env NODE_ENV=test TS_NODE_COMPILER='ttypescript' ts-node -r dotenv/config test/api-docs/index.ts",
14
+ "test-debug": "run-s 'test --inspect-brk=9230'",
15
+ "code-coverage": "nyc run-s 'test -r source-map-support/register'",
16
+ "generate-docs": "typedoc --out docs/typedoc src",
17
+ "lint": "eslint \"{src,test}/**/*.ts\""
18
+ },
19
+ "keywords": [
20
+ "golemio",
21
+ "fcd"
22
+ ],
23
+ "author": "Operator ICT, a.s.",
24
+ "license": "MIT",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "https://gitlab.com/operator-ict/golemio/code/modules/fcd"
28
+ },
29
+ "devDependencies": {
30
+ "@commitlint/cli": "^11.0.0",
31
+ "@commitlint/config-conventional": "^11.0.0",
32
+ "@golemio/cli": "1.2.2",
33
+ "@golemio/core": "1.2.10",
34
+ "@golemio/db-common": "1.0.1",
35
+ "@golemio/eslint-config": "^1.0.2",
36
+ "@ovos-media/ts-transform-paths": "^1.7.18-1",
37
+ "@types/body-parser-xml": "^1.1.0",
38
+ "@types/chai": "4.2.3",
39
+ "@types/chai-as-promised": "7.1.2",
40
+ "@types/mocha": "^8.2.0",
41
+ "@types/node": "^16.11.35",
42
+ "@types/sinon": "^9.0.10",
43
+ "@types/supertest": "^2.0.10",
44
+ "body-parser": "^1.19.0",
45
+ "body-parser-xml": "^2.0.0",
46
+ "chai": "4.2.0",
47
+ "chai-as-promised": "7.1.1",
48
+ "cross-env": "^7.0.3",
49
+ "dotenv": "^8.2.0",
50
+ "eslint": "^7.17.0",
51
+ "husky": "^4.3.7",
52
+ "mocha": "^8.2.1",
53
+ "npm-run-all": "^4.1.5",
54
+ "nyc": "^15.1.0",
55
+ "prettier": "^2.2.1",
56
+ "pretty-quick": "^3.1.0",
57
+ "rimraf": "^3.0.2",
58
+ "sinon": "^9.2.3",
59
+ "source-map-support": "0.5.19",
60
+ "supertest": "^6.0.1",
61
+ "ts-node": "^10.7.0",
62
+ "ttypescript": "^1.5.13",
63
+ "typedoc": "^0.22.15",
64
+ "typescript": "4.6.4"
65
+ },
66
+ "peerDependencies": {
67
+ "@golemio/core": "^1.0.5"
68
+ },
69
+ "dependencies": {
70
+ "@apideck/portman": "^1.14.2",
71
+ "ajv": "^8.2.0",
72
+ "xmldom": "github:xmldom/xmldom#0.7.0"
73
+ },
74
+ "resolutions": {
75
+ "@commitlint/cli/**/trim-newlines": "^3.0.1",
76
+ "hosted-git-info": "^3.0.8",
77
+ "xmldom": "github:xmldom/xmldom#0.7.0",
78
+ "mpath": "^0.8.4",
79
+ "minimist": "^1.2.6",
80
+ "follow-redirects": "1.14.7",
81
+ "xsd2jsonschema/urijs": "^1.19.10"
82
+ }
83
83
  }