From 716b8048eed2bbea30e3b261d7ab99a7d2807169 Mon Sep 17 00:00:00 2001 From: Peter Somogyvari Date: Wed, 17 Nov 2021 15:06:05 -0800 Subject: [PATCH] feat(core-api): add weaver protocol buffer definitions #1523 Adding the .proto definitions from here as discussed earlier with @VRamakrishna To-do: I skipped the fabric driver proto due to an error on account of the Fabric peer definitions not being present (unresolved import error). Fixes #1523 Signed-off-by: Peter Somogyvari --- package.json | 1 + packages/cactus-core-api/package.json | 6 + .../main/proto/weaver/common/protos/README.md | 8 + .../common/protos/common/access_control.proto | 21 + .../weaver/common/protos/common/ack.proto | 21 + .../common/protos/common/asset_locks.proto | 62 ++ .../protos/common/interop_payload.proto | 11 + .../common/protos/common/membership.proto | 21 + .../weaver/common/protos/common/proofs.proto | 12 + .../weaver/common/protos/common/query.proto | 18 + .../weaver/common/protos/common/state.proto | 62 ++ .../protos/common/verification_policy.proto | 29 + .../common/protos/corda/view_data.proto | 17 + .../weaver/common/protos/driver/driver.proto | 15 + .../common/protos/fabric/view_data.proto | 24 + .../common/protos/networks/networks.proto | 43 + .../common/protos/relay/datatransfer.proto | 25 + .../common/protos/common/access_control.ts | 200 +++++ .../weaver/common/protos/common/ack.ts | 111 +++ .../common/protos/common/asset_locks.ts | 779 ++++++++++++++++++ .../common/protos/common/interop_payload.ts | 86 ++ .../weaver/common/protos/common/membership.ts | 193 +++++ .../weaver/common/protos/common/proofs.ts | 143 ++++ .../weaver/common/protos/common/query.ts | 219 +++++ .../weaver/common/protos/common/state.ts | 453 ++++++++++ .../protos/common/verification_policy.ts | 238 ++++++ .../weaver/common/protos/corda/view_data.ts | 183 ++++ .../weaver/common/protos/driver/driver.ts | 39 + .../weaver/common/protos/networks/networks.ts | 443 ++++++++++ .../common/protos/relay/datatransfer.ts | 74 ++ yarn.lock | 10 +- 31 files changed, 3566 insertions(+), 1 deletion(-) create mode 100644 packages/cactus-core-api/src/main/proto/weaver/common/protos/README.md create mode 100644 packages/cactus-core-api/src/main/proto/weaver/common/protos/common/access_control.proto create mode 100644 packages/cactus-core-api/src/main/proto/weaver/common/protos/common/ack.proto create mode 100644 packages/cactus-core-api/src/main/proto/weaver/common/protos/common/asset_locks.proto create mode 100644 packages/cactus-core-api/src/main/proto/weaver/common/protos/common/interop_payload.proto create mode 100644 packages/cactus-core-api/src/main/proto/weaver/common/protos/common/membership.proto create mode 100644 packages/cactus-core-api/src/main/proto/weaver/common/protos/common/proofs.proto create mode 100644 packages/cactus-core-api/src/main/proto/weaver/common/protos/common/query.proto create mode 100644 packages/cactus-core-api/src/main/proto/weaver/common/protos/common/state.proto create mode 100644 packages/cactus-core-api/src/main/proto/weaver/common/protos/common/verification_policy.proto create mode 100644 packages/cactus-core-api/src/main/proto/weaver/common/protos/corda/view_data.proto create mode 100644 packages/cactus-core-api/src/main/proto/weaver/common/protos/driver/driver.proto create mode 100644 packages/cactus-core-api/src/main/proto/weaver/common/protos/fabric/view_data.proto create mode 100644 packages/cactus-core-api/src/main/proto/weaver/common/protos/networks/networks.proto create mode 100644 packages/cactus-core-api/src/main/proto/weaver/common/protos/relay/datatransfer.proto create mode 100644 packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/access_control.ts create mode 100644 packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/ack.ts create mode 100644 packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/asset_locks.ts create mode 100644 packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/interop_payload.ts create mode 100644 packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/membership.ts create mode 100644 packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/proofs.ts create mode 100644 packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/query.ts create mode 100644 packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/state.ts create mode 100644 packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/verification_policy.ts create mode 100644 packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/corda/view_data.ts create mode 100644 packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/driver/driver.ts create mode 100644 packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/networks/networks.ts create mode 100644 packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/relay/datatransfer.ts diff --git a/package.json b/package.json index 04dbf29ba6..d3829e391a 100644 --- a/package.json +++ b/package.json @@ -119,6 +119,7 @@ "karma-webpack": "5.0.0", "lerna": "4.0.0", "lint-staged": "11.1.2", + "make-dir-cli": "3.0.0", "node-polyfill-webpack-plugin": "1.1.4", "npm-run-all": "4.1.5", "npm-watch": "0.11.0", diff --git a/packages/cactus-core-api/package.json b/packages/cactus-core-api/package.json index 4ee903f384..a000371275 100644 --- a/packages/cactus-core-api/package.json +++ b/packages/cactus-core-api/package.json @@ -14,6 +14,9 @@ "scripts": { "generate-sdk": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected", "codegen:openapi": "npm run generate-sdk", + "preproto:protoc-gen-ts": "make-dir ./src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/", + "proto:protoc-gen-ts": "yarn run grpc_tools_node_protoc --plugin=protoc-gen-ts=../../node_modules/.bin/protoc-gen-ts --ts_out=grpc_js:./src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/ --proto_path ./src/main/proto/weaver/common/protos/ ./src/main/proto/weaver/common/protos/common/*.proto ./src/main/proto/weaver/common/protos/corda/*.proto ./src/main/proto/weaver/common/protos/driver/*.proto ./src/main/proto/weaver/common/protos/networks/*.proto ./src/main/proto/weaver/common/protos/relay/*.proto", + "codegen:proto": "run-s proto:protoc-gen-ts", "codegen": "run-p 'codegen:*'", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", @@ -69,7 +72,10 @@ }, "homepage": "https://github.com/hyperledger/cactus#readme", "devDependencies": { + "@grpc/grpc-js": "1.3.6", + "@grpc/proto-loader": "0.6.4", "@types/express": "4.17.13", + "make-dir-cli": "3.0.0", "socket.io": "4.1.3", "typescript-optional": "2.0.1" }, diff --git a/packages/cactus-core-api/src/main/proto/weaver/common/protos/README.md b/packages/cactus-core-api/src/main/proto/weaver/common/protos/README.md new file mode 100644 index 0000000000..abeafc8791 --- /dev/null +++ b/packages/cactus-core-api/src/main/proto/weaver/common/protos/README.md @@ -0,0 +1,8 @@ + +## protos + +This repository contains the grpc service and protocol buffer definitions for the relay, drivers and other interop modules. protos diff --git a/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/access_control.proto b/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/access_control.proto new file mode 100644 index 0000000000..183aba26b7 --- /dev/null +++ b/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/access_control.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; + +package common.access_control; + +option java_package = "com.weaver.protos.common.access_control"; +option go_package = "github.com/hyperledger-labs/weaver-dlt-interoperability/common/protos-go/common"; + +// AccessControlPolicy specifies a set of data that can be accessed by some +// SecurityGroup +message AccessControlPolicy { + string securityDomain = 1; + repeated Rule rules = 2; +} + +// Rule represents a single data access rule for the AccessControlPolicy +message Rule { + string principal = 1; + string principalType = 2; + string resource = 3; + bool read = 4; +} diff --git a/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/ack.proto b/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/ack.proto new file mode 100644 index 0000000000..e7f0c082c3 --- /dev/null +++ b/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/ack.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; + +package common.ack; + +option java_package = "com.weaver.protos.common.ack"; +option go_package = "github.com/hyperledger-labs/weaver-dlt-interoperability/common/protos-go/common"; + +// This message respresents "ACKs" sent between relay-relay, +// relay-driver and relay-network +message Ack { + enum STATUS { + OK = 0; + ERROR = 1; + }; + STATUS status = 2; + string request_id = 3; + // an error can have an associated string + // this is the best way to represent this in protobuf + string message = 4; + } + diff --git a/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/asset_locks.proto b/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/asset_locks.proto new file mode 100644 index 0000000000..5bf9223b22 --- /dev/null +++ b/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/asset_locks.proto @@ -0,0 +1,62 @@ +syntax = "proto3"; + +package common.asset_locks; + +option java_package = "com.weaver.protos.common.asset_locks"; +option go_package = "github.com/hyperledger-labs/weaver-dlt-interoperability/common/protos-go/common"; + +enum LockMechanism { + HTLC = 0; +} + +message AssetLock { + LockMechanism lockMechanism = 1; + bytes lockInfo = 2; +} + +message AssetClaim { + LockMechanism lockMechanism = 1; + bytes claimInfo = 2; +} + +message AssetLockHTLC { + bytes hashBase64 = 1; + uint64 expiryTimeSecs = 2; + enum TimeSpec { + EPOCH = 0; + DURATION = 1; + } + TimeSpec timeSpec = 3; +} + +message AssetClaimHTLC { + bytes hashPreimageBase64 = 1; +} + +message AssetExchangeAgreement { + string type = 1; + string id = 2; + string locker = 3; + string recipient = 4; +} + +message FungibleAssetExchangeAgreement { + string type = 1; + uint64 numUnits = 2; + string locker = 3; + string recipient = 4; +} + +message AssetContractHTLC { + string contractId = 1; + AssetExchangeAgreement agreement = 2; + AssetLockHTLC lock = 3; + AssetClaimHTLC claim = 4; +} + +message FungibleAssetContractHTLC { + string contractId = 1; + FungibleAssetExchangeAgreement agreement = 2; + AssetLockHTLC lock = 3; + AssetClaimHTLC claim = 4; +} diff --git a/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/interop_payload.proto b/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/interop_payload.proto new file mode 100644 index 0000000000..c36d490fbc --- /dev/null +++ b/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/interop_payload.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + +package common.interop_payload; + +option java_package = "com.weaver.protos.common.interop_payload"; +option go_package = "github.com/hyperledger-labs/weaver-dlt-interoperability/common/protos-go/common"; + +message InteropPayload { + bytes payload = 1; + string address = 2; +} diff --git a/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/membership.proto b/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/membership.proto new file mode 100644 index 0000000000..f32125a2e0 --- /dev/null +++ b/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/membership.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; + +package common.membership; + +option java_package = "com.weaver.protos.common.membership"; +option go_package = "github.com/hyperledger-labs/weaver-dlt-interoperability/common/protos-go/common"; + +// Membership captures the members of an external entity such as a thing, +// person, organization or groups of entities such as networks +message Membership { + string securityDomain = 1; + map members = 2; +} + +// Member of a security group is represented by a set of public keys, +// certificates or certificate authorities +message Member { + string value = 1; + string type = 2; + repeated string chain = 3; +} diff --git a/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/proofs.proto b/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/proofs.proto new file mode 100644 index 0000000000..bac6764b2f --- /dev/null +++ b/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/proofs.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package common.proofs; +option java_package = "com.weaver.protos.common.proofs"; +option go_package = "github.com/hyperledger-labs/weaver-dlt-interoperability/common/protos-go/common"; + +message Proof { + string signature = 1; + string certificate = 2; +} + +message Proofs { repeated Proof proofs = 1; } diff --git a/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/query.proto b/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/query.proto new file mode 100644 index 0000000000..155f313bd1 --- /dev/null +++ b/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/query.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package common.query; +option java_package = "com.weaver.protos.common.query"; +option go_package = "github.com/hyperledger-labs/weaver-dlt-interoperability/common/protos-go/common"; + +// the payload to define the data that is being requested +message Query { + repeated string policy = 1; + string address = 2; + string requesting_relay = 3; + string requesting_network = 4; + string certificate = 5; + string requestor_signature = 6; + string nonce = 7; + string request_id = 8; + string requesting_org = 9; +} diff --git a/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/state.proto b/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/state.proto new file mode 100644 index 0000000000..c25697128a --- /dev/null +++ b/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/state.proto @@ -0,0 +1,62 @@ +syntax = "proto3"; + +package common.state; +option java_package = "com.weaver.protos.common.state"; +option go_package = "github.com/hyperledger-labs/weaver-dlt-interoperability/common/protos-go/common"; + +// Metadata for a View +message Meta { + enum Protocol { + BITCOIN = 0; + ETHEREUM = 1; + FABRIC = 3; + CORDA = 4; + } + // Underlying distributed ledger protocol. + Protocol protocol = 1; + // What notion of time? + // If the observer and network are synchronizing on a global clock + // there won't be a need to distinguish between static and dynamic views. + string timestamp = 2; + // Notorization, SPV, ZKP, etc. Possibly enum + string proof_type = 3; + // The data field's serialization format (e.g. JSON, XML, Protobuf) + string serialization_format = 4; +} + +message View { + Meta meta = 1; + // Represents the data playload of this view. + // The representation of Fabric, Corda etc will be captured elsewhere. + // For some protocols, like Bitcoin, the structure of an SPV proof is well known. + bytes data = 2; +} + +// View represents the response from a remote network +message ViewPayload { + string request_id = 1; + oneof state { + View view = 2; + string error = 3; + }; +} + +// the payload that is used for the communication between the requesting relay +// and its network +message RequestState { + enum STATUS { + // pending ACK from remote relay + PENDING_ACK = 0; + // Received ACK, waiting for data to be sent from remote relay + PENDING = 1; + ERROR = 2; + COMPLETED = 3; + }; + string request_id = 1; + STATUS status = 2; + oneof state { + View view = 3; + string error = 4; + }; +} + diff --git a/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/verification_policy.proto b/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/verification_policy.proto new file mode 100644 index 0000000000..cad8714850 --- /dev/null +++ b/packages/cactus-core-api/src/main/proto/weaver/common/protos/common/verification_policy.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; + +package common.verification_policy; + +option java_package = "com.weaver.protos.common.verification_policy"; +option go_package = "github.com/hyperledger-labs/weaver-dlt-interoperability/common/protos-go/common"; + +// VerificationPolicy stores the rules around which parties from a foreign +// network need to provide proof of a view in order for it to be deemed valid by +// the Fabric network +message VerificationPolicy { + string securityDomain = 1; + repeated Identifier identifiers = 2; +} + +// The Policy captures the list of parties that are required to provide proofs +// of a view in order for the Fabric network to accept the view as valid. +message Policy { + string type = 1; + repeated string criteria = 2; +} + +// List of identifiers for the VerificationPolicy +message Identifier { + // pattern defines the view/views that this rule applies to + // A rule may contain a "*" at the end of the pattern + string pattern = 1; + Policy policy = 2; +} diff --git a/packages/cactus-core-api/src/main/proto/weaver/common/protos/corda/view_data.proto b/packages/cactus-core-api/src/main/proto/weaver/common/protos/corda/view_data.proto new file mode 100644 index 0000000000..b155ceaf8a --- /dev/null +++ b/packages/cactus-core-api/src/main/proto/weaver/common/protos/corda/view_data.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package corda; + +option java_package = "com.weaver.protos.corda"; +option go_package = "github.com/hyperledger-labs/weaver-dlt-interoperability/common/protos-go/corda"; + +message ViewData { + message Notarization { + string signature = 1; + string certificate = 2; + string id = 3; + } + repeated Notarization notarizations = 1; + // Bytes of InteropPayload + bytes payload = 2; +} diff --git a/packages/cactus-core-api/src/main/proto/weaver/common/protos/driver/driver.proto b/packages/cactus-core-api/src/main/proto/weaver/common/protos/driver/driver.proto new file mode 100644 index 0000000000..032f0b2675 --- /dev/null +++ b/packages/cactus-core-api/src/main/proto/weaver/common/protos/driver/driver.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package driver.driver; + +import "common/ack.proto"; +import "common/query.proto"; + +option java_package = "com.weaver.protos.driver.driver"; +option go_package = "github.com/hyperledger-labs/weaver-dlt-interoperability/common/protos-go/driver"; + +service DriverCommunication { + // the remote relay sends a RequestDriverState request to its driver with a + // query defining the data it wants to receive + rpc RequestDriverState(common.query.Query) returns (common.ack.Ack) {} +} \ No newline at end of file diff --git a/packages/cactus-core-api/src/main/proto/weaver/common/protos/fabric/view_data.proto b/packages/cactus-core-api/src/main/proto/weaver/common/protos/fabric/view_data.proto new file mode 100644 index 0000000000..ce45718c56 --- /dev/null +++ b/packages/cactus-core-api/src/main/proto/weaver/common/protos/fabric/view_data.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +package fabric.view_data; + +option java_package = "com.weaver.protos.fabric.view_data"; +option go_package = "github.com/hyperledger-labs/weaver-dlt-interoperability/common/protos-go/fabric"; + +import "peer/proposal_response.proto"; + +message FabricView { + // `Response` from the peers + // https://github.com/hyperledger/fabric-protos-go/blob/main/peer/proposal_response.pb.go#L113 + // We only need the `Payload` field though. + protos.Response response = 1; + // `ProposalResponsePayload` is the output produced by each peer and signed as a serialized blob + // https://github.com/hyperledger/fabric-protos-go/blob/main/peer/proposal_response.pb.go#L176 + // `ProposalResponsePayload` contains an `Extension` field which is of type `ChaincodeAction` + // https://github.com/hyperledger/fabric-protos-go/blob/main/peer/proposal.pb.go#L280 + // We only need the `ProposalHash`, `ChaincodeId` and `Response` fields. + protos.ProposalResponsePayload proposal_response_payload = 3; + // Each `Endorsement` is an identity coupled with a signature + // https://github.com/hyperledger/fabric-protos-go/blob/main/peer/proposal_response.pb.go#L242 + repeated protos.Endorsement endorsements = 4; +} diff --git a/packages/cactus-core-api/src/main/proto/weaver/common/protos/networks/networks.proto b/packages/cactus-core-api/src/main/proto/weaver/common/protos/networks/networks.proto new file mode 100644 index 0000000000..2332ded5b2 --- /dev/null +++ b/packages/cactus-core-api/src/main/proto/weaver/common/protos/networks/networks.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; + +package networks.networks; + +import "common/ack.proto"; +import "common/state.proto"; + +option java_package = "com.weaver.protos.networks.networks"; +option go_package = "github.com/hyperledger-labs/weaver-dlt-interoperability/common/protos-go/networks"; + +// This service is the interface for how the network communicates with +// its relay. +service Network { + // endpoint for a network to request remote relay state via local relay + rpc RequestState(NetworkQuery) returns (common.ack.Ack) {} + // This rpc endpooint is for polling the local relay for request state. + rpc GetState(GetStateMessage) returns(common.state.RequestState) {} + // NOTE: This rpc is just for debugging. + rpc RequestDatabase(DbName) returns (RelayDatabase) {} +} + +message DbName { + string name = 1; +} + +message RelayDatabase { + map pairs = 1; +} + +message GetStateMessage { + string request_id = 1; +} + +message NetworkQuery { + repeated string policy = 1; + string address = 2; + string requesting_relay = 3; + string requesting_network = 4; + string certificate = 5; + string requestor_signature = 6; + string nonce = 7; + string requesting_org = 8; +} diff --git a/packages/cactus-core-api/src/main/proto/weaver/common/protos/relay/datatransfer.proto b/packages/cactus-core-api/src/main/proto/weaver/common/protos/relay/datatransfer.proto new file mode 100644 index 0000000000..4306857c81 --- /dev/null +++ b/packages/cactus-core-api/src/main/proto/weaver/common/protos/relay/datatransfer.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +package relay.datatransfer; + +import "common/ack.proto"; +import "common/state.proto"; +import "common/query.proto"; + +option java_package = "com.weaver.protos.relay.datatransfer"; +option go_package = "github.com/hyperledger-labs/weaver-dlt-interoperability/common/protos-go/relay"; + +// definitions of all messages used in the datatransfer protocol +service DataTransfer { + // the requesting relay sends a RequestState request to the remote relay with a + // query defining the data it wants to receive + rpc RequestState(common.query.Query) returns (common.ack.Ack) {} + // the remote relay asynchronously sends back the requested data with + // SendState + rpc SendState(common.state.ViewPayload) returns (common.ack.Ack) {} + // Handling state sent from the driver. + rpc SendDriverState(common.state.ViewPayload) returns (common.ack.Ack){} +} + + +// TODO: Update DataTransferState to be a enum including possible error in ACK fromat. diff --git a/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/access_control.ts b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/access_control.ts new file mode 100644 index 0000000000..62a24ebcbc --- /dev/null +++ b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/access_control.ts @@ -0,0 +1,200 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.15.6 + * source: common/access_control.proto + * git: https://github.com/thesayyn/protoc-gen-ts + * buymeacoffee: https://www.buymeacoffee.com/thesayyn + * */ +import * as pb_1 from "google-protobuf"; +export namespace common.access_control { + export class AccessControlPolicy extends pb_1.Message { + constructor(data?: any[] | { + securityDomain?: string; + rules?: Rule[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("securityDomain" in data && data.securityDomain != undefined) { + this.securityDomain = data.securityDomain; + } + if ("rules" in data && data.rules != undefined) { + this.rules = data.rules; + } + } + } + get securityDomain() { + return pb_1.Message.getField(this, 1) as string; + } + set securityDomain(value: string) { + pb_1.Message.setField(this, 1, value); + } + get rules() { + return pb_1.Message.getRepeatedWrapperField(this, Rule, 2) as Rule[]; + } + set rules(value: Rule[]) { + pb_1.Message.setRepeatedWrapperField(this, 2, value); + } + toObject() { + const data: { + securityDomain?: string; + rules?: ReturnType[]; + } = {}; + if (this.securityDomain != null) { + data.securityDomain = this.securityDomain; + } + if (this.rules != null) { + data.rules = this.rules.map((item: Rule) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.securityDomain === "string" && this.securityDomain.length) + writer.writeString(1, this.securityDomain); + if (this.rules !== undefined) + writer.writeRepeatedMessage(2, this.rules, (item: Rule) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AccessControlPolicy { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AccessControlPolicy(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.securityDomain = reader.readString(); + break; + case 2: + reader.readMessage(message.rules, () => pb_1.Message.addToRepeatedWrapperField(message, 2, Rule.deserialize(reader), Rule)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): AccessControlPolicy { + return AccessControlPolicy.deserialize(bytes); + } + } + export class Rule extends pb_1.Message { + constructor(data?: any[] | { + principal?: string; + principalType?: string; + resource?: string; + read?: boolean; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("principal" in data && data.principal != undefined) { + this.principal = data.principal; + } + if ("principalType" in data && data.principalType != undefined) { + this.principalType = data.principalType; + } + if ("resource" in data && data.resource != undefined) { + this.resource = data.resource; + } + if ("read" in data && data.read != undefined) { + this.read = data.read; + } + } + } + get principal() { + return pb_1.Message.getField(this, 1) as string; + } + set principal(value: string) { + pb_1.Message.setField(this, 1, value); + } + get principalType() { + return pb_1.Message.getField(this, 2) as string; + } + set principalType(value: string) { + pb_1.Message.setField(this, 2, value); + } + get resource() { + return pb_1.Message.getField(this, 3) as string; + } + set resource(value: string) { + pb_1.Message.setField(this, 3, value); + } + get read() { + return pb_1.Message.getField(this, 4) as boolean; + } + set read(value: boolean) { + pb_1.Message.setField(this, 4, value); + } + toObject() { + const data: { + principal?: string; + principalType?: string; + resource?: string; + read?: boolean; + } = {}; + if (this.principal != null) { + data.principal = this.principal; + } + if (this.principalType != null) { + data.principalType = this.principalType; + } + if (this.resource != null) { + data.resource = this.resource; + } + if (this.read != null) { + data.read = this.read; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.principal === "string" && this.principal.length) + writer.writeString(1, this.principal); + if (typeof this.principalType === "string" && this.principalType.length) + writer.writeString(2, this.principalType); + if (typeof this.resource === "string" && this.resource.length) + writer.writeString(3, this.resource); + if (this.read !== undefined) + writer.writeBool(4, this.read); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Rule { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Rule(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.principal = reader.readString(); + break; + case 2: + message.principalType = reader.readString(); + break; + case 3: + message.resource = reader.readString(); + break; + case 4: + message.read = reader.readBool(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Rule { + return Rule.deserialize(bytes); + } + } +} diff --git a/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/ack.ts b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/ack.ts new file mode 100644 index 0000000000..3a72c37769 --- /dev/null +++ b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/ack.ts @@ -0,0 +1,111 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.15.6 + * source: common/ack.proto + * git: https://github.com/thesayyn/protoc-gen-ts + * buymeacoffee: https://www.buymeacoffee.com/thesayyn + * */ +import * as pb_1 from "google-protobuf"; +export namespace common.ack { + export class Ack extends pb_1.Message { + constructor(data?: any[] | { + status?: Ack.STATUS; + request_id?: string; + message?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("status" in data && data.status != undefined) { + this.status = data.status; + } + if ("request_id" in data && data.request_id != undefined) { + this.request_id = data.request_id; + } + if ("message" in data && data.message != undefined) { + this.message = data.message; + } + } + } + get status() { + return pb_1.Message.getField(this, 2) as Ack.STATUS; + } + set status(value: Ack.STATUS) { + pb_1.Message.setField(this, 2, value); + } + get request_id() { + return pb_1.Message.getField(this, 3) as string; + } + set request_id(value: string) { + pb_1.Message.setField(this, 3, value); + } + get message() { + return pb_1.Message.getField(this, 4) as string; + } + set message(value: string) { + pb_1.Message.setField(this, 4, value); + } + toObject() { + const data: { + status?: Ack.STATUS; + request_id?: string; + message?: string; + } = {}; + if (this.status != null) { + data.status = this.status; + } + if (this.request_id != null) { + data.request_id = this.request_id; + } + if (this.message != null) { + data.message = this.message; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.status !== undefined) + writer.writeEnum(2, this.status); + if (typeof this.request_id === "string" && this.request_id.length) + writer.writeString(3, this.request_id); + if (typeof this.message === "string" && this.message.length) + writer.writeString(4, this.message); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Ack { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Ack(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 2: + message.status = reader.readEnum(); + break; + case 3: + message.request_id = reader.readString(); + break; + case 4: + message.message = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Ack { + return Ack.deserialize(bytes); + } + } + export namespace Ack { + export enum STATUS { + OK = 0, + ERROR = 1 + } + } +} diff --git a/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/asset_locks.ts b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/asset_locks.ts new file mode 100644 index 0000000000..896de97649 --- /dev/null +++ b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/asset_locks.ts @@ -0,0 +1,779 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.15.6 + * source: common/asset_locks.proto + * git: https://github.com/thesayyn/protoc-gen-ts + * buymeacoffee: https://www.buymeacoffee.com/thesayyn + * */ +import * as pb_1 from "google-protobuf"; +export namespace common.asset_locks { + export enum LockMechanism { + HTLC = 0 + } + export class AssetLock extends pb_1.Message { + constructor(data?: any[] | { + lockMechanism?: LockMechanism; + lockInfo?: Uint8Array; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("lockMechanism" in data && data.lockMechanism != undefined) { + this.lockMechanism = data.lockMechanism; + } + if ("lockInfo" in data && data.lockInfo != undefined) { + this.lockInfo = data.lockInfo; + } + } + } + get lockMechanism() { + return pb_1.Message.getField(this, 1) as LockMechanism; + } + set lockMechanism(value: LockMechanism) { + pb_1.Message.setField(this, 1, value); + } + get lockInfo() { + return pb_1.Message.getField(this, 2) as Uint8Array; + } + set lockInfo(value: Uint8Array) { + pb_1.Message.setField(this, 2, value); + } + toObject() { + const data: { + lockMechanism?: LockMechanism; + lockInfo?: Uint8Array; + } = {}; + if (this.lockMechanism != null) { + data.lockMechanism = this.lockMechanism; + } + if (this.lockInfo != null) { + data.lockInfo = this.lockInfo; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.lockMechanism !== undefined) + writer.writeEnum(1, this.lockMechanism); + if (this.lockInfo !== undefined) + writer.writeBytes(2, this.lockInfo); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AssetLock { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AssetLock(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.lockMechanism = reader.readEnum(); + break; + case 2: + message.lockInfo = reader.readBytes(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): AssetLock { + return AssetLock.deserialize(bytes); + } + } + export class AssetClaim extends pb_1.Message { + constructor(data?: any[] | { + lockMechanism?: LockMechanism; + claimInfo?: Uint8Array; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("lockMechanism" in data && data.lockMechanism != undefined) { + this.lockMechanism = data.lockMechanism; + } + if ("claimInfo" in data && data.claimInfo != undefined) { + this.claimInfo = data.claimInfo; + } + } + } + get lockMechanism() { + return pb_1.Message.getField(this, 1) as LockMechanism; + } + set lockMechanism(value: LockMechanism) { + pb_1.Message.setField(this, 1, value); + } + get claimInfo() { + return pb_1.Message.getField(this, 2) as Uint8Array; + } + set claimInfo(value: Uint8Array) { + pb_1.Message.setField(this, 2, value); + } + toObject() { + const data: { + lockMechanism?: LockMechanism; + claimInfo?: Uint8Array; + } = {}; + if (this.lockMechanism != null) { + data.lockMechanism = this.lockMechanism; + } + if (this.claimInfo != null) { + data.claimInfo = this.claimInfo; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.lockMechanism !== undefined) + writer.writeEnum(1, this.lockMechanism); + if (this.claimInfo !== undefined) + writer.writeBytes(2, this.claimInfo); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AssetClaim { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AssetClaim(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.lockMechanism = reader.readEnum(); + break; + case 2: + message.claimInfo = reader.readBytes(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): AssetClaim { + return AssetClaim.deserialize(bytes); + } + } + export class AssetLockHTLC extends pb_1.Message { + constructor(data?: any[] | { + hashBase64?: Uint8Array; + expiryTimeSecs?: number; + timeSpec?: AssetLockHTLC.TimeSpec; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("hashBase64" in data && data.hashBase64 != undefined) { + this.hashBase64 = data.hashBase64; + } + if ("expiryTimeSecs" in data && data.expiryTimeSecs != undefined) { + this.expiryTimeSecs = data.expiryTimeSecs; + } + if ("timeSpec" in data && data.timeSpec != undefined) { + this.timeSpec = data.timeSpec; + } + } + } + get hashBase64() { + return pb_1.Message.getField(this, 1) as Uint8Array; + } + set hashBase64(value: Uint8Array) { + pb_1.Message.setField(this, 1, value); + } + get expiryTimeSecs() { + return pb_1.Message.getField(this, 2) as number; + } + set expiryTimeSecs(value: number) { + pb_1.Message.setField(this, 2, value); + } + get timeSpec() { + return pb_1.Message.getField(this, 3) as AssetLockHTLC.TimeSpec; + } + set timeSpec(value: AssetLockHTLC.TimeSpec) { + pb_1.Message.setField(this, 3, value); + } + toObject() { + const data: { + hashBase64?: Uint8Array; + expiryTimeSecs?: number; + timeSpec?: AssetLockHTLC.TimeSpec; + } = {}; + if (this.hashBase64 != null) { + data.hashBase64 = this.hashBase64; + } + if (this.expiryTimeSecs != null) { + data.expiryTimeSecs = this.expiryTimeSecs; + } + if (this.timeSpec != null) { + data.timeSpec = this.timeSpec; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.hashBase64 !== undefined) + writer.writeBytes(1, this.hashBase64); + if (this.expiryTimeSecs !== undefined) + writer.writeUint64(2, this.expiryTimeSecs); + if (this.timeSpec !== undefined) + writer.writeEnum(3, this.timeSpec); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AssetLockHTLC { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AssetLockHTLC(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.hashBase64 = reader.readBytes(); + break; + case 2: + message.expiryTimeSecs = reader.readUint64(); + break; + case 3: + message.timeSpec = reader.readEnum(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): AssetLockHTLC { + return AssetLockHTLC.deserialize(bytes); + } + } + export namespace AssetLockHTLC { + export enum TimeSpec { + EPOCH = 0, + DURATION = 1 + } + } + export class AssetClaimHTLC extends pb_1.Message { + constructor(data?: any[] | { + hashPreimageBase64?: Uint8Array; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("hashPreimageBase64" in data && data.hashPreimageBase64 != undefined) { + this.hashPreimageBase64 = data.hashPreimageBase64; + } + } + } + get hashPreimageBase64() { + return pb_1.Message.getField(this, 1) as Uint8Array; + } + set hashPreimageBase64(value: Uint8Array) { + pb_1.Message.setField(this, 1, value); + } + toObject() { + const data: { + hashPreimageBase64?: Uint8Array; + } = {}; + if (this.hashPreimageBase64 != null) { + data.hashPreimageBase64 = this.hashPreimageBase64; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.hashPreimageBase64 !== undefined) + writer.writeBytes(1, this.hashPreimageBase64); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AssetClaimHTLC { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AssetClaimHTLC(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.hashPreimageBase64 = reader.readBytes(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): AssetClaimHTLC { + return AssetClaimHTLC.deserialize(bytes); + } + } + export class AssetExchangeAgreement extends pb_1.Message { + constructor(data?: any[] | { + type?: string; + id?: string; + locker?: string; + recipient?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("type" in data && data.type != undefined) { + this.type = data.type; + } + if ("id" in data && data.id != undefined) { + this.id = data.id; + } + if ("locker" in data && data.locker != undefined) { + this.locker = data.locker; + } + if ("recipient" in data && data.recipient != undefined) { + this.recipient = data.recipient; + } + } + } + get type() { + return pb_1.Message.getField(this, 1) as string; + } + set type(value: string) { + pb_1.Message.setField(this, 1, value); + } + get id() { + return pb_1.Message.getField(this, 2) as string; + } + set id(value: string) { + pb_1.Message.setField(this, 2, value); + } + get locker() { + return pb_1.Message.getField(this, 3) as string; + } + set locker(value: string) { + pb_1.Message.setField(this, 3, value); + } + get recipient() { + return pb_1.Message.getField(this, 4) as string; + } + set recipient(value: string) { + pb_1.Message.setField(this, 4, value); + } + toObject() { + const data: { + type?: string; + id?: string; + locker?: string; + recipient?: string; + } = {}; + if (this.type != null) { + data.type = this.type; + } + if (this.id != null) { + data.id = this.id; + } + if (this.locker != null) { + data.locker = this.locker; + } + if (this.recipient != null) { + data.recipient = this.recipient; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.type === "string" && this.type.length) + writer.writeString(1, this.type); + if (typeof this.id === "string" && this.id.length) + writer.writeString(2, this.id); + if (typeof this.locker === "string" && this.locker.length) + writer.writeString(3, this.locker); + if (typeof this.recipient === "string" && this.recipient.length) + writer.writeString(4, this.recipient); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AssetExchangeAgreement { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AssetExchangeAgreement(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.type = reader.readString(); + break; + case 2: + message.id = reader.readString(); + break; + case 3: + message.locker = reader.readString(); + break; + case 4: + message.recipient = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): AssetExchangeAgreement { + return AssetExchangeAgreement.deserialize(bytes); + } + } + export class FungibleAssetExchangeAgreement extends pb_1.Message { + constructor(data?: any[] | { + type?: string; + numUnits?: number; + locker?: string; + recipient?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("type" in data && data.type != undefined) { + this.type = data.type; + } + if ("numUnits" in data && data.numUnits != undefined) { + this.numUnits = data.numUnits; + } + if ("locker" in data && data.locker != undefined) { + this.locker = data.locker; + } + if ("recipient" in data && data.recipient != undefined) { + this.recipient = data.recipient; + } + } + } + get type() { + return pb_1.Message.getField(this, 1) as string; + } + set type(value: string) { + pb_1.Message.setField(this, 1, value); + } + get numUnits() { + return pb_1.Message.getField(this, 2) as number; + } + set numUnits(value: number) { + pb_1.Message.setField(this, 2, value); + } + get locker() { + return pb_1.Message.getField(this, 3) as string; + } + set locker(value: string) { + pb_1.Message.setField(this, 3, value); + } + get recipient() { + return pb_1.Message.getField(this, 4) as string; + } + set recipient(value: string) { + pb_1.Message.setField(this, 4, value); + } + toObject() { + const data: { + type?: string; + numUnits?: number; + locker?: string; + recipient?: string; + } = {}; + if (this.type != null) { + data.type = this.type; + } + if (this.numUnits != null) { + data.numUnits = this.numUnits; + } + if (this.locker != null) { + data.locker = this.locker; + } + if (this.recipient != null) { + data.recipient = this.recipient; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.type === "string" && this.type.length) + writer.writeString(1, this.type); + if (this.numUnits !== undefined) + writer.writeUint64(2, this.numUnits); + if (typeof this.locker === "string" && this.locker.length) + writer.writeString(3, this.locker); + if (typeof this.recipient === "string" && this.recipient.length) + writer.writeString(4, this.recipient); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): FungibleAssetExchangeAgreement { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new FungibleAssetExchangeAgreement(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.type = reader.readString(); + break; + case 2: + message.numUnits = reader.readUint64(); + break; + case 3: + message.locker = reader.readString(); + break; + case 4: + message.recipient = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): FungibleAssetExchangeAgreement { + return FungibleAssetExchangeAgreement.deserialize(bytes); + } + } + export class AssetContractHTLC extends pb_1.Message { + constructor(data?: any[] | { + contractId?: string; + agreement?: AssetExchangeAgreement; + lock?: AssetLockHTLC; + claim?: AssetClaimHTLC; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("contractId" in data && data.contractId != undefined) { + this.contractId = data.contractId; + } + if ("agreement" in data && data.agreement != undefined) { + this.agreement = data.agreement; + } + if ("lock" in data && data.lock != undefined) { + this.lock = data.lock; + } + if ("claim" in data && data.claim != undefined) { + this.claim = data.claim; + } + } + } + get contractId() { + return pb_1.Message.getField(this, 1) as string; + } + set contractId(value: string) { + pb_1.Message.setField(this, 1, value); + } + get agreement() { + return pb_1.Message.getWrapperField(this, AssetExchangeAgreement, 2) as AssetExchangeAgreement; + } + set agreement(value: AssetExchangeAgreement) { + pb_1.Message.setWrapperField(this, 2, value); + } + get lock() { + return pb_1.Message.getWrapperField(this, AssetLockHTLC, 3) as AssetLockHTLC; + } + set lock(value: AssetLockHTLC) { + pb_1.Message.setWrapperField(this, 3, value); + } + get claim() { + return pb_1.Message.getWrapperField(this, AssetClaimHTLC, 4) as AssetClaimHTLC; + } + set claim(value: AssetClaimHTLC) { + pb_1.Message.setWrapperField(this, 4, value); + } + toObject() { + const data: { + contractId?: string; + agreement?: ReturnType; + lock?: ReturnType; + claim?: ReturnType; + } = {}; + if (this.contractId != null) { + data.contractId = this.contractId; + } + if (this.agreement != null) { + data.agreement = this.agreement.toObject(); + } + if (this.lock != null) { + data.lock = this.lock.toObject(); + } + if (this.claim != null) { + data.claim = this.claim.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.contractId === "string" && this.contractId.length) + writer.writeString(1, this.contractId); + if (this.agreement !== undefined) + writer.writeMessage(2, this.agreement, () => this.agreement.serialize(writer)); + if (this.lock !== undefined) + writer.writeMessage(3, this.lock, () => this.lock.serialize(writer)); + if (this.claim !== undefined) + writer.writeMessage(4, this.claim, () => this.claim.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AssetContractHTLC { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AssetContractHTLC(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.contractId = reader.readString(); + break; + case 2: + reader.readMessage(message.agreement, () => message.agreement = AssetExchangeAgreement.deserialize(reader)); + break; + case 3: + reader.readMessage(message.lock, () => message.lock = AssetLockHTLC.deserialize(reader)); + break; + case 4: + reader.readMessage(message.claim, () => message.claim = AssetClaimHTLC.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): AssetContractHTLC { + return AssetContractHTLC.deserialize(bytes); + } + } + export class FungibleAssetContractHTLC extends pb_1.Message { + constructor(data?: any[] | { + contractId?: string; + agreement?: FungibleAssetExchangeAgreement; + lock?: AssetLockHTLC; + claim?: AssetClaimHTLC; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("contractId" in data && data.contractId != undefined) { + this.contractId = data.contractId; + } + if ("agreement" in data && data.agreement != undefined) { + this.agreement = data.agreement; + } + if ("lock" in data && data.lock != undefined) { + this.lock = data.lock; + } + if ("claim" in data && data.claim != undefined) { + this.claim = data.claim; + } + } + } + get contractId() { + return pb_1.Message.getField(this, 1) as string; + } + set contractId(value: string) { + pb_1.Message.setField(this, 1, value); + } + get agreement() { + return pb_1.Message.getWrapperField(this, FungibleAssetExchangeAgreement, 2) as FungibleAssetExchangeAgreement; + } + set agreement(value: FungibleAssetExchangeAgreement) { + pb_1.Message.setWrapperField(this, 2, value); + } + get lock() { + return pb_1.Message.getWrapperField(this, AssetLockHTLC, 3) as AssetLockHTLC; + } + set lock(value: AssetLockHTLC) { + pb_1.Message.setWrapperField(this, 3, value); + } + get claim() { + return pb_1.Message.getWrapperField(this, AssetClaimHTLC, 4) as AssetClaimHTLC; + } + set claim(value: AssetClaimHTLC) { + pb_1.Message.setWrapperField(this, 4, value); + } + toObject() { + const data: { + contractId?: string; + agreement?: ReturnType; + lock?: ReturnType; + claim?: ReturnType; + } = {}; + if (this.contractId != null) { + data.contractId = this.contractId; + } + if (this.agreement != null) { + data.agreement = this.agreement.toObject(); + } + if (this.lock != null) { + data.lock = this.lock.toObject(); + } + if (this.claim != null) { + data.claim = this.claim.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.contractId === "string" && this.contractId.length) + writer.writeString(1, this.contractId); + if (this.agreement !== undefined) + writer.writeMessage(2, this.agreement, () => this.agreement.serialize(writer)); + if (this.lock !== undefined) + writer.writeMessage(3, this.lock, () => this.lock.serialize(writer)); + if (this.claim !== undefined) + writer.writeMessage(4, this.claim, () => this.claim.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): FungibleAssetContractHTLC { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new FungibleAssetContractHTLC(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.contractId = reader.readString(); + break; + case 2: + reader.readMessage(message.agreement, () => message.agreement = FungibleAssetExchangeAgreement.deserialize(reader)); + break; + case 3: + reader.readMessage(message.lock, () => message.lock = AssetLockHTLC.deserialize(reader)); + break; + case 4: + reader.readMessage(message.claim, () => message.claim = AssetClaimHTLC.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): FungibleAssetContractHTLC { + return FungibleAssetContractHTLC.deserialize(bytes); + } + } +} diff --git a/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/interop_payload.ts b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/interop_payload.ts new file mode 100644 index 0000000000..d05241db89 --- /dev/null +++ b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/interop_payload.ts @@ -0,0 +1,86 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.15.6 + * source: common/interop_payload.proto + * git: https://github.com/thesayyn/protoc-gen-ts + * buymeacoffee: https://www.buymeacoffee.com/thesayyn + * */ +import * as pb_1 from "google-protobuf"; +export namespace common.interop_payload { + export class InteropPayload extends pb_1.Message { + constructor(data?: any[] | { + payload?: Uint8Array; + address?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("payload" in data && data.payload != undefined) { + this.payload = data.payload; + } + if ("address" in data && data.address != undefined) { + this.address = data.address; + } + } + } + get payload() { + return pb_1.Message.getField(this, 1) as Uint8Array; + } + set payload(value: Uint8Array) { + pb_1.Message.setField(this, 1, value); + } + get address() { + return pb_1.Message.getField(this, 2) as string; + } + set address(value: string) { + pb_1.Message.setField(this, 2, value); + } + toObject() { + const data: { + payload?: Uint8Array; + address?: string; + } = {}; + if (this.payload != null) { + data.payload = this.payload; + } + if (this.address != null) { + data.address = this.address; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.payload !== undefined) + writer.writeBytes(1, this.payload); + if (typeof this.address === "string" && this.address.length) + writer.writeString(2, this.address); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): InteropPayload { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new InteropPayload(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.payload = reader.readBytes(); + break; + case 2: + message.address = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): InteropPayload { + return InteropPayload.deserialize(bytes); + } + } +} diff --git a/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/membership.ts b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/membership.ts new file mode 100644 index 0000000000..54ea978336 --- /dev/null +++ b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/membership.ts @@ -0,0 +1,193 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.15.6 + * source: common/membership.proto + * git: https://github.com/thesayyn/protoc-gen-ts + * buymeacoffee: https://www.buymeacoffee.com/thesayyn + * */ +import * as pb_1 from "google-protobuf"; +export namespace common.membership { + export class Membership extends pb_1.Message { + constructor(data?: any[] | { + securityDomain?: string; + members?: Map; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("securityDomain" in data && data.securityDomain != undefined) { + this.securityDomain = data.securityDomain; + } + if ("members" in data && data.members != undefined) { + this.members = data.members; + } + } + if (!this.members) + this.members = new Map() + } + get securityDomain() { + return pb_1.Message.getField(this, 1) as string; + } + set securityDomain(value: string) { + pb_1.Message.setField(this, 1, value); + } + get members() { + return pb_1.Message.getField(this, 2) as any as Map; + } + set members(value: Map) { + pb_1.Message.setField(this, 2, value as any); + } + toObject() { + const data: { + securityDomain?: string; + members?: { + [key: string]: ReturnType; + }; + } = {}; + if (this.securityDomain != null) { + data.securityDomain = this.securityDomain; + } + if (this.members.size > 0) { + data.members = Object.fromEntries(Array.from(this.members).map(([key, value]) => [key, value.toObject()])); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.securityDomain === "string" && this.securityDomain.length) + writer.writeString(1, this.securityDomain); + for (const [key, value] of this.members) { + writer.writeMessage(2, this.members, () => { + writer.writeString(1, key); + writer.writeMessage(2, value, () => value.serialize(writer)); + }) + } + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Membership { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Membership(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.securityDomain = reader.readString(); + break; + case 2: + reader.readMessage(message, () => (pb_1.Map as any).deserializeBinary(message.members, reader, reader.readString, () => { + let value; + reader.readMessage(message, () => value = Member.deserialize(reader)) + return value; + })); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Membership { + return Membership.deserialize(bytes); + } + } + export class Member extends pb_1.Message { + constructor(data?: any[] | { + value?: string; + type?: string; + chain?: string[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("value" in data && data.value != undefined) { + this.value = data.value; + } + if ("type" in data && data.type != undefined) { + this.type = data.type; + } + if ("chain" in data && data.chain != undefined) { + this.chain = data.chain; + } + } + } + get value() { + return pb_1.Message.getField(this, 1) as string; + } + set value(value: string) { + pb_1.Message.setField(this, 1, value); + } + get type() { + return pb_1.Message.getField(this, 2) as string; + } + set type(value: string) { + pb_1.Message.setField(this, 2, value); + } + get chain() { + return pb_1.Message.getField(this, 3) as string[]; + } + set chain(value: string[]) { + pb_1.Message.setField(this, 3, value); + } + toObject() { + const data: { + value?: string; + type?: string; + chain?: string[]; + } = {}; + if (this.value != null) { + data.value = this.value; + } + if (this.type != null) { + data.type = this.type; + } + if (this.chain != null) { + data.chain = this.chain; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.value === "string" && this.value.length) + writer.writeString(1, this.value); + if (typeof this.type === "string" && this.type.length) + writer.writeString(2, this.type); + if (this.chain !== undefined) + writer.writeRepeatedString(3, this.chain); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Member { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Member(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.value = reader.readString(); + break; + case 2: + message.type = reader.readString(); + break; + case 3: + pb_1.Message.addToRepeatedField(message, 3, reader.readString()); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Member { + return Member.deserialize(bytes); + } + } +} diff --git a/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/proofs.ts b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/proofs.ts new file mode 100644 index 0000000000..df24efabb4 --- /dev/null +++ b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/proofs.ts @@ -0,0 +1,143 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.15.6 + * source: common/proofs.proto + * git: https://github.com/thesayyn/protoc-gen-ts + * buymeacoffee: https://www.buymeacoffee.com/thesayyn + * */ +import * as pb_1 from "google-protobuf"; +export namespace common.proofs { + export class Proof extends pb_1.Message { + constructor(data?: any[] | { + signature?: string; + certificate?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("signature" in data && data.signature != undefined) { + this.signature = data.signature; + } + if ("certificate" in data && data.certificate != undefined) { + this.certificate = data.certificate; + } + } + } + get signature() { + return pb_1.Message.getField(this, 1) as string; + } + set signature(value: string) { + pb_1.Message.setField(this, 1, value); + } + get certificate() { + return pb_1.Message.getField(this, 2) as string; + } + set certificate(value: string) { + pb_1.Message.setField(this, 2, value); + } + toObject() { + const data: { + signature?: string; + certificate?: string; + } = {}; + if (this.signature != null) { + data.signature = this.signature; + } + if (this.certificate != null) { + data.certificate = this.certificate; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.signature === "string" && this.signature.length) + writer.writeString(1, this.signature); + if (typeof this.certificate === "string" && this.certificate.length) + writer.writeString(2, this.certificate); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Proof { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Proof(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.signature = reader.readString(); + break; + case 2: + message.certificate = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Proof { + return Proof.deserialize(bytes); + } + } + export class Proofs extends pb_1.Message { + constructor(data?: any[] | { + proofs?: Proof[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("proofs" in data && data.proofs != undefined) { + this.proofs = data.proofs; + } + } + } + get proofs() { + return pb_1.Message.getRepeatedWrapperField(this, Proof, 1) as Proof[]; + } + set proofs(value: Proof[]) { + pb_1.Message.setRepeatedWrapperField(this, 1, value); + } + toObject() { + const data: { + proofs?: ReturnType[]; + } = {}; + if (this.proofs != null) { + data.proofs = this.proofs.map((item: Proof) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.proofs !== undefined) + writer.writeRepeatedMessage(1, this.proofs, (item: Proof) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Proofs { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Proofs(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.proofs, () => pb_1.Message.addToRepeatedWrapperField(message, 1, Proof.deserialize(reader), Proof)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Proofs { + return Proofs.deserialize(bytes); + } + } +} diff --git a/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/query.ts b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/query.ts new file mode 100644 index 0000000000..4b77ec771c --- /dev/null +++ b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/query.ts @@ -0,0 +1,219 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.15.6 + * source: common/query.proto + * git: https://github.com/thesayyn/protoc-gen-ts + * buymeacoffee: https://www.buymeacoffee.com/thesayyn + * */ +import * as pb_1 from "google-protobuf"; +export namespace common.query { + export class Query extends pb_1.Message { + constructor(data?: any[] | { + policy?: string[]; + address?: string; + requesting_relay?: string; + requesting_network?: string; + certificate?: string; + requestor_signature?: string; + nonce?: string; + request_id?: string; + requesting_org?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("policy" in data && data.policy != undefined) { + this.policy = data.policy; + } + if ("address" in data && data.address != undefined) { + this.address = data.address; + } + if ("requesting_relay" in data && data.requesting_relay != undefined) { + this.requesting_relay = data.requesting_relay; + } + if ("requesting_network" in data && data.requesting_network != undefined) { + this.requesting_network = data.requesting_network; + } + if ("certificate" in data && data.certificate != undefined) { + this.certificate = data.certificate; + } + if ("requestor_signature" in data && data.requestor_signature != undefined) { + this.requestor_signature = data.requestor_signature; + } + if ("nonce" in data && data.nonce != undefined) { + this.nonce = data.nonce; + } + if ("request_id" in data && data.request_id != undefined) { + this.request_id = data.request_id; + } + if ("requesting_org" in data && data.requesting_org != undefined) { + this.requesting_org = data.requesting_org; + } + } + } + get policy() { + return pb_1.Message.getField(this, 1) as string[]; + } + set policy(value: string[]) { + pb_1.Message.setField(this, 1, value); + } + get address() { + return pb_1.Message.getField(this, 2) as string; + } + set address(value: string) { + pb_1.Message.setField(this, 2, value); + } + get requesting_relay() { + return pb_1.Message.getField(this, 3) as string; + } + set requesting_relay(value: string) { + pb_1.Message.setField(this, 3, value); + } + get requesting_network() { + return pb_1.Message.getField(this, 4) as string; + } + set requesting_network(value: string) { + pb_1.Message.setField(this, 4, value); + } + get certificate() { + return pb_1.Message.getField(this, 5) as string; + } + set certificate(value: string) { + pb_1.Message.setField(this, 5, value); + } + get requestor_signature() { + return pb_1.Message.getField(this, 6) as string; + } + set requestor_signature(value: string) { + pb_1.Message.setField(this, 6, value); + } + get nonce() { + return pb_1.Message.getField(this, 7) as string; + } + set nonce(value: string) { + pb_1.Message.setField(this, 7, value); + } + get request_id() { + return pb_1.Message.getField(this, 8) as string; + } + set request_id(value: string) { + pb_1.Message.setField(this, 8, value); + } + get requesting_org() { + return pb_1.Message.getField(this, 9) as string; + } + set requesting_org(value: string) { + pb_1.Message.setField(this, 9, value); + } + toObject() { + const data: { + policy?: string[]; + address?: string; + requesting_relay?: string; + requesting_network?: string; + certificate?: string; + requestor_signature?: string; + nonce?: string; + request_id?: string; + requesting_org?: string; + } = {}; + if (this.policy != null) { + data.policy = this.policy; + } + if (this.address != null) { + data.address = this.address; + } + if (this.requesting_relay != null) { + data.requesting_relay = this.requesting_relay; + } + if (this.requesting_network != null) { + data.requesting_network = this.requesting_network; + } + if (this.certificate != null) { + data.certificate = this.certificate; + } + if (this.requestor_signature != null) { + data.requestor_signature = this.requestor_signature; + } + if (this.nonce != null) { + data.nonce = this.nonce; + } + if (this.request_id != null) { + data.request_id = this.request_id; + } + if (this.requesting_org != null) { + data.requesting_org = this.requesting_org; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.policy !== undefined) + writer.writeRepeatedString(1, this.policy); + if (typeof this.address === "string" && this.address.length) + writer.writeString(2, this.address); + if (typeof this.requesting_relay === "string" && this.requesting_relay.length) + writer.writeString(3, this.requesting_relay); + if (typeof this.requesting_network === "string" && this.requesting_network.length) + writer.writeString(4, this.requesting_network); + if (typeof this.certificate === "string" && this.certificate.length) + writer.writeString(5, this.certificate); + if (typeof this.requestor_signature === "string" && this.requestor_signature.length) + writer.writeString(6, this.requestor_signature); + if (typeof this.nonce === "string" && this.nonce.length) + writer.writeString(7, this.nonce); + if (typeof this.request_id === "string" && this.request_id.length) + writer.writeString(8, this.request_id); + if (typeof this.requesting_org === "string" && this.requesting_org.length) + writer.writeString(9, this.requesting_org); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Query { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Query(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + pb_1.Message.addToRepeatedField(message, 1, reader.readString()); + break; + case 2: + message.address = reader.readString(); + break; + case 3: + message.requesting_relay = reader.readString(); + break; + case 4: + message.requesting_network = reader.readString(); + break; + case 5: + message.certificate = reader.readString(); + break; + case 6: + message.requestor_signature = reader.readString(); + break; + case 7: + message.nonce = reader.readString(); + break; + case 8: + message.request_id = reader.readString(); + break; + case 9: + message.requesting_org = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Query { + return Query.deserialize(bytes); + } + } +} diff --git a/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/state.ts b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/state.ts new file mode 100644 index 0000000000..c6c2c4619f --- /dev/null +++ b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/state.ts @@ -0,0 +1,453 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.15.6 + * source: common/state.proto + * git: https://github.com/thesayyn/protoc-gen-ts + * buymeacoffee: https://www.buymeacoffee.com/thesayyn + * */ +import * as pb_1 from "google-protobuf"; +export namespace common.state { + export class Meta extends pb_1.Message { + constructor(data?: any[] | { + protocol?: Meta.Protocol; + timestamp?: string; + proof_type?: string; + serialization_format?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("protocol" in data && data.protocol != undefined) { + this.protocol = data.protocol; + } + if ("timestamp" in data && data.timestamp != undefined) { + this.timestamp = data.timestamp; + } + if ("proof_type" in data && data.proof_type != undefined) { + this.proof_type = data.proof_type; + } + if ("serialization_format" in data && data.serialization_format != undefined) { + this.serialization_format = data.serialization_format; + } + } + } + get protocol() { + return pb_1.Message.getField(this, 1) as Meta.Protocol; + } + set protocol(value: Meta.Protocol) { + pb_1.Message.setField(this, 1, value); + } + get timestamp() { + return pb_1.Message.getField(this, 2) as string; + } + set timestamp(value: string) { + pb_1.Message.setField(this, 2, value); + } + get proof_type() { + return pb_1.Message.getField(this, 3) as string; + } + set proof_type(value: string) { + pb_1.Message.setField(this, 3, value); + } + get serialization_format() { + return pb_1.Message.getField(this, 4) as string; + } + set serialization_format(value: string) { + pb_1.Message.setField(this, 4, value); + } + toObject() { + const data: { + protocol?: Meta.Protocol; + timestamp?: string; + proof_type?: string; + serialization_format?: string; + } = {}; + if (this.protocol != null) { + data.protocol = this.protocol; + } + if (this.timestamp != null) { + data.timestamp = this.timestamp; + } + if (this.proof_type != null) { + data.proof_type = this.proof_type; + } + if (this.serialization_format != null) { + data.serialization_format = this.serialization_format; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.protocol !== undefined) + writer.writeEnum(1, this.protocol); + if (typeof this.timestamp === "string" && this.timestamp.length) + writer.writeString(2, this.timestamp); + if (typeof this.proof_type === "string" && this.proof_type.length) + writer.writeString(3, this.proof_type); + if (typeof this.serialization_format === "string" && this.serialization_format.length) + writer.writeString(4, this.serialization_format); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Meta { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Meta(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.protocol = reader.readEnum(); + break; + case 2: + message.timestamp = reader.readString(); + break; + case 3: + message.proof_type = reader.readString(); + break; + case 4: + message.serialization_format = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Meta { + return Meta.deserialize(bytes); + } + } + export namespace Meta { + export enum Protocol { + BITCOIN = 0, + ETHEREUM = 1, + FABRIC = 3, + CORDA = 4 + } + } + export class View extends pb_1.Message { + constructor(data?: any[] | { + meta?: Meta; + data?: Uint8Array; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("meta" in data && data.meta != undefined) { + this.meta = data.meta; + } + if ("data" in data && data.data != undefined) { + this.data = data.data; + } + } + } + get meta() { + return pb_1.Message.getWrapperField(this, Meta, 1) as Meta; + } + set meta(value: Meta) { + pb_1.Message.setWrapperField(this, 1, value); + } + get data() { + return pb_1.Message.getField(this, 2) as Uint8Array; + } + set data(value: Uint8Array) { + pb_1.Message.setField(this, 2, value); + } + toObject() { + const data: { + meta?: ReturnType; + data?: Uint8Array; + } = {}; + if (this.meta != null) { + data.meta = this.meta.toObject(); + } + if (this.data != null) { + data.data = this.data; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.meta !== undefined) + writer.writeMessage(1, this.meta, () => this.meta.serialize(writer)); + if (this.data !== undefined) + writer.writeBytes(2, this.data); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): View { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new View(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.meta, () => message.meta = Meta.deserialize(reader)); + break; + case 2: + message.data = reader.readBytes(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): View { + return View.deserialize(bytes); + } + } + export class ViewPayload extends pb_1.Message { + constructor(data?: any[] | ({ + request_id?: string; + } & (({ + view?: View; + error?: never; + } | { + view?: never; + error?: string; + })))) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], [[2, 3]]); + if (!Array.isArray(data) && typeof data == "object") { + if ("request_id" in data && data.request_id != undefined) { + this.request_id = data.request_id; + } + if ("view" in data && data.view != undefined) { + this.view = data.view; + } + if ("error" in data && data.error != undefined) { + this.error = data.error; + } + } + } + get request_id() { + return pb_1.Message.getField(this, 1) as string; + } + set request_id(value: string) { + pb_1.Message.setField(this, 1, value); + } + get view() { + return pb_1.Message.getWrapperField(this, View, 2) as View; + } + set view(value: View) { + pb_1.Message.setOneofWrapperField(this, 2, [2, 3], value); + } + get error() { + return pb_1.Message.getField(this, 3) as string; + } + set error(value: string) { + pb_1.Message.setOneofField(this, 3, [2, 3], value); + } + get state() { + const cases: { + [index: number]: "none" | "view" | "error"; + } = { + 0: "none", + 2: "view", + 3: "error" + }; + return cases[pb_1.Message.computeOneofCase(this, [2, 3])]; + } + toObject() { + const data: { + request_id?: string; + view?: ReturnType; + error?: string; + } = {}; + if (this.request_id != null) { + data.request_id = this.request_id; + } + if (this.view != null) { + data.view = this.view.toObject(); + } + if (this.error != null) { + data.error = this.error; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.request_id === "string" && this.request_id.length) + writer.writeString(1, this.request_id); + if (this.view !== undefined) + writer.writeMessage(2, this.view, () => this.view.serialize(writer)); + if (typeof this.error === "string" && this.error.length) + writer.writeString(3, this.error); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ViewPayload { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ViewPayload(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.request_id = reader.readString(); + break; + case 2: + reader.readMessage(message.view, () => message.view = View.deserialize(reader)); + break; + case 3: + message.error = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): ViewPayload { + return ViewPayload.deserialize(bytes); + } + } + export class RequestState extends pb_1.Message { + constructor(data?: any[] | ({ + request_id?: string; + status?: RequestState.STATUS; + } & (({ + view?: View; + error?: never; + } | { + view?: never; + error?: string; + })))) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], [[3, 4]]); + if (!Array.isArray(data) && typeof data == "object") { + if ("request_id" in data && data.request_id != undefined) { + this.request_id = data.request_id; + } + if ("status" in data && data.status != undefined) { + this.status = data.status; + } + if ("view" in data && data.view != undefined) { + this.view = data.view; + } + if ("error" in data && data.error != undefined) { + this.error = data.error; + } + } + } + get request_id() { + return pb_1.Message.getField(this, 1) as string; + } + set request_id(value: string) { + pb_1.Message.setField(this, 1, value); + } + get status() { + return pb_1.Message.getField(this, 2) as RequestState.STATUS; + } + set status(value: RequestState.STATUS) { + pb_1.Message.setField(this, 2, value); + } + get view() { + return pb_1.Message.getWrapperField(this, View, 3) as View; + } + set view(value: View) { + pb_1.Message.setOneofWrapperField(this, 3, [3, 4], value); + } + get error() { + return pb_1.Message.getField(this, 4) as string; + } + set error(value: string) { + pb_1.Message.setOneofField(this, 4, [3, 4], value); + } + get state() { + const cases: { + [index: number]: "none" | "view" | "error"; + } = { + 0: "none", + 3: "view", + 4: "error" + }; + return cases[pb_1.Message.computeOneofCase(this, [3, 4])]; + } + toObject() { + const data: { + request_id?: string; + status?: RequestState.STATUS; + view?: ReturnType; + error?: string; + } = {}; + if (this.request_id != null) { + data.request_id = this.request_id; + } + if (this.status != null) { + data.status = this.status; + } + if (this.view != null) { + data.view = this.view.toObject(); + } + if (this.error != null) { + data.error = this.error; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.request_id === "string" && this.request_id.length) + writer.writeString(1, this.request_id); + if (this.status !== undefined) + writer.writeEnum(2, this.status); + if (this.view !== undefined) + writer.writeMessage(3, this.view, () => this.view.serialize(writer)); + if (typeof this.error === "string" && this.error.length) + writer.writeString(4, this.error); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): RequestState { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new RequestState(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.request_id = reader.readString(); + break; + case 2: + message.status = reader.readEnum(); + break; + case 3: + reader.readMessage(message.view, () => message.view = View.deserialize(reader)); + break; + case 4: + message.error = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): RequestState { + return RequestState.deserialize(bytes); + } + } + export namespace RequestState { + export enum STATUS { + PENDING_ACK = 0, + PENDING = 1, + ERROR = 2, + COMPLETED = 3 + } + } +} diff --git a/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/verification_policy.ts b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/verification_policy.ts new file mode 100644 index 0000000000..3f778f582c --- /dev/null +++ b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/common/verification_policy.ts @@ -0,0 +1,238 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.15.6 + * source: common/verification_policy.proto + * git: https://github.com/thesayyn/protoc-gen-ts + * buymeacoffee: https://www.buymeacoffee.com/thesayyn + * */ +import * as pb_1 from "google-protobuf"; +export namespace common.verification_policy { + export class VerificationPolicy extends pb_1.Message { + constructor(data?: any[] | { + securityDomain?: string; + identifiers?: Identifier[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("securityDomain" in data && data.securityDomain != undefined) { + this.securityDomain = data.securityDomain; + } + if ("identifiers" in data && data.identifiers != undefined) { + this.identifiers = data.identifiers; + } + } + } + get securityDomain() { + return pb_1.Message.getField(this, 1) as string; + } + set securityDomain(value: string) { + pb_1.Message.setField(this, 1, value); + } + get identifiers() { + return pb_1.Message.getRepeatedWrapperField(this, Identifier, 2) as Identifier[]; + } + set identifiers(value: Identifier[]) { + pb_1.Message.setRepeatedWrapperField(this, 2, value); + } + toObject() { + const data: { + securityDomain?: string; + identifiers?: ReturnType[]; + } = {}; + if (this.securityDomain != null) { + data.securityDomain = this.securityDomain; + } + if (this.identifiers != null) { + data.identifiers = this.identifiers.map((item: Identifier) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.securityDomain === "string" && this.securityDomain.length) + writer.writeString(1, this.securityDomain); + if (this.identifiers !== undefined) + writer.writeRepeatedMessage(2, this.identifiers, (item: Identifier) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): VerificationPolicy { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new VerificationPolicy(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.securityDomain = reader.readString(); + break; + case 2: + reader.readMessage(message.identifiers, () => pb_1.Message.addToRepeatedWrapperField(message, 2, Identifier.deserialize(reader), Identifier)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): VerificationPolicy { + return VerificationPolicy.deserialize(bytes); + } + } + export class Policy extends pb_1.Message { + constructor(data?: any[] | { + type?: string; + criteria?: string[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("type" in data && data.type != undefined) { + this.type = data.type; + } + if ("criteria" in data && data.criteria != undefined) { + this.criteria = data.criteria; + } + } + } + get type() { + return pb_1.Message.getField(this, 1) as string; + } + set type(value: string) { + pb_1.Message.setField(this, 1, value); + } + get criteria() { + return pb_1.Message.getField(this, 2) as string[]; + } + set criteria(value: string[]) { + pb_1.Message.setField(this, 2, value); + } + toObject() { + const data: { + type?: string; + criteria?: string[]; + } = {}; + if (this.type != null) { + data.type = this.type; + } + if (this.criteria != null) { + data.criteria = this.criteria; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.type === "string" && this.type.length) + writer.writeString(1, this.type); + if (this.criteria !== undefined) + writer.writeRepeatedString(2, this.criteria); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Policy { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Policy(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.type = reader.readString(); + break; + case 2: + pb_1.Message.addToRepeatedField(message, 2, reader.readString()); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Policy { + return Policy.deserialize(bytes); + } + } + export class Identifier extends pb_1.Message { + constructor(data?: any[] | { + pattern?: string; + policy?: Policy; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("pattern" in data && data.pattern != undefined) { + this.pattern = data.pattern; + } + if ("policy" in data && data.policy != undefined) { + this.policy = data.policy; + } + } + } + get pattern() { + return pb_1.Message.getField(this, 1) as string; + } + set pattern(value: string) { + pb_1.Message.setField(this, 1, value); + } + get policy() { + return pb_1.Message.getWrapperField(this, Policy, 2) as Policy; + } + set policy(value: Policy) { + pb_1.Message.setWrapperField(this, 2, value); + } + toObject() { + const data: { + pattern?: string; + policy?: ReturnType; + } = {}; + if (this.pattern != null) { + data.pattern = this.pattern; + } + if (this.policy != null) { + data.policy = this.policy.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.pattern === "string" && this.pattern.length) + writer.writeString(1, this.pattern); + if (this.policy !== undefined) + writer.writeMessage(2, this.policy, () => this.policy.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Identifier { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Identifier(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.pattern = reader.readString(); + break; + case 2: + reader.readMessage(message.policy, () => message.policy = Policy.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Identifier { + return Identifier.deserialize(bytes); + } + } +} diff --git a/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/corda/view_data.ts b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/corda/view_data.ts new file mode 100644 index 0000000000..ad18a4c2d8 --- /dev/null +++ b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/corda/view_data.ts @@ -0,0 +1,183 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.15.6 + * source: corda/view_data.proto + * git: https://github.com/thesayyn/protoc-gen-ts + * buymeacoffee: https://www.buymeacoffee.com/thesayyn + * */ +import * as pb_1 from "google-protobuf"; +export namespace corda { + export class ViewData extends pb_1.Message { + constructor(data?: any[] | { + notarizations?: ViewData.Notarization[]; + payload?: Uint8Array; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("notarizations" in data && data.notarizations != undefined) { + this.notarizations = data.notarizations; + } + if ("payload" in data && data.payload != undefined) { + this.payload = data.payload; + } + } + } + get notarizations() { + return pb_1.Message.getRepeatedWrapperField(this, ViewData.Notarization, 1) as ViewData.Notarization[]; + } + set notarizations(value: ViewData.Notarization[]) { + pb_1.Message.setRepeatedWrapperField(this, 1, value); + } + get payload() { + return pb_1.Message.getField(this, 2) as Uint8Array; + } + set payload(value: Uint8Array) { + pb_1.Message.setField(this, 2, value); + } + toObject() { + const data: { + notarizations?: ReturnType[]; + payload?: Uint8Array; + } = {}; + if (this.notarizations != null) { + data.notarizations = this.notarizations.map((item: ViewData.Notarization) => item.toObject()); + } + if (this.payload != null) { + data.payload = this.payload; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.notarizations !== undefined) + writer.writeRepeatedMessage(1, this.notarizations, (item: ViewData.Notarization) => item.serialize(writer)); + if (this.payload !== undefined) + writer.writeBytes(2, this.payload); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ViewData { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ViewData(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.notarizations, () => pb_1.Message.addToRepeatedWrapperField(message, 1, ViewData.Notarization.deserialize(reader), ViewData.Notarization)); + break; + case 2: + message.payload = reader.readBytes(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): ViewData { + return ViewData.deserialize(bytes); + } + } + export namespace ViewData { + export class Notarization extends pb_1.Message { + constructor(data?: any[] | { + signature?: string; + certificate?: string; + id?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("signature" in data && data.signature != undefined) { + this.signature = data.signature; + } + if ("certificate" in data && data.certificate != undefined) { + this.certificate = data.certificate; + } + if ("id" in data && data.id != undefined) { + this.id = data.id; + } + } + } + get signature() { + return pb_1.Message.getField(this, 1) as string; + } + set signature(value: string) { + pb_1.Message.setField(this, 1, value); + } + get certificate() { + return pb_1.Message.getField(this, 2) as string; + } + set certificate(value: string) { + pb_1.Message.setField(this, 2, value); + } + get id() { + return pb_1.Message.getField(this, 3) as string; + } + set id(value: string) { + pb_1.Message.setField(this, 3, value); + } + toObject() { + const data: { + signature?: string; + certificate?: string; + id?: string; + } = {}; + if (this.signature != null) { + data.signature = this.signature; + } + if (this.certificate != null) { + data.certificate = this.certificate; + } + if (this.id != null) { + data.id = this.id; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.signature === "string" && this.signature.length) + writer.writeString(1, this.signature); + if (typeof this.certificate === "string" && this.certificate.length) + writer.writeString(2, this.certificate); + if (typeof this.id === "string" && this.id.length) + writer.writeString(3, this.id); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Notarization { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Notarization(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.signature = reader.readString(); + break; + case 2: + message.certificate = reader.readString(); + break; + case 3: + message.id = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Notarization { + return Notarization.deserialize(bytes); + } + } + } +} diff --git a/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/driver/driver.ts b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/driver/driver.ts new file mode 100644 index 0000000000..bb5edd822f --- /dev/null +++ b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/driver/driver.ts @@ -0,0 +1,39 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.15.6 + * source: driver/driver.proto + * git: https://github.com/thesayyn/protoc-gen-ts + * buymeacoffee: https://www.buymeacoffee.com/thesayyn + * */ +import * as dependency_1 from "./../common/ack"; +import * as dependency_2 from "./../common/query"; +import * as grpc_1 from "@grpc/grpc-js"; +export namespace driver.driver { + export abstract class UnimplementedDriverCommunicationService { + static definition = { + RequestDriverState: { + path: "/driver.driver.DriverCommunication/RequestDriverState", + requestStream: false, + responseStream: false, + requestSerialize: (message: dependency_2.common.query.Query) => Buffer.from(message.serialize()), + requestDeserialize: (bytes: Buffer) => dependency_2.common.query.Query.deserialize(new Uint8Array(bytes)), + responseSerialize: (message: dependency_1.common.ack.Ack) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_1.common.ack.Ack.deserialize(new Uint8Array(bytes)) + } + }; + [method: string]: grpc_1.UntypedHandleCall; + abstract RequestDriverState(call: grpc_1.ServerUnaryCall, callback: grpc_1.requestCallback): void; + } + export class DriverCommunicationClient extends grpc_1.makeGenericClientConstructor(UnimplementedDriverCommunicationService.definition, "DriverCommunication", {}) { + constructor(address: string, credentials: grpc_1.ChannelCredentials, options?: Partial) { + super(address, credentials, options) + } + RequestDriverState(message: dependency_2.common.query.Query, metadata: grpc_1.Metadata, options: grpc_1.CallOptions, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + RequestDriverState(message: dependency_2.common.query.Query, metadata: grpc_1.Metadata, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + RequestDriverState(message: dependency_2.common.query.Query, options: grpc_1.CallOptions, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + RequestDriverState(message: dependency_2.common.query.Query, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + RequestDriverState(message: dependency_2.common.query.Query, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall { + return super.RequestDriverState(message, metadata, options, callback); + } + } +} diff --git a/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/networks/networks.ts b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/networks/networks.ts new file mode 100644 index 0000000000..5d71729d1b --- /dev/null +++ b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/networks/networks.ts @@ -0,0 +1,443 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.15.6 + * source: networks/networks.proto + * git: https://github.com/thesayyn/protoc-gen-ts + * buymeacoffee: https://www.buymeacoffee.com/thesayyn + * */ +import * as dependency_1 from "./../common/ack"; +import * as dependency_2 from "./../common/state"; +import * as pb_1 from "google-protobuf"; +import * as grpc_1 from "@grpc/grpc-js"; +export namespace networks.networks { + export class DbName extends pb_1.Message { + constructor(data?: any[] | { + name?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("name" in data && data.name != undefined) { + this.name = data.name; + } + } + } + get name() { + return pb_1.Message.getField(this, 1) as string; + } + set name(value: string) { + pb_1.Message.setField(this, 1, value); + } + toObject() { + const data: { + name?: string; + } = {}; + if (this.name != null) { + data.name = this.name; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.name === "string" && this.name.length) + writer.writeString(1, this.name); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DbName { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DbName(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.name = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): DbName { + return DbName.deserialize(bytes); + } + } + export class RelayDatabase extends pb_1.Message { + constructor(data?: any[] | { + pairs?: Map; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("pairs" in data && data.pairs != undefined) { + this.pairs = data.pairs; + } + } + if (!this.pairs) + this.pairs = new Map() + } + get pairs() { + return pb_1.Message.getField(this, 1) as any as Map; + } + set pairs(value: Map) { + pb_1.Message.setField(this, 1, value as any); + } + toObject() { + const data: { + pairs?: { + [key: string]: string; + }; + } = {}; + if (this.pairs.size > 0) { + data.pairs = Object.fromEntries(this.pairs); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + for (const [key, value] of this.pairs) { + writer.writeMessage(1, this.pairs, () => { + writer.writeString(1, key); + writer.writeString(2, value); + }) + } + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): RelayDatabase { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new RelayDatabase(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message, () => (pb_1.Map as any).deserializeBinary(message.pairs, reader, reader.readString, reader.readString)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): RelayDatabase { + return RelayDatabase.deserialize(bytes); + } + } + export class GetStateMessage extends pb_1.Message { + constructor(data?: any[] | { + request_id?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("request_id" in data && data.request_id != undefined) { + this.request_id = data.request_id; + } + } + } + get request_id() { + return pb_1.Message.getField(this, 1) as string; + } + set request_id(value: string) { + pb_1.Message.setField(this, 1, value); + } + toObject() { + const data: { + request_id?: string; + } = {}; + if (this.request_id != null) { + data.request_id = this.request_id; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.request_id === "string" && this.request_id.length) + writer.writeString(1, this.request_id); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetStateMessage { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetStateMessage(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.request_id = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GetStateMessage { + return GetStateMessage.deserialize(bytes); + } + } + export class NetworkQuery extends pb_1.Message { + constructor(data?: any[] | { + policy?: string[]; + address?: string; + requesting_relay?: string; + requesting_network?: string; + certificate?: string; + requestor_signature?: string; + nonce?: string; + requesting_org?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("policy" in data && data.policy != undefined) { + this.policy = data.policy; + } + if ("address" in data && data.address != undefined) { + this.address = data.address; + } + if ("requesting_relay" in data && data.requesting_relay != undefined) { + this.requesting_relay = data.requesting_relay; + } + if ("requesting_network" in data && data.requesting_network != undefined) { + this.requesting_network = data.requesting_network; + } + if ("certificate" in data && data.certificate != undefined) { + this.certificate = data.certificate; + } + if ("requestor_signature" in data && data.requestor_signature != undefined) { + this.requestor_signature = data.requestor_signature; + } + if ("nonce" in data && data.nonce != undefined) { + this.nonce = data.nonce; + } + if ("requesting_org" in data && data.requesting_org != undefined) { + this.requesting_org = data.requesting_org; + } + } + } + get policy() { + return pb_1.Message.getField(this, 1) as string[]; + } + set policy(value: string[]) { + pb_1.Message.setField(this, 1, value); + } + get address() { + return pb_1.Message.getField(this, 2) as string; + } + set address(value: string) { + pb_1.Message.setField(this, 2, value); + } + get requesting_relay() { + return pb_1.Message.getField(this, 3) as string; + } + set requesting_relay(value: string) { + pb_1.Message.setField(this, 3, value); + } + get requesting_network() { + return pb_1.Message.getField(this, 4) as string; + } + set requesting_network(value: string) { + pb_1.Message.setField(this, 4, value); + } + get certificate() { + return pb_1.Message.getField(this, 5) as string; + } + set certificate(value: string) { + pb_1.Message.setField(this, 5, value); + } + get requestor_signature() { + return pb_1.Message.getField(this, 6) as string; + } + set requestor_signature(value: string) { + pb_1.Message.setField(this, 6, value); + } + get nonce() { + return pb_1.Message.getField(this, 7) as string; + } + set nonce(value: string) { + pb_1.Message.setField(this, 7, value); + } + get requesting_org() { + return pb_1.Message.getField(this, 8) as string; + } + set requesting_org(value: string) { + pb_1.Message.setField(this, 8, value); + } + toObject() { + const data: { + policy?: string[]; + address?: string; + requesting_relay?: string; + requesting_network?: string; + certificate?: string; + requestor_signature?: string; + nonce?: string; + requesting_org?: string; + } = {}; + if (this.policy != null) { + data.policy = this.policy; + } + if (this.address != null) { + data.address = this.address; + } + if (this.requesting_relay != null) { + data.requesting_relay = this.requesting_relay; + } + if (this.requesting_network != null) { + data.requesting_network = this.requesting_network; + } + if (this.certificate != null) { + data.certificate = this.certificate; + } + if (this.requestor_signature != null) { + data.requestor_signature = this.requestor_signature; + } + if (this.nonce != null) { + data.nonce = this.nonce; + } + if (this.requesting_org != null) { + data.requesting_org = this.requesting_org; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.policy !== undefined) + writer.writeRepeatedString(1, this.policy); + if (typeof this.address === "string" && this.address.length) + writer.writeString(2, this.address); + if (typeof this.requesting_relay === "string" && this.requesting_relay.length) + writer.writeString(3, this.requesting_relay); + if (typeof this.requesting_network === "string" && this.requesting_network.length) + writer.writeString(4, this.requesting_network); + if (typeof this.certificate === "string" && this.certificate.length) + writer.writeString(5, this.certificate); + if (typeof this.requestor_signature === "string" && this.requestor_signature.length) + writer.writeString(6, this.requestor_signature); + if (typeof this.nonce === "string" && this.nonce.length) + writer.writeString(7, this.nonce); + if (typeof this.requesting_org === "string" && this.requesting_org.length) + writer.writeString(8, this.requesting_org); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): NetworkQuery { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new NetworkQuery(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + pb_1.Message.addToRepeatedField(message, 1, reader.readString()); + break; + case 2: + message.address = reader.readString(); + break; + case 3: + message.requesting_relay = reader.readString(); + break; + case 4: + message.requesting_network = reader.readString(); + break; + case 5: + message.certificate = reader.readString(); + break; + case 6: + message.requestor_signature = reader.readString(); + break; + case 7: + message.nonce = reader.readString(); + break; + case 8: + message.requesting_org = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): NetworkQuery { + return NetworkQuery.deserialize(bytes); + } + } + export abstract class UnimplementedNetworkService { + static definition = { + RequestState: { + path: "/networks.networks.Network/RequestState", + requestStream: false, + responseStream: false, + requestSerialize: (message: NetworkQuery) => Buffer.from(message.serialize()), + requestDeserialize: (bytes: Buffer) => NetworkQuery.deserialize(new Uint8Array(bytes)), + responseSerialize: (message: dependency_1.common.ack.Ack) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_1.common.ack.Ack.deserialize(new Uint8Array(bytes)) + }, + GetState: { + path: "/networks.networks.Network/GetState", + requestStream: false, + responseStream: false, + requestSerialize: (message: GetStateMessage) => Buffer.from(message.serialize()), + requestDeserialize: (bytes: Buffer) => GetStateMessage.deserialize(new Uint8Array(bytes)), + responseSerialize: (message: dependency_2.common.state.RequestState) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_2.common.state.RequestState.deserialize(new Uint8Array(bytes)) + }, + RequestDatabase: { + path: "/networks.networks.Network/RequestDatabase", + requestStream: false, + responseStream: false, + requestSerialize: (message: DbName) => Buffer.from(message.serialize()), + requestDeserialize: (bytes: Buffer) => DbName.deserialize(new Uint8Array(bytes)), + responseSerialize: (message: RelayDatabase) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => RelayDatabase.deserialize(new Uint8Array(bytes)) + } + }; + [method: string]: grpc_1.UntypedHandleCall; + abstract RequestState(call: grpc_1.ServerUnaryCall, callback: grpc_1.requestCallback): void; + abstract GetState(call: grpc_1.ServerUnaryCall, callback: grpc_1.requestCallback): void; + abstract RequestDatabase(call: grpc_1.ServerUnaryCall, callback: grpc_1.requestCallback): void; + } + export class NetworkClient extends grpc_1.makeGenericClientConstructor(UnimplementedNetworkService.definition, "Network", {}) { + constructor(address: string, credentials: grpc_1.ChannelCredentials, options?: Partial) { + super(address, credentials, options) + } + RequestState(message: NetworkQuery, metadata: grpc_1.Metadata, options: grpc_1.CallOptions, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + RequestState(message: NetworkQuery, metadata: grpc_1.Metadata, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + RequestState(message: NetworkQuery, options: grpc_1.CallOptions, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + RequestState(message: NetworkQuery, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + RequestState(message: NetworkQuery, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall { + return super.RequestState(message, metadata, options, callback); + } + GetState(message: GetStateMessage, metadata: grpc_1.Metadata, options: grpc_1.CallOptions, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + GetState(message: GetStateMessage, metadata: grpc_1.Metadata, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + GetState(message: GetStateMessage, options: grpc_1.CallOptions, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + GetState(message: GetStateMessage, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + GetState(message: GetStateMessage, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall { + return super.GetState(message, metadata, options, callback); + } + RequestDatabase(message: DbName, metadata: grpc_1.Metadata, options: grpc_1.CallOptions, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + RequestDatabase(message: DbName, metadata: grpc_1.Metadata, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + RequestDatabase(message: DbName, options: grpc_1.CallOptions, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + RequestDatabase(message: DbName, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + RequestDatabase(message: DbName, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall { + return super.RequestDatabase(message, metadata, options, callback); + } + } +} diff --git a/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/relay/datatransfer.ts b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/relay/datatransfer.ts new file mode 100644 index 0000000000..7d0eac6695 --- /dev/null +++ b/packages/cactus-core-api/src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/relay/datatransfer.ts @@ -0,0 +1,74 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.15.6 + * source: relay/datatransfer.proto + * git: https://github.com/thesayyn/protoc-gen-ts + * buymeacoffee: https://www.buymeacoffee.com/thesayyn + * */ +import * as dependency_1 from "./../common/ack"; +import * as dependency_2 from "./../common/state"; +import * as dependency_3 from "./../common/query"; +import * as grpc_1 from "@grpc/grpc-js"; +export namespace relay.datatransfer { + export abstract class UnimplementedDataTransferService { + static definition = { + RequestState: { + path: "/relay.datatransfer.DataTransfer/RequestState", + requestStream: false, + responseStream: false, + requestSerialize: (message: dependency_3.common.query.Query) => Buffer.from(message.serialize()), + requestDeserialize: (bytes: Buffer) => dependency_3.common.query.Query.deserialize(new Uint8Array(bytes)), + responseSerialize: (message: dependency_1.common.ack.Ack) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_1.common.ack.Ack.deserialize(new Uint8Array(bytes)) + }, + SendState: { + path: "/relay.datatransfer.DataTransfer/SendState", + requestStream: false, + responseStream: false, + requestSerialize: (message: dependency_2.common.state.ViewPayload) => Buffer.from(message.serialize()), + requestDeserialize: (bytes: Buffer) => dependency_2.common.state.ViewPayload.deserialize(new Uint8Array(bytes)), + responseSerialize: (message: dependency_1.common.ack.Ack) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_1.common.ack.Ack.deserialize(new Uint8Array(bytes)) + }, + SendDriverState: { + path: "/relay.datatransfer.DataTransfer/SendDriverState", + requestStream: false, + responseStream: false, + requestSerialize: (message: dependency_2.common.state.ViewPayload) => Buffer.from(message.serialize()), + requestDeserialize: (bytes: Buffer) => dependency_2.common.state.ViewPayload.deserialize(new Uint8Array(bytes)), + responseSerialize: (message: dependency_1.common.ack.Ack) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_1.common.ack.Ack.deserialize(new Uint8Array(bytes)) + } + }; + [method: string]: grpc_1.UntypedHandleCall; + abstract RequestState(call: grpc_1.ServerUnaryCall, callback: grpc_1.requestCallback): void; + abstract SendState(call: grpc_1.ServerUnaryCall, callback: grpc_1.requestCallback): void; + abstract SendDriverState(call: grpc_1.ServerUnaryCall, callback: grpc_1.requestCallback): void; + } + export class DataTransferClient extends grpc_1.makeGenericClientConstructor(UnimplementedDataTransferService.definition, "DataTransfer", {}) { + constructor(address: string, credentials: grpc_1.ChannelCredentials, options?: Partial) { + super(address, credentials, options) + } + RequestState(message: dependency_3.common.query.Query, metadata: grpc_1.Metadata, options: grpc_1.CallOptions, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + RequestState(message: dependency_3.common.query.Query, metadata: grpc_1.Metadata, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + RequestState(message: dependency_3.common.query.Query, options: grpc_1.CallOptions, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + RequestState(message: dependency_3.common.query.Query, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + RequestState(message: dependency_3.common.query.Query, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall { + return super.RequestState(message, metadata, options, callback); + } + SendState(message: dependency_2.common.state.ViewPayload, metadata: grpc_1.Metadata, options: grpc_1.CallOptions, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + SendState(message: dependency_2.common.state.ViewPayload, metadata: grpc_1.Metadata, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + SendState(message: dependency_2.common.state.ViewPayload, options: grpc_1.CallOptions, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + SendState(message: dependency_2.common.state.ViewPayload, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + SendState(message: dependency_2.common.state.ViewPayload, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall { + return super.SendState(message, metadata, options, callback); + } + SendDriverState(message: dependency_2.common.state.ViewPayload, metadata: grpc_1.Metadata, options: grpc_1.CallOptions, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + SendDriverState(message: dependency_2.common.state.ViewPayload, metadata: grpc_1.Metadata, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + SendDriverState(message: dependency_2.common.state.ViewPayload, options: grpc_1.CallOptions, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + SendDriverState(message: dependency_2.common.state.ViewPayload, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + SendDriverState(message: dependency_2.common.state.ViewPayload, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall { + return super.SendDriverState(message, metadata, options, callback); + } + } +} diff --git a/yarn.lock b/yarn.lock index e2901365c7..b17b7f4ad8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16440,6 +16440,14 @@ magic-string@0.25.7, magic-string@^0.25.0: dependencies: sourcemap-codec "^1.4.4" +make-dir-cli@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/make-dir-cli/-/make-dir-cli-3.0.0.tgz#cf35a79363f3fbab2b67b99e45e1883a2be14d27" + integrity sha512-8yCjIAOQ8tezWRJWUG3tbvN2I19hiVr8K5DPDVl8fECS3qz0ZbeL194ZGRdf8K3LgvbjDCTadge6NrN/I4XrNw== + dependencies: + make-dir "^3.1.0" + meow "^10.0.0" + make-dir@^1.0.0: version "1.3.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" @@ -16622,7 +16630,7 @@ memorystream@^0.3.1: resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" integrity sha1-htcJCzDORV1j+64S3aUaR93K+bI= -meow@^10.1.0: +meow@^10.0.0, meow@^10.1.0: version "10.1.1" resolved "https://registry.yarnpkg.com/meow/-/meow-10.1.1.tgz#87fa665f18e727024116d456e725f69033ca6d8f" integrity sha512-uzOAEBTGujHAD6bVzIQQk5kDTgatxmpVmr1pj9QhwsHLEG2AiB+9F08/wmjrZIk4h5pWxERd7+jqGZywYx3ZFw==