@xube/kit-schema 0.0.88 → 0.0.90

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/base.js CHANGED
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BaseDataSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.BaseDataSchema = zod_1.z.object({
6
- s: zod_1.z.number(),
7
- us: zod_1.z.number().optional(),
8
- type: zod_1.z.string(),
6
+ s: zod_1.z.number(), //Seconds
7
+ us: zod_1.z.number().optional(), //Microseconds
8
+ type: zod_1.z.string(), //Type of item (ie. data, event, etc)
9
9
  id: zod_1.z.string(), //Id of item
10
10
  });
@@ -1,13 +1,9 @@
1
1
  export function validate(data: any, { instancePath, parentData, parentDataProperty, rootData }?: {
2
2
  instancePath?: string | undefined;
3
- parentData: any;
4
- parentDataProperty: any;
5
3
  rootData?: any;
6
4
  }): boolean;
7
5
  export default validate10;
8
6
  declare function validate10(data: any, { instancePath, parentData, parentDataProperty, rootData }?: {
9
7
  instancePath?: string | undefined;
10
- parentData: any;
11
- parentDataProperty: any;
12
8
  rootData?: any;
13
9
  }): boolean;
@@ -35,9 +35,9 @@ exports.TimeSeriesEntrySchema = zod_1.z.object({
35
35
  trigger: exports.TriggerTypeSchema,
36
36
  source: exports.SourceTypeSchema,
37
37
  }),
38
- t0: zod_1.z.string().datetime(),
39
- dtt: exports.TimeUnitSchema.default("ms"),
40
- dt: zod_1.z.number(),
38
+ t0: zod_1.z.string().datetime(), //in microseconds since epoch
39
+ dtt: exports.TimeUnitSchema.default("ms"), //delta type - time unit
40
+ dt: zod_1.z.number(), //in microseconds
41
41
  dataT: zod_1.z
42
42
  .array(zod_1.z
43
43
  .object({
@@ -51,18 +51,18 @@ exports.TimeSeriesEntrySchema = zod_1.z.object({
51
51
  exports.TimeSeriesSchema = zod_1.z.array(exports.TimeSeriesEntrySchema);
52
52
  exports.timeSeriesExample = [
53
53
  {
54
- v: "1",
54
+ v: "1", //Version of the schema
55
55
  m: {
56
- id: "DEVICE_1234567890",
57
- trigger: "data",
56
+ id: "DEVICE_1234567890", //This is the device, or component id
57
+ trigger: "data", //Options are "data" or "event"
58
58
  source: "device", //Options are "device", "component", or "platform"
59
59
  },
60
- t0: "2023-10-13T01:29:55.1024001Z",
61
- dtt: "ms",
62
- dt: 1,
60
+ t0: "2023-10-13T01:29:55.1024001Z", //microseconds since epoch
61
+ dtt: "ms", //Time unit for dt. Default is ms
62
+ dt: 1, //In milliseconds. This is 1 ms
63
63
  dataT: [
64
64
  {
65
- i: 4,
65
+ i: 4, // index of the data reading in Y
66
66
  dt: 3, //diff in time with dtt as the unit
67
67
  },
68
68
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xube/kit-schema",
3
- "version": "0.0.88",
3
+ "version": "0.0.90",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -19,12 +19,12 @@
19
19
  "homepage": "https://github.com/XubeLtd/data-logger#readme",
20
20
  "dependencies": {
21
21
  "@anatine/zod-openapi": "^2.2.0",
22
- "@xube/kit-constants": "^0.0.88",
23
- "@xube/kit-generator": "^0.0.88",
24
- "@xube/kit-log": "^0.0.88",
22
+ "@xube/kit-constants": "^0.0.90",
23
+ "@xube/kit-generator": "^0.0.90",
24
+ "@xube/kit-log": "^0.0.90",
25
25
  "zod": "^3.22.4"
26
26
  },
27
27
  "devDependencies": {
28
- "@xube/kit-build": "^0.0.88"
28
+ "@xube/kit-build": "^0.0.90"
29
29
  }
30
30
  }