@quenty/influxdbclient 7.39.0 → 7.41.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,16 @@
|
|
|
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.41.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/influxdbclient@7.40.0...@quenty/influxdbclient@7.41.0) (2026-07-23)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/influxdbclient
|
|
9
|
+
|
|
10
|
+
# [7.40.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/influxdbclient@7.39.0...@quenty/influxdbclient@7.40.0) (2026-07-23)
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- Add baseline player-mock and support across Nevermore for mocked players. ([567d121](https://github.com/Quenty/NevermoreEngine/commit/567d121ffc014b42391554088189a1a6296dda83))
|
|
15
|
+
|
|
6
16
|
# [7.39.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/influxdbclient@7.38.0...@quenty/influxdbclient@7.39.0) (2026-07-22)
|
|
7
17
|
|
|
8
18
|
### Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/influxdbclient",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.41.0",
|
|
4
4
|
"description": "Provides a Roblox Lua InfluxDB client",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -28,24 +28,24 @@
|
|
|
28
28
|
"Quenty"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@quenty/baseobject": "10.
|
|
32
|
-
"@quenty/httppromise": "10.
|
|
33
|
-
"@quenty/jsonutils": "10.
|
|
31
|
+
"@quenty/baseobject": "10.15.0",
|
|
32
|
+
"@quenty/httppromise": "10.22.0",
|
|
33
|
+
"@quenty/jsonutils": "10.22.0",
|
|
34
34
|
"@quenty/loader": "10.11.0",
|
|
35
|
-
"@quenty/maid": "3.
|
|
35
|
+
"@quenty/maid": "3.11.0",
|
|
36
36
|
"@quenty/math": "2.7.5",
|
|
37
|
-
"@quenty/nevermore-test-runner": "1.
|
|
38
|
-
"@quenty/promise": "10.
|
|
39
|
-
"@quenty/rx": "13.
|
|
40
|
-
"@quenty/servicebag": "11.
|
|
37
|
+
"@quenty/nevermore-test-runner": "1.5.0",
|
|
38
|
+
"@quenty/promise": "10.22.0",
|
|
39
|
+
"@quenty/rx": "13.32.0",
|
|
40
|
+
"@quenty/servicebag": "11.20.0",
|
|
41
41
|
"@quenty/signal": "7.13.1",
|
|
42
|
-
"@quenty/string": "3.
|
|
42
|
+
"@quenty/string": "3.4.0",
|
|
43
43
|
"@quenty/table": "3.9.2",
|
|
44
|
-
"@quenty/valueobject": "13.
|
|
44
|
+
"@quenty/valueobject": "13.35.0",
|
|
45
45
|
"@quentystudios/jest-lua": "3.10.0-quenty.2"
|
|
46
46
|
},
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "88b03743718172ff79cd62ade64a86565fcac17d"
|
|
51
51
|
}
|
|
@@ -117,9 +117,6 @@ describe("InfluxDBClient.GetWriteAPI", function()
|
|
|
117
117
|
client:Destroy()
|
|
118
118
|
end)
|
|
119
119
|
|
|
120
|
-
-- Regression: GetWriteAPI must work before a config is set. Its ValueObject:Observe() subscription
|
|
121
|
-
-- fires the current value (nil) immediately; without a nil guard in GetWriteAPI this would call
|
|
122
|
-
-- writeAPI:SetClientConfig(nil) and throw "Bad clientConfig".
|
|
123
120
|
it("should return a write API", function()
|
|
124
121
|
local client = InfluxDBClient.new()
|
|
125
122
|
local writeAPI = client:GetWriteAPI("my-org", "my-bucket")
|
|
@@ -155,7 +152,6 @@ describe("InfluxDBClient.GetWriteAPI", function()
|
|
|
155
152
|
local client, requestMock = InfluxDBClient.newMock(CONFIG)
|
|
156
153
|
local writeAPI = client:GetWriteAPI("my-org", "my-bucket")
|
|
157
154
|
|
|
158
|
-
-- If the config had not reached the write API, the flush would reject with "No client configuration".
|
|
159
155
|
writeAPI:QueuePoint(newPoint())
|
|
160
156
|
expect(PromiseTestUtils.awaitSettled(writeAPI:PromiseFlush())).toEqual(true)
|
|
161
157
|
|
|
@@ -205,7 +201,6 @@ describe("InfluxDBClient.PromiseFlushAll", function()
|
|
|
205
201
|
it("should reuse the pending flush promise while one is in flight", function()
|
|
206
202
|
local client, requestMock = InfluxDBClient.newMock(CONFIG)
|
|
207
203
|
|
|
208
|
-
-- A request that never settles keeps the flush pending, so both calls observe the same promise.
|
|
209
204
|
requestMock:SetResponder(function()
|
|
210
205
|
return Promise.new(function() end)
|
|
211
206
|
end)
|
|
@@ -28,6 +28,7 @@ local require = require(script.Parent.loader).load(script)
|
|
|
28
28
|
|
|
29
29
|
local InfluxDBClient = require("InfluxDBClient")
|
|
30
30
|
local InfluxDBClientConfigUtils = require("InfluxDBClientConfigUtils")
|
|
31
|
+
local InfluxDBPoint = require("InfluxDBPoint")
|
|
31
32
|
local InfluxDBWriteAPI = require("InfluxDBWriteAPI")
|
|
32
33
|
local Maid = require("Maid")
|
|
33
34
|
local Promise = require("Promise")
|
|
@@ -43,6 +44,7 @@ export type InfluxDBService = typeof(setmetatable(
|
|
|
43
44
|
_client: InfluxDBClient.InfluxDBClient?,
|
|
44
45
|
_requestHandler: InfluxDBWriteAPI.InfluxDBRequestHandler?,
|
|
45
46
|
_pendingClientConfig: InfluxDBClientConfigUtils.InfluxDBClientConfig?,
|
|
47
|
+
_destroyed: boolean?,
|
|
46
48
|
},
|
|
47
49
|
{} :: typeof({ __index = InfluxDBService })
|
|
48
50
|
))
|
|
@@ -74,6 +76,16 @@ function InfluxDBService.SetRequestHandler(
|
|
|
74
76
|
self._requestHandler = requestHandler
|
|
75
77
|
end
|
|
76
78
|
|
|
79
|
+
--[=[
|
|
80
|
+
Returns whether a request handler override was injected (see [InfluxDBService.SetRequestHandler]).
|
|
81
|
+
Consumers can use this to skip resolving real credentials when HTTP is intercepted.
|
|
82
|
+
|
|
83
|
+
@return boolean
|
|
84
|
+
]=]
|
|
85
|
+
function InfluxDBService.HasRequestHandler(self: InfluxDBService): boolean
|
|
86
|
+
return self._requestHandler ~= nil
|
|
87
|
+
end
|
|
88
|
+
|
|
77
89
|
--[=[
|
|
78
90
|
Sets the client config used to authenticate writes. May be called before or after the client is
|
|
79
91
|
built; a later config is forwarded to the existing client.
|
|
@@ -127,6 +139,34 @@ function InfluxDBService.GetWriteAPI(
|
|
|
127
139
|
return self:GetClient():GetWriteAPI(org, bucket, precision)
|
|
128
140
|
end
|
|
129
141
|
|
|
142
|
+
--[=[
|
|
143
|
+
Queues a point to the shared client's write API for the given org and bucket. Consumers should
|
|
144
|
+
route queueing through this rather than holding the [InfluxDBWriteAPI] object: the service owns
|
|
145
|
+
client teardown, so it can answer liveness -- a point queued after the service is destroyed
|
|
146
|
+
errors, because it means the caller outlived teardown (the closing flush has already run; the
|
|
147
|
+
caller should have been destroyed first).
|
|
148
|
+
|
|
149
|
+
@param org string
|
|
150
|
+
@param bucket string
|
|
151
|
+
@param point InfluxDBPoint
|
|
152
|
+
]=]
|
|
153
|
+
function InfluxDBService.QueuePoint(self: InfluxDBService, org: string, bucket: string, point): ()
|
|
154
|
+
assert(type(org) == "string", "Bad org")
|
|
155
|
+
assert(type(bucket) == "string", "Bad bucket")
|
|
156
|
+
assert(InfluxDBPoint.isInfluxDBPoint(point), "Bad point")
|
|
157
|
+
|
|
158
|
+
if self._destroyed then
|
|
159
|
+
error(
|
|
160
|
+
string.format(
|
|
161
|
+
"[InfluxDBService.QueuePoint] - Queued %q after InfluxDBService was destroyed; the caller outlived teardown",
|
|
162
|
+
tostring(point:GetMeasurementName())
|
|
163
|
+
)
|
|
164
|
+
)
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
self:GetWriteAPI(org, bucket):QueuePoint(point)
|
|
168
|
+
end
|
|
169
|
+
|
|
130
170
|
--[=[
|
|
131
171
|
Flushes every write API on the shared client. Resolves immediately if the client was never built.
|
|
132
172
|
|
|
@@ -141,6 +181,7 @@ function InfluxDBService.PromiseFlushAll(self: InfluxDBService): Promise.Promise
|
|
|
141
181
|
end
|
|
142
182
|
|
|
143
183
|
function InfluxDBService.Destroy(self: InfluxDBService): ()
|
|
184
|
+
self._destroyed = true
|
|
144
185
|
self._maid:DoCleaning()
|
|
145
186
|
end
|
|
146
187
|
|
|
@@ -30,11 +30,9 @@ local function newPoint(): InfluxDBPoint.InfluxDBPoint
|
|
|
30
30
|
return point
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
-- Boots a service through a ServiceBag with a request mock injected between Init and Start, mirroring
|
|
34
|
-
-- how a consuming package would swap in the mock at the ServiceBag layer.
|
|
35
33
|
local function setup()
|
|
36
34
|
local serviceBag = ServiceBag.new()
|
|
37
|
-
local influxDBService =
|
|
35
|
+
local influxDBService: InfluxDBService.InfluxDBService = serviceBag:GetService(InfluxDBService) :: any
|
|
38
36
|
serviceBag:Init()
|
|
39
37
|
|
|
40
38
|
local requestMock = InfluxDBRequestHandlerMock.new()
|
|
@@ -62,7 +60,7 @@ describe("InfluxDBService.SetRequestHandler", function()
|
|
|
62
60
|
|
|
63
61
|
it("should throw on a non-function handler", function()
|
|
64
62
|
local serviceBag = ServiceBag.new()
|
|
65
|
-
local influxDBService =
|
|
63
|
+
local influxDBService: InfluxDBService.InfluxDBService = serviceBag:GetService(InfluxDBService) :: any
|
|
66
64
|
serviceBag:Init()
|
|
67
65
|
|
|
68
66
|
expect(function()
|
|
@@ -74,11 +72,10 @@ describe("InfluxDBService.SetRequestHandler", function()
|
|
|
74
72
|
|
|
75
73
|
it("should throw once the client has been built", function()
|
|
76
74
|
local serviceBag = ServiceBag.new()
|
|
77
|
-
local influxDBService =
|
|
75
|
+
local influxDBService: InfluxDBService.InfluxDBService = serviceBag:GetService(InfluxDBService) :: any
|
|
78
76
|
serviceBag:Init()
|
|
79
77
|
serviceBag:Start()
|
|
80
78
|
|
|
81
|
-
-- Building the client locks the seam.
|
|
82
79
|
influxDBService:GetClient()
|
|
83
80
|
|
|
84
81
|
expect(function()
|
|
@@ -103,7 +100,6 @@ describe("InfluxDBService.SetClientConfig", function()
|
|
|
103
100
|
it("should apply a config set after the client is built", function()
|
|
104
101
|
local serviceBag, influxDBService, requestMock = setup()
|
|
105
102
|
|
|
106
|
-
-- Build the client and its write API before any config is set.
|
|
107
103
|
local writeAPI = influxDBService:GetWriteAPI("my-org", "my-bucket")
|
|
108
104
|
|
|
109
105
|
influxDBService:SetClientConfig(CONFIG)
|