@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 CHANGED
@@ -9,230 +9,163 @@ yarn add @blackglory/geyser-js
9
9
  ## API
10
10
  ### GeyserClient
11
11
  ```ts
12
- new GeyserClient({
12
+ interface IGeyserClientOptions {
13
13
  server: string
14
- , token?: string
15
- , basicAuth?: {
14
+ token?: string
15
+ basicAuth?: {
16
16
  username: string
17
- , password: string
17
+ password: string
18
18
  }
19
- , keepalive?: boolean
20
- , timeout?: number
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
- #### acquire
34
- ```ts
35
- GeyserClient#acquire(
36
- namespace: string
37
- , options?: IGeyserClientRequestOptions
38
- ): Promise<void>
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
- new GeyserManager({
42
+ interface IGeyserManagerOptions {
44
43
  server: string
45
- , adminPassword: string
46
- , keepalive?: boolean
47
- , timeout?: number
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
- #### Cycle
60
- ##### resetCycle
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
- #### Configuration
69
- ##### getNamespaces
70
- ```ts
71
- GeyserManager#Configuration.getNamespaces(
72
- options?: IGeyserManagerRequestOptions
73
- ): Promise<string[]>
52
+ Configuration: ConfigurationClient
53
+ Cycle: CycleClient
54
+ Blacklist: BlacklistClient
55
+ Whitelist: WhitelistClient
56
+ TokenPolicy: TokenPolicyClient
57
+ Token: TokenClient
58
+ }
74
59
  ```
75
60
 
76
- ##### get
61
+ #### ConfigurationClient
77
62
  ```ts
78
- GeyserManager#Configuration.get(
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
- #### Whitelist
146
- ##### getNamespaces
147
- ```ts
148
- GeyserManager#Whitelist.getNamespaces(
149
- options?: IGeyserManagerRequestOptions
150
- ): Promise<string[]>
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
- ##### add
95
+ #### CycleClient
154
96
  ```ts
155
- GeyserManager#Whitelist.add(
156
- namespace: string
157
- , options?: IGeyserManagerRequestOptions
158
- ): Promise<void>
97
+ class CycleClient {
98
+ resetCycle(
99
+ namespace: string
100
+ , options: IGeyserManagerRequestOptions = {}
101
+ ): Promise<void>
102
+ }
159
103
  ```
160
104
 
161
- ##### remove
105
+ #### BlacklistClient
162
106
  ```ts
163
- GeyserManager#Whitelist.remove(
164
- namespace: string
165
- , options?: IGeyserManagerRequestOptions
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
- #### TokenPolicy
170
- ##### getNamespaces
114
+ #### WhitelistClient
171
115
  ```ts
172
- GeyserManager#TokenPolicy.getNamespaces(
173
- options?: IGeyserManagerRequestOptions
174
- ): Promise<string[]>
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
- ##### get
123
+ #### TokenPolicyClient
178
124
  ```ts
179
- GeyserManager#TokenPolicy.get(
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
- #### Token
205
- ##### getNamespaces
206
- ```ts
207
- GeyserManager#Token.getNamespaces(
208
- options?: IGeyserManagerRequestOptions
209
- ): Promise<string[]>
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
- ##### getTokens
147
+ #### TokenClient
213
148
  ```ts
214
- GeyserManager#Token.getTokens(
215
- namespace: string
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
- ##### removeAcquireToken
232
- ```ts
233
- GeyserManager#Token.removeAcquireToken(
234
- namespace: string
235
- , token: string
236
- , options?: IGeyserManagerRequestOptions
237
- ): Promise<void>
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
  ```