Skip to content

Commit 4e6c9fa

Browse files
author
Aschen
committed
Release 0.4.5
1 parent d8f333c commit 4e6c9fa

File tree

10 files changed

+19
-20
lines changed

10 files changed

+19
-20
lines changed

doc/1/guides/assets/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ It is possible to override the [Decoder.copyToAsset](/official-plugins/device-ma
8888

8989
## Historization
9090

91-
Assets are historized in the `assets-history` collection when a new measure is received.
91+
Assets are historized in the `asset-history` collection when a new measure is received.
9292

9393
Before historization, the `tenant:<tenant-id>:asset:measure:new` event is emitted.
9494

features/Engine.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Feature: Engine Controller
55
When I successfully execute the action "collection":"list" with args:
66
| index | "tenant-kuzzle" |
77
Then I should receive a result matching:
8-
| collections | [{"name":"assets","type":"stored"},{"name":"assets-history","type":"stored"}, {"name":"config","type":"stored"},{"name":"devices","type":"stored"}] |
8+
| collections | [{"name":"assets","type":"stored"},{"name":"asset-history","type":"stored"}, {"name":"config","type":"stored"},{"name":"devices","type":"stored"}] |
99
When I successfully execute the action "device-manager/engine":"delete" with args:
1010
| index | "tenant-kuzzle" |
1111
And I successfully execute the action "collection":"list" with args:

features/PayloadController.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ Feature: Payloads Controller
158158
| deviceEUI | "attached_ayse_linked" |
159159
| register55 | 51.1 |
160160
| batteryLevel | 0.42 |
161-
And I refresh the collection "tenant-ayse":"assets-history"
162-
And The last document from "tenant-ayse":"assets-history" content match:
161+
And I refresh the collection "tenant-ayse":"asset-history"
162+
And The last document from "tenant-ayse":"asset-history" content match:
163163
| assetId | "MART-linked" |
164164
| measureTypes | ["temperature"] |
165165
| assetId | "MART-linked" |

features/fixtures/application/app.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { Backend, Kuzzle, KuzzleRequest } from 'kuzzle';
2-
import { AssetMeasures, BaseAssetContent } from 'lib/types';
1+
import { Backend, KuzzleRequest } from 'kuzzle';
32

43
import { DeviceManagerPlugin } from '../../../index';
54
import { DummyTempDecoder, DummyTempPositionDecoder } from './decoders';

features/support/hooks.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ Before({ timeout: 30 * 1000 }, async function () {
7373
removeCatalogEntries(this.sdk, 'device-manager'),
7474

7575
truncateCollection(this.sdk, 'tenant-kuzzle', 'assets'),
76-
truncateCollection(this.sdk, 'tenant-kuzzle', 'assets-history'),
76+
truncateCollection(this.sdk, 'tenant-kuzzle', 'asset-history'),
7777
truncateCollection(this.sdk, 'tenant-kuzzle', 'devices'),
7878

7979
truncateCollection(this.sdk, 'tenant-ayse', 'assets'),
80-
truncateCollection(this.sdk, 'tenant-ayse', 'assets-history'),
80+
truncateCollection(this.sdk, 'tenant-ayse', 'asset-history'),
8181
truncateCollection(this.sdk, 'tenant-ayse', 'devices'),
8282
removeCatalogEntries(this.sdk, 'tenant-ayse'),
8383
]);

lib/DeviceManagerPlugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export type DeviceManagerConfig = {
6464

6565
devices: JSONObject;
6666

67-
'assets-history': JSONObject;
67+
'asset-history': JSONObject;
6868
},
6969

7070
/**
@@ -167,7 +167,7 @@ export class DeviceManagerPlugin extends Plugin {
167167
collections: {
168168
assets: assetsMappings,
169169
devices: devicesMappings,
170-
'assets-history': assetsHistoryMappings,
170+
'asset-history': assetsHistoryMappings,
171171
},
172172
writerInterval: 50
173173
};

lib/core-classes/DeviceManagerEngine.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class DeviceManagerEngine extends AbstractEngine {
2626
mappings: this.assetMappings.get(group)
2727
}));
2828

29-
promises.push(this.sdk.collection.create(index, 'assets-history', {
29+
promises.push(this.sdk.collection.create(index, 'asset-history', {
3030
mappings: this.getAssetsHistoryMappings(group)
3131
}));
3232

@@ -47,7 +47,7 @@ export class DeviceManagerEngine extends AbstractEngine {
4747

4848
await Promise.all(promises);
4949

50-
return { collections: ['assets', 'assets-history', this.config.configCollection, 'devices'] };
50+
return { collections: ['assets', 'asset-history', this.config.configCollection, 'devices'] };
5151
}
5252

5353
async onUpdate (index: string, group = 'commons') {
@@ -57,7 +57,7 @@ export class DeviceManagerEngine extends AbstractEngine {
5757
mappings: this.assetMappings.get(group)
5858
}));
5959

60-
promises.push(this.sdk.collection.create(index, 'assets-history', {
60+
promises.push(this.sdk.collection.create(index, 'asset-history', {
6161
mappings: this.getAssetsHistoryMappings(group)
6262
}));
6363

@@ -67,23 +67,23 @@ export class DeviceManagerEngine extends AbstractEngine {
6767

6868
await Promise.all(promises);
6969

70-
return { collections: ['assets', 'assets-history', 'devices'] };
70+
return { collections: ['assets', 'asset-history', 'devices'] };
7171
}
7272

7373
async onDelete (index: string) {
7474
const promises = [];
7575

7676
promises.push(this.sdk.collection.delete(index, 'assets'));
77-
promises.push(this.sdk.collection.delete(index, 'assets-history'));
77+
promises.push(this.sdk.collection.delete(index, 'asset-history'));
7878
promises.push(this.sdk.collection.delete(index, 'devices'));
7979

8080
await Promise.all(promises);
8181

82-
return { collections: ['assets', 'assets-history', 'devices'] };
82+
return { collections: ['assets', 'asset-history', 'devices'] };
8383
}
8484

8585
private getAssetsHistoryMappings (group: string) {
86-
const mappings = JSON.parse(JSON.stringify(this.config.collections['assets-history']));
86+
const mappings = JSON.parse(JSON.stringify(this.config.collections['asset-history']));
8787

8888
mappings.properties.asset = this.assetMappings.get(group);
8989

lib/core-classes/PayloadService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ export class PayloadService {
319319
private async historizeAsset (tenantId: string, asset: BaseAsset) {
320320
await this.batchController.create(
321321
tenantId,
322-
'assets-history',
322+
'asset-history',
323323
{
324324
assetId: asset._id,
325325
measureTypes: Object.keys(asset._source.measures),

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kuzzleio/plugin-device-manager",
3-
"version": "0.4.4",
3+
"version": "0.4.5",
44
"description": "Manage your IoT devices and assets. Choose a provisionning strategy, receive and decode payload, handle your IoT business logic.",
55
"author": "The Kuzzle Team (support@kuzzle.io)",
66
"repository": {

0 commit comments

Comments
 (0)