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.
Files changed (61) hide show
  1. package/index.d.ts +4 -0
  2. package/index.js +17 -0
  3. package/lib/DeviceManagerPlugin.d.ts +100 -0
  4. package/lib/DeviceManagerPlugin.js +237 -0
  5. package/lib/controllers/AssetController.d.ts +7 -0
  6. package/lib/controllers/AssetController.js +53 -0
  7. package/lib/controllers/CRUDController.d.ts +34 -0
  8. package/lib/controllers/CRUDController.js +65 -0
  9. package/lib/controllers/DeviceController.d.ts +56 -0
  10. package/lib/controllers/DeviceController.js +218 -0
  11. package/lib/controllers/index.d.ts +3 -0
  12. package/lib/controllers/index.js +16 -0
  13. package/lib/core-classes/BatchProcessing/BatchController.d.ts +32 -0
  14. package/lib/core-classes/BatchProcessing/BatchController.js +86 -0
  15. package/lib/core-classes/BatchProcessing/BatchWriter.d.ts +110 -0
  16. package/lib/core-classes/BatchProcessing/BatchWriter.js +264 -0
  17. package/lib/core-classes/BatchProcessing/InstrumentablePromise.d.ts +6 -0
  18. package/lib/core-classes/BatchProcessing/InstrumentablePromise.js +13 -0
  19. package/lib/core-classes/BatchProcessing/index.d.ts +3 -0
  20. package/lib/core-classes/BatchProcessing/index.js +16 -0
  21. package/lib/core-classes/CustomMappings/AssetMappingsManager.d.ts +31 -0
  22. package/lib/core-classes/CustomMappings/AssetMappingsManager.js +79 -0
  23. package/lib/core-classes/CustomMappings/DeviceMappingsManager.d.ts +43 -0
  24. package/lib/core-classes/CustomMappings/DeviceMappingsManager.js +71 -0
  25. package/lib/core-classes/Decoder.d.ts +133 -0
  26. package/lib/core-classes/Decoder.js +166 -0
  27. package/lib/core-classes/DeviceManagerEngine.d.ts +21 -0
  28. package/lib/core-classes/DeviceManagerEngine.js +64 -0
  29. package/lib/core-classes/DeviceService.d.ts +41 -0
  30. package/lib/core-classes/DeviceService.js +264 -0
  31. package/lib/core-classes/MigrationService.d.ts +13 -0
  32. package/lib/core-classes/MigrationService.js +49 -0
  33. package/lib/core-classes/PayloadService.d.ts +43 -0
  34. package/lib/core-classes/PayloadService.js +191 -0
  35. package/lib/core-classes/index.d.ts +8 -0
  36. package/lib/core-classes/index.js +21 -0
  37. package/lib/models/BaseAsset.d.ts +56 -0
  38. package/lib/models/BaseAsset.js +58 -0
  39. package/lib/models/Catalog.d.ts +55 -0
  40. package/lib/models/Catalog.js +38 -0
  41. package/lib/models/Config.d.ts +33 -0
  42. package/lib/models/Config.js +26 -0
  43. package/lib/models/Device.d.ts +102 -0
  44. package/lib/models/Device.js +91 -0
  45. package/lib/models/index.d.ts +3 -0
  46. package/lib/models/index.js +16 -0
  47. package/lib/types/AssetsHistoryContent.d.ts +9 -0
  48. package/lib/types/AssetsHistoryContent.js +3 -0
  49. package/lib/types/BaseAssetContent.d.ts +8 -0
  50. package/lib/types/BaseAssetContent.js +3 -0
  51. package/lib/types/DeviceContent.d.ts +62 -0
  52. package/lib/types/DeviceContent.js +3 -0
  53. package/lib/types/Measure.d.ts +54 -0
  54. package/lib/types/Measure.js +3 -0
  55. package/lib/types/index.d.ts +3 -0
  56. package/lib/types/index.js +16 -0
  57. package/lib/utils/events.d.ts +8 -0
  58. package/lib/utils/events.js +17 -0
  59. package/lib/utils/index.d.ts +1 -0
  60. package/lib/utils/index.js +14 -0
  61. 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,9 @@
1
+ import { BaseAssetContent } from './BaseAssetContent';
2
+ export interface AssetsHistoryContent {
3
+ assetId: string;
4
+ /**
5
+ * Names of measures historized in the document
6
+ */
7
+ measureTypes: string[];
8
+ asset: BaseAssetContent;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=AssetsHistoryContent.js.map
@@ -0,0 +1,8 @@
1
+ import { JSONObject } from "kuzzle";
2
+ export interface BaseAssetContent {
3
+ type: string;
4
+ model: string;
5
+ reference: string;
6
+ measures?: JSONObject;
7
+ metadata?: JSONObject;
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=BaseAssetContent.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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=DeviceContent.js.map
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Measure.js.map
@@ -0,0 +1,3 @@
1
+ export * from './Measure';
2
+ export * from './DeviceContent';
3
+ export * from './BaseAssetContent';
@@ -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.8",
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": {