diff --git a/dist/javy-chainlink-sdk.plugin.wasm b/dist/javy-chainlink-sdk.plugin.wasm index 07931902..a6afccfa 100644 Binary files a/dist/javy-chainlink-sdk.plugin.wasm and b/dist/javy-chainlink-sdk.plugin.wasm differ diff --git a/src/generated-sdk/capabilities/blockchain/evm/v1alpha/client_sdk_gen.ts b/src/generated-sdk/capabilities/blockchain/evm/v1alpha/client_sdk_gen.ts index b54bb30c..5be14683 100644 --- a/src/generated-sdk/capabilities/blockchain/evm/v1alpha/client_sdk_gen.ts +++ b/src/generated-sdk/capabilities/blockchain/evm/v1alpha/client_sdk_gen.ts @@ -1,511 +1,535 @@ -import { fromBinary, toBinary, fromJson, create } from '@bufbuild/protobuf' -import { Mode, type CapabilityResponse } from '@cre/generated/sdk/v1alpha/sdk_pb' -import { callCapability } from '@cre/sdk/utils/capabilities/call-capability' -import { CapabilityError } from '@cre/sdk/utils/capabilities/capability-error' -import { type Trigger } from '@cre/sdk/utils/triggers/trigger-interface' -import { type Any, AnySchema } from '@bufbuild/protobuf/wkt' -import { getTypeUrl } from '@cre/sdk/utils/typeurl' +import { fromBinary, toBinary, fromJson, create } from "@bufbuild/protobuf"; import { - BalanceAtReplySchema, - BalanceAtRequestSchema, - CallContractReplySchema, - CallContractRequestSchema, - EstimateGasReplySchema, - EstimateGasRequestSchema, - FilterLogTriggerRequestSchema, - FilterLogsReplySchema, - FilterLogsRequestSchema, - GetTransactionByHashReplySchema, - GetTransactionByHashRequestSchema, - GetTransactionReceiptReplySchema, - GetTransactionReceiptRequestSchema, - HeaderByNumberReplySchema, - HeaderByNumberRequestSchema, - LogSchema, - RegisterLogTrackingRequestSchema, - UnregisterLogTrackingRequestSchema, - WriteReportReplySchema, - WriteReportRequestSchema, - type BalanceAtReply, - type BalanceAtRequestJson, - type CallContractReply, - type CallContractRequestJson, - type EstimateGasReply, - type EstimateGasRequestJson, - type FilterLogTriggerRequestJson, - type FilterLogsReply, - type FilterLogsRequestJson, - type GetTransactionByHashReply, - type GetTransactionByHashRequestJson, - type GetTransactionReceiptReply, - type GetTransactionReceiptRequestJson, - type HeaderByNumberReply, - type HeaderByNumberRequestJson, - type Log, - type RegisterLogTrackingRequestJson, - type UnregisterLogTrackingRequestJson, - type WriteReportReply, - type WriteReportRequestJson, -} from '@cre/generated/capabilities/blockchain/evm/v1alpha/client_pb' -import { EmptySchema, type Empty } from '@bufbuild/protobuf/wkt' + Mode, + type CapabilityResponse, +} from "@cre/generated/sdk/v1alpha/sdk_pb"; +import { callCapability } from "@cre/sdk/utils/capabilities/call-capability"; +import { CapabilityError } from "@cre/sdk/utils/capabilities/capability-error"; +import { type Trigger } from "@cre/sdk/utils/triggers/trigger-interface"; +import { type Any, AnySchema } from "@bufbuild/protobuf/wkt"; +import { getTypeUrl } from "@cre/sdk/utils/typeurl"; +import { + BalanceAtReplySchema, + BalanceAtRequestSchema, + CallContractReplySchema, + CallContractRequestSchema, + EstimateGasReplySchema, + EstimateGasRequestSchema, + FilterLogTriggerRequestSchema, + FilterLogsReplySchema, + FilterLogsRequestSchema, + GetTransactionByHashReplySchema, + GetTransactionByHashRequestSchema, + GetTransactionReceiptReplySchema, + GetTransactionReceiptRequestSchema, + HeaderByNumberReplySchema, + HeaderByNumberRequestSchema, + LogSchema, + RegisterLogTrackingRequestSchema, + UnregisterLogTrackingRequestSchema, + WriteReportReplySchema, + WriteReportRequestSchema, + type BalanceAtReply, + type BalanceAtRequest, + type BalanceAtRequestJson, + type CallContractReply, + type CallContractRequest, + type CallContractRequestJson, + type EstimateGasReply, + type EstimateGasRequest, + type EstimateGasRequestJson, + type FilterLogTriggerRequest, + type FilterLogTriggerRequestJson, + type FilterLogsReply, + type FilterLogsRequest, + type FilterLogsRequestJson, + type GetTransactionByHashReply, + type GetTransactionByHashRequest, + type GetTransactionByHashRequestJson, + type GetTransactionReceiptReply, + type GetTransactionReceiptRequest, + type GetTransactionReceiptRequestJson, + type HeaderByNumberReply, + type HeaderByNumberRequest, + type HeaderByNumberRequestJson, + type Log, + type RegisterLogTrackingRequest, + type RegisterLogTrackingRequestJson, + type UnregisterLogTrackingRequest, + type UnregisterLogTrackingRequestJson, + type WriteReportReply, + type WriteReportRequest, + type WriteReportRequestJson, +} from "@cre/generated/capabilities/blockchain/evm/v1alpha/client_pb"; +import { + EmptySchema, + type Empty, +} from "@bufbuild/protobuf/wkt"; /** * Client Capability - * + * * Capability ID: evm@1.0.0 * Default Mode: Mode.DON * Capability Name: evm * Capability Version: 1.0.0 */ export class ClientCapability { - /** The capability ID for this service */ - static readonly CAPABILITY_ID = 'evm@1.0.0' - - /** The default execution mode for this capability */ - static readonly DEFAULT_MODE = Mode.DON - - static readonly CAPABILITY_NAME = 'evm' - static readonly CAPABILITY_VERSION = '1.0.0' - - /** Available chain selectors */ - static readonly SUPPORTED_CHAINS = { - 'avalanche-mainnet': 6433500567565415381n, - 'avalanche-testnet-fuji': 14767482510784806043n, - 'binance_smart_chain-mainnet-opbnb-1': 465944652040885897n, - 'binance_smart_chain-testnet-opbnb-1': 13274425992935471758n, - 'ethereum-mainnet': 5009297550715157269n, - 'ethereum-mainnet-arbitrum-1': 4949039107694359620n, - 'ethereum-mainnet-optimism-1': 3734403246176062136n, - 'ethereum-testnet-sepolia': 16015286601757825753n, - 'ethereum-testnet-sepolia-arbitrum-1': 3478487238524512106n, - 'ethereum-testnet-sepolia-base-1': 10344971235874465080n, - 'ethereum-testnet-sepolia-optimism-1': 5224473277236331295n, - 'polygon-mainnet': 4051577828743386545n, - 'polygon-testnet-amoy': 16281711391670634445n, - } as const - - constructor( - private readonly mode: Mode = ClientCapability.DEFAULT_MODE, - private readonly chainSelector?: bigint, - ) {} - - async callContract(input: CallContractRequestJson): Promise { - const payload = { - typeUrl: getTypeUrl(CallContractRequestSchema), - value: toBinary(CallContractRequestSchema, fromJson(CallContractRequestSchema, input)), - } - // Include chainSelector in capability ID for routing when specified - const capabilityId = this.chainSelector - ? `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.chainSelector}@${ClientCapability.CAPABILITY_VERSION}` - : ClientCapability.CAPABILITY_ID - - return callCapability({ - capabilityId, - method: 'CallContract', - mode: this.mode, - payload, - }).then((capabilityResponse: CapabilityResponse) => { - if (capabilityResponse.response.case === 'error') { - throw new CapabilityError(capabilityResponse.response.value, { - capabilityId, - method: 'CallContract', - mode: this.mode, - }) - } - - if (capabilityResponse.response.case !== 'payload') { - throw new CapabilityError('No payload in response', { - capabilityId, - method: 'CallContract', - mode: this.mode, - }) - } - - return fromBinary(CallContractReplySchema, capabilityResponse.response.value.value) - }) - } - - async filterLogs(input: FilterLogsRequestJson): Promise { - const payload = { - typeUrl: getTypeUrl(FilterLogsRequestSchema), - value: toBinary(FilterLogsRequestSchema, fromJson(FilterLogsRequestSchema, input)), - } - // Include chainSelector in capability ID for routing when specified - const capabilityId = this.chainSelector - ? `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.chainSelector}@${ClientCapability.CAPABILITY_VERSION}` - : ClientCapability.CAPABILITY_ID - - return callCapability({ - capabilityId, - method: 'FilterLogs', - mode: this.mode, - payload, - }).then((capabilityResponse: CapabilityResponse) => { - if (capabilityResponse.response.case === 'error') { - throw new CapabilityError(capabilityResponse.response.value, { - capabilityId, - method: 'FilterLogs', - mode: this.mode, - }) - } - - if (capabilityResponse.response.case !== 'payload') { - throw new CapabilityError('No payload in response', { - capabilityId, - method: 'FilterLogs', - mode: this.mode, - }) - } - - return fromBinary(FilterLogsReplySchema, capabilityResponse.response.value.value) - }) - } - - async balanceAt(input: BalanceAtRequestJson): Promise { - const payload = { - typeUrl: getTypeUrl(BalanceAtRequestSchema), - value: toBinary(BalanceAtRequestSchema, fromJson(BalanceAtRequestSchema, input)), - } - // Include chainSelector in capability ID for routing when specified - const capabilityId = this.chainSelector - ? `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.chainSelector}@${ClientCapability.CAPABILITY_VERSION}` - : ClientCapability.CAPABILITY_ID - - return callCapability({ - capabilityId, - method: 'BalanceAt', - mode: this.mode, - payload, - }).then((capabilityResponse: CapabilityResponse) => { - if (capabilityResponse.response.case === 'error') { - throw new CapabilityError(capabilityResponse.response.value, { - capabilityId, - method: 'BalanceAt', - mode: this.mode, - }) - } - - if (capabilityResponse.response.case !== 'payload') { - throw new CapabilityError('No payload in response', { - capabilityId, - method: 'BalanceAt', - mode: this.mode, - }) - } - - return fromBinary(BalanceAtReplySchema, capabilityResponse.response.value.value) - }) - } - - async estimateGas(input: EstimateGasRequestJson): Promise { - const payload = { - typeUrl: getTypeUrl(EstimateGasRequestSchema), - value: toBinary(EstimateGasRequestSchema, fromJson(EstimateGasRequestSchema, input)), - } - // Include chainSelector in capability ID for routing when specified - const capabilityId = this.chainSelector - ? `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.chainSelector}@${ClientCapability.CAPABILITY_VERSION}` - : ClientCapability.CAPABILITY_ID - - return callCapability({ - capabilityId, - method: 'EstimateGas', - mode: this.mode, - payload, - }).then((capabilityResponse: CapabilityResponse) => { - if (capabilityResponse.response.case === 'error') { - throw new CapabilityError(capabilityResponse.response.value, { - capabilityId, - method: 'EstimateGas', - mode: this.mode, - }) - } - - if (capabilityResponse.response.case !== 'payload') { - throw new CapabilityError('No payload in response', { - capabilityId, - method: 'EstimateGas', - mode: this.mode, - }) - } - - return fromBinary(EstimateGasReplySchema, capabilityResponse.response.value.value) - }) - } - - async getTransactionByHash( - input: GetTransactionByHashRequestJson, - ): Promise { - const payload = { - typeUrl: getTypeUrl(GetTransactionByHashRequestSchema), - value: toBinary( - GetTransactionByHashRequestSchema, - fromJson(GetTransactionByHashRequestSchema, input), - ), - } - // Include chainSelector in capability ID for routing when specified - const capabilityId = this.chainSelector - ? `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.chainSelector}@${ClientCapability.CAPABILITY_VERSION}` - : ClientCapability.CAPABILITY_ID - - return callCapability({ - capabilityId, - method: 'GetTransactionByHash', - mode: this.mode, - payload, - }).then((capabilityResponse: CapabilityResponse) => { - if (capabilityResponse.response.case === 'error') { - throw new CapabilityError(capabilityResponse.response.value, { - capabilityId, - method: 'GetTransactionByHash', - mode: this.mode, - }) - } - - if (capabilityResponse.response.case !== 'payload') { - throw new CapabilityError('No payload in response', { - capabilityId, - method: 'GetTransactionByHash', - mode: this.mode, - }) - } - - return fromBinary(GetTransactionByHashReplySchema, capabilityResponse.response.value.value) - }) - } - - async getTransactionReceipt( - input: GetTransactionReceiptRequestJson, - ): Promise { - const payload = { - typeUrl: getTypeUrl(GetTransactionReceiptRequestSchema), - value: toBinary( - GetTransactionReceiptRequestSchema, - fromJson(GetTransactionReceiptRequestSchema, input), - ), - } - // Include chainSelector in capability ID for routing when specified - const capabilityId = this.chainSelector - ? `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.chainSelector}@${ClientCapability.CAPABILITY_VERSION}` - : ClientCapability.CAPABILITY_ID - - return callCapability({ - capabilityId, - method: 'GetTransactionReceipt', - mode: this.mode, - payload, - }).then((capabilityResponse: CapabilityResponse) => { - if (capabilityResponse.response.case === 'error') { - throw new CapabilityError(capabilityResponse.response.value, { - capabilityId, - method: 'GetTransactionReceipt', - mode: this.mode, - }) - } - - if (capabilityResponse.response.case !== 'payload') { - throw new CapabilityError('No payload in response', { - capabilityId, - method: 'GetTransactionReceipt', - mode: this.mode, - }) - } - - return fromBinary(GetTransactionReceiptReplySchema, capabilityResponse.response.value.value) - }) - } - - async headerByNumber(input: HeaderByNumberRequestJson): Promise { - const payload = { - typeUrl: getTypeUrl(HeaderByNumberRequestSchema), - value: toBinary(HeaderByNumberRequestSchema, fromJson(HeaderByNumberRequestSchema, input)), - } - // Include chainSelector in capability ID for routing when specified - const capabilityId = this.chainSelector - ? `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.chainSelector}@${ClientCapability.CAPABILITY_VERSION}` - : ClientCapability.CAPABILITY_ID - - return callCapability({ - capabilityId, - method: 'HeaderByNumber', - mode: this.mode, - payload, - }).then((capabilityResponse: CapabilityResponse) => { - if (capabilityResponse.response.case === 'error') { - throw new CapabilityError(capabilityResponse.response.value, { - capabilityId, - method: 'HeaderByNumber', - mode: this.mode, - }) - } - - if (capabilityResponse.response.case !== 'payload') { - throw new CapabilityError('No payload in response', { - capabilityId, - method: 'HeaderByNumber', - mode: this.mode, - }) - } - - return fromBinary(HeaderByNumberReplySchema, capabilityResponse.response.value.value) - }) - } - - async registerLogTracking(input: RegisterLogTrackingRequestJson): Promise { - const payload = { - typeUrl: getTypeUrl(RegisterLogTrackingRequestSchema), - value: toBinary( - RegisterLogTrackingRequestSchema, - fromJson(RegisterLogTrackingRequestSchema, input), - ), - } - // Include chainSelector in capability ID for routing when specified - const capabilityId = this.chainSelector - ? `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.chainSelector}@${ClientCapability.CAPABILITY_VERSION}` - : ClientCapability.CAPABILITY_ID - - return callCapability({ - capabilityId, - method: 'RegisterLogTracking', - mode: this.mode, - payload, - }).then((capabilityResponse: CapabilityResponse) => { - if (capabilityResponse.response.case === 'error') { - throw new CapabilityError(capabilityResponse.response.value, { - capabilityId, - method: 'RegisterLogTracking', - mode: this.mode, - }) - } - - if (capabilityResponse.response.case !== 'payload') { - throw new CapabilityError('No payload in response', { - capabilityId, - method: 'RegisterLogTracking', - mode: this.mode, - }) - } - - return fromBinary(EmptySchema, capabilityResponse.response.value.value) - }) - } - - async unregisterLogTracking(input: UnregisterLogTrackingRequestJson): Promise { - const payload = { - typeUrl: getTypeUrl(UnregisterLogTrackingRequestSchema), - value: toBinary( - UnregisterLogTrackingRequestSchema, - fromJson(UnregisterLogTrackingRequestSchema, input), - ), - } - // Include chainSelector in capability ID for routing when specified - const capabilityId = this.chainSelector - ? `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.chainSelector}@${ClientCapability.CAPABILITY_VERSION}` - : ClientCapability.CAPABILITY_ID - - return callCapability({ - capabilityId, - method: 'UnregisterLogTracking', - mode: this.mode, - payload, - }).then((capabilityResponse: CapabilityResponse) => { - if (capabilityResponse.response.case === 'error') { - throw new CapabilityError(capabilityResponse.response.value, { - capabilityId, - method: 'UnregisterLogTracking', - mode: this.mode, - }) - } - - if (capabilityResponse.response.case !== 'payload') { - throw new CapabilityError('No payload in response', { - capabilityId, - method: 'UnregisterLogTracking', - mode: this.mode, - }) - } - - return fromBinary(EmptySchema, capabilityResponse.response.value.value) - }) - } - - logTrigger(config: FilterLogTriggerRequestJson): ClientLogTrigger { - return new ClientLogTrigger(this.mode, config, ClientCapability.CAPABILITY_ID, 'LogTrigger') - } - - async writeReport(input: WriteReportRequestJson): Promise { - const payload = { - typeUrl: getTypeUrl(WriteReportRequestSchema), - value: toBinary(WriteReportRequestSchema, fromJson(WriteReportRequestSchema, input)), - } - // Include chainSelector in capability ID for routing when specified - const capabilityId = this.chainSelector - ? `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.chainSelector}@${ClientCapability.CAPABILITY_VERSION}` - : ClientCapability.CAPABILITY_ID - - return callCapability({ - capabilityId, - method: 'WriteReport', - mode: this.mode, - payload, - }).then((capabilityResponse: CapabilityResponse) => { - if (capabilityResponse.response.case === 'error') { - throw new CapabilityError(capabilityResponse.response.value, { - capabilityId, - method: 'WriteReport', - mode: this.mode, - }) - } - - if (capabilityResponse.response.case !== 'payload') { - throw new CapabilityError('No payload in response', { - capabilityId, - method: 'WriteReport', - mode: this.mode, - }) - } - - return fromBinary(WriteReportReplySchema, capabilityResponse.response.value.value) - }) - } + /** The capability ID for this service */ + static readonly CAPABILITY_ID = "evm@1.0.0"; + + /** The default execution mode for this capability */ + static readonly DEFAULT_MODE = Mode.DON; + + static readonly CAPABILITY_NAME = "evm"; + static readonly CAPABILITY_VERSION = "1.0.0"; + + /** Available chain selectors */ + static readonly SUPPORTED_CHAINS = { + "avalanche-mainnet": 6433500567565415381n, + "avalanche-testnet-fuji": 14767482510784806043n, + "binance_smart_chain-mainnet-opbnb-1": 465944652040885897n, + "binance_smart_chain-testnet-opbnb-1": 13274425992935471758n, + "ethereum-mainnet": 5009297550715157269n, + "ethereum-mainnet-arbitrum-1": 4949039107694359620n, + "ethereum-mainnet-optimism-1": 3734403246176062136n, + "ethereum-testnet-sepolia": 16015286601757825753n, + "ethereum-testnet-sepolia-arbitrum-1": 3478487238524512106n, + "ethereum-testnet-sepolia-base-1": 10344971235874465080n, + "ethereum-testnet-sepolia-optimism-1": 5224473277236331295n, + "polygon-mainnet": 4051577828743386545n, + "polygon-testnet-amoy": 16281711391670634445n + } as const; + + constructor( + private readonly mode: Mode = ClientCapability.DEFAULT_MODE, + private readonly chainSelector?: bigint + ) {} + + async callContract(input: CallContractRequest | CallContractRequestJson): Promise { + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + const value = (input as any).$typeName ? input as CallContractRequest : fromJson(CallContractRequestSchema, input as CallContractRequestJson) + const payload = { + typeUrl: getTypeUrl(CallContractRequestSchema), + value: toBinary(CallContractRequestSchema, value), + }; + // Include chainSelector in capability ID for routing when specified + const capabilityId = this.chainSelector + ? `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.chainSelector}@${ClientCapability.CAPABILITY_VERSION}` + : ClientCapability.CAPABILITY_ID; + + return callCapability({ + capabilityId, + method: "CallContract", + mode: this.mode, + payload, + }).then((capabilityResponse: CapabilityResponse) => { + if (capabilityResponse.response.case === "error") { + throw new CapabilityError(capabilityResponse.response.value, { + capabilityId, + method: "CallContract", + mode: this.mode, + }); + } + + if (capabilityResponse.response.case !== "payload") { + throw new CapabilityError("No payload in response", { + capabilityId, + method: "CallContract", + mode: this.mode, + }); + } + + return fromBinary(CallContractReplySchema, capabilityResponse.response.value.value); + }); + } + + async filterLogs(input: FilterLogsRequest | FilterLogsRequestJson): Promise { + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + const value = (input as any).$typeName ? input as FilterLogsRequest : fromJson(FilterLogsRequestSchema, input as FilterLogsRequestJson) + const payload = { + typeUrl: getTypeUrl(FilterLogsRequestSchema), + value: toBinary(FilterLogsRequestSchema, value), + }; + // Include chainSelector in capability ID for routing when specified + const capabilityId = this.chainSelector + ? `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.chainSelector}@${ClientCapability.CAPABILITY_VERSION}` + : ClientCapability.CAPABILITY_ID; + + return callCapability({ + capabilityId, + method: "FilterLogs", + mode: this.mode, + payload, + }).then((capabilityResponse: CapabilityResponse) => { + if (capabilityResponse.response.case === "error") { + throw new CapabilityError(capabilityResponse.response.value, { + capabilityId, + method: "FilterLogs", + mode: this.mode, + }); + } + + if (capabilityResponse.response.case !== "payload") { + throw new CapabilityError("No payload in response", { + capabilityId, + method: "FilterLogs", + mode: this.mode, + }); + } + + return fromBinary(FilterLogsReplySchema, capabilityResponse.response.value.value); + }); + } + + async balanceAt(input: BalanceAtRequest | BalanceAtRequestJson): Promise { + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + const value = (input as any).$typeName ? input as BalanceAtRequest : fromJson(BalanceAtRequestSchema, input as BalanceAtRequestJson) + const payload = { + typeUrl: getTypeUrl(BalanceAtRequestSchema), + value: toBinary(BalanceAtRequestSchema, value), + }; + // Include chainSelector in capability ID for routing when specified + const capabilityId = this.chainSelector + ? `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.chainSelector}@${ClientCapability.CAPABILITY_VERSION}` + : ClientCapability.CAPABILITY_ID; + + return callCapability({ + capabilityId, + method: "BalanceAt", + mode: this.mode, + payload, + }).then((capabilityResponse: CapabilityResponse) => { + if (capabilityResponse.response.case === "error") { + throw new CapabilityError(capabilityResponse.response.value, { + capabilityId, + method: "BalanceAt", + mode: this.mode, + }); + } + + if (capabilityResponse.response.case !== "payload") { + throw new CapabilityError("No payload in response", { + capabilityId, + method: "BalanceAt", + mode: this.mode, + }); + } + + return fromBinary(BalanceAtReplySchema, capabilityResponse.response.value.value); + }); + } + + async estimateGas(input: EstimateGasRequest | EstimateGasRequestJson): Promise { + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + const value = (input as any).$typeName ? input as EstimateGasRequest : fromJson(EstimateGasRequestSchema, input as EstimateGasRequestJson) + const payload = { + typeUrl: getTypeUrl(EstimateGasRequestSchema), + value: toBinary(EstimateGasRequestSchema, value), + }; + // Include chainSelector in capability ID for routing when specified + const capabilityId = this.chainSelector + ? `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.chainSelector}@${ClientCapability.CAPABILITY_VERSION}` + : ClientCapability.CAPABILITY_ID; + + return callCapability({ + capabilityId, + method: "EstimateGas", + mode: this.mode, + payload, + }).then((capabilityResponse: CapabilityResponse) => { + if (capabilityResponse.response.case === "error") { + throw new CapabilityError(capabilityResponse.response.value, { + capabilityId, + method: "EstimateGas", + mode: this.mode, + }); + } + + if (capabilityResponse.response.case !== "payload") { + throw new CapabilityError("No payload in response", { + capabilityId, + method: "EstimateGas", + mode: this.mode, + }); + } + + return fromBinary(EstimateGasReplySchema, capabilityResponse.response.value.value); + }); + } + + async getTransactionByHash(input: GetTransactionByHashRequest | GetTransactionByHashRequestJson): Promise { + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + const value = (input as any).$typeName ? input as GetTransactionByHashRequest : fromJson(GetTransactionByHashRequestSchema, input as GetTransactionByHashRequestJson) + const payload = { + typeUrl: getTypeUrl(GetTransactionByHashRequestSchema), + value: toBinary(GetTransactionByHashRequestSchema, value), + }; + // Include chainSelector in capability ID for routing when specified + const capabilityId = this.chainSelector + ? `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.chainSelector}@${ClientCapability.CAPABILITY_VERSION}` + : ClientCapability.CAPABILITY_ID; + + return callCapability({ + capabilityId, + method: "GetTransactionByHash", + mode: this.mode, + payload, + }).then((capabilityResponse: CapabilityResponse) => { + if (capabilityResponse.response.case === "error") { + throw new CapabilityError(capabilityResponse.response.value, { + capabilityId, + method: "GetTransactionByHash", + mode: this.mode, + }); + } + + if (capabilityResponse.response.case !== "payload") { + throw new CapabilityError("No payload in response", { + capabilityId, + method: "GetTransactionByHash", + mode: this.mode, + }); + } + + return fromBinary(GetTransactionByHashReplySchema, capabilityResponse.response.value.value); + }); + } + + async getTransactionReceipt(input: GetTransactionReceiptRequest | GetTransactionReceiptRequestJson): Promise { + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + const value = (input as any).$typeName ? input as GetTransactionReceiptRequest : fromJson(GetTransactionReceiptRequestSchema, input as GetTransactionReceiptRequestJson) + const payload = { + typeUrl: getTypeUrl(GetTransactionReceiptRequestSchema), + value: toBinary(GetTransactionReceiptRequestSchema, value), + }; + // Include chainSelector in capability ID for routing when specified + const capabilityId = this.chainSelector + ? `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.chainSelector}@${ClientCapability.CAPABILITY_VERSION}` + : ClientCapability.CAPABILITY_ID; + + return callCapability({ + capabilityId, + method: "GetTransactionReceipt", + mode: this.mode, + payload, + }).then((capabilityResponse: CapabilityResponse) => { + if (capabilityResponse.response.case === "error") { + throw new CapabilityError(capabilityResponse.response.value, { + capabilityId, + method: "GetTransactionReceipt", + mode: this.mode, + }); + } + + if (capabilityResponse.response.case !== "payload") { + throw new CapabilityError("No payload in response", { + capabilityId, + method: "GetTransactionReceipt", + mode: this.mode, + }); + } + + return fromBinary(GetTransactionReceiptReplySchema, capabilityResponse.response.value.value); + }); + } + + async headerByNumber(input: HeaderByNumberRequest | HeaderByNumberRequestJson): Promise { + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + const value = (input as any).$typeName ? input as HeaderByNumberRequest : fromJson(HeaderByNumberRequestSchema, input as HeaderByNumberRequestJson) + const payload = { + typeUrl: getTypeUrl(HeaderByNumberRequestSchema), + value: toBinary(HeaderByNumberRequestSchema, value), + }; + // Include chainSelector in capability ID for routing when specified + const capabilityId = this.chainSelector + ? `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.chainSelector}@${ClientCapability.CAPABILITY_VERSION}` + : ClientCapability.CAPABILITY_ID; + + return callCapability({ + capabilityId, + method: "HeaderByNumber", + mode: this.mode, + payload, + }).then((capabilityResponse: CapabilityResponse) => { + if (capabilityResponse.response.case === "error") { + throw new CapabilityError(capabilityResponse.response.value, { + capabilityId, + method: "HeaderByNumber", + mode: this.mode, + }); + } + + if (capabilityResponse.response.case !== "payload") { + throw new CapabilityError("No payload in response", { + capabilityId, + method: "HeaderByNumber", + mode: this.mode, + }); + } + + return fromBinary(HeaderByNumberReplySchema, capabilityResponse.response.value.value); + }); + } + + async registerLogTracking(input: RegisterLogTrackingRequest | RegisterLogTrackingRequestJson): Promise { + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + const value = (input as any).$typeName ? input as RegisterLogTrackingRequest : fromJson(RegisterLogTrackingRequestSchema, input as RegisterLogTrackingRequestJson) + const payload = { + typeUrl: getTypeUrl(RegisterLogTrackingRequestSchema), + value: toBinary(RegisterLogTrackingRequestSchema, value), + }; + // Include chainSelector in capability ID for routing when specified + const capabilityId = this.chainSelector + ? `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.chainSelector}@${ClientCapability.CAPABILITY_VERSION}` + : ClientCapability.CAPABILITY_ID; + + return callCapability({ + capabilityId, + method: "RegisterLogTracking", + mode: this.mode, + payload, + }).then((capabilityResponse: CapabilityResponse) => { + if (capabilityResponse.response.case === "error") { + throw new CapabilityError(capabilityResponse.response.value, { + capabilityId, + method: "RegisterLogTracking", + mode: this.mode, + }); + } + + if (capabilityResponse.response.case !== "payload") { + throw new CapabilityError("No payload in response", { + capabilityId, + method: "RegisterLogTracking", + mode: this.mode, + }); + } + + return fromBinary(EmptySchema, capabilityResponse.response.value.value); + }); + } + + async unregisterLogTracking(input: UnregisterLogTrackingRequest | UnregisterLogTrackingRequestJson): Promise { + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + const value = (input as any).$typeName ? input as UnregisterLogTrackingRequest : fromJson(UnregisterLogTrackingRequestSchema, input as UnregisterLogTrackingRequestJson) + const payload = { + typeUrl: getTypeUrl(UnregisterLogTrackingRequestSchema), + value: toBinary(UnregisterLogTrackingRequestSchema, value), + }; + // Include chainSelector in capability ID for routing when specified + const capabilityId = this.chainSelector + ? `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.chainSelector}@${ClientCapability.CAPABILITY_VERSION}` + : ClientCapability.CAPABILITY_ID; + + return callCapability({ + capabilityId, + method: "UnregisterLogTracking", + mode: this.mode, + payload, + }).then((capabilityResponse: CapabilityResponse) => { + if (capabilityResponse.response.case === "error") { + throw new CapabilityError(capabilityResponse.response.value, { + capabilityId, + method: "UnregisterLogTracking", + mode: this.mode, + }); + } + + if (capabilityResponse.response.case !== "payload") { + throw new CapabilityError("No payload in response", { + capabilityId, + method: "UnregisterLogTracking", + mode: this.mode, + }); + } + + return fromBinary(EmptySchema, capabilityResponse.response.value.value); + }); + } + + logTrigger(config: FilterLogTriggerRequestJson): ClientLogTrigger { + return new ClientLogTrigger(this.mode, config, ClientCapability.CAPABILITY_ID, "LogTrigger"); + } + + async writeReport(input: WriteReportRequest | WriteReportRequestJson): Promise { + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + const value = (input as any).$typeName ? input as WriteReportRequest : fromJson(WriteReportRequestSchema, input as WriteReportRequestJson) + const payload = { + typeUrl: getTypeUrl(WriteReportRequestSchema), + value: toBinary(WriteReportRequestSchema, value), + }; + // Include chainSelector in capability ID for routing when specified + const capabilityId = this.chainSelector + ? `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.chainSelector}@${ClientCapability.CAPABILITY_VERSION}` + : ClientCapability.CAPABILITY_ID; + + return callCapability({ + capabilityId, + method: "WriteReport", + mode: this.mode, + payload, + }).then((capabilityResponse: CapabilityResponse) => { + if (capabilityResponse.response.case === "error") { + throw new CapabilityError(capabilityResponse.response.value, { + capabilityId, + method: "WriteReport", + mode: this.mode, + }); + } + + if (capabilityResponse.response.case !== "payload") { + throw new CapabilityError("No payload in response", { + capabilityId, + method: "WriteReport", + mode: this.mode, + }); + } + + return fromBinary(WriteReportReplySchema, capabilityResponse.response.value.value); + }); + } } /** * Trigger implementation for LogTrigger */ class ClientLogTrigger implements Trigger { - constructor( - public readonly mode: Mode, - public readonly config: FilterLogTriggerRequestJson, - private readonly _capabilityId: string, - private readonly _method: string, - ) {} - - capabilityId(): string { - return this._capabilityId - } - - method(): string { - return this._method - } - - outputSchema() { - return LogSchema - } - - configAsAny(): Any { - const configMessage = fromJson(FilterLogTriggerRequestSchema, this.config) - return create(AnySchema, { - typeUrl: getTypeUrl(FilterLogTriggerRequestSchema), - value: toBinary(FilterLogTriggerRequestSchema, configMessage), - }) - } - - /** - * Transform the raw trigger output - override this method if needed - * Default implementation returns the raw output unchanged - */ - adapt(rawOutput: Log): Log { - return rawOutput - } -} + public readonly config: FilterLogTriggerRequest + constructor( + public readonly mode: Mode, + config: FilterLogTriggerRequest | FilterLogTriggerRequestJson, + private readonly _capabilityId: string, + private readonly _method: string + ) { + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + this.config = (config as any).$typeName ? config as FilterLogTriggerRequest : fromJson(FilterLogTriggerRequestSchema, config as FilterLogTriggerRequestJson) + } + + capabilityId(): string { + return this._capabilityId; + } + + method(): string { + return this._method; + } + + outputSchema() { + return LogSchema; + } + + configAsAny(): Any { + return create(AnySchema, { + typeUrl: getTypeUrl(FilterLogTriggerRequestSchema), + value: toBinary(FilterLogTriggerRequestSchema, this.config), + }); + } + + /** + * Transform the raw trigger output - override this method if needed + * Default implementation returns the raw output unchanged + */ + adapt(rawOutput: Log): Log { + return rawOutput; + } +} \ No newline at end of file diff --git a/src/generated-sdk/capabilities/internal/actionandtrigger/v1/basic_sdk_gen.ts b/src/generated-sdk/capabilities/internal/actionandtrigger/v1/basic_sdk_gen.ts index bae9bff1..9120ebd8 100644 --- a/src/generated-sdk/capabilities/internal/actionandtrigger/v1/basic_sdk_gen.ts +++ b/src/generated-sdk/capabilities/internal/actionandtrigger/v1/basic_sdk_gen.ts @@ -1,115 +1,128 @@ -import { fromBinary, toBinary, fromJson, create } from '@bufbuild/protobuf' -import { Mode, type CapabilityResponse } from '@cre/generated/sdk/v1alpha/sdk_pb' -import { callCapability } from '@cre/sdk/utils/capabilities/call-capability' -import { CapabilityError } from '@cre/sdk/utils/capabilities/capability-error' -import { type Trigger } from '@cre/sdk/utils/triggers/trigger-interface' -import { type Any, AnySchema } from '@bufbuild/protobuf/wkt' -import { getTypeUrl } from '@cre/sdk/utils/typeurl' +import { fromBinary, toBinary, fromJson, create } from "@bufbuild/protobuf"; import { - ConfigSchema, - InputSchema, - OutputSchema, - TriggerEventSchema, - type ConfigJson, - type InputJson, - type Output, - type TriggerEvent, -} from '@cre/generated/capabilities/internal/actionandtrigger/v1/action_and_trigger_pb' + Mode, + type CapabilityResponse, +} from "@cre/generated/sdk/v1alpha/sdk_pb"; +import { callCapability } from "@cre/sdk/utils/capabilities/call-capability"; +import { CapabilityError } from "@cre/sdk/utils/capabilities/capability-error"; +import { type Trigger } from "@cre/sdk/utils/triggers/trigger-interface"; +import { type Any, AnySchema } from "@bufbuild/protobuf/wkt"; +import { getTypeUrl } from "@cre/sdk/utils/typeurl"; +import { + ConfigSchema, + InputSchema, + OutputSchema, + TriggerEventSchema, + type Config, + type ConfigJson, + type Input, + type InputJson, + type Output, + type TriggerEvent, +} from "@cre/generated/capabilities/internal/actionandtrigger/v1/action_and_trigger_pb"; /** * Basic Capability - * + * * Capability ID: basic-test-action-trigger@1.0.0 * Default Mode: Mode.DON * Capability Name: basic-test-action-trigger * Capability Version: 1.0.0 */ export class BasicCapability { - /** The capability ID for this service */ - static readonly CAPABILITY_ID = 'basic-test-action-trigger@1.0.0' - - /** The default execution mode for this capability */ - static readonly DEFAULT_MODE = Mode.DON + /** The capability ID for this service */ + static readonly CAPABILITY_ID = "basic-test-action-trigger@1.0.0"; + + /** The default execution mode for this capability */ + static readonly DEFAULT_MODE = Mode.DON; - static readonly CAPABILITY_NAME = 'basic-test-action-trigger' - static readonly CAPABILITY_VERSION = '1.0.0' + static readonly CAPABILITY_NAME = "basic-test-action-trigger"; + static readonly CAPABILITY_VERSION = "1.0.0"; - constructor(private readonly mode: Mode = BasicCapability.DEFAULT_MODE) {} - async action(input: InputJson): Promise { - const payload = { - typeUrl: getTypeUrl(InputSchema), - value: toBinary(InputSchema, fromJson(InputSchema, input)), - } - const capabilityId = BasicCapability.CAPABILITY_ID + constructor( + private readonly mode: Mode = BasicCapability.DEFAULT_MODE + ) {} - return callCapability({ - capabilityId, - method: 'Action', - mode: this.mode, - payload, - }).then((capabilityResponse: CapabilityResponse) => { - if (capabilityResponse.response.case === 'error') { - throw new CapabilityError(capabilityResponse.response.value, { - capabilityId, - method: 'Action', - mode: this.mode, - }) - } + async action(input: Input | InputJson): Promise { + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + const value = (input as any).$typeName ? input as Input : fromJson(InputSchema, input as InputJson) + const payload = { + typeUrl: getTypeUrl(InputSchema), + value: toBinary(InputSchema, value), + }; + const capabilityId = BasicCapability.CAPABILITY_ID; + + return callCapability({ + capabilityId, + method: "Action", + mode: this.mode, + payload, + }).then((capabilityResponse: CapabilityResponse) => { + if (capabilityResponse.response.case === "error") { + throw new CapabilityError(capabilityResponse.response.value, { + capabilityId, + method: "Action", + mode: this.mode, + }); + } - if (capabilityResponse.response.case !== 'payload') { - throw new CapabilityError('No payload in response', { - capabilityId, - method: 'Action', - mode: this.mode, - }) - } + if (capabilityResponse.response.case !== "payload") { + throw new CapabilityError("No payload in response", { + capabilityId, + method: "Action", + mode: this.mode, + }); + } - return fromBinary(OutputSchema, capabilityResponse.response.value.value) - }) - } + return fromBinary(OutputSchema, capabilityResponse.response.value.value); + }); + } - trigger(config: ConfigJson): BasicTrigger { - return new BasicTrigger(this.mode, config, BasicCapability.CAPABILITY_ID, 'Trigger') - } + trigger(config: ConfigJson): BasicTrigger { + return new BasicTrigger(this.mode, config, BasicCapability.CAPABILITY_ID, "Trigger"); + } } /** * Trigger implementation for Trigger */ class BasicTrigger implements Trigger { - constructor( - public readonly mode: Mode, - public readonly config: ConfigJson, - private readonly _capabilityId: string, - private readonly _method: string, - ) {} + public readonly config: Config + constructor( + public readonly mode: Mode, + config: Config | ConfigJson, + private readonly _capabilityId: string, + private readonly _method: string + ) { + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + this.config = (config as any).$typeName ? config as Config : fromJson(ConfigSchema, config as ConfigJson) + } - capabilityId(): string { - return this._capabilityId - } + capabilityId(): string { + return this._capabilityId; + } - method(): string { - return this._method - } + method(): string { + return this._method; + } - outputSchema() { - return TriggerEventSchema - } + outputSchema() { + return TriggerEventSchema; + } - configAsAny(): Any { - const configMessage = fromJson(ConfigSchema, this.config) - return create(AnySchema, { - typeUrl: getTypeUrl(ConfigSchema), - value: toBinary(ConfigSchema, configMessage), - }) - } + configAsAny(): Any { + return create(AnySchema, { + typeUrl: getTypeUrl(ConfigSchema), + value: toBinary(ConfigSchema, this.config), + }); + } - /** - * Transform the raw trigger output - override this method if needed - * Default implementation returns the raw output unchanged - */ - adapt(rawOutput: TriggerEvent): TriggerEvent { - return rawOutput - } -} + /** + * Transform the raw trigger output - override this method if needed + * Default implementation returns the raw output unchanged + */ + adapt(rawOutput: TriggerEvent): TriggerEvent { + return rawOutput; + } +} \ No newline at end of file diff --git a/src/generated-sdk/capabilities/internal/basicaction/v1/basicaction_sdk_gen.ts b/src/generated-sdk/capabilities/internal/basicaction/v1/basicaction_sdk_gen.ts index aa682a8b..06c5402b 100644 --- a/src/generated-sdk/capabilities/internal/basicaction/v1/basicaction_sdk_gen.ts +++ b/src/generated-sdk/capabilities/internal/basicaction/v1/basicaction_sdk_gen.ts @@ -1,65 +1,74 @@ -import { fromBinary, toBinary, fromJson, create } from '@bufbuild/protobuf' -import { Mode, type CapabilityResponse } from '@cre/generated/sdk/v1alpha/sdk_pb' -import { callCapability } from '@cre/sdk/utils/capabilities/call-capability' -import { CapabilityError } from '@cre/sdk/utils/capabilities/capability-error' -import { getTypeUrl } from '@cre/sdk/utils/typeurl' +import { fromBinary, toBinary, fromJson } from "@bufbuild/protobuf"; import { - InputsSchema, - OutputsSchema, - type InputsJson, - type Outputs, -} from '@cre/generated/capabilities/internal/basicaction/v1/basic_action_pb' + Mode, + type CapabilityResponse, +} from "@cre/generated/sdk/v1alpha/sdk_pb"; +import { callCapability } from "@cre/sdk/utils/capabilities/call-capability"; +import { CapabilityError } from "@cre/sdk/utils/capabilities/capability-error"; +import { getTypeUrl } from "@cre/sdk/utils/typeurl"; +import { + InputsSchema, + OutputsSchema, + type Inputs, + type InputsJson, + type Outputs, +} from "@cre/generated/capabilities/internal/basicaction/v1/basic_action_pb"; /** * BasicAction Capability - * + * * Capability ID: basic-test-action@1.0.0 * Default Mode: Mode.DON * Capability Name: basic-test-action * Capability Version: 1.0.0 */ export class BasicActionCapability { - /** The capability ID for this service */ - static readonly CAPABILITY_ID = 'basic-test-action@1.0.0' - - /** The default execution mode for this capability */ - static readonly DEFAULT_MODE = Mode.DON + /** The capability ID for this service */ + static readonly CAPABILITY_ID = "basic-test-action@1.0.0"; + + /** The default execution mode for this capability */ + static readonly DEFAULT_MODE = Mode.DON; - static readonly CAPABILITY_NAME = 'basic-test-action' - static readonly CAPABILITY_VERSION = '1.0.0' + static readonly CAPABILITY_NAME = "basic-test-action"; + static readonly CAPABILITY_VERSION = "1.0.0"; - constructor(private readonly mode: Mode = BasicActionCapability.DEFAULT_MODE) {} - async performAction(input: InputsJson): Promise { - const payload = { - typeUrl: getTypeUrl(InputsSchema), - value: toBinary(InputsSchema, fromJson(InputsSchema, input)), - } - const capabilityId = BasicActionCapability.CAPABILITY_ID + constructor( + private readonly mode: Mode = BasicActionCapability.DEFAULT_MODE + ) {} - return callCapability({ - capabilityId, - method: 'PerformAction', - mode: this.mode, - payload, - }).then((capabilityResponse: CapabilityResponse) => { - if (capabilityResponse.response.case === 'error') { - throw new CapabilityError(capabilityResponse.response.value, { - capabilityId, - method: 'PerformAction', - mode: this.mode, - }) - } + async performAction(input: Inputs | InputsJson): Promise { + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + const value = (input as any).$typeName ? input as Inputs : fromJson(InputsSchema, input as InputsJson) + const payload = { + typeUrl: getTypeUrl(InputsSchema), + value: toBinary(InputsSchema, value), + }; + const capabilityId = BasicActionCapability.CAPABILITY_ID; + + return callCapability({ + capabilityId, + method: "PerformAction", + mode: this.mode, + payload, + }).then((capabilityResponse: CapabilityResponse) => { + if (capabilityResponse.response.case === "error") { + throw new CapabilityError(capabilityResponse.response.value, { + capabilityId, + method: "PerformAction", + mode: this.mode, + }); + } - if (capabilityResponse.response.case !== 'payload') { - throw new CapabilityError('No payload in response', { - capabilityId, - method: 'PerformAction', - mode: this.mode, - }) - } + if (capabilityResponse.response.case !== "payload") { + throw new CapabilityError("No payload in response", { + capabilityId, + method: "PerformAction", + mode: this.mode, + }); + } - return fromBinary(OutputsSchema, capabilityResponse.response.value.value) - }) - } + return fromBinary(OutputsSchema, capabilityResponse.response.value.value); + }); + } } diff --git a/src/generated-sdk/capabilities/internal/basictrigger/v1/basic_sdk_gen.ts b/src/generated-sdk/capabilities/internal/basictrigger/v1/basic_sdk_gen.ts index 750ddced..be6720c5 100644 --- a/src/generated-sdk/capabilities/internal/basictrigger/v1/basic_sdk_gen.ts +++ b/src/generated-sdk/capabilities/internal/basictrigger/v1/basic_sdk_gen.ts @@ -1,78 +1,88 @@ -import { fromBinary, toBinary, fromJson, create } from '@bufbuild/protobuf' -import { Mode, type CapabilityResponse } from '@cre/generated/sdk/v1alpha/sdk_pb' -import { callCapability } from '@cre/sdk/utils/capabilities/call-capability' -import { CapabilityError } from '@cre/sdk/utils/capabilities/capability-error' -import { type Trigger } from '@cre/sdk/utils/triggers/trigger-interface' -import { type Any, AnySchema } from '@bufbuild/protobuf/wkt' -import { getTypeUrl } from '@cre/sdk/utils/typeurl' +import { fromBinary, toBinary, fromJson, create } from "@bufbuild/protobuf"; import { - ConfigSchema, - OutputsSchema, - type ConfigJson, - type Outputs, -} from '@cre/generated/capabilities/internal/basictrigger/v1/basic_trigger_pb' + Mode, + type CapabilityResponse, +} from "@cre/generated/sdk/v1alpha/sdk_pb"; +import { callCapability } from "@cre/sdk/utils/capabilities/call-capability"; +import { CapabilityError } from "@cre/sdk/utils/capabilities/capability-error"; +import { type Trigger } from "@cre/sdk/utils/triggers/trigger-interface"; +import { type Any, AnySchema } from "@bufbuild/protobuf/wkt"; +import { getTypeUrl } from "@cre/sdk/utils/typeurl"; +import { + ConfigSchema, + OutputsSchema, + type Config, + type ConfigJson, + type Outputs, +} from "@cre/generated/capabilities/internal/basictrigger/v1/basic_trigger_pb"; /** * Basic Capability - * + * * Capability ID: basic-test-trigger@1.0.0 * Default Mode: Mode.DON * Capability Name: basic-test-trigger * Capability Version: 1.0.0 */ export class BasicCapability { - /** The capability ID for this service */ - static readonly CAPABILITY_ID = 'basic-test-trigger@1.0.0' + /** The capability ID for this service */ + static readonly CAPABILITY_ID = "basic-test-trigger@1.0.0"; + + /** The default execution mode for this capability */ + static readonly DEFAULT_MODE = Mode.DON; - /** The default execution mode for this capability */ - static readonly DEFAULT_MODE = Mode.DON + static readonly CAPABILITY_NAME = "basic-test-trigger"; + static readonly CAPABILITY_VERSION = "1.0.0"; - static readonly CAPABILITY_NAME = 'basic-test-trigger' - static readonly CAPABILITY_VERSION = '1.0.0' - constructor(private readonly mode: Mode = BasicCapability.DEFAULT_MODE) {} + constructor( + private readonly mode: Mode = BasicCapability.DEFAULT_MODE + ) {} - trigger(config: ConfigJson): BasicTrigger { - return new BasicTrigger(this.mode, config, BasicCapability.CAPABILITY_ID, 'Trigger') - } + trigger(config: ConfigJson): BasicTrigger { + return new BasicTrigger(this.mode, config, BasicCapability.CAPABILITY_ID, "Trigger"); + } } /** * Trigger implementation for Trigger */ class BasicTrigger implements Trigger { - constructor( - public readonly mode: Mode, - public readonly config: ConfigJson, - private readonly _capabilityId: string, - private readonly _method: string, - ) {} + public readonly config: Config + constructor( + public readonly mode: Mode, + config: Config | ConfigJson, + private readonly _capabilityId: string, + private readonly _method: string + ) { + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + this.config = (config as any).$typeName ? config as Config : fromJson(ConfigSchema, config as ConfigJson) + } - capabilityId(): string { - return this._capabilityId - } + capabilityId(): string { + return this._capabilityId; + } - method(): string { - return this._method - } + method(): string { + return this._method; + } - outputSchema() { - return OutputsSchema - } + outputSchema() { + return OutputsSchema; + } - configAsAny(): Any { - const configMessage = fromJson(ConfigSchema, this.config) - return create(AnySchema, { - typeUrl: getTypeUrl(ConfigSchema), - value: toBinary(ConfigSchema, configMessage), - }) - } + configAsAny(): Any { + return create(AnySchema, { + typeUrl: getTypeUrl(ConfigSchema), + value: toBinary(ConfigSchema, this.config), + }); + } - /** - * Transform the raw trigger output - override this method if needed - * Default implementation returns the raw output unchanged - */ - adapt(rawOutput: Outputs): Outputs { - return rawOutput - } -} + /** + * Transform the raw trigger output - override this method if needed + * Default implementation returns the raw output unchanged + */ + adapt(rawOutput: Outputs): Outputs { + return rawOutput; + } +} \ No newline at end of file diff --git a/src/generated-sdk/capabilities/internal/consensus/v1alpha/consensus_sdk_gen.ts b/src/generated-sdk/capabilities/internal/consensus/v1alpha/consensus_sdk_gen.ts index 9a04845b..6f39fcbe 100644 --- a/src/generated-sdk/capabilities/internal/consensus/v1alpha/consensus_sdk_gen.ts +++ b/src/generated-sdk/capabilities/internal/consensus/v1alpha/consensus_sdk_gen.ts @@ -1,101 +1,116 @@ -import { fromBinary, toBinary, fromJson, create } from '@bufbuild/protobuf' -import { Mode, type CapabilityResponse } from '@cre/generated/sdk/v1alpha/sdk_pb' -import { callCapability } from '@cre/sdk/utils/capabilities/call-capability' -import { CapabilityError } from '@cre/sdk/utils/capabilities/capability-error' -import { getTypeUrl } from '@cre/sdk/utils/typeurl' +import { fromBinary, toBinary, fromJson } from "@bufbuild/protobuf"; import { - ReportRequestSchema, - ReportResponseSchema, - SimpleConsensusInputsSchema, - type ReportRequestJson, - type ReportResponse, - type SimpleConsensusInputsJson, -} from '@cre/generated/sdk/v1alpha/sdk_pb' -import { ValueSchema, type Value } from '@cre/generated/values/v1/values_pb' + Mode, + type CapabilityResponse, +} from "@cre/generated/sdk/v1alpha/sdk_pb"; +import { callCapability } from "@cre/sdk/utils/capabilities/call-capability"; +import { CapabilityError } from "@cre/sdk/utils/capabilities/capability-error"; +import { getTypeUrl } from "@cre/sdk/utils/typeurl"; +import { + ReportRequestSchema, + ReportResponseSchema, + SimpleConsensusInputsSchema, + type ReportRequest, + type ReportRequestJson, + type ReportResponse, + type SimpleConsensusInputs, + type SimpleConsensusInputsJson, +} from "@cre/generated/sdk/v1alpha/sdk_pb"; +import { + ValueSchema, + type Value, +} from "@cre/generated/values/v1/values_pb"; /** * Consensus Capability - * + * * Capability ID: consensus@1.0.0-alpha * Default Mode: Mode.DON * Capability Name: consensus * Capability Version: 1.0.0-alpha */ export class ConsensusCapability { - /** The capability ID for this service */ - static readonly CAPABILITY_ID = 'consensus@1.0.0-alpha' - - /** The default execution mode for this capability */ - static readonly DEFAULT_MODE = Mode.DON - - static readonly CAPABILITY_NAME = 'consensus' - static readonly CAPABILITY_VERSION = '1.0.0-alpha' + /** The capability ID for this service */ + static readonly CAPABILITY_ID = "consensus@1.0.0-alpha"; + + /** The default execution mode for this capability */ + static readonly DEFAULT_MODE = Mode.DON; - constructor(private readonly mode: Mode = ConsensusCapability.DEFAULT_MODE) {} + static readonly CAPABILITY_NAME = "consensus"; + static readonly CAPABILITY_VERSION = "1.0.0-alpha"; - async simple(input: SimpleConsensusInputsJson): Promise { - const payload = { - typeUrl: getTypeUrl(SimpleConsensusInputsSchema), - value: toBinary(SimpleConsensusInputsSchema, fromJson(SimpleConsensusInputsSchema, input)), - } - const capabilityId = ConsensusCapability.CAPABILITY_ID - return callCapability({ - capabilityId, - method: 'Simple', - mode: this.mode, - payload, - }).then((capabilityResponse: CapabilityResponse) => { - if (capabilityResponse.response.case === 'error') { - throw new CapabilityError(capabilityResponse.response.value, { - capabilityId, - method: 'Simple', - mode: this.mode, - }) - } + constructor( + private readonly mode: Mode = ConsensusCapability.DEFAULT_MODE + ) {} - if (capabilityResponse.response.case !== 'payload') { - throw new CapabilityError('No payload in response', { - capabilityId, - method: 'Simple', - mode: this.mode, - }) - } + async simple(input: SimpleConsensusInputs | SimpleConsensusInputsJson): Promise { + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + const value = (input as any).$typeName ? input as SimpleConsensusInputs : fromJson(SimpleConsensusInputsSchema, input as SimpleConsensusInputsJson) + const payload = { + typeUrl: getTypeUrl(SimpleConsensusInputsSchema), + value: toBinary(SimpleConsensusInputsSchema, value), + }; + const capabilityId = ConsensusCapability.CAPABILITY_ID; + + return callCapability({ + capabilityId, + method: "Simple", + mode: this.mode, + payload, + }).then((capabilityResponse: CapabilityResponse) => { + if (capabilityResponse.response.case === "error") { + throw new CapabilityError(capabilityResponse.response.value, { + capabilityId, + method: "Simple", + mode: this.mode, + }); + } - return fromBinary(ValueSchema, capabilityResponse.response.value.value) - }) - } + if (capabilityResponse.response.case !== "payload") { + throw new CapabilityError("No payload in response", { + capabilityId, + method: "Simple", + mode: this.mode, + }); + } - async report(input: ReportRequestJson): Promise { - const payload = { - typeUrl: getTypeUrl(ReportRequestSchema), - value: toBinary(ReportRequestSchema, fromJson(ReportRequestSchema, input)), - } - const capabilityId = ConsensusCapability.CAPABILITY_ID + return fromBinary(ValueSchema, capabilityResponse.response.value.value); + }); + } - return callCapability({ - capabilityId, - method: 'Report', - mode: this.mode, - payload, - }).then((capabilityResponse: CapabilityResponse) => { - if (capabilityResponse.response.case === 'error') { - throw new CapabilityError(capabilityResponse.response.value, { - capabilityId, - method: 'Report', - mode: this.mode, - }) - } + async report(input: ReportRequest | ReportRequestJson): Promise { + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + const value = (input as any).$typeName ? input as ReportRequest : fromJson(ReportRequestSchema, input as ReportRequestJson) + const payload = { + typeUrl: getTypeUrl(ReportRequestSchema), + value: toBinary(ReportRequestSchema, value), + }; + const capabilityId = ConsensusCapability.CAPABILITY_ID; + + return callCapability({ + capabilityId, + method: "Report", + mode: this.mode, + payload, + }).then((capabilityResponse: CapabilityResponse) => { + if (capabilityResponse.response.case === "error") { + throw new CapabilityError(capabilityResponse.response.value, { + capabilityId, + method: "Report", + mode: this.mode, + }); + } - if (capabilityResponse.response.case !== 'payload') { - throw new CapabilityError('No payload in response', { - capabilityId, - method: 'Report', - mode: this.mode, - }) - } + if (capabilityResponse.response.case !== "payload") { + throw new CapabilityError("No payload in response", { + capabilityId, + method: "Report", + mode: this.mode, + }); + } - return fromBinary(ReportResponseSchema, capabilityResponse.response.value.value) - }) - } + return fromBinary(ReportResponseSchema, capabilityResponse.response.value.value); + }); + } } diff --git a/src/generated-sdk/capabilities/internal/nodeaction/v1/basicaction_sdk_gen.ts b/src/generated-sdk/capabilities/internal/nodeaction/v1/basicaction_sdk_gen.ts index 4576570b..8c5152e7 100644 --- a/src/generated-sdk/capabilities/internal/nodeaction/v1/basicaction_sdk_gen.ts +++ b/src/generated-sdk/capabilities/internal/nodeaction/v1/basicaction_sdk_gen.ts @@ -1,65 +1,74 @@ -import { fromBinary, toBinary, fromJson, create } from '@bufbuild/protobuf' -import { Mode, type CapabilityResponse } from '@cre/generated/sdk/v1alpha/sdk_pb' -import { callCapability } from '@cre/sdk/utils/capabilities/call-capability' -import { CapabilityError } from '@cre/sdk/utils/capabilities/capability-error' -import { getTypeUrl } from '@cre/sdk/utils/typeurl' +import { fromBinary, toBinary, fromJson } from "@bufbuild/protobuf"; import { - NodeInputsSchema, - NodeOutputsSchema, - type NodeInputsJson, - type NodeOutputs, -} from '@cre/generated/capabilities/internal/nodeaction/v1/node_action_pb' + Mode, + type CapabilityResponse, +} from "@cre/generated/sdk/v1alpha/sdk_pb"; +import { callCapability } from "@cre/sdk/utils/capabilities/call-capability"; +import { CapabilityError } from "@cre/sdk/utils/capabilities/capability-error"; +import { getTypeUrl } from "@cre/sdk/utils/typeurl"; +import { + NodeInputsSchema, + NodeOutputsSchema, + type NodeInputs, + type NodeInputsJson, + type NodeOutputs, +} from "@cre/generated/capabilities/internal/nodeaction/v1/node_action_pb"; /** * BasicAction Capability - * + * * Capability ID: basic-test-node-action@1.0.0 * Default Mode: Mode.NODE * Capability Name: basic-test-node-action * Capability Version: 1.0.0 */ export class BasicActionCapability { - /** The capability ID for this service */ - static readonly CAPABILITY_ID = 'basic-test-node-action@1.0.0' - - /** The default execution mode for this capability */ - static readonly DEFAULT_MODE = Mode.NODE + /** The capability ID for this service */ + static readonly CAPABILITY_ID = "basic-test-node-action@1.0.0"; + + /** The default execution mode for this capability */ + static readonly DEFAULT_MODE = Mode.NODE; - static readonly CAPABILITY_NAME = 'basic-test-node-action' - static readonly CAPABILITY_VERSION = '1.0.0' + static readonly CAPABILITY_NAME = "basic-test-node-action"; + static readonly CAPABILITY_VERSION = "1.0.0"; - constructor(private readonly mode: Mode = BasicActionCapability.DEFAULT_MODE) {} - async performAction(input: NodeInputsJson): Promise { - const payload = { - typeUrl: getTypeUrl(NodeInputsSchema), - value: toBinary(NodeInputsSchema, fromJson(NodeInputsSchema, input)), - } - const capabilityId = BasicActionCapability.CAPABILITY_ID + constructor( + private readonly mode: Mode = BasicActionCapability.DEFAULT_MODE + ) {} - return callCapability({ - capabilityId, - method: 'PerformAction', - mode: this.mode, - payload, - }).then((capabilityResponse: CapabilityResponse) => { - if (capabilityResponse.response.case === 'error') { - throw new CapabilityError(capabilityResponse.response.value, { - capabilityId, - method: 'PerformAction', - mode: this.mode, - }) - } + async performAction(input: NodeInputs | NodeInputsJson): Promise { + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + const value = (input as any).$typeName ? input as NodeInputs : fromJson(NodeInputsSchema, input as NodeInputsJson) + const payload = { + typeUrl: getTypeUrl(NodeInputsSchema), + value: toBinary(NodeInputsSchema, value), + }; + const capabilityId = BasicActionCapability.CAPABILITY_ID; + + return callCapability({ + capabilityId, + method: "PerformAction", + mode: this.mode, + payload, + }).then((capabilityResponse: CapabilityResponse) => { + if (capabilityResponse.response.case === "error") { + throw new CapabilityError(capabilityResponse.response.value, { + capabilityId, + method: "PerformAction", + mode: this.mode, + }); + } - if (capabilityResponse.response.case !== 'payload') { - throw new CapabilityError('No payload in response', { - capabilityId, - method: 'PerformAction', - mode: this.mode, - }) - } + if (capabilityResponse.response.case !== "payload") { + throw new CapabilityError("No payload in response", { + capabilityId, + method: "PerformAction", + mode: this.mode, + }); + } - return fromBinary(NodeOutputsSchema, capabilityResponse.response.value.value) - }) - } + return fromBinary(NodeOutputsSchema, capabilityResponse.response.value.value); + }); + } } diff --git a/src/generated-sdk/capabilities/networking/http/v1alpha/client_sdk_gen.ts b/src/generated-sdk/capabilities/networking/http/v1alpha/client_sdk_gen.ts index f7ae7b3b..2b582c2b 100644 --- a/src/generated-sdk/capabilities/networking/http/v1alpha/client_sdk_gen.ts +++ b/src/generated-sdk/capabilities/networking/http/v1alpha/client_sdk_gen.ts @@ -1,65 +1,74 @@ -import { fromBinary, toBinary, fromJson, create } from '@bufbuild/protobuf' -import { Mode, type CapabilityResponse } from '@cre/generated/sdk/v1alpha/sdk_pb' -import { callCapability } from '@cre/sdk/utils/capabilities/call-capability' -import { CapabilityError } from '@cre/sdk/utils/capabilities/capability-error' -import { getTypeUrl } from '@cre/sdk/utils/typeurl' +import { fromBinary, toBinary, fromJson } from "@bufbuild/protobuf"; import { - RequestSchema, - ResponseSchema, - type RequestJson, - type Response, -} from '@cre/generated/capabilities/networking/http/v1alpha/client_pb' + Mode, + type CapabilityResponse, +} from "@cre/generated/sdk/v1alpha/sdk_pb"; +import { callCapability } from "@cre/sdk/utils/capabilities/call-capability"; +import { CapabilityError } from "@cre/sdk/utils/capabilities/capability-error"; +import { getTypeUrl } from "@cre/sdk/utils/typeurl"; +import { + RequestSchema, + ResponseSchema, + type Request, + type RequestJson, + type Response, +} from "@cre/generated/capabilities/networking/http/v1alpha/client_pb"; /** * Client Capability - * + * * Capability ID: http-actions@1.0.0-alpha * Default Mode: Mode.NODE * Capability Name: http-actions * Capability Version: 1.0.0-alpha */ export class ClientCapability { - /** The capability ID for this service */ - static readonly CAPABILITY_ID = 'http-actions@1.0.0-alpha' - - /** The default execution mode for this capability */ - static readonly DEFAULT_MODE = Mode.NODE + /** The capability ID for this service */ + static readonly CAPABILITY_ID = "http-actions@1.0.0-alpha"; + + /** The default execution mode for this capability */ + static readonly DEFAULT_MODE = Mode.NODE; - static readonly CAPABILITY_NAME = 'http-actions' - static readonly CAPABILITY_VERSION = '1.0.0-alpha' + static readonly CAPABILITY_NAME = "http-actions"; + static readonly CAPABILITY_VERSION = "1.0.0-alpha"; - constructor(private readonly mode: Mode = ClientCapability.DEFAULT_MODE) {} - async sendRequest(input: RequestJson): Promise { - const payload = { - typeUrl: getTypeUrl(RequestSchema), - value: toBinary(RequestSchema, fromJson(RequestSchema, input)), - } - const capabilityId = ClientCapability.CAPABILITY_ID + constructor( + private readonly mode: Mode = ClientCapability.DEFAULT_MODE + ) {} - return callCapability({ - capabilityId, - method: 'SendRequest', - mode: this.mode, - payload, - }).then((capabilityResponse: CapabilityResponse) => { - if (capabilityResponse.response.case === 'error') { - throw new CapabilityError(capabilityResponse.response.value, { - capabilityId, - method: 'SendRequest', - mode: this.mode, - }) - } + async sendRequest(input: Request | RequestJson): Promise { + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + const value = (input as any).$typeName ? input as Request : fromJson(RequestSchema, input as RequestJson) + const payload = { + typeUrl: getTypeUrl(RequestSchema), + value: toBinary(RequestSchema, value), + }; + const capabilityId = ClientCapability.CAPABILITY_ID; + + return callCapability({ + capabilityId, + method: "SendRequest", + mode: this.mode, + payload, + }).then((capabilityResponse: CapabilityResponse) => { + if (capabilityResponse.response.case === "error") { + throw new CapabilityError(capabilityResponse.response.value, { + capabilityId, + method: "SendRequest", + mode: this.mode, + }); + } - if (capabilityResponse.response.case !== 'payload') { - throw new CapabilityError('No payload in response', { - capabilityId, - method: 'SendRequest', - mode: this.mode, - }) - } + if (capabilityResponse.response.case !== "payload") { + throw new CapabilityError("No payload in response", { + capabilityId, + method: "SendRequest", + mode: this.mode, + }); + } - return fromBinary(ResponseSchema, capabilityResponse.response.value.value) - }) - } + return fromBinary(ResponseSchema, capabilityResponse.response.value.value); + }); + } } diff --git a/src/generated-sdk/capabilities/networking/http/v1alpha/http_sdk_gen.ts b/src/generated-sdk/capabilities/networking/http/v1alpha/http_sdk_gen.ts index 0369e1fd..941e13ea 100644 --- a/src/generated-sdk/capabilities/networking/http/v1alpha/http_sdk_gen.ts +++ b/src/generated-sdk/capabilities/networking/http/v1alpha/http_sdk_gen.ts @@ -1,78 +1,88 @@ -import { fromBinary, toBinary, fromJson, create } from '@bufbuild/protobuf' -import { Mode, type CapabilityResponse } from '@cre/generated/sdk/v1alpha/sdk_pb' -import { callCapability } from '@cre/sdk/utils/capabilities/call-capability' -import { CapabilityError } from '@cre/sdk/utils/capabilities/capability-error' -import { type Trigger } from '@cre/sdk/utils/triggers/trigger-interface' -import { type Any, AnySchema } from '@bufbuild/protobuf/wkt' -import { getTypeUrl } from '@cre/sdk/utils/typeurl' +import { fromBinary, toBinary, fromJson, create } from "@bufbuild/protobuf"; import { - ConfigSchema, - PayloadSchema, - type ConfigJson, - type Payload, -} from '@cre/generated/capabilities/networking/http/v1alpha/trigger_pb' + Mode, + type CapabilityResponse, +} from "@cre/generated/sdk/v1alpha/sdk_pb"; +import { callCapability } from "@cre/sdk/utils/capabilities/call-capability"; +import { CapabilityError } from "@cre/sdk/utils/capabilities/capability-error"; +import { type Trigger } from "@cre/sdk/utils/triggers/trigger-interface"; +import { type Any, AnySchema } from "@bufbuild/protobuf/wkt"; +import { getTypeUrl } from "@cre/sdk/utils/typeurl"; +import { + ConfigSchema, + PayloadSchema, + type Config, + type ConfigJson, + type Payload, +} from "@cre/generated/capabilities/networking/http/v1alpha/trigger_pb"; /** * HTTP Capability - * + * * Capability ID: http-trigger@1.0.0-alpha * Default Mode: Mode.DON * Capability Name: http-trigger * Capability Version: 1.0.0-alpha */ export class HTTPCapability { - /** The capability ID for this service */ - static readonly CAPABILITY_ID = 'http-trigger@1.0.0-alpha' + /** The capability ID for this service */ + static readonly CAPABILITY_ID = "http-trigger@1.0.0-alpha"; + + /** The default execution mode for this capability */ + static readonly DEFAULT_MODE = Mode.DON; - /** The default execution mode for this capability */ - static readonly DEFAULT_MODE = Mode.DON + static readonly CAPABILITY_NAME = "http-trigger"; + static readonly CAPABILITY_VERSION = "1.0.0-alpha"; - static readonly CAPABILITY_NAME = 'http-trigger' - static readonly CAPABILITY_VERSION = '1.0.0-alpha' - constructor(private readonly mode: Mode = HTTPCapability.DEFAULT_MODE) {} + constructor( + private readonly mode: Mode = HTTPCapability.DEFAULT_MODE + ) {} - trigger(config: ConfigJson): HTTPTrigger { - return new HTTPTrigger(this.mode, config, HTTPCapability.CAPABILITY_ID, 'Trigger') - } + trigger(config: ConfigJson): HTTPTrigger { + return new HTTPTrigger(this.mode, config, HTTPCapability.CAPABILITY_ID, "Trigger"); + } } /** * Trigger implementation for Trigger */ class HTTPTrigger implements Trigger { - constructor( - public readonly mode: Mode, - public readonly config: ConfigJson, - private readonly _capabilityId: string, - private readonly _method: string, - ) {} + public readonly config: Config + constructor( + public readonly mode: Mode, + config: Config | ConfigJson, + private readonly _capabilityId: string, + private readonly _method: string + ) { + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + this.config = (config as any).$typeName ? config as Config : fromJson(ConfigSchema, config as ConfigJson) + } - capabilityId(): string { - return this._capabilityId - } + capabilityId(): string { + return this._capabilityId; + } - method(): string { - return this._method - } + method(): string { + return this._method; + } - outputSchema() { - return PayloadSchema - } + outputSchema() { + return PayloadSchema; + } - configAsAny(): Any { - const configMessage = fromJson(ConfigSchema, this.config) - return create(AnySchema, { - typeUrl: getTypeUrl(ConfigSchema), - value: toBinary(ConfigSchema, configMessage), - }) - } + configAsAny(): Any { + return create(AnySchema, { + typeUrl: getTypeUrl(ConfigSchema), + value: toBinary(ConfigSchema, this.config), + }); + } - /** - * Transform the raw trigger output - override this method if needed - * Default implementation returns the raw output unchanged - */ - adapt(rawOutput: Payload): Payload { - return rawOutput - } -} + /** + * Transform the raw trigger output - override this method if needed + * Default implementation returns the raw output unchanged + */ + adapt(rawOutput: Payload): Payload { + return rawOutput; + } +} \ No newline at end of file diff --git a/src/generated-sdk/capabilities/scheduler/cron/v1/cron_sdk_gen.ts b/src/generated-sdk/capabilities/scheduler/cron/v1/cron_sdk_gen.ts index 8f1b53fa..9ca63a61 100644 --- a/src/generated-sdk/capabilities/scheduler/cron/v1/cron_sdk_gen.ts +++ b/src/generated-sdk/capabilities/scheduler/cron/v1/cron_sdk_gen.ts @@ -1,80 +1,90 @@ -import { fromBinary, toBinary, fromJson, create } from '@bufbuild/protobuf' -import { Mode, type CapabilityResponse } from '@cre/generated/sdk/v1alpha/sdk_pb' -import { callCapability } from '@cre/sdk/utils/capabilities/call-capability' -import { CapabilityError } from '@cre/sdk/utils/capabilities/capability-error' -import { type Trigger } from '@cre/sdk/utils/triggers/trigger-interface' -import { type Any, AnySchema } from '@bufbuild/protobuf/wkt' -import { getTypeUrl } from '@cre/sdk/utils/typeurl' +import { fromBinary, toBinary, fromJson, create } from "@bufbuild/protobuf"; import { - ConfigSchema, - LegacyPayloadSchema, - PayloadSchema, - type ConfigJson, - type LegacyPayload, - type Payload, -} from '@cre/generated/capabilities/scheduler/cron/v1/trigger_pb' + Mode, + type CapabilityResponse, +} from "@cre/generated/sdk/v1alpha/sdk_pb"; +import { callCapability } from "@cre/sdk/utils/capabilities/call-capability"; +import { CapabilityError } from "@cre/sdk/utils/capabilities/capability-error"; +import { type Trigger } from "@cre/sdk/utils/triggers/trigger-interface"; +import { type Any, AnySchema } from "@bufbuild/protobuf/wkt"; +import { getTypeUrl } from "@cre/sdk/utils/typeurl"; +import { + ConfigSchema, + LegacyPayloadSchema, + PayloadSchema, + type Config, + type ConfigJson, + type LegacyPayload, + type Payload, +} from "@cre/generated/capabilities/scheduler/cron/v1/trigger_pb"; /** * Cron Capability - * + * * Capability ID: cron-trigger@1.0.0 * Default Mode: Mode.DON * Capability Name: cron-trigger * Capability Version: 1.0.0 */ export class CronCapability { - /** The capability ID for this service */ - static readonly CAPABILITY_ID = 'cron-trigger@1.0.0' + /** The capability ID for this service */ + static readonly CAPABILITY_ID = "cron-trigger@1.0.0"; + + /** The default execution mode for this capability */ + static readonly DEFAULT_MODE = Mode.DON; - /** The default execution mode for this capability */ - static readonly DEFAULT_MODE = Mode.DON + static readonly CAPABILITY_NAME = "cron-trigger"; + static readonly CAPABILITY_VERSION = "1.0.0"; - static readonly CAPABILITY_NAME = 'cron-trigger' - static readonly CAPABILITY_VERSION = '1.0.0' - constructor(private readonly mode: Mode = CronCapability.DEFAULT_MODE) {} + constructor( + private readonly mode: Mode = CronCapability.DEFAULT_MODE + ) {} - trigger(config: ConfigJson): CronTrigger { - return new CronTrigger(this.mode, config, CronCapability.CAPABILITY_ID, 'Trigger') - } + trigger(config: ConfigJson): CronTrigger { + return new CronTrigger(this.mode, config, CronCapability.CAPABILITY_ID, "Trigger"); + } } /** * Trigger implementation for Trigger */ class CronTrigger implements Trigger { - constructor( - public readonly mode: Mode, - public readonly config: ConfigJson, - private readonly _capabilityId: string, - private readonly _method: string, - ) {} + public readonly config: Config + constructor( + public readonly mode: Mode, + config: Config | ConfigJson, + private readonly _capabilityId: string, + private readonly _method: string + ) { + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + this.config = (config as any).$typeName ? config as Config : fromJson(ConfigSchema, config as ConfigJson) + } - capabilityId(): string { - return this._capabilityId - } + capabilityId(): string { + return this._capabilityId; + } - method(): string { - return this._method - } + method(): string { + return this._method; + } - outputSchema() { - return PayloadSchema - } + outputSchema() { + return PayloadSchema; + } - configAsAny(): Any { - const configMessage = fromJson(ConfigSchema, this.config) - return create(AnySchema, { - typeUrl: getTypeUrl(ConfigSchema), - value: toBinary(ConfigSchema, configMessage), - }) - } + configAsAny(): Any { + return create(AnySchema, { + typeUrl: getTypeUrl(ConfigSchema), + value: toBinary(ConfigSchema, this.config), + }); + } - /** - * Transform the raw trigger output - override this method if needed - * Default implementation returns the raw output unchanged - */ - adapt(rawOutput: Payload): Payload { - return rawOutput - } -} + /** + * Transform the raw trigger output - override this method if needed + * Default implementation returns the raw output unchanged + */ + adapt(rawOutput: Payload): Payload { + return rawOutput; + } +} \ No newline at end of file diff --git a/src/generated/capabilities/blockchain/evm/v1alpha/client_pb.ts b/src/generated/capabilities/blockchain/evm/v1alpha/client_pb.ts index 1a1cefca..8832aa19 100644 --- a/src/generated/capabilities/blockchain/evm/v1alpha/client_pb.ts +++ b/src/generated/capabilities/blockchain/evm/v1alpha/client_pb.ts @@ -2,135 +2,122 @@ // @generated from file capabilities/blockchain/evm/v1alpha/client.proto (package capabilities.blockchain.evm.v1alpha, syntax proto3) /* eslint-disable */ -import type { GenEnum, GenFile, GenMessage, GenService } from '@bufbuild/protobuf/codegenv2' -import { enumDesc, fileDesc, messageDesc, serviceDesc } from '@bufbuild/protobuf/codegenv2' -import type { EmptySchema } from '@bufbuild/protobuf/wkt' -import { file_google_protobuf_empty } from '@bufbuild/protobuf/wkt' -import type { ReportResponse, ReportResponseJson } from '../../../../sdk/v1alpha/sdk_pb' -import { file_sdk_v1alpha_sdk } from '../../../../sdk/v1alpha/sdk_pb' -import { file_tools_generator_v1alpha_cre_metadata } from '../../../../tools/generator/v1alpha/cre_metadata_pb' -import type { BigInt, BigIntJson } from '../../../../values/v1/values_pb' -import { file_values_v1_values } from '../../../../values/v1/values_pb' -import type { Message } from '@bufbuild/protobuf' +import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; +import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import type { EmptySchema } from "@bufbuild/protobuf/wkt"; +import { file_google_protobuf_empty } from "@bufbuild/protobuf/wkt"; +import type { ReportResponse, ReportResponseJson } from "../../../../sdk/v1alpha/sdk_pb"; +import { file_sdk_v1alpha_sdk } from "../../../../sdk/v1alpha/sdk_pb"; +import { file_tools_generator_v1alpha_cre_metadata } from "../../../../tools/generator/v1alpha/cre_metadata_pb"; +import type { BigInt, BigIntJson } from "../../../../values/v1/values_pb"; +import { file_values_v1_values } from "../../../../values/v1/values_pb"; +import type { Message } from "@bufbuild/protobuf"; /** * Describes the file capabilities/blockchain/evm/v1alpha/client.proto. */ -export const file_capabilities_blockchain_evm_v1alpha_client: GenFile = - /*@__PURE__*/ - fileDesc( - 'CjBjYXBhYmlsaXRpZXMvYmxvY2tjaGFpbi9ldm0vdjFhbHBoYS9jbGllbnQucHJvdG8SI2NhcGFiaWxpdGllcy5ibG9ja2NoYWluLmV2bS52MWFscGhhIh0KC1RvcGljVmFsdWVzEg4KBnZhbHVlcxgBIAMoDCK4AQoXRmlsdGVyTG9nVHJpZ2dlclJlcXVlc3QSEQoJYWRkcmVzc2VzGAEgAygMEkAKBnRvcGljcxgCIAMoCzIwLmNhcGFiaWxpdGllcy5ibG9ja2NoYWluLmV2bS52MWFscGhhLlRvcGljVmFsdWVzEkgKCmNvbmZpZGVuY2UYAyABKA4yNC5jYXBhYmlsaXRpZXMuYmxvY2tjaGFpbi5ldm0udjFhbHBoYS5Db25maWRlbmNlTGV2ZWwiegoTQ2FsbENvbnRyYWN0UmVxdWVzdBI6CgRjYWxsGAEgASgLMiwuY2FwYWJpbGl0aWVzLmJsb2NrY2hhaW4uZXZtLnYxYWxwaGEuQ2FsbE1zZxInCgxibG9ja19udW1iZXIYAiABKAsyES52YWx1ZXMudjEuQmlnSW50IiEKEUNhbGxDb250cmFjdFJlcGx5EgwKBGRhdGEYASABKAwiWwoRRmlsdGVyTG9nc1JlcXVlc3QSRg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kz7KmwkUKJwobZXRoZXJldW0tbWFpbm5ldC1hcmJpdHJ1bS0xEMTojc2Om6HXRAonChtldGhlcmV1bS1tYWlubmV0LW9wdGltaXNtLTEQuJWPw/f+0OkzCiUKGGV0aGVyZXVtLXRlc3RuZXQtc2Vwb2xpYRDZteTO/MnuoN4BCi8KI2V0aGVyZXVtLXRlc3RuZXQtc2Vwb2xpYS1hcmJpdHJ1bS0xEOrO7v/qtoSjMAosCh9ldGhlcmV1bS10ZXN0bmV0LXNlcG9saWEtYmFzZS0xELjKue/2kK7IjwEKLwojZXRoZXJldW0tdGVzdG5ldC1zZXBvbGlhLW9wdGltaXNtLTEQn4bFob7Yw8BIChsKD3BvbHlnb24tbWFpbm5ldBCxq+TwmpKGnTgKIQoUcG9seWdvbi10ZXN0bmV0LWFtb3kQzY/W3/HHkPrhAULlAQonY29tLmNhcGFiaWxpdGllcy5ibG9ja2NoYWluLmV2bS52MWFscGhhQgtDbGllbnRQcm90b1ABogIDQ0JFqgIjQ2FwYWJpbGl0aWVzLkJsb2NrY2hhaW4uRXZtLlYxYWxwaGHKAiNDYXBhYmlsaXRpZXNcQmxvY2tjaGFpblxFdm1cVjFhbHBoYeICL0NhcGFiaWxpdGllc1xCbG9ja2NoYWluXEV2bVxWMWFscGhhXEdQQk1ldGFkYXRh6gImQ2FwYWJpbGl0aWVzOjpCbG9ja2NoYWluOjpFdm06OlYxYWxwaGFiBnByb3RvMw', - [ - file_google_protobuf_empty, - file_sdk_v1alpha_sdk, - file_tools_generator_v1alpha_cre_metadata, - file_values_v1_values, - ], - ) +export const file_capabilities_blockchain_evm_v1alpha_client: GenFile = /*@__PURE__*/ + fileDesc("CjBjYXBhYmlsaXRpZXMvYmxvY2tjaGFpbi9ldm0vdjFhbHBoYS9jbGllbnQucHJvdG8SI2NhcGFiaWxpdGllcy5ibG9ja2NoYWluLmV2bS52MWFscGhhIh0KC1RvcGljVmFsdWVzEg4KBnZhbHVlcxgBIAMoDCK4AQoXRmlsdGVyTG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mlsaXRpZXNcQmxvY2tjaGFpblxFdm1cVjFhbHBoYeICL0NhcGFiaWxpdGllc1xCbG9ja2NoYWluXEV2bVxWMWFscGhhXEdQQk1ldGFkYXRh6gImQ2FwYWJpbGl0aWVzOjpCbG9ja2NoYWluOjpFdm06OlYxYWxwaGFiBnByb3RvMw", [file_google_protobuf_empty, file_sdk_v1alpha_sdk, file_tools_generator_v1alpha_cre_metadata, file_values_v1_values]); /** * @generated from message capabilities.blockchain.evm.v1alpha.TopicValues */ -export type TopicValues = Message<'capabilities.blockchain.evm.v1alpha.TopicValues'> & { - /** - * list of possible values for any topic, in [32]byte fix-sized array format - * - * @generated from field: repeated bytes values = 1; - */ - values: Uint8Array[] -} +export type TopicValues = Message<"capabilities.blockchain.evm.v1alpha.TopicValues"> & { + /** + * list of possible values for any topic, in [32]byte fix-sized array format + * + * @generated from field: repeated bytes values = 1; + */ + values: Uint8Array[]; +}; /** * @generated from message capabilities.blockchain.evm.v1alpha.TopicValues */ export type TopicValuesJson = { - /** - * list of possible values for any topic, in [32]byte fix-sized array format - * - * @generated from field: repeated bytes values = 1; - */ - values?: string[] -} + /** + * list of possible values for any topic, in [32]byte fix-sized array format + * + * @generated from field: repeated bytes values = 1; + */ + values?: string[]; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.TopicValues. * Use `create(TopicValuesSchema)` to create a new message. */ -export const TopicValuesSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 0) +export const TopicValuesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 0); /** * @generated from message capabilities.blockchain.evm.v1alpha.FilterLogTriggerRequest */ -export type FilterLogTriggerRequest = - Message<'capabilities.blockchain.evm.v1alpha.FilterLogTriggerRequest'> & { - /** - * list of addresses to include in evm address [20]byte fix-sized array format, at least one address is required - * - * @generated from field: repeated bytes addresses = 1; - */ - addresses: Uint8Array[] - - /** - * - * TopicValues is a fixed 4 length array of possible values for any topic where: - * a) the first element is an array of the event signatures (keccak256 of the event name and indexed args types), it has to have at least one value - * b) the second element is an array of possible values for the first indexed argument, can be empty - * c) the third element is an array of possible values for the second indexed argument, can be empty - * d) the fourth element is an array of possible values for the third indexed argument, can be empty - * - * @generated from field: repeated capabilities.blockchain.evm.v1alpha.TopicValues topics = 2; - */ - topics: TopicValues[] - - /** - * optional, defaults to "SAFE" - * - * @generated from field: capabilities.blockchain.evm.v1alpha.ConfidenceLevel confidence = 3; - */ - confidence: ConfidenceLevel - } +export type FilterLogTriggerRequest = Message<"capabilities.blockchain.evm.v1alpha.FilterLogTriggerRequest"> & { + /** + * list of addresses to include in evm address [20]byte fix-sized array format, at least one address is required + * + * @generated from field: repeated bytes addresses = 1; + */ + addresses: Uint8Array[]; + + /** + * + * TopicValues is a fixed 4 length array of possible values for any topic where: + * a) the first element is an array of the event signatures (keccak256 of the event name and indexed args types), it has to have at least one value + * b) the second element is an array of possible values for the first indexed argument, can be empty + * c) the third element is an array of possible values for the second indexed argument, can be empty + * d) the fourth element is an array of possible values for the third indexed argument, can be empty + * + * @generated from field: repeated capabilities.blockchain.evm.v1alpha.TopicValues topics = 2; + */ + topics: TopicValues[]; + + /** + * optional, defaults to "SAFE" + * + * @generated from field: capabilities.blockchain.evm.v1alpha.ConfidenceLevel confidence = 3; + */ + confidence: ConfidenceLevel; +}; /** * @generated from message capabilities.blockchain.evm.v1alpha.FilterLogTriggerRequest */ export type FilterLogTriggerRequestJson = { - /** - * list of addresses to include in evm address [20]byte fix-sized array format, at least one address is required - * - * @generated from field: repeated bytes addresses = 1; - */ - addresses?: string[] - - /** - * - * TopicValues is a fixed 4 length array of possible values for any topic where: - * a) the first element is an array of the event signatures (keccak256 of the event name and indexed args types), it has to have at least one value - * b) the second element is an array of possible values for the first indexed argument, can be empty - * c) the third element is an array of possible values for the second indexed argument, can be empty - * d) the fourth element is an array of possible values for the third indexed argument, can be empty - * - * @generated from field: repeated capabilities.blockchain.evm.v1alpha.TopicValues topics = 2; - */ - topics?: TopicValuesJson[] - - /** - * optional, defaults to "SAFE" - * - * @generated from field: capabilities.blockchain.evm.v1alpha.ConfidenceLevel confidence = 3; - */ - confidence?: ConfidenceLevelJson -} + /** + * list of addresses to include in evm address [20]byte fix-sized array format, at least one address is required + * + * @generated from field: repeated bytes addresses = 1; + */ + addresses?: string[]; + + /** + * + * TopicValues is a fixed 4 length array of possible values for any topic where: + * a) the first element is an array of the event signatures (keccak256 of the event name and indexed args types), it has to have at least one value + * b) the second element is an array of possible values for the first indexed argument, can be empty + * c) the third element is an array of possible values for the second indexed argument, can be empty + * d) the fourth element is an array of possible values for the third indexed argument, can be empty + * + * @generated from field: repeated capabilities.blockchain.evm.v1alpha.TopicValues topics = 2; + */ + topics?: TopicValuesJson[]; + + /** + * optional, defaults to "SAFE" + * + * @generated from field: capabilities.blockchain.evm.v1alpha.ConfidenceLevel confidence = 3; + */ + confidence?: ConfidenceLevelJson; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.FilterLogTriggerRequest. * Use `create(FilterLogTriggerRequestSchema)` to create a new message. */ -export const FilterLogTriggerRequestSchema: GenMessage< - FilterLogTriggerRequest, - { jsonType: FilterLogTriggerRequestJson } -> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 1) +export const FilterLogTriggerRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 1); /** * CallContractRequest has arguments for reading a contract as specified in the call message at a block height defined by blockNumber where: @@ -142,18 +129,17 @@ export const FilterLogTriggerRequestSchema: GenMessage< * * @generated from message capabilities.blockchain.evm.v1alpha.CallContractRequest */ -export type CallContractRequest = - Message<'capabilities.blockchain.evm.v1alpha.CallContractRequest'> & { - /** - * @generated from field: capabilities.blockchain.evm.v1alpha.CallMsg call = 1; - */ - call?: CallMsg +export type CallContractRequest = Message<"capabilities.blockchain.evm.v1alpha.CallContractRequest"> & { + /** + * @generated from field: capabilities.blockchain.evm.v1alpha.CallMsg call = 1; + */ + call?: CallMsg; - /** - * @generated from field: values.v1.BigInt block_number = 2; - */ - blockNumber?: BigInt - } + /** + * @generated from field: values.v1.BigInt block_number = 2; + */ + blockNumber?: BigInt; +}; /** * CallContractRequest has arguments for reading a contract as specified in the call message at a block height defined by blockNumber where: @@ -166,192 +152,185 @@ export type CallContractRequest = * @generated from message capabilities.blockchain.evm.v1alpha.CallContractRequest */ export type CallContractRequestJson = { - /** - * @generated from field: capabilities.blockchain.evm.v1alpha.CallMsg call = 1; - */ - call?: CallMsgJson - - /** - * @generated from field: values.v1.BigInt block_number = 2; - */ - blockNumber?: BigIntJson -} + /** + * @generated from field: capabilities.blockchain.evm.v1alpha.CallMsg call = 1; + */ + call?: CallMsgJson; + + /** + * @generated from field: values.v1.BigInt block_number = 2; + */ + blockNumber?: BigIntJson; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.CallContractRequest. * Use `create(CallContractRequestSchema)` to create a new message. */ -export const CallContractRequestSchema: GenMessage< - CallContractRequest, - { jsonType: CallContractRequestJson } -> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 2) +export const CallContractRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 2); /** * @generated from message capabilities.blockchain.evm.v1alpha.CallContractReply */ -export type CallContractReply = Message<'capabilities.blockchain.evm.v1alpha.CallContractReply'> & { - /** - * solidity-spec abi encoded bytes - * - * @generated from field: bytes data = 1; - */ - data: Uint8Array -} +export type CallContractReply = Message<"capabilities.blockchain.evm.v1alpha.CallContractReply"> & { + /** + * solidity-spec abi encoded bytes + * + * @generated from field: bytes data = 1; + */ + data: Uint8Array; +}; /** * @generated from message capabilities.blockchain.evm.v1alpha.CallContractReply */ export type CallContractReplyJson = { - /** - * solidity-spec abi encoded bytes - * - * @generated from field: bytes data = 1; - */ - data?: string -} + /** + * solidity-spec abi encoded bytes + * + * @generated from field: bytes data = 1; + */ + data?: string; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.CallContractReply. * Use `create(CallContractReplySchema)` to create a new message. */ -export const CallContractReplySchema: GenMessage< - CallContractReply, - { jsonType: CallContractReplyJson } -> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 3) +export const CallContractReplySchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 3); /** * @generated from message capabilities.blockchain.evm.v1alpha.FilterLogsRequest */ -export type FilterLogsRequest = Message<'capabilities.blockchain.evm.v1alpha.FilterLogsRequest'> & { - /** - * @generated from field: capabilities.blockchain.evm.v1alpha.FilterQuery filter_query = 1; - */ - filterQuery?: FilterQuery -} +export type FilterLogsRequest = Message<"capabilities.blockchain.evm.v1alpha.FilterLogsRequest"> & { + /** + * @generated from field: capabilities.blockchain.evm.v1alpha.FilterQuery filter_query = 1; + */ + filterQuery?: FilterQuery; +}; /** * @generated from message capabilities.blockchain.evm.v1alpha.FilterLogsRequest */ export type FilterLogsRequestJson = { - /** - * @generated from field: capabilities.blockchain.evm.v1alpha.FilterQuery filter_query = 1; - */ - filterQuery?: FilterQueryJson -} + /** + * @generated from field: capabilities.blockchain.evm.v1alpha.FilterQuery filter_query = 1; + */ + filterQuery?: FilterQueryJson; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.FilterLogsRequest. * Use `create(FilterLogsRequestSchema)` to create a new message. */ -export const FilterLogsRequestSchema: GenMessage< - FilterLogsRequest, - { jsonType: FilterLogsRequestJson } -> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 4) +export const FilterLogsRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 4); /** * @generated from message capabilities.blockchain.evm.v1alpha.FilterLogsReply */ -export type FilterLogsReply = Message<'capabilities.blockchain.evm.v1alpha.FilterLogsReply'> & { - /** - * @generated from field: repeated capabilities.blockchain.evm.v1alpha.Log logs = 1; - */ - logs: Log[] -} +export type FilterLogsReply = Message<"capabilities.blockchain.evm.v1alpha.FilterLogsReply"> & { + /** + * @generated from field: repeated capabilities.blockchain.evm.v1alpha.Log logs = 1; + */ + logs: Log[]; +}; /** * @generated from message capabilities.blockchain.evm.v1alpha.FilterLogsReply */ export type FilterLogsReplyJson = { - /** - * @generated from field: repeated capabilities.blockchain.evm.v1alpha.Log logs = 1; - */ - logs?: LogJson[] -} + /** + * @generated from field: repeated capabilities.blockchain.evm.v1alpha.Log logs = 1; + */ + logs?: LogJson[]; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.FilterLogsReply. * Use `create(FilterLogsReplySchema)` to create a new message. */ -export const FilterLogsReplySchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 5) +export const FilterLogsReplySchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 5); /** * represents evm-style log * * @generated from message capabilities.blockchain.evm.v1alpha.Log */ -export type Log = Message<'capabilities.blockchain.evm.v1alpha.Log'> & { - /** - * address of the contract emitted the log in evm address [20]byte fix-sized array format - * - * @generated from field: bytes address = 1; - */ - address: Uint8Array - - /** - * indexed log fields, in [32]byte fix-sized array format - * - * @generated from field: repeated bytes topics = 2; - */ - topics: Uint8Array[] - - /** - * hash of the transaction containing the log, in [32]byte fix-sized array format - * - * @generated from field: bytes tx_hash = 3; - */ - txHash: Uint8Array - - /** - * hash of the block containing the log, in [32]byte fix-sized array format - * - * @generated from field: bytes block_hash = 4; - */ - blockHash: Uint8Array - - /** - * solidity-spec abi encoded log Data - * - * @generated from field: bytes data = 5; - */ - data: Uint8Array - - /** - * keccak256 of event signature, in [32]byte fix-sized array format - * - * @generated from field: bytes event_sig = 6; - */ - eventSig: Uint8Array - - /** - * block number containing the log - * - * @generated from field: values.v1.BigInt block_number = 7; - */ - blockNumber?: BigInt - - /** - * index of transaction emmited the log - * - * @generated from field: uint32 tx_index = 8; - */ - txIndex: number - - /** - * index of the Log within the intire block - * - * @generated from field: uint32 index = 9; - */ - index: number - - /** - * flag if the log was removed during reorg - * - * @generated from field: bool removed = 10; - */ - removed: boolean -} +export type Log = Message<"capabilities.blockchain.evm.v1alpha.Log"> & { + /** + * address of the contract emitted the log in evm address [20]byte fix-sized array format + * + * @generated from field: bytes address = 1; + */ + address: Uint8Array; + + /** + * indexed log fields, in [32]byte fix-sized array format + * + * @generated from field: repeated bytes topics = 2; + */ + topics: Uint8Array[]; + + /** + * hash of the transaction containing the log, in [32]byte fix-sized array format + * + * @generated from field: bytes tx_hash = 3; + */ + txHash: Uint8Array; + + /** + * hash of the block containing the log, in [32]byte fix-sized array format + * + * @generated from field: bytes block_hash = 4; + */ + blockHash: Uint8Array; + + /** + * solidity-spec abi encoded log Data + * + * @generated from field: bytes data = 5; + */ + data: Uint8Array; + + /** + * keccak256 of event signature, in [32]byte fix-sized array format + * + * @generated from field: bytes event_sig = 6; + */ + eventSig: Uint8Array; + + /** + * block number containing the log + * + * @generated from field: values.v1.BigInt block_number = 7; + */ + blockNumber?: BigInt; + + /** + * index of transaction emmited the log + * + * @generated from field: uint32 tx_index = 8; + */ + txIndex: number; + + /** + * index of the Log within the intire block + * + * @generated from field: uint32 index = 9; + */ + index: number; + + /** + * flag if the log was removed during reorg + * + * @generated from field: bool removed = 10; + */ + removed: boolean; +}; /** * represents evm-style log @@ -359,112 +338,111 @@ export type Log = Message<'capabilities.blockchain.evm.v1alpha.Log'> & { * @generated from message capabilities.blockchain.evm.v1alpha.Log */ export type LogJson = { - /** - * address of the contract emitted the log in evm address [20]byte fix-sized array format - * - * @generated from field: bytes address = 1; - */ - address?: string - - /** - * indexed log fields, in [32]byte fix-sized array format - * - * @generated from field: repeated bytes topics = 2; - */ - topics?: string[] - - /** - * hash of the transaction containing the log, in [32]byte fix-sized array format - * - * @generated from field: bytes tx_hash = 3; - */ - txHash?: string - - /** - * hash of the block containing the log, in [32]byte fix-sized array format - * - * @generated from field: bytes block_hash = 4; - */ - blockHash?: string - - /** - * solidity-spec abi encoded log Data - * - * @generated from field: bytes data = 5; - */ - data?: string - - /** - * keccak256 of event signature, in [32]byte fix-sized array format - * - * @generated from field: bytes event_sig = 6; - */ - eventSig?: string - - /** - * block number containing the log - * - * @generated from field: values.v1.BigInt block_number = 7; - */ - blockNumber?: BigIntJson - - /** - * index of transaction emmited the log - * - * @generated from field: uint32 tx_index = 8; - */ - txIndex?: number - - /** - * index of the Log within the intire block - * - * @generated from field: uint32 index = 9; - */ - index?: number - - /** - * flag if the log was removed during reorg - * - * @generated from field: bool removed = 10; - */ - removed?: boolean -} + /** + * address of the contract emitted the log in evm address [20]byte fix-sized array format + * + * @generated from field: bytes address = 1; + */ + address?: string; + + /** + * indexed log fields, in [32]byte fix-sized array format + * + * @generated from field: repeated bytes topics = 2; + */ + topics?: string[]; + + /** + * hash of the transaction containing the log, in [32]byte fix-sized array format + * + * @generated from field: bytes tx_hash = 3; + */ + txHash?: string; + + /** + * hash of the block containing the log, in [32]byte fix-sized array format + * + * @generated from field: bytes block_hash = 4; + */ + blockHash?: string; + + /** + * solidity-spec abi encoded log Data + * + * @generated from field: bytes data = 5; + */ + data?: string; + + /** + * keccak256 of event signature, in [32]byte fix-sized array format + * + * @generated from field: bytes event_sig = 6; + */ + eventSig?: string; + + /** + * block number containing the log + * + * @generated from field: values.v1.BigInt block_number = 7; + */ + blockNumber?: BigIntJson; + + /** + * index of transaction emmited the log + * + * @generated from field: uint32 tx_index = 8; + */ + txIndex?: number; + + /** + * index of the Log within the intire block + * + * @generated from field: uint32 index = 9; + */ + index?: number; + + /** + * flag if the log was removed during reorg + * + * @generated from field: bool removed = 10; + */ + removed?: boolean; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.Log. * Use `create(LogSchema)` to create a new message. */ -export const LogSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 6) +export const LogSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 6); /** * represents simplified evm-style CallMsg * * @generated from message capabilities.blockchain.evm.v1alpha.CallMsg */ -export type CallMsg = Message<'capabilities.blockchain.evm.v1alpha.CallMsg'> & { - /** - * sender address in evm address [20]byte fix-sized array format - * - * @generated from field: bytes from = 1; - */ - from: Uint8Array - - /** - * contract address in evm address [20]byte fix-sized array format - * - * @generated from field: bytes to = 2; - */ - to: Uint8Array - - /** - * solidity-spec abi encoded bytes - * - * @generated from field: bytes data = 3; - */ - data: Uint8Array -} +export type CallMsg = Message<"capabilities.blockchain.evm.v1alpha.CallMsg"> & { + /** + * sender address in evm address [20]byte fix-sized array format + * + * @generated from field: bytes from = 1; + */ + from: Uint8Array; + + /** + * contract address in evm address [20]byte fix-sized array format + * + * @generated from field: bytes to = 2; + */ + to: Uint8Array; + + /** + * solidity-spec abi encoded bytes + * + * @generated from field: bytes data = 3; + */ + data: Uint8Array; +}; /** * represents simplified evm-style CallMsg @@ -472,77 +450,76 @@ export type CallMsg = Message<'capabilities.blockchain.evm.v1alpha.CallMsg'> & { * @generated from message capabilities.blockchain.evm.v1alpha.CallMsg */ export type CallMsgJson = { - /** - * sender address in evm address [20]byte fix-sized array format - * - * @generated from field: bytes from = 1; - */ - from?: string - - /** - * contract address in evm address [20]byte fix-sized array format - * - * @generated from field: bytes to = 2; - */ - to?: string - - /** - * solidity-spec abi encoded bytes - * - * @generated from field: bytes data = 3; - */ - data?: string -} + /** + * sender address in evm address [20]byte fix-sized array format + * + * @generated from field: bytes from = 1; + */ + from?: string; + + /** + * contract address in evm address [20]byte fix-sized array format + * + * @generated from field: bytes to = 2; + */ + to?: string; + + /** + * solidity-spec abi encoded bytes + * + * @generated from field: bytes data = 3; + */ + data?: string; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.CallMsg. * Use `create(CallMsgSchema)` to create a new message. */ -export const CallMsgSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 7) +export const CallMsgSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 7); /** * represents evm-style filter query * * @generated from message capabilities.blockchain.evm.v1alpha.FilterQuery */ -export type FilterQuery = Message<'capabilities.blockchain.evm.v1alpha.FilterQuery'> & { - /** - * exact block (cant use from/to), in [32]byte fix-sized array format - * - * @generated from field: bytes block_hash = 1; - */ - blockHash: Uint8Array - - /** - * start block range - * - * @generated from field: values.v1.BigInt from_block = 2; - */ - fromBlock?: BigInt - - /** - * end block range - * - * @generated from field: values.v1.BigInt to_block = 3; - */ - toBlock?: BigInt - - /** - * contract(s) to filter logs from in evm address [20]byte fix-sized array format - * - * @generated from field: repeated bytes addresses = 4; - */ - addresses: Uint8Array[] - - /** - * filter log by event signature and indexed args - * - * @generated from field: repeated capabilities.blockchain.evm.v1alpha.Topics topics = 5; - */ - topics: Topics[] -} +export type FilterQuery = Message<"capabilities.blockchain.evm.v1alpha.FilterQuery"> & { + /** + * exact block (cant use from/to), in [32]byte fix-sized array format + * + * @generated from field: bytes block_hash = 1; + */ + blockHash: Uint8Array; + + /** + * start block range + * + * @generated from field: values.v1.BigInt from_block = 2; + */ + fromBlock?: BigInt; + + /** + * end block range + * + * @generated from field: values.v1.BigInt to_block = 3; + */ + toBlock?: BigInt; + + /** + * contract(s) to filter logs from in evm address [20]byte fix-sized array format + * + * @generated from field: repeated bytes addresses = 4; + */ + addresses: Uint8Array[]; + + /** + * filter log by event signature and indexed args + * + * @generated from field: repeated capabilities.blockchain.evm.v1alpha.Topics topics = 5; + */ + topics: Topics[]; +}; /** * represents evm-style filter query @@ -550,343 +527,327 @@ export type FilterQuery = Message<'capabilities.blockchain.evm.v1alpha.FilterQue * @generated from message capabilities.blockchain.evm.v1alpha.FilterQuery */ export type FilterQueryJson = { - /** - * exact block (cant use from/to), in [32]byte fix-sized array format - * - * @generated from field: bytes block_hash = 1; - */ - blockHash?: string - - /** - * start block range - * - * @generated from field: values.v1.BigInt from_block = 2; - */ - fromBlock?: BigIntJson - - /** - * end block range - * - * @generated from field: values.v1.BigInt to_block = 3; - */ - toBlock?: BigIntJson - - /** - * contract(s) to filter logs from in evm address [20]byte fix-sized array format - * - * @generated from field: repeated bytes addresses = 4; - */ - addresses?: string[] - - /** - * filter log by event signature and indexed args - * - * @generated from field: repeated capabilities.blockchain.evm.v1alpha.Topics topics = 5; - */ - topics?: TopicsJson[] -} + /** + * exact block (cant use from/to), in [32]byte fix-sized array format + * + * @generated from field: bytes block_hash = 1; + */ + blockHash?: string; + + /** + * start block range + * + * @generated from field: values.v1.BigInt from_block = 2; + */ + fromBlock?: BigIntJson; + + /** + * end block range + * + * @generated from field: values.v1.BigInt to_block = 3; + */ + toBlock?: BigIntJson; + + /** + * contract(s) to filter logs from in evm address [20]byte fix-sized array format + * + * @generated from field: repeated bytes addresses = 4; + */ + addresses?: string[]; + + /** + * filter log by event signature and indexed args + * + * @generated from field: repeated capabilities.blockchain.evm.v1alpha.Topics topics = 5; + */ + topics?: TopicsJson[]; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.FilterQuery. * Use `create(FilterQuerySchema)` to create a new message. */ -export const FilterQuerySchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 8) +export const FilterQuerySchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 8); /** * @generated from message capabilities.blockchain.evm.v1alpha.Topics */ -export type Topics = Message<'capabilities.blockchain.evm.v1alpha.Topics'> & { - /** - * in [32]byte fix-sized array format - * - * @generated from field: repeated bytes topic = 1; - */ - topic: Uint8Array[] -} +export type Topics = Message<"capabilities.blockchain.evm.v1alpha.Topics"> & { + /** + * in [32]byte fix-sized array format + * + * @generated from field: repeated bytes topic = 1; + */ + topic: Uint8Array[]; +}; /** * @generated from message capabilities.blockchain.evm.v1alpha.Topics */ export type TopicsJson = { - /** - * in [32]byte fix-sized array format - * - * @generated from field: repeated bytes topic = 1; - */ - topic?: string[] -} + /** + * in [32]byte fix-sized array format + * + * @generated from field: repeated bytes topic = 1; + */ + topic?: string[]; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.Topics. * Use `create(TopicsSchema)` to create a new message. */ -export const TopicsSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 9) +export const TopicsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 9); /** * @generated from message capabilities.blockchain.evm.v1alpha.BalanceAtRequest */ -export type BalanceAtRequest = Message<'capabilities.blockchain.evm.v1alpha.BalanceAtRequest'> & { - /** - * in evm address [20]byte fix-sized array format - * - * @generated from field: bytes account = 1; - */ - account: Uint8Array - - /** - * @generated from field: values.v1.BigInt block_number = 2; - */ - blockNumber?: BigInt -} +export type BalanceAtRequest = Message<"capabilities.blockchain.evm.v1alpha.BalanceAtRequest"> & { + /** + * in evm address [20]byte fix-sized array format + * + * @generated from field: bytes account = 1; + */ + account: Uint8Array; + + /** + * @generated from field: values.v1.BigInt block_number = 2; + */ + blockNumber?: BigInt; +}; /** * @generated from message capabilities.blockchain.evm.v1alpha.BalanceAtRequest */ export type BalanceAtRequestJson = { - /** - * in evm address [20]byte fix-sized array format - * - * @generated from field: bytes account = 1; - */ - account?: string - - /** - * @generated from field: values.v1.BigInt block_number = 2; - */ - blockNumber?: BigIntJson -} + /** + * in evm address [20]byte fix-sized array format + * + * @generated from field: bytes account = 1; + */ + account?: string; + + /** + * @generated from field: values.v1.BigInt block_number = 2; + */ + blockNumber?: BigIntJson; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.BalanceAtRequest. * Use `create(BalanceAtRequestSchema)` to create a new message. */ -export const BalanceAtRequestSchema: GenMessage< - BalanceAtRequest, - { jsonType: BalanceAtRequestJson } -> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 10) +export const BalanceAtRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 10); /** * @generated from message capabilities.blockchain.evm.v1alpha.BalanceAtReply */ -export type BalanceAtReply = Message<'capabilities.blockchain.evm.v1alpha.BalanceAtReply'> & { - /** - * Balance of the account in wei (10^-18 eth) - * - * @generated from field: values.v1.BigInt balance = 1; - */ - balance?: BigInt -} +export type BalanceAtReply = Message<"capabilities.blockchain.evm.v1alpha.BalanceAtReply"> & { + /** + * Balance of the account in wei (10^-18 eth) + * + * @generated from field: values.v1.BigInt balance = 1; + */ + balance?: BigInt; +}; /** * @generated from message capabilities.blockchain.evm.v1alpha.BalanceAtReply */ export type BalanceAtReplyJson = { - /** - * Balance of the account in wei (10^-18 eth) - * - * @generated from field: values.v1.BigInt balance = 1; - */ - balance?: BigIntJson -} + /** + * Balance of the account in wei (10^-18 eth) + * + * @generated from field: values.v1.BigInt balance = 1; + */ + balance?: BigIntJson; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.BalanceAtReply. * Use `create(BalanceAtReplySchema)` to create a new message. */ -export const BalanceAtReplySchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 11) +export const BalanceAtReplySchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 11); /** * @generated from message capabilities.blockchain.evm.v1alpha.EstimateGasRequest */ -export type EstimateGasRequest = - Message<'capabilities.blockchain.evm.v1alpha.EstimateGasRequest'> & { - /** - * simulates tx execution returns approximate amount of gas units needed - * - * @generated from field: capabilities.blockchain.evm.v1alpha.CallMsg msg = 1; - */ - msg?: CallMsg - } +export type EstimateGasRequest = Message<"capabilities.blockchain.evm.v1alpha.EstimateGasRequest"> & { + /** + * simulates tx execution returns approximate amount of gas units needed + * + * @generated from field: capabilities.blockchain.evm.v1alpha.CallMsg msg = 1; + */ + msg?: CallMsg; +}; /** * @generated from message capabilities.blockchain.evm.v1alpha.EstimateGasRequest */ export type EstimateGasRequestJson = { - /** - * simulates tx execution returns approximate amount of gas units needed - * - * @generated from field: capabilities.blockchain.evm.v1alpha.CallMsg msg = 1; - */ - msg?: CallMsgJson -} + /** + * simulates tx execution returns approximate amount of gas units needed + * + * @generated from field: capabilities.blockchain.evm.v1alpha.CallMsg msg = 1; + */ + msg?: CallMsgJson; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.EstimateGasRequest. * Use `create(EstimateGasRequestSchema)` to create a new message. */ -export const EstimateGasRequestSchema: GenMessage< - EstimateGasRequest, - { jsonType: EstimateGasRequestJson } -> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 12) +export const EstimateGasRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 12); /** * @generated from message capabilities.blockchain.evm.v1alpha.EstimateGasReply */ -export type EstimateGasReply = Message<'capabilities.blockchain.evm.v1alpha.EstimateGasReply'> & { - /** - * estimated amount of gas in gas units, needed for tx execution - * - * @generated from field: uint64 gas = 1 [jstype = JS_NORMAL]; - */ - gas: bigint -} +export type EstimateGasReply = Message<"capabilities.blockchain.evm.v1alpha.EstimateGasReply"> & { + /** + * estimated amount of gas in gas units, needed for tx execution + * + * @generated from field: uint64 gas = 1 [jstype = JS_NORMAL]; + */ + gas: bigint; +}; /** * @generated from message capabilities.blockchain.evm.v1alpha.EstimateGasReply */ export type EstimateGasReplyJson = { - /** - * estimated amount of gas in gas units, needed for tx execution - * - * @generated from field: uint64 gas = 1 [jstype = JS_NORMAL]; - */ - gas?: string -} + /** + * estimated amount of gas in gas units, needed for tx execution + * + * @generated from field: uint64 gas = 1 [jstype = JS_NORMAL]; + */ + gas?: string; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.EstimateGasReply. * Use `create(EstimateGasReplySchema)` to create a new message. */ -export const EstimateGasReplySchema: GenMessage< - EstimateGasReply, - { jsonType: EstimateGasReplyJson } -> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 13) +export const EstimateGasReplySchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 13); /** * @generated from message capabilities.blockchain.evm.v1alpha.GetTransactionByHashRequest */ -export type GetTransactionByHashRequest = - Message<'capabilities.blockchain.evm.v1alpha.GetTransactionByHashRequest'> & { - /** - * in [32]byte fix-sized array format - * - * @generated from field: bytes hash = 1; - */ - hash: Uint8Array - } +export type GetTransactionByHashRequest = Message<"capabilities.blockchain.evm.v1alpha.GetTransactionByHashRequest"> & { + /** + * in [32]byte fix-sized array format + * + * @generated from field: bytes hash = 1; + */ + hash: Uint8Array; +}; /** * @generated from message capabilities.blockchain.evm.v1alpha.GetTransactionByHashRequest */ export type GetTransactionByHashRequestJson = { - /** - * in [32]byte fix-sized array format - * - * @generated from field: bytes hash = 1; - */ - hash?: string -} + /** + * in [32]byte fix-sized array format + * + * @generated from field: bytes hash = 1; + */ + hash?: string; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.GetTransactionByHashRequest. * Use `create(GetTransactionByHashRequestSchema)` to create a new message. */ -export const GetTransactionByHashRequestSchema: GenMessage< - GetTransactionByHashRequest, - { jsonType: GetTransactionByHashRequestJson } -> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 14) +export const GetTransactionByHashRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 14); /** * @generated from message capabilities.blockchain.evm.v1alpha.GetTransactionByHashReply */ -export type GetTransactionByHashReply = - Message<'capabilities.blockchain.evm.v1alpha.GetTransactionByHashReply'> & { - /** - * @generated from field: capabilities.blockchain.evm.v1alpha.Transaction transaction = 1; - */ - transaction?: Transaction - } +export type GetTransactionByHashReply = Message<"capabilities.blockchain.evm.v1alpha.GetTransactionByHashReply"> & { + /** + * @generated from field: capabilities.blockchain.evm.v1alpha.Transaction transaction = 1; + */ + transaction?: Transaction; +}; /** * @generated from message capabilities.blockchain.evm.v1alpha.GetTransactionByHashReply */ export type GetTransactionByHashReplyJson = { - /** - * @generated from field: capabilities.blockchain.evm.v1alpha.Transaction transaction = 1; - */ - transaction?: TransactionJson -} + /** + * @generated from field: capabilities.blockchain.evm.v1alpha.Transaction transaction = 1; + */ + transaction?: TransactionJson; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.GetTransactionByHashReply. * Use `create(GetTransactionByHashReplySchema)` to create a new message. */ -export const GetTransactionByHashReplySchema: GenMessage< - GetTransactionByHashReply, - { jsonType: GetTransactionByHashReplyJson } -> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 15) +export const GetTransactionByHashReplySchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 15); /** * represents evm-style transaction * * @generated from message capabilities.blockchain.evm.v1alpha.Transaction */ -export type Transaction = Message<'capabilities.blockchain.evm.v1alpha.Transaction'> & { - /** - * number of txs sent from sender - * - * @generated from field: uint64 nonce = 1 [jstype = JS_NORMAL]; - */ - nonce: bigint - - /** - * max gas allowed per execution (in gas units) - * - * @generated from field: uint64 gas = 2 [jstype = JS_NORMAL]; - */ - gas: bigint - - /** - * recipient address in evm address [20]byte fix-sized array format - * - * @generated from field: bytes to = 3; - */ - to: Uint8Array - - /** - * solidity-spec abi encoded input data for function call payload - * - * @generated from field: bytes data = 4; - */ - data: Uint8Array - - /** - * transaction hash, in [32]byte fix-sized array format - * - * @generated from field: bytes hash = 5; - */ - hash: Uint8Array - - /** - * amount of eth sent in wei - * - * @generated from field: values.v1.BigInt value = 6; - */ - value?: BigInt - - /** - * price for a single gas unit in wei - * - * @generated from field: values.v1.BigInt gas_price = 7; - */ - gasPrice?: BigInt -} +export type Transaction = Message<"capabilities.blockchain.evm.v1alpha.Transaction"> & { + /** + * number of txs sent from sender + * + * @generated from field: uint64 nonce = 1 [jstype = JS_NORMAL]; + */ + nonce: bigint; + + /** + * max gas allowed per execution (in gas units) + * + * @generated from field: uint64 gas = 2 [jstype = JS_NORMAL]; + */ + gas: bigint; + + /** + * recipient address in evm address [20]byte fix-sized array format + * + * @generated from field: bytes to = 3; + */ + to: Uint8Array; + + /** + * solidity-spec abi encoded input data for function call payload + * + * @generated from field: bytes data = 4; + */ + data: Uint8Array; + + /** + * transaction hash, in [32]byte fix-sized array format + * + * @generated from field: bytes hash = 5; + */ + hash: Uint8Array; + + /** + * amount of eth sent in wei + * + * @generated from field: values.v1.BigInt value = 6; + */ + value?: BigInt; + + /** + * price for a single gas unit in wei + * + * @generated from field: values.v1.BigInt gas_price = 7; + */ + gasPrice?: BigInt; +}; /** * represents evm-style transaction @@ -894,197 +855,190 @@ export type Transaction = Message<'capabilities.blockchain.evm.v1alpha.Transacti * @generated from message capabilities.blockchain.evm.v1alpha.Transaction */ export type TransactionJson = { - /** - * number of txs sent from sender - * - * @generated from field: uint64 nonce = 1 [jstype = JS_NORMAL]; - */ - nonce?: string - - /** - * max gas allowed per execution (in gas units) - * - * @generated from field: uint64 gas = 2 [jstype = JS_NORMAL]; - */ - gas?: string - - /** - * recipient address in evm address [20]byte fix-sized array format - * - * @generated from field: bytes to = 3; - */ - to?: string - - /** - * solidity-spec abi encoded input data for function call payload - * - * @generated from field: bytes data = 4; - */ - data?: string - - /** - * transaction hash, in [32]byte fix-sized array format - * - * @generated from field: bytes hash = 5; - */ - hash?: string - - /** - * amount of eth sent in wei - * - * @generated from field: values.v1.BigInt value = 6; - */ - value?: BigIntJson - - /** - * price for a single gas unit in wei - * - * @generated from field: values.v1.BigInt gas_price = 7; - */ - gasPrice?: BigIntJson -} + /** + * number of txs sent from sender + * + * @generated from field: uint64 nonce = 1 [jstype = JS_NORMAL]; + */ + nonce?: string; + + /** + * max gas allowed per execution (in gas units) + * + * @generated from field: uint64 gas = 2 [jstype = JS_NORMAL]; + */ + gas?: string; + + /** + * recipient address in evm address [20]byte fix-sized array format + * + * @generated from field: bytes to = 3; + */ + to?: string; + + /** + * solidity-spec abi encoded input data for function call payload + * + * @generated from field: bytes data = 4; + */ + data?: string; + + /** + * transaction hash, in [32]byte fix-sized array format + * + * @generated from field: bytes hash = 5; + */ + hash?: string; + + /** + * amount of eth sent in wei + * + * @generated from field: values.v1.BigInt value = 6; + */ + value?: BigIntJson; + + /** + * price for a single gas unit in wei + * + * @generated from field: values.v1.BigInt gas_price = 7; + */ + gasPrice?: BigIntJson; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.Transaction. * Use `create(TransactionSchema)` to create a new message. */ -export const TransactionSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 16) +export const TransactionSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 16); /** * @generated from message capabilities.blockchain.evm.v1alpha.GetTransactionReceiptRequest */ -export type GetTransactionReceiptRequest = - Message<'capabilities.blockchain.evm.v1alpha.GetTransactionReceiptRequest'> & { - /** - * in [32]byte fix-sized array format - * - * @generated from field: bytes hash = 1; - */ - hash: Uint8Array - } +export type GetTransactionReceiptRequest = Message<"capabilities.blockchain.evm.v1alpha.GetTransactionReceiptRequest"> & { + /** + * in [32]byte fix-sized array format + * + * @generated from field: bytes hash = 1; + */ + hash: Uint8Array; +}; /** * @generated from message capabilities.blockchain.evm.v1alpha.GetTransactionReceiptRequest */ export type GetTransactionReceiptRequestJson = { - /** - * in [32]byte fix-sized array format - * - * @generated from field: bytes hash = 1; - */ - hash?: string -} + /** + * in [32]byte fix-sized array format + * + * @generated from field: bytes hash = 1; + */ + hash?: string; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.GetTransactionReceiptRequest. * Use `create(GetTransactionReceiptRequestSchema)` to create a new message. */ -export const GetTransactionReceiptRequestSchema: GenMessage< - GetTransactionReceiptRequest, - { jsonType: GetTransactionReceiptRequestJson } -> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 17) +export const GetTransactionReceiptRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 17); /** * @generated from message capabilities.blockchain.evm.v1alpha.GetTransactionReceiptReply */ -export type GetTransactionReceiptReply = - Message<'capabilities.blockchain.evm.v1alpha.GetTransactionReceiptReply'> & { - /** - * @generated from field: capabilities.blockchain.evm.v1alpha.Receipt receipt = 1; - */ - receipt?: Receipt - } +export type GetTransactionReceiptReply = Message<"capabilities.blockchain.evm.v1alpha.GetTransactionReceiptReply"> & { + /** + * @generated from field: capabilities.blockchain.evm.v1alpha.Receipt receipt = 1; + */ + receipt?: Receipt; +}; /** * @generated from message capabilities.blockchain.evm.v1alpha.GetTransactionReceiptReply */ export type GetTransactionReceiptReplyJson = { - /** - * @generated from field: capabilities.blockchain.evm.v1alpha.Receipt receipt = 1; - */ - receipt?: ReceiptJson -} + /** + * @generated from field: capabilities.blockchain.evm.v1alpha.Receipt receipt = 1; + */ + receipt?: ReceiptJson; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.GetTransactionReceiptReply. * Use `create(GetTransactionReceiptReplySchema)` to create a new message. */ -export const GetTransactionReceiptReplySchema: GenMessage< - GetTransactionReceiptReply, - { jsonType: GetTransactionReceiptReplyJson } -> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 18) +export const GetTransactionReceiptReplySchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 18); /** * represents evm-style receipt * * @generated from message capabilities.blockchain.evm.v1alpha.Receipt */ -export type Receipt = Message<'capabilities.blockchain.evm.v1alpha.Receipt'> & { - /** - * 1 for success 0 for failure - * - * @generated from field: uint64 status = 1 [jstype = JS_NORMAL]; - */ - status: bigint - - /** - * gas used by this transaction (in gas units) - * - * @generated from field: uint64 gas_used = 2 [jstype = JS_NORMAL]; - */ - gasUsed: bigint - - /** - * index of the transaction inside of the block - * - * @generated from field: uint64 tx_index = 3 [jstype = JS_NORMAL]; - */ - txIndex: bigint - - /** - * block hash containing the transaction - * - * @generated from field: bytes block_hash = 4; - */ - blockHash: Uint8Array - - /** - * logs emitted by this transaction - * - * @generated from field: repeated capabilities.blockchain.evm.v1alpha.Log logs = 6; - */ - logs: Log[] - - /** - * hash of the transaction this receipt is for, in [32]byte fix-sized array format - * - * @generated from field: bytes tx_hash = 7; - */ - txHash: Uint8Array - - /** - * actual gas price paid in wei (include after EIP-1559) - * - * @generated from field: values.v1.BigInt effective_gas_price = 8; - */ - effectiveGasPrice?: BigInt - - /** - * block number containing the transaction - * - * @generated from field: values.v1.BigInt block_number = 9; - */ - blockNumber?: BigInt - - /** - * address of the contract if this transaction created one in evm address [20]byte fix-sized array format - * - * @generated from field: bytes contract_address = 10; - */ - contractAddress: Uint8Array -} +export type Receipt = Message<"capabilities.blockchain.evm.v1alpha.Receipt"> & { + /** + * 1 for success 0 for failure + * + * @generated from field: uint64 status = 1 [jstype = JS_NORMAL]; + */ + status: bigint; + + /** + * gas used by this transaction (in gas units) + * + * @generated from field: uint64 gas_used = 2 [jstype = JS_NORMAL]; + */ + gasUsed: bigint; + + /** + * index of the transaction inside of the block + * + * @generated from field: uint64 tx_index = 3 [jstype = JS_NORMAL]; + */ + txIndex: bigint; + + /** + * block hash containing the transaction + * + * @generated from field: bytes block_hash = 4; + */ + blockHash: Uint8Array; + + /** + * logs emitted by this transaction + * + * @generated from field: repeated capabilities.blockchain.evm.v1alpha.Log logs = 6; + */ + logs: Log[]; + + /** + * hash of the transaction this receipt is for, in [32]byte fix-sized array format + * + * @generated from field: bytes tx_hash = 7; + */ + txHash: Uint8Array; + + /** + * actual gas price paid in wei (include after EIP-1559) + * + * @generated from field: values.v1.BigInt effective_gas_price = 8; + */ + effectiveGasPrice?: BigInt; + + /** + * block number containing the transaction + * + * @generated from field: values.v1.BigInt block_number = 9; + */ + blockNumber?: BigInt; + + /** + * address of the contract if this transaction created one in evm address [20]byte fix-sized array format + * + * @generated from field: bytes contract_address = 10; + */ + contractAddress: Uint8Array; +}; /** * represents evm-style receipt @@ -1092,90 +1046,88 @@ export type Receipt = Message<'capabilities.blockchain.evm.v1alpha.Receipt'> & { * @generated from message capabilities.blockchain.evm.v1alpha.Receipt */ export type ReceiptJson = { - /** - * 1 for success 0 for failure - * - * @generated from field: uint64 status = 1 [jstype = JS_NORMAL]; - */ - status?: string - - /** - * gas used by this transaction (in gas units) - * - * @generated from field: uint64 gas_used = 2 [jstype = JS_NORMAL]; - */ - gasUsed?: string - - /** - * index of the transaction inside of the block - * - * @generated from field: uint64 tx_index = 3 [jstype = JS_NORMAL]; - */ - txIndex?: string - - /** - * block hash containing the transaction - * - * @generated from field: bytes block_hash = 4; - */ - blockHash?: string - - /** - * logs emitted by this transaction - * - * @generated from field: repeated capabilities.blockchain.evm.v1alpha.Log logs = 6; - */ - logs?: LogJson[] - - /** - * hash of the transaction this receipt is for, in [32]byte fix-sized array format - * - * @generated from field: bytes tx_hash = 7; - */ - txHash?: string - - /** - * actual gas price paid in wei (include after EIP-1559) - * - * @generated from field: values.v1.BigInt effective_gas_price = 8; - */ - effectiveGasPrice?: BigIntJson - - /** - * block number containing the transaction - * - * @generated from field: values.v1.BigInt block_number = 9; - */ - blockNumber?: BigIntJson - - /** - * address of the contract if this transaction created one in evm address [20]byte fix-sized array format - * - * @generated from field: bytes contract_address = 10; - */ - contractAddress?: string -} + /** + * 1 for success 0 for failure + * + * @generated from field: uint64 status = 1 [jstype = JS_NORMAL]; + */ + status?: string; + + /** + * gas used by this transaction (in gas units) + * + * @generated from field: uint64 gas_used = 2 [jstype = JS_NORMAL]; + */ + gasUsed?: string; + + /** + * index of the transaction inside of the block + * + * @generated from field: uint64 tx_index = 3 [jstype = JS_NORMAL]; + */ + txIndex?: string; + + /** + * block hash containing the transaction + * + * @generated from field: bytes block_hash = 4; + */ + blockHash?: string; + + /** + * logs emitted by this transaction + * + * @generated from field: repeated capabilities.blockchain.evm.v1alpha.Log logs = 6; + */ + logs?: LogJson[]; + + /** + * hash of the transaction this receipt is for, in [32]byte fix-sized array format + * + * @generated from field: bytes tx_hash = 7; + */ + txHash?: string; + + /** + * actual gas price paid in wei (include after EIP-1559) + * + * @generated from field: values.v1.BigInt effective_gas_price = 8; + */ + effectiveGasPrice?: BigIntJson; + + /** + * block number containing the transaction + * + * @generated from field: values.v1.BigInt block_number = 9; + */ + blockNumber?: BigIntJson; + + /** + * address of the contract if this transaction created one in evm address [20]byte fix-sized array format + * + * @generated from field: bytes contract_address = 10; + */ + contractAddress?: string; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.Receipt. * Use `create(ReceiptSchema)` to create a new message. */ -export const ReceiptSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 19) +export const ReceiptSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 19); /** * ----- Request/Reply Wrappers ----- * * @generated from message capabilities.blockchain.evm.v1alpha.HeaderByNumberRequest */ -export type HeaderByNumberRequest = - Message<'capabilities.blockchain.evm.v1alpha.HeaderByNumberRequest'> & { - /** - * @generated from field: values.v1.BigInt block_number = 1; - */ - blockNumber?: BigInt - } +export type HeaderByNumberRequest = Message<"capabilities.blockchain.evm.v1alpha.HeaderByNumberRequest"> & { + /** + * @generated from field: values.v1.BigInt block_number = 1; + */ + blockNumber?: BigInt; +}; /** * ----- Request/Reply Wrappers ----- @@ -1183,659 +1135,633 @@ export type HeaderByNumberRequest = * @generated from message capabilities.blockchain.evm.v1alpha.HeaderByNumberRequest */ export type HeaderByNumberRequestJson = { - /** - * @generated from field: values.v1.BigInt block_number = 1; - */ - blockNumber?: BigIntJson -} + /** + * @generated from field: values.v1.BigInt block_number = 1; + */ + blockNumber?: BigIntJson; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.HeaderByNumberRequest. * Use `create(HeaderByNumberRequestSchema)` to create a new message. */ -export const HeaderByNumberRequestSchema: GenMessage< - HeaderByNumberRequest, - { jsonType: HeaderByNumberRequestJson } -> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 20) +export const HeaderByNumberRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 20); /** * @generated from message capabilities.blockchain.evm.v1alpha.HeaderByNumberReply */ -export type HeaderByNumberReply = - Message<'capabilities.blockchain.evm.v1alpha.HeaderByNumberReply'> & { - /** - * @generated from field: capabilities.blockchain.evm.v1alpha.Header header = 1; - */ - header?: Header - } +export type HeaderByNumberReply = Message<"capabilities.blockchain.evm.v1alpha.HeaderByNumberReply"> & { + /** + * @generated from field: capabilities.blockchain.evm.v1alpha.Header header = 1; + */ + header?: Header; +}; /** * @generated from message capabilities.blockchain.evm.v1alpha.HeaderByNumberReply */ export type HeaderByNumberReplyJson = { - /** - * @generated from field: capabilities.blockchain.evm.v1alpha.Header header = 1; - */ - header?: HeaderJson -} + /** + * @generated from field: capabilities.blockchain.evm.v1alpha.Header header = 1; + */ + header?: HeaderJson; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.HeaderByNumberReply. * Use `create(HeaderByNumberReplySchema)` to create a new message. */ -export const HeaderByNumberReplySchema: GenMessage< - HeaderByNumberReply, - { jsonType: HeaderByNumberReplyJson } -> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 21) +export const HeaderByNumberReplySchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 21); /** * @generated from message capabilities.blockchain.evm.v1alpha.Header */ -export type Header = Message<'capabilities.blockchain.evm.v1alpha.Header'> & { - /** - * unix timestamp - * - * @generated from field: uint64 timestamp = 1 [jstype = JS_NORMAL]; - */ - timestamp: bigint - - /** - * @generated from field: values.v1.BigInt block_number = 2; - */ - blockNumber?: BigInt - - /** - * in [32]byte fix-sized array format - * - * @generated from field: bytes hash = 3; - */ - hash: Uint8Array - - /** - * in [32]byte fix-sized array format - * - * @generated from field: bytes parent_hash = 4; - */ - parentHash: Uint8Array -} +export type Header = Message<"capabilities.blockchain.evm.v1alpha.Header"> & { + /** + * unix timestamp + * + * @generated from field: uint64 timestamp = 1 [jstype = JS_NORMAL]; + */ + timestamp: bigint; + + /** + * @generated from field: values.v1.BigInt block_number = 2; + */ + blockNumber?: BigInt; + + /** + * in [32]byte fix-sized array format + * + * @generated from field: bytes hash = 3; + */ + hash: Uint8Array; + + /** + * in [32]byte fix-sized array format + * + * @generated from field: bytes parent_hash = 4; + */ + parentHash: Uint8Array; +}; /** * @generated from message capabilities.blockchain.evm.v1alpha.Header */ export type HeaderJson = { - /** - * unix timestamp - * - * @generated from field: uint64 timestamp = 1 [jstype = JS_NORMAL]; - */ - timestamp?: string - - /** - * @generated from field: values.v1.BigInt block_number = 2; - */ - blockNumber?: BigIntJson - - /** - * in [32]byte fix-sized array format - * - * @generated from field: bytes hash = 3; - */ - hash?: string - - /** - * in [32]byte fix-sized array format - * - * @generated from field: bytes parent_hash = 4; - */ - parentHash?: string -} + /** + * unix timestamp + * + * @generated from field: uint64 timestamp = 1 [jstype = JS_NORMAL]; + */ + timestamp?: string; + + /** + * @generated from field: values.v1.BigInt block_number = 2; + */ + blockNumber?: BigIntJson; + + /** + * in [32]byte fix-sized array format + * + * @generated from field: bytes hash = 3; + */ + hash?: string; + + /** + * in [32]byte fix-sized array format + * + * @generated from field: bytes parent_hash = 4; + */ + parentHash?: string; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.Header. * Use `create(HeaderSchema)` to create a new message. */ -export const HeaderSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 22) +export const HeaderSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 22); /** * @generated from message capabilities.blockchain.evm.v1alpha.RegisterLogTrackingRequest */ -export type RegisterLogTrackingRequest = - Message<'capabilities.blockchain.evm.v1alpha.RegisterLogTrackingRequest'> & { - /** - * @generated from field: capabilities.blockchain.evm.v1alpha.LPFilter filter = 1; - */ - filter?: LPFilter - } +export type RegisterLogTrackingRequest = Message<"capabilities.blockchain.evm.v1alpha.RegisterLogTrackingRequest"> & { + /** + * @generated from field: capabilities.blockchain.evm.v1alpha.LPFilter filter = 1; + */ + filter?: LPFilter; +}; /** * @generated from message capabilities.blockchain.evm.v1alpha.RegisterLogTrackingRequest */ export type RegisterLogTrackingRequestJson = { - /** - * @generated from field: capabilities.blockchain.evm.v1alpha.LPFilter filter = 1; - */ - filter?: LPFilterJson -} + /** + * @generated from field: capabilities.blockchain.evm.v1alpha.LPFilter filter = 1; + */ + filter?: LPFilterJson; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.RegisterLogTrackingRequest. * Use `create(RegisterLogTrackingRequestSchema)` to create a new message. */ -export const RegisterLogTrackingRequestSchema: GenMessage< - RegisterLogTrackingRequest, - { jsonType: RegisterLogTrackingRequestJson } -> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 23) +export const RegisterLogTrackingRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 23); /** * @generated from message capabilities.blockchain.evm.v1alpha.LPFilter */ -export type LPFilter = Message<'capabilities.blockchain.evm.v1alpha.LPFilter'> & { - /** - * maximum number of logs to retain ( 0 = unlimited ) - * - * @generated from field: uint64 max_logs_kept = 1 [jstype = JS_NORMAL]; - */ - maxLogsKept: bigint - - /** - * maximum amount of time to retain logs in seconds - * - * @generated from field: int64 retention_time = 2 [jstype = JS_NORMAL]; - */ - retentionTime: bigint - - /** - * rate limit ( maximum # of logs per block, 0 = unlimited ) - * - * @generated from field: uint64 logs_per_block = 3 [jstype = JS_NORMAL]; - */ - logsPerBlock: bigint - - /** - * filter name, has to persist for removing filter - * - * @generated from field: string name = 4; - */ - name: string - - /** - * list of addresses to include in evm address [20]byte fix-sized array format - * - * @generated from field: repeated bytes addresses = 5; - */ - addresses: Uint8Array[] - - /** - * list of possible signatures (aka topic1), in [32]byte fix-sized array format - * - * @generated from field: repeated bytes event_sigs = 6; - */ - eventSigs: Uint8Array[] - - /** - * list of possible values for topic2, in [32]byte fix-sized array format - * - * @generated from field: repeated bytes topic2 = 7; - */ - topic2: Uint8Array[] - - /** - * list of possible values for topic3, in [32]byte fix-sized array format - * - * @generated from field: repeated bytes topic3 = 8; - */ - topic3: Uint8Array[] - - /** - * list of possible values for topic4, in [32]byte fix-sized array format - * - * @generated from field: repeated bytes topic4 = 9; - */ - topic4: Uint8Array[] -} +export type LPFilter = Message<"capabilities.blockchain.evm.v1alpha.LPFilter"> & { + /** + * maximum number of logs to retain ( 0 = unlimited ) + * + * @generated from field: uint64 max_logs_kept = 1 [jstype = JS_NORMAL]; + */ + maxLogsKept: bigint; + + /** + * maximum amount of time to retain logs in seconds + * + * @generated from field: int64 retention_time = 2 [jstype = JS_NORMAL]; + */ + retentionTime: bigint; + + /** + * rate limit ( maximum # of logs per block, 0 = unlimited ) + * + * @generated from field: uint64 logs_per_block = 3 [jstype = JS_NORMAL]; + */ + logsPerBlock: bigint; + + /** + * filter name, has to persist for removing filter + * + * @generated from field: string name = 4; + */ + name: string; + + /** + * list of addresses to include in evm address [20]byte fix-sized array format + * + * @generated from field: repeated bytes addresses = 5; + */ + addresses: Uint8Array[]; + + /** + * list of possible signatures (aka topic1), in [32]byte fix-sized array format + * + * @generated from field: repeated bytes event_sigs = 6; + */ + eventSigs: Uint8Array[]; + + /** + * list of possible values for topic2, in [32]byte fix-sized array format + * + * @generated from field: repeated bytes topic2 = 7; + */ + topic2: Uint8Array[]; + + /** + * list of possible values for topic3, in [32]byte fix-sized array format + * + * @generated from field: repeated bytes topic3 = 8; + */ + topic3: Uint8Array[]; + + /** + * list of possible values for topic4, in [32]byte fix-sized array format + * + * @generated from field: repeated bytes topic4 = 9; + */ + topic4: Uint8Array[]; +}; /** * @generated from message capabilities.blockchain.evm.v1alpha.LPFilter */ export type LPFilterJson = { - /** - * maximum number of logs to retain ( 0 = unlimited ) - * - * @generated from field: uint64 max_logs_kept = 1 [jstype = JS_NORMAL]; - */ - maxLogsKept?: string - - /** - * maximum amount of time to retain logs in seconds - * - * @generated from field: int64 retention_time = 2 [jstype = JS_NORMAL]; - */ - retentionTime?: string - - /** - * rate limit ( maximum # of logs per block, 0 = unlimited ) - * - * @generated from field: uint64 logs_per_block = 3 [jstype = JS_NORMAL]; - */ - logsPerBlock?: string - - /** - * filter name, has to persist for removing filter - * - * @generated from field: string name = 4; - */ - name?: string - - /** - * list of addresses to include in evm address [20]byte fix-sized array format - * - * @generated from field: repeated bytes addresses = 5; - */ - addresses?: string[] - - /** - * list of possible signatures (aka topic1), in [32]byte fix-sized array format - * - * @generated from field: repeated bytes event_sigs = 6; - */ - eventSigs?: string[] - - /** - * list of possible values for topic2, in [32]byte fix-sized array format - * - * @generated from field: repeated bytes topic2 = 7; - */ - topic2?: string[] - - /** - * list of possible values for topic3, in [32]byte fix-sized array format - * - * @generated from field: repeated bytes topic3 = 8; - */ - topic3?: string[] - - /** - * list of possible values for topic4, in [32]byte fix-sized array format - * - * @generated from field: repeated bytes topic4 = 9; - */ - topic4?: string[] -} + /** + * maximum number of logs to retain ( 0 = unlimited ) + * + * @generated from field: uint64 max_logs_kept = 1 [jstype = JS_NORMAL]; + */ + maxLogsKept?: string; + + /** + * maximum amount of time to retain logs in seconds + * + * @generated from field: int64 retention_time = 2 [jstype = JS_NORMAL]; + */ + retentionTime?: string; + + /** + * rate limit ( maximum # of logs per block, 0 = unlimited ) + * + * @generated from field: uint64 logs_per_block = 3 [jstype = JS_NORMAL]; + */ + logsPerBlock?: string; + + /** + * filter name, has to persist for removing filter + * + * @generated from field: string name = 4; + */ + name?: string; + + /** + * list of addresses to include in evm address [20]byte fix-sized array format + * + * @generated from field: repeated bytes addresses = 5; + */ + addresses?: string[]; + + /** + * list of possible signatures (aka topic1), in [32]byte fix-sized array format + * + * @generated from field: repeated bytes event_sigs = 6; + */ + eventSigs?: string[]; + + /** + * list of possible values for topic2, in [32]byte fix-sized array format + * + * @generated from field: repeated bytes topic2 = 7; + */ + topic2?: string[]; + + /** + * list of possible values for topic3, in [32]byte fix-sized array format + * + * @generated from field: repeated bytes topic3 = 8; + */ + topic3?: string[]; + + /** + * list of possible values for topic4, in [32]byte fix-sized array format + * + * @generated from field: repeated bytes topic4 = 9; + */ + topic4?: string[]; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.LPFilter. * Use `create(LPFilterSchema)` to create a new message. */ -export const LPFilterSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 24) +export const LPFilterSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 24); /** * @generated from message capabilities.blockchain.evm.v1alpha.UnregisterLogTrackingRequest */ -export type UnregisterLogTrackingRequest = - Message<'capabilities.blockchain.evm.v1alpha.UnregisterLogTrackingRequest'> & { - /** - * @generated from field: string filter_name = 1; - */ - filterName: string - } +export type UnregisterLogTrackingRequest = Message<"capabilities.blockchain.evm.v1alpha.UnregisterLogTrackingRequest"> & { + /** + * @generated from field: string filter_name = 1; + */ + filterName: string; +}; /** * @generated from message capabilities.blockchain.evm.v1alpha.UnregisterLogTrackingRequest */ export type UnregisterLogTrackingRequestJson = { - /** - * @generated from field: string filter_name = 1; - */ - filterName?: string -} + /** + * @generated from field: string filter_name = 1; + */ + filterName?: string; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.UnregisterLogTrackingRequest. * Use `create(UnregisterLogTrackingRequestSchema)` to create a new message. */ -export const UnregisterLogTrackingRequestSchema: GenMessage< - UnregisterLogTrackingRequest, - { jsonType: UnregisterLogTrackingRequestJson } -> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 25) +export const UnregisterLogTrackingRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 25); /** * @generated from message capabilities.blockchain.evm.v1alpha.WriteReportRequest */ -export type WriteReportRequest = - Message<'capabilities.blockchain.evm.v1alpha.WriteReportRequest'> & { - /** - * @generated from field: bytes receiver = 1; - */ - receiver: Uint8Array +export type WriteReportRequest = Message<"capabilities.blockchain.evm.v1alpha.WriteReportRequest"> & { + /** + * @generated from field: bytes receiver = 1; + */ + receiver: Uint8Array; - /** - * @generated from field: sdk.v1alpha.ReportResponse report = 2; - */ - report?: ReportResponse + /** + * @generated from field: sdk.v1alpha.ReportResponse report = 2; + */ + report?: ReportResponse; - /** - * @generated from field: optional capabilities.blockchain.evm.v1alpha.GasConfig gas_config = 3; - */ - gasConfig?: GasConfig - } + /** + * @generated from field: optional capabilities.blockchain.evm.v1alpha.GasConfig gas_config = 3; + */ + gasConfig?: GasConfig; +}; /** * @generated from message capabilities.blockchain.evm.v1alpha.WriteReportRequest */ export type WriteReportRequestJson = { - /** - * @generated from field: bytes receiver = 1; - */ - receiver?: string - - /** - * @generated from field: sdk.v1alpha.ReportResponse report = 2; - */ - report?: ReportResponseJson - - /** - * @generated from field: optional capabilities.blockchain.evm.v1alpha.GasConfig gas_config = 3; - */ - gasConfig?: GasConfigJson -} + /** + * @generated from field: bytes receiver = 1; + */ + receiver?: string; + + /** + * @generated from field: sdk.v1alpha.ReportResponse report = 2; + */ + report?: ReportResponseJson; + + /** + * @generated from field: optional capabilities.blockchain.evm.v1alpha.GasConfig gas_config = 3; + */ + gasConfig?: GasConfigJson; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.WriteReportRequest. * Use `create(WriteReportRequestSchema)` to create a new message. */ -export const WriteReportRequestSchema: GenMessage< - WriteReportRequest, - { jsonType: WriteReportRequestJson } -> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 26) +export const WriteReportRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 26); /** * @generated from message capabilities.blockchain.evm.v1alpha.GasConfig */ -export type GasConfig = Message<'capabilities.blockchain.evm.v1alpha.GasConfig'> & { - /** - * @generated from field: uint64 gas_limit = 1 [jstype = JS_NORMAL]; - */ - gasLimit: bigint -} +export type GasConfig = Message<"capabilities.blockchain.evm.v1alpha.GasConfig"> & { + /** + * @generated from field: uint64 gas_limit = 1 [jstype = JS_NORMAL]; + */ + gasLimit: bigint; +}; /** * @generated from message capabilities.blockchain.evm.v1alpha.GasConfig */ export type GasConfigJson = { - /** - * @generated from field: uint64 gas_limit = 1 [jstype = JS_NORMAL]; - */ - gasLimit?: string -} + /** + * @generated from field: uint64 gas_limit = 1 [jstype = JS_NORMAL]; + */ + gasLimit?: string; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.GasConfig. * Use `create(GasConfigSchema)` to create a new message. */ -export const GasConfigSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 27) +export const GasConfigSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 27); /** * @generated from message capabilities.blockchain.evm.v1alpha.WriteReportReply */ -export type WriteReportReply = Message<'capabilities.blockchain.evm.v1alpha.WriteReportReply'> & { - /** - * @generated from field: capabilities.blockchain.evm.v1alpha.TxStatus tx_status = 1; - */ - txStatus: TxStatus - - /** - * @generated from field: optional capabilities.blockchain.evm.v1alpha.ReceiverContractExecutionStatus receiver_contract_execution_status = 2; - */ - receiverContractExecutionStatus?: ReceiverContractExecutionStatus - - /** - * @generated from field: optional bytes tx_hash = 3; - */ - txHash?: Uint8Array - - /** - * @generated from field: optional values.v1.BigInt transaction_fee = 4; - */ - transactionFee?: BigInt - - /** - * @generated from field: optional string error_message = 5; - */ - errorMessage?: string -} +export type WriteReportReply = Message<"capabilities.blockchain.evm.v1alpha.WriteReportReply"> & { + /** + * @generated from field: capabilities.blockchain.evm.v1alpha.TxStatus tx_status = 1; + */ + txStatus: TxStatus; + + /** + * @generated from field: optional capabilities.blockchain.evm.v1alpha.ReceiverContractExecutionStatus receiver_contract_execution_status = 2; + */ + receiverContractExecutionStatus?: ReceiverContractExecutionStatus; + + /** + * @generated from field: optional bytes tx_hash = 3; + */ + txHash?: Uint8Array; + + /** + * @generated from field: optional values.v1.BigInt transaction_fee = 4; + */ + transactionFee?: BigInt; + + /** + * @generated from field: optional string error_message = 5; + */ + errorMessage?: string; +}; /** * @generated from message capabilities.blockchain.evm.v1alpha.WriteReportReply */ export type WriteReportReplyJson = { - /** - * @generated from field: capabilities.blockchain.evm.v1alpha.TxStatus tx_status = 1; - */ - txStatus?: TxStatusJson - - /** - * @generated from field: optional capabilities.blockchain.evm.v1alpha.ReceiverContractExecutionStatus receiver_contract_execution_status = 2; - */ - receiverContractExecutionStatus?: ReceiverContractExecutionStatusJson - - /** - * @generated from field: optional bytes tx_hash = 3; - */ - txHash?: string - - /** - * @generated from field: optional values.v1.BigInt transaction_fee = 4; - */ - transactionFee?: BigIntJson - - /** - * @generated from field: optional string error_message = 5; - */ - errorMessage?: string -} + /** + * @generated from field: capabilities.blockchain.evm.v1alpha.TxStatus tx_status = 1; + */ + txStatus?: TxStatusJson; + + /** + * @generated from field: optional capabilities.blockchain.evm.v1alpha.ReceiverContractExecutionStatus receiver_contract_execution_status = 2; + */ + receiverContractExecutionStatus?: ReceiverContractExecutionStatusJson; + + /** + * @generated from field: optional bytes tx_hash = 3; + */ + txHash?: string; + + /** + * @generated from field: optional values.v1.BigInt transaction_fee = 4; + */ + transactionFee?: BigIntJson; + + /** + * @generated from field: optional string error_message = 5; + */ + errorMessage?: string; +}; /** * Describes the message capabilities.blockchain.evm.v1alpha.WriteReportReply. * Use `create(WriteReportReplySchema)` to create a new message. */ -export const WriteReportReplySchema: GenMessage< - WriteReportReply, - { jsonType: WriteReportReplyJson } -> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 28) +export const WriteReportReplySchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_evm_v1alpha_client, 28); /** * @generated from enum capabilities.blockchain.evm.v1alpha.ConfidenceLevel */ export enum ConfidenceLevel { - /** - * @generated from enum value: CONFIDENCE_LEVEL_SAFE = 0; - */ - SAFE = 0, - - /** - * @generated from enum value: CONFIDENCE_LEVEL_LATEST = 1; - */ - LATEST = 1, - - /** - * @generated from enum value: CONFIDENCE_LEVEL_FINALIZED = 2; - */ - FINALIZED = 2, + /** + * @generated from enum value: CONFIDENCE_LEVEL_SAFE = 0; + */ + SAFE = 0, + + /** + * @generated from enum value: CONFIDENCE_LEVEL_LATEST = 1; + */ + LATEST = 1, + + /** + * @generated from enum value: CONFIDENCE_LEVEL_FINALIZED = 2; + */ + FINALIZED = 2, } /** * @generated from enum capabilities.blockchain.evm.v1alpha.ConfidenceLevel */ -export type ConfidenceLevelJson = - | 'CONFIDENCE_LEVEL_SAFE' - | 'CONFIDENCE_LEVEL_LATEST' - | 'CONFIDENCE_LEVEL_FINALIZED' +export type ConfidenceLevelJson = "CONFIDENCE_LEVEL_SAFE" | "CONFIDENCE_LEVEL_LATEST" | "CONFIDENCE_LEVEL_FINALIZED"; /** * Describes the enum capabilities.blockchain.evm.v1alpha.ConfidenceLevel. */ -export const ConfidenceLevelSchema: GenEnum = - /*@__PURE__*/ - enumDesc(file_capabilities_blockchain_evm_v1alpha_client, 0) +export const ConfidenceLevelSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_capabilities_blockchain_evm_v1alpha_client, 0); /** * @generated from enum capabilities.blockchain.evm.v1alpha.ReceiverContractExecutionStatus */ export enum ReceiverContractExecutionStatus { - /** - * @generated from enum value: RECEIVER_CONTRACT_EXECUTION_STATUS_SUCCESS = 0; - */ - SUCCESS = 0, - - /** - * @generated from enum value: RECEIVER_CONTRACT_EXECUTION_STATUS_REVERTED = 1; - */ - REVERTED = 1, + /** + * @generated from enum value: RECEIVER_CONTRACT_EXECUTION_STATUS_SUCCESS = 0; + */ + SUCCESS = 0, + + /** + * @generated from enum value: RECEIVER_CONTRACT_EXECUTION_STATUS_REVERTED = 1; + */ + REVERTED = 1, } /** * @generated from enum capabilities.blockchain.evm.v1alpha.ReceiverContractExecutionStatus */ -export type ReceiverContractExecutionStatusJson = - | 'RECEIVER_CONTRACT_EXECUTION_STATUS_SUCCESS' - | 'RECEIVER_CONTRACT_EXECUTION_STATUS_REVERTED' +export type ReceiverContractExecutionStatusJson = "RECEIVER_CONTRACT_EXECUTION_STATUS_SUCCESS" | "RECEIVER_CONTRACT_EXECUTION_STATUS_REVERTED"; /** * Describes the enum capabilities.blockchain.evm.v1alpha.ReceiverContractExecutionStatus. */ -export const ReceiverContractExecutionStatusSchema: GenEnum< - ReceiverContractExecutionStatus, - ReceiverContractExecutionStatusJson -> = /*@__PURE__*/ enumDesc(file_capabilities_blockchain_evm_v1alpha_client, 1) +export const ReceiverContractExecutionStatusSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_capabilities_blockchain_evm_v1alpha_client, 1); /** * @generated from enum capabilities.blockchain.evm.v1alpha.TxStatus */ export enum TxStatus { - /** - * @generated from enum value: TX_STATUS_FATAL = 0; - */ - FATAL = 0, - - /** - * @generated from enum value: TX_STATUS_REVERTED = 1; - */ - REVERTED = 1, - - /** - * @generated from enum value: TX_STATUS_SUCCESS = 2; - */ - SUCCESS = 2, + /** + * @generated from enum value: TX_STATUS_FATAL = 0; + */ + FATAL = 0, + + /** + * @generated from enum value: TX_STATUS_REVERTED = 1; + */ + REVERTED = 1, + + /** + * @generated from enum value: TX_STATUS_SUCCESS = 2; + */ + SUCCESS = 2, } /** * @generated from enum capabilities.blockchain.evm.v1alpha.TxStatus */ -export type TxStatusJson = 'TX_STATUS_FATAL' | 'TX_STATUS_REVERTED' | 'TX_STATUS_SUCCESS' +export type TxStatusJson = "TX_STATUS_FATAL" | "TX_STATUS_REVERTED" | "TX_STATUS_SUCCESS"; /** * Describes the enum capabilities.blockchain.evm.v1alpha.TxStatus. */ -export const TxStatusSchema: GenEnum = - /*@__PURE__*/ - enumDesc(file_capabilities_blockchain_evm_v1alpha_client, 2) +export const TxStatusSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_capabilities_blockchain_evm_v1alpha_client, 2); /** * @generated from service capabilities.blockchain.evm.v1alpha.Client */ export const Client: GenService<{ - /** - * @generated from rpc capabilities.blockchain.evm.v1alpha.Client.CallContract - */ - callContract: { - methodKind: 'unary' - input: typeof CallContractRequestSchema - output: typeof CallContractReplySchema - } - /** - * @generated from rpc capabilities.blockchain.evm.v1alpha.Client.FilterLogs - */ - filterLogs: { - methodKind: 'unary' - input: typeof FilterLogsRequestSchema - output: typeof FilterLogsReplySchema - } - /** - * @generated from rpc capabilities.blockchain.evm.v1alpha.Client.BalanceAt - */ - balanceAt: { - methodKind: 'unary' - input: typeof BalanceAtRequestSchema - output: typeof BalanceAtReplySchema - } - /** - * @generated from rpc capabilities.blockchain.evm.v1alpha.Client.EstimateGas - */ - estimateGas: { - methodKind: 'unary' - input: typeof EstimateGasRequestSchema - output: typeof EstimateGasReplySchema - } - /** - * @generated from rpc capabilities.blockchain.evm.v1alpha.Client.GetTransactionByHash - */ - getTransactionByHash: { - methodKind: 'unary' - input: typeof GetTransactionByHashRequestSchema - output: typeof GetTransactionByHashReplySchema - } - /** - * @generated from rpc capabilities.blockchain.evm.v1alpha.Client.GetTransactionReceipt - */ - getTransactionReceipt: { - methodKind: 'unary' - input: typeof GetTransactionReceiptRequestSchema - output: typeof GetTransactionReceiptReplySchema - } - /** - * @generated from rpc capabilities.blockchain.evm.v1alpha.Client.HeaderByNumber - */ - headerByNumber: { - methodKind: 'unary' - input: typeof HeaderByNumberRequestSchema - output: typeof HeaderByNumberReplySchema - } - /** - * @generated from rpc capabilities.blockchain.evm.v1alpha.Client.RegisterLogTracking - */ - registerLogTracking: { - methodKind: 'unary' - input: typeof RegisterLogTrackingRequestSchema - output: typeof EmptySchema - } - /** - * @generated from rpc capabilities.blockchain.evm.v1alpha.Client.UnregisterLogTracking - */ - unregisterLogTracking: { - methodKind: 'unary' - input: typeof UnregisterLogTrackingRequestSchema - output: typeof EmptySchema - } - /** - * @generated from rpc capabilities.blockchain.evm.v1alpha.Client.LogTrigger - */ - logTrigger: { - methodKind: 'server_streaming' - input: typeof FilterLogTriggerRequestSchema - output: typeof LogSchema - } - /** - * @generated from rpc capabilities.blockchain.evm.v1alpha.Client.WriteReport - */ - writeReport: { - methodKind: 'unary' - input: typeof WriteReportRequestSchema - output: typeof WriteReportReplySchema - } -}> = /*@__PURE__*/ serviceDesc(file_capabilities_blockchain_evm_v1alpha_client, 0) + /** + * @generated from rpc capabilities.blockchain.evm.v1alpha.Client.CallContract + */ + callContract: { + methodKind: "unary"; + input: typeof CallContractRequestSchema; + output: typeof CallContractReplySchema; + }, + /** + * @generated from rpc capabilities.blockchain.evm.v1alpha.Client.FilterLogs + */ + filterLogs: { + methodKind: "unary"; + input: typeof FilterLogsRequestSchema; + output: typeof FilterLogsReplySchema; + }, + /** + * @generated from rpc capabilities.blockchain.evm.v1alpha.Client.BalanceAt + */ + balanceAt: { + methodKind: "unary"; + input: typeof BalanceAtRequestSchema; + output: typeof BalanceAtReplySchema; + }, + /** + * @generated from rpc capabilities.blockchain.evm.v1alpha.Client.EstimateGas + */ + estimateGas: { + methodKind: "unary"; + input: typeof EstimateGasRequestSchema; + output: typeof EstimateGasReplySchema; + }, + /** + * @generated from rpc capabilities.blockchain.evm.v1alpha.Client.GetTransactionByHash + */ + getTransactionByHash: { + methodKind: "unary"; + input: typeof GetTransactionByHashRequestSchema; + output: typeof GetTransactionByHashReplySchema; + }, + /** + * @generated from rpc capabilities.blockchain.evm.v1alpha.Client.GetTransactionReceipt + */ + getTransactionReceipt: { + methodKind: "unary"; + input: typeof GetTransactionReceiptRequestSchema; + output: typeof GetTransactionReceiptReplySchema; + }, + /** + * @generated from rpc capabilities.blockchain.evm.v1alpha.Client.HeaderByNumber + */ + headerByNumber: { + methodKind: "unary"; + input: typeof HeaderByNumberRequestSchema; + output: typeof HeaderByNumberReplySchema; + }, + /** + * @generated from rpc capabilities.blockchain.evm.v1alpha.Client.RegisterLogTracking + */ + registerLogTracking: { + methodKind: "unary"; + input: typeof RegisterLogTrackingRequestSchema; + output: typeof EmptySchema; + }, + /** + * @generated from rpc capabilities.blockchain.evm.v1alpha.Client.UnregisterLogTracking + */ + unregisterLogTracking: { + methodKind: "unary"; + input: typeof UnregisterLogTrackingRequestSchema; + output: typeof EmptySchema; + }, + /** + * @generated from rpc capabilities.blockchain.evm.v1alpha.Client.LogTrigger + */ + logTrigger: { + methodKind: "server_streaming"; + input: typeof FilterLogTriggerRequestSchema; + output: typeof LogSchema; + }, + /** + * @generated from rpc capabilities.blockchain.evm.v1alpha.Client.WriteReport + */ + writeReport: { + methodKind: "unary"; + input: typeof WriteReportRequestSchema; + output: typeof WriteReportReplySchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_capabilities_blockchain_evm_v1alpha_client, 0); + diff --git a/src/generated/capabilities/internal/actionandtrigger/v1/action_and_trigger_pb.ts b/src/generated/capabilities/internal/actionandtrigger/v1/action_and_trigger_pb.ts index 53a10721..6cba3f9b 100644 --- a/src/generated/capabilities/internal/actionandtrigger/v1/action_and_trigger_pb.ts +++ b/src/generated/capabilities/internal/actionandtrigger/v1/action_and_trigger_pb.ts @@ -2,161 +2,155 @@ // @generated from file capabilities/internal/actionandtrigger/v1/action_and_trigger.proto (package capabilities.internal.actionandtrigger.v1, syntax proto3) /* eslint-disable */ -import type { GenFile, GenMessage, GenService } from '@bufbuild/protobuf/codegenv2' -import { fileDesc, messageDesc, serviceDesc } from '@bufbuild/protobuf/codegenv2' -import { file_tools_generator_v1alpha_cre_metadata } from '../../../../tools/generator/v1alpha/cre_metadata_pb' -import type { Message } from '@bufbuild/protobuf' +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import { file_tools_generator_v1alpha_cre_metadata } from "../../../../tools/generator/v1alpha/cre_metadata_pb"; +import type { Message } from "@bufbuild/protobuf"; /** * Describes the file capabilities/internal/actionandtrigger/v1/action_and_trigger.proto. */ -export const file_capabilities_internal_actionandtrigger_v1_action_and_trigger: GenFile = - /*@__PURE__*/ - fileDesc( - 'CkJjYXBhYmlsaXRpZXMvaW50ZXJuYWwvYWN0aW9uYW5kdHJpZ2dlci92M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YXBhYmlsaXRpZXM6OkludGVybmFsOjpBY3Rpb25hbmR0cmlnZ2VyOjpWMWIGcHJvdG8z", [file_tools_generator_v1alpha_cre_metadata]); /** * @generated from message capabilities.internal.actionandtrigger.v1.Config */ -export type Config = Message<'capabilities.internal.actionandtrigger.v1.Config'> & { - /** - * @generated from field: string name = 1; - */ - name: string - - /** - * @generated from field: int32 number = 2; - */ - number: number -} +export type Config = Message<"capabilities.internal.actionandtrigger.v1.Config"> & { + /** + * @generated from field: string name = 1; + */ + name: string; + + /** + * @generated from field: int32 number = 2; + */ + number: number; +}; /** * @generated from message capabilities.internal.actionandtrigger.v1.Config */ export type ConfigJson = { - /** - * @generated from field: string name = 1; - */ - name?: string + /** + * @generated from field: string name = 1; + */ + name?: string; - /** - * @generated from field: int32 number = 2; - */ - number?: number -} + /** + * @generated from field: int32 number = 2; + */ + number?: number; +}; /** * Describes the message capabilities.internal.actionandtrigger.v1.Config. * Use `create(ConfigSchema)` to create a new message. */ -export const ConfigSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_internal_actionandtrigger_v1_action_and_trigger, 0) +export const ConfigSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_internal_actionandtrigger_v1_action_and_trigger, 0); /** * @generated from message capabilities.internal.actionandtrigger.v1.TriggerEvent */ -export type TriggerEvent = Message<'capabilities.internal.actionandtrigger.v1.TriggerEvent'> & { - /** - * @generated from field: string cool_output = 1; - */ - coolOutput: string -} +export type TriggerEvent = Message<"capabilities.internal.actionandtrigger.v1.TriggerEvent"> & { + /** + * @generated from field: string cool_output = 1; + */ + coolOutput: string; +}; /** * @generated from message capabilities.internal.actionandtrigger.v1.TriggerEvent */ export type TriggerEventJson = { - /** - * @generated from field: string cool_output = 1; - */ - coolOutput?: string -} + /** + * @generated from field: string cool_output = 1; + */ + coolOutput?: string; +}; /** * Describes the message capabilities.internal.actionandtrigger.v1.TriggerEvent. * Use `create(TriggerEventSchema)` to create a new message. */ -export const TriggerEventSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_internal_actionandtrigger_v1_action_and_trigger, 1) +export const TriggerEventSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_internal_actionandtrigger_v1_action_and_trigger, 1); /** * @generated from message capabilities.internal.actionandtrigger.v1.Input */ -export type Input = Message<'capabilities.internal.actionandtrigger.v1.Input'> & { - /** - * @generated from field: string name = 1; - */ - name: string -} +export type Input = Message<"capabilities.internal.actionandtrigger.v1.Input"> & { + /** + * @generated from field: string name = 1; + */ + name: string; +}; /** * @generated from message capabilities.internal.actionandtrigger.v1.Input */ export type InputJson = { - /** - * @generated from field: string name = 1; - */ - name?: string -} + /** + * @generated from field: string name = 1; + */ + name?: string; +}; /** * Describes the message capabilities.internal.actionandtrigger.v1.Input. * Use `create(InputSchema)` to create a new message. */ -export const InputSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_internal_actionandtrigger_v1_action_and_trigger, 2) +export const InputSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_internal_actionandtrigger_v1_action_and_trigger, 2); /** * @generated from message capabilities.internal.actionandtrigger.v1.Output */ -export type Output = Message<'capabilities.internal.actionandtrigger.v1.Output'> & { - /** - * @generated from field: string welcome = 1; - */ - welcome: string -} +export type Output = Message<"capabilities.internal.actionandtrigger.v1.Output"> & { + /** + * @generated from field: string welcome = 1; + */ + welcome: string; +}; /** * @generated from message capabilities.internal.actionandtrigger.v1.Output */ export type OutputJson = { - /** - * @generated from field: string welcome = 1; - */ - welcome?: string -} + /** + * @generated from field: string welcome = 1; + */ + welcome?: string; +}; /** * Describes the message capabilities.internal.actionandtrigger.v1.Output. * Use `create(OutputSchema)` to create a new message. */ -export const OutputSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_internal_actionandtrigger_v1_action_and_trigger, 3) +export const OutputSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_internal_actionandtrigger_v1_action_and_trigger, 3); /** * @generated from service capabilities.internal.actionandtrigger.v1.Basic */ export const Basic: GenService<{ - /** - * @generated from rpc capabilities.internal.actionandtrigger.v1.Basic.Action - */ - action: { - methodKind: 'unary' - input: typeof InputSchema - output: typeof OutputSchema - } - /** - * @generated from rpc capabilities.internal.actionandtrigger.v1.Basic.Trigger - */ - trigger: { - methodKind: 'server_streaming' - input: typeof ConfigSchema - output: typeof TriggerEventSchema - } -}> = /*@__PURE__*/ serviceDesc(file_capabilities_internal_actionandtrigger_v1_action_and_trigger, 0) + /** + * @generated from rpc capabilities.internal.actionandtrigger.v1.Basic.Action + */ + action: { + methodKind: "unary"; + input: typeof InputSchema; + output: typeof OutputSchema; + }, + /** + * @generated from rpc capabilities.internal.actionandtrigger.v1.Basic.Trigger + */ + trigger: { + methodKind: "server_streaming"; + input: typeof ConfigSchema; + output: typeof TriggerEventSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_capabilities_internal_actionandtrigger_v1_action_and_trigger, 0); + diff --git a/src/generated/capabilities/internal/basicaction/v1/basic_action_pb.ts b/src/generated/capabilities/internal/basicaction/v1/basic_action_pb.ts index 4957ffbf..f225faed 100644 --- a/src/generated/capabilities/internal/basicaction/v1/basic_action_pb.ts +++ b/src/generated/capabilities/internal/basicaction/v1/basic_action_pb.ts @@ -2,76 +2,70 @@ // @generated from file capabilities/internal/basicaction/v1/basic_action.proto (package capabilities.internal.basicaction.v1, syntax proto3) /* eslint-disable */ -import type { GenFile, GenMessage, GenService } from '@bufbuild/protobuf/codegenv2' -import { fileDesc, messageDesc, serviceDesc } from '@bufbuild/protobuf/codegenv2' -import { file_tools_generator_v1alpha_cre_metadata } from '../../../../tools/generator/v1alpha/cre_metadata_pb' -import type { Message } from '@bufbuild/protobuf' +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import { file_tools_generator_v1alpha_cre_metadata } from "../../../../tools/generator/v1alpha/cre_metadata_pb"; +import type { Message } from "@bufbuild/protobuf"; /** * Describes the file capabilities/internal/basicaction/v1/basic_action.proto. */ -export const file_capabilities_internal_basicaction_v1_basic_action: GenFile = - /*@__PURE__*/ - fileDesc( - 'CjdjYXBhYmlsaXRpZXMvaW50ZXJuYWwvYmFzaWNhY3Rpb24vdjEvYmFzaWNfYWN0aW9uLnByb3RvEiRjYXBhYmlsaXRpZXMuaW50ZXJuYWwuYmFzaWNhY3Rpb24udjEiHQoGSW5wdXRzEhMKC2lucHV0X3RoaW5nGAEgASgIIiAKB091dHB1dHMSFQoNYWRhcHRlZF90aGluZxgBIAEoCTKcAQoLQmFzaWNBY3Rpb24SbAoNUGVyZm9ybUFjdGlvbhIsLmNhcGFiaWxpdGllcy5pbnRlcm5hbC5iYXNpY2FjdGlvbi52MS5JbnB1dHMaLS5jYXBhYmlsaXRpZXMuaW50ZXJuYWwuYmFzaWNhY3Rpb24udjEuT3V0cHV0cxofgrUYGwgBEhdiYXNpYy10ZXN0LWFjdGlvbkAxLjAuMELvAQooY29tLmNhcGFiaWxpdGllcy5pbnRlcm5hbC5iYXNpY2FjdGlvbi52MUIQQmFzaWNBY3Rpb25Qcm90b1ABogIDQ0lCqgIkQ2FwYWJpbGl0aWVzLkludGVybmFsLkJhc2ljYWN0aW9uLlYxygIkQ2FwYWJpbGl0aWVzXEludGVybmFsXEJhc2ljYWN0aW9uXFYx4gIwQ2FwYWJpbGl0aWVzXEludGVybmFsXEJhc2ljYWN0aW9uXFYxXEdQQk1ldGFkYXRh6gInQ2FwYWJpbGl0aWVzOjpJbnRlcm5hbDo6QmFzaWNhY3Rpb246OlYxYgZwcm90bzM', - [file_tools_generator_v1alpha_cre_metadata], - ) +export const file_capabilities_internal_basicaction_v1_basic_action: GenFile = /*@__PURE__*/ + fileDesc("CjdjYXBhYmlsaXRpZXMvaW50ZXJuYWwvYmFzaWNhY3Rpb24vdjEvYmFzaWNfYWN0aW9uLnByb3RvEiRjYXBhYmlsaXRpZXMuaW50ZXJuYWwuYmFzaWNhY3Rpb24udjEiHQoGSW5wdXRzEhMKC2lucHV0X3RoaW5nGAEgASgIIiAKB091dHB1dHMSFQoNYWRhcHRlZF90aGluZxgBIAEoCTKcAQoLQmFzaWNBY3Rpb24SbAoNUGVyZm9ybUFjdGlvbhIsLmNhcGFiaWxpdGllcy5pbnRlcm5hbC5iYXNpY2FjdGlvbi52MS5JbnB1dHMaLS5jYXBhYmlsaXRpZXMuaW50ZXJuYWwuYmFzaWNhY3Rpb24udjEuT3V0cHV0cxofgrUYGwgBEhdiYXNpYy10ZXN0LWFjdGlvbkAxLjAuMELvAQooY29tLmNhcGFiaWxpdGllcy5pbnRlcm5hbC5iYXNpY2FjdGlvbi52MUIQQmFzaWNBY3Rpb25Qcm90b1ABogIDQ0lCqgIkQ2FwYWJpbGl0aWVzLkludGVybmFsLkJhc2ljYWN0aW9uLlYxygIkQ2FwYWJpbGl0aWVzXEludGVybmFsXEJhc2ljYWN0aW9uXFYx4gIwQ2FwYWJpbGl0aWVzXEludGVybmFsXEJhc2ljYWN0aW9uXFYxXEdQQk1ldGFkYXRh6gInQ2FwYWJpbGl0aWVzOjpJbnRlcm5hbDo6QmFzaWNhY3Rpb246OlYxYgZwcm90bzM", [file_tools_generator_v1alpha_cre_metadata]); /** * @generated from message capabilities.internal.basicaction.v1.Inputs */ -export type Inputs = Message<'capabilities.internal.basicaction.v1.Inputs'> & { - /** - * @generated from field: bool input_thing = 1; - */ - inputThing: boolean -} +export type Inputs = Message<"capabilities.internal.basicaction.v1.Inputs"> & { + /** + * @generated from field: bool input_thing = 1; + */ + inputThing: boolean; +}; /** * @generated from message capabilities.internal.basicaction.v1.Inputs */ export type InputsJson = { - /** - * @generated from field: bool input_thing = 1; - */ - inputThing?: boolean -} + /** + * @generated from field: bool input_thing = 1; + */ + inputThing?: boolean; +}; /** * Describes the message capabilities.internal.basicaction.v1.Inputs. * Use `create(InputsSchema)` to create a new message. */ -export const InputsSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_internal_basicaction_v1_basic_action, 0) +export const InputsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_internal_basicaction_v1_basic_action, 0); /** * @generated from message capabilities.internal.basicaction.v1.Outputs */ -export type Outputs = Message<'capabilities.internal.basicaction.v1.Outputs'> & { - /** - * @generated from field: string adapted_thing = 1; - */ - adaptedThing: string -} +export type Outputs = Message<"capabilities.internal.basicaction.v1.Outputs"> & { + /** + * @generated from field: string adapted_thing = 1; + */ + adaptedThing: string; +}; /** * @generated from message capabilities.internal.basicaction.v1.Outputs */ export type OutputsJson = { - /** - * @generated from field: string adapted_thing = 1; - */ - adaptedThing?: string -} + /** + * @generated from field: string adapted_thing = 1; + */ + adaptedThing?: string; +}; /** * Describes the message capabilities.internal.basicaction.v1.Outputs. * Use `create(OutputsSchema)` to create a new message. */ -export const OutputsSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_internal_basicaction_v1_basic_action, 1) +export const OutputsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_internal_basicaction_v1_basic_action, 1); /** * This action server for testing purposes only. @@ -81,16 +75,18 @@ export const OutputsSchema: GenMessage = * @generated from service capabilities.internal.basicaction.v1.BasicAction */ export const BasicAction: GenService<{ - /** - * This comment tests the generator's ability to handle leading comments on methods. - * - * This comment tests the generator's ability to handle trailing comments on methods. - * - * @generated from rpc capabilities.internal.basicaction.v1.BasicAction.PerformAction - */ - performAction: { - methodKind: 'unary' - input: typeof InputsSchema - output: typeof OutputsSchema - } -}> = /*@__PURE__*/ serviceDesc(file_capabilities_internal_basicaction_v1_basic_action, 0) + /** + * This comment tests the generator's ability to handle leading comments on methods. + * + * This comment tests the generator's ability to handle trailing comments on methods. + * + * @generated from rpc capabilities.internal.basicaction.v1.BasicAction.PerformAction + */ + performAction: { + methodKind: "unary"; + input: typeof InputsSchema; + output: typeof OutputsSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_capabilities_internal_basicaction_v1_basic_action, 0); + diff --git a/src/generated/capabilities/internal/basictrigger/v1/basic_trigger_pb.ts b/src/generated/capabilities/internal/basictrigger/v1/basic_trigger_pb.ts index c62a37dc..8f8a538f 100644 --- a/src/generated/capabilities/internal/basictrigger/v1/basic_trigger_pb.ts +++ b/src/generated/capabilities/internal/basictrigger/v1/basic_trigger_pb.ts @@ -2,97 +2,93 @@ // @generated from file capabilities/internal/basictrigger/v1/basic_trigger.proto (package capabilities.internal.basictrigger.v1, syntax proto3) /* eslint-disable */ -import type { GenFile, GenMessage, GenService } from '@bufbuild/protobuf/codegenv2' -import { fileDesc, messageDesc, serviceDesc } from '@bufbuild/protobuf/codegenv2' -import { file_tools_generator_v1alpha_cre_metadata } from '../../../../tools/generator/v1alpha/cre_metadata_pb' -import type { Message } from '@bufbuild/protobuf' +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import { file_tools_generator_v1alpha_cre_metadata } from "../../../../tools/generator/v1alpha/cre_metadata_pb"; +import type { Message } from "@bufbuild/protobuf"; /** * Describes the file capabilities/internal/basictrigger/v1/basic_trigger.proto. */ -export const file_capabilities_internal_basictrigger_v1_basic_trigger: GenFile = - /*@__PURE__*/ - fileDesc( - 'CjljYXBhYmlsaXRpZXMvaW50ZXJuYWwvYmFzaWN0cmlnZ2VyL3YxL2Jhc2ljX3RyaWdnZXIucHJvdG8SJWNhcGFiaWxpdGllcy5pbnRlcm5hbC5iYXNpY3RyaWdnZXIudjEiJgoGQ29uZmlnEgwKBG5hbWUYASABKAkSDgoGbnVtYmVyGAIgASgFIh4KB091dHB1dHMSEwoLY29vbF9vdXRwdXQYASABKAkylQEKBUJhc2ljEmoKB1RyaWdnZXISLS5jYXBhYmlsaXRpZXMuaW50ZXJuYWwuYmFzaWN0cmlnZ2VyLnYxLkNvbmZpZxouLmNhcGFiaWxpdGllcy5pbnRlcm5hbC5iYXNpY3RyaWdnZXIudjEuT3V0cHV0czABGiCCtRgcCAESGGJhc2ljLXRlc3QtdHJpZ2dlckAxLjAuMEL1AQopY29tLmNhcGFiaWxpdGllcy5pbnRlcm5hbC5iYXNpY3RyaWdnZXIudjFCEUJhc2ljVHJpZ2dlclByb3RvUAGiAgNDSUKqAiVDYXBhYmlsaXRpZXMuSW50ZXJuYWwuQmFzaWN0cmlnZ2VyLlYxygIlQ2FwYWJpbGl0aWVzXEludGVybmFsXEJhc2ljdHJpZ2dlclxWMeICMUNhcGFiaWxpdGllc1xJbnRlcm5hbFxCYXNpY3RyaWdnZXJcVjFcR1BCTWV0YWRhdGHqAihDYXBhYmlsaXRpZXM6OkludGVybmFsOjpCYXNpY3RyaWdnZXI6OlYxYgZwcm90bzM', - [file_tools_generator_v1alpha_cre_metadata], - ) +export const file_capabilities_internal_basictrigger_v1_basic_trigger: GenFile = /*@__PURE__*/ + fileDesc("CjljYXBhYmlsaXRpZXMvaW50ZXJuYWwvYmFzaWN0cmlnZ2VyL3YxL2Jhc2ljX3RyaWdnZXIucHJvdG8SJWNhcGFiaWxpdGllcy5pbnRlcm5hbC5iYXNpY3RyaWdnZXIudjEiJgoGQ29uZmlnEgwKBG5hbWUYASABKAkSDgoGbnVtYmVyGAIgASgFIh4KB091dHB1dHMSEwoLY29vbF9vdXRwdXQYASABKAkylQEKBUJhc2ljEmoKB1RyaWdnZXISLS5jYXBhYmlsaXRpZXMuaW50ZXJuYWwuYmFzaWN0cmlnZ2VyLnYxLkNvbmZpZxouLmNhcGFiaWxpdGllcy5pbnRlcm5hbC5iYXNpY3RyaWdnZXIudjEuT3V0cHV0czABGiCCtRgcCAESGGJhc2ljLXRlc3QtdHJpZ2dlckAxLjAuMEL1AQopY29tLmNhcGFiaWxpdGllcy5pbnRlcm5hbC5iYXNpY3RyaWdnZXIudjFCEUJhc2ljVHJpZ2dlclByb3RvUAGiAgNDSUKqAiVDYXBhYmlsaXRpZXMuSW50ZXJuYWwuQmFzaWN0cmlnZ2VyLlYxygIlQ2FwYWJpbGl0aWVzXEludGVybmFsXEJhc2ljdHJpZ2dlclxWMeICMUNhcGFiaWxpdGllc1xJbnRlcm5hbFxCYXNpY3RyaWdnZXJcVjFcR1BCTWV0YWRhdGHqAihDYXBhYmlsaXRpZXM6OkludGVybmFsOjpCYXNpY3RyaWdnZXI6OlYxYgZwcm90bzM", [file_tools_generator_v1alpha_cre_metadata]); /** * @generated from message capabilities.internal.basictrigger.v1.Config */ -export type Config = Message<'capabilities.internal.basictrigger.v1.Config'> & { - /** - * @generated from field: string name = 1; - */ - name: string +export type Config = Message<"capabilities.internal.basictrigger.v1.Config"> & { + /** + * @generated from field: string name = 1; + */ + name: string; - /** - * @generated from field: int32 number = 2; - */ - number: number -} + /** + * @generated from field: int32 number = 2; + */ + number: number; +}; /** * @generated from message capabilities.internal.basictrigger.v1.Config */ export type ConfigJson = { - /** - * @generated from field: string name = 1; - */ - name?: string + /** + * @generated from field: string name = 1; + */ + name?: string; - /** - * @generated from field: int32 number = 2; - */ - number?: number -} + /** + * @generated from field: int32 number = 2; + */ + number?: number; +}; /** * Describes the message capabilities.internal.basictrigger.v1.Config. * Use `create(ConfigSchema)` to create a new message. */ -export const ConfigSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_internal_basictrigger_v1_basic_trigger, 0) +export const ConfigSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_internal_basictrigger_v1_basic_trigger, 0); /** * @generated from message capabilities.internal.basictrigger.v1.Outputs */ -export type Outputs = Message<'capabilities.internal.basictrigger.v1.Outputs'> & { - /** - * @generated from field: string cool_output = 1; - */ - coolOutput: string -} +export type Outputs = Message<"capabilities.internal.basictrigger.v1.Outputs"> & { + /** + * @generated from field: string cool_output = 1; + */ + coolOutput: string; +}; /** * @generated from message capabilities.internal.basictrigger.v1.Outputs */ export type OutputsJson = { - /** - * @generated from field: string cool_output = 1; - */ - coolOutput?: string -} + /** + * @generated from field: string cool_output = 1; + */ + coolOutput?: string; +}; /** * Describes the message capabilities.internal.basictrigger.v1.Outputs. * Use `create(OutputsSchema)` to create a new message. */ -export const OutputsSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_internal_basictrigger_v1_basic_trigger, 1) +export const OutputsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_internal_basictrigger_v1_basic_trigger, 1); /** * @generated from service capabilities.internal.basictrigger.v1.Basic */ export const Basic: GenService<{ - /** - * @generated from rpc capabilities.internal.basictrigger.v1.Basic.Trigger - */ - trigger: { - methodKind: 'server_streaming' - input: typeof ConfigSchema - output: typeof OutputsSchema - } -}> = /*@__PURE__*/ serviceDesc(file_capabilities_internal_basictrigger_v1_basic_trigger, 0) + /** + * @generated from rpc capabilities.internal.basictrigger.v1.Basic.Trigger + */ + trigger: { + methodKind: "server_streaming"; + input: typeof ConfigSchema; + output: typeof OutputsSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_capabilities_internal_basictrigger_v1_basic_trigger, 0); + diff --git a/src/generated/capabilities/internal/consensus/v1alpha/consensus_pb.ts b/src/generated/capabilities/internal/consensus/v1alpha/consensus_pb.ts index 0accb578..2977a437 100644 --- a/src/generated/capabilities/internal/consensus/v1alpha/consensus_pb.ts +++ b/src/generated/capabilities/internal/consensus/v1alpha/consensus_pb.ts @@ -2,46 +2,40 @@ // @generated from file capabilities/internal/consensus/v1alpha/consensus.proto (package capabilities.internal.consensus.v1alpha, syntax proto3) /* eslint-disable */ -import type { GenFile, GenService } from '@bufbuild/protobuf/codegenv2' -import { fileDesc, serviceDesc } from '@bufbuild/protobuf/codegenv2' -import type { - ReportRequestSchema, - ReportResponseSchema, - SimpleConsensusInputsSchema, -} from '../../../../sdk/v1alpha/sdk_pb' -import { file_sdk_v1alpha_sdk } from '../../../../sdk/v1alpha/sdk_pb' -import { file_tools_generator_v1alpha_cre_metadata } from '../../../../tools/generator/v1alpha/cre_metadata_pb' -import type { ValueSchema } from '../../../../values/v1/values_pb' -import { file_values_v1_values } from '../../../../values/v1/values_pb' +import type { GenFile, GenService } from "@bufbuild/protobuf/codegenv2"; +import { fileDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import type { ReportRequestSchema, ReportResponseSchema, SimpleConsensusInputsSchema } from "../../../../sdk/v1alpha/sdk_pb"; +import { file_sdk_v1alpha_sdk } from "../../../../sdk/v1alpha/sdk_pb"; +import { file_tools_generator_v1alpha_cre_metadata } from "../../../../tools/generator/v1alpha/cre_metadata_pb"; +import type { ValueSchema } from "../../../../values/v1/values_pb"; +import { file_values_v1_values } from "../../../../values/v1/values_pb"; /** * Describes the file capabilities/internal/consensus/v1alpha/consensus.proto. */ -export const file_capabilities_internal_consensus_v1alpha_consensus: GenFile = - /*@__PURE__*/ - fileDesc( - 'CjdjYXBhYmlsaXRpZXMvaW50ZXJuYWwvY29uc2Vuc3VzL3YxYWxwaGEvY29uc2Vuc3VzLnByb3RvEidjYXBhYmlsaXRpZXMuaW50ZXJuYWwuY29uc2Vuc3VzLnYxYWxwaGEyrQEKCUNvbnNlbnN1cxI+CgZTaW1wbGUSIi5zZGsudjFhbHBoYS5TaW1wbGVDb25zZW5zdXNJbnB1dHMaEC52YWx1ZXMudjEuVmFsdWUSQQoGUmVwb3J0Ehouc2RrLnYxYWxwaGEuUmVwb3J0UmVxdWVzdBobLnNkay52MWFscGhhLlJlcG9ydFJlc3BvbnNlGh2CtRgZCAESFWNvbnNlbnN1c0AxLjAuMC1hbHBoYUL8AQorY29tLmNhcGFiaWxpdGllcy5pbnRlcm5hbC5jb25zZW5zdXMudjFhbHBoYUIOQ29uc2Vuc3VzUHJvdG9QAaICA0NJQ6oCJ0NhcGFiaWxpdGllcy5JbnRlcm5hbC5Db25zZW5zdXMuVjFhbHBoYcoCJ0NhcGFiaWxpdGllc1xJbnRlcm5hbFxDb25zZW5zdXNcVjFhbHBoYeICM0NhcGFiaWxpdGllc1xJbnRlcm5hbFxDb25zZW5zdXNcVjFhbHBoYVxHUEJNZXRhZGF0YeoCKkNhcGFiaWxpdGllczo6SW50ZXJuYWw6OkNvbnNlbnN1czo6VjFhbHBoYWIGcHJvdG8z', - [file_sdk_v1alpha_sdk, file_tools_generator_v1alpha_cre_metadata, file_values_v1_values], - ) +export const file_capabilities_internal_consensus_v1alpha_consensus: GenFile = /*@__PURE__*/ + fileDesc("CjdjYXBhYmlsaXRpZXMvaW50ZXJuYWwvY29uc2Vuc3VzL3YxYWxwaGEvY29uc2Vuc3VzLnByb3RvEidjYXBhYmlsaXRpZXMuaW50ZXJuYWwuY29uc2Vuc3VzLnYxYWxwaGEyrQEKCUNvbnNlbnN1cxI+CgZTaW1wbGUSIi5zZGsudjFhbHBoYS5TaW1wbGVDb25zZW5zdXNJbnB1dHMaEC52YWx1ZXMudjEuVmFsdWUSQQoGUmVwb3J0Ehouc2RrLnYxYWxwaGEuUmVwb3J0UmVxdWVzdBobLnNkay52MWFscGhhLlJlcG9ydFJlc3BvbnNlGh2CtRgZCAESFWNvbnNlbnN1c0AxLjAuMC1hbHBoYUL8AQorY29tLmNhcGFiaWxpdGllcy5pbnRlcm5hbC5jb25zZW5zdXMudjFhbHBoYUIOQ29uc2Vuc3VzUHJvdG9QAaICA0NJQ6oCJ0NhcGFiaWxpdGllcy5JbnRlcm5hbC5Db25zZW5zdXMuVjFhbHBoYcoCJ0NhcGFiaWxpdGllc1xJbnRlcm5hbFxDb25zZW5zdXNcVjFhbHBoYeICM0NhcGFiaWxpdGllc1xJbnRlcm5hbFxDb25zZW5zdXNcVjFhbHBoYVxHUEJNZXRhZGF0YeoCKkNhcGFiaWxpdGllczo6SW50ZXJuYWw6OkNvbnNlbnN1czo6VjFhbHBoYWIGcHJvdG8z", [file_sdk_v1alpha_sdk, file_tools_generator_v1alpha_cre_metadata, file_values_v1_values]); /** * @generated from service capabilities.internal.consensus.v1alpha.Consensus */ export const Consensus: GenService<{ - /** - * @generated from rpc capabilities.internal.consensus.v1alpha.Consensus.Simple - */ - simple: { - methodKind: 'unary' - input: typeof SimpleConsensusInputsSchema - output: typeof ValueSchema - } - /** - * @generated from rpc capabilities.internal.consensus.v1alpha.Consensus.Report - */ - report: { - methodKind: 'unary' - input: typeof ReportRequestSchema - output: typeof ReportResponseSchema - } -}> = /*@__PURE__*/ serviceDesc(file_capabilities_internal_consensus_v1alpha_consensus, 0) + /** + * @generated from rpc capabilities.internal.consensus.v1alpha.Consensus.Simple + */ + simple: { + methodKind: "unary"; + input: typeof SimpleConsensusInputsSchema; + output: typeof ValueSchema; + }, + /** + * @generated from rpc capabilities.internal.consensus.v1alpha.Consensus.Report + */ + report: { + methodKind: "unary"; + input: typeof ReportRequestSchema; + output: typeof ReportResponseSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_capabilities_internal_consensus_v1alpha_consensus, 0); + diff --git a/src/generated/capabilities/internal/importclash/p1/v1/import_pb.ts b/src/generated/capabilities/internal/importclash/p1/v1/import_pb.ts index 4fba7663..a93fe8dd 100644 --- a/src/generated/capabilities/internal/importclash/p1/v1/import_pb.ts +++ b/src/generated/capabilities/internal/importclash/p1/v1/import_pb.ts @@ -2,43 +2,40 @@ // @generated from file capabilities/internal/importclash/p1/v1/import.proto (package capabilities.internal.importclash.p1.v1, syntax proto3) /* eslint-disable */ -import type { GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2' -import { fileDesc, messageDesc } from '@bufbuild/protobuf/codegenv2' -import type { Message } from '@bufbuild/protobuf' +import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; +import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; +import type { Message } from "@bufbuild/protobuf"; /** * Describes the file capabilities/internal/importclash/p1/v1/import.proto. */ -export const file_capabilities_internal_importclash_p1_v1_import: GenFile = - /*@__PURE__*/ - fileDesc( - 'CjRjYXBhYmlsaXRpZXMvaW50ZXJuYWwvaW1wb3J0Y2xhc2gvcDEvdjEvaW1wb3J0LnByb3RvEidjYXBhYmlsaXRpZXMuaW50ZXJuYWwuaW1wb3J0Y2xhc2gucDEudjEiGwoESXRlbRITCgtpbnB1dF90aGluZxgBIAEoCEL7AQorY29tLmNhcGFiaWxpdGllcy5pbnRlcm5hbC5pbXBvcnRjbGFzaC5wMS52MUILSW1wb3J0UHJvdG9QAaICBENJSVCqAidDYXBhYmlsaXRpZXMuSW50ZXJuYWwuSW1wb3J0Y2xhc2guUDEuVjHKAidDYXBhYmlsaXRpZXNcSW50ZXJuYWxcSW1wb3J0Y2xhc2hcUDFcVjHiAjNDYXBhYmlsaXRpZXNcSW50ZXJuYWxcSW1wb3J0Y2xhc2hcUDFcVjFcR1BCTWV0YWRhdGHqAitDYXBhYmlsaXRpZXM6OkludGVybmFsOjpJbXBvcnRjbGFzaDo6UDE6OlYxYgZwcm90bzM', - ) +export const file_capabilities_internal_importclash_p1_v1_import: GenFile = /*@__PURE__*/ + fileDesc("CjRjYXBhYmlsaXRpZXMvaW50ZXJuYWwvaW1wb3J0Y2xhc2gvcDEvdjEvaW1wb3J0LnByb3RvEidjYXBhYmlsaXRpZXMuaW50ZXJuYWwuaW1wb3J0Y2xhc2gucDEudjEiGwoESXRlbRITCgtpbnB1dF90aGluZxgBIAEoCEL7AQorY29tLmNhcGFiaWxpdGllcy5pbnRlcm5hbC5pbXBvcnRjbGFzaC5wMS52MUILSW1wb3J0UHJvdG9QAaICBENJSVCqAidDYXBhYmlsaXRpZXMuSW50ZXJuYWwuSW1wb3J0Y2xhc2guUDEuVjHKAidDYXBhYmlsaXRpZXNcSW50ZXJuYWxcSW1wb3J0Y2xhc2hcUDFcVjHiAjNDYXBhYmlsaXRpZXNcSW50ZXJuYWxcSW1wb3J0Y2xhc2hcUDFcVjFcR1BCTWV0YWRhdGHqAitDYXBhYmlsaXRpZXM6OkludGVybmFsOjpJbXBvcnRjbGFzaDo6UDE6OlYxYgZwcm90bzM"); /** * @generated from message capabilities.internal.importclash.p1.v1.Item */ -export type Item = Message<'capabilities.internal.importclash.p1.v1.Item'> & { - /** - * @generated from field: bool input_thing = 1; - */ - inputThing: boolean -} +export type Item = Message<"capabilities.internal.importclash.p1.v1.Item"> & { + /** + * @generated from field: bool input_thing = 1; + */ + inputThing: boolean; +}; /** * @generated from message capabilities.internal.importclash.p1.v1.Item */ export type ItemJson = { - /** - * @generated from field: bool input_thing = 1; - */ - inputThing?: boolean -} + /** + * @generated from field: bool input_thing = 1; + */ + inputThing?: boolean; +}; /** * Describes the message capabilities.internal.importclash.p1.v1.Item. * Use `create(ItemSchema)` to create a new message. */ -export const ItemSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_internal_importclash_p1_v1_import, 0) +export const ItemSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_internal_importclash_p1_v1_import, 0); + diff --git a/src/generated/capabilities/internal/importclash/p2/v1/import_pb.ts b/src/generated/capabilities/internal/importclash/p2/v1/import_pb.ts index b6a0cfd6..ee6a57fd 100644 --- a/src/generated/capabilities/internal/importclash/p2/v1/import_pb.ts +++ b/src/generated/capabilities/internal/importclash/p2/v1/import_pb.ts @@ -2,43 +2,40 @@ // @generated from file capabilities/internal/importclash/p2/v1/import.proto (package capabilities.internal.importclash.p2.v1, syntax proto3) /* eslint-disable */ -import type { GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2' -import { fileDesc, messageDesc } from '@bufbuild/protobuf/codegenv2' -import type { Message } from '@bufbuild/protobuf' +import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; +import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; +import type { Message } from "@bufbuild/protobuf"; /** * Describes the file capabilities/internal/importclash/p2/v1/import.proto. */ -export const file_capabilities_internal_importclash_p2_v1_import: GenFile = - /*@__PURE__*/ - fileDesc( - 'CjRjYXBhYmlsaXRpZXMvaW50ZXJuYWwvaW1wb3J0Y2xhc2gvcDIvdjEvaW1wb3J0LnByb3RvEidjYXBhYmlsaXRpZXMuaW50ZXJuYWwuaW1wb3J0Y2xhc2gucDIudjEiHQoESXRlbRIVCg1hZGFwdGVkX3RoaW5nGAEgASgJQvsBCitjb20uY2FwYWJpbGl0aWVzLmludGVybmFsLmltcG9ydGNsYXNoLnAyLnYxQgtJbXBvcnRQcm90b1ABogIEQ0lJUKoCJ0NhcGFiaWxpdGllcy5JbnRlcm5hbC5JbXBvcnRjbGFzaC5QMi5WMcoCJ0NhcGFiaWxpdGllc1xJbnRlcm5hbFxJbXBvcnRjbGFzaFxQMlxWMeICM0NhcGFiaWxpdGllc1xJbnRlcm5hbFxJbXBvcnRjbGFzaFxQMlxWMVxHUEJNZXRhZGF0YeoCK0NhcGFiaWxpdGllczo6SW50ZXJuYWw6OkltcG9ydGNsYXNoOjpQMjo6VjFiBnByb3RvMw', - ) +export const file_capabilities_internal_importclash_p2_v1_import: GenFile = /*@__PURE__*/ + fileDesc("CjRjYXBhYmlsaXRpZXMvaW50ZXJuYWwvaW1wb3J0Y2xhc2gvcDIvdjEvaW1wb3J0LnByb3RvEidjYXBhYmlsaXRpZXMuaW50ZXJuYWwuaW1wb3J0Y2xhc2gucDIudjEiHQoESXRlbRIVCg1hZGFwdGVkX3RoaW5nGAEgASgJQvsBCitjb20uY2FwYWJpbGl0aWVzLmludGVybmFsLmltcG9ydGNsYXNoLnAyLnYxQgtJbXBvcnRQcm90b1ABogIEQ0lJUKoCJ0NhcGFiaWxpdGllcy5JbnRlcm5hbC5JbXBvcnRjbGFzaC5QMi5WMcoCJ0NhcGFiaWxpdGllc1xJbnRlcm5hbFxJbXBvcnRjbGFzaFxQMlxWMeICM0NhcGFiaWxpdGllc1xJbnRlcm5hbFxJbXBvcnRjbGFzaFxQMlxWMVxHUEJNZXRhZGF0YeoCK0NhcGFiaWxpdGllczo6SW50ZXJuYWw6OkltcG9ydGNsYXNoOjpQMjo6VjFiBnByb3RvMw"); /** * @generated from message capabilities.internal.importclash.p2.v1.Item */ -export type Item = Message<'capabilities.internal.importclash.p2.v1.Item'> & { - /** - * @generated from field: string adapted_thing = 1; - */ - adaptedThing: string -} +export type Item = Message<"capabilities.internal.importclash.p2.v1.Item"> & { + /** + * @generated from field: string adapted_thing = 1; + */ + adaptedThing: string; +}; /** * @generated from message capabilities.internal.importclash.p2.v1.Item */ export type ItemJson = { - /** - * @generated from field: string adapted_thing = 1; - */ - adaptedThing?: string -} + /** + * @generated from field: string adapted_thing = 1; + */ + adaptedThing?: string; +}; /** * Describes the message capabilities.internal.importclash.p2.v1.Item. * Use `create(ItemSchema)` to create a new message. */ -export const ItemSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_internal_importclash_p2_v1_import, 0) +export const ItemSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_internal_importclash_p2_v1_import, 0); + diff --git a/src/generated/capabilities/internal/importclash/v1/clash_pb.ts b/src/generated/capabilities/internal/importclash/v1/clash_pb.ts index 33cda750..de884309 100644 --- a/src/generated/capabilities/internal/importclash/v1/clash_pb.ts +++ b/src/generated/capabilities/internal/importclash/v1/clash_pb.ts @@ -2,38 +2,32 @@ // @generated from file capabilities/internal/importclash/v1/clash.proto (package capabilities.internal.importclash.v1, syntax proto3) /* eslint-disable */ -import type { GenFile, GenService } from '@bufbuild/protobuf/codegenv2' -import { fileDesc, serviceDesc } from '@bufbuild/protobuf/codegenv2' -import type { ItemSchema } from '../p1/v1/import_pb' -import { file_capabilities_internal_importclash_p1_v1_import } from '../p1/v1/import_pb' -import type { ItemSchema as ItemSchema$1 } from '../p2/v1/import_pb' -import { file_capabilities_internal_importclash_p2_v1_import } from '../p2/v1/import_pb' -import { file_tools_generator_v1alpha_cre_metadata } from '../../../../tools/generator/v1alpha/cre_metadata_pb' +import type { GenFile, GenService } from "@bufbuild/protobuf/codegenv2"; +import { fileDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import type { ItemSchema } from "../p1/v1/import_pb"; +import { file_capabilities_internal_importclash_p1_v1_import } from "../p1/v1/import_pb"; +import type { ItemSchema as ItemSchema$1 } from "../p2/v1/import_pb"; +import { file_capabilities_internal_importclash_p2_v1_import } from "../p2/v1/import_pb"; +import { file_tools_generator_v1alpha_cre_metadata } from "../../../../tools/generator/v1alpha/cre_metadata_pb"; /** * Describes the file capabilities/internal/importclash/v1/clash.proto. */ -export const file_capabilities_internal_importclash_v1_clash: GenFile = - /*@__PURE__*/ - fileDesc( - 'CjBjYXBhYmlsaXRpZXMvaW50ZXJuYWwvaW1wb3J0Y2xhc2gvdjEvY2xhc2gucHJvdG8SJGNhcGFiaWxpdGllcy5pbnRlcm5hbC5pbXBvcnRjbGFzaC52MTKYAQoLQmFzaWNBY3Rpb24SbQoNUGVyZm9ybUFjdGlvbhItLmNhcGFiaWxpdGllcy5pbnRlcm5hbC5pbXBvcnRjbGFzaC5wMS52MS5JdGVtGi0uY2FwYWJpbGl0aWVzLmludGVybmFsLmltcG9ydGNsYXNoLnAyLnYxLkl0ZW0aGoK1GBYIARISaW1wb3J0LWNsYXNoQDEuMC4wQukBCihjb20uY2FwYWJpbGl0aWVzLmludGVybmFsLmltcG9ydGNsYXNoLnYxQgpDbGFzaFByb3RvUAGiAgNDSUmqAiRDYXBhYmlsaXRpZXMuSW50ZXJuYWwuSW1wb3J0Y2xhc2guVjHKAiRDYXBhYmlsaXRpZXNcSW50ZXJuYWxcSW1wb3J0Y2xhc2hcVjHiAjBDYXBhYmlsaXRpZXNcSW50ZXJuYWxcSW1wb3J0Y2xhc2hcVjFcR1BCTWV0YWRhdGHqAidDYXBhYmlsaXRpZXM6OkludGVybmFsOjpJbXBvcnRjbGFzaDo6VjFiBnByb3RvMw', - [ - file_capabilities_internal_importclash_p1_v1_import, - file_capabilities_internal_importclash_p2_v1_import, - file_tools_generator_v1alpha_cre_metadata, - ], - ) +export const file_capabilities_internal_importclash_v1_clash: GenFile = /*@__PURE__*/ + fileDesc("CjBjYXBhYmlsaXRpZXMvaW50ZXJuYWwvaW1wb3J0Y2xhc2gvdjEvY2xhc2gucHJvdG8SJGNhcGFiaWxpdGllcy5pbnRlcm5hbC5pbXBvcnRjbGFzaC52MTKYAQoLQmFzaWNBY3Rpb24SbQoNUGVyZm9ybUFjdGlvbhItLmNhcGFiaWxpdGllcy5pbnRlcm5hbC5pbXBvcnRjbGFzaC5wMS52MS5JdGVtGi0uY2FwYWJpbGl0aWVzLmludGVybmFsLmltcG9ydGNsYXNoLnAyLnYxLkl0ZW0aGoK1GBYIARISaW1wb3J0LWNsYXNoQDEuMC4wQukBCihjb20uY2FwYWJpbGl0aWVzLmludGVybmFsLmltcG9ydGNsYXNoLnYxQgpDbGFzaFByb3RvUAGiAgNDSUmqAiRDYXBhYmlsaXRpZXMuSW50ZXJuYWwuSW1wb3J0Y2xhc2guVjHKAiRDYXBhYmlsaXRpZXNcSW50ZXJuYWxcSW1wb3J0Y2xhc2hcVjHiAjBDYXBhYmlsaXRpZXNcSW50ZXJuYWxcSW1wb3J0Y2xhc2hcVjFcR1BCTWV0YWRhdGHqAidDYXBhYmlsaXRpZXM6OkludGVybmFsOjpJbXBvcnRjbGFzaDo6VjFiBnByb3RvMw", [file_capabilities_internal_importclash_p1_v1_import, file_capabilities_internal_importclash_p2_v1_import, file_tools_generator_v1alpha_cre_metadata]); /** * @generated from service capabilities.internal.importclash.v1.BasicAction */ export const BasicAction: GenService<{ - /** - * @generated from rpc capabilities.internal.importclash.v1.BasicAction.PerformAction - */ - performAction: { - methodKind: 'unary' - input: typeof ItemSchema - output: typeof ItemSchema$1 - } -}> = /*@__PURE__*/ serviceDesc(file_capabilities_internal_importclash_v1_clash, 0) + /** + * @generated from rpc capabilities.internal.importclash.v1.BasicAction.PerformAction + */ + performAction: { + methodKind: "unary"; + input: typeof ItemSchema; + output: typeof ItemSchema$1; + }, +}> = /*@__PURE__*/ + serviceDesc(file_capabilities_internal_importclash_v1_clash, 0); + diff --git a/src/generated/capabilities/internal/nodeaction/v1/node_action_pb.ts b/src/generated/capabilities/internal/nodeaction/v1/node_action_pb.ts index 563bb0a6..d36ac88b 100644 --- a/src/generated/capabilities/internal/nodeaction/v1/node_action_pb.ts +++ b/src/generated/capabilities/internal/nodeaction/v1/node_action_pb.ts @@ -2,87 +2,83 @@ // @generated from file capabilities/internal/nodeaction/v1/node_action.proto (package capabilities.internal.nodeaction.v1, syntax proto3) /* eslint-disable */ -import type { GenFile, GenMessage, GenService } from '@bufbuild/protobuf/codegenv2' -import { fileDesc, messageDesc, serviceDesc } from '@bufbuild/protobuf/codegenv2' -import { file_tools_generator_v1alpha_cre_metadata } from '../../../../tools/generator/v1alpha/cre_metadata_pb' -import type { Message } from '@bufbuild/protobuf' +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import { file_tools_generator_v1alpha_cre_metadata } from "../../../../tools/generator/v1alpha/cre_metadata_pb"; +import type { Message } from "@bufbuild/protobuf"; /** * Describes the file capabilities/internal/nodeaction/v1/node_action.proto. */ -export const file_capabilities_internal_nodeaction_v1_node_action: GenFile = - /*@__PURE__*/ - fileDesc( - 'CjVjYXBhYmlsaXRpZXMvaW50ZXJuYWwvbm9kZWFjdGlvbi92MS9ub2RlX2FjdGlvbi5wcm90bxIjY2FwYWJpbGl0aWVzLmludGVybmFsLm5vZGVhY3Rpb24udjEiIQoKTm9kZUlucHV0cxITCgtpbnB1dF90aGluZxgBIAEoCCIjCgtOb2RlT3V0cHV0cxIUCgxvdXRwdXRfdGhpbmcYASABKAUypwEKC0Jhc2ljQWN0aW9uEnIKDVBlcmZvcm1BY3Rpb24SLy5jYXBhYmlsaXRpZXMuaW50ZXJuYWwubm9kZWFjdGlvbi52MS5Ob2RlSW5wdXRzGjAuY2FwYWJpbGl0aWVzLmludGVybmFsLm5vZGVhY3Rpb24udjEuTm9kZU91dHB1dHMaJIK1GCAIAhIcYmFzaWMtdGVzdC1ub2RlLWFjdGlvbkAxLjAuMELpAQonY29tLmNhcGFiaWxpdGllcy5pbnRlcm5hbC5ub2RlYWN0aW9uLnYxQg9Ob2RlQWN0aW9uUHJvdG9QAaICA0NJTqoCI0NhcGFiaWxpdGllcy5JbnRlcm5hbC5Ob2RlYWN0aW9uLlYxygIjQ2FwYWJpbGl0aWVzXEludGVybmFsXE5vZGVhY3Rpb25cVjHiAi9DYXBhYmlsaXRpZXNcSW50ZXJuYWxcTm9kZWFjdGlvblxWMVxHUEJNZXRhZGF0YeoCJkNhcGFiaWxpdGllczo6SW50ZXJuYWw6Ok5vZGVhY3Rpb246OlYxYgZwcm90bzM', - [file_tools_generator_v1alpha_cre_metadata], - ) +export const file_capabilities_internal_nodeaction_v1_node_action: GenFile = /*@__PURE__*/ + fileDesc("CjVjYXBhYmlsaXRpZXMvaW50ZXJuYWwvbm9kZWFjdGlvbi92MS9ub2RlX2FjdGlvbi5wcm90bxIjY2FwYWJpbGl0aWVzLmludGVybmFsLm5vZGVhY3Rpb24udjEiIQoKTm9kZUlucHV0cxITCgtpbnB1dF90aGluZxgBIAEoCCIjCgtOb2RlT3V0cHV0cxIUCgxvdXRwdXRfdGhpbmcYASABKAUypwEKC0Jhc2ljQWN0aW9uEnIKDVBlcmZvcm1BY3Rpb24SLy5jYXBhYmlsaXRpZXMuaW50ZXJuYWwubm9kZWFjdGlvbi52MS5Ob2RlSW5wdXRzGjAuY2FwYWJpbGl0aWVzLmludGVybmFsLm5vZGVhY3Rpb24udjEuTm9kZU91dHB1dHMaJIK1GCAIAhIcYmFzaWMtdGVzdC1ub2RlLWFjdGlvbkAxLjAuMELpAQonY29tLmNhcGFiaWxpdGllcy5pbnRlcm5hbC5ub2RlYWN0aW9uLnYxQg9Ob2RlQWN0aW9uUHJvdG9QAaICA0NJTqoCI0NhcGFiaWxpdGllcy5JbnRlcm5hbC5Ob2RlYWN0aW9uLlYxygIjQ2FwYWJpbGl0aWVzXEludGVybmFsXE5vZGVhY3Rpb25cVjHiAi9DYXBhYmlsaXRpZXNcSW50ZXJuYWxcTm9kZWFjdGlvblxWMVxHUEJNZXRhZGF0YeoCJkNhcGFiaWxpdGllczo6SW50ZXJuYWw6Ok5vZGVhY3Rpb246OlYxYgZwcm90bzM", [file_tools_generator_v1alpha_cre_metadata]); /** * @generated from message capabilities.internal.nodeaction.v1.NodeInputs */ -export type NodeInputs = Message<'capabilities.internal.nodeaction.v1.NodeInputs'> & { - /** - * @generated from field: bool input_thing = 1; - */ - inputThing: boolean -} +export type NodeInputs = Message<"capabilities.internal.nodeaction.v1.NodeInputs"> & { + /** + * @generated from field: bool input_thing = 1; + */ + inputThing: boolean; +}; /** * @generated from message capabilities.internal.nodeaction.v1.NodeInputs */ export type NodeInputsJson = { - /** - * @generated from field: bool input_thing = 1; - */ - inputThing?: boolean -} + /** + * @generated from field: bool input_thing = 1; + */ + inputThing?: boolean; +}; /** * Describes the message capabilities.internal.nodeaction.v1.NodeInputs. * Use `create(NodeInputsSchema)` to create a new message. */ -export const NodeInputsSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_internal_nodeaction_v1_node_action, 0) +export const NodeInputsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_internal_nodeaction_v1_node_action, 0); /** * @generated from message capabilities.internal.nodeaction.v1.NodeOutputs */ -export type NodeOutputs = Message<'capabilities.internal.nodeaction.v1.NodeOutputs'> & { - /** - * @generated from field: int32 output_thing = 1; - */ - outputThing: number -} +export type NodeOutputs = Message<"capabilities.internal.nodeaction.v1.NodeOutputs"> & { + /** + * @generated from field: int32 output_thing = 1; + */ + outputThing: number; +}; /** * @generated from message capabilities.internal.nodeaction.v1.NodeOutputs */ export type NodeOutputsJson = { - /** - * @generated from field: int32 output_thing = 1; - */ - outputThing?: number -} + /** + * @generated from field: int32 output_thing = 1; + */ + outputThing?: number; +}; /** * Describes the message capabilities.internal.nodeaction.v1.NodeOutputs. * Use `create(NodeOutputsSchema)` to create a new message. */ -export const NodeOutputsSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_internal_nodeaction_v1_node_action, 1) +export const NodeOutputsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_internal_nodeaction_v1_node_action, 1); /** * @generated from service capabilities.internal.nodeaction.v1.BasicAction */ export const BasicAction: GenService<{ - /** - * @generated from rpc capabilities.internal.nodeaction.v1.BasicAction.PerformAction - */ - performAction: { - methodKind: 'unary' - input: typeof NodeInputsSchema - output: typeof NodeOutputsSchema - } -}> = /*@__PURE__*/ serviceDesc(file_capabilities_internal_nodeaction_v1_node_action, 0) + /** + * @generated from rpc capabilities.internal.nodeaction.v1.BasicAction.PerformAction + */ + performAction: { + methodKind: "unary"; + input: typeof NodeInputsSchema; + output: typeof NodeOutputsSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_capabilities_internal_nodeaction_v1_node_action, 0); + diff --git a/src/generated/capabilities/networking/confidentialhttp/v1alpha/client_pb.ts b/src/generated/capabilities/networking/confidentialhttp/v1alpha/client_pb.ts index 4069f96f..74377f34 100644 --- a/src/generated/capabilities/networking/confidentialhttp/v1alpha/client_pb.ts +++ b/src/generated/capabilities/networking/confidentialhttp/v1alpha/client_pb.ts @@ -2,267 +2,256 @@ // @generated from file capabilities/networking/confidentialhttp/v1alpha/client.proto (package capabilities.networking.confidentialhttp.v1alpha, syntax proto3) /* eslint-disable */ -import type { GenFile, GenMessage, GenService } from '@bufbuild/protobuf/codegenv2' -import { fileDesc, messageDesc, serviceDesc } from '@bufbuild/protobuf/codegenv2' -import type { StructJson } from '@bufbuild/protobuf/wkt' -import { file_google_protobuf_struct } from '@bufbuild/protobuf/wkt' -import { file_tools_generator_v1alpha_cre_metadata } from '../../../../tools/generator/v1alpha/cre_metadata_pb' -import type { JsonObject, Message } from '@bufbuild/protobuf' +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import type { StructJson } from "@bufbuild/protobuf/wkt"; +import { file_google_protobuf_struct } from "@bufbuild/protobuf/wkt"; +import { file_tools_generator_v1alpha_cre_metadata } from "../../../../tools/generator/v1alpha/cre_metadata_pb"; +import type { JsonObject, Message } from "@bufbuild/protobuf"; /** * Describes the file capabilities/networking/confidentialhttp/v1alpha/client.proto. */ -export const file_capabilities_networking_confidentialhttp_v1alpha_client: GenFile = - /*@__PURE__*/ - fileDesc( - 'Cj1jYXBhYmlsaXRpZXMvbmV0d29ya2luZy9jb25maWRlbnRpYWxodHRwL3YxYWxwaGEvY2xpZW50LnByb3RvEjBjYXBhYmlsaXRpZXMubmV0d29ya2luZy5jb25maWRlbnRpYWxodHRwLnYxYWxwaGEiUAoQU2VjcmV0SWRlbnRpZmllchILCgNrZXkYASABKAkSEQoJbmFtZXNwYWNlGAIgASgJEhIKBW93bmVyGAMgASgJSACIAQFCCAoGX293bmVyIpoBCgdSZXF1ZXN0EgwKBGJvZHkYASABKAkSGgoSY3VzdG9tX2NlcnRfYnVuZGxlGAIgASgMEg8KB2hlYWRlcnMYAyADKAkSDgoGbWV0aG9kGAQgASgJEjcKFnB1YmxpY190ZW1wbGF0ZV92YWx1ZXMYBSABKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0EgsKA3VybBgGIAEoCSKzAQoFSW5wdXQSSwoIcmVxdWVzdHMYASADKAsyOS5jYXBhYmlsaXRpZXMubmV0d29ya2luZy5jb25maWRlbnRpYWxodHRwLnYxYWxwaGEuUmVxdWVzdBJdChF2YXVsdF9kb25fc2VjcmV0cxgCIAMoCzJCLmNhcGFiaWxpdGllcy5uZXR3b3JraW5nLmNvbmZpZGVudGlhbGh0dHAudjFhbHBoYS5TZWNyZXRJZGVudGlmaWVyIjwKE091dHB1dFJlc3BvbnNlc0VsZW0SDAoEYm9keRgBIAEoDBIXCgtzdGF0dXNfY29kZRgCIAEoA0ICMAAiYgoGT3V0cHV0ElgKCXJlc3BvbnNlcxgBIAMoCzJFLmNhcGFiaWxpdGllcy5uZXR3b3JraW5nLmNvbmZpZGVudGlhbGh0dHAudjFhbHBoYS5PdXRwdXRSZXNwb25zZXNFbGVtMrsBCgZDbGllbnQSgQEKDFNlbmRSZXF1ZXN0cxI3LmNhcGFiaWxpdGllcy5uZXR3b3JraW5nLmNvbmZpZGVudGlhbGh0dHAudjFhbHBoYS5JbnB1dBo4LmNhcGFiaWxpdGllcy5uZXR3b3JraW5nLmNvbmZpZGVudGlhbGh0dHAudjFhbHBoYS5PdXRwdXQaLYK1GCkIAhIlY29uZmlkZW50aWFsLWh0dHAtYWN0aW9uc0AxLjAuMC1hbHBoYUKmAgo0Y29tLmNhcGFiaWxpdGllcy5uZXR3b3JraW5nLmNvbmZpZGVudGlhbGh0dHAudjFhbHBoYUILQ2xpZW50UHJvdG9QAaICA0NOQ6oCMENhcGFiaWxpdGllcy5OZXR3b3JraW5nLkNvbmZpZGVudGlhbGh0dHAuVjFhbHBoYcoCMENhcGFiaWxpdGllc1xOZXR3b3JraW5nXENvbmZpZGVudGlhbGh0dHBcVjFhbHBoYeICPENhcGFiaWxpdGllc1xOZXR3b3JraW5nXENvbmZpZGVudGlhbGh0dHBcVjFhbHBoYVxHUEJNZXRhZGF0YeoCM0NhcGFiaWxpdGllczo6TmV0d29ya2luZzo6Q29uZmlkZW50aWFsaHR0cDo6VjFhbHBoYWIGcHJvdG8z', - [file_google_protobuf_struct, file_tools_generator_v1alpha_cre_metadata], - ) +export const file_capabilities_networking_confidentialhttp_v1alpha_client: GenFile = /*@__PURE__*/ + fileDesc("Cj1jYXBhYmlsaXRpZXMvbmV0d29ya2luZy9jb25maWRlbnRpYWxodHRwL3YxYWxwaGEvY2xpZW50LnByb3RvEjBjYXBhYmlsaXRpZXMubmV0d29ya2luZy5jb25maWRlbnRpYWxodHRwLnYxYWxwaGEiUAoQU2VjcmV0SWRlbnRpZmllchILCgNrZXkYASABKAkSEQoJbmFtZXNwYWNlGAIgASgJEhIKBW93bmVyGAMgASgJSACIAQFCCAoGX293bmVyIpoBCgdSZXF1ZXN0EgwKBGJvZHkYASABKAkSGgoSY3VzdG9tX2NlcnRfYnVuZGxlGAIgASgMEg8KB2hlYWRlcnMYAyADKAkSDgoGbWV0aG9kGAQgASgJEjcKFnB1YmxpY190ZW1wbGF0ZV92YWx1ZXMYBSABKAsyFy5nb29nbG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cGFiaWxpdGllczo6TmV0d29ya2luZzo6Q29uZmlkZW50aWFsaHR0cDo6VjFhbHBoYWIGcHJvdG8z", [file_google_protobuf_struct, file_tools_generator_v1alpha_cre_metadata]); /** * @generated from message capabilities.networking.confidentialhttp.v1alpha.SecretIdentifier */ -export type SecretIdentifier = - Message<'capabilities.networking.confidentialhttp.v1alpha.SecretIdentifier'> & { - /** - * @generated from field: string key = 1; - */ - key: string - - /** - * @generated from field: string namespace = 2; - */ - namespace: string - - /** - * @generated from field: optional string owner = 3; - */ - owner?: string - } +export type SecretIdentifier = Message<"capabilities.networking.confidentialhttp.v1alpha.SecretIdentifier"> & { + /** + * @generated from field: string key = 1; + */ + key: string; + + /** + * @generated from field: string namespace = 2; + */ + namespace: string; + + /** + * @generated from field: optional string owner = 3; + */ + owner?: string; +}; /** * @generated from message capabilities.networking.confidentialhttp.v1alpha.SecretIdentifier */ export type SecretIdentifierJson = { - /** - * @generated from field: string key = 1; - */ - key?: string - - /** - * @generated from field: string namespace = 2; - */ - namespace?: string - - /** - * @generated from field: optional string owner = 3; - */ - owner?: string -} + /** + * @generated from field: string key = 1; + */ + key?: string; + + /** + * @generated from field: string namespace = 2; + */ + namespace?: string; + + /** + * @generated from field: optional string owner = 3; + */ + owner?: string; +}; /** * Describes the message capabilities.networking.confidentialhttp.v1alpha.SecretIdentifier. * Use `create(SecretIdentifierSchema)` to create a new message. */ -export const SecretIdentifierSchema: GenMessage< - SecretIdentifier, - { jsonType: SecretIdentifierJson } -> = /*@__PURE__*/ messageDesc(file_capabilities_networking_confidentialhttp_v1alpha_client, 0) +export const SecretIdentifierSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_networking_confidentialhttp_v1alpha_client, 0); /** * @generated from message capabilities.networking.confidentialhttp.v1alpha.Request */ -export type Request = Message<'capabilities.networking.confidentialhttp.v1alpha.Request'> & { - /** - * @generated from field: string body = 1; - */ - body: string - - /** - * @generated from field: bytes custom_cert_bundle = 2; - */ - customCertBundle: Uint8Array - - /** - * @generated from field: repeated string headers = 3; - */ - headers: string[] - - /** - * @generated from field: string method = 4; - */ - method: string - - /** - * @generated from field: google.protobuf.Struct public_template_values = 5; - */ - publicTemplateValues?: JsonObject - - /** - * @generated from field: string url = 6; - */ - url: string -} +export type Request = Message<"capabilities.networking.confidentialhttp.v1alpha.Request"> & { + /** + * @generated from field: string body = 1; + */ + body: string; + + /** + * @generated from field: bytes custom_cert_bundle = 2; + */ + customCertBundle: Uint8Array; + + /** + * @generated from field: repeated string headers = 3; + */ + headers: string[]; + + /** + * @generated from field: string method = 4; + */ + method: string; + + /** + * @generated from field: google.protobuf.Struct public_template_values = 5; + */ + publicTemplateValues?: JsonObject; + + /** + * @generated from field: string url = 6; + */ + url: string; +}; /** * @generated from message capabilities.networking.confidentialhttp.v1alpha.Request */ export type RequestJson = { - /** - * @generated from field: string body = 1; - */ - body?: string - - /** - * @generated from field: bytes custom_cert_bundle = 2; - */ - customCertBundle?: string - - /** - * @generated from field: repeated string headers = 3; - */ - headers?: string[] - - /** - * @generated from field: string method = 4; - */ - method?: string - - /** - * @generated from field: google.protobuf.Struct public_template_values = 5; - */ - publicTemplateValues?: StructJson - - /** - * @generated from field: string url = 6; - */ - url?: string -} + /** + * @generated from field: string body = 1; + */ + body?: string; + + /** + * @generated from field: bytes custom_cert_bundle = 2; + */ + customCertBundle?: string; + + /** + * @generated from field: repeated string headers = 3; + */ + headers?: string[]; + + /** + * @generated from field: string method = 4; + */ + method?: string; + + /** + * @generated from field: google.protobuf.Struct public_template_values = 5; + */ + publicTemplateValues?: StructJson; + + /** + * @generated from field: string url = 6; + */ + url?: string; +}; /** * Describes the message capabilities.networking.confidentialhttp.v1alpha.Request. * Use `create(RequestSchema)` to create a new message. */ -export const RequestSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_networking_confidentialhttp_v1alpha_client, 1) +export const RequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_networking_confidentialhttp_v1alpha_client, 1); /** * @generated from message capabilities.networking.confidentialhttp.v1alpha.Input */ -export type Input = Message<'capabilities.networking.confidentialhttp.v1alpha.Input'> & { - /** - * @generated from field: repeated capabilities.networking.confidentialhttp.v1alpha.Request requests = 1; - */ - requests: Request[] - - /** - * @generated from field: repeated capabilities.networking.confidentialhttp.v1alpha.SecretIdentifier vault_don_secrets = 2; - */ - vaultDonSecrets: SecretIdentifier[] -} +export type Input = Message<"capabilities.networking.confidentialhttp.v1alpha.Input"> & { + /** + * @generated from field: repeated capabilities.networking.confidentialhttp.v1alpha.Request requests = 1; + */ + requests: Request[]; + + /** + * @generated from field: repeated capabilities.networking.confidentialhttp.v1alpha.SecretIdentifier vault_don_secrets = 2; + */ + vaultDonSecrets: SecretIdentifier[]; +}; /** * @generated from message capabilities.networking.confidentialhttp.v1alpha.Input */ export type InputJson = { - /** - * @generated from field: repeated capabilities.networking.confidentialhttp.v1alpha.Request requests = 1; - */ - requests?: RequestJson[] + /** + * @generated from field: repeated capabilities.networking.confidentialhttp.v1alpha.Request requests = 1; + */ + requests?: RequestJson[]; - /** - * @generated from field: repeated capabilities.networking.confidentialhttp.v1alpha.SecretIdentifier vault_don_secrets = 2; - */ - vaultDonSecrets?: SecretIdentifierJson[] -} + /** + * @generated from field: repeated capabilities.networking.confidentialhttp.v1alpha.SecretIdentifier vault_don_secrets = 2; + */ + vaultDonSecrets?: SecretIdentifierJson[]; +}; /** * Describes the message capabilities.networking.confidentialhttp.v1alpha.Input. * Use `create(InputSchema)` to create a new message. */ -export const InputSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_networking_confidentialhttp_v1alpha_client, 2) +export const InputSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_networking_confidentialhttp_v1alpha_client, 2); /** * @generated from message capabilities.networking.confidentialhttp.v1alpha.OutputResponsesElem */ -export type OutputResponsesElem = - Message<'capabilities.networking.confidentialhttp.v1alpha.OutputResponsesElem'> & { - /** - * @generated from field: bytes body = 1; - */ - body: Uint8Array - - /** - * @generated from field: int64 status_code = 2 [jstype = JS_NORMAL]; - */ - statusCode: bigint - } +export type OutputResponsesElem = Message<"capabilities.networking.confidentialhttp.v1alpha.OutputResponsesElem"> & { + /** + * @generated from field: bytes body = 1; + */ + body: Uint8Array; + + /** + * @generated from field: int64 status_code = 2 [jstype = JS_NORMAL]; + */ + statusCode: bigint; +}; /** * @generated from message capabilities.networking.confidentialhttp.v1alpha.OutputResponsesElem */ export type OutputResponsesElemJson = { - /** - * @generated from field: bytes body = 1; - */ - body?: string + /** + * @generated from field: bytes body = 1; + */ + body?: string; - /** - * @generated from field: int64 status_code = 2 [jstype = JS_NORMAL]; - */ - statusCode?: string -} + /** + * @generated from field: int64 status_code = 2 [jstype = JS_NORMAL]; + */ + statusCode?: string; +}; /** * Describes the message capabilities.networking.confidentialhttp.v1alpha.OutputResponsesElem. * Use `create(OutputResponsesElemSchema)` to create a new message. */ -export const OutputResponsesElemSchema: GenMessage< - OutputResponsesElem, - { jsonType: OutputResponsesElemJson } -> = /*@__PURE__*/ messageDesc(file_capabilities_networking_confidentialhttp_v1alpha_client, 3) +export const OutputResponsesElemSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_networking_confidentialhttp_v1alpha_client, 3); /** * @generated from message capabilities.networking.confidentialhttp.v1alpha.Output */ -export type Output = Message<'capabilities.networking.confidentialhttp.v1alpha.Output'> & { - /** - * @generated from field: repeated capabilities.networking.confidentialhttp.v1alpha.OutputResponsesElem responses = 1; - */ - responses: OutputResponsesElem[] -} +export type Output = Message<"capabilities.networking.confidentialhttp.v1alpha.Output"> & { + /** + * @generated from field: repeated capabilities.networking.confidentialhttp.v1alpha.OutputResponsesElem responses = 1; + */ + responses: OutputResponsesElem[]; +}; /** * @generated from message capabilities.networking.confidentialhttp.v1alpha.Output */ export type OutputJson = { - /** - * @generated from field: repeated capabilities.networking.confidentialhttp.v1alpha.OutputResponsesElem responses = 1; - */ - responses?: OutputResponsesElemJson[] -} + /** + * @generated from field: repeated capabilities.networking.confidentialhttp.v1alpha.OutputResponsesElem responses = 1; + */ + responses?: OutputResponsesElemJson[]; +}; /** * Describes the message capabilities.networking.confidentialhttp.v1alpha.Output. * Use `create(OutputSchema)` to create a new message. */ -export const OutputSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_networking_confidentialhttp_v1alpha_client, 4) +export const OutputSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_networking_confidentialhttp_v1alpha_client, 4); /** * @generated from service capabilities.networking.confidentialhttp.v1alpha.Client */ export const Client: GenService<{ - /** - * @generated from rpc capabilities.networking.confidentialhttp.v1alpha.Client.SendRequests - */ - sendRequests: { - methodKind: 'unary' - input: typeof InputSchema - output: typeof OutputSchema - } -}> = /*@__PURE__*/ serviceDesc(file_capabilities_networking_confidentialhttp_v1alpha_client, 0) + /** + * @generated from rpc capabilities.networking.confidentialhttp.v1alpha.Client.SendRequests + */ + sendRequests: { + methodKind: "unary"; + input: typeof InputSchema; + output: typeof OutputSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_capabilities_networking_confidentialhttp_v1alpha_client, 0); + diff --git a/src/generated/capabilities/networking/http/v1alpha/client_pb.ts b/src/generated/capabilities/networking/http/v1alpha/client_pb.ts index 87de3765..c0cbfbe0 100644 --- a/src/generated/capabilities/networking/http/v1alpha/client_pb.ts +++ b/src/generated/capabilities/networking/http/v1alpha/client_pb.ts @@ -2,41 +2,37 @@ // @generated from file capabilities/networking/http/v1alpha/client.proto (package capabilities.networking.http.v1alpha, syntax proto3) /* eslint-disable */ -import type { GenFile, GenMessage, GenService } from '@bufbuild/protobuf/codegenv2' -import { fileDesc, messageDesc, serviceDesc } from '@bufbuild/protobuf/codegenv2' -import { file_tools_generator_v1alpha_cre_metadata } from '../../../../tools/generator/v1alpha/cre_metadata_pb' -import type { Message } from '@bufbuild/protobuf' +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import { file_tools_generator_v1alpha_cre_metadata } from "../../../../tools/generator/v1alpha/cre_metadata_pb"; +import type { Message } from "@bufbuild/protobuf"; /** * Describes the file capabilities/networking/http/v1alpha/client.proto. */ -export const file_capabilities_networking_http_v1alpha_client: GenFile = - /*@__PURE__*/ - fileDesc( - 'CjFjYXBhYmlsaXRpZXMvbmV0d29ya2luZy9odHRwL3YxYWxwaGEvY2xpZW50LnByb3RvEiRjYXBhYmlsaXRpZXMubmV0d29ya2luZy5odHRwLnYxYWxwaGEiPAoNQ2FjaGVTZXR0aW5ncxIXCg9yZWFkX2Zyb21fY2FjaGUYASABKAgSEgoKbWF4X2FnZV9tcxgCIAEoBSKSAgoHUmVxdWVzdBILCgN1cmwYASABKAkSDgoGbWV0aG9kGAIgASgJEksKB2hlYWRlcnMYAyADKAsyOi5jYXBhYmlsaXRpZXMubmV0d29ya2luZy5odHRwLnYxYWxwaGEuUmVxdWVzdC5IZWFkZXJzRW50cnkSDAoEYm9keRgEIAEoDBISCgp0aW1lb3V0X21zGAUgASgFEksKDmNhY2hlX3NldHRpbmdzGAYgASgLMjMuY2FwYWJpbGl0aWVzLm5ldHdvcmtpbmcuaHR0cC52MWFscGhhLkNhY2hlU2V0dGluZ3MaLgoMSGVhZGVyc0VudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEiqwEKCFJlc3BvbnNlEhMKC3N0YXR1c19jb2RlGAEgASgNEkwKB2hlYWRlcnMYAiADKAsyOy5jYXBhYmlsaXRpZXMubmV0d29ya2luZy5odHRwLnYxYWxwaGEuUmVzcG9uc2UuSGVhZGVyc0VudHJ5EgwKBGJvZHkYAyABKAwaLgoMSGVhZGVyc0VudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEymAEKBkNsaWVudBJsCgtTZW5kUmVxdWVzdBItLmNhcGFiaWxpdGllcy5uZXR3b3JraW5nLmh0dHAudjFhbHBoYS5SZXF1ZXN0Gi4uY2FwYWJpbGl0aWVzLm5ldHdvcmtpbmcuaHR0cC52MWFscGhhLlJlc3BvbnNlGiCCtRgcCAISGGh0dHAtYWN0aW9uc0AxLjAuMC1hbHBoYULqAQooY29tLmNhcGFiaWxpdGllcy5uZXR3b3JraW5nLmh0dHAudjFhbHBoYUILQ2xpZW50UHJvdG9QAaICA0NOSKoCJENhcGFiaWxpdGllcy5OZXR3b3JraW5nLkh0dHAuVjFhbHBoYcoCJENhcGFiaWxpdGllc1xOZXR3b3JraW5nXEh0dHBcVjFhbHBoYeICMENhcGFiaWxpdGllc1xOZXR3b3JraW5nXEh0dHBcVjFhbHBoYVxHUEJNZXRhZGF0YeoCJ0NhcGFiaWxpdGllczo6TmV0d29ya2luZzo6SHR0cDo6VjFhbHBoYWIGcHJvdG8z', - [file_tools_generator_v1alpha_cre_metadata], - ) +export const file_capabilities_networking_http_v1alpha_client: GenFile = /*@__PURE__*/ + fileDesc("CjFjYXBhYmlsaXRpZXMvbmV0d29ya2luZy9odHRwL3YxYWxwaGEvY2xpZW50LnByb3RvEiRjYXBhYmlsaXRpZXMubmV0d29ya2luZy5odHRwLnYxYWxwaGEiPAoNQ2FjaGVTZXR0aW5ncxIXCg9yZWFkX2Zyb21fY2FjaGUYASABKAgSEgoKbWF4X2FnZV9tcxgCIAEoBSKSAgoHUmVxdWVzdBILCgN1cmwYASABKAkSDgoGbWV0aG9kGAIgASgJEksKB2hlYWRlcnMYAyADKAsyOi5jYXBhYmlsaXRpZXMubmV0d29ya2luZy5odHRwLnYxYWxwaGEuUmVxdWVzdC5IZWFkZXJzRW50cnkSDAoEYm9keRgEIAEoDBISCgp0aW1lb3V0X21zGAUgASgFEksKDmNhY2hlX3NldHRpbmdzGAYgASgLMjMuY2FwYWJpbGl0aWVzLm5ldHdvcmtpbmcuaHR0cC52MWFscGhhLkNhY2hlU2V0dGluZ3MaLgoMSGVhZGVyc0VudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEiqwEKCFJlc3BvbnNlEhMKC3N0YXR1c19jb2RlGAEgASgNEkwKB2hlYWRlcnMYAiADKAsyOy5jYXBhYmlsaXRpZXMubmV0d29ya2luZy5odHRwLnYxYWxwaGEuUmVzcG9uc2UuSGVhZGVyc0VudHJ5EgwKBGJvZHkYAyABKAwaLgoMSGVhZGVyc0VudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEymAEKBkNsaWVudBJsCgtTZW5kUmVxdWVzdBItLmNhcGFiaWxpdGllcy5uZXR3b3JraW5nLmh0dHAudjFhbHBoYS5SZXF1ZXN0Gi4uY2FwYWJpbGl0aWVzLm5ldHdvcmtpbmcuaHR0cC52MWFscGhhLlJlc3BvbnNlGiCCtRgcCAISGGh0dHAtYWN0aW9uc0AxLjAuMC1hbHBoYULqAQooY29tLmNhcGFiaWxpdGllcy5uZXR3b3JraW5nLmh0dHAudjFhbHBoYUILQ2xpZW50UHJvdG9QAaICA0NOSKoCJENhcGFiaWxpdGllcy5OZXR3b3JraW5nLkh0dHAuVjFhbHBoYcoCJENhcGFiaWxpdGllc1xOZXR3b3JraW5nXEh0dHBcVjFhbHBoYeICMENhcGFiaWxpdGllc1xOZXR3b3JraW5nXEh0dHBcVjFhbHBoYVxHUEJNZXRhZGF0YeoCJ0NhcGFiaWxpdGllczo6TmV0d29ya2luZzo6SHR0cDo6VjFhbHBoYWIGcHJvdG8z", [file_tools_generator_v1alpha_cre_metadata]); /** * CacheSettings defines cache control options for outbound HTTP requests. * * @generated from message capabilities.networking.http.v1alpha.CacheSettings */ -export type CacheSettings = Message<'capabilities.networking.http.v1alpha.CacheSettings'> & { - /** - * If true, attempt to read a cached response for the request. - * - * @generated from field: bool read_from_cache = 1; - */ - readFromCache: boolean - - /** - * Maximum age of a cached response in milliseconds. - * - * @generated from field: int32 max_age_ms = 2; - */ - maxAgeMs: number -} +export type CacheSettings = Message<"capabilities.networking.http.v1alpha.CacheSettings"> & { + /** + * If true, attempt to read a cached response for the request. + * + * @generated from field: bool read_from_cache = 1; + */ + readFromCache: boolean; + + /** + * Maximum age of a cached response in milliseconds. + * + * @generated from field: int32 max_age_ms = 2; + */ + maxAgeMs: number; +}; /** * CacheSettings defines cache control options for outbound HTTP requests. @@ -44,165 +40,164 @@ export type CacheSettings = Message<'capabilities.networking.http.v1alpha.CacheS * @generated from message capabilities.networking.http.v1alpha.CacheSettings */ export type CacheSettingsJson = { - /** - * If true, attempt to read a cached response for the request. - * - * @generated from field: bool read_from_cache = 1; - */ - readFromCache?: boolean - - /** - * Maximum age of a cached response in milliseconds. - * - * @generated from field: int32 max_age_ms = 2; - */ - maxAgeMs?: number -} + /** + * If true, attempt to read a cached response for the request. + * + * @generated from field: bool read_from_cache = 1; + */ + readFromCache?: boolean; + + /** + * Maximum age of a cached response in milliseconds. + * + * @generated from field: int32 max_age_ms = 2; + */ + maxAgeMs?: number; +}; /** * Describes the message capabilities.networking.http.v1alpha.CacheSettings. * Use `create(CacheSettingsSchema)` to create a new message. */ -export const CacheSettingsSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_networking_http_v1alpha_client, 0) +export const CacheSettingsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_networking_http_v1alpha_client, 0); /** * @generated from message capabilities.networking.http.v1alpha.Request */ -export type Request = Message<'capabilities.networking.http.v1alpha.Request'> & { - /** - * @generated from field: string url = 1; - */ - url: string - - /** - * @generated from field: string method = 2; - */ - method: string - - /** - * @generated from field: map headers = 3; - */ - headers: { [key: string]: string } - - /** - * @generated from field: bytes body = 4; - */ - body: Uint8Array - - /** - * @generated from field: int32 timeout_ms = 5; - */ - timeoutMs: number - - /** - * @generated from field: capabilities.networking.http.v1alpha.CacheSettings cache_settings = 6; - */ - cacheSettings?: CacheSettings -} +export type Request = Message<"capabilities.networking.http.v1alpha.Request"> & { + /** + * @generated from field: string url = 1; + */ + url: string; + + /** + * @generated from field: string method = 2; + */ + method: string; + + /** + * @generated from field: map headers = 3; + */ + headers: { [key: string]: string }; + + /** + * @generated from field: bytes body = 4; + */ + body: Uint8Array; + + /** + * @generated from field: int32 timeout_ms = 5; + */ + timeoutMs: number; + + /** + * @generated from field: capabilities.networking.http.v1alpha.CacheSettings cache_settings = 6; + */ + cacheSettings?: CacheSettings; +}; /** * @generated from message capabilities.networking.http.v1alpha.Request */ export type RequestJson = { - /** - * @generated from field: string url = 1; - */ - url?: string - - /** - * @generated from field: string method = 2; - */ - method?: string - - /** - * @generated from field: map headers = 3; - */ - headers?: { [key: string]: string } - - /** - * @generated from field: bytes body = 4; - */ - body?: string - - /** - * @generated from field: int32 timeout_ms = 5; - */ - timeoutMs?: number - - /** - * @generated from field: capabilities.networking.http.v1alpha.CacheSettings cache_settings = 6; - */ - cacheSettings?: CacheSettingsJson -} + /** + * @generated from field: string url = 1; + */ + url?: string; + + /** + * @generated from field: string method = 2; + */ + method?: string; + + /** + * @generated from field: map headers = 3; + */ + headers?: { [key: string]: string }; + + /** + * @generated from field: bytes body = 4; + */ + body?: string; + + /** + * @generated from field: int32 timeout_ms = 5; + */ + timeoutMs?: number; + + /** + * @generated from field: capabilities.networking.http.v1alpha.CacheSettings cache_settings = 6; + */ + cacheSettings?: CacheSettingsJson; +}; /** * Describes the message capabilities.networking.http.v1alpha.Request. * Use `create(RequestSchema)` to create a new message. */ -export const RequestSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_networking_http_v1alpha_client, 1) +export const RequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_networking_http_v1alpha_client, 1); /** * @generated from message capabilities.networking.http.v1alpha.Response */ -export type Response = Message<'capabilities.networking.http.v1alpha.Response'> & { - /** - * @generated from field: uint32 status_code = 1; - */ - statusCode: number - - /** - * @generated from field: map headers = 2; - */ - headers: { [key: string]: string } - - /** - * @generated from field: bytes body = 3; - */ - body: Uint8Array -} +export type Response = Message<"capabilities.networking.http.v1alpha.Response"> & { + /** + * @generated from field: uint32 status_code = 1; + */ + statusCode: number; + + /** + * @generated from field: map headers = 2; + */ + headers: { [key: string]: string }; + + /** + * @generated from field: bytes body = 3; + */ + body: Uint8Array; +}; /** * @generated from message capabilities.networking.http.v1alpha.Response */ export type ResponseJson = { - /** - * @generated from field: uint32 status_code = 1; - */ - statusCode?: number - - /** - * @generated from field: map headers = 2; - */ - headers?: { [key: string]: string } - - /** - * @generated from field: bytes body = 3; - */ - body?: string -} + /** + * @generated from field: uint32 status_code = 1; + */ + statusCode?: number; + + /** + * @generated from field: map headers = 2; + */ + headers?: { [key: string]: string }; + + /** + * @generated from field: bytes body = 3; + */ + body?: string; +}; /** * Describes the message capabilities.networking.http.v1alpha.Response. * Use `create(ResponseSchema)` to create a new message. */ -export const ResponseSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_networking_http_v1alpha_client, 2) +export const ResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_networking_http_v1alpha_client, 2); /** * @generated from service capabilities.networking.http.v1alpha.Client */ export const Client: GenService<{ - /** - * @generated from rpc capabilities.networking.http.v1alpha.Client.SendRequest - */ - sendRequest: { - methodKind: 'unary' - input: typeof RequestSchema - output: typeof ResponseSchema - } -}> = /*@__PURE__*/ serviceDesc(file_capabilities_networking_http_v1alpha_client, 0) + /** + * @generated from rpc capabilities.networking.http.v1alpha.Client.SendRequest + */ + sendRequest: { + methodKind: "unary"; + input: typeof RequestSchema; + output: typeof ResponseSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_capabilities_networking_http_v1alpha_client, 0); + diff --git a/src/generated/capabilities/networking/http/v1alpha/trigger_pb.ts b/src/generated/capabilities/networking/http/v1alpha/trigger_pb.ts index bc4ee640..783367a3 100644 --- a/src/generated/capabilities/networking/http/v1alpha/trigger_pb.ts +++ b/src/generated/capabilities/networking/http/v1alpha/trigger_pb.ts @@ -2,115 +2,109 @@ // @generated from file capabilities/networking/http/v1alpha/trigger.proto (package capabilities.networking.http.v1alpha, syntax proto3) /* eslint-disable */ -import type { GenEnum, GenFile, GenMessage, GenService } from '@bufbuild/protobuf/codegenv2' -import { enumDesc, fileDesc, messageDesc, serviceDesc } from '@bufbuild/protobuf/codegenv2' -import { file_tools_generator_v1alpha_cre_metadata } from '../../../../tools/generator/v1alpha/cre_metadata_pb' -import type { Message } from '@bufbuild/protobuf' +import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; +import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import { file_tools_generator_v1alpha_cre_metadata } from "../../../../tools/generator/v1alpha/cre_metadata_pb"; +import type { Message } from "@bufbuild/protobuf"; /** * Describes the file capabilities/networking/http/v1alpha/trigger.proto. */ -export const file_capabilities_networking_http_v1alpha_trigger: GenFile = - /*@__PURE__*/ - fileDesc( - 'CjJjYXBhYmlsaXRpZXMvbmV0d29ya2luZy9odHRwL3YxYWxwaGEvdHJpZ2dlci5wcm90bxIkY2FwYWJpbGl0aWVzLm5ldHdvcmtpbmcuaHR0cC52MWFscGhhIlYKBkNvbmZpZxJMCg9hdXRob3JpemVkX2tleXMYASADKAsyMy5jYXBhYmlsaXRpZXMubmV0d29ya2luZy5odHRwLnYxYWxwaGEuQXV0aG9yaXplZEtleSJaCgdQYXlsb2FkEg0KBWlucHV0GAEgASgMEkAKA2tleRgCIAEoCzIzLmNhcGFiaWxpdGllcy5uZXR3b3JraW5nLmh0dHAudjFhbHBoYS5BdXRob3JpemVkS2V5ImAKDUF1dGhvcml6ZWRLZXkSOwoEdHlwZRgBIAEoDjItLmNhcGFiaWxpdGllcy5uZXR3b3JraW5nLmh0dHAudjFhbHBoYS5LZXlUeXBlEhIKCnB1YmxpY19rZXkYAiABKAkqOwoHS2V5VHlwZRIYChRLRVlfVFlQRV9VTlNQRUNJRklFRBAAEhYKEktFWV9UWVBFX0VDRFNBX0VWTRABMpIBCgRIVFRQEmgKB1RyaWdnZXISLC5jYXBhYmlsaXRpZXMubmV0d29ya2luZy5odHRwLnYxYWxwaGEuQ29uZmlnGi0uY2FwYWJpbGl0aWVzLm5ldHdvcmtpbmcuaHR0cC52MWFscGhhLlBheWxvYWQwARoggrUYHAgBEhhodHRwLXRyaWdnZXJAMS4wLjAtYWxwaGFC6wEKKGNvbS5jYXBhYmlsaXRpZXMubmV0d29ya2luZy5odHRwLnYxYWxwaGFCDFRyaWdnZXJQcm90b1ABogIDQ05IqgIkQ2FwYWJpbGl0aWVzLk5ldHdvcmtpbmcuSHR0cC5WMWFscGhhygIkQ2FwYWJpbGl0aWVzXE5ldHdvcmtpbmdcSHR0cFxWMWFscGhh4gIwQ2FwYWJpbGl0aWVzXE5ldHdvcmtpbmdcSHR0cFxWMWFscGhhXEdQQk1ldGFkYXRh6gInQ2FwYWJpbGl0aWVzOjpOZXR3b3JraW5nOjpIdHRwOjpWMWFscGhhYgZwcm90bzM', - [file_tools_generator_v1alpha_cre_metadata], - ) +export const file_capabilities_networking_http_v1alpha_trigger: GenFile = /*@__PURE__*/ + fileDesc("CjJjYXBhYmlsaXRpZXMvbmV0d29ya2luZy9odHRwL3YxYWxwaGEvdHJpZ2dlci5wcm90bxIkY2FwYWJpbGl0aWVzLm5ldHdvcmtpbmcuaHR0cC52MWFscGhhIlYKBkNvbmZpZxJMCg9hdXRob3JpemVkX2tleXMYASADKAsyMy5jYXBhYmlsaXRpZXMubmV0d29ya2luZy5odHRwLnYxYWxwaGEuQXV0aG9yaXplZEtleSJaCgdQYXlsb2FkEg0KBWlucHV0GAEgASgMEkAKA2tleRgCIAEoCzIzLmNhcGFiaWxpdGllcy5uZXR3b3JraW5nLmh0dHAudjFhbHBoYS5BdXRob3JpemVkS2V5ImAKDUF1dGhvcml6ZWRLZXkSOwoEdHlwZRgBIAEoDjItLmNhcGFiaWxpdGllcy5uZXR3b3JraW5nLmh0dHAudjFhbHBoYS5LZXlUeXBlEhIKCnB1YmxpY19rZXkYAiABKAkqOwoHS2V5VHlwZRIYChRLRVlfVFlQRV9VTlNQRUNJRklFRBAAEhYKEktFWV9UWVBFX0VDRFNBX0VWTRABMpIBCgRIVFRQEmgKB1RyaWdnZXISLC5jYXBhYmlsaXRpZXMubmV0d29ya2luZy5odHRwLnYxYWxwaGEuQ29uZmlnGi0uY2FwYWJpbGl0aWVzLm5ldHdvcmtpbmcuaHR0cC52MWFscGhhLlBheWxvYWQwARoggrUYHAgBEhhodHRwLXRyaWdnZXJAMS4wLjAtYWxwaGFC6wEKKGNvbS5jYXBhYmlsaXRpZXMubmV0d29ya2luZy5odHRwLnYxYWxwaGFCDFRyaWdnZXJQcm90b1ABogIDQ05IqgIkQ2FwYWJpbGl0aWVzLk5ldHdvcmtpbmcuSHR0cC5WMWFscGhhygIkQ2FwYWJpbGl0aWVzXE5ldHdvcmtpbmdcSHR0cFxWMWFscGhh4gIwQ2FwYWJpbGl0aWVzXE5ldHdvcmtpbmdcSHR0cFxWMWFscGhhXEdQQk1ldGFkYXRh6gInQ2FwYWJpbGl0aWVzOjpOZXR3b3JraW5nOjpIdHRwOjpWMWFscGhhYgZwcm90bzM", [file_tools_generator_v1alpha_cre_metadata]); /** * @generated from message capabilities.networking.http.v1alpha.Config */ -export type Config = Message<'capabilities.networking.http.v1alpha.Config'> & { - /** - * Public keys against which the signature of incoming requests are validated - * - * @generated from field: repeated capabilities.networking.http.v1alpha.AuthorizedKey authorized_keys = 1; - */ - authorizedKeys: AuthorizedKey[] -} +export type Config = Message<"capabilities.networking.http.v1alpha.Config"> & { + /** + * Public keys against which the signature of incoming requests are validated + * + * @generated from field: repeated capabilities.networking.http.v1alpha.AuthorizedKey authorized_keys = 1; + */ + authorizedKeys: AuthorizedKey[]; +}; /** * @generated from message capabilities.networking.http.v1alpha.Config */ export type ConfigJson = { - /** - * Public keys against which the signature of incoming requests are validated - * - * @generated from field: repeated capabilities.networking.http.v1alpha.AuthorizedKey authorized_keys = 1; - */ - authorizedKeys?: AuthorizedKeyJson[] -} + /** + * Public keys against which the signature of incoming requests are validated + * + * @generated from field: repeated capabilities.networking.http.v1alpha.AuthorizedKey authorized_keys = 1; + */ + authorizedKeys?: AuthorizedKeyJson[]; +}; /** * Describes the message capabilities.networking.http.v1alpha.Config. * Use `create(ConfigSchema)` to create a new message. */ -export const ConfigSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_networking_http_v1alpha_trigger, 0) +export const ConfigSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_networking_http_v1alpha_trigger, 0); /** * @generated from message capabilities.networking.http.v1alpha.Payload */ -export type Payload = Message<'capabilities.networking.http.v1alpha.Payload'> & { - /** - * JSON input in the HTTP trigger request (as bytes) - * - * @generated from field: bytes input = 1; - */ - input: Uint8Array - - /** - * Key used to sign the HTTP trigger request - * - * @generated from field: capabilities.networking.http.v1alpha.AuthorizedKey key = 2; - */ - key?: AuthorizedKey -} +export type Payload = Message<"capabilities.networking.http.v1alpha.Payload"> & { + /** + * JSON input in the HTTP trigger request (as bytes) + * + * @generated from field: bytes input = 1; + */ + input: Uint8Array; + + /** + * Key used to sign the HTTP trigger request + * + * @generated from field: capabilities.networking.http.v1alpha.AuthorizedKey key = 2; + */ + key?: AuthorizedKey; +}; /** * @generated from message capabilities.networking.http.v1alpha.Payload */ export type PayloadJson = { - /** - * JSON input in the HTTP trigger request (as bytes) - * - * @generated from field: bytes input = 1; - */ - input?: string - - /** - * Key used to sign the HTTP trigger request - * - * @generated from field: capabilities.networking.http.v1alpha.AuthorizedKey key = 2; - */ - key?: AuthorizedKeyJson -} + /** + * JSON input in the HTTP trigger request (as bytes) + * + * @generated from field: bytes input = 1; + */ + input?: string; + + /** + * Key used to sign the HTTP trigger request + * + * @generated from field: capabilities.networking.http.v1alpha.AuthorizedKey key = 2; + */ + key?: AuthorizedKeyJson; +}; /** * Describes the message capabilities.networking.http.v1alpha.Payload. * Use `create(PayloadSchema)` to create a new message. */ -export const PayloadSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_networking_http_v1alpha_trigger, 1) +export const PayloadSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_networking_http_v1alpha_trigger, 1); /** * Generic and extensible authorized signer abstraction * * @generated from message capabilities.networking.http.v1alpha.AuthorizedKey */ -export type AuthorizedKey = Message<'capabilities.networking.http.v1alpha.AuthorizedKey'> & { - /** - * @generated from field: capabilities.networking.http.v1alpha.KeyType type = 1; - */ - type: KeyType - - /** - * @generated from field: string public_key = 2; - */ - publicKey: string -} +export type AuthorizedKey = Message<"capabilities.networking.http.v1alpha.AuthorizedKey"> & { + /** + * @generated from field: capabilities.networking.http.v1alpha.KeyType type = 1; + */ + type: KeyType; + + /** + * @generated from field: string public_key = 2; + */ + publicKey: string; +}; /** * Generic and extensible authorized signer abstraction @@ -118,62 +112,62 @@ export type AuthorizedKey = Message<'capabilities.networking.http.v1alpha.Author * @generated from message capabilities.networking.http.v1alpha.AuthorizedKey */ export type AuthorizedKeyJson = { - /** - * @generated from field: capabilities.networking.http.v1alpha.KeyType type = 1; - */ - type?: KeyTypeJson - - /** - * @generated from field: string public_key = 2; - */ - publicKey?: string -} + /** + * @generated from field: capabilities.networking.http.v1alpha.KeyType type = 1; + */ + type?: KeyTypeJson; + + /** + * @generated from field: string public_key = 2; + */ + publicKey?: string; +}; /** * Describes the message capabilities.networking.http.v1alpha.AuthorizedKey. * Use `create(AuthorizedKeySchema)` to create a new message. */ -export const AuthorizedKeySchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_networking_http_v1alpha_trigger, 2) +export const AuthorizedKeySchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_networking_http_v1alpha_trigger, 2); /** * @generated from enum capabilities.networking.http.v1alpha.KeyType */ export enum KeyType { - /** - * @generated from enum value: KEY_TYPE_UNSPECIFIED = 0; - */ - UNSPECIFIED = 0, - - /** - * @generated from enum value: KEY_TYPE_ECDSA_EVM = 1; - */ - ECDSA_EVM = 1, + /** + * @generated from enum value: KEY_TYPE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: KEY_TYPE_ECDSA_EVM = 1; + */ + ECDSA_EVM = 1, } /** * @generated from enum capabilities.networking.http.v1alpha.KeyType */ -export type KeyTypeJson = 'KEY_TYPE_UNSPECIFIED' | 'KEY_TYPE_ECDSA_EVM' +export type KeyTypeJson = "KEY_TYPE_UNSPECIFIED" | "KEY_TYPE_ECDSA_EVM"; /** * Describes the enum capabilities.networking.http.v1alpha.KeyType. */ -export const KeyTypeSchema: GenEnum = - /*@__PURE__*/ - enumDesc(file_capabilities_networking_http_v1alpha_trigger, 0) +export const KeyTypeSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_capabilities_networking_http_v1alpha_trigger, 0); /** * @generated from service capabilities.networking.http.v1alpha.HTTP */ export const HTTP: GenService<{ - /** - * @generated from rpc capabilities.networking.http.v1alpha.HTTP.Trigger - */ - trigger: { - methodKind: 'server_streaming' - input: typeof ConfigSchema - output: typeof PayloadSchema - } -}> = /*@__PURE__*/ serviceDesc(file_capabilities_networking_http_v1alpha_trigger, 0) + /** + * @generated from rpc capabilities.networking.http.v1alpha.HTTP.Trigger + */ + trigger: { + methodKind: "server_streaming"; + input: typeof ConfigSchema; + output: typeof PayloadSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_capabilities_networking_http_v1alpha_trigger, 0); + diff --git a/src/generated/capabilities/scheduler/cron/v1/trigger_pb.ts b/src/generated/capabilities/scheduler/cron/v1/trigger_pb.ts index 56d270df..063ea161 100644 --- a/src/generated/capabilities/scheduler/cron/v1/trigger_pb.ts +++ b/src/generated/capabilities/scheduler/cron/v1/trigger_pb.ts @@ -2,137 +2,132 @@ // @generated from file capabilities/scheduler/cron/v1/trigger.proto (package capabilities.scheduler.cron.v1, syntax proto3) /* eslint-disable */ -import type { GenFile, GenMessage, GenService } from '@bufbuild/protobuf/codegenv2' -import { fileDesc, messageDesc, serviceDesc } from '@bufbuild/protobuf/codegenv2' -import type { Timestamp, TimestampJson } from '@bufbuild/protobuf/wkt' -import { file_google_protobuf_timestamp } from '@bufbuild/protobuf/wkt' -import { file_tools_generator_v1alpha_cre_metadata } from '../../../../tools/generator/v1alpha/cre_metadata_pb' -import type { Message } from '@bufbuild/protobuf' +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import type { Timestamp, TimestampJson } from "@bufbuild/protobuf/wkt"; +import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; +import { file_tools_generator_v1alpha_cre_metadata } from "../../../../tools/generator/v1alpha/cre_metadata_pb"; +import type { Message } from "@bufbuild/protobuf"; /** * Describes the file capabilities/scheduler/cron/v1/trigger.proto. */ -export const file_capabilities_scheduler_cron_v1_trigger: GenFile = - /*@__PURE__*/ - fileDesc( - 'CixjYXBhYmlsaXRpZXMvc2NoZWR1bGVyL2Nyb24vdjEvdHJpZ2dlci5wcm90bxIeY2FwYWJpbGl0aWVzLnNjaGVkdWxlci5jcm9uLnYxIhoKBkNvbmZpZxIQCghzY2hlZHVsZRgBIAEoCSJHCgdQYXlsb2FkEjwKGHNjaGVkdWxlZF9leGVjdXRpb25fdGltZRgBIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXAiNQoNTGVnYWN5UGF5bG9hZBIgChhzY2hlZHVsZWRfZXhlY3V0aW9uX3RpbWUYASABKAk6AhgBMvUBCgRDcm9uElwKB1RyaWdnZXISJi5jYXBhYmlsaXRpZXMuc2NoZWR1bGVyLmNyb24udjEuQ29uZmlnGicuY2FwYWJpbGl0aWVzLnNjaGVkdWxlci5jcm9uLnYxLlBheWxvYWQwARJzCg1MZWdhY3lUcmlnZ2VyEiYuY2FwYWJpbGl0aWVzLnNjaGVkdWxlci5jcm9uLnYxLkNvbmZpZxotLmNhcGFiaWxpdGllcy5zY2hlZHVsZXIuY3Jvbi52MS5MZWdhY3lQYXlsb2FkIgmIAgGKtRgCCAEwARoagrUYFggBEhJjcm9uLXRyaWdnZXJAMS4wLjBCzQEKImNvbS5jYXBhYmlsaXRpZXMuc2NoZWR1bGVyLmNyb24udjFCDFRyaWdnZXJQcm90b1ABogIDQ1NDqgIeQ2FwYWJpbGl0aWVzLlNjaGVkdWxlci5Dcm9uLlYxygIeQ2FwYWJpbGl0aWVzXFNjaGVkdWxlclxDcm9uXFYx4gIqQ2FwYWJpbGl0aWVzXFNjaGVkdWxlclxDcm9uXFYxXEdQQk1ldGFkYXRh6gIhQ2FwYWJpbGl0aWVzOjpTY2hlZHVsZXI6OkNyb246OlYxYgZwcm90bzM', - [file_google_protobuf_timestamp, file_tools_generator_v1alpha_cre_metadata], - ) +export const file_capabilities_scheduler_cron_v1_trigger: GenFile = /*@__PURE__*/ + fileDesc("CixjYXBhYmlsaXRpZXMvc2NoZWR1bGVyL2Nyb24vdjEvdHJpZ2dlci5wcm90bxIeY2FwYWJpbGl0aWVzLnNjaGVkdWxlci5jcm9uLnYxIhoKBkNvbmZpZxIQCghzY2hlZHVsZRgBIAEoCSJHCgdQYXlsb2FkEjwKGHNjaGVkdWxlZF9leGVjdXRpb25fdGltZRgBIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXAiNQoNTGVnYWN5UGF5bG9hZBIgChhzY2hlZHVsZWRfZXhlY3V0aW9uX3RpbWUYASABKAk6AhgBMvUBCgRDcm9uElwKB1RyaWdnZXISJi5jYXBhYmlsaXRpZXMuc2NoZWR1bGVyLmNyb24udjEuQ29uZmlnGicuY2FwYWJpbGl0aWVzLnNjaGVkdWxlci5jcm9uLnYxLlBheWxvYWQwARJzCg1MZWdhY3lUcmlnZ2VyEiYuY2FwYWJpbGl0aWVzLnNjaGVkdWxlci5jcm9uLnYxLkNvbmZpZxotLmNhcGFiaWxpdGllcy5zY2hlZHVsZXIuY3Jvbi52MS5MZWdhY3lQYXlsb2FkIgmIAgGKtRgCCAEwARoagrUYFggBEhJjcm9uLXRyaWdnZXJAMS4wLjBCzQEKImNvbS5jYXBhYmlsaXRpZXMuc2NoZWR1bGVyLmNyb24udjFCDFRyaWdnZXJQcm90b1ABogIDQ1NDqgIeQ2FwYWJpbGl0aWVzLlNjaGVkdWxlci5Dcm9uLlYxygIeQ2FwYWJpbGl0aWVzXFNjaGVkdWxlclxDcm9uXFYx4gIqQ2FwYWJpbGl0aWVzXFNjaGVkdWxlclxDcm9uXFYxXEdQQk1ldGFkYXRh6gIhQ2FwYWJpbGl0aWVzOjpTY2hlZHVsZXI6OkNyb246OlYxYgZwcm90bzM", [file_google_protobuf_timestamp, file_tools_generator_v1alpha_cre_metadata]); /** * @generated from message capabilities.scheduler.cron.v1.Config */ -export type Config = Message<'capabilities.scheduler.cron.v1.Config'> & { - /** - * Cron schedule string - * - * @generated from field: string schedule = 1; - */ - schedule: string -} +export type Config = Message<"capabilities.scheduler.cron.v1.Config"> & { + /** + * Cron schedule string + * + * @generated from field: string schedule = 1; + */ + schedule: string; +}; /** * @generated from message capabilities.scheduler.cron.v1.Config */ export type ConfigJson = { - /** - * Cron schedule string - * - * @generated from field: string schedule = 1; - */ - schedule?: string -} + /** + * Cron schedule string + * + * @generated from field: string schedule = 1; + */ + schedule?: string; +}; /** * Describes the message capabilities.scheduler.cron.v1.Config. * Use `create(ConfigSchema)` to create a new message. */ -export const ConfigSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_scheduler_cron_v1_trigger, 0) +export const ConfigSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_scheduler_cron_v1_trigger, 0); /** * @generated from message capabilities.scheduler.cron.v1.Payload */ -export type Payload = Message<'capabilities.scheduler.cron.v1.Payload'> & { - /** - * @generated from field: google.protobuf.Timestamp scheduled_execution_time = 1; - */ - scheduledExecutionTime?: Timestamp -} +export type Payload = Message<"capabilities.scheduler.cron.v1.Payload"> & { + /** + * @generated from field: google.protobuf.Timestamp scheduled_execution_time = 1; + */ + scheduledExecutionTime?: Timestamp; +}; /** * @generated from message capabilities.scheduler.cron.v1.Payload */ export type PayloadJson = { - /** - * @generated from field: google.protobuf.Timestamp scheduled_execution_time = 1; - */ - scheduledExecutionTime?: TimestampJson -} + /** + * @generated from field: google.protobuf.Timestamp scheduled_execution_time = 1; + */ + scheduledExecutionTime?: TimestampJson; +}; /** * Describes the message capabilities.scheduler.cron.v1.Payload. * Use `create(PayloadSchema)` to create a new message. */ -export const PayloadSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_scheduler_cron_v1_trigger, 1) +export const PayloadSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_scheduler_cron_v1_trigger, 1); /** * @generated from message capabilities.scheduler.cron.v1.LegacyPayload * @deprecated */ -export type LegacyPayload = Message<'capabilities.scheduler.cron.v1.LegacyPayload'> & { - /** - * Time that cron trigger's task execution had been scheduled to occur (RFC3339Nano formatted) - * - * @generated from field: string scheduled_execution_time = 1; - */ - scheduledExecutionTime: string -} +export type LegacyPayload = Message<"capabilities.scheduler.cron.v1.LegacyPayload"> & { + /** + * Time that cron trigger's task execution had been scheduled to occur (RFC3339Nano formatted) + * + * @generated from field: string scheduled_execution_time = 1; + */ + scheduledExecutionTime: string; +}; /** * @generated from message capabilities.scheduler.cron.v1.LegacyPayload * @deprecated */ export type LegacyPayloadJson = { - /** - * Time that cron trigger's task execution had been scheduled to occur (RFC3339Nano formatted) - * - * @generated from field: string scheduled_execution_time = 1; - */ - scheduledExecutionTime?: string -} + /** + * Time that cron trigger's task execution had been scheduled to occur (RFC3339Nano formatted) + * + * @generated from field: string scheduled_execution_time = 1; + */ + scheduledExecutionTime?: string; +}; /** * Describes the message capabilities.scheduler.cron.v1.LegacyPayload. * Use `create(LegacyPayloadSchema)` to create a new message. * @deprecated */ -export const LegacyPayloadSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_capabilities_scheduler_cron_v1_trigger, 2) +export const LegacyPayloadSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_capabilities_scheduler_cron_v1_trigger, 2); /** * @generated from service capabilities.scheduler.cron.v1.Cron */ export const Cron: GenService<{ - /** - * @generated from rpc capabilities.scheduler.cron.v1.Cron.Trigger - */ - trigger: { - methodKind: 'server_streaming' - input: typeof ConfigSchema - output: typeof PayloadSchema - } - /** - * @generated from rpc capabilities.scheduler.cron.v1.Cron.LegacyTrigger - * @deprecated - */ - legacyTrigger: { - methodKind: 'server_streaming' - input: typeof ConfigSchema - output: typeof LegacyPayloadSchema - } -}> = /*@__PURE__*/ serviceDesc(file_capabilities_scheduler_cron_v1_trigger, 0) + /** + * @generated from rpc capabilities.scheduler.cron.v1.Cron.Trigger + */ + trigger: { + methodKind: "server_streaming"; + input: typeof ConfigSchema; + output: typeof PayloadSchema; + }, + /** + * @generated from rpc capabilities.scheduler.cron.v1.Cron.LegacyTrigger + * @deprecated + */ + legacyTrigger: { + methodKind: "server_streaming"; + input: typeof ConfigSchema; + output: typeof LegacyPayloadSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_capabilities_scheduler_cron_v1_trigger, 0); + diff --git a/src/generated/sdk/v1alpha/sdk_pb.ts b/src/generated/sdk/v1alpha/sdk_pb.ts index 97c0b08f..daf96160 100644 --- a/src/generated/sdk/v1alpha/sdk_pb.ts +++ b/src/generated/sdk/v1alpha/sdk_pb.ts @@ -2,1149 +2,1087 @@ // @generated from file sdk/v1alpha/sdk.proto (package sdk.v1alpha, syntax proto3) /* eslint-disable */ -import type { GenEnum, GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2' -import { enumDesc, fileDesc, messageDesc } from '@bufbuild/protobuf/codegenv2' -import type { Any, AnyJson, Empty, EmptyJson } from '@bufbuild/protobuf/wkt' -import { file_google_protobuf_any, file_google_protobuf_empty } from '@bufbuild/protobuf/wkt' -import type { Value, ValueJson } from '../../values/v1/values_pb' -import { file_values_v1_values } from '../../values/v1/values_pb' -import type { Message } from '@bufbuild/protobuf' +import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; +import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; +import type { Any, AnyJson, Empty, EmptyJson } from "@bufbuild/protobuf/wkt"; +import { file_google_protobuf_any, file_google_protobuf_empty } from "@bufbuild/protobuf/wkt"; +import type { Value, ValueJson } from "../../values/v1/values_pb"; +import { file_values_v1_values } from "../../values/v1/values_pb"; +import type { Message } from "@bufbuild/protobuf"; /** * Describes the file sdk/v1alpha/sdk.proto. */ -export const file_sdk_v1alpha_sdk: GenFile = - /*@__PURE__*/ - fileDesc( - 'ChVzZGsvdjFhbHBoYS9zZGsucHJvdG8SC3Nkay52MWFscGhhIrQBChVTaW1wbGVDb25zZW5zdXNJbnB1dHMSIQoFdmFsdWUYASABKAsyEC52YWx1ZXMudjEuVmFsdWVIABIPCgVlcnJvchgCIAEoCUgAEjUKC2Rlc2NyaXB0b3JzGAMgASgLMiAuc2RrLnYxYWxwaGEuQ29uc2Vuc3VzRGVzY3JpcHRvchIhCgdkZWZhdWx0GAQgASgLMhAudmFsdWVzLnYxLlZhbHVlQg0KC29ic2VydmF0aW9uIpABCglGaWVsZHNNYXASMgoGZmllbGRzGAEgAygLMiIuc2RrLnYxYWxwaGEuRmllbGRzTWFwLkZpZWxkc0VudHJ5Gk8KC0ZpZWxkc0VudHJ5EgsKA2tleRgBIAEoCRIvCgV2YWx1ZRgCIAEoCzIgLnNkay52MWFscGhhLkNvbnNlbnN1c0Rlc2NyaXB0b3I6AjgBIoYBChNDb25zZW5zdXNEZXNjcmlwdG9yEjMKC2FnZ3JlZ2F0aW9uGAEgASgOMhwuc2RrLnYxYWxwaGEuQWdncmVnYXRpb25UeXBlSAASLAoKZmllbGRzX21hcBgCIAEoCzIWLnNkay52MWFscGhhLkZpZWxkc01hcEgAQgwKCmRlc2NyaXB0b3IiagoNUmVwb3J0UmVxdWVzdBIXCg9lbmNvZGVkX3BheWxvYWQYASABKAwSFAoMZW5jb2Rlcl9uYW1lGAIgASgJEhQKDHNpZ25pbmdfYWxnbxgDIAEoCRIUCgxoYXNoaW5nX2FsZ28YBCABKAkilwEKDlJlcG9ydFJlc3BvbnNlEhUKDWNvbmZpZ19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goCaWQYASABKAkSEQoJbmFtZXNwYWNlGAIgASgJEg0KBW93bmVyGAMgASgJEg0KBWVycm9yGAQgASgJIm4KDlNlY3JldFJlc3BvbnNlEiUKBnNlY3JldBgBIAEoCzITLnNkay52MWFscGhhLlNlY3JldEgAEikKBWVycm9yGAIgASgLMhguc2RrLnYxYWxwaGEuU2VjcmV0RXJyb3JIAEIKCghyZXNwb25zZSJBCg9TZWNyZXRSZXNwb25zZXMSLgoJcmVzcG9uc2VzGAEgAygLMhsuc2RrLnYxYWxwaGEuU2VjcmV0UmVzcG9uc2UquAEKD0FnZ3JlZ2F0aW9uVHlwZRIgChxBR0dSRUdBVElPTl9UWVBFX1VOU1BFQ0lGSUVEEAASGwoXQUdHUkVHQVRJT05fVFlQRV9NRURJQU4QARIeChpBR0dSRUdBVElPTl9UWVBFX0lERU5USUNBTBACEiIKHkFHR1JFR0FUSU9OX1RZUEVfQ09NTU9OX1BSRUZJWBADEiIKHkFHR1JFR0FUSU9OX1RZUEVfQ09NTU9OX1NVRkZJWBAEKjkKBE1vZGUSFAoQTU9ERV9VTlNQRUNJRklFRBAAEgwKCE1PREVfRE9OEAESDQoJTU9ERV9OT0RFEAJCaAoPY29tLnNkay52MWFscGhhQghTZGtQcm90b1ABogIDU1hYqgILU2RrLlYxYWxwaGHKAgtTZGtcVjFhbHBoYeICF1Nka1xWMWFscGhhXEdQQk1ldGFkYXRh6gIMU2RrOjpWMWFscGhhYgZwcm90bzM', - [file_google_protobuf_any, file_google_protobuf_empty, file_values_v1_values], - ) +export const file_sdk_v1alpha_sdk: GenFile = /*@__PURE__*/ + fileDesc("ChVzZGsvdjFhbHBoYS9zZGsucHJvdG8SC3Nkay52MWFscGhhIrQBChVTaW1wbGVDb25zZW5zdXNJbnB1dHMSIQoFdmFsdWUYASABKAsyEC52YWx1ZXMudjEuVmFsdWVIABIPCgVlcnJvchgCIAEoCUgAEjUKC2Rlc2NyaXB0b3JzGAMgASgLMiAuc2RrLnYxYWxwaGEuQ29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QU4QARIeChpBR0dSRUdBVElPTl9UWVBFX0lERU5USUNBTBACEiIKHkFHR1JFR0FUSU9OX1RZUEVfQ09NTU9OX1BSRUZJWBADEiIKHkFHR1JFR0FUSU9OX1RZUEVfQ09NTU9OX1NVRkZJWBAEKjkKBE1vZGUSFAoQTU9ERV9VTlNQRUNJRklFRBAAEgwKCE1PREVfRE9OEAESDQoJTU9ERV9OT0RFEAJCaAoPY29tLnNkay52MWFscGhhQghTZGtQcm90b1ABogIDU1hYqgILU2RrLlYxYWxwaGHKAgtTZGtcVjFhbHBoYeICF1Nka1xWMWFscGhhXEdQQk1ldGFkYXRh6gIMU2RrOjpWMWFscGhhYgZwcm90bzM", [file_google_protobuf_any, file_google_protobuf_empty, file_values_v1_values]); /** * @generated from message sdk.v1alpha.SimpleConsensusInputs */ -export type SimpleConsensusInputs = Message<'sdk.v1alpha.SimpleConsensusInputs'> & { - /** - * @generated from oneof sdk.v1alpha.SimpleConsensusInputs.observation - */ - observation: - | { - /** - * @generated from field: values.v1.Value value = 1; - */ - value: Value - case: 'value' - } - | { - /** - * @generated from field: string error = 2; - */ - value: string - case: 'error' - } - | { case: undefined; value?: undefined } - - /** - * @generated from field: sdk.v1alpha.ConsensusDescriptor descriptors = 3; - */ - descriptors?: ConsensusDescriptor - - /** - * @generated from field: values.v1.Value default = 4; - */ - default?: Value -} +export type SimpleConsensusInputs = Message<"sdk.v1alpha.SimpleConsensusInputs"> & { + /** + * @generated from oneof sdk.v1alpha.SimpleConsensusInputs.observation + */ + observation: { + /** + * @generated from field: values.v1.Value value = 1; + */ + value: Value; + case: "value"; + } | { + /** + * @generated from field: string error = 2; + */ + value: string; + case: "error"; + } | { case: undefined; value?: undefined }; + + /** + * @generated from field: sdk.v1alpha.ConsensusDescriptor descriptors = 3; + */ + descriptors?: ConsensusDescriptor; + + /** + * @generated from field: values.v1.Value default = 4; + */ + default?: Value; +}; /** * @generated from message sdk.v1alpha.SimpleConsensusInputs */ export type SimpleConsensusInputsJson = { - /** - * @generated from field: values.v1.Value value = 1; - */ - value?: ValueJson - - /** - * @generated from field: string error = 2; - */ - error?: string - - /** - * @generated from field: sdk.v1alpha.ConsensusDescriptor descriptors = 3; - */ - descriptors?: ConsensusDescriptorJson - - /** - * @generated from field: values.v1.Value default = 4; - */ - default?: ValueJson -} + /** + * @generated from field: values.v1.Value value = 1; + */ + value?: ValueJson; + + /** + * @generated from field: string error = 2; + */ + error?: string; + + /** + * @generated from field: sdk.v1alpha.ConsensusDescriptor descriptors = 3; + */ + descriptors?: ConsensusDescriptorJson; + + /** + * @generated from field: values.v1.Value default = 4; + */ + default?: ValueJson; +}; /** * Describes the message sdk.v1alpha.SimpleConsensusInputs. * Use `create(SimpleConsensusInputsSchema)` to create a new message. */ -export const SimpleConsensusInputsSchema: GenMessage< - SimpleConsensusInputs, - { jsonType: SimpleConsensusInputsJson } -> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 0) +export const SimpleConsensusInputsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 0); /** * @generated from message sdk.v1alpha.FieldsMap */ -export type FieldsMap = Message<'sdk.v1alpha.FieldsMap'> & { - /** - * @generated from field: map fields = 1; - */ - fields: { [key: string]: ConsensusDescriptor } -} +export type FieldsMap = Message<"sdk.v1alpha.FieldsMap"> & { + /** + * @generated from field: map fields = 1; + */ + fields: { [key: string]: ConsensusDescriptor }; +}; /** * @generated from message sdk.v1alpha.FieldsMap */ export type FieldsMapJson = { - /** - * @generated from field: map fields = 1; - */ - fields?: { [key: string]: ConsensusDescriptorJson } -} + /** + * @generated from field: map fields = 1; + */ + fields?: { [key: string]: ConsensusDescriptorJson }; +}; /** * Describes the message sdk.v1alpha.FieldsMap. * Use `create(FieldsMapSchema)` to create a new message. */ -export const FieldsMapSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_sdk_v1alpha_sdk, 1) +export const FieldsMapSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 1); /** * @generated from message sdk.v1alpha.ConsensusDescriptor */ -export type ConsensusDescriptor = Message<'sdk.v1alpha.ConsensusDescriptor'> & { - /** - * @generated from oneof sdk.v1alpha.ConsensusDescriptor.descriptor - */ - descriptor: - | { - /** - * @generated from field: sdk.v1alpha.AggregationType aggregation = 1; - */ - value: AggregationType - case: 'aggregation' - } - | { - /** - * @generated from field: sdk.v1alpha.FieldsMap fields_map = 2; - */ - value: FieldsMap - case: 'fieldsMap' - } - | { case: undefined; value?: undefined } -} +export type ConsensusDescriptor = Message<"sdk.v1alpha.ConsensusDescriptor"> & { + /** + * @generated from oneof sdk.v1alpha.ConsensusDescriptor.descriptor + */ + descriptor: { + /** + * @generated from field: sdk.v1alpha.AggregationType aggregation = 1; + */ + value: AggregationType; + case: "aggregation"; + } | { + /** + * @generated from field: sdk.v1alpha.FieldsMap fields_map = 2; + */ + value: FieldsMap; + case: "fieldsMap"; + } | { case: undefined; value?: undefined }; +}; /** * @generated from message sdk.v1alpha.ConsensusDescriptor */ export type ConsensusDescriptorJson = { - /** - * @generated from field: sdk.v1alpha.AggregationType aggregation = 1; - */ - aggregation?: AggregationTypeJson - - /** - * @generated from field: sdk.v1alpha.FieldsMap fields_map = 2; - */ - fieldsMap?: FieldsMapJson -} + /** + * @generated from field: sdk.v1alpha.AggregationType aggregation = 1; + */ + aggregation?: AggregationTypeJson; + + /** + * @generated from field: sdk.v1alpha.FieldsMap fields_map = 2; + */ + fieldsMap?: FieldsMapJson; +}; /** * Describes the message sdk.v1alpha.ConsensusDescriptor. * Use `create(ConsensusDescriptorSchema)` to create a new message. */ -export const ConsensusDescriptorSchema: GenMessage< - ConsensusDescriptor, - { jsonType: ConsensusDescriptorJson } -> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 2) +export const ConsensusDescriptorSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 2); /** * @generated from message sdk.v1alpha.ReportRequest */ -export type ReportRequest = Message<'sdk.v1alpha.ReportRequest'> & { - /** - * @generated from field: bytes encoded_payload = 1; - */ - encodedPayload: Uint8Array - - /** - * @generated from field: string encoder_name = 2; - */ - encoderName: string - - /** - * @generated from field: string signing_algo = 3; - */ - signingAlgo: string - - /** - * @generated from field: string hashing_algo = 4; - */ - hashingAlgo: string -} +export type ReportRequest = Message<"sdk.v1alpha.ReportRequest"> & { + /** + * @generated from field: bytes encoded_payload = 1; + */ + encodedPayload: Uint8Array; + + /** + * @generated from field: string encoder_name = 2; + */ + encoderName: string; + + /** + * @generated from field: string signing_algo = 3; + */ + signingAlgo: string; + + /** + * @generated from field: string hashing_algo = 4; + */ + hashingAlgo: string; +}; /** * @generated from message sdk.v1alpha.ReportRequest */ export type ReportRequestJson = { - /** - * @generated from field: bytes encoded_payload = 1; - */ - encodedPayload?: string - - /** - * @generated from field: string encoder_name = 2; - */ - encoderName?: string - - /** - * @generated from field: string signing_algo = 3; - */ - signingAlgo?: string - - /** - * @generated from field: string hashing_algo = 4; - */ - hashingAlgo?: string -} + /** + * @generated from field: bytes encoded_payload = 1; + */ + encodedPayload?: string; + + /** + * @generated from field: string encoder_name = 2; + */ + encoderName?: string; + + /** + * @generated from field: string signing_algo = 3; + */ + signingAlgo?: string; + + /** + * @generated from field: string hashing_algo = 4; + */ + hashingAlgo?: string; +}; /** * Describes the message sdk.v1alpha.ReportRequest. * Use `create(ReportRequestSchema)` to create a new message. */ -export const ReportRequestSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_sdk_v1alpha_sdk, 3) +export const ReportRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 3); /** * @generated from message sdk.v1alpha.ReportResponse */ -export type ReportResponse = Message<'sdk.v1alpha.ReportResponse'> & { - /** - * @generated from field: bytes config_digest = 1; - */ - configDigest: Uint8Array - - /** - * @generated from field: uint64 seq_nr = 2 [jstype = JS_NORMAL]; - */ - seqNr: bigint - - /** - * combination of seq_nr and config_digest - * - * @generated from field: bytes report_context = 3; - */ - reportContext: Uint8Array - - /** - * @generated from field: bytes raw_report = 4; - */ - rawReport: Uint8Array - - /** - * @generated from field: repeated sdk.v1alpha.AttributedSignature sigs = 5; - */ - sigs: AttributedSignature[] -} +export type ReportResponse = Message<"sdk.v1alpha.ReportResponse"> & { + /** + * @generated from field: bytes config_digest = 1; + */ + configDigest: Uint8Array; + + /** + * @generated from field: uint64 seq_nr = 2 [jstype = JS_NORMAL]; + */ + seqNr: bigint; + + /** + * combination of seq_nr and config_digest + * + * @generated from field: bytes report_context = 3; + */ + reportContext: Uint8Array; + + /** + * @generated from field: bytes raw_report = 4; + */ + rawReport: Uint8Array; + + /** + * @generated from field: repeated sdk.v1alpha.AttributedSignature sigs = 5; + */ + sigs: AttributedSignature[]; +}; /** * @generated from message sdk.v1alpha.ReportResponse */ export type ReportResponseJson = { - /** - * @generated from field: bytes config_digest = 1; - */ - configDigest?: string - - /** - * @generated from field: uint64 seq_nr = 2 [jstype = JS_NORMAL]; - */ - seqNr?: string - - /** - * combination of seq_nr and config_digest - * - * @generated from field: bytes report_context = 3; - */ - reportContext?: string - - /** - * @generated from field: bytes raw_report = 4; - */ - rawReport?: string - - /** - * @generated from field: repeated sdk.v1alpha.AttributedSignature sigs = 5; - */ - sigs?: AttributedSignatureJson[] -} + /** + * @generated from field: bytes config_digest = 1; + */ + configDigest?: string; + + /** + * @generated from field: uint64 seq_nr = 2 [jstype = JS_NORMAL]; + */ + seqNr?: string; + + /** + * combination of seq_nr and config_digest + * + * @generated from field: bytes report_context = 3; + */ + reportContext?: string; + + /** + * @generated from field: bytes raw_report = 4; + */ + rawReport?: string; + + /** + * @generated from field: repeated sdk.v1alpha.AttributedSignature sigs = 5; + */ + sigs?: AttributedSignatureJson[]; +}; /** * Describes the message sdk.v1alpha.ReportResponse. * Use `create(ReportResponseSchema)` to create a new message. */ -export const ReportResponseSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_sdk_v1alpha_sdk, 4) +export const ReportResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 4); /** * @generated from message sdk.v1alpha.AttributedSignature */ -export type AttributedSignature = Message<'sdk.v1alpha.AttributedSignature'> & { - /** - * @generated from field: bytes signature = 1; - */ - signature: Uint8Array +export type AttributedSignature = Message<"sdk.v1alpha.AttributedSignature"> & { + /** + * @generated from field: bytes signature = 1; + */ + signature: Uint8Array; - /** - * @generated from field: uint32 signer_id = 2; - */ - signerId: number -} + /** + * @generated from field: uint32 signer_id = 2; + */ + signerId: number; +}; /** * @generated from message sdk.v1alpha.AttributedSignature */ export type AttributedSignatureJson = { - /** - * @generated from field: bytes signature = 1; - */ - signature?: string - - /** - * @generated from field: uint32 signer_id = 2; - */ - signerId?: number -} + /** + * @generated from field: bytes signature = 1; + */ + signature?: string; + + /** + * @generated from field: uint32 signer_id = 2; + */ + signerId?: number; +}; /** * Describes the message sdk.v1alpha.AttributedSignature. * Use `create(AttributedSignatureSchema)` to create a new message. */ -export const AttributedSignatureSchema: GenMessage< - AttributedSignature, - { jsonType: AttributedSignatureJson } -> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 5) +export const AttributedSignatureSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 5); /** * @generated from message sdk.v1alpha.CapabilityRequest */ -export type CapabilityRequest = Message<'sdk.v1alpha.CapabilityRequest'> & { - /** - * @generated from field: string id = 1; - */ - id: string - - /** - * @generated from field: google.protobuf.Any payload = 2; - */ - payload?: Any - - /** - * @generated from field: string method = 3; - */ - method: string - - /** - * @generated from field: int32 callback_id = 4; - */ - callbackId: number -} +export type CapabilityRequest = Message<"sdk.v1alpha.CapabilityRequest"> & { + /** + * @generated from field: string id = 1; + */ + id: string; + + /** + * @generated from field: google.protobuf.Any payload = 2; + */ + payload?: Any; + + /** + * @generated from field: string method = 3; + */ + method: string; + + /** + * @generated from field: int32 callback_id = 4; + */ + callbackId: number; +}; /** * @generated from message sdk.v1alpha.CapabilityRequest */ export type CapabilityRequestJson = { - /** - * @generated from field: string id = 1; - */ - id?: string - - /** - * @generated from field: google.protobuf.Any payload = 2; - */ - payload?: AnyJson - - /** - * @generated from field: string method = 3; - */ - method?: string - - /** - * @generated from field: int32 callback_id = 4; - */ - callbackId?: number -} + /** + * @generated from field: string id = 1; + */ + id?: string; + + /** + * @generated from field: google.protobuf.Any payload = 2; + */ + payload?: AnyJson; + + /** + * @generated from field: string method = 3; + */ + method?: string; + + /** + * @generated from field: int32 callback_id = 4; + */ + callbackId?: number; +}; /** * Describes the message sdk.v1alpha.CapabilityRequest. * Use `create(CapabilityRequestSchema)` to create a new message. */ -export const CapabilityRequestSchema: GenMessage< - CapabilityRequest, - { jsonType: CapabilityRequestJson } -> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 6) +export const CapabilityRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 6); /** * @generated from message sdk.v1alpha.CapabilityResponse */ -export type CapabilityResponse = Message<'sdk.v1alpha.CapabilityResponse'> & { - /** - * @generated from oneof sdk.v1alpha.CapabilityResponse.response - */ - response: - | { - /** - * @generated from field: google.protobuf.Any payload = 1; - */ - value: Any - case: 'payload' - } - | { - /** - * @generated from field: string error = 2; - */ - value: string - case: 'error' - } - | { case: undefined; value?: undefined } -} +export type CapabilityResponse = Message<"sdk.v1alpha.CapabilityResponse"> & { + /** + * @generated from oneof sdk.v1alpha.CapabilityResponse.response + */ + response: { + /** + * @generated from field: google.protobuf.Any payload = 1; + */ + value: Any; + case: "payload"; + } | { + /** + * @generated from field: string error = 2; + */ + value: string; + case: "error"; + } | { case: undefined; value?: undefined }; +}; /** * @generated from message sdk.v1alpha.CapabilityResponse */ export type CapabilityResponseJson = { - /** - * @generated from field: google.protobuf.Any payload = 1; - */ - payload?: AnyJson - - /** - * @generated from field: string error = 2; - */ - error?: string -} + /** + * @generated from field: google.protobuf.Any payload = 1; + */ + payload?: AnyJson; + + /** + * @generated from field: string error = 2; + */ + error?: string; +}; /** * Describes the message sdk.v1alpha.CapabilityResponse. * Use `create(CapabilityResponseSchema)` to create a new message. */ -export const CapabilityResponseSchema: GenMessage< - CapabilityResponse, - { jsonType: CapabilityResponseJson } -> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 7) +export const CapabilityResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 7); /** * @generated from message sdk.v1alpha.TriggerSubscription */ -export type TriggerSubscription = Message<'sdk.v1alpha.TriggerSubscription'> & { - /** - * @generated from field: string id = 1; - */ - id: string - - /** - * @generated from field: google.protobuf.Any payload = 2; - */ - payload?: Any - - /** - * @generated from field: string method = 3; - */ - method: string -} +export type TriggerSubscription = Message<"sdk.v1alpha.TriggerSubscription"> & { + /** + * @generated from field: string id = 1; + */ + id: string; + + /** + * @generated from field: google.protobuf.Any payload = 2; + */ + payload?: Any; + + /** + * @generated from field: string method = 3; + */ + method: string; +}; /** * @generated from message sdk.v1alpha.TriggerSubscription */ export type TriggerSubscriptionJson = { - /** - * @generated from field: string id = 1; - */ - id?: string - - /** - * @generated from field: google.protobuf.Any payload = 2; - */ - payload?: AnyJson - - /** - * @generated from field: string method = 3; - */ - method?: string -} + /** + * @generated from field: string id = 1; + */ + id?: string; + + /** + * @generated from field: google.protobuf.Any payload = 2; + */ + payload?: AnyJson; + + /** + * @generated from field: string method = 3; + */ + method?: string; +}; /** * Describes the message sdk.v1alpha.TriggerSubscription. * Use `create(TriggerSubscriptionSchema)` to create a new message. */ -export const TriggerSubscriptionSchema: GenMessage< - TriggerSubscription, - { jsonType: TriggerSubscriptionJson } -> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 8) +export const TriggerSubscriptionSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 8); /** * @generated from message sdk.v1alpha.TriggerSubscriptionRequest */ -export type TriggerSubscriptionRequest = Message<'sdk.v1alpha.TriggerSubscriptionRequest'> & { - /** - * @generated from field: repeated sdk.v1alpha.TriggerSubscription subscriptions = 1; - */ - subscriptions: TriggerSubscription[] -} +export type TriggerSubscriptionRequest = Message<"sdk.v1alpha.TriggerSubscriptionRequest"> & { + /** + * @generated from field: repeated sdk.v1alpha.TriggerSubscription subscriptions = 1; + */ + subscriptions: TriggerSubscription[]; +}; /** * @generated from message sdk.v1alpha.TriggerSubscriptionRequest */ export type TriggerSubscriptionRequestJson = { - /** - * @generated from field: repeated sdk.v1alpha.TriggerSubscription subscriptions = 1; - */ - subscriptions?: TriggerSubscriptionJson[] -} + /** + * @generated from field: repeated sdk.v1alpha.TriggerSubscription subscriptions = 1; + */ + subscriptions?: TriggerSubscriptionJson[]; +}; /** * Describes the message sdk.v1alpha.TriggerSubscriptionRequest. * Use `create(TriggerSubscriptionRequestSchema)` to create a new message. */ -export const TriggerSubscriptionRequestSchema: GenMessage< - TriggerSubscriptionRequest, - { jsonType: TriggerSubscriptionRequestJson } -> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 9) +export const TriggerSubscriptionRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 9); /** * @generated from message sdk.v1alpha.Trigger */ -export type Trigger = Message<'sdk.v1alpha.Trigger'> & { - /** - * @generated from field: uint64 id = 1 [jstype = JS_NORMAL]; - */ - id: bigint +export type Trigger = Message<"sdk.v1alpha.Trigger"> & { + /** + * @generated from field: uint64 id = 1 [jstype = JS_NORMAL]; + */ + id: bigint; - /** - * @generated from field: google.protobuf.Any payload = 2; - */ - payload?: Any -} + /** + * @generated from field: google.protobuf.Any payload = 2; + */ + payload?: Any; +}; /** * @generated from message sdk.v1alpha.Trigger */ export type TriggerJson = { - /** - * @generated from field: uint64 id = 1 [jstype = JS_NORMAL]; - */ - id?: string - - /** - * @generated from field: google.protobuf.Any payload = 2; - */ - payload?: AnyJson -} + /** + * @generated from field: uint64 id = 1 [jstype = JS_NORMAL]; + */ + id?: string; + + /** + * @generated from field: google.protobuf.Any payload = 2; + */ + payload?: AnyJson; +}; /** * Describes the message sdk.v1alpha.Trigger. * Use `create(TriggerSchema)` to create a new message. */ -export const TriggerSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_sdk_v1alpha_sdk, 10) +export const TriggerSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 10); /** * @generated from message sdk.v1alpha.AwaitCapabilitiesRequest */ -export type AwaitCapabilitiesRequest = Message<'sdk.v1alpha.AwaitCapabilitiesRequest'> & { - /** - * @generated from field: repeated int32 ids = 1; - */ - ids: number[] -} +export type AwaitCapabilitiesRequest = Message<"sdk.v1alpha.AwaitCapabilitiesRequest"> & { + /** + * @generated from field: repeated int32 ids = 1; + */ + ids: number[]; +}; /** * @generated from message sdk.v1alpha.AwaitCapabilitiesRequest */ export type AwaitCapabilitiesRequestJson = { - /** - * @generated from field: repeated int32 ids = 1; - */ - ids?: number[] -} + /** + * @generated from field: repeated int32 ids = 1; + */ + ids?: number[]; +}; /** * Describes the message sdk.v1alpha.AwaitCapabilitiesRequest. * Use `create(AwaitCapabilitiesRequestSchema)` to create a new message. */ -export const AwaitCapabilitiesRequestSchema: GenMessage< - AwaitCapabilitiesRequest, - { jsonType: AwaitCapabilitiesRequestJson } -> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 11) +export const AwaitCapabilitiesRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 11); /** * @generated from message sdk.v1alpha.AwaitCapabilitiesResponse */ -export type AwaitCapabilitiesResponse = Message<'sdk.v1alpha.AwaitCapabilitiesResponse'> & { - /** - * @generated from field: map responses = 1; - */ - responses: { [key: number]: CapabilityResponse } -} +export type AwaitCapabilitiesResponse = Message<"sdk.v1alpha.AwaitCapabilitiesResponse"> & { + /** + * @generated from field: map responses = 1; + */ + responses: { [key: number]: CapabilityResponse }; +}; /** * @generated from message sdk.v1alpha.AwaitCapabilitiesResponse */ export type AwaitCapabilitiesResponseJson = { - /** - * @generated from field: map responses = 1; - */ - responses?: { [key: number]: CapabilityResponseJson } -} + /** + * @generated from field: map responses = 1; + */ + responses?: { [key: number]: CapabilityResponseJson }; +}; /** * Describes the message sdk.v1alpha.AwaitCapabilitiesResponse. * Use `create(AwaitCapabilitiesResponseSchema)` to create a new message. */ -export const AwaitCapabilitiesResponseSchema: GenMessage< - AwaitCapabilitiesResponse, - { jsonType: AwaitCapabilitiesResponseJson } -> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 12) +export const AwaitCapabilitiesResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 12); /** * @generated from message sdk.v1alpha.ExecuteRequest */ -export type ExecuteRequest = Message<'sdk.v1alpha.ExecuteRequest'> & { - /** - * @generated from field: bytes config = 1; - */ - config: Uint8Array - - /** - * @generated from oneof sdk.v1alpha.ExecuteRequest.request - */ - request: - | { - /** - * @generated from field: google.protobuf.Empty subscribe = 2; - */ - value: Empty - case: 'subscribe' - } - | { - /** - * @generated from field: sdk.v1alpha.Trigger trigger = 3; - */ - value: Trigger - case: 'trigger' - } - | { case: undefined; value?: undefined } - - /** - * @generated from field: uint64 max_response_size = 4 [jstype = JS_NORMAL]; - */ - maxResponseSize: bigint -} +export type ExecuteRequest = Message<"sdk.v1alpha.ExecuteRequest"> & { + /** + * @generated from field: bytes config = 1; + */ + config: Uint8Array; + + /** + * @generated from oneof sdk.v1alpha.ExecuteRequest.request + */ + request: { + /** + * @generated from field: google.protobuf.Empty subscribe = 2; + */ + value: Empty; + case: "subscribe"; + } | { + /** + * @generated from field: sdk.v1alpha.Trigger trigger = 3; + */ + value: Trigger; + case: "trigger"; + } | { case: undefined; value?: undefined }; + + /** + * @generated from field: uint64 max_response_size = 4 [jstype = JS_NORMAL]; + */ + maxResponseSize: bigint; +}; /** * @generated from message sdk.v1alpha.ExecuteRequest */ export type ExecuteRequestJson = { - /** - * @generated from field: bytes config = 1; - */ - config?: string - - /** - * @generated from field: google.protobuf.Empty subscribe = 2; - */ - subscribe?: EmptyJson - - /** - * @generated from field: sdk.v1alpha.Trigger trigger = 3; - */ - trigger?: TriggerJson - - /** - * @generated from field: uint64 max_response_size = 4 [jstype = JS_NORMAL]; - */ - maxResponseSize?: string -} + /** + * @generated from field: bytes config = 1; + */ + config?: string; + + /** + * @generated from field: google.protobuf.Empty subscribe = 2; + */ + subscribe?: EmptyJson; + + /** + * @generated from field: sdk.v1alpha.Trigger trigger = 3; + */ + trigger?: TriggerJson; + + /** + * @generated from field: uint64 max_response_size = 4 [jstype = JS_NORMAL]; + */ + maxResponseSize?: string; +}; /** * Describes the message sdk.v1alpha.ExecuteRequest. * Use `create(ExecuteRequestSchema)` to create a new message. */ -export const ExecuteRequestSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_sdk_v1alpha_sdk, 13) +export const ExecuteRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 13); /** * @generated from message sdk.v1alpha.ExecutionResult */ -export type ExecutionResult = Message<'sdk.v1alpha.ExecutionResult'> & { - /** - * @generated from oneof sdk.v1alpha.ExecutionResult.result - */ - result: - | { - /** - * @generated from field: values.v1.Value value = 1; - */ - value: Value - case: 'value' - } - | { - /** - * @generated from field: string error = 2; - */ - value: string - case: 'error' - } - | { - /** - * @generated from field: sdk.v1alpha.TriggerSubscriptionRequest trigger_subscriptions = 3; - */ - value: TriggerSubscriptionRequest - case: 'triggerSubscriptions' - } - | { case: undefined; value?: undefined } -} +export type ExecutionResult = Message<"sdk.v1alpha.ExecutionResult"> & { + /** + * @generated from oneof sdk.v1alpha.ExecutionResult.result + */ + result: { + /** + * @generated from field: values.v1.Value value = 1; + */ + value: Value; + case: "value"; + } | { + /** + * @generated from field: string error = 2; + */ + value: string; + case: "error"; + } | { + /** + * @generated from field: sdk.v1alpha.TriggerSubscriptionRequest trigger_subscriptions = 3; + */ + value: TriggerSubscriptionRequest; + case: "triggerSubscriptions"; + } | { case: undefined; value?: undefined }; +}; /** * @generated from message sdk.v1alpha.ExecutionResult */ export type ExecutionResultJson = { - /** - * @generated from field: values.v1.Value value = 1; - */ - value?: ValueJson - - /** - * @generated from field: string error = 2; - */ - error?: string - - /** - * @generated from field: sdk.v1alpha.TriggerSubscriptionRequest trigger_subscriptions = 3; - */ - triggerSubscriptions?: TriggerSubscriptionRequestJson -} + /** + * @generated from field: values.v1.Value value = 1; + */ + value?: ValueJson; + + /** + * @generated from field: string error = 2; + */ + error?: string; + + /** + * @generated from field: sdk.v1alpha.TriggerSubscriptionRequest trigger_subscriptions = 3; + */ + triggerSubscriptions?: TriggerSubscriptionRequestJson; +}; /** * Describes the message sdk.v1alpha.ExecutionResult. * Use `create(ExecutionResultSchema)` to create a new message. */ -export const ExecutionResultSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_sdk_v1alpha_sdk, 14) +export const ExecutionResultSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 14); /** * @generated from message sdk.v1alpha.GetSecretsRequest */ -export type GetSecretsRequest = Message<'sdk.v1alpha.GetSecretsRequest'> & { - /** - * @generated from field: repeated sdk.v1alpha.SecretRequest requests = 1; - */ - requests: SecretRequest[] +export type GetSecretsRequest = Message<"sdk.v1alpha.GetSecretsRequest"> & { + /** + * @generated from field: repeated sdk.v1alpha.SecretRequest requests = 1; + */ + requests: SecretRequest[]; - /** - * @generated from field: int32 callback_id = 2; - */ - callbackId: number -} + /** + * @generated from field: int32 callback_id = 2; + */ + callbackId: number; +}; /** * @generated from message sdk.v1alpha.GetSecretsRequest */ export type GetSecretsRequestJson = { - /** - * @generated from field: repeated sdk.v1alpha.SecretRequest requests = 1; - */ - requests?: SecretRequestJson[] - - /** - * @generated from field: int32 callback_id = 2; - */ - callbackId?: number -} + /** + * @generated from field: repeated sdk.v1alpha.SecretRequest requests = 1; + */ + requests?: SecretRequestJson[]; + + /** + * @generated from field: int32 callback_id = 2; + */ + callbackId?: number; +}; /** * Describes the message sdk.v1alpha.GetSecretsRequest. * Use `create(GetSecretsRequestSchema)` to create a new message. */ -export const GetSecretsRequestSchema: GenMessage< - GetSecretsRequest, - { jsonType: GetSecretsRequestJson } -> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 15) +export const GetSecretsRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 15); /** * @generated from message sdk.v1alpha.AwaitSecretsRequest */ -export type AwaitSecretsRequest = Message<'sdk.v1alpha.AwaitSecretsRequest'> & { - /** - * @generated from field: repeated int32 ids = 1; - */ - ids: number[] -} +export type AwaitSecretsRequest = Message<"sdk.v1alpha.AwaitSecretsRequest"> & { + /** + * @generated from field: repeated int32 ids = 1; + */ + ids: number[]; +}; /** * @generated from message sdk.v1alpha.AwaitSecretsRequest */ export type AwaitSecretsRequestJson = { - /** - * @generated from field: repeated int32 ids = 1; - */ - ids?: number[] -} + /** + * @generated from field: repeated int32 ids = 1; + */ + ids?: number[]; +}; /** * Describes the message sdk.v1alpha.AwaitSecretsRequest. * Use `create(AwaitSecretsRequestSchema)` to create a new message. */ -export const AwaitSecretsRequestSchema: GenMessage< - AwaitSecretsRequest, - { jsonType: AwaitSecretsRequestJson } -> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 16) +export const AwaitSecretsRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 16); /** * @generated from message sdk.v1alpha.AwaitSecretsResponse */ -export type AwaitSecretsResponse = Message<'sdk.v1alpha.AwaitSecretsResponse'> & { - /** - * @generated from field: map responses = 1; - */ - responses: { [key: number]: SecretResponses } -} +export type AwaitSecretsResponse = Message<"sdk.v1alpha.AwaitSecretsResponse"> & { + /** + * @generated from field: map responses = 1; + */ + responses: { [key: number]: SecretResponses }; +}; /** * @generated from message sdk.v1alpha.AwaitSecretsResponse */ export type AwaitSecretsResponseJson = { - /** - * @generated from field: map responses = 1; - */ - responses?: { [key: number]: SecretResponsesJson } -} + /** + * @generated from field: map responses = 1; + */ + responses?: { [key: number]: SecretResponsesJson }; +}; /** * Describes the message sdk.v1alpha.AwaitSecretsResponse. * Use `create(AwaitSecretsResponseSchema)` to create a new message. */ -export const AwaitSecretsResponseSchema: GenMessage< - AwaitSecretsResponse, - { jsonType: AwaitSecretsResponseJson } -> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 17) +export const AwaitSecretsResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 17); /** * @generated from message sdk.v1alpha.SecretRequest */ -export type SecretRequest = Message<'sdk.v1alpha.SecretRequest'> & { - /** - * @generated from field: string id = 1; - */ - id: string +export type SecretRequest = Message<"sdk.v1alpha.SecretRequest"> & { + /** + * @generated from field: string id = 1; + */ + id: string; - /** - * @generated from field: string namespace = 2; - */ - namespace: string -} + /** + * @generated from field: string namespace = 2; + */ + namespace: string; +}; /** * @generated from message sdk.v1alpha.SecretRequest */ export type SecretRequestJson = { - /** - * @generated from field: string id = 1; - */ - id?: string - - /** - * @generated from field: string namespace = 2; - */ - namespace?: string -} + /** + * @generated from field: string id = 1; + */ + id?: string; + + /** + * @generated from field: string namespace = 2; + */ + namespace?: string; +}; /** * Describes the message sdk.v1alpha.SecretRequest. * Use `create(SecretRequestSchema)` to create a new message. */ -export const SecretRequestSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_sdk_v1alpha_sdk, 18) +export const SecretRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 18); /** * @generated from message sdk.v1alpha.Secret */ -export type Secret = Message<'sdk.v1alpha.Secret'> & { - /** - * @generated from field: string id = 1; - */ - id: string - - /** - * @generated from field: string namespace = 2; - */ - namespace: string - - /** - * @generated from field: string owner = 3; - */ - owner: string - - /** - * @generated from field: string value = 4; - */ - value: string -} +export type Secret = Message<"sdk.v1alpha.Secret"> & { + /** + * @generated from field: string id = 1; + */ + id: string; + + /** + * @generated from field: string namespace = 2; + */ + namespace: string; + + /** + * @generated from field: string owner = 3; + */ + owner: string; + + /** + * @generated from field: string value = 4; + */ + value: string; +}; /** * @generated from message sdk.v1alpha.Secret */ export type SecretJson = { - /** - * @generated from field: string id = 1; - */ - id?: string - - /** - * @generated from field: string namespace = 2; - */ - namespace?: string - - /** - * @generated from field: string owner = 3; - */ - owner?: string - - /** - * @generated from field: string value = 4; - */ - value?: string -} + /** + * @generated from field: string id = 1; + */ + id?: string; + + /** + * @generated from field: string namespace = 2; + */ + namespace?: string; + + /** + * @generated from field: string owner = 3; + */ + owner?: string; + + /** + * @generated from field: string value = 4; + */ + value?: string; +}; /** * Describes the message sdk.v1alpha.Secret. * Use `create(SecretSchema)` to create a new message. */ -export const SecretSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_sdk_v1alpha_sdk, 19) +export const SecretSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 19); /** * @generated from message sdk.v1alpha.SecretError */ -export type SecretError = Message<'sdk.v1alpha.SecretError'> & { - /** - * @generated from field: string id = 1; - */ - id: string - - /** - * @generated from field: string namespace = 2; - */ - namespace: string - - /** - * @generated from field: string owner = 3; - */ - owner: string - - /** - * @generated from field: string error = 4; - */ - error: string -} +export type SecretError = Message<"sdk.v1alpha.SecretError"> & { + /** + * @generated from field: string id = 1; + */ + id: string; + + /** + * @generated from field: string namespace = 2; + */ + namespace: string; + + /** + * @generated from field: string owner = 3; + */ + owner: string; + + /** + * @generated from field: string error = 4; + */ + error: string; +}; /** * @generated from message sdk.v1alpha.SecretError */ export type SecretErrorJson = { - /** - * @generated from field: string id = 1; - */ - id?: string - - /** - * @generated from field: string namespace = 2; - */ - namespace?: string - - /** - * @generated from field: string owner = 3; - */ - owner?: string - - /** - * @generated from field: string error = 4; - */ - error?: string -} + /** + * @generated from field: string id = 1; + */ + id?: string; + + /** + * @generated from field: string namespace = 2; + */ + namespace?: string; + + /** + * @generated from field: string owner = 3; + */ + owner?: string; + + /** + * @generated from field: string error = 4; + */ + error?: string; +}; /** * Describes the message sdk.v1alpha.SecretError. * Use `create(SecretErrorSchema)` to create a new message. */ -export const SecretErrorSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_sdk_v1alpha_sdk, 20) +export const SecretErrorSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 20); /** * @generated from message sdk.v1alpha.SecretResponse */ -export type SecretResponse = Message<'sdk.v1alpha.SecretResponse'> & { - /** - * @generated from oneof sdk.v1alpha.SecretResponse.response - */ - response: - | { - /** - * @generated from field: sdk.v1alpha.Secret secret = 1; - */ - value: Secret - case: 'secret' - } - | { - /** - * @generated from field: sdk.v1alpha.SecretError error = 2; - */ - value: SecretError - case: 'error' - } - | { case: undefined; value?: undefined } -} +export type SecretResponse = Message<"sdk.v1alpha.SecretResponse"> & { + /** + * @generated from oneof sdk.v1alpha.SecretResponse.response + */ + response: { + /** + * @generated from field: sdk.v1alpha.Secret secret = 1; + */ + value: Secret; + case: "secret"; + } | { + /** + * @generated from field: sdk.v1alpha.SecretError error = 2; + */ + value: SecretError; + case: "error"; + } | { case: undefined; value?: undefined }; +}; /** * @generated from message sdk.v1alpha.SecretResponse */ export type SecretResponseJson = { - /** - * @generated from field: sdk.v1alpha.Secret secret = 1; - */ - secret?: SecretJson - - /** - * @generated from field: sdk.v1alpha.SecretError error = 2; - */ - error?: SecretErrorJson -} + /** + * @generated from field: sdk.v1alpha.Secret secret = 1; + */ + secret?: SecretJson; + + /** + * @generated from field: sdk.v1alpha.SecretError error = 2; + */ + error?: SecretErrorJson; +}; /** * Describes the message sdk.v1alpha.SecretResponse. * Use `create(SecretResponseSchema)` to create a new message. */ -export const SecretResponseSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_sdk_v1alpha_sdk, 21) +export const SecretResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 21); /** * @generated from message sdk.v1alpha.SecretResponses */ -export type SecretResponses = Message<'sdk.v1alpha.SecretResponses'> & { - /** - * @generated from field: repeated sdk.v1alpha.SecretResponse responses = 1; - */ - responses: SecretResponse[] -} +export type SecretResponses = Message<"sdk.v1alpha.SecretResponses"> & { + /** + * @generated from field: repeated sdk.v1alpha.SecretResponse responses = 1; + */ + responses: SecretResponse[]; +}; /** * @generated from message sdk.v1alpha.SecretResponses */ export type SecretResponsesJson = { - /** - * @generated from field: repeated sdk.v1alpha.SecretResponse responses = 1; - */ - responses?: SecretResponseJson[] -} + /** + * @generated from field: repeated sdk.v1alpha.SecretResponse responses = 1; + */ + responses?: SecretResponseJson[]; +}; /** * Describes the message sdk.v1alpha.SecretResponses. * Use `create(SecretResponsesSchema)` to create a new message. */ -export const SecretResponsesSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_sdk_v1alpha_sdk, 22) +export const SecretResponsesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 22); /** * @generated from enum sdk.v1alpha.AggregationType */ export enum AggregationType { - /** - * @generated from enum value: AGGREGATION_TYPE_UNSPECIFIED = 0; - */ - UNSPECIFIED = 0, - - /** - * @generated from enum value: AGGREGATION_TYPE_MEDIAN = 1; - */ - MEDIAN = 1, - - /** - * @generated from enum value: AGGREGATION_TYPE_IDENTICAL = 2; - */ - IDENTICAL = 2, - - /** - * @generated from enum value: AGGREGATION_TYPE_COMMON_PREFIX = 3; - */ - COMMON_PREFIX = 3, - - /** - * @generated from enum value: AGGREGATION_TYPE_COMMON_SUFFIX = 4; - */ - COMMON_SUFFIX = 4, + /** + * @generated from enum value: AGGREGATION_TYPE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: AGGREGATION_TYPE_MEDIAN = 1; + */ + MEDIAN = 1, + + /** + * @generated from enum value: AGGREGATION_TYPE_IDENTICAL = 2; + */ + IDENTICAL = 2, + + /** + * @generated from enum value: AGGREGATION_TYPE_COMMON_PREFIX = 3; + */ + COMMON_PREFIX = 3, + + /** + * @generated from enum value: AGGREGATION_TYPE_COMMON_SUFFIX = 4; + */ + COMMON_SUFFIX = 4, } /** * @generated from enum sdk.v1alpha.AggregationType */ -export type AggregationTypeJson = - | 'AGGREGATION_TYPE_UNSPECIFIED' - | 'AGGREGATION_TYPE_MEDIAN' - | 'AGGREGATION_TYPE_IDENTICAL' - | 'AGGREGATION_TYPE_COMMON_PREFIX' - | 'AGGREGATION_TYPE_COMMON_SUFFIX' +export type AggregationTypeJson = "AGGREGATION_TYPE_UNSPECIFIED" | "AGGREGATION_TYPE_MEDIAN" | "AGGREGATION_TYPE_IDENTICAL" | "AGGREGATION_TYPE_COMMON_PREFIX" | "AGGREGATION_TYPE_COMMON_SUFFIX"; /** * Describes the enum sdk.v1alpha.AggregationType. */ -export const AggregationTypeSchema: GenEnum = - /*@__PURE__*/ - enumDesc(file_sdk_v1alpha_sdk, 0) +export const AggregationTypeSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_sdk_v1alpha_sdk, 0); /** * @generated from enum sdk.v1alpha.Mode */ export enum Mode { - /** - * @generated from enum value: MODE_UNSPECIFIED = 0; - */ - UNSPECIFIED = 0, - - /** - * @generated from enum value: MODE_DON = 1; - */ - DON = 1, - - /** - * @generated from enum value: MODE_NODE = 2; - */ - NODE = 2, + /** + * @generated from enum value: MODE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: MODE_DON = 1; + */ + DON = 1, + + /** + * @generated from enum value: MODE_NODE = 2; + */ + NODE = 2, } /** * @generated from enum sdk.v1alpha.Mode */ -export type ModeJson = 'MODE_UNSPECIFIED' | 'MODE_DON' | 'MODE_NODE' +export type ModeJson = "MODE_UNSPECIFIED" | "MODE_DON" | "MODE_NODE"; /** * Describes the enum sdk.v1alpha.Mode. */ -export const ModeSchema: GenEnum = /*@__PURE__*/ enumDesc(file_sdk_v1alpha_sdk, 1) +export const ModeSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_sdk_v1alpha_sdk, 1); + diff --git a/src/generated/tools/generator/v1alpha/cre_metadata_pb.ts b/src/generated/tools/generator/v1alpha/cre_metadata_pb.ts index f317d6ad..957437ce 100644 --- a/src/generated/tools/generator/v1alpha/cre_metadata_pb.ts +++ b/src/generated/tools/generator/v1alpha/cre_metadata_pb.ts @@ -2,341 +2,319 @@ // @generated from file tools/generator/v1alpha/cre_metadata.proto (package tools.generator.v1alpha, syntax proto3) /* eslint-disable */ -import type { GenExtension, GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2' -import { extDesc, fileDesc, messageDesc } from '@bufbuild/protobuf/codegenv2' -import type { MethodOptions, ServiceOptions } from '@bufbuild/protobuf/wkt' -import { file_google_protobuf_descriptor } from '@bufbuild/protobuf/wkt' -import type { Mode, ModeJson } from '../../../sdk/v1alpha/sdk_pb' -import { file_sdk_v1alpha_sdk } from '../../../sdk/v1alpha/sdk_pb' -import type { Message } from '@bufbuild/protobuf' +import type { GenExtension, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; +import { extDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; +import type { MethodOptions, ServiceOptions } from "@bufbuild/protobuf/wkt"; +import { file_google_protobuf_descriptor } from "@bufbuild/protobuf/wkt"; +import type { Mode, ModeJson } from "../../../sdk/v1alpha/sdk_pb"; +import { file_sdk_v1alpha_sdk } from "../../../sdk/v1alpha/sdk_pb"; +import type { Message } from "@bufbuild/protobuf"; /** * Describes the file tools/generator/v1alpha/cre_metadata.proto. */ -export const file_tools_generator_v1alpha_cre_metadata: GenFile = - /*@__PURE__*/ - fileDesc( - 'Cip0b29scy9nZW5lcmF0b3IvdjFhbHBoYS9jcmVfbWV0YWRhdGEucHJvdG8SF3Rvb2xzLmdlbmVyYXRvci52MWFscGhhIoQBCgtTdHJpbmdMYWJlbBJECghkZWZhdWx0cxgBIAMoCzIyLnRvb2xzLmdlbmVyYXRvci52MWFscGhhLlN0cmluZ0xhYmVsLkRlZmF1bHRzRW50cnkaLwoNRGVmYXVsdHNFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWU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G2NvbS50b29scy5nZW5lcmF0b3IudjFhbHBoYUIQQ3JlTWV0YWRhdGFQcm90b1ABogIDVEdYqgIXVG9vbHMuR2VuZXJhdG9yLlYxYWxwaGHKAhhUb29sc1xHZW5lcmF0b3JfXFYxYWxwaGHiAiRUb29sc1xHZW5lcmF0b3JfXFYxYWxwaGFcR1BCTWV0YWRhdGHqAhlUb29sczo6R2VuZXJhdG9yOjpWMWFscGhhYgZwcm90bzM", [file_google_protobuf_descriptor, file_sdk_v1alpha_sdk]); /** * @generated from message tools.generator.v1alpha.StringLabel */ -export type StringLabel = Message<'tools.generator.v1alpha.StringLabel'> & { - /** - * @generated from field: map defaults = 1; - */ - defaults: { [key: string]: string } -} +export type StringLabel = Message<"tools.generator.v1alpha.StringLabel"> & { + /** + * @generated from field: map defaults = 1; + */ + defaults: { [key: string]: string }; +}; /** * @generated from message tools.generator.v1alpha.StringLabel */ export type StringLabelJson = { - /** - * @generated from field: map defaults = 1; - */ - defaults?: { [key: string]: string } -} + /** + * @generated from field: map defaults = 1; + */ + defaults?: { [key: string]: string }; +}; /** * Describes the message tools.generator.v1alpha.StringLabel. * Use `create(StringLabelSchema)` to create a new message. */ -export const StringLabelSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_tools_generator_v1alpha_cre_metadata, 0) +export const StringLabelSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_tools_generator_v1alpha_cre_metadata, 0); /** * @generated from message tools.generator.v1alpha.Uint64Label */ -export type Uint64Label = Message<'tools.generator.v1alpha.Uint64Label'> & { - /** - * @generated from field: map defaults = 1; - */ - defaults: { [key: string]: bigint } -} +export type Uint64Label = Message<"tools.generator.v1alpha.Uint64Label"> & { + /** + * @generated from field: map defaults = 1; + */ + defaults: { [key: string]: bigint }; +}; /** * @generated from message tools.generator.v1alpha.Uint64Label */ export type Uint64LabelJson = { - /** - * @generated from field: map defaults = 1; - */ - defaults?: { [key: string]: string } -} + /** + * @generated from field: map defaults = 1; + */ + defaults?: { [key: string]: string }; +}; /** * Describes the message tools.generator.v1alpha.Uint64Label. * Use `create(Uint64LabelSchema)` to create a new message. */ -export const Uint64LabelSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_tools_generator_v1alpha_cre_metadata, 1) +export const Uint64LabelSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_tools_generator_v1alpha_cre_metadata, 1); /** * @generated from message tools.generator.v1alpha.Uint32Label */ -export type Uint32Label = Message<'tools.generator.v1alpha.Uint32Label'> & { - /** - * @generated from field: map defaults = 1; - */ - defaults: { [key: string]: number } -} +export type Uint32Label = Message<"tools.generator.v1alpha.Uint32Label"> & { + /** + * @generated from field: map defaults = 1; + */ + defaults: { [key: string]: number }; +}; /** * @generated from message tools.generator.v1alpha.Uint32Label */ export type Uint32LabelJson = { - /** - * @generated from field: map defaults = 1; - */ - defaults?: { [key: string]: number } -} + /** + * @generated from field: map defaults = 1; + */ + defaults?: { [key: string]: number }; +}; /** * Describes the message tools.generator.v1alpha.Uint32Label. * Use `create(Uint32LabelSchema)` to create a new message. */ -export const Uint32LabelSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_tools_generator_v1alpha_cre_metadata, 2) +export const Uint32LabelSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_tools_generator_v1alpha_cre_metadata, 2); /** * @generated from message tools.generator.v1alpha.Int64Label */ -export type Int64Label = Message<'tools.generator.v1alpha.Int64Label'> & { - /** - * @generated from field: map defaults = 1; - */ - defaults: { [key: string]: bigint } -} +export type Int64Label = Message<"tools.generator.v1alpha.Int64Label"> & { + /** + * @generated from field: map defaults = 1; + */ + defaults: { [key: string]: bigint }; +}; /** * @generated from message tools.generator.v1alpha.Int64Label */ export type Int64LabelJson = { - /** - * @generated from field: map defaults = 1; - */ - defaults?: { [key: string]: string } -} + /** + * @generated from field: map defaults = 1; + */ + defaults?: { [key: string]: string }; +}; /** * Describes the message tools.generator.v1alpha.Int64Label. * Use `create(Int64LabelSchema)` to create a new message. */ -export const Int64LabelSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_tools_generator_v1alpha_cre_metadata, 3) +export const Int64LabelSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_tools_generator_v1alpha_cre_metadata, 3); /** * @generated from message tools.generator.v1alpha.Int32Label */ -export type Int32Label = Message<'tools.generator.v1alpha.Int32Label'> & { - /** - * @generated from field: map defaults = 1; - */ - defaults: { [key: string]: number } -} +export type Int32Label = Message<"tools.generator.v1alpha.Int32Label"> & { + /** + * @generated from field: map defaults = 1; + */ + defaults: { [key: string]: number }; +}; /** * @generated from message tools.generator.v1alpha.Int32Label */ export type Int32LabelJson = { - /** - * @generated from field: map defaults = 1; - */ - defaults?: { [key: string]: number } -} + /** + * @generated from field: map defaults = 1; + */ + defaults?: { [key: string]: number }; +}; /** * Describes the message tools.generator.v1alpha.Int32Label. * Use `create(Int32LabelSchema)` to create a new message. */ -export const Int32LabelSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_tools_generator_v1alpha_cre_metadata, 4) +export const Int32LabelSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_tools_generator_v1alpha_cre_metadata, 4); /** * @generated from message tools.generator.v1alpha.Label */ -export type Label = Message<'tools.generator.v1alpha.Label'> & { - /** - * @generated from oneof tools.generator.v1alpha.Label.kind - */ - kind: - | { - /** - * @generated from field: tools.generator.v1alpha.StringLabel string_label = 1; - */ - value: StringLabel - case: 'stringLabel' - } - | { - /** - * @generated from field: tools.generator.v1alpha.Uint64Label uint64_label = 2; - */ - value: Uint64Label - case: 'uint64Label' - } - | { - /** - * @generated from field: tools.generator.v1alpha.Int64Label int64_label = 3; - */ - value: Int64Label - case: 'int64Label' - } - | { - /** - * @generated from field: tools.generator.v1alpha.Uint32Label uint32_label = 4; - */ - value: Uint32Label - case: 'uint32Label' - } - | { - /** - * @generated from field: tools.generator.v1alpha.Int32Label int32_label = 5; - */ - value: Int32Label - case: 'int32Label' - } - | { case: undefined; value?: undefined } -} +export type Label = Message<"tools.generator.v1alpha.Label"> & { + /** + * @generated from oneof tools.generator.v1alpha.Label.kind + */ + kind: { + /** + * @generated from field: tools.generator.v1alpha.StringLabel string_label = 1; + */ + value: StringLabel; + case: "stringLabel"; + } | { + /** + * @generated from field: tools.generator.v1alpha.Uint64Label uint64_label = 2; + */ + value: Uint64Label; + case: "uint64Label"; + } | { + /** + * @generated from field: tools.generator.v1alpha.Int64Label int64_label = 3; + */ + value: Int64Label; + case: "int64Label"; + } | { + /** + * @generated from field: tools.generator.v1alpha.Uint32Label uint32_label = 4; + */ + value: Uint32Label; + case: "uint32Label"; + } | { + /** + * @generated from field: tools.generator.v1alpha.Int32Label int32_label = 5; + */ + value: Int32Label; + case: "int32Label"; + } | { case: undefined; value?: undefined }; +}; /** * @generated from message tools.generator.v1alpha.Label */ export type LabelJson = { - /** - * @generated from field: tools.generator.v1alpha.StringLabel string_label = 1; - */ - stringLabel?: StringLabelJson - - /** - * @generated from field: tools.generator.v1alpha.Uint64Label uint64_label = 2; - */ - uint64Label?: Uint64LabelJson - - /** - * @generated from field: tools.generator.v1alpha.Int64Label int64_label = 3; - */ - int64Label?: Int64LabelJson - - /** - * @generated from field: tools.generator.v1alpha.Uint32Label uint32_label = 4; - */ - uint32Label?: Uint32LabelJson - - /** - * @generated from field: tools.generator.v1alpha.Int32Label int32_label = 5; - */ - int32Label?: Int32LabelJson -} + /** + * @generated from field: tools.generator.v1alpha.StringLabel string_label = 1; + */ + stringLabel?: StringLabelJson; + + /** + * @generated from field: tools.generator.v1alpha.Uint64Label uint64_label = 2; + */ + uint64Label?: Uint64LabelJson; + + /** + * @generated from field: tools.generator.v1alpha.Int64Label int64_label = 3; + */ + int64Label?: Int64LabelJson; + + /** + * @generated from field: tools.generator.v1alpha.Uint32Label uint32_label = 4; + */ + uint32Label?: Uint32LabelJson; + + /** + * @generated from field: tools.generator.v1alpha.Int32Label int32_label = 5; + */ + int32Label?: Int32LabelJson; +}; /** * Describes the message tools.generator.v1alpha.Label. * Use `create(LabelSchema)` to create a new message. */ -export const LabelSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_tools_generator_v1alpha_cre_metadata, 5) +export const LabelSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_tools_generator_v1alpha_cre_metadata, 5); /** * @generated from message tools.generator.v1alpha.CapabilityMetadata */ -export type CapabilityMetadata = Message<'tools.generator.v1alpha.CapabilityMetadata'> & { - /** - * @generated from field: sdk.v1alpha.Mode mode = 1; - */ - mode: Mode - - /** - * @generated from field: string capability_id = 2; - */ - capabilityId: string - - /** - * @generated from field: map labels = 3; - */ - labels: { [key: string]: Label } -} +export type CapabilityMetadata = Message<"tools.generator.v1alpha.CapabilityMetadata"> & { + /** + * @generated from field: sdk.v1alpha.Mode mode = 1; + */ + mode: Mode; + + /** + * @generated from field: string capability_id = 2; + */ + capabilityId: string; + + /** + * @generated from field: map labels = 3; + */ + labels: { [key: string]: Label }; +}; /** * @generated from message tools.generator.v1alpha.CapabilityMetadata */ export type CapabilityMetadataJson = { - /** - * @generated from field: sdk.v1alpha.Mode mode = 1; - */ - mode?: ModeJson - - /** - * @generated from field: string capability_id = 2; - */ - capabilityId?: string - - /** - * @generated from field: map labels = 3; - */ - labels?: { [key: string]: LabelJson } -} + /** + * @generated from field: sdk.v1alpha.Mode mode = 1; + */ + mode?: ModeJson; + + /** + * @generated from field: string capability_id = 2; + */ + capabilityId?: string; + + /** + * @generated from field: map labels = 3; + */ + labels?: { [key: string]: LabelJson }; +}; /** * Describes the message tools.generator.v1alpha.CapabilityMetadata. * Use `create(CapabilityMetadataSchema)` to create a new message. */ -export const CapabilityMetadataSchema: GenMessage< - CapabilityMetadata, - { jsonType: CapabilityMetadataJson } -> = /*@__PURE__*/ messageDesc(file_tools_generator_v1alpha_cre_metadata, 6) +export const CapabilityMetadataSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_tools_generator_v1alpha_cre_metadata, 6); /** * @generated from message tools.generator.v1alpha.CapabilityMethodMetadata */ -export type CapabilityMethodMetadata = - Message<'tools.generator.v1alpha.CapabilityMethodMetadata'> & { - /** - * @generated from field: bool map_to_untyped_api = 1; - */ - mapToUntypedApi: boolean - } +export type CapabilityMethodMetadata = Message<"tools.generator.v1alpha.CapabilityMethodMetadata"> & { + /** + * @generated from field: bool map_to_untyped_api = 1; + */ + mapToUntypedApi: boolean; +}; /** * @generated from message tools.generator.v1alpha.CapabilityMethodMetadata */ export type CapabilityMethodMetadataJson = { - /** - * @generated from field: bool map_to_untyped_api = 1; - */ - mapToUntypedApi?: boolean -} + /** + * @generated from field: bool map_to_untyped_api = 1; + */ + mapToUntypedApi?: boolean; +}; /** * Describes the message tools.generator.v1alpha.CapabilityMethodMetadata. * Use `create(CapabilityMethodMetadataSchema)` to create a new message. */ -export const CapabilityMethodMetadataSchema: GenMessage< - CapabilityMethodMetadata, - { jsonType: CapabilityMethodMetadataJson } -> = /*@__PURE__*/ messageDesc(file_tools_generator_v1alpha_cre_metadata, 7) +export const CapabilityMethodMetadataSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_tools_generator_v1alpha_cre_metadata, 7); /** * 50000-99999 is the range for custom options. * * @generated from extension: tools.generator.v1alpha.CapabilityMetadata capability = 50000; */ -export const capability: GenExtension = - /*@__PURE__*/ - extDesc(file_tools_generator_v1alpha_cre_metadata, 0) +export const capability: GenExtension = /*@__PURE__*/ + extDesc(file_tools_generator_v1alpha_cre_metadata, 0); /** * 50000-99999 is the range for custom options. * * @generated from extension: tools.generator.v1alpha.CapabilityMethodMetadata method = 50001; */ -export const method: GenExtension = - /*@__PURE__*/ - extDesc(file_tools_generator_v1alpha_cre_metadata, 1) +export const method: GenExtension = /*@__PURE__*/ + extDesc(file_tools_generator_v1alpha_cre_metadata, 1); + diff --git a/src/generated/values/v1/values_pb.ts b/src/generated/values/v1/values_pb.ts index f72a0559..929239c0 100644 --- a/src/generated/values/v1/values_pb.ts +++ b/src/generated/values/v1/values_pb.ts @@ -2,306 +2,286 @@ // @generated from file values/v1/values.proto (package values.v1, syntax proto3) /* eslint-disable */ -import type { GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2' -import { fileDesc, messageDesc } from '@bufbuild/protobuf/codegenv2' -import type { Timestamp, TimestampJson } from '@bufbuild/protobuf/wkt' -import { file_google_protobuf_timestamp } from '@bufbuild/protobuf/wkt' -import type { Message } from '@bufbuild/protobuf' +import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; +import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; +import type { Timestamp, TimestampJson } from "@bufbuild/protobuf/wkt"; +import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; +import type { Message } from "@bufbuild/protobuf"; /** * Describes the file values/v1/values.proto. */ -export const file_values_v1_values: GenFile = - /*@__PURE__*/ - fileDesc( - 'ChZ2YWx1ZXMvdjEvdmFsdWVzLnByb3RvEgl2YWx1ZXMudjEigQMKBVZhbHVlEhYKDHN0cmluZ192YWx1ZRgBIAEoCUgAEhQKCmJvb2xfdmFsdWUYAiABKAhIABIVCgtieXRlc192YWx1ZRgDIAEoDEgAEiMKCW1hcF92YWx1ZRgEIAEoCzIOLnZhbHVlcy52MS5NYXBIABIlCgpsaXN0X3ZhbHVlGAUgASgLMg8udmFsdWVzLnYxLkxpc3RIABIrCg1kZWNpbWFsX3ZhbHVlGAYgASgLMhIudmFsdWVzLnYxLkRlY2ltYWxIABIZCgtpbnQ2NF92YWx1ZRgHIAEoA0ICMABIABIpCgxiaWdpbnRfdmFsdWUYCSABKAsyES52YWx1ZXMudjEuQmlnSW50SAASMAoKdGltZV92YWx1ZRgKIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXBIABIXCg1mbG9hdDY0X3ZhbHVlGAsgASgBSAASGgoMdWludDY0X3ZhbHVlGAwgASgEQgIwAEgAQgcKBXZhbHVlSgQICBAJIisKBkJpZ0ludBIPCgdhYnNfdmFsGAEgASgMEhAKBHNpZ24YAiABKANCAjAAInIKA01hcBIqCgZmaWVsZHMYASADKAsyGi52YWx1ZXMudj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24YAiABKANCAjAAInIKA01hcBIqCgZmaWVsZHMYASADKAsyGi52YWx1ZXMudjEuTWFwLkZpZWxkc0VudHJ5Gj8KC0ZpZWxkc0VudHJ5EgsKA2tleRgBIAEoCRIfCgV2YWx1ZRgCIAEoCzIQLnZhbHVlcy52MS5WYWx1ZToCOAEiKAoETGlzdBIgCgZmaWVsZHMYAiADKAsyEC52YWx1ZXMudjEuVmFsdWUiQwoHRGVjaW1hbBImCgtjb2VmZmljaWVudBgBIAEoCzIRLnZhbHVlcy52MS5CaWdJbnQSEAoIZXhwb25lbnQYAiABKAVCYQoNY29tLnZhbHVlcy52MUILVmFsdWVzUHJvdG9QAaICA1ZYWKoCCVZhbHVlcy5WMcoCCVZhbHVlc1xWMeICFVZhbHVlc1xWMVxHUEJNZXRhZGF0YeoCClZhbHVlczo6VjFiBnByb3RvMw", [file_google_protobuf_timestamp]); /** * @generated from message values.v1.Value */ -export type Value = Message<'values.v1.Value'> & { - /** - * @generated from oneof values.v1.Value.value - */ - value: - | { - /** - * @generated from field: string string_value = 1; - */ - value: string - case: 'stringValue' - } - | { - /** - * @generated from field: bool bool_value = 2; - */ - value: boolean - case: 'boolValue' - } - | { - /** - * @generated from field: bytes bytes_value = 3; - */ - value: Uint8Array - case: 'bytesValue' - } - | { - /** - * @generated from field: values.v1.Map map_value = 4; - */ - value: Map - case: 'mapValue' - } - | { - /** - * @generated from field: values.v1.List list_value = 5; - */ - value: List - case: 'listValue' - } - | { - /** - * @generated from field: values.v1.Decimal decimal_value = 6; - */ - value: Decimal - case: 'decimalValue' - } - | { - /** - * @generated from field: int64 int64_value = 7 [jstype = JS_NORMAL]; - */ - value: bigint - case: 'int64Value' - } - | { - /** - * @generated from field: values.v1.BigInt bigint_value = 9; - */ - value: BigInt - case: 'bigintValue' - } - | { - /** - * @generated from field: google.protobuf.Timestamp time_value = 10; - */ - value: Timestamp - case: 'timeValue' - } - | { - /** - * @generated from field: double float64_value = 11; - */ - value: number - case: 'float64Value' - } - | { - /** - * @generated from field: uint64 uint64_value = 12 [jstype = JS_NORMAL]; - */ - value: bigint - case: 'uint64Value' - } - | { case: undefined; value?: undefined } -} +export type Value = Message<"values.v1.Value"> & { + /** + * @generated from oneof values.v1.Value.value + */ + value: { + /** + * @generated from field: string string_value = 1; + */ + value: string; + case: "stringValue"; + } | { + /** + * @generated from field: bool bool_value = 2; + */ + value: boolean; + case: "boolValue"; + } | { + /** + * @generated from field: bytes bytes_value = 3; + */ + value: Uint8Array; + case: "bytesValue"; + } | { + /** + * @generated from field: values.v1.Map map_value = 4; + */ + value: Map; + case: "mapValue"; + } | { + /** + * @generated from field: values.v1.List list_value = 5; + */ + value: List; + case: "listValue"; + } | { + /** + * @generated from field: values.v1.Decimal decimal_value = 6; + */ + value: Decimal; + case: "decimalValue"; + } | { + /** + * @generated from field: int64 int64_value = 7 [jstype = JS_NORMAL]; + */ + value: bigint; + case: "int64Value"; + } | { + /** + * @generated from field: values.v1.BigInt bigint_value = 9; + */ + value: BigInt; + case: "bigintValue"; + } | { + /** + * @generated from field: google.protobuf.Timestamp time_value = 10; + */ + value: Timestamp; + case: "timeValue"; + } | { + /** + * @generated from field: double float64_value = 11; + */ + value: number; + case: "float64Value"; + } | { + /** + * @generated from field: uint64 uint64_value = 12 [jstype = JS_NORMAL]; + */ + value: bigint; + case: "uint64Value"; + } | { case: undefined; value?: undefined }; +}; /** * @generated from message values.v1.Value */ export type ValueJson = { - /** - * @generated from field: string string_value = 1; - */ - stringValue?: string - - /** - * @generated from field: bool bool_value = 2; - */ - boolValue?: boolean - - /** - * @generated from field: bytes bytes_value = 3; - */ - bytesValue?: string - - /** - * @generated from field: values.v1.Map map_value = 4; - */ - mapValue?: MapJson - - /** - * @generated from field: values.v1.List list_value = 5; - */ - listValue?: ListJson - - /** - * @generated from field: values.v1.Decimal decimal_value = 6; - */ - decimalValue?: DecimalJson - - /** - * @generated from field: int64 int64_value = 7 [jstype = JS_NORMAL]; - */ - int64Value?: string - - /** - * @generated from field: values.v1.BigInt bigint_value = 9; - */ - bigintValue?: BigIntJson - - /** - * @generated from field: google.protobuf.Timestamp time_value = 10; - */ - timeValue?: TimestampJson - - /** - * @generated from field: double float64_value = 11; - */ - float64Value?: number | 'NaN' | 'Infinity' | '-Infinity' - - /** - * @generated from field: uint64 uint64_value = 12 [jstype = JS_NORMAL]; - */ - uint64Value?: string -} + /** + * @generated from field: string string_value = 1; + */ + stringValue?: string; + + /** + * @generated from field: bool bool_value = 2; + */ + boolValue?: boolean; + + /** + * @generated from field: bytes bytes_value = 3; + */ + bytesValue?: string; + + /** + * @generated from field: values.v1.Map map_value = 4; + */ + mapValue?: MapJson; + + /** + * @generated from field: values.v1.List list_value = 5; + */ + listValue?: ListJson; + + /** + * @generated from field: values.v1.Decimal decimal_value = 6; + */ + decimalValue?: DecimalJson; + + /** + * @generated from field: int64 int64_value = 7 [jstype = JS_NORMAL]; + */ + int64Value?: string; + + /** + * @generated from field: values.v1.BigInt bigint_value = 9; + */ + bigintValue?: BigIntJson; + + /** + * @generated from field: google.protobuf.Timestamp time_value = 10; + */ + timeValue?: TimestampJson; + + /** + * @generated from field: double float64_value = 11; + */ + float64Value?: number | "NaN" | "Infinity" | "-Infinity"; + + /** + * @generated from field: uint64 uint64_value = 12 [jstype = JS_NORMAL]; + */ + uint64Value?: string; +}; /** * Describes the message values.v1.Value. * Use `create(ValueSchema)` to create a new message. */ -export const ValueSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_values_v1_values, 0) +export const ValueSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_values_v1_values, 0); /** * @generated from message values.v1.BigInt */ -export type BigInt = Message<'values.v1.BigInt'> & { - /** - * @generated from field: bytes abs_val = 1; - */ - absVal: Uint8Array - - /** - * @generated from field: int64 sign = 2 [jstype = JS_NORMAL]; - */ - sign: bigint -} +export type BigInt = Message<"values.v1.BigInt"> & { + /** + * @generated from field: bytes abs_val = 1; + */ + absVal: Uint8Array; + + /** + * @generated from field: int64 sign = 2 [jstype = JS_NORMAL]; + */ + sign: bigint; +}; /** * @generated from message values.v1.BigInt */ export type BigIntJson = { - /** - * @generated from field: bytes abs_val = 1; - */ - absVal?: string + /** + * @generated from field: bytes abs_val = 1; + */ + absVal?: string; - /** - * @generated from field: int64 sign = 2 [jstype = JS_NORMAL]; - */ - sign?: string -} + /** + * @generated from field: int64 sign = 2 [jstype = JS_NORMAL]; + */ + sign?: string; +}; /** * Describes the message values.v1.BigInt. * Use `create(BigIntSchema)` to create a new message. */ -export const BigIntSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_values_v1_values, 1) +export const BigIntSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_values_v1_values, 1); /** * @generated from message values.v1.Map */ -export type Map = Message<'values.v1.Map'> & { - /** - * @generated from field: map fields = 1; - */ - fields: { [key: string]: Value } -} +export type Map = Message<"values.v1.Map"> & { + /** + * @generated from field: map fields = 1; + */ + fields: { [key: string]: Value }; +}; /** * @generated from message values.v1.Map */ export type MapJson = { - /** - * @generated from field: map fields = 1; - */ - fields?: { [key: string]: ValueJson } -} + /** + * @generated from field: map fields = 1; + */ + fields?: { [key: string]: ValueJson }; +}; /** * Describes the message values.v1.Map. * Use `create(MapSchema)` to create a new message. */ -export const MapSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_values_v1_values, 2) +export const MapSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_values_v1_values, 2); /** * @generated from message values.v1.List */ -export type List = Message<'values.v1.List'> & { - /** - * @generated from field: repeated values.v1.Value fields = 2; - */ - fields: Value[] -} +export type List = Message<"values.v1.List"> & { + /** + * @generated from field: repeated values.v1.Value fields = 2; + */ + fields: Value[]; +}; /** * @generated from message values.v1.List */ export type ListJson = { - /** - * @generated from field: repeated values.v1.Value fields = 2; - */ - fields?: ValueJson[] -} + /** + * @generated from field: repeated values.v1.Value fields = 2; + */ + fields?: ValueJson[]; +}; /** * Describes the message values.v1.List. * Use `create(ListSchema)` to create a new message. */ -export const ListSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_values_v1_values, 3) +export const ListSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_values_v1_values, 3); /** * @generated from message values.v1.Decimal */ -export type Decimal = Message<'values.v1.Decimal'> & { - /** - * @generated from field: values.v1.BigInt coefficient = 1; - */ - coefficient?: BigInt - - /** - * @generated from field: int32 exponent = 2; - */ - exponent: number -} +export type Decimal = Message<"values.v1.Decimal"> & { + /** + * @generated from field: values.v1.BigInt coefficient = 1; + */ + coefficient?: BigInt; + + /** + * @generated from field: int32 exponent = 2; + */ + exponent: number; +}; /** * @generated from message values.v1.Decimal */ export type DecimalJson = { - /** - * @generated from field: values.v1.BigInt coefficient = 1; - */ - coefficient?: BigIntJson + /** + * @generated from field: values.v1.BigInt coefficient = 1; + */ + coefficient?: BigIntJson; - /** - * @generated from field: int32 exponent = 2; - */ - exponent?: number -} + /** + * @generated from field: int32 exponent = 2; + */ + exponent?: number; +}; /** * Describes the message values.v1.Decimal. * Use `create(DecimalSchema)` to create a new message. */ -export const DecimalSchema: GenMessage = - /*@__PURE__*/ - messageDesc(file_values_v1_values, 4) +export const DecimalSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_values_v1_values, 4); + diff --git a/src/generator/generate-action.ts b/src/generator/generate-action.ts index 9d9dbce8..e2063703 100644 --- a/src/generator/generate-action.ts +++ b/src/generator/generate-action.ts @@ -25,10 +25,12 @@ export function generateActionMethod( const capabilityId = ${capabilityClassName}.CAPABILITY_ID;` return ` - async ${methodName}(input: ${method.input.name}Json): Promise<${method.output.name}> { + async ${methodName}(input: ${method.input.name} | ${method.input.name}Json): Promise<${method.output.name}> { + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + const value = (input as any).$typeName ? input as ${method.input.name} : fromJson(${method.input.name}Schema, input as ${method.input.name}Json) const payload = { typeUrl: getTypeUrl(${method.input.name}Schema), - value: toBinary(${method.input.name}Schema, fromJson(${method.input.name}Schema, input)), + value: toBinary(${method.input.name}Schema, value), };${capabilityIdLogic} return callCapability({ diff --git a/src/generator/generate-sdk.ts b/src/generator/generate-sdk.ts index 9e224c29..a2be201d 100644 --- a/src/generator/generate-sdk.ts +++ b/src/generator/generate-sdk.ts @@ -61,6 +61,7 @@ export function generateSdk(file: GenFile, outputDir: string) { const inputPathTypes = typeImports.get(inputPath)! inputPathTypes.add(`${method.input.name}Schema`) inputPathTypes.add(`type ${method.input.name}Json`) + inputPathTypes.add(`type ${method.input.name}`) // Handle output type const outputFile = method.output.file @@ -83,7 +84,11 @@ export function generateSdk(file: GenFile, outputDir: string) { // Build import statements const imports = new Set() - imports.add('import { fromBinary, toBinary, fromJson, create } from "@bufbuild/protobuf";') + if (hasTriggers) { + imports.add('import { fromBinary, toBinary, fromJson, create } from "@bufbuild/protobuf";') + } else { + imports.add('import { fromBinary, toBinary, fromJson } from "@bufbuild/protobuf";') + } imports.add(`import { Mode, type CapabilityResponse, diff --git a/src/generator/generate-trigger.ts b/src/generator/generate-trigger.ts index 2f090015..40a6b3f9 100644 --- a/src/generator/generate-trigger.ts +++ b/src/generator/generate-trigger.ts @@ -39,12 +39,16 @@ export function generateTriggerClass(method: DescMethod, className: string): str * Trigger implementation for ${method.name} */ class ${triggerClassName} implements Trigger<${method.output.name}, ${method.output.name}> { + public readonly config: ${method.input.name} constructor( public readonly mode: Mode, - public readonly config: ${method.input.name}Json, + config: ${method.input.name} | ${method.input.name}Json, private readonly _capabilityId: string, private readonly _method: string - ) {} + ) { + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + this.config = (config as any).$typeName ? config as ${method.input.name} : fromJson(${method.input.name}Schema, config as ${method.input.name}Json) + } capabilityId(): string { return this._capabilityId; @@ -59,10 +63,9 @@ class ${triggerClassName} implements Trigger<${method.output.name}, ${method.out } configAsAny(): Any { - const configMessage = fromJson(${method.input.name}Schema, this.config); return create(AnySchema, { typeUrl: getTypeUrl(${method.input.name}Schema), - value: toBinary(${method.input.name}Schema, configMessage), + value: toBinary(${method.input.name}Schema, this.config), }); } diff --git a/src/sdk/cre/index.ts b/src/sdk/cre/index.ts index c87137bb..2e617fc1 100644 --- a/src/sdk/cre/index.ts +++ b/src/sdk/cre/index.ts @@ -8,7 +8,6 @@ import { runInNodeMode } from '@cre/sdk/runtime/run-in-node-mode' import { CronCapability } from '@cre/generated-sdk/capabilities/scheduler/cron/v1/cron_sdk_gen' import { ClientCapability as EVMClient } from '@cre/generated-sdk/capabilities/blockchain/evm/v1alpha/client_sdk_gen' import { ClientCapability as HTTPClient } from '@cre/generated-sdk/capabilities/networking/http/v1alpha/client_sdk_gen' -import { getAggregatedValue } from '@cre/sdk/utils/values/consensus' import { creFetch } from '@cre/sdk/utils/capabilities/http/fetch' import { sendResponseValue } from '@cre/sdk/utils/send-response-value' import { withErrorBoundary } from '@cre/sdk/utils/error-boundary' @@ -30,9 +29,6 @@ export const cre = { newRunner: Runner.newRunner, runInNodeMode, utils: { - consensus: { - getAggregatedValue, - }, fetch: creFetch, }, sendResponseValue, diff --git a/src/sdk/engine/execute.ts b/src/sdk/engine/execute.ts index a0c36d90..cc4fb0fd 100644 --- a/src/sdk/engine/execute.ts +++ b/src/sdk/engine/execute.ts @@ -1,4 +1,4 @@ -import type { ExecuteRequest, CapabilityResponse } from '@cre/generated/sdk/v1alpha/sdk_pb' +import { type ExecuteRequest, type CapabilityResponse, Mode } from '@cre/generated/sdk/v1alpha/sdk_pb' import type { Workflow } from '@cre/sdk/workflow' import type { Runtime } from '@cre/sdk/runtime/runtime' import { handleSubscribePhase } from './handleSubscribePhase' @@ -15,6 +15,7 @@ export const handleExecuteRequest = async ( } if (req.request.case === 'trigger') { + runtime.switchModes(Mode.DON) return handleExecutionPhase(req, workflow, config, runtime) } } diff --git a/src/sdk/runtime/errors.ts b/src/sdk/runtime/errors.ts index d854b8cd..039c6041 100644 --- a/src/sdk/runtime/errors.ts +++ b/src/sdk/runtime/errors.ts @@ -7,7 +7,7 @@ export class DonModeError extends Error { public mode?: Mode constructor( - message = 'cannot use DON Runtime inside Node mode', + message = 'cannot use Runtime inside RunInNodeMode', options?: { capabilityId?: string method?: string @@ -30,9 +30,8 @@ export class NodeModeError extends Error { public capabilityId?: string public method?: string public mode?: Mode - constructor( - message = 'cannot use Node Runtime inside DON mode', + message = 'cannot use NodeRuntime outside RunInNodeMode', options?: { capabilityId?: string method?: string diff --git a/src/sdk/runtime/run-in-node-mode.test.ts b/src/sdk/runtime/run-in-node-mode.test.ts index 0cafa4ee..46fca81a 100644 --- a/src/sdk/runtime/run-in-node-mode.test.ts +++ b/src/sdk/runtime/run-in-node-mode.test.ts @@ -1,8 +1,10 @@ import { describe, test, expect, mock } from 'bun:test' import { create } from '@bufbuild/protobuf' import { + AggregationType, + ConsensusDescriptorSchema, Mode, - SimpleConsensusInputsSchema, + type SimpleConsensusInputs, type SimpleConsensusInputsJson, } from '@cre/generated/sdk/v1alpha/sdk_pb' import { ConsensusCapability } from '@cre/generated-sdk/capabilities/internal/consensus/v1alpha/consensus_sdk_gen' @@ -10,77 +12,140 @@ import { ConsensusCapability } from '@cre/generated-sdk/capabilities/internal/co import { calls } from '@cre/sdk/testhelpers/mock-host-bindings' import { type NodeRuntime } from '@cre/sdk/runtime/runtime' import { runInNodeMode } from '@cre/sdk/runtime/run-in-node-mode' +import { Value, consensusIdenticalAggregation, consensusMedianAggregation } from '../utils' +import type { Value as ProtoValue } from '@cre/generated/values/v1/values_pb' +import { BasicActionCapability } from '@cre/generated-sdk/capabilities/internal/basicaction/v1/basicaction_sdk_gen' + +function expectObservation(i: SimpleConsensusInputs): Value { + expect(i.observation.case).toEqual('value') + return Value.wrap(i.observation.value as ProtoValue) +} + +function expectError(i: SimpleConsensusInputs): string { + expect(i.observation.case).toEqual('error') + return i.observation.value as string +} describe('runInNodeMode', () => { - test('accepts message input and returns Value', async () => { + test('successful run', async () => { + // Clear the calls array for this test + calls.length = 0 + + const anyObservation = 120 + const anyResult = 123 + // spy on consensus.simple const origSimple = ConsensusCapability.prototype.simple - ConsensusCapability.prototype.simple = mock(async (_: SimpleConsensusInputsJson) => { - return {} as any // a Value; not asserting shape here - }) - - const res = await runInNodeMode(() => create(SimpleConsensusInputsSchema)) - expect(res).toBeDefined() + ConsensusCapability.prototype.simple = mock(async (inputs: SimpleConsensusInputs | SimpleConsensusInputsJson) => { + calls.push('CONSENSUS_SIMPLE') - ConsensusCapability.prototype.simple = origSimple - }) + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + expect((inputs as any).$typeName).toBeDefined() + const castedInputs = inputs as SimpleConsensusInputs + expect(castedInputs.default).toBeUndefined() + const actualObservation = expectObservation(castedInputs) + expect(Value.from(anyObservation)).toEqual(actualObservation) - test('accepts json input and returns Value', async () => { - const origSimple = ConsensusCapability.prototype.simple - ConsensusCapability.prototype.simple = mock(async (_: SimpleConsensusInputsJson) => { - return {} as any + const expectedDescriptor = create(ConsensusDescriptorSchema, { + descriptor: { + case: 'aggregation', + value: AggregationType.MEDIAN + } + }) + expect(castedInputs.descriptors).toEqual(expectedDescriptor) + + return Value.from(anyResult).proto() }) - const res = await runInNodeMode(() => ({}) as SimpleConsensusInputsJson) - expect(res).toBeDefined() + const res = await runInNodeMode((_: NodeRuntime) => anyObservation, consensusMedianAggregation())() + expect(res).toEqual(anyResult) + expect(calls).toEqual(['NODE', 'DON', 'CONSENSUS_SIMPLE']) + + // Restore the original method after the test ConsensusCapability.prototype.simple = origSimple }) - test('restores DON mode before calling consensus', async () => { + test('local failure with consensus', async () => { // Clear the calls array for this test calls.length = 0 + const anyError = Error("nope") + const anyResult = 123 + + + // spy on consensus.simple const origSimple = ConsensusCapability.prototype.simple - ConsensusCapability.prototype.simple = mock(async (_: SimpleConsensusInputsJson) => { - // At this point we expect mode to have been restored to DON + ConsensusCapability.prototype.simple = mock(async (inputs: SimpleConsensusInputs | SimpleConsensusInputsJson) => { calls.push('CONSENSUS_SIMPLE') - return {} as any + + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + expect((inputs as any).$typeName).toBeDefined() + const castedInputs = inputs as SimpleConsensusInputs + expect(castedInputs.default).toBeUndefined() + const actualError = expectError(castedInputs) + expect(anyError.message).toEqual(actualError) + + const expectedDescriptor = create(ConsensusDescriptorSchema, { + descriptor: { + case: 'aggregation', + value: AggregationType.MEDIAN + } + }) + expect(castedInputs.descriptors).toEqual(expectedDescriptor) + + return Value.from(anyResult).proto() }) - await runInNodeMode(() => create(SimpleConsensusInputsSchema)) - expect(calls).toEqual(['NODE', 'DON', 'CONSENSUS_SIMPLE']) + const errFn: (_: NodeRuntime) => number = (_: NodeRuntime) => { throw anyError } + const res = await runInNodeMode(errFn, consensusMedianAggregation())() + expect(res).toEqual(anyResult) - // restore + expect(calls).toEqual(['NODE', 'DON', 'CONSENSUS_SIMPLE']) + + // Restore the original method after the test ConsensusCapability.prototype.simple = origSimple }) - test('guards DON calls while in node mode', async () => { + test('guards DON calls while in node mode, also local and consensus failure', async () => { // Simulate switchModes by touching global function used by host const origSwitch = (globalThis as any).switchModes ;(globalThis as any).switchModes = (_m: Mode) => {} - // Mock consensus.simple but also try to make a DON call in node mode + + // spy on consensus.simple const origSimple = ConsensusCapability.prototype.simple - ConsensusCapability.prototype.simple = mock(async (_: SimpleConsensusInputsJson) => { - return {} as any - }) + ConsensusCapability.prototype.simple = mock(async (inputs: SimpleConsensusInputs | SimpleConsensusInputsJson) => { + calls.push('CONSENSUS_SIMPLE') + + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + expect((inputs as any).$typeName).toBeDefined() + const castedInputs = inputs as SimpleConsensusInputs + expect(castedInputs.default).toBeUndefined() + const actualError = expectError(castedInputs) + expect(actualError).toContain('cannot use Runtime inside RunInNodeMode.') - let threw = false - try { - await runInNodeMode(async (nodeRuntime: NodeRuntime) => { - // During builder, we are in NODE mode, performing a DON call should throw - expect(() => nodeRuntime.logger.log('')) - return create(SimpleConsensusInputsSchema) + const expectedDescriptor = create(ConsensusDescriptorSchema, { + descriptor: { + case: 'aggregation', + value: AggregationType.IDENTICAL + } }) - } catch (_e) { - threw = true - } + expect(castedInputs.descriptors).toEqual(expectedDescriptor) + + throw Error(actualError) + }) + + expect(async () => { + await runInNodeMode(async (_: NodeRuntime) => { + const ba = new BasicActionCapability() + const result = await ba.performAction({ inputThing: true }) + return result.adaptedThing + }, consensusIdenticalAggregation())() + }).toThrow(RegExp(".*cannot use Runtime inside RunInNodeMode.*")) - // The guard may not throw on host.log; rely on callCapability guard instead by attempting a DON call - // restore + // Restore the original method and global after the test ConsensusCapability.prototype.simple = origSimple ;(globalThis as any).switchModes = origSwitch - expect(threw).toBeFalse() }) }) diff --git a/src/sdk/runtime/run-in-node-mode.ts b/src/sdk/runtime/run-in-node-mode.ts index fbf74cd8..dc1f4a15 100644 --- a/src/sdk/runtime/run-in-node-mode.ts +++ b/src/sdk/runtime/run-in-node-mode.ts @@ -1,68 +1,54 @@ -import { toJson } from '@bufbuild/protobuf' +import { create, toJson } from '@bufbuild/protobuf' import { Mode, SimpleConsensusInputsSchema, - type SimpleConsensusInputs, - type SimpleConsensusInputsJson, } from '@cre/generated/sdk/v1alpha/sdk_pb' import { ConsensusCapability } from '@cre/generated-sdk/capabilities/internal/consensus/v1alpha/consensus_sdk_gen' -import type { Value } from '@cre/generated/values/v1/values_pb' import { runtime, type NodeRuntime } from '@cre/sdk/runtime/runtime' - -type Inputs = SimpleConsensusInputs | SimpleConsensusInputsJson - -const isMessageInputs = (i: unknown): i is SimpleConsensusInputs => { - const anyI = i as any - return ( - anyI && - typeof anyI === 'object' && - 'observation' in anyI && - anyI.observation && - typeof anyI.observation === 'object' && - 'case' in anyI.observation - ) -} - -const isJsonInputs = (i: unknown): i is SimpleConsensusInputsJson => { - const anyI = i as any - if (!anyI || typeof anyI !== 'object') return false - if (!('observation' in anyI)) return true - const obs = anyI.observation - if (obs == null) return true - return typeof obs === 'object' && ('value' in obs || 'error' in obs) -} - -const toInputsJson = (input: Inputs): SimpleConsensusInputsJson => { - if (isMessageInputs(input)) { - return toJson(SimpleConsensusInputsSchema, input) - } - if (isJsonInputs(input)) { - return input - } - throw new Error( - 'runInNodeMode: invalid input shape; expected SimpleConsensusInputs message or SimpleConsensusInputsJson', - ) -} +import type { UnwrapOptions, ConsensusAggregation, CreSerializable, PrimitiveTypes } from '../utils' +import { Value } from '../utils' /** * Runs the provided builder inside Node mode and returns the consensus result Value. * Ensures mode is switched back to DON even if errors occur. */ -export const runInNodeMode = async ( - buildConsensusInputs: (nodeRuntime: NodeRuntime) => Promise | Inputs, -): Promise => { - const nodeRuntime: NodeRuntime = runtime.switchModes(Mode.NODE) - let consensusInputJson: SimpleConsensusInputsJson - try { - const consensusInput = await buildConsensusInputs(nodeRuntime) - consensusInputJson = toInputsJson(consensusInput) - } finally { - // Always restore DON mode before invoking consensus - runtime.switchModes(Mode.DON) - } +/** + * Runs the provided builder inside Node mode and returns the consensus result Value. + * For primitive types (number, bigint, Date, boolean, string), it will use unwrap() + * For complex types, it will use unwrapToType() with the provided options + */ +export function runInNodeMode( + fn: (nodeRuntime: NodeRuntime, ...args: TArgs) => Promise | TOutput, + consesusAggretation: ConsensusAggregation, + unwrapOptions?: TOutput extends PrimitiveTypes ? never : UnwrapOptions +): (...args: TArgs) => Promise { + return async (...args: TArgs) => { + const nodeRuntime: NodeRuntime = runtime.switchModes(Mode.NODE) + + const consensusInput = create(SimpleConsensusInputsSchema, { descriptors: consesusAggretation.descriptor }) + if (consesusAggretation.defaultValue) { + // This cast is safe, since ConsensusAggregation can only have true its second argument if T extends CreSerializable + consensusInput.default = Value.from(consesusAggretation.defaultValue as CreSerializable).proto() + } - const consensus = new ConsensusCapability() - // simple() expects JSON per generated client conventions - const result = await consensus.simple(consensusInputJson) - return result + try { + const observation = await fn(nodeRuntime, ...args) + // This cast is safe, since ConsensusAggregation can only have true its second argument if T extends CreSerializable + consensusInput.observation = { case: 'value', value: Value.from(observation as CreSerializable).proto() } + + } catch (e: any) { + consensusInput.observation = { case: 'error', value: e.message || String(e) } + } finally { + // Always restore DON mode before invoking consensus + runtime.switchModes(Mode.DON) + } + + const consensus = new ConsensusCapability() + const result = await consensus.simple(consensusInput) + const wrappedValue = Value.wrap(result) + + return unwrapOptions + ? wrappedValue.unwrapToType(unwrapOptions) + : wrappedValue.unwrap() as TOutput + } } diff --git a/src/sdk/runtime/runtime.ts b/src/sdk/runtime/runtime.ts index e9919518..10a21cb4 100644 --- a/src/sdk/runtime/runtime.ts +++ b/src/sdk/runtime/runtime.ts @@ -14,7 +14,7 @@ import { getTimeAsDate } from '@cre/sdk/utils/time/get-time' * If not the prepared error will be thrown. */ export const runtimeGuards = (() => { - let currentMode: Mode = Mode.DON + let currentMode: Mode = Mode.UNSPECIFIED let donModeGuardError: DonModeError | null = null let nodeModeGuardError: NodeModeError | null = new NodeModeError() @@ -76,7 +76,6 @@ export type NodeRuntime = BaseRuntime & { // Shared implementation for mode switching function switchModes(mode: Mode.NODE): NodeRuntime function switchModes(mode: Mode.DON): Runtime -function switchModes(mode: Mode): Runtime | NodeRuntime function switchModes(mode: Mode): Runtime | NodeRuntime { // Changing to the same mode should be a noop, we make sure to actually call switching logic if it's different mode if (mode !== runtimeGuards.getMode()) { diff --git a/src/sdk/utils/hex-utils.ts b/src/sdk/utils/hex-utils.ts index 342c77cf..4c0ff201 100644 --- a/src/sdk/utils/hex-utils.ts +++ b/src/sdk/utils/hex-utils.ts @@ -1,7 +1,7 @@ /** * Hex conversion utilities for blockchain data * - * Note: BigInt utilities are available in @cre/sdk/utils/values/value + * Note: BigInt utilities are available in @cre/sdk/utils * Use val.bigint() or bigIntToProtoBigInt() for BigInt conversions */ import { type Hex } from 'viem' diff --git a/src/sdk/utils/index.ts b/src/sdk/utils/index.ts index 564aec12..5607ba7b 100644 --- a/src/sdk/utils/index.ts +++ b/src/sdk/utils/index.ts @@ -1,5 +1,6 @@ export * from './error-boundary' export * from './hex-utils' export * from './send-response-value' -export * from './values/consensus-hooks' +export * from './values/consensus_aggregators' +export * from './values/serializer_types' export * from './values/value' diff --git a/src/sdk/utils/send-response-value.ts b/src/sdk/utils/send-response-value.ts index ebf958dc..d453de4f 100644 --- a/src/sdk/utils/send-response-value.ts +++ b/src/sdk/utils/send-response-value.ts @@ -1,4 +1,4 @@ -import { Value } from '@cre/sdk/utils/values/value' +import { Value } from '@cre/sdk/utils' import { type ExecutionResult, ExecutionResultSchema } from '@cre/generated/sdk/v1alpha/sdk_pb' import { create, toBinary } from '@bufbuild/protobuf' @@ -7,7 +7,7 @@ export const sendResponseValue = (value: Value): void => { const execResult: ExecutionResult = create(ExecutionResultSchema, { result: { case: 'value', - value: value.proto, + value: value.proto(), }, }) diff --git a/src/sdk/utils/values/consensus-hooks.ts b/src/sdk/utils/values/consensus-hooks.ts deleted file mode 100644 index 780a8e1f..00000000 --- a/src/sdk/utils/values/consensus-hooks.ts +++ /dev/null @@ -1,93 +0,0 @@ -import { cre } from '@cre/sdk/cre' -import { Value } from '@cre/sdk/utils/values/value' -import { type ConsenusAggregator, getAggregatedValue } from '@cre/sdk/utils/values/consensus' -import { type SupportedValueTypes } from '@cre/sdk/utils/values/value' -import { type NodeRuntime } from '@cre/sdk/runtime/runtime' - -// ===== TYPE HELPERS FOR BETTER TYPE SAFETY ===== - -// Map value types to their expected input types -type ValueTypeInput = { - string: string - float64: number - int64: number | bigint | string - bigint: bigint - bool: boolean - bytes: Uint8Array | ArrayBuffer - time: Date | number | string - list: Array - mapValue: Record - decimal: string - from: unknown -} - -// ===== CORE CONSENSUS WRAPPER ===== - -/** - * Core consensus wrapper with strong typing - * Ensures the function return type matches the value type input requirements - */ -export const useConsensus = < - TValueType extends keyof ValueTypeInput & SupportedValueTypes, - TArgs extends readonly any[], - TReturn extends ValueTypeInput[TValueType], ->( - fn: (...args: TArgs) => Promise, - valueType: TValueType, - aggregationType: ConsenusAggregator, -) => { - return async (...args: TArgs): Promise => { - return cre.runInNodeMode(async (_nodeRuntime: NodeRuntime) => { - const result = await fn(...args) - return getAggregatedValue(new Value(result), aggregationType) - }) - } -} - -// ===== TYPED CONVENIENCE WRAPPERS ===== - -/** - * Median consensus for numerical data - * Automatically infers correct return type based on value type - */ -export const useMedianConsensus = ( - fn: (...args: TArgs) => Promise, - valueType: 'float64' | 'int64' = 'float64', -) => useConsensus(fn, valueType, 'median') - -/** - * Identical consensus - all nodes must agree exactly - * Supports any value type with proper typing - */ -export const useIdenticalConsensus = < - TValueType extends keyof ValueTypeInput & SupportedValueTypes, - TArgs extends readonly any[], - TReturn extends ValueTypeInput[TValueType], ->( - fn: (...args: TArgs) => Promise, - valueType: TValueType, -) => useConsensus(fn, valueType, 'identical') - -/** - * Common prefix consensus for strings and bytes - */ -export const useCommonPrefixConsensus = < - TValueType extends ('string' | 'bytes') & keyof ValueTypeInput, - TArgs extends readonly any[], - TReturn extends ValueTypeInput[TValueType], ->( - fn: (...args: TArgs) => Promise, - valueType: TValueType, -) => useConsensus(fn, valueType, 'commonPrefix') - -/** - * Common suffix consensus for strings and bytes - */ -export const useCommonSuffixConsensus = < - TValueType extends ('string' | 'bytes') & keyof ValueTypeInput, - TArgs extends readonly any[], - TReturn extends ValueTypeInput[TValueType], ->( - fn: (...args: TArgs) => Promise, - valueType: TValueType, -) => useConsensus(fn, valueType, 'commonSuffix') diff --git a/src/sdk/utils/values/consensus.test.ts b/src/sdk/utils/values/consensus.test.ts deleted file mode 100644 index e5697c6d..00000000 --- a/src/sdk/utils/values/consensus.test.ts +++ /dev/null @@ -1,129 +0,0 @@ -import { describe, expect, test } from 'bun:test' -import { AggregationType } from '@cre/generated/sdk/v1alpha/sdk_pb' -import type { ConsensusDescriptor } from '@cre/generated/sdk/v1alpha/sdk_pb' -import { - consensusDescriptorMedian, - consensusDescriptorIdentical, - consensusDescriptorCommonPrefix, - consensusDescriptorCommonSuffix, - createConsensusDescriptorAggregation, - consensusFields, - consensusFieldsFrom, - observationValue, - observationError, - getAggregatedValue, -} from './consensus' -import { Value } from './value' - -const getAggregation = (d: ConsensusDescriptor): AggregationType | undefined => - d.descriptor.case === 'aggregation' ? d.descriptor.value : undefined - -const isFieldsMap = (d: ConsensusDescriptor): boolean => d.descriptor.case === 'fieldsMap' - -describe('consensus helpers', () => { - test('aggregation helpers', () => { - expect(getAggregation(consensusDescriptorMedian)).toBe(AggregationType.MEDIAN) - expect(getAggregation(consensusDescriptorIdentical)).toBe(AggregationType.IDENTICAL) - expect(getAggregation(consensusDescriptorCommonPrefix)).toBe(AggregationType.COMMON_PREFIX) - expect(getAggregation(consensusDescriptorCommonSuffix)).toBe(AggregationType.COMMON_SUFFIX) - }) - - test('createConsensusDescriptorAggregation', () => { - const d = createConsensusDescriptorAggregation(AggregationType.IDENTICAL) - expect(getAggregation(d)).toBe(AggregationType.IDENTICAL) - }) - - test('consensusFields builds fieldsMap', () => { - const fields: Record = { - Price: createConsensusDescriptorAggregation(AggregationType.MEDIAN), - } - const d = consensusFields(fields) - expect(isFieldsMap(d)).toBe(true) - const map = d.descriptor.case === 'fieldsMap' ? d.descriptor.value.fields : {} - expect(Object.keys(map)).toEqual(['Price']) - expect(getAggregation(map.Price!)).toBe(AggregationType.MEDIAN) - }) - - test('consensusFieldsFrom normalizes enums and descriptors', () => { - const prebuilt = createConsensusDescriptorAggregation(AggregationType.IDENTICAL) - const d = consensusFieldsFrom({ - a: AggregationType.MEDIAN, - b: prebuilt, - }) - expect(isFieldsMap(d)).toBe(true) - const map = d.descriptor.case === 'fieldsMap' ? d.descriptor.value.fields : {} - expect(getAggregation(map.a!)).toBe(AggregationType.MEDIAN) - expect(getAggregation(map.b!)).toBe(AggregationType.IDENTICAL) - }) - - test('consensusFieldsFrom nested fieldsMap', () => { - const nested = consensusFieldsFrom({ - In: consensusFieldsFrom({ Score: AggregationType.MEDIAN }), - }) - expect(isFieldsMap(nested)).toBe(true) - const outer = nested.descriptor.case === 'fieldsMap' ? nested.descriptor.value.fields : {} - const inner = outer.In! - expect(isFieldsMap(inner)).toBe(true) - const innerFields = inner.descriptor.case === 'fieldsMap' ? inner.descriptor.value.fields : {} - expect(getAggregation(innerFields.Score!)).toBe(AggregationType.MEDIAN) - }) - - test('consensusFieldsFrom with mixed data types and aggregation strategies', () => { - const d = consensusFieldsFrom({ - Foo: AggregationType.MEDIAN, - Bar: AggregationType.IDENTICAL, - Baz: AggregationType.COMMON_PREFIX, - }) - expect(isFieldsMap(d)).toBe(true) - const map = d.descriptor.case === 'fieldsMap' ? d.descriptor.value.fields : {} - expect(Object.keys(map)).toEqual(['Foo', 'Bar', 'Baz']) - expect(getAggregation(map.Foo!)).toBe(AggregationType.MEDIAN) - expect(getAggregation(map.Bar!)).toBe(AggregationType.IDENTICAL) - expect(getAggregation(map.Baz!)).toBe(AggregationType.COMMON_PREFIX) - }) - - test('consensusFieldsFrom with numeric enum values', () => { - const d = consensusFieldsFrom({ - Foo: AggregationType.MEDIAN, - Bar: AggregationType.IDENTICAL, - }) - expect(isFieldsMap(d)).toBe(true) - const map = d.descriptor.case === 'fieldsMap' ? d.descriptor.value.fields : {} - expect(getAggregation(map.Foo!)).toBe(AggregationType.MEDIAN) - expect(getAggregation(map.Bar!)).toBe(AggregationType.IDENTICAL) - }) - - test('consensusFieldsFrom with empty object', () => { - const d = consensusFieldsFrom({}) - expect(isFieldsMap(d)).toBe(true) - const map = d.descriptor.case === 'fieldsMap' ? d.descriptor.value.fields : {} - expect(Object.keys(map)).toEqual([]) - }) - - test('observation helpers', () => { - const ov = observationValue(new Value('ok')) - expect(ov.case).toBe('value') - expect(ov.value.value.case).toBe('stringValue') - - const oe = observationError('boom') - expect(oe.case).toBe('error') - expect(oe.value).toBe('boom') - }) - - test('getAggregatedValue with different consensus strategies', () => { - const priceInput = getAggregatedValue(new Value(1850.5), 'median') - expect(priceInput.observation.case).toBe('value') - expect(priceInput.descriptors).toBe(consensusDescriptorMedian) - - const statusInput = getAggregatedValue(new Value(true), 'identical') - expect(statusInput.observation.case).toBe('value') - expect(statusInput.descriptors).toBe(consensusDescriptorIdentical) - - const urlInput = getAggregatedValue( - new Value('https://api.example.com/v1/data'), - 'commonPrefix', - ) - expect(urlInput.observation.case).toBe('value') - expect(urlInput.descriptors).toBe(consensusDescriptorCommonPrefix) - }) -}) diff --git a/src/sdk/utils/values/consensus.ts b/src/sdk/utils/values/consensus.ts deleted file mode 100644 index 049a6750..00000000 --- a/src/sdk/utils/values/consensus.ts +++ /dev/null @@ -1,196 +0,0 @@ -import { create } from '@bufbuild/protobuf' -import type { ConsensusDescriptor, SimpleConsensusInputs } from '@cre/generated/sdk/v1alpha/sdk_pb' -import type { Value } from './value' -import { - AggregationType, - ConsensusDescriptorSchema, - FieldsMapSchema, - SimpleConsensusInputsSchema, -} from '@cre/generated/sdk/v1alpha/sdk_pb' - -export { AggregationType } from '@cre/generated/sdk/v1alpha/sdk_pb' - -const consensusAggregators = ['median', 'identical', 'commonPrefix', 'commonSuffix'] as const -export type ConsenusAggregator = (typeof consensusAggregators)[number] - -export const consensusDescriptorMedian = create(ConsensusDescriptorSchema, { - descriptor: { - case: 'aggregation', - value: AggregationType.MEDIAN, - }, -}) - -export const consensusDescriptorIdentical = create(ConsensusDescriptorSchema, { - descriptor: { - case: 'aggregation', - value: AggregationType.IDENTICAL, - }, -}) - -export const consensusDescriptorCommonPrefix = create(ConsensusDescriptorSchema, { - descriptor: { - case: 'aggregation', - value: AggregationType.COMMON_PREFIX, - }, -}) - -export const consensusDescriptorCommonSuffix = create(ConsensusDescriptorSchema, { - descriptor: { - case: 'aggregation', - value: AggregationType.COMMON_SUFFIX, - }, -}) - -const consensusAggregatorsMap = { - median: consensusDescriptorMedian, - identical: consensusDescriptorIdentical, - commonPrefix: consensusDescriptorCommonPrefix, - commonSuffix: consensusDescriptorCommonSuffix, -} as const - -export const createConsensusDescriptorAggregation = (aggregation: AggregationType) => - create(ConsensusDescriptorSchema, { - descriptor: { - case: 'aggregation', - value: aggregation, - }, - }) - -export const consensusFields = (fields: Record) => - create(ConsensusDescriptorSchema, { - descriptor: { - case: 'fieldsMap', - value: create(FieldsMapSchema, { fields }), - }, - }) - -/** - * Creates a consensus fields descriptor from a mixed specification of aggregation types and descriptors. - * - * This function normalizes a mixed object where values can be either: - * - `AggregationType` enum values (numbers) - automatically converted to consensus descriptors - * - `ConsensusDescriptor` objects - used as-is - * - * @param spec - Object mapping field names to either AggregationType enum values or ConsensusDescriptor objects - * @returns A ConsensusDescriptor with a fieldsMap containing the normalized field descriptors - * - * @example - * ```typescript - * // Using AggregationType enum values (most common usage) - * const descriptors = consensusFieldsFrom({ - * "Price": AggregationType.MEDIAN, - * "Volume": AggregationType.IDENTICAL - * }); - * - * @example - * ```typescript - * // Mixed usage with pre-built descriptors - * const prebuilt = createConsensusDescriptorAggregation(AggregationType.COMMON_PREFIX); - * const descriptors = consensusFieldsFrom({ - * "Foo": AggregationType.MEDIAN, - * "Bar": AggregationType.IDENTICAL, - * "Baz": prebuilt // Reuse pre-built descriptor - * }); - * - * @example - * ```typescript - * // Nested field maps for complex consensus structures - * const nested = consensusFieldsFrom({ - * "OuterField": consensusFieldsFrom({ - * "InnerField": AggregationType.MEDIAN - * }) - * }); - * - * @example - * ```typescript - * // Real-world usage in workflow consensus inputs - * const consensusInput = create(SimpleConsensusInputsSchema, { - * observation: observationValue(val.mapValue({ - * Foo: val.int64(response.fooValue), - * Bar: val.int64(response.barValue), - * Baz: val.string(response.bazValue) - * })), - * descriptors: consensusFieldsFrom({ - * Foo: AggregationType.MEDIAN, - * Bar: AggregationType.IDENTICAL, - * Baz: AggregationType.COMMON_PREFIX, - * }), - * default: val.mapValue({ - * Foo: val.int64(42), - * Bar: val.int64(123), - * Baz: val.string("default"), - * }), - * }); - * ``` - */ -export const consensusFieldsFrom = ( - spec: Record, -) => { - const normalized: Record = {} - for (const key of Object.keys(spec)) { - const value = spec[key] - normalized[key] = - typeof value === 'number' ? createConsensusDescriptorAggregation(value) : value - } - return consensusFields(normalized) -} - -export type ObservationValueCase = Extract - -export type ObservationErrorCase = Extract - -export const observationValue = (value: Value): ObservationValueCase => ({ - case: 'value', - value: value.proto, -}) - -export const observationError = (message: string): ObservationErrorCase => ({ - case: 'error', - value: message, -}) - -/** - * Creates consensus inputs for oracle network data aggregation. - * - * This function prepares an individual observation for distributed consensus - * among multiple oracle nodes. Each consensus strategy aggregates observations - * differently to produce a single trusted result. - * - * **Note**: This function only handles single values with a single consensus strategy. - * For complex objects with multiple fields using different consensus strategies, - * use `consensusFieldsFrom` directly with `create(SimpleConsensusInputsSchema, ...)`. - * - * @param value - The observation value from this oracle node - * @param consensus - The consensus mechanism to use for aggregation: - * - `"median"` - Takes middle value when sorted (ideal for numerical data, like prices) - * - `"identical"` - Requires all nodes to report exact same value (for critical boolean/status data) - * - `"commonPrefix"` - Finds longest shared beginning of strings (useful for URLs/addresses) - * - `"commonSuffix"` - Finds longest shared ending of strings - * @returns SimpleConsensusInputs object containing the observation and consensus descriptor - * - * @example - * ```typescript - * // Price feed - use median to resist outliers - * const priceInput = getAggregatedValue(val.float64(1850.50), "median"); - * - * // System status - require exact consensus - * const statusInput = getAggregatedValue(val.bool(true), "identical"); - * - * // API endpoint - find common base URL - * const urlInput = getAggregatedValue(val.string("https://api.example.com/v1/data"), "commonPrefix"); - * - * // For complex multi-field consensus, use consensusFieldsFrom instead: - * // const complexInput = create(SimpleConsensusInputsSchema, { - * // observation: observationValue(val.mapValue({ Foo: val.int64(42), Bar: val.string("test") })), - * // descriptors: consensusFieldsFrom({ - * // Foo: AggregationType.MEDIAN, - * // Bar: AggregationType.IDENTICAL, - * // }), - * // }); - * ``` - */ -export const getAggregatedValue = (value: Value, consensus: ConsenusAggregator) => - create(SimpleConsensusInputsSchema, { - observation: observationValue(value), - descriptors: consensusAggregatorsMap[consensus], - }) diff --git a/src/sdk/utils/values/consensus_aggregators.test.ts b/src/sdk/utils/values/consensus_aggregators.test.ts new file mode 100644 index 00000000..320c93f5 --- /dev/null +++ b/src/sdk/utils/values/consensus_aggregators.test.ts @@ -0,0 +1,186 @@ +import { describe, expect, test } from 'bun:test' +import { commonPrefix, commonSuffix, ConsensusAggregationByFields, consensusCommonPrefixAggregation, consensusCommonSuffixAggregation, type ConsensusFieldAggregation, consensusIdenticalAggregation, consensusMedianAggregation, identical, ignore, median, type ConsensusAggregation } from './consensus_aggregators' +import { AggregationType, type ConsensusDescriptor } from '@cre/generated/sdk/v1alpha/sdk_pb' + +// Similar to the tests for serialization, there are portions of the tests to verify that the retuned type is correct. +// The compilation itself is enough to validate it is correct, but it's broken into tests to make it easier to see what is tested. +// Since CreSerializable is tested in depth in the serializer tests, tests in this file only verify one invalid type. +describe('test consensus', () => { + test('median', () => { + assertSimpleConsensus(consensusMedianAggregation(), AggregationType.MEDIAN) + usableForConsensus(consensusMedianAggregation()) + usableForConsensus(consensusMedianAggregation()) + usableForConsensus(consensusMedianAggregation()) + // Restrictions on consensusMedianAggregation won't allow other types + }) + + test('identical', () => { + assertSimpleConsensus(consensusIdenticalAggregation(), AggregationType.IDENTICAL) + usableForConsensus(consensusIdenticalAggregation()) + usableForConsensus(consensusIdenticalAggregation()) + usableForConsensus(consensusIdenticalAggregation()) + usableForConsensus(consensusIdenticalAggregation()) + usableForConsensus(consensusIdenticalAggregation()) + usableForConsensus(consensusIdenticalAggregation()) + }) + + test('common prefix', () => { + assertSimpleConsensus(consensusCommonPrefixAggregation(), AggregationType.COMMON_PREFIX) + usableForConsensus(consensusCommonPrefixAggregation()) + usableForConsensus(consensusCommonPrefixAggregation()) + usableForConsensus(consensusCommonPrefixAggregation()) + usableForConsensus(consensusCommonPrefixAggregation()) + usableForConsensus(consensusCommonPrefixAggregation()) + usableForConsensus(consensusCommonPrefixAggregation()) + }) + + test('common prefix', () => { + assertSimpleConsensus(consensusCommonSuffixAggregation(), AggregationType.COMMON_SUFFIX) + usableForConsensus(consensusCommonSuffixAggregation()) + usableForConsensus(consensusCommonSuffixAggregation()) + usableForConsensus(consensusCommonSuffixAggregation()) + usableForConsensus(consensusCommonSuffixAggregation()) + usableForConsensus(consensusCommonSuffixAggregation()) + usableForConsensus(consensusCommonSuffixAggregation()) + }) + + test('with default adds default', () => { + const original = consensusMedianAggregation() + const anyDefaultValue = 10 + const withDefault = original.withDefault(anyDefaultValue) + + expect(original.defaultValue).toBeUndefined() + expect(withDefault.descriptor).toEqual(original.descriptor) + expect(withDefault.defaultValue).toEqual(anyDefaultValue) + }) + + test('with default overrides default', () => { + const anyDefaultValue = 10 + const original = consensusMedianAggregation().withDefault(anyDefaultValue) + const anyDifferentDefaultValue = anyDefaultValue + 20 + const withDefault = original.withDefault(anyDifferentDefaultValue) + + expect(original.defaultValue).toEqual(anyDefaultValue) + expect(withDefault.descriptor).toEqual(original.descriptor) + expect(withDefault.defaultValue).toEqual(anyDifferentDefaultValue) + }) + + describe('test fields', () => { + test('median', () => { + const consensusAggregation = ConsensusAggregationByFields>({ + f1: median, + f2: median + }) + assertFieldConsensus(consensusAggregation, AggregationType.MEDIAN) + usableForFieldConsensus(median) + usableForFieldConsensus(median) + usableForFieldConsensus(median) + // Restrictions on median won't allow other types + }) + + test('identical', () => { + const consensusAggregation = ConsensusAggregationByFields>({ + f1: identical, + f2: identical + }) + assertFieldConsensus(consensusAggregation, AggregationType.IDENTICAL) + + usableForFieldConsensus(identical) + usableForFieldConsensus(identical) + usableForFieldConsensus(identical) + usableForFieldConsensus(identical) + usableForFieldConsensus(identical) + usableForFieldConsensus(identical) + }) + + test('common prefix', () => { + const consensusAggregation = ConsensusAggregationByFields>({ + f1: commonPrefix, + f2: commonPrefix + }) + assertFieldConsensus(consensusAggregation, AggregationType.COMMON_PREFIX) + usableForFieldConsensus(commonPrefix) + usableForFieldConsensus(commonPrefix) + usableForFieldConsensus(commonPrefix) + usableForFieldConsensus(commonPrefix) + usableForFieldConsensus(commonPrefix) + usableForFieldConsensus(commonPrefix) + }) + + test('common suffix', () => { + const consensusAggregation = ConsensusAggregationByFields>({ + f1: commonSuffix, + f2: commonSuffix + }) + assertFieldConsensus(consensusAggregation, AggregationType.COMMON_SUFFIX) + usableForFieldConsensus(commonSuffix) + usableForFieldConsensus(commonSuffix) + usableForFieldConsensus(commonSuffix) + usableForFieldConsensus(commonSuffix) + usableForFieldConsensus(commonSuffix) + usableForFieldConsensus(commonSuffix) + }) + + test('ignore', () => { + const consensusAggregation = ConsensusAggregationByFields({ + f1: identical, + f2: identical, + ignoreString: ignore, + ignoreRegExp: ignore + }) + assertFieldConsensus(consensusAggregation, AggregationType.IDENTICAL) + }) + }) +}) + +function assertSimpleConsensus(c: ConsensusAggregation, expected: AggregationType) { + expect(c.defaultValue).toBeUndefined() + const actual = expectCase(c.descriptor, 'aggregation') + expect(actual).toEqual(expected) +} + +function assertFieldConsensus(c: ConsensusAggregation, expected: AggregationType) { + expect(c.defaultValue).toBeUndefined() + const actual = expectCase(c.descriptor, 'fieldsMap').fields + const entries = Object.entries(actual) + expect(entries).toHaveLength(2) + + expect(actual).toHaveProperty('f1') + expect(actual).toHaveProperty('f2') + + const f1Descriptor = actual['f1'] + const f2Descriptor = actual['f2'] + + expect(f1Descriptor.descriptor).toBeDefined() + expect(f1Descriptor.descriptor.case).toBe('aggregation') + expect(f1Descriptor.descriptor.value).toEqual(expected) + + expect(f2Descriptor.descriptor).toBeDefined() + expect(f2Descriptor.descriptor.case).toBe('aggregation') + expect(f2Descriptor.descriptor.value).toEqual(expected) +} + +function expectCase, V = Extract, { case: C }>['value']>( + actual: ConsensusDescriptor, + expectedCase: C +): V { + expect(actual.descriptor).toBeDefined() + expect(actual.descriptor.case).toBe(expectedCase) + return actual.descriptor.value as V +} + +class SimpleFieldType { + constructor(public f1: T, public f2: T) { } +} + +class InvalidFieldType { + constructor(public f1: string, public f2: string, public ignoreString: string, public ignoreRegExp: RegExp) { } +} + +function usableForConsensus(a: ConsensusAggregation): ConsensusAggregation { + return a +} + +function usableForFieldConsensus(a: () =>ConsensusFieldAggregation): ()=> ConsensusFieldAggregation { + return a +} \ No newline at end of file diff --git a/src/sdk/utils/values/consensus_aggregators.ts b/src/sdk/utils/values/consensus_aggregators.ts new file mode 100644 index 00000000..8a9af73a --- /dev/null +++ b/src/sdk/utils/values/consensus_aggregators.ts @@ -0,0 +1,98 @@ +import { AggregationType, ConsensusDescriptorSchema, FieldsMapSchema, type ConsensusDescriptor, type FieldsMap } from "@cre/generated/sdk/v1alpha/sdk_pb"; +import { create } from "@bufbuild/protobuf"; +import type { CreSerializable, NumericType, TypeVerifier } from "./serializer_types"; + +export type ConsensusAggregation = { + readonly descriptor: ConsensusDescriptor + readonly defaultValue?: T + withDefault(t: T): ConsensusAggregation + _usesUToForceShape(u: U): void +} +// Maybe make ConsensusAggregation take a second parameter, and it'll be true or false, then make anything using it require true +// Only take one type, but make the return type ConsensusAggregation> +// Similar for fields, but ignore would always return ConsensusAggregationFields instead of ConsensusAggregationFields>, and so would ConsensusAggregationByFields :D + +export function consensusMedianAggregation(): ConsensusAggregation>> { + return simpleConsensus(AggregationType.MEDIAN) +} + +export function consensusIdenticalAggregation(): ConsensusAggregation>> { + return simpleConsensus(AggregationType.IDENTICAL) +} + +export function consensusCommonPrefixAggregation(): ConsensusAggregation>> { + return simpleConsensus(AggregationType.COMMON_PREFIX) +} + +export function consensusCommonSuffixAggregation(): ConsensusAggregation>> { + return simpleConsensus (AggregationType.COMMON_SUFFIX) +} + +class ConsensusImpl implements ConsensusAggregation { + constructor(readonly descriptor: ConsensusDescriptor, readonly defaultValue?: T) {} + withDefault(t: T): ConsensusAggregation { + return new ConsensusImpl(this.descriptor, t) + } + _usesUToForceShape(_: U): void{} +} + +function simpleConsensus(agg: AggregationType): ConsensusAggregation>> { + return new ConsensusImpl>>(simpleDescriptor(agg)) +} + +function simpleDescriptor(agg: AggregationType): ConsensusDescriptor { + return create(ConsensusDescriptorSchema, { + descriptor: { + case: 'aggregation', + value: agg + } + }) +} + +export function median(): ConsensusFieldAggregation { + return new ConsensusFieldAggregation(simpleDescriptor(AggregationType.MEDIAN)) +} + +// identical requires the type twice due to limitations in circular references in TypeScripts validation system. +export function identical(): ConsensusFieldAggregation>> { + return new ConsensusFieldAggregation(simpleDescriptor(AggregationType.IDENTICAL)) +} + +export function commonPrefix(): ConsensusFieldAggregation>> { + return new ConsensusFieldAggregation(simpleDescriptor(AggregationType.COMMON_PREFIX)) +} + +export function commonSuffix(): ConsensusFieldAggregation>> { + return new ConsensusFieldAggregation(simpleDescriptor(AggregationType.COMMON_SUFFIX)) +} + +export function ignore(): ConsensusFieldAggregation { + return new ConsensusFieldAggregation() +} + +export class ConsensusFieldAggregation { + // t and u are included in the constructor to force the shape of ConsensusFieldAggregation to include them. + // This disallows automatic casting from other ConsensusFieldAggregation types. + constructor(public fieldDescriptor?: ConsensusDescriptor, protected readonly t?: T, protected readonly u?: U) { } +} + +export type ConsensusAggregationFields = { [K in keyof T]: () => ConsensusFieldAggregation } + +export function ConsensusAggregationByFields(aggregation: ConsensusAggregationFields): ConsensusAggregation { + const fieldMap = create(FieldsMapSchema) + + Object.keys(aggregation).forEach(key => { + const fieldFn = aggregation[key as keyof T] + const fieldAggregation = fieldFn() + if (fieldAggregation.fieldDescriptor) { + fieldMap.fields[key] = fieldAggregation.fieldDescriptor + } + }) + + return new ConsensusImpl(create(ConsensusDescriptorSchema, { + descriptor: { + case: 'fieldsMap', + value: fieldMap + } + })) +} \ No newline at end of file diff --git a/src/sdk/utils/values/serializer_types.test.ts b/src/sdk/utils/values/serializer_types.test.ts new file mode 100644 index 00000000..48542356 --- /dev/null +++ b/src/sdk/utils/values/serializer_types.test.ts @@ -0,0 +1,117 @@ +import { describe, test } from 'bun:test' +import type { NumericType, PrimitiveTypes, NonSerializable, CreSerializableNested, CreSerializable, TypeVerifier } from './serializer_types'; +import { Decimal, Int64, UInt64, type Value } from './value'; + +// These tests verify types are set up correctly. +// The compilation itself is enough to validate it is correct, but it's broken into tests to make it easier to see what is tested. +// Each path in a type is tested at laest once, in order of their occurence +// False values are meant to demonstrate the constraints, but cannot be exaustive, for each type check, there's one false to capture it. +describe('test types', () => { + test('NumericType', () => { + verifyType(true) + verifyType(true) + verifyType(true) + verifyType(true) + verifyType(true) + verifyType(true) + verifyType(false) + }) + + test('PrimitiveTypes', () => { + verifyType(true) + verifyType(true) + verifyType(true) + verifyType(false) + }) + + test('NonSerializable', () => { + verifyType(true) + verifyType, NonSerializable>(true) + verifyType, NonSerializable>(true) + verifyType(true) + verifyType(true) + verifyType(false) + }) + + test('CreSerializableNested', () => { + verifyType>(true) + verifyType>(true) + verifyType<(a: number, b: RegExp) => boolean, CreSerializableNested<(a: number, b: RegExp) => boolean>>(true) + verifyType<() => void, CreSerializableNested<() => void>>(true) + verifyType>(false) + verifyType, CreSerializableNested>>(false) + verifyType>(true) + verifyType>(true) + verifyType>(true) + verifyType>(true) + verifyType>(true) + verifyType>(true) + verifyType >(true) + verifyType>(true) + verifyType(false) + verifyType>(false) + verifyType>(false) + verifyType>(false) + verifyType>(false) + }) + + test('CreSerializable', () => { + verifyType>(true) + verifyType>(true) + verifyType<(a: number, b: RegExp) => boolean, CreSerializable<(a: number, b: RegExp) => boolean>>(false) + verifyType<() => void, CreSerializable<() => void>>(false) + verifyType>(false) + verifyType, CreSerializable>>(false) + verifyType>(true) + verifyType>(true) + verifyType>(true) + verifyType>(true) + verifyType>(true) + verifyType>(true) + verifyType >(true) + verifyType>(true) + verifyType(false) + verifyType>(false) + verifyType>(false) + verifyType>(false) + verifyType>(false) + }) +}) + +class Empty{} + +class TestSerializableClass { + constructor(public a: string, public b: () => RegExp) { } + foo(): boolean { return false } +} + +interface TestSerializableInterface { + a: string + foo(): boolean +} + +type TestSerializableType = { + a: string + foo(): boolean +} + +class TestSerializableClassPrivateNonSerializableMembers { + constructor(public a: string, private b: RegExp, private readonly c : RegExp) { } +} + +class TestNonSerializableClass { + constructor(public a: RegExp) { } +} + + +interface TestNonSerializableInterface { + a: RegExp +} + +type TestNonSerializableType = { + a: RegExp +} + +function verifyType(isType: TypeVerifier): boolean { + return isType +} \ No newline at end of file diff --git a/src/sdk/utils/values/serializer_types.ts b/src/sdk/utils/values/serializer_types.ts new file mode 100644 index 00000000..b76e38fe --- /dev/null +++ b/src/sdk/utils/values/serializer_types.ts @@ -0,0 +1,32 @@ +import type { Decimal, Int64, UInt64 } from "./value" + +export type NumericType = number | bigint | Date | Decimal | Int64 | UInt64 +export type PrimitiveTypes = NumericType | boolean | string +export type NonSerializable = null | Map | Set | RegExp | Int8Array + +export type CreSerializableNested = + T extends PrimitiveTypes ? + T + : T extends Function ? + T + : T extends NonSerializable ? + never + : T extends any[] ? + CreSerializableNested[] + : T extends object ? + { [K in keyof T]: CreSerializableNested } + : never + +export type CreSerializable = T extends PrimitiveTypes? + T + : T extends Function? +never +: T extends NonSerializable? +never : +T extends any[]? +CreSerializableNested[] + : T extends object? +{ [K in keyof T]: CreSerializableNested } +: never + +export type TypeVerifier = T extends U ? true : false diff --git a/src/sdk/utils/values/value.test.ts b/src/sdk/utils/values/value.test.ts index 137df03a..309678ac 100644 --- a/src/sdk/utils/values/value.test.ts +++ b/src/sdk/utils/values/value.test.ts @@ -1,14 +1,12 @@ import { describe, expect, test } from 'bun:test' import type { Value as ProtoValue } from '@cre/generated/values/v1/values_pb' -import { - ValueSchema, - BigIntSchema, - MapSchema, - ListSchema, - DecimalSchema, -} from '@cre/generated/values/v1/values_pb' -import { Value } from './value' -import { timestampDate, TimestampSchema, FieldMaskSchema } from '@bufbuild/protobuf/wkt' +import { ValueSchema, BigIntSchema, MapSchema, ListSchema, DecimalSchema } from '@cre/generated/values/v1/values_pb' +import { Decimal, Int64, UInt64, Value } from './value' +import { + timestampDate, + TimestampSchema, + FieldMaskSchema +} from '@bufbuild/protobuf/wkt' import { create } from '@bufbuild/protobuf' const bytesToBigIntBE = (bytes: Uint8Array): bigint => { @@ -23,261 +21,282 @@ const expectProto = (actual: ProtoValue, expected: NonNullable) => { - expectProto(actual.proto, expected) + expectProto(actual.proto(), expected) expect(actual.unwrap()).toEqual(expected.value) } -function expectCase< - C extends NonNullable, - V = Extract, { case: C }>['value'], ->(actual: ProtoValue, expectedCase: C): V { - expect(actual.value).toBeDefined() - expect(actual.value.case).toBe(expectedCase) - return actual.value.value as V +function expectCase, V = Extract, { case: C }>['value']>( + actual: ProtoValue, + expectedCase: C +): V { + expect(actual.value).toBeDefined() + expect(actual.value.case).toBe(expectedCase) + return actual.value.value as V } describe('val helpers', () => { test('another value', () => { - const val = new Value('10') - const val2 = new Value(val) + const val = Value.from("10") + const val2 = Value.from(val) expect(val).toEqual(val2) }) test('nested value', () => { - const val = new Value(10) - const val2 = new Value({ foo: 99, val: val }) - expectProto(val2.proto, { - case: 'mapValue', - value: create(MapSchema, { - fields: { - foo: create(ValueSchema, { value: { case: 'float64Value', value: 99 } }), - val: create(ValueSchema, { value: { case: 'float64Value', value: 10 } }), - }, - }), - }) + const val = Value.from(10) + const val2 = Value.from({ foo: 99, val: val }) + expectProto(val2.proto(), { + case: 'mapValue', + value: create(MapSchema, { + fields: { + 'foo': create(ValueSchema, { value: { case: 'float64Value', value: 99 } }), + 'val': create(ValueSchema, { value: { case: 'float64Value', value: 10 } }) + } + }) + }) }) describe('protos directly', () => { type ValueCase = NonNullable['case']> - - type AllTests = { [K in ValueCase]: { proto: ProtoValue; expected: any } } + + type AllTests = { [K in ValueCase]: {proto: ProtoValue, expected: any} } const allCases: AllTests = { - stringValue: { + 'stringValue': { proto: create(ValueSchema, { - value: { case: 'stringValue', value: 'hello' }, + value: { case: 'stringValue', value: 'hello' } }), - expected: 'hello', + expected: 'hello' }, - boolValue: { + 'boolValue': { proto: create(ValueSchema, { - value: { case: 'boolValue', value: true }, + value: { case: 'boolValue', value: true } }), - expected: true, + expected: true }, - bytesValue: { + 'bytesValue': { proto: create(ValueSchema, { - value: { case: 'bytesValue', value: new Uint8Array([1, 2, 3]) }, + value: { case: 'bytesValue', value: new Uint8Array([1, 2, 3]) } }), - expected: new Uint8Array([1, 2, 3]), + expected: new Uint8Array([1, 2, 3]) }, - float64Value: { + 'float64Value': { proto: create(ValueSchema, { - value: { case: 'float64Value', value: 3.14159 }, + value: { case: 'float64Value', value: 3.14159 } }), - expected: 3.14159, + expected: 3.14159 }, - int64Value: { + 'int64Value': { proto: create(ValueSchema, { - value: { case: 'int64Value', value: 42n }, + value: { case: 'int64Value', value: 42n } }), - expected: 42n, + expected: new Int64(42n) }, - uint64Value: { + 'uint64Value': { proto: create(ValueSchema, { - value: { case: 'uint64Value', value: 42n }, + value: { case: 'uint64Value', value: 42n } }), - expected: 42n, + expected: new UInt64(42n) }, - timeValue: { + 'timeValue': { proto: create(ValueSchema, { - value: { - case: 'timeValue', - value: create(TimestampSchema, { - seconds: 1700000123n, - nanos: 456000000, - }), - }, + value: { + case: 'timeValue', + value: create(TimestampSchema, { + seconds: 1700000123n, + nanos: 456000000 + }) + } }), expected: new Date(1700000123456), }, - bigintValue: { + 'bigintValue': { proto: create(ValueSchema, { - value: { - case: 'bigintValue', + value: { + case: 'bigintValue', value: create(BigIntSchema, { absVal: new Uint8Array([0x01, 0x23, 0x45, 0x67, 0x89]), - sign: 1n, - }), - }, + sign: 1n + }) + } }), - expected: 0x0123456789n, + expected: 0x0123456789n }, - listValue: { + 'listValue': { proto: create(ValueSchema, { - value: { - case: 'listValue', + value: { + case: 'listValue', value: create(ListSchema, { fields: [ create(ValueSchema, { value: { case: 'stringValue', value: 'item1' } }), - create(ValueSchema, { value: { case: 'float64Value', value: 2.5 } }), - ], - }), - }, + create(ValueSchema, { value: { case: 'float64Value', value: 2.5 } }) + ] + }) + } }), - expected: ['item1', 2.5], + expected: ['item1', 2.5] }, - mapValue: { + 'mapValue': { proto: create(ValueSchema, { - value: { - case: 'mapValue', + value: { + case: 'mapValue', value: create(MapSchema, { fields: { - key1: create(ValueSchema, { value: { case: 'stringValue', value: 'value1' } }), - key2: create(ValueSchema, { value: { case: 'float64Value', value: 2.5 } }), - }, - }), - }, + 'key1': create(ValueSchema, { value: { case: 'stringValue', value: 'value1' } }), + 'key2': create(ValueSchema, { value: { case: 'float64Value', value: 2.5 } }) + } + }) + } }), - expected: { key1: 'value1', key2: 2.5 }, + expected: { key1: 'value1', key2: 2.5 } }, - decimalValue: { + 'decimalValue': { proto: create(ValueSchema, { - value: { - case: 'decimalValue', + value: { + case: 'decimalValue', value: create(DecimalSchema, { coefficient: create(BigIntSchema, { absVal: new Uint8Array([0x04, 0xd2]), // 1234 in big-endian - sign: 1n, + sign: 1n }), - exponent: -2, - }), - }, + exponent: -2 + }) + } }), - expected: '12.34', - }, + expected: new Decimal(1234n, -2) + } } - + const possibleCases = Object.keys(allCases) as ValueCase[] - possibleCases.forEach((caseType) => { + possibleCases.forEach(caseType => { const testCase = allCases[caseType] test(`handles ${caseType} correctly`, () => { - var val = new Value(testCase.proto) - - expect(val.proto.value).toBeDefined() - expect(val.proto.value!.case).toBe(caseType) - + var val = Value.wrap(testCase.proto) + + expect(val.proto().value).toBeDefined() + expect(val.proto().value!.case).toBe(caseType) + expect(val.unwrap()).toEqual(testCase.expected) }) }) }) test('string', () => { - expectValue(new Value('hello'), { case: 'stringValue', value: 'hello' }) + expectValue(Value.from('hello'), { case: 'stringValue', value: 'hello'}) }) test('bool', () => { - const val = new Value(true) - expectValue(new Value(true), { case: 'boolValue', value: true }) + const val = Value.from(true) + expectValue(Value.from(true), { case: 'boolValue', value: true}) }) test('bytes Uint8Array', () => { const data = new Uint8Array([1, 2, 3]) - const val = new Value(data) + const val = Value.from(data) expectValue(val, { case: 'bytesValue', value: new Uint8Array([1, 2, 3]) }) }) test('bytes ArrayBuffer', () => { const ab = new Uint8Array([1, 2, 3]) - const val = new Value(ab.buffer) + const val = Value.from(ab.buffer) expectValue(val, { case: 'bytesValue', value: new Uint8Array([1, 2, 3]) }) }) + + // Use expectProto instead and verify against the int64 etc test('int64 from number', () => { - expectValue(Value.int64(42), { case: 'int64Value', value: 42n }) + const val = Value.from(new Int64(42)) + const pb = expectCase(val.proto(), 'int64Value') + expect(pb).toBe(42n) + expect(val.unwrap()).toEqual(new Int64(42)) }) test('int64 from bigint within range', () => { - expectValue(Value.int64(123n), { case: 'int64Value', value: 123n }) + const val = Value.from(new Int64(123n)) + const pb = expectCase(val.proto(), 'int64Value') + expect(pb).toBe(123n) + expect(val.unwrap()).toEqual(new Int64(123n)) }) test('int64 throws on non-integer number', () => { - expect(() => Value.int64(1.5)).toThrow() + expect(() => new Int64(1.5)).toThrow() }) test('int64 overflow throws (number)', () => { // larger than int64 max const tooBig = Number(2n ** 63n) expect(Number.isFinite(tooBig)).toBe(true) - expect(() => Value.int64(tooBig)).toThrow() + expect(() => new Int64(tooBig)).toThrow() }) test('int64 underflow throws (number)', () => { // smaller than int64 min const tooSmall = Number(-(2n ** 64n)) expect(Number.isFinite(tooSmall)).toBe(true) - expect(() => Value.int64(tooSmall)).toThrow() + expect(() => new Int64(tooSmall)).toThrow() }) test('int64 from string ', () => { - expectValue(Value.int64('-42'), { case: 'int64Value', value: -42n }) + const val = Value.from(new Int64('-42')) + const pb = expectCase(val.proto(), 'int64Value') + expect(pb).toBe(-42n) + expect(val.unwrap()).toEqual(new Int64(-42)) }) + test('uint64 from number', () => { - expectValue(Value.uint64(42), { case: 'uint64Value', value: 42n }) + const val = Value.from(new UInt64(42)) + const pb = expectCase(val.proto(), 'uint64Value') + expect(pb).toBe(42n) + expect(val.unwrap()).toEqual(new UInt64(42)) }) test('uint64 from bigint within range', () => { - expectValue(Value.uint64(123n), { case: 'uint64Value', value: 123n }) + const val = Value.from(new UInt64(123n)) + const pb = expectCase(val.proto(), 'uint64Value') + expect(pb).toBe(123n) + expect(val.unwrap()).toEqual(new UInt64(123n)) }) test('uint64 throws on non-integer number', () => { - expect(() => Value.uint64(1.5)).toThrow() + expect(() => new UInt64(1.5)).toThrow() }) test('uint64 overflow throws (number)', () => { // larger than uint64 max const tooBig = Number(2n ** 64n) expect(Number.isFinite(tooBig)).toBe(true) - expect(() => Value.uint64(tooBig)).toThrow() + expect(() => new UInt64(tooBig)).toThrow() }) test('uint64 underflow throws (number)', () => { // larger than uint64 min const tooSmall = Number(-1) expect(Number.isFinite(tooSmall)).toBe(true) - expect(() => Value.uint64(tooSmall)).toThrow() + expect(() => new UInt64(tooSmall)).toThrow() }) test('uint64 from string ', () => { - expectValue(Value.uint64('42'), { case: 'uint64Value', value: 42n }) + const val = Value.from(new UInt64('42')) + const pb = expectCase(val.proto(), 'uint64Value') + expect(pb).toBe(42n) + expect(val.unwrap()).toEqual(new UInt64(42n)) }) test('float64', () => { // safe, since the any rounding would occur before the nubmer is a float // this does a copy without math - expectValue(new Value(3.14), { case: 'float64Value', value: 3.14 }) + expectValue(Value.from(3.14), {case: 'float64Value', value: 3.14}) }) test('float64 supports NaN and Infinity', () => { - const nan = new Value(NaN) - var value = expectCase(nan.proto, 'float64Value') + const nan = Value.from(NaN) + var value = expectCase(nan.proto(), 'float64Value') expect(Number.isNaN(value)).toBe(true) const unwrappedNaN = nan.unwrap() expect(Number.isNaN(unwrappedNaN)).toBe(true) - const inf = new Value(Infinity) - var value = expectCase(inf.proto, 'float64Value') + const inf = Value.from(Infinity) + var value = expectCase(inf.proto(), 'float64Value') expect(Number.isFinite(value)).toBe(false) const unwrappedInf = inf.unwrap() expect(Number.isFinite(unwrappedInf)).toBe(false) @@ -285,9 +304,9 @@ describe('val helpers', () => { test('bigint encodes sign and abs bytes', () => { const big = -123456789012345678901234567890n - const val = new Value(big) - - const pb = expectCase(val.proto, 'bigintValue') + const val = Value.from(big) + + const pb = expectCase(val.proto(), 'bigintValue') expect(pb.sign).toBe(-1n) const abs = bytesToBigIntBE(pb.absVal) expect(abs).toBe(-big) @@ -298,9 +317,9 @@ describe('val helpers', () => { test('time from Date', () => { const d = new Date(1700000123456) - const val = new Value(d) + const val = Value.from(d) - const ts = expectCase(val.proto, 'timeValue') + const ts = expectCase(val.proto(), 'timeValue') expect(timestampDate(ts)).toEqual(d) const unwrapped = val.unwrap() @@ -309,78 +328,48 @@ describe('val helpers', () => { test('list', () => { const items = [1, 'x', true] - const val = new Value(items) + const val = Value.from(items) - const protoItems = expectCase(val.proto, 'listValue').fields + const protoItems = expectCase(val.proto(), 'listValue').fields expect(protoItems).toHaveLength(3) expectProto(protoItems[0], { case: 'float64Value', value: 1 }) expectProto(protoItems[1], { case: 'stringValue', value: 'x' }) expectProto(protoItems[2], { case: 'boolValue', value: true }) - + const unwrapped = val.unwrap() expect(unwrapped).toEqual(items) }) test('list empty', () => { - const val = new Value([]) + const val = Value.from([]) - const protoItems = expectCase(val.proto, 'listValue').fields + const protoItems = expectCase(val.proto(), 'listValue').fields expect(protoItems).toHaveLength(0) }) test('map', () => { - const inputMap = { d: 1.25, s: 'ok' } - const val = new Value(inputMap) - - const m = expectCase(val.proto, 'mapValue').fields + const inputMap = {d: 1.25, s: 'ok' } + const val = Value.from(inputMap) + + const m = expectCase(val.proto(), 'mapValue').fields expect(Object.keys(m)).toHaveLength(2) expectProto(m['d'], { case: 'float64Value', value: 1.25 }) - expectProto(m['s'], { case: 'stringValue', value: 'ok' }) + expectProto(m['s'], {case: 'stringValue', value: "ok"}) expect(val.unwrap()).toEqual(inputMap) }) test('map empty', () => { - const val = new Value({}) - - const m = expectCase(val.proto, 'mapValue').fields + const val = Value.from({}) + + const m = expectCase(val.proto(), 'mapValue').fields expect(Object.keys(m)).toHaveLength(0) const unwrapped = val.unwrap() as Record expect(Object.keys(unwrapped)).toHaveLength(0) }) - test('from objec', () => { - class Test { - constructor( - public i: number, - public s: string, - ) {} - getI(): number { - return this.i - } - } - - const inputObject = new Test(123, 'abc') - const val = new Value(inputObject) - - const fields = expectCase(val.proto, 'mapValue').fields - expect(Object.keys(fields)).toHaveLength(2) - expectProto(fields['i'], { case: 'float64Value', value: 123 }) - expectProto(fields['s'], { case: 'stringValue', value: 'abc' }) - - const rawUnwrapped = val.unwrap() - expect(rawUnwrapped).toEqual({ i: 123, s: 'abc' }) - - const unwrappedObject = val.unwrapToType({ - factory: () => new Test(0, ''), - }) - expect(unwrappedObject).toEqual(inputObject) - expect(unwrappedObject).toBeInstanceOf(Test) - expect(unwrappedObject.getI()).toEqual(123) - }) - test('from object with schema', () => { var schemaCalled = false const personSchema = { @@ -389,19 +378,19 @@ describe('val helpers', () => { if (typeof value !== 'object' || value === null) { throw new Error('Expected an object') } - + const v = value as any if (typeof v.name !== 'string' || typeof v.age !== 'number') { throw new Error('Invalid person schema') } - + return { name: v.name, age: v.age } - }, + } } - + const person = { name: 'Alice', age: 30 } - const val = new Value(person) - + const val = Value.from(person) + // Test unwrapToType with schema const unwrapped = val.unwrapToType({ schema: personSchema }) expect(unwrapped).toEqual(person) @@ -410,32 +399,33 @@ describe('val helpers', () => { test('from object with constructor', () => { class Test { - constructor( - public i: number, - public s: string, - ) {} - getI(): number { + public i: number = 0 + public s: string = "" + constructor() { } + getI() : number { return this.i } } - const inputObject = new Test(123, 'abc') - const val = new Value(inputObject) + const inputObject = new Test() + inputObject.i = 123 + inputObject.s = "abc" + const val = Value.from(inputObject) - const fields = expectCase(val.proto, 'mapValue').fields + const fields = expectCase(val.proto(), 'mapValue').fields expect(Object.keys(fields)).toHaveLength(2) expectProto(fields['i'], { case: 'float64Value', value: 123 }) - expectProto(fields['s'], { case: 'stringValue', value: 'abc' }) - + expectProto(fields['s'], { case: 'stringValue', value: "abc" }) + const rawUnwrapped = val.unwrap() - expect(rawUnwrapped).toEqual({ i: 123, s: 'abc' }) + expect(rawUnwrapped).toEqual({i: 123, s: "abc"}) var factoryCalled = false const unwrappedObject = val.unwrapToType({ factory: () => { factoryCalled = true - return new Test(0, '') - }, + return new Test() + } }) expect(unwrappedObject).toEqual(inputObject) expect(unwrappedObject).toBeInstanceOf(Test) @@ -443,91 +433,87 @@ describe('val helpers', () => { expect(factoryCalled).toBe(true) }) - test('from unsupported object instances throw (Set, Map, Int8Array)', () => { - expect(() => new Value(new Set([1, 2]))).toThrow() - expect(() => new Value(new Map([['a', 1]]))).toThrow() - expect(() => new Value(new Int8Array([1, 2]))).toThrow() - }) - test('decimal normalization and structure', () => { - const val = Value.decimal('15.2300') - const d = expectCase(val.proto, 'decimalValue') - + const val = Value.from(Decimal.parse('15.2300')) + const d = expectCase(val.proto(), 'decimalValue') + expect(d.exponent).toBe(-2) // coefficient should be 1523 (sign + digits) const coeffAbs = bytesToBigIntBE(d.coefficient!.absVal) expect(d.coefficient!.sign).toBe(1n) expect(coeffAbs).toBe(1523n) + const unwrapped = val.unwrap() - expect(unwrapped).toEqual('15.23') + expect(unwrapped).toEqual(new Decimal(1523n, -2)) }) test('decimal negative and integer only', () => { - const val = Value.decimal('-123.4500') - - const d = expectCase(val.proto, 'decimalValue') + const val = Value.from(Decimal.parse('-123.4500')) + + const d = expectCase(val.proto(), 'decimalValue') expect(d.exponent).toBe(-2) expect(d.coefficient!.sign).toBe(-1n) const coeffAbs = bytesToBigIntBE(d.coefficient!.absVal) expect(coeffAbs).toBe(12345n) const unwrapped = val.unwrap() - expect(unwrapped).toEqual('-123.45') + expect(unwrapped).toEqual(new Decimal(-12345n, -2)) const intString = '42' - const i = Value.decimal(intString) + const i = Value.from(Decimal.parse(intString)) - const id = expectCase(i.proto, 'decimalValue') + const id = expectCase(i.proto(), 'decimalValue') expect(id.exponent).toBe(0) expect(bytesToBigIntBE(id.coefficient!.absVal)).toBe(42n) const iunwrapped = i.unwrap() - expect(iunwrapped).toEqual(intString) + expect(iunwrapped).toEqual(new Decimal(42n, 0)) }) test('decimal invalid strings throw', () => { - expect(() => Value.decimal('abc')).toThrow() - expect(() => Value.decimal('1.')).toThrow() - expect(() => Value.decimal('.5')).toThrow() + expect(() => Value.from(Decimal.parse('abc'))).toThrow() + expect(() => Value.from(Decimal.parse('1.'))).toThrow() + expect(() => Value.from(Decimal.parse('.5'))).toThrow() }) test('from throws on null/undefined', () => { - expect(() => new Value(null as unknown as string)).toThrow() - expect(() => new Value(undefined as unknown as string)).toThrow() + expect(() => Value.from(null as unknown as string)).toThrow() + expect(() => Value.from(undefined as unknown as string)).toThrow() }) test('non value protos', () => { // An proto that isn't related to values const fieldMask = create(FieldMaskSchema, { - paths: ['user.displayName', 'user.email', 'posts.*.title'], + paths: ['user.displayName', 'user.email', 'posts.*.title'] }) - - const val = new Value(fieldMask) - - const mapValue = expectCase(val.proto, 'mapValue').fields + + const val = Value.from(fieldMask) + + const mapValue = expectCase(val.proto(), 'mapValue').fields expect(Object.keys(mapValue)).toContain('$typeName') expect(Object.keys(mapValue)).toContain('paths') - + // Check that the typeName was preserved expectProto(mapValue['$typeName'], { case: 'stringValue', value: 'google.protobuf.FieldMask' }) - + const pathsList = expectCase(mapValue['paths'], 'listValue').fields expect(pathsList).toHaveLength(3) expectProto(pathsList[0], { case: 'stringValue', value: 'user.displayName' }) expectProto(pathsList[1], { case: 'stringValue', value: 'user.email' }) expectProto(pathsList[2], { case: 'stringValue', value: 'posts.*.title' }) - + // Test unwrap to plain object const unwrapped = val.unwrap() as Record expect(unwrapped.$typeName).toBe('google.protobuf.FieldMask') expect(Array.isArray(unwrapped.paths)).toBe(true) expect(unwrapped.paths).toEqual(['user.displayName', 'user.email', 'posts.*.title']) - + + const directProto = val.unwrapToType({ - factory: () => create(FieldMaskSchema), + factory: () => create(FieldMaskSchema) }) - + // Verify this approach also works expect(directProto.$typeName).toBe('google.protobuf.FieldMask') expect(directProto.paths).toEqual(['user.displayName', 'user.email', 'posts.*.title']) diff --git a/src/sdk/utils/values/value.ts b/src/sdk/utils/values/value.ts index 4907bbcb..e14cf990 100644 --- a/src/sdk/utils/values/value.ts +++ b/src/sdk/utils/values/value.ts @@ -15,65 +15,118 @@ import { DecimalSchema, } from '@cre/generated/values/v1/values_pb' -export type SupportedValueTypes = - | 'string' - | 'bool' - | 'bytes' - | 'int64' - | 'uint64' - | 'float64' - | 'bigint' - | 'time' - | 'list' - | 'map' - | 'decimal' +import type { CreSerializable } from "./serializer_types" /** * Type that can validate a value and return a typed result. * Compatible with Zod schemas, Yup validators, and other similar libraries. */ export interface SchemaValidator { - parse(value: unknown): T + parse(value: unknown): T } /** * Options for the unwrapToType function - either use a schema validator OR a factory function, not both. */ -export type UnwrapOptions = +export type UnwrapOptions = | { schema: SchemaValidator; factory?: never } | { schema?: never; factory: () => T } -export class Value { - private readonly value: ProtoValue - +export class Int64 { // int64 bounds - private static readonly INT64_MIN = -(2n ** 63n) - private static readonly INT64_MAX = 2n ** 63n - 1n - private static readonly UINT64_MAX = 2n ** 64n - 1n - - // int64 craetes a Value wrapping an int64 value. - // This can be used to communicate with other languages, as TypeScript doesn't have built-int 64 bit integer types - public static int64(n: number | bigint | string): Value { - return new Value( - create(ValueSchema, { - value: { case: 'int64Value', value: Value.toInt64Bigint(n) }, - }), - ) + static readonly INT64_MIN = -(2n ** 63n) + static readonly INT64_MAX = 2n ** 63n - 1n + + public readonly value: bigint + + public static toInt64Bigint(v: number | bigint | string): bigint { + if (typeof v === 'string') { + const bi: bigint = BigInt(v) + return Int64.toInt64Bigint(bi) + } + + if (typeof v === 'bigint') { + if (v > Int64.INT64_MAX) throw new Error('int64 overflow') + else if (v < Int64.INT64_MIN) throw new Error('int64 underflow') + return v + } + + if (!Number.isFinite(v) || !Number.isInteger(v)) + throw new Error('int64 requires an integer number') + + const bi = BigInt(v) + if (bi > Int64.INT64_MAX) throw new Error('int64 overflow') + else if (bi < Int64.INT64_MIN) throw new Error('int64 underflow') + return bi + } + + public constructor(v: number | bigint | string) { + this.value = Int64.toInt64Bigint(v) + } + + public add(i: Int64, safe: boolean = true): Int64 { + return safe ? new Int64(this.value + i.value) : new Int64(BigInt.asIntN(64, this.value + i.value)) } - // uint64 craetes a Value wrapping an uint64 value. - // This can be used to communicate with other languages, as TypeScript doesn't have built-int 64 bit integer types. - public static uint64(n: number | bigint | string): Value { - return new Value( - create(ValueSchema, { - value: { case: 'uint64Value', value: Value.toUint64Bigint(n) }, - }), - ) + public sub(i: Int64, safe: boolean = true): Int64 { + return safe ? new Int64(this.value - i.value) : new Int64(BigInt.asIntN(64, this.value - i.value)) } + + public mul(i: Int64, safe: boolean = true): Int64 { + return safe ? new Int64(this.value * i.value) : new Int64(BigInt.asIntN(64, this.value * i.value)) + } + + public div(i: Int64, safe: boolean = true): Int64 { + return new Int64(this.value / i.value) + } +} - // decimal creates a Value wrapping of a decimal. - // This can be used to communicate with other languages, as TypeScript doesn't have built-int decimal type. - public static decimal(s: string): Value { +export class UInt64 { + static readonly UINT64_MAX = 2n ** 64n - 1n + public readonly value: bigint + + public static toUint64Bigint(v: number | bigint | string): bigint { + if (typeof v === 'string') { + const bi: bigint = BigInt(v) + return UInt64.toUint64Bigint(bi) + } + if (typeof v === 'bigint') { + if (v > UInt64.UINT64_MAX) throw new Error('uint64 overflow') + else if (v < 0n) throw new Error('uint64 underflow') + return v + } + + if (!Number.isFinite(v) || !Number.isInteger(v)) + throw new Error('int64 requires an integer number') + const bi = BigInt(v) + if (bi > UInt64.UINT64_MAX) throw new Error('uint64 overflow') + else if (bi < 0n) throw new Error('uint64 underflow') + return bi + } + + public constructor(v: number | bigint | string) { + this.value = UInt64.toUint64Bigint(v) + } + + public add(i: UInt64, safe: boolean = true): UInt64 { + return safe ? new UInt64(this.value + i.value) : new UInt64(BigInt.asUintN(64, this.value + i.value)) + } + + public sub(i: UInt64, safe: boolean = true): UInt64 { + return safe ? new UInt64(this.value - i.value) : new UInt64(BigInt.asUintN(64, this.value - i.value)) + } + + public mul(i: UInt64, safe: boolean = true): UInt64 { + return safe ? new UInt64(this.value * i.value) : new UInt64(BigInt.asUintN(64, this.value * i.value)) + } + + public div(i: UInt64, safe: boolean = true): UInt64 { + return new UInt64(this.value / i.value) + } +} + +export class Decimal { + public static parse(s: string): Decimal { // Parse decimal string into coefficient (bigint) and exponent (int32) const m = /^([+-])?(\d+)(?:\.(\d+))?$/.exec(s.trim()) if (!m) throw new Error('invalid decimal string') @@ -82,22 +135,26 @@ export class Value { let fracPart = m[3] ?? '' // remove trailing zeros in fractional part to normalize fracPart = fracPart.replace(/0+$/g, '') - const exp = fracPart.length === 0 ? 0 : -fracPart.length + const exponent = fracPart.length === 0 ? 0 : -fracPart.length const digits = intPart + fracPart || '0' - const coeff = BigInt((signStr === '-' ? '-' : '') + digits) - const decimal: ProtoDecimal = create(DecimalSchema, { - coefficient: Value.bigIntToProtoBigInt(coeff), - exponent: exp, - }) + const coeffecient = BigInt((signStr === '-' ? '-' : '') + digits) + return new Decimal(coeffecient, exponent) + } + constructor(public readonly coeffecient: bigint, public readonly exponent: number) {} +} + +export class Value { + private readonly value: ProtoValue + + public static from(value: CreSerializable): Value { + return new Value(value) + } - return new Value( - create(ValueSchema, { - value: { case: 'decimalValue', value: decimal }, - }), - ) + public static wrap(value: ProtoValue): Value { + return new Value(value) } - constructor(value: any) { + private constructor(value: any) { if (value instanceof Value) { this.value = value.value } else if (isValueProto(value)) { @@ -106,11 +163,11 @@ export class Value { this.value = Value.wrapInternal(value) } } - - get proto(): ProtoValue { + + proto(): ProtoValue { return this.value } - + private static toUint8Array(input: Uint8Array | ArrayBuffer): Uint8Array { return input instanceof Uint8Array ? input : new Uint8Array(input) } @@ -125,7 +182,7 @@ export class Value { if (hex.length % 2 === 1) hex = '0' + hex const len = hex.length / 2 const out = new Uint8Array(len) - for (let i = 0; i < len; i++) { + for (let i = 0; i Value.INT64_MAX) throw new Error('int64 overflow') - else if (v < Value.INT64_MIN) throw new Error('int64 underflow') - return v - } - - if (!Number.isFinite(v) || !Number.isInteger(v)) - throw new Error('int64 requires an integer number') - const bi = BigInt(v) - if (bi > Value.INT64_MAX) throw new Error('int64 overflow') - else if (bi < Value.INT64_MIN) throw new Error('int64 underflow') - return bi - } - - private static toUint64Bigint(v: number | bigint | string): bigint { - if (typeof v === 'string') { - const bi: bigint = BigInt(v) - return Value.toUint64Bigint(bi) - } - if (typeof v === 'bigint') { - if (v > Value.UINT64_MAX) throw new Error('uint64 overflow') - else if (v < 0n) throw new Error('uint64 underflow') - return v - } - - if (!Number.isFinite(v) || !Number.isInteger(v)) - throw new Error('int64 requires an integer number') - const bi = BigInt(v) - if (bi > Value.UINT64_MAX) throw new Error('uint64 overflow') - else if (bi < 0n) throw new Error('uint64 underflow') - return bi - } - private static toTimestamp(d: Date | number | string): Timestamp { const date = d instanceof Date ? d : new Date(d) return timestampFromDate(date) @@ -189,7 +208,7 @@ export class Value { private static isPlainObject(v: unknown): v is Record { return typeof v === 'object' && v !== null && v.constructor === Object } - + private static isObject(v: unknown): v is Record { return typeof v === 'object' && v !== null } @@ -197,23 +216,40 @@ export class Value { private static wrapInternal(v: unknown): ProtoValue { // null/undefined not supported by Value oneof if (v === null || v === undefined) throw new Error('cannot wrap null/undefined into Value') - + if (v instanceof Value) { - return v.proto + return v.proto() } - if (v instanceof Uint8Array) + if (v instanceof Uint8Array) return create(ValueSchema, { value: { case: 'bytesValue', value: v } }) + if (v instanceof ArrayBuffer) return create(ValueSchema, { value: { case: 'bytesValue', value: Value.toUint8Array(v) }, }) - + if (v instanceof Date) return create(ValueSchema, { value: { case: 'timeValue', value: Value.toTimestamp(v) }, }) + if (v instanceof Int64) { + return create(ValueSchema, { value: { case: 'int64Value', value: v.value } }) + } + + if (v instanceof UInt64) { + return create(ValueSchema, { value: { case: 'uint64Value', value: v.value } }) + } + + if (v instanceof Decimal) { + const decimalProto: ProtoDecimal = create(DecimalSchema, { + coefficient: Value.bigIntToProtoBigInt(v.coeffecient), + exponent: v.exponent, + }) + return create(ValueSchema, { value: { case: 'decimalValue', value: decimalProto } }) + } + switch (typeof v) { case 'string': return create(ValueSchema, { value: { case: 'stringValue', value: v } }) @@ -233,6 +269,7 @@ export class Value { throw new Error(`unsupported type: ${typeof v}`) } + if (Array.isArray(v)) { const fields = v.map(Value.wrapInternal) const list: ProtoList = create(ListSchema, { fields }) @@ -247,14 +284,9 @@ export class Value { const map: ProtoMap = create(MapSchema, { fields }) return create(ValueSchema, { value: { case: 'mapValue', value: map } }) } - - // TODO why? + + if (Value.isObject(v) && v.constructor !== Object) { - // Check for unsupported types specifically - if (v instanceof Set || v instanceof Map || v instanceof Int8Array) { - throw new Error('unsupported object instance') - } - const fields: Record = {} for (const [k, vv] of Object.entries(v)) { fields[k] = Value.wrapInternal(vv) @@ -265,97 +297,85 @@ export class Value { throw new Error('unsupported object instance') } - + // Instance methods for unwrapping unwrap(): unknown { return unwrap(this.value) } - - /** - * Unwraps a Value object into its native JavaScript equivalent and casts it to type T. - * If the value is null or undefined, throws an exception. - * - * @param options - Either a schema validator or a factory function (but not both) - * @returns The unwrapped JavaScript value cast to type T - * @throws Error if value is null, undefined, contains an invalid case, or fails schema validation - */ - unwrapToType(options?: UnwrapOptions): T { - const unwrapped = this.unwrap() - - if (!options) { - return unwrapped as T - } - - // Apply schema validation if provided - if (options.schema) { - return options.schema.parse(unwrapped) - } - - // Apply factory function if provided (preserves methods) - if (options.factory) { - const instance = options.factory() - - // Copy properties from unwrapped to the instance - if (typeof unwrapped === 'object' && unwrapped !== null) { - // Use Object.assign for more efficient property copying - Object.assign(instance as object, unwrapped) - } else { - // For primitive types, this won't work well - throw new Error( - `Cannot copy properties from primitive value to object instance. Use a schema instead.`, - ) - } - - return instance - } - - return unwrapped as T + +/** + * Unwraps a Value object into its native JavaScript equivalent and casts it to type T. + * If the value is null or undefined, throws an exception. + * + * @param options - Either a schema validator or a factory function (but not both) + * @returns The unwrapped JavaScript value cast to type T + * @throws Error if value is null, undefined, contains an invalid case, or fails schema validation + */ + unwrapToType(options: UnwrapOptions): T { + const unwrapped = this.unwrap() + + if (options.schema) { + return options.schema.parse(unwrapped) + } + + + const instance = options.factory() + + if (typeof unwrapped === 'object' && unwrapped !== null) { + // Use Object.assign for more efficient property copying + Object.assign(instance as object, unwrapped) + } else { + throw new Error(`Cannot copy properties from primitive value to object instance. Use a schema instead.`) } + + return instance +} } + /** * Unwraps a Value object into its native JavaScript equivalent. * If the value is null or undefined, throws an exception. - * + * * @param value - The Value object to unwrap * @returns The unwrapped JavaScript value * @throws Error if value is null, undefined, or contains an invalid case */ function unwrap(value: ProtoValue): unknown { switch (value.value.case) { - case 'stringValue': - return value.value.value - case 'boolValue': + case "stringValue": return value.value.value - case 'bytesValue': + case "boolValue": return value.value.value - case 'int64Value': + case "bytesValue": return value.value.value - case 'uint64Value': + case "int64Value": + return new Int64(value.value.value) + case "uint64Value": + return new UInt64(value.value.value) + case "float64Value": return value.value.value - case 'float64Value': - return value.value.value - case 'bigintValue': { + case "bigintValue": { const bigIntValue = value.value.value const absVal = bigIntValue.absVal const sign = bigIntValue.sign - + // Convert bytes to bigint let result = 0n for (const byte of absVal) { result = (result << 8n) | BigInt(byte) } - + return sign < 0n ? -result : result } - case 'timeValue': { + case "timeValue": { return timestampDate(value.value.value) } - case 'listValue': { + case "listValue": { const list = value.value.value return list.fields.map(unwrap) } - case 'mapValue': { + case "mapValue": { const map = value.value.value const result: Record = {} for (const [key, val] of Object.entries(map.fields)) { @@ -363,64 +383,35 @@ function unwrap(value: ProtoValue): unknown { } return result } - case 'decimalValue': { + case "decimalValue": { + const decimal = value.value.value const coefficient = decimal.coefficient const exponent = decimal.exponent - if (!coefficient) { - return '0' + return new Decimal(0n, 0) } - + // Convert coefficient to bigint let coeffBigInt: bigint const absVal = coefficient.absVal const sign = coefficient.sign - + // Convert bytes to bigint let result = 0n for (const byte of absVal) { result = (result << 8n) | BigInt(byte) } - + coeffBigInt = sign < 0n ? -result : result - - if (exponent === 0) { - return coeffBigInt.toString() - } - - // Handle decimal point placement - if (exponent < 0) { - const coeffStr = coeffBigInt.toString().replace('-', '') - const isNegative = coeffBigInt < 0n - const absExp = Math.abs(exponent) - - if (coeffStr.length <= absExp) { - // Need leading zeros - const zeros = '0'.repeat(absExp - coeffStr.length) - const sign = isNegative ? '-' : '' - return `${sign}0.${zeros}${coeffStr}` - } else { - // Insert decimal point - const insertPos = coeffStr.length - absExp - const withDecimal = coeffStr.slice(0, insertPos) + '.' + coeffStr.slice(insertPos) - const finalValue = isNegative ? '-' + withDecimal : withDecimal - - // Remove any trailing zeros after the decimal point - return finalValue.replace(/\.?0+$/, '') - } - } else { - // Positive exponent (multiply by 10^exponent) - return (coeffBigInt * 10n ** BigInt(exponent)).toString() - } + + return new Decimal(coeffBigInt, exponent) } - default: - throw new Error(`Unsupported value type: ${(value.value as any).case}`) - } + default: + throw new Error(`Unsupported value type: ${(value.value as any).case}`) + } } function isValueProto(value: any): boolean { - return ( - value.$typeName && typeof value.$typeName === 'string' && value.$typeName === 'values.v1.Value' - ) -} + return value.$typeName && typeof value.$typeName === 'string' && value.$typeName === 'values.v1.Value' +} \ No newline at end of file diff --git a/src/workflows/hello-world/hello-world.ts b/src/workflows/hello-world/hello-world.ts index a19745ac..57c92b48 100644 --- a/src/workflows/hello-world/hello-world.ts +++ b/src/workflows/hello-world/hello-world.ts @@ -1,4 +1,4 @@ -import { Value } from '@cre/sdk/utils/values/value' +import { Value } from '@cre/sdk/utils' import { cre } from '@cre/sdk/cre' import type { Runtime } from '@cre/sdk/runtime/runtime' import { withErrorBoundary } from '@cre/sdk/utils/error-boundary' @@ -9,7 +9,7 @@ type Config = { const onCronTrigger = (_: Config, runtime: Runtime): void => { runtime.logger.log('Hello, Calculator! Workflow triggered.') - cre.sendResponseValue(new Value('Hello, Calculator!')) + cre.sendResponseValue(Value.from('Hello, Calculator!')) } const initWorkflow = (config: Config) => { diff --git a/src/workflows/http-fetch/http-fetch-hook.ts b/src/workflows/http-fetch/http-fetch-hook.ts index 3d9601bf..1a78cdb5 100644 --- a/src/workflows/http-fetch/http-fetch-hook.ts +++ b/src/workflows/http-fetch/http-fetch-hook.ts @@ -1,8 +1,9 @@ import { z } from 'zod' import { cre } from '@cre/sdk/cre' -import { useMedianConsensus } from '@cre/sdk/utils/values/consensus-hooks' import { withErrorBoundary } from '@cre/sdk/utils/error-boundary' -import { Value } from '@cre/sdk/utils/values/value' +import { Value, consensusMedianAggregation } from '@cre/sdk/utils' +import { type NodeRuntime } from '@cre/sdk/runtime/runtime' +import { runInNodeMode } from '@cre/sdk/runtime/run-in-node-mode' const configSchema = z.object({ schedule: z.string(), @@ -11,7 +12,7 @@ const configSchema = z.object({ type Config = z.infer -const fetchMathResult = useMedianConsensus(async (config: Config) => { +const fetchMathResult = async (_: NodeRuntime, config: Config) => { try { const response = await cre.utils.fetch({ url: config.apiUrl, @@ -21,11 +22,11 @@ const fetchMathResult = useMedianConsensus(async (config: Config) => { console.log('fetch error', error) return 0 } -}, 'float64') +} const onCronTrigger = async (config: Config) => { - const aggregatedValue = await fetchMathResult(config) - cre.sendResponseValue(new Value({ Result: aggregatedValue })) + const aggregatedValue = await runInNodeMode(fetchMathResult, consensusMedianAggregation())(config) + cre.sendResponseValue(Value.from(aggregatedValue)) } const initWorkflow = (config: Config) => { diff --git a/src/workflows/http-fetch/http-fetch.ts b/src/workflows/http-fetch/http-fetch.ts index 393bdda9..71e7bd7d 100644 --- a/src/workflows/http-fetch/http-fetch.ts +++ b/src/workflows/http-fetch/http-fetch.ts @@ -2,7 +2,8 @@ import { z } from 'zod' import { cre } from '@cre/sdk/cre' import { type NodeRuntime } from '@cre/sdk/runtime/runtime' import { withErrorBoundary } from '@cre/sdk/utils/error-boundary' -import { Value } from '@cre/sdk/utils/values/value' +import { Value, consensusMedianAggregation } from '@cre/sdk/utils' +import { runInNodeMode } from '@cre/sdk/runtime/run-in-node-mode' const configSchema = z.object({ schedule: z.string(), @@ -11,22 +12,17 @@ const configSchema = z.object({ type Config = z.infer -const fetchMathResult = async (config: Config) => { +const fetchMathResult = async (nodeRuntime: NodeRuntime, config: Config) => { const response = await cre.utils.fetch({ url: config.apiUrl, }) return Number.parseFloat(response.body.trim()) } - -const fetchAggregatedResult = async (config: Config) => - cre.runInNodeMode(async (_nodeRuntime: NodeRuntime) => { - const result = await fetchMathResult(config) - return cre.utils.consensus.getAggregatedValue(new Value(result), 'median') - }) + const onCronTrigger = async (config: Config) => { - const aggregatedValue = await fetchAggregatedResult(config) - cre.sendResponseValue(new Value({ Result: aggregatedValue })) + const aggregatedValue = await runInNodeMode(fetchMathResult, consensusMedianAggregation())(config) + cre.sendResponseValue(Value.from(aggregatedValue)) } const initWorkflow = (config: Config) => { diff --git a/src/workflows/on-chain-write/on-chain-write.ts b/src/workflows/on-chain-write/on-chain-write.ts index d9bbb84e..93ad8383 100644 --- a/src/workflows/on-chain-write/on-chain-write.ts +++ b/src/workflows/on-chain-write/on-chain-write.ts @@ -1,10 +1,9 @@ -import { cre, type Runtime } from '@cre/sdk/cre' +import { cre, type NodeRuntime, type Runtime } from '@cre/sdk/cre' import { withErrorBoundary } from '@cre/sdk/utils/error-boundary' import { bytesToHex, hexToBase64 } from '@cre/sdk/utils/hex-utils' import { sendResponseValue } from '@cre/sdk/utils/send-response-value' -import { useMedianConsensus } from '@cre/sdk/utils/values/consensus-hooks' import { decodeFunctionResult, encodeFunctionData, toHex, zeroAddress } from 'viem' -import { Value } from '@cre/sdk/utils/values/value' +import { Value, consensusMedianAggregation } from '@cre/sdk/utils' import { z } from 'zod' // TODO: In production, load ABI from external file or contract metadata @@ -25,12 +24,12 @@ const configSchema = z.object({ type Config = z.infer -const fetchMathResult = useMedianConsensus(async (config: Config) => { +async function fetchMathResult(nodeRuntime: NodeRuntime, config: Config): Promise { const response = await cre.utils.fetch({ url: config.apiUrl, }) return Number.parseFloat(response.body.trim()) -}, 'float64') +} const onCronTrigger = async (config: Config, runtime: Runtime): Promise => { if (!config.evms?.length) { @@ -38,7 +37,7 @@ const onCronTrigger = async (config: Config, runtime: Runtime): Promise => } // Step 1: Fetch offchain data using consensus (from Part 2) - const offchainValue = await fetchMathResult(config) + const offchainValue = await cre.runInNodeMode(fetchMathResult, consensusMedianAggregation())(config) runtime.logger.log('Successfully fetched offchain value') @@ -79,9 +78,7 @@ const onCronTrigger = async (config: Config, runtime: Runtime): Promise => runtime.logger.log(`Successfully read onchain value: ${onchainValue.toString()}`) // Step 3: Combine the results - convert offchain float to bigint and add - const offchainFloat = offchainValue.value.case === 'float64Value' ? offchainValue.value.value : 0 - - const offchainBigInt = BigInt(Math.floor(offchainFloat)) + const offchainBigInt = BigInt(Math.floor(offchainValue)) const finalResult = onchainValue + offchainBigInt runtime.logger.log('Final calculated result') @@ -150,7 +147,7 @@ const onCronTrigger = async (config: Config, runtime: Runtime): Promise => } sendResponseValue( - new Value({ + Value.from({ OffchainValue: offchainBigInt, OnchainValue: onchainValue, FinalResult: finalResult, diff --git a/src/workflows/on-chain/on-chain.ts b/src/workflows/on-chain/on-chain.ts index 34ed2aaf..dc0ea256 100644 --- a/src/workflows/on-chain/on-chain.ts +++ b/src/workflows/on-chain/on-chain.ts @@ -1,11 +1,10 @@ import { z } from 'zod' import { cre } from '@cre/sdk/cre' import { sendResponseValue } from '@cre/sdk/utils/send-response-value' -import { Value } from '@cre/sdk/utils/values/value' +import { Value, consensusMedianAggregation } from '@cre/sdk/utils' import { encodeFunctionData, decodeFunctionResult, zeroAddress } from 'viem' import { bytesToHex } from '@cre/sdk/utils/hex-utils' -import type { Runtime } from '@cre/sdk/runtime/runtime' -import { useMedianConsensus } from '@cre/sdk/utils/values/consensus-hooks' +import type { NodeRuntime, Runtime } from '@cre/sdk/runtime/runtime' import { hexToBase64 } from '@cre/sdk/utils/hex-utils' import { withErrorBoundary } from '@cre/sdk/utils/error-boundary' @@ -25,12 +24,12 @@ const configSchema = z.object({ type Config = z.infer -const fetchMathResult = useMedianConsensus(async (config: Config) => { +async function fetchMathResult(nodeRuntime: NodeRuntime, config: Config): Promise { const response = await cre.utils.fetch({ url: config.apiUrl, }) return Number.parseFloat(response.body.trim()) -}, 'float64') +} const onCronTrigger = async (config: Config, runtime: Runtime): Promise => { if (!config.evms?.length) { @@ -38,7 +37,7 @@ const onCronTrigger = async (config: Config, runtime: Runtime): Promise => } // Step 1: Fetch offchain data using consensus (from Part 2) - const offchainValue = await fetchMathResult(config) + const offchainValue = await cre.runInNodeMode(fetchMathResult, consensusMedianAggregation())(config) runtime.logger.log(`Successfully fetched offchain value: ${offchainValue}`) @@ -79,13 +78,11 @@ const onCronTrigger = async (config: Config, runtime: Runtime): Promise => runtime.logger.log(`Successfully read onchain value: ${onchainValue.toString()}`) // Step 3: Combine the results - convert offchain float to bigint and add - const offchainFloat = offchainValue.value.case === 'float64Value' ? offchainValue.value.value : 0 - - const offchainBigInt = BigInt(Math.floor(offchainFloat)) + const offchainBigInt = BigInt(Math.floor(offchainValue)) const finalResult = onchainValue + offchainBigInt sendResponseValue( - new Value({ + Value.from({ FinalResult: finalResult, }), ) diff --git a/src/workflows/standard_tests/capability_calls_are_async/test.ts b/src/workflows/standard_tests/capability_calls_are_async/test.ts index 0a99bbfc..b74b2e7f 100644 --- a/src/workflows/standard_tests/capability_calls_are_async/test.ts +++ b/src/workflows/standard_tests/capability_calls_are_async/test.ts @@ -1,5 +1,5 @@ import { cre } from '@cre/sdk/cre' -import { Value } from '@cre/sdk/utils/values/value' +import { Value } from '@cre/sdk/utils' import { BasicActionCapability } from '@cre/generated-sdk/capabilities/internal/basicaction/v1/basicaction_sdk_gen' import { BasicCapability as BasicTriggerCapability } from '@cre/generated-sdk/capabilities/internal/basictrigger/v1/basic_sdk_gen' @@ -17,7 +17,7 @@ const asyncCalls = async () => { const r2 = await p2 const r1 = await p1 - cre.sendResponseValue(new Value(`${r1.adaptedThing}${r2.adaptedThing}`)) + cre.sendResponseValue(Value.from(`${r1.adaptedThing}${r2.adaptedThing}`)) } const initWorkflow = () => { diff --git a/src/workflows/standard_tests/config/test.ts b/src/workflows/standard_tests/config/test.ts index 78a48247..f10fe29c 100644 --- a/src/workflows/standard_tests/config/test.ts +++ b/src/workflows/standard_tests/config/test.ts @@ -1,11 +1,11 @@ import { cre } from '@cre/sdk/cre' import { BasicCapability as BasicTriggerCapability } from '@cre/generated-sdk/capabilities/internal/basictrigger/v1/basic_sdk_gen' -import { Value } from '@cre/sdk/utils/values/value' +import { Value } from '@cre/sdk/utils' type Config = 'config' const sendBackConfig = (config: Config) => { - cre.sendResponseValue(new Value(Buffer.from(config))) + cre.sendResponseValue(Value.from(Buffer.from(config))) } const initWorkflow = () => { diff --git a/src/workflows/standard_tests/logging/test.ts b/src/workflows/standard_tests/logging/test.ts index 96e8cd22..712757ba 100644 --- a/src/workflows/standard_tests/logging/test.ts +++ b/src/workflows/standard_tests/logging/test.ts @@ -1,12 +1,12 @@ import { cre, type Runtime } from '@cre/sdk/cre' import { BasicCapability as BasicTriggerCapability } from '@cre/generated-sdk/capabilities/internal/basictrigger/v1/basic_sdk_gen' -import { Value } from '@cre/sdk/utils/values/value' +import { Value } from '@cre/sdk/utils' type Config = 'config' const doLog = (config: Config, runtime: Runtime) => { runtime.logger.log('log from wasm!') - cre.sendResponseValue(new Value(Buffer.from(config))) + cre.sendResponseValue(Value.from(Buffer.from(config))) } const initWorkflow = () => { diff --git a/src/workflows/standard_tests/mode_switch/don_runtime_in_node_mode/test.ts b/src/workflows/standard_tests/mode_switch/don_runtime_in_node_mode/test.ts index 44be97eb..8bc04ebf 100644 --- a/src/workflows/standard_tests/mode_switch/don_runtime_in_node_mode/test.ts +++ b/src/workflows/standard_tests/mode_switch/don_runtime_in_node_mode/test.ts @@ -1,40 +1,22 @@ -import { Mode } from '@cre/generated/sdk/v1alpha/sdk_pb' -import { SimpleConsensusInputsSchema } from '@cre/generated/sdk/v1alpha/sdk_pb' -import { CapabilityError } from '@cre/sdk/utils/capabilities/capability-error' -import { create, toJson } from '@bufbuild/protobuf' -import { ConsensusCapability } from '@cre/generated-sdk/capabilities/internal/consensus/v1alpha/consensus_sdk_gen' -import { consensusDescriptorIdentical, observationError } from '@cre/sdk/utils/values/consensus' import { cre } from '@cre/sdk/cre' import { BasicCapability as BasicTriggerCapability } from '@cre/generated-sdk/capabilities/internal/basictrigger/v1/basic_sdk_gen' -import { type Runtime } from '@cre/sdk/runtime/runtime' +import type { NodeRuntime, Runtime } from '@cre/sdk/runtime/runtime' +import { runInNodeMode } from '@cre/sdk/runtime/run-in-node-mode' +import { BasicActionCapability } from '@cre/generated-sdk/capabilities/internal/basicaction/v1/basicaction_sdk_gen' +import { consensusIdenticalAggregation } from '@cre/sdk/utils' // Doesn't matter for this test type Config = any const handler = async (_config: Config, runtime: Runtime) => { - const nodeRuntime = runtime.switchModes(Mode.NODE) - - const consensusInput = create(SimpleConsensusInputsSchema, { - observation: observationError('cannot use Runtime inside RunInNodeMode'), - descriptors: consensusDescriptorIdentical, - }) - try { - // Note: ConsensusCapability won't work in NODE mode. - // We're forcing it here just for test purposes. - // Normally, if we don't force the wrong mode, the runtime guards would prevent call to `callCapability` in the first place. - // Because test expectation is to callCapability and verify error output, we need to "trick" the guards. - const consensusCapability = new ConsensusCapability(Mode.NODE) - await consensusCapability.simple(toJson(SimpleConsensusInputsSchema, consensusInput)) + await runInNodeMode(async (nr: NodeRuntime) => { + const basicCap = new BasicActionCapability() + return (await basicCap.performAction({ inputThing: true })).adaptedThing + }, consensusIdenticalAggregation())() } catch (e) { - if (e instanceof CapabilityError) { - cre.sendError('cannot use Runtime inside RunInNodeMode') - } else { - throw e - } + cre.sendError(e as Error) } - - nodeRuntime.switchModes(Mode.DON) } const initWorkflow = () => { diff --git a/src/workflows/standard_tests/mode_switch/node_runtime_in_don_mode/test.ts b/src/workflows/standard_tests/mode_switch/node_runtime_in_don_mode/test.ts index c8611fd1..112b0c05 100644 --- a/src/workflows/standard_tests/mode_switch/node_runtime_in_don_mode/test.ts +++ b/src/workflows/standard_tests/mode_switch/node_runtime_in_don_mode/test.ts @@ -1,33 +1,29 @@ -import { SimpleConsensusInputsSchema } from '@cre/generated/sdk/v1alpha/sdk_pb' -import { create } from '@bufbuild/protobuf' -import { consensusDescriptorIdentical, observationValue } from '@cre/sdk/utils/values/consensus' +import { consensusIdenticalAggregation } from '@cre/sdk/utils' import { BasicCapability as BasicTriggerCapability } from '@cre/generated-sdk/capabilities/internal/basictrigger/v1/basic_sdk_gen' import { BasicActionCapability as NodeActionCapability } from '@cre/generated-sdk/capabilities/internal/nodeaction/v1/basicaction_sdk_gen' import { cre, type NodeRuntime } from '@cre/sdk/cre' import { NodeModeError } from '@cre/sdk/runtime/errors' -import { Value } from '@cre/sdk/utils/values/value' const handler = async () => { // First, run in node mode and do consensus - this makes the expected CallCapability call + var nrt: NodeRuntime | undefined = undefined await cre.runInNodeMode(async (nodeRuntime: NodeRuntime) => { - const consensusInput = create(SimpleConsensusInputsSchema, { - observation: observationValue(new Value('hi')), - descriptors: consensusDescriptorIdentical, - }) - - return consensusInput - }) + nrt = nodeRuntime + return "hi" + }, consensusIdenticalAggregation())() try { // Now we're back in DON mode, try to use a NODE mode capability // This should trigger assertNodeSafe() and throw "cannot use NodeRuntime outside RunInNodeMode" + // We shoudl be using node runtime here in future... + const _ = nrt const nodeActionCapability = new NodeActionCapability() await nodeActionCapability.performAction({ inputThing: true }) } catch (e) { console.log('error', e) if (e instanceof NodeModeError) { // The runtime guards should catch this and throw the expected error - cre.sendError('cannot use NodeRuntime outside RunInNodeMode') + cre.sendError(e) } else { // Should still fail the test if something else got broken throw e diff --git a/src/workflows/standard_tests/mode_switch/successful_mode_switch/test.ts b/src/workflows/standard_tests/mode_switch/successful_mode_switch/test.ts index 5b6bd565..8e53f24c 100644 --- a/src/workflows/standard_tests/mode_switch/successful_mode_switch/test.ts +++ b/src/workflows/standard_tests/mode_switch/successful_mode_switch/test.ts @@ -1,58 +1,37 @@ -import { AggregationType, Mode } from '@cre/generated/sdk/v1alpha/sdk_pb' -import { SimpleConsensusInputsSchema } from '@cre/generated/sdk/v1alpha/sdk_pb' -import { ValueSchema } from '@cre/generated/values/v1/values_pb' -import { create, toJson } from '@bufbuild/protobuf' import { BasicActionCapability } from '@cre/generated-sdk/capabilities/internal/basicaction/v1/basicaction_sdk_gen' import { BasicActionCapability as NodeActionCapability } from '@cre/generated-sdk/capabilities/internal/nodeaction/v1/basicaction_sdk_gen' -import { consensusFieldsFrom, observationValue } from '@cre/sdk/utils/values/consensus' -import { type NodeRuntime } from '@cre/sdk/runtime/runtime' +import type { NodeRuntime } from '@cre/sdk/runtime/runtime' import { BasicCapability as BasicTriggerCapability } from '@cre/generated-sdk/capabilities/internal/basictrigger/v1/basic_sdk_gen' import { cre, type Runtime } from '@cre/sdk/cre' -import { Value } from '@cre/sdk/utils/values/value' +import { Int64, Value, ConsensusAggregationByFields, median } from '@cre/sdk/utils' // Doesn't matter for this test type Config = any +class Output { + constructor(public OutputThing: Int64) { } +} + const handler = async (_config: Config, runtime: Runtime) => { const donInput = { inputThing: true } const basicActionCapability = new BasicActionCapability() const donResponse = await basicActionCapability.performAction(donInput) + runtime.now() - const consensusOutput = await cre.runInNodeMode(async (nodeRuntime: NodeRuntime) => { + const consensusOutput = await cre.runInNodeMode(async (nodeRuntime: NodeRuntime): Promise => { nodeRuntime.now() const nodeActionCapability = new NodeActionCapability() - const nodeResponse = await nodeActionCapability.performAction({ - inputThing: true, - }) - - return create(SimpleConsensusInputsSchema, { - observation: observationValue( - new Value({ - OutputThing: Value.int64(nodeResponse.outputThing), - }), - ), - descriptors: consensusFieldsFrom({ - OutputThing: AggregationType.MEDIAN, - }), - default: new Value({ - OutputThing: Value.int64(123), - }).proto, - }) - }) - - runtime.now() + const nodeResponse = await nodeActionCapability.performAction({inputThing: true}) - const nodeRuntime = runtime.switchModes(Mode.NODE) - nodeRuntime.now() - nodeRuntime.switchModes(Mode.DON) + return new Output(new Int64(nodeResponse.outputThing)) + }, ConsensusAggregationByFields({OutputThing: median}).withDefault(new Output(new Int64(123))))() runtime.now() - const outputJson = toJson(ValueSchema, consensusOutput) cre.sendResponseValue( - new Value( - `${donResponse.adaptedThing}${outputJson?.mapValue?.fields?.OutputThing?.int64Value}`, + Value.from( + `${donResponse.adaptedThing}${consensusOutput.OutputThing.value}`, ), ) } diff --git a/src/workflows/standard_tests/multiple_triggers/test.ts b/src/workflows/standard_tests/multiple_triggers/test.ts index 1959aea7..8dc7cb0e 100644 --- a/src/workflows/standard_tests/multiple_triggers/test.ts +++ b/src/workflows/standard_tests/multiple_triggers/test.ts @@ -3,21 +3,21 @@ import { BasicCapability as ActionAndTriggerCapability } from '@cre/generated-sd import { type Outputs } from '@cre/generated/capabilities/internal/basictrigger/v1/basic_trigger_pb' import { type TriggerEvent } from '@cre/generated/capabilities/internal/actionandtrigger/v1/action_and_trigger_pb' import { cre, type Runtime } from '@cre/sdk/cre' -import { Value } from '@cre/sdk/utils/values/value' +import { Value } from '@cre/sdk/utils' // Doesn't matter for this test type Config = any const doLog0 = (_config: Config, _runtime: Runtime, output: Outputs) => { - cre.sendResponseValue(new Value(`called 0 with ${output.coolOutput}`)) + cre.sendResponseValue(Value.from(`called 0 with ${output.coolOutput}`)) } const doLog1 = (_config: Config, _runtime: Runtime, output: TriggerEvent) => { - cre.sendResponseValue(new Value(`called 1 with ${output.coolOutput}`)) + cre.sendResponseValue(Value.from(`called 1 with ${output.coolOutput}`)) } const doLog2 = (_config: Config, _runtime: Runtime, output: Outputs) => { - cre.sendResponseValue(new Value(`called 2 with ${output.coolOutput}`)) + cre.sendResponseValue(Value.from(`called 2 with ${output.coolOutput}`)) } const initWorkflow = () => { diff --git a/src/workflows/standard_tests/random/test.ts b/src/workflows/standard_tests/random/test.ts index 801ab66c..53b5e99c 100644 --- a/src/workflows/standard_tests/random/test.ts +++ b/src/workflows/standard_tests/random/test.ts @@ -5,12 +5,15 @@ import { BasicCapability as BasicTriggerCapability } from '@cre/generated-sdk/ca import { AggregationType, Mode } from '@cre/generated/sdk/v1alpha/sdk_pb' import { SimpleConsensusInputsSchema } from '@cre/generated/sdk/v1alpha/sdk_pb' import { BasicActionCapability as NodeActionCapability } from '@cre/generated-sdk/capabilities/internal/nodeaction/v1/basicaction_sdk_gen' -import { consensusFieldsFrom, observationValue } from '@cre/sdk/utils/values/consensus' -import { Value } from '@cre/sdk/utils/values/value' +import { Int64, Value, ConsensusAggregationByFields, median } from '@cre/sdk/utils' const configSchema = z.object({ config: z.string() }) type Config = z.infer +class Output { + constructor(public OutputThing: Int64) { } +} + const randHandler = async (_config: Config, runtime: Runtime) => { const donRandomNumber = runtime.getRand().Uint64() let total = donRandomNumber @@ -27,26 +30,14 @@ const randHandler = async (_config: Config, runtime: Runtime) => { log('***' + nodeRandomNumber.toString()) } - const consensusInput = create(SimpleConsensusInputsSchema, { - observation: observationValue( - new Value({ - OutputThing: Value.int64(nodeResponse.outputThing), - }), - ), - descriptors: consensusFieldsFrom({ - OutputThing: AggregationType.MEDIAN, - }), - default: new Value({ - OutputThing: Value.int64(123), - }).proto, - }) - - return consensusInput - }) + return new Output(new Int64(nodeResponse.outputThing)) + }, ConsensusAggregationByFields({ + OutputThing: median + }).withDefault(new Output(new Int64(123))))() total += donRandomNumber - cre.sendResponseValue(new Value(total)) + cre.sendResponseValue(Value.from(total)) } const initWorkflow = () => { diff --git a/src/workflows/standard_tests/secrets/test.ts b/src/workflows/standard_tests/secrets/test.ts index f9a9be8e..dc8c8002 100644 --- a/src/workflows/standard_tests/secrets/test.ts +++ b/src/workflows/standard_tests/secrets/test.ts @@ -1,7 +1,7 @@ import { cre, type Runtime } from '@cre/sdk/cre' import { BasicCapability as BasicTriggerCapability } from '@cre/generated-sdk/capabilities/internal/basictrigger/v1/basic_sdk_gen' import { SecretsError } from '@cre/sdk/utils/secrets-error' -import { Value } from '@cre/sdk/utils/values/value' +import { Value } from '@cre/sdk/utils' // Doesn't matter for this test type Config = any @@ -9,7 +9,7 @@ type Config = any const handleSecret = async (_config: Config, runtime: Runtime) => { try { const secret = await runtime.getSecret('Foo') - cre.sendResponseValue(new Value(secret)) + cre.sendResponseValue(Value.from(secret)) } catch (error) { // One of the tests covers the lack of particular secret. // We cover that in this catch block, however any other error should still be thrown. diff --git a/src/workflows/standard_tests/secrets_fail_in_node_mode/test.ts b/src/workflows/standard_tests/secrets_fail_in_node_mode/test.ts index d2a949f3..da189f78 100644 --- a/src/workflows/standard_tests/secrets_fail_in_node_mode/test.ts +++ b/src/workflows/standard_tests/secrets_fail_in_node_mode/test.ts @@ -1,9 +1,6 @@ -import { create } from '@bufbuild/protobuf' import { cre, type Runtime, type NodeRuntime } from '@cre/sdk/cre' import { BasicCapability as BasicTriggerCapability } from '@cre/generated-sdk/capabilities/internal/basictrigger/v1/basic_sdk_gen' -// TODO: is this part of CRE or test utils? -import { consensusDescriptorIdentical, observationError } from '@cre/sdk/utils/values/consensus' -import { SimpleConsensusInputsSchema } from '@cre/generated/sdk/v1alpha/sdk_pb' +import { consensusMedianAggregation } from '@cre/sdk/utils' // Doesn't matter for this test type Config = any @@ -11,17 +8,8 @@ type Config = any const secretAccessInNodeMode = async (_config: Config, runtime: Runtime) => { try { await cre.runInNodeMode(async (_nodeRuntime: NodeRuntime) => { - try { - await runtime.getSecret('anything') - } catch { - // This is expected to fail due to Don Mode guards, ignore error - } - - return create(SimpleConsensusInputsSchema, { - observation: observationError('cannot use Runtime inside RunInNodeMode'), - descriptors: consensusDescriptorIdentical, - }) - }) + return await runtime.getSecret('anything') + }, consensusMedianAggregation())() } catch { cre.sendError('cannot use Runtime inside RunInNodeMode') }