mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-19 08:02:55 +00:00
build: update dependencies
This commit is contained in:
@@ -12,9 +12,9 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCBulkAddRoute, SCBulkDoneRoute, SCDish, SCMessage} from '@openstapps/core';
|
||||
import * as chai from 'chai';
|
||||
import {SCBulkAddRoute, SCBulkDoneRoute, SCDish, SCMessage, SCThingOriginType, SCThingType} from '@openstapps/core';
|
||||
import {expect} from 'chai';
|
||||
import * as chai from 'chai';
|
||||
import * as chaiAsPromised from 'chai-as-promised';
|
||||
import * as chaiSpies from 'chai-spies';
|
||||
import {suite, test} from 'mocha-typescript';
|
||||
@@ -46,11 +46,11 @@ export class BulkSpec {
|
||||
|
||||
expect(client.invokeRoute).not.to.have.been.called();
|
||||
|
||||
const bulk = new Bulk('dish', client, {
|
||||
const bulk = new Bulk(SCThingType.Dish, client, {
|
||||
expiration: moment().add(3600, 'seconds').format(),
|
||||
source: 'foo',
|
||||
state: 'in progress',
|
||||
type: 'dish',
|
||||
type: SCThingType.Dish,
|
||||
uid: 'bar',
|
||||
});
|
||||
|
||||
@@ -62,8 +62,9 @@ export class BulkSpec {
|
||||
origin: {
|
||||
indexed: moment().format(),
|
||||
name: 'bar',
|
||||
type: SCThingOriginType.Remote,
|
||||
},
|
||||
type: 'dish',
|
||||
type: SCThingType.Dish,
|
||||
uid: 'foo',
|
||||
};
|
||||
|
||||
@@ -76,11 +77,11 @@ export class BulkSpec {
|
||||
|
||||
@test
|
||||
async addFails() {
|
||||
const bulk = new Bulk('dish', client, {
|
||||
const bulk = new Bulk(SCThingType.Dish, client, {
|
||||
expiration: moment().add(3600, 'seconds').format(),
|
||||
source: 'foo',
|
||||
state: 'in progress',
|
||||
type: 'dish',
|
||||
type: SCThingType.Dish,
|
||||
uid: 'bar',
|
||||
});
|
||||
|
||||
@@ -93,8 +94,9 @@ export class BulkSpec {
|
||||
origin: {
|
||||
indexed: moment().format(),
|
||||
name: 'bar',
|
||||
type: SCThingOriginType.Remote,
|
||||
},
|
||||
type: 'message',
|
||||
type: SCThingType.Message,
|
||||
uid: 'foo',
|
||||
};
|
||||
|
||||
@@ -108,11 +110,11 @@ export class BulkSpec {
|
||||
@test
|
||||
async construct() {
|
||||
expect(() => {
|
||||
return new Bulk('dish', client, {
|
||||
return new Bulk(SCThingType.Dish, client, {
|
||||
expiration: moment().add(3600, 'seconds').format(),
|
||||
source: 'foo',
|
||||
state: 'in progress',
|
||||
type: 'dish',
|
||||
type: SCThingType.Dish,
|
||||
uid: 'bar',
|
||||
});
|
||||
}).not.to.throw();
|
||||
@@ -126,11 +128,11 @@ export class BulkSpec {
|
||||
|
||||
expect(client.invokeRoute).not.to.have.been.called();
|
||||
|
||||
const bulk = new Bulk('dish', client, {
|
||||
const bulk = new Bulk(SCThingType.Dish, client, {
|
||||
expiration: moment().add(3600, 'seconds').format(),
|
||||
source: 'foo',
|
||||
state: 'in progress',
|
||||
type: 'dish',
|
||||
type: SCThingType.Dish,
|
||||
uid: 'bar',
|
||||
});
|
||||
|
||||
|
||||
@@ -24,9 +24,11 @@ import {
|
||||
SCSearchRequest,
|
||||
SCSearchResponse,
|
||||
SCSearchRoute,
|
||||
SCThingOriginType,
|
||||
SCThingType,
|
||||
} from '@openstapps/core';
|
||||
import * as chai from 'chai';
|
||||
import {expect} from 'chai';
|
||||
import * as chai from 'chai';
|
||||
import * as chaiAsPromised from 'chai-as-promised';
|
||||
import * as chaiSpies from 'chai-spies';
|
||||
import {suite, test} from 'mocha-typescript';
|
||||
@@ -145,8 +147,9 @@ export class ClientSpec {
|
||||
origin: {
|
||||
indexed: 'foo',
|
||||
name: 'foo',
|
||||
type: SCThingOriginType.Remote,
|
||||
},
|
||||
type: 'message',
|
||||
type: SCThingType.Message,
|
||||
uid: 'foo',
|
||||
};
|
||||
await client.feedback(feedback);
|
||||
@@ -170,8 +173,9 @@ export class ClientSpec {
|
||||
origin: {
|
||||
indexed: 'foo',
|
||||
name: 'foo',
|
||||
type: SCThingOriginType.Remote,
|
||||
},
|
||||
type: 'message',
|
||||
type: SCThingType.Message,
|
||||
uid: 'foo',
|
||||
};
|
||||
|
||||
@@ -255,8 +259,9 @@ export class ClientSpec {
|
||||
origin: {
|
||||
indexed: 'foo',
|
||||
name: 'foo',
|
||||
type: SCThingOriginType.Remote,
|
||||
},
|
||||
type: 'message',
|
||||
type: SCThingType.Message,
|
||||
uid: 'foo',
|
||||
};
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ import {
|
||||
SCMessage,
|
||||
SCThingUpdateResponse,
|
||||
SCThingUpdateRoute,
|
||||
SCThingType,
|
||||
SCThingOriginType,
|
||||
} from '@openstapps/core';
|
||||
import * as chai from 'chai';
|
||||
import {expect} from 'chai';
|
||||
@@ -61,7 +63,7 @@ export class ConnectorClientSpec {
|
||||
expiration: moment().add(1800, 'seconds').format(),
|
||||
source: 'foo',
|
||||
state: 'in progress',
|
||||
type: 'message',
|
||||
type: SCThingType.Message,
|
||||
uid: 'foo',
|
||||
},
|
||||
headers: {},
|
||||
@@ -72,13 +74,13 @@ export class ConnectorClientSpec {
|
||||
expect(httpClient.request).not.to.have.been.called();
|
||||
|
||||
const connectorClient = new ConnectorClient(httpClient, 'http://localhost');
|
||||
await connectorClient.bulk('message', 'foo', 1800);
|
||||
await connectorClient.bulk(SCThingType.Message, 'foo', 1800);
|
||||
|
||||
expect(httpClient.request).to.have.been.first.called.with({
|
||||
body: {
|
||||
expiration: moment().add(1800, 'seconds').format(),
|
||||
source: 'foo',
|
||||
type: 'message',
|
||||
type: SCThingType.Message,
|
||||
},
|
||||
headers: {},
|
||||
method: bulkRoute.method,
|
||||
@@ -94,7 +96,7 @@ export class ConnectorClientSpec {
|
||||
expiration: moment().add(3600, 'seconds').format(),
|
||||
source: 'foo',
|
||||
state: 'in progress',
|
||||
type: 'message',
|
||||
type: SCThingType.Message,
|
||||
uid: 'foo',
|
||||
},
|
||||
headers: {},
|
||||
@@ -105,13 +107,13 @@ export class ConnectorClientSpec {
|
||||
expect(httpClient.request).not.to.have.been.called();
|
||||
|
||||
const connectorClient = new ConnectorClient(httpClient, 'http://localhost');
|
||||
await connectorClient.bulk('message', 'foo');
|
||||
await connectorClient.bulk(SCThingType.Message, 'foo');
|
||||
|
||||
expect(httpClient.request).to.have.been.first.called.with({
|
||||
body: {
|
||||
expiration: moment().add(3600, 'seconds').format(),
|
||||
source: 'foo',
|
||||
type: 'message',
|
||||
type: SCThingType.Message,
|
||||
},
|
||||
headers: {},
|
||||
method: bulkRoute.method,
|
||||
@@ -131,8 +133,9 @@ export class ConnectorClientSpec {
|
||||
origin: {
|
||||
indexed: 'foo',
|
||||
name: 'foo',
|
||||
type: SCThingOriginType.Remote,
|
||||
},
|
||||
type: 'message',
|
||||
type: SCThingType.Message,
|
||||
uid: 'foo',
|
||||
},
|
||||
{
|
||||
@@ -144,8 +147,9 @@ export class ConnectorClientSpec {
|
||||
origin: {
|
||||
indexed: 'foo',
|
||||
name: 'foo',
|
||||
type: SCThingOriginType.Remote,
|
||||
},
|
||||
type: 'message',
|
||||
type: SCThingType.Message,
|
||||
uid: 'bar',
|
||||
},
|
||||
];
|
||||
@@ -160,7 +164,7 @@ export class ConnectorClientSpec {
|
||||
expiration: moment().add(3600, 'seconds').format(),
|
||||
source: 'copy',
|
||||
state: 'in progress',
|
||||
type: 'message',
|
||||
type: SCThingType.Message,
|
||||
uid: 'foo',
|
||||
},
|
||||
headers: {},
|
||||
@@ -190,7 +194,7 @@ export class ConnectorClientSpec {
|
||||
body: {
|
||||
expiration: moment().add(3600, 'seconds').format(),
|
||||
source: 'copy',
|
||||
type: 'message',
|
||||
type: SCThingType.Message,
|
||||
},
|
||||
headers: {},
|
||||
method: bulkRoute.method,
|
||||
@@ -216,8 +220,9 @@ export class ConnectorClientSpec {
|
||||
origin: {
|
||||
indexed: 'foo',
|
||||
name: 'foo',
|
||||
type: SCThingOriginType.Remote,
|
||||
},
|
||||
type: 'message',
|
||||
type: SCThingType.Message,
|
||||
uid: 'foo',
|
||||
},
|
||||
{
|
||||
@@ -229,8 +234,9 @@ export class ConnectorClientSpec {
|
||||
origin: {
|
||||
indexed: 'foo',
|
||||
name: 'foo',
|
||||
type: SCThingOriginType.Remote,
|
||||
},
|
||||
type: 'message',
|
||||
type: SCThingType.Message,
|
||||
uid: 'bar',
|
||||
},
|
||||
];
|
||||
@@ -245,7 +251,7 @@ export class ConnectorClientSpec {
|
||||
expiration: moment().add(3600, 'seconds').format(),
|
||||
source: 'stapps-api',
|
||||
state: 'in progress',
|
||||
type: 'message',
|
||||
type: SCThingType.Message,
|
||||
uid: 'foo',
|
||||
},
|
||||
headers: {},
|
||||
@@ -275,7 +281,7 @@ export class ConnectorClientSpec {
|
||||
body: {
|
||||
expiration: moment().add(3600, 'seconds').format(),
|
||||
source: 'stapps-api',
|
||||
type: 'message',
|
||||
type: SCThingType.Message,
|
||||
},
|
||||
headers: {},
|
||||
method: bulkRoute.method,
|
||||
@@ -310,8 +316,9 @@ export class ConnectorClientSpec {
|
||||
origin: {
|
||||
indexed: 'foo',
|
||||
name: 'foo',
|
||||
type: SCThingOriginType.Remote,
|
||||
},
|
||||
type: 'message',
|
||||
type: SCThingType.Message,
|
||||
uid: 'foo',
|
||||
};
|
||||
|
||||
@@ -333,7 +340,7 @@ export class ConnectorClientSpec {
|
||||
headers: {},
|
||||
method: thingUpdateRoute.method,
|
||||
url: new URL('http://localhost' + thingUpdateRoute.getUrlFragment({
|
||||
TYPE: 'message',
|
||||
TYPE: SCThingType.Message,
|
||||
UID: 'foo',
|
||||
})),
|
||||
});
|
||||
|
||||
@@ -22,6 +22,7 @@ import {
|
||||
SCSearchRequest,
|
||||
SCSearchResponse,
|
||||
SCSearchRoute,
|
||||
SCThingType,
|
||||
} from '@openstapps/core';
|
||||
import * as chai from 'chai';
|
||||
import * as chaiAsPromised from 'chai-as-promised';
|
||||
@@ -76,7 +77,7 @@ export class CopySpec {
|
||||
indexed: moment().format(),
|
||||
name: 'bar',
|
||||
},
|
||||
type: 'dish',
|
||||
type: SCThingType.Dish,
|
||||
uid: 'foo',
|
||||
}],
|
||||
facets: [],
|
||||
@@ -119,7 +120,7 @@ export class CopySpec {
|
||||
from: 'http://foo.bar',
|
||||
source: 'stapps-copy',
|
||||
to: 'http://localhost',
|
||||
type: 'dish',
|
||||
type: SCThingType.Dish,
|
||||
version: 'foo.bar.foobar',
|
||||
});
|
||||
}
|
||||
@@ -147,7 +148,7 @@ export class CopySpec {
|
||||
indexed: moment().format(),
|
||||
name: 'bar',
|
||||
},
|
||||
type: 'dish',
|
||||
type: SCThingType.Dish,
|
||||
uid: 'foo',
|
||||
}],
|
||||
facets: [],
|
||||
@@ -190,7 +191,7 @@ export class CopySpec {
|
||||
from: 'http://foo.bar',
|
||||
source: 'stapps-copy',
|
||||
to: 'http://localhost',
|
||||
type: 'dish',
|
||||
type: SCThingType.Dish,
|
||||
version: 'foo.bar.foobar',
|
||||
}).should.be.rejectedWith(ApiError);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user