@minecraft/server-net 1.0.0-beta.1.21.70-preview.21 → 1.0.0-beta.1.21.70-preview.23

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.
Files changed (2) hide show
  1. package/index.d.ts +47 -15
  2. package/package.json +3 -3
package/index.d.ts CHANGED
@@ -311,7 +311,7 @@ export class HttpClient {
311
311
  * @remarks
312
312
  * Cancels all pending requests.
313
313
  *
314
- * This function can't be called in read-only mode.
314
+ * This function can be called in early-execution mode.
315
315
  *
316
316
  */
317
317
  cancelAll(reason: string): void;
@@ -319,7 +319,7 @@ export class HttpClient {
319
319
  * @remarks
320
320
  * Performs a simple HTTP get request.
321
321
  *
322
- * This function can't be called in read-only mode.
322
+ * This function can be called in early-execution mode.
323
323
  *
324
324
  * @param uri
325
325
  * URL to make an HTTP Request to.
@@ -331,7 +331,7 @@ export class HttpClient {
331
331
  * @remarks
332
332
  * Performs an HTTP request.
333
333
  *
334
- * This function can't be called in read-only mode.
334
+ * This function can be called in early-execution mode.
335
335
  *
336
336
  * @param config
337
337
  * Contains an HTTP Request object with configuration data on
@@ -391,7 +391,7 @@ export class HttpHeader {
391
391
  * @remarks
392
392
  * Key of the HTTP header.
393
393
  *
394
- * This property can't be edited in read-only mode.
394
+ * This property can be used in early-execution mode.
395
395
  *
396
396
  */
397
397
  key: string;
@@ -399,7 +399,7 @@ export class HttpHeader {
399
399
  * @remarks
400
400
  * Value of the HTTP header.
401
401
  *
402
- * This property can't be edited in read-only mode.
402
+ * This property can be used in early-execution mode.
403
403
  *
404
404
  */
405
405
  value: minecraftserveradmin.SecretString | string;
@@ -434,7 +434,7 @@ export class HttpRequest {
434
434
  * @remarks
435
435
  * Content of the body of the HTTP request.
436
436
  *
437
- * This property can't be edited in read-only mode.
437
+ * This property can be used in early-execution mode.
438
438
  *
439
439
  */
440
440
  body: string;
@@ -442,7 +442,7 @@ export class HttpRequest {
442
442
  * @remarks
443
443
  * A collection of HTTP headers to add to the outbound request.
444
444
  *
445
- * This property can't be edited in read-only mode.
445
+ * This property can be used in early-execution mode.
446
446
  *
447
447
  */
448
448
  headers: HttpHeader[];
@@ -451,7 +451,7 @@ export class HttpRequest {
451
451
  * HTTP method (e.g., GET or PUT or PATCH) to use for making
452
452
  * the request.
453
453
  *
454
- * This property can't be edited in read-only mode.
454
+ * This property can be used in early-execution mode.
455
455
  *
456
456
  */
457
457
  method: HttpRequestMethod;
@@ -460,7 +460,7 @@ export class HttpRequest {
460
460
  * Amount of time, in seconds, before the request times out and
461
461
  * is abandoned.
462
462
  *
463
- * This property can't be edited in read-only mode.
463
+ * This property can be used in early-execution mode.
464
464
  *
465
465
  */
466
466
  timeout: number;
@@ -468,7 +468,7 @@ export class HttpRequest {
468
468
  * @remarks
469
469
  * The HTTP resource to access.
470
470
  *
471
- * This property can't be edited in read-only mode.
471
+ * This property can be used in early-execution mode.
472
472
  *
473
473
  */
474
474
  uri: string;
@@ -478,7 +478,7 @@ export class HttpRequest {
478
478
  * Adds an additional header to the overall list of headers
479
479
  * used in the corresponding HTTP request.
480
480
  *
481
- * This function can't be called in read-only mode.
481
+ * This function can be called in early-execution mode.
482
482
  *
483
483
  */
484
484
  addHeader(key: string, value: minecraftserveradmin.SecretString | string): HttpRequest;
@@ -486,7 +486,7 @@ export class HttpRequest {
486
486
  * @remarks
487
487
  * Updates the content of the body of the HTTP request.
488
488
  *
489
- * This function can't be called in read-only mode.
489
+ * This function can be called in early-execution mode.
490
490
  *
491
491
  */
492
492
  setBody(body: string): HttpRequest;
@@ -494,7 +494,7 @@ export class HttpRequest {
494
494
  * @remarks
495
495
  * Replaces and applies a set of HTTP Headers for the request.
496
496
  *
497
- * This function can't be called in read-only mode.
497
+ * This function can be called in early-execution mode.
498
498
  *
499
499
  */
500
500
  setHeaders(headers: HttpHeader[]): HttpRequest;
@@ -503,13 +503,13 @@ export class HttpRequest {
503
503
  * Sets the desired HTTP method (e.g., GET or PUT or PATCH) to
504
504
  * use for making the request.
505
505
  *
506
- * This function can't be called in read-only mode.
506
+ * This function can be called in early-execution mode.
507
507
  *
508
508
  */
509
509
  setMethod(method: HttpRequestMethod): HttpRequest;
510
510
  /**
511
511
  * @remarks
512
- * This function can't be called in read-only mode.
512
+ * This function can be called in early-execution mode.
513
513
  *
514
514
  */
515
515
  setTimeout(timeout: number): HttpRequest;
@@ -672,5 +672,37 @@ export interface PacketEventOptions {
672
672
  monitoredPacketIds?: PacketId[];
673
673
  }
674
674
 
675
+ /**
676
+ * An error thrown when a platform-level HTTP error occurs.
677
+ * Information provided in this class may be useful for
678
+ * diagnostics purposes but will differ from platform to
679
+ * platform.
680
+ */
681
+ // @ts-ignore Class inheritance allowed for native defined classes
682
+ export class InternalHttpRequestError extends Error {
683
+ private constructor();
684
+ /**
685
+ * @remarks
686
+ * The platform-provided numeric error code for the error.
687
+ *
688
+ */
689
+ code: number;
690
+ /**
691
+ * @remarks
692
+ * The platform-provided message for the error.
693
+ *
694
+ */
695
+ message: string;
696
+ }
697
+
698
+ /**
699
+ * An error thrown when a malformed HTTP request is attempted
700
+ * to be sent.
701
+ */
702
+ // @ts-ignore Class inheritance allowed for native defined classes
703
+ export class MalformedHttpRequestError extends Error {
704
+ private constructor();
705
+ }
706
+
675
707
  export const beforeEvents: NetworkBeforeEvents;
676
708
  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.21.70-preview.21",
3
+ "version": "1.0.0-beta.1.21.70-preview.23",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {
@@ -14,8 +14,8 @@
14
14
  ],
15
15
  "dependencies": {
16
16
  "@minecraft/common": "^1.0.0",
17
- "@minecraft/server": "^1.17.0-rc.1.21.70-preview.21 || ^2.0.0-beta.1.21.70-preview.21",
18
- "@minecraft/server-admin": "^1.0.0-beta.1.21.70-preview.21"
17
+ "@minecraft/server": "^1.17.0 || ^2.0.0-beta.1.21.70-preview.23",
18
+ "@minecraft/server-admin": "^1.0.0-beta.1.21.70-preview.23"
19
19
  },
20
20
  "license": "MIT"
21
21
  }