mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-07 22:12:53 +00:00
refactor: update the dependencies
This commit is contained in:
11
.npmignore
Normal file
11
.npmignore
Normal file
@@ -0,0 +1,11 @@
|
||||
# Ignore all files/folders by default
|
||||
# See https://stackoverflow.com/a/29932318
|
||||
/*
|
||||
# Except these files/folders
|
||||
!docs
|
||||
!lib
|
||||
!LICENSE
|
||||
!package.json
|
||||
!package-lock.json
|
||||
!README.md
|
||||
!src
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Prerequisites:
|
||||
|
||||
* `node` (version 8+) and `npm` installed
|
||||
* `node` (version 10+) and `npm` installed
|
||||
|
||||
* a backend, which is running locally (on http://localhost:3000) --- for testing purposes, it is advisable to use `minimal-deployment` project
|
||||
|
||||
|
||||
667
package-lock.json
generated
667
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
44
package.json
44
package.json
@@ -21,48 +21,52 @@
|
||||
"compile": "tsc",
|
||||
"documentation": "typedoc --includeDeclarations --excludeExternals --mode modules --out docs src",
|
||||
"test": "nyc mocha --require ts-node/register --require source-map-support/register --ui mocha-typescript --recursive 'test/*.spec.ts'",
|
||||
"tslint": "tslint 'src/**/*.ts'"
|
||||
"tslint": "tslint 'src/**/*.ts'",
|
||||
"check-configuration": "openstapps-configuration"
|
||||
},
|
||||
"dependencies": {
|
||||
"@openstapps/api": "0.0.1",
|
||||
"@openstapps/core": "0.0.2",
|
||||
"@openstapps/logger": "0.0.3",
|
||||
"@openstapps/api": "0.1.0",
|
||||
"@openstapps/core": "0.3.0",
|
||||
"@openstapps/logger": "0.0.5",
|
||||
"promise-limit": "2.7.0",
|
||||
"typescript": "3.2.1"
|
||||
"typescript": "3.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@openstapps/configuration": "0.2.0",
|
||||
"@openstapps/core-validator": "0.0.1",
|
||||
"@openstapps/configuration": "0.5.1",
|
||||
"@openstapps/core-tools": "0.1.1",
|
||||
"@types/chai": "4.1.7",
|
||||
"@types/mocha": "5.2.5",
|
||||
"@types/node": "10.12.11",
|
||||
"@types/node": "10.12.18",
|
||||
"chai": "4.2.0",
|
||||
"conventional-changelog-cli": "2.0.11",
|
||||
"mocha": "5.2.0",
|
||||
"mocha-typescript": "1.1.17",
|
||||
"nyc": "13.1.0",
|
||||
"ts-node": "7.0.1",
|
||||
"tslint": "5.11.0",
|
||||
"typedoc": "0.13.0"
|
||||
"ts-node": "8.0.2",
|
||||
"tslint": "5.12.1",
|
||||
"typedoc": "0.14.2"
|
||||
},
|
||||
"nyc": {
|
||||
"all": true,
|
||||
"branches": 95,
|
||||
"check-coverage": true,
|
||||
"per-file": true,
|
||||
"lines": 0,
|
||||
"statements": 0,
|
||||
"functions": 0,
|
||||
"branches": 0,
|
||||
"include": [
|
||||
"src"
|
||||
"exclude": [
|
||||
"src/test/**/*.spec.ts",
|
||||
"src/cli.ts"
|
||||
],
|
||||
"extension": [
|
||||
".ts"
|
||||
],
|
||||
"functions": 95,
|
||||
"include": [
|
||||
"src"
|
||||
],
|
||||
"lines": 95,
|
||||
"per-file": true,
|
||||
"reporter": [
|
||||
"html",
|
||||
"text-summary"
|
||||
],
|
||||
"sourceMap": true,
|
||||
"all": true
|
||||
"statements": 95
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
import {Bulk} from '@openstapps/api/lib/bulk';
|
||||
import {ConnectorClient as Client} from '@openstapps/api/lib/connectorClient';
|
||||
import {HttpClient} from '@openstapps/api/lib/httpClient';
|
||||
import {SCBulkAddResponse, SCMessage} from '@openstapps/core';
|
||||
import {SCBulkAddResponse, SCMessage, SCThingType} from '@openstapps/core';
|
||||
import {Logger} from '@openstapps/logger';
|
||||
import * as promiseLimit from 'promise-limit';
|
||||
import {MinimalConnector} from '.';
|
||||
@@ -35,7 +35,7 @@ async function runConnector() {
|
||||
let bulk: Bulk<SCMessage>;
|
||||
|
||||
try {
|
||||
bulk = await api.bulk<SCMessage>('message', 'minimal-connector');
|
||||
bulk = await api.bulk<SCMessage>(SCThingType.Message, 'minimal-connector');
|
||||
} catch (err) {
|
||||
logger.error('Couldn\'t open bulk.');
|
||||
throw err;
|
||||
|
||||
11
src/index.ts
11
src/index.ts
@@ -13,7 +13,7 @@
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {ConnectorClient as Client} from '@openstapps/api/lib/connectorClient';
|
||||
import {SCMessage} from '@openstapps/core';
|
||||
import {SCMessage, SCThingOriginType, SCThingType} from '@openstapps/core';
|
||||
|
||||
export class MinimalConnector {
|
||||
// Data is mocked inside of getItems()
|
||||
@@ -39,8 +39,9 @@ export class MinimalConnector {
|
||||
origin: {
|
||||
indexed: (new Date()).toISOString(),
|
||||
name: 'minimal connector',
|
||||
type: SCThingOriginType.Remote,
|
||||
},
|
||||
type: 'message',
|
||||
type: SCThingType.Message,
|
||||
uid: '',
|
||||
},
|
||||
{
|
||||
@@ -51,8 +52,9 @@ export class MinimalConnector {
|
||||
origin: {
|
||||
indexed: (new Date()).toISOString(),
|
||||
name: 'minimal connector',
|
||||
type: SCThingOriginType.Remote,
|
||||
},
|
||||
type: 'message',
|
||||
type: SCThingType.Message,
|
||||
uid: '',
|
||||
},
|
||||
{
|
||||
@@ -63,8 +65,9 @@ export class MinimalConnector {
|
||||
origin: {
|
||||
indexed: (new Date()).toISOString(),
|
||||
name: 'minimal connector',
|
||||
type: SCThingOriginType.Remote,
|
||||
},
|
||||
type: 'message',
|
||||
type: SCThingType.Message,
|
||||
uid: '',
|
||||
},
|
||||
];
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCMessage} from '@openstapps/core';
|
||||
import {SCValidator} from '@openstapps/core-validator';
|
||||
import {Validator} from '@openstapps/core-tools/lib/validate';
|
||||
import {expect} from 'chai';
|
||||
import {suite, test} from 'mocha-typescript';
|
||||
import {MinimalConnector} from '../src';
|
||||
@@ -22,11 +22,11 @@ import {MinimalConnector} from '../src';
|
||||
export class MinimalConnectorSpec {
|
||||
|
||||
private static connector: MinimalConnector;
|
||||
private static validator: SCValidator;
|
||||
private static validator: Validator;
|
||||
|
||||
static before() {
|
||||
this.validator = new SCValidator('./node_modules/@openstapps/core/lib/schema');
|
||||
this.validator.feedValidator();
|
||||
this.validator = new Validator();
|
||||
this.validator.addSchemas('./node_modules/@openstapps/core/lib/schema');
|
||||
this.connector = new MinimalConnector();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user