@xube/kit-aws-hooks 0.0.55 → 0.0.57
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/transform.d.ts +2 -1
- package/dist/transform.js +4 -1
- package/package.json +8 -8
- package/src/transform.ts +8 -1
package/dist/transform.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TableItem } from "@xube/kit-aws-schema";
|
|
2
|
+
import { XubeLog } from "@xube/kit-log";
|
|
2
3
|
export declare const stageDataForSend: (items: TableItem[]) => void;
|
|
3
|
-
export declare const getTimeSeriesDataFromData: (items: TableItem[]) => {
|
|
4
|
+
export declare const getTimeSeriesDataFromData: (items: TableItem[], log?: XubeLog) => {
|
|
4
5
|
data: (string | number | boolean | import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough">)[];
|
|
5
6
|
m: {
|
|
6
7
|
id: string;
|
package/dist/transform.js
CHANGED
|
@@ -3,13 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getTimeSeriesDataFromData = exports.stageDataForSend = void 0;
|
|
4
4
|
const kit_data_schema_1 = require("@xube/kit-data-schema");
|
|
5
5
|
const kit_data_schema_2 = require("@xube/kit-data-schema");
|
|
6
|
+
const kit_log_1 = require("@xube/kit-log");
|
|
6
7
|
const stageDataForSend = (items) => {
|
|
7
8
|
const timeSeries = (0, exports.getTimeSeriesDataFromData)(items);
|
|
8
9
|
};
|
|
9
10
|
exports.stageDataForSend = stageDataForSend;
|
|
10
|
-
const getTimeSeriesDataFromData = (items) => {
|
|
11
|
+
const getTimeSeriesDataFromData = (items, log = kit_log_1.XubeLog.getInstance()) => {
|
|
11
12
|
const timeSeriesEntriesById = {};
|
|
12
13
|
const previousMicroSecondsSinceEpochById = {};
|
|
14
|
+
log.info(`Staging data for send based on ${items.length} items.`);
|
|
15
|
+
log.info(JSON.stringify(items, null, 2));
|
|
13
16
|
for (const item of items) {
|
|
14
17
|
if (!(0, kit_data_schema_1.isReadingV1)(item)) {
|
|
15
18
|
console.log(`${item.type} is not a currently supported type.`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xube/kit-aws-hooks",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.57",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
},
|
|
18
18
|
"homepage": "https://github.com/XubeLtd/dev-kit#readme",
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@xube/kit-build": "^0.0.
|
|
20
|
+
"@xube/kit-build": "^0.0.57"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@xube/kit-aws": "^0.0.
|
|
24
|
-
"@xube/kit-aws-schema": "^0.0.
|
|
25
|
-
"@xube/kit-data-schema": "^0.0.
|
|
26
|
-
"@xube/kit-log": "^0.0.
|
|
27
|
-
"@xube/kit-request": "^0.0.
|
|
28
|
-
"@xube/kit-schema": "^0.0.
|
|
23
|
+
"@xube/kit-aws": "^0.0.57",
|
|
24
|
+
"@xube/kit-aws-schema": "^0.0.57",
|
|
25
|
+
"@xube/kit-data-schema": "^0.0.57",
|
|
26
|
+
"@xube/kit-log": "^0.0.57",
|
|
27
|
+
"@xube/kit-request": "^0.0.57",
|
|
28
|
+
"@xube/kit-schema": "^0.0.57",
|
|
29
29
|
"zod": "^3.22.4"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/src/transform.ts
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import { TableItem } from "@xube/kit-aws-schema";
|
|
2
2
|
import { isReadingV1 } from "@xube/kit-data-schema";
|
|
3
3
|
import { DATA_TYPE } from "@xube/kit-data-schema";
|
|
4
|
+
import { XubeLog } from "@xube/kit-log";
|
|
4
5
|
import { TimeSeries, TimeSeriesEntry, TimeUnit } from "@xube/kit-schema";
|
|
5
6
|
|
|
6
7
|
export const stageDataForSend = (items: TableItem[]) => {
|
|
7
8
|
const timeSeries = getTimeSeriesDataFromData(items);
|
|
8
9
|
};
|
|
9
10
|
|
|
10
|
-
export const getTimeSeriesDataFromData = (
|
|
11
|
+
export const getTimeSeriesDataFromData = (
|
|
12
|
+
items: TableItem[],
|
|
13
|
+
log: XubeLog = XubeLog.getInstance()
|
|
14
|
+
): TimeSeries => {
|
|
11
15
|
const timeSeriesEntriesById: Record<string, TimeSeriesEntry> = {};
|
|
12
16
|
const previousMicroSecondsSinceEpochById: Record<string, number> = {};
|
|
13
17
|
|
|
18
|
+
log.info(`Staging data for send based on ${items.length} items.`);
|
|
19
|
+
log.info(JSON.stringify(items, null, 2));
|
|
20
|
+
|
|
14
21
|
for (const item of items) {
|
|
15
22
|
if (!isReadingV1(item)) {
|
|
16
23
|
console.log(`${item.type} is not a currently supported type.`);
|