kuzzle-device-manager 0.4.8 → 0.4.9
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/index.d.ts +4 -0
- package/index.js +17 -0
- package/lib/DeviceManagerPlugin.d.ts +100 -0
- package/lib/DeviceManagerPlugin.js +237 -0
- package/lib/controllers/AssetController.d.ts +7 -0
- package/lib/controllers/AssetController.js +53 -0
- package/lib/controllers/CRUDController.d.ts +34 -0
- package/lib/controllers/CRUDController.js +65 -0
- package/lib/controllers/DeviceController.d.ts +56 -0
- package/lib/controllers/DeviceController.js +218 -0
- package/lib/controllers/index.d.ts +3 -0
- package/lib/controllers/index.js +16 -0
- package/lib/core-classes/BatchProcessing/BatchController.d.ts +32 -0
- package/lib/core-classes/BatchProcessing/BatchController.js +86 -0
- package/lib/core-classes/BatchProcessing/BatchWriter.d.ts +110 -0
- package/lib/core-classes/BatchProcessing/BatchWriter.js +264 -0
- package/lib/core-classes/BatchProcessing/InstrumentablePromise.d.ts +6 -0
- package/lib/core-classes/BatchProcessing/InstrumentablePromise.js +13 -0
- package/lib/core-classes/BatchProcessing/index.d.ts +3 -0
- package/lib/core-classes/BatchProcessing/index.js +16 -0
- package/lib/core-classes/CustomMappings/AssetMappingsManager.d.ts +31 -0
- package/lib/core-classes/CustomMappings/AssetMappingsManager.js +79 -0
- package/lib/core-classes/CustomMappings/DeviceMappingsManager.d.ts +43 -0
- package/lib/core-classes/CustomMappings/DeviceMappingsManager.js +71 -0
- package/lib/core-classes/Decoder.d.ts +133 -0
- package/lib/core-classes/Decoder.js +166 -0
- package/lib/core-classes/DeviceManagerEngine.d.ts +21 -0
- package/lib/core-classes/DeviceManagerEngine.js +64 -0
- package/lib/core-classes/DeviceService.d.ts +41 -0
- package/lib/core-classes/DeviceService.js +264 -0
- package/lib/core-classes/MigrationService.d.ts +13 -0
- package/lib/core-classes/MigrationService.js +49 -0
- package/lib/core-classes/PayloadService.d.ts +43 -0
- package/lib/core-classes/PayloadService.js +191 -0
- package/lib/core-classes/index.d.ts +8 -0
- package/lib/core-classes/index.js +21 -0
- package/lib/models/BaseAsset.d.ts +56 -0
- package/lib/models/BaseAsset.js +58 -0
- package/lib/models/Catalog.d.ts +55 -0
- package/lib/models/Catalog.js +38 -0
- package/lib/models/Config.d.ts +33 -0
- package/lib/models/Config.js +26 -0
- package/lib/models/Device.d.ts +102 -0
- package/lib/models/Device.js +91 -0
- package/lib/models/index.d.ts +3 -0
- package/lib/models/index.js +16 -0
- package/lib/types/AssetsHistoryContent.d.ts +9 -0
- package/lib/types/AssetsHistoryContent.js +3 -0
- package/lib/types/BaseAssetContent.d.ts +8 -0
- package/lib/types/BaseAssetContent.js +3 -0
- package/lib/types/DeviceContent.d.ts +62 -0
- package/lib/types/DeviceContent.js +3 -0
- package/lib/types/Measure.d.ts +54 -0
- package/lib/types/Measure.js +3 -0
- package/lib/types/index.d.ts +3 -0
- package/lib/types/index.js +16 -0
- package/lib/utils/events.d.ts +8 -0
- package/lib/utils/events.js +17 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +14 -0
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./Device"), exports);
|
|
14
|
+
__exportStar(require("./BaseAsset"), exports);
|
|
15
|
+
__exportStar(require("./Catalog"), exports);
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { JSONObject } from 'kuzzle';
|
|
2
|
+
import { DeviceMeasures } from './Measure';
|
|
3
|
+
export declare type DeviceContent = {
|
|
4
|
+
/**
|
|
5
|
+
* Device unique reference for a model
|
|
6
|
+
*/
|
|
7
|
+
reference: string;
|
|
8
|
+
/**
|
|
9
|
+
* Device measures gathered from a payload
|
|
10
|
+
*/
|
|
11
|
+
measures?: DeviceMeasures;
|
|
12
|
+
/**
|
|
13
|
+
* Device model
|
|
14
|
+
* (This will be auto-filled by Kuzzle)
|
|
15
|
+
*/
|
|
16
|
+
model?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Device additionnal informations gathered from a payload
|
|
19
|
+
* (e.g. battery, network strength, etc.)
|
|
20
|
+
*/
|
|
21
|
+
qos?: JSONObject;
|
|
22
|
+
/**
|
|
23
|
+
* Device metadata
|
|
24
|
+
*/
|
|
25
|
+
metadata?: JSONObject;
|
|
26
|
+
/**
|
|
27
|
+
* Linked asset unique identifier
|
|
28
|
+
*/
|
|
29
|
+
assetId?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Attached tenant ID (index name)
|
|
32
|
+
*/
|
|
33
|
+
tenantId?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Document metadata
|
|
36
|
+
* @todo use DocumentMetadata when it's not an interface anymore
|
|
37
|
+
*/
|
|
38
|
+
_kuzzle_info?: {
|
|
39
|
+
author?: string;
|
|
40
|
+
createdAt?: number;
|
|
41
|
+
updater?: string | null;
|
|
42
|
+
updatedAt?: number | null;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export declare type DeviceBulkContent = {
|
|
46
|
+
tenantId?: string;
|
|
47
|
+
deviceId: string;
|
|
48
|
+
assetId?: string;
|
|
49
|
+
};
|
|
50
|
+
export declare type DeviceBulkBuildedContent = {
|
|
51
|
+
tenantId: string;
|
|
52
|
+
deviceIds: string[];
|
|
53
|
+
assetIds: string[];
|
|
54
|
+
};
|
|
55
|
+
export declare type DeviceMAttachementContent = {
|
|
56
|
+
errors: JSONObject[];
|
|
57
|
+
successes: JSONObject[];
|
|
58
|
+
};
|
|
59
|
+
export declare type DeviceMRequestContent = {
|
|
60
|
+
_id: string;
|
|
61
|
+
body: JSONObject;
|
|
62
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { JSONObject } from 'kuzzle';
|
|
2
|
+
export interface BaseMeasure {
|
|
3
|
+
/**
|
|
4
|
+
* Date of the measure
|
|
5
|
+
*/
|
|
6
|
+
updatedAt: number;
|
|
7
|
+
/**
|
|
8
|
+
* The payload uuid is auto-generated by Kuzzle
|
|
9
|
+
*/
|
|
10
|
+
payloadUuid?: string;
|
|
11
|
+
[property: string]: any;
|
|
12
|
+
}
|
|
13
|
+
export interface PositionMeasure extends BaseMeasure {
|
|
14
|
+
point: {
|
|
15
|
+
lat: number;
|
|
16
|
+
lon: number;
|
|
17
|
+
};
|
|
18
|
+
altitude?: number;
|
|
19
|
+
accuracy?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface TemperatureMeasure extends BaseMeasure {
|
|
22
|
+
degree: number;
|
|
23
|
+
}
|
|
24
|
+
export interface MovementMeasure extends BaseMeasure {
|
|
25
|
+
moving: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare type Measure = BaseMeasure;
|
|
28
|
+
export declare type DeviceMeasures = {
|
|
29
|
+
position?: PositionMeasure;
|
|
30
|
+
temperature?: TemperatureMeasure;
|
|
31
|
+
movement?: MovementMeasure;
|
|
32
|
+
[measureType: string]: Measure;
|
|
33
|
+
};
|
|
34
|
+
export interface BaseAssetMeasure extends BaseMeasure {
|
|
35
|
+
/**
|
|
36
|
+
* Device ID
|
|
37
|
+
*/
|
|
38
|
+
id: string;
|
|
39
|
+
/**
|
|
40
|
+
* Device model
|
|
41
|
+
*/
|
|
42
|
+
model: string;
|
|
43
|
+
/**
|
|
44
|
+
* Device reference
|
|
45
|
+
*/
|
|
46
|
+
reference: string;
|
|
47
|
+
/**
|
|
48
|
+
* Device metadata
|
|
49
|
+
*/
|
|
50
|
+
metadata: JSONObject;
|
|
51
|
+
}
|
|
52
|
+
export declare type AssetMeasures = {
|
|
53
|
+
[measureType: string]: BaseAssetMeasure;
|
|
54
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./Measure"), exports);
|
|
14
|
+
__exportStar(require("./DeviceContent"), exports);
|
|
15
|
+
__exportStar(require("./BaseAssetContent"), exports);
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { KuzzleRequest, JSONObject } from 'kuzzle';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a KuzzleRequest containing the payload in the result property.
|
|
4
|
+
*
|
|
5
|
+
* This is used to trigger event with payload that can be used by the workflow
|
|
6
|
+
* plugin.
|
|
7
|
+
*/
|
|
8
|
+
export declare function eventPayload(payload: JSONObject): KuzzleRequest;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.eventPayload = void 0;
|
|
4
|
+
const kuzzle_1 = require("kuzzle");
|
|
5
|
+
/**
|
|
6
|
+
* Returns a KuzzleRequest containing the payload in the result property.
|
|
7
|
+
*
|
|
8
|
+
* This is used to trigger event with payload that can be used by the workflow
|
|
9
|
+
* plugin.
|
|
10
|
+
*/
|
|
11
|
+
function eventPayload(payload) {
|
|
12
|
+
return new kuzzle_1.KuzzleRequest({}, {
|
|
13
|
+
result: payload
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
exports.eventPayload = eventPayload;
|
|
17
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './events';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./events"), exports);
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kuzzle-device-manager",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.9",
|
|
4
4
|
"description": "Manage your IoT devices and assets. Choose a provisionning strategy, receive and decode payload, handle your IoT business logic.",
|
|
5
5
|
"author": "The Kuzzle Team (support@kuzzle.io)",
|
|
6
6
|
"repository": {
|