@minecraft/server-net 1.0.0-beta.1.19.80-preview.24 → 1.0.0-beta.1.19.80-stable
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/index.d.ts +88 -1
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* ```json
|
|
18
18
|
* {
|
|
19
19
|
* "module_name": "@minecraft/server-net",
|
|
20
|
-
* "version": "1.0.0-beta.1.19.80-
|
|
20
|
+
* "version": "1.0.0-beta.1.19.80-stable"
|
|
21
21
|
* }
|
|
22
22
|
* ```
|
|
23
23
|
*
|
|
@@ -25,47 +25,64 @@
|
|
|
25
25
|
import * as minecraftserveradmin from '@minecraft/server-admin';
|
|
26
26
|
export enum HttpRequestMethod {
|
|
27
27
|
/**
|
|
28
|
+
* @remarks
|
|
28
29
|
* Represents the method for an HTTP HEAD request. HEAD
|
|
29
30
|
* requests are similar to a GET request, but are commonly used
|
|
30
31
|
* to retrieve just the HTTP response headers from the
|
|
31
32
|
* specified URI, and not the body contents.
|
|
33
|
+
*
|
|
32
34
|
*/
|
|
33
35
|
DELETE = 'DELETE',
|
|
34
36
|
/**
|
|
37
|
+
* @remarks
|
|
35
38
|
* Represents the method for an HTTP PUT request. POST requests
|
|
36
39
|
* are commonly used to create a new resource that is a
|
|
37
40
|
* subordinate of the specified URI.
|
|
41
|
+
*
|
|
38
42
|
*/
|
|
39
43
|
GET = 'GET',
|
|
40
44
|
/**
|
|
45
|
+
* @remarks
|
|
41
46
|
* Represents the method for an HTTP PUT request. GET requests
|
|
42
47
|
* are commonly used to retrieve information about a resource
|
|
43
48
|
* at the specified URI.
|
|
49
|
+
*
|
|
44
50
|
*/
|
|
45
51
|
HEAD = 'HEAD',
|
|
46
52
|
/**
|
|
53
|
+
* @remarks
|
|
47
54
|
* Represents the method for an HTTP PUT request. GET requests
|
|
48
55
|
* are commonly used to retrieve information about a resource
|
|
49
56
|
* at the specified URI.
|
|
57
|
+
*
|
|
50
58
|
*/
|
|
51
59
|
POST = 'POST',
|
|
52
60
|
/**
|
|
61
|
+
* @remarks
|
|
53
62
|
* Represents the method for an HTTP PUT request. PUT requests
|
|
54
63
|
* are commonly used to update a single resource that already
|
|
55
64
|
* exists in a resource collection.
|
|
65
|
+
*
|
|
56
66
|
*/
|
|
57
67
|
PUT = 'PUT',
|
|
58
68
|
}
|
|
69
|
+
|
|
59
70
|
export class HttpClient {
|
|
60
71
|
protected constructor();
|
|
61
72
|
/**
|
|
62
73
|
* @remarks
|
|
63
74
|
* Cancels all pending requests.
|
|
75
|
+
*
|
|
76
|
+
* This function can't be called in read-only mode.
|
|
77
|
+
*
|
|
64
78
|
*/
|
|
65
79
|
cancelAll(reason: string): void;
|
|
66
80
|
/**
|
|
67
81
|
* @remarks
|
|
68
82
|
* Performs a simple HTTP get request.
|
|
83
|
+
*
|
|
84
|
+
* This function can't be called in read-only mode.
|
|
85
|
+
*
|
|
69
86
|
* @param uri
|
|
70
87
|
* URL to make an HTTP Request to.
|
|
71
88
|
* @returns
|
|
@@ -75,6 +92,9 @@ export class HttpClient {
|
|
|
75
92
|
/**
|
|
76
93
|
* @remarks
|
|
77
94
|
* Performs an HTTP request.
|
|
95
|
+
*
|
|
96
|
+
* This function can't be called in read-only mode.
|
|
97
|
+
*
|
|
78
98
|
* @param config
|
|
79
99
|
* Contains an HTTP Request object with configuration data on
|
|
80
100
|
* the HTTP request.
|
|
@@ -83,96 +103,163 @@ export class HttpClient {
|
|
|
83
103
|
*/
|
|
84
104
|
request(config: HttpRequest): Promise<HttpResponse>;
|
|
85
105
|
}
|
|
106
|
+
|
|
86
107
|
/**
|
|
87
108
|
* Represents an HTTP header - a key/value pair of
|
|
88
109
|
* meta-information about a request.
|
|
89
110
|
*/
|
|
90
111
|
export class HttpHeader {
|
|
91
112
|
/**
|
|
113
|
+
* @remarks
|
|
92
114
|
* Key of the HTTP header.
|
|
115
|
+
*
|
|
116
|
+
* This property can't be edited in read-only mode.
|
|
117
|
+
*
|
|
93
118
|
*/
|
|
94
119
|
key: string;
|
|
95
120
|
/**
|
|
121
|
+
* @remarks
|
|
96
122
|
* Value of the HTTP header.
|
|
123
|
+
*
|
|
124
|
+
* This property can't be edited in read-only mode.
|
|
125
|
+
*
|
|
97
126
|
*/
|
|
98
127
|
value: minecraftserveradmin.SecretString | string;
|
|
128
|
+
/**
|
|
129
|
+
* @remarks
|
|
130
|
+
* This function can't be called in read-only mode.
|
|
131
|
+
*
|
|
132
|
+
*/
|
|
99
133
|
constructor(key: string, value: minecraftserveradmin.SecretString | string);
|
|
100
134
|
}
|
|
135
|
+
|
|
101
136
|
/**
|
|
102
137
|
* Main object for structuring a request.
|
|
103
138
|
*/
|
|
104
139
|
export class HttpRequest {
|
|
105
140
|
/**
|
|
141
|
+
* @remarks
|
|
106
142
|
* Content of the body of the HTTP request.
|
|
143
|
+
*
|
|
144
|
+
* This property can't be edited in read-only mode.
|
|
145
|
+
*
|
|
107
146
|
*/
|
|
108
147
|
body: string;
|
|
109
148
|
/**
|
|
149
|
+
* @remarks
|
|
110
150
|
* A collection of HTTP headers to add to the outbound request.
|
|
151
|
+
*
|
|
152
|
+
* This property can't be edited in read-only mode.
|
|
153
|
+
*
|
|
111
154
|
*/
|
|
112
155
|
headers: HttpHeader[];
|
|
113
156
|
/**
|
|
157
|
+
* @remarks
|
|
114
158
|
* HTTP method (e.g., GET or PUT or PATCH) to use for making
|
|
115
159
|
* the request.
|
|
160
|
+
*
|
|
161
|
+
* This property can't be edited in read-only mode.
|
|
162
|
+
*
|
|
116
163
|
*/
|
|
117
164
|
method: HttpRequestMethod;
|
|
118
165
|
/**
|
|
166
|
+
* @remarks
|
|
119
167
|
* Amount of time, in seconds, before the request times out and
|
|
120
168
|
* is abandoned.
|
|
169
|
+
*
|
|
170
|
+
* This property can't be edited in read-only mode.
|
|
171
|
+
*
|
|
121
172
|
*/
|
|
122
173
|
timeout: number;
|
|
123
174
|
/**
|
|
175
|
+
* @remarks
|
|
124
176
|
* The HTTP resource to access.
|
|
177
|
+
*
|
|
178
|
+
* This property can't be edited in read-only mode.
|
|
179
|
+
*
|
|
125
180
|
*/
|
|
126
181
|
uri: string;
|
|
182
|
+
/**
|
|
183
|
+
* @remarks
|
|
184
|
+
* This function can't be called in read-only mode.
|
|
185
|
+
*
|
|
186
|
+
*/
|
|
127
187
|
constructor(uri: string);
|
|
128
188
|
/**
|
|
129
189
|
* @remarks
|
|
130
190
|
* Adds an additional header to the overall list of headers
|
|
131
191
|
* used in the corresponding HTTP request.
|
|
192
|
+
*
|
|
193
|
+
* This function can't be called in read-only mode.
|
|
194
|
+
*
|
|
132
195
|
*/
|
|
133
196
|
addHeader(key: string, value: minecraftserveradmin.SecretString | string): HttpRequest;
|
|
134
197
|
/**
|
|
135
198
|
* @remarks
|
|
136
199
|
* Updates the content of the body of the HTTP request.
|
|
200
|
+
*
|
|
201
|
+
* This function can't be called in read-only mode.
|
|
202
|
+
*
|
|
137
203
|
*/
|
|
138
204
|
setBody(body: string): HttpRequest;
|
|
139
205
|
/**
|
|
140
206
|
* @remarks
|
|
141
207
|
* Replaces and applies a set of HTTP Headers for the request.
|
|
208
|
+
*
|
|
209
|
+
* This function can't be called in read-only mode.
|
|
210
|
+
*
|
|
142
211
|
*/
|
|
143
212
|
setHeaders(headers: HttpHeader[]): HttpRequest;
|
|
144
213
|
/**
|
|
145
214
|
* @remarks
|
|
146
215
|
* Sets the desired HTTP method (e.g., GET or PUT or PATCH) to
|
|
147
216
|
* use for making the request.
|
|
217
|
+
*
|
|
218
|
+
* This function can't be called in read-only mode.
|
|
219
|
+
*
|
|
148
220
|
*/
|
|
149
221
|
setMethod(method: HttpRequestMethod): HttpRequest;
|
|
222
|
+
/**
|
|
223
|
+
* @remarks
|
|
224
|
+
* This function can't be called in read-only mode.
|
|
225
|
+
*
|
|
226
|
+
*/
|
|
150
227
|
setTimeout(timeout: number): HttpRequest;
|
|
151
228
|
}
|
|
229
|
+
|
|
152
230
|
/**
|
|
153
231
|
* Main object that contains result information from a request.
|
|
154
232
|
*/
|
|
155
233
|
export class HttpResponse {
|
|
156
234
|
protected constructor();
|
|
157
235
|
/**
|
|
236
|
+
* @remarks
|
|
158
237
|
* Body content of the HTTP response.
|
|
238
|
+
*
|
|
159
239
|
*/
|
|
160
240
|
readonly body: string;
|
|
161
241
|
/**
|
|
242
|
+
* @remarks
|
|
162
243
|
* A collection of HTTP response headers returned from the
|
|
163
244
|
* request.
|
|
245
|
+
*
|
|
164
246
|
*/
|
|
165
247
|
readonly headers: HttpHeader[];
|
|
166
248
|
/**
|
|
249
|
+
* @remarks
|
|
167
250
|
* Information that was used to formulate the HTTP response
|
|
168
251
|
* that this object represents.
|
|
252
|
+
*
|
|
169
253
|
*/
|
|
170
254
|
readonly request: HttpRequest;
|
|
171
255
|
/**
|
|
256
|
+
* @remarks
|
|
172
257
|
* HTTP response code for the request. For example, 404
|
|
173
258
|
* represents resource not found, and 500 represents an
|
|
174
259
|
* internal server error.
|
|
260
|
+
*
|
|
175
261
|
*/
|
|
176
262
|
readonly status: number;
|
|
177
263
|
}
|
|
264
|
+
|
|
178
265
|
export const http: HttpClient;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@minecraft/server-net",
|
|
3
|
-
"version": "1.0.0-beta.1.19.80-
|
|
3
|
+
"version": "1.0.0-beta.1.19.80-stable",
|
|
4
4
|
"description": "",
|
|
5
5
|
"contributors": [
|
|
6
6
|
{
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
}
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@minecraft/server-admin": "1.0.0-beta.1.19.80-
|
|
16
|
+
"@minecraft/server-admin": "1.0.0-beta.1.19.80-stable"
|
|
17
17
|
},
|
|
18
18
|
"license": "MIT"
|
|
19
19
|
}
|