@miniflare/tre
Version:
Fun, full-featured, fully-local simulator for Cloudflare Workers
1,188 lines (1,187 loc) • 275 kB
JavaScript
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
__markAsModule(target);
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __reExport = (target, module2, desc) => {
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
for (let key of __getOwnPropNames(module2))
if (!__hasOwnProp.call(target, key) && key !== "default")
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
}
return target;
};
var __toModule = (module2) => {
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
};
var __decorateClass = (decorators, target, key, kind) => {
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
for (var i = decorators.length - 1, decorator; i >= 0; i--)
if (decorator = decorators[i])
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
if (kind && result)
__defProp(target, key, result);
return result;
};
var __publicField = (obj, key, value) => {
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
return value;
};
var __accessCheck = (obj, member, msg) => {
if (!member.has(obj))
throw TypeError("Cannot " + msg);
};
var __privateGet = (obj, member, getter) => {
__accessCheck(obj, member, "read from private field");
return getter ? getter.call(obj) : member.get(obj);
};
var __privateAdd = (obj, member, value) => {
if (member.has(obj))
throw TypeError("Cannot add the same private member more than once");
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
};
var __privateSet = (obj, member, value, setter) => {
__accessCheck(obj, member, "write to private field");
setter ? setter.call(obj, value) : member.set(obj, value);
return value;
};
var __privateMethod = (obj, member, method) => {
__accessCheck(obj, member, "access private method");
return method;
};
// packages/tre/src/runtime/config/workerd.capnp.js
var require_workerd_capnp = __commonJS({
"packages/tre/src/runtime/config/workerd.capnp.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TlsOptions = exports.TlsOptions_Version = exports.TlsOptions_Keypair = exports.HttpOptions = exports.HttpOptions_Header = exports.HttpOptions_Style = exports.DiskDirectory = exports.Network = exports.ExternalServer = exports.ExternalServer_Which = exports.ExternalServer_Https = exports.Worker = exports.Worker_Which = exports.Worker_DurableObjectStorage = exports.Worker_DurableObjectStorage_Which = exports.Worker_DurableObjectNamespace = exports.Worker_DurableObjectNamespace_Which = exports.Worker_Binding = exports.Worker_Binding_Which = exports.Worker_Binding_Parameter = exports.Worker_Binding_CryptoKey = exports.Worker_Binding_CryptoKey_Which = exports.Worker_Binding_CryptoKey_Algorithm = exports.Worker_Binding_CryptoKey_Algorithm_Which = exports.Worker_Binding_CryptoKey_Usage = exports.Worker_Binding_DurableObjectNamespaceDesignator = exports.Worker_Binding_Type = exports.Worker_Binding_Type_Which = exports.Worker_Module = exports.Worker_Module_Which = exports.ServiceDesignator = exports.Service = exports.Service_Which = exports.Socket = exports.Socket_Which = exports.Socket_Https = exports.Config = exports._capnpFileId = void 0;
var capnp = require("capnp-ts");
var capnp_ts_1 = require("capnp-ts");
exports._capnpFileId = "e6afd26682091c01";
var Config3 = class extends capnp_ts_1.Struct {
adoptServices(value) {
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(0, this));
}
disownServices() {
return capnp_ts_1.Struct.disown(this.getServices());
}
getServices() {
return capnp_ts_1.Struct.getList(0, Config3._Services, this);
}
hasServices() {
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(0, this));
}
initServices(length) {
return capnp_ts_1.Struct.initList(0, Config3._Services, length, this);
}
setServices(value) {
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(0, this));
}
adoptSockets(value) {
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(1, this));
}
disownSockets() {
return capnp_ts_1.Struct.disown(this.getSockets());
}
getSockets() {
return capnp_ts_1.Struct.getList(1, Config3._Sockets, this);
}
hasSockets() {
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(1, this));
}
initSockets(length) {
return capnp_ts_1.Struct.initList(1, Config3._Sockets, length, this);
}
setSockets(value) {
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(1, this));
}
adoptV8Flags(value) {
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(2, this));
}
disownV8Flags() {
return capnp_ts_1.Struct.disown(this.getV8Flags());
}
getV8Flags() {
return capnp_ts_1.Struct.getList(2, capnp.TextList, this);
}
hasV8Flags() {
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(2, this));
}
initV8Flags(length) {
return capnp_ts_1.Struct.initList(2, capnp.TextList, length, this);
}
setV8Flags(value) {
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(2, this));
}
toString() {
return "Config_" + super.toString();
}
};
exports.Config = Config3;
Config3._capnp = { displayName: "Config", id: "8794486c76aaa7d6", size: new capnp_ts_1.ObjectSize(0, 3) };
var Socket_Https = class extends capnp_ts_1.Struct {
adoptOptions(value) {
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(2, this));
}
disownOptions() {
return capnp_ts_1.Struct.disown(this.getOptions());
}
getOptions() {
return capnp_ts_1.Struct.getStruct(2, HttpOptions, this);
}
hasOptions() {
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(2, this));
}
initOptions() {
return capnp_ts_1.Struct.initStructAt(2, HttpOptions, this);
}
setOptions(value) {
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(2, this));
}
adoptTlsOptions(value) {
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(3, this));
}
disownTlsOptions() {
return capnp_ts_1.Struct.disown(this.getTlsOptions());
}
getTlsOptions() {
return capnp_ts_1.Struct.getStruct(3, TlsOptions, this);
}
hasTlsOptions() {
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(3, this));
}
initTlsOptions() {
return capnp_ts_1.Struct.initStructAt(3, TlsOptions, this);
}
setTlsOptions(value) {
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(3, this));
}
toString() {
return "Socket_Https_" + super.toString();
}
};
exports.Socket_Https = Socket_Https;
Socket_Https._capnp = { displayName: "https", id: "de123876383cbbdc", size: new capnp_ts_1.ObjectSize(8, 5) };
var Socket_Which;
(function(Socket_Which2) {
Socket_Which2[Socket_Which2["HTTP"] = 0] = "HTTP";
Socket_Which2[Socket_Which2["HTTPS"] = 1] = "HTTPS";
})(Socket_Which = exports.Socket_Which || (exports.Socket_Which = {}));
var Socket2 = class extends capnp_ts_1.Struct {
getName() {
return capnp_ts_1.Struct.getText(0, this);
}
setName(value) {
capnp_ts_1.Struct.setText(0, value, this);
}
getAddress() {
return capnp_ts_1.Struct.getText(1, this);
}
setAddress(value) {
capnp_ts_1.Struct.setText(1, value, this);
}
adoptHttp(value) {
capnp_ts_1.Struct.setUint16(0, 0, this);
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(2, this));
}
disownHttp() {
return capnp_ts_1.Struct.disown(this.getHttp());
}
getHttp() {
capnp_ts_1.Struct.testWhich("http", capnp_ts_1.Struct.getUint16(0, this), 0, this);
return capnp_ts_1.Struct.getStruct(2, HttpOptions, this);
}
hasHttp() {
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(2, this));
}
initHttp() {
capnp_ts_1.Struct.setUint16(0, 0, this);
return capnp_ts_1.Struct.initStructAt(2, HttpOptions, this);
}
isHttp() {
return capnp_ts_1.Struct.getUint16(0, this) === 0;
}
setHttp(value) {
capnp_ts_1.Struct.setUint16(0, 0, this);
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(2, this));
}
getHttps() {
capnp_ts_1.Struct.testWhich("https", capnp_ts_1.Struct.getUint16(0, this), 1, this);
return capnp_ts_1.Struct.getAs(Socket_Https, this);
}
initHttps() {
capnp_ts_1.Struct.setUint16(0, 1, this);
return capnp_ts_1.Struct.getAs(Socket_Https, this);
}
isHttps() {
return capnp_ts_1.Struct.getUint16(0, this) === 1;
}
setHttps() {
capnp_ts_1.Struct.setUint16(0, 1, this);
}
adoptService(value) {
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(4, this));
}
disownService() {
return capnp_ts_1.Struct.disown(this.getService());
}
getService() {
return capnp_ts_1.Struct.getStruct(4, ServiceDesignator, this);
}
hasService() {
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(4, this));
}
initService() {
return capnp_ts_1.Struct.initStructAt(4, ServiceDesignator, this);
}
setService(value) {
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(4, this));
}
toString() {
return "Socket_" + super.toString();
}
which() {
return capnp_ts_1.Struct.getUint16(0, this);
}
};
exports.Socket = Socket2;
Socket2.HTTP = Socket_Which.HTTP;
Socket2.HTTPS = Socket_Which.HTTPS;
Socket2._capnp = { displayName: "Socket", id: "9a0eba45530ee79f", size: new capnp_ts_1.ObjectSize(8, 5) };
var Service_Which;
(function(Service_Which2) {
Service_Which2[Service_Which2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
Service_Which2[Service_Which2["WORKER"] = 1] = "WORKER";
Service_Which2[Service_Which2["NETWORK"] = 2] = "NETWORK";
Service_Which2[Service_Which2["EXTERNAL"] = 3] = "EXTERNAL";
Service_Which2[Service_Which2["DISK"] = 4] = "DISK";
})(Service_Which = exports.Service_Which || (exports.Service_Which = {}));
var Service3 = class extends capnp_ts_1.Struct {
getName() {
return capnp_ts_1.Struct.getText(0, this);
}
setName(value) {
capnp_ts_1.Struct.setText(0, value, this);
}
isUnspecified() {
return capnp_ts_1.Struct.getUint16(0, this) === 0;
}
setUnspecified() {
capnp_ts_1.Struct.setUint16(0, 0, this);
}
adoptWorker(value) {
capnp_ts_1.Struct.setUint16(0, 1, this);
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(1, this));
}
disownWorker() {
return capnp_ts_1.Struct.disown(this.getWorker());
}
getWorker() {
capnp_ts_1.Struct.testWhich("worker", capnp_ts_1.Struct.getUint16(0, this), 1, this);
return capnp_ts_1.Struct.getStruct(1, Worker, this);
}
hasWorker() {
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(1, this));
}
initWorker() {
capnp_ts_1.Struct.setUint16(0, 1, this);
return capnp_ts_1.Struct.initStructAt(1, Worker, this);
}
isWorker() {
return capnp_ts_1.Struct.getUint16(0, this) === 1;
}
setWorker(value) {
capnp_ts_1.Struct.setUint16(0, 1, this);
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(1, this));
}
adoptNetwork(value) {
capnp_ts_1.Struct.setUint16(0, 2, this);
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(1, this));
}
disownNetwork() {
return capnp_ts_1.Struct.disown(this.getNetwork());
}
getNetwork() {
capnp_ts_1.Struct.testWhich("network", capnp_ts_1.Struct.getUint16(0, this), 2, this);
return capnp_ts_1.Struct.getStruct(1, Network, this);
}
hasNetwork() {
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(1, this));
}
initNetwork() {
capnp_ts_1.Struct.setUint16(0, 2, this);
return capnp_ts_1.Struct.initStructAt(1, Network, this);
}
isNetwork() {
return capnp_ts_1.Struct.getUint16(0, this) === 2;
}
setNetwork(value) {
capnp_ts_1.Struct.setUint16(0, 2, this);
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(1, this));
}
adoptExternal(value) {
capnp_ts_1.Struct.setUint16(0, 3, this);
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(1, this));
}
disownExternal() {
return capnp_ts_1.Struct.disown(this.getExternal());
}
getExternal() {
capnp_ts_1.Struct.testWhich("external", capnp_ts_1.Struct.getUint16(0, this), 3, this);
return capnp_ts_1.Struct.getStruct(1, ExternalServer2, this);
}
hasExternal() {
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(1, this));
}
initExternal() {
capnp_ts_1.Struct.setUint16(0, 3, this);
return capnp_ts_1.Struct.initStructAt(1, ExternalServer2, this);
}
isExternal() {
return capnp_ts_1.Struct.getUint16(0, this) === 3;
}
setExternal(value) {
capnp_ts_1.Struct.setUint16(0, 3, this);
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(1, this));
}
adoptDisk(value) {
capnp_ts_1.Struct.setUint16(0, 4, this);
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(1, this));
}
disownDisk() {
return capnp_ts_1.Struct.disown(this.getDisk());
}
getDisk() {
capnp_ts_1.Struct.testWhich("disk", capnp_ts_1.Struct.getUint16(0, this), 4, this);
return capnp_ts_1.Struct.getStruct(1, DiskDirectory, this);
}
hasDisk() {
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(1, this));
}
initDisk() {
capnp_ts_1.Struct.setUint16(0, 4, this);
return capnp_ts_1.Struct.initStructAt(1, DiskDirectory, this);
}
isDisk() {
return capnp_ts_1.Struct.getUint16(0, this) === 4;
}
setDisk(value) {
capnp_ts_1.Struct.setUint16(0, 4, this);
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(1, this));
}
toString() {
return "Service_" + super.toString();
}
which() {
return capnp_ts_1.Struct.getUint16(0, this);
}
};
exports.Service = Service3;
Service3.UNSPECIFIED = Service_Which.UNSPECIFIED;
Service3.WORKER = Service_Which.WORKER;
Service3.NETWORK = Service_Which.NETWORK;
Service3.EXTERNAL = Service_Which.EXTERNAL;
Service3.DISK = Service_Which.DISK;
Service3._capnp = { displayName: "Service", id: "e5c88e8bb7bcb6b9", size: new capnp_ts_1.ObjectSize(8, 2) };
var ServiceDesignator = class extends capnp_ts_1.Struct {
getName() {
return capnp_ts_1.Struct.getText(0, this);
}
setName(value) {
capnp_ts_1.Struct.setText(0, value, this);
}
getEntrypoint() {
return capnp_ts_1.Struct.getText(1, this);
}
setEntrypoint(value) {
capnp_ts_1.Struct.setText(1, value, this);
}
toString() {
return "ServiceDesignator_" + super.toString();
}
};
exports.ServiceDesignator = ServiceDesignator;
ServiceDesignator._capnp = { displayName: "ServiceDesignator", id: "ae8ec91cee724450", size: new capnp_ts_1.ObjectSize(0, 2) };
var Worker_Module_Which;
(function(Worker_Module_Which2) {
Worker_Module_Which2[Worker_Module_Which2["ES_MODULE"] = 0] = "ES_MODULE";
Worker_Module_Which2[Worker_Module_Which2["COMMON_JS_MODULE"] = 1] = "COMMON_JS_MODULE";
Worker_Module_Which2[Worker_Module_Which2["TEXT"] = 2] = "TEXT";
Worker_Module_Which2[Worker_Module_Which2["DATA"] = 3] = "DATA";
Worker_Module_Which2[Worker_Module_Which2["WASM"] = 4] = "WASM";
Worker_Module_Which2[Worker_Module_Which2["JSON"] = 5] = "JSON";
})(Worker_Module_Which = exports.Worker_Module_Which || (exports.Worker_Module_Which = {}));
var Worker_Module3 = class extends capnp_ts_1.Struct {
getName() {
return capnp_ts_1.Struct.getText(0, this);
}
setName(value) {
capnp_ts_1.Struct.setText(0, value, this);
}
getEsModule() {
capnp_ts_1.Struct.testWhich("esModule", capnp_ts_1.Struct.getUint16(0, this), 0, this);
return capnp_ts_1.Struct.getText(1, this);
}
isEsModule() {
return capnp_ts_1.Struct.getUint16(0, this) === 0;
}
setEsModule(value) {
capnp_ts_1.Struct.setUint16(0, 0, this);
capnp_ts_1.Struct.setText(1, value, this);
}
getCommonJsModule() {
capnp_ts_1.Struct.testWhich("commonJsModule", capnp_ts_1.Struct.getUint16(0, this), 1, this);
return capnp_ts_1.Struct.getText(1, this);
}
isCommonJsModule() {
return capnp_ts_1.Struct.getUint16(0, this) === 1;
}
setCommonJsModule(value) {
capnp_ts_1.Struct.setUint16(0, 1, this);
capnp_ts_1.Struct.setText(1, value, this);
}
getText() {
capnp_ts_1.Struct.testWhich("text", capnp_ts_1.Struct.getUint16(0, this), 2, this);
return capnp_ts_1.Struct.getText(1, this);
}
isText() {
return capnp_ts_1.Struct.getUint16(0, this) === 2;
}
setText(value) {
capnp_ts_1.Struct.setUint16(0, 2, this);
capnp_ts_1.Struct.setText(1, value, this);
}
adoptData(value) {
capnp_ts_1.Struct.setUint16(0, 3, this);
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(1, this));
}
disownData() {
return capnp_ts_1.Struct.disown(this.getData());
}
getData() {
capnp_ts_1.Struct.testWhich("data", capnp_ts_1.Struct.getUint16(0, this), 3, this);
return capnp_ts_1.Struct.getData(1, this);
}
hasData() {
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(1, this));
}
initData(length) {
capnp_ts_1.Struct.setUint16(0, 3, this);
return capnp_ts_1.Struct.initData(1, length, this);
}
isData() {
return capnp_ts_1.Struct.getUint16(0, this) === 3;
}
setData(value) {
capnp_ts_1.Struct.setUint16(0, 3, this);
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(1, this));
}
adoptWasm(value) {
capnp_ts_1.Struct.setUint16(0, 4, this);
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(1, this));
}
disownWasm() {
return capnp_ts_1.Struct.disown(this.getWasm());
}
getWasm() {
capnp_ts_1.Struct.testWhich("wasm", capnp_ts_1.Struct.getUint16(0, this), 4, this);
return capnp_ts_1.Struct.getData(1, this);
}
hasWasm() {
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(1, this));
}
initWasm(length) {
capnp_ts_1.Struct.setUint16(0, 4, this);
return capnp_ts_1.Struct.initData(1, length, this);
}
isWasm() {
return capnp_ts_1.Struct.getUint16(0, this) === 4;
}
setWasm(value) {
capnp_ts_1.Struct.setUint16(0, 4, this);
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(1, this));
}
getJson() {
capnp_ts_1.Struct.testWhich("json", capnp_ts_1.Struct.getUint16(0, this), 5, this);
return capnp_ts_1.Struct.getText(1, this);
}
isJson() {
return capnp_ts_1.Struct.getUint16(0, this) === 5;
}
setJson(value) {
capnp_ts_1.Struct.setUint16(0, 5, this);
capnp_ts_1.Struct.setText(1, value, this);
}
toString() {
return "Worker_Module_" + super.toString();
}
which() {
return capnp_ts_1.Struct.getUint16(0, this);
}
};
exports.Worker_Module = Worker_Module3;
Worker_Module3.ES_MODULE = Worker_Module_Which.ES_MODULE;
Worker_Module3.COMMON_JS_MODULE = Worker_Module_Which.COMMON_JS_MODULE;
Worker_Module3.TEXT = Worker_Module_Which.TEXT;
Worker_Module3.DATA = Worker_Module_Which.DATA;
Worker_Module3.WASM = Worker_Module_Which.WASM;
Worker_Module3.JSON = Worker_Module_Which.JSON;
Worker_Module3._capnp = { displayName: "Module", id: "d9d87a63770a12f3", size: new capnp_ts_1.ObjectSize(8, 2) };
var Worker_Binding_Type_Which;
(function(Worker_Binding_Type_Which2) {
Worker_Binding_Type_Which2[Worker_Binding_Type_Which2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
Worker_Binding_Type_Which2[Worker_Binding_Type_Which2["TEXT"] = 1] = "TEXT";
Worker_Binding_Type_Which2[Worker_Binding_Type_Which2["DATA"] = 2] = "DATA";
Worker_Binding_Type_Which2[Worker_Binding_Type_Which2["JSON"] = 3] = "JSON";
Worker_Binding_Type_Which2[Worker_Binding_Type_Which2["WASM"] = 4] = "WASM";
Worker_Binding_Type_Which2[Worker_Binding_Type_Which2["CRYPTO_KEY"] = 5] = "CRYPTO_KEY";
Worker_Binding_Type_Which2[Worker_Binding_Type_Which2["SERVICE"] = 6] = "SERVICE";
Worker_Binding_Type_Which2[Worker_Binding_Type_Which2["DURABLE_OBJECT_NAMESPACE"] = 7] = "DURABLE_OBJECT_NAMESPACE";
Worker_Binding_Type_Which2[Worker_Binding_Type_Which2["KV_NAMESPACE"] = 8] = "KV_NAMESPACE";
Worker_Binding_Type_Which2[Worker_Binding_Type_Which2["R2BUCKET"] = 9] = "R2BUCKET";
Worker_Binding_Type_Which2[Worker_Binding_Type_Which2["R2ADMIN"] = 10] = "R2ADMIN";
})(Worker_Binding_Type_Which = exports.Worker_Binding_Type_Which || (exports.Worker_Binding_Type_Which = {}));
var Worker_Binding_Type = class extends capnp_ts_1.Struct {
isUnspecified() {
return capnp_ts_1.Struct.getUint16(0, this) === 0;
}
setUnspecified() {
capnp_ts_1.Struct.setUint16(0, 0, this);
}
isText() {
return capnp_ts_1.Struct.getUint16(0, this) === 1;
}
setText() {
capnp_ts_1.Struct.setUint16(0, 1, this);
}
isData() {
return capnp_ts_1.Struct.getUint16(0, this) === 2;
}
setData() {
capnp_ts_1.Struct.setUint16(0, 2, this);
}
isJson() {
return capnp_ts_1.Struct.getUint16(0, this) === 3;
}
setJson() {
capnp_ts_1.Struct.setUint16(0, 3, this);
}
isWasm() {
return capnp_ts_1.Struct.getUint16(0, this) === 4;
}
setWasm() {
capnp_ts_1.Struct.setUint16(0, 4, this);
}
adoptCryptoKey(value) {
capnp_ts_1.Struct.setUint16(0, 5, this);
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(0, this));
}
disownCryptoKey() {
return capnp_ts_1.Struct.disown(this.getCryptoKey());
}
getCryptoKey() {
capnp_ts_1.Struct.testWhich("cryptoKey", capnp_ts_1.Struct.getUint16(0, this), 5, this);
return capnp_ts_1.Struct.getList(0, capnp.Uint16List, this);
}
hasCryptoKey() {
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(0, this));
}
initCryptoKey(length) {
capnp_ts_1.Struct.setUint16(0, 5, this);
return capnp_ts_1.Struct.initList(0, capnp.Uint16List, length, this);
}
isCryptoKey() {
return capnp_ts_1.Struct.getUint16(0, this) === 5;
}
setCryptoKey(value) {
capnp_ts_1.Struct.setUint16(0, 5, this);
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(0, this));
}
isService() {
return capnp_ts_1.Struct.getUint16(0, this) === 6;
}
setService() {
capnp_ts_1.Struct.setUint16(0, 6, this);
}
isDurableObjectNamespace() {
return capnp_ts_1.Struct.getUint16(0, this) === 7;
}
setDurableObjectNamespace() {
capnp_ts_1.Struct.setUint16(0, 7, this);
}
isKvNamespace() {
return capnp_ts_1.Struct.getUint16(0, this) === 8;
}
setKvNamespace() {
capnp_ts_1.Struct.setUint16(0, 8, this);
}
isR2Bucket() {
return capnp_ts_1.Struct.getUint16(0, this) === 9;
}
setR2Bucket() {
capnp_ts_1.Struct.setUint16(0, 9, this);
}
isR2Admin() {
return capnp_ts_1.Struct.getUint16(0, this) === 10;
}
setR2Admin() {
capnp_ts_1.Struct.setUint16(0, 10, this);
}
toString() {
return "Worker_Binding_Type_" + super.toString();
}
which() {
return capnp_ts_1.Struct.getUint16(0, this);
}
};
exports.Worker_Binding_Type = Worker_Binding_Type;
Worker_Binding_Type.UNSPECIFIED = Worker_Binding_Type_Which.UNSPECIFIED;
Worker_Binding_Type.TEXT = Worker_Binding_Type_Which.TEXT;
Worker_Binding_Type.DATA = Worker_Binding_Type_Which.DATA;
Worker_Binding_Type.JSON = Worker_Binding_Type_Which.JSON;
Worker_Binding_Type.WASM = Worker_Binding_Type_Which.WASM;
Worker_Binding_Type.CRYPTO_KEY = Worker_Binding_Type_Which.CRYPTO_KEY;
Worker_Binding_Type.SERVICE = Worker_Binding_Type_Which.SERVICE;
Worker_Binding_Type.DURABLE_OBJECT_NAMESPACE = Worker_Binding_Type_Which.DURABLE_OBJECT_NAMESPACE;
Worker_Binding_Type.KV_NAMESPACE = Worker_Binding_Type_Which.KV_NAMESPACE;
Worker_Binding_Type.R2BUCKET = Worker_Binding_Type_Which.R2BUCKET;
Worker_Binding_Type.R2ADMIN = Worker_Binding_Type_Which.R2ADMIN;
Worker_Binding_Type._capnp = { displayName: "Type", id: "8906a1296519bf8a", size: new capnp_ts_1.ObjectSize(8, 1) };
var Worker_Binding_DurableObjectNamespaceDesignator = class extends capnp_ts_1.Struct {
getClassName() {
return capnp_ts_1.Struct.getText(0, this);
}
setClassName(value) {
capnp_ts_1.Struct.setText(0, value, this);
}
getServiceName() {
return capnp_ts_1.Struct.getText(1, this);
}
setServiceName(value) {
capnp_ts_1.Struct.setText(1, value, this);
}
toString() {
return "Worker_Binding_DurableObjectNamespaceDesignator_" + super.toString();
}
};
exports.Worker_Binding_DurableObjectNamespaceDesignator = Worker_Binding_DurableObjectNamespaceDesignator;
Worker_Binding_DurableObjectNamespaceDesignator._capnp = { displayName: "DurableObjectNamespaceDesignator", id: "804f144ff477aac7", size: new capnp_ts_1.ObjectSize(0, 2) };
var Worker_Binding_CryptoKey_Usage2;
(function(Worker_Binding_CryptoKey_Usage3) {
Worker_Binding_CryptoKey_Usage3[Worker_Binding_CryptoKey_Usage3["ENCRYPT"] = 0] = "ENCRYPT";
Worker_Binding_CryptoKey_Usage3[Worker_Binding_CryptoKey_Usage3["DECRYPT"] = 1] = "DECRYPT";
Worker_Binding_CryptoKey_Usage3[Worker_Binding_CryptoKey_Usage3["SIGN"] = 2] = "SIGN";
Worker_Binding_CryptoKey_Usage3[Worker_Binding_CryptoKey_Usage3["VERIFY"] = 3] = "VERIFY";
Worker_Binding_CryptoKey_Usage3[Worker_Binding_CryptoKey_Usage3["DERIVE_KEY"] = 4] = "DERIVE_KEY";
Worker_Binding_CryptoKey_Usage3[Worker_Binding_CryptoKey_Usage3["DERIVE_BITS"] = 5] = "DERIVE_BITS";
Worker_Binding_CryptoKey_Usage3[Worker_Binding_CryptoKey_Usage3["WRAP_KEY"] = 6] = "WRAP_KEY";
Worker_Binding_CryptoKey_Usage3[Worker_Binding_CryptoKey_Usage3["UNWRAP_KEY"] = 7] = "UNWRAP_KEY";
})(Worker_Binding_CryptoKey_Usage2 = exports.Worker_Binding_CryptoKey_Usage || (exports.Worker_Binding_CryptoKey_Usage = {}));
var Worker_Binding_CryptoKey_Algorithm_Which;
(function(Worker_Binding_CryptoKey_Algorithm_Which2) {
Worker_Binding_CryptoKey_Algorithm_Which2[Worker_Binding_CryptoKey_Algorithm_Which2["NAME"] = 0] = "NAME";
Worker_Binding_CryptoKey_Algorithm_Which2[Worker_Binding_CryptoKey_Algorithm_Which2["JSON"] = 1] = "JSON";
})(Worker_Binding_CryptoKey_Algorithm_Which = exports.Worker_Binding_CryptoKey_Algorithm_Which || (exports.Worker_Binding_CryptoKey_Algorithm_Which = {}));
var Worker_Binding_CryptoKey_Algorithm = class extends capnp_ts_1.Struct {
getName() {
capnp_ts_1.Struct.testWhich("name", capnp_ts_1.Struct.getUint16(2, this), 0, this);
return capnp_ts_1.Struct.getText(1, this);
}
isName() {
return capnp_ts_1.Struct.getUint16(2, this) === 0;
}
setName(value) {
capnp_ts_1.Struct.setUint16(2, 0, this);
capnp_ts_1.Struct.setText(1, value, this);
}
getJson() {
capnp_ts_1.Struct.testWhich("json", capnp_ts_1.Struct.getUint16(2, this), 1, this);
return capnp_ts_1.Struct.getText(1, this);
}
isJson() {
return capnp_ts_1.Struct.getUint16(2, this) === 1;
}
setJson(value) {
capnp_ts_1.Struct.setUint16(2, 1, this);
capnp_ts_1.Struct.setText(1, value, this);
}
toString() {
return "Worker_Binding_CryptoKey_Algorithm_" + super.toString();
}
which() {
return capnp_ts_1.Struct.getUint16(2, this);
}
};
exports.Worker_Binding_CryptoKey_Algorithm = Worker_Binding_CryptoKey_Algorithm;
Worker_Binding_CryptoKey_Algorithm.NAME = Worker_Binding_CryptoKey_Algorithm_Which.NAME;
Worker_Binding_CryptoKey_Algorithm.JSON = Worker_Binding_CryptoKey_Algorithm_Which.JSON;
Worker_Binding_CryptoKey_Algorithm._capnp = { displayName: "algorithm", id: "a1a040c5e00d7021", size: new capnp_ts_1.ObjectSize(8, 3) };
var Worker_Binding_CryptoKey_Which;
(function(Worker_Binding_CryptoKey_Which2) {
Worker_Binding_CryptoKey_Which2[Worker_Binding_CryptoKey_Which2["RAW"] = 0] = "RAW";
Worker_Binding_CryptoKey_Which2[Worker_Binding_CryptoKey_Which2["HEX"] = 1] = "HEX";
Worker_Binding_CryptoKey_Which2[Worker_Binding_CryptoKey_Which2["BASE64"] = 2] = "BASE64";
Worker_Binding_CryptoKey_Which2[Worker_Binding_CryptoKey_Which2["PKCS8"] = 3] = "PKCS8";
Worker_Binding_CryptoKey_Which2[Worker_Binding_CryptoKey_Which2["SPKI"] = 4] = "SPKI";
Worker_Binding_CryptoKey_Which2[Worker_Binding_CryptoKey_Which2["JWK"] = 5] = "JWK";
})(Worker_Binding_CryptoKey_Which = exports.Worker_Binding_CryptoKey_Which || (exports.Worker_Binding_CryptoKey_Which = {}));
var Worker_Binding_CryptoKey = class extends capnp_ts_1.Struct {
adoptRaw(value) {
capnp_ts_1.Struct.setUint16(0, 0, this);
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(0, this));
}
disownRaw() {
return capnp_ts_1.Struct.disown(this.getRaw());
}
getRaw() {
capnp_ts_1.Struct.testWhich("raw", capnp_ts_1.Struct.getUint16(0, this), 0, this);
return capnp_ts_1.Struct.getData(0, this);
}
hasRaw() {
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(0, this));
}
initRaw(length) {
capnp_ts_1.Struct.setUint16(0, 0, this);
return capnp_ts_1.Struct.initData(0, length, this);
}
isRaw() {
return capnp_ts_1.Struct.getUint16(0, this) === 0;
}
setRaw(value) {
capnp_ts_1.Struct.setUint16(0, 0, this);
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(0, this));
}
getHex() {
capnp_ts_1.Struct.testWhich("hex", capnp_ts_1.Struct.getUint16(0, this), 1, this);
return capnp_ts_1.Struct.getText(0, this);
}
isHex() {
return capnp_ts_1.Struct.getUint16(0, this) === 1;
}
setHex(value) {
capnp_ts_1.Struct.setUint16(0, 1, this);
capnp_ts_1.Struct.setText(0, value, this);
}
getBase64() {
capnp_ts_1.Struct.testWhich("base64", capnp_ts_1.Struct.getUint16(0, this), 2, this);
return capnp_ts_1.Struct.getText(0, this);
}
isBase64() {
return capnp_ts_1.Struct.getUint16(0, this) === 2;
}
setBase64(value) {
capnp_ts_1.Struct.setUint16(0, 2, this);
capnp_ts_1.Struct.setText(0, value, this);
}
getPkcs8() {
capnp_ts_1.Struct.testWhich("pkcs8", capnp_ts_1.Struct.getUint16(0, this), 3, this);
return capnp_ts_1.Struct.getText(0, this);
}
isPkcs8() {
return capnp_ts_1.Struct.getUint16(0, this) === 3;
}
setPkcs8(value) {
capnp_ts_1.Struct.setUint16(0, 3, this);
capnp_ts_1.Struct.setText(0, value, this);
}
getSpki() {
capnp_ts_1.Struct.testWhich("spki", capnp_ts_1.Struct.getUint16(0, this), 4, this);
return capnp_ts_1.Struct.getText(0, this);
}
isSpki() {
return capnp_ts_1.Struct.getUint16(0, this) === 4;
}
setSpki(value) {
capnp_ts_1.Struct.setUint16(0, 4, this);
capnp_ts_1.Struct.setText(0, value, this);
}
getJwk() {
capnp_ts_1.Struct.testWhich("jwk", capnp_ts_1.Struct.getUint16(0, this), 5, this);
return capnp_ts_1.Struct.getText(0, this);
}
isJwk() {
return capnp_ts_1.Struct.getUint16(0, this) === 5;
}
setJwk(value) {
capnp_ts_1.Struct.setUint16(0, 5, this);
capnp_ts_1.Struct.setText(0, value, this);
}
getAlgorithm() {
return capnp_ts_1.Struct.getAs(Worker_Binding_CryptoKey_Algorithm, this);
}
initAlgorithm() {
return capnp_ts_1.Struct.getAs(Worker_Binding_CryptoKey_Algorithm, this);
}
getExtractable() {
return capnp_ts_1.Struct.getBit(32, this, Worker_Binding_CryptoKey._capnp.defaultExtractable);
}
setExtractable(value) {
capnp_ts_1.Struct.setBit(32, value, this);
}
adoptUsages(value) {
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(2, this));
}
disownUsages() {
return capnp_ts_1.Struct.disown(this.getUsages());
}
getUsages() {
return capnp_ts_1.Struct.getList(2, capnp.Uint16List, this);
}
hasUsages() {
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(2, this));
}
initUsages(length) {
return capnp_ts_1.Struct.initList(2, capnp.Uint16List, length, this);
}
setUsages(value) {
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(2, this));
}
toString() {
return "Worker_Binding_CryptoKey_" + super.toString();
}
which() {
return capnp_ts_1.Struct.getUint16(0, this);
}
};
exports.Worker_Binding_CryptoKey = Worker_Binding_CryptoKey;
Worker_Binding_CryptoKey.RAW = Worker_Binding_CryptoKey_Which.RAW;
Worker_Binding_CryptoKey.HEX = Worker_Binding_CryptoKey_Which.HEX;
Worker_Binding_CryptoKey.BASE64 = Worker_Binding_CryptoKey_Which.BASE64;
Worker_Binding_CryptoKey.PKCS8 = Worker_Binding_CryptoKey_Which.PKCS8;
Worker_Binding_CryptoKey.SPKI = Worker_Binding_CryptoKey_Which.SPKI;
Worker_Binding_CryptoKey.JWK = Worker_Binding_CryptoKey_Which.JWK;
Worker_Binding_CryptoKey.Usage = Worker_Binding_CryptoKey_Usage2;
Worker_Binding_CryptoKey._capnp = { displayName: "CryptoKey", id: "b5e1bff0e57d6eb0", size: new capnp_ts_1.ObjectSize(8, 3), defaultExtractable: capnp.getBitMask(false, 0) };
var Worker_Binding_Parameter = class extends capnp_ts_1.Struct {
adoptType(value) {
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(1, this));
}
disownType() {
return capnp_ts_1.Struct.disown(this.getType());
}
getType() {
return capnp_ts_1.Struct.getStruct(1, Worker_Binding_Type, this);
}
hasType() {
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(1, this));
}
initType() {
return capnp_ts_1.Struct.initStructAt(1, Worker_Binding_Type, this);
}
setType(value) {
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(1, this));
}
getOptional() {
return capnp_ts_1.Struct.getBit(16, this);
}
setOptional(value) {
capnp_ts_1.Struct.setBit(16, value, this);
}
toString() {
return "Worker_Binding_Parameter_" + super.toString();
}
};
exports.Worker_Binding_Parameter = Worker_Binding_Parameter;
Worker_Binding_Parameter._capnp = { displayName: "parameter", id: "dc57e1258d26d152", size: new capnp_ts_1.ObjectSize(8, 2) };
var Worker_Binding_Which;
(function(Worker_Binding_Which2) {
Worker_Binding_Which2[Worker_Binding_Which2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
Worker_Binding_Which2[Worker_Binding_Which2["PARAMETER"] = 1] = "PARAMETER";
Worker_Binding_Which2[Worker_Binding_Which2["TEXT"] = 2] = "TEXT";
Worker_Binding_Which2[Worker_Binding_Which2["DATA"] = 3] = "DATA";
Worker_Binding_Which2[Worker_Binding_Which2["JSON"] = 4] = "JSON";
Worker_Binding_Which2[Worker_Binding_Which2["WASM_MODULE"] = 5] = "WASM_MODULE";
Worker_Binding_Which2[Worker_Binding_Which2["CRYPTO_KEY"] = 6] = "CRYPTO_KEY";
Worker_Binding_Which2[Worker_Binding_Which2["SERVICE"] = 7] = "SERVICE";
Worker_Binding_Which2[Worker_Binding_Which2["DURABLE_OBJECT_NAMESPACE"] = 8] = "DURABLE_OBJECT_NAMESPACE";
Worker_Binding_Which2[Worker_Binding_Which2["KV_NAMESPACE"] = 9] = "KV_NAMESPACE";
Worker_Binding_Which2[Worker_Binding_Which2["R2BUCKET"] = 10] = "R2BUCKET";
Worker_Binding_Which2[Worker_Binding_Which2["R2ADMIN"] = 11] = "R2ADMIN";
})(Worker_Binding_Which = exports.Worker_Binding_Which || (exports.Worker_Binding_Which = {}));
var Worker_Binding3 = class extends capnp_ts_1.Struct {
getName() {
return capnp_ts_1.Struct.getText(0, this);
}
setName(value) {
capnp_ts_1.Struct.setText(0, value, this);
}
isUnspecified() {
return capnp_ts_1.Struct.getUint16(0, this) === 0;
}
setUnspecified() {
capnp_ts_1.Struct.setUint16(0, 0, this);
}
getParameter() {
capnp_ts_1.Struct.testWhich("parameter", capnp_ts_1.Struct.getUint16(0, this), 1, this);
return capnp_ts_1.Struct.getAs(Worker_Binding_Parameter, this);
}
initParameter() {
capnp_ts_1.Struct.setUint16(0, 1, this);
return capnp_ts_1.Struct.getAs(Worker_Binding_Parameter, this);
}
isParameter() {
return capnp_ts_1.Struct.getUint16(0, this) === 1;
}
setParameter() {
capnp_ts_1.Struct.setUint16(0, 1, this);
}
getText() {
capnp_ts_1.Struct.testWhich("text", capnp_ts_1.Struct.getUint16(0, this), 2, this);
return capnp_ts_1.Struct.getText(1, this);
}
isText() {
return capnp_ts_1.Struct.getUint16(0, this) === 2;
}
setText(value) {
capnp_ts_1.Struct.setUint16(0, 2, this);
capnp_ts_1.Struct.setText(1, value, this);
}
adoptData(value) {
capnp_ts_1.Struct.setUint16(0, 3, this);
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(1, this));
}
disownData() {
return capnp_ts_1.Struct.disown(this.getData());
}
getData() {
capnp_ts_1.Struct.testWhich("data", capnp_ts_1.Struct.getUint16(0, this), 3, this);
return capnp_ts_1.Struct.getData(1, this);
}
hasData() {
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(1, this));
}
initData(length) {
capnp_ts_1.Struct.setUint16(0, 3, this);
return capnp_ts_1.Struct.initData(1, length, this);
}
isData() {
return capnp_ts_1.Struct.getUint16(0, this) === 3;
}
setData(value) {
capnp_ts_1.Struct.setUint16(0, 3, this);
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(1, this));
}
getJson() {
capnp_ts_1.Struct.testWhich("json", capnp_ts_1.Struct.getUint16(0, this), 4, this);
return capnp_ts_1.Struct.getText(1, this);
}
isJson() {
return capnp_ts_1.Struct.getUint16(0, this) === 4;
}
setJson(value) {
capnp_ts_1.Struct.setUint16(0, 4, this);
capnp_ts_1.Struct.setText(1, value, this);
}
adoptWasmModule(value) {
capnp_ts_1.Struct.setUint16(0, 5, this);
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(1, this));
}
disownWasmModule() {
return capnp_ts_1.Struct.disown(this.getWasmModule());
}
getWasmModule() {
capnp_ts_1.Struct.testWhich("wasmModule", capnp_ts_1.Struct.getUint16(0, this), 5, this);
return capnp_ts_1.Struct.getData(1, this);
}
hasWasmModule() {
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(1, this));
}
initWasmModule(length) {
capnp_ts_1.Struct.setUint16(0, 5, this);
return capnp_ts_1.Struct.initData(1, length, this);
}
isWasmModule() {
return capnp_ts_1.Struct.getUint16(0, this) === 5;
}
setWasmModule(value) {
capnp_ts_1.Struct.setUint16(0, 5, this);
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(1, this));
}
adoptCryptoKey(value) {
capnp_ts_1.Struct.setUint16(0, 6, this);
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(1, this));
}
disownCryptoKey() {
return capnp_ts_1.Struct.disown(this.getCryptoKey());
}
getCryptoKey() {
capnp_ts_1.Struct.testWhich("cryptoKey", capnp_ts_1.Struct.getUint16(0, this), 6, this);
return capnp_ts_1.Struct.getStruct(1, Worker_Binding_CryptoKey, this);
}
hasCryptoKey() {
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(1, this));
}
initCryptoKey() {
capnp_ts_1.Struct.setUint16(0, 6, this);
return capnp_ts_1.Struct.initStructAt(1, Worker_Binding_CryptoKey, this);
}
isCryptoKey() {
return capnp_ts_1.Struct.getUint16(0, this) === 6;
}
setCryptoKey(value) {
capnp_ts_1.Struct.setUint16(0, 6, this);
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(1, this));
}
adoptService(value) {
capnp_ts_1.Struct.setUint16(0, 7, this);
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(1, this));
}
disownService() {
return capnp_ts_1.Struct.disown(this.getService());
}
getService() {
capnp_ts_1.Struct.testWhich("service", capnp_ts_1.Struct.getUint16(0, this), 7, this);
return capnp_ts_1.Struct.getStruct(1, ServiceDesignator, this);
}
hasService() {
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(1, this));
}
initService() {
capnp_ts_1.Struct.setUint16(0, 7, this);
return capnp_ts_1.Struct.initStructAt(1, ServiceDesignator, this);
}
isService() {
return capnp_ts_1.Struct.getUint16(0, this) === 7;
}
setService(value) {
capnp_ts_1.Struct.setUint16(0, 7, this);
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(1, this));
}
adoptDurableObjectNamespace(value) {
capnp_ts_1.Struct.setUint16(0, 8, this);
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(1, this));
}
disownDurableObjectNamespace() {
return capnp_ts_1.Struct.disown(this.getDurableObjectNamespace());
}
getDurableObjectNamespace() {
capnp_ts_1.Struct.testWhich("durableObjectNamespace", capnp_ts_1.Struct.getUint16(0, this), 8, this);
return capnp_ts_1.Struct.getStruct(1, Worker_Binding_DurableObjectNamespaceDesignator, this);
}
hasDurableObjectNamespace() {
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(1, this));
}
initDurableObjectNamespace() {
capnp_ts_1.Struct.setUint16(0, 8, this);
return capnp_ts_1.Struct.initStructAt(1, Worker_Binding_DurableObjectNamespaceDesignator, this);
}
isDurableObjectNamespace() {
return capnp_ts_1.Struct.getUint16(0, this) === 8;
}
setDurableObjectNamespace(value) {
capnp_ts_1.Struct.setUint16(0, 8, this);
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(1, this));
}
adoptKvNamespace(value) {
capnp_ts_1.Struct.setUint16(0, 9, this);
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(1, this));
}
disownKvNamespace() {
return capnp_ts_1.Struct.disown(this.getKvNamespace());
}
getKvNamespace() {
capnp_ts_1.Struct.testWhich("kvNamespace", capnp_ts_1.Struct.getUint16(0, this), 9, this);
return capnp_ts_1.Struct.getStruct(1, ServiceDesignator, this);
}
hasKvNamespace() {
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(1, this));
}
initKvNamespace() {
capnp_ts_1.Struct.setUint16(0, 9, this);
return capnp_ts_1.Struct.initStructAt(1, ServiceDesignator, this);
}
isKvNamespace() {
return capnp_ts_1.Struct.getUint16(0, this) === 9;
}
setKvNamespace(value) {
capnp_ts_1.Struct.setUint16(0, 9, this);
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(1, this));
}
adoptR2Bucket(value) {
capnp_ts_1.Struct.setUint16(0, 10, this);
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(1, this));
}
disownR2Bucket() {
return capnp_ts_1.Struct.disown(this.getR2Bucket());
}
getR2Bucket() {
capnp_ts_1.Struct.testWhich("r2Bucket", capnp_ts_1.Struct.getUint16(0, this), 10, this);
return capnp_ts_1.Struct.getStruct(1, ServiceDesignator, this);
}
hasR2Bucket() {
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(1, this));
}
initR2Bucket() {
capnp_ts_1.Struct.setUint16(0, 10, this);
return capnp_ts_1.Struct.initStructAt(1, ServiceDesignator, this);
}
isR2Bucket() {
return capnp_ts_1.Struct.getUint16(0, this) === 10;
}
setR2Bucket(value) {
capnp_ts_1.Struct.setUint16(0, 10, this);
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(1, this));
}
adoptR2Admin(value) {
capnp_ts_1.Struct.setUint16(0, 11, this);
capnp_ts_1.Struct.adopt(value, capnp_ts_1.Struct.getPointer(1, this));
}
disownR2Admin() {
return capnp_ts_1.Struct.disown(this.getR2Admin());
}
getR2Admin() {
capnp_ts_1.Struct.testWhich("r2Admin", capnp_ts_1.Struct.getUint16(0, this), 11, this);
return capnp_ts_1.Struct.getStruct(1, ServiceDesignator, this);
}
hasR2Admin() {
return !capnp_ts_1.Struct.isNull(capnp_ts_1.Struct.getPointer(1, this));
}
initR2Admin() {
capnp_ts_1.Struct.setUint16(0, 11, this);
return capnp_ts_1.Struct.initStructAt(1, ServiceDesignator, this);
}
isR2Admin() {
return capnp_ts_1.Struct.getUint16(0, this) === 11;
}
setR2Admin(value) {
capnp_ts_1.Struct.setUint16(0, 11, this);
capnp_ts_1.Struct.copyFrom(value, capnp_ts_1.Struct.getPointer(1, this));
}
toString() {
return "Worker_Binding_" + super.toString();
}
which() {
return capnp_ts_1.Struct.getUint16(0, this);
}
};
exports.Worker_Binding = Worker_Binding3;
Worker_Binding3.UNSPECIFIED = Worker_Binding_Which.UNSPECIFIED;
Worker_Binding3.PARAMETER = Worker_Binding_Which.PARAMETER;
Worker_Binding3.TEXT = Worker_Binding_Which.TEXT;
Worker_Binding3.DATA = Worker_Binding_Which.DATA;
Worker_Binding3.JSON = Worker_Binding_Which.JSON;
Worker_Binding3.WASM_MODULE = Worker_Binding_Which.WASM_MODULE;
Worker_Binding3.CRYPTO_KEY = Worker_Binding_Which.CRYPTO_KEY;
Worker_Binding3.SERVICE = Worker_Binding_Which.SERVICE;
Worker_Binding3.DURABLE_OBJECT_NAMESPACE = Worker_Binding_Which.DURABLE_OBJECT_NAMESPACE;
Worker_Binding3.KV_NAMESPACE = Worker_Binding_Which.KV_NAMESPACE;
Worker_Binding3.R2BUCKET = Worker_Binding_Which.R2BUCKET;
Worker_Binding3.R2ADMIN = Worker_Binding_Which.R2ADMIN;
Worker_Binding3.Type = Worker_Binding_Type;
Worker_Binding3.DurableObjectNamespaceDesignator = Worker_Binding_DurableObjectNamespaceDesignator;
Worker_Binding3.CryptoKey = Worker_Binding_CryptoKey;
Worker_Binding3._capnp = { displayName: "Binding", id: "8e7e492fd7e35f3e", size: new capnp_ts_1.ObjectSize(8, 2) };
var Worker_DurableObjectNamespace_Which;
(function(Worker_DurableObjectNamespace_Which2) {
Worker_DurableObjectNamespace_Which2[Worker_DurableObje