@php-wasm/node 0.6.2 → 0.6.4

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 CHANGED
@@ -169,7 +169,7 @@ export interface RequestHandler {
169
169
  * headers: {
170
170
  * 'X-foo': 'bar',
171
171
  * },
172
- * formData: {
172
+ * body: {
173
173
  * foo: 'bar',
174
174
  * },
175
175
  * });
@@ -476,18 +476,11 @@ export interface PHPRequest {
476
476
  */
477
477
  headers?: PHPRequestHeaders;
478
478
  /**
479
- * Uploaded files
479
+ * Request body.
480
+ * If an object is given, the request will be encoded as multipart
481
+ * and sent with a `multipart/form-data` header.
480
482
  */
481
- files?: Record<string, File>;
482
- /**
483
- * Request body without the files.
484
- */
485
- body?: string;
486
- /**
487
- * Form data. If set, the request body will be ignored and
488
- * the content-type header will be set to `application/x-www-form-urlencoded`.
489
- */
490
- formData?: Record<string, unknown>;
483
+ body?: string | Uint8Array | Record<string, string | Uint8Array | File>;
491
484
  }
492
485
  export interface PHPRunOptions {
493
486
  /**
@@ -511,13 +504,13 @@ export interface PHPRunOptions {
511
504
  */
512
505
  headers?: PHPRequestHeaders;
513
506
  /**
514
- * Request body without the files.
507
+ * Request body.
515
508
  */
516
- body?: string;
509
+ body?: string | Uint8Array;
517
510
  /**
518
- * Uploaded files.
511
+ * Environment variables to set for this run.
519
512
  */
520
- fileInfos?: FileInfo[];
513
+ env?: Record<string, string>;
521
514
  /**
522
515
  * The code snippet to eval instead of a php file.
523
516
  */
@@ -528,12 +521,6 @@ export interface PHPRunOptions {
528
521
  */
529
522
  throwOnError?: boolean;
530
523
  }
531
- export interface FileInfo {
532
- key: string;
533
- name: string;
534
- type: string;
535
- data: Uint8Array;
536
- }
537
524
  export interface RmDirOptions {
538
525
  /**
539
526
  * If true, recursively removes the directory and all its contents.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@php-wasm/node",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
4
4
  "description": "PHP.wasm for Node.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,7 +28,7 @@
28
28
  "license": "GPL-2.0-or-later",
29
29
  "main": "index.cjs",
30
30
  "types": "index.d.ts",
31
- "gitHead": "3c0de0d0847c3550a75a026bef9724eac421afbf",
31
+ "gitHead": "8b74852e9701f5083b367f9a294f34200230ce79",
32
32
  "engines": {
33
33
  "node": ">=18.18.2",
34
34
  "npm": ">=8.11.0"
@@ -38,8 +38,8 @@
38
38
  "express": "4.18.2",
39
39
  "ws": "8.13.0",
40
40
  "yargs": "17.7.2",
41
- "@php-wasm/node-polyfills": "0.6.2",
42
- "@php-wasm/universal": "0.6.2",
43
- "@php-wasm/util": "0.6.2"
41
+ "@php-wasm/node-polyfills": "0.6.4",
42
+ "@php-wasm/universal": "0.6.4",
43
+ "@php-wasm/util": "0.6.4"
44
44
  }
45
45
  }