kuzzle-device-manager 2.3.2 → 2.4.0-beta.1-2
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/dist/lib/modules/asset/AssetsController.d.ts +5 -4
- package/dist/lib/modules/asset/AssetsController.js +88 -23
- package/dist/lib/modules/asset/AssetsController.js.map +1 -1
- package/dist/lib/modules/asset/collections/assetsMappings.js +1 -0
- package/dist/lib/modules/asset/collections/assetsMappings.js.map +1 -1
- package/dist/lib/modules/asset/types/AssetApi.d.ts +13 -0
- package/dist/lib/modules/decoder/PayloadService.js +1 -0
- package/dist/lib/modules/decoder/PayloadService.js.map +1 -1
- package/dist/lib/modules/device/DeviceService.js +1 -0
- package/dist/lib/modules/device/DeviceService.js.map +1 -1
- package/dist/lib/modules/device/DevicesController.d.ts +5 -4
- package/dist/lib/modules/device/DevicesController.js +86 -24
- package/dist/lib/modules/device/DevicesController.js.map +1 -1
- package/dist/lib/modules/device/collections/deviceMappings.d.ts +3 -0
- package/dist/lib/modules/device/collections/deviceMappings.js +1 -0
- package/dist/lib/modules/device/collections/deviceMappings.js.map +1 -1
- package/dist/lib/modules/device/types/DeviceApi.d.ts +13 -0
- package/dist/lib/modules/measure/MeasureExporter.d.ts +23 -33
- package/dist/lib/modules/measure/MeasureExporter.js +84 -104
- package/dist/lib/modules/measure/MeasureExporter.js.map +1 -1
- package/dist/lib/modules/measure/MeasureService.js +10 -0
- package/dist/lib/modules/measure/MeasureService.js.map +1 -1
- package/dist/lib/modules/shared/index.d.ts +1 -0
- package/dist/lib/modules/shared/index.js +1 -0
- package/dist/lib/modules/shared/index.js.map +1 -1
- package/dist/lib/modules/shared/services/AbstractExporter.d.ts +53 -0
- package/dist/lib/modules/shared/services/AbstractExporter.js +87 -0
- package/dist/lib/modules/shared/services/AbstractExporter.js.map +1 -0
- package/dist/lib/modules/shared/services/DigitalTwinExporter.d.ts +14 -0
- package/dist/lib/modules/shared/services/DigitalTwinExporter.js +89 -0
- package/dist/lib/modules/shared/services/DigitalTwinExporter.js.map +1 -0
- package/dist/lib/modules/shared/services/index.d.ts +2 -0
- package/dist/lib/modules/shared/services/index.js +19 -0
- package/dist/lib/modules/shared/services/index.js.map +1 -0
- package/dist/lib/modules/shared/types/DigitalTwinContent.d.ts +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import { UUID } from "node:crypto";
|
|
4
|
+
import { PassThrough, Readable } from "node:stream";
|
|
5
|
+
import { JSONObject, KDocumentContentGeneric, KHit, SearchResult, User } from "kuzzle";
|
|
6
|
+
import { EngineContent } from "kuzzle-plugin-commons";
|
|
7
|
+
import { DeviceManagerPlugin, InternalCollection } from "../../plugin";
|
|
8
|
+
export interface ExporterOption {
|
|
9
|
+
/**
|
|
10
|
+
* Expiration time of export in seconds before being invalid
|
|
11
|
+
*/
|
|
12
|
+
expireTime: number;
|
|
13
|
+
}
|
|
14
|
+
export interface ExportParams {
|
|
15
|
+
query: JSONObject;
|
|
16
|
+
sort?: JSONObject;
|
|
17
|
+
lang?: "elasticsearch" | "koncorde";
|
|
18
|
+
}
|
|
19
|
+
export interface Column {
|
|
20
|
+
header: string;
|
|
21
|
+
path: string;
|
|
22
|
+
isMeasure?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare abstract class AbstractExporter<P extends ExportParams = ExportParams> {
|
|
25
|
+
protected plugin: DeviceManagerPlugin;
|
|
26
|
+
protected target: InternalCollection;
|
|
27
|
+
protected config: ExporterOption;
|
|
28
|
+
constructor(plugin: DeviceManagerPlugin, target: InternalCollection, config?: Partial<ExporterOption>);
|
|
29
|
+
protected get sdk(): import("kuzzle").EmbeddedSDK;
|
|
30
|
+
protected get ms(): any;
|
|
31
|
+
protected get log(): {
|
|
32
|
+
debug: (message: any) => void;
|
|
33
|
+
error: (message: any) => void;
|
|
34
|
+
info: (message: any) => void;
|
|
35
|
+
silly: (message: any) => void;
|
|
36
|
+
verbose: (message: any) => void;
|
|
37
|
+
warn: (message: any) => void;
|
|
38
|
+
};
|
|
39
|
+
protected getEngine(engineId: string): Promise<EngineContent>;
|
|
40
|
+
protected abstract exportRedisKey(engineId: string, exportId: string): string;
|
|
41
|
+
protected abstract getLink(engineId: string, exportId: UUID, params: P): string;
|
|
42
|
+
/**
|
|
43
|
+
* Retrieve a prepared export and write each document as a CSV in the stream
|
|
44
|
+
*
|
|
45
|
+
* This method never returns a rejected promise, but write potential error in
|
|
46
|
+
* the stream.
|
|
47
|
+
*/
|
|
48
|
+
abstract sendExport(engineId: string, exportId: string): Promise<Readable>;
|
|
49
|
+
prepareExport(engineId: string, user: User, params: P): Promise<string>;
|
|
50
|
+
protected formatHit(columns: Column[], hit: KHit<KDocumentContentGeneric>): string[];
|
|
51
|
+
getExport(engineId: string, exportId: string): Promise<P>;
|
|
52
|
+
getExportStream(request: SearchResult<KHit<KDocumentContentGeneric>>, columns: Column[]): Promise<PassThrough>;
|
|
53
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AbstractExporter = void 0;
|
|
7
|
+
const node_crypto_1 = require("node:crypto");
|
|
8
|
+
const node_stream_1 = require("node:stream");
|
|
9
|
+
const sync_1 = require("csv-stringify/sync");
|
|
10
|
+
const kuzzle_1 = require("kuzzle");
|
|
11
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
12
|
+
const plugin_1 = require("../../plugin");
|
|
13
|
+
class AbstractExporter {
|
|
14
|
+
constructor(plugin, target, config = {}) {
|
|
15
|
+
this.plugin = plugin;
|
|
16
|
+
this.target = target;
|
|
17
|
+
this.config = {
|
|
18
|
+
expireTime: 2 * 60,
|
|
19
|
+
};
|
|
20
|
+
if (Object.keys(config).length > 0) {
|
|
21
|
+
this.config = {
|
|
22
|
+
...this.config,
|
|
23
|
+
...config,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
get sdk() {
|
|
28
|
+
return this.plugin.context.accessors.sdk;
|
|
29
|
+
}
|
|
30
|
+
get ms() {
|
|
31
|
+
return this.sdk.ms;
|
|
32
|
+
}
|
|
33
|
+
get log() {
|
|
34
|
+
return this.plugin.context.log;
|
|
35
|
+
}
|
|
36
|
+
async getEngine(engineId) {
|
|
37
|
+
const engine = await this.sdk.document.get(this.plugin.config.adminIndex, plugin_1.InternalCollection.CONFIG, `engine-device-manager--${engineId}`);
|
|
38
|
+
return engine._source.engine;
|
|
39
|
+
}
|
|
40
|
+
async prepareExport(engineId, user, params) {
|
|
41
|
+
const exportId = (0, node_crypto_1.randomUUID)();
|
|
42
|
+
await this.ms.setex(this.exportRedisKey(engineId, exportId), JSON.stringify(params), this.config.expireTime);
|
|
43
|
+
let link = this.getLink(engineId, exportId, params);
|
|
44
|
+
if (user._id !== "-1") {
|
|
45
|
+
const { result } = await this.sdk.as(user).query({
|
|
46
|
+
action: "createToken",
|
|
47
|
+
controller: "auth",
|
|
48
|
+
expiresIn: this.config.expireTime * 1000,
|
|
49
|
+
singleUse: true,
|
|
50
|
+
});
|
|
51
|
+
link += `?jwt=${result.token}`;
|
|
52
|
+
}
|
|
53
|
+
return link;
|
|
54
|
+
}
|
|
55
|
+
formatHit(columns, hit) {
|
|
56
|
+
return columns.map(({ path }) => lodash_1.default.get(hit, path, null));
|
|
57
|
+
}
|
|
58
|
+
async getExport(engineId, exportId) {
|
|
59
|
+
const exportParams = await this.sdk.ms.get(this.exportRedisKey(engineId, exportId));
|
|
60
|
+
if (!exportParams) {
|
|
61
|
+
throw new kuzzle_1.NotFoundError(`Export "${exportId}" not found or expired.`);
|
|
62
|
+
}
|
|
63
|
+
return JSON.parse(exportParams);
|
|
64
|
+
}
|
|
65
|
+
async getExportStream(request, columns) {
|
|
66
|
+
const stream = new node_stream_1.PassThrough();
|
|
67
|
+
let result = request;
|
|
68
|
+
try {
|
|
69
|
+
stream.write((0, sync_1.stringify)([columns.map((column) => column.header)]));
|
|
70
|
+
while (result) {
|
|
71
|
+
for (const hit of result.hits) {
|
|
72
|
+
stream.write((0, sync_1.stringify)([this.formatHit(columns, hit)]));
|
|
73
|
+
}
|
|
74
|
+
result = result.fetched < 10000 ? await result.next() : null;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
stream.write(error.message);
|
|
79
|
+
}
|
|
80
|
+
finally {
|
|
81
|
+
stream.end();
|
|
82
|
+
}
|
|
83
|
+
return stream;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.AbstractExporter = AbstractExporter;
|
|
87
|
+
//# sourceMappingURL=AbstractExporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbstractExporter.js","sourceRoot":"","sources":["../../../../../lib/modules/shared/services/AbstractExporter.ts"],"names":[],"mappings":";;;;;;AAAA,6CAA+C;AAC/C,6CAAoD;AACpD,6CAA+C;AAC/C,mCAOgB;AAEhB,oDAAuB;AAEvB,yCAAuE;AAqBvE,MAAsB,gBAAgB;IAKpC,YACY,MAA2B,EAC3B,MAA0B,EACpC,SAAkC,EAAE;QAF1B,WAAM,GAAN,MAAM,CAAqB;QAC3B,WAAM,GAAN,MAAM,CAAoB;QAN5B,WAAM,GAAmB;YACjC,UAAU,EAAE,CAAC,GAAG,EAAE;SACnB,CAAC;QAOA,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YAClC,IAAI,CAAC,MAAM,GAAG;gBACZ,GAAG,IAAI,CAAC,MAAM;gBACd,GAAG,MAAM;aACV,CAAC;SACH;IACH,CAAC;IAED,IAAc,GAAG;QACf,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SA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CAAC,CAAC,CAAC,IAAI,CAAC;aAC9D;SACF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;SAC7B;gBAAS;YACR,MAAM,CAAC,GAAG,EAAE,CAAC;SACd;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AA5HD,4CA4HC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import { UUID } from "node:crypto";
|
|
4
|
+
import { AbstractExporter } from "./AbstractExporter";
|
|
5
|
+
export declare class DigitalTwinExporter extends AbstractExporter {
|
|
6
|
+
protected exportRedisKey(engineId: string, exportId: string): string;
|
|
7
|
+
protected getLink(engineId: string, exportId: UUID): string;
|
|
8
|
+
sendExport(engineId: string, exportId: string): Promise<import("stream").PassThrough>;
|
|
9
|
+
/**
|
|
10
|
+
* Get the deduplicated Named Measures get from models
|
|
11
|
+
*/
|
|
12
|
+
private getNamedMeasures;
|
|
13
|
+
private generateMeasureColumns;
|
|
14
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DigitalTwinExporter = void 0;
|
|
4
|
+
const plugin_1 = require("../../plugin");
|
|
5
|
+
const __1 = require("../");
|
|
6
|
+
const AbstractExporter_1 = require("./AbstractExporter");
|
|
7
|
+
class DigitalTwinExporter extends AbstractExporter_1.AbstractExporter {
|
|
8
|
+
exportRedisKey(engineId, exportId) {
|
|
9
|
+
return `exports:${engineId}:${this.target}:${exportId}`;
|
|
10
|
+
}
|
|
11
|
+
getLink(engineId, exportId) {
|
|
12
|
+
return `/_/device-manager/${engineId}/${this.target}/_export/${exportId}`;
|
|
13
|
+
}
|
|
14
|
+
async sendExport(engineId, exportId) {
|
|
15
|
+
const { query, sort, lang = "elasticsearch", } = await this.getExport(engineId, exportId);
|
|
16
|
+
const digitalTwins = await this.sdk.document.search(engineId, this.target, { query, sort }, { lang, size: 200 });
|
|
17
|
+
const namedMeasures = await this.getNamedMeasures(engineId);
|
|
18
|
+
const measureColumns = await this.generateMeasureColumns(namedMeasures);
|
|
19
|
+
const columns = [
|
|
20
|
+
{ header: "Model", path: "_source.model" },
|
|
21
|
+
{ header: "Reference", path: "_source.reference" },
|
|
22
|
+
...measureColumns,
|
|
23
|
+
{ header: "lastMeasuredAt", path: "_source.lastMeasuredAt" },
|
|
24
|
+
];
|
|
25
|
+
const stream = this.getExportStream(digitalTwins, columns);
|
|
26
|
+
await this.sdk.ms.del(this.exportRedisKey(engineId, exportId));
|
|
27
|
+
return stream;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Get the deduplicated Named Measures get from models
|
|
31
|
+
*/
|
|
32
|
+
async getNamedMeasures(engineId) {
|
|
33
|
+
const type = this.target === plugin_1.InternalCollection.ASSETS ? "asset" : "device";
|
|
34
|
+
const query = {
|
|
35
|
+
and: [{ equals: { type } }],
|
|
36
|
+
};
|
|
37
|
+
if (this.target === plugin_1.InternalCollection.ASSETS) {
|
|
38
|
+
const engine = await this.getEngine(engineId);
|
|
39
|
+
query.and.push({ equals: { engineGroup: engine.group } });
|
|
40
|
+
}
|
|
41
|
+
let result = await this.sdk.document.search(this.plugin.config.adminIndex, plugin_1.InternalCollection.MODELS, {
|
|
42
|
+
query: { equals: { type } },
|
|
43
|
+
}, { lang: "koncorde" });
|
|
44
|
+
// ? Use a map to dedup the NamedMeasures get from models
|
|
45
|
+
const namedMeasures = new Map();
|
|
46
|
+
while (result) {
|
|
47
|
+
for (const { _source } of result.hits) {
|
|
48
|
+
for (const namedMeasure of _source[type].measures) {
|
|
49
|
+
if (!namedMeasures.has(namedMeasure.name)) {
|
|
50
|
+
namedMeasures.set(namedMeasure.name, namedMeasure);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
result = await result.next();
|
|
55
|
+
}
|
|
56
|
+
// ? Ensure stable measures order
|
|
57
|
+
return [...namedMeasures.values()].sort((a, b) => {
|
|
58
|
+
if (a.name < b.name) {
|
|
59
|
+
return -1;
|
|
60
|
+
}
|
|
61
|
+
if (a.name > b.name) {
|
|
62
|
+
return 1;
|
|
63
|
+
}
|
|
64
|
+
return 0;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
async generateMeasureColumns(namedMeasures) {
|
|
68
|
+
const columns = [];
|
|
69
|
+
const measuresPath = new Map();
|
|
70
|
+
for (const { name, type } of namedMeasures) {
|
|
71
|
+
if (!measuresPath.has(name)) {
|
|
72
|
+
const { measure: measureDefinition } = await (0, __1.ask)("ask:device-manager:model:measure:get", { type });
|
|
73
|
+
const flattenMeasuresPath = Object.keys((0, __1.flattenObject)(measureDefinition.valuesMappings)).map((path) => path.replace(".type", "").replace(".properties", ""));
|
|
74
|
+
measuresPath.set(name, flattenMeasuresPath);
|
|
75
|
+
}
|
|
76
|
+
for (const path of measuresPath.get(name)) {
|
|
77
|
+
const header = `${name}.${path}`.replace(`${name}.${type}`, name);
|
|
78
|
+
columns.push({
|
|
79
|
+
header,
|
|
80
|
+
isMeasure: true,
|
|
81
|
+
path: `_source.measures.${name}.values.${path}`,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return columns;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.DigitalTwinExporter = DigitalTwinExporter;
|
|
89
|
+
//# sourceMappingURL=DigitalTwinExporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DigitalTwinExporter.js","sourceRoot":"","sources":["../../../../../lib/modules/shared/services/DigitalTwinExporter.ts"],"names":[],"mappings":";;;AAIA,yCAAkD;AAMlD,2BAA6D;AAC7D,yDAA8D;AAM9D,MAAa,mBAAoB,SAAQ,mCAAgB;IAC7C,cAAc,CAAC,QAAgB,EAAE,QAAgB;QACzD,OAAO,WAAW,QAAQ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AC,GAAG,IAAI,IAAI,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC;gBAElE,OAAO,CAAC,IAAI,CAAC;oBACX,MAAM;oBACN,SAAS,EAAE,IAAI;oBACf,IAAI,EAAE,oBAAoB,IAAI,WAAW,IAAI,EAAE;iBAChD,CAAC,CAAC;aACJ;SACF;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AA1HD,kDA0HC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./AbstractExporter"), exports);
|
|
18
|
+
__exportStar(require("./DigitalTwinExporter"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../lib/modules/shared/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,wDAAsC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kuzzle-device-manager",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0-beta.1-2",
|
|
4
4
|
"description": "Manage your IoT devices and assets. Choose a provisioning strategy, receive and decode payload, handle your IoT business logic.",
|
|
5
5
|
"author": "The Kuzzle Team (support@kuzzle.io)",
|
|
6
6
|
"repository": {
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"@types/lodash": "^4.14.195",
|
|
41
41
|
"@types/node": "^18.15.13",
|
|
42
42
|
"axios": "^1.3.6",
|
|
43
|
+
"csv-parse": "^5.4.0",
|
|
43
44
|
"cz-conventional-changelog": "^3.3.0",
|
|
44
45
|
"ergol": "^1.0.2",
|
|
45
46
|
"eslint-plugin-jest": "^27.2.1",
|