@php-wasm/web 1.0.15 → 1.0.16

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.
@@ -0,0 +1 @@
1
+ export declare function fetchWithCorsProxy(input: RequestInfo, init?: RequestInit, corsProxyUrl?: string): Promise<Response>;
package/lib/index.d.ts CHANGED
@@ -9,3 +9,4 @@ export { createDirectoryHandleMountHandler } from './directory-handle-mount';
9
9
  export type { MountDevice, MountOptions, SyncProgress, SyncProgressCallback, } from './directory-handle-mount';
10
10
  export * from './tls/certificates';
11
11
  export type { TCPOverFetchOptions } from './tcp-over-fetch-websocket';
12
+ export { fetchWithCorsProxy } from './fetch-with-cors-proxy';
@@ -1,6 +1,7 @@
1
1
  import { GeneratedCertificate } from './tls/certificates';
2
2
  export type TCPOverFetchOptions = {
3
3
  CAroot: GeneratedCertificate;
4
+ corsProxyUrl?: string;
4
5
  };
5
6
  /**
6
7
  * Sets up a WebSocket that analyzes the received bytes and, if they look like
@@ -25,6 +26,7 @@ export declare const tcpOverFetchWebsocket: (tcpOptions: TCPOverFetchOptions) =>
25
26
  port: number;
26
27
  listeners: Map<string, any>;
27
28
  CAroot?: GeneratedCertificate | undefined;
29
+ corsProxyUrl?: string | undefined;
28
30
  clientUpstream: TransformStream<any, any>;
29
31
  clientUpstreamWriter: WritableStreamDefaultWriter<any>;
30
32
  clientDownstream: TransformStream<any, any>;
@@ -64,6 +66,7 @@ export interface TCPOverFetchWebsocketOptions {
64
66
  * clientDownstream stream and tracking the closure of that stream.
65
67
  */
66
68
  outputType?: 'messages' | 'stream';
69
+ corsProxyUrl?: string;
67
70
  }
68
71
  export declare class TCPOverFetchWebsocket {
69
72
  url: string;
@@ -81,12 +84,13 @@ export declare class TCPOverFetchWebsocket {
81
84
  port: number;
82
85
  listeners: Map<string, any>;
83
86
  CAroot?: GeneratedCertificate;
87
+ corsProxyUrl?: string;
84
88
  clientUpstream: TransformStream<any, any>;
85
89
  clientUpstreamWriter: WritableStreamDefaultWriter<any>;
86
90
  clientDownstream: TransformStream<any, any>;
87
91
  fetchInitiated: boolean;
88
92
  bufferedBytesFromClient: Uint8Array;
89
- constructor(url: string, options: string[], { CAroot, outputType }?: TCPOverFetchWebsocketOptions);
93
+ constructor(url: string, options: string[], { CAroot, corsProxyUrl, outputType, }?: TCPOverFetchWebsocketOptions);
90
94
  on(eventName: string, callback: (e: any) => void): void;
91
95
  once(eventName: string, callback: (e: any) => void): void;
92
96
  addEventListener(eventName: string, callback: (e: any) => void): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@php-wasm/web",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "PHP.wasm for the web",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,7 +29,7 @@
29
29
  "type": "module",
30
30
  "main": "index.js",
31
31
  "types": "index.d.ts",
32
- "gitHead": "916516040522ab257109dd617bfcc493bb4f2eb1",
32
+ "gitHead": "bb91e62fb28611a9d447a182aff26dcfced2bb2e",
33
33
  "engines": {
34
34
  "node": ">=16.15.1",
35
35
  "npm": ">=8.11.0"
@@ -42,9 +42,10 @@
42
42
  "wasm-feature-detect": "1.8.0",
43
43
  "ws": "8.18.0",
44
44
  "yargs": "17.7.2",
45
- "@php-wasm/universal": "1.0.15",
46
- "@php-wasm/util": "1.0.15",
47
- "@php-wasm/logger": "1.0.15",
48
- "@php-wasm/fs-journal": "1.0.15"
45
+ "@php-wasm/universal": "1.0.16",
46
+ "@php-wasm/util": "1.0.16",
47
+ "@php-wasm/logger": "1.0.16",
48
+ "@php-wasm/fs-journal": "1.0.16",
49
+ "@php-wasm/web-service-worker": "1.0.16"
49
50
  }
50
51
  }