@quenty/influxdbclient 7.0.0 → 7.1.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [7.1.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/influxdbclient@7.0.0...@quenty/influxdbclient@7.1.0) (2024-03-09)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Adjust the influx db config to send stuff from the client ([696b452](https://github.com/Quenty/NevermoreEngine/commit/696b452e0125b48a265abfed5b7c7e6e3b15176f))
12
+
13
+
14
+
15
+
16
+
6
17
  # [7.0.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/influxdbclient@6.0.0...@quenty/influxdbclient@7.0.0) (2024-02-14)
7
18
 
8
19
  **Note:** Version bump only for package @quenty/influxdbclient
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/influxdbclient",
3
- "version": "7.0.0",
3
+ "version": "7.1.0",
4
4
  "description": "Provides a Roblox Lua InfluxDB client",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -25,22 +25,22 @@
25
25
  "Quenty"
26
26
  ],
27
27
  "dependencies": {
28
- "@quenty/baseobject": "^10.0.0",
29
- "@quenty/httppromise": "^10.0.0",
30
- "@quenty/jsonutils": "^10.0.0",
31
- "@quenty/loader": "^10.0.0",
32
- "@quenty/maid": "^3.0.0",
33
- "@quenty/math": "^2.5.0",
34
- "@quenty/promise": "^10.0.0",
35
- "@quenty/rx": "^13.0.0",
36
- "@quenty/servicebag": "^11.0.0",
37
- "@quenty/signal": "^7.0.0",
28
+ "@quenty/baseobject": "^10.1.0",
29
+ "@quenty/httppromise": "^10.1.0",
30
+ "@quenty/jsonutils": "^10.1.0",
31
+ "@quenty/loader": "^10.1.0",
32
+ "@quenty/maid": "^3.1.0",
33
+ "@quenty/math": "^2.6.0",
34
+ "@quenty/promise": "^10.1.0",
35
+ "@quenty/rx": "^13.1.0",
36
+ "@quenty/servicebag": "^11.1.0",
37
+ "@quenty/signal": "^7.1.0",
38
38
  "@quenty/string": "^3.1.0",
39
39
  "@quenty/table": "^3.4.0",
40
- "@quenty/valueobject": "^13.0.0"
40
+ "@quenty/valueobject": "^13.1.0"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public"
44
44
  },
45
- "gitHead": "63f949a67b77d3edc98b358cace163da8c789e9f"
45
+ "gitHead": "e0148dde5ca3864389a0faa2da66153a776acc1e"
46
46
  }
@@ -18,8 +18,7 @@ InfluxDBClient.__index = InfluxDBClient
18
18
  function InfluxDBClient.new(clientConfig)
19
19
  local self = setmetatable(BaseObject.new(), InfluxDBClient)
20
20
 
21
- self._clientConfig = ValueObject.new(nil)
22
- self._maid:GiveTask(self._clientConfig)
21
+ self._clientConfig = self._maid:Add(ValueObject.new(nil))
23
22
 
24
23
  if clientConfig then
25
24
  self:SetClientConfig(clientConfig)
@@ -49,8 +48,7 @@ function InfluxDBClient:GetWriteAPI(org, bucket, precision)
49
48
 
50
49
  local maid = Maid.new()
51
50
 
52
- local writeAPI = InfluxDBWriteAPI.new(org, bucket, precision)
53
- maid:GiveTask(writeAPI)
51
+ local writeAPI = maid:Add(InfluxDBWriteAPI.new(org, bucket, precision))
54
52
 
55
53
  maid:GiveTask(self._clientConfig:Observe():Subscribe(function(clientConfig)
56
54
  writeAPI:SetClientConfig(clientConfig)
@@ -28,14 +28,31 @@ end
28
28
 
29
29
  function InfluxDBPoint.fromTableData(data)
30
30
  assert(type(data) == "table", "Bad data")
31
+ assert(type(data.measurementName) == "string" or data.measurementName == nil, "Bad data.measurementName")
31
32
 
32
33
  local copy = InfluxDBPoint.new(data.measurementName)
33
- copy:SetTimestamp(data.timestamp)
34
+ copy._timestamp = copy:_convertTimeToMillis(data.timestamp)
34
35
 
35
36
  if data.tags then
37
+ assert(type(data.tags) == "table", "Bad data.tags")
38
+
39
+ for tagKey, tagValue in pairs(data.tags) do
40
+ assert(type(tagKey) == "string", "Bad tagKey")
41
+ assert(type(tagValue) == "string", "Bad tagValue")
42
+ end
43
+
36
44
  copy._tags = data.tags
37
45
  end
38
46
  if data.fields then
47
+ assert(type(data.fields) == "table", "Bad data.fields")
48
+
49
+ for fieldKey, fieldValue in pairs(data.fields) do
50
+ assert(type(fieldKey) == "string", "Bad fieldKey")
51
+ assert(type(fieldValue) == "string", "Bad fieldValue")
52
+
53
+ -- TODO: Additional validation on fieldValue types
54
+ end
55
+
39
56
  copy._fields = data.fields
40
57
  end
41
58