@ruby/head-wasm-wasi 2.6.1 → 2.6.2
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/dist/browser.script.iife.js +4 -2
- package/dist/browser.script.umd.js +3 -1
- package/dist/browser.umd.js +3 -1
- package/dist/component/interfaces/wasi-cli-environment.d.ts +2 -0
- package/dist/component/interfaces/wasi-filesystem-types.d.ts +9 -56
- package/dist/component/interfaces/wasi-http-outgoing-handler.d.ts +11 -0
- package/dist/component/interfaces/wasi-http-types.d.ts +311 -0
- package/dist/component/interfaces/wasi-io-poll.d.ts +3 -1
- package/dist/component/interfaces/wasi-io-streams.d.ts +7 -0
- package/dist/component/ruby.component.core.wasm +0 -0
- package/dist/component/ruby.component.core10.wasm +0 -0
- package/dist/component/ruby.component.core100.wasm +0 -0
- package/dist/component/ruby.component.core101.wasm +0 -0
- package/dist/component/ruby.component.core102.wasm +0 -0
- package/dist/component/ruby.component.core103.wasm +0 -0
- package/dist/component/ruby.component.core11.wasm +0 -0
- package/dist/component/ruby.component.core12.wasm +0 -0
- package/dist/component/ruby.component.core13.wasm +0 -0
- package/dist/component/ruby.component.core14.wasm +0 -0
- package/dist/component/ruby.component.core15.wasm +0 -0
- package/dist/component/ruby.component.core16.wasm +0 -0
- package/dist/component/ruby.component.core17.wasm +0 -0
- package/dist/component/ruby.component.core18.wasm +0 -0
- package/dist/component/ruby.component.core19.wasm +0 -0
- package/dist/component/ruby.component.core2.wasm +0 -0
- package/dist/component/ruby.component.core20.wasm +0 -0
- package/dist/component/ruby.component.core21.wasm +0 -0
- package/dist/component/ruby.component.core22.wasm +0 -0
- package/dist/component/ruby.component.core23.wasm +0 -0
- package/dist/component/ruby.component.core24.wasm +0 -0
- package/dist/component/ruby.component.core25.wasm +0 -0
- package/dist/component/ruby.component.core26.wasm +0 -0
- package/dist/component/ruby.component.core27.wasm +0 -0
- package/dist/component/ruby.component.core28.wasm +0 -0
- package/dist/component/ruby.component.core29.wasm +0 -0
- package/dist/component/ruby.component.core3.wasm +0 -0
- package/dist/component/ruby.component.core30.wasm +0 -0
- package/dist/component/ruby.component.core31.wasm +0 -0
- package/dist/component/ruby.component.core32.wasm +0 -0
- package/dist/component/ruby.component.core33.wasm +0 -0
- package/dist/component/ruby.component.core34.wasm +0 -0
- package/dist/component/ruby.component.core35.wasm +0 -0
- package/dist/component/ruby.component.core36.wasm +0 -0
- package/dist/component/ruby.component.core37.wasm +0 -0
- package/dist/component/ruby.component.core38.wasm +0 -0
- package/dist/component/ruby.component.core39.wasm +0 -0
- package/dist/component/ruby.component.core4.wasm +0 -0
- package/dist/component/ruby.component.core40.wasm +0 -0
- package/dist/component/ruby.component.core41.wasm +0 -0
- package/dist/component/ruby.component.core42.wasm +0 -0
- package/dist/component/ruby.component.core43.wasm +0 -0
- package/dist/component/ruby.component.core44.wasm +0 -0
- package/dist/component/ruby.component.core45.wasm +0 -0
- package/dist/component/ruby.component.core46.wasm +0 -0
- package/dist/component/ruby.component.core47.wasm +0 -0
- package/dist/component/ruby.component.core48.wasm +0 -0
- package/dist/component/ruby.component.core49.wasm +0 -0
- package/dist/component/ruby.component.core5.wasm +0 -0
- package/dist/component/ruby.component.core50.wasm +0 -0
- package/dist/component/ruby.component.core51.wasm +0 -0
- package/dist/component/ruby.component.core52.wasm +0 -0
- package/dist/component/ruby.component.core53.wasm +0 -0
- package/dist/component/ruby.component.core54.wasm +0 -0
- package/dist/component/ruby.component.core55.wasm +0 -0
- package/dist/component/ruby.component.core56.wasm +0 -0
- package/dist/component/ruby.component.core57.wasm +0 -0
- package/dist/component/ruby.component.core58.wasm +0 -0
- package/dist/component/ruby.component.core59.wasm +0 -0
- package/dist/component/ruby.component.core6.wasm +0 -0
- package/dist/component/ruby.component.core60.wasm +0 -0
- package/dist/component/ruby.component.core61.wasm +0 -0
- package/dist/component/ruby.component.core62.wasm +0 -0
- package/dist/component/ruby.component.core63.wasm +0 -0
- package/dist/component/ruby.component.core64.wasm +0 -0
- package/dist/component/ruby.component.core65.wasm +0 -0
- package/dist/component/ruby.component.core66.wasm +0 -0
- package/dist/component/ruby.component.core67.wasm +0 -0
- package/dist/component/ruby.component.core68.wasm +0 -0
- package/dist/component/ruby.component.core69.wasm +0 -0
- package/dist/component/ruby.component.core7.wasm +0 -0
- package/dist/component/ruby.component.core70.wasm +0 -0
- package/dist/component/ruby.component.core71.wasm +0 -0
- package/dist/component/ruby.component.core72.wasm +0 -0
- package/dist/component/ruby.component.core73.wasm +0 -0
- package/dist/component/ruby.component.core74.wasm +0 -0
- package/dist/component/ruby.component.core75.wasm +0 -0
- package/dist/component/ruby.component.core76.wasm +0 -0
- package/dist/component/ruby.component.core77.wasm +0 -0
- package/dist/component/ruby.component.core78.wasm +0 -0
- package/dist/component/ruby.component.core79.wasm +0 -0
- package/dist/component/ruby.component.core8.wasm +0 -0
- package/dist/component/ruby.component.core80.wasm +0 -0
- package/dist/component/ruby.component.core81.wasm +0 -0
- package/dist/component/ruby.component.core82.wasm +0 -0
- package/dist/component/ruby.component.core83.wasm +0 -0
- package/dist/component/ruby.component.core84.wasm +0 -0
- package/dist/component/ruby.component.core85.wasm +0 -0
- package/dist/component/ruby.component.core86.wasm +0 -0
- package/dist/component/ruby.component.core87.wasm +0 -0
- package/dist/component/ruby.component.core88.wasm +0 -0
- package/dist/component/ruby.component.core89.wasm +0 -0
- package/dist/component/ruby.component.core9.wasm +0 -0
- package/dist/component/ruby.component.core90.wasm +0 -0
- package/dist/component/ruby.component.core91.wasm +0 -0
- package/dist/component/ruby.component.core92.wasm +0 -0
- package/dist/component/ruby.component.core93.wasm +0 -0
- package/dist/component/ruby.component.core94.wasm +0 -0
- package/dist/component/ruby.component.core95.wasm +0 -0
- package/dist/component/ruby.component.core96.wasm +0 -0
- package/dist/component/ruby.component.core97.wasm +0 -0
- package/dist/component/ruby.component.core98.wasm +0 -0
- package/dist/component/ruby.component.core99.wasm +0 -0
- package/dist/component/ruby.component.d.ts +12 -3
- package/dist/component/ruby.component.js +16615 -7266
- package/dist/index.umd.js +3 -1
- package/dist/ruby+stdlib.wasm +0 -0
- package/dist/ruby.debug+stdlib.wasm +0 -0
- package/dist/ruby.wasm +0 -0
- package/package.json +1 -1
|
@@ -1438,7 +1438,9 @@ SOFTWARE.
|
|
|
1438
1438
|
const fs_filetypePtr = fdstat + 0;
|
|
1439
1439
|
view.setUint8(fs_filetypePtr, 2); // FILETYPE_CHARACTER_DEVICE
|
|
1440
1440
|
const fs_rights_basePtr = fdstat + 8;
|
|
1441
|
-
|
|
1441
|
+
// See https://github.com/WebAssembly/WASI/blob/v0.2.0/legacy/preview1/docs.md#record-members
|
|
1442
|
+
const RIGHTS_FD_WRITE = 1 << 6;
|
|
1443
|
+
view.setBigUint64(fs_rights_basePtr, BigInt(RIGHTS_FD_WRITE), true);
|
|
1442
1444
|
return 0;
|
|
1443
1445
|
};
|
|
1444
1446
|
},
|
|
@@ -2931,7 +2933,7 @@ SOFTWARE.
|
|
|
2931
2933
|
};
|
|
2932
2934
|
|
|
2933
2935
|
var name = "@ruby/head-wasm-wasi";
|
|
2934
|
-
var version = "2.6.
|
|
2936
|
+
var version = "2.6.2";
|
|
2935
2937
|
var description = "Ruby head built on WASI";
|
|
2936
2938
|
var main = "./dist/cjs/index.js";
|
|
2937
2939
|
var module = "./dist/esm/index.js";
|
|
@@ -150,7 +150,9 @@ Please replace your \`require('ruby-head-wasm-wasi/dist/browser.script.umd');\`
|
|
|
150
150
|
const fs_filetypePtr = fdstat + 0;
|
|
151
151
|
view.setUint8(fs_filetypePtr, 2); // FILETYPE_CHARACTER_DEVICE
|
|
152
152
|
const fs_rights_basePtr = fdstat + 8;
|
|
153
|
-
|
|
153
|
+
// See https://github.com/WebAssembly/WASI/blob/v0.2.0/legacy/preview1/docs.md#record-members
|
|
154
|
+
const RIGHTS_FD_WRITE = 1 << 6;
|
|
155
|
+
view.setBigUint64(fs_rights_basePtr, BigInt(RIGHTS_FD_WRITE), true);
|
|
154
156
|
return 0;
|
|
155
157
|
};
|
|
156
158
|
},
|
package/dist/browser.umd.js
CHANGED
|
@@ -105,7 +105,9 @@
|
|
|
105
105
|
const fs_filetypePtr = fdstat + 0;
|
|
106
106
|
view.setUint8(fs_filetypePtr, 2); // FILETYPE_CHARACTER_DEVICE
|
|
107
107
|
const fs_rights_basePtr = fdstat + 8;
|
|
108
|
-
|
|
108
|
+
// See https://github.com/WebAssembly/WASI/blob/v0.2.0/legacy/preview1/docs.md#record-members
|
|
109
|
+
const RIGHTS_FD_WRITE = 1 << 6;
|
|
110
|
+
view.setBigUint64(fs_rights_basePtr, BigInt(RIGHTS_FD_WRITE), true);
|
|
109
111
|
return 0;
|
|
110
112
|
};
|
|
111
113
|
},
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export namespace WasiFilesystemTypes {
|
|
2
2
|
export { Descriptor };
|
|
3
3
|
export { DirectoryEntryStream };
|
|
4
|
-
export function filesystemErrorCode(err: Error): ErrorCode | undefined;
|
|
5
4
|
}
|
|
6
5
|
export type Filesize = bigint;
|
|
7
6
|
import type { InputStream } from './wasi-io-streams.js';
|
|
@@ -84,32 +83,6 @@ export { InputStream };
|
|
|
84
83
|
* ## `"cross-device"`
|
|
85
84
|
*/
|
|
86
85
|
export type ErrorCode = 'access' | 'would-block' | 'already' | 'bad-descriptor' | 'busy' | 'deadlock' | 'quota' | 'exist' | 'file-too-large' | 'illegal-byte-sequence' | 'in-progress' | 'interrupted' | 'invalid' | 'io' | 'is-directory' | 'loop' | 'too-many-links' | 'message-size' | 'name-too-long' | 'no-device' | 'no-entry' | 'no-lock' | 'insufficient-memory' | 'insufficient-space' | 'not-directory' | 'not-empty' | 'not-recoverable' | 'unsupported' | 'no-tty' | 'no-such-device' | 'overflow' | 'not-permitted' | 'pipe' | 'read-only' | 'invalid-seek' | 'text-file-busy' | 'cross-device';
|
|
87
|
-
import type { OutputStream } from './wasi-io-streams.js';
|
|
88
|
-
export { OutputStream };
|
|
89
|
-
/**
|
|
90
|
-
* # Variants
|
|
91
|
-
*
|
|
92
|
-
* ## `"normal"`
|
|
93
|
-
*
|
|
94
|
-
* ## `"sequential"`
|
|
95
|
-
*
|
|
96
|
-
* ## `"random"`
|
|
97
|
-
*
|
|
98
|
-
* ## `"will-need"`
|
|
99
|
-
*
|
|
100
|
-
* ## `"dont-need"`
|
|
101
|
-
*
|
|
102
|
-
* ## `"no-reuse"`
|
|
103
|
-
*/
|
|
104
|
-
export type Advice = 'normal' | 'sequential' | 'random' | 'will-need' | 'dont-need' | 'no-reuse';
|
|
105
|
-
export interface DescriptorFlags {
|
|
106
|
-
read?: boolean,
|
|
107
|
-
write?: boolean,
|
|
108
|
-
fileIntegritySync?: boolean,
|
|
109
|
-
dataIntegritySync?: boolean,
|
|
110
|
-
requestedWriteSync?: boolean,
|
|
111
|
-
mutateDirectory?: boolean,
|
|
112
|
-
}
|
|
113
86
|
/**
|
|
114
87
|
* # Variants
|
|
115
88
|
*
|
|
@@ -144,23 +117,20 @@ export interface DescriptorStat {
|
|
|
144
117
|
export interface PathFlags {
|
|
145
118
|
symlinkFollow?: boolean,
|
|
146
119
|
}
|
|
147
|
-
export type NewTimestamp = NewTimestampNoChange | NewTimestampNow | NewTimestampTimestamp;
|
|
148
|
-
export interface NewTimestampNoChange {
|
|
149
|
-
tag: 'no-change',
|
|
150
|
-
}
|
|
151
|
-
export interface NewTimestampNow {
|
|
152
|
-
tag: 'now',
|
|
153
|
-
}
|
|
154
|
-
export interface NewTimestampTimestamp {
|
|
155
|
-
tag: 'timestamp',
|
|
156
|
-
val: Datetime,
|
|
157
|
-
}
|
|
158
120
|
export interface OpenFlags {
|
|
159
121
|
create?: boolean,
|
|
160
122
|
directory?: boolean,
|
|
161
123
|
exclusive?: boolean,
|
|
162
124
|
truncate?: boolean,
|
|
163
125
|
}
|
|
126
|
+
export interface DescriptorFlags {
|
|
127
|
+
read?: boolean,
|
|
128
|
+
write?: boolean,
|
|
129
|
+
fileIntegritySync?: boolean,
|
|
130
|
+
dataIntegritySync?: boolean,
|
|
131
|
+
requestedWriteSync?: boolean,
|
|
132
|
+
mutateDirectory?: boolean,
|
|
133
|
+
}
|
|
164
134
|
export interface MetadataHashValue {
|
|
165
135
|
lower: bigint,
|
|
166
136
|
upper: bigint,
|
|
@@ -169,33 +139,16 @@ export interface DirectoryEntry {
|
|
|
169
139
|
type: DescriptorType,
|
|
170
140
|
name: string,
|
|
171
141
|
}
|
|
172
|
-
import type { Error } from './wasi-io-streams.js';
|
|
173
|
-
export { Error };
|
|
174
142
|
|
|
175
143
|
export class Descriptor {
|
|
176
144
|
readViaStream(offset: Filesize): InputStream;
|
|
177
|
-
writeViaStream(offset: Filesize): OutputStream;
|
|
178
|
-
appendViaStream(): OutputStream;
|
|
179
|
-
advise(offset: Filesize, length: Filesize, advice: Advice): void;
|
|
180
|
-
syncData(): void;
|
|
181
|
-
getFlags(): DescriptorFlags;
|
|
182
145
|
getType(): DescriptorType;
|
|
183
|
-
setSize(size: Filesize): void;
|
|
184
|
-
read(length: Filesize, offset: Filesize): [Uint8Array, boolean];
|
|
185
|
-
write(buffer: Uint8Array, offset: Filesize): Filesize;
|
|
186
146
|
readDirectory(): DirectoryEntryStream;
|
|
187
|
-
sync(): void;
|
|
188
|
-
createDirectoryAt(path: string): void;
|
|
189
147
|
stat(): DescriptorStat;
|
|
190
148
|
statAt(pathFlags: PathFlags, path: string): DescriptorStat;
|
|
191
|
-
setTimesAt(pathFlags: PathFlags, path: string, dataAccessTimestamp: NewTimestamp, dataModificationTimestamp: NewTimestamp): void;
|
|
192
|
-
linkAt(oldPathFlags: PathFlags, oldPath: string, newDescriptor: Descriptor, newPath: string): void;
|
|
193
149
|
openAt(pathFlags: PathFlags, path: string, openFlags: OpenFlags, flags: DescriptorFlags): Descriptor;
|
|
194
150
|
readlinkAt(path: string): string;
|
|
195
|
-
|
|
196
|
-
renameAt(oldPath: string, newDescriptor: Descriptor, newPath: string): void;
|
|
197
|
-
symlinkAt(oldPath: string, newPath: string): void;
|
|
198
|
-
unlinkFileAt(path: string): void;
|
|
151
|
+
isSameObject(other: Descriptor): boolean;
|
|
199
152
|
metadataHash(): MetadataHashValue;
|
|
200
153
|
metadataHashAt(pathFlags: PathFlags, path: string): MetadataHashValue;
|
|
201
154
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export namespace WasiHttpOutgoingHandler {
|
|
2
|
+
export function handle(request: OutgoingRequest, options: RequestOptions | undefined): FutureIncomingResponse;
|
|
3
|
+
}
|
|
4
|
+
import type { OutgoingRequest } from './wasi-http-types.js';
|
|
5
|
+
export { OutgoingRequest };
|
|
6
|
+
import type { RequestOptions } from './wasi-http-types.js';
|
|
7
|
+
export { RequestOptions };
|
|
8
|
+
import type { FutureIncomingResponse } from './wasi-http-types.js';
|
|
9
|
+
export { FutureIncomingResponse };
|
|
10
|
+
import type { ErrorCode } from './wasi-http-types.js';
|
|
11
|
+
export { ErrorCode };
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
export namespace WasiHttpTypes {
|
|
2
|
+
export { Fields };
|
|
3
|
+
export { IncomingRequest };
|
|
4
|
+
export { OutgoingRequest };
|
|
5
|
+
export { RequestOptions };
|
|
6
|
+
export { ResponseOutparam };
|
|
7
|
+
export { IncomingResponse };
|
|
8
|
+
export { IncomingBody };
|
|
9
|
+
export { FutureTrailers };
|
|
10
|
+
export { OutgoingResponse };
|
|
11
|
+
export { OutgoingBody };
|
|
12
|
+
export { FutureIncomingResponse };
|
|
13
|
+
export function httpErrorCode(err: IoError): ErrorCode | undefined;
|
|
14
|
+
}
|
|
15
|
+
export type FieldKey = string;
|
|
16
|
+
export type FieldValue = Uint8Array;
|
|
17
|
+
export type HeaderError = HeaderErrorInvalidSyntax | HeaderErrorForbidden | HeaderErrorImmutable;
|
|
18
|
+
export interface HeaderErrorInvalidSyntax {
|
|
19
|
+
tag: 'invalid-syntax',
|
|
20
|
+
}
|
|
21
|
+
export interface HeaderErrorForbidden {
|
|
22
|
+
tag: 'forbidden',
|
|
23
|
+
}
|
|
24
|
+
export interface HeaderErrorImmutable {
|
|
25
|
+
tag: 'immutable',
|
|
26
|
+
}
|
|
27
|
+
export type Method = MethodGet | MethodHead | MethodPost | MethodPut | MethodDelete | MethodConnect | MethodOptions | MethodTrace | MethodPatch | MethodOther;
|
|
28
|
+
export interface MethodGet {
|
|
29
|
+
tag: 'get',
|
|
30
|
+
}
|
|
31
|
+
export interface MethodHead {
|
|
32
|
+
tag: 'head',
|
|
33
|
+
}
|
|
34
|
+
export interface MethodPost {
|
|
35
|
+
tag: 'post',
|
|
36
|
+
}
|
|
37
|
+
export interface MethodPut {
|
|
38
|
+
tag: 'put',
|
|
39
|
+
}
|
|
40
|
+
export interface MethodDelete {
|
|
41
|
+
tag: 'delete',
|
|
42
|
+
}
|
|
43
|
+
export interface MethodConnect {
|
|
44
|
+
tag: 'connect',
|
|
45
|
+
}
|
|
46
|
+
export interface MethodOptions {
|
|
47
|
+
tag: 'options',
|
|
48
|
+
}
|
|
49
|
+
export interface MethodTrace {
|
|
50
|
+
tag: 'trace',
|
|
51
|
+
}
|
|
52
|
+
export interface MethodPatch {
|
|
53
|
+
tag: 'patch',
|
|
54
|
+
}
|
|
55
|
+
export interface MethodOther {
|
|
56
|
+
tag: 'other',
|
|
57
|
+
val: string,
|
|
58
|
+
}
|
|
59
|
+
export type Scheme = SchemeHttp | SchemeHttps | SchemeOther;
|
|
60
|
+
export interface SchemeHttp {
|
|
61
|
+
tag: 'HTTP',
|
|
62
|
+
}
|
|
63
|
+
export interface SchemeHttps {
|
|
64
|
+
tag: 'HTTPS',
|
|
65
|
+
}
|
|
66
|
+
export interface SchemeOther {
|
|
67
|
+
tag: 'other',
|
|
68
|
+
val: string,
|
|
69
|
+
}
|
|
70
|
+
export type Headers = Fields;
|
|
71
|
+
import type { Duration } from './wasi-clocks-monotonic-clock.js';
|
|
72
|
+
export { Duration };
|
|
73
|
+
export interface DnsErrorPayload {
|
|
74
|
+
rcode?: string,
|
|
75
|
+
infoCode?: number,
|
|
76
|
+
}
|
|
77
|
+
export interface TlsAlertReceivedPayload {
|
|
78
|
+
alertId?: number,
|
|
79
|
+
alertMessage?: string,
|
|
80
|
+
}
|
|
81
|
+
export interface FieldSizePayload {
|
|
82
|
+
fieldName?: string,
|
|
83
|
+
fieldSize?: number,
|
|
84
|
+
}
|
|
85
|
+
export type ErrorCode = ErrorCodeDnsTimeout | ErrorCodeDnsError | ErrorCodeDestinationNotFound | ErrorCodeDestinationUnavailable | ErrorCodeDestinationIpProhibited | ErrorCodeDestinationIpUnroutable | ErrorCodeConnectionRefused | ErrorCodeConnectionTerminated | ErrorCodeConnectionTimeout | ErrorCodeConnectionReadTimeout | ErrorCodeConnectionWriteTimeout | ErrorCodeConnectionLimitReached | ErrorCodeTlsProtocolError | ErrorCodeTlsCertificateError | ErrorCodeTlsAlertReceived | ErrorCodeHttpRequestDenied | ErrorCodeHttpRequestLengthRequired | ErrorCodeHttpRequestBodySize | ErrorCodeHttpRequestMethodInvalid | ErrorCodeHttpRequestUriInvalid | ErrorCodeHttpRequestUriTooLong | ErrorCodeHttpRequestHeaderSectionSize | ErrorCodeHttpRequestHeaderSize | ErrorCodeHttpRequestTrailerSectionSize | ErrorCodeHttpRequestTrailerSize | ErrorCodeHttpResponseIncomplete | ErrorCodeHttpResponseHeaderSectionSize | ErrorCodeHttpResponseHeaderSize | ErrorCodeHttpResponseBodySize | ErrorCodeHttpResponseTrailerSectionSize | ErrorCodeHttpResponseTrailerSize | ErrorCodeHttpResponseTransferCoding | ErrorCodeHttpResponseContentCoding | ErrorCodeHttpResponseTimeout | ErrorCodeHttpUpgradeFailed | ErrorCodeHttpProtocolError | ErrorCodeLoopDetected | ErrorCodeConfigurationError | ErrorCodeInternalError;
|
|
86
|
+
export interface ErrorCodeDnsTimeout {
|
|
87
|
+
tag: 'DNS-timeout',
|
|
88
|
+
}
|
|
89
|
+
export interface ErrorCodeDnsError {
|
|
90
|
+
tag: 'DNS-error',
|
|
91
|
+
val: DnsErrorPayload,
|
|
92
|
+
}
|
|
93
|
+
export interface ErrorCodeDestinationNotFound {
|
|
94
|
+
tag: 'destination-not-found',
|
|
95
|
+
}
|
|
96
|
+
export interface ErrorCodeDestinationUnavailable {
|
|
97
|
+
tag: 'destination-unavailable',
|
|
98
|
+
}
|
|
99
|
+
export interface ErrorCodeDestinationIpProhibited {
|
|
100
|
+
tag: 'destination-IP-prohibited',
|
|
101
|
+
}
|
|
102
|
+
export interface ErrorCodeDestinationIpUnroutable {
|
|
103
|
+
tag: 'destination-IP-unroutable',
|
|
104
|
+
}
|
|
105
|
+
export interface ErrorCodeConnectionRefused {
|
|
106
|
+
tag: 'connection-refused',
|
|
107
|
+
}
|
|
108
|
+
export interface ErrorCodeConnectionTerminated {
|
|
109
|
+
tag: 'connection-terminated',
|
|
110
|
+
}
|
|
111
|
+
export interface ErrorCodeConnectionTimeout {
|
|
112
|
+
tag: 'connection-timeout',
|
|
113
|
+
}
|
|
114
|
+
export interface ErrorCodeConnectionReadTimeout {
|
|
115
|
+
tag: 'connection-read-timeout',
|
|
116
|
+
}
|
|
117
|
+
export interface ErrorCodeConnectionWriteTimeout {
|
|
118
|
+
tag: 'connection-write-timeout',
|
|
119
|
+
}
|
|
120
|
+
export interface ErrorCodeConnectionLimitReached {
|
|
121
|
+
tag: 'connection-limit-reached',
|
|
122
|
+
}
|
|
123
|
+
export interface ErrorCodeTlsProtocolError {
|
|
124
|
+
tag: 'TLS-protocol-error',
|
|
125
|
+
}
|
|
126
|
+
export interface ErrorCodeTlsCertificateError {
|
|
127
|
+
tag: 'TLS-certificate-error',
|
|
128
|
+
}
|
|
129
|
+
export interface ErrorCodeTlsAlertReceived {
|
|
130
|
+
tag: 'TLS-alert-received',
|
|
131
|
+
val: TlsAlertReceivedPayload,
|
|
132
|
+
}
|
|
133
|
+
export interface ErrorCodeHttpRequestDenied {
|
|
134
|
+
tag: 'HTTP-request-denied',
|
|
135
|
+
}
|
|
136
|
+
export interface ErrorCodeHttpRequestLengthRequired {
|
|
137
|
+
tag: 'HTTP-request-length-required',
|
|
138
|
+
}
|
|
139
|
+
export interface ErrorCodeHttpRequestBodySize {
|
|
140
|
+
tag: 'HTTP-request-body-size',
|
|
141
|
+
val: bigint | undefined,
|
|
142
|
+
}
|
|
143
|
+
export interface ErrorCodeHttpRequestMethodInvalid {
|
|
144
|
+
tag: 'HTTP-request-method-invalid',
|
|
145
|
+
}
|
|
146
|
+
export interface ErrorCodeHttpRequestUriInvalid {
|
|
147
|
+
tag: 'HTTP-request-URI-invalid',
|
|
148
|
+
}
|
|
149
|
+
export interface ErrorCodeHttpRequestUriTooLong {
|
|
150
|
+
tag: 'HTTP-request-URI-too-long',
|
|
151
|
+
}
|
|
152
|
+
export interface ErrorCodeHttpRequestHeaderSectionSize {
|
|
153
|
+
tag: 'HTTP-request-header-section-size',
|
|
154
|
+
val: number | undefined,
|
|
155
|
+
}
|
|
156
|
+
export interface ErrorCodeHttpRequestHeaderSize {
|
|
157
|
+
tag: 'HTTP-request-header-size',
|
|
158
|
+
val: FieldSizePayload | undefined,
|
|
159
|
+
}
|
|
160
|
+
export interface ErrorCodeHttpRequestTrailerSectionSize {
|
|
161
|
+
tag: 'HTTP-request-trailer-section-size',
|
|
162
|
+
val: number | undefined,
|
|
163
|
+
}
|
|
164
|
+
export interface ErrorCodeHttpRequestTrailerSize {
|
|
165
|
+
tag: 'HTTP-request-trailer-size',
|
|
166
|
+
val: FieldSizePayload,
|
|
167
|
+
}
|
|
168
|
+
export interface ErrorCodeHttpResponseIncomplete {
|
|
169
|
+
tag: 'HTTP-response-incomplete',
|
|
170
|
+
}
|
|
171
|
+
export interface ErrorCodeHttpResponseHeaderSectionSize {
|
|
172
|
+
tag: 'HTTP-response-header-section-size',
|
|
173
|
+
val: number | undefined,
|
|
174
|
+
}
|
|
175
|
+
export interface ErrorCodeHttpResponseHeaderSize {
|
|
176
|
+
tag: 'HTTP-response-header-size',
|
|
177
|
+
val: FieldSizePayload,
|
|
178
|
+
}
|
|
179
|
+
export interface ErrorCodeHttpResponseBodySize {
|
|
180
|
+
tag: 'HTTP-response-body-size',
|
|
181
|
+
val: bigint | undefined,
|
|
182
|
+
}
|
|
183
|
+
export interface ErrorCodeHttpResponseTrailerSectionSize {
|
|
184
|
+
tag: 'HTTP-response-trailer-section-size',
|
|
185
|
+
val: number | undefined,
|
|
186
|
+
}
|
|
187
|
+
export interface ErrorCodeHttpResponseTrailerSize {
|
|
188
|
+
tag: 'HTTP-response-trailer-size',
|
|
189
|
+
val: FieldSizePayload,
|
|
190
|
+
}
|
|
191
|
+
export interface ErrorCodeHttpResponseTransferCoding {
|
|
192
|
+
tag: 'HTTP-response-transfer-coding',
|
|
193
|
+
val: string | undefined,
|
|
194
|
+
}
|
|
195
|
+
export interface ErrorCodeHttpResponseContentCoding {
|
|
196
|
+
tag: 'HTTP-response-content-coding',
|
|
197
|
+
val: string | undefined,
|
|
198
|
+
}
|
|
199
|
+
export interface ErrorCodeHttpResponseTimeout {
|
|
200
|
+
tag: 'HTTP-response-timeout',
|
|
201
|
+
}
|
|
202
|
+
export interface ErrorCodeHttpUpgradeFailed {
|
|
203
|
+
tag: 'HTTP-upgrade-failed',
|
|
204
|
+
}
|
|
205
|
+
export interface ErrorCodeHttpProtocolError {
|
|
206
|
+
tag: 'HTTP-protocol-error',
|
|
207
|
+
}
|
|
208
|
+
export interface ErrorCodeLoopDetected {
|
|
209
|
+
tag: 'loop-detected',
|
|
210
|
+
}
|
|
211
|
+
export interface ErrorCodeConfigurationError {
|
|
212
|
+
tag: 'configuration-error',
|
|
213
|
+
}
|
|
214
|
+
export interface ErrorCodeInternalError {
|
|
215
|
+
tag: 'internal-error',
|
|
216
|
+
val: string | undefined,
|
|
217
|
+
}
|
|
218
|
+
export type StatusCode = number;
|
|
219
|
+
import type { InputStream } from './wasi-io-streams.js';
|
|
220
|
+
export { InputStream };
|
|
221
|
+
import type { Pollable } from './wasi-io-poll.js';
|
|
222
|
+
export { Pollable };
|
|
223
|
+
export type Trailers = Fields;
|
|
224
|
+
import type { OutputStream } from './wasi-io-streams.js';
|
|
225
|
+
export { OutputStream };
|
|
226
|
+
import type { Error as IoError } from './wasi-io-error.js';
|
|
227
|
+
export { IoError };
|
|
228
|
+
export type Result<T, E> = { tag: 'ok', val: T } | { tag: 'err', val: E };
|
|
229
|
+
|
|
230
|
+
export class Fields {
|
|
231
|
+
constructor()
|
|
232
|
+
static fromList(entries: [FieldKey, FieldValue][]): Fields;
|
|
233
|
+
get(name: FieldKey): FieldValue[];
|
|
234
|
+
has(name: FieldKey): boolean;
|
|
235
|
+
set(name: FieldKey, value: FieldValue[]): void;
|
|
236
|
+
'delete'(name: FieldKey): void;
|
|
237
|
+
append(name: FieldKey, value: FieldValue): void;
|
|
238
|
+
entries(): [FieldKey, FieldValue][];
|
|
239
|
+
clone(): Fields;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export class FutureIncomingResponse {
|
|
243
|
+
subscribe(): Pollable;
|
|
244
|
+
get(): Result<Result<IncomingResponse, ErrorCode>, void> | undefined;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export class FutureTrailers {
|
|
248
|
+
subscribe(): Pollable;
|
|
249
|
+
get(): Result<Result<Trailers | undefined, ErrorCode>, void> | undefined;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export class IncomingBody {
|
|
253
|
+
stream(): InputStream;
|
|
254
|
+
static finish(this_: IncomingBody): FutureTrailers;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export class IncomingRequest {
|
|
258
|
+
method(): Method;
|
|
259
|
+
pathWithQuery(): string | undefined;
|
|
260
|
+
scheme(): Scheme | undefined;
|
|
261
|
+
authority(): string | undefined;
|
|
262
|
+
headers(): Headers;
|
|
263
|
+
consume(): IncomingBody;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export class IncomingResponse {
|
|
267
|
+
status(): StatusCode;
|
|
268
|
+
headers(): Headers;
|
|
269
|
+
consume(): IncomingBody;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export class OutgoingBody {
|
|
273
|
+
write(): OutputStream;
|
|
274
|
+
static finish(this_: OutgoingBody, trailers: Trailers | undefined): void;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export class OutgoingRequest {
|
|
278
|
+
constructor(headers: Headers)
|
|
279
|
+
body(): OutgoingBody;
|
|
280
|
+
method(): Method;
|
|
281
|
+
setMethod(method: Method): void;
|
|
282
|
+
pathWithQuery(): string | undefined;
|
|
283
|
+
setPathWithQuery(pathWithQuery: string | undefined): void;
|
|
284
|
+
scheme(): Scheme | undefined;
|
|
285
|
+
setScheme(scheme: Scheme | undefined): void;
|
|
286
|
+
authority(): string | undefined;
|
|
287
|
+
setAuthority(authority: string | undefined): void;
|
|
288
|
+
headers(): Headers;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export class OutgoingResponse {
|
|
292
|
+
constructor(headers: Headers)
|
|
293
|
+
statusCode(): StatusCode;
|
|
294
|
+
setStatusCode(statusCode: StatusCode): void;
|
|
295
|
+
headers(): Headers;
|
|
296
|
+
body(): OutgoingBody;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export class RequestOptions {
|
|
300
|
+
constructor()
|
|
301
|
+
connectTimeout(): Duration | undefined;
|
|
302
|
+
setConnectTimeout(duration: Duration | undefined): void;
|
|
303
|
+
firstByteTimeout(): Duration | undefined;
|
|
304
|
+
setFirstByteTimeout(duration: Duration | undefined): void;
|
|
305
|
+
betweenBytesTimeout(): Duration | undefined;
|
|
306
|
+
setBetweenBytesTimeout(duration: Duration | undefined): void;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export class ResponseOutparam {
|
|
310
|
+
static set(param: ResponseOutparam, response: Result<OutgoingResponse, ErrorCode>): void;
|
|
311
|
+
}
|
|
@@ -18,6 +18,8 @@ export { Pollable };
|
|
|
18
18
|
export class InputStream {
|
|
19
19
|
read(len: bigint): Uint8Array;
|
|
20
20
|
blockingRead(len: bigint): Uint8Array;
|
|
21
|
+
skip(len: bigint): bigint;
|
|
22
|
+
blockingSkip(len: bigint): bigint;
|
|
21
23
|
subscribe(): Pollable;
|
|
22
24
|
}
|
|
23
25
|
|
|
@@ -25,6 +27,11 @@ export class OutputStream {
|
|
|
25
27
|
checkWrite(): bigint;
|
|
26
28
|
write(contents: Uint8Array): void;
|
|
27
29
|
blockingWriteAndFlush(contents: Uint8Array): void;
|
|
30
|
+
flush(): void;
|
|
28
31
|
blockingFlush(): void;
|
|
29
32
|
subscribe(): Pollable;
|
|
33
|
+
writeZeroes(len: bigint): void;
|
|
34
|
+
blockingWriteZeroesAndFlush(len: bigint): void;
|
|
35
|
+
splice(src: InputStream, len: bigint): bigint;
|
|
36
|
+
blockingSplice(src: InputStream, len: bigint): bigint;
|
|
30
37
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|