@quenty/userserviceutils 9.14.1-canary.522.b5d379b.0 → 9.16.0-canary.524.4bb843b.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 +16 -2
- package/package.json +5 -5
- package/src/Shared/UserInfoAggregator.lua +27 -4
- package/src/Shared/UserInfoService.lua +13 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,9 +3,23 @@
|
|
|
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
|
-
|
|
6
|
+
# [9.16.0-canary.524.4bb843b.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/userserviceutils@9.15.0...@quenty/userserviceutils@9.16.0-canary.524.4bb843b.0) (2024-12-15)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Add retry mechanism to UserInfoAggregator ([7ff28b9](https://github.com/Quenty/NevermoreEngine/commit/7ff28b98173b376389496d6d895ba564edf4b337))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [9.15.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/userserviceutils@9.14.0...@quenty/userserviceutils@9.15.0) (2024-12-03)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* Fix username query ([a605933](https://github.com/Quenty/NevermoreEngine/commit/a605933b1375e0f0fc4e55f9d1c8dbf9e5893c4b))
|
|
9
23
|
|
|
10
24
|
|
|
11
25
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/userserviceutils",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.16.0-canary.524.4bb843b.0",
|
|
4
4
|
"description": "Utilities involving UserService in Roblox",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -25,17 +25,17 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/aggregator": "1.0
|
|
28
|
+
"@quenty/aggregator": "1.2.0-canary.524.4bb843b.0",
|
|
29
29
|
"@quenty/baseobject": "10.7.1",
|
|
30
30
|
"@quenty/loader": "10.7.1",
|
|
31
31
|
"@quenty/maid": "3.4.0",
|
|
32
32
|
"@quenty/math": "2.7.0",
|
|
33
|
-
"@quenty/promise": "10.
|
|
34
|
-
"@quenty/rx": "13.
|
|
33
|
+
"@quenty/promise": "10.9.0-canary.524.4bb843b.0",
|
|
34
|
+
"@quenty/rx": "13.15.0-canary.524.4bb843b.0",
|
|
35
35
|
"@quenty/servicebag": "11.10.0"
|
|
36
36
|
},
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "4bb843bfb89c18579a80ba2f11b1d48faa86b48f"
|
|
41
41
|
}
|
|
@@ -10,6 +10,7 @@ local Aggregator = require("Aggregator")
|
|
|
10
10
|
local BaseObject = require("BaseObject")
|
|
11
11
|
local Rx = require("Rx")
|
|
12
12
|
local UserServiceUtils = require("UserServiceUtils")
|
|
13
|
+
local PromiseRetryUtils = require("PromiseRetryUtils")
|
|
13
14
|
|
|
14
15
|
local UserInfoAggregator = setmetatable({}, BaseObject)
|
|
15
16
|
UserInfoAggregator.ClassName = "UserInfoAggregator"
|
|
@@ -19,7 +20,13 @@ function UserInfoAggregator.new()
|
|
|
19
20
|
local self = setmetatable(BaseObject.new(), UserInfoAggregator)
|
|
20
21
|
|
|
21
22
|
self._aggregator = self._maid:Add(Aggregator.new("UserServiceUtils.promiseUserInfosByUserIds", function(userIdList)
|
|
22
|
-
return
|
|
23
|
+
return PromiseRetryUtils.retry(function()
|
|
24
|
+
return UserServiceUtils.promiseUserInfosByUserIds(userIdList)
|
|
25
|
+
end, {
|
|
26
|
+
initialWaitTime = 10;
|
|
27
|
+
maxAttempts = 10;
|
|
28
|
+
printWarning = true;
|
|
29
|
+
})
|
|
23
30
|
end))
|
|
24
31
|
|
|
25
32
|
return self
|
|
@@ -54,17 +61,17 @@ function UserInfoAggregator:PromiseDisplayName(userId)
|
|
|
54
61
|
end
|
|
55
62
|
|
|
56
63
|
--[=[
|
|
57
|
-
Promises the
|
|
64
|
+
Promises the Username for the userId
|
|
58
65
|
|
|
59
66
|
@param userId number
|
|
60
67
|
@return Promise<string>
|
|
61
68
|
]=]
|
|
62
|
-
function UserInfoAggregator:
|
|
69
|
+
function UserInfoAggregator:PromiseUsername(userId)
|
|
63
70
|
assert(type(userId) == "number", "Bad userId")
|
|
64
71
|
|
|
65
72
|
return self._aggregator:Promise(userId)
|
|
66
73
|
:Then(function(userInfo)
|
|
67
|
-
return userInfo.
|
|
74
|
+
return userInfo.Username
|
|
68
75
|
end)
|
|
69
76
|
end
|
|
70
77
|
|
|
@@ -111,6 +118,22 @@ function UserInfoAggregator:ObserveDisplayName(userId)
|
|
|
111
118
|
})
|
|
112
119
|
end
|
|
113
120
|
|
|
121
|
+
--[=[
|
|
122
|
+
Observes the Username for the userId
|
|
123
|
+
|
|
124
|
+
@param userId number
|
|
125
|
+
@return Observable<string>
|
|
126
|
+
]=]
|
|
127
|
+
function UserInfoAggregator:ObserveUsername(userId)
|
|
128
|
+
assert(type(userId) == "number", "Bad userId")
|
|
129
|
+
|
|
130
|
+
return self._aggregator:Observe(userId):Pipe({
|
|
131
|
+
Rx.map(function(userInfo)
|
|
132
|
+
return userInfo.Username
|
|
133
|
+
end)
|
|
134
|
+
})
|
|
135
|
+
end
|
|
136
|
+
|
|
114
137
|
--[=[
|
|
115
138
|
Observes the user display name for the userId
|
|
116
139
|
|
|
@@ -42,7 +42,7 @@ end
|
|
|
42
42
|
function UserInfoService:ObserveUserInfo(userId)
|
|
43
43
|
assert(type(userId) == "number", "Bad userId")
|
|
44
44
|
|
|
45
|
-
return self._aggregator:
|
|
45
|
+
return self._aggregator:ObserveUserInfo(userId)
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
--[=[
|
|
@@ -57,6 +57,18 @@ function UserInfoService:PromiseDisplayName(userId)
|
|
|
57
57
|
return self._aggregator:PromiseDisplayName(userId)
|
|
58
58
|
end
|
|
59
59
|
|
|
60
|
+
--[=[
|
|
61
|
+
Promises the Username for the userId
|
|
62
|
+
|
|
63
|
+
@param userId number
|
|
64
|
+
@return Promise<string>
|
|
65
|
+
]=]
|
|
66
|
+
function UserInfoService:PromiseUsername(userId)
|
|
67
|
+
assert(type(userId) == "number", "Bad userId")
|
|
68
|
+
|
|
69
|
+
return self._aggregator:PromiseUsername(userId)
|
|
70
|
+
end
|
|
71
|
+
|
|
60
72
|
--[=[
|
|
61
73
|
Observes the user display name for the userId
|
|
62
74
|
|