@php-wasm/web 1.0.28 → 1.1.0
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.cjs +21 -0
- package/index.cjs.map +1 -0
- package/index.js +666 -631
- package/index.js.map +1 -1
- package/lib/chunked-decoder.d.ts +8 -0
- package/lib/directory-handle-mount.d.ts +1 -1
- package/lib/get-php-loader-module.d.ts +1 -1
- package/lib/load-runtime.d.ts +4 -3
- package/lib/tcp-over-fetch-websocket.d.ts +32 -4
- package/lib/tls/1_2/types.d.ts +19 -17
- package/lib/tls/extensions/parse-extensions.d.ts +8 -4
- package/lib/tls/utils.d.ts +1 -1
- package/lib/with-icu-data.d.ts +2 -0
- package/package.json +28 -14
- package/php/asyncify/7_0_33/php_7_0.wasm +0 -0
- package/php/asyncify/7_1_30/php_7_1.wasm +0 -0
- package/php/asyncify/7_2_34/php_7_2.wasm +0 -0
- package/php/asyncify/7_3_33/php_7_3.wasm +0 -0
- package/php/asyncify/7_4_33/php_7_4.wasm +0 -0
- package/php/asyncify/8_0_30/php_8_0.wasm +0 -0
- package/php/asyncify/8_1_23/php_8_1.wasm +0 -0
- package/php/asyncify/8_2_10/php_8_2.wasm +0 -0
- package/php/asyncify/8_3_0/php_8_3.wasm +0 -0
- package/php/asyncify/8_4_0/php_8_4.wasm +0 -0
- package/php/asyncify/php_7_0.js +13 -39
- package/php/asyncify/php_7_1.js +13 -39
- package/php/asyncify/php_7_2.js +13 -39
- package/php/asyncify/php_7_3.js +13 -39
- package/php/asyncify/php_7_4.js +13 -39
- package/php/asyncify/php_8_0.js +13 -39
- package/php/asyncify/php_8_1.js +13 -39
- package/php/asyncify/php_8_2.js +13 -39
- package/php/asyncify/php_8_3.js +13 -39
- package/php/asyncify/php_8_4.js +13 -39
- package/php/jspi/7_0_33/php_7_0.wasm +0 -0
- package/php/jspi/7_1_30/php_7_1.wasm +0 -0
- package/php/jspi/7_2_34/php_7_2.wasm +0 -0
- package/php/jspi/7_3_33/php_7_3.wasm +0 -0
- package/php/jspi/7_4_33/php_7_4.wasm +0 -0
- package/php/jspi/8_0_30/php_8_0.wasm +0 -0
- package/php/jspi/8_1_23/php_8_1.wasm +0 -0
- package/php/jspi/8_2_10/php_8_2.wasm +0 -0
- package/php/jspi/8_3_0/php_8_3.wasm +0 -0
- package/php/jspi/8_4_0/php_8_4.wasm +0 -0
- package/php/jspi/php_7_0.js +13 -39
- package/php/jspi/php_7_1.js +13 -39
- package/php/jspi/php_7_2.js +13 -39
- package/php/jspi/php_7_3.js +13 -39
- package/php/jspi/php_7_4.js +13 -39
- package/php/jspi/php_8_0.js +13 -39
- package/php/jspi/php_8_1.js +13 -39
- package/php/jspi/php_8_2.js +13 -39
- package/php/jspi/php_8_3.js +13 -39
- package/php/jspi/php_8_4.js +13 -39
- package/shared/icudt74l.dat +0 -0
- package/shared/icudt74l.js +2 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A TransformStream that decodes HTTP chunked transfer encoding.
|
|
3
|
+
* Each chunk starts with the chunk size in hex followed by CRLF,
|
|
4
|
+
* then the chunk data, then CRLF. A chunk size of 0 indicates the end.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ChunkedDecoderStream extends TransformStream<Uint8Array, Uint8Array> {
|
|
7
|
+
constructor();
|
|
8
|
+
}
|
package/lib/load-runtime.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { EmscriptenOptions, PHPLoaderModule
|
|
2
|
-
import { TCPOverFetchOptions } from './tcp-over-fetch-websocket';
|
|
1
|
+
import type { SupportedPHPVersion, EmscriptenOptions, PHPLoaderModule } from '@php-wasm/universal';
|
|
2
|
+
import type { TCPOverFetchOptions } from './tcp-over-fetch-websocket';
|
|
3
3
|
export interface LoaderOptions {
|
|
4
4
|
emscriptenOptions?: EmscriptenOptions;
|
|
5
5
|
onPhpLoaderModuleLoaded?: (module: PHPLoaderModule) => void;
|
|
6
6
|
tcpOverFetch?: TCPOverFetchOptions;
|
|
7
|
+
withICU?: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare function loadWebRuntime(phpVersion: SupportedPHPVersion,
|
|
9
|
+
export declare function loadWebRuntime(phpVersion: SupportedPHPVersion, loaderOptions?: LoaderOptions): Promise<number>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type { GeneratedCertificate } from './tls/certificates';
|
|
3
|
+
import type { EmscriptenOptions } from '@php-wasm/universal';
|
|
2
4
|
export type TCPOverFetchOptions = {
|
|
3
5
|
CAroot: GeneratedCertificate;
|
|
4
6
|
corsProxyUrl?: string;
|
|
@@ -7,7 +9,7 @@ export type TCPOverFetchOptions = {
|
|
|
7
9
|
* Sets up a WebSocket that analyzes the received bytes and, if they look like
|
|
8
10
|
* TLS or HTTP, handles the network transmission using fetch().
|
|
9
11
|
*/
|
|
10
|
-
export declare const tcpOverFetchWebsocket: (tcpOptions: TCPOverFetchOptions) => {
|
|
12
|
+
export declare const tcpOverFetchWebsocket: (emOptions: EmscriptenOptions, tcpOptions: TCPOverFetchOptions) => {
|
|
11
13
|
websocket: {
|
|
12
14
|
url: (_: any, host: string, port: string) => string;
|
|
13
15
|
subprotocol: string;
|
|
@@ -55,6 +57,19 @@ export declare const tcpOverFetchWebsocket: (tcpOptions: TCPOverFetchOptions) =>
|
|
|
55
57
|
};
|
|
56
58
|
};
|
|
57
59
|
};
|
|
60
|
+
onAbort?: ((message: string) => void) | undefined;
|
|
61
|
+
debug?: boolean | undefined;
|
|
62
|
+
ENV?: Record<string, string> | undefined;
|
|
63
|
+
locateFile?: ((path: string) => string) | undefined;
|
|
64
|
+
noInitialRun?: boolean | undefined;
|
|
65
|
+
print?: ((message: string) => void) | undefined;
|
|
66
|
+
printErr?: ((message: string) => void) | undefined;
|
|
67
|
+
quit?: ((status: number, toThrow: any) => void) | undefined;
|
|
68
|
+
onRuntimeInitialized?: ((phpRuntime: any) => void) | undefined;
|
|
69
|
+
monitorRunDependencies?: ((left: number) => void) | undefined;
|
|
70
|
+
onMessage?: ((listener: import("packages/php-wasm/universal/src/lib/load-php-runtime").EmscriptenMessageListener) => void) | undefined;
|
|
71
|
+
outboundNetworkProxyServer?: import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse> | undefined;
|
|
72
|
+
instantiateWasm?: ((info: WebAssembly.Imports, receiveInstance: (instance: WebAssembly.Instance, module: WebAssembly.Module) => void) => void) | undefined;
|
|
58
73
|
};
|
|
59
74
|
export interface TCPOverFetchWebsocketOptions {
|
|
60
75
|
CAroot?: GeneratedCertificate;
|
|
@@ -69,8 +84,6 @@ export interface TCPOverFetchWebsocketOptions {
|
|
|
69
84
|
corsProxyUrl?: string;
|
|
70
85
|
}
|
|
71
86
|
export declare class TCPOverFetchWebsocket {
|
|
72
|
-
url: string;
|
|
73
|
-
options: string[];
|
|
74
87
|
CONNECTING: number;
|
|
75
88
|
OPEN: number;
|
|
76
89
|
CLOSING: number;
|
|
@@ -90,6 +103,8 @@ export declare class TCPOverFetchWebsocket {
|
|
|
90
103
|
clientDownstream: TransformStream<any, any>;
|
|
91
104
|
fetchInitiated: boolean;
|
|
92
105
|
bufferedBytesFromClient: Uint8Array;
|
|
106
|
+
url: string;
|
|
107
|
+
options: string[];
|
|
93
108
|
constructor(url: string, options: string[], { CAroot, corsProxyUrl, outputType, }?: TCPOverFetchWebsocketOptions);
|
|
94
109
|
on(eventName: string, callback: (e: any) => void): void;
|
|
95
110
|
once(eventName: string, callback: (e: any) => void): void;
|
|
@@ -110,3 +125,16 @@ export declare class TCPOverFetchWebsocket {
|
|
|
110
125
|
fetchOverHTTP(): Promise<void>;
|
|
111
126
|
close(): void;
|
|
112
127
|
}
|
|
128
|
+
export declare class RawBytesFetch {
|
|
129
|
+
/**
|
|
130
|
+
* Streams a HTTP response including the status line and headers.
|
|
131
|
+
*/
|
|
132
|
+
static fetchRawResponseBytes(request: Request, corsProxyUrl?: string): ReadableStream<any>;
|
|
133
|
+
private static headersAsBytes;
|
|
134
|
+
/**
|
|
135
|
+
* Parses a raw, streamed HTTP request into a Request object
|
|
136
|
+
* with known headers and a readable body stream.
|
|
137
|
+
*/
|
|
138
|
+
static parseHttpRequest(requestBytesStream: ReadableStream<Uint8Array>, host: string, protocol: 'http' | 'https'): Promise<Request>;
|
|
139
|
+
private static parseRequestHeaders;
|
|
140
|
+
}
|
package/lib/tls/1_2/types.d.ts
CHANGED
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
* from the TLS 1.2 RFC.
|
|
4
4
|
* https://datatracker.ietf.org/doc/html/rfc5246#section-6.2
|
|
5
5
|
*/
|
|
6
|
-
import { ParsedExtension } from '../extensions/parse-extensions';
|
|
7
|
-
export declare const
|
|
8
|
-
Null
|
|
9
|
-
Deflate
|
|
10
|
-
}
|
|
6
|
+
import type { ParsedExtension } from '../extensions/parse-extensions';
|
|
7
|
+
export declare const CompressionMethod: {
|
|
8
|
+
readonly Null: 0;
|
|
9
|
+
readonly Deflate: 1;
|
|
10
|
+
};
|
|
11
|
+
export type CompressionMethod = (typeof CompressionMethod)[keyof typeof CompressionMethod];
|
|
11
12
|
/**
|
|
12
13
|
* TLS 1.2 Record layer types defined after the structs
|
|
13
14
|
* from the TLS 1.2 RFC.
|
|
@@ -102,18 +103,19 @@ export declare const ContentTypes: {
|
|
|
102
103
|
readonly ApplicationData: 23;
|
|
103
104
|
};
|
|
104
105
|
export type ContentType = (typeof ContentTypes)[keyof typeof ContentTypes];
|
|
105
|
-
export declare const
|
|
106
|
-
HelloRequest
|
|
107
|
-
ClientHello
|
|
108
|
-
ServerHello
|
|
109
|
-
Certificate
|
|
110
|
-
ServerKeyExchange
|
|
111
|
-
CertificateRequest
|
|
112
|
-
ServerHelloDone
|
|
113
|
-
CertificateVerify
|
|
114
|
-
ClientKeyExchange
|
|
115
|
-
Finished
|
|
116
|
-
}
|
|
106
|
+
export declare const HandshakeType: {
|
|
107
|
+
readonly HelloRequest: 0;
|
|
108
|
+
readonly ClientHello: 1;
|
|
109
|
+
readonly ServerHello: 2;
|
|
110
|
+
readonly Certificate: 11;
|
|
111
|
+
readonly ServerKeyExchange: 12;
|
|
112
|
+
readonly CertificateRequest: 13;
|
|
113
|
+
readonly ServerHelloDone: 14;
|
|
114
|
+
readonly CertificateVerify: 15;
|
|
115
|
+
readonly ClientKeyExchange: 16;
|
|
116
|
+
readonly Finished: 20;
|
|
117
|
+
};
|
|
118
|
+
export type HandshakeType = (typeof HandshakeType)[keyof typeof HandshakeType];
|
|
117
119
|
export type HandshakeMessageBody = HelloRequest | ClientHello | ServerHello | Certificate | ServerKeyExchange | CertificateRequest | ServerHelloDone | CertificateVerify | ClientKeyExchange | Finished;
|
|
118
120
|
export interface HandshakeMessage<Body extends HandshakeMessageBody> {
|
|
119
121
|
type: typeof ContentTypes.Handshake;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import type { ServerNameList } from './0_server_name';
|
|
2
|
+
import { ServerNameExtension } from './0_server_name';
|
|
3
|
+
import type { ParsedSupportedGroups } from './10_supported_groups';
|
|
4
|
+
import { SupportedGroupsExtension } from './10_supported_groups';
|
|
5
|
+
import type { ParsedECPointFormats } from './11_ec_point_formats';
|
|
6
|
+
import { ECPointFormatsExtension } from './11_ec_point_formats';
|
|
7
|
+
import type { SignatureAlgorithms } from './13_signature_algorithms';
|
|
8
|
+
import { SignatureAlgorithmsExtension } from './13_signature_algorithms';
|
|
5
9
|
export declare const TLSExtensionsHandlers: {
|
|
6
10
|
readonly server_name: typeof ServerNameExtension;
|
|
7
11
|
readonly signature_algorithms: typeof SignatureAlgorithmsExtension;
|
package/lib/tls/utils.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ export declare function as2Bytes(value: number): Uint8Array;
|
|
|
5
5
|
export declare function as3Bytes(value: number): Uint8Array;
|
|
6
6
|
export declare function as8Bytes(value: number): Uint8Array;
|
|
7
7
|
export declare class ArrayBufferReader {
|
|
8
|
-
private buffer;
|
|
9
8
|
private view;
|
|
10
9
|
offset: number;
|
|
10
|
+
private buffer;
|
|
11
11
|
constructor(buffer: ArrayBuffer);
|
|
12
12
|
readUint8(): number;
|
|
13
13
|
readUint16(): number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@php-wasm/web",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "PHP.wasm for the web",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,31 +21,45 @@
|
|
|
21
21
|
"displayName": "@php-wasm/web",
|
|
22
22
|
"tsconfig": "./tsconfig.lib.json"
|
|
23
23
|
},
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"import": "./index.js",
|
|
27
|
+
"require": "./index.cjs"
|
|
28
|
+
},
|
|
29
|
+
"./package.json": "./package.json"
|
|
30
|
+
},
|
|
24
31
|
"publishConfig": {
|
|
25
32
|
"access": "public",
|
|
26
33
|
"directory": "../../../dist/packages/php-wasm/web"
|
|
27
34
|
},
|
|
28
35
|
"license": "GPL-2.0-or-later",
|
|
29
36
|
"type": "module",
|
|
30
|
-
"main": "index.
|
|
37
|
+
"main": "./index.cjs",
|
|
38
|
+
"module": "./index.js",
|
|
31
39
|
"types": "index.d.ts",
|
|
32
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "9dbbe2b22ccbacda9c0da4444c51d5739e784302",
|
|
33
41
|
"engines": {
|
|
34
|
-
"node": ">=
|
|
35
|
-
"npm": ">=
|
|
42
|
+
"node": ">=20.18.3",
|
|
43
|
+
"npm": ">=10.1.0"
|
|
36
44
|
},
|
|
37
45
|
"dependencies": {
|
|
38
46
|
"comlink": "^4.4.1",
|
|
39
|
-
"
|
|
40
|
-
"express": "4.19.2",
|
|
47
|
+
"express": "4.21.2",
|
|
41
48
|
"ini": "4.1.2",
|
|
42
49
|
"wasm-feature-detect": "1.8.0",
|
|
43
|
-
"ws": "8.18.
|
|
50
|
+
"ws": "8.18.1",
|
|
44
51
|
"yargs": "17.7.2",
|
|
45
|
-
"@php-wasm/universal": "1.0
|
|
46
|
-
"@php-wasm/util": "1.0
|
|
47
|
-
"@php-wasm/logger": "1.0
|
|
48
|
-
"@php-wasm/fs-journal": "1.0
|
|
49
|
-
"@php-wasm/web-service-worker": "1.0
|
|
52
|
+
"@php-wasm/universal": "1.1.0",
|
|
53
|
+
"@php-wasm/util": "1.1.0",
|
|
54
|
+
"@php-wasm/logger": "1.1.0",
|
|
55
|
+
"@php-wasm/fs-journal": "1.1.0",
|
|
56
|
+
"@php-wasm/web-service-worker": "1.1.0"
|
|
57
|
+
},
|
|
58
|
+
"overrides": {
|
|
59
|
+
"rollup": "^4.34.6",
|
|
60
|
+
"react": "18.3.1",
|
|
61
|
+
"react-dom": "18.3.1",
|
|
62
|
+
"typescript": "5.4.5",
|
|
63
|
+
"ws": "^8.18.0"
|
|
50
64
|
}
|
|
51
|
-
}
|
|
65
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|