@blackglory/geyser-js 0.5.3 → 0.5.5
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/README.md +115 -182
- package/dist/es2015/index.min.mjs +2 -2
- package/dist/es2015/index.min.mjs.map +1 -1
- package/dist/es2015/index.mjs +5730 -3655
- package/dist/es2015/index.mjs.map +1 -1
- package/dist/es2015/index.umd.js +5734 -3657
- package/dist/es2015/index.umd.js.map +1 -1
- package/dist/es2015/index.umd.min.js +4 -4
- package/dist/es2015/index.umd.min.js.map +1 -1
- package/dist/es2018/index.min.mjs +1 -1
- package/dist/es2018/index.min.mjs.map +1 -1
- package/dist/es2018/index.mjs +5781 -3706
- package/dist/es2018/index.mjs.map +1 -1
- package/dist/es2018/index.umd.js +5735 -3658
- package/dist/es2018/index.umd.js.map +1 -1
- package/dist/es2018/index.umd.min.js +3 -3
- package/dist/es2018/index.umd.min.js.map +1 -1
- package/lib/es2015/geyser-client.js +1 -1
- package/lib/es2015/geyser-client.js.map +1 -1
- package/lib/es2015/utils.d.ts +2 -1
- package/lib/es2015/utils.js +1 -1
- package/lib/es2015/utils.js.map +1 -1
- package/lib/es2018/geyser-client.js +1 -1
- package/lib/es2018/geyser-client.js.map +1 -1
- package/lib/es2018/utils.d.ts +2 -1
- package/lib/es2018/utils.js +1 -1
- package/lib/es2018/utils.js.map +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -9,230 +9,163 @@ yarn add @blackglory/geyser-js
|
|
|
9
9
|
## API
|
|
10
10
|
### GeyserClient
|
|
11
11
|
```ts
|
|
12
|
-
|
|
12
|
+
interface IGeyserClientOptions {
|
|
13
13
|
server: string
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
token?: string
|
|
15
|
+
basicAuth?: {
|
|
16
16
|
username: string
|
|
17
|
-
|
|
17
|
+
password: string
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
```
|
|
19
|
+
keepalive?: boolean
|
|
20
|
+
timeout?: number
|
|
21
|
+
}
|
|
23
22
|
|
|
24
|
-
```ts
|
|
25
23
|
interface IGeyserClientRequestOptions {
|
|
26
24
|
signal?: AbortSignal
|
|
27
25
|
token?: string
|
|
28
26
|
keepalive?: boolean
|
|
29
27
|
timeout?: number | false
|
|
30
28
|
}
|
|
31
|
-
```
|
|
32
29
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
class GeyserClient {
|
|
31
|
+
constructor(options: IGeyserClientOptions)
|
|
32
|
+
|
|
33
|
+
acquire(
|
|
34
|
+
namespace: string
|
|
35
|
+
, options: IGeyserClientRequestOptions = {}
|
|
36
|
+
): Promise<void>
|
|
37
|
+
}
|
|
39
38
|
```
|
|
40
39
|
|
|
41
40
|
### GeyserManager
|
|
42
41
|
```ts
|
|
43
|
-
|
|
42
|
+
interface IGeyserManagerOptions {
|
|
44
43
|
server: string
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
})
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
```ts
|
|
52
|
-
interface IGeyserManagerRequestOptions {
|
|
53
|
-
signal?: AbortSignal
|
|
54
|
-
, keepalive?: boolean
|
|
55
|
-
, timeout?: number | false
|
|
44
|
+
adminPassword: string
|
|
45
|
+
keepalive?: boolean
|
|
46
|
+
timeout?: number
|
|
56
47
|
}
|
|
57
|
-
```
|
|
58
48
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
```ts
|
|
62
|
-
GeyserManager#Cycle.resetCycle(
|
|
63
|
-
namespace: string
|
|
64
|
-
, options?: IGeyserManagerRequestOptions
|
|
65
|
-
): Promise<void>
|
|
66
|
-
```
|
|
49
|
+
class GeyserManager {
|
|
50
|
+
constructor(options: IGeyserManagerOptions)
|
|
67
51
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
52
|
+
Configuration: ConfigurationClient
|
|
53
|
+
Cycle: CycleClient
|
|
54
|
+
Blacklist: BlacklistClient
|
|
55
|
+
Whitelist: WhitelistClient
|
|
56
|
+
TokenPolicy: TokenPolicyClient
|
|
57
|
+
Token: TokenClient
|
|
58
|
+
}
|
|
74
59
|
```
|
|
75
60
|
|
|
76
|
-
|
|
61
|
+
#### ConfigurationClient
|
|
77
62
|
```ts
|
|
78
|
-
|
|
79
|
-
namespace: string
|
|
80
|
-
, options?: IGeyserManagerRequestOptions
|
|
81
|
-
): Promise<{
|
|
63
|
+
interface IConfiguration {
|
|
82
64
|
duration: number | null
|
|
83
65
|
limit: number | null
|
|
84
|
-
}
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
##### setDuration
|
|
88
|
-
```ts
|
|
89
|
-
GeyserManager#Configuration.setDuration(
|
|
90
|
-
namespace: string
|
|
91
|
-
, val: number
|
|
92
|
-
, options?: IGeyserManagerRequestOptions
|
|
93
|
-
): Promise<void>
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
##### removeDuration
|
|
97
|
-
```ts
|
|
98
|
-
GeyserManager#Configuration.removeDuration(
|
|
99
|
-
namespace: string
|
|
100
|
-
, options?: IGeyserManagerRequestOptions
|
|
101
|
-
): Promise<void>
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
##### setLimit
|
|
105
|
-
```ts
|
|
106
|
-
GeyserManager#Configuration.setLimit(
|
|
107
|
-
namespace: string
|
|
108
|
-
, val: number
|
|
109
|
-
, options?: IGeyserManagerRequestOptions
|
|
110
|
-
): Promise<void>
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
##### removeLimit
|
|
114
|
-
```ts
|
|
115
|
-
GeyserManager#Configuration.removeLimit(
|
|
116
|
-
namespace: string
|
|
117
|
-
, options?: IGeyserManagerRequestOptions
|
|
118
|
-
): Promise<void>
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
#### Blacklist
|
|
122
|
-
##### getNamespaces
|
|
123
|
-
```ts
|
|
124
|
-
GeyserManager#Blacklist.getNamespaces(
|
|
125
|
-
options?: IGeyserManagerRequestOptions
|
|
126
|
-
): Promise<string[]>
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
##### add
|
|
130
|
-
```ts
|
|
131
|
-
GeyserManager#Blacklist.add(
|
|
132
|
-
namespace: string
|
|
133
|
-
, options?: IGeyserManagerRequestOptions
|
|
134
|
-
): Promise<void>
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
##### remove
|
|
138
|
-
```ts
|
|
139
|
-
GeyserManager#Blacklist.remove(
|
|
140
|
-
namespace: string
|
|
141
|
-
, options?: IGeyserManagerRequestOptions
|
|
142
|
-
): Promise<void>
|
|
143
|
-
```
|
|
66
|
+
}
|
|
144
67
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
options
|
|
150
|
-
): Promise<
|
|
68
|
+
class ConfigurationClient {
|
|
69
|
+
getNamespaces(options: IGeyserManagerRequestOptions = {}): Promise<string[]>
|
|
70
|
+
get(
|
|
71
|
+
namespace: string
|
|
72
|
+
, options: IGeyserManagerRequestOptions = {}
|
|
73
|
+
): Promise<IConfiguration>
|
|
74
|
+
setDuration(
|
|
75
|
+
namespace: string
|
|
76
|
+
, val: number
|
|
77
|
+
, options: IGeyserManagerRequestOptions = {}
|
|
78
|
+
): Promise<void>
|
|
79
|
+
removeDuration(
|
|
80
|
+
namespace: string
|
|
81
|
+
, options: IGeyserManagerRequestOptions = {}
|
|
82
|
+
): Promise<void>
|
|
83
|
+
setLimit(
|
|
84
|
+
namespace: string
|
|
85
|
+
, val: number
|
|
86
|
+
, options: IGeyserManagerRequestOptions = {}
|
|
87
|
+
): Promise<void>
|
|
88
|
+
removeLimit(
|
|
89
|
+
namespace: string
|
|
90
|
+
, options: IGeyserManagerRequestOptions = {}
|
|
91
|
+
): Promise<void>
|
|
92
|
+
}
|
|
151
93
|
```
|
|
152
94
|
|
|
153
|
-
|
|
95
|
+
#### CycleClient
|
|
154
96
|
```ts
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
97
|
+
class CycleClient {
|
|
98
|
+
resetCycle(
|
|
99
|
+
namespace: string
|
|
100
|
+
, options: IGeyserManagerRequestOptions = {}
|
|
101
|
+
): Promise<void>
|
|
102
|
+
}
|
|
159
103
|
```
|
|
160
104
|
|
|
161
|
-
|
|
105
|
+
#### BlacklistClient
|
|
162
106
|
```ts
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
, options
|
|
166
|
-
): Promise<void>
|
|
107
|
+
class BlacklistClient {
|
|
108
|
+
getNamespaces(options: IGeyserManagerRequestOptions = {}): Promise<string[]>
|
|
109
|
+
add(namespace: string, options: IGeyserManagerRequestOptions = {}): Promise<void>
|
|
110
|
+
remove(namespace: string, options: IGeyserManagerRequestOptions = {}): Promise<void>
|
|
111
|
+
}
|
|
167
112
|
```
|
|
168
113
|
|
|
169
|
-
####
|
|
170
|
-
##### getNamespaces
|
|
114
|
+
#### WhitelistClient
|
|
171
115
|
```ts
|
|
172
|
-
|
|
173
|
-
options
|
|
174
|
-
): Promise<
|
|
116
|
+
class WhitelistClient {
|
|
117
|
+
getNamespaces(options: IGeyserManagerRequestOptions = {}): Promise<string[]>
|
|
118
|
+
add(namespace: string, options: IGeyserManagerRequestOptions = {}): Promise<void>
|
|
119
|
+
remove(namespace: string, options: IGeyserManagerRequestOptions = {}): Promise<void>
|
|
120
|
+
}
|
|
175
121
|
```
|
|
176
122
|
|
|
177
|
-
|
|
123
|
+
#### TokenPolicyClient
|
|
178
124
|
```ts
|
|
179
|
-
|
|
180
|
-
namespace: string
|
|
181
|
-
, options?: IGeyserManagerRequestOptions
|
|
182
|
-
): Promise<{
|
|
125
|
+
interface ITokenPolicy {
|
|
183
126
|
acquireTokenRequired: boolean | null
|
|
184
|
-
}
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
##### setAcquireTokenRequired
|
|
188
|
-
```ts
|
|
189
|
-
GeyserManager#TokenPolicy.setAcquireTokenRequired(
|
|
190
|
-
namespace: string
|
|
191
|
-
, val: boolean
|
|
192
|
-
, options?: IGeyserManagerRequestOptions
|
|
193
|
-
): Promise<void>
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
##### removeAcquireTokenRequired
|
|
197
|
-
```ts
|
|
198
|
-
GeyserManager#TokenPolicy.removeAcquireTokenRequired(
|
|
199
|
-
namespace: string
|
|
200
|
-
, options?: IGeyserManagerRequestOptions
|
|
201
|
-
): Promise<void>
|
|
202
|
-
```
|
|
127
|
+
}
|
|
203
128
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
options
|
|
209
|
-
): Promise<
|
|
129
|
+
class TokenPolicyClient {
|
|
130
|
+
getNamespaces(options: IGeyserManagerRequestOptions = {}): Promise<string[]>
|
|
131
|
+
get(
|
|
132
|
+
namespace: string
|
|
133
|
+
, options: IGeyserManagerRequestOptions = {}
|
|
134
|
+
): Promise<ITokenPolicy>
|
|
135
|
+
setAcquireTokenRequired(
|
|
136
|
+
namespace: string
|
|
137
|
+
, val: boolean
|
|
138
|
+
, options: IGeyserManagerRequestOptions = {}
|
|
139
|
+
): Promise<void>
|
|
140
|
+
removeAcquireTokenRequired(
|
|
141
|
+
namespace: string
|
|
142
|
+
, options: IGeyserManagerRequestOptions = {}
|
|
143
|
+
): Promise<void>
|
|
144
|
+
}
|
|
210
145
|
```
|
|
211
146
|
|
|
212
|
-
|
|
147
|
+
#### TokenClient
|
|
213
148
|
```ts
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
, options?: IGeyserManagerRequestOptions
|
|
217
|
-
): Promise<Array<{
|
|
149
|
+
interface ITokenInfo {
|
|
150
|
+
token: string
|
|
218
151
|
acquire: boolean
|
|
219
|
-
}
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
##### addAcquireToken
|
|
223
|
-
```ts
|
|
224
|
-
GeyserManager#Token.addAcquireToken(
|
|
225
|
-
namespace: string
|
|
226
|
-
, token: string
|
|
227
|
-
, options?: IGeyserManagerRequestOptions
|
|
228
|
-
): Promise<void>
|
|
229
|
-
```
|
|
152
|
+
}
|
|
230
153
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
,
|
|
236
|
-
|
|
237
|
-
|
|
154
|
+
class TokenClient {
|
|
155
|
+
getNamespaces(options: IGeyserManagerRequestOptions = {}): Promise<string[]>
|
|
156
|
+
getTokens(
|
|
157
|
+
namespace: string
|
|
158
|
+
, options: IGeyserManagerRequestOptions = {}
|
|
159
|
+
): Promise<ITokenInfo[]>
|
|
160
|
+
addAcquireToken(
|
|
161
|
+
namespace: string
|
|
162
|
+
, token: string
|
|
163
|
+
, options: IGeyserManagerRequestOptions = {}
|
|
164
|
+
): Promise<void>
|
|
165
|
+
removeAcquireToken(
|
|
166
|
+
namespace: string
|
|
167
|
+
, token: string
|
|
168
|
+
, options: IGeyserManagerRequestOptions = {}
|
|
169
|
+
): Promise<void>
|
|
170
|
+
}
|
|
238
171
|
```
|