cf-workers-native 0.0.0-stage → 0.1.2-beta.local.sha2f5e4e6956f4
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/LICENSE +21 -0
- package/Package.swift +25 -0
- package/README.md +92 -2
- package/dist/android.d.ts +2 -0
- package/dist/android.js +1 -0
- package/dist/browser/abort/index.d.ts +13 -0
- package/dist/browser/abort/index.js +66 -0
- package/dist/browser/body/index.d.ts +24 -0
- package/dist/browser/body/index.js +116 -0
- package/dist/browser/body/stream-body.d.ts +13 -0
- package/dist/browser/body/stream-body.js +84 -0
- package/dist/browser/documents/body.d.ts +3 -0
- package/dist/browser/documents/body.js +48 -0
- package/dist/browser/documents/form-body.d.ts +1 -0
- package/dist/browser/documents/form-body.js +54 -0
- package/dist/browser/documents/host.d.ts +11 -0
- package/dist/browser/documents/host.js +256 -0
- package/dist/browser/documents/links-source.d.ts +1 -0
- package/dist/browser/documents/links-source.js +1 -0
- package/dist/browser/documents/links.d.ts +1 -0
- package/dist/browser/documents/links.js +33 -0
- package/dist/browser/documents/page-config.d.ts +5 -0
- package/dist/browser/documents/page-config.js +5 -0
- package/dist/browser/documents/page-source.d.ts +1 -0
- package/dist/browser/documents/page-source.js +1 -0
- package/dist/browser/documents/page.d.ts +2 -0
- package/dist/browser/documents/page.js +153 -0
- package/dist/browser/documents/registration.d.ts +5 -0
- package/dist/browser/documents/registration.js +75 -0
- package/dist/browser/documents/runtime.d.ts +7 -0
- package/dist/browser/documents/runtime.js +161 -0
- package/dist/browser/documents/service-worker.js +285 -0
- package/dist/browser/encoding/index.d.ts +7 -0
- package/dist/browser/encoding/index.js +3 -0
- package/dist/browser/fetch/LICENSE-3RD-PARTY.md +9 -0
- package/dist/browser/fetch/LICENSE-APACHE +177 -0
- package/dist/browser/fetch/host-call.d.ts +3 -0
- package/dist/browser/fetch/host-call.js +67 -0
- package/dist/browser/fetch/index.d.ts +5 -0
- package/dist/browser/fetch/index.js +96 -0
- package/dist/browser/fetch/interop.d.ts +6 -0
- package/dist/browser/fetch/interop.js +48 -0
- package/dist/browser/fetch/native-network.d.ts +20 -0
- package/dist/browser/fetch/native-network.js +233 -0
- package/dist/browser/fetch/outbound.d.ts +2 -0
- package/dist/browser/fetch/outbound.js +11 -0
- package/dist/browser/fetch/relay.d.ts +7 -0
- package/dist/browser/fetch/relay.js +100 -0
- package/dist/browser/fetch/scope.d.ts +8 -0
- package/dist/browser/fetch/scope.js +108 -0
- package/dist/browser/fetch/transport.d.ts +39 -0
- package/dist/browser/fetch/transport.js +136 -0
- package/dist/browser/headers/LICENSE-3RD-PARTY.md +9 -0
- package/dist/browser/headers/LICENSE-APACHE +177 -0
- package/dist/browser/headers/index.d.ts +20 -0
- package/dist/browser/headers/index.js +194 -0
- package/dist/browser/isolated/bridge.d.ts +8 -0
- package/dist/browser/isolated/bridge.js +267 -0
- package/dist/browser/isolated/protocol.d.ts +40 -0
- package/dist/browser/isolated/protocol.js +1 -0
- package/dist/browser/isolated/transport.d.ts +2 -0
- package/dist/browser/isolated/transport.js +157 -0
- package/dist/browser/request/LICENSE-3RD-PARTY.md +10 -0
- package/dist/browser/request/LICENSE-APACHE +177 -0
- package/dist/browser/request/index.d.ts +48 -0
- package/dist/browser/request/index.js +182 -0
- package/dist/browser/response/LICENSE-3RD-PARTY.md +10 -0
- package/dist/browser/response/LICENSE-APACHE +177 -0
- package/dist/browser/response/index.d.ts +43 -0
- package/dist/browser/response/index.js +192 -0
- package/dist/browser/response/status.d.ts +1 -0
- package/dist/browser/response/status.js +75 -0
- package/dist/browser/structured-clone/index.d.ts +1 -0
- package/dist/browser/structured-clone/index.js +479 -0
- package/dist/cloudflare/apis/cloudflare-node/index.d.ts +18 -0
- package/dist/cloudflare/apis/cloudflare-node/index.js +150 -0
- package/dist/cloudflare/apis/cloudflare-workers/index.d.ts +8 -0
- package/dist/cloudflare/apis/cloudflare-workers/index.js +37 -0
- package/dist/cloudflare/apis/types.d.ts +7 -0
- package/dist/cloudflare/apis/types.js +1 -0
- package/dist/cloudflare/bindings/config.d.ts +42 -0
- package/dist/cloudflare/bindings/config.js +280 -0
- package/dist/cloudflare/bindings/kv/contract.d.ts +6 -0
- package/dist/cloudflare/bindings/kv/contract.js +181 -0
- package/dist/cloudflare/bindings/kv/index.d.ts +18 -0
- package/dist/cloudflare/bindings/kv/index.js +61 -0
- package/dist/cloudflare/bindings/kv/storage.d.ts +25 -0
- package/dist/cloudflare/bindings/kv/storage.js +320 -0
- package/dist/cloudflare/bindings/kv/types.d.ts +50 -0
- package/dist/cloudflare/bindings/kv/types.js +1 -0
- package/dist/cloudflare/bindings/remote.d.ts +8 -0
- package/dist/cloudflare/bindings/remote.js +261 -0
- package/dist/cloudflare/workers/contract.d.ts +8 -0
- package/dist/cloudflare/workers/contract.js +65 -0
- package/dist/cloudflare/workers/feature.d.ts +10 -0
- package/dist/cloudflare/workers/feature.js +28 -0
- package/dist/cloudflare/workers/runtime.d.ts +23 -0
- package/dist/cloudflare/workers/runtime.js +121 -0
- package/dist/cloudflare/workers/types.d.ts +49 -0
- package/dist/cloudflare/workers/types.js +1 -0
- package/dist/cloudflare/workers/worker-runtime.d.ts +44 -0
- package/dist/cloudflare/workers/worker-runtime.js +267 -0
- package/dist/compat/assert/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/assert/LICENSE-APACHE +177 -0
- package/dist/compat/assert/assertion-error.d.ts +26 -0
- package/dist/compat/assert/assertion-error.js +468 -0
- package/dist/compat/assert/diff.d.ts +26 -0
- package/dist/compat/assert/diff.js +329 -0
- package/dist/compat/assert/errors.d.ts +11 -0
- package/dist/compat/assert/errors.js +55 -0
- package/dist/compat/assert/index.cjs +24 -0
- package/dist/compat/assert/index.d.cts +43 -0
- package/dist/compat/assert/index.d.ts +50 -0
- package/dist/compat/assert/index.js +858 -0
- package/dist/compat/async-hooks/LICENSE-APACHE +177 -0
- package/dist/compat/async-hooks/NOTICE.md +8 -0
- package/dist/compat/async-hooks/callbacks.d.ts +7 -0
- package/dist/compat/async-hooks/callbacks.js +18 -0
- package/dist/compat/async-hooks/hooks.d.ts +10 -0
- package/dist/compat/async-hooks/hooks.js +111 -0
- package/dist/compat/async-hooks/index.d.ts +41 -0
- package/dist/compat/async-hooks/index.js +298 -0
- package/dist/compat/buffer/LICENSE-3RD-PARTY.md +15 -0
- package/dist/compat/buffer/LICENSE-APACHE +177 -0
- package/dist/compat/buffer/blob.d.ts +22 -0
- package/dist/compat/buffer/blob.js +210 -0
- package/dist/compat/buffer/bytes.d.ts +34 -0
- package/dist/compat/buffer/bytes.js +228 -0
- package/dist/compat/buffer/errors.d.ts +41 -0
- package/dist/compat/buffer/errors.js +265 -0
- package/dist/compat/buffer/index.d.ts +25 -0
- package/dist/compat/buffer/index.js +24 -0
- package/dist/compat/buffer/internal-buffer.d.ts +148 -0
- package/dist/compat/buffer/internal-buffer.js +1809 -0
- package/dist/compat/buffer/support.d.ts +13 -0
- package/dist/compat/buffer/support.js +65 -0
- package/dist/compat/child-process/LICENSE-3RD-PARTY.md +8 -0
- package/dist/compat/child-process/LICENSE-APACHE +177 -0
- package/dist/compat/child-process/errors.d.ts +4 -0
- package/dist/compat/child-process/errors.js +6 -0
- package/dist/compat/child-process/index.d.ts +49 -0
- package/dist/compat/child-process/index.js +96 -0
- package/dist/compat/cluster/LICENSE-3RD-PARTY.md +40 -0
- package/dist/compat/cluster/LICENSE-APACHE +177 -0
- package/dist/compat/cluster/errors.d.ts +4 -0
- package/dist/compat/cluster/errors.js +6 -0
- package/dist/compat/cluster/index.d.ts +47 -0
- package/dist/compat/cluster/index.js +88 -0
- package/dist/compat/constants/LICENSE-3RD-PARTY.md +6 -0
- package/dist/compat/constants/LICENSE-APACHE +177 -0
- package/dist/compat/constants/index.d.ts +481 -0
- package/dist/compat/constants/index.js +488 -0
- package/dist/compat/dgram/LICENSE-3RD-PARTY.md +8 -0
- package/dist/compat/dgram/LICENSE-APACHE +177 -0
- package/dist/compat/dgram/index.d.ts +10 -0
- package/dist/compat/dgram/index.js +132 -0
- package/dist/compat/diagnostics-channel/LICENSE-3RD-PARTY.md +13 -0
- package/dist/compat/diagnostics-channel/LICENSE-APACHE +177 -0
- package/dist/compat/diagnostics-channel/index.d.ts +73 -0
- package/dist/compat/diagnostics-channel/index.js +261 -0
- package/dist/compat/diagnostics-channel/native.d.ts +26 -0
- package/dist/compat/diagnostics-channel/native.js +154 -0
- package/dist/compat/dns/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/dns/LICENSE-APACHE +177 -0
- package/dist/compat/dns/client.d.ts +72 -0
- package/dist/compat/dns/client.js +161 -0
- package/dist/compat/dns/constants.d.ts +27 -0
- package/dist/compat/dns/constants.js +31 -0
- package/dist/compat/dns/errors.d.ts +8 -0
- package/dist/compat/dns/errors.js +12 -0
- package/dist/compat/dns/index.d.ts +97 -0
- package/dist/compat/dns/index.js +127 -0
- package/dist/compat/dns/parser.d.ts +18 -0
- package/dist/compat/dns/parser.js +144 -0
- package/dist/compat/dns/promise-resolver.d.ts +82 -0
- package/dist/compat/dns/promise-resolver.js +113 -0
- package/dist/compat/dns/promises.d.ts +50 -0
- package/dist/compat/dns/promises.js +53 -0
- package/dist/compat/dns/resolver.d.ts +34 -0
- package/dist/compat/dns/resolver.js +415 -0
- package/dist/compat/domain/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/domain/LICENSE-APACHE +177 -0
- package/dist/compat/domain/index.d.ts +22 -0
- package/dist/compat/domain/index.js +79 -0
- package/dist/compat/fs/index.d.ts +85 -0
- package/dist/compat/fs/index.js +255 -0
- package/dist/compat/fs/promises/index.d.ts +3 -0
- package/dist/compat/fs/promises/index.js +3 -0
- package/dist/compat/http/index.d.ts +322 -0
- package/dist/compat/http/index.js +1356 -0
- package/dist/compat/http/registry.d.ts +19 -0
- package/dist/compat/http/registry.js +13 -0
- package/dist/compat/http-agent/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/http-agent/LICENSE-APACHE +177 -0
- package/dist/compat/http-agent/index.d.ts +7 -0
- package/dist/compat/http-agent/index.js +10 -0
- package/dist/compat/http-client/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/http-client/LICENSE-APACHE +177 -0
- package/dist/compat/http-client/index.d.ts +6 -0
- package/dist/compat/http-client/index.js +7 -0
- package/dist/compat/http-incoming/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/http-incoming/LICENSE-APACHE +177 -0
- package/dist/compat/http-incoming/index.d.ts +6 -0
- package/dist/compat/http-incoming/index.js +9 -0
- package/dist/compat/http2/LICENSE-3RD-PARTY.md +29 -0
- package/dist/compat/http2/LICENSE-APACHE +177 -0
- package/dist/compat/http2/constants.d.ts +255 -0
- package/dist/compat/http2/constants.js +515 -0
- package/dist/compat/http2/errors.d.ts +4 -0
- package/dist/compat/http2/errors.js +6 -0
- package/dist/compat/http2/index.d.ts +283 -0
- package/dist/compat/http2/index.js +68 -0
- package/dist/compat/https/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/https/LICENSE-APACHE +177 -0
- package/dist/compat/https/agent.d.ts +10 -0
- package/dist/compat/https/agent.js +99 -0
- package/dist/compat/https/errors.d.ts +4 -0
- package/dist/compat/https/errors.js +6 -0
- package/dist/compat/https/index.d.ts +20 -0
- package/dist/compat/https/index.js +50 -0
- package/dist/compat/https/server.d.ts +8 -0
- package/dist/compat/https/server.js +27 -0
- package/dist/compat/immediate/index.d.ts +11 -0
- package/dist/compat/immediate/index.js +58 -0
- package/dist/compat/inspector/LICENSE-3RD-PARTY.md +34 -0
- package/dist/compat/inspector/LICENSE-APACHE +177 -0
- package/dist/compat/inspector/errors.d.ts +4 -0
- package/dist/compat/inspector/errors.js +6 -0
- package/dist/compat/inspector/index.d.ts +18 -0
- package/dist/compat/inspector/index.js +117 -0
- package/dist/compat/inspector/promises.d.ts +18 -0
- package/dist/compat/inspector/promises.js +114 -0
- package/dist/compat/module/index.cjs +2 -0
- package/dist/compat/module/index.d.cts +2 -0
- package/dist/compat/module/index.d.ts +11 -0
- package/dist/compat/module/index.js +44 -0
- package/dist/compat/module/resolve-unavailable.d.ts +1 -0
- package/dist/compat/module/resolve-unavailable.js +3 -0
- package/dist/compat/net/LICENSE-3RD-PARTY.md +15 -0
- package/dist/compat/net/LICENSE-APACHE +177 -0
- package/dist/compat/net/error-base.d.ts +14 -0
- package/dist/compat/net/error-base.js +62 -0
- package/dist/compat/net/errors.d.ts +76 -0
- package/dist/compat/net/errors.js +333 -0
- package/dist/compat/net/index.d.ts +23 -0
- package/dist/compat/net/index.js +46 -0
- package/dist/compat/net/internal-net.d.ts +236 -0
- package/dist/compat/net/internal-net.js +2292 -0
- package/dist/compat/net/ports.d.ts +32 -0
- package/dist/compat/net/ports.js +149 -0
- package/dist/compat/net/reader.d.ts +8 -0
- package/dist/compat/net/reader.js +36 -0
- package/dist/compat/net/sockets.d.ts +20 -0
- package/dist/compat/net/sockets.js +195 -0
- package/dist/compat/net/validators.d.ts +18 -0
- package/dist/compat/net/validators.js +154 -0
- package/dist/compat/os/LICENSE-3RD-PARTY.md +8 -0
- package/dist/compat/os/LICENSE-APACHE +177 -0
- package/dist/compat/os/index.d.ts +329 -0
- package/dist/compat/os/index.js +278 -0
- package/dist/compat/path/LICENSE-3RD-PARTY.md +35 -0
- package/dist/compat/path/LICENSE-APACHE +177 -0
- package/dist/compat/path/index.d.ts +4 -0
- package/dist/compat/path/index.js +11 -0
- package/dist/compat/path/internal-path.d.ts +95 -0
- package/dist/compat/path/internal-path.js +1542 -0
- package/dist/compat/path/posix/index.d.ts +4 -0
- package/dist/compat/path/posix/index.js +5 -0
- package/dist/compat/path/win32/index.d.ts +4 -0
- package/dist/compat/path/win32/index.js +5 -0
- package/dist/compat/perf-hooks/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/perf-hooks/LICENSE-APACHE +177 -0
- package/dist/compat/perf-hooks/index.d.ts +85 -0
- package/dist/compat/perf-hooks/index.js +79 -0
- package/dist/compat/perf-hooks/performance.d.ts +96 -0
- package/dist/compat/perf-hooks/performance.js +445 -0
- package/dist/compat/punycode/LICENSE-3RD-PARTY.md +7 -0
- package/dist/compat/punycode/LICENSE-APACHE +177 -0
- package/dist/compat/punycode/index.d.ts +93 -0
- package/dist/compat/punycode/index.js +410 -0
- package/dist/compat/querystring/LICENSE-3RD-PARTY.md +35 -0
- package/dist/compat/querystring/LICENSE-APACHE +177 -0
- package/dist/compat/querystring/index.d.ts +14 -0
- package/dist/compat/querystring/index.js +18 -0
- package/dist/compat/querystring/internal-querystring.d.ts +22 -0
- package/dist/compat/querystring/internal-querystring.js +498 -0
- package/dist/compat/readline/LICENSE-3RD-PARTY.md +37 -0
- package/dist/compat/readline/LICENSE-APACHE +177 -0
- package/dist/compat/readline/index.d.ts +21 -0
- package/dist/compat/readline/index.js +56 -0
- package/dist/compat/readline/interface.d.ts +22 -0
- package/dist/compat/readline/interface.js +85 -0
- package/dist/compat/readline/internal-promises.d.ts +32 -0
- package/dist/compat/readline/internal-promises.js +104 -0
- package/dist/compat/readline/promises.d.ts +8 -0
- package/dist/compat/readline/promises.js +32 -0
- package/dist/compat/repl/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/repl/LICENSE-APACHE +177 -0
- package/dist/compat/repl/builtin-modules.d.ts +1 -0
- package/dist/compat/repl/builtin-modules.js +101 -0
- package/dist/compat/repl/errors.d.ts +4 -0
- package/dist/compat/repl/errors.js +6 -0
- package/dist/compat/repl/index.d.ts +53 -0
- package/dist/compat/repl/index.js +106 -0
- package/dist/compat/sqlite/LICENSE-3RD-PARTY.md +6 -0
- package/dist/compat/sqlite/LICENSE-APACHE +177 -0
- package/dist/compat/sqlite/index.d.ts +12 -0
- package/dist/compat/sqlite/index.js +101 -0
- package/dist/compat/sqlite/native.d.ts +16 -0
- package/dist/compat/sqlite/native.js +33 -0
- package/dist/compat/stream/LICENSE-3RD-PARTY.md +13 -0
- package/dist/compat/stream/LICENSE-APACHE +177 -0
- package/dist/compat/stream/add-abort-signal.d.ts +4 -0
- package/dist/compat/stream/add-abort-signal.js +73 -0
- package/dist/compat/stream/compose.d.ts +1 -0
- package/dist/compat/stream/compose.js +313 -0
- package/dist/compat/stream/destroy.d.ts +5 -0
- package/dist/compat/stream/destroy.js +315 -0
- package/dist/compat/stream/duplex.d.ts +48 -0
- package/dist/compat/stream/duplex.js +789 -0
- package/dist/compat/stream/end-of-stream.d.ts +16 -0
- package/dist/compat/stream/end-of-stream.js +269 -0
- package/dist/compat/stream/errors.d.ts +40 -0
- package/dist/compat/stream/errors.js +86 -0
- package/dist/compat/stream/events.d.ts +6 -0
- package/dist/compat/stream/events.js +28 -0
- package/dist/compat/stream/index.cjs +27 -0
- package/dist/compat/stream/index.d.cts +25 -0
- package/dist/compat/stream/index.d.ts +20 -0
- package/dist/compat/stream/index.js +55 -0
- package/dist/compat/stream/legacy.d.ts +8 -0
- package/dist/compat/stream/legacy.js +105 -0
- package/dist/compat/stream/once.d.ts +7 -0
- package/dist/compat/stream/once.js +13 -0
- package/dist/compat/stream/pipeline.d.ts +5 -0
- package/dist/compat/stream/pipeline.js +567 -0
- package/dist/compat/stream/process.d.ts +1 -0
- package/dist/compat/stream/process.js +4 -0
- package/dist/compat/stream/promises.d.ts +7 -0
- package/dist/compat/stream/promises.js +60 -0
- package/dist/compat/stream/readable.d.ts +29 -0
- package/dist/compat/stream/readable.js +2267 -0
- package/dist/compat/stream/state.d.ts +8 -0
- package/dist/compat/stream/state.js +63 -0
- package/dist/compat/stream/transform.d.ts +2 -0
- package/dist/compat/stream/transform.js +202 -0
- package/dist/compat/stream/util.d.ts +55 -0
- package/dist/compat/stream/util.js +345 -0
- package/dist/compat/stream/validators.d.ts +2 -0
- package/dist/compat/stream/validators.js +14 -0
- package/dist/compat/stream/writable.d.ts +21 -0
- package/dist/compat/stream/writable.js +1325 -0
- package/dist/compat/stream-consumers/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/stream-consumers/LICENSE-APACHE +177 -0
- package/dist/compat/stream-consumers/index.d.ts +14 -0
- package/dist/compat/stream-consumers/index.js +62 -0
- package/dist/compat/stream-consumers/iterable.d.ts +1 -0
- package/dist/compat/stream-consumers/iterable.js +34 -0
- package/dist/compat/stream-duplex/LICENSE-3RD-PARTY.md +13 -0
- package/dist/compat/stream-duplex/LICENSE-APACHE +177 -0
- package/dist/compat/stream-duplex/index.cjs +3 -0
- package/dist/compat/stream-duplex/index.d.cts +2 -0
- package/dist/compat/stream-duplex/index.d.ts +3 -0
- package/dist/compat/stream-duplex/index.js +8 -0
- package/dist/compat/stream-passthrough/LICENSE-3RD-PARTY.md +13 -0
- package/dist/compat/stream-passthrough/LICENSE-APACHE +177 -0
- package/dist/compat/stream-passthrough/index.cjs +3 -0
- package/dist/compat/stream-passthrough/index.d.cts +2 -0
- package/dist/compat/stream-passthrough/index.d.ts +3 -0
- package/dist/compat/stream-passthrough/index.js +8 -0
- package/dist/compat/stream-promises/LICENSE-3RD-PARTY.md +13 -0
- package/dist/compat/stream-promises/LICENSE-APACHE +177 -0
- package/dist/compat/stream-promises/index.d.ts +1 -0
- package/dist/compat/stream-promises/index.js +1 -0
- package/dist/compat/stream-readable/LICENSE-3RD-PARTY.md +13 -0
- package/dist/compat/stream-readable/LICENSE-APACHE +177 -0
- package/dist/compat/stream-readable/index.cjs +3 -0
- package/dist/compat/stream-readable/index.d.cts +2 -0
- package/dist/compat/stream-readable/index.d.ts +3 -0
- package/dist/compat/stream-readable/index.js +8 -0
- package/dist/compat/stream-transform/LICENSE-3RD-PARTY.md +13 -0
- package/dist/compat/stream-transform/LICENSE-APACHE +177 -0
- package/dist/compat/stream-transform/index.cjs +3 -0
- package/dist/compat/stream-transform/index.d.cts +2 -0
- package/dist/compat/stream-transform/index.d.ts +3 -0
- package/dist/compat/stream-transform/index.js +8 -0
- package/dist/compat/stream-web/LICENSE-MIT +22 -0
- package/dist/compat/stream-web/NOTICE.md +3 -0
- package/dist/compat/stream-web/context.d.ts +2 -0
- package/dist/compat/stream-web/context.js +35 -0
- package/dist/compat/stream-web/index.d.ts +80 -0
- package/dist/compat/stream-web/index.js +129 -0
- package/dist/compat/stream-web/interop.d.ts +6 -0
- package/dist/compat/stream-web/interop.js +72 -0
- package/dist/compat/stream-web/ponyfill.d.ts +1 -0
- package/dist/compat/stream-web/ponyfill.js +2093 -0
- package/dist/compat/stream-web/runtime.d.ts +16 -0
- package/dist/compat/stream-web/runtime.js +51 -0
- package/dist/compat/stream-writable/LICENSE-3RD-PARTY.md +13 -0
- package/dist/compat/stream-writable/LICENSE-APACHE +177 -0
- package/dist/compat/stream-writable/index.cjs +3 -0
- package/dist/compat/stream-writable/index.d.cts +2 -0
- package/dist/compat/stream-writable/index.d.ts +3 -0
- package/dist/compat/stream-writable/index.js +8 -0
- package/dist/compat/string-decoder/LICENSE-3RD-PARTY.md +38 -0
- package/dist/compat/string-decoder/LICENSE-APACHE +177 -0
- package/dist/compat/string-decoder/index.d.ts +33 -0
- package/dist/compat/string-decoder/index.js +518 -0
- package/dist/compat/test/LICENSE-3RD-PARTY.md +37 -0
- package/dist/compat/test/LICENSE-APACHE +177 -0
- package/dist/compat/test/index.d.ts +9 -0
- package/dist/compat/test/index.js +11 -0
- package/dist/compat/test/mock.d.ts +103 -0
- package/dist/compat/test/mock.js +397 -0
- package/dist/compat/test/validators.d.ts +2 -0
- package/dist/compat/test/validators.js +14 -0
- package/dist/compat/timers/LICENSE-3RD-PARTY.md +7 -0
- package/dist/compat/timers/LICENSE-APACHE +177 -0
- package/dist/compat/timers/errors.d.ts +28 -0
- package/dist/compat/timers/errors.js +206 -0
- package/dist/compat/timers/host.d.ts +11 -0
- package/dist/compat/timers/host.js +60 -0
- package/dist/compat/timers/index.cjs +3 -0
- package/dist/compat/timers/index.d.cts +23 -0
- package/dist/compat/timers/index.d.ts +36 -0
- package/dist/compat/timers/index.js +20 -0
- package/dist/compat/timers/installation.d.ts +4 -0
- package/dist/compat/timers/installation.js +61 -0
- package/dist/compat/timers/internal-promises.d.ts +19 -0
- package/dist/compat/timers/internal-promises.js +173 -0
- package/dist/compat/timers/promises.cjs +2 -0
- package/dist/compat/timers/promises.d.cts +12 -0
- package/dist/compat/timers/promises.d.ts +14 -0
- package/dist/compat/timers/promises.js +3 -0
- package/dist/compat/timers/timers.d.ts +32 -0
- package/dist/compat/timers/timers.js +147 -0
- package/dist/compat/timers/validation.d.ts +5 -0
- package/dist/compat/timers/validation.js +22 -0
- package/dist/compat/timers/wait.d.ts +4 -0
- package/dist/compat/timers/wait.js +91 -0
- package/dist/compat/tls-common/LICENSE-3RD-PARTY.md +11 -0
- package/dist/compat/tls-common/LICENSE-APACHE +177 -0
- package/dist/compat/tls-common/index.d.ts +14 -0
- package/dist/compat/tls-common/index.js +88 -0
- package/dist/compat/trace-events/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/trace-events/LICENSE-APACHE +177 -0
- package/dist/compat/trace-events/index.d.ts +18 -0
- package/dist/compat/trace-events/index.js +88 -0
- package/dist/compat/tty/LICENSE-3RD-PARTY.md +8 -0
- package/dist/compat/tty/LICENSE-APACHE +177 -0
- package/dist/compat/tty/index.d.ts +17 -0
- package/dist/compat/tty/index.js +101 -0
- package/dist/compat/url/LICENSE-3RD-PARTY.md +63 -0
- package/dist/compat/url/LICENSE-ADA +18 -0
- package/dist/compat/url/LICENSE-APACHE +177 -0
- package/dist/compat/url/LICENSE-UNICODE +39 -0
- package/dist/compat/url/LICENSE-WHATWG-URL +21 -0
- package/dist/compat/url/brand.d.ts +4 -0
- package/dist/compat/url/brand.js +10 -0
- package/dist/compat/url/constants.d.ts +27 -0
- package/dist/compat/url/constants.js +28 -0
- package/dist/compat/url/errors.d.ts +44 -0
- package/dist/compat/url/errors.js +248 -0
- package/dist/compat/url/idna-data.d.ts +3958 -0
- package/dist/compat/url/idna-data.js +22 -0
- package/dist/compat/url/idna.d.ts +9 -0
- package/dist/compat/url/idna.js +47 -0
- package/dist/compat/url/index.d.ts +48 -0
- package/dist/compat/url/index.js +39 -0
- package/dist/compat/url/installation.d.ts +4 -0
- package/dist/compat/url/installation.js +61 -0
- package/dist/compat/url/internal-url.d.ts +34 -0
- package/dist/compat/url/internal-url.js +264 -0
- package/dist/compat/url/legacy-url.d.ts +28 -0
- package/dist/compat/url/legacy-url.js +870 -0
- package/dist/compat/url/parser-platform.d.ts +3 -0
- package/dist/compat/url/parser-platform.js +26 -0
- package/dist/compat/url/standard-url.d.ts +2 -0
- package/dist/compat/url/standard-url.js +3189 -0
- package/dist/compat/url/unicode.d.ts +2 -0
- package/dist/compat/url/unicode.js +119 -0
- package/dist/compat/url/validation.d.ts +2 -0
- package/dist/compat/url/validation.js +9 -0
- package/dist/compat/url/web-url.d.ts +27 -0
- package/dist/compat/url/web-url.js +119 -0
- package/dist/compat/util/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/util/LICENSE-APACHE +177 -0
- package/dist/compat/util/additional.d.ts +11 -0
- package/dist/compat/util/additional.js +121 -0
- package/dist/compat/util/comparison-types.d.ts +16 -0
- package/dist/compat/util/comparison-types.js +50 -0
- package/dist/compat/util/comparisons.d.ts +1 -0
- package/dist/compat/util/comparisons.js +527 -0
- package/dist/compat/util/core.d.ts +18 -0
- package/dist/compat/util/core.js +265 -0
- package/dist/compat/util/debuglog.d.ts +1 -0
- package/dist/compat/util/debuglog.js +78 -0
- package/dist/compat/util/index.d.ts +35 -0
- package/dist/compat/util/index.js +77 -0
- package/dist/compat/util/inspect-binding.d.ts +13 -0
- package/dist/compat/util/inspect-binding.js +39 -0
- package/dist/compat/util/inspect-types.d.ts +13 -0
- package/dist/compat/util/inspect-types.js +30 -0
- package/dist/compat/util/inspect.d.ts +152 -0
- package/dist/compat/util/inspect.js +2503 -0
- package/dist/compat/util/mime.d.ts +24 -0
- package/dist/compat/util/mime.js +284 -0
- package/dist/compat/util/properties.d.ts +9 -0
- package/dist/compat/util/properties.js +76 -0
- package/dist/compat/v8/LICENSE-3RD-PARTY.md +6 -0
- package/dist/compat/v8/LICENSE-APACHE +177 -0
- package/dist/compat/v8/errors.d.ts +5 -0
- package/dist/compat/v8/errors.js +7 -0
- package/dist/compat/v8/index.d.ts +106 -0
- package/dist/compat/v8/index.js +280 -0
- package/dist/compat/vm/LICENSE-3RD-PARTY.md +39 -0
- package/dist/compat/vm/LICENSE-APACHE +177 -0
- package/dist/compat/vm/errors.d.ts +5 -0
- package/dist/compat/vm/errors.js +7 -0
- package/dist/compat/vm/index.d.ts +47 -0
- package/dist/compat/vm/index.js +231 -0
- package/dist/compat/vm/validation.d.ts +3 -0
- package/dist/compat/vm/validation.js +14 -0
- package/dist/compat/wasi/LICENSE-3RD-PARTY.md +8 -0
- package/dist/compat/wasi/LICENSE-APACHE +177 -0
- package/dist/compat/wasi/errors.d.ts +4 -0
- package/dist/compat/wasi/errors.js +6 -0
- package/dist/compat/wasi/index.d.ts +15 -0
- package/dist/compat/wasi/index.js +44 -0
- package/dist/compat/worker-threads/LICENSE-3RD-PARTY.md +5 -0
- package/dist/compat/worker-threads/LICENSE-APACHE +177 -0
- package/dist/compat/worker-threads/errors.d.ts +4 -0
- package/dist/compat/worker-threads/errors.js +6 -0
- package/dist/compat/worker-threads/index.d.ts +71 -0
- package/dist/compat/worker-threads/index.js +138 -0
- package/dist/compat/worker-threads/message-channel.d.ts +18 -0
- package/dist/compat/worker-threads/message-channel.js +157 -0
- package/dist/configured.d.ts +3 -0
- package/dist/configured.js +4 -0
- package/dist/environment.d.ts +4 -0
- package/dist/environment.js +18 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +107 -0
- package/dist/ios.d.ts +2 -0
- package/dist/ios.js +1 -0
- package/dist/native-entry.d.ts +8 -0
- package/dist/native-entry.js +67 -0
- package/dist/shared/brotli/LICENSE-APACHE +201 -0
- package/dist/shared/brotli/LICENSE-MIT +9 -0
- package/dist/shared/brotli/NOTICE +3 -0
- package/dist/shared/brotli/index.d.ts +2 -0
- package/dist/shared/brotli/index.js +288 -0
- package/dist/shared/contracts/index.d.ts +42 -0
- package/dist/shared/contracts/index.js +88 -0
- package/dist/shared/contracts/testing.d.ts +22 -0
- package/dist/shared/contracts/testing.js +57 -0
- package/dist/shared/globals/index.d.ts +3 -0
- package/dist/shared/globals/index.js +87 -0
- package/dist/shared/globals/inject.d.ts +2 -0
- package/dist/shared/globals/inject.js +3 -0
- package/dist/shared/globals/install.d.ts +1 -0
- package/dist/shared/globals/install.js +15 -0
- package/dist/shared/globals/node-install.d.ts +1 -0
- package/dist/shared/globals/node-install.js +4 -0
- package/dist/shared/globals/platform.d.ts +104 -0
- package/dist/shared/globals/platform.js +37 -0
- package/dist/shared/globals/runtime.d.ts +6 -0
- package/dist/shared/globals/runtime.js +8 -0
- package/dist/shared/globals/symbols.d.ts +4 -0
- package/dist/shared/globals/symbols.js +35 -0
- package/dist/shared/globals/web.d.ts +4 -0
- package/dist/shared/globals/web.js +108 -0
- package/dist/shared/http-wire/LICENSE.llhttp +22 -0
- package/dist/shared/http-wire/LICENSE.undici +21 -0
- package/dist/shared/http-wire/NOTICE.md +14 -0
- package/dist/shared/http-wire/index.d.ts +27 -0
- package/dist/shared/http-wire/index.js +132 -0
- package/dist/shared/http-wire/wasm.d.ts +2 -0
- package/dist/shared/http-wire/wasm.js +2 -0
- package/dist/tooling/async.d.ts +7 -0
- package/dist/tooling/async.js +99 -0
- package/dist/tooling/build-isolation.d.ts +4 -0
- package/dist/tooling/build-isolation.js +34 -0
- package/dist/tooling/documents.d.ts +7 -0
- package/dist/tooling/documents.js +26 -0
- package/dist/tooling/esbuild.d.ts +15 -0
- package/dist/tooling/esbuild.js +193 -0
- package/dist/tooling/files.d.ts +2 -0
- package/dist/tooling/files.js +18 -0
- package/dist/tooling/opennext/build.d.ts +1 -0
- package/dist/tooling/opennext/build.js +121 -0
- package/dist/tooling/opennext/index.d.ts +3 -0
- package/dist/tooling/opennext/index.js +213 -0
- package/dist/tooling/opennext/plan.d.ts +9 -0
- package/dist/tooling/opennext/plan.js +36 -0
- package/dist/tooling/opennext/safety.d.ts +4 -0
- package/dist/tooling/opennext/safety.js +36 -0
- package/dist/tooling/route-permissions.d.ts +3 -0
- package/dist/tooling/route-permissions.js +15 -0
- package/dist/tooling/server-modules.d.ts +30 -0
- package/dist/tooling/server-modules.js +98 -0
- package/dist/tooling/server-only-html.d.ts +1 -0
- package/dist/tooling/server-only-html.js +66 -0
- package/dist/tooling/server-only.d.ts +6 -0
- package/dist/tooling/server-only.js +53 -0
- package/dist/tooling/server.d.ts +25 -0
- package/dist/tooling/server.js +981 -0
- package/dist/tooling/shared.d.ts +13 -0
- package/dist/tooling/shared.js +130 -0
- package/dist/tooling/vite.d.ts +18 -0
- package/dist/tooling/vite.js +448 -0
- package/dist/tooling/void/index.d.ts +3 -0
- package/dist/tooling/void/index.js +205 -0
- package/dist/tooling/void/plan.d.ts +17 -0
- package/dist/tooling/void/plan.js +288 -0
- package/native/android/build.gradle +68 -0
- package/native/android/consumer-rules.pro +2 -0
- package/native/android/src/main/AndroidManifest.xml +6 -0
- package/native/android/src/main/java/jp/rdlabo/workerscapacitor/WorkerSockets.java +202 -0
- package/native/android/src/main/java/jp/rdlabo/workerscapacitor/WorkersCapacitorPlugin.java +256 -0
- package/native/android/src/main/java/jp/rdlabo/workerscapacitor/WorkersNative.java +22 -0
- package/native/android/src/main/java/jp/rdlabo/workerscapacitor/WorkersNativeActivity.java +178 -0
- package/native/android/src/main/java/jp/rdlabo/workerscapacitor/WorkersNativeBridge.java +45 -0
- package/native/ios/DocumentBridge.swift +330 -0
- package/native/ios/NetworkBridge.swift +51 -0
- package/native/ios/SocketBridge.swift +180 -0
- package/native/ios/WorkersCapacitorPlugin.swift +152 -0
- package/native/ios-host/WorkersView.swift +194 -0
- package/package.json +154 -4
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
// Port of workerd 5358e3d src/workerd/api/performance.{h,c++}.
|
|
2
|
+
// Copyright (c) Cloudflare, Inc. Licensed under Apache-2.0.
|
|
3
|
+
// Workers retains user entries but deliberately does not deliver observer callbacks.
|
|
4
|
+
const internal = Symbol("Performance construction");
|
|
5
|
+
function dictionary(value, context, type = "Options") {
|
|
6
|
+
if (value == null)
|
|
7
|
+
return {};
|
|
8
|
+
if (typeof value !== "object" && typeof value !== "function")
|
|
9
|
+
throw new TypeError(`${context} is not of type '${type}'.`);
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
function detail(value) {
|
|
13
|
+
if (value === undefined)
|
|
14
|
+
return undefined;
|
|
15
|
+
if ((typeof value !== "object" || value === null) &&
|
|
16
|
+
typeof value !== "function")
|
|
17
|
+
throw new TypeError("Incorrect type for the 'detail' field on 'Options': the provided value is not of type 'Object'.");
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
function primitive(value, hint) {
|
|
21
|
+
if (value === null ||
|
|
22
|
+
(typeof value !== "object" && typeof value !== "function"))
|
|
23
|
+
return value;
|
|
24
|
+
const object = value;
|
|
25
|
+
const exotic = object[Symbol.toPrimitive];
|
|
26
|
+
if (exotic != null) {
|
|
27
|
+
if (typeof exotic !== "function")
|
|
28
|
+
throw new TypeError("Cannot convert object to primitive value");
|
|
29
|
+
const result = Reflect.apply(exotic, value, [hint]);
|
|
30
|
+
if (result === null ||
|
|
31
|
+
(typeof result !== "object" && typeof result !== "function"))
|
|
32
|
+
return result;
|
|
33
|
+
throw new TypeError("Cannot convert object to primitive value");
|
|
34
|
+
}
|
|
35
|
+
for (const key of hint === "number"
|
|
36
|
+
? ["valueOf", "toString"]
|
|
37
|
+
: ["toString", "valueOf"]) {
|
|
38
|
+
const method = object[key];
|
|
39
|
+
if (typeof method !== "function")
|
|
40
|
+
continue;
|
|
41
|
+
const result = Reflect.apply(method, value, []);
|
|
42
|
+
if (result === null ||
|
|
43
|
+
(typeof result !== "object" && typeof result !== "function"))
|
|
44
|
+
return result;
|
|
45
|
+
}
|
|
46
|
+
throw new TypeError("Cannot convert object to primitive value");
|
|
47
|
+
}
|
|
48
|
+
function numeric(value) {
|
|
49
|
+
const converted = primitive(value, "number");
|
|
50
|
+
if (typeof converted === "bigint")
|
|
51
|
+
throw new TypeError("Cannot convert a BigInt value to a number");
|
|
52
|
+
if (typeof converted === "symbol")
|
|
53
|
+
throw new TypeError("Cannot convert a Symbol value to a number");
|
|
54
|
+
return Number(converted);
|
|
55
|
+
}
|
|
56
|
+
function unsigned(value) {
|
|
57
|
+
const n = numeric(value);
|
|
58
|
+
if (!Number.isFinite(n))
|
|
59
|
+
throw new TypeError("The value cannot be converted because it is not an integer.");
|
|
60
|
+
if (n < 0)
|
|
61
|
+
throw new TypeError("The value cannot be converted because it is negative and this API expects a positive number.");
|
|
62
|
+
if (n > 4294967295)
|
|
63
|
+
throw new TypeError("Value out of range. Must be less than or equal to 4294967295.");
|
|
64
|
+
return Math.trunc(n);
|
|
65
|
+
}
|
|
66
|
+
function required(count, type, method, owner = "Performance") {
|
|
67
|
+
if (count)
|
|
68
|
+
return;
|
|
69
|
+
const context = method
|
|
70
|
+
? `Failed to execute '${method}' on '${owner}': parameter 1`
|
|
71
|
+
: `Failed to construct '${owner}': constructor parameter 1`;
|
|
72
|
+
throw new TypeError(`${context} is not of type '${type}'.`);
|
|
73
|
+
}
|
|
74
|
+
function string(value) {
|
|
75
|
+
const converted = primitive(value, "string");
|
|
76
|
+
if (typeof converted === "symbol")
|
|
77
|
+
throw new TypeError("Cannot convert a Symbol value to a string");
|
|
78
|
+
return String(converted);
|
|
79
|
+
}
|
|
80
|
+
function object(values) {
|
|
81
|
+
return Object.assign(Object.create(null), values);
|
|
82
|
+
}
|
|
83
|
+
export class PerformanceEntry {
|
|
84
|
+
#name;
|
|
85
|
+
#entryType;
|
|
86
|
+
#startTime;
|
|
87
|
+
#duration;
|
|
88
|
+
constructor(token, name = "", entryType = "", startTime = 0, duration = 0) {
|
|
89
|
+
if (token !== internal)
|
|
90
|
+
throw new TypeError("Illegal constructor");
|
|
91
|
+
this.#name = name;
|
|
92
|
+
this.#entryType = entryType;
|
|
93
|
+
this.#startTime = startTime;
|
|
94
|
+
this.#duration = duration;
|
|
95
|
+
}
|
|
96
|
+
get name() {
|
|
97
|
+
return this.#name;
|
|
98
|
+
}
|
|
99
|
+
get entryType() {
|
|
100
|
+
return this.#entryType;
|
|
101
|
+
}
|
|
102
|
+
get startTime() {
|
|
103
|
+
return this.#startTime;
|
|
104
|
+
}
|
|
105
|
+
get duration() {
|
|
106
|
+
return this.#duration;
|
|
107
|
+
}
|
|
108
|
+
toJSON() {
|
|
109
|
+
return object({
|
|
110
|
+
name: this.name,
|
|
111
|
+
entryType: this.entryType,
|
|
112
|
+
startTime: this.startTime,
|
|
113
|
+
duration: this.duration,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
export class PerformanceMark extends PerformanceEntry {
|
|
118
|
+
#detail;
|
|
119
|
+
constructor(name, options) {
|
|
120
|
+
required(arguments.length, "string", undefined, "PerformanceMark");
|
|
121
|
+
const convertedName = string(name);
|
|
122
|
+
const opts = dictionary(options, "Failed to construct 'PerformanceMark': constructor parameter 2");
|
|
123
|
+
const d = detail(opts.detail);
|
|
124
|
+
const start = opts.startTime === undefined ? Date.now() : numeric(opts.startTime);
|
|
125
|
+
super(internal, convertedName, "mark", start, 0);
|
|
126
|
+
this.#detail = d;
|
|
127
|
+
}
|
|
128
|
+
get detail() {
|
|
129
|
+
return this.#detail ?? null;
|
|
130
|
+
}
|
|
131
|
+
toJSON() {
|
|
132
|
+
const result = super.toJSON();
|
|
133
|
+
if (this.#detail !== undefined)
|
|
134
|
+
result.detail = this.#detail;
|
|
135
|
+
return result;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
export class PerformanceMeasure extends PerformanceEntry {
|
|
139
|
+
#detail;
|
|
140
|
+
constructor(token, name = "", start = 0, duration = 0, d) {
|
|
141
|
+
super(token, name, "measure", start, duration);
|
|
142
|
+
this.#detail = d;
|
|
143
|
+
}
|
|
144
|
+
get detail() {
|
|
145
|
+
return this.#detail ?? null;
|
|
146
|
+
}
|
|
147
|
+
toJSON() {
|
|
148
|
+
const result = super.toJSON();
|
|
149
|
+
if (this.#detail !== undefined)
|
|
150
|
+
result.detail = this.#detail;
|
|
151
|
+
return result;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
export class PerformanceResourceTiming extends PerformanceEntry {
|
|
155
|
+
get connectEnd() {
|
|
156
|
+
return 0;
|
|
157
|
+
}
|
|
158
|
+
get connectStart() {
|
|
159
|
+
return 0;
|
|
160
|
+
}
|
|
161
|
+
get decodedBodySize() {
|
|
162
|
+
return 0;
|
|
163
|
+
}
|
|
164
|
+
get domainLookupEnd() {
|
|
165
|
+
return 0;
|
|
166
|
+
}
|
|
167
|
+
get domainLookupStart() {
|
|
168
|
+
return 0;
|
|
169
|
+
}
|
|
170
|
+
get encodedBodySize() {
|
|
171
|
+
return 0;
|
|
172
|
+
}
|
|
173
|
+
get fetchStart() {
|
|
174
|
+
return 0;
|
|
175
|
+
}
|
|
176
|
+
get initiatorType() {
|
|
177
|
+
return "";
|
|
178
|
+
}
|
|
179
|
+
get nextHopProtocol() {
|
|
180
|
+
return "";
|
|
181
|
+
}
|
|
182
|
+
get redirectEnd() {
|
|
183
|
+
return 0;
|
|
184
|
+
}
|
|
185
|
+
get redirectStart() {
|
|
186
|
+
return 0;
|
|
187
|
+
}
|
|
188
|
+
get requestStart() {
|
|
189
|
+
return 0;
|
|
190
|
+
}
|
|
191
|
+
get responseEnd() {
|
|
192
|
+
return 0;
|
|
193
|
+
}
|
|
194
|
+
get responseStart() {
|
|
195
|
+
return 0;
|
|
196
|
+
}
|
|
197
|
+
get responseStatus() {
|
|
198
|
+
return 0;
|
|
199
|
+
}
|
|
200
|
+
get secureConnectionStart() {
|
|
201
|
+
return undefined;
|
|
202
|
+
}
|
|
203
|
+
get transferSize() {
|
|
204
|
+
return 0;
|
|
205
|
+
}
|
|
206
|
+
get workerStart() {
|
|
207
|
+
return 0;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
class PerformanceNodeTiming extends PerformanceEntry {
|
|
211
|
+
constructor(token) {
|
|
212
|
+
if (token !== internal)
|
|
213
|
+
throw new TypeError("Illegal constructor");
|
|
214
|
+
super(internal, "node", "node", 0, 0);
|
|
215
|
+
for (const name of [
|
|
216
|
+
"nodeStart",
|
|
217
|
+
"v8Start",
|
|
218
|
+
"bootstrapComplete",
|
|
219
|
+
"environment",
|
|
220
|
+
"loopStart",
|
|
221
|
+
"loopExit",
|
|
222
|
+
"idleTime",
|
|
223
|
+
])
|
|
224
|
+
Object.defineProperty(this, name, {
|
|
225
|
+
configurable: true,
|
|
226
|
+
enumerable: true,
|
|
227
|
+
get: () => 0,
|
|
228
|
+
});
|
|
229
|
+
Object.defineProperty(this, "uvMetricsInfo", {
|
|
230
|
+
configurable: true,
|
|
231
|
+
enumerable: true,
|
|
232
|
+
get: () => ({ loopCount: 0, events: 0, eventsWaiting: 0 }),
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
toJSON() {
|
|
236
|
+
return object({
|
|
237
|
+
...super.toJSON(),
|
|
238
|
+
...this,
|
|
239
|
+
uvMetricsInfo: object({ loopCount: 0, events: 0, eventsWaiting: 0 }),
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
export class PerformanceObserverEntryList {
|
|
244
|
+
constructor() {
|
|
245
|
+
throw new TypeError("Illegal constructor");
|
|
246
|
+
}
|
|
247
|
+
getEntries() {
|
|
248
|
+
return [];
|
|
249
|
+
}
|
|
250
|
+
getEntriesByType(type) {
|
|
251
|
+
required(arguments.length, "string", "getEntriesByType", "PerformanceObserverEntryList");
|
|
252
|
+
string(type);
|
|
253
|
+
return [];
|
|
254
|
+
}
|
|
255
|
+
getEntriesByName(name, type) {
|
|
256
|
+
required(arguments.length, "string", "getEntriesByName", "PerformanceObserverEntryList");
|
|
257
|
+
string(name);
|
|
258
|
+
if (type !== undefined)
|
|
259
|
+
string(type);
|
|
260
|
+
return [];
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
export class PerformanceObserver {
|
|
264
|
+
constructor(_callback) {
|
|
265
|
+
required(arguments.length, "Value", undefined, "PerformanceObserver");
|
|
266
|
+
}
|
|
267
|
+
disconnect() { }
|
|
268
|
+
observe(options) {
|
|
269
|
+
// JSG converts the dictionary even though the native method does nothing.
|
|
270
|
+
const opts = dictionary(options, "Failed to execute 'observe' on 'PerformanceObserver': parameter 1", "ObserveOptions");
|
|
271
|
+
if (opts.buffered !== undefined)
|
|
272
|
+
Boolean(opts.buffered);
|
|
273
|
+
if (opts.durationThreshold !== undefined)
|
|
274
|
+
unsigned(opts.durationThreshold);
|
|
275
|
+
if (opts.entryTypes !== undefined) {
|
|
276
|
+
if (!Array.isArray(opts.entryTypes))
|
|
277
|
+
throw new TypeError("Incorrect type for the 'entryTypes' field on 'ObserveOptions': the provided value is not of type 'Array'.");
|
|
278
|
+
for (const value of opts.entryTypes)
|
|
279
|
+
string(value);
|
|
280
|
+
}
|
|
281
|
+
if (opts.type !== undefined)
|
|
282
|
+
string(opts.type);
|
|
283
|
+
}
|
|
284
|
+
takeRecords() {
|
|
285
|
+
return [];
|
|
286
|
+
}
|
|
287
|
+
static get supportedEntryTypes() {
|
|
288
|
+
return ["measure", "mark"];
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
class EventCounts {
|
|
292
|
+
constructor(token) {
|
|
293
|
+
if (token !== internal)
|
|
294
|
+
throw new TypeError("Illegal constructor");
|
|
295
|
+
}
|
|
296
|
+
get size() {
|
|
297
|
+
return 0;
|
|
298
|
+
}
|
|
299
|
+
get(type) {
|
|
300
|
+
required(arguments.length, "string", "get", "EventCounts");
|
|
301
|
+
string(type);
|
|
302
|
+
return undefined;
|
|
303
|
+
}
|
|
304
|
+
has(type) {
|
|
305
|
+
required(arguments.length, "string", "has", "EventCounts");
|
|
306
|
+
string(type);
|
|
307
|
+
return false;
|
|
308
|
+
}
|
|
309
|
+
*entries() { }
|
|
310
|
+
*keys() { }
|
|
311
|
+
*values() { }
|
|
312
|
+
forEach(callback, _thisArg) {
|
|
313
|
+
if (typeof callback !== "function")
|
|
314
|
+
throw new TypeError("Failed to execute 'forEach' on 'EventCounts': parameter 1 is not of type 'function'.");
|
|
315
|
+
}
|
|
316
|
+
[Symbol.iterator]() {
|
|
317
|
+
return this.entries();
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
export class Performance extends EventTarget {
|
|
321
|
+
#entries = [];
|
|
322
|
+
constructor(token) {
|
|
323
|
+
super();
|
|
324
|
+
if (token !== internal)
|
|
325
|
+
throw new TypeError("Illegal constructor");
|
|
326
|
+
}
|
|
327
|
+
get timeOrigin() {
|
|
328
|
+
return 0;
|
|
329
|
+
}
|
|
330
|
+
now() {
|
|
331
|
+
return Date.now();
|
|
332
|
+
}
|
|
333
|
+
get eventCounts() {
|
|
334
|
+
return new EventCounts(internal);
|
|
335
|
+
}
|
|
336
|
+
get nodeTiming() {
|
|
337
|
+
return new PerformanceNodeTiming(internal);
|
|
338
|
+
}
|
|
339
|
+
clearMarks(name) {
|
|
340
|
+
const key = name === undefined ? undefined : string(name);
|
|
341
|
+
this.#entries = this.#entries.filter((e) => key === undefined ? e.entryType !== "mark" : e.name !== key);
|
|
342
|
+
}
|
|
343
|
+
clearMeasures(name) {
|
|
344
|
+
const key = name === undefined ? undefined : string(name);
|
|
345
|
+
this.#entries = this.#entries.filter((e) => key === undefined ? e.entryType !== "measure" : e.name !== key);
|
|
346
|
+
}
|
|
347
|
+
clearResourceTimings() {
|
|
348
|
+
this.#entries = this.#entries.filter((e) => e.entryType !== "resource" && e.entryType !== "navigation");
|
|
349
|
+
}
|
|
350
|
+
getEntries() {
|
|
351
|
+
return [...this.#entries];
|
|
352
|
+
}
|
|
353
|
+
getEntriesByName(name, type) {
|
|
354
|
+
required(arguments.length, "string", "getEntriesByName", "Performance");
|
|
355
|
+
const key = string(name);
|
|
356
|
+
const kind = type === undefined ? undefined : string(type);
|
|
357
|
+
return this.#entries.filter((e) => e.name === key && (kind === undefined || e.entryType === kind));
|
|
358
|
+
}
|
|
359
|
+
getEntriesByType(type) {
|
|
360
|
+
required(arguments.length, "string", "getEntriesByType", "Performance");
|
|
361
|
+
const kind = string(type);
|
|
362
|
+
return this.#entries.filter((e) => e.entryType === kind);
|
|
363
|
+
}
|
|
364
|
+
mark(name, options) {
|
|
365
|
+
required(arguments.length, "string", "mark");
|
|
366
|
+
const key = string(name);
|
|
367
|
+
const opts = dictionary(options, "Failed to execute 'mark' on 'Performance': parameter 2");
|
|
368
|
+
const mark = new PerformanceMark(key, opts);
|
|
369
|
+
this.#entries.push(mark);
|
|
370
|
+
return mark;
|
|
371
|
+
}
|
|
372
|
+
measure(name, options, endMark) {
|
|
373
|
+
required(arguments.length, "string", "measure");
|
|
374
|
+
const key = string(name);
|
|
375
|
+
let start = 0, end = Date.now(), d;
|
|
376
|
+
if (options != null &&
|
|
377
|
+
typeof options !== "object" &&
|
|
378
|
+
typeof options !== "function") {
|
|
379
|
+
options = string(options);
|
|
380
|
+
start = this.getEntriesByName(options, "mark")[0]?.startTime ?? start;
|
|
381
|
+
if (endMark !== undefined)
|
|
382
|
+
end = this.getEntriesByName(endMark, "mark")[0]?.startTime ?? end;
|
|
383
|
+
}
|
|
384
|
+
else if (options != null) {
|
|
385
|
+
const opts = dictionary(options, "Failed to execute 'measure' on 'Performance': parameter 2");
|
|
386
|
+
d = detail(opts.detail);
|
|
387
|
+
if (opts.start !== undefined)
|
|
388
|
+
start = numeric(opts.start);
|
|
389
|
+
// The pinned dictionary converts duration even when end takes precedence.
|
|
390
|
+
const duration = opts.duration === undefined ? undefined : numeric(opts.duration);
|
|
391
|
+
if (opts.end !== undefined)
|
|
392
|
+
end = numeric(opts.end);
|
|
393
|
+
else if (duration !== undefined)
|
|
394
|
+
end = start + duration;
|
|
395
|
+
if (endMark !== undefined)
|
|
396
|
+
string(endMark);
|
|
397
|
+
}
|
|
398
|
+
const entry = new PerformanceMeasure(internal, key, start, end >= start ? end - start : 0, d);
|
|
399
|
+
this.#entries.push(entry);
|
|
400
|
+
return entry;
|
|
401
|
+
}
|
|
402
|
+
setResourceTimingBufferSize(size) {
|
|
403
|
+
required(arguments.length, "unsigned integer", "setResourceTimingBufferSize");
|
|
404
|
+
unsigned(size);
|
|
405
|
+
}
|
|
406
|
+
toJSON() {
|
|
407
|
+
return object({ timeOrigin: this.timeOrigin });
|
|
408
|
+
}
|
|
409
|
+
eventLoopUtilization() {
|
|
410
|
+
return { idle: 0, active: 0, utilization: 0 };
|
|
411
|
+
}
|
|
412
|
+
markResourceTiming() { }
|
|
413
|
+
timerify(fn) {
|
|
414
|
+
if (typeof fn !== "function")
|
|
415
|
+
throw new TypeError("Failed to execute 'timerify' on 'Performance': parameter 1 is not of type 'function'.");
|
|
416
|
+
return fn;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
export const performance = new Performance(internal);
|
|
420
|
+
// JSG exposes Web IDL members as enumerable prototype properties.
|
|
421
|
+
for (const [tag, Type] of Object.entries({
|
|
422
|
+
Performance,
|
|
423
|
+
PerformanceEntry,
|
|
424
|
+
PerformanceMark,
|
|
425
|
+
PerformanceMeasure,
|
|
426
|
+
PerformanceResourceTiming,
|
|
427
|
+
PerformanceNodeTiming,
|
|
428
|
+
PerformanceObserver,
|
|
429
|
+
PerformanceObserverEntryList,
|
|
430
|
+
EventCounts,
|
|
431
|
+
})) {
|
|
432
|
+
for (const name of Object.getOwnPropertyNames(Type.prototype)) {
|
|
433
|
+
if (name === "constructor")
|
|
434
|
+
continue;
|
|
435
|
+
const descriptor = Object.getOwnPropertyDescriptor(Type.prototype, name);
|
|
436
|
+
Object.defineProperty(Type.prototype, name, {
|
|
437
|
+
...descriptor,
|
|
438
|
+
enumerable: true,
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
Object.defineProperty(Type.prototype, Symbol.toStringTag, {
|
|
442
|
+
value: tag,
|
|
443
|
+
configurable: true,
|
|
444
|
+
});
|
|
445
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Upstream notices
|
|
2
|
+
|
|
3
|
+
Implementation: Cloudflare workerd `src/node/punycode.ts`, revision
|
|
4
|
+
`5358e3d337336eaf696a48bc1563d808b10feba5` (`v1.20261012.1`).
|
|
5
|
+
Cloudflare Apache 2.0 and Mathias Bynens MIT notices are retained in index.ts.
|
|
6
|
+
The adjacent upstream test is from the same revision's
|
|
7
|
+
`src/workerd/api/node/tests/punycode-nodejs-test.js`.
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|