diff --git a/.cspell.json b/.cspell.json index a02135d36e5..5327c653798 100644 --- a/.cspell.json +++ b/.cspell.json @@ -43,6 +43,7 @@ "commenceack", "configtx", "connectrpc", + "Copm", "Corda", "Cordapp", "couchdb", diff --git a/.eslintignore b/.eslintignore index 2e15772a42d..d8801944c6d 100644 --- a/.eslintignore +++ b/.eslintignore @@ -30,6 +30,7 @@ weaver/common/policy-dsl/parser/PolicyListener.js weaver/common/policy-dsl/parser/PolicyParser.js weaver/common/policy-dsl/test/MyErrorListener.js weaver/common/policy-dsl/test/MyParseTreeVisitor.js +weaver/common/protos-js/driver/driver_grpc_pb.js weaver/core/drivers/fabric-driver/server/dbConnector.ts weaver/core/drivers/fabric-driver/server/events.ts weaver/core/drivers/fabric-driver/server/fabric-code.ts diff --git a/.github/actions/copm_test/action.yaml b/.github/actions/copm_test/action.yaml new file mode 100644 index 00000000000..f02a3a2e169 --- /dev/null +++ b/.github/actions/copm_test/action.yaml @@ -0,0 +1,36 @@ +name: 'Copm Test' +description: "common setup steps for the weaver network needed to run copm tests" +runs: + using: "composite" + steps: + - name: Use Node.js ${{ env.NODEJS_VERSION }} + uses: actions/setup-node@v4.0.2 + with: + node-version: ${{ env.NODEJS_VERSION }} + - id: yarn-cache + name: Restore Yarn Cache + uses: actions/cache@v4.0.1 + with: + key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} + path: ./.yarn/ + restore-keys: | + ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} + - name: Get Latest Relay Dependencies + shell: bash + run: | + make protos-local + cargo update -p nom + cargo update -p lexical-core + working-directory: weaver/core/relay + - name: Use Protoc 3.15 + shell: bash + run: | + curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip + unzip protoc-3.15.6-linux-x86_64.zip -d protoc + go install google.golang.org/protobuf/cmd/protoc-gen-go@latest + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.4.0 + # PROTOS + - name: Build local weaver dependencies + run: make setup --trace + shell: bash + working-directory: packages/cacti-plugin-copm-fabric diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ba8a70e63e4..c16ef1d59d1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -53,6 +53,7 @@ jobs: plugin-htlc-coordinator-besu-changed: ${{ steps.changes.outputs.plugin-htlc-coordinator-besu-changed }} test-tooling-changed: ${{ steps.changes.outputs.test-tooling-changed }} ghcr-dev-container-vscode-changed: ${{ steps.changes.outputs.ghcr-dev-container-vscode-changed }} + plugin-copm-fabric-changed: ${{ steps.changes.outputs.plugin-copm-fabric-changed }} runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4.1.7 @@ -163,6 +164,10 @@ jobs: - './packages/cactus-plugin-keychain-memory/**' # - './.github/workflows/ci.yaml' + plugin-copm-fabric-changed: + - './packages/cacti-copm-common/**' + - './packages/cacti-plugin-copm-fabric/**' + build-dev: continue-on-error: false env: @@ -1450,6 +1455,14 @@ jobs: name: coverage-reports-27 path: ./code-coverage-ts/**/ + copm-tests: + needs: + - build-dev + - compute_changed_packages + if: needs.compute_changed_packages.outputs.plugin-copm-fabric-changed == 'true' + uses: ./.github/workflows/test_copm.yaml + + plc-fabric-0: needs: - build-dev diff --git a/.github/workflows/test_copm.yaml b/.github/workflows/test_copm.yaml new file mode 100644 index 00000000000..ba731f82042 --- /dev/null +++ b/.github/workflows/test_copm.yaml @@ -0,0 +1,69 @@ +on: + # Triggers the workflow on push or pull request events but only for the main branch + workflow_call: + +env: + NODEJS_VERSION: v18.18.2 + RUN_TRIVY_SCAN: true + RUN_CODE_COVERAGE: true + +jobs: + copm-fabric-fabric-pledge-and-provestate: + continue-on-error: false + env: + CACTI_NPM_PACKAGE_NAME: "@hyperledger/cacti-plugin-copm-fabric" + HFC_LOGGING: '{"debug":"console","info":"console","warn": "console","error":"console"}' + FULL_BUILD_DISABLED: true + FREE_UP_GITHUB_RUNNER_DISK_SPACE_DISABLED: false + JEST_TEST_PATTERN: packages/cacti-plugin-copm-fabric/src/test/typescript/integration/test-copm-pledge-claim.test.ts packages/cacti-plugin-copm-fabric/src/test/typescript/integration/test-copm-provestate.test.ts + JEST_TEST_RUNNER_DISABLED: false + JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/plc-copm-fabric-fabric-pledge + JEST_TEST_CODE_COVERAGE_ENABLED: true + TAPE_TEST_PATTERN: "" + TAPE_TEST_RUNNER_DISABLED: true + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4.1.1 + - uses: ./.github/actions/copm_test/ + - name: Make the fabric network + run: make pledge-network --trace + working-directory: packages/cacti-plugin-copm-fabric + - name: show the running network + run: docker container ls + - run: ./tools/ci.sh + - name: Upload coverage reports as artifacts + if: ${{ env.RUN_CODE_COVERAGE == 'true' }} + uses: actions/upload-artifact@v4.3.3 + with: + name: coverage-reports-copm-fabric + path: ./code-coverage-ts/**/ + + copm-fabric-fabric-lock: + continue-on-error: false + env: + CACTI_NPM_PACKAGE_NAME: "@hyperledger/cacti-plugin-copm-fabric" + HFC_LOGGING: '{"debug":"console","info":"console","warn": "console","error":"console"}' + FULL_BUILD_DISABLED: true + FREE_UP_GITHUB_RUNNER_DISK_SPACE_DISABLED: false + JEST_TEST_PATTERN: packages/cacti-plugin-copm-fabric/src/test/typescript/integration/test-copm-lock-claim.test.ts + JEST_TEST_RUNNER_DISABLED: false + JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/plc-copm-fabric-fabric-lock + JEST_TEST_CODE_COVERAGE_ENABLED: true + TAPE_TEST_PATTERN: "" + TAPE_TEST_RUNNER_DISABLED: true + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4.1.1 + - uses: ./.github/actions/copm_test/ + - name: Make the fabric network + run: make lock-network --trace + working-directory: packages/cacti-plugin-copm-fabric + - name: show the running network + run: docker container ls + - run: ./tools/ci.sh + - name: Upload coverage reports as artifacts + if: ${{ env.RUN_CODE_COVERAGE == 'true' }} + uses: actions/upload-artifact@v4.3.3 + with: + name: coverage-reports-copm-fabric-lock + path: ./code-coverage-ts/**/ diff --git a/packages/cacti-copm-core/README.md b/packages/cacti-copm-core/README.md new file mode 100644 index 00000000000..1f38ca0625a --- /dev/null +++ b/packages/cacti-copm-core/README.md @@ -0,0 +1,27 @@ +# @hyperledger/cacti-copm-core + +This package defines the common types, interfaces, and endpoints for the +COPM module to be used by Digital Ledger-specific implementations. + +These endpoints require specific chaincode and weaver relays to be deployed on the network. +Please see https://hyperledger.github.io/cacti/weaver/introduction/. + +Endpoint documentation: +https://jenniferlianne.github.io/cacti/references/openapi/cacti-copm-core_openapi/ + +# Usage + +## Installation + +Yarn: + + yarn add --exact @hyperledger/cacti-copm-core + + +# Development + +When implementing a new distributed ledger, the following interfaces must be implemented: + +- DLTransactionContext: Implements running a transaction on the local network +- DLRemoteTransactionContext: Uses the weaver relays to run a transaction on another network +- DLTransactionContextFactory: Factory to return either local or remote context for the specific DLT. \ No newline at end of file diff --git a/packages/cacti-copm-core/buf.gen.yaml b/packages/cacti-copm-core/buf.gen.yaml new file mode 100644 index 00000000000..c4fc464c56a --- /dev/null +++ b/packages/cacti-copm-core/buf.gen.yaml @@ -0,0 +1,14 @@ +version: v1 +plugins: + # This will invoke protoc-gen-es and write output to src/gen + - plugin: es + out: src/main/typescript/generated + opt: + # Add more plugin options here + - target=ts + # This will invoke protoc-gen-connect-es + - plugin: connect-es + out: src/main/typescript/generated + opt: + # Add more plugin options here + - target=ts diff --git a/packages/cacti-copm-core/openapitools.json b/packages/cacti-copm-core/openapitools.json new file mode 100644 index 00000000000..cd53ff4cad7 --- /dev/null +++ b/packages/cacti-copm-core/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "6.6.0" + } +} diff --git a/packages/cacti-copm-core/package.json b/packages/cacti-copm-core/package.json new file mode 100644 index 00000000000..ddf9933378f --- /dev/null +++ b/packages/cacti-copm-core/package.json @@ -0,0 +1,42 @@ +{ + "name": "@hyperledger/cacti-copm-core", + "version": "0.0.1", + "description": "Cacti Common Operators", + "homepage": "https://github.com/hyperledger/cacti#readme", + "bugs": { + "url": "https://github.com/hyperledger/cacti/issues" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/hyperledger/cacti.git" + }, + "license": "Apache-2.0", + "author": "Jennifer Bell", + "main": "dist/lib/main/typescript/index.js", + "module": "dist/lib/main/typescript/index.js", + "types": "dist/lib/main/typescript/index.d.ts", + "files": [ + "dist/*" + ], + "scripts": { + "bundleopenapi": "yarn run --top-level tools:bundle-open-api-tpl-files", + "codegen": "yarn run --top-level run-s 'codegen:*'", + "codegen:proto": "yarn run proto:openapi; yarn run proto:connectrpc", + "dev:redo": "yarn run bundleopenapi; yarn run codegen:proto", + "proto:connectrpc": "yarn run buf generate --template=./buf.gen.yaml ./src/main/proto/generated/openapi", + "proto:openapi": "yarn run --top-level openapi-generator-cli generate -i ./src/main/json/openapi.json -g protobuf-schema --model-name-suffix=PB --language-specific-primitives=google.protobuf.Any --type-mappings=AnyType=google.protobuf.Any --type-mappings=object=google.protobuf.Any --additional-properties=packageName=org.hyperledger.cacti.plugin.cacti.plugin.copm.core -o ./src/main/proto/generated/openapi/ -t=./src/main/mustache/openapi-generator/templates/protobuf-schema/ --ignore-file-override ../../openapi-generator-ignore" + }, + "dependencies": { + "@bufbuild/buf": "1.30.0", + "@bufbuild/protobuf": "1.10.0", + "@connectrpc/connect": "1.4.0", + "@hyperledger/cacti-weaver-sdk-fabric": "2.0.0-rc.4", + "@hyperledger/cactus-common": "2.0.0-rc.4" + }, + "devDependencies": { + "@bufbuild/protoc-gen-es": "1.8.0", + "@connectrpc/connect-node": "1.4.0", + "@connectrpc/protoc-gen-connect-es": "1.4.0", + "@openapitools/openapi-generator-cli": "2.13.4" + } +} diff --git a/packages/cacti-copm-core/src/main/json/openapi.json b/packages/cacti-copm-core/src/main/json/openapi.json new file mode 100644 index 00000000000..4dcd222f8f6 --- /dev/null +++ b/packages/cacti-copm-core/src/main/json/openapi.json @@ -0,0 +1,463 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Hyperledger Cacti Plugin - Common Operator Primitives", + "description": "Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/.", + "version": "2.0.0-rc.2", + "license": { + "name": "Apache-2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + } + }, + "components": { + "schemas": { + "TransferrableAssetV1": { + "type": "object", + "description": "An asset. One of 'asset_id' or 'asset_quantity' is required. Please see https://github.com/hyperledger/cacti/blob/main/weaver/rfcs/protocols/asset-transfer/generic.md", + "oneOf": [ + { + "required": ["asset_type", "asset_id"] + }, + { + "required": ["asset_type", "asset_quantity"] + } + ], + "properties": { + "asset_type": { + "type": "string", + "example": "bond" + }, + "asset_id": { + "type": "string", + "description": "encoded description of NFT" + }, + "asset_quantity": { + "type": "integer", + "example": 22 + } + } + }, + "AssetAccountV1": { + "description": "A network account used in exchanging or transferring assets.", + "type": "object", + "required": ["network", "user_id"], + "properties": { + "network": { + "type": "string", + "example": "network1.org" + }, + "user_id": { + "type": "string", + "example": "Alice" + } + } + }, + "AssetPledgeV1": { + "description": "Asset Pledge per https://github.com/hyperledger/cacti/blob/main/weaver/rfcs/protocols/asset-transfer/generic.md#protocol-units-or-building-blocks", + "type": "object", + "required": [ + "source", + "destination", + "asset", + "destination_certificate" + ], + "properties": { + "source": { + "$ref": "#/components/schemas/AssetAccountV1" + }, + "destination": { + "$ref": "#/components/schemas/AssetAccountV1", + "example": { + "network": "network2.org", + "user_id": "Bob" + } + }, + "asset": { + "$ref": "#/components/schemas/TransferrableAssetV1", + "example": { + "type": "bond", + "asset_id": "ref203" + } + }, + "expiry_secs": { + "type": "integer", + "format": "int64", + "default": 3600 + }, + "destination_certificate": { + "type": "string" + } + } + }, + "HashInfoV1": { + "description": "hash used to lock asset in HTLC when claiming", + "type": "object", + "required": ["hash_fcn", "secret"], + "properties": { + "hash_fcn": { + "type": "string", + "example": "SHA256" + }, + "secret": { + "type": "string", + "example": "my_secret" + } + } + }, + "AssetLockV1": { + "description": "lock an asset by HTLC so it can be claimed by a user on the same network. https://github.com/hyperledger/cacti/blob/main/weaver/rfcs/protocols/asset-exchange/generic-htlc.md", + "required": ["asset", "hash_info", "expiry_secs"], + "properties": { + "asset": { + "$ref": "#/components/schemas/TransferrableAssetV1", + "example": { + "type": "bond", + "asset_id": "ref203" + } + }, + "owner": { + "$ref": "#/components/schemas/AssetAccountV1" + }, + "hash_info": { + "$ref": "#/components/schemas/HashInfoV1" + }, + "destination_certificate": { + "type": "string" + }, + "source_certificate": { + "type": "string" + }, + "expiry_secs": { + "type": "integer", + "format": "int64", + "default": 3600 + } + } + }, + "AssetLockClaimV1": { + "description": "Claim a previously locked asset on the same network.\n\"lock_id\" is required for fungible assets, \"asset\" is required for non-fungible assets.\nhttps://github.com/hyperledger/cacti/blob/main/weaver/rfcs/protocols/asset-exchange/generic-htlc.md", + "required": [ + "lock_id", + "source", + "destination", + "asset", + "source_certificate", + "hash_info" + ], + "properties": { + "lock_id": { + "type": "string" + }, + "source": { + "$ref": "#/components/schemas/AssetAccountV1" + }, + "destination": { + "$ref": "#/components/schemas/AssetAccountV1", + "example": { + "network": "network2.org", + "user_id": "Bob" + } + }, + "asset": { + "$ref": "#/components/schemas/TransferrableAssetV1", + "example": { + "type": "bond", + "asset_id": "ref203" + } + }, + "hash_info": { + "$ref": "#/components/schemas/HashInfoV1" + }, + "source_certificate": { + "type": "string" + }, + "dest_certificate": { + "type": "string" + } + } + }, + "AssetPledgeClaimV1": { + "description": "Asset Claim per https://github.com/hyperledger/cacti/blob/main/weaver/rfcs/protocols/asset-transfer/generic.md#protocol-units-or-building-blocks", + "required": [ + "pledge_id", + "source", + "destination", + "asset", + "source_certificate" + ], + "properties": { + "pledge_id": { + "type": "string", + "example": "pledge_550e8400-e29b-41d4-a716-446655440000" + }, + "source": { + "$ref": "#/components/schemas/AssetAccountV1" + }, + "destination": { + "$ref": "#/components/schemas/AssetAccountV1", + "example": { + "network": "network2.org", + "gateway": "gateway2.network2.org", + "user_id": "Bob" + } + }, + "asset": { + "$ref": "#/components/schemas/TransferrableAssetV1", + "example": { + "type": "bond", + "asset_id": "ref203" + } + }, + "source_certificate": { + "type": "string" + }, + "dest_certificate": { + "type": "string" + } + } + }, + "ViewAddressV1": { + "description": "View per https://github.com/hyperledger/cacti/blob/main/weaver/rfcs/formats/views/addressing.md#views", + "properties": { + "contract_id": { + "type": "string", + "example": "trade-chaincode" + }, + "function": { + "type": "string", + "example": "getBillOfLading" + }, + "input": { + "type": "array", + "items": { + "type": "string", + "example": "bill-10012" + } + } + } + }, + "ViewV1": { + "description": "View Description per https://github.com/hyperledger/cacti/blob/main/weaver/rfcs/formats/views/addressing.md", + "properties": { + "network": { + "type": "string", + "example": "network1" + }, + "view_address": { + "$ref": "#/components/schemas/ViewAddressV1" + } + } + }, + "StateProofV1": { + "description": "Verifies a view address according to the configured verification policy for the view", + "properties": { + "account": { + "$ref": "#/components/schemas/AssetAccountV1" + }, + "view": { + "$ref": "#/components/schemas/ViewV1" + } + } + } + } + }, + "paths": { + "/api/v1/plugins/@hyperledger/cacti-plugin-copm/pledge-asset": { + "post": { + "x-hyperledger-cacti": { + "http": { + "path": "/api/v1/plugins/@hyperledger/cacti-plugin-copm/pledge-asset", + "verbLowerCase": "post" + } + }, + "operationId": "pledgeAssetV1", + "summary": "Pledge an asset.", + "parameters": [], + "requestBody": { + "description": "", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AssetPledgeV1" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "pledge_id": { + "type": "string", + "example": "pledge-550e8400-e29b-41d4-a716-446655440000" + } + } + } + } + } + } + } + } + }, + "/api/v1/plugins/@hyperledger/cacti-plugin-copm/lock-asset": { + "post": { + "x-hyperledger-cacti": { + "http": { + "path": "/api/v1/plugins/@hyperledger/cacti-plugin-copm/lock-asset", + "verbLowerCase": "post" + } + }, + "operationId": "lockAssetV1", + "summary": "Lock an asset.", + "parameters": [], + "requestBody": { + "description": "", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AssetLockV1" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "lock_id": { + "type": "string", + "example": "lock-550e8400-e29b-41d4-a716-446655440000" + } + } + } + } + } + } + } + } + }, + "/api/v1/plugins/@hyperledger/cacti-plugin-copm/claim-pledged-asset": { + "post": { + "x-hyperledger-cacti": { + "http": { + "path": "/api/v1/plugins/@hyperledger/cacti-plugin-copm/claim-pledged-asset", + "verbLowerCase": "post" + } + }, + "operationId": "claimPledgedAssetV1", + "summary": "Claim an asset.", + "parameters": [], + "requestBody": { + "description": "", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AssetPledgeClaimV1" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "claim_id": { + "type": "string", + "example": "claim-550e8400-e29b-41d4-a716-446655440000" + } + } + } + } + } + } + } + } + }, + "/api/v1/plugins/@hyperledger/cacti-plugin-copm/claim-locked-asset": { + "post": { + "x-hyperledger-cacti": { + "http": { + "path": "/api/v1/plugins/@hyperledger/cacti-plugin-copm/claim-locked-asset", + "verbLowerCase": "post" + } + }, + "operationId": "claimLockedAssetV1", + "summary": "Claim an asset that has been locked.", + "parameters": [], + "requestBody": { + "description": "", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AssetLockClaimV1" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "claim_id": { + "type": "string", + "example": "claim-550e8400-e29b-41d4-a716-446655440000" + } + } + } + } + } + } + } + } + }, + "/api/v1/plugins/@hyperledger/cacti-plugin-copm/verify-state": { + "post": { + "x-hyperledger-cacti": { + "http": { + "path": "/api/v1/plugins/@hyperledger/cacti-plugin-copm/prove-state", + "verbLowerCase": "post" + } + }, + "operationId": "provestateV1", + "summary": "Prove a state", + "parameters": [], + "requestBody": { + "description": "", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StateProofV1" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} diff --git a/packages/cacti-copm-core/src/main/json/openapi.tpl.json b/packages/cacti-copm-core/src/main/json/openapi.tpl.json new file mode 100644 index 00000000000..6be0db6f252 --- /dev/null +++ b/packages/cacti-copm-core/src/main/json/openapi.tpl.json @@ -0,0 +1,451 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Hyperledger Cacti Plugin - Common Operator Primitives", + "description": "Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/.", + "version": "2.0.0-rc.2", + "license": { + "name": "Apache-2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + } + }, + "components": { + "schemas": { + "TransferrableAssetV1" : { + "type": "object", + "description": "An asset. One of 'asset_id' or 'asset_quantity' is required. Please see https://github.com/hyperledger/cacti/blob/main/weaver/rfcs/protocols/asset-transfer/generic.md", + "oneOf": [ + { + "required": [ + "asset_type", + "asset_id" + ] + }, + { + "required": [ + "asset_type", + "asset_quantity" + ] + } + ], + "properties": { + "asset_type": { + "type": "string", + "example": "bond" + }, + "asset_id": { + "type": "string", + "description": "encoded description of NFT" + }, + "asset_quantity": { + "type": "integer", + "example": 22 + } + } + }, + "AssetAccountV1": { + "description": "A network account used in exchanging or transferring assets.", + "type": "object", + "required": ["network","user_id"], + "properties": { + "network": { + "type": "string", + "example": "network1.org" + }, + "user_id": { + "type": "string", + "example": "Alice" + } + } + }, + "AssetPledgeV1": { + "description": "Asset Pledge per https://github.com/hyperledger/cacti/blob/main/weaver/rfcs/protocols/asset-transfer/generic.md#protocol-units-or-building-blocks", + "type": "object", + "required": ["source","destination", "asset", "destination_certificate"], + "properties": { + "source": { + "$ref": "#/components/schemas/AssetAccountV1" + }, + "destination": { + "$ref": "#/components/schemas/AssetAccountV1", + "example": { + "network" : "network2.org", + "user_id" : "Bob" + } + }, + "asset": { + "$ref": "#/components/schemas/TransferrableAssetV1", + "example": { + "type" : "bond", + "asset_id": "ref203" + } + }, + "expiry_secs": { + "type": "integer", + "format": "int64", + "default": 3600 + }, + "destination_certificate" : { + "type" : "string" + } + } + }, + "HashInfoV1": { + "description": "hash used to lock asset in HTLC when claiming", + "type" : "object", + "required" : ["hash_fcn", "secret"], + "properties" : { + "hash_fcn" : { + "type": "string", + "example" : "SHA256" + }, + "secret" : { + "type" : "string", + "example" : "my_secret" + } + } + }, + "AssetLockV1": { + "description": "lock an asset by HTLC so it can be claimed by a user on the same network. https://github.com/hyperledger/cacti/blob/main/weaver/rfcs/protocols/asset-exchange/generic-htlc.md", + "required": ["asset", "hash_info", "expiry_secs"], + "properties": { + "asset": { + "$ref": "#/components/schemas/TransferrableAssetV1", + "example": { + "type" : "bond", + "asset_id": "ref203" + } + }, + "owner": { + "$ref": "#/components/schemas/AssetAccountV1" + }, + "hash_info": { + "$ref": "#/components/schemas/HashInfoV1" + }, + "destination_certificate" : { + "type": "string" + }, + "source_certificate" : { + "type": "string" + }, + "expiry_secs": { + "type": "integer", + "format": "int64", + "default": 3600 + } + } + }, + "AssetLockClaimV1": { + "description": "Claim a previously locked asset on the same network.\n\"lock_id\" is required for fungible assets, \"asset\" is required for non-fungible assets.\nhttps://github.com/hyperledger/cacti/blob/main/weaver/rfcs/protocols/asset-exchange/generic-htlc.md", + "required": ["lock_id","source","destination","asset","source_certificate", "hash_info"], + "properties": { + "lock_id" : { + "type": "string" + }, + "source": { + "$ref": "#/components/schemas/AssetAccountV1" + }, + "destination": { + "$ref": "#/components/schemas/AssetAccountV1", + "example": { + "network" : "network2.org", + "user_id" : "Bob" + } + }, + "asset": { + "$ref": "#/components/schemas/TransferrableAssetV1", + "example": { + "type" : "bond", + "asset_id": "ref203" + } + }, + "hash_info": { + "$ref": "#/components/schemas/HashInfoV1" + }, + "source_certificate" : { + "type" : "string" + }, + "dest_certificate" : { + "type": "string" + } + } + }, + "AssetPledgeClaimV1": { + "description": "Asset Claim per https://github.com/hyperledger/cacti/blob/main/weaver/rfcs/protocols/asset-transfer/generic.md#protocol-units-or-building-blocks", + "required": ["pledge_id","source","destination","asset","source_certificate"], + "properties": { + "pledge_id": { + "type": "string", + "example": "pledge_550e8400-e29b-41d4-a716-446655440000" + }, + "source": { + "$ref": "#/components/schemas/AssetAccountV1" + }, + "destination": { + "$ref": "#/components/schemas/AssetAccountV1", + "example": { + "network" : "network2.org", + "gateway" :"gateway2.network2.org", + "user_id" : "Bob" + } + }, + "asset": { + "$ref": "#/components/schemas/TransferrableAssetV1", + "example": { + "type" : "bond", + "asset_id": "ref203" + } + }, + "source_certificate" : { + "type" : "string" + }, + "dest_certificate" : { + "type": "string" + } + } + }, + "ViewAddressV1": { + "description": "View per https://github.com/hyperledger/cacti/blob/main/weaver/rfcs/formats/views/addressing.md#views", + "properties": { + "contract_id": { + "type": "string", + "example": "trade-chaincode" + }, + "function": { + "type": "string", + "example": "getBillOfLading" + }, + "input": { + "type": "array", + "items": { + "type": "string", + "example": "bill-10012" + } + } + } + }, + "ViewV1": { + "description": "View Description per https://github.com/hyperledger/cacti/blob/main/weaver/rfcs/formats/views/addressing.md", + "properties": { + "network": { + "type": "string", + "example": "network1" + }, + "view_address": { + "$ref": "#/components/schemas/ViewAddressV1" + } + } + }, + "StateProofV1": { + "description": "Verifies a view address according to the configured verification policy for the view", + "properties": { + "account" : { + "$ref" : "#/components/schemas/AssetAccountV1" + }, + "view": { + "$ref": "#/components/schemas/ViewV1" + } + } + } + } + }, + "paths": { + "/api/v1/plugins/@hyperledger/cacti-plugin-copm/pledge-asset": { + "post": { + "x-hyperledger-cacti": { + "http": { + "path": "/api/v1/plugins/@hyperledger/cacti-plugin-copm/pledge-asset", + "verbLowerCase": "post" + } + }, + "operationId": "pledgeAssetV1", + "summary": "Pledge an asset.", + "parameters": [], + "requestBody": { + "description": "", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AssetPledgeV1" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "pledge_id": { + "type": "string", + "example": "pledge-550e8400-e29b-41d4-a716-446655440000" + } + } + } + } + } + } + } + } + }, + "/api/v1/plugins/@hyperledger/cacti-plugin-copm/lock-asset": { + "post": { + "x-hyperledger-cacti": { + "http": { + "path": "/api/v1/plugins/@hyperledger/cacti-plugin-copm/lock-asset", + "verbLowerCase": "post" + } + }, + "operationId": "lockAssetV1", + "summary": "Lock an asset.", + "parameters": [], + "requestBody": { + "description": "", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AssetLockV1" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "lock_id": { + "type": "string", + "example": "lock-550e8400-e29b-41d4-a716-446655440000" + } + } + } + } + } + } + } + } + }, + "/api/v1/plugins/@hyperledger/cacti-plugin-copm/claim-pledged-asset": { + "post": { + "x-hyperledger-cacti": { + "http": { + "path": "/api/v1/plugins/@hyperledger/cacti-plugin-copm/claim-pledged-asset", + "verbLowerCase": "post" + } + }, + "operationId": "claimPledgedAssetV1", + "summary": "Claim an asset.", + "parameters": [], + "requestBody": { + "description": "", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AssetPledgeClaimV1" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "claim_id": { + "type": "string", + "example": "claim-550e8400-e29b-41d4-a716-446655440000" + } + } + } + } + } + } + } + } + }, + "/api/v1/plugins/@hyperledger/cacti-plugin-copm/claim-locked-asset": { + "post": { + "x-hyperledger-cacti": { + "http": { + "path": "/api/v1/plugins/@hyperledger/cacti-plugin-copm/claim-locked-asset", + "verbLowerCase": "post" + } + }, + "operationId": "claimLockedAssetV1", + "summary": "Claim an asset that has been locked.", + "parameters": [], + "requestBody": { + "description": "", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AssetLockClaimV1" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "claim_id": { + "type": "string", + "example": "claim-550e8400-e29b-41d4-a716-446655440000" + } + } + } + } + } + } + } + } + }, + "/api/v1/plugins/@hyperledger/cacti-plugin-copm/verify-state": { + "post": { + "x-hyperledger-cacti": { + "http": { + "path": "/api/v1/plugins/@hyperledger/cacti-plugin-copm/prove-state", + "verbLowerCase": "post" + } + }, + "operationId": "provestateV1", + "summary": "Prove a state", + "parameters": [], + "requestBody": { + "description": "", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StateProofV1" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} diff --git a/packages/cacti-copm-core/src/main/mustache/openapi-generator/templates/protobuf-schema/api.mustache b/packages/cacti-copm-core/src/main/mustache/openapi-generator/templates/protobuf-schema/api.mustache new file mode 100644 index 00000000000..b728d9e71ff --- /dev/null +++ b/packages/cacti-copm-core/src/main/mustache/openapi-generator/templates/protobuf-schema/api.mustache @@ -0,0 +1,46 @@ +{{>partial_header}} +syntax = "proto3"; + +package {{#lambda.lowercase}}{{{packageName}}}.{{{apiPackage}}}.{{{classname}}};{{/lambda.lowercase}} + +import "google/protobuf/empty.proto"; +{{#imports}} +{{#import}} +import "{{{modelPackage}}}/{{{.}}}.proto"; +{{/import}} +{{/imports}} + +service {{classname}} { +{{#operations}} +{{#operation}} + {{#description}} + // {{{.}}} + {{/description}} + rpc {{operationId}} ({{#hasParams}}{{operationId}}Request{{/hasParams}}{{^hasParams}}google.protobuf.Empty{{/hasParams}}) returns ({{#vendorExtensions.x-grpc-response}}{{.}}{{/vendorExtensions.x-grpc-response}}{{^vendorExtensions.x-grpc-response}}{{operationId}}Response{{/vendorExtensions.x-grpc-response}}); + +{{/operation}} +{{/operations}} +} + +{{#operations}} +{{#operation}} +{{#hasParams}} +message {{operationId}}Request { + {{#allParams}} + {{#description}} + // {{{.}}} + {{/description}} + {{#vendorExtensions.x-protobuf-type}}{{.}} {{/vendorExtensions.x-protobuf-type}}{{vendorExtensions.x-protobuf-data-type}} {{paramName}} = {{vendorExtensions.x-protobuf-index}}; + {{/allParams}} + +} + +{{/hasParams}} +{{^vendorExtensions.x-grpc-response}} +message {{operationId}}Response { + {{{vendorExtensions.x-grpc-response-type}}} data = 1; +} + +{{/vendorExtensions.x-grpc-response}} +{{/operation}} +{{/operations}} \ No newline at end of file diff --git a/packages/cacti-copm-core/src/main/mustache/openapi-generator/templates/protobuf-schema/model.mustache b/packages/cacti-copm-core/src/main/mustache/openapi-generator/templates/protobuf-schema/model.mustache new file mode 100644 index 00000000000..a350fd9e144 --- /dev/null +++ b/packages/cacti-copm-core/src/main/mustache/openapi-generator/templates/protobuf-schema/model.mustache @@ -0,0 +1,41 @@ +{{>partial_header}} +syntax = "proto3"; + +package {{#lambda.lowercase}}{{{packageName}}};{{/lambda.lowercase}} + +import "google/protobuf/any.proto"; + +{{#imports}} +{{#import}} +import "{{{modelPackage}}}/{{{import}}}.proto"; +{{/import}} +{{/imports}} + +{{#models}} +{{#model}} +{{#isEnum}}{{>enum}}{{/isEnum}}{{^isEnum}}message {{classname}} { + + {{#vars}} + {{#description}} + // {{{.}}} + {{/description}} + {{^isEnum}} + {{#vendorExtensions.x-protobuf-type}}{{{.}}} {{/vendorExtensions.x-protobuf-type}}{{{vendorExtensions.x-protobuf-data-type}}} {{{name}}} = {{vendorExtensions.x-protobuf-index}}{{#vendorExtensions.x-protobuf-packed}} [packed=true]{{/vendorExtensions.x-protobuf-packed}}; + {{/isEnum}} + {{#isEnum}} + enum {{enumName}} { + {{#allowableValues}} + {{#enumVars}} + {{{name}}} = {{{protobuf-enum-index}}}; + {{/enumVars}} + {{/allowableValues}} + } + + {{enumName}} {{name}} = {{vendorExtensions.x-protobuf-index}}; + {{/isEnum}} + + {{/vars}} +} +{{/isEnum}} +{{/model}} +{{/models}} \ No newline at end of file diff --git a/packages/cacti-copm-core/src/main/mustache/openapi-generator/templates/protobuf-schema/root.mustache b/packages/cacti-copm-core/src/main/mustache/openapi-generator/templates/protobuf-schema/root.mustache new file mode 100644 index 00000000000..581e04c91dd --- /dev/null +++ b/packages/cacti-copm-core/src/main/mustache/openapi-generator/templates/protobuf-schema/root.mustache @@ -0,0 +1,22 @@ +{{>partial_header}} +syntax = "proto3"; + +package {{{packageName}}}; + +{{#vendorExtensions.x-grpc-options}} +option {{{.}}}; +{{/vendorExtensions.x-grpc-options}} + +// Models +{{#models}} +{{#model}} +import "./{{modelPackage}}/{{classFilename}}.proto"; +{{/model}} +{{/models}} + +// APIs +{{#apiInfo}} +{{#apis}} +import "{{apiPackage}}/{{classFilename}}.proto"; +{{/apis}} +{{/apiInfo}} \ No newline at end of file diff --git a/packages/cacti-copm-core/src/main/proto/generated/openapi/.openapi-generator/FILES b/packages/cacti-copm-core/src/main/proto/generated/openapi/.openapi-generator/FILES new file mode 100644 index 00000000000..4a6d2f5eb16 --- /dev/null +++ b/packages/cacti-copm-core/src/main/proto/generated/openapi/.openapi-generator/FILES @@ -0,0 +1,15 @@ +README.md +models/asset_account_v1_pb.proto +models/asset_lock_claim_v1_pb.proto +models/asset_lock_v1_pb.proto +models/asset_pledge_claim_v1_pb.proto +models/asset_pledge_v1_pb.proto +models/claim_pledged_asset_v1200_response_pb.proto +models/hash_info_v1_pb.proto +models/lock_asset_v1200_response_pb.proto +models/pledge_asset_v1200_response_pb.proto +models/state_proof_v1_pb.proto +models/transferrable_asset_v1_pb.proto +models/view_address_v1_pb.proto +models/view_v1_pb.proto +services/default_service.proto diff --git a/packages/cacti-copm-core/src/main/proto/generated/openapi/.openapi-generator/VERSION b/packages/cacti-copm-core/src/main/proto/generated/openapi/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cacti-copm-core/src/main/proto/generated/openapi/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cacti-copm-core/src/main/proto/generated/openapi/README.md b/packages/cacti-copm-core/src/main/proto/generated/openapi/README.md new file mode 100644 index 00000000000..f4b6933608b --- /dev/null +++ b/packages/cacti-copm-core/src/main/proto/generated/openapi/README.md @@ -0,0 +1,31 @@ +# gPRC for org.hyperledger.cacti.plugin.cacti.plugin.copm.core + +Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. + +## Overview +These files were generated by the [OpenAPI Generator](https://openapi-generator.tech) project. + +- API version: 2.0.0-rc.2 +- Package version: +- Build package: org.openapitools.codegen.languages.ProtobufSchemaCodegen + +## Usage + +Below are some usage examples for Go and Ruby. For other languages, please refer to https://grpc.io/docs/quickstart/. + +### Go +``` +# assuming `protoc-gen-go` has been installed with `go get -u github.com/golang/protobuf/protoc-gen-go` +mkdir /var/tmp/go/org.hyperledger.cacti.plugin.cacti.plugin.copm.core +protoc --go_out=/var/tmp/go/org.hyperledger.cacti.plugin.cacti.plugin.copm.core services/* +protoc --go_out=/var/tmp/go/org.hyperledger.cacti.plugin.cacti.plugin.copm.core models/* +``` + +### Ruby +``` +# assuming `grpc_tools_ruby_protoc` has been installed via `gem install grpc-tools` +RUBY_OUTPUT_DIR="/var/tmp/ruby/org.hyperledger.cacti.plugin.cacti.plugin.copm.core" +mkdir $RUBY_OUTPUT_DIR +grpc_tools_ruby_protoc --ruby_out=$RUBY_OUTPUT_DIR --grpc_out=$RUBY_OUTPUT_DIR/lib services/* +grpc_tools_ruby_protoc --ruby_out=$RUBY_OUTPUT_DIR --grpc_out=$RUBY_OUTPUT_DIR/lib models/* +``` diff --git a/packages/cacti-copm-core/src/main/proto/generated/openapi/models/asset_account_v1_pb.proto b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/asset_account_v1_pb.proto new file mode 100644 index 00000000000..f9f379ae446 --- /dev/null +++ b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/asset_account_v1_pb.proto @@ -0,0 +1,24 @@ +/* + Hyperledger Cacti Plugin - Common Operator Primitives + + Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. + + The version of the OpenAPI document: 2.0.0-rc.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.cacti.plugin.copm.core; + +import "google/protobuf/any.proto"; + + +message AssetAccountV1PB { + + string network = 232872497; + + string user_id = 147132913; + +} diff --git a/packages/cacti-copm-core/src/main/proto/generated/openapi/models/asset_claim_v1_pb.proto b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/asset_claim_v1_pb.proto new file mode 100644 index 00000000000..c1ddf6c9bbb --- /dev/null +++ b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/asset_claim_v1_pb.proto @@ -0,0 +1,37 @@ +/* + Hyperledger Cacti Plugin - Common Operator Primitives + + Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. + + The version of the OpenAPI document: 2.0.0-rc.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.cacti.plugin.copm.core; + +import "google/protobuf/any.proto"; + +import "models/asset_account_v1_pb.proto"; +import "models/hash_info_v1_pb.proto"; +import "models/transferrable_asset_v1_pb.proto"; + +message AssetClaimV1PB { + + string pledge_id = 4476259; + + AssetAccountV1PB source = 359634918; + + AssetAccountV1PB destination = 356105204; + + TransferrableAssetV1PB asset = 93121264; + + HashInfoV1PB hash_info = 309318975; + + string source_certificate = 72464244; + + string dest_certificate = 165133181; + +} diff --git a/packages/cacti-copm-core/src/main/proto/generated/openapi/models/asset_lock_claim_v1_pb.proto b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/asset_lock_claim_v1_pb.proto new file mode 100644 index 00000000000..c32aeaebbe6 --- /dev/null +++ b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/asset_lock_claim_v1_pb.proto @@ -0,0 +1,37 @@ +/* + Hyperledger Cacti Plugin - Common Operator Primitives + + Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. + + The version of the OpenAPI document: 2.0.0-rc.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.cacti.plugin.copm.core; + +import "google/protobuf/any.proto"; + +import "models/asset_account_v1_pb.proto"; +import "models/hash_info_v1_pb.proto"; +import "models/transferrable_asset_v1_pb.proto"; + +message AssetLockClaimV1PB { + + string lock_id = 338696367; + + AssetAccountV1PB source = 359634918; + + AssetAccountV1PB destination = 356105204; + + TransferrableAssetV1PB asset = 93121264; + + HashInfoV1PB hash_info = 309318975; + + string source_certificate = 72464244; + + string dest_certificate = 165133181; + +} diff --git a/packages/cacti-copm-core/src/main/proto/generated/openapi/models/asset_lock_v1_pb.proto b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/asset_lock_v1_pb.proto new file mode 100644 index 00000000000..cf715f9d912 --- /dev/null +++ b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/asset_lock_v1_pb.proto @@ -0,0 +1,35 @@ +/* + Hyperledger Cacti Plugin - Common Operator Primitives + + Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. + + The version of the OpenAPI document: 2.0.0-rc.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.cacti.plugin.copm.core; + +import "google/protobuf/any.proto"; + +import "models/asset_account_v1_pb.proto"; +import "models/hash_info_v1_pb.proto"; +import "models/transferrable_asset_v1_pb.proto"; + +message AssetLockV1PB { + + TransferrableAssetV1PB asset = 93121264; + + AssetAccountV1PB owner = 106164915; + + HashInfoV1PB hash_info = 309318975; + + string destination_certificate = 101302555; + + string source_certificate = 72464244; + + int64 expiry_secs = 476369358; + +} diff --git a/packages/cacti-copm-core/src/main/proto/generated/openapi/models/asset_pledge_claim_v1_pb.proto b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/asset_pledge_claim_v1_pb.proto new file mode 100644 index 00000000000..a5040e97ee8 --- /dev/null +++ b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/asset_pledge_claim_v1_pb.proto @@ -0,0 +1,34 @@ +/* + Hyperledger Cacti Plugin - Common Operator Primitives + + Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. + + The version of the OpenAPI document: 2.0.0-rc.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.cacti.plugin.copm.core; + +import "google/protobuf/any.proto"; + +import "models/asset_account_v1_pb.proto"; +import "models/transferrable_asset_v1_pb.proto"; + +message AssetPledgeClaimV1PB { + + string pledge_id = 4476259; + + AssetAccountV1PB source = 359634918; + + AssetAccountV1PB destination = 356105204; + + TransferrableAssetV1PB asset = 93121264; + + string source_certificate = 72464244; + + string dest_certificate = 165133181; + +} diff --git a/packages/cacti-copm-core/src/main/proto/generated/openapi/models/asset_pledge_v1_pb.proto b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/asset_pledge_v1_pb.proto new file mode 100644 index 00000000000..7936736eb9c --- /dev/null +++ b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/asset_pledge_v1_pb.proto @@ -0,0 +1,32 @@ +/* + Hyperledger Cacti Plugin - Common Operator Primitives + + Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. + + The version of the OpenAPI document: 2.0.0-rc.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.cacti.plugin.copm.core; + +import "google/protobuf/any.proto"; + +import "models/asset_account_v1_pb.proto"; +import "models/transferrable_asset_v1_pb.proto"; + +message AssetPledgeV1PB { + + AssetAccountV1PB source = 359634918; + + AssetAccountV1PB destination = 356105204; + + TransferrableAssetV1PB asset = 93121264; + + int64 expiry_secs = 476369358; + + string destination_certificate = 101302555; + +} diff --git a/packages/cacti-copm-core/src/main/proto/generated/openapi/models/claim_pledged_asset_v1200_response_pb.proto b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/claim_pledged_asset_v1200_response_pb.proto new file mode 100644 index 00000000000..b5c2a381f08 --- /dev/null +++ b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/claim_pledged_asset_v1200_response_pb.proto @@ -0,0 +1,22 @@ +/* + Hyperledger Cacti Plugin - Common Operator Primitives + + Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. + + The version of the OpenAPI document: 2.0.0-rc.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.cacti.plugin.copm.core; + +import "google/protobuf/any.proto"; + + +message ClaimPledgedAssetV1200ResponsePB { + + string claim_id = 146149375; + +} diff --git a/packages/cacti-copm-core/src/main/proto/generated/openapi/models/hash_info_v1_pb.proto b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/hash_info_v1_pb.proto new file mode 100644 index 00000000000..4843ea00d61 --- /dev/null +++ b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/hash_info_v1_pb.proto @@ -0,0 +1,24 @@ +/* + Hyperledger Cacti Plugin - Common Operator Primitives + + Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. + + The version of the OpenAPI document: 2.0.0-rc.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.cacti.plugin.copm.core; + +import "google/protobuf/any.proto"; + + +message HashInfoV1PB { + + string hash_fcn = 148522144; + + string secret = 369406289; + +} diff --git a/packages/cacti-copm-core/src/main/proto/generated/openapi/models/lock_asset_v1200_response_pb.proto b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/lock_asset_v1200_response_pb.proto new file mode 100644 index 00000000000..849394fbc2d --- /dev/null +++ b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/lock_asset_v1200_response_pb.proto @@ -0,0 +1,22 @@ +/* + Hyperledger Cacti Plugin - Common Operator Primitives + + Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. + + The version of the OpenAPI document: 2.0.0-rc.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.cacti.plugin.copm.core; + +import "google/protobuf/any.proto"; + + +message LockAssetV1200ResponsePB { + + string lock_id = 338696367; + +} diff --git a/packages/cacti-copm-core/src/main/proto/generated/openapi/models/pledge_asset_v1200_response_pb.proto b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/pledge_asset_v1200_response_pb.proto new file mode 100644 index 00000000000..297bea92420 --- /dev/null +++ b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/pledge_asset_v1200_response_pb.proto @@ -0,0 +1,22 @@ +/* + Hyperledger Cacti Plugin - Common Operator Primitives + + Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. + + The version of the OpenAPI document: 2.0.0-rc.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.cacti.plugin.copm.core; + +import "google/protobuf/any.proto"; + + +message PledgeAssetV1200ResponsePB { + + string pledge_id = 4476259; + +} diff --git a/packages/cacti-copm-core/src/main/proto/generated/openapi/models/state_proof_v1_pb.proto b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/state_proof_v1_pb.proto new file mode 100644 index 00000000000..8d2fb18f443 --- /dev/null +++ b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/state_proof_v1_pb.proto @@ -0,0 +1,26 @@ +/* + Hyperledger Cacti Plugin - Common Operator Primitives + + Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. + + The version of the OpenAPI document: 2.0.0-rc.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.cacti.plugin.copm.core; + +import "google/protobuf/any.proto"; + +import "models/asset_account_v1_pb.proto"; +import "models/view_v1_pb.proto"; + +message StateProofV1PB { + + AssetAccountV1PB account = 103577045; + + ViewV1PB view = 3619493; + +} diff --git a/packages/cacti-copm-core/src/main/proto/generated/openapi/models/transferrable_asset_v1_pb.proto b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/transferrable_asset_v1_pb.proto new file mode 100644 index 00000000000..24af69efc8c --- /dev/null +++ b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/transferrable_asset_v1_pb.proto @@ -0,0 +1,27 @@ +/* + Hyperledger Cacti Plugin - Common Operator Primitives + + Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. + + The version of the OpenAPI document: 2.0.0-rc.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.cacti.plugin.copm.core; + +import "google/protobuf/any.proto"; + + +message TransferrableAssetV1PB { + + string asset_type = 519156524; + + // encoded description of NFT + string asset_id = 373202742; + + int32 asset_quantity = 386005244; + +} diff --git a/packages/cacti-copm-core/src/main/proto/generated/openapi/models/view_address_v1_pb.proto b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/view_address_v1_pb.proto new file mode 100644 index 00000000000..4b9a41d8883 --- /dev/null +++ b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/view_address_v1_pb.proto @@ -0,0 +1,26 @@ +/* + Hyperledger Cacti Plugin - Common Operator Primitives + + Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. + + The version of the OpenAPI document: 2.0.0-rc.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.cacti.plugin.copm.core; + +import "google/protobuf/any.proto"; + + +message ViewAddressV1PB { + + string contract_id = 512823451; + + string function = 307196890; + + repeated string input = 100358090; + +} diff --git a/packages/cacti-copm-core/src/main/proto/generated/openapi/models/view_v1_pb.proto b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/view_v1_pb.proto new file mode 100644 index 00000000000..e29754c8ac7 --- /dev/null +++ b/packages/cacti-copm-core/src/main/proto/generated/openapi/models/view_v1_pb.proto @@ -0,0 +1,25 @@ +/* + Hyperledger Cacti Plugin - Common Operator Primitives + + Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. + + The version of the OpenAPI document: 2.0.0-rc.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.cacti.plugin.copm.core; + +import "google/protobuf/any.proto"; + +import "models/view_address_v1_pb.proto"; + +message ViewV1PB { + + string network = 232872497; + + ViewAddressV1PB view_address = 312477787; + +} diff --git a/packages/cacti-copm-core/src/main/proto/generated/openapi/services/default_service.proto b/packages/cacti-copm-core/src/main/proto/generated/openapi/services/default_service.proto new file mode 100644 index 00000000000..442eff4753a --- /dev/null +++ b/packages/cacti-copm-core/src/main/proto/generated/openapi/services/default_service.proto @@ -0,0 +1,67 @@ +/* + Hyperledger Cacti Plugin - Common Operator Primitives + + Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. + + The version of the OpenAPI document: 2.0.0-rc.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.cacti.plugin.copm.core.services.defaultservice; + +import "google/protobuf/empty.proto"; +import "models/asset_lock_claim_v1_pb.proto"; +import "models/asset_lock_v1_pb.proto"; +import "models/asset_pledge_claim_v1_pb.proto"; +import "models/asset_pledge_v1_pb.proto"; +import "models/claim_pledged_asset_v1200_response_pb.proto"; +import "models/lock_asset_v1200_response_pb.proto"; +import "models/pledge_asset_v1200_response_pb.proto"; +import "models/state_proof_v1_pb.proto"; + +service DefaultService { + rpc ClaimLockedAssetV1 (ClaimLockedAssetV1Request) returns (ClaimPledgedAssetV1200ResponsePB); + + rpc ClaimPledgedAssetV1 (ClaimPledgedAssetV1Request) returns (ClaimPledgedAssetV1200ResponsePB); + + rpc LockAssetV1 (LockAssetV1Request) returns (LockAssetV1200ResponsePB); + + rpc PledgeAssetV1 (PledgeAssetV1Request) returns (PledgeAssetV1200ResponsePB); + + rpc ProvestateV1 (ProvestateV1Request) returns (google.protobuf.Empty); + +} + +message ClaimLockedAssetV1Request { + // + AssetLockClaimV1PB assetLockClaimV1PB = 1; + +} + +message ClaimPledgedAssetV1Request { + // + AssetPledgeClaimV1PB assetPledgeClaimV1PB = 1; + +} + +message LockAssetV1Request { + // + AssetLockV1PB assetLockV1PB = 1; + +} + +message PledgeAssetV1Request { + // + AssetPledgeV1PB assetPledgeV1PB = 1; + +} + +message ProvestateV1Request { + // + StateProofV1PB stateProofV1PB = 1; + +} + diff --git a/packages/cacti-copm-core/src/main/typescript/generated/models/asset_account_v1_pb_pb.ts b/packages/cacti-copm-core/src/main/typescript/generated/models/asset_account_v1_pb_pb.ts new file mode 100644 index 00000000000..68f6cee712f --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/generated/models/asset_account_v1_pb_pb.ts @@ -0,0 +1,60 @@ +// +//Hyperledger Cacti Plugin - Common Operator Primitives +// +//Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. +// +//The version of the OpenAPI document: 2.0.0-rc.2 +// +//Generated by OpenAPI Generator: https://openapi-generator.tech + +// @generated by protoc-gen-es v1.8.0 with parameter "target=ts" +// @generated from file models/asset_account_v1_pb.proto (package org.hyperledger.cacti.plugin.cacti.plugin.copm.core, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetAccountV1PB + */ +export class AssetAccountV1PB extends Message { + /** + * @generated from field: string network = 232872497; + */ + network = ""; + + /** + * @generated from field: string user_id = 147132913; + */ + userId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetAccountV1PB"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 232872497, name: "network", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 147132913, name: "user_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AssetAccountV1PB { + return new AssetAccountV1PB().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AssetAccountV1PB { + return new AssetAccountV1PB().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AssetAccountV1PB { + return new AssetAccountV1PB().fromJsonString(jsonString, options); + } + + static equals(a: AssetAccountV1PB | PlainMessage | undefined, b: AssetAccountV1PB | PlainMessage | undefined): boolean { + return proto3.util.equals(AssetAccountV1PB, a, b); + } +} + diff --git a/packages/cacti-copm-core/src/main/typescript/generated/models/asset_claim_v1_pb_pb.ts b/packages/cacti-copm-core/src/main/typescript/generated/models/asset_claim_v1_pb_pb.ts new file mode 100644 index 00000000000..c92ba4ef036 --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/generated/models/asset_claim_v1_pb_pb.ts @@ -0,0 +1,93 @@ +// +//Hyperledger Cacti Plugin - Common Operator Primitives +// +//Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. +// +//The version of the OpenAPI document: 2.0.0-rc.2 +// +//Generated by OpenAPI Generator: https://openapi-generator.tech + +// @generated by protoc-gen-es v1.8.0 with parameter "target=ts" +// @generated from file models/asset_claim_v1_pb.proto (package org.hyperledger.cacti.plugin.cacti.plugin.copm.core, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import { AssetAccountV1PB } from "./asset_account_v1_pb_pb.js"; +import { TransferrableAssetV1PB } from "./transferrable_asset_v1_pb_pb.js"; +import { HashInfoV1PB } from "./hash_info_v1_pb_pb.js"; + +/** + * @generated from message org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetClaimV1PB + */ +export class AssetClaimV1PB extends Message { + /** + * @generated from field: string pledge_id = 4476259; + */ + pledgeId = ""; + + /** + * @generated from field: org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetAccountV1PB source = 359634918; + */ + source?: AssetAccountV1PB; + + /** + * @generated from field: org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetAccountV1PB destination = 356105204; + */ + destination?: AssetAccountV1PB; + + /** + * @generated from field: org.hyperledger.cacti.plugin.cacti.plugin.copm.core.TransferrableAssetV1PB asset = 93121264; + */ + asset?: TransferrableAssetV1PB; + + /** + * @generated from field: org.hyperledger.cacti.plugin.cacti.plugin.copm.core.HashInfoV1PB hash_info = 309318975; + */ + hashInfo?: HashInfoV1PB; + + /** + * @generated from field: string source_certificate = 72464244; + */ + sourceCertificate = ""; + + /** + * @generated from field: string dest_certificate = 165133181; + */ + destCertificate = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetClaimV1PB"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 4476259, name: "pledge_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 359634918, name: "source", kind: "message", T: AssetAccountV1PB }, + { no: 356105204, name: "destination", kind: "message", T: AssetAccountV1PB }, + { no: 93121264, name: "asset", kind: "message", T: TransferrableAssetV1PB }, + { no: 309318975, name: "hash_info", kind: "message", T: HashInfoV1PB }, + { no: 72464244, name: "source_certificate", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 165133181, name: "dest_certificate", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AssetClaimV1PB { + return new AssetClaimV1PB().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AssetClaimV1PB { + return new AssetClaimV1PB().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AssetClaimV1PB { + return new AssetClaimV1PB().fromJsonString(jsonString, options); + } + + static equals(a: AssetClaimV1PB | PlainMessage | undefined, b: AssetClaimV1PB | PlainMessage | undefined): boolean { + return proto3.util.equals(AssetClaimV1PB, a, b); + } +} + diff --git a/packages/cacti-copm-core/src/main/typescript/generated/models/asset_lock_claim_v1_pb_pb.ts b/packages/cacti-copm-core/src/main/typescript/generated/models/asset_lock_claim_v1_pb_pb.ts new file mode 100644 index 00000000000..a22cca910cd --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/generated/models/asset_lock_claim_v1_pb_pb.ts @@ -0,0 +1,93 @@ +// +//Hyperledger Cacti Plugin - Common Operator Primitives +// +//Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. +// +//The version of the OpenAPI document: 2.0.0-rc.2 +// +//Generated by OpenAPI Generator: https://openapi-generator.tech + +// @generated by protoc-gen-es v1.8.0 with parameter "target=ts" +// @generated from file models/asset_lock_claim_v1_pb.proto (package org.hyperledger.cacti.plugin.cacti.plugin.copm.core, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import { AssetAccountV1PB } from "./asset_account_v1_pb_pb.js"; +import { TransferrableAssetV1PB } from "./transferrable_asset_v1_pb_pb.js"; +import { HashInfoV1PB } from "./hash_info_v1_pb_pb.js"; + +/** + * @generated from message org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetLockClaimV1PB + */ +export class AssetLockClaimV1PB extends Message { + /** + * @generated from field: string lock_id = 338696367; + */ + lockId = ""; + + /** + * @generated from field: org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetAccountV1PB source = 359634918; + */ + source?: AssetAccountV1PB; + + /** + * @generated from field: org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetAccountV1PB destination = 356105204; + */ + destination?: AssetAccountV1PB; + + /** + * @generated from field: org.hyperledger.cacti.plugin.cacti.plugin.copm.core.TransferrableAssetV1PB asset = 93121264; + */ + asset?: TransferrableAssetV1PB; + + /** + * @generated from field: org.hyperledger.cacti.plugin.cacti.plugin.copm.core.HashInfoV1PB hash_info = 309318975; + */ + hashInfo?: HashInfoV1PB; + + /** + * @generated from field: string source_certificate = 72464244; + */ + sourceCertificate = ""; + + /** + * @generated from field: string dest_certificate = 165133181; + */ + destCertificate = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetLockClaimV1PB"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 338696367, name: "lock_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 359634918, name: "source", kind: "message", T: AssetAccountV1PB }, + { no: 356105204, name: "destination", kind: "message", T: AssetAccountV1PB }, + { no: 93121264, name: "asset", kind: "message", T: TransferrableAssetV1PB }, + { no: 309318975, name: "hash_info", kind: "message", T: HashInfoV1PB }, + { no: 72464244, name: "source_certificate", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 165133181, name: "dest_certificate", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AssetLockClaimV1PB { + return new AssetLockClaimV1PB().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AssetLockClaimV1PB { + return new AssetLockClaimV1PB().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AssetLockClaimV1PB { + return new AssetLockClaimV1PB().fromJsonString(jsonString, options); + } + + static equals(a: AssetLockClaimV1PB | PlainMessage | undefined, b: AssetLockClaimV1PB | PlainMessage | undefined): boolean { + return proto3.util.equals(AssetLockClaimV1PB, a, b); + } +} + diff --git a/packages/cacti-copm-core/src/main/typescript/generated/models/asset_lock_v1_pb_pb.ts b/packages/cacti-copm-core/src/main/typescript/generated/models/asset_lock_v1_pb_pb.ts new file mode 100644 index 00000000000..91a738199fc --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/generated/models/asset_lock_v1_pb_pb.ts @@ -0,0 +1,87 @@ +// +//Hyperledger Cacti Plugin - Common Operator Primitives +// +//Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. +// +//The version of the OpenAPI document: 2.0.0-rc.2 +// +//Generated by OpenAPI Generator: https://openapi-generator.tech + +// @generated by protoc-gen-es v1.8.0 with parameter "target=ts" +// @generated from file models/asset_lock_v1_pb.proto (package org.hyperledger.cacti.plugin.cacti.plugin.copm.core, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; +import { TransferrableAssetV1PB } from "./transferrable_asset_v1_pb_pb.js"; +import { AssetAccountV1PB } from "./asset_account_v1_pb_pb.js"; +import { HashInfoV1PB } from "./hash_info_v1_pb_pb.js"; + +/** + * @generated from message org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetLockV1PB + */ +export class AssetLockV1PB extends Message { + /** + * @generated from field: org.hyperledger.cacti.plugin.cacti.plugin.copm.core.TransferrableAssetV1PB asset = 93121264; + */ + asset?: TransferrableAssetV1PB; + + /** + * @generated from field: org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetAccountV1PB owner = 106164915; + */ + owner?: AssetAccountV1PB; + + /** + * @generated from field: org.hyperledger.cacti.plugin.cacti.plugin.copm.core.HashInfoV1PB hash_info = 309318975; + */ + hashInfo?: HashInfoV1PB; + + /** + * @generated from field: string destination_certificate = 101302555; + */ + destinationCertificate = ""; + + /** + * @generated from field: string source_certificate = 72464244; + */ + sourceCertificate = ""; + + /** + * @generated from field: int64 expiry_secs = 476369358; + */ + expirySecs = protoInt64.zero; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetLockV1PB"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 93121264, name: "asset", kind: "message", T: TransferrableAssetV1PB }, + { no: 106164915, name: "owner", kind: "message", T: AssetAccountV1PB }, + { no: 309318975, name: "hash_info", kind: "message", T: HashInfoV1PB }, + { no: 101302555, name: "destination_certificate", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 72464244, name: "source_certificate", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 476369358, name: "expiry_secs", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AssetLockV1PB { + return new AssetLockV1PB().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AssetLockV1PB { + return new AssetLockV1PB().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AssetLockV1PB { + return new AssetLockV1PB().fromJsonString(jsonString, options); + } + + static equals(a: AssetLockV1PB | PlainMessage | undefined, b: AssetLockV1PB | PlainMessage | undefined): boolean { + return proto3.util.equals(AssetLockV1PB, a, b); + } +} + diff --git a/packages/cacti-copm-core/src/main/typescript/generated/models/asset_pledge_claim_v1_pb_pb.ts b/packages/cacti-copm-core/src/main/typescript/generated/models/asset_pledge_claim_v1_pb_pb.ts new file mode 100644 index 00000000000..e169dda8552 --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/generated/models/asset_pledge_claim_v1_pb_pb.ts @@ -0,0 +1,86 @@ +// +//Hyperledger Cacti Plugin - Common Operator Primitives +// +//Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. +// +//The version of the OpenAPI document: 2.0.0-rc.2 +// +//Generated by OpenAPI Generator: https://openapi-generator.tech + +// @generated by protoc-gen-es v1.8.0 with parameter "target=ts" +// @generated from file models/asset_pledge_claim_v1_pb.proto (package org.hyperledger.cacti.plugin.cacti.plugin.copm.core, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import { AssetAccountV1PB } from "./asset_account_v1_pb_pb.js"; +import { TransferrableAssetV1PB } from "./transferrable_asset_v1_pb_pb.js"; + +/** + * @generated from message org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetPledgeClaimV1PB + */ +export class AssetPledgeClaimV1PB extends Message { + /** + * @generated from field: string pledge_id = 4476259; + */ + pledgeId = ""; + + /** + * @generated from field: org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetAccountV1PB source = 359634918; + */ + source?: AssetAccountV1PB; + + /** + * @generated from field: org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetAccountV1PB destination = 356105204; + */ + destination?: AssetAccountV1PB; + + /** + * @generated from field: org.hyperledger.cacti.plugin.cacti.plugin.copm.core.TransferrableAssetV1PB asset = 93121264; + */ + asset?: TransferrableAssetV1PB; + + /** + * @generated from field: string source_certificate = 72464244; + */ + sourceCertificate = ""; + + /** + * @generated from field: string dest_certificate = 165133181; + */ + destCertificate = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetPledgeClaimV1PB"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 4476259, name: "pledge_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 359634918, name: "source", kind: "message", T: AssetAccountV1PB }, + { no: 356105204, name: "destination", kind: "message", T: AssetAccountV1PB }, + { no: 93121264, name: "asset", kind: "message", T: TransferrableAssetV1PB }, + { no: 72464244, name: "source_certificate", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 165133181, name: "dest_certificate", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AssetPledgeClaimV1PB { + return new AssetPledgeClaimV1PB().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AssetPledgeClaimV1PB { + return new AssetPledgeClaimV1PB().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AssetPledgeClaimV1PB { + return new AssetPledgeClaimV1PB().fromJsonString(jsonString, options); + } + + static equals(a: AssetPledgeClaimV1PB | PlainMessage | undefined, b: AssetPledgeClaimV1PB | PlainMessage | undefined): boolean { + return proto3.util.equals(AssetPledgeClaimV1PB, a, b); + } +} + diff --git a/packages/cacti-copm-core/src/main/typescript/generated/models/asset_pledge_v1_pb_pb.ts b/packages/cacti-copm-core/src/main/typescript/generated/models/asset_pledge_v1_pb_pb.ts new file mode 100644 index 00000000000..45418c80c99 --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/generated/models/asset_pledge_v1_pb_pb.ts @@ -0,0 +1,80 @@ +// +//Hyperledger Cacti Plugin - Common Operator Primitives +// +//Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. +// +//The version of the OpenAPI document: 2.0.0-rc.2 +// +//Generated by OpenAPI Generator: https://openapi-generator.tech + +// @generated by protoc-gen-es v1.8.0 with parameter "target=ts" +// @generated from file models/asset_pledge_v1_pb.proto (package org.hyperledger.cacti.plugin.cacti.plugin.copm.core, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; +import { AssetAccountV1PB } from "./asset_account_v1_pb_pb.js"; +import { TransferrableAssetV1PB } from "./transferrable_asset_v1_pb_pb.js"; + +/** + * @generated from message org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetPledgeV1PB + */ +export class AssetPledgeV1PB extends Message { + /** + * @generated from field: org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetAccountV1PB source = 359634918; + */ + source?: AssetAccountV1PB; + + /** + * @generated from field: org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetAccountV1PB destination = 356105204; + */ + destination?: AssetAccountV1PB; + + /** + * @generated from field: org.hyperledger.cacti.plugin.cacti.plugin.copm.core.TransferrableAssetV1PB asset = 93121264; + */ + asset?: TransferrableAssetV1PB; + + /** + * @generated from field: int64 expiry_secs = 476369358; + */ + expirySecs = protoInt64.zero; + + /** + * @generated from field: string destination_certificate = 101302555; + */ + destinationCertificate = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetPledgeV1PB"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 359634918, name: "source", kind: "message", T: AssetAccountV1PB }, + { no: 356105204, name: "destination", kind: "message", T: AssetAccountV1PB }, + { no: 93121264, name: "asset", kind: "message", T: TransferrableAssetV1PB }, + { no: 476369358, name: "expiry_secs", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 101302555, name: "destination_certificate", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AssetPledgeV1PB { + return new AssetPledgeV1PB().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AssetPledgeV1PB { + return new AssetPledgeV1PB().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AssetPledgeV1PB { + return new AssetPledgeV1PB().fromJsonString(jsonString, options); + } + + static equals(a: AssetPledgeV1PB | PlainMessage | undefined, b: AssetPledgeV1PB | PlainMessage | undefined): boolean { + return proto3.util.equals(AssetPledgeV1PB, a, b); + } +} + diff --git a/packages/cacti-copm-core/src/main/typescript/generated/models/claim_pledged_asset_v1200_response_pb_pb.ts b/packages/cacti-copm-core/src/main/typescript/generated/models/claim_pledged_asset_v1200_response_pb_pb.ts new file mode 100644 index 00000000000..cc76dd37ac2 --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/generated/models/claim_pledged_asset_v1200_response_pb_pb.ts @@ -0,0 +1,54 @@ +// +//Hyperledger Cacti Plugin - Common Operator Primitives +// +//Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. +// +//The version of the OpenAPI document: 2.0.0-rc.2 +// +//Generated by OpenAPI Generator: https://openapi-generator.tech + +// @generated by protoc-gen-es v1.8.0 with parameter "target=ts" +// @generated from file models/claim_pledged_asset_v1200_response_pb.proto (package org.hyperledger.cacti.plugin.cacti.plugin.copm.core, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message org.hyperledger.cacti.plugin.cacti.plugin.copm.core.ClaimPledgedAssetV1200ResponsePB + */ +export class ClaimPledgedAssetV1200ResponsePB extends Message { + /** + * @generated from field: string claim_id = 146149375; + */ + claimId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "org.hyperledger.cacti.plugin.cacti.plugin.copm.core.ClaimPledgedAssetV1200ResponsePB"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 146149375, name: "claim_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ClaimPledgedAssetV1200ResponsePB { + return new ClaimPledgedAssetV1200ResponsePB().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ClaimPledgedAssetV1200ResponsePB { + return new ClaimPledgedAssetV1200ResponsePB().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ClaimPledgedAssetV1200ResponsePB { + return new ClaimPledgedAssetV1200ResponsePB().fromJsonString(jsonString, options); + } + + static equals(a: ClaimPledgedAssetV1200ResponsePB | PlainMessage | undefined, b: ClaimPledgedAssetV1200ResponsePB | PlainMessage | undefined): boolean { + return proto3.util.equals(ClaimPledgedAssetV1200ResponsePB, a, b); + } +} + diff --git a/packages/cacti-copm-core/src/main/typescript/generated/models/hash_info_v1_pb_pb.ts b/packages/cacti-copm-core/src/main/typescript/generated/models/hash_info_v1_pb_pb.ts new file mode 100644 index 00000000000..c8e88bbe875 --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/generated/models/hash_info_v1_pb_pb.ts @@ -0,0 +1,60 @@ +// +//Hyperledger Cacti Plugin - Common Operator Primitives +// +//Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. +// +//The version of the OpenAPI document: 2.0.0-rc.2 +// +//Generated by OpenAPI Generator: https://openapi-generator.tech + +// @generated by protoc-gen-es v1.8.0 with parameter "target=ts" +// @generated from file models/hash_info_v1_pb.proto (package org.hyperledger.cacti.plugin.cacti.plugin.copm.core, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message org.hyperledger.cacti.plugin.cacti.plugin.copm.core.HashInfoV1PB + */ +export class HashInfoV1PB extends Message { + /** + * @generated from field: string hash_fcn = 148522144; + */ + hashFcn = ""; + + /** + * @generated from field: string secret = 369406289; + */ + secret = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "org.hyperledger.cacti.plugin.cacti.plugin.copm.core.HashInfoV1PB"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 148522144, name: "hash_fcn", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 369406289, name: "secret", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): HashInfoV1PB { + return new HashInfoV1PB().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): HashInfoV1PB { + return new HashInfoV1PB().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): HashInfoV1PB { + return new HashInfoV1PB().fromJsonString(jsonString, options); + } + + static equals(a: HashInfoV1PB | PlainMessage | undefined, b: HashInfoV1PB | PlainMessage | undefined): boolean { + return proto3.util.equals(HashInfoV1PB, a, b); + } +} + diff --git a/packages/cacti-copm-core/src/main/typescript/generated/models/lock_asset_v1200_response_pb_pb.ts b/packages/cacti-copm-core/src/main/typescript/generated/models/lock_asset_v1200_response_pb_pb.ts new file mode 100644 index 00000000000..ade6bd98af9 --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/generated/models/lock_asset_v1200_response_pb_pb.ts @@ -0,0 +1,54 @@ +// +//Hyperledger Cacti Plugin - Common Operator Primitives +// +//Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. +// +//The version of the OpenAPI document: 2.0.0-rc.2 +// +//Generated by OpenAPI Generator: https://openapi-generator.tech + +// @generated by protoc-gen-es v1.8.0 with parameter "target=ts" +// @generated from file models/lock_asset_v1200_response_pb.proto (package org.hyperledger.cacti.plugin.cacti.plugin.copm.core, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message org.hyperledger.cacti.plugin.cacti.plugin.copm.core.LockAssetV1200ResponsePB + */ +export class LockAssetV1200ResponsePB extends Message { + /** + * @generated from field: string lock_id = 338696367; + */ + lockId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "org.hyperledger.cacti.plugin.cacti.plugin.copm.core.LockAssetV1200ResponsePB"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 338696367, name: "lock_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): LockAssetV1200ResponsePB { + return new LockAssetV1200ResponsePB().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): LockAssetV1200ResponsePB { + return new LockAssetV1200ResponsePB().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): LockAssetV1200ResponsePB { + return new LockAssetV1200ResponsePB().fromJsonString(jsonString, options); + } + + static equals(a: LockAssetV1200ResponsePB | PlainMessage | undefined, b: LockAssetV1200ResponsePB | PlainMessage | undefined): boolean { + return proto3.util.equals(LockAssetV1200ResponsePB, a, b); + } +} + diff --git a/packages/cacti-copm-core/src/main/typescript/generated/models/pledge_asset_v1200_response_pb_pb.ts b/packages/cacti-copm-core/src/main/typescript/generated/models/pledge_asset_v1200_response_pb_pb.ts new file mode 100644 index 00000000000..f4596ea68ad --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/generated/models/pledge_asset_v1200_response_pb_pb.ts @@ -0,0 +1,54 @@ +// +//Hyperledger Cacti Plugin - Common Operator Primitives +// +//Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. +// +//The version of the OpenAPI document: 2.0.0-rc.2 +// +//Generated by OpenAPI Generator: https://openapi-generator.tech + +// @generated by protoc-gen-es v1.8.0 with parameter "target=ts" +// @generated from file models/pledge_asset_v1200_response_pb.proto (package org.hyperledger.cacti.plugin.cacti.plugin.copm.core, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message org.hyperledger.cacti.plugin.cacti.plugin.copm.core.PledgeAssetV1200ResponsePB + */ +export class PledgeAssetV1200ResponsePB extends Message { + /** + * @generated from field: string pledge_id = 4476259; + */ + pledgeId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "org.hyperledger.cacti.plugin.cacti.plugin.copm.core.PledgeAssetV1200ResponsePB"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 4476259, name: "pledge_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PledgeAssetV1200ResponsePB { + return new PledgeAssetV1200ResponsePB().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PledgeAssetV1200ResponsePB { + return new PledgeAssetV1200ResponsePB().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PledgeAssetV1200ResponsePB { + return new PledgeAssetV1200ResponsePB().fromJsonString(jsonString, options); + } + + static equals(a: PledgeAssetV1200ResponsePB | PlainMessage | undefined, b: PledgeAssetV1200ResponsePB | PlainMessage | undefined): boolean { + return proto3.util.equals(PledgeAssetV1200ResponsePB, a, b); + } +} + diff --git a/packages/cacti-copm-core/src/main/typescript/generated/models/state_proof_v1_pb_pb.ts b/packages/cacti-copm-core/src/main/typescript/generated/models/state_proof_v1_pb_pb.ts new file mode 100644 index 00000000000..1f9e19028db --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/generated/models/state_proof_v1_pb_pb.ts @@ -0,0 +1,62 @@ +// +//Hyperledger Cacti Plugin - Common Operator Primitives +// +//Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. +// +//The version of the OpenAPI document: 2.0.0-rc.2 +// +//Generated by OpenAPI Generator: https://openapi-generator.tech + +// @generated by protoc-gen-es v1.8.0 with parameter "target=ts" +// @generated from file models/state_proof_v1_pb.proto (package org.hyperledger.cacti.plugin.cacti.plugin.copm.core, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import { AssetAccountV1PB } from "./asset_account_v1_pb_pb.js"; +import { ViewV1PB } from "./view_v1_pb_pb.js"; + +/** + * @generated from message org.hyperledger.cacti.plugin.cacti.plugin.copm.core.StateProofV1PB + */ +export class StateProofV1PB extends Message { + /** + * @generated from field: org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetAccountV1PB account = 103577045; + */ + account?: AssetAccountV1PB; + + /** + * @generated from field: org.hyperledger.cacti.plugin.cacti.plugin.copm.core.ViewV1PB view = 3619493; + */ + view?: ViewV1PB; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "org.hyperledger.cacti.plugin.cacti.plugin.copm.core.StateProofV1PB"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 103577045, name: "account", kind: "message", T: AssetAccountV1PB }, + { no: 3619493, name: "view", kind: "message", T: ViewV1PB }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): StateProofV1PB { + return new StateProofV1PB().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): StateProofV1PB { + return new StateProofV1PB().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): StateProofV1PB { + return new StateProofV1PB().fromJsonString(jsonString, options); + } + + static equals(a: StateProofV1PB | PlainMessage | undefined, b: StateProofV1PB | PlainMessage | undefined): boolean { + return proto3.util.equals(StateProofV1PB, a, b); + } +} + diff --git a/packages/cacti-copm-core/src/main/typescript/generated/models/transferrable_asset_v1_pb_pb.ts b/packages/cacti-copm-core/src/main/typescript/generated/models/transferrable_asset_v1_pb_pb.ts new file mode 100644 index 00000000000..844c5f3601c --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/generated/models/transferrable_asset_v1_pb_pb.ts @@ -0,0 +1,68 @@ +// +//Hyperledger Cacti Plugin - Common Operator Primitives +// +//Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. +// +//The version of the OpenAPI document: 2.0.0-rc.2 +// +//Generated by OpenAPI Generator: https://openapi-generator.tech + +// @generated by protoc-gen-es v1.8.0 with parameter "target=ts" +// @generated from file models/transferrable_asset_v1_pb.proto (package org.hyperledger.cacti.plugin.cacti.plugin.copm.core, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message org.hyperledger.cacti.plugin.cacti.plugin.copm.core.TransferrableAssetV1PB + */ +export class TransferrableAssetV1PB extends Message { + /** + * @generated from field: string asset_type = 519156524; + */ + assetType = ""; + + /** + * encoded description of NFT + * + * @generated from field: string asset_id = 373202742; + */ + assetId = ""; + + /** + * @generated from field: int32 asset_quantity = 386005244; + */ + assetQuantity = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "org.hyperledger.cacti.plugin.cacti.plugin.copm.core.TransferrableAssetV1PB"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 519156524, name: "asset_type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 373202742, name: "asset_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 386005244, name: "asset_quantity", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): TransferrableAssetV1PB { + return new TransferrableAssetV1PB().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): TransferrableAssetV1PB { + return new TransferrableAssetV1PB().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): TransferrableAssetV1PB { + return new TransferrableAssetV1PB().fromJsonString(jsonString, options); + } + + static equals(a: TransferrableAssetV1PB | PlainMessage | undefined, b: TransferrableAssetV1PB | PlainMessage | undefined): boolean { + return proto3.util.equals(TransferrableAssetV1PB, a, b); + } +} + diff --git a/packages/cacti-copm-core/src/main/typescript/generated/models/view_address_v1_pb_pb.ts b/packages/cacti-copm-core/src/main/typescript/generated/models/view_address_v1_pb_pb.ts new file mode 100644 index 00000000000..faf48ccb4dd --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/generated/models/view_address_v1_pb_pb.ts @@ -0,0 +1,66 @@ +// +//Hyperledger Cacti Plugin - Common Operator Primitives +// +//Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. +// +//The version of the OpenAPI document: 2.0.0-rc.2 +// +//Generated by OpenAPI Generator: https://openapi-generator.tech + +// @generated by protoc-gen-es v1.8.0 with parameter "target=ts" +// @generated from file models/view_address_v1_pb.proto (package org.hyperledger.cacti.plugin.cacti.plugin.copm.core, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message org.hyperledger.cacti.plugin.cacti.plugin.copm.core.ViewAddressV1PB + */ +export class ViewAddressV1PB extends Message { + /** + * @generated from field: string contract_id = 512823451; + */ + contractId = ""; + + /** + * @generated from field: string function = 307196890; + */ + function = ""; + + /** + * @generated from field: repeated string input = 100358090; + */ + input: string[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "org.hyperledger.cacti.plugin.cacti.plugin.copm.core.ViewAddressV1PB"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 512823451, name: "contract_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 307196890, name: "function", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 100358090, name: "input", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ViewAddressV1PB { + return new ViewAddressV1PB().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ViewAddressV1PB { + return new ViewAddressV1PB().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ViewAddressV1PB { + return new ViewAddressV1PB().fromJsonString(jsonString, options); + } + + static equals(a: ViewAddressV1PB | PlainMessage | undefined, b: ViewAddressV1PB | PlainMessage | undefined): boolean { + return proto3.util.equals(ViewAddressV1PB, a, b); + } +} + diff --git a/packages/cacti-copm-core/src/main/typescript/generated/models/view_v1_pb_pb.ts b/packages/cacti-copm-core/src/main/typescript/generated/models/view_v1_pb_pb.ts new file mode 100644 index 00000000000..a9c5107bb13 --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/generated/models/view_v1_pb_pb.ts @@ -0,0 +1,61 @@ +// +//Hyperledger Cacti Plugin - Common Operator Primitives +// +//Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. +// +//The version of the OpenAPI document: 2.0.0-rc.2 +// +//Generated by OpenAPI Generator: https://openapi-generator.tech + +// @generated by protoc-gen-es v1.8.0 with parameter "target=ts" +// @generated from file models/view_v1_pb.proto (package org.hyperledger.cacti.plugin.cacti.plugin.copm.core, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import { ViewAddressV1PB } from "./view_address_v1_pb_pb.js"; + +/** + * @generated from message org.hyperledger.cacti.plugin.cacti.plugin.copm.core.ViewV1PB + */ +export class ViewV1PB extends Message { + /** + * @generated from field: string network = 232872497; + */ + network = ""; + + /** + * @generated from field: org.hyperledger.cacti.plugin.cacti.plugin.copm.core.ViewAddressV1PB view_address = 312477787; + */ + viewAddress?: ViewAddressV1PB; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "org.hyperledger.cacti.plugin.cacti.plugin.copm.core.ViewV1PB"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 232872497, name: "network", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 312477787, name: "view_address", kind: "message", T: ViewAddressV1PB }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ViewV1PB { + return new ViewV1PB().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ViewV1PB { + return new ViewV1PB().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ViewV1PB { + return new ViewV1PB().fromJsonString(jsonString, options); + } + + static equals(a: ViewV1PB | PlainMessage | undefined, b: ViewV1PB | PlainMessage | undefined): boolean { + return proto3.util.equals(ViewV1PB, a, b); + } +} + diff --git a/packages/cacti-copm-core/src/main/typescript/generated/services/default_service_connect.ts b/packages/cacti-copm-core/src/main/typescript/generated/services/default_service_connect.ts new file mode 100644 index 00000000000..7d140264d04 --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/generated/services/default_service_connect.ts @@ -0,0 +1,74 @@ +// +//Hyperledger Cacti Plugin - Common Operator Primitives +// +//Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. +// +//The version of the OpenAPI document: 2.0.0-rc.2 +// +//Generated by OpenAPI Generator: https://openapi-generator.tech + +// @generated by protoc-gen-connect-es v1.5.0 with parameter "target=ts" +// @generated from file services/default_service.proto (package org.hyperledger.cacti.plugin.cacti.plugin.copm.core.services.defaultservice, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { ClaimLockedAssetV1Request, ClaimPledgedAssetV1Request, LockAssetV1Request, PledgeAssetV1Request, ProvestateV1Request } from "./default_service_pb.js"; +import { ClaimPledgedAssetV1200ResponsePB } from "../models/claim_pledged_asset_v1200_response_pb_pb.js"; +import { Empty, MethodKind } from "@bufbuild/protobuf"; +import { LockAssetV1200ResponsePB } from "../models/lock_asset_v1200_response_pb_pb.js"; +import { PledgeAssetV1200ResponsePB } from "../models/pledge_asset_v1200_response_pb_pb.js"; + +/** + * @generated from service org.hyperledger.cacti.plugin.cacti.plugin.copm.core.services.defaultservice.DefaultService + */ +export const DefaultService = { + typeName: "org.hyperledger.cacti.plugin.cacti.plugin.copm.core.services.defaultservice.DefaultService", + methods: { + /** + * @generated from rpc org.hyperledger.cacti.plugin.cacti.plugin.copm.core.services.defaultservice.DefaultService.ClaimLockedAssetV1 + */ + claimLockedAssetV1: { + name: "ClaimLockedAssetV1", + I: ClaimLockedAssetV1Request, + O: ClaimPledgedAssetV1200ResponsePB, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc org.hyperledger.cacti.plugin.cacti.plugin.copm.core.services.defaultservice.DefaultService.ClaimPledgedAssetV1 + */ + claimPledgedAssetV1: { + name: "ClaimPledgedAssetV1", + I: ClaimPledgedAssetV1Request, + O: ClaimPledgedAssetV1200ResponsePB, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc org.hyperledger.cacti.plugin.cacti.plugin.copm.core.services.defaultservice.DefaultService.LockAssetV1 + */ + lockAssetV1: { + name: "LockAssetV1", + I: LockAssetV1Request, + O: LockAssetV1200ResponsePB, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc org.hyperledger.cacti.plugin.cacti.plugin.copm.core.services.defaultservice.DefaultService.PledgeAssetV1 + */ + pledgeAssetV1: { + name: "PledgeAssetV1", + I: PledgeAssetV1Request, + O: PledgeAssetV1200ResponsePB, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc org.hyperledger.cacti.plugin.cacti.plugin.copm.core.services.defaultservice.DefaultService.ProvestateV1 + */ + provestateV1: { + name: "ProvestateV1", + I: ProvestateV1Request, + O: Empty, + kind: MethodKind.Unary, + }, + } +} as const; + diff --git a/packages/cacti-copm-core/src/main/typescript/generated/services/default_service_pb.ts b/packages/cacti-copm-core/src/main/typescript/generated/services/default_service_pb.ts new file mode 100644 index 00000000000..f056d64c0fb --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/generated/services/default_service_pb.ts @@ -0,0 +1,217 @@ +// +//Hyperledger Cacti Plugin - Common Operator Primitives +// +//Contains/describes the Hyperledger Cacti Common Operator Primitives plugin. These primitives require specific chaincode and weaver relays to be deployed on the network as described at https://hyperledger.github.io/cacti/weaver/introduction/. +// +//The version of the OpenAPI document: 2.0.0-rc.2 +// +//Generated by OpenAPI Generator: https://openapi-generator.tech + +// @generated by protoc-gen-es v1.8.0 with parameter "target=ts" +// @generated from file services/default_service.proto (package org.hyperledger.cacti.plugin.cacti.plugin.copm.core.services.defaultservice, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import { AssetLockClaimV1PB } from "../models/asset_lock_claim_v1_pb_pb.js"; +import { AssetPledgeClaimV1PB } from "../models/asset_pledge_claim_v1_pb_pb.js"; +import { AssetLockV1PB } from "../models/asset_lock_v1_pb_pb.js"; +import { AssetPledgeV1PB } from "../models/asset_pledge_v1_pb_pb.js"; +import { StateProofV1PB } from "../models/state_proof_v1_pb_pb.js"; + +/** + * @generated from message org.hyperledger.cacti.plugin.cacti.plugin.copm.core.services.defaultservice.ClaimLockedAssetV1Request + */ +export class ClaimLockedAssetV1Request extends Message { + /** + * + * + * @generated from field: org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetLockClaimV1PB assetLockClaimV1PB = 1; + */ + assetLockClaimV1PB?: AssetLockClaimV1PB; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "org.hyperledger.cacti.plugin.cacti.plugin.copm.core.services.defaultservice.ClaimLockedAssetV1Request"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "assetLockClaimV1PB", kind: "message", T: AssetLockClaimV1PB }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ClaimLockedAssetV1Request { + return new ClaimLockedAssetV1Request().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ClaimLockedAssetV1Request { + return new ClaimLockedAssetV1Request().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ClaimLockedAssetV1Request { + return new ClaimLockedAssetV1Request().fromJsonString(jsonString, options); + } + + static equals(a: ClaimLockedAssetV1Request | PlainMessage | undefined, b: ClaimLockedAssetV1Request | PlainMessage | undefined): boolean { + return proto3.util.equals(ClaimLockedAssetV1Request, a, b); + } +} + +/** + * @generated from message org.hyperledger.cacti.plugin.cacti.plugin.copm.core.services.defaultservice.ClaimPledgedAssetV1Request + */ +export class ClaimPledgedAssetV1Request extends Message { + /** + * + * + * @generated from field: org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetPledgeClaimV1PB assetPledgeClaimV1PB = 1; + */ + assetPledgeClaimV1PB?: AssetPledgeClaimV1PB; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "org.hyperledger.cacti.plugin.cacti.plugin.copm.core.services.defaultservice.ClaimPledgedAssetV1Request"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "assetPledgeClaimV1PB", kind: "message", T: AssetPledgeClaimV1PB }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ClaimPledgedAssetV1Request { + return new ClaimPledgedAssetV1Request().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ClaimPledgedAssetV1Request { + return new ClaimPledgedAssetV1Request().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ClaimPledgedAssetV1Request { + return new ClaimPledgedAssetV1Request().fromJsonString(jsonString, options); + } + + static equals(a: ClaimPledgedAssetV1Request | PlainMessage | undefined, b: ClaimPledgedAssetV1Request | PlainMessage | undefined): boolean { + return proto3.util.equals(ClaimPledgedAssetV1Request, a, b); + } +} + +/** + * @generated from message org.hyperledger.cacti.plugin.cacti.plugin.copm.core.services.defaultservice.LockAssetV1Request + */ +export class LockAssetV1Request extends Message { + /** + * + * + * @generated from field: org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetLockV1PB assetLockV1PB = 1; + */ + assetLockV1PB?: AssetLockV1PB; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "org.hyperledger.cacti.plugin.cacti.plugin.copm.core.services.defaultservice.LockAssetV1Request"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "assetLockV1PB", kind: "message", T: AssetLockV1PB }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): LockAssetV1Request { + return new LockAssetV1Request().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): LockAssetV1Request { + return new LockAssetV1Request().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): LockAssetV1Request { + return new LockAssetV1Request().fromJsonString(jsonString, options); + } + + static equals(a: LockAssetV1Request | PlainMessage | undefined, b: LockAssetV1Request | PlainMessage | undefined): boolean { + return proto3.util.equals(LockAssetV1Request, a, b); + } +} + +/** + * @generated from message org.hyperledger.cacti.plugin.cacti.plugin.copm.core.services.defaultservice.PledgeAssetV1Request + */ +export class PledgeAssetV1Request extends Message { + /** + * + * + * @generated from field: org.hyperledger.cacti.plugin.cacti.plugin.copm.core.AssetPledgeV1PB assetPledgeV1PB = 1; + */ + assetPledgeV1PB?: AssetPledgeV1PB; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "org.hyperledger.cacti.plugin.cacti.plugin.copm.core.services.defaultservice.PledgeAssetV1Request"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "assetPledgeV1PB", kind: "message", T: AssetPledgeV1PB }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PledgeAssetV1Request { + return new PledgeAssetV1Request().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PledgeAssetV1Request { + return new PledgeAssetV1Request().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PledgeAssetV1Request { + return new PledgeAssetV1Request().fromJsonString(jsonString, options); + } + + static equals(a: PledgeAssetV1Request | PlainMessage | undefined, b: PledgeAssetV1Request | PlainMessage | undefined): boolean { + return proto3.util.equals(PledgeAssetV1Request, a, b); + } +} + +/** + * @generated from message org.hyperledger.cacti.plugin.cacti.plugin.copm.core.services.defaultservice.ProvestateV1Request + */ +export class ProvestateV1Request extends Message { + /** + * + * + * @generated from field: org.hyperledger.cacti.plugin.cacti.plugin.copm.core.StateProofV1PB stateProofV1PB = 1; + */ + stateProofV1PB?: StateProofV1PB; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "org.hyperledger.cacti.plugin.cacti.plugin.copm.core.services.defaultservice.ProvestateV1Request"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "stateProofV1PB", kind: "message", T: StateProofV1PB }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ProvestateV1Request { + return new ProvestateV1Request().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ProvestateV1Request { + return new ProvestateV1Request().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ProvestateV1Request { + return new ProvestateV1Request().fromJsonString(jsonString, options); + } + + static equals(a: ProvestateV1Request | PlainMessage | undefined, b: ProvestateV1Request | PlainMessage | undefined): boolean { + return proto3.util.equals(ProvestateV1Request, a, b); + } +} + diff --git a/packages/cacti-copm-core/src/main/typescript/index.ts b/packages/cacti-copm-core/src/main/typescript/index.ts new file mode 100755 index 00000000000..87cb558397c --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/index.ts @@ -0,0 +1 @@ +export * from "./public-api"; diff --git a/packages/cacti-copm-core/src/main/typescript/interfaces.ts b/packages/cacti-copm-core/src/main/typescript/interfaces.ts new file mode 100644 index 00000000000..90c1ad9a8ee --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/interfaces.ts @@ -0,0 +1,4 @@ +export { DLTransactionContextFactory } from "./interfaces/dl-context-factory"; +export { DLRemoteTransactionContext } from "./interfaces/dl-remote-transaction-context"; +export { DLTransactionContext } from "./interfaces/dl-transaction-context"; +export { InteropConfiguration } from "./interfaces/interop-configuration"; diff --git a/packages/cacti-copm-core/src/main/typescript/interfaces/dl-context-factory.ts b/packages/cacti-copm-core/src/main/typescript/interfaces/dl-context-factory.ts new file mode 100644 index 00000000000..e6fbf6d76df --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/interfaces/dl-context-factory.ts @@ -0,0 +1,11 @@ +import { DLTransactionContext } from "./dl-transaction-context"; +import { DLRemoteTransactionContext } from "./dl-remote-transaction-context"; +import { DLAccount } from "../lib/types"; + +export interface DLTransactionContextFactory { + getTransactionContext(account: DLAccount): Promise; + getRemoteTransactionContext( + account: DLAccount, + remoteNetwork: string, + ): Promise; +} diff --git a/packages/cacti-copm-core/src/main/typescript/interfaces/dl-remote-transaction-context.ts b/packages/cacti-copm-core/src/main/typescript/interfaces/dl-remote-transaction-context.ts new file mode 100644 index 00000000000..ef31bbab9ee --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/interfaces/dl-remote-transaction-context.ts @@ -0,0 +1,10 @@ +import { DLTransactionParams } from "../lib/types"; + +export interface DLRemoteTransactionContext { + invokeFlow( + remoteTransactionParams: DLTransactionParams, + localTransactionParams: DLTransactionParams, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ): Promise; + invoke(transactionParams: DLTransactionParams): Promise; +} diff --git a/packages/cacti-copm-core/src/main/typescript/interfaces/dl-transaction-context.ts b/packages/cacti-copm-core/src/main/typescript/interfaces/dl-transaction-context.ts new file mode 100644 index 00000000000..512a167b2ed --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/interfaces/dl-transaction-context.ts @@ -0,0 +1,4 @@ +import { DLTransactionParams } from "../lib/types"; +export interface DLTransactionContext { + invoke(transactionParams: DLTransactionParams): Promise; +} diff --git a/packages/cacti-copm-core/src/main/typescript/interfaces/interop-configuration.ts b/packages/cacti-copm-core/src/main/typescript/interfaces/interop-configuration.ts new file mode 100644 index 00000000000..55aa2ffcbc1 --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/interfaces/interop-configuration.ts @@ -0,0 +1,7 @@ +import { LocalRelayConfig, RemoteNetworkConfig } from "../lib/types"; + +export interface InteropConfiguration { + getLocalRelayConfig(orgKey: string): LocalRelayConfig; + getRemoteNetworkConfig(remoteOrgKey: string): RemoteNetworkConfig; + interopContractName: string; +} diff --git a/packages/cacti-copm-core/src/main/typescript/lib/transferrable-asset.ts b/packages/cacti-copm-core/src/main/typescript/lib/transferrable-asset.ts new file mode 100644 index 00000000000..b1edca0b217 --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/lib/transferrable-asset.ts @@ -0,0 +1,26 @@ +import { TransferrableAssetV1PB } from "../generated/models/transferrable_asset_v1_pb_pb"; +export class TransferrableAsset { + private asset: TransferrableAssetV1PB; + public assetType: string; + + constructor(asset: TransferrableAssetV1PB) { + this.asset = asset; + this.assetType = asset.assetType || ""; + } + + public isNFT(): boolean { + if (this.asset.assetId) { + return true; + } else { + return false; + } + } + + public idOrQuantity(): string { + if (this.asset.assetQuantity) { + return this.asset.assetQuantity.toString(); + } else { + return this.asset.assetId || ""; + } + } +} diff --git a/packages/cacti-copm-core/src/main/typescript/lib/types.ts b/packages/cacti-copm-core/src/main/typescript/lib/types.ts new file mode 100644 index 00000000000..323a1cd7650 --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/lib/types.ts @@ -0,0 +1,32 @@ + +export type DLTransactionParams = { + contract: string; + method: string; + args: string[]; +}; + +export type DLAccount = { + organization: string; + userId: string; +}; + +export type CopmContractNames = { + pledgeContract: string; + lockContract: string; +}; + +export type RemoteNetworkConfig = { + channelName: string; + network: string; + relayAddr: string; + e2eConfidentiality: boolean; + partyEndPoint: string; // corda-specific + flowPackage: string; // corda-specific + networkType: string; +}; + +export type LocalRelayConfig = { + endpoint: string; + useTLS: boolean; + tlsCerts: string[]; +}; diff --git a/packages/cacti-copm-core/src/main/typescript/lib/view-address.ts b/packages/cacti-copm-core/src/main/typescript/lib/view-address.ts new file mode 100644 index 00000000000..281bf8e6228 --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/lib/view-address.ts @@ -0,0 +1,47 @@ +import { DLTransactionParams, RemoteNetworkConfig } from "./types"; + +export class ViewAddress { + private remoteNetConfig: RemoteNetworkConfig; + private transactionParams: DLTransactionParams; + + constructor( + remoteNetConfig: RemoteNetworkConfig, + transactionParams: DLTransactionParams, + ) { + this.remoteNetConfig = remoteNetConfig; + this.transactionParams = transactionParams; + } + + public toString(): string { + let address = + this.remoteNetConfig.relayAddr + "/" + this.remoteNetConfig.network; + if (this.remoteNetConfig.networkType == "fabric") { + address = + address + + "/" + + this.remoteNetConfig.channelName + + ":" + + this.transactionParams.contract + + ":" + + this.transactionParams.method + + ":" + + this.transactionParams.args.join(":"); + } else if (this.remoteNetConfig.networkType == "corda") { + address = + address + + "/" + + this.remoteNetConfig.partyEndPoint + + "#" + + this.remoteNetConfig.flowPackage + + "." + + this.transactionParams.method + + ":" + + this.transactionParams.args.join(":"); + } else { + throw new Error( + `Error: remote network ${this.remoteNetConfig.networkType} not supported.`, + ); + } + return address; + } +} diff --git a/packages/cacti-copm-core/src/main/typescript/public-api.ts b/packages/cacti-copm-core/src/main/typescript/public-api.ts new file mode 100755 index 00000000000..5ad0d2ca9c5 --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/public-api.ts @@ -0,0 +1,24 @@ +export * from "./generated/services/default_service_connect"; +export { + ClaimLockedAssetV1Request, + ClaimPledgedAssetV1Request, + LockAssetV1Request, + PledgeAssetV1Request, + ProvestateV1Request, +} from "./generated/services/default_service_pb"; +export { ClaimPledgedAssetV1200ResponsePB } from "./generated/models/claim_pledged_asset_v1200_response_pb_pb.js"; +export { LockAssetV1200ResponsePB } from "./generated/models/lock_asset_v1200_response_pb_pb.js"; +export { PledgeAssetV1200ResponsePB } from "./generated/models/pledge_asset_v1200_response_pb_pb.js"; +export { AssetAccountV1PB } from "./generated/models/asset_account_v1_pb_pb"; +export { HashInfoV1PB } from "./generated/models/hash_info_v1_pb_pb"; +export { TransferrableAssetV1PB } from "./generated/models/transferrable_asset_v1_pb_pb"; +export { + DLAccount, + CopmContractNames, + RemoteNetworkConfig, + LocalRelayConfig, + DLTransactionParams, +} from "./lib/types"; +export { ViewAddress } from "./lib/view-address"; +export * as Interfaces from "./interfaces"; +export * as Validators from "./validators"; diff --git a/packages/cacti-copm-core/src/main/typescript/validators.ts b/packages/cacti-copm-core/src/main/typescript/validators.ts new file mode 100644 index 00000000000..818940b34ef --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/validators.ts @@ -0,0 +1,5 @@ +export { validateClaimLockedAssetRequest } from "./validators/validate_claim_locked_asset_request"; +export { validateClaimPledgedAssetRequest } from "./validators/validate_claim_pledged_asset_request"; +export { validateLockAssetRequest } from "./validators/validate_lock_asset_request"; +export { validatePledgeAssetRequest } from "./validators/validate_pledge_asset_request"; +export { validateProveStateRequest } from "./validators/validate_prove_state_request"; \ No newline at end of file diff --git a/packages/cacti-copm-core/src/main/typescript/validators/common.ts b/packages/cacti-copm-core/src/main/typescript/validators/common.ts new file mode 100644 index 00000000000..74307cd6764 --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/validators/common.ts @@ -0,0 +1,80 @@ +import { ConnectError, Code } from "@connectrpc/connect"; +import { AssetAccountV1PB } from "../generated/models/asset_account_v1_pb_pb"; +import { HashInfoV1PB } from "../generated/models/hash_info_v1_pb_pb"; +import { TransferrableAssetV1PB } from "../generated/models/transferrable_asset_v1_pb_pb"; +import { HashFunctions } from "@hyperledger/cacti-weaver-sdk-fabric"; +import { DLAccount } from "../lib/types"; +import { TransferrableAsset } from "../lib/transferrable-asset"; + +export function validateAssetAccount( + account: AssetAccountV1PB | undefined, + object_prefix: string, +): DLAccount { + if (!account) { + throw new ConnectError(`${object_prefix} required`, Code.InvalidArgument); + } + if (!account.network) { + throw new ConnectError( + `${object_prefix}.network required`, + Code.InvalidArgument, + ); + } + if (!account.userId) { + throw new ConnectError( + `${object_prefix}.userId required`, + Code.InvalidArgument, + ); + } + return { + organization: account.network, + userId: account.userId, + }; +} + +export function validateTransferrableAsset( + asset: TransferrableAssetV1PB | undefined, + object_prefix: string, +) { + if (!asset) { + throw new ConnectError(`${object_prefix} required`, Code.InvalidArgument); + } + + if (!asset.assetType) { + throw new ConnectError( + `${object_prefix}.assetType required`, + Code.InvalidArgument, + ); + } + + if (!asset.assetId && !asset.assetQuantity) { + throw new ConnectError( + `Either ${object_prefix}.assetQuantity or ${object_prefix}.assetId must be supplied`, + Code.InvalidArgument, + ); + } + + return new TransferrableAsset(asset); +} + +export function validateHashInfo( + hashInfo: HashInfoV1PB | undefined, + object_prefix: string, +): HashFunctions.Hash { + if (!hashInfo) { + throw new ConnectError(`${object_prefix} required`, Code.InvalidArgument); + } + if (!hashInfo.secret) { + throw new ConnectError( + `${object_prefix}.secret required`, + Code.InvalidArgument, + ); + } + let hash: HashFunctions.Hash; + if (hashInfo?.hashFcn == "SHA512") { + hash = new HashFunctions.SHA512(); + } else { + hash = new HashFunctions.SHA256(); + } + hash.setPreimage(hashInfo.secret); + return hash; +} diff --git a/packages/cacti-copm-core/src/main/typescript/validators/validate_claim_locked_asset_request.ts b/packages/cacti-copm-core/src/main/typescript/validators/validate_claim_locked_asset_request.ts new file mode 100644 index 00000000000..bb2ed4b5bee --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/validators/validate_claim_locked_asset_request.ts @@ -0,0 +1,68 @@ +import { TransferrableAsset } from "../lib/transferrable-asset"; +import { DLAccount } from "../lib/types"; +import { HashFunctions } from "@hyperledger/cacti-weaver-sdk-fabric"; +import { ConnectError, Code } from "@connectrpc/connect"; +import { + validateTransferrableAsset, + validateHashInfo, + validateAssetAccount, +} from "./common"; +import { ClaimLockedAssetV1Request } from "../generated/services/default_service_pb"; + +export function validateClaimLockedAssetRequest( + req: ClaimLockedAssetV1Request, +): { + asset: TransferrableAsset; + destination: DLAccount; + hashInfo: HashFunctions.Hash; + lockId: string; + sourceCertificate: string; + destCertificate: string; +} { + if (!req.assetLockClaimV1PB) { + throw new ConnectError(`request data is required`, Code.InvalidArgument); + } + if ( + !req.assetLockClaimV1PB?.asset?.assetId && + !req.assetLockClaimV1PB?.lockId + ) { + throw new ConnectError( + "either lockId or asset.assetId is required", + Code.InvalidArgument, + ); + } + + if (req.assetLockClaimV1PB?.asset.assetId) { + if (!req.assetLockClaimV1PB?.destCertificate) { + throw new ConnectError( + "destinationCertificate required for NFT claim", + Code.InvalidArgument, + ); + } + if (!req.assetLockClaimV1PB?.sourceCertificate) { + throw new ConnectError( + "sourceCertificate required for NFT claim", + Code.InvalidArgument, + ); + } + } else { + if (!req.assetLockClaimV1PB.lockId) { + throw new ConnectError( + "lockId must be supplied for fungible assets", + Code.InvalidArgument, + ); + } + } + + return { + asset: validateTransferrableAsset(req.assetLockClaimV1PB.asset, "asset"), + hashInfo: validateHashInfo(req.assetLockClaimV1PB.hashInfo, "hashInfo"), + destination: validateAssetAccount( + req.assetLockClaimV1PB.destination, + "destination", + ), + sourceCertificate: req.assetLockClaimV1PB.sourceCertificate || "", + destCertificate: req.assetLockClaimV1PB.destCertificate || "", + lockId: req.assetLockClaimV1PB.lockId || "", + }; +} diff --git a/packages/cacti-copm-core/src/main/typescript/validators/validate_claim_pledged_asset_request.ts b/packages/cacti-copm-core/src/main/typescript/validators/validate_claim_pledged_asset_request.ts new file mode 100644 index 00000000000..f8181c5656c --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/validators/validate_claim_pledged_asset_request.ts @@ -0,0 +1,43 @@ +import { TransferrableAsset } from "../lib/transferrable-asset"; +import { DLAccount } from "../lib/types"; +import { ConnectError, Code } from "@connectrpc/connect"; +import { validateTransferrableAsset, validateAssetAccount } from "./common"; +import { ClaimPledgedAssetV1Request } from "../generated/services/default_service_pb"; + +export function validateClaimPledgedAssetRequest( + req: ClaimPledgedAssetV1Request, +): { + asset: TransferrableAsset; + sourceCert: string; + destCert: string; + destAccount: DLAccount; + sourceNetwork: string; + pledgeId: string; +} { + if (!req.assetPledgeClaimV1PB) { + throw new ConnectError("request data required", Code.InvalidArgument); + } + if (!req.assetPledgeClaimV1PB.destCertificate) { + throw new ConnectError("destCertificate required", Code.InvalidArgument); + } + if (!req.assetPledgeClaimV1PB.sourceCertificate) { + throw new ConnectError("sourceCertificate required", Code.InvalidArgument); + } + if (!req.assetPledgeClaimV1PB.source?.network) { + throw new ConnectError("source.network required", Code.InvalidArgument); + } + if (!req.assetPledgeClaimV1PB.pledgeId) { + throw new ConnectError("pledgeId required", Code.InvalidArgument); + } + return { + destAccount: validateAssetAccount( + req.assetPledgeClaimV1PB.destination, + "destination", + ), + asset: validateTransferrableAsset(req.assetPledgeClaimV1PB.asset, "asset"), + pledgeId: req.assetPledgeClaimV1PB.pledgeId, + sourceNetwork: req.assetPledgeClaimV1PB.source.network, + sourceCert: req.assetPledgeClaimV1PB.sourceCertificate, + destCert: req.assetPledgeClaimV1PB.destCertificate, + }; +} diff --git a/packages/cacti-copm-core/src/main/typescript/validators/validate_lock_asset_request.ts b/packages/cacti-copm-core/src/main/typescript/validators/validate_lock_asset_request.ts new file mode 100644 index 00000000000..ea8e690c21c --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/validators/validate_lock_asset_request.ts @@ -0,0 +1,42 @@ +import { TransferrableAsset } from "../lib/transferrable-asset"; +import { DLAccount } from "../lib/types"; +import { ConnectError, Code } from "@connectrpc/connect"; +import { + validateTransferrableAsset, + validateAssetAccount, + validateHashInfo, +} from "./common"; +import { LockAssetV1Request } from "../generated/services/default_service_pb"; +import { HashFunctions } from "@hyperledger/cacti-weaver-sdk-fabric"; + +export function validateLockAssetRequest(request: LockAssetV1Request): { + owner: DLAccount; + hashInfo: HashFunctions.Hash; + sourceCertificate: string; + destinationCertificate: string; + asset: TransferrableAsset; + expirySecs: number; +} { + if (!request.assetLockV1PB) { + throw new ConnectError("data required", Code.InvalidArgument); + } + if (!request.assetLockV1PB.destinationCertificate) { + throw new ConnectError( + "destinationCertificate required", + Code.InvalidArgument, + ); + } + if (!request.assetLockV1PB.sourceCertificate) { + throw new ConnectError("sourceCertificate required", Code.InvalidArgument); + } + return { + owner: validateAssetAccount(request.assetLockV1PB.owner, "owner"), + hashInfo: validateHashInfo(request.assetLockV1PB.hashInfo, "hashInfo"), + asset: validateTransferrableAsset(request.assetLockV1PB.asset, "asset"), + sourceCertificate: request.assetLockV1PB.sourceCertificate, + destinationCertificate: request.assetLockV1PB.destinationCertificate, + expirySecs: request.assetLockV1PB.expirySecs + ? Number(request.assetLockV1PB.expirySecs) + : 60, + }; +} diff --git a/packages/cacti-copm-core/src/main/typescript/validators/validate_pledge_asset_request.ts b/packages/cacti-copm-core/src/main/typescript/validators/validate_pledge_asset_request.ts new file mode 100644 index 00000000000..4d720466ba5 --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/validators/validate_pledge_asset_request.ts @@ -0,0 +1,33 @@ +import { TransferrableAsset } from "../lib/transferrable-asset"; +import { DLAccount } from "../lib/types"; +import { ConnectError, Code } from "@connectrpc/connect"; +import { validateTransferrableAsset, validateAssetAccount } from "./common"; +import { PledgeAssetV1Request } from "../generated/services/default_service_pb"; + +export function validatePledgeAssetRequest(req: PledgeAssetV1Request): { + asset: TransferrableAsset; + source: DLAccount; + destinationNetwork: string; + destinationCertificate: string; + expirySecs: number; +} { + if (!req.assetPledgeV1PB) { + throw new ConnectError(`request data is required`, Code.InvalidArgument); + } + if (!req.assetPledgeV1PB.destination?.network) { + throw new ConnectError("destination.network is required"); + } + if (!req.assetPledgeV1PB.destinationCertificate) { + throw new ConnectError("destinationCertificate is required"); + } + + return { + asset: validateTransferrableAsset(req.assetPledgeV1PB.asset, "asset"), + source: validateAssetAccount(req.assetPledgeV1PB.source, "source"), + destinationNetwork: req.assetPledgeV1PB.destination.network, + destinationCertificate: req.assetPledgeV1PB.destinationCertificate, + expirySecs: req.assetPledgeV1PB.expirySecs + ? Number(req.assetPledgeV1PB.expirySecs) + : 60, + }; +} diff --git a/packages/cacti-copm-core/src/main/typescript/validators/validate_prove_state_request.ts b/packages/cacti-copm-core/src/main/typescript/validators/validate_prove_state_request.ts new file mode 100644 index 00000000000..74883a9928e --- /dev/null +++ b/packages/cacti-copm-core/src/main/typescript/validators/validate_prove_state_request.ts @@ -0,0 +1,49 @@ +import { DLAccount } from "../lib/types"; +import { ConnectError, Code } from "@connectrpc/connect"; +import { validateAssetAccount } from "./common"; +import { ProvestateV1Request } from "../generated/services/default_service_pb"; + +export function validateProveStateRequest(req: ProvestateV1Request): { + account: DLAccount; + method: string; + contractId: string; + args: string[]; + remoteNetwork: string; +} { + if (!req.stateProofV1PB) { + throw new ConnectError("request data required", Code.InvalidArgument); + } + if (!req.stateProofV1PB.view) { + throw new ConnectError("view required", Code.InvalidArgument); + } + if (!req.stateProofV1PB.view.network) { + throw new ConnectError("view.network required", Code.InvalidArgument); + } + if (!req.stateProofV1PB.view.viewAddress) { + throw new ConnectError("view.viewAddress required", Code.InvalidArgument); + } + if (!req.stateProofV1PB.view.viewAddress.contractId) { + throw new ConnectError( + "view.viewAddress.contractId required", + Code.InvalidArgument, + ); + } + if (!req.stateProofV1PB.view.viewAddress.function) { + throw new ConnectError( + "view.viewAddress.function required", + Code.InvalidArgument, + ); + } + + const args = req.stateProofV1PB?.view?.viewAddress?.input + ? req.stateProofV1PB.view.viewAddress.input + : []; + + return { + account: validateAssetAccount(req.stateProofV1PB.account, "account"), + remoteNetwork: req.stateProofV1PB.view.network, + contractId: req.stateProofV1PB.view.viewAddress.contractId, + method: req.stateProofV1PB.view.viewAddress.function, + args: args, + }; +} diff --git a/packages/cacti-copm-core/tsconfig.json b/packages/cacti-copm-core/tsconfig.json new file mode 100644 index 00000000000..556992d6d19 --- /dev/null +++ b/packages/cacti-copm-core/tsconfig.json @@ -0,0 +1,34 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "composite": true, + "outDir": "./dist/lib/", + "declarationDir": "dist/lib", + "resolveJsonModule": true, + "rootDir": "./src", + "strict": false /* Enable all strict type-checking options. */, + "noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */ + "tsBuildInfoFile": "../../.build-cache/cacti-copm-core.tsbuildinfo" + }, + "include": [ + "./src", + "src/**/*.json" + ], + "references": [ + { + "path": "../cactus-common/tsconfig.json" + }, + { + "path": "../cactus-core/tsconfig.json" + }, + { + "path": "../cactus-core-api/tsconfig.json" + }, + { + "path": "../cactus-plugin-keychain-memory/tsconfig.json" + }, + { + "path": "../cactus-test-tooling/tsconfig.json" + } + ] +} \ No newline at end of file diff --git a/packages/cacti-plugin-copm-fabric/.npmignore b/packages/cacti-plugin-copm-fabric/.npmignore new file mode 100644 index 00000000000..f46592831f3 --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/.npmignore @@ -0,0 +1 @@ +src/tests diff --git a/packages/cacti-plugin-copm-fabric/Makefile b/packages/cacti-plugin-copm-fabric/Makefile new file mode 100644 index 00000000000..894350c49f8 --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/Makefile @@ -0,0 +1,108 @@ +WORKSPACE ?= $(shell realpath `pwd`/../../) +DOCKER_IMAGES=hyperledger/fabric-orderer hyperledger/fabric-peer hyperledger/fabric-ca ghcr.io/hyperledger/cacti-weaver-iin-agent ghcr.io/hyperledger/cacti-weaver-relay-server ghcr.io/hyperledger/cacti-weaver-driver-fabric + +pledge%: chaincode = simpleassettransfer +lock%: chaincode = simpleasset + +.fabric-network: + cd $(WORKSPACE)/weaver/tests/network-setups/fabric/dev && \ + make start-interop CHAINCODE_NAME=$(chaincode) PROFILE='2-nodes' + +drivers: + cd $(WORKSPACE)/weaver/core/drivers/fabric-driver && \ + sed -i "s##$(WORKSPACE)/weaver#g" docker-testnet-envs/.env.n1 &&\ + sed -i "s##$(WORKSPACE)/weaver#g" docker-testnet-envs/.env.n2 && \ + make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.n1' NETWORK_NAME=network1 && \ + make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.n2' NETWORK_NAME=network2 + +relays: + cd $(WORKSPACE)/weaver/core/relay && \ + make convert-compose-method2 && \ + make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.n1' && \ + make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.n2' + +iin: + cd $(WORKSPACE)/weaver/core/identity-management/iin-agent && \ + sed -i "s##$(WORKSPACE)/weaver#g" docker-testnet/envs/.env.n1.org1 && \ + sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n1.org1 && \ + sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n1.org1 && \ + sed -i "s##$(WORKSPACE)/weaver#g" docker-testnet/envs/.env.n1.org2 && \ + sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n1.org2 && \ + sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n1.org2 && \ + sed -i "s##$(WORKSPACE)/weaver#g" docker-testnet/envs/.env.n2.org1 && \ + sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n2.org1 && \ + sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n2.org1 && \ + sed -i "s##$(WORKSPACE)/weaver#g" docker-testnet/envs/.env.n2.org2 && \ + sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n2.org2 && \ + sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n2.org2 && \ + make build-image-local && \ + make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n1.org1' DLT_SPECIFIC_DIR=$(WORKSPACE)/weaver/tests/network-setups/fabric/shared/network1/peerOrganizations/org1.network1.com && \ + make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n1.org2' DLT_SPECIFIC_DIR=$(WORKSPACE)/weaver/tests/network-setups/fabric/shared/network1/peerOrganizations/org2.network1.com && \ + make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n2.org1' DLT_SPECIFIC_DIR=$(WORKSPACE)/weaver/tests/network-setups/fabric/shared/network2/peerOrganizations/org1.network2.com && \ + make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n2.org2' DLT_SPECIFIC_DIR=$(WORKSPACE)/weaver/tests/network-setups/fabric/shared/network2/peerOrganizations/org2.network2.com + + +.fabric-config: + cd $(WORKSPACE)/weaver/samples/fabric/fabric-cli && \ + ./bin/fabric-cli env set MEMBER_CREDENTIAL_FOLDER $(WORKSPACE)/weaver/samples/fabric/fabric-cli/src/data/credentials_docker && \ + ./bin/fabric-cli env set CONFIG_PATH $(WORKSPACE)/weaver/samples/fabric/fabric-cli/config.json && \ + ./bin/fabric-cli env set DEFAULT_APPLICATION_CHAINCODE $(chaincode) && \ + ./bin/fabric-cli env set REMOTE_CONFIG_PATH $(WORKSPACE)/weaver/samples/fabric/fabric-cli/remote-network-config.json && \ + ./bin/fabric-cli env set CHAINCODE_PATH $(WORKSPACE)/weaver/samples/fabric/fabric-cli/chaincode.json && \ + cat .env && \ + cp config.template.json config.json && \ + sed -i "s##$(WORKSPACE)/weaver#g" config.json && \ + ./bin/fabric-cli config set network2 aclPolicyPrincipalType ca && \ + ./bin/fabric-cli config set network1 chaincode $(chaincode) && \ + ./bin/fabric-cli config set network2 chaincode $(chaincode) && \ + cp chaincode.json.template chaincode.json && \ + cp remote-network-config.json.template remote-network-config.json && \ + sed -i "s#localhost:9080#relay-network1:9080#g" remote-network-config.json && \ + sed -i "s#localhost:9081#relay-corda:9081#g" remote-network-config.json && \ + sed -i "s#localhost:9082#relay-corda2:9082#g" remote-network-config.json && \ + sed -i "s#localhost:9083#relay-network2:9083#g" remote-network-config.json && \ + sed -i "s#localhost:10006#corda_partya_1:10003#g" remote-network-config.json && \ + sed -i "s#localhost:30006#corda_network2_partya_1:10003#g" remote-network-config.json && \ + ./bin/fabric-cli configure create all --local-network=network1 && \ + ./bin/fabric-cli configure create all --local-network=network2 && \ + ./bin/fabric-cli configure network --local-network=network1 --num-orgs=2 && \ + ./bin/fabric-cli configure network --local-network=network2 --num-orgs=2 && \ + ./bin/fabric-cli configure membership --local-network=network1 --target-network=network2 --iin-agent-endpoint=localhost:9500 && \ + sleep 30 && \ + docker logs iin-agent-Org1MSP-network1 && \ + docker logs iin-agent-Org1MSP-network2 && \ + ./bin/fabric-cli configure membership --local-network=network2 --target-network=network1 --iin-agent-endpoint=localhost:9501 && \ + sleep 30 && \ + docker logs iin-agent-Org1MSP-network1 && \ + docker logs iin-agent-Org1MSP-network2 + +PATH := $(PATH):$(WORKSPACE)/protoc/bin + +setup: + cd $(WORKSPACE)/weaver/common/protos-js && make build + rm -Rf $(WORKSPACE)/weaver/sdks/fabric/interoperation-node-sdk/build + cd $(WORKSPACE)/weaver/sdks/fabric/interoperation-node-sdk && make build-local + cd $(WORKSPACE)/weaver/core/identity-management/iin-agent && make build-local + cd $(WORKSPACE)/weaver/samples/fabric/fabric-cli && npm install --global yarn && make build-local + +.test-network: .fabric-network relays drivers iin .fabric-config + +pledge-network: .test-network + +lock-network: .test-network + +define stop_docker +echo "removing $(1)" +docker stop `docker container ls -a -q -f ancestor=$(1) | xargs` || true +docker rm `docker container ls -a -q -f ancestor=$(1) | xargs` || true +endef + +clean-network: + $(foreach image,$(DOCKER_IMAGES),$(call stop_docker,$(image))) + docker volume prune -f + docker volume rm network2_peer0.org2.network2.com || true + docker volume rm network1_peer0.org2.network1.com || true + if [ "$(shell id -un )" != "root" ]; then \ + sudo chown -R $(shell id -un ) $(WORKSPACE)/weaver/tests/network-setups/fabric/shared; \ + fi + cd $(WORKSPACE)/weaver/tests/network-setups/fabric/dev && make clean diff --git a/packages/cacti-plugin-copm-fabric/README.md b/packages/cacti-plugin-copm-fabric/README.md new file mode 100644 index 00000000000..273d646c3bf --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/README.md @@ -0,0 +1,55 @@ +# @hyperledger/cacti-plugin-copm-fabric + +This cactus plugin implements a connectRPC server for the fabric COPM implementation. + +Command documentation as OpenAPI: +https://jenniferlianne.github.io/cacti/references/openapi/cacti-copm-core_openapi/ + +These endpoints require the following: + +- weaver relays and drivers to be deployed on the network +- chaincode contracts for 'asset exchange' and 'asset transfer' to be deployed on the fabric network + +Please see https://hyperledger.github.io/cacti/weaver/introduction/. + + +# Usage + +## Installation + +Yarn: + + yarn add --exact @hyperledger/cacti-plugin-copm-fabric + + +## Configuration + +The following application-specific interfaces must be implemented: + +- FabricConfiguration + - getConnectionProfile(orgKey: string): object; + - getContractContext(orgKey: string): Promise; + - getOrgWallet(orgKey: string): Promise; + +- InteropConfiguration (from cacti-copm-common) + - getLocalRelayConfig(orgKey: string): LocalRelayConfig; + - getRemoteNetworkConfig(remoteOrgKey: string): RemoteNetworkConfig; + + These implementations are then supplied to the plugin constructor. + +## Development + +A Makefile is provided which will build a docker weaver network with the following commands: + +- make setup + - build all weaver components +- make pledge-network + - makes a network for running pledge/claim (asset transfer) +- make lock-network + - makes a network for running lock/claim (asset exchange) +- make clean-network + - tear down the current network + +The asset exchanges and asset transfer network modes are currently mutually exclusive. + + \ No newline at end of file diff --git a/packages/cacti-plugin-copm-fabric/package.json b/packages/cacti-plugin-copm-fabric/package.json new file mode 100644 index 00000000000..5bead3d0bdb --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/package.json @@ -0,0 +1,45 @@ +{ + "name": "@hyperledger/cacti-plugin-copm-fabric", + "version": "0.0.1", + "description": "Cacti Common Operators - Fabric", + "homepage": "https://github.com/hyperledger/cacti#readme", + "bugs": { + "url": "https://github.com/hyperledger/cacti/issues" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/hyperledger/cacti.git" + }, + "license": "Apache-2.0", + "author": "Jennifer Bell", + "scripts": { + "test": "yarn run --top-level test:jest:all ./src/test/typescript/*/*.test.ts", + "test:lock": "yarn run --top-level test:jest:all ./src/test/typescript/integration/test-copm-lock-claim.test.ts", + "test:pledge": "yarn run --top-level test:jest:all ./src/test/typescript/integration/test-copm-pledge-claim.test.ts", + "test:provestate": "yarn run --top-level test:jest:all ./src/test/typescript/integration/test-copm-provestate.test.ts" + }, + "dependencies": { + "@bufbuild/buf": "1.30.0", + "@bufbuild/protobuf": "1.10.0", + "@connectrpc/connect": "1.4.0", + "@hyperledger/cacti-copm-core": "workspace:^", + "@hyperledger/cacti-weaver-protos-js": "2.0.0-rc.4", + "@hyperledger/cacti-weaver-sdk-fabric": "2.0.0-rc.4", + "@hyperledger/cactus-common": "2.0.0-rc.4", + "@hyperledger/cactus-core": "2.0.0-rc.4", + "@hyperledger/cactus-core-api": "2.0.0-rc.4", + "fabric-ca-client": "2.2.20", + "fabric-common": "2.2.20", + "fabric-network": "2.2.20" + }, + "devDependencies": { + "@bufbuild/protoc-gen-es": "1.8.0", + "@connectrpc/connect-node": "1.4.0", + "@connectrpc/protoc-gen-connect-es": "1.4.0", + "@hyperledger/cactus-cmd-api-server": "2.0.0-rc.4", + "@hyperledger/cactus-plugin-keychain-memory": "2.0.0-rc.4", + "@hyperledger/cactus-plugin-ledger-connector-fabric": "workspace:^", + "@hyperledger/cactus-test-tooling": "2.0.0-rc.4", + "@openapitools/openapi-generator-cli": "2.13.4" + } +} diff --git a/packages/cacti-plugin-copm-fabric/src/main/typescript/endpoints.ts b/packages/cacti-plugin-copm-fabric/src/main/typescript/endpoints.ts new file mode 100644 index 00000000000..fec04bf4421 --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/src/main/typescript/endpoints.ts @@ -0,0 +1,5 @@ +export { claimLockedAssetV1Impl } from "./endpoints/claim-locked-asset-v1"; +export { claimPledgedAssetV1Impl } from "./endpoints/claim-pledged-asset-v1"; +export { pledgeAssetV1Impl } from "./endpoints/pledge-asset-impl-v1"; +export { lockAssetV1Impl } from "./endpoints/lock-asset-impl-v1"; +export { proveStateV1Impl } from "./endpoints/prove-state-impl-v1"; diff --git a/packages/cacti-plugin-copm-fabric/src/main/typescript/endpoints/claim-locked-asset-v1.ts b/packages/cacti-plugin-copm-fabric/src/main/typescript/endpoints/claim-locked-asset-v1.ts new file mode 100644 index 00000000000..3b3731b9ca2 --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/src/main/typescript/endpoints/claim-locked-asset-v1.ts @@ -0,0 +1,50 @@ +import { Logger } from "@hyperledger/cactus-common"; +import { AssetManager } from "@hyperledger/cacti-weaver-sdk-fabric"; +import { + DLTransactionParams, + Validators, + ClaimLockedAssetV1Request, + Interfaces as CopmIF, +} from "@hyperledger/cacti-copm-core"; + +export async function claimLockedAssetV1Impl( + req: ClaimLockedAssetV1Request, + log: Logger, + contextFactory: CopmIF.DLTransactionContextFactory, + contractName: string, +): Promise { + let transactionParams: DLTransactionParams; + const params = Validators.validateClaimLockedAssetRequest(req); + const claimInfoStr = AssetManager.createAssetClaimInfoSerialized( + params.hashInfo, + ); + + if (params.asset.isNFT()) { + const agreementStr = AssetManager.createAssetExchangeAgreementSerialized( + params.asset.assetType, + params.asset.idOrQuantity(), + params.destCertificate, + params.sourceCertificate, + ); + transactionParams = { + contract: contractName, + method: "ClaimAsset", + args: [agreementStr, claimInfoStr], + }; + } else { + // NOTE: can not currently claim NFTs with only a lock id + transactionParams = { + contract: contractName, + method: "ClaimFungibleAsset", + args: [params.lockId, claimInfoStr], + }; + } + + const transactionContext = await contextFactory.getTransactionContext( + params.destination, + ); + const claimId = await transactionContext.invoke(transactionParams); + + log.debug("claim complete"); + return claimId; +} diff --git a/packages/cacti-plugin-copm-fabric/src/main/typescript/endpoints/claim-pledged-asset-v1.ts b/packages/cacti-plugin-copm-fabric/src/main/typescript/endpoints/claim-pledged-asset-v1.ts new file mode 100644 index 00000000000..192736ef314 --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/src/main/typescript/endpoints/claim-pledged-asset-v1.ts @@ -0,0 +1,48 @@ +import { Logger } from "@hyperledger/cactus-common"; +import { + ClaimPledgedAssetV1Request, + Interfaces as CopmIF, + Validators, +} from "@hyperledger/cacti-copm-core"; + +export async function claimPledgedAssetV1Impl( + req: ClaimPledgedAssetV1Request, + log: Logger, + contextFactory: CopmIF.DLTransactionContextFactory, + contractName: string, +): Promise { + const data = Validators.validateClaimPledgedAssetRequest(req); + + const interop_context = await contextFactory.getRemoteTransactionContext( + data.destAccount, + data.sourceNetwork, + ); + + const claimId = await interop_context.invokeFlow( + { + contract: contractName, + method: "GetAssetPledgeStatus", + args: [ + data.pledgeId, + data.sourceCert, + data.destAccount.organization, + data.destCert, + ], + }, + { + contract: contractName, + method: data.asset.isNFT() ? "ClaimRemoteAsset" : "ClaimRemoteTokenAsset", + args: [ + data.pledgeId, + data.asset.assetType, + data.asset.idOrQuantity(), + data.sourceCert, + data.sourceNetwork, + "", + ], + }, + ); + + log.debug("claim pledged asset complete"); + return claimId; +} diff --git a/packages/cacti-plugin-copm-fabric/src/main/typescript/endpoints/lock-asset-impl-v1.ts b/packages/cacti-plugin-copm-fabric/src/main/typescript/endpoints/lock-asset-impl-v1.ts new file mode 100644 index 00000000000..d8b98fed54f --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/src/main/typescript/endpoints/lock-asset-impl-v1.ts @@ -0,0 +1,45 @@ +import { + LockAssetV1Request, + Validators, + Interfaces as CopmIF, +} from "@hyperledger/cacti-copm-core"; +import { Logger } from "@hyperledger/cactus-common"; +import { AssetManager } from "@hyperledger/cacti-weaver-sdk-fabric"; + +export async function lockAssetV1Impl( + req: LockAssetV1Request, + log: Logger, + contextFactory: CopmIF.DLTransactionContextFactory, + contractName: string, +): Promise { + const params = Validators.validateLockAssetRequest(req); + + const transactionContext = await contextFactory.getTransactionContext( + params.owner, + ); + + const serializeAgreementFunc = params.asset.isNFT() + ? AssetManager.createAssetExchangeAgreementSerialized + : AssetManager.createFungibleAssetExchangeAgreementSerialized; + + const agreementStr = serializeAgreementFunc( + params.asset.assetType, + params.asset.idOrQuantity(), + params.destinationCertificate, + params.sourceCertificate, + ); + + const lockInfoStr = AssetManager.createAssetLockInfoSerialized( + params.hashInfo, + Math.floor(Date.now() / 1000) + params.expirySecs, + ); + + const claimId = await transactionContext.invoke({ + contract: contractName, + method: params.asset.isNFT() ? "LockAsset" : "LockFungibleAsset", + args: [agreementStr, lockInfoStr], + }); + + log.debug("lock complete"); + return claimId; +} diff --git a/packages/cacti-plugin-copm-fabric/src/main/typescript/endpoints/pledge-asset-impl-v1.ts b/packages/cacti-plugin-copm-fabric/src/main/typescript/endpoints/pledge-asset-impl-v1.ts new file mode 100644 index 00000000000..30fee786e8c --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/src/main/typescript/endpoints/pledge-asset-impl-v1.ts @@ -0,0 +1,33 @@ +import { Logger } from "@hyperledger/cactus-common"; +import { + PledgeAssetV1Request, + Validators, + Interfaces as CopmIF, +} from "@hyperledger/cacti-copm-core"; + +export async function pledgeAssetV1Impl( + req: PledgeAssetV1Request, + log: Logger, + contextFactory: CopmIF.DLTransactionContextFactory, + contractName: string, +): Promise { + const data = Validators.validatePledgeAssetRequest(req); + + const transactionContext = await contextFactory.getTransactionContext( + data.source, + ); + + const pledgeId = await transactionContext.invoke({ + contract: contractName, + method: data.asset.isNFT() ? "PledgeAsset" : "PledgeTokenAsset", + args: [ + data.asset.assetType, + data.asset.idOrQuantity(), + data.destinationNetwork, + data.destinationCertificate, + (Math.floor(Date.now() / 1000) + data.expirySecs).toString(), + ], + }); + + return pledgeId; +} diff --git a/packages/cacti-plugin-copm-fabric/src/main/typescript/endpoints/prove-state-impl-v1.ts b/packages/cacti-plugin-copm-fabric/src/main/typescript/endpoints/prove-state-impl-v1.ts new file mode 100644 index 00000000000..3d4808813d1 --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/src/main/typescript/endpoints/prove-state-impl-v1.ts @@ -0,0 +1,27 @@ +import { + ProvestateV1Request, + Validators, + Interfaces as CopmIF, +} from "@hyperledger/cacti-copm-core"; +import { Logger } from "@hyperledger/cactus-common"; + +export async function proveStateV1Impl( + req: ProvestateV1Request, + contextFactory: CopmIF.DLTransactionContextFactory, + log: Logger, +): Promise { + const data = Validators.validateProveStateRequest(req); + const remoteContext = await contextFactory.getRemoteTransactionContext( + data.account, + data.remoteNetwork, + ); + + await remoteContext.invoke({ + contract: data.contractId, + method: data.method, + args: data.args, + }); + + log.debug("view complete"); + return true; +} diff --git a/packages/cacti-plugin-copm-fabric/src/main/typescript/index.ts b/packages/cacti-plugin-copm-fabric/src/main/typescript/index.ts new file mode 100755 index 00000000000..87cb558397c --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/src/main/typescript/index.ts @@ -0,0 +1 @@ +export * from "./public-api"; diff --git a/packages/cacti-plugin-copm-fabric/src/main/typescript/lib/fabric-configuration.ts b/packages/cacti-plugin-copm-fabric/src/main/typescript/lib/fabric-configuration.ts new file mode 100644 index 00000000000..716883a3539 --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/src/main/typescript/lib/fabric-configuration.ts @@ -0,0 +1,8 @@ +import { Wallet } from "fabric-network"; +import { FabricContractContext } from "./fabric-types"; + +export interface FabricConfiguration { + getConnectionProfile(orgKey: string): object; + getContractContext(orgKey: string): Promise; + getOrgWallet(orgKey: string): Promise; +} diff --git a/packages/cacti-plugin-copm-fabric/src/main/typescript/lib/fabric-context-factory.ts b/packages/cacti-plugin-copm-fabric/src/main/typescript/lib/fabric-context-factory.ts new file mode 100644 index 00000000000..6d5d1404b7d --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/src/main/typescript/lib/fabric-context-factory.ts @@ -0,0 +1,46 @@ +import { FabricRemoteTransactionContext } from "./fabric-remote-transaction-context"; +import { FabricConfiguration } from "./fabric-configuration"; +import { Interfaces as CopmIF, DLAccount } from "@hyperledger/cacti-copm-core"; +import { Logger } from "@hyperledger/cactus-common"; +import { FabricTransactionContext } from "./fabric-transaction-context"; + +export class FabricTransactionContextFactory + implements CopmIF.DLTransactionContextFactory +{ + private fabricConfiguration: FabricConfiguration; + private interopConfiguration: CopmIF.InteropConfiguration; + private log: Logger; + + constructor( + fabricConfiguration: FabricConfiguration, + interopConfiguration: CopmIF.InteropConfiguration, + log: Logger, + ) { + this.fabricConfiguration = fabricConfiguration; + this.interopConfiguration = interopConfiguration; + this.log = log; + } + + public async getTransactionContext( + account: DLAccount, + ): Promise { + const context = await this.fabricConfiguration.getContractContext( + account.organization, + ); + return new FabricTransactionContext(context, account, this.log); + } + + public async getRemoteTransactionContext( + account: DLAccount, + remoteNetwork: string, + ): Promise { + return new FabricRemoteTransactionContext( + await this.fabricConfiguration.getContractContext(account.organization), + this.interopConfiguration.getLocalRelayConfig(account.organization), + account, + this.interopConfiguration.getRemoteNetworkConfig(remoteNetwork), + this.interopConfiguration.interopContractName, + this.log, + ); + } +} diff --git a/packages/cacti-plugin-copm-fabric/src/main/typescript/lib/fabric-remote-transaction-context.ts b/packages/cacti-plugin-copm-fabric/src/main/typescript/lib/fabric-remote-transaction-context.ts new file mode 100644 index 00000000000..61c557d0aaf --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/src/main/typescript/lib/fabric-remote-transaction-context.ts @@ -0,0 +1,227 @@ +import { Logger } from "@hyperledger/cactus-common"; +import { + RemoteNetworkConfig, + LocalRelayConfig, + DLAccount, + DLTransactionParams, + ViewAddress, + Interfaces as CopmIF, +} from "@hyperledger/cacti-copm-core"; +import { FabricContractContext } from "./fabric-types"; +import { InteroperableHelper } from "@hyperledger/cacti-weaver-sdk-fabric"; +import { Gateway, Contract } from "fabric-network"; +import { ICryptoKey, Utils } from "fabric-common"; + +export class FabricRemoteTransactionContext + implements CopmIF.DLRemoteTransactionContext +{ + private localContext: FabricContractContext; + private localRelayConfig: LocalRelayConfig; + private account: DLAccount; + private interopContractName: string; + private remoteNetConfig: RemoteNetworkConfig; + private gateway: Gateway; + private log: Logger; + + constructor( + localContext: FabricContractContext, + localRelayConfig: LocalRelayConfig, + account: DLAccount, + remoteNetworkConfig: RemoteNetworkConfig, + + interopContractName: string, + log: Logger, + ) { + this.localContext = localContext; + this.localRelayConfig = localRelayConfig; + this.account = account; + this.remoteNetConfig = remoteNetworkConfig; + this.log = log; + this.interopContractName = interopContractName; + this.gateway = new Gateway(); + } + + public async invokeFlow( + remoteTransactionParams: DLTransactionParams, + localTransactionParams: DLTransactionParams, + ): Promise { + const contract = await this.connect(); + const keyCert = await this.getKeyAndCertForRemoteRequestByUserName( + this.localContext.wallet, + this.account.userId, + ); + const replaceIndices = localTransactionParams.args.findIndex( + (element) => element == "", + ); + let interopFlowResponse; + this.log.debug( + `calling flow on relay on network ${this.localContext.networkName} relay: ${this.localRelayConfig.endpoint}`, + ); + try { + interopFlowResponse = await InteroperableHelper.interopFlow( + contract, + this.localContext.networkName, + { + channel: this.localContext.channelName, + ccFunc: localTransactionParams.method, + ccArgs: localTransactionParams.args, + contractName: localTransactionParams.contract, + }, + this.localContext.mspId, + this.localRelayConfig.endpoint, + [replaceIndices], + [ + { + address: this.address(remoteTransactionParams), + Sign: true, + }, + ], + keyCert, + [], + false, + this.localRelayConfig.useTLS, + this.localRelayConfig.tlsCerts, + this.remoteNetConfig.e2eConfidentiality, + this.gateway, + ); + } catch (error) { + this.log.error(`Error calling interopFlow: ${error}`); + throw error; + } + this.log.info( + `View from remote network: ${JSON.stringify( + interopFlowResponse.views[0].toObject(), + )}. Interop Flow result: ${interopFlowResponse.result || "successful"}`, + ); + this.log.debug( + `ViewB64: ${Buffer.from(interopFlowResponse.views[0].serializeBinary()).toString("base64")}`, + ); + const remoteValue = this.remoteNetConfig.e2eConfidentiality + ? InteroperableHelper.getResponseDataFromView( + interopFlowResponse.views[0], + keyCert.cert.toBytes(), + ) + : InteroperableHelper.getResponseDataFromView( + interopFlowResponse.views[0], + ); + if (remoteValue.contents) { + this.log.debug( + `ViewB64Contents: ${Buffer.from(remoteValue.contents).toString("base64")}`, + ); + } + await this.disconnect(); + return remoteValue.data; + } + + public async invoke(transactionParams: DLTransactionParams): Promise { + const contract = await this.connect(); + const keyCert = await this.getKeyAndCertForRemoteRequestByUserName( + this.localContext.wallet, + this.account.userId, + ); + + this.log.debug( + `contacting local relay ${this.localRelayConfig.endpoint} on network ${this.account.organization} using cert for user ${this.account.userId}`, + ); + try { + const viewAddress = this.address(transactionParams); + this.log.debug(`parameters for get remote view:`); + this.log.debug( + `[0] contract [1] ${this.localContext.networkName}, [2] ${this.localContext.mspId} [3] ${this.localRelayConfig.endpoint}`, + ); + this.log.debug(`view address: ${viewAddress}`); + const viewResponse = await InteroperableHelper.getRemoteView( + contract, + this.localContext.networkName, + this.localContext.mspId, + this.localRelayConfig.endpoint, + { + address: viewAddress, + Sign: true, + }, + keyCert, + this.localRelayConfig.useTLS, + this.localRelayConfig.tlsCerts, + ); + this.log.debug("got remote view"); + + const view = viewResponse.view; + this.log.debug( + `ViewB64: ${Buffer.from(view.serializeBinary()).toString("base64")}`, + ); + const remoteValue = this.remoteNetConfig.e2eConfidentiality + ? InteroperableHelper.getResponseDataFromView( + view, + keyCert.cert.toBytes(), + ) + : InteroperableHelper.getResponseDataFromView(view); + if (remoteValue.contents) { + this.log.debug( + `ViewB64Contents: ${Buffer.from(remoteValue.contents).toString("base64")}`, + ); + } + + await this.disconnect(); + return remoteValue.data; + } catch (error) { + this.log.error(`Error verifying and storing state: ${error}`); + throw error; + } + } + + public address(transactionParams: DLTransactionParams) { + return new ViewAddress(this.remoteNetConfig, transactionParams).toString(); + } + + private disconnect() { + this.gateway.disconnect(); + this.gateway = new Gateway(); + } + + private async connect(): Promise { + const identity = await this.localContext.wallet.get(this.account.userId); + if (!identity) { + throw new Error( + `An identity for the user "${this.account.userId}" does not exist in the wallet for network "${this.account.organization}"`, + ); + } + + // Create a new gateway for connecting to our peer node. + await this.gateway.connect(this.localContext.connectionProfile, { + wallet: this.localContext.wallet, + identity: identity, + discovery: this.localContext.discoveryOptions, + }); + + const network = await this.gateway.getNetwork( + this.localContext.channelName, + ); + // Get the contract from the network. + return network.getContract(this.interopContractName); + } + + private async getKeyAndCertForRemoteRequestByUserName( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + wallet: any, + username: string, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ): Promise<{ key: ICryptoKey; cert: any }> { + if (!wallet) { + throw new Error("No wallet passed"); + } + if (!username) { + throw new Error("No username passed"); + } + const identity = await wallet.get(username); + if (!identity) { + throw new Error( + "Identity for username " + username + " not present in wallet", + ); + } + // Assume the identity is of type 'fabric-network.X509Identity' + const privKey = Utils.newCryptoSuite().createKeyFromRaw( + identity.credentials.privateKey, + ); + return { key: privKey, cert: identity.credentials.certificate }; + } +} diff --git a/packages/cacti-plugin-copm-fabric/src/main/typescript/lib/fabric-transaction-context.ts b/packages/cacti-plugin-copm-fabric/src/main/typescript/lib/fabric-transaction-context.ts new file mode 100644 index 00000000000..38453d06b2e --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/src/main/typescript/lib/fabric-transaction-context.ts @@ -0,0 +1,69 @@ +import { Gateway } from "fabric-network"; +import { Logger } from "@hyperledger/cactus-common"; +import { + DLTransactionParams, + Interfaces as CopmIF, + DLAccount, +} from "@hyperledger/cacti-copm-core"; +import { FabricContractContext } from "./fabric-types"; + +export class FabricTransactionContext implements CopmIF.DLTransactionContext { + private context: FabricContractContext; + private account: DLAccount; + private log: Logger; + + constructor( + context: FabricContractContext, + account: DLAccount, + logger: Logger, + ) { + this.context = context; + this.account = account; + this.log = logger; + } + + public async invoke(transactionParams: DLTransactionParams) { + // get the user identity + const identity = await this.context.wallet.get(this.account.userId); + if (!identity) { + throw new Error( + `An identity for the user "${this.account.userId}" does not exist in the wallet for network "${this.account.organization}"`, + ); + } + // Create a new gateway for connecting to our peer node. + const gateway = new Gateway(); + await gateway.connect(this.context.connectionProfile, { + wallet: this.context.wallet, + identity: identity, + discovery: this.context.discoveryOptions, + }); + + const network = await gateway.getNetwork(this.context.channelName); + // Get the contract from the network. + const contract = network.getContract(transactionParams.contract); + + const currentQuery = { + channel: this.context.channelName, + contractName: transactionParams.contract, + ccFunc: transactionParams.method, + args: transactionParams.args, + }; + + this.log.debug(currentQuery); + + const read = await contract.submitTransaction( + currentQuery.ccFunc, + ...currentQuery.args, + ); + const res = Buffer.from(read).toString(); + if (res) { + this.log.debug(`Response From Network: ${res}`); + } else { + this.log.debug("No Response from network"); + } + + // Disconnect from the gateway. + gateway.disconnect(); + return res; + } +} diff --git a/packages/cacti-plugin-copm-fabric/src/main/typescript/lib/fabric-types.ts b/packages/cacti-plugin-copm-fabric/src/main/typescript/lib/fabric-types.ts new file mode 100644 index 00000000000..5f90f0adc95 --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/src/main/typescript/lib/fabric-types.ts @@ -0,0 +1,18 @@ +import { DiscoveryOptions, Wallet } from "fabric-network"; +import { ICryptoKey } from "fabric-common"; + +export type FabricContractContext = { + channelName: string; + mspId: string; + networkName: string; + discoveryOptions: DiscoveryOptions; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + connectionProfile: any; + wallet: Wallet; +}; + +export type LocalUserKeyAndCert = { + key: ICryptoKey; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cert: any; +}; diff --git a/packages/cacti-plugin-copm-fabric/src/main/typescript/plugin-copm-fabric.ts b/packages/cacti-plugin-copm-fabric/src/main/typescript/plugin-copm-fabric.ts new file mode 100644 index 00000000000..6f9a355a9ba --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/src/main/typescript/plugin-copm-fabric.ts @@ -0,0 +1,83 @@ +import { + LogLevelDesc, + LoggerProvider, + Logger, +} from "@hyperledger/cactus-common"; +import { + ICactusPluginOptions, + ICrpcSvcRegistration, + IPluginCrpcService, +} from "@hyperledger/cactus-core-api"; +import { ServiceType } from "@bufbuild/protobuf"; +import { + DefaultService, + CopmContractNames, + Interfaces as CopmIF, +} from "@hyperledger/cacti-copm-core"; +import { CopmFabricImpl } from "./service-implementation"; +import { FabricTransactionContextFactory } from "./lib/fabric-context-factory"; +import { FabricConfiguration } from "./lib/fabric-configuration"; + +export interface IPluginCopmFabricOptions extends ICactusPluginOptions { + logLevel?: LogLevelDesc; + fabricConfig: FabricConfiguration; + interopConfig: CopmIF.InteropConfiguration; + contractNames: CopmContractNames; +} + +export class PluginCopmFabric implements IPluginCrpcService { + public static readonly CLASS_NAME = "PluginCopmFabric"; + private readonly instanceId: string; + private readonly logLevel: LogLevelDesc; + private contextFactory: FabricTransactionContextFactory; + private copmContractNames: CopmContractNames; + private readonly log: Logger; + + constructor(public readonly opts: IPluginCopmFabricOptions) { + this.logLevel = opts.logLevel || "INFO"; + this.log = LoggerProvider.getOrCreate({ + level: this.logLevel, + label: "CopmFabricImpl", + }); + + this.contextFactory = new FabricTransactionContextFactory( + opts.fabricConfig, + opts.interopConfig, + this.log, + ); + this.copmContractNames = opts.contractNames; + this.instanceId = this.opts.instanceId; + } + + public async createCrpcSvcRegistrations(): Promise< + ICrpcSvcRegistration[] + > { + const out: ICrpcSvcRegistration[] = []; + + const implementation = new CopmFabricImpl( + this.log, + this.contextFactory, + this.copmContractNames, + ); + + const crpcSvcRegistration: ICrpcSvcRegistration = { + definition: DefaultService, + serviceName: DefaultService.typeName, + implementation, + }; + out.push(crpcSvcRegistration); + return out; + } + + public getInstanceId(): string { + return this.instanceId; + } + + public getPackageName(): string { + return `@hyperledger/cacti-plugin-copm-fabric`; + } + + public async onPluginInit(): Promise { + return; + } +} diff --git a/packages/cacti-plugin-copm-fabric/src/main/typescript/plugin-factory-copm-fabric.ts b/packages/cacti-plugin-copm-fabric/src/main/typescript/plugin-factory-copm-fabric.ts new file mode 100644 index 00000000000..4673f731731 --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/src/main/typescript/plugin-factory-copm-fabric.ts @@ -0,0 +1,19 @@ +import { IPluginFactoryOptions } from "@hyperledger/cactus-core-api"; +import { PluginFactory } from "@hyperledger/cactus-core-api"; + +import { + IPluginCopmFabricOptions, + PluginCopmFabric, +} from "./plugin-copm-fabric"; + +export class PluginFactoryCopmFabric extends PluginFactory< + PluginCopmFabric, + IPluginCopmFabricOptions, + IPluginFactoryOptions +> { + async create( + pluginOptions: IPluginCopmFabricOptions, + ): Promise { + return new PluginCopmFabric(pluginOptions); + } +} diff --git a/packages/cacti-plugin-copm-fabric/src/main/typescript/public-api.ts b/packages/cacti-plugin-copm-fabric/src/main/typescript/public-api.ts new file mode 100755 index 00000000000..ea1e43660b9 --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/src/main/typescript/public-api.ts @@ -0,0 +1,10 @@ +import { IPluginFactoryOptions } from "@hyperledger/cactus-core-api"; +import { PluginFactoryCopmFabric } from "./plugin-factory-copm-fabric"; + +export async function createPluginFactory( + pluginFactoryOptions: IPluginFactoryOptions, +): Promise { + return new PluginFactoryCopmFabric(pluginFactoryOptions); +} + +export { FabricConfiguration } from "./lib/fabric-configuration"; diff --git a/packages/cacti-plugin-copm-fabric/src/main/typescript/service-implementation.ts b/packages/cacti-plugin-copm-fabric/src/main/typescript/service-implementation.ts new file mode 100644 index 00000000000..394d162a282 --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/src/main/typescript/service-implementation.ts @@ -0,0 +1,123 @@ +import { Logger } from "@hyperledger/cactus-common"; +import { ServiceImpl } from "@connectrpc/connect"; +import type { ServiceType } from "@bufbuild/protobuf"; +import { + DefaultService, + PledgeAssetV1Request, + PledgeAssetV1200ResponsePB, + ClaimPledgedAssetV1Request, + LockAssetV1Request, + ProvestateV1Request, + LockAssetV1200ResponsePB, + ClaimLockedAssetV1Request, + ClaimPledgedAssetV1200ResponsePB, + Interfaces as CopmIF, + CopmContractNames, +} from "@hyperledger/cacti-copm-core"; +import * as Endpoints from "./endpoints"; + +type DefaultServiceMethodDefinitions = typeof DefaultService.methods; +type DefaultServiceMethodNames = keyof DefaultServiceMethodDefinitions; + +type ICopmFabricApi = { + [key in DefaultServiceMethodNames]: (...args: never[]) => unknown; +}; + +export class CopmFabricImpl + implements ICopmFabricApi, Partial> +{ + // We cannot avoid this due to how the types of the upstream library are + // structured/designed hence we just disable the linter on this particular line. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [k: string]: any; + + private readonly log: Logger; + private readonly contextFactory: CopmIF.DLTransactionContextFactory; + private readonly contractNames: CopmContractNames; + + constructor( + log: Logger, + contextFactory: CopmIF.DLTransactionContextFactory, + copmContractNames: CopmContractNames, + ) { + this.log = log; + this.contextFactory = contextFactory; + this.contractNames = copmContractNames; + } + + public async pledgeAssetV1( + req: PledgeAssetV1Request, + ): Promise { + try { + this.log.debug("pledgeAssetV1 ENTRY req=%o", req); + const pledgeId = await Endpoints.pledgeAssetV1Impl( + req, + this.log, + this.contextFactory, + this.contractNames.pledgeContract, + ); + const res = new PledgeAssetV1200ResponsePB({ pledgeId: pledgeId }); + return res; + } catch (ex) { + this.log.error(ex.message); + throw ex; + } + } + + public async claimLockedAssetV1( + req: ClaimLockedAssetV1Request, + ): Promise { + try { + this.log.debug("claimAssetV1 ENTRY req=%o", req); + const claimId = await Endpoints.claimLockedAssetV1Impl( + req, + this.log, + this.contextFactory, + this.contractNames.lockContract, + ); + const res = new ClaimPledgedAssetV1200ResponsePB({ claimId: claimId }); + return res; + } catch (ex) { + this.log.error(ex.message); + throw ex; + } + } + + public async claimPledgedAssetV1( + req: ClaimPledgedAssetV1Request, + ): Promise { + this.log.debug("claimAssetV1 ENTRY req=%o", req); + const claimId = await Endpoints.claimPledgedAssetV1Impl( + req, + this.log, + this.contextFactory, + this.contractNames.pledgeContract, + ); + const res = new ClaimPledgedAssetV1200ResponsePB({ claimId: claimId }); + return res; + } + + public async lockAssetV1( + req: LockAssetV1Request, + ): Promise { + this.log.debug("lockAssetV1 ENTRY req=%o", req); + try { + const lockId = await Endpoints.lockAssetV1Impl( + req, + this.log, + this.contextFactory, + this.contractNames.lockContract, + ); + const res = new LockAssetV1200ResponsePB({ lockId: lockId }); + return res; + } catch (error) { + this.log.error(error); + throw error; + } + } + + public async provestateV1(req: ProvestateV1Request): Promise { + this.log.debug("provestateV1 ENTRY req=%o", req); + await Endpoints.proveStateV1Impl(req, this.contextFactory, this.log); + } +} diff --git a/packages/cacti-plugin-copm-fabric/src/test/typescript/integration/test-copm-lock-claim.test.ts b/packages/cacti-plugin-copm-fabric/src/test/typescript/integration/test-copm-lock-claim.test.ts new file mode 100644 index 00000000000..a21f42fd940 --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/src/test/typescript/integration/test-copm-lock-claim.test.ts @@ -0,0 +1,249 @@ +import { AddressInfo } from "node:net"; +import http from "node:http"; + +import "jest-extended"; +import { v4 as uuidV4 } from "uuid"; +import { createPromiseClient, PromiseClient } from "@connectrpc/connect"; +import { createConnectTransport } from "@connectrpc/connect-node"; +import { PluginRegistry } from "@hyperledger/cactus-core"; +import { + LogLevelDesc, + Logger, + LoggerProvider, + Servers, +} from "@hyperledger/cactus-common"; +import { + AuthorizationProtocol, + ConfigService, + ApiServer, +} from "@hyperledger/cactus-cmd-api-server"; +import { PluginCopmFabric } from "../../../main/typescript/plugin-copm-fabric"; +import { + DefaultService, + ClaimLockedAssetV1Request, + LockAssetV1Request, +} from "@hyperledger/cacti-copm-core"; +import { CopmWeaverFabricTestnet } from "../lib/copm-weaver-fabric-testnet"; +import { TestAssetManager } from "../lib/test-asset-manager"; +import * as path from "path"; +import * as dotenv from "dotenv"; +dotenv.config({ path: path.resolve(__dirname, "../../.env") }); + +const logLevel: LogLevelDesc = "DEBUG"; +const log: Logger = LoggerProvider.getOrCreate({ + label: "plugin-copm-crpc-server-test", + level: logLevel, +}); + +describe("PluginCopmFabric", () => { + let fabricTestnet: CopmWeaverFabricTestnet; + let httpServer: http.Server; + let apiServer: ApiServer; + let assetManager: TestAssetManager; + let client: PromiseClient; + let user1: string, net1: string, user2: string, net2: string; + + const hashSecret: string = "my_secret_123"; + const lockAssetName: string = "lockasset" + new Date().getTime().toString(); + + beforeAll(async () => { + httpServer = await Servers.startOnPreferredPort(4050); + const addressInfoHttp = httpServer.address() as AddressInfo; + const apiHttpHost = `http://${addressInfoHttp.address}:${addressInfoHttp.port}`; + log.debug("HTTP API host: %s", apiHttpHost); + + const pluginRegistry = new PluginRegistry({ plugins: [] }); + + const cfgSrv = new ConfigService(); + const apiSrvOpts = await cfgSrv.newExampleConfig(); + apiSrvOpts.authorizationProtocol = AuthorizationProtocol.NONE; + apiSrvOpts.logLevel = logLevel; + apiSrvOpts.configFile = ""; + apiSrvOpts.apiCorsDomainCsv = "*"; + apiSrvOpts.apiPort = addressInfoHttp.port; + apiSrvOpts.cockpitPort = 0; + apiSrvOpts.grpcPort = 0; + apiSrvOpts.grpcMtlsEnabled = false; + apiSrvOpts.apiTlsEnabled = false; + apiSrvOpts.crpcPort = 0; + const cfg = await cfgSrv.newExampleConfigConvict(apiSrvOpts); + + fabricTestnet = new CopmWeaverFabricTestnet(log, "simpleasset"); + + const compFabricPlugin = new PluginCopmFabric({ + instanceId: uuidV4(), + logLevel, + fabricConfig: fabricTestnet.fabricConfig, + interopConfig: fabricTestnet.interopConfig, + contractNames: fabricTestnet.contractNames, + }); + + pluginRegistry.add(compFabricPlugin); + + apiServer = new ApiServer({ + httpServerApi: httpServer, + config: cfg.getProperties(), + pluginRegistry, + }); + + log.info("staring api server"); + const { addressInfoGrpc, addressInfoCrpc } = await apiServer.start(); + const grpcPort = addressInfoGrpc.port; + const grpcHost = addressInfoGrpc.address; + const grpcFamily = addressInfoHttp.family; + log.info("gRPC family=%s host=%s port=%s", grpcFamily, grpcHost, grpcPort); + log.info("CRPC AddressInfo=%o", addressInfoCrpc); + + expect(apiServer).toBeTruthy(); + + [net1, net2] = fabricTestnet.networkNames(); + [user1, user2] = fabricTestnet.userNames(); + assetManager = fabricTestnet.assetManager(); + + const transport = createConnectTransport({ + baseUrl: apiHttpHost, + httpVersion: "1.1", + }); + + client = createPromiseClient(DefaultService, transport); + }); + + afterAll(async () => { + if (apiServer) { + await apiServer.shutdown(); + } + }); + + test("fabric-fabric can lock/claim nft on same network by asset agreement", async () => { + const assetType = "bond"; + + const sourceCert = await fabricTestnet.getCertificateString({ + organization: net1, + userId: user1, + }); + const destCert = await fabricTestnet.getCertificateString({ + organization: net1, + userId: user2, + }); + + await assetManager.addNonFungibleAsset(assetType, lockAssetName, { + organization: net1, + userId: user1, + }); + + const lockResult = await client.lockAssetV1( + new LockAssetV1Request({ + assetLockV1PB: { + asset: { + assetType: assetType, + assetId: lockAssetName, + }, + owner: { + network: net1, + userId: user1, + }, + hashInfo: { + secret: hashSecret, + }, + expirySecs: BigInt(45), + sourceCertificate: sourceCert, + destinationCertificate: destCert, + }, + }), + ); + + expect(lockResult).toBeTruthy(); + + const claimResult = await client.claimLockedAssetV1( + new ClaimLockedAssetV1Request({ + assetLockClaimV1PB: { + asset: { + assetType: assetType, + assetId: lockAssetName, + }, + source: { + network: net1, + userId: user1, + }, + destination: { + network: net1, + userId: user2, + }, + sourceCertificate: sourceCert, + destCertificate: destCert, + hashInfo: { + secret: hashSecret, + }, + }, + }), + ); + expect(claimResult).toBeTruthy(); + }); + + test("fabric-fabric can lock/claim tokens on same network", async () => { + const assetType = "token1"; + const assetQuantity = 10; + + await assetManager.addToken(assetType, assetQuantity, { + organization: net2, + userId: user2, + }); + + const srcCert = await fabricTestnet.getCertificateString({ + organization: net2, + userId: user2, + }); + const destCert = await fabricTestnet.getCertificateString({ + organization: net2, + userId: user1, + }); + + const lockResult = await client.lockAssetV1( + new LockAssetV1Request({ + assetLockV1PB: { + asset: { + assetType: assetType, + assetQuantity: assetQuantity, + }, + owner: { network: net2, userId: user2 }, + hashInfo: { + secret: hashSecret, + }, + expirySecs: BigInt(45), + sourceCertificate: srcCert, + destinationCertificate: destCert, + }, + }), + ); + + expect(lockResult).toBeTruthy(); + expect(lockResult.lockId).toBeString(); + log.debug(lockResult.lockId); + + const claimResult = await client.claimLockedAssetV1( + new ClaimLockedAssetV1Request({ + assetLockClaimV1PB: { + lockId: lockResult.lockId, + asset: { + assetType: assetType, + assetQuantity: assetQuantity, + }, + source: { + network: net2, + userId: user2, + }, + destination: { + network: net2, + userId: user1, + }, + sourceCertificate: srcCert, + destCertificate: destCert, + hashInfo: { + secret: hashSecret, + }, + }, + }), + ); + expect(claimResult).toBeTruthy(); + }); +}); diff --git a/packages/cacti-plugin-copm-fabric/src/test/typescript/integration/test-copm-pledge-claim.test.ts b/packages/cacti-plugin-copm-fabric/src/test/typescript/integration/test-copm-pledge-claim.test.ts new file mode 100644 index 00000000000..a00c2a381af --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/src/test/typescript/integration/test-copm-pledge-claim.test.ts @@ -0,0 +1,255 @@ +import { AddressInfo } from "node:net"; +import http from "node:http"; + +import "jest-extended"; +import { v4 as uuidV4 } from "uuid"; +import { createPromiseClient, PromiseClient } from "@connectrpc/connect"; +import { createConnectTransport } from "@connectrpc/connect-node"; +import { PluginRegistry } from "@hyperledger/cactus-core"; +import { + LogLevelDesc, + Logger, + LoggerProvider, + Servers, +} from "@hyperledger/cactus-common"; +import { ApiServer } from "@hyperledger/cactus-cmd-api-server"; +import { AuthorizationProtocol } from "@hyperledger/cactus-cmd-api-server"; +import { ConfigService } from "@hyperledger/cactus-cmd-api-server"; +import { + DefaultService, + ClaimPledgedAssetV1Request, + PledgeAssetV1Request, + AssetAccountV1PB, + DLAccount, +} from "@hyperledger/cacti-copm-core"; +import { PluginCopmFabric } from "../../../main/typescript/plugin-copm-fabric"; +import { CopmWeaverFabricTestnet } from "../lib/copm-weaver-fabric-testnet"; +import { TestAssetManager } from "../lib/test-asset-manager"; +import * as path from "path"; +import * as dotenv from "dotenv"; +dotenv.config({ path: path.resolve(__dirname, "../../.env") }); + +const logLevel: LogLevelDesc = "DEBUG"; +const log: Logger = LoggerProvider.getOrCreate({ + label: "plugin-copm-crpc-server-test", + level: logLevel, +}); + +describe("PluginCopmFabric", () => { + let fabricTestnet: CopmWeaverFabricTestnet; + let httpServer: http.Server; + let apiServer: ApiServer; + let sourceAccount: DLAccount, destAccount: DLAccount; + let sourceCert: string, destCert: string; + let sourceAccountPB: AssetAccountV1PB, destAccountPB: AssetAccountV1PB; + let assetManager: TestAssetManager; + let client: PromiseClient; + + const contractName: string = "simpleassettransfer"; + const pledgeAssetName: string = + "pledgeasset" + new Date().getTime().toString(); + + beforeAll(async () => { + httpServer = await Servers.startOnPreferredPort(4050); + const addressInfoHttp = httpServer.address() as AddressInfo; + const apiHttpHost = `http://${addressInfoHttp.address}:${addressInfoHttp.port}`; + log.debug("HTTP API host: %s", apiHttpHost); + + const pluginRegistry = new PluginRegistry({ plugins: [] }); + + const cfgSrv = new ConfigService(); + const apiSrvOpts = await cfgSrv.newExampleConfig(); + apiSrvOpts.authorizationProtocol = AuthorizationProtocol.NONE; + apiSrvOpts.logLevel = logLevel; + apiSrvOpts.configFile = ""; + apiSrvOpts.apiCorsDomainCsv = "*"; + apiSrvOpts.apiPort = addressInfoHttp.port; + apiSrvOpts.cockpitPort = 0; + apiSrvOpts.grpcPort = 0; + apiSrvOpts.grpcMtlsEnabled = false; + apiSrvOpts.apiTlsEnabled = false; + apiSrvOpts.crpcPort = 0; + const cfg = await cfgSrv.newExampleConfigConvict(apiSrvOpts); + + log.info("setting up fabric test network"); + + fabricTestnet = new CopmWeaverFabricTestnet(log, contractName); + + const compFabricPlugin = new PluginCopmFabric({ + instanceId: uuidV4(), + logLevel, + fabricConfig: fabricTestnet.fabricConfig, + interopConfig: fabricTestnet.interopConfig, + contractNames: fabricTestnet.contractNames, + }); + + pluginRegistry.add(compFabricPlugin); + + apiServer = new ApiServer({ + httpServerApi: httpServer, + config: cfg.getProperties(), + pluginRegistry, + }); + + log.info("staring api server"); + const { addressInfoGrpc, addressInfoCrpc } = await apiServer.start(); + const grpcPort = addressInfoGrpc.port; + const grpcHost = addressInfoGrpc.address; + const grpcFamily = addressInfoHttp.family; + log.info("gRPC family=%s host=%s port=%s", grpcFamily, grpcHost, grpcPort); + log.info("CRPC AddressInfo=%o", addressInfoCrpc); + + expect(apiServer).toBeTruthy(); + + const [net1, net2] = fabricTestnet.networkNames(); + const [user1, user2] = fabricTestnet.userNames(); + assetManager = fabricTestnet.assetManager(); + sourceAccount = { organization: net1, userId: user1 }; + destAccount = { organization: net2, userId: user2 }; + sourceAccountPB = AssetAccountV1PB.fromJson({ + network: net1, + userId: user1, + }); + destAccountPB = AssetAccountV1PB.fromJson({ network: net2, userId: user2 }); + sourceCert = await fabricTestnet.getCertificateString(sourceAccount); + destCert = await fabricTestnet.getCertificateString(destAccount); + + const transport = createConnectTransport({ + baseUrl: apiHttpHost, + httpVersion: "1.1", + }); + client = createPromiseClient(DefaultService, transport); + + log.info("test setup complete"); + }); + + afterAll(async () => { + if (apiServer) { + await apiServer.shutdown(); + } + }); + + test("fabric-fabric asset nft pledge and claim by asset id", async () => { + const assetType = "bond01"; + + await assetManager.addNonFungibleAsset( + assetType, + pledgeAssetName, + sourceAccount, + ); + + const pledgeNFTResult = await client.pledgeAssetV1( + new PledgeAssetV1Request({ + assetPledgeV1PB: { + asset: { + assetType: assetType, + assetId: pledgeAssetName, + }, + source: sourceAccountPB, + destination: destAccountPB, + expirySecs: BigInt(45), + destinationCertificate: destCert, + }, + }), + ); + + expect(pledgeNFTResult).toBeTruthy(); + expect(pledgeNFTResult.pledgeId).toBeString(); + + const claimNFTResult = await client.claimPledgedAssetV1( + new ClaimPledgedAssetV1Request({ + assetPledgeClaimV1PB: { + pledgeId: pledgeNFTResult.pledgeId, + asset: { + assetType: assetType, + assetId: pledgeAssetName, + }, + source: sourceAccountPB, + destination: destAccountPB, + sourceCertificate: sourceCert, + destCertificate: destCert, + }, + }), + ); + expect(claimNFTResult).toBeTruthy(); + + // Check that the asset changed networks. + expect( + await assetManager.userOwnsNonFungibleAsset( + assetType, + pledgeAssetName, + sourceAccount, + ), + ).toBeFalse(); + + expect( + await assetManager.userOwnsNonFungibleAsset( + assetType, + pledgeAssetName, + destAccount, + ), + ).toBeTrue(); + }); + + test("fabric-fabric asset token pledge and claim", async () => { + const assetType = "token1"; + const exchangeQuantity = 10; + + // ensure initial account balance - user will not have a wallet if 0 tokens + await assetManager.addToken(assetType, 1 + exchangeQuantity, sourceAccount); + await assetManager.addToken(assetType, 1, destAccount); + + const user1StartBalance = await assetManager.tokenBalance( + assetType, + sourceAccount, + ); + const user2StartBalance = await assetManager.tokenBalance( + assetType, + destAccount, + ); + + const pledgeResult = await client.pledgeAssetV1( + new PledgeAssetV1Request({ + assetPledgeV1PB: { + asset: { + assetType: assetType, + assetQuantity: exchangeQuantity, + }, + source: sourceAccountPB, + destination: destAccountPB, + expirySecs: BigInt(45), + destinationCertificate: destCert, + }, + }), + ); + + expect(pledgeResult).toBeTruthy(); + expect(pledgeResult.pledgeId).toBeString(); + + const claimResult = await client.claimPledgedAssetV1( + new ClaimPledgedAssetV1Request({ + assetPledgeClaimV1PB: { + pledgeId: pledgeResult.pledgeId, + asset: { + assetType: assetType, + assetQuantity: exchangeQuantity, + }, + source: sourceAccountPB, + destination: destAccountPB, + sourceCertificate: sourceCert, + destCertificate: destCert, + }, + }), + ); + expect(claimResult).toBeTruthy(); + + // Check that the tokens changed networks. + expect(await assetManager.tokenBalance(assetType, sourceAccount)).toEqual( + user1StartBalance - exchangeQuantity, + ); + + expect(await assetManager.tokenBalance(assetType, destAccount)).toEqual( + user2StartBalance + exchangeQuantity, + ); + }); +}); diff --git a/packages/cacti-plugin-copm-fabric/src/test/typescript/integration/test-copm-provestate.test.ts b/packages/cacti-plugin-copm-fabric/src/test/typescript/integration/test-copm-provestate.test.ts new file mode 100644 index 00000000000..83b1172e62c --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/src/test/typescript/integration/test-copm-provestate.test.ts @@ -0,0 +1,181 @@ +import { AddressInfo } from "node:net"; +import http from "node:http"; + +import "jest-extended"; +import { v4 as uuidV4 } from "uuid"; +import { createPromiseClient, PromiseClient } from "@connectrpc/connect"; +import { createConnectTransport } from "@connectrpc/connect-node"; +import { PluginRegistry } from "@hyperledger/cactus-core"; +import { + LogLevelDesc, + Logger, + LoggerProvider, + Servers, +} from "@hyperledger/cactus-common"; +import { + AuthorizationProtocol, + ConfigService, + ApiServer, +} from "@hyperledger/cactus-cmd-api-server"; +import { PluginCopmFabric } from "../../../main/typescript/plugin-copm-fabric"; +import { + PledgeAssetV1Request, + ProvestateV1Request, + DefaultService, +} from "@hyperledger/cacti-copm-core"; +import { CopmWeaverFabricTestnet } from "../lib/copm-weaver-fabric-testnet"; +import * as path from "path"; +import * as dotenv from "dotenv"; +import { TestAssetManager } from "../lib/test-asset-manager"; +dotenv.config({ path: path.resolve(__dirname, "../../.env") }); + +const logLevel: LogLevelDesc = "DEBUG"; +const log: Logger = LoggerProvider.getOrCreate({ + label: "plugin-copm-crpc-server-test", + level: logLevel, +}); + +describe("PluginCopmFabric", () => { + let fabricTestnet: CopmWeaverFabricTestnet; + let httpServer: http.Server; + let apiServer: ApiServer; + let assetManager: TestAssetManager; + let net1: string, net2: string, user1: string, user2: string; + let source_cert: string, dest_cert: string; + let client: PromiseClient; + const contractName: string = "simpleassettransfer"; + const proveAssetName: string = "proveasset" + new Date().getTime().toString(); + + beforeAll(async () => { + httpServer = await Servers.startOnPreferredPort(4050); + const addressInfoHttp = httpServer.address() as AddressInfo; + const apiHttpHost = `http://${addressInfoHttp.address}:${addressInfoHttp.port}`; + log.debug("HTTP API host: %s", apiHttpHost); + + const pluginRegistry = new PluginRegistry({ plugins: [] }); + + const cfgSrv = new ConfigService(); + const apiSrvOpts = await cfgSrv.newExampleConfig(); + apiSrvOpts.authorizationProtocol = AuthorizationProtocol.NONE; + apiSrvOpts.logLevel = logLevel; + apiSrvOpts.configFile = ""; + apiSrvOpts.apiCorsDomainCsv = "*"; + apiSrvOpts.apiPort = addressInfoHttp.port; + apiSrvOpts.cockpitPort = 0; + apiSrvOpts.grpcPort = 0; + apiSrvOpts.grpcMtlsEnabled = false; + apiSrvOpts.apiTlsEnabled = false; + apiSrvOpts.crpcPort = 0; + const cfg = await cfgSrv.newExampleConfigConvict(apiSrvOpts); + + log.info("setting up fabric test network"); + + fabricTestnet = new CopmWeaverFabricTestnet(log, contractName); + + const compFabricPlugin = new PluginCopmFabric({ + instanceId: uuidV4(), + logLevel, + fabricConfig: fabricTestnet.fabricConfig, + interopConfig: fabricTestnet.interopConfig, + contractNames: fabricTestnet.contractNames, + }); + + pluginRegistry.add(compFabricPlugin); + + apiServer = new ApiServer({ + httpServerApi: httpServer, + config: cfg.getProperties(), + pluginRegistry, + }); + + log.info("staring api server"); + const { addressInfoGrpc, addressInfoCrpc } = await apiServer.start(); + const grpcPort = addressInfoGrpc.port; + const grpcHost = addressInfoGrpc.address; + const grpcFamily = addressInfoHttp.family; + log.info("gRPC family=%s host=%s port=%s", grpcFamily, grpcHost, grpcPort); + log.info("CRPC AddressInfo=%o", addressInfoCrpc); + + expect(apiServer).toBeTruthy(); + + const transport = createConnectTransport({ + baseUrl: apiHttpHost, + httpVersion: "1.1", + }); + client = createPromiseClient(DefaultService, transport); + + [net1, net2] = fabricTestnet.networkNames(); + [user1, user2] = fabricTestnet.userNames(); + assetManager = fabricTestnet.assetManager(); + + source_cert = await fabricTestnet.getCertificateString({ + organization: net1, + userId: user1, + }); + + dest_cert = await fabricTestnet.getCertificateString({ + organization: net2, + userId: user2, + }); + + log.info("test setup complete"); + }); + + afterAll(async () => { + if (apiServer) { + await apiServer.shutdown(); + } + }); + + test("fabric-fabric prove state", async () => { + await assetManager.addNonFungibleAsset("bond", proveAssetName, { + organization: net1, + userId: user1, + }); + + const pledgeResult = await client.pledgeAssetV1( + new PledgeAssetV1Request({ + assetPledgeV1PB: { + asset: { + assetType: "bond", + assetId: proveAssetName, + }, + source: { + network: net1, + userId: user1, + }, + destination: { + network: net2, + userId: user2, + }, + expirySecs: BigInt(45), + destinationCertificate: dest_cert, + }, + }), + ); + + expect(pledgeResult).toBeTruthy(); + expect(pledgeResult.pledgeId).toBeString(); + + const res = await client.provestateV1( + new ProvestateV1Request({ + stateProofV1PB: { + account: { + network: net2, + userId: user2, + }, + view: { + network: net1, + viewAddress: { + contractId: contractName, + function: "GetAssetPledgeStatus", + input: [pledgeResult.pledgeId, source_cert, net2, dest_cert], + }, + }, + }, + }), + ); + + expect(res).toBeTruthy(); + }); +}); diff --git a/packages/cacti-plugin-copm-fabric/src/test/typescript/lib/copm-weaver-fabric-testnet.ts b/packages/cacti-plugin-copm-fabric/src/test/typescript/lib/copm-weaver-fabric-testnet.ts new file mode 100644 index 00000000000..fa8214ed743 --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/src/test/typescript/lib/copm-weaver-fabric-testnet.ts @@ -0,0 +1,75 @@ +import { Identity } from "fabric-network"; +import { DLAccount, CopmContractNames } from "@hyperledger/cacti-copm-core"; +import { LogLevelDesc, Logger } from "@hyperledger/cactus-common"; +import { TestAssetManager } from "./test-asset-manager"; +import { TestFabricConfiguration } from "./test-fabric-configuration"; +import { FabricTransactionContextFactory } from "../../../main/typescript/lib/fabric-context-factory"; +import { TestInteropConfiguration } from "./test-interop-configuration"; + +type FabricIdentity = Identity & { + credentials: { + certificate: string; + privateKey: string; + }; +}; + +export class CopmWeaverFabricTestnet { + logLevel: LogLevelDesc = "INFO"; + log: Logger; + fabricConfig: TestFabricConfiguration; + interopConfig: TestInteropConfiguration; + contractNames: CopmContractNames; + + private assetContractName: string; + private networkAdminName: string; + + constructor(log: Logger, assetContractName: string) { + this.log = log; + this.assetContractName = assetContractName; + this.networkAdminName = "networkadmin"; + this.fabricConfig = new TestFabricConfiguration(log); + this.interopConfig = new TestInteropConfiguration("interop", this.log); + this.contractNames = { + pledgeContract: "simpleassettransfer", + lockContract: "simpleasset", + }; + } + + public networkNames(): string[] { + return ["network1", "network2"]; + } + + public userNames(): string[] { + return ["alice", "bob"]; + } + + public async getCertificateString(account: DLAccount): Promise { + const wallet = await this.fabricConfig.getOrgWallet(account.organization); + const identity = (await wallet.get(account.userId)) as FabricIdentity; + if (!identity?.credentials?.certificate) { + throw new Error(`no credentials for user ${account.userId}`); + } + const userCert = Buffer.from(identity.credentials.certificate).toString( + "base64", + ); + return userCert; + } + + public assetManager() { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const testnet = this; + return new TestAssetManager( + this.assetContractName, + this.networkAdminName, + new FabricTransactionContextFactory( + this.fabricConfig, + this.interopConfig, + this.log, + ), + async function (account: DLAccount): Promise { + return await testnet.getCertificateString(account); + }, + this.log, + ); + } +} diff --git a/packages/cacti-plugin-copm-fabric/src/test/typescript/lib/test-asset-manager.ts b/packages/cacti-plugin-copm-fabric/src/test/typescript/lib/test-asset-manager.ts new file mode 100644 index 00000000000..25c347d2717 --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/src/test/typescript/lib/test-asset-manager.ts @@ -0,0 +1,119 @@ +import { Interfaces as CopmIF, DLAccount } from "@hyperledger/cacti-copm-core"; +import { Logger } from "@hyperledger/cactus-common"; + +export interface CertificateFactoryFunc { + (account: DLAccount): Promise; +} + +export class TestAssetManager { + contractName: string; + networkAdminName: string; + log: Logger; + contextFactory: CopmIF.DLTransactionContextFactory; + certificateFactory: CertificateFactoryFunc; + + constructor( + contractName: string, + networkAdminName: string, + contextFactory: CopmIF.DLTransactionContextFactory, + certificateFactory: CertificateFactoryFunc, + log: Logger, + ) { + this.contextFactory = contextFactory; + this.certificateFactory = certificateFactory; + this.contractName = contractName; + this.networkAdminName = networkAdminName; + this.log = log; + } + + public async userOwnsNonFungibleAsset( + assetType: string, + assetId: string, + account: DLAccount, + ): Promise { + const netContext = await this.contextFactory.getTransactionContext(account); + + try { + const readResult = await netContext.invoke({ + contract: this.contractName, + method: "ReadAsset", + args: [assetType, assetId], + }); + return readResult.includes(assetId); + } catch (ex) { + if (ex.message.includes("does not exist")) { + return false; + } + // unexpected error case + throw ex; + } + return false; + } + + public async addToken( + assetType: string, + assetQuantity: number, + owner: DLAccount, + ) { + const transaction = await this.contextFactory.getTransactionContext(owner); + + await transaction.invoke({ + contract: this.contractName, + method: "IssueTokenAssets", + args: [ + assetType, + assetQuantity.toString(), + await this.certificateFactory(owner), + ], + }); + } + + public async addNonFungibleAsset( + assetType: string, + assetId: string, + account: DLAccount, + ) { + const item = { + assetType: assetType, + id: assetId, + owner: account.userId, + issuer: "treasury", + facevalue: "500", + maturitydate: "01 Jan 45 00:00 MST", + }; + const transaction = + await this.contextFactory.getTransactionContext(account); + const userCert = await this.certificateFactory(account); + + await transaction.invoke({ + contract: this.contractName, + method: "CreateAsset", + args: [ + item.assetType, + item.id, + userCert, + item.issuer, + item.facevalue, + item.maturitydate, + ], + }); + } + + public async tokenBalance( + tokenType: string, + account: DLAccount, + ): Promise { + const transaction = + await this.contextFactory.getTransactionContext(account); + + const walletBalance = await transaction.invoke({ + contract: this.contractName, + method: "GetMyWallet", + args: [], + }); + + this.log.info(walletBalance); + const walletParts = walletBalance.split("="); + return +walletParts[1]; + } +} diff --git a/packages/cacti-plugin-copm-fabric/src/test/typescript/lib/test-fabric-configuration.ts b/packages/cacti-plugin-copm-fabric/src/test/typescript/lib/test-fabric-configuration.ts new file mode 100644 index 00000000000..eea7dc5ff78 --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/src/test/typescript/lib/test-fabric-configuration.ts @@ -0,0 +1,83 @@ +import { FabricConfiguration } from "../../../main/typescript/lib/fabric-configuration"; +import { FabricContractContext } from "../../../main/typescript/lib/fabric-types"; +import { Wallet, DiscoveryOptions, Wallets } from "fabric-network"; +import { Logger } from "@hyperledger/cactus-common"; +import path from "path"; +import fs from "fs-extra"; + +export class TestFabricConfiguration implements FabricConfiguration { + private log: Logger; + private discoveryOptions: DiscoveryOptions; + private weaverRelativePath = "../../../../../../weaver/"; + private weaverWalletPath = path.join( + __dirname, + this.weaverRelativePath, + "samples/fabric/fabric-cli/src", + ); + private weaverNetConfigPath = path.join( + __dirname, + this.weaverRelativePath, + "samples/fabric/fabric-cli", + ); + + constructor(log: Logger) { + this.log = log; + this.discoveryOptions = { + enabled: true, + asLocalhost: true, + }; + } + + public async getContractContext( + orgName: string, + ): Promise { + const weaverConfig = this.getWeaverNetworkConfig(orgName); + if (!weaverConfig.mspId) { + throw Error(`no mspId defined for ${orgName}`); + } + if (!weaverConfig.channelName) { + throw Error(`no channel name defined for ${orgName}`); + } + return { + mspId: weaverConfig.mspId, + networkName: orgName, + channelName: weaverConfig.channelName, + discoveryOptions: this.discoveryOptions, + wallet: await this.getOrgWallet(orgName), + connectionProfile: this.getConnectionProfile(orgName), + }; + } + + public getConnectionProfile(orgName: string): object { + const netConfig = this.getWeaverNetworkConfig(orgName); + const ccp = JSON.parse(fs.readFileSync(netConfig.connProfilePath, "utf8")); + return ccp; + } + + public async getOrgWallet(orgName: string): Promise { + const walletPath = path.join(this.weaverWalletPath, `wallet-${orgName}`); + const wallet = await Wallets.newFileSystemWallet(walletPath); + return wallet; + } + + private getWeaverNetworkConfig(networkId: string): { + relayEndpoint?: string; + connProfilePath: string; + username?: string; + mspId?: string; + aclPolicyPrincipalType?: string; + channelName?: string; + chaincode?: string; + } { + const configPath = path.join(this.weaverNetConfigPath, "config.json"); + const configJSON = JSON.parse(fs.readFileSync(configPath).toString()); + if (!configJSON[networkId]) { + throw Error( + `Network: ${networkId} does not exist in the config.template.json file at ${configPath}`, + ); + } + + const netConfig = configJSON[networkId]; + return netConfig; + } +} diff --git a/packages/cacti-plugin-copm-fabric/src/test/typescript/lib/test-interop-configuration.ts b/packages/cacti-plugin-copm-fabric/src/test/typescript/lib/test-interop-configuration.ts new file mode 100644 index 00000000000..2b5de774822 --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/src/test/typescript/lib/test-interop-configuration.ts @@ -0,0 +1,88 @@ +import { Logger } from "@hyperledger/cactus-common"; +import { + LocalRelayConfig, + RemoteNetworkConfig, + Interfaces as CopmIF, +} from "@hyperledger/cacti-copm-core"; +import path from "path"; +import fs from "fs-extra"; + +export class TestInteropConfiguration implements CopmIF.InteropConfiguration { + private log: Logger; + private weaverRelativePath = "../../../../../../weaver/"; + private weaverNetConfigPath = path.join( + __dirname, + this.weaverRelativePath, + "samples/fabric/fabric-cli", + ); + + interopContractName: string; + + public constructor(interopContractName: string, log: Logger) { + this.log = log; + this.interopContractName = interopContractName; + } + + public getLocalRelayConfig(orgName: string): LocalRelayConfig { + const netConfig = this.getWeaverNetworkConfig(orgName); + if (!netConfig.relayEndpoint) { + throw Error(`no relay endpoint for ${orgName}`); + } + return { + endpoint: netConfig.relayEndpoint, + useTLS: false, + tlsCerts: [], + }; + } + + public getRemoteNetworkConfig(orgName: string): RemoteNetworkConfig { + const configPath = path.join( + this.weaverNetConfigPath, + "remote-network-config.json", + ); + const configJSON = JSON.parse(fs.readFileSync(configPath).toString()); + if (!configJSON[orgName]) { + throw Error( + `Network: ${orgName} does not exist in the config.template.json file at ${configPath}`, + ); + } + const netConfig = configJSON[orgName]; + if (!netConfig.channelName) { + throw Error(`no channel name defined for ${orgName}`); + } + if (!netConfig.relayEndpoint) { + throw Error(`no relay endpoint defined for ${orgName}`); + } + + return { + channelName: netConfig.channelName, + network: orgName, + relayAddr: netConfig.relayEndpoint, + e2eConfidentiality: false, + partyEndPoint: "", // corda-specific + flowPackage: "", // corda-specific + networkType: "fabric", + }; + } + + private getWeaverNetworkConfig(networkId: string): { + relayEndpoint?: string; + connProfilePath: string; + username?: string; + mspId?: string; + aclPolicyPrincipalType?: string; + channelName?: string; + chaincode?: string; + } { + const configPath = path.join(this.weaverNetConfigPath, "config.json"); + const configJSON = JSON.parse(fs.readFileSync(configPath).toString()); + if (!configJSON[networkId]) { + throw Error( + `Network: ${networkId} does not exist in the config.template.json file at ${configPath}`, + ); + } + + const netConfig = configJSON[networkId]; + return netConfig; + } +} diff --git a/packages/cacti-plugin-copm-fabric/tsconfig.json b/packages/cacti-plugin-copm-fabric/tsconfig.json new file mode 100644 index 00000000000..162afd7838c --- /dev/null +++ b/packages/cacti-plugin-copm-fabric/tsconfig.json @@ -0,0 +1,35 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "composite": true, + "outDir": "./dist/lib/", + "declarationDir": "dist/lib", + "resolveJsonModule": true, + "rootDir": "./src", + "strict": false /* Enable all strict type-checking options. */, + "noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */ + + "tsBuildInfoFile": "../../.build-cache/cacti-plugin-copm-fabric.tsbuildinfo" + }, + "include": [ + "./src", + "src/**/*.json" + ], + "references": [ + { + "path": "../cacti-copm-core/tsconfig.json" + }, + { + "path": "../cactus-common/tsconfig.json" + }, + { + "path": "../cactus-core/tsconfig.json" + }, + { + "path": "../cactus-core-api/tsconfig.json" + }, + { + "path": "../cactus-test-tooling/tsconfig.json" + } + ] +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 600c138e5ed..1c97a2b31f6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -115,6 +115,18 @@ { "path": "./packages/cactus-plugin-ledger-connector-sawtooth/tsconfig.json" }, + { + "path": "./packages/cacti-copm-core/tsconfig.json" + }, + { + "path": "./weaver/common/protos-js/tsconfig.json" + }, + { + "path" : "weaver/sdks/fabric/interoperation-node-sdk/tsconfig.cacti.json" + }, + { + "path": "./packages/cacti-plugin-copm-fabric/tsconfig.json" + }, { "path": "./packages/cactus-test-tooling/tsconfig.json" }, diff --git a/weaver/common/protos-js/.gitignore b/weaver/common/protos-js/.gitignore index 0ebf227dd1c..bc92c58329c 100644 --- a/weaver/common/protos-js/.gitignore +++ b/weaver/common/protos-js/.gitignore @@ -1,12 +1,3 @@ .npmrc node_modules/ package-lock.json -common/ -corda/ -driver/ -identity/ -fabric/ -networks/ -relay/ -peer/ -msp/ diff --git a/weaver/common/protos-js/common/access_control_pb.d.ts b/weaver/common/protos-js/common/access_control_pb.d.ts new file mode 100644 index 00000000000..dc150aa131f --- /dev/null +++ b/weaver/common/protos-js/common/access_control_pb.d.ts @@ -0,0 +1,61 @@ +// package: common.access_control +// file: common/access_control.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; + +export class AccessControlPolicy extends jspb.Message { + getSecuritydomain(): string; + setSecuritydomain(value: string): AccessControlPolicy; + clearRulesList(): void; + getRulesList(): Array; + setRulesList(value: Array): AccessControlPolicy; + addRules(value?: Rule, index?: number): Rule; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AccessControlPolicy.AsObject; + static toObject(includeInstance: boolean, msg: AccessControlPolicy): AccessControlPolicy.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AccessControlPolicy, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AccessControlPolicy; + static deserializeBinaryFromReader(message: AccessControlPolicy, reader: jspb.BinaryReader): AccessControlPolicy; +} + +export namespace AccessControlPolicy { + export type AsObject = { + securitydomain: string, + rulesList: Array, + } +} + +export class Rule extends jspb.Message { + getPrincipal(): string; + setPrincipal(value: string): Rule; + getPrincipaltype(): string; + setPrincipaltype(value: string): Rule; + getResource(): string; + setResource(value: string): Rule; + getRead(): boolean; + setRead(value: boolean): Rule; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Rule.AsObject; + static toObject(includeInstance: boolean, msg: Rule): Rule.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Rule, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Rule; + static deserializeBinaryFromReader(message: Rule, reader: jspb.BinaryReader): Rule; +} + +export namespace Rule { + export type AsObject = { + principal: string, + principaltype: string, + resource: string, + read: boolean, + } +} diff --git a/weaver/common/protos-js/common/access_control_pb.js b/weaver/common/protos-js/common/access_control_pb.js new file mode 100644 index 00000000000..120dbcda8c9 --- /dev/null +++ b/weaver/common/protos-js/common/access_control_pb.js @@ -0,0 +1,478 @@ +// source: common/access_control.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +goog.exportSymbol('proto.common.access_control.AccessControlPolicy', null, global); +goog.exportSymbol('proto.common.access_control.Rule', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.access_control.AccessControlPolicy = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.common.access_control.AccessControlPolicy.repeatedFields_, null); +}; +goog.inherits(proto.common.access_control.AccessControlPolicy, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.access_control.AccessControlPolicy.displayName = 'proto.common.access_control.AccessControlPolicy'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.access_control.Rule = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.access_control.Rule, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.access_control.Rule.displayName = 'proto.common.access_control.Rule'; +} + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.common.access_control.AccessControlPolicy.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.access_control.AccessControlPolicy.prototype.toObject = function(opt_includeInstance) { + return proto.common.access_control.AccessControlPolicy.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.access_control.AccessControlPolicy} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.access_control.AccessControlPolicy.toObject = function(includeInstance, msg) { + var f, obj = { + securitydomain: jspb.Message.getFieldWithDefault(msg, 1, ""), + rulesList: jspb.Message.toObjectList(msg.getRulesList(), + proto.common.access_control.Rule.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.access_control.AccessControlPolicy} + */ +proto.common.access_control.AccessControlPolicy.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.access_control.AccessControlPolicy; + return proto.common.access_control.AccessControlPolicy.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.access_control.AccessControlPolicy} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.access_control.AccessControlPolicy} + */ +proto.common.access_control.AccessControlPolicy.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setSecuritydomain(value); + break; + case 2: + var value = new proto.common.access_control.Rule; + reader.readMessage(value,proto.common.access_control.Rule.deserializeBinaryFromReader); + msg.addRules(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.access_control.AccessControlPolicy.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.access_control.AccessControlPolicy.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.access_control.AccessControlPolicy} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.access_control.AccessControlPolicy.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSecuritydomain(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getRulesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.common.access_control.Rule.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string securityDomain = 1; + * @return {string} + */ +proto.common.access_control.AccessControlPolicy.prototype.getSecuritydomain = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.access_control.AccessControlPolicy} returns this + */ +proto.common.access_control.AccessControlPolicy.prototype.setSecuritydomain = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * repeated Rule rules = 2; + * @return {!Array} + */ +proto.common.access_control.AccessControlPolicy.prototype.getRulesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.common.access_control.Rule, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.common.access_control.AccessControlPolicy} returns this +*/ +proto.common.access_control.AccessControlPolicy.prototype.setRulesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.common.access_control.Rule=} opt_value + * @param {number=} opt_index + * @return {!proto.common.access_control.Rule} + */ +proto.common.access_control.AccessControlPolicy.prototype.addRules = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.common.access_control.Rule, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.common.access_control.AccessControlPolicy} returns this + */ +proto.common.access_control.AccessControlPolicy.prototype.clearRulesList = function() { + return this.setRulesList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.access_control.Rule.prototype.toObject = function(opt_includeInstance) { + return proto.common.access_control.Rule.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.access_control.Rule} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.access_control.Rule.toObject = function(includeInstance, msg) { + var f, obj = { + principal: jspb.Message.getFieldWithDefault(msg, 1, ""), + principaltype: jspb.Message.getFieldWithDefault(msg, 2, ""), + resource: jspb.Message.getFieldWithDefault(msg, 3, ""), + read: jspb.Message.getBooleanFieldWithDefault(msg, 4, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.access_control.Rule} + */ +proto.common.access_control.Rule.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.access_control.Rule; + return proto.common.access_control.Rule.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.access_control.Rule} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.access_control.Rule} + */ +proto.common.access_control.Rule.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setPrincipal(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setPrincipaltype(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setResource(value); + break; + case 4: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setRead(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.access_control.Rule.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.access_control.Rule.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.access_control.Rule} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.access_control.Rule.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPrincipal(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getPrincipaltype(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getResource(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getRead(); + if (f) { + writer.writeBool( + 4, + f + ); + } +}; + + +/** + * optional string principal = 1; + * @return {string} + */ +proto.common.access_control.Rule.prototype.getPrincipal = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.access_control.Rule} returns this + */ +proto.common.access_control.Rule.prototype.setPrincipal = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string principalType = 2; + * @return {string} + */ +proto.common.access_control.Rule.prototype.getPrincipaltype = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.access_control.Rule} returns this + */ +proto.common.access_control.Rule.prototype.setPrincipaltype = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string resource = 3; + * @return {string} + */ +proto.common.access_control.Rule.prototype.getResource = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.access_control.Rule} returns this + */ +proto.common.access_control.Rule.prototype.setResource = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional bool read = 4; + * @return {boolean} + */ +proto.common.access_control.Rule.prototype.getRead = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.common.access_control.Rule} returns this + */ +proto.common.access_control.Rule.prototype.setRead = function(value) { + return jspb.Message.setProto3BooleanField(this, 4, value); +}; + + +goog.object.extend(exports, proto.common.access_control); diff --git a/weaver/common/protos-js/common/ack_pb.d.ts b/weaver/common/protos-js/common/ack_pb.d.ts new file mode 100644 index 00000000000..d5a335abaf8 --- /dev/null +++ b/weaver/common/protos-js/common/ack_pb.d.ts @@ -0,0 +1,39 @@ +// package: common.ack +// file: common/ack.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; + +export class Ack extends jspb.Message { + getStatus(): Ack.STATUS; + setStatus(value: Ack.STATUS): Ack; + getRequestId(): string; + setRequestId(value: string): Ack; + getMessage(): string; + setMessage(value: string): Ack; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Ack.AsObject; + static toObject(includeInstance: boolean, msg: Ack): Ack.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Ack, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Ack; + static deserializeBinaryFromReader(message: Ack, reader: jspb.BinaryReader): Ack; +} + +export namespace Ack { + export type AsObject = { + status: Ack.STATUS, + requestId: string, + message: string, + } + + export enum STATUS { + OK = 0, + ERROR = 1, + } + +} diff --git a/weaver/common/protos-js/common/ack_pb.js b/weaver/common/protos-js/common/ack_pb.js new file mode 100644 index 00000000000..aedc5fb8ff7 --- /dev/null +++ b/weaver/common/protos-js/common/ack_pb.js @@ -0,0 +1,245 @@ +// source: common/ack.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +goog.exportSymbol('proto.common.ack.Ack', null, global); +goog.exportSymbol('proto.common.ack.Ack.STATUS', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.ack.Ack = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.ack.Ack, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.ack.Ack.displayName = 'proto.common.ack.Ack'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.ack.Ack.prototype.toObject = function(opt_includeInstance) { + return proto.common.ack.Ack.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.ack.Ack} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.ack.Ack.toObject = function(includeInstance, msg) { + var f, obj = { + status: jspb.Message.getFieldWithDefault(msg, 2, 0), + requestId: jspb.Message.getFieldWithDefault(msg, 3, ""), + message: jspb.Message.getFieldWithDefault(msg, 4, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.ack.Ack} + */ +proto.common.ack.Ack.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.ack.Ack; + return proto.common.ack.Ack.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.ack.Ack} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.ack.Ack} + */ +proto.common.ack.Ack.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 2: + var value = /** @type {!proto.common.ack.Ack.STATUS} */ (reader.readEnum()); + msg.setStatus(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setRequestId(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setMessage(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.ack.Ack.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.ack.Ack.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.ack.Ack} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.ack.Ack.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStatus(); + if (f !== 0.0) { + writer.writeEnum( + 2, + f + ); + } + f = message.getRequestId(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getMessage(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.common.ack.Ack.STATUS = { + OK: 0, + ERROR: 1 +}; + +/** + * optional STATUS status = 2; + * @return {!proto.common.ack.Ack.STATUS} + */ +proto.common.ack.Ack.prototype.getStatus = function() { + return /** @type {!proto.common.ack.Ack.STATUS} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {!proto.common.ack.Ack.STATUS} value + * @return {!proto.common.ack.Ack} returns this + */ +proto.common.ack.Ack.prototype.setStatus = function(value) { + return jspb.Message.setProto3EnumField(this, 2, value); +}; + + +/** + * optional string request_id = 3; + * @return {string} + */ +proto.common.ack.Ack.prototype.getRequestId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.ack.Ack} returns this + */ +proto.common.ack.Ack.prototype.setRequestId = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string message = 4; + * @return {string} + */ +proto.common.ack.Ack.prototype.getMessage = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.ack.Ack} returns this + */ +proto.common.ack.Ack.prototype.setMessage = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +goog.object.extend(exports, proto.common.ack); diff --git a/weaver/common/protos-js/common/asset_locks_pb.d.ts b/weaver/common/protos-js/common/asset_locks_pb.d.ts new file mode 100644 index 00000000000..e132e55c6d4 --- /dev/null +++ b/weaver/common/protos-js/common/asset_locks_pb.d.ts @@ -0,0 +1,298 @@ +// package: common.asset_locks +// file: common/asset_locks.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; + +export class AssetLock extends jspb.Message { + getLockmechanism(): LockMechanism; + setLockmechanism(value: LockMechanism): AssetLock; + getLockinfo(): Uint8Array | string; + getLockinfo_asU8(): Uint8Array; + getLockinfo_asB64(): string; + setLockinfo(value: Uint8Array | string): AssetLock; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AssetLock.AsObject; + static toObject(includeInstance: boolean, msg: AssetLock): AssetLock.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AssetLock, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AssetLock; + static deserializeBinaryFromReader(message: AssetLock, reader: jspb.BinaryReader): AssetLock; +} + +export namespace AssetLock { + export type AsObject = { + lockmechanism: LockMechanism, + lockinfo: Uint8Array | string, + } +} + +export class AssetClaim extends jspb.Message { + getLockmechanism(): LockMechanism; + setLockmechanism(value: LockMechanism): AssetClaim; + getClaiminfo(): Uint8Array | string; + getClaiminfo_asU8(): Uint8Array; + getClaiminfo_asB64(): string; + setClaiminfo(value: Uint8Array | string): AssetClaim; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AssetClaim.AsObject; + static toObject(includeInstance: boolean, msg: AssetClaim): AssetClaim.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AssetClaim, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AssetClaim; + static deserializeBinaryFromReader(message: AssetClaim, reader: jspb.BinaryReader): AssetClaim; +} + +export namespace AssetClaim { + export type AsObject = { + lockmechanism: LockMechanism, + claiminfo: Uint8Array | string, + } +} + +export class AssetLockHTLC extends jspb.Message { + getHashmechanism(): HashMechanism; + setHashmechanism(value: HashMechanism): AssetLockHTLC; + getHashbase64(): Uint8Array | string; + getHashbase64_asU8(): Uint8Array; + getHashbase64_asB64(): string; + setHashbase64(value: Uint8Array | string): AssetLockHTLC; + getExpirytimesecs(): number; + setExpirytimesecs(value: number): AssetLockHTLC; + getTimespec(): TimeSpec; + setTimespec(value: TimeSpec): AssetLockHTLC; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AssetLockHTLC.AsObject; + static toObject(includeInstance: boolean, msg: AssetLockHTLC): AssetLockHTLC.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AssetLockHTLC, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AssetLockHTLC; + static deserializeBinaryFromReader(message: AssetLockHTLC, reader: jspb.BinaryReader): AssetLockHTLC; +} + +export namespace AssetLockHTLC { + export type AsObject = { + hashmechanism: HashMechanism, + hashbase64: Uint8Array | string, + expirytimesecs: number, + timespec: TimeSpec, + } +} + +export class AssetClaimHTLC extends jspb.Message { + getHashmechanism(): HashMechanism; + setHashmechanism(value: HashMechanism): AssetClaimHTLC; + getHashpreimagebase64(): Uint8Array | string; + getHashpreimagebase64_asU8(): Uint8Array; + getHashpreimagebase64_asB64(): string; + setHashpreimagebase64(value: Uint8Array | string): AssetClaimHTLC; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AssetClaimHTLC.AsObject; + static toObject(includeInstance: boolean, msg: AssetClaimHTLC): AssetClaimHTLC.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AssetClaimHTLC, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AssetClaimHTLC; + static deserializeBinaryFromReader(message: AssetClaimHTLC, reader: jspb.BinaryReader): AssetClaimHTLC; +} + +export namespace AssetClaimHTLC { + export type AsObject = { + hashmechanism: HashMechanism, + hashpreimagebase64: Uint8Array | string, + } +} + +export class AssetExchangeAgreement extends jspb.Message { + getAssettype(): string; + setAssettype(value: string): AssetExchangeAgreement; + getId(): string; + setId(value: string): AssetExchangeAgreement; + getLocker(): string; + setLocker(value: string): AssetExchangeAgreement; + getRecipient(): string; + setRecipient(value: string): AssetExchangeAgreement; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AssetExchangeAgreement.AsObject; + static toObject(includeInstance: boolean, msg: AssetExchangeAgreement): AssetExchangeAgreement.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AssetExchangeAgreement, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AssetExchangeAgreement; + static deserializeBinaryFromReader(message: AssetExchangeAgreement, reader: jspb.BinaryReader): AssetExchangeAgreement; +} + +export namespace AssetExchangeAgreement { + export type AsObject = { + assettype: string, + id: string, + locker: string, + recipient: string, + } +} + +export class HybridAssetExchangeAgreement extends jspb.Message { + getAssettype(): string; + setAssettype(value: string): HybridAssetExchangeAgreement; + getId(): string; + setId(value: string): HybridAssetExchangeAgreement; + getAssetdata(): Uint8Array | string; + getAssetdata_asU8(): Uint8Array; + getAssetdata_asB64(): string; + setAssetdata(value: Uint8Array | string): HybridAssetExchangeAgreement; + getNumunits(): number; + setNumunits(value: number): HybridAssetExchangeAgreement; + getLocker(): string; + setLocker(value: string): HybridAssetExchangeAgreement; + getRecipient(): string; + setRecipient(value: string): HybridAssetExchangeAgreement; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): HybridAssetExchangeAgreement.AsObject; + static toObject(includeInstance: boolean, msg: HybridAssetExchangeAgreement): HybridAssetExchangeAgreement.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: HybridAssetExchangeAgreement, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): HybridAssetExchangeAgreement; + static deserializeBinaryFromReader(message: HybridAssetExchangeAgreement, reader: jspb.BinaryReader): HybridAssetExchangeAgreement; +} + +export namespace HybridAssetExchangeAgreement { + export type AsObject = { + assettype: string, + id: string, + assetdata: Uint8Array | string, + numunits: number, + locker: string, + recipient: string, + } +} + +export class FungibleAssetExchangeAgreement extends jspb.Message { + getAssettype(): string; + setAssettype(value: string): FungibleAssetExchangeAgreement; + getNumunits(): number; + setNumunits(value: number): FungibleAssetExchangeAgreement; + getLocker(): string; + setLocker(value: string): FungibleAssetExchangeAgreement; + getRecipient(): string; + setRecipient(value: string): FungibleAssetExchangeAgreement; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): FungibleAssetExchangeAgreement.AsObject; + static toObject(includeInstance: boolean, msg: FungibleAssetExchangeAgreement): FungibleAssetExchangeAgreement.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: FungibleAssetExchangeAgreement, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): FungibleAssetExchangeAgreement; + static deserializeBinaryFromReader(message: FungibleAssetExchangeAgreement, reader: jspb.BinaryReader): FungibleAssetExchangeAgreement; +} + +export namespace FungibleAssetExchangeAgreement { + export type AsObject = { + assettype: string, + numunits: number, + locker: string, + recipient: string, + } +} + +export class AssetContractHTLC extends jspb.Message { + getContractid(): string; + setContractid(value: string): AssetContractHTLC; + + hasAgreement(): boolean; + clearAgreement(): void; + getAgreement(): AssetExchangeAgreement | undefined; + setAgreement(value?: AssetExchangeAgreement): AssetContractHTLC; + + hasLock(): boolean; + clearLock(): void; + getLock(): AssetLockHTLC | undefined; + setLock(value?: AssetLockHTLC): AssetContractHTLC; + + hasClaim(): boolean; + clearClaim(): void; + getClaim(): AssetClaimHTLC | undefined; + setClaim(value?: AssetClaimHTLC): AssetContractHTLC; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AssetContractHTLC.AsObject; + static toObject(includeInstance: boolean, msg: AssetContractHTLC): AssetContractHTLC.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AssetContractHTLC, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AssetContractHTLC; + static deserializeBinaryFromReader(message: AssetContractHTLC, reader: jspb.BinaryReader): AssetContractHTLC; +} + +export namespace AssetContractHTLC { + export type AsObject = { + contractid: string, + agreement?: AssetExchangeAgreement.AsObject, + lock?: AssetLockHTLC.AsObject, + claim?: AssetClaimHTLC.AsObject, + } +} + +export class FungibleAssetContractHTLC extends jspb.Message { + getContractid(): string; + setContractid(value: string): FungibleAssetContractHTLC; + + hasAgreement(): boolean; + clearAgreement(): void; + getAgreement(): FungibleAssetExchangeAgreement | undefined; + setAgreement(value?: FungibleAssetExchangeAgreement): FungibleAssetContractHTLC; + + hasLock(): boolean; + clearLock(): void; + getLock(): AssetLockHTLC | undefined; + setLock(value?: AssetLockHTLC): FungibleAssetContractHTLC; + + hasClaim(): boolean; + clearClaim(): void; + getClaim(): AssetClaimHTLC | undefined; + setClaim(value?: AssetClaimHTLC): FungibleAssetContractHTLC; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): FungibleAssetContractHTLC.AsObject; + static toObject(includeInstance: boolean, msg: FungibleAssetContractHTLC): FungibleAssetContractHTLC.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: FungibleAssetContractHTLC, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): FungibleAssetContractHTLC; + static deserializeBinaryFromReader(message: FungibleAssetContractHTLC, reader: jspb.BinaryReader): FungibleAssetContractHTLC; +} + +export namespace FungibleAssetContractHTLC { + export type AsObject = { + contractid: string, + agreement?: FungibleAssetExchangeAgreement.AsObject, + lock?: AssetLockHTLC.AsObject, + claim?: AssetClaimHTLC.AsObject, + } +} + +export enum LockMechanism { + HTLC = 0, +} + +export enum HashMechanism { + SHA256 = 0, + SHA512 = 1, +} + +export enum TimeSpec { + EPOCH = 0, + DURATION = 1, +} diff --git a/weaver/common/protos-js/common/asset_locks_pb.js b/weaver/common/protos-js/common/asset_locks_pb.js new file mode 100644 index 00000000000..d0328f74a44 --- /dev/null +++ b/weaver/common/protos-js/common/asset_locks_pb.js @@ -0,0 +1,2354 @@ +// source: common/asset_locks.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +goog.exportSymbol('proto.common.asset_locks.AssetClaim', null, global); +goog.exportSymbol('proto.common.asset_locks.AssetClaimHTLC', null, global); +goog.exportSymbol('proto.common.asset_locks.AssetContractHTLC', null, global); +goog.exportSymbol('proto.common.asset_locks.AssetExchangeAgreement', null, global); +goog.exportSymbol('proto.common.asset_locks.AssetLock', null, global); +goog.exportSymbol('proto.common.asset_locks.AssetLockHTLC', null, global); +goog.exportSymbol('proto.common.asset_locks.FungibleAssetContractHTLC', null, global); +goog.exportSymbol('proto.common.asset_locks.FungibleAssetExchangeAgreement', null, global); +goog.exportSymbol('proto.common.asset_locks.HashMechanism', null, global); +goog.exportSymbol('proto.common.asset_locks.HybridAssetExchangeAgreement', null, global); +goog.exportSymbol('proto.common.asset_locks.LockMechanism', null, global); +goog.exportSymbol('proto.common.asset_locks.TimeSpec', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.asset_locks.AssetLock = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.asset_locks.AssetLock, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.asset_locks.AssetLock.displayName = 'proto.common.asset_locks.AssetLock'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.asset_locks.AssetClaim = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.asset_locks.AssetClaim, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.asset_locks.AssetClaim.displayName = 'proto.common.asset_locks.AssetClaim'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.asset_locks.AssetLockHTLC = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.asset_locks.AssetLockHTLC, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.asset_locks.AssetLockHTLC.displayName = 'proto.common.asset_locks.AssetLockHTLC'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.asset_locks.AssetClaimHTLC = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.asset_locks.AssetClaimHTLC, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.asset_locks.AssetClaimHTLC.displayName = 'proto.common.asset_locks.AssetClaimHTLC'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.asset_locks.AssetExchangeAgreement = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.asset_locks.AssetExchangeAgreement, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.asset_locks.AssetExchangeAgreement.displayName = 'proto.common.asset_locks.AssetExchangeAgreement'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.asset_locks.HybridAssetExchangeAgreement = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.asset_locks.HybridAssetExchangeAgreement, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.asset_locks.HybridAssetExchangeAgreement.displayName = 'proto.common.asset_locks.HybridAssetExchangeAgreement'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.asset_locks.FungibleAssetExchangeAgreement = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.asset_locks.FungibleAssetExchangeAgreement, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.asset_locks.FungibleAssetExchangeAgreement.displayName = 'proto.common.asset_locks.FungibleAssetExchangeAgreement'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.asset_locks.AssetContractHTLC = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.asset_locks.AssetContractHTLC, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.asset_locks.AssetContractHTLC.displayName = 'proto.common.asset_locks.AssetContractHTLC'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.asset_locks.FungibleAssetContractHTLC = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.asset_locks.FungibleAssetContractHTLC, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.asset_locks.FungibleAssetContractHTLC.displayName = 'proto.common.asset_locks.FungibleAssetContractHTLC'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.asset_locks.AssetLock.prototype.toObject = function(opt_includeInstance) { + return proto.common.asset_locks.AssetLock.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.asset_locks.AssetLock} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.asset_locks.AssetLock.toObject = function(includeInstance, msg) { + var f, obj = { + lockmechanism: jspb.Message.getFieldWithDefault(msg, 1, 0), + lockinfo: msg.getLockinfo_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.asset_locks.AssetLock} + */ +proto.common.asset_locks.AssetLock.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.asset_locks.AssetLock; + return proto.common.asset_locks.AssetLock.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.asset_locks.AssetLock} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.asset_locks.AssetLock} + */ +proto.common.asset_locks.AssetLock.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.common.asset_locks.LockMechanism} */ (reader.readEnum()); + msg.setLockmechanism(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setLockinfo(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.asset_locks.AssetLock.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.asset_locks.AssetLock.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.asset_locks.AssetLock} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.asset_locks.AssetLock.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getLockmechanism(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getLockinfo_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional LockMechanism lockMechanism = 1; + * @return {!proto.common.asset_locks.LockMechanism} + */ +proto.common.asset_locks.AssetLock.prototype.getLockmechanism = function() { + return /** @type {!proto.common.asset_locks.LockMechanism} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.common.asset_locks.LockMechanism} value + * @return {!proto.common.asset_locks.AssetLock} returns this + */ +proto.common.asset_locks.AssetLock.prototype.setLockmechanism = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional bytes lockInfo = 2; + * @return {!(string|Uint8Array)} + */ +proto.common.asset_locks.AssetLock.prototype.getLockinfo = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes lockInfo = 2; + * This is a type-conversion wrapper around `getLockinfo()` + * @return {string} + */ +proto.common.asset_locks.AssetLock.prototype.getLockinfo_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getLockinfo())); +}; + + +/** + * optional bytes lockInfo = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getLockinfo()` + * @return {!Uint8Array} + */ +proto.common.asset_locks.AssetLock.prototype.getLockinfo_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getLockinfo())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.common.asset_locks.AssetLock} returns this + */ +proto.common.asset_locks.AssetLock.prototype.setLockinfo = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.asset_locks.AssetClaim.prototype.toObject = function(opt_includeInstance) { + return proto.common.asset_locks.AssetClaim.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.asset_locks.AssetClaim} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.asset_locks.AssetClaim.toObject = function(includeInstance, msg) { + var f, obj = { + lockmechanism: jspb.Message.getFieldWithDefault(msg, 1, 0), + claiminfo: msg.getClaiminfo_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.asset_locks.AssetClaim} + */ +proto.common.asset_locks.AssetClaim.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.asset_locks.AssetClaim; + return proto.common.asset_locks.AssetClaim.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.asset_locks.AssetClaim} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.asset_locks.AssetClaim} + */ +proto.common.asset_locks.AssetClaim.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.common.asset_locks.LockMechanism} */ (reader.readEnum()); + msg.setLockmechanism(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setClaiminfo(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.asset_locks.AssetClaim.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.asset_locks.AssetClaim.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.asset_locks.AssetClaim} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.asset_locks.AssetClaim.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getLockmechanism(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getClaiminfo_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional LockMechanism lockMechanism = 1; + * @return {!proto.common.asset_locks.LockMechanism} + */ +proto.common.asset_locks.AssetClaim.prototype.getLockmechanism = function() { + return /** @type {!proto.common.asset_locks.LockMechanism} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.common.asset_locks.LockMechanism} value + * @return {!proto.common.asset_locks.AssetClaim} returns this + */ +proto.common.asset_locks.AssetClaim.prototype.setLockmechanism = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional bytes claimInfo = 2; + * @return {!(string|Uint8Array)} + */ +proto.common.asset_locks.AssetClaim.prototype.getClaiminfo = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes claimInfo = 2; + * This is a type-conversion wrapper around `getClaiminfo()` + * @return {string} + */ +proto.common.asset_locks.AssetClaim.prototype.getClaiminfo_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getClaiminfo())); +}; + + +/** + * optional bytes claimInfo = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getClaiminfo()` + * @return {!Uint8Array} + */ +proto.common.asset_locks.AssetClaim.prototype.getClaiminfo_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getClaiminfo())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.common.asset_locks.AssetClaim} returns this + */ +proto.common.asset_locks.AssetClaim.prototype.setClaiminfo = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.asset_locks.AssetLockHTLC.prototype.toObject = function(opt_includeInstance) { + return proto.common.asset_locks.AssetLockHTLC.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.asset_locks.AssetLockHTLC} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.asset_locks.AssetLockHTLC.toObject = function(includeInstance, msg) { + var f, obj = { + hashmechanism: jspb.Message.getFieldWithDefault(msg, 1, 0), + hashbase64: msg.getHashbase64_asB64(), + expirytimesecs: jspb.Message.getFieldWithDefault(msg, 3, 0), + timespec: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.asset_locks.AssetLockHTLC} + */ +proto.common.asset_locks.AssetLockHTLC.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.asset_locks.AssetLockHTLC; + return proto.common.asset_locks.AssetLockHTLC.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.asset_locks.AssetLockHTLC} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.asset_locks.AssetLockHTLC} + */ +proto.common.asset_locks.AssetLockHTLC.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.common.asset_locks.HashMechanism} */ (reader.readEnum()); + msg.setHashmechanism(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setHashbase64(value); + break; + case 3: + var value = /** @type {number} */ (reader.readUint64()); + msg.setExpirytimesecs(value); + break; + case 4: + var value = /** @type {!proto.common.asset_locks.TimeSpec} */ (reader.readEnum()); + msg.setTimespec(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.asset_locks.AssetLockHTLC.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.asset_locks.AssetLockHTLC.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.asset_locks.AssetLockHTLC} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.asset_locks.AssetLockHTLC.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getHashmechanism(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getHashbase64_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getExpirytimesecs(); + if (f !== 0) { + writer.writeUint64( + 3, + f + ); + } + f = message.getTimespec(); + if (f !== 0.0) { + writer.writeEnum( + 4, + f + ); + } +}; + + +/** + * optional HashMechanism hashMechanism = 1; + * @return {!proto.common.asset_locks.HashMechanism} + */ +proto.common.asset_locks.AssetLockHTLC.prototype.getHashmechanism = function() { + return /** @type {!proto.common.asset_locks.HashMechanism} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.common.asset_locks.HashMechanism} value + * @return {!proto.common.asset_locks.AssetLockHTLC} returns this + */ +proto.common.asset_locks.AssetLockHTLC.prototype.setHashmechanism = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional bytes hashBase64 = 2; + * @return {!(string|Uint8Array)} + */ +proto.common.asset_locks.AssetLockHTLC.prototype.getHashbase64 = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes hashBase64 = 2; + * This is a type-conversion wrapper around `getHashbase64()` + * @return {string} + */ +proto.common.asset_locks.AssetLockHTLC.prototype.getHashbase64_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getHashbase64())); +}; + + +/** + * optional bytes hashBase64 = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getHashbase64()` + * @return {!Uint8Array} + */ +proto.common.asset_locks.AssetLockHTLC.prototype.getHashbase64_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getHashbase64())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.common.asset_locks.AssetLockHTLC} returns this + */ +proto.common.asset_locks.AssetLockHTLC.prototype.setHashbase64 = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * optional uint64 expiryTimeSecs = 3; + * @return {number} + */ +proto.common.asset_locks.AssetLockHTLC.prototype.getExpirytimesecs = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.common.asset_locks.AssetLockHTLC} returns this + */ +proto.common.asset_locks.AssetLockHTLC.prototype.setExpirytimesecs = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional TimeSpec timeSpec = 4; + * @return {!proto.common.asset_locks.TimeSpec} + */ +proto.common.asset_locks.AssetLockHTLC.prototype.getTimespec = function() { + return /** @type {!proto.common.asset_locks.TimeSpec} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {!proto.common.asset_locks.TimeSpec} value + * @return {!proto.common.asset_locks.AssetLockHTLC} returns this + */ +proto.common.asset_locks.AssetLockHTLC.prototype.setTimespec = function(value) { + return jspb.Message.setProto3EnumField(this, 4, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.asset_locks.AssetClaimHTLC.prototype.toObject = function(opt_includeInstance) { + return proto.common.asset_locks.AssetClaimHTLC.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.asset_locks.AssetClaimHTLC} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.asset_locks.AssetClaimHTLC.toObject = function(includeInstance, msg) { + var f, obj = { + hashmechanism: jspb.Message.getFieldWithDefault(msg, 1, 0), + hashpreimagebase64: msg.getHashpreimagebase64_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.asset_locks.AssetClaimHTLC} + */ +proto.common.asset_locks.AssetClaimHTLC.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.asset_locks.AssetClaimHTLC; + return proto.common.asset_locks.AssetClaimHTLC.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.asset_locks.AssetClaimHTLC} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.asset_locks.AssetClaimHTLC} + */ +proto.common.asset_locks.AssetClaimHTLC.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.common.asset_locks.HashMechanism} */ (reader.readEnum()); + msg.setHashmechanism(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setHashpreimagebase64(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.asset_locks.AssetClaimHTLC.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.asset_locks.AssetClaimHTLC.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.asset_locks.AssetClaimHTLC} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.asset_locks.AssetClaimHTLC.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getHashmechanism(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getHashpreimagebase64_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional HashMechanism hashMechanism = 1; + * @return {!proto.common.asset_locks.HashMechanism} + */ +proto.common.asset_locks.AssetClaimHTLC.prototype.getHashmechanism = function() { + return /** @type {!proto.common.asset_locks.HashMechanism} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.common.asset_locks.HashMechanism} value + * @return {!proto.common.asset_locks.AssetClaimHTLC} returns this + */ +proto.common.asset_locks.AssetClaimHTLC.prototype.setHashmechanism = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional bytes hashPreimageBase64 = 2; + * @return {!(string|Uint8Array)} + */ +proto.common.asset_locks.AssetClaimHTLC.prototype.getHashpreimagebase64 = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes hashPreimageBase64 = 2; + * This is a type-conversion wrapper around `getHashpreimagebase64()` + * @return {string} + */ +proto.common.asset_locks.AssetClaimHTLC.prototype.getHashpreimagebase64_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getHashpreimagebase64())); +}; + + +/** + * optional bytes hashPreimageBase64 = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getHashpreimagebase64()` + * @return {!Uint8Array} + */ +proto.common.asset_locks.AssetClaimHTLC.prototype.getHashpreimagebase64_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getHashpreimagebase64())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.common.asset_locks.AssetClaimHTLC} returns this + */ +proto.common.asset_locks.AssetClaimHTLC.prototype.setHashpreimagebase64 = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.asset_locks.AssetExchangeAgreement.prototype.toObject = function(opt_includeInstance) { + return proto.common.asset_locks.AssetExchangeAgreement.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.asset_locks.AssetExchangeAgreement} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.asset_locks.AssetExchangeAgreement.toObject = function(includeInstance, msg) { + var f, obj = { + assettype: jspb.Message.getFieldWithDefault(msg, 1, ""), + id: jspb.Message.getFieldWithDefault(msg, 2, ""), + locker: jspb.Message.getFieldWithDefault(msg, 3, ""), + recipient: jspb.Message.getFieldWithDefault(msg, 4, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.asset_locks.AssetExchangeAgreement} + */ +proto.common.asset_locks.AssetExchangeAgreement.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.asset_locks.AssetExchangeAgreement; + return proto.common.asset_locks.AssetExchangeAgreement.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.asset_locks.AssetExchangeAgreement} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.asset_locks.AssetExchangeAgreement} + */ +proto.common.asset_locks.AssetExchangeAgreement.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setAssettype(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setLocker(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setRecipient(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.asset_locks.AssetExchangeAgreement.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.asset_locks.AssetExchangeAgreement.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.asset_locks.AssetExchangeAgreement} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.asset_locks.AssetExchangeAgreement.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAssettype(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getLocker(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getRecipient(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } +}; + + +/** + * optional string assetType = 1; + * @return {string} + */ +proto.common.asset_locks.AssetExchangeAgreement.prototype.getAssettype = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.asset_locks.AssetExchangeAgreement} returns this + */ +proto.common.asset_locks.AssetExchangeAgreement.prototype.setAssettype = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string id = 2; + * @return {string} + */ +proto.common.asset_locks.AssetExchangeAgreement.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.asset_locks.AssetExchangeAgreement} returns this + */ +proto.common.asset_locks.AssetExchangeAgreement.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string locker = 3; + * @return {string} + */ +proto.common.asset_locks.AssetExchangeAgreement.prototype.getLocker = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.asset_locks.AssetExchangeAgreement} returns this + */ +proto.common.asset_locks.AssetExchangeAgreement.prototype.setLocker = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string recipient = 4; + * @return {string} + */ +proto.common.asset_locks.AssetExchangeAgreement.prototype.getRecipient = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.asset_locks.AssetExchangeAgreement} returns this + */ +proto.common.asset_locks.AssetExchangeAgreement.prototype.setRecipient = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.asset_locks.HybridAssetExchangeAgreement.prototype.toObject = function(opt_includeInstance) { + return proto.common.asset_locks.HybridAssetExchangeAgreement.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.asset_locks.HybridAssetExchangeAgreement} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.asset_locks.HybridAssetExchangeAgreement.toObject = function(includeInstance, msg) { + var f, obj = { + assettype: jspb.Message.getFieldWithDefault(msg, 1, ""), + id: jspb.Message.getFieldWithDefault(msg, 2, ""), + assetdata: msg.getAssetdata_asB64(), + numunits: jspb.Message.getFieldWithDefault(msg, 4, 0), + locker: jspb.Message.getFieldWithDefault(msg, 5, ""), + recipient: jspb.Message.getFieldWithDefault(msg, 6, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.asset_locks.HybridAssetExchangeAgreement} + */ +proto.common.asset_locks.HybridAssetExchangeAgreement.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.asset_locks.HybridAssetExchangeAgreement; + return proto.common.asset_locks.HybridAssetExchangeAgreement.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.asset_locks.HybridAssetExchangeAgreement} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.asset_locks.HybridAssetExchangeAgreement} + */ +proto.common.asset_locks.HybridAssetExchangeAgreement.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setAssettype(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setAssetdata(value); + break; + case 4: + var value = /** @type {number} */ (reader.readUint64()); + msg.setNumunits(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setLocker(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setRecipient(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.asset_locks.HybridAssetExchangeAgreement.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.asset_locks.HybridAssetExchangeAgreement.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.asset_locks.HybridAssetExchangeAgreement} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.asset_locks.HybridAssetExchangeAgreement.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAssettype(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getAssetdata_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getNumunits(); + if (f !== 0) { + writer.writeUint64( + 4, + f + ); + } + f = message.getLocker(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getRecipient(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } +}; + + +/** + * optional string assetType = 1; + * @return {string} + */ +proto.common.asset_locks.HybridAssetExchangeAgreement.prototype.getAssettype = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.asset_locks.HybridAssetExchangeAgreement} returns this + */ +proto.common.asset_locks.HybridAssetExchangeAgreement.prototype.setAssettype = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string id = 2; + * @return {string} + */ +proto.common.asset_locks.HybridAssetExchangeAgreement.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.asset_locks.HybridAssetExchangeAgreement} returns this + */ +proto.common.asset_locks.HybridAssetExchangeAgreement.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional bytes assetData = 3; + * @return {!(string|Uint8Array)} + */ +proto.common.asset_locks.HybridAssetExchangeAgreement.prototype.getAssetdata = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes assetData = 3; + * This is a type-conversion wrapper around `getAssetdata()` + * @return {string} + */ +proto.common.asset_locks.HybridAssetExchangeAgreement.prototype.getAssetdata_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAssetdata())); +}; + + +/** + * optional bytes assetData = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAssetdata()` + * @return {!Uint8Array} + */ +proto.common.asset_locks.HybridAssetExchangeAgreement.prototype.getAssetdata_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAssetdata())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.common.asset_locks.HybridAssetExchangeAgreement} returns this + */ +proto.common.asset_locks.HybridAssetExchangeAgreement.prototype.setAssetdata = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); +}; + + +/** + * optional uint64 numUnits = 4; + * @return {number} + */ +proto.common.asset_locks.HybridAssetExchangeAgreement.prototype.getNumunits = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.common.asset_locks.HybridAssetExchangeAgreement} returns this + */ +proto.common.asset_locks.HybridAssetExchangeAgreement.prototype.setNumunits = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + +/** + * optional string locker = 5; + * @return {string} + */ +proto.common.asset_locks.HybridAssetExchangeAgreement.prototype.getLocker = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.asset_locks.HybridAssetExchangeAgreement} returns this + */ +proto.common.asset_locks.HybridAssetExchangeAgreement.prototype.setLocker = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string recipient = 6; + * @return {string} + */ +proto.common.asset_locks.HybridAssetExchangeAgreement.prototype.getRecipient = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.asset_locks.HybridAssetExchangeAgreement} returns this + */ +proto.common.asset_locks.HybridAssetExchangeAgreement.prototype.setRecipient = function(value) { + return jspb.Message.setProto3StringField(this, 6, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.asset_locks.FungibleAssetExchangeAgreement.prototype.toObject = function(opt_includeInstance) { + return proto.common.asset_locks.FungibleAssetExchangeAgreement.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.asset_locks.FungibleAssetExchangeAgreement} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.asset_locks.FungibleAssetExchangeAgreement.toObject = function(includeInstance, msg) { + var f, obj = { + assettype: jspb.Message.getFieldWithDefault(msg, 1, ""), + numunits: jspb.Message.getFieldWithDefault(msg, 2, 0), + locker: jspb.Message.getFieldWithDefault(msg, 3, ""), + recipient: jspb.Message.getFieldWithDefault(msg, 4, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.asset_locks.FungibleAssetExchangeAgreement} + */ +proto.common.asset_locks.FungibleAssetExchangeAgreement.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.asset_locks.FungibleAssetExchangeAgreement; + return proto.common.asset_locks.FungibleAssetExchangeAgreement.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.asset_locks.FungibleAssetExchangeAgreement} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.asset_locks.FungibleAssetExchangeAgreement} + */ +proto.common.asset_locks.FungibleAssetExchangeAgreement.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setAssettype(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint64()); + msg.setNumunits(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setLocker(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setRecipient(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.asset_locks.FungibleAssetExchangeAgreement.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.asset_locks.FungibleAssetExchangeAgreement.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.asset_locks.FungibleAssetExchangeAgreement} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.asset_locks.FungibleAssetExchangeAgreement.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAssettype(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getNumunits(); + if (f !== 0) { + writer.writeUint64( + 2, + f + ); + } + f = message.getLocker(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getRecipient(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } +}; + + +/** + * optional string assetType = 1; + * @return {string} + */ +proto.common.asset_locks.FungibleAssetExchangeAgreement.prototype.getAssettype = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.asset_locks.FungibleAssetExchangeAgreement} returns this + */ +proto.common.asset_locks.FungibleAssetExchangeAgreement.prototype.setAssettype = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional uint64 numUnits = 2; + * @return {number} + */ +proto.common.asset_locks.FungibleAssetExchangeAgreement.prototype.getNumunits = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.common.asset_locks.FungibleAssetExchangeAgreement} returns this + */ +proto.common.asset_locks.FungibleAssetExchangeAgreement.prototype.setNumunits = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional string locker = 3; + * @return {string} + */ +proto.common.asset_locks.FungibleAssetExchangeAgreement.prototype.getLocker = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.asset_locks.FungibleAssetExchangeAgreement} returns this + */ +proto.common.asset_locks.FungibleAssetExchangeAgreement.prototype.setLocker = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string recipient = 4; + * @return {string} + */ +proto.common.asset_locks.FungibleAssetExchangeAgreement.prototype.getRecipient = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.asset_locks.FungibleAssetExchangeAgreement} returns this + */ +proto.common.asset_locks.FungibleAssetExchangeAgreement.prototype.setRecipient = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.asset_locks.AssetContractHTLC.prototype.toObject = function(opt_includeInstance) { + return proto.common.asset_locks.AssetContractHTLC.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.asset_locks.AssetContractHTLC} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.asset_locks.AssetContractHTLC.toObject = function(includeInstance, msg) { + var f, obj = { + contractid: jspb.Message.getFieldWithDefault(msg, 1, ""), + agreement: (f = msg.getAgreement()) && proto.common.asset_locks.AssetExchangeAgreement.toObject(includeInstance, f), + lock: (f = msg.getLock()) && proto.common.asset_locks.AssetLockHTLC.toObject(includeInstance, f), + claim: (f = msg.getClaim()) && proto.common.asset_locks.AssetClaimHTLC.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.asset_locks.AssetContractHTLC} + */ +proto.common.asset_locks.AssetContractHTLC.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.asset_locks.AssetContractHTLC; + return proto.common.asset_locks.AssetContractHTLC.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.asset_locks.AssetContractHTLC} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.asset_locks.AssetContractHTLC} + */ +proto.common.asset_locks.AssetContractHTLC.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setContractid(value); + break; + case 2: + var value = new proto.common.asset_locks.AssetExchangeAgreement; + reader.readMessage(value,proto.common.asset_locks.AssetExchangeAgreement.deserializeBinaryFromReader); + msg.setAgreement(value); + break; + case 3: + var value = new proto.common.asset_locks.AssetLockHTLC; + reader.readMessage(value,proto.common.asset_locks.AssetLockHTLC.deserializeBinaryFromReader); + msg.setLock(value); + break; + case 4: + var value = new proto.common.asset_locks.AssetClaimHTLC; + reader.readMessage(value,proto.common.asset_locks.AssetClaimHTLC.deserializeBinaryFromReader); + msg.setClaim(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.asset_locks.AssetContractHTLC.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.asset_locks.AssetContractHTLC.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.asset_locks.AssetContractHTLC} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.asset_locks.AssetContractHTLC.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getContractid(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getAgreement(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.common.asset_locks.AssetExchangeAgreement.serializeBinaryToWriter + ); + } + f = message.getLock(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.common.asset_locks.AssetLockHTLC.serializeBinaryToWriter + ); + } + f = message.getClaim(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.common.asset_locks.AssetClaimHTLC.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string contractId = 1; + * @return {string} + */ +proto.common.asset_locks.AssetContractHTLC.prototype.getContractid = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.asset_locks.AssetContractHTLC} returns this + */ +proto.common.asset_locks.AssetContractHTLC.prototype.setContractid = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional AssetExchangeAgreement agreement = 2; + * @return {?proto.common.asset_locks.AssetExchangeAgreement} + */ +proto.common.asset_locks.AssetContractHTLC.prototype.getAgreement = function() { + return /** @type{?proto.common.asset_locks.AssetExchangeAgreement} */ ( + jspb.Message.getWrapperField(this, proto.common.asset_locks.AssetExchangeAgreement, 2)); +}; + + +/** + * @param {?proto.common.asset_locks.AssetExchangeAgreement|undefined} value + * @return {!proto.common.asset_locks.AssetContractHTLC} returns this +*/ +proto.common.asset_locks.AssetContractHTLC.prototype.setAgreement = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.common.asset_locks.AssetContractHTLC} returns this + */ +proto.common.asset_locks.AssetContractHTLC.prototype.clearAgreement = function() { + return this.setAgreement(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.common.asset_locks.AssetContractHTLC.prototype.hasAgreement = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional AssetLockHTLC lock = 3; + * @return {?proto.common.asset_locks.AssetLockHTLC} + */ +proto.common.asset_locks.AssetContractHTLC.prototype.getLock = function() { + return /** @type{?proto.common.asset_locks.AssetLockHTLC} */ ( + jspb.Message.getWrapperField(this, proto.common.asset_locks.AssetLockHTLC, 3)); +}; + + +/** + * @param {?proto.common.asset_locks.AssetLockHTLC|undefined} value + * @return {!proto.common.asset_locks.AssetContractHTLC} returns this +*/ +proto.common.asset_locks.AssetContractHTLC.prototype.setLock = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.common.asset_locks.AssetContractHTLC} returns this + */ +proto.common.asset_locks.AssetContractHTLC.prototype.clearLock = function() { + return this.setLock(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.common.asset_locks.AssetContractHTLC.prototype.hasLock = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional AssetClaimHTLC claim = 4; + * @return {?proto.common.asset_locks.AssetClaimHTLC} + */ +proto.common.asset_locks.AssetContractHTLC.prototype.getClaim = function() { + return /** @type{?proto.common.asset_locks.AssetClaimHTLC} */ ( + jspb.Message.getWrapperField(this, proto.common.asset_locks.AssetClaimHTLC, 4)); +}; + + +/** + * @param {?proto.common.asset_locks.AssetClaimHTLC|undefined} value + * @return {!proto.common.asset_locks.AssetContractHTLC} returns this +*/ +proto.common.asset_locks.AssetContractHTLC.prototype.setClaim = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.common.asset_locks.AssetContractHTLC} returns this + */ +proto.common.asset_locks.AssetContractHTLC.prototype.clearClaim = function() { + return this.setClaim(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.common.asset_locks.AssetContractHTLC.prototype.hasClaim = function() { + return jspb.Message.getField(this, 4) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.asset_locks.FungibleAssetContractHTLC.prototype.toObject = function(opt_includeInstance) { + return proto.common.asset_locks.FungibleAssetContractHTLC.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.asset_locks.FungibleAssetContractHTLC} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.asset_locks.FungibleAssetContractHTLC.toObject = function(includeInstance, msg) { + var f, obj = { + contractid: jspb.Message.getFieldWithDefault(msg, 1, ""), + agreement: (f = msg.getAgreement()) && proto.common.asset_locks.FungibleAssetExchangeAgreement.toObject(includeInstance, f), + lock: (f = msg.getLock()) && proto.common.asset_locks.AssetLockHTLC.toObject(includeInstance, f), + claim: (f = msg.getClaim()) && proto.common.asset_locks.AssetClaimHTLC.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.asset_locks.FungibleAssetContractHTLC} + */ +proto.common.asset_locks.FungibleAssetContractHTLC.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.asset_locks.FungibleAssetContractHTLC; + return proto.common.asset_locks.FungibleAssetContractHTLC.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.asset_locks.FungibleAssetContractHTLC} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.asset_locks.FungibleAssetContractHTLC} + */ +proto.common.asset_locks.FungibleAssetContractHTLC.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setContractid(value); + break; + case 2: + var value = new proto.common.asset_locks.FungibleAssetExchangeAgreement; + reader.readMessage(value,proto.common.asset_locks.FungibleAssetExchangeAgreement.deserializeBinaryFromReader); + msg.setAgreement(value); + break; + case 3: + var value = new proto.common.asset_locks.AssetLockHTLC; + reader.readMessage(value,proto.common.asset_locks.AssetLockHTLC.deserializeBinaryFromReader); + msg.setLock(value); + break; + case 4: + var value = new proto.common.asset_locks.AssetClaimHTLC; + reader.readMessage(value,proto.common.asset_locks.AssetClaimHTLC.deserializeBinaryFromReader); + msg.setClaim(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.asset_locks.FungibleAssetContractHTLC.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.asset_locks.FungibleAssetContractHTLC.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.asset_locks.FungibleAssetContractHTLC} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.asset_locks.FungibleAssetContractHTLC.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getContractid(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getAgreement(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.common.asset_locks.FungibleAssetExchangeAgreement.serializeBinaryToWriter + ); + } + f = message.getLock(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.common.asset_locks.AssetLockHTLC.serializeBinaryToWriter + ); + } + f = message.getClaim(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.common.asset_locks.AssetClaimHTLC.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string contractId = 1; + * @return {string} + */ +proto.common.asset_locks.FungibleAssetContractHTLC.prototype.getContractid = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.asset_locks.FungibleAssetContractHTLC} returns this + */ +proto.common.asset_locks.FungibleAssetContractHTLC.prototype.setContractid = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional FungibleAssetExchangeAgreement agreement = 2; + * @return {?proto.common.asset_locks.FungibleAssetExchangeAgreement} + */ +proto.common.asset_locks.FungibleAssetContractHTLC.prototype.getAgreement = function() { + return /** @type{?proto.common.asset_locks.FungibleAssetExchangeAgreement} */ ( + jspb.Message.getWrapperField(this, proto.common.asset_locks.FungibleAssetExchangeAgreement, 2)); +}; + + +/** + * @param {?proto.common.asset_locks.FungibleAssetExchangeAgreement|undefined} value + * @return {!proto.common.asset_locks.FungibleAssetContractHTLC} returns this +*/ +proto.common.asset_locks.FungibleAssetContractHTLC.prototype.setAgreement = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.common.asset_locks.FungibleAssetContractHTLC} returns this + */ +proto.common.asset_locks.FungibleAssetContractHTLC.prototype.clearAgreement = function() { + return this.setAgreement(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.common.asset_locks.FungibleAssetContractHTLC.prototype.hasAgreement = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional AssetLockHTLC lock = 3; + * @return {?proto.common.asset_locks.AssetLockHTLC} + */ +proto.common.asset_locks.FungibleAssetContractHTLC.prototype.getLock = function() { + return /** @type{?proto.common.asset_locks.AssetLockHTLC} */ ( + jspb.Message.getWrapperField(this, proto.common.asset_locks.AssetLockHTLC, 3)); +}; + + +/** + * @param {?proto.common.asset_locks.AssetLockHTLC|undefined} value + * @return {!proto.common.asset_locks.FungibleAssetContractHTLC} returns this +*/ +proto.common.asset_locks.FungibleAssetContractHTLC.prototype.setLock = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.common.asset_locks.FungibleAssetContractHTLC} returns this + */ +proto.common.asset_locks.FungibleAssetContractHTLC.prototype.clearLock = function() { + return this.setLock(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.common.asset_locks.FungibleAssetContractHTLC.prototype.hasLock = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional AssetClaimHTLC claim = 4; + * @return {?proto.common.asset_locks.AssetClaimHTLC} + */ +proto.common.asset_locks.FungibleAssetContractHTLC.prototype.getClaim = function() { + return /** @type{?proto.common.asset_locks.AssetClaimHTLC} */ ( + jspb.Message.getWrapperField(this, proto.common.asset_locks.AssetClaimHTLC, 4)); +}; + + +/** + * @param {?proto.common.asset_locks.AssetClaimHTLC|undefined} value + * @return {!proto.common.asset_locks.FungibleAssetContractHTLC} returns this +*/ +proto.common.asset_locks.FungibleAssetContractHTLC.prototype.setClaim = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.common.asset_locks.FungibleAssetContractHTLC} returns this + */ +proto.common.asset_locks.FungibleAssetContractHTLC.prototype.clearClaim = function() { + return this.setClaim(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.common.asset_locks.FungibleAssetContractHTLC.prototype.hasClaim = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * @enum {number} + */ +proto.common.asset_locks.LockMechanism = { + HTLC: 0 +}; + +/** + * @enum {number} + */ +proto.common.asset_locks.HashMechanism = { + SHA256: 0, + SHA512: 1 +}; + +/** + * @enum {number} + */ +proto.common.asset_locks.TimeSpec = { + EPOCH: 0, + DURATION: 1 +}; + +goog.object.extend(exports, proto.common.asset_locks); diff --git a/weaver/common/protos-js/common/asset_transfer_pb.d.ts b/weaver/common/protos-js/common/asset_transfer_pb.d.ts new file mode 100644 index 00000000000..9aec5590b93 --- /dev/null +++ b/weaver/common/protos-js/common/asset_transfer_pb.d.ts @@ -0,0 +1,81 @@ +// package: common.asset_transfer +// file: common/asset_transfer.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; + +export class AssetPledge extends jspb.Message { + getAssetdetails(): Uint8Array | string; + getAssetdetails_asU8(): Uint8Array; + getAssetdetails_asB64(): string; + setAssetdetails(value: Uint8Array | string): AssetPledge; + getLocalnetworkid(): string; + setLocalnetworkid(value: string): AssetPledge; + getRemotenetworkid(): string; + setRemotenetworkid(value: string): AssetPledge; + getRecipient(): string; + setRecipient(value: string): AssetPledge; + getExpirytimesecs(): number; + setExpirytimesecs(value: number): AssetPledge; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AssetPledge.AsObject; + static toObject(includeInstance: boolean, msg: AssetPledge): AssetPledge.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AssetPledge, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AssetPledge; + static deserializeBinaryFromReader(message: AssetPledge, reader: jspb.BinaryReader): AssetPledge; +} + +export namespace AssetPledge { + export type AsObject = { + assetdetails: Uint8Array | string, + localnetworkid: string, + remotenetworkid: string, + recipient: string, + expirytimesecs: number, + } +} + +export class AssetClaimStatus extends jspb.Message { + getAssetdetails(): Uint8Array | string; + getAssetdetails_asU8(): Uint8Array; + getAssetdetails_asB64(): string; + setAssetdetails(value: Uint8Array | string): AssetClaimStatus; + getLocalnetworkid(): string; + setLocalnetworkid(value: string): AssetClaimStatus; + getRemotenetworkid(): string; + setRemotenetworkid(value: string): AssetClaimStatus; + getRecipient(): string; + setRecipient(value: string): AssetClaimStatus; + getClaimstatus(): boolean; + setClaimstatus(value: boolean): AssetClaimStatus; + getExpirytimesecs(): number; + setExpirytimesecs(value: number): AssetClaimStatus; + getExpirationstatus(): boolean; + setExpirationstatus(value: boolean): AssetClaimStatus; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AssetClaimStatus.AsObject; + static toObject(includeInstance: boolean, msg: AssetClaimStatus): AssetClaimStatus.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AssetClaimStatus, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AssetClaimStatus; + static deserializeBinaryFromReader(message: AssetClaimStatus, reader: jspb.BinaryReader): AssetClaimStatus; +} + +export namespace AssetClaimStatus { + export type AsObject = { + assetdetails: Uint8Array | string, + localnetworkid: string, + remotenetworkid: string, + recipient: string, + claimstatus: boolean, + expirytimesecs: number, + expirationstatus: boolean, + } +} diff --git a/weaver/common/protos-js/common/asset_transfer_pb.js b/weaver/common/protos-js/common/asset_transfer_pb.js new file mode 100644 index 00000000000..3bdfe1fc273 --- /dev/null +++ b/weaver/common/protos-js/common/asset_transfer_pb.js @@ -0,0 +1,676 @@ +// source: common/asset_transfer.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +goog.exportSymbol('proto.common.asset_transfer.AssetClaimStatus', null, global); +goog.exportSymbol('proto.common.asset_transfer.AssetPledge', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.asset_transfer.AssetPledge = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.asset_transfer.AssetPledge, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.asset_transfer.AssetPledge.displayName = 'proto.common.asset_transfer.AssetPledge'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.asset_transfer.AssetClaimStatus = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.asset_transfer.AssetClaimStatus, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.asset_transfer.AssetClaimStatus.displayName = 'proto.common.asset_transfer.AssetClaimStatus'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.asset_transfer.AssetPledge.prototype.toObject = function(opt_includeInstance) { + return proto.common.asset_transfer.AssetPledge.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.asset_transfer.AssetPledge} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.asset_transfer.AssetPledge.toObject = function(includeInstance, msg) { + var f, obj = { + assetdetails: msg.getAssetdetails_asB64(), + localnetworkid: jspb.Message.getFieldWithDefault(msg, 2, ""), + remotenetworkid: jspb.Message.getFieldWithDefault(msg, 3, ""), + recipient: jspb.Message.getFieldWithDefault(msg, 4, ""), + expirytimesecs: jspb.Message.getFieldWithDefault(msg, 5, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.asset_transfer.AssetPledge} + */ +proto.common.asset_transfer.AssetPledge.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.asset_transfer.AssetPledge; + return proto.common.asset_transfer.AssetPledge.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.asset_transfer.AssetPledge} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.asset_transfer.AssetPledge} + */ +proto.common.asset_transfer.AssetPledge.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setAssetdetails(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setLocalnetworkid(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setRemotenetworkid(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setRecipient(value); + break; + case 5: + var value = /** @type {number} */ (reader.readUint64()); + msg.setExpirytimesecs(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.asset_transfer.AssetPledge.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.asset_transfer.AssetPledge.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.asset_transfer.AssetPledge} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.asset_transfer.AssetPledge.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAssetdetails_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getLocalnetworkid(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getRemotenetworkid(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getRecipient(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getExpirytimesecs(); + if (f !== 0) { + writer.writeUint64( + 5, + f + ); + } +}; + + +/** + * optional bytes assetDetails = 1; + * @return {!(string|Uint8Array)} + */ +proto.common.asset_transfer.AssetPledge.prototype.getAssetdetails = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes assetDetails = 1; + * This is a type-conversion wrapper around `getAssetdetails()` + * @return {string} + */ +proto.common.asset_transfer.AssetPledge.prototype.getAssetdetails_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAssetdetails())); +}; + + +/** + * optional bytes assetDetails = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAssetdetails()` + * @return {!Uint8Array} + */ +proto.common.asset_transfer.AssetPledge.prototype.getAssetdetails_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAssetdetails())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.common.asset_transfer.AssetPledge} returns this + */ +proto.common.asset_transfer.AssetPledge.prototype.setAssetdetails = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional string localNetworkID = 2; + * @return {string} + */ +proto.common.asset_transfer.AssetPledge.prototype.getLocalnetworkid = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.asset_transfer.AssetPledge} returns this + */ +proto.common.asset_transfer.AssetPledge.prototype.setLocalnetworkid = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string remoteNetworkID = 3; + * @return {string} + */ +proto.common.asset_transfer.AssetPledge.prototype.getRemotenetworkid = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.asset_transfer.AssetPledge} returns this + */ +proto.common.asset_transfer.AssetPledge.prototype.setRemotenetworkid = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string recipient = 4; + * @return {string} + */ +proto.common.asset_transfer.AssetPledge.prototype.getRecipient = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.asset_transfer.AssetPledge} returns this + */ +proto.common.asset_transfer.AssetPledge.prototype.setRecipient = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional uint64 expiryTimeSecs = 5; + * @return {number} + */ +proto.common.asset_transfer.AssetPledge.prototype.getExpirytimesecs = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.common.asset_transfer.AssetPledge} returns this + */ +proto.common.asset_transfer.AssetPledge.prototype.setExpirytimesecs = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.asset_transfer.AssetClaimStatus.prototype.toObject = function(opt_includeInstance) { + return proto.common.asset_transfer.AssetClaimStatus.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.asset_transfer.AssetClaimStatus} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.asset_transfer.AssetClaimStatus.toObject = function(includeInstance, msg) { + var f, obj = { + assetdetails: msg.getAssetdetails_asB64(), + localnetworkid: jspb.Message.getFieldWithDefault(msg, 2, ""), + remotenetworkid: jspb.Message.getFieldWithDefault(msg, 3, ""), + recipient: jspb.Message.getFieldWithDefault(msg, 4, ""), + claimstatus: jspb.Message.getBooleanFieldWithDefault(msg, 5, false), + expirytimesecs: jspb.Message.getFieldWithDefault(msg, 6, 0), + expirationstatus: jspb.Message.getBooleanFieldWithDefault(msg, 7, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.asset_transfer.AssetClaimStatus} + */ +proto.common.asset_transfer.AssetClaimStatus.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.asset_transfer.AssetClaimStatus; + return proto.common.asset_transfer.AssetClaimStatus.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.asset_transfer.AssetClaimStatus} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.asset_transfer.AssetClaimStatus} + */ +proto.common.asset_transfer.AssetClaimStatus.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setAssetdetails(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setLocalnetworkid(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setRemotenetworkid(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setRecipient(value); + break; + case 5: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setClaimstatus(value); + break; + case 6: + var value = /** @type {number} */ (reader.readUint64()); + msg.setExpirytimesecs(value); + break; + case 7: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setExpirationstatus(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.asset_transfer.AssetClaimStatus.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.asset_transfer.AssetClaimStatus.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.asset_transfer.AssetClaimStatus} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.asset_transfer.AssetClaimStatus.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAssetdetails_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getLocalnetworkid(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getRemotenetworkid(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getRecipient(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getClaimstatus(); + if (f) { + writer.writeBool( + 5, + f + ); + } + f = message.getExpirytimesecs(); + if (f !== 0) { + writer.writeUint64( + 6, + f + ); + } + f = message.getExpirationstatus(); + if (f) { + writer.writeBool( + 7, + f + ); + } +}; + + +/** + * optional bytes assetDetails = 1; + * @return {!(string|Uint8Array)} + */ +proto.common.asset_transfer.AssetClaimStatus.prototype.getAssetdetails = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes assetDetails = 1; + * This is a type-conversion wrapper around `getAssetdetails()` + * @return {string} + */ +proto.common.asset_transfer.AssetClaimStatus.prototype.getAssetdetails_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAssetdetails())); +}; + + +/** + * optional bytes assetDetails = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAssetdetails()` + * @return {!Uint8Array} + */ +proto.common.asset_transfer.AssetClaimStatus.prototype.getAssetdetails_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAssetdetails())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.common.asset_transfer.AssetClaimStatus} returns this + */ +proto.common.asset_transfer.AssetClaimStatus.prototype.setAssetdetails = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional string localNetworkID = 2; + * @return {string} + */ +proto.common.asset_transfer.AssetClaimStatus.prototype.getLocalnetworkid = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.asset_transfer.AssetClaimStatus} returns this + */ +proto.common.asset_transfer.AssetClaimStatus.prototype.setLocalnetworkid = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string remoteNetworkID = 3; + * @return {string} + */ +proto.common.asset_transfer.AssetClaimStatus.prototype.getRemotenetworkid = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.asset_transfer.AssetClaimStatus} returns this + */ +proto.common.asset_transfer.AssetClaimStatus.prototype.setRemotenetworkid = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string recipient = 4; + * @return {string} + */ +proto.common.asset_transfer.AssetClaimStatus.prototype.getRecipient = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.asset_transfer.AssetClaimStatus} returns this + */ +proto.common.asset_transfer.AssetClaimStatus.prototype.setRecipient = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional bool claimStatus = 5; + * @return {boolean} + */ +proto.common.asset_transfer.AssetClaimStatus.prototype.getClaimstatus = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.common.asset_transfer.AssetClaimStatus} returns this + */ +proto.common.asset_transfer.AssetClaimStatus.prototype.setClaimstatus = function(value) { + return jspb.Message.setProto3BooleanField(this, 5, value); +}; + + +/** + * optional uint64 expiryTimeSecs = 6; + * @return {number} + */ +proto.common.asset_transfer.AssetClaimStatus.prototype.getExpirytimesecs = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.common.asset_transfer.AssetClaimStatus} returns this + */ +proto.common.asset_transfer.AssetClaimStatus.prototype.setExpirytimesecs = function(value) { + return jspb.Message.setProto3IntField(this, 6, value); +}; + + +/** + * optional bool expirationStatus = 7; + * @return {boolean} + */ +proto.common.asset_transfer.AssetClaimStatus.prototype.getExpirationstatus = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 7, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.common.asset_transfer.AssetClaimStatus} returns this + */ +proto.common.asset_transfer.AssetClaimStatus.prototype.setExpirationstatus = function(value) { + return jspb.Message.setProto3BooleanField(this, 7, value); +}; + + +goog.object.extend(exports, proto.common.asset_transfer); diff --git a/weaver/common/protos-js/common/events_pb.d.ts b/weaver/common/protos-js/common/events_pb.d.ts new file mode 100644 index 00000000000..7c168bf7a7f --- /dev/null +++ b/weaver/common/protos-js/common/events_pb.d.ts @@ -0,0 +1,270 @@ +// package: common.events +// file: common/events.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; +import * as common_query_pb from "../common/query_pb"; +import * as common_state_pb from "../common/state_pb"; + +export class EventMatcher extends jspb.Message { + getEventType(): EventType; + setEventType(value: EventType): EventMatcher; + getEventClassId(): string; + setEventClassId(value: string): EventMatcher; + getTransactionLedgerId(): string; + setTransactionLedgerId(value: string): EventMatcher; + getTransactionContractId(): string; + setTransactionContractId(value: string): EventMatcher; + getTransactionFunc(): string; + setTransactionFunc(value: string): EventMatcher; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): EventMatcher.AsObject; + static toObject(includeInstance: boolean, msg: EventMatcher): EventMatcher.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: EventMatcher, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): EventMatcher; + static deserializeBinaryFromReader(message: EventMatcher, reader: jspb.BinaryReader): EventMatcher; +} + +export namespace EventMatcher { + export type AsObject = { + eventType: EventType, + eventClassId: string, + transactionLedgerId: string, + transactionContractId: string, + transactionFunc: string, + } +} + +export class EventSubscription extends jspb.Message { + + hasEventMatcher(): boolean; + clearEventMatcher(): void; + getEventMatcher(): EventMatcher | undefined; + setEventMatcher(value?: EventMatcher): EventSubscription; + + hasQuery(): boolean; + clearQuery(): void; + getQuery(): common_query_pb.Query | undefined; + setQuery(value?: common_query_pb.Query): EventSubscription; + getOperation(): EventSubOperation; + setOperation(value: EventSubOperation): EventSubscription; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): EventSubscription.AsObject; + static toObject(includeInstance: boolean, msg: EventSubscription): EventSubscription.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: EventSubscription, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): EventSubscription; + static deserializeBinaryFromReader(message: EventSubscription, reader: jspb.BinaryReader): EventSubscription; +} + +export namespace EventSubscription { + export type AsObject = { + eventMatcher?: EventMatcher.AsObject, + query?: common_query_pb.Query.AsObject, + operation: EventSubOperation, + } +} + +export class EventSubscriptionState extends jspb.Message { + getRequestId(): string; + setRequestId(value: string): EventSubscriptionState; + getPublishingRequestId(): string; + setPublishingRequestId(value: string): EventSubscriptionState; + getStatus(): EventSubscriptionState.STATUS; + setStatus(value: EventSubscriptionState.STATUS): EventSubscriptionState; + getMessage(): string; + setMessage(value: string): EventSubscriptionState; + + hasEventMatcher(): boolean; + clearEventMatcher(): void; + getEventMatcher(): EventMatcher | undefined; + setEventMatcher(value?: EventMatcher): EventSubscriptionState; + clearEventPublicationSpecsList(): void; + getEventPublicationSpecsList(): Array; + setEventPublicationSpecsList(value: Array): EventSubscriptionState; + addEventPublicationSpecs(value?: EventPublication, index?: number): EventPublication; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): EventSubscriptionState.AsObject; + static toObject(includeInstance: boolean, msg: EventSubscriptionState): EventSubscriptionState.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: EventSubscriptionState, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): EventSubscriptionState; + static deserializeBinaryFromReader(message: EventSubscriptionState, reader: jspb.BinaryReader): EventSubscriptionState; +} + +export namespace EventSubscriptionState { + export type AsObject = { + requestId: string, + publishingRequestId: string, + status: EventSubscriptionState.STATUS, + message: string, + eventMatcher?: EventMatcher.AsObject, + eventPublicationSpecsList: Array, + } + + export enum STATUS { + SUBSCRIBE_PENDING_ACK = 0, + SUBSCRIBE_PENDING = 1, + SUBSCRIBED = 2, + UNSUBSCRIBE_PENDING_ACK = 3, + UNSUBSCRIBE_PENDING = 4, + UNSUBSCRIBED = 5, + ERROR = 6, + DUPLICATE_QUERY_SUBSCRIBED = 7, + } + +} + +export class ContractTransaction extends jspb.Message { + getDriverId(): string; + setDriverId(value: string): ContractTransaction; + getLedgerId(): string; + setLedgerId(value: string): ContractTransaction; + getContractId(): string; + setContractId(value: string): ContractTransaction; + getFunc(): string; + setFunc(value: string): ContractTransaction; + clearArgsList(): void; + getArgsList(): Array; + getArgsList_asU8(): Array; + getArgsList_asB64(): Array; + setArgsList(value: Array): ContractTransaction; + addArgs(value: Uint8Array | string, index?: number): Uint8Array | string; + getReplaceArgIndex(): number; + setReplaceArgIndex(value: number): ContractTransaction; + clearMembersList(): void; + getMembersList(): Array; + setMembersList(value: Array): ContractTransaction; + addMembers(value: string, index?: number): string; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ContractTransaction.AsObject; + static toObject(includeInstance: boolean, msg: ContractTransaction): ContractTransaction.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ContractTransaction, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ContractTransaction; + static deserializeBinaryFromReader(message: ContractTransaction, reader: jspb.BinaryReader): ContractTransaction; +} + +export namespace ContractTransaction { + export type AsObject = { + driverId: string, + ledgerId: string, + contractId: string, + func: string, + argsList: Array, + replaceArgIndex: number, + membersList: Array, + } +} + +export class EventPublication extends jspb.Message { + + hasCtx(): boolean; + clearCtx(): void; + getCtx(): ContractTransaction | undefined; + setCtx(value?: ContractTransaction): EventPublication; + + hasAppUrl(): boolean; + clearAppUrl(): void; + getAppUrl(): string; + setAppUrl(value: string): EventPublication; + + getPublicationTargetCase(): EventPublication.PublicationTargetCase; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): EventPublication.AsObject; + static toObject(includeInstance: boolean, msg: EventPublication): EventPublication.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: EventPublication, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): EventPublication; + static deserializeBinaryFromReader(message: EventPublication, reader: jspb.BinaryReader): EventPublication; +} + +export namespace EventPublication { + export type AsObject = { + ctx?: ContractTransaction.AsObject, + appUrl: string, + } + + export enum PublicationTargetCase { + PUBLICATION_TARGET_NOT_SET = 0, + CTX = 1, + APP_URL = 2, + } + +} + +export class EventStates extends jspb.Message { + clearStatesList(): void; + getStatesList(): Array; + setStatesList(value: Array): EventStates; + addStates(value?: EventState, index?: number): EventState; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): EventStates.AsObject; + static toObject(includeInstance: boolean, msg: EventStates): EventStates.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: EventStates, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): EventStates; + static deserializeBinaryFromReader(message: EventStates, reader: jspb.BinaryReader): EventStates; +} + +export namespace EventStates { + export type AsObject = { + statesList: Array, + } +} + +export class EventState extends jspb.Message { + + hasState(): boolean; + clearState(): void; + getState(): common_state_pb.RequestState | undefined; + setState(value?: common_state_pb.RequestState): EventState; + getEventId(): string; + setEventId(value: string): EventState; + getMessage(): string; + setMessage(value: string): EventState; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): EventState.AsObject; + static toObject(includeInstance: boolean, msg: EventState): EventState.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: EventState, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): EventState; + static deserializeBinaryFromReader(message: EventState, reader: jspb.BinaryReader): EventState; +} + +export namespace EventState { + export type AsObject = { + state?: common_state_pb.RequestState.AsObject, + eventId: string, + message: string, + } +} + +export enum EventType { + LEDGER_STATE = 0, + ASSET_LOCK = 1, + ASSET_CLAIM = 2, +} + +export enum EventSubOperation { + SUBSCRIBE = 0, + UNSUBSCRIBE = 1, + UPDATE = 2, +} diff --git a/weaver/common/protos-js/common/events_pb.js b/weaver/common/protos-js/common/events_pb.js new file mode 100644 index 00000000000..e077c1969ec --- /dev/null +++ b/weaver/common/protos-js/common/events_pb.js @@ -0,0 +1,2006 @@ +// source: common/events.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +var common_query_pb = require('../common/query_pb.js'); +goog.object.extend(proto, common_query_pb); +var common_state_pb = require('../common/state_pb.js'); +goog.object.extend(proto, common_state_pb); +goog.exportSymbol('proto.common.events.ContractTransaction', null, global); +goog.exportSymbol('proto.common.events.EventMatcher', null, global); +goog.exportSymbol('proto.common.events.EventPublication', null, global); +goog.exportSymbol('proto.common.events.EventPublication.PublicationTargetCase', null, global); +goog.exportSymbol('proto.common.events.EventState', null, global); +goog.exportSymbol('proto.common.events.EventStates', null, global); +goog.exportSymbol('proto.common.events.EventSubOperation', null, global); +goog.exportSymbol('proto.common.events.EventSubscription', null, global); +goog.exportSymbol('proto.common.events.EventSubscriptionState', null, global); +goog.exportSymbol('proto.common.events.EventSubscriptionState.STATUS', null, global); +goog.exportSymbol('proto.common.events.EventType', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.events.EventMatcher = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.events.EventMatcher, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.events.EventMatcher.displayName = 'proto.common.events.EventMatcher'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.events.EventSubscription = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.events.EventSubscription, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.events.EventSubscription.displayName = 'proto.common.events.EventSubscription'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.events.EventSubscriptionState = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.common.events.EventSubscriptionState.repeatedFields_, null); +}; +goog.inherits(proto.common.events.EventSubscriptionState, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.events.EventSubscriptionState.displayName = 'proto.common.events.EventSubscriptionState'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.events.ContractTransaction = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.common.events.ContractTransaction.repeatedFields_, null); +}; +goog.inherits(proto.common.events.ContractTransaction, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.events.ContractTransaction.displayName = 'proto.common.events.ContractTransaction'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.events.EventPublication = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.common.events.EventPublication.oneofGroups_); +}; +goog.inherits(proto.common.events.EventPublication, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.events.EventPublication.displayName = 'proto.common.events.EventPublication'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.events.EventStates = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.common.events.EventStates.repeatedFields_, null); +}; +goog.inherits(proto.common.events.EventStates, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.events.EventStates.displayName = 'proto.common.events.EventStates'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.events.EventState = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.events.EventState, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.events.EventState.displayName = 'proto.common.events.EventState'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.events.EventMatcher.prototype.toObject = function(opt_includeInstance) { + return proto.common.events.EventMatcher.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.events.EventMatcher} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.events.EventMatcher.toObject = function(includeInstance, msg) { + var f, obj = { + eventType: jspb.Message.getFieldWithDefault(msg, 1, 0), + eventClassId: jspb.Message.getFieldWithDefault(msg, 2, ""), + transactionLedgerId: jspb.Message.getFieldWithDefault(msg, 3, ""), + transactionContractId: jspb.Message.getFieldWithDefault(msg, 4, ""), + transactionFunc: jspb.Message.getFieldWithDefault(msg, 5, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.events.EventMatcher} + */ +proto.common.events.EventMatcher.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.events.EventMatcher; + return proto.common.events.EventMatcher.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.events.EventMatcher} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.events.EventMatcher} + */ +proto.common.events.EventMatcher.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.common.events.EventType} */ (reader.readEnum()); + msg.setEventType(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setEventClassId(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setTransactionLedgerId(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setTransactionContractId(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setTransactionFunc(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.events.EventMatcher.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.events.EventMatcher.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.events.EventMatcher} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.events.EventMatcher.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getEventType(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getEventClassId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getTransactionLedgerId(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getTransactionContractId(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getTransactionFunc(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } +}; + + +/** + * optional EventType event_type = 1; + * @return {!proto.common.events.EventType} + */ +proto.common.events.EventMatcher.prototype.getEventType = function() { + return /** @type {!proto.common.events.EventType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.common.events.EventType} value + * @return {!proto.common.events.EventMatcher} returns this + */ +proto.common.events.EventMatcher.prototype.setEventType = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional string event_class_id = 2; + * @return {string} + */ +proto.common.events.EventMatcher.prototype.getEventClassId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.events.EventMatcher} returns this + */ +proto.common.events.EventMatcher.prototype.setEventClassId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string transaction_ledger_id = 3; + * @return {string} + */ +proto.common.events.EventMatcher.prototype.getTransactionLedgerId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.events.EventMatcher} returns this + */ +proto.common.events.EventMatcher.prototype.setTransactionLedgerId = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string transaction_contract_id = 4; + * @return {string} + */ +proto.common.events.EventMatcher.prototype.getTransactionContractId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.events.EventMatcher} returns this + */ +proto.common.events.EventMatcher.prototype.setTransactionContractId = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string transaction_func = 5; + * @return {string} + */ +proto.common.events.EventMatcher.prototype.getTransactionFunc = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.events.EventMatcher} returns this + */ +proto.common.events.EventMatcher.prototype.setTransactionFunc = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.events.EventSubscription.prototype.toObject = function(opt_includeInstance) { + return proto.common.events.EventSubscription.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.events.EventSubscription} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.events.EventSubscription.toObject = function(includeInstance, msg) { + var f, obj = { + eventMatcher: (f = msg.getEventMatcher()) && proto.common.events.EventMatcher.toObject(includeInstance, f), + query: (f = msg.getQuery()) && common_query_pb.Query.toObject(includeInstance, f), + operation: jspb.Message.getFieldWithDefault(msg, 3, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.events.EventSubscription} + */ +proto.common.events.EventSubscription.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.events.EventSubscription; + return proto.common.events.EventSubscription.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.events.EventSubscription} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.events.EventSubscription} + */ +proto.common.events.EventSubscription.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.common.events.EventMatcher; + reader.readMessage(value,proto.common.events.EventMatcher.deserializeBinaryFromReader); + msg.setEventMatcher(value); + break; + case 2: + var value = new common_query_pb.Query; + reader.readMessage(value,common_query_pb.Query.deserializeBinaryFromReader); + msg.setQuery(value); + break; + case 3: + var value = /** @type {!proto.common.events.EventSubOperation} */ (reader.readEnum()); + msg.setOperation(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.events.EventSubscription.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.events.EventSubscription.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.events.EventSubscription} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.events.EventSubscription.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getEventMatcher(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.common.events.EventMatcher.serializeBinaryToWriter + ); + } + f = message.getQuery(); + if (f != null) { + writer.writeMessage( + 2, + f, + common_query_pb.Query.serializeBinaryToWriter + ); + } + f = message.getOperation(); + if (f !== 0.0) { + writer.writeEnum( + 3, + f + ); + } +}; + + +/** + * optional EventMatcher event_matcher = 1; + * @return {?proto.common.events.EventMatcher} + */ +proto.common.events.EventSubscription.prototype.getEventMatcher = function() { + return /** @type{?proto.common.events.EventMatcher} */ ( + jspb.Message.getWrapperField(this, proto.common.events.EventMatcher, 1)); +}; + + +/** + * @param {?proto.common.events.EventMatcher|undefined} value + * @return {!proto.common.events.EventSubscription} returns this +*/ +proto.common.events.EventSubscription.prototype.setEventMatcher = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.common.events.EventSubscription} returns this + */ +proto.common.events.EventSubscription.prototype.clearEventMatcher = function() { + return this.setEventMatcher(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.common.events.EventSubscription.prototype.hasEventMatcher = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional common.query.Query query = 2; + * @return {?proto.common.query.Query} + */ +proto.common.events.EventSubscription.prototype.getQuery = function() { + return /** @type{?proto.common.query.Query} */ ( + jspb.Message.getWrapperField(this, common_query_pb.Query, 2)); +}; + + +/** + * @param {?proto.common.query.Query|undefined} value + * @return {!proto.common.events.EventSubscription} returns this +*/ +proto.common.events.EventSubscription.prototype.setQuery = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.common.events.EventSubscription} returns this + */ +proto.common.events.EventSubscription.prototype.clearQuery = function() { + return this.setQuery(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.common.events.EventSubscription.prototype.hasQuery = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional EventSubOperation operation = 3; + * @return {!proto.common.events.EventSubOperation} + */ +proto.common.events.EventSubscription.prototype.getOperation = function() { + return /** @type {!proto.common.events.EventSubOperation} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {!proto.common.events.EventSubOperation} value + * @return {!proto.common.events.EventSubscription} returns this + */ +proto.common.events.EventSubscription.prototype.setOperation = function(value) { + return jspb.Message.setProto3EnumField(this, 3, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.common.events.EventSubscriptionState.repeatedFields_ = [6]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.events.EventSubscriptionState.prototype.toObject = function(opt_includeInstance) { + return proto.common.events.EventSubscriptionState.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.events.EventSubscriptionState} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.events.EventSubscriptionState.toObject = function(includeInstance, msg) { + var f, obj = { + requestId: jspb.Message.getFieldWithDefault(msg, 1, ""), + publishingRequestId: jspb.Message.getFieldWithDefault(msg, 2, ""), + status: jspb.Message.getFieldWithDefault(msg, 3, 0), + message: jspb.Message.getFieldWithDefault(msg, 4, ""), + eventMatcher: (f = msg.getEventMatcher()) && proto.common.events.EventMatcher.toObject(includeInstance, f), + eventPublicationSpecsList: jspb.Message.toObjectList(msg.getEventPublicationSpecsList(), + proto.common.events.EventPublication.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.events.EventSubscriptionState} + */ +proto.common.events.EventSubscriptionState.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.events.EventSubscriptionState; + return proto.common.events.EventSubscriptionState.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.events.EventSubscriptionState} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.events.EventSubscriptionState} + */ +proto.common.events.EventSubscriptionState.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setRequestId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setPublishingRequestId(value); + break; + case 3: + var value = /** @type {!proto.common.events.EventSubscriptionState.STATUS} */ (reader.readEnum()); + msg.setStatus(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setMessage(value); + break; + case 5: + var value = new proto.common.events.EventMatcher; + reader.readMessage(value,proto.common.events.EventMatcher.deserializeBinaryFromReader); + msg.setEventMatcher(value); + break; + case 6: + var value = new proto.common.events.EventPublication; + reader.readMessage(value,proto.common.events.EventPublication.deserializeBinaryFromReader); + msg.addEventPublicationSpecs(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.events.EventSubscriptionState.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.events.EventSubscriptionState.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.events.EventSubscriptionState} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.events.EventSubscriptionState.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRequestId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getPublishingRequestId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getStatus(); + if (f !== 0.0) { + writer.writeEnum( + 3, + f + ); + } + f = message.getMessage(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getEventMatcher(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.common.events.EventMatcher.serializeBinaryToWriter + ); + } + f = message.getEventPublicationSpecsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 6, + f, + proto.common.events.EventPublication.serializeBinaryToWriter + ); + } +}; + + +/** + * @enum {number} + */ +proto.common.events.EventSubscriptionState.STATUS = { + SUBSCRIBE_PENDING_ACK: 0, + SUBSCRIBE_PENDING: 1, + SUBSCRIBED: 2, + UNSUBSCRIBE_PENDING_ACK: 3, + UNSUBSCRIBE_PENDING: 4, + UNSUBSCRIBED: 5, + ERROR: 6, + DUPLICATE_QUERY_SUBSCRIBED: 7 +}; + +/** + * optional string request_id = 1; + * @return {string} + */ +proto.common.events.EventSubscriptionState.prototype.getRequestId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.events.EventSubscriptionState} returns this + */ +proto.common.events.EventSubscriptionState.prototype.setRequestId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string publishing_request_id = 2; + * @return {string} + */ +proto.common.events.EventSubscriptionState.prototype.getPublishingRequestId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.events.EventSubscriptionState} returns this + */ +proto.common.events.EventSubscriptionState.prototype.setPublishingRequestId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional STATUS status = 3; + * @return {!proto.common.events.EventSubscriptionState.STATUS} + */ +proto.common.events.EventSubscriptionState.prototype.getStatus = function() { + return /** @type {!proto.common.events.EventSubscriptionState.STATUS} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {!proto.common.events.EventSubscriptionState.STATUS} value + * @return {!proto.common.events.EventSubscriptionState} returns this + */ +proto.common.events.EventSubscriptionState.prototype.setStatus = function(value) { + return jspb.Message.setProto3EnumField(this, 3, value); +}; + + +/** + * optional string message = 4; + * @return {string} + */ +proto.common.events.EventSubscriptionState.prototype.getMessage = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.events.EventSubscriptionState} returns this + */ +proto.common.events.EventSubscriptionState.prototype.setMessage = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional EventMatcher event_matcher = 5; + * @return {?proto.common.events.EventMatcher} + */ +proto.common.events.EventSubscriptionState.prototype.getEventMatcher = function() { + return /** @type{?proto.common.events.EventMatcher} */ ( + jspb.Message.getWrapperField(this, proto.common.events.EventMatcher, 5)); +}; + + +/** + * @param {?proto.common.events.EventMatcher|undefined} value + * @return {!proto.common.events.EventSubscriptionState} returns this +*/ +proto.common.events.EventSubscriptionState.prototype.setEventMatcher = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.common.events.EventSubscriptionState} returns this + */ +proto.common.events.EventSubscriptionState.prototype.clearEventMatcher = function() { + return this.setEventMatcher(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.common.events.EventSubscriptionState.prototype.hasEventMatcher = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * repeated EventPublication event_publication_specs = 6; + * @return {!Array} + */ +proto.common.events.EventSubscriptionState.prototype.getEventPublicationSpecsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.common.events.EventPublication, 6)); +}; + + +/** + * @param {!Array} value + * @return {!proto.common.events.EventSubscriptionState} returns this +*/ +proto.common.events.EventSubscriptionState.prototype.setEventPublicationSpecsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 6, value); +}; + + +/** + * @param {!proto.common.events.EventPublication=} opt_value + * @param {number=} opt_index + * @return {!proto.common.events.EventPublication} + */ +proto.common.events.EventSubscriptionState.prototype.addEventPublicationSpecs = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 6, opt_value, proto.common.events.EventPublication, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.common.events.EventSubscriptionState} returns this + */ +proto.common.events.EventSubscriptionState.prototype.clearEventPublicationSpecsList = function() { + return this.setEventPublicationSpecsList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.common.events.ContractTransaction.repeatedFields_ = [5,7]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.events.ContractTransaction.prototype.toObject = function(opt_includeInstance) { + return proto.common.events.ContractTransaction.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.events.ContractTransaction} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.events.ContractTransaction.toObject = function(includeInstance, msg) { + var f, obj = { + driverId: jspb.Message.getFieldWithDefault(msg, 1, ""), + ledgerId: jspb.Message.getFieldWithDefault(msg, 2, ""), + contractId: jspb.Message.getFieldWithDefault(msg, 3, ""), + func: jspb.Message.getFieldWithDefault(msg, 4, ""), + argsList: msg.getArgsList_asB64(), + replaceArgIndex: jspb.Message.getFieldWithDefault(msg, 6, 0), + membersList: (f = jspb.Message.getRepeatedField(msg, 7)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.events.ContractTransaction} + */ +proto.common.events.ContractTransaction.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.events.ContractTransaction; + return proto.common.events.ContractTransaction.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.events.ContractTransaction} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.events.ContractTransaction} + */ +proto.common.events.ContractTransaction.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setDriverId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setLedgerId(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setContractId(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setFunc(value); + break; + case 5: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addArgs(value); + break; + case 6: + var value = /** @type {number} */ (reader.readUint64()); + msg.setReplaceArgIndex(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.addMembers(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.events.ContractTransaction.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.events.ContractTransaction.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.events.ContractTransaction} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.events.ContractTransaction.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDriverId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getLedgerId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getContractId(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getFunc(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getArgsList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 5, + f + ); + } + f = message.getReplaceArgIndex(); + if (f !== 0) { + writer.writeUint64( + 6, + f + ); + } + f = message.getMembersList(); + if (f.length > 0) { + writer.writeRepeatedString( + 7, + f + ); + } +}; + + +/** + * optional string driver_id = 1; + * @return {string} + */ +proto.common.events.ContractTransaction.prototype.getDriverId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.events.ContractTransaction} returns this + */ +proto.common.events.ContractTransaction.prototype.setDriverId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string ledger_id = 2; + * @return {string} + */ +proto.common.events.ContractTransaction.prototype.getLedgerId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.events.ContractTransaction} returns this + */ +proto.common.events.ContractTransaction.prototype.setLedgerId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string contract_id = 3; + * @return {string} + */ +proto.common.events.ContractTransaction.prototype.getContractId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.events.ContractTransaction} returns this + */ +proto.common.events.ContractTransaction.prototype.setContractId = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string func = 4; + * @return {string} + */ +proto.common.events.ContractTransaction.prototype.getFunc = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.events.ContractTransaction} returns this + */ +proto.common.events.ContractTransaction.prototype.setFunc = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * repeated bytes args = 5; + * @return {!(Array|Array)} + */ +proto.common.events.ContractTransaction.prototype.getArgsList = function() { + return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 5)); +}; + + +/** + * repeated bytes args = 5; + * This is a type-conversion wrapper around `getArgsList()` + * @return {!Array} + */ +proto.common.events.ContractTransaction.prototype.getArgsList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getArgsList())); +}; + + +/** + * repeated bytes args = 5; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getArgsList()` + * @return {!Array} + */ +proto.common.events.ContractTransaction.prototype.getArgsList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getArgsList())); +}; + + +/** + * @param {!(Array|Array)} value + * @return {!proto.common.events.ContractTransaction} returns this + */ +proto.common.events.ContractTransaction.prototype.setArgsList = function(value) { + return jspb.Message.setField(this, 5, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.common.events.ContractTransaction} returns this + */ +proto.common.events.ContractTransaction.prototype.addArgs = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 5, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.common.events.ContractTransaction} returns this + */ +proto.common.events.ContractTransaction.prototype.clearArgsList = function() { + return this.setArgsList([]); +}; + + +/** + * optional uint64 replace_arg_index = 6; + * @return {number} + */ +proto.common.events.ContractTransaction.prototype.getReplaceArgIndex = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.common.events.ContractTransaction} returns this + */ +proto.common.events.ContractTransaction.prototype.setReplaceArgIndex = function(value) { + return jspb.Message.setProto3IntField(this, 6, value); +}; + + +/** + * repeated string members = 7; + * @return {!Array} + */ +proto.common.events.ContractTransaction.prototype.getMembersList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 7)); +}; + + +/** + * @param {!Array} value + * @return {!proto.common.events.ContractTransaction} returns this + */ +proto.common.events.ContractTransaction.prototype.setMembersList = function(value) { + return jspb.Message.setField(this, 7, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.common.events.ContractTransaction} returns this + */ +proto.common.events.ContractTransaction.prototype.addMembers = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 7, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.common.events.ContractTransaction} returns this + */ +proto.common.events.ContractTransaction.prototype.clearMembersList = function() { + return this.setMembersList([]); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.common.events.EventPublication.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.common.events.EventPublication.PublicationTargetCase = { + PUBLICATION_TARGET_NOT_SET: 0, + CTX: 1, + APP_URL: 2 +}; + +/** + * @return {proto.common.events.EventPublication.PublicationTargetCase} + */ +proto.common.events.EventPublication.prototype.getPublicationTargetCase = function() { + return /** @type {proto.common.events.EventPublication.PublicationTargetCase} */(jspb.Message.computeOneofCase(this, proto.common.events.EventPublication.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.events.EventPublication.prototype.toObject = function(opt_includeInstance) { + return proto.common.events.EventPublication.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.events.EventPublication} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.events.EventPublication.toObject = function(includeInstance, msg) { + var f, obj = { + ctx: (f = msg.getCtx()) && proto.common.events.ContractTransaction.toObject(includeInstance, f), + appUrl: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.events.EventPublication} + */ +proto.common.events.EventPublication.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.events.EventPublication; + return proto.common.events.EventPublication.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.events.EventPublication} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.events.EventPublication} + */ +proto.common.events.EventPublication.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.common.events.ContractTransaction; + reader.readMessage(value,proto.common.events.ContractTransaction.deserializeBinaryFromReader); + msg.setCtx(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setAppUrl(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.events.EventPublication.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.events.EventPublication.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.events.EventPublication} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.events.EventPublication.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getCtx(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.common.events.ContractTransaction.serializeBinaryToWriter + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional ContractTransaction ctx = 1; + * @return {?proto.common.events.ContractTransaction} + */ +proto.common.events.EventPublication.prototype.getCtx = function() { + return /** @type{?proto.common.events.ContractTransaction} */ ( + jspb.Message.getWrapperField(this, proto.common.events.ContractTransaction, 1)); +}; + + +/** + * @param {?proto.common.events.ContractTransaction|undefined} value + * @return {!proto.common.events.EventPublication} returns this +*/ +proto.common.events.EventPublication.prototype.setCtx = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.common.events.EventPublication.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.common.events.EventPublication} returns this + */ +proto.common.events.EventPublication.prototype.clearCtx = function() { + return this.setCtx(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.common.events.EventPublication.prototype.hasCtx = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional string app_url = 2; + * @return {string} + */ +proto.common.events.EventPublication.prototype.getAppUrl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.events.EventPublication} returns this + */ +proto.common.events.EventPublication.prototype.setAppUrl = function(value) { + return jspb.Message.setOneofField(this, 2, proto.common.events.EventPublication.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.common.events.EventPublication} returns this + */ +proto.common.events.EventPublication.prototype.clearAppUrl = function() { + return jspb.Message.setOneofField(this, 2, proto.common.events.EventPublication.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.common.events.EventPublication.prototype.hasAppUrl = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.common.events.EventStates.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.events.EventStates.prototype.toObject = function(opt_includeInstance) { + return proto.common.events.EventStates.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.events.EventStates} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.events.EventStates.toObject = function(includeInstance, msg) { + var f, obj = { + statesList: jspb.Message.toObjectList(msg.getStatesList(), + proto.common.events.EventState.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.events.EventStates} + */ +proto.common.events.EventStates.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.events.EventStates; + return proto.common.events.EventStates.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.events.EventStates} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.events.EventStates} + */ +proto.common.events.EventStates.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.common.events.EventState; + reader.readMessage(value,proto.common.events.EventState.deserializeBinaryFromReader); + msg.addStates(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.events.EventStates.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.events.EventStates.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.events.EventStates} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.events.EventStates.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStatesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.common.events.EventState.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated EventState states = 1; + * @return {!Array} + */ +proto.common.events.EventStates.prototype.getStatesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.common.events.EventState, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.common.events.EventStates} returns this +*/ +proto.common.events.EventStates.prototype.setStatesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.common.events.EventState=} opt_value + * @param {number=} opt_index + * @return {!proto.common.events.EventState} + */ +proto.common.events.EventStates.prototype.addStates = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.common.events.EventState, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.common.events.EventStates} returns this + */ +proto.common.events.EventStates.prototype.clearStatesList = function() { + return this.setStatesList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.events.EventState.prototype.toObject = function(opt_includeInstance) { + return proto.common.events.EventState.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.events.EventState} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.events.EventState.toObject = function(includeInstance, msg) { + var f, obj = { + state: (f = msg.getState()) && common_state_pb.RequestState.toObject(includeInstance, f), + eventId: jspb.Message.getFieldWithDefault(msg, 2, ""), + message: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.events.EventState} + */ +proto.common.events.EventState.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.events.EventState; + return proto.common.events.EventState.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.events.EventState} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.events.EventState} + */ +proto.common.events.EventState.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new common_state_pb.RequestState; + reader.readMessage(value,common_state_pb.RequestState.deserializeBinaryFromReader); + msg.setState(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setEventId(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setMessage(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.events.EventState.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.events.EventState.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.events.EventState} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.events.EventState.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getState(); + if (f != null) { + writer.writeMessage( + 1, + f, + common_state_pb.RequestState.serializeBinaryToWriter + ); + } + f = message.getEventId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getMessage(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional common.state.RequestState state = 1; + * @return {?proto.common.state.RequestState} + */ +proto.common.events.EventState.prototype.getState = function() { + return /** @type{?proto.common.state.RequestState} */ ( + jspb.Message.getWrapperField(this, common_state_pb.RequestState, 1)); +}; + + +/** + * @param {?proto.common.state.RequestState|undefined} value + * @return {!proto.common.events.EventState} returns this +*/ +proto.common.events.EventState.prototype.setState = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.common.events.EventState} returns this + */ +proto.common.events.EventState.prototype.clearState = function() { + return this.setState(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.common.events.EventState.prototype.hasState = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional string event_id = 2; + * @return {string} + */ +proto.common.events.EventState.prototype.getEventId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.events.EventState} returns this + */ +proto.common.events.EventState.prototype.setEventId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string message = 3; + * @return {string} + */ +proto.common.events.EventState.prototype.getMessage = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.events.EventState} returns this + */ +proto.common.events.EventState.prototype.setMessage = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * @enum {number} + */ +proto.common.events.EventType = { + LEDGER_STATE: 0, + ASSET_LOCK: 1, + ASSET_CLAIM: 2 +}; + +/** + * @enum {number} + */ +proto.common.events.EventSubOperation = { + SUBSCRIBE: 0, + UNSUBSCRIBE: 1, + UPDATE: 2 +}; + +goog.object.extend(exports, proto.common.events); diff --git a/weaver/common/protos-js/common/interop_payload_pb.d.ts b/weaver/common/protos-js/common/interop_payload_pb.d.ts new file mode 100644 index 00000000000..99572e5ca33 --- /dev/null +++ b/weaver/common/protos-js/common/interop_payload_pb.d.ts @@ -0,0 +1,103 @@ +// package: common.interop_payload +// file: common/interop_payload.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; + +export class InteropPayload extends jspb.Message { + getPayload(): Uint8Array | string; + getPayload_asU8(): Uint8Array; + getPayload_asB64(): string; + setPayload(value: Uint8Array | string): InteropPayload; + getAddress(): string; + setAddress(value: string): InteropPayload; + getConfidential(): boolean; + setConfidential(value: boolean): InteropPayload; + getRequestorCertificate(): string; + setRequestorCertificate(value: string): InteropPayload; + getNonce(): string; + setNonce(value: string): InteropPayload; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): InteropPayload.AsObject; + static toObject(includeInstance: boolean, msg: InteropPayload): InteropPayload.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: InteropPayload, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): InteropPayload; + static deserializeBinaryFromReader(message: InteropPayload, reader: jspb.BinaryReader): InteropPayload; +} + +export namespace InteropPayload { + export type AsObject = { + payload: Uint8Array | string, + address: string, + confidential: boolean, + requestorCertificate: string, + nonce: string, + } +} + +export class ConfidentialPayload extends jspb.Message { + getEncryptedPayload(): Uint8Array | string; + getEncryptedPayload_asU8(): Uint8Array; + getEncryptedPayload_asB64(): string; + setEncryptedPayload(value: Uint8Array | string): ConfidentialPayload; + getHashType(): ConfidentialPayload.HashType; + setHashType(value: ConfidentialPayload.HashType): ConfidentialPayload; + getHash(): Uint8Array | string; + getHash_asU8(): Uint8Array; + getHash_asB64(): string; + setHash(value: Uint8Array | string): ConfidentialPayload; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ConfidentialPayload.AsObject; + static toObject(includeInstance: boolean, msg: ConfidentialPayload): ConfidentialPayload.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ConfidentialPayload, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ConfidentialPayload; + static deserializeBinaryFromReader(message: ConfidentialPayload, reader: jspb.BinaryReader): ConfidentialPayload; +} + +export namespace ConfidentialPayload { + export type AsObject = { + encryptedPayload: Uint8Array | string, + hashType: ConfidentialPayload.HashType, + hash: Uint8Array | string, + } + + export enum HashType { + HMAC = 0, + } + +} + +export class ConfidentialPayloadContents extends jspb.Message { + getPayload(): Uint8Array | string; + getPayload_asU8(): Uint8Array; + getPayload_asB64(): string; + setPayload(value: Uint8Array | string): ConfidentialPayloadContents; + getRandom(): Uint8Array | string; + getRandom_asU8(): Uint8Array; + getRandom_asB64(): string; + setRandom(value: Uint8Array | string): ConfidentialPayloadContents; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ConfidentialPayloadContents.AsObject; + static toObject(includeInstance: boolean, msg: ConfidentialPayloadContents): ConfidentialPayloadContents.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ConfidentialPayloadContents, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ConfidentialPayloadContents; + static deserializeBinaryFromReader(message: ConfidentialPayloadContents, reader: jspb.BinaryReader): ConfidentialPayloadContents; +} + +export namespace ConfidentialPayloadContents { + export type AsObject = { + payload: Uint8Array | string, + random: Uint8Array | string, + } +} diff --git a/weaver/common/protos-js/common/interop_payload_pb.js b/weaver/common/protos-js/common/interop_payload_pb.js new file mode 100644 index 00000000000..4cd36152032 --- /dev/null +++ b/weaver/common/protos-js/common/interop_payload_pb.js @@ -0,0 +1,818 @@ +// source: common/interop_payload.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +goog.exportSymbol('proto.common.interop_payload.ConfidentialPayload', null, global); +goog.exportSymbol('proto.common.interop_payload.ConfidentialPayload.HashType', null, global); +goog.exportSymbol('proto.common.interop_payload.ConfidentialPayloadContents', null, global); +goog.exportSymbol('proto.common.interop_payload.InteropPayload', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.interop_payload.InteropPayload = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.interop_payload.InteropPayload, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.interop_payload.InteropPayload.displayName = 'proto.common.interop_payload.InteropPayload'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.interop_payload.ConfidentialPayload = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.interop_payload.ConfidentialPayload, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.interop_payload.ConfidentialPayload.displayName = 'proto.common.interop_payload.ConfidentialPayload'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.interop_payload.ConfidentialPayloadContents = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.interop_payload.ConfidentialPayloadContents, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.interop_payload.ConfidentialPayloadContents.displayName = 'proto.common.interop_payload.ConfidentialPayloadContents'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.interop_payload.InteropPayload.prototype.toObject = function(opt_includeInstance) { + return proto.common.interop_payload.InteropPayload.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.interop_payload.InteropPayload} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.interop_payload.InteropPayload.toObject = function(includeInstance, msg) { + var f, obj = { + payload: msg.getPayload_asB64(), + address: jspb.Message.getFieldWithDefault(msg, 2, ""), + confidential: jspb.Message.getBooleanFieldWithDefault(msg, 3, false), + requestorCertificate: jspb.Message.getFieldWithDefault(msg, 4, ""), + nonce: jspb.Message.getFieldWithDefault(msg, 5, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.interop_payload.InteropPayload} + */ +proto.common.interop_payload.InteropPayload.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.interop_payload.InteropPayload; + return proto.common.interop_payload.InteropPayload.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.interop_payload.InteropPayload} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.interop_payload.InteropPayload} + */ +proto.common.interop_payload.InteropPayload.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setPayload(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setAddress(value); + break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setConfidential(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setRequestorCertificate(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setNonce(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.interop_payload.InteropPayload.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.interop_payload.InteropPayload.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.interop_payload.InteropPayload} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.interop_payload.InteropPayload.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPayload_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getAddress(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getConfidential(); + if (f) { + writer.writeBool( + 3, + f + ); + } + f = message.getRequestorCertificate(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getNonce(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } +}; + + +/** + * optional bytes payload = 1; + * @return {!(string|Uint8Array)} + */ +proto.common.interop_payload.InteropPayload.prototype.getPayload = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes payload = 1; + * This is a type-conversion wrapper around `getPayload()` + * @return {string} + */ +proto.common.interop_payload.InteropPayload.prototype.getPayload_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPayload())); +}; + + +/** + * optional bytes payload = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPayload()` + * @return {!Uint8Array} + */ +proto.common.interop_payload.InteropPayload.prototype.getPayload_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPayload())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.common.interop_payload.InteropPayload} returns this + */ +proto.common.interop_payload.InteropPayload.prototype.setPayload = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional string address = 2; + * @return {string} + */ +proto.common.interop_payload.InteropPayload.prototype.getAddress = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.interop_payload.InteropPayload} returns this + */ +proto.common.interop_payload.InteropPayload.prototype.setAddress = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional bool confidential = 3; + * @return {boolean} + */ +proto.common.interop_payload.InteropPayload.prototype.getConfidential = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.common.interop_payload.InteropPayload} returns this + */ +proto.common.interop_payload.InteropPayload.prototype.setConfidential = function(value) { + return jspb.Message.setProto3BooleanField(this, 3, value); +}; + + +/** + * optional string requestor_certificate = 4; + * @return {string} + */ +proto.common.interop_payload.InteropPayload.prototype.getRequestorCertificate = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.interop_payload.InteropPayload} returns this + */ +proto.common.interop_payload.InteropPayload.prototype.setRequestorCertificate = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string nonce = 5; + * @return {string} + */ +proto.common.interop_payload.InteropPayload.prototype.getNonce = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.interop_payload.InteropPayload} returns this + */ +proto.common.interop_payload.InteropPayload.prototype.setNonce = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.interop_payload.ConfidentialPayload.prototype.toObject = function(opt_includeInstance) { + return proto.common.interop_payload.ConfidentialPayload.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.interop_payload.ConfidentialPayload} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.interop_payload.ConfidentialPayload.toObject = function(includeInstance, msg) { + var f, obj = { + encryptedPayload: msg.getEncryptedPayload_asB64(), + hashType: jspb.Message.getFieldWithDefault(msg, 2, 0), + hash: msg.getHash_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.interop_payload.ConfidentialPayload} + */ +proto.common.interop_payload.ConfidentialPayload.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.interop_payload.ConfidentialPayload; + return proto.common.interop_payload.ConfidentialPayload.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.interop_payload.ConfidentialPayload} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.interop_payload.ConfidentialPayload} + */ +proto.common.interop_payload.ConfidentialPayload.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setEncryptedPayload(value); + break; + case 2: + var value = /** @type {!proto.common.interop_payload.ConfidentialPayload.HashType} */ (reader.readEnum()); + msg.setHashType(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setHash(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.interop_payload.ConfidentialPayload.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.interop_payload.ConfidentialPayload.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.interop_payload.ConfidentialPayload} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.interop_payload.ConfidentialPayload.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getEncryptedPayload_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getHashType(); + if (f !== 0.0) { + writer.writeEnum( + 2, + f + ); + } + f = message.getHash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.common.interop_payload.ConfidentialPayload.HashType = { + HMAC: 0 +}; + +/** + * optional bytes encrypted_payload = 1; + * @return {!(string|Uint8Array)} + */ +proto.common.interop_payload.ConfidentialPayload.prototype.getEncryptedPayload = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes encrypted_payload = 1; + * This is a type-conversion wrapper around `getEncryptedPayload()` + * @return {string} + */ +proto.common.interop_payload.ConfidentialPayload.prototype.getEncryptedPayload_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getEncryptedPayload())); +}; + + +/** + * optional bytes encrypted_payload = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getEncryptedPayload()` + * @return {!Uint8Array} + */ +proto.common.interop_payload.ConfidentialPayload.prototype.getEncryptedPayload_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getEncryptedPayload())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.common.interop_payload.ConfidentialPayload} returns this + */ +proto.common.interop_payload.ConfidentialPayload.prototype.setEncryptedPayload = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional HashType hash_type = 2; + * @return {!proto.common.interop_payload.ConfidentialPayload.HashType} + */ +proto.common.interop_payload.ConfidentialPayload.prototype.getHashType = function() { + return /** @type {!proto.common.interop_payload.ConfidentialPayload.HashType} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {!proto.common.interop_payload.ConfidentialPayload.HashType} value + * @return {!proto.common.interop_payload.ConfidentialPayload} returns this + */ +proto.common.interop_payload.ConfidentialPayload.prototype.setHashType = function(value) { + return jspb.Message.setProto3EnumField(this, 2, value); +}; + + +/** + * optional bytes hash = 3; + * @return {!(string|Uint8Array)} + */ +proto.common.interop_payload.ConfidentialPayload.prototype.getHash = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes hash = 3; + * This is a type-conversion wrapper around `getHash()` + * @return {string} + */ +proto.common.interop_payload.ConfidentialPayload.prototype.getHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getHash())); +}; + + +/** + * optional bytes hash = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getHash()` + * @return {!Uint8Array} + */ +proto.common.interop_payload.ConfidentialPayload.prototype.getHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getHash())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.common.interop_payload.ConfidentialPayload} returns this + */ +proto.common.interop_payload.ConfidentialPayload.prototype.setHash = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.interop_payload.ConfidentialPayloadContents.prototype.toObject = function(opt_includeInstance) { + return proto.common.interop_payload.ConfidentialPayloadContents.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.interop_payload.ConfidentialPayloadContents} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.interop_payload.ConfidentialPayloadContents.toObject = function(includeInstance, msg) { + var f, obj = { + payload: msg.getPayload_asB64(), + random: msg.getRandom_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.interop_payload.ConfidentialPayloadContents} + */ +proto.common.interop_payload.ConfidentialPayloadContents.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.interop_payload.ConfidentialPayloadContents; + return proto.common.interop_payload.ConfidentialPayloadContents.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.interop_payload.ConfidentialPayloadContents} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.interop_payload.ConfidentialPayloadContents} + */ +proto.common.interop_payload.ConfidentialPayloadContents.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setPayload(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setRandom(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.interop_payload.ConfidentialPayloadContents.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.interop_payload.ConfidentialPayloadContents.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.interop_payload.ConfidentialPayloadContents} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.interop_payload.ConfidentialPayloadContents.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPayload_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getRandom_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional bytes payload = 1; + * @return {!(string|Uint8Array)} + */ +proto.common.interop_payload.ConfidentialPayloadContents.prototype.getPayload = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes payload = 1; + * This is a type-conversion wrapper around `getPayload()` + * @return {string} + */ +proto.common.interop_payload.ConfidentialPayloadContents.prototype.getPayload_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPayload())); +}; + + +/** + * optional bytes payload = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPayload()` + * @return {!Uint8Array} + */ +proto.common.interop_payload.ConfidentialPayloadContents.prototype.getPayload_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPayload())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.common.interop_payload.ConfidentialPayloadContents} returns this + */ +proto.common.interop_payload.ConfidentialPayloadContents.prototype.setPayload = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes random = 2; + * @return {!(string|Uint8Array)} + */ +proto.common.interop_payload.ConfidentialPayloadContents.prototype.getRandom = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes random = 2; + * This is a type-conversion wrapper around `getRandom()` + * @return {string} + */ +proto.common.interop_payload.ConfidentialPayloadContents.prototype.getRandom_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getRandom())); +}; + + +/** + * optional bytes random = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getRandom()` + * @return {!Uint8Array} + */ +proto.common.interop_payload.ConfidentialPayloadContents.prototype.getRandom_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getRandom())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.common.interop_payload.ConfidentialPayloadContents} returns this + */ +proto.common.interop_payload.ConfidentialPayloadContents.prototype.setRandom = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + +goog.object.extend(exports, proto.common.interop_payload); diff --git a/weaver/common/protos-js/common/membership_pb.d.ts b/weaver/common/protos-js/common/membership_pb.d.ts new file mode 100644 index 00000000000..4cb1e86bb53 --- /dev/null +++ b/weaver/common/protos-js/common/membership_pb.d.ts @@ -0,0 +1,60 @@ +// package: common.membership +// file: common/membership.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; + +export class Membership extends jspb.Message { + getSecuritydomain(): string; + setSecuritydomain(value: string): Membership; + + getMembersMap(): jspb.Map; + clearMembersMap(): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Membership.AsObject; + static toObject(includeInstance: boolean, msg: Membership): Membership.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Membership, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Membership; + static deserializeBinaryFromReader(message: Membership, reader: jspb.BinaryReader): Membership; +} + +export namespace Membership { + export type AsObject = { + securitydomain: string, + + membersMap: Array<[string, Member.AsObject]>, + } +} + +export class Member extends jspb.Message { + getValue(): string; + setValue(value: string): Member; + getType(): string; + setType(value: string): Member; + clearChainList(): void; + getChainList(): Array; + setChainList(value: Array): Member; + addChain(value: string, index?: number): string; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Member.AsObject; + static toObject(includeInstance: boolean, msg: Member): Member.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Member, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Member; + static deserializeBinaryFromReader(message: Member, reader: jspb.BinaryReader): Member; +} + +export namespace Member { + export type AsObject = { + value: string, + type: string, + chainList: Array, + } +} diff --git a/weaver/common/protos-js/common/membership_pb.js b/weaver/common/protos-js/common/membership_pb.js new file mode 100644 index 00000000000..06f4e72bbe5 --- /dev/null +++ b/weaver/common/protos-js/common/membership_pb.js @@ -0,0 +1,447 @@ +// source: common/membership.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +goog.exportSymbol('proto.common.membership.Member', null, global); +goog.exportSymbol('proto.common.membership.Membership', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.membership.Membership = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.membership.Membership, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.membership.Membership.displayName = 'proto.common.membership.Membership'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.membership.Member = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.common.membership.Member.repeatedFields_, null); +}; +goog.inherits(proto.common.membership.Member, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.membership.Member.displayName = 'proto.common.membership.Member'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.membership.Membership.prototype.toObject = function(opt_includeInstance) { + return proto.common.membership.Membership.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.membership.Membership} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.membership.Membership.toObject = function(includeInstance, msg) { + var f, obj = { + securitydomain: jspb.Message.getFieldWithDefault(msg, 1, ""), + membersMap: (f = msg.getMembersMap()) ? f.toObject(includeInstance, proto.common.membership.Member.toObject) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.membership.Membership} + */ +proto.common.membership.Membership.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.membership.Membership; + return proto.common.membership.Membership.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.membership.Membership} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.membership.Membership} + */ +proto.common.membership.Membership.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setSecuritydomain(value); + break; + case 2: + var value = msg.getMembersMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.common.membership.Member.deserializeBinaryFromReader, "", new proto.common.membership.Member()); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.membership.Membership.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.membership.Membership.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.membership.Membership} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.membership.Membership.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSecuritydomain(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getMembersMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.common.membership.Member.serializeBinaryToWriter); + } +}; + + +/** + * optional string securityDomain = 1; + * @return {string} + */ +proto.common.membership.Membership.prototype.getSecuritydomain = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.membership.Membership} returns this + */ +proto.common.membership.Membership.prototype.setSecuritydomain = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * map members = 2; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.common.membership.Membership.prototype.getMembersMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 2, opt_noLazyCreate, + proto.common.membership.Member)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.common.membership.Membership} returns this + */ +proto.common.membership.Membership.prototype.clearMembersMap = function() { + this.getMembersMap().clear(); + return this;}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.common.membership.Member.repeatedFields_ = [3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.membership.Member.prototype.toObject = function(opt_includeInstance) { + return proto.common.membership.Member.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.membership.Member} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.membership.Member.toObject = function(includeInstance, msg) { + var f, obj = { + value: jspb.Message.getFieldWithDefault(msg, 1, ""), + type: jspb.Message.getFieldWithDefault(msg, 2, ""), + chainList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.membership.Member} + */ +proto.common.membership.Member.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.membership.Member; + return proto.common.membership.Member.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.membership.Member} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.membership.Member} + */ +proto.common.membership.Member.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setValue(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setType(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.addChain(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.membership.Member.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.membership.Member.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.membership.Member} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.membership.Member.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValue(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getType(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getChainList(); + if (f.length > 0) { + writer.writeRepeatedString( + 3, + f + ); + } +}; + + +/** + * optional string value = 1; + * @return {string} + */ +proto.common.membership.Member.prototype.getValue = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.membership.Member} returns this + */ +proto.common.membership.Member.prototype.setValue = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string type = 2; + * @return {string} + */ +proto.common.membership.Member.prototype.getType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.membership.Member} returns this + */ +proto.common.membership.Member.prototype.setType = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * repeated string chain = 3; + * @return {!Array} + */ +proto.common.membership.Member.prototype.getChainList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.common.membership.Member} returns this + */ +proto.common.membership.Member.prototype.setChainList = function(value) { + return jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.common.membership.Member} returns this + */ +proto.common.membership.Member.prototype.addChain = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.common.membership.Member} returns this + */ +proto.common.membership.Member.prototype.clearChainList = function() { + return this.setChainList([]); +}; + + +goog.object.extend(exports, proto.common.membership); diff --git a/weaver/common/protos-js/common/policies_pb.d.ts b/weaver/common/protos-js/common/policies_pb.d.ts new file mode 100644 index 00000000000..b080956db08 --- /dev/null +++ b/weaver/common/protos-js/common/policies_pb.d.ts @@ -0,0 +1,205 @@ +// package: common +// file: common/policies.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; +import * as msp_msp_principal_pb from "../msp/msp_principal_pb"; + +export class Policy extends jspb.Message { + getType(): number; + setType(value: number): Policy; + getValue(): Uint8Array | string; + getValue_asU8(): Uint8Array; + getValue_asB64(): string; + setValue(value: Uint8Array | string): Policy; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Policy.AsObject; + static toObject(includeInstance: boolean, msg: Policy): Policy.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Policy, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Policy; + static deserializeBinaryFromReader(message: Policy, reader: jspb.BinaryReader): Policy; +} + +export namespace Policy { + export type AsObject = { + type: number, + value: Uint8Array | string, + } + + export enum PolicyType { + UNKNOWN = 0, + SIGNATURE = 1, + MSP = 2, + IMPLICIT_META = 3, + } + +} + +export class SignaturePolicyEnvelope extends jspb.Message { + getVersion(): number; + setVersion(value: number): SignaturePolicyEnvelope; + + hasRule(): boolean; + clearRule(): void; + getRule(): SignaturePolicy | undefined; + setRule(value?: SignaturePolicy): SignaturePolicyEnvelope; + clearIdentitiesList(): void; + getIdentitiesList(): Array; + setIdentitiesList(value: Array): SignaturePolicyEnvelope; + addIdentities(value?: msp_msp_principal_pb.MSPPrincipal, index?: number): msp_msp_principal_pb.MSPPrincipal; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SignaturePolicyEnvelope.AsObject; + static toObject(includeInstance: boolean, msg: SignaturePolicyEnvelope): SignaturePolicyEnvelope.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SignaturePolicyEnvelope, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SignaturePolicyEnvelope; + static deserializeBinaryFromReader(message: SignaturePolicyEnvelope, reader: jspb.BinaryReader): SignaturePolicyEnvelope; +} + +export namespace SignaturePolicyEnvelope { + export type AsObject = { + version: number, + rule?: SignaturePolicy.AsObject, + identitiesList: Array, + } +} + +export class SignaturePolicy extends jspb.Message { + + hasSignedBy(): boolean; + clearSignedBy(): void; + getSignedBy(): number; + setSignedBy(value: number): SignaturePolicy; + + hasNOutOf(): boolean; + clearNOutOf(): void; + getNOutOf(): SignaturePolicy.NOutOf | undefined; + setNOutOf(value?: SignaturePolicy.NOutOf): SignaturePolicy; + + getTypeCase(): SignaturePolicy.TypeCase; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SignaturePolicy.AsObject; + static toObject(includeInstance: boolean, msg: SignaturePolicy): SignaturePolicy.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SignaturePolicy, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SignaturePolicy; + static deserializeBinaryFromReader(message: SignaturePolicy, reader: jspb.BinaryReader): SignaturePolicy; +} + +export namespace SignaturePolicy { + export type AsObject = { + signedBy: number, + nOutOf?: SignaturePolicy.NOutOf.AsObject, + } + + + export class NOutOf extends jspb.Message { + getN(): number; + setN(value: number): NOutOf; + clearRulesList(): void; + getRulesList(): Array; + setRulesList(value: Array): NOutOf; + addRules(value?: SignaturePolicy, index?: number): SignaturePolicy; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): NOutOf.AsObject; + static toObject(includeInstance: boolean, msg: NOutOf): NOutOf.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: NOutOf, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): NOutOf; + static deserializeBinaryFromReader(message: NOutOf, reader: jspb.BinaryReader): NOutOf; + } + + export namespace NOutOf { + export type AsObject = { + n: number, + rulesList: Array, + } + } + + + export enum TypeCase { + TYPE_NOT_SET = 0, + SIGNED_BY = 1, + N_OUT_OF = 2, + } + +} + +export class ImplicitMetaPolicy extends jspb.Message { + getSubPolicy(): string; + setSubPolicy(value: string): ImplicitMetaPolicy; + getRule(): ImplicitMetaPolicy.Rule; + setRule(value: ImplicitMetaPolicy.Rule): ImplicitMetaPolicy; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ImplicitMetaPolicy.AsObject; + static toObject(includeInstance: boolean, msg: ImplicitMetaPolicy): ImplicitMetaPolicy.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ImplicitMetaPolicy, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ImplicitMetaPolicy; + static deserializeBinaryFromReader(message: ImplicitMetaPolicy, reader: jspb.BinaryReader): ImplicitMetaPolicy; +} + +export namespace ImplicitMetaPolicy { + export type AsObject = { + subPolicy: string, + rule: ImplicitMetaPolicy.Rule, + } + + export enum Rule { + ANY = 0, + ALL = 1, + MAJORITY = 2, + } + +} + +export class ApplicationPolicy extends jspb.Message { + + hasSignaturePolicy(): boolean; + clearSignaturePolicy(): void; + getSignaturePolicy(): SignaturePolicyEnvelope | undefined; + setSignaturePolicy(value?: SignaturePolicyEnvelope): ApplicationPolicy; + + hasChannelConfigPolicyReference(): boolean; + clearChannelConfigPolicyReference(): void; + getChannelConfigPolicyReference(): string; + setChannelConfigPolicyReference(value: string): ApplicationPolicy; + + getTypeCase(): ApplicationPolicy.TypeCase; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ApplicationPolicy.AsObject; + static toObject(includeInstance: boolean, msg: ApplicationPolicy): ApplicationPolicy.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ApplicationPolicy, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ApplicationPolicy; + static deserializeBinaryFromReader(message: ApplicationPolicy, reader: jspb.BinaryReader): ApplicationPolicy; +} + +export namespace ApplicationPolicy { + export type AsObject = { + signaturePolicy?: SignaturePolicyEnvelope.AsObject, + channelConfigPolicyReference: string, + } + + export enum TypeCase { + TYPE_NOT_SET = 0, + SIGNATURE_POLICY = 1, + CHANNEL_CONFIG_POLICY_REFERENCE = 2, + } + +} diff --git a/weaver/common/protos-js/common/policies_pb.js b/weaver/common/protos-js/common/policies_pb.js new file mode 100644 index 00000000000..2c7ad3498d6 --- /dev/null +++ b/weaver/common/protos-js/common/policies_pb.js @@ -0,0 +1,1406 @@ +// source: common/policies.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +var msp_msp_principal_pb = require('../msp/msp_principal_pb.js'); +goog.object.extend(proto, msp_msp_principal_pb); +goog.exportSymbol('proto.common.ApplicationPolicy', null, global); +goog.exportSymbol('proto.common.ApplicationPolicy.TypeCase', null, global); +goog.exportSymbol('proto.common.ImplicitMetaPolicy', null, global); +goog.exportSymbol('proto.common.ImplicitMetaPolicy.Rule', null, global); +goog.exportSymbol('proto.common.Policy', null, global); +goog.exportSymbol('proto.common.Policy.PolicyType', null, global); +goog.exportSymbol('proto.common.SignaturePolicy', null, global); +goog.exportSymbol('proto.common.SignaturePolicy.NOutOf', null, global); +goog.exportSymbol('proto.common.SignaturePolicy.TypeCase', null, global); +goog.exportSymbol('proto.common.SignaturePolicyEnvelope', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.Policy = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.Policy, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.Policy.displayName = 'proto.common.Policy'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.SignaturePolicyEnvelope = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.common.SignaturePolicyEnvelope.repeatedFields_, null); +}; +goog.inherits(proto.common.SignaturePolicyEnvelope, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.SignaturePolicyEnvelope.displayName = 'proto.common.SignaturePolicyEnvelope'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.SignaturePolicy = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.common.SignaturePolicy.oneofGroups_); +}; +goog.inherits(proto.common.SignaturePolicy, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.SignaturePolicy.displayName = 'proto.common.SignaturePolicy'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.SignaturePolicy.NOutOf = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.common.SignaturePolicy.NOutOf.repeatedFields_, null); +}; +goog.inherits(proto.common.SignaturePolicy.NOutOf, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.SignaturePolicy.NOutOf.displayName = 'proto.common.SignaturePolicy.NOutOf'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.ImplicitMetaPolicy = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.ImplicitMetaPolicy, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.ImplicitMetaPolicy.displayName = 'proto.common.ImplicitMetaPolicy'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.ApplicationPolicy = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.common.ApplicationPolicy.oneofGroups_); +}; +goog.inherits(proto.common.ApplicationPolicy, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.ApplicationPolicy.displayName = 'proto.common.ApplicationPolicy'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.Policy.prototype.toObject = function(opt_includeInstance) { + return proto.common.Policy.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.Policy} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.Policy.toObject = function(includeInstance, msg) { + var f, obj = { + type: jspb.Message.getFieldWithDefault(msg, 1, 0), + value: msg.getValue_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.Policy} + */ +proto.common.Policy.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.Policy; + return proto.common.Policy.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.Policy} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.Policy} + */ +proto.common.Policy.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setType(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.Policy.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.Policy.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.Policy} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.Policy.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getType(); + if (f !== 0) { + writer.writeInt32( + 1, + f + ); + } + f = message.getValue_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.common.Policy.PolicyType = { + UNKNOWN: 0, + SIGNATURE: 1, + MSP: 2, + IMPLICIT_META: 3 +}; + +/** + * optional int32 type = 1; + * @return {number} + */ +proto.common.Policy.prototype.getType = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.common.Policy} returns this + */ +proto.common.Policy.prototype.setType = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional bytes value = 2; + * @return {!(string|Uint8Array)} + */ +proto.common.Policy.prototype.getValue = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes value = 2; + * This is a type-conversion wrapper around `getValue()` + * @return {string} + */ +proto.common.Policy.prototype.getValue_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getValue())); +}; + + +/** + * optional bytes value = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getValue()` + * @return {!Uint8Array} + */ +proto.common.Policy.prototype.getValue_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getValue())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.common.Policy} returns this + */ +proto.common.Policy.prototype.setValue = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.common.SignaturePolicyEnvelope.repeatedFields_ = [3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.SignaturePolicyEnvelope.prototype.toObject = function(opt_includeInstance) { + return proto.common.SignaturePolicyEnvelope.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.SignaturePolicyEnvelope} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.SignaturePolicyEnvelope.toObject = function(includeInstance, msg) { + var f, obj = { + version: jspb.Message.getFieldWithDefault(msg, 1, 0), + rule: (f = msg.getRule()) && proto.common.SignaturePolicy.toObject(includeInstance, f), + identitiesList: jspb.Message.toObjectList(msg.getIdentitiesList(), + msp_msp_principal_pb.MSPPrincipal.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.SignaturePolicyEnvelope} + */ +proto.common.SignaturePolicyEnvelope.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.SignaturePolicyEnvelope; + return proto.common.SignaturePolicyEnvelope.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.SignaturePolicyEnvelope} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.SignaturePolicyEnvelope} + */ +proto.common.SignaturePolicyEnvelope.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setVersion(value); + break; + case 2: + var value = new proto.common.SignaturePolicy; + reader.readMessage(value,proto.common.SignaturePolicy.deserializeBinaryFromReader); + msg.setRule(value); + break; + case 3: + var value = new msp_msp_principal_pb.MSPPrincipal; + reader.readMessage(value,msp_msp_principal_pb.MSPPrincipal.deserializeBinaryFromReader); + msg.addIdentities(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.SignaturePolicyEnvelope.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.SignaturePolicyEnvelope.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.SignaturePolicyEnvelope} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.SignaturePolicyEnvelope.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getVersion(); + if (f !== 0) { + writer.writeInt32( + 1, + f + ); + } + f = message.getRule(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.common.SignaturePolicy.serializeBinaryToWriter + ); + } + f = message.getIdentitiesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + msp_msp_principal_pb.MSPPrincipal.serializeBinaryToWriter + ); + } +}; + + +/** + * optional int32 version = 1; + * @return {number} + */ +proto.common.SignaturePolicyEnvelope.prototype.getVersion = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.common.SignaturePolicyEnvelope} returns this + */ +proto.common.SignaturePolicyEnvelope.prototype.setVersion = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional SignaturePolicy rule = 2; + * @return {?proto.common.SignaturePolicy} + */ +proto.common.SignaturePolicyEnvelope.prototype.getRule = function() { + return /** @type{?proto.common.SignaturePolicy} */ ( + jspb.Message.getWrapperField(this, proto.common.SignaturePolicy, 2)); +}; + + +/** + * @param {?proto.common.SignaturePolicy|undefined} value + * @return {!proto.common.SignaturePolicyEnvelope} returns this +*/ +proto.common.SignaturePolicyEnvelope.prototype.setRule = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.common.SignaturePolicyEnvelope} returns this + */ +proto.common.SignaturePolicyEnvelope.prototype.clearRule = function() { + return this.setRule(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.common.SignaturePolicyEnvelope.prototype.hasRule = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * repeated MSPPrincipal identities = 3; + * @return {!Array} + */ +proto.common.SignaturePolicyEnvelope.prototype.getIdentitiesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, msp_msp_principal_pb.MSPPrincipal, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.common.SignaturePolicyEnvelope} returns this +*/ +proto.common.SignaturePolicyEnvelope.prototype.setIdentitiesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.common.MSPPrincipal=} opt_value + * @param {number=} opt_index + * @return {!proto.common.MSPPrincipal} + */ +proto.common.SignaturePolicyEnvelope.prototype.addIdentities = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.common.MSPPrincipal, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.common.SignaturePolicyEnvelope} returns this + */ +proto.common.SignaturePolicyEnvelope.prototype.clearIdentitiesList = function() { + return this.setIdentitiesList([]); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.common.SignaturePolicy.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.common.SignaturePolicy.TypeCase = { + TYPE_NOT_SET: 0, + SIGNED_BY: 1, + N_OUT_OF: 2 +}; + +/** + * @return {proto.common.SignaturePolicy.TypeCase} + */ +proto.common.SignaturePolicy.prototype.getTypeCase = function() { + return /** @type {proto.common.SignaturePolicy.TypeCase} */(jspb.Message.computeOneofCase(this, proto.common.SignaturePolicy.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.SignaturePolicy.prototype.toObject = function(opt_includeInstance) { + return proto.common.SignaturePolicy.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.SignaturePolicy} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.SignaturePolicy.toObject = function(includeInstance, msg) { + var f, obj = { + signedBy: jspb.Message.getFieldWithDefault(msg, 1, 0), + nOutOf: (f = msg.getNOutOf()) && proto.common.SignaturePolicy.NOutOf.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.SignaturePolicy} + */ +proto.common.SignaturePolicy.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.SignaturePolicy; + return proto.common.SignaturePolicy.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.SignaturePolicy} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.SignaturePolicy} + */ +proto.common.SignaturePolicy.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setSignedBy(value); + break; + case 2: + var value = new proto.common.SignaturePolicy.NOutOf; + reader.readMessage(value,proto.common.SignaturePolicy.NOutOf.deserializeBinaryFromReader); + msg.setNOutOf(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.SignaturePolicy.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.SignaturePolicy.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.SignaturePolicy} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.SignaturePolicy.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeInt32( + 1, + f + ); + } + f = message.getNOutOf(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.common.SignaturePolicy.NOutOf.serializeBinaryToWriter + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.common.SignaturePolicy.NOutOf.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.SignaturePolicy.NOutOf.prototype.toObject = function(opt_includeInstance) { + return proto.common.SignaturePolicy.NOutOf.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.SignaturePolicy.NOutOf} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.SignaturePolicy.NOutOf.toObject = function(includeInstance, msg) { + var f, obj = { + n: jspb.Message.getFieldWithDefault(msg, 1, 0), + rulesList: jspb.Message.toObjectList(msg.getRulesList(), + proto.common.SignaturePolicy.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.SignaturePolicy.NOutOf} + */ +proto.common.SignaturePolicy.NOutOf.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.SignaturePolicy.NOutOf; + return proto.common.SignaturePolicy.NOutOf.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.SignaturePolicy.NOutOf} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.SignaturePolicy.NOutOf} + */ +proto.common.SignaturePolicy.NOutOf.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setN(value); + break; + case 2: + var value = new proto.common.SignaturePolicy; + reader.readMessage(value,proto.common.SignaturePolicy.deserializeBinaryFromReader); + msg.addRules(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.SignaturePolicy.NOutOf.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.SignaturePolicy.NOutOf.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.SignaturePolicy.NOutOf} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.SignaturePolicy.NOutOf.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getN(); + if (f !== 0) { + writer.writeInt32( + 1, + f + ); + } + f = message.getRulesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.common.SignaturePolicy.serializeBinaryToWriter + ); + } +}; + + +/** + * optional int32 n = 1; + * @return {number} + */ +proto.common.SignaturePolicy.NOutOf.prototype.getN = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.common.SignaturePolicy.NOutOf} returns this + */ +proto.common.SignaturePolicy.NOutOf.prototype.setN = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * repeated SignaturePolicy rules = 2; + * @return {!Array} + */ +proto.common.SignaturePolicy.NOutOf.prototype.getRulesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.common.SignaturePolicy, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.common.SignaturePolicy.NOutOf} returns this +*/ +proto.common.SignaturePolicy.NOutOf.prototype.setRulesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.common.SignaturePolicy=} opt_value + * @param {number=} opt_index + * @return {!proto.common.SignaturePolicy} + */ +proto.common.SignaturePolicy.NOutOf.prototype.addRules = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.common.SignaturePolicy, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.common.SignaturePolicy.NOutOf} returns this + */ +proto.common.SignaturePolicy.NOutOf.prototype.clearRulesList = function() { + return this.setRulesList([]); +}; + + +/** + * optional int32 signed_by = 1; + * @return {number} + */ +proto.common.SignaturePolicy.prototype.getSignedBy = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.common.SignaturePolicy} returns this + */ +proto.common.SignaturePolicy.prototype.setSignedBy = function(value) { + return jspb.Message.setOneofField(this, 1, proto.common.SignaturePolicy.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.common.SignaturePolicy} returns this + */ +proto.common.SignaturePolicy.prototype.clearSignedBy = function() { + return jspb.Message.setOneofField(this, 1, proto.common.SignaturePolicy.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.common.SignaturePolicy.prototype.hasSignedBy = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional NOutOf n_out_of = 2; + * @return {?proto.common.SignaturePolicy.NOutOf} + */ +proto.common.SignaturePolicy.prototype.getNOutOf = function() { + return /** @type{?proto.common.SignaturePolicy.NOutOf} */ ( + jspb.Message.getWrapperField(this, proto.common.SignaturePolicy.NOutOf, 2)); +}; + + +/** + * @param {?proto.common.SignaturePolicy.NOutOf|undefined} value + * @return {!proto.common.SignaturePolicy} returns this +*/ +proto.common.SignaturePolicy.prototype.setNOutOf = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.common.SignaturePolicy.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.common.SignaturePolicy} returns this + */ +proto.common.SignaturePolicy.prototype.clearNOutOf = function() { + return this.setNOutOf(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.common.SignaturePolicy.prototype.hasNOutOf = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.ImplicitMetaPolicy.prototype.toObject = function(opt_includeInstance) { + return proto.common.ImplicitMetaPolicy.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.ImplicitMetaPolicy} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.ImplicitMetaPolicy.toObject = function(includeInstance, msg) { + var f, obj = { + subPolicy: jspb.Message.getFieldWithDefault(msg, 1, ""), + rule: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.ImplicitMetaPolicy} + */ +proto.common.ImplicitMetaPolicy.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.ImplicitMetaPolicy; + return proto.common.ImplicitMetaPolicy.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.ImplicitMetaPolicy} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.ImplicitMetaPolicy} + */ +proto.common.ImplicitMetaPolicy.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setSubPolicy(value); + break; + case 2: + var value = /** @type {!proto.common.ImplicitMetaPolicy.Rule} */ (reader.readEnum()); + msg.setRule(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.ImplicitMetaPolicy.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.ImplicitMetaPolicy.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.ImplicitMetaPolicy} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.ImplicitMetaPolicy.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSubPolicy(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getRule(); + if (f !== 0.0) { + writer.writeEnum( + 2, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.common.ImplicitMetaPolicy.Rule = { + ANY: 0, + ALL: 1, + MAJORITY: 2 +}; + +/** + * optional string sub_policy = 1; + * @return {string} + */ +proto.common.ImplicitMetaPolicy.prototype.getSubPolicy = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.ImplicitMetaPolicy} returns this + */ +proto.common.ImplicitMetaPolicy.prototype.setSubPolicy = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional Rule rule = 2; + * @return {!proto.common.ImplicitMetaPolicy.Rule} + */ +proto.common.ImplicitMetaPolicy.prototype.getRule = function() { + return /** @type {!proto.common.ImplicitMetaPolicy.Rule} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {!proto.common.ImplicitMetaPolicy.Rule} value + * @return {!proto.common.ImplicitMetaPolicy} returns this + */ +proto.common.ImplicitMetaPolicy.prototype.setRule = function(value) { + return jspb.Message.setProto3EnumField(this, 2, value); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.common.ApplicationPolicy.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.common.ApplicationPolicy.TypeCase = { + TYPE_NOT_SET: 0, + SIGNATURE_POLICY: 1, + CHANNEL_CONFIG_POLICY_REFERENCE: 2 +}; + +/** + * @return {proto.common.ApplicationPolicy.TypeCase} + */ +proto.common.ApplicationPolicy.prototype.getTypeCase = function() { + return /** @type {proto.common.ApplicationPolicy.TypeCase} */(jspb.Message.computeOneofCase(this, proto.common.ApplicationPolicy.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.ApplicationPolicy.prototype.toObject = function(opt_includeInstance) { + return proto.common.ApplicationPolicy.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.ApplicationPolicy} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.ApplicationPolicy.toObject = function(includeInstance, msg) { + var f, obj = { + signaturePolicy: (f = msg.getSignaturePolicy()) && proto.common.SignaturePolicyEnvelope.toObject(includeInstance, f), + channelConfigPolicyReference: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.ApplicationPolicy} + */ +proto.common.ApplicationPolicy.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.ApplicationPolicy; + return proto.common.ApplicationPolicy.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.ApplicationPolicy} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.ApplicationPolicy} + */ +proto.common.ApplicationPolicy.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.common.SignaturePolicyEnvelope; + reader.readMessage(value,proto.common.SignaturePolicyEnvelope.deserializeBinaryFromReader); + msg.setSignaturePolicy(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setChannelConfigPolicyReference(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.ApplicationPolicy.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.ApplicationPolicy.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.ApplicationPolicy} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.ApplicationPolicy.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSignaturePolicy(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.common.SignaturePolicyEnvelope.serializeBinaryToWriter + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional SignaturePolicyEnvelope signature_policy = 1; + * @return {?proto.common.SignaturePolicyEnvelope} + */ +proto.common.ApplicationPolicy.prototype.getSignaturePolicy = function() { + return /** @type{?proto.common.SignaturePolicyEnvelope} */ ( + jspb.Message.getWrapperField(this, proto.common.SignaturePolicyEnvelope, 1)); +}; + + +/** + * @param {?proto.common.SignaturePolicyEnvelope|undefined} value + * @return {!proto.common.ApplicationPolicy} returns this +*/ +proto.common.ApplicationPolicy.prototype.setSignaturePolicy = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.common.ApplicationPolicy.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.common.ApplicationPolicy} returns this + */ +proto.common.ApplicationPolicy.prototype.clearSignaturePolicy = function() { + return this.setSignaturePolicy(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.common.ApplicationPolicy.prototype.hasSignaturePolicy = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional string channel_config_policy_reference = 2; + * @return {string} + */ +proto.common.ApplicationPolicy.prototype.getChannelConfigPolicyReference = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.ApplicationPolicy} returns this + */ +proto.common.ApplicationPolicy.prototype.setChannelConfigPolicyReference = function(value) { + return jspb.Message.setOneofField(this, 2, proto.common.ApplicationPolicy.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.common.ApplicationPolicy} returns this + */ +proto.common.ApplicationPolicy.prototype.clearChannelConfigPolicyReference = function() { + return jspb.Message.setOneofField(this, 2, proto.common.ApplicationPolicy.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.common.ApplicationPolicy.prototype.hasChannelConfigPolicyReference = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +goog.object.extend(exports, proto.common); diff --git a/weaver/common/protos-js/common/proofs_pb.d.ts b/weaver/common/protos-js/common/proofs_pb.d.ts new file mode 100644 index 00000000000..f3394c8182c --- /dev/null +++ b/weaver/common/protos-js/common/proofs_pb.d.ts @@ -0,0 +1,52 @@ +// package: common.proofs +// file: common/proofs.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; + +export class Proof extends jspb.Message { + getSignature(): string; + setSignature(value: string): Proof; + getCertificate(): string; + setCertificate(value: string): Proof; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Proof.AsObject; + static toObject(includeInstance: boolean, msg: Proof): Proof.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Proof, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Proof; + static deserializeBinaryFromReader(message: Proof, reader: jspb.BinaryReader): Proof; +} + +export namespace Proof { + export type AsObject = { + signature: string, + certificate: string, + } +} + +export class Proofs extends jspb.Message { + clearProofsList(): void; + getProofsList(): Array; + setProofsList(value: Array): Proofs; + addProofs(value?: Proof, index?: number): Proof; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Proofs.AsObject; + static toObject(includeInstance: boolean, msg: Proofs): Proofs.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Proofs, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Proofs; + static deserializeBinaryFromReader(message: Proofs, reader: jspb.BinaryReader): Proofs; +} + +export namespace Proofs { + export type AsObject = { + proofsList: Array, + } +} diff --git a/weaver/common/protos-js/common/proofs_pb.js b/weaver/common/protos-js/common/proofs_pb.js new file mode 100644 index 00000000000..047fbb0812d --- /dev/null +++ b/weaver/common/protos-js/common/proofs_pb.js @@ -0,0 +1,388 @@ +// source: common/proofs.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +goog.exportSymbol('proto.common.proofs.Proof', null, global); +goog.exportSymbol('proto.common.proofs.Proofs', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.proofs.Proof = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.proofs.Proof, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.proofs.Proof.displayName = 'proto.common.proofs.Proof'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.proofs.Proofs = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.common.proofs.Proofs.repeatedFields_, null); +}; +goog.inherits(proto.common.proofs.Proofs, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.proofs.Proofs.displayName = 'proto.common.proofs.Proofs'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.proofs.Proof.prototype.toObject = function(opt_includeInstance) { + return proto.common.proofs.Proof.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.proofs.Proof} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.proofs.Proof.toObject = function(includeInstance, msg) { + var f, obj = { + signature: jspb.Message.getFieldWithDefault(msg, 1, ""), + certificate: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.proofs.Proof} + */ +proto.common.proofs.Proof.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.proofs.Proof; + return proto.common.proofs.Proof.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.proofs.Proof} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.proofs.Proof} + */ +proto.common.proofs.Proof.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setSignature(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setCertificate(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.proofs.Proof.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.proofs.Proof.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.proofs.Proof} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.proofs.Proof.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSignature(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getCertificate(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string signature = 1; + * @return {string} + */ +proto.common.proofs.Proof.prototype.getSignature = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.proofs.Proof} returns this + */ +proto.common.proofs.Proof.prototype.setSignature = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string certificate = 2; + * @return {string} + */ +proto.common.proofs.Proof.prototype.getCertificate = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.proofs.Proof} returns this + */ +proto.common.proofs.Proof.prototype.setCertificate = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.common.proofs.Proofs.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.proofs.Proofs.prototype.toObject = function(opt_includeInstance) { + return proto.common.proofs.Proofs.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.proofs.Proofs} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.proofs.Proofs.toObject = function(includeInstance, msg) { + var f, obj = { + proofsList: jspb.Message.toObjectList(msg.getProofsList(), + proto.common.proofs.Proof.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.proofs.Proofs} + */ +proto.common.proofs.Proofs.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.proofs.Proofs; + return proto.common.proofs.Proofs.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.proofs.Proofs} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.proofs.Proofs} + */ +proto.common.proofs.Proofs.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.common.proofs.Proof; + reader.readMessage(value,proto.common.proofs.Proof.deserializeBinaryFromReader); + msg.addProofs(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.proofs.Proofs.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.proofs.Proofs.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.proofs.Proofs} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.proofs.Proofs.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProofsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.common.proofs.Proof.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated Proof proofs = 1; + * @return {!Array} + */ +proto.common.proofs.Proofs.prototype.getProofsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.common.proofs.Proof, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.common.proofs.Proofs} returns this +*/ +proto.common.proofs.Proofs.prototype.setProofsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.common.proofs.Proof=} opt_value + * @param {number=} opt_index + * @return {!proto.common.proofs.Proof} + */ +proto.common.proofs.Proofs.prototype.addProofs = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.common.proofs.Proof, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.common.proofs.Proofs} returns this + */ +proto.common.proofs.Proofs.prototype.clearProofsList = function() { + return this.setProofsList([]); +}; + + +goog.object.extend(exports, proto.common.proofs); diff --git a/weaver/common/protos-js/common/query_pb.d.ts b/weaver/common/protos-js/common/query_pb.d.ts new file mode 100644 index 00000000000..f46c6f38806 --- /dev/null +++ b/weaver/common/protos-js/common/query_pb.d.ts @@ -0,0 +1,56 @@ +// package: common.query +// file: common/query.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; + +export class Query extends jspb.Message { + clearPolicyList(): void; + getPolicyList(): Array; + setPolicyList(value: Array): Query; + addPolicy(value: string, index?: number): string; + getAddress(): string; + setAddress(value: string): Query; + getRequestingRelay(): string; + setRequestingRelay(value: string): Query; + getRequestingNetwork(): string; + setRequestingNetwork(value: string): Query; + getCertificate(): string; + setCertificate(value: string): Query; + getRequestorSignature(): string; + setRequestorSignature(value: string): Query; + getNonce(): string; + setNonce(value: string): Query; + getRequestId(): string; + setRequestId(value: string): Query; + getRequestingOrg(): string; + setRequestingOrg(value: string): Query; + getConfidential(): boolean; + setConfidential(value: boolean): Query; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Query.AsObject; + static toObject(includeInstance: boolean, msg: Query): Query.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Query, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Query; + static deserializeBinaryFromReader(message: Query, reader: jspb.BinaryReader): Query; +} + +export namespace Query { + export type AsObject = { + policyList: Array, + address: string, + requestingRelay: string, + requestingNetwork: string, + certificate: string, + requestorSignature: string, + nonce: string, + requestId: string, + requestingOrg: string, + confidential: boolean, + } +} diff --git a/weaver/common/protos-js/common/query_pb.js b/weaver/common/protos-js/common/query_pb.js new file mode 100644 index 00000000000..41b65a69a17 --- /dev/null +++ b/weaver/common/protos-js/common/query_pb.js @@ -0,0 +1,472 @@ +// source: common/query.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +goog.exportSymbol('proto.common.query.Query', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.query.Query = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.common.query.Query.repeatedFields_, null); +}; +goog.inherits(proto.common.query.Query, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.query.Query.displayName = 'proto.common.query.Query'; +} + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.common.query.Query.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.query.Query.prototype.toObject = function(opt_includeInstance) { + return proto.common.query.Query.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.query.Query} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.query.Query.toObject = function(includeInstance, msg) { + var f, obj = { + policyList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f, + address: jspb.Message.getFieldWithDefault(msg, 2, ""), + requestingRelay: jspb.Message.getFieldWithDefault(msg, 3, ""), + requestingNetwork: jspb.Message.getFieldWithDefault(msg, 4, ""), + certificate: jspb.Message.getFieldWithDefault(msg, 5, ""), + requestorSignature: jspb.Message.getFieldWithDefault(msg, 6, ""), + nonce: jspb.Message.getFieldWithDefault(msg, 7, ""), + requestId: jspb.Message.getFieldWithDefault(msg, 8, ""), + requestingOrg: jspb.Message.getFieldWithDefault(msg, 9, ""), + confidential: jspb.Message.getBooleanFieldWithDefault(msg, 10, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.query.Query} + */ +proto.common.query.Query.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.query.Query; + return proto.common.query.Query.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.query.Query} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.query.Query} + */ +proto.common.query.Query.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.addPolicy(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setAddress(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setRequestingRelay(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setRequestingNetwork(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setCertificate(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setRequestorSignature(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setNonce(value); + break; + case 8: + var value = /** @type {string} */ (reader.readString()); + msg.setRequestId(value); + break; + case 9: + var value = /** @type {string} */ (reader.readString()); + msg.setRequestingOrg(value); + break; + case 10: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setConfidential(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.query.Query.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.query.Query.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.query.Query} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.query.Query.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPolicyList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } + f = message.getAddress(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getRequestingRelay(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getRequestingNetwork(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getCertificate(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getRequestorSignature(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getNonce(); + if (f.length > 0) { + writer.writeString( + 7, + f + ); + } + f = message.getRequestId(); + if (f.length > 0) { + writer.writeString( + 8, + f + ); + } + f = message.getRequestingOrg(); + if (f.length > 0) { + writer.writeString( + 9, + f + ); + } + f = message.getConfidential(); + if (f) { + writer.writeBool( + 10, + f + ); + } +}; + + +/** + * repeated string policy = 1; + * @return {!Array} + */ +proto.common.query.Query.prototype.getPolicyList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.common.query.Query} returns this + */ +proto.common.query.Query.prototype.setPolicyList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.common.query.Query} returns this + */ +proto.common.query.Query.prototype.addPolicy = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.common.query.Query} returns this + */ +proto.common.query.Query.prototype.clearPolicyList = function() { + return this.setPolicyList([]); +}; + + +/** + * optional string address = 2; + * @return {string} + */ +proto.common.query.Query.prototype.getAddress = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.query.Query} returns this + */ +proto.common.query.Query.prototype.setAddress = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string requesting_relay = 3; + * @return {string} + */ +proto.common.query.Query.prototype.getRequestingRelay = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.query.Query} returns this + */ +proto.common.query.Query.prototype.setRequestingRelay = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string requesting_network = 4; + * @return {string} + */ +proto.common.query.Query.prototype.getRequestingNetwork = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.query.Query} returns this + */ +proto.common.query.Query.prototype.setRequestingNetwork = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string certificate = 5; + * @return {string} + */ +proto.common.query.Query.prototype.getCertificate = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.query.Query} returns this + */ +proto.common.query.Query.prototype.setCertificate = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string requestor_signature = 6; + * @return {string} + */ +proto.common.query.Query.prototype.getRequestorSignature = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.query.Query} returns this + */ +proto.common.query.Query.prototype.setRequestorSignature = function(value) { + return jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional string nonce = 7; + * @return {string} + */ +proto.common.query.Query.prototype.getNonce = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.query.Query} returns this + */ +proto.common.query.Query.prototype.setNonce = function(value) { + return jspb.Message.setProto3StringField(this, 7, value); +}; + + +/** + * optional string request_id = 8; + * @return {string} + */ +proto.common.query.Query.prototype.getRequestId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.query.Query} returns this + */ +proto.common.query.Query.prototype.setRequestId = function(value) { + return jspb.Message.setProto3StringField(this, 8, value); +}; + + +/** + * optional string requesting_org = 9; + * @return {string} + */ +proto.common.query.Query.prototype.getRequestingOrg = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.query.Query} returns this + */ +proto.common.query.Query.prototype.setRequestingOrg = function(value) { + return jspb.Message.setProto3StringField(this, 9, value); +}; + + +/** + * optional bool confidential = 10; + * @return {boolean} + */ +proto.common.query.Query.prototype.getConfidential = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 10, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.common.query.Query} returns this + */ +proto.common.query.Query.prototype.setConfidential = function(value) { + return jspb.Message.setProto3BooleanField(this, 10, value); +}; + + +goog.object.extend(exports, proto.common.query); diff --git a/weaver/common/protos-js/common/state_pb.d.ts b/weaver/common/protos-js/common/state_pb.d.ts new file mode 100644 index 00000000000..98952e1341a --- /dev/null +++ b/weaver/common/protos-js/common/state_pb.d.ts @@ -0,0 +1,169 @@ +// package: common.state +// file: common/state.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; + +export class Meta extends jspb.Message { + getProtocol(): Meta.Protocol; + setProtocol(value: Meta.Protocol): Meta; + getTimestamp(): string; + setTimestamp(value: string): Meta; + getProofType(): string; + setProofType(value: string): Meta; + getSerializationFormat(): string; + setSerializationFormat(value: string): Meta; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Meta.AsObject; + static toObject(includeInstance: boolean, msg: Meta): Meta.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Meta, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Meta; + static deserializeBinaryFromReader(message: Meta, reader: jspb.BinaryReader): Meta; +} + +export namespace Meta { + export type AsObject = { + protocol: Meta.Protocol, + timestamp: string, + proofType: string, + serializationFormat: string, + } + + export enum Protocol { + BITCOIN = 0, + ETHEREUM = 1, + FABRIC = 3, + CORDA = 4, + } + +} + +export class View extends jspb.Message { + + hasMeta(): boolean; + clearMeta(): void; + getMeta(): Meta | undefined; + setMeta(value?: Meta): View; + getData(): Uint8Array | string; + getData_asU8(): Uint8Array; + getData_asB64(): string; + setData(value: Uint8Array | string): View; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): View.AsObject; + static toObject(includeInstance: boolean, msg: View): View.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: View, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): View; + static deserializeBinaryFromReader(message: View, reader: jspb.BinaryReader): View; +} + +export namespace View { + export type AsObject = { + meta?: Meta.AsObject, + data: Uint8Array | string, + } +} + +export class ViewPayload extends jspb.Message { + getRequestId(): string; + setRequestId(value: string): ViewPayload; + + hasView(): boolean; + clearView(): void; + getView(): View | undefined; + setView(value?: View): ViewPayload; + + hasError(): boolean; + clearError(): void; + getError(): string; + setError(value: string): ViewPayload; + + getStateCase(): ViewPayload.StateCase; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ViewPayload.AsObject; + static toObject(includeInstance: boolean, msg: ViewPayload): ViewPayload.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ViewPayload, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ViewPayload; + static deserializeBinaryFromReader(message: ViewPayload, reader: jspb.BinaryReader): ViewPayload; +} + +export namespace ViewPayload { + export type AsObject = { + requestId: string, + view?: View.AsObject, + error: string, + } + + export enum StateCase { + STATE_NOT_SET = 0, + VIEW = 2, + ERROR = 3, + } + +} + +export class RequestState extends jspb.Message { + getRequestId(): string; + setRequestId(value: string): RequestState; + getStatus(): RequestState.STATUS; + setStatus(value: RequestState.STATUS): RequestState; + + hasView(): boolean; + clearView(): void; + getView(): View | undefined; + setView(value?: View): RequestState; + + hasError(): boolean; + clearError(): void; + getError(): string; + setError(value: string): RequestState; + + getStateCase(): RequestState.StateCase; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): RequestState.AsObject; + static toObject(includeInstance: boolean, msg: RequestState): RequestState.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: RequestState, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): RequestState; + static deserializeBinaryFromReader(message: RequestState, reader: jspb.BinaryReader): RequestState; +} + +export namespace RequestState { + export type AsObject = { + requestId: string, + status: RequestState.STATUS, + view?: View.AsObject, + error: string, + } + + export enum STATUS { + PENDING_ACK = 0, + PENDING = 1, + ERROR = 2, + COMPLETED = 3, + EVENT_RECEIVED = 4, + EVENT_WRITTEN = 5, + EVENT_WRITE_ERROR = 6, + DELETED = 7, + } + + + export enum StateCase { + STATE_NOT_SET = 0, + VIEW = 3, + ERROR = 4, + } + +} diff --git a/weaver/common/protos-js/common/state_pb.js b/weaver/common/protos-js/common/state_pb.js new file mode 100644 index 00000000000..aee22583693 --- /dev/null +++ b/weaver/common/protos-js/common/state_pb.js @@ -0,0 +1,1105 @@ +// source: common/state.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +goog.exportSymbol('proto.common.state.Meta', null, global); +goog.exportSymbol('proto.common.state.Meta.Protocol', null, global); +goog.exportSymbol('proto.common.state.RequestState', null, global); +goog.exportSymbol('proto.common.state.RequestState.STATUS', null, global); +goog.exportSymbol('proto.common.state.RequestState.StateCase', null, global); +goog.exportSymbol('proto.common.state.View', null, global); +goog.exportSymbol('proto.common.state.ViewPayload', null, global); +goog.exportSymbol('proto.common.state.ViewPayload.StateCase', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.state.Meta = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.state.Meta, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.state.Meta.displayName = 'proto.common.state.Meta'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.state.View = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.state.View, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.state.View.displayName = 'proto.common.state.View'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.state.ViewPayload = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.common.state.ViewPayload.oneofGroups_); +}; +goog.inherits(proto.common.state.ViewPayload, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.state.ViewPayload.displayName = 'proto.common.state.ViewPayload'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.state.RequestState = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.common.state.RequestState.oneofGroups_); +}; +goog.inherits(proto.common.state.RequestState, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.state.RequestState.displayName = 'proto.common.state.RequestState'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.state.Meta.prototype.toObject = function(opt_includeInstance) { + return proto.common.state.Meta.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.state.Meta} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.state.Meta.toObject = function(includeInstance, msg) { + var f, obj = { + protocol: jspb.Message.getFieldWithDefault(msg, 1, 0), + timestamp: jspb.Message.getFieldWithDefault(msg, 2, ""), + proofType: jspb.Message.getFieldWithDefault(msg, 3, ""), + serializationFormat: jspb.Message.getFieldWithDefault(msg, 4, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.state.Meta} + */ +proto.common.state.Meta.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.state.Meta; + return proto.common.state.Meta.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.state.Meta} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.state.Meta} + */ +proto.common.state.Meta.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.common.state.Meta.Protocol} */ (reader.readEnum()); + msg.setProtocol(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setTimestamp(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setProofType(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setSerializationFormat(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.state.Meta.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.state.Meta.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.state.Meta} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.state.Meta.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProtocol(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getTimestamp(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getProofType(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getSerializationFormat(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.common.state.Meta.Protocol = { + BITCOIN: 0, + ETHEREUM: 1, + FABRIC: 3, + CORDA: 4 +}; + +/** + * optional Protocol protocol = 1; + * @return {!proto.common.state.Meta.Protocol} + */ +proto.common.state.Meta.prototype.getProtocol = function() { + return /** @type {!proto.common.state.Meta.Protocol} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.common.state.Meta.Protocol} value + * @return {!proto.common.state.Meta} returns this + */ +proto.common.state.Meta.prototype.setProtocol = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional string timestamp = 2; + * @return {string} + */ +proto.common.state.Meta.prototype.getTimestamp = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.state.Meta} returns this + */ +proto.common.state.Meta.prototype.setTimestamp = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string proof_type = 3; + * @return {string} + */ +proto.common.state.Meta.prototype.getProofType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.state.Meta} returns this + */ +proto.common.state.Meta.prototype.setProofType = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string serialization_format = 4; + * @return {string} + */ +proto.common.state.Meta.prototype.getSerializationFormat = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.state.Meta} returns this + */ +proto.common.state.Meta.prototype.setSerializationFormat = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.state.View.prototype.toObject = function(opt_includeInstance) { + return proto.common.state.View.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.state.View} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.state.View.toObject = function(includeInstance, msg) { + var f, obj = { + meta: (f = msg.getMeta()) && proto.common.state.Meta.toObject(includeInstance, f), + data: msg.getData_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.state.View} + */ +proto.common.state.View.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.state.View; + return proto.common.state.View.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.state.View} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.state.View} + */ +proto.common.state.View.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.common.state.Meta; + reader.readMessage(value,proto.common.state.Meta.deserializeBinaryFromReader); + msg.setMeta(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setData(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.state.View.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.state.View.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.state.View} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.state.View.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMeta(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.common.state.Meta.serializeBinaryToWriter + ); + } + f = message.getData_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional Meta meta = 1; + * @return {?proto.common.state.Meta} + */ +proto.common.state.View.prototype.getMeta = function() { + return /** @type{?proto.common.state.Meta} */ ( + jspb.Message.getWrapperField(this, proto.common.state.Meta, 1)); +}; + + +/** + * @param {?proto.common.state.Meta|undefined} value + * @return {!proto.common.state.View} returns this +*/ +proto.common.state.View.prototype.setMeta = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.common.state.View} returns this + */ +proto.common.state.View.prototype.clearMeta = function() { + return this.setMeta(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.common.state.View.prototype.hasMeta = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional bytes data = 2; + * @return {!(string|Uint8Array)} + */ +proto.common.state.View.prototype.getData = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes data = 2; + * This is a type-conversion wrapper around `getData()` + * @return {string} + */ +proto.common.state.View.prototype.getData_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getData())); +}; + + +/** + * optional bytes data = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getData()` + * @return {!Uint8Array} + */ +proto.common.state.View.prototype.getData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getData())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.common.state.View} returns this + */ +proto.common.state.View.prototype.setData = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.common.state.ViewPayload.oneofGroups_ = [[2,3]]; + +/** + * @enum {number} + */ +proto.common.state.ViewPayload.StateCase = { + STATE_NOT_SET: 0, + VIEW: 2, + ERROR: 3 +}; + +/** + * @return {proto.common.state.ViewPayload.StateCase} + */ +proto.common.state.ViewPayload.prototype.getStateCase = function() { + return /** @type {proto.common.state.ViewPayload.StateCase} */(jspb.Message.computeOneofCase(this, proto.common.state.ViewPayload.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.state.ViewPayload.prototype.toObject = function(opt_includeInstance) { + return proto.common.state.ViewPayload.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.state.ViewPayload} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.state.ViewPayload.toObject = function(includeInstance, msg) { + var f, obj = { + requestId: jspb.Message.getFieldWithDefault(msg, 1, ""), + view: (f = msg.getView()) && proto.common.state.View.toObject(includeInstance, f), + error: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.state.ViewPayload} + */ +proto.common.state.ViewPayload.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.state.ViewPayload; + return proto.common.state.ViewPayload.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.state.ViewPayload} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.state.ViewPayload} + */ +proto.common.state.ViewPayload.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setRequestId(value); + break; + case 2: + var value = new proto.common.state.View; + reader.readMessage(value,proto.common.state.View.deserializeBinaryFromReader); + msg.setView(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setError(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.state.ViewPayload.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.state.ViewPayload.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.state.ViewPayload} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.state.ViewPayload.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRequestId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getView(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.common.state.View.serializeBinaryToWriter + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional string request_id = 1; + * @return {string} + */ +proto.common.state.ViewPayload.prototype.getRequestId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.state.ViewPayload} returns this + */ +proto.common.state.ViewPayload.prototype.setRequestId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional View view = 2; + * @return {?proto.common.state.View} + */ +proto.common.state.ViewPayload.prototype.getView = function() { + return /** @type{?proto.common.state.View} */ ( + jspb.Message.getWrapperField(this, proto.common.state.View, 2)); +}; + + +/** + * @param {?proto.common.state.View|undefined} value + * @return {!proto.common.state.ViewPayload} returns this +*/ +proto.common.state.ViewPayload.prototype.setView = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.common.state.ViewPayload.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.common.state.ViewPayload} returns this + */ +proto.common.state.ViewPayload.prototype.clearView = function() { + return this.setView(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.common.state.ViewPayload.prototype.hasView = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional string error = 3; + * @return {string} + */ +proto.common.state.ViewPayload.prototype.getError = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.state.ViewPayload} returns this + */ +proto.common.state.ViewPayload.prototype.setError = function(value) { + return jspb.Message.setOneofField(this, 3, proto.common.state.ViewPayload.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.common.state.ViewPayload} returns this + */ +proto.common.state.ViewPayload.prototype.clearError = function() { + return jspb.Message.setOneofField(this, 3, proto.common.state.ViewPayload.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.common.state.ViewPayload.prototype.hasError = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.common.state.RequestState.oneofGroups_ = [[3,4]]; + +/** + * @enum {number} + */ +proto.common.state.RequestState.StateCase = { + STATE_NOT_SET: 0, + VIEW: 3, + ERROR: 4 +}; + +/** + * @return {proto.common.state.RequestState.StateCase} + */ +proto.common.state.RequestState.prototype.getStateCase = function() { + return /** @type {proto.common.state.RequestState.StateCase} */(jspb.Message.computeOneofCase(this, proto.common.state.RequestState.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.state.RequestState.prototype.toObject = function(opt_includeInstance) { + return proto.common.state.RequestState.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.state.RequestState} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.state.RequestState.toObject = function(includeInstance, msg) { + var f, obj = { + requestId: jspb.Message.getFieldWithDefault(msg, 1, ""), + status: jspb.Message.getFieldWithDefault(msg, 2, 0), + view: (f = msg.getView()) && proto.common.state.View.toObject(includeInstance, f), + error: jspb.Message.getFieldWithDefault(msg, 4, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.state.RequestState} + */ +proto.common.state.RequestState.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.state.RequestState; + return proto.common.state.RequestState.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.state.RequestState} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.state.RequestState} + */ +proto.common.state.RequestState.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setRequestId(value); + break; + case 2: + var value = /** @type {!proto.common.state.RequestState.STATUS} */ (reader.readEnum()); + msg.setStatus(value); + break; + case 3: + var value = new proto.common.state.View; + reader.readMessage(value,proto.common.state.View.deserializeBinaryFromReader); + msg.setView(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setError(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.state.RequestState.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.state.RequestState.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.state.RequestState} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.state.RequestState.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRequestId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getStatus(); + if (f !== 0.0) { + writer.writeEnum( + 2, + f + ); + } + f = message.getView(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.common.state.View.serializeBinaryToWriter + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeString( + 4, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.common.state.RequestState.STATUS = { + PENDING_ACK: 0, + PENDING: 1, + ERROR: 2, + COMPLETED: 3, + EVENT_RECEIVED: 4, + EVENT_WRITTEN: 5, + EVENT_WRITE_ERROR: 6, + DELETED: 7 +}; + +/** + * optional string request_id = 1; + * @return {string} + */ +proto.common.state.RequestState.prototype.getRequestId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.state.RequestState} returns this + */ +proto.common.state.RequestState.prototype.setRequestId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional STATUS status = 2; + * @return {!proto.common.state.RequestState.STATUS} + */ +proto.common.state.RequestState.prototype.getStatus = function() { + return /** @type {!proto.common.state.RequestState.STATUS} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {!proto.common.state.RequestState.STATUS} value + * @return {!proto.common.state.RequestState} returns this + */ +proto.common.state.RequestState.prototype.setStatus = function(value) { + return jspb.Message.setProto3EnumField(this, 2, value); +}; + + +/** + * optional View view = 3; + * @return {?proto.common.state.View} + */ +proto.common.state.RequestState.prototype.getView = function() { + return /** @type{?proto.common.state.View} */ ( + jspb.Message.getWrapperField(this, proto.common.state.View, 3)); +}; + + +/** + * @param {?proto.common.state.View|undefined} value + * @return {!proto.common.state.RequestState} returns this +*/ +proto.common.state.RequestState.prototype.setView = function(value) { + return jspb.Message.setOneofWrapperField(this, 3, proto.common.state.RequestState.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.common.state.RequestState} returns this + */ +proto.common.state.RequestState.prototype.clearView = function() { + return this.setView(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.common.state.RequestState.prototype.hasView = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional string error = 4; + * @return {string} + */ +proto.common.state.RequestState.prototype.getError = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.state.RequestState} returns this + */ +proto.common.state.RequestState.prototype.setError = function(value) { + return jspb.Message.setOneofField(this, 4, proto.common.state.RequestState.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.common.state.RequestState} returns this + */ +proto.common.state.RequestState.prototype.clearError = function() { + return jspb.Message.setOneofField(this, 4, proto.common.state.RequestState.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.common.state.RequestState.prototype.hasError = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +goog.object.extend(exports, proto.common.state); diff --git a/weaver/common/protos-js/common/verification_policy_pb.d.ts b/weaver/common/protos-js/common/verification_policy_pb.d.ts new file mode 100644 index 00000000000..63293ad4bad --- /dev/null +++ b/weaver/common/protos-js/common/verification_policy_pb.d.ts @@ -0,0 +1,83 @@ +// package: common.verification_policy +// file: common/verification_policy.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; + +export class VerificationPolicy extends jspb.Message { + getSecuritydomain(): string; + setSecuritydomain(value: string): VerificationPolicy; + clearIdentifiersList(): void; + getIdentifiersList(): Array; + setIdentifiersList(value: Array): VerificationPolicy; + addIdentifiers(value?: Identifier, index?: number): Identifier; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): VerificationPolicy.AsObject; + static toObject(includeInstance: boolean, msg: VerificationPolicy): VerificationPolicy.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: VerificationPolicy, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): VerificationPolicy; + static deserializeBinaryFromReader(message: VerificationPolicy, reader: jspb.BinaryReader): VerificationPolicy; +} + +export namespace VerificationPolicy { + export type AsObject = { + securitydomain: string, + identifiersList: Array, + } +} + +export class Policy extends jspb.Message { + getType(): string; + setType(value: string): Policy; + clearCriteriaList(): void; + getCriteriaList(): Array; + setCriteriaList(value: Array): Policy; + addCriteria(value: string, index?: number): string; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Policy.AsObject; + static toObject(includeInstance: boolean, msg: Policy): Policy.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Policy, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Policy; + static deserializeBinaryFromReader(message: Policy, reader: jspb.BinaryReader): Policy; +} + +export namespace Policy { + export type AsObject = { + type: string, + criteriaList: Array, + } +} + +export class Identifier extends jspb.Message { + getPattern(): string; + setPattern(value: string): Identifier; + + hasPolicy(): boolean; + clearPolicy(): void; + getPolicy(): Policy | undefined; + setPolicy(value?: Policy): Identifier; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Identifier.AsObject; + static toObject(includeInstance: boolean, msg: Identifier): Identifier.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Identifier, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Identifier; + static deserializeBinaryFromReader(message: Identifier, reader: jspb.BinaryReader): Identifier; +} + +export namespace Identifier { + export type AsObject = { + pattern: string, + policy?: Policy.AsObject, + } +} diff --git a/weaver/common/protos-js/common/verification_policy_pb.js b/weaver/common/protos-js/common/verification_policy_pb.js new file mode 100644 index 00000000000..634cd4c79cd --- /dev/null +++ b/weaver/common/protos-js/common/verification_policy_pb.js @@ -0,0 +1,647 @@ +// source: common/verification_policy.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +goog.exportSymbol('proto.common.verification_policy.Identifier', null, global); +goog.exportSymbol('proto.common.verification_policy.Policy', null, global); +goog.exportSymbol('proto.common.verification_policy.VerificationPolicy', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.verification_policy.VerificationPolicy = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.common.verification_policy.VerificationPolicy.repeatedFields_, null); +}; +goog.inherits(proto.common.verification_policy.VerificationPolicy, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.verification_policy.VerificationPolicy.displayName = 'proto.common.verification_policy.VerificationPolicy'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.verification_policy.Policy = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.common.verification_policy.Policy.repeatedFields_, null); +}; +goog.inherits(proto.common.verification_policy.Policy, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.verification_policy.Policy.displayName = 'proto.common.verification_policy.Policy'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.verification_policy.Identifier = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.verification_policy.Identifier, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.verification_policy.Identifier.displayName = 'proto.common.verification_policy.Identifier'; +} + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.common.verification_policy.VerificationPolicy.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.verification_policy.VerificationPolicy.prototype.toObject = function(opt_includeInstance) { + return proto.common.verification_policy.VerificationPolicy.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.verification_policy.VerificationPolicy} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.verification_policy.VerificationPolicy.toObject = function(includeInstance, msg) { + var f, obj = { + securitydomain: jspb.Message.getFieldWithDefault(msg, 1, ""), + identifiersList: jspb.Message.toObjectList(msg.getIdentifiersList(), + proto.common.verification_policy.Identifier.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.verification_policy.VerificationPolicy} + */ +proto.common.verification_policy.VerificationPolicy.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.verification_policy.VerificationPolicy; + return proto.common.verification_policy.VerificationPolicy.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.verification_policy.VerificationPolicy} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.verification_policy.VerificationPolicy} + */ +proto.common.verification_policy.VerificationPolicy.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setSecuritydomain(value); + break; + case 2: + var value = new proto.common.verification_policy.Identifier; + reader.readMessage(value,proto.common.verification_policy.Identifier.deserializeBinaryFromReader); + msg.addIdentifiers(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.verification_policy.VerificationPolicy.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.verification_policy.VerificationPolicy.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.verification_policy.VerificationPolicy} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.verification_policy.VerificationPolicy.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSecuritydomain(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getIdentifiersList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.common.verification_policy.Identifier.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string securityDomain = 1; + * @return {string} + */ +proto.common.verification_policy.VerificationPolicy.prototype.getSecuritydomain = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.verification_policy.VerificationPolicy} returns this + */ +proto.common.verification_policy.VerificationPolicy.prototype.setSecuritydomain = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * repeated Identifier identifiers = 2; + * @return {!Array} + */ +proto.common.verification_policy.VerificationPolicy.prototype.getIdentifiersList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.common.verification_policy.Identifier, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.common.verification_policy.VerificationPolicy} returns this +*/ +proto.common.verification_policy.VerificationPolicy.prototype.setIdentifiersList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.common.verification_policy.Identifier=} opt_value + * @param {number=} opt_index + * @return {!proto.common.verification_policy.Identifier} + */ +proto.common.verification_policy.VerificationPolicy.prototype.addIdentifiers = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.common.verification_policy.Identifier, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.common.verification_policy.VerificationPolicy} returns this + */ +proto.common.verification_policy.VerificationPolicy.prototype.clearIdentifiersList = function() { + return this.setIdentifiersList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.common.verification_policy.Policy.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.verification_policy.Policy.prototype.toObject = function(opt_includeInstance) { + return proto.common.verification_policy.Policy.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.verification_policy.Policy} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.verification_policy.Policy.toObject = function(includeInstance, msg) { + var f, obj = { + type: jspb.Message.getFieldWithDefault(msg, 1, ""), + criteriaList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.verification_policy.Policy} + */ +proto.common.verification_policy.Policy.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.verification_policy.Policy; + return proto.common.verification_policy.Policy.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.verification_policy.Policy} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.verification_policy.Policy} + */ +proto.common.verification_policy.Policy.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setType(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.addCriteria(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.verification_policy.Policy.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.verification_policy.Policy.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.verification_policy.Policy} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.verification_policy.Policy.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getType(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getCriteriaList(); + if (f.length > 0) { + writer.writeRepeatedString( + 2, + f + ); + } +}; + + +/** + * optional string type = 1; + * @return {string} + */ +proto.common.verification_policy.Policy.prototype.getType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.verification_policy.Policy} returns this + */ +proto.common.verification_policy.Policy.prototype.setType = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * repeated string criteria = 2; + * @return {!Array} + */ +proto.common.verification_policy.Policy.prototype.getCriteriaList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.common.verification_policy.Policy} returns this + */ +proto.common.verification_policy.Policy.prototype.setCriteriaList = function(value) { + return jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.common.verification_policy.Policy} returns this + */ +proto.common.verification_policy.Policy.prototype.addCriteria = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.common.verification_policy.Policy} returns this + */ +proto.common.verification_policy.Policy.prototype.clearCriteriaList = function() { + return this.setCriteriaList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.verification_policy.Identifier.prototype.toObject = function(opt_includeInstance) { + return proto.common.verification_policy.Identifier.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.verification_policy.Identifier} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.verification_policy.Identifier.toObject = function(includeInstance, msg) { + var f, obj = { + pattern: jspb.Message.getFieldWithDefault(msg, 1, ""), + policy: (f = msg.getPolicy()) && proto.common.verification_policy.Policy.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.verification_policy.Identifier} + */ +proto.common.verification_policy.Identifier.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.verification_policy.Identifier; + return proto.common.verification_policy.Identifier.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.verification_policy.Identifier} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.verification_policy.Identifier} + */ +proto.common.verification_policy.Identifier.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setPattern(value); + break; + case 2: + var value = new proto.common.verification_policy.Policy; + reader.readMessage(value,proto.common.verification_policy.Policy.deserializeBinaryFromReader); + msg.setPolicy(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.verification_policy.Identifier.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.verification_policy.Identifier.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.verification_policy.Identifier} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.verification_policy.Identifier.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPattern(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getPolicy(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.common.verification_policy.Policy.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string pattern = 1; + * @return {string} + */ +proto.common.verification_policy.Identifier.prototype.getPattern = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.verification_policy.Identifier} returns this + */ +proto.common.verification_policy.Identifier.prototype.setPattern = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional Policy policy = 2; + * @return {?proto.common.verification_policy.Policy} + */ +proto.common.verification_policy.Identifier.prototype.getPolicy = function() { + return /** @type{?proto.common.verification_policy.Policy} */ ( + jspb.Message.getWrapperField(this, proto.common.verification_policy.Policy, 2)); +}; + + +/** + * @param {?proto.common.verification_policy.Policy|undefined} value + * @return {!proto.common.verification_policy.Identifier} returns this +*/ +proto.common.verification_policy.Identifier.prototype.setPolicy = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.common.verification_policy.Identifier} returns this + */ +proto.common.verification_policy.Identifier.prototype.clearPolicy = function() { + return this.setPolicy(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.common.verification_policy.Identifier.prototype.hasPolicy = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +goog.object.extend(exports, proto.common.verification_policy); diff --git a/weaver/common/protos-js/corda/view_data_pb.d.ts b/weaver/common/protos-js/corda/view_data_pb.d.ts new file mode 100644 index 00000000000..0ba696d18de --- /dev/null +++ b/weaver/common/protos-js/corda/view_data_pb.d.ts @@ -0,0 +1,62 @@ +// package: corda +// file: corda/view_data.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; + +export class ViewData extends jspb.Message { + clearNotarizedPayloadsList(): void; + getNotarizedPayloadsList(): Array; + setNotarizedPayloadsList(value: Array): ViewData; + addNotarizedPayloads(value?: ViewData.NotarizedPayload, index?: number): ViewData.NotarizedPayload; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ViewData.AsObject; + static toObject(includeInstance: boolean, msg: ViewData): ViewData.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ViewData, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ViewData; + static deserializeBinaryFromReader(message: ViewData, reader: jspb.BinaryReader): ViewData; +} + +export namespace ViewData { + export type AsObject = { + notarizedPayloadsList: Array, + } + + + export class NotarizedPayload extends jspb.Message { + getSignature(): string; + setSignature(value: string): NotarizedPayload; + getCertificate(): string; + setCertificate(value: string): NotarizedPayload; + getId(): string; + setId(value: string): NotarizedPayload; + getPayload(): Uint8Array | string; + getPayload_asU8(): Uint8Array; + getPayload_asB64(): string; + setPayload(value: Uint8Array | string): NotarizedPayload; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): NotarizedPayload.AsObject; + static toObject(includeInstance: boolean, msg: NotarizedPayload): NotarizedPayload.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: NotarizedPayload, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): NotarizedPayload; + static deserializeBinaryFromReader(message: NotarizedPayload, reader: jspb.BinaryReader): NotarizedPayload; + } + + export namespace NotarizedPayload { + export type AsObject = { + signature: string, + certificate: string, + id: string, + payload: Uint8Array | string, + } + } + +} diff --git a/weaver/common/protos-js/corda/view_data_pb.js b/weaver/common/protos-js/corda/view_data_pb.js new file mode 100644 index 00000000000..a09c81808ed --- /dev/null +++ b/weaver/common/protos-js/corda/view_data_pb.js @@ -0,0 +1,472 @@ +// source: corda/view_data.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +goog.exportSymbol('proto.corda.ViewData', null, global); +goog.exportSymbol('proto.corda.ViewData.NotarizedPayload', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.corda.ViewData = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.corda.ViewData.repeatedFields_, null); +}; +goog.inherits(proto.corda.ViewData, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.corda.ViewData.displayName = 'proto.corda.ViewData'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.corda.ViewData.NotarizedPayload = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.corda.ViewData.NotarizedPayload, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.corda.ViewData.NotarizedPayload.displayName = 'proto.corda.ViewData.NotarizedPayload'; +} + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.corda.ViewData.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.corda.ViewData.prototype.toObject = function(opt_includeInstance) { + return proto.corda.ViewData.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.corda.ViewData} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.corda.ViewData.toObject = function(includeInstance, msg) { + var f, obj = { + notarizedPayloadsList: jspb.Message.toObjectList(msg.getNotarizedPayloadsList(), + proto.corda.ViewData.NotarizedPayload.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.corda.ViewData} + */ +proto.corda.ViewData.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.corda.ViewData; + return proto.corda.ViewData.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.corda.ViewData} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.corda.ViewData} + */ +proto.corda.ViewData.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.corda.ViewData.NotarizedPayload; + reader.readMessage(value,proto.corda.ViewData.NotarizedPayload.deserializeBinaryFromReader); + msg.addNotarizedPayloads(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.corda.ViewData.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.corda.ViewData.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.corda.ViewData} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.corda.ViewData.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getNotarizedPayloadsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.corda.ViewData.NotarizedPayload.serializeBinaryToWriter + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.corda.ViewData.NotarizedPayload.prototype.toObject = function(opt_includeInstance) { + return proto.corda.ViewData.NotarizedPayload.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.corda.ViewData.NotarizedPayload} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.corda.ViewData.NotarizedPayload.toObject = function(includeInstance, msg) { + var f, obj = { + signature: jspb.Message.getFieldWithDefault(msg, 1, ""), + certificate: jspb.Message.getFieldWithDefault(msg, 2, ""), + id: jspb.Message.getFieldWithDefault(msg, 3, ""), + payload: msg.getPayload_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.corda.ViewData.NotarizedPayload} + */ +proto.corda.ViewData.NotarizedPayload.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.corda.ViewData.NotarizedPayload; + return proto.corda.ViewData.NotarizedPayload.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.corda.ViewData.NotarizedPayload} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.corda.ViewData.NotarizedPayload} + */ +proto.corda.ViewData.NotarizedPayload.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setSignature(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setCertificate(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setPayload(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.corda.ViewData.NotarizedPayload.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.corda.ViewData.NotarizedPayload.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.corda.ViewData.NotarizedPayload} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.corda.ViewData.NotarizedPayload.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSignature(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getCertificate(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getPayload_asU8(); + if (f.length > 0) { + writer.writeBytes( + 4, + f + ); + } +}; + + +/** + * optional string signature = 1; + * @return {string} + */ +proto.corda.ViewData.NotarizedPayload.prototype.getSignature = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.corda.ViewData.NotarizedPayload} returns this + */ +proto.corda.ViewData.NotarizedPayload.prototype.setSignature = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string certificate = 2; + * @return {string} + */ +proto.corda.ViewData.NotarizedPayload.prototype.getCertificate = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.corda.ViewData.NotarizedPayload} returns this + */ +proto.corda.ViewData.NotarizedPayload.prototype.setCertificate = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string id = 3; + * @return {string} + */ +proto.corda.ViewData.NotarizedPayload.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.corda.ViewData.NotarizedPayload} returns this + */ +proto.corda.ViewData.NotarizedPayload.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional bytes payload = 4; + * @return {!(string|Uint8Array)} + */ +proto.corda.ViewData.NotarizedPayload.prototype.getPayload = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * optional bytes payload = 4; + * This is a type-conversion wrapper around `getPayload()` + * @return {string} + */ +proto.corda.ViewData.NotarizedPayload.prototype.getPayload_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPayload())); +}; + + +/** + * optional bytes payload = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPayload()` + * @return {!Uint8Array} + */ +proto.corda.ViewData.NotarizedPayload.prototype.getPayload_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPayload())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.corda.ViewData.NotarizedPayload} returns this + */ +proto.corda.ViewData.NotarizedPayload.prototype.setPayload = function(value) { + return jspb.Message.setProto3BytesField(this, 4, value); +}; + + +/** + * repeated NotarizedPayload notarized_payloads = 1; + * @return {!Array} + */ +proto.corda.ViewData.prototype.getNotarizedPayloadsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.corda.ViewData.NotarizedPayload, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.corda.ViewData} returns this +*/ +proto.corda.ViewData.prototype.setNotarizedPayloadsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.corda.ViewData.NotarizedPayload=} opt_value + * @param {number=} opt_index + * @return {!proto.corda.ViewData.NotarizedPayload} + */ +proto.corda.ViewData.prototype.addNotarizedPayloads = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.corda.ViewData.NotarizedPayload, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.corda.ViewData} returns this + */ +proto.corda.ViewData.prototype.clearNotarizedPayloadsList = function() { + return this.setNotarizedPayloadsList([]); +}; + + +goog.object.extend(exports, proto.corda); diff --git a/weaver/common/protos-js/driver/driver_grpc_pb.d.ts b/weaver/common/protos-js/driver/driver_grpc_pb.d.ts new file mode 100644 index 00000000000..8b56a3c551b --- /dev/null +++ b/weaver/common/protos-js/driver/driver_grpc_pb.d.ts @@ -0,0 +1,164 @@ +// package: driver.driver +// file: driver/driver.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as grpc from "@grpc/grpc-js"; +import * as driver_driver_pb from "../driver/driver_pb"; +import * as common_ack_pb from "../common/ack_pb"; +import * as common_query_pb from "../common/query_pb"; +import * as common_events_pb from "../common/events_pb"; +import * as common_state_pb from "../common/state_pb"; + +interface IDriverCommunicationService extends grpc.ServiceDefinition { + requestDriverState: IDriverCommunicationService_IRequestDriverState; + subscribeEvent: IDriverCommunicationService_ISubscribeEvent; + requestSignedEventSubscriptionQuery: IDriverCommunicationService_IRequestSignedEventSubscriptionQuery; + writeExternalState: IDriverCommunicationService_IWriteExternalState; + performLock: IDriverCommunicationService_IPerformLock; + createAsset: IDriverCommunicationService_ICreateAsset; + extinguish: IDriverCommunicationService_IExtinguish; + assignAsset: IDriverCommunicationService_IAssignAsset; +} + +interface IDriverCommunicationService_IRequestDriverState extends grpc.MethodDefinition { + path: "/driver.driver.DriverCommunication/RequestDriverState"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IDriverCommunicationService_ISubscribeEvent extends grpc.MethodDefinition { + path: "/driver.driver.DriverCommunication/SubscribeEvent"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IDriverCommunicationService_IRequestSignedEventSubscriptionQuery extends grpc.MethodDefinition { + path: "/driver.driver.DriverCommunication/RequestSignedEventSubscriptionQuery"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IDriverCommunicationService_IWriteExternalState extends grpc.MethodDefinition { + path: "/driver.driver.DriverCommunication/WriteExternalState"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IDriverCommunicationService_IPerformLock extends grpc.MethodDefinition { + path: "/driver.driver.DriverCommunication/PerformLock"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IDriverCommunicationService_ICreateAsset extends grpc.MethodDefinition { + path: "/driver.driver.DriverCommunication/CreateAsset"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IDriverCommunicationService_IExtinguish extends grpc.MethodDefinition { + path: "/driver.driver.DriverCommunication/Extinguish"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IDriverCommunicationService_IAssignAsset extends grpc.MethodDefinition { + path: "/driver.driver.DriverCommunication/AssignAsset"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} + +export const DriverCommunicationService: IDriverCommunicationService; + +export interface IDriverCommunicationServer extends grpc.UntypedServiceImplementation { + requestDriverState: grpc.handleUnaryCall; + subscribeEvent: grpc.handleUnaryCall; + requestSignedEventSubscriptionQuery: grpc.handleUnaryCall; + writeExternalState: grpc.handleUnaryCall; + performLock: grpc.handleUnaryCall; + createAsset: grpc.handleUnaryCall; + extinguish: grpc.handleUnaryCall; + assignAsset: grpc.handleUnaryCall; +} + +export interface IDriverCommunicationClient { + requestDriverState(request: common_query_pb.Query, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + requestDriverState(request: common_query_pb.Query, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + requestDriverState(request: common_query_pb.Query, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + subscribeEvent(request: common_events_pb.EventSubscription, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + subscribeEvent(request: common_events_pb.EventSubscription, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + subscribeEvent(request: common_events_pb.EventSubscription, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + requestSignedEventSubscriptionQuery(request: common_events_pb.EventSubscription, callback: (error: grpc.ServiceError | null, response: common_query_pb.Query) => void): grpc.ClientUnaryCall; + requestSignedEventSubscriptionQuery(request: common_events_pb.EventSubscription, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_query_pb.Query) => void): grpc.ClientUnaryCall; + requestSignedEventSubscriptionQuery(request: common_events_pb.EventSubscription, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_query_pb.Query) => void): grpc.ClientUnaryCall; + writeExternalState(request: driver_driver_pb.WriteExternalStateMessage, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + writeExternalState(request: driver_driver_pb.WriteExternalStateMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + writeExternalState(request: driver_driver_pb.WriteExternalStateMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + performLock(request: driver_driver_pb.PerformLockRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + performLock(request: driver_driver_pb.PerformLockRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + performLock(request: driver_driver_pb.PerformLockRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + createAsset(request: driver_driver_pb.CreateAssetRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + createAsset(request: driver_driver_pb.CreateAssetRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + createAsset(request: driver_driver_pb.CreateAssetRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + extinguish(request: driver_driver_pb.ExtinguishRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + extinguish(request: driver_driver_pb.ExtinguishRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + extinguish(request: driver_driver_pb.ExtinguishRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + assignAsset(request: driver_driver_pb.AssignAssetRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + assignAsset(request: driver_driver_pb.AssignAssetRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + assignAsset(request: driver_driver_pb.AssignAssetRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; +} + +export class DriverCommunicationClient extends grpc.Client implements IDriverCommunicationClient { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: Partial); + public requestDriverState(request: common_query_pb.Query, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public requestDriverState(request: common_query_pb.Query, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public requestDriverState(request: common_query_pb.Query, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public subscribeEvent(request: common_events_pb.EventSubscription, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public subscribeEvent(request: common_events_pb.EventSubscription, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public subscribeEvent(request: common_events_pb.EventSubscription, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public requestSignedEventSubscriptionQuery(request: common_events_pb.EventSubscription, callback: (error: grpc.ServiceError | null, response: common_query_pb.Query) => void): grpc.ClientUnaryCall; + public requestSignedEventSubscriptionQuery(request: common_events_pb.EventSubscription, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_query_pb.Query) => void): grpc.ClientUnaryCall; + public requestSignedEventSubscriptionQuery(request: common_events_pb.EventSubscription, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_query_pb.Query) => void): grpc.ClientUnaryCall; + public writeExternalState(request: driver_driver_pb.WriteExternalStateMessage, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public writeExternalState(request: driver_driver_pb.WriteExternalStateMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public writeExternalState(request: driver_driver_pb.WriteExternalStateMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public performLock(request: driver_driver_pb.PerformLockRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public performLock(request: driver_driver_pb.PerformLockRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public performLock(request: driver_driver_pb.PerformLockRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public createAsset(request: driver_driver_pb.CreateAssetRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public createAsset(request: driver_driver_pb.CreateAssetRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public createAsset(request: driver_driver_pb.CreateAssetRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public extinguish(request: driver_driver_pb.ExtinguishRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public extinguish(request: driver_driver_pb.ExtinguishRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public extinguish(request: driver_driver_pb.ExtinguishRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public assignAsset(request: driver_driver_pb.AssignAssetRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public assignAsset(request: driver_driver_pb.AssignAssetRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public assignAsset(request: driver_driver_pb.AssignAssetRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; +} diff --git a/weaver/common/protos-js/driver/driver_grpc_pb.js b/weaver/common/protos-js/driver/driver_grpc_pb.js new file mode 100644 index 00000000000..90192efa4e3 --- /dev/null +++ b/weaver/common/protos-js/driver/driver_grpc_pb.js @@ -0,0 +1,214 @@ +// GENERATED CODE -- DO NOT EDIT! + +// Original file comments: +// Copyright IBM Corp. All Rights Reserved. +// +// SPDX-License-Identifier: Apache-2.0 +// +'use strict'; +var grpc = require('@grpc/grpc-js'); +var driver_driver_pb = require('../driver/driver_pb.js'); +var common_ack_pb = require('../common/ack_pb.js'); +var common_query_pb = require('../common/query_pb.js'); +var common_events_pb = require('../common/events_pb.js'); +var common_state_pb = require('../common/state_pb.js'); + +function serialize_common_ack_Ack(arg) { + if (!(arg instanceof common_ack_pb.Ack)) { + throw new Error('Expected argument of type common.ack.Ack'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_common_ack_Ack(buffer_arg) { + return common_ack_pb.Ack.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_common_events_EventSubscription(arg) { + if (!(arg instanceof common_events_pb.EventSubscription)) { + throw new Error('Expected argument of type common.events.EventSubscription'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_common_events_EventSubscription(buffer_arg) { + return common_events_pb.EventSubscription.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_common_query_Query(arg) { + if (!(arg instanceof common_query_pb.Query)) { + throw new Error('Expected argument of type common.query.Query'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_common_query_Query(buffer_arg) { + return common_query_pb.Query.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_driver_driver_AssignAssetRequest(arg) { + if (!(arg instanceof driver_driver_pb.AssignAssetRequest)) { + throw new Error('Expected argument of type driver.driver.AssignAssetRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_driver_driver_AssignAssetRequest(buffer_arg) { + return driver_driver_pb.AssignAssetRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_driver_driver_CreateAssetRequest(arg) { + if (!(arg instanceof driver_driver_pb.CreateAssetRequest)) { + throw new Error('Expected argument of type driver.driver.CreateAssetRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_driver_driver_CreateAssetRequest(buffer_arg) { + return driver_driver_pb.CreateAssetRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_driver_driver_ExtinguishRequest(arg) { + if (!(arg instanceof driver_driver_pb.ExtinguishRequest)) { + throw new Error('Expected argument of type driver.driver.ExtinguishRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_driver_driver_ExtinguishRequest(buffer_arg) { + return driver_driver_pb.ExtinguishRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_driver_driver_PerformLockRequest(arg) { + if (!(arg instanceof driver_driver_pb.PerformLockRequest)) { + throw new Error('Expected argument of type driver.driver.PerformLockRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_driver_driver_PerformLockRequest(buffer_arg) { + return driver_driver_pb.PerformLockRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_driver_driver_WriteExternalStateMessage(arg) { + if (!(arg instanceof driver_driver_pb.WriteExternalStateMessage)) { + throw new Error('Expected argument of type driver.driver.WriteExternalStateMessage'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_driver_driver_WriteExternalStateMessage(buffer_arg) { + return driver_driver_pb.WriteExternalStateMessage.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +var DriverCommunicationService = exports.DriverCommunicationService = { + // Data Sharing +// the remote relay sends a RequestDriverState request to its driver with a +// query defining the data it wants to receive +requestDriverState: { + path: '/driver.driver.DriverCommunication/RequestDriverState', + requestStream: false, + responseStream: false, + requestType: common_query_pb.Query, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_common_query_Query, + requestDeserialize: deserialize_common_query_Query, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + // Events Subscription +// the src-relay uses this endpoint to forward the event subscription request from dest-relay to driver +subscribeEvent: { + path: '/driver.driver.DriverCommunication/SubscribeEvent', + requestStream: false, + responseStream: false, + requestType: common_events_pb.EventSubscription, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_common_events_EventSubscription, + requestDeserialize: deserialize_common_events_EventSubscription, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + // Recommended to have TLS mode on for this unsafe endpoint +// Relay uses this to get Query.requestor_signature and +// Query.certificate required for event subscription +requestSignedEventSubscriptionQuery: { + path: '/driver.driver.DriverCommunication/RequestSignedEventSubscriptionQuery', + requestStream: false, + responseStream: false, + requestType: common_events_pb.EventSubscription, + responseType: common_query_pb.Query, + requestSerialize: serialize_common_events_EventSubscription, + requestDeserialize: deserialize_common_events_EventSubscription, + responseSerialize: serialize_common_query_Query, + responseDeserialize: deserialize_common_query_Query, + }, + // Events Publication +// the dest-relay calls the dest-driver on this end point to write the remote network state to the local ledger +writeExternalState: { + path: '/driver.driver.DriverCommunication/WriteExternalState', + requestStream: false, + responseStream: false, + requestType: driver_driver_pb.WriteExternalStateMessage, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_driver_driver_WriteExternalStateMessage, + requestDeserialize: deserialize_driver_driver_WriteExternalStateMessage, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + // As part of SATP, the source reply (sender gateway) sends a PerformLock request to its driver +// to lock a specific asset +performLock: { + path: '/driver.driver.DriverCommunication/PerformLock', + requestStream: false, + responseStream: false, + requestType: driver_driver_pb.PerformLockRequest, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_driver_driver_PerformLockRequest, + requestDeserialize: deserialize_driver_driver_PerformLockRequest, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + // As part of SATP, the destination reply (receiver gateway) sends a CreateAsset request to its driver +// to create a specific asset +createAsset: { + path: '/driver.driver.DriverCommunication/CreateAsset', + requestStream: false, + responseStream: false, + requestType: driver_driver_pb.CreateAssetRequest, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_driver_driver_CreateAssetRequest, + requestDeserialize: deserialize_driver_driver_CreateAssetRequest, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + // As part of SATP, the source reply (sender gateway) sends a Extinguish request to its driver +// to extinguish a specific asset +extinguish: { + path: '/driver.driver.DriverCommunication/Extinguish', + requestStream: false, + responseStream: false, + requestType: driver_driver_pb.ExtinguishRequest, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_driver_driver_ExtinguishRequest, + requestDeserialize: deserialize_driver_driver_ExtinguishRequest, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + // As part of SATP, the destination reply (receiver gateway) sends a AssignAsset request to its driver +// to assign a specific asset +assignAsset: { + path: '/driver.driver.DriverCommunication/AssignAsset', + requestStream: false, + responseStream: false, + requestType: driver_driver_pb.AssignAssetRequest, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_driver_driver_AssignAssetRequest, + requestDeserialize: deserialize_driver_driver_AssignAssetRequest, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, +}; + +exports.DriverCommunicationClient = grpc.makeGenericClientConstructor(DriverCommunicationService); diff --git a/weaver/common/protos-js/driver/driver_pb.d.ts b/weaver/common/protos-js/driver/driver_pb.d.ts new file mode 100644 index 00000000000..a07b209846e --- /dev/null +++ b/weaver/common/protos-js/driver/driver_pb.d.ts @@ -0,0 +1,120 @@ +// package: driver.driver +// file: driver/driver.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; +import * as common_ack_pb from "../common/ack_pb"; +import * as common_query_pb from "../common/query_pb"; +import * as common_events_pb from "../common/events_pb"; +import * as common_state_pb from "../common/state_pb"; + +export class WriteExternalStateMessage extends jspb.Message { + + hasViewPayload(): boolean; + clearViewPayload(): void; + getViewPayload(): common_state_pb.ViewPayload | undefined; + setViewPayload(value?: common_state_pb.ViewPayload): WriteExternalStateMessage; + + hasCtx(): boolean; + clearCtx(): void; + getCtx(): common_events_pb.ContractTransaction | undefined; + setCtx(value?: common_events_pb.ContractTransaction): WriteExternalStateMessage; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WriteExternalStateMessage.AsObject; + static toObject(includeInstance: boolean, msg: WriteExternalStateMessage): WriteExternalStateMessage.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WriteExternalStateMessage, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WriteExternalStateMessage; + static deserializeBinaryFromReader(message: WriteExternalStateMessage, reader: jspb.BinaryReader): WriteExternalStateMessage; +} + +export namespace WriteExternalStateMessage { + export type AsObject = { + viewPayload?: common_state_pb.ViewPayload.AsObject, + ctx?: common_events_pb.ContractTransaction.AsObject, + } +} + +export class PerformLockRequest extends jspb.Message { + getSessionId(): string; + setSessionId(value: string): PerformLockRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): PerformLockRequest.AsObject; + static toObject(includeInstance: boolean, msg: PerformLockRequest): PerformLockRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: PerformLockRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): PerformLockRequest; + static deserializeBinaryFromReader(message: PerformLockRequest, reader: jspb.BinaryReader): PerformLockRequest; +} + +export namespace PerformLockRequest { + export type AsObject = { + sessionId: string, + } +} + +export class CreateAssetRequest extends jspb.Message { + getSessionId(): string; + setSessionId(value: string): CreateAssetRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): CreateAssetRequest.AsObject; + static toObject(includeInstance: boolean, msg: CreateAssetRequest): CreateAssetRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: CreateAssetRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): CreateAssetRequest; + static deserializeBinaryFromReader(message: CreateAssetRequest, reader: jspb.BinaryReader): CreateAssetRequest; +} + +export namespace CreateAssetRequest { + export type AsObject = { + sessionId: string, + } +} + +export class ExtinguishRequest extends jspb.Message { + getSessionId(): string; + setSessionId(value: string): ExtinguishRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ExtinguishRequest.AsObject; + static toObject(includeInstance: boolean, msg: ExtinguishRequest): ExtinguishRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ExtinguishRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ExtinguishRequest; + static deserializeBinaryFromReader(message: ExtinguishRequest, reader: jspb.BinaryReader): ExtinguishRequest; +} + +export namespace ExtinguishRequest { + export type AsObject = { + sessionId: string, + } +} + +export class AssignAssetRequest extends jspb.Message { + getSessionId(): string; + setSessionId(value: string): AssignAssetRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AssignAssetRequest.AsObject; + static toObject(includeInstance: boolean, msg: AssignAssetRequest): AssignAssetRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AssignAssetRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AssignAssetRequest; + static deserializeBinaryFromReader(message: AssignAssetRequest, reader: jspb.BinaryReader): AssignAssetRequest; +} + +export namespace AssignAssetRequest { + export type AsObject = { + sessionId: string, + } +} diff --git a/weaver/common/protos-js/driver/driver_pb.js b/weaver/common/protos-js/driver/driver_pb.js new file mode 100644 index 00000000000..ab845a18e9b --- /dev/null +++ b/weaver/common/protos-js/driver/driver_pb.js @@ -0,0 +1,864 @@ +// source: driver/driver.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +var common_ack_pb = require('../common/ack_pb.js'); +goog.object.extend(proto, common_ack_pb); +var common_query_pb = require('../common/query_pb.js'); +goog.object.extend(proto, common_query_pb); +var common_events_pb = require('../common/events_pb.js'); +goog.object.extend(proto, common_events_pb); +var common_state_pb = require('../common/state_pb.js'); +goog.object.extend(proto, common_state_pb); +goog.exportSymbol('proto.driver.driver.AssignAssetRequest', null, global); +goog.exportSymbol('proto.driver.driver.CreateAssetRequest', null, global); +goog.exportSymbol('proto.driver.driver.ExtinguishRequest', null, global); +goog.exportSymbol('proto.driver.driver.PerformLockRequest', null, global); +goog.exportSymbol('proto.driver.driver.WriteExternalStateMessage', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.driver.driver.WriteExternalStateMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.driver.driver.WriteExternalStateMessage, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.driver.driver.WriteExternalStateMessage.displayName = 'proto.driver.driver.WriteExternalStateMessage'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.driver.driver.PerformLockRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.driver.driver.PerformLockRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.driver.driver.PerformLockRequest.displayName = 'proto.driver.driver.PerformLockRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.driver.driver.CreateAssetRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.driver.driver.CreateAssetRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.driver.driver.CreateAssetRequest.displayName = 'proto.driver.driver.CreateAssetRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.driver.driver.ExtinguishRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.driver.driver.ExtinguishRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.driver.driver.ExtinguishRequest.displayName = 'proto.driver.driver.ExtinguishRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.driver.driver.AssignAssetRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.driver.driver.AssignAssetRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.driver.driver.AssignAssetRequest.displayName = 'proto.driver.driver.AssignAssetRequest'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.driver.driver.WriteExternalStateMessage.prototype.toObject = function(opt_includeInstance) { + return proto.driver.driver.WriteExternalStateMessage.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.driver.driver.WriteExternalStateMessage} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.driver.driver.WriteExternalStateMessage.toObject = function(includeInstance, msg) { + var f, obj = { + viewPayload: (f = msg.getViewPayload()) && common_state_pb.ViewPayload.toObject(includeInstance, f), + ctx: (f = msg.getCtx()) && common_events_pb.ContractTransaction.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.driver.driver.WriteExternalStateMessage} + */ +proto.driver.driver.WriteExternalStateMessage.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.driver.driver.WriteExternalStateMessage; + return proto.driver.driver.WriteExternalStateMessage.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.driver.driver.WriteExternalStateMessage} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.driver.driver.WriteExternalStateMessage} + */ +proto.driver.driver.WriteExternalStateMessage.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new common_state_pb.ViewPayload; + reader.readMessage(value,common_state_pb.ViewPayload.deserializeBinaryFromReader); + msg.setViewPayload(value); + break; + case 2: + var value = new common_events_pb.ContractTransaction; + reader.readMessage(value,common_events_pb.ContractTransaction.deserializeBinaryFromReader); + msg.setCtx(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.driver.driver.WriteExternalStateMessage.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.driver.driver.WriteExternalStateMessage.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.driver.driver.WriteExternalStateMessage} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.driver.driver.WriteExternalStateMessage.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getViewPayload(); + if (f != null) { + writer.writeMessage( + 1, + f, + common_state_pb.ViewPayload.serializeBinaryToWriter + ); + } + f = message.getCtx(); + if (f != null) { + writer.writeMessage( + 2, + f, + common_events_pb.ContractTransaction.serializeBinaryToWriter + ); + } +}; + + +/** + * optional common.state.ViewPayload view_payload = 1; + * @return {?proto.common.state.ViewPayload} + */ +proto.driver.driver.WriteExternalStateMessage.prototype.getViewPayload = function() { + return /** @type{?proto.common.state.ViewPayload} */ ( + jspb.Message.getWrapperField(this, common_state_pb.ViewPayload, 1)); +}; + + +/** + * @param {?proto.common.state.ViewPayload|undefined} value + * @return {!proto.driver.driver.WriteExternalStateMessage} returns this +*/ +proto.driver.driver.WriteExternalStateMessage.prototype.setViewPayload = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.driver.driver.WriteExternalStateMessage} returns this + */ +proto.driver.driver.WriteExternalStateMessage.prototype.clearViewPayload = function() { + return this.setViewPayload(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.driver.driver.WriteExternalStateMessage.prototype.hasViewPayload = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional common.events.ContractTransaction ctx = 2; + * @return {?proto.common.events.ContractTransaction} + */ +proto.driver.driver.WriteExternalStateMessage.prototype.getCtx = function() { + return /** @type{?proto.common.events.ContractTransaction} */ ( + jspb.Message.getWrapperField(this, common_events_pb.ContractTransaction, 2)); +}; + + +/** + * @param {?proto.common.events.ContractTransaction|undefined} value + * @return {!proto.driver.driver.WriteExternalStateMessage} returns this +*/ +proto.driver.driver.WriteExternalStateMessage.prototype.setCtx = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.driver.driver.WriteExternalStateMessage} returns this + */ +proto.driver.driver.WriteExternalStateMessage.prototype.clearCtx = function() { + return this.setCtx(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.driver.driver.WriteExternalStateMessage.prototype.hasCtx = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.driver.driver.PerformLockRequest.prototype.toObject = function(opt_includeInstance) { + return proto.driver.driver.PerformLockRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.driver.driver.PerformLockRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.driver.driver.PerformLockRequest.toObject = function(includeInstance, msg) { + var f, obj = { + sessionId: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.driver.driver.PerformLockRequest} + */ +proto.driver.driver.PerformLockRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.driver.driver.PerformLockRequest; + return proto.driver.driver.PerformLockRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.driver.driver.PerformLockRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.driver.driver.PerformLockRequest} + */ +proto.driver.driver.PerformLockRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setSessionId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.driver.driver.PerformLockRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.driver.driver.PerformLockRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.driver.driver.PerformLockRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.driver.driver.PerformLockRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSessionId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string session_id = 1; + * @return {string} + */ +proto.driver.driver.PerformLockRequest.prototype.getSessionId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.driver.driver.PerformLockRequest} returns this + */ +proto.driver.driver.PerformLockRequest.prototype.setSessionId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.driver.driver.CreateAssetRequest.prototype.toObject = function(opt_includeInstance) { + return proto.driver.driver.CreateAssetRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.driver.driver.CreateAssetRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.driver.driver.CreateAssetRequest.toObject = function(includeInstance, msg) { + var f, obj = { + sessionId: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.driver.driver.CreateAssetRequest} + */ +proto.driver.driver.CreateAssetRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.driver.driver.CreateAssetRequest; + return proto.driver.driver.CreateAssetRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.driver.driver.CreateAssetRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.driver.driver.CreateAssetRequest} + */ +proto.driver.driver.CreateAssetRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setSessionId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.driver.driver.CreateAssetRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.driver.driver.CreateAssetRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.driver.driver.CreateAssetRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.driver.driver.CreateAssetRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSessionId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string session_id = 1; + * @return {string} + */ +proto.driver.driver.CreateAssetRequest.prototype.getSessionId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.driver.driver.CreateAssetRequest} returns this + */ +proto.driver.driver.CreateAssetRequest.prototype.setSessionId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.driver.driver.ExtinguishRequest.prototype.toObject = function(opt_includeInstance) { + return proto.driver.driver.ExtinguishRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.driver.driver.ExtinguishRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.driver.driver.ExtinguishRequest.toObject = function(includeInstance, msg) { + var f, obj = { + sessionId: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.driver.driver.ExtinguishRequest} + */ +proto.driver.driver.ExtinguishRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.driver.driver.ExtinguishRequest; + return proto.driver.driver.ExtinguishRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.driver.driver.ExtinguishRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.driver.driver.ExtinguishRequest} + */ +proto.driver.driver.ExtinguishRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setSessionId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.driver.driver.ExtinguishRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.driver.driver.ExtinguishRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.driver.driver.ExtinguishRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.driver.driver.ExtinguishRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSessionId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string session_id = 1; + * @return {string} + */ +proto.driver.driver.ExtinguishRequest.prototype.getSessionId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.driver.driver.ExtinguishRequest} returns this + */ +proto.driver.driver.ExtinguishRequest.prototype.setSessionId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.driver.driver.AssignAssetRequest.prototype.toObject = function(opt_includeInstance) { + return proto.driver.driver.AssignAssetRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.driver.driver.AssignAssetRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.driver.driver.AssignAssetRequest.toObject = function(includeInstance, msg) { + var f, obj = { + sessionId: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.driver.driver.AssignAssetRequest} + */ +proto.driver.driver.AssignAssetRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.driver.driver.AssignAssetRequest; + return proto.driver.driver.AssignAssetRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.driver.driver.AssignAssetRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.driver.driver.AssignAssetRequest} + */ +proto.driver.driver.AssignAssetRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setSessionId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.driver.driver.AssignAssetRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.driver.driver.AssignAssetRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.driver.driver.AssignAssetRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.driver.driver.AssignAssetRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSessionId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string session_id = 1; + * @return {string} + */ +proto.driver.driver.AssignAssetRequest.prototype.getSessionId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.driver.driver.AssignAssetRequest} returns this + */ +proto.driver.driver.AssignAssetRequest.prototype.setSessionId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +goog.object.extend(exports, proto.driver.driver); diff --git a/weaver/common/protos-js/fabric/view_data_pb.d.ts b/weaver/common/protos-js/fabric/view_data_pb.d.ts new file mode 100644 index 00000000000..da4da2fb1cf --- /dev/null +++ b/weaver/common/protos-js/fabric/view_data_pb.d.ts @@ -0,0 +1,61 @@ +// package: fabric.view_data +// file: fabric/view_data.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; +import * as peer_proposal_response_pb from "../peer/proposal_response_pb"; + +export class FabricView extends jspb.Message { + clearEndorsedProposalResponsesList(): void; + getEndorsedProposalResponsesList(): Array; + setEndorsedProposalResponsesList(value: Array): FabricView; + addEndorsedProposalResponses(value?: FabricView.EndorsedProposalResponse, index?: number): FabricView.EndorsedProposalResponse; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): FabricView.AsObject; + static toObject(includeInstance: boolean, msg: FabricView): FabricView.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: FabricView, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): FabricView; + static deserializeBinaryFromReader(message: FabricView, reader: jspb.BinaryReader): FabricView; +} + +export namespace FabricView { + export type AsObject = { + endorsedProposalResponsesList: Array, + } + + + export class EndorsedProposalResponse extends jspb.Message { + + hasPayload(): boolean; + clearPayload(): void; + getPayload(): peer_proposal_response_pb.ProposalResponsePayload | undefined; + setPayload(value?: peer_proposal_response_pb.ProposalResponsePayload): EndorsedProposalResponse; + + hasEndorsement(): boolean; + clearEndorsement(): void; + getEndorsement(): peer_proposal_response_pb.Endorsement | undefined; + setEndorsement(value?: peer_proposal_response_pb.Endorsement): EndorsedProposalResponse; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): EndorsedProposalResponse.AsObject; + static toObject(includeInstance: boolean, msg: EndorsedProposalResponse): EndorsedProposalResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: EndorsedProposalResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): EndorsedProposalResponse; + static deserializeBinaryFromReader(message: EndorsedProposalResponse, reader: jspb.BinaryReader): EndorsedProposalResponse; + } + + export namespace EndorsedProposalResponse { + export type AsObject = { + payload?: peer_proposal_response_pb.ProposalResponsePayload.AsObject, + endorsement?: peer_proposal_response_pb.Endorsement.AsObject, + } + } + +} diff --git a/weaver/common/protos-js/fabric/view_data_pb.js b/weaver/common/protos-js/fabric/view_data_pb.js new file mode 100644 index 00000000000..51508f1c7aa --- /dev/null +++ b/weaver/common/protos-js/fabric/view_data_pb.js @@ -0,0 +1,432 @@ +// source: fabric/view_data.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +var peer_proposal_response_pb = require('../peer/proposal_response_pb.js'); +goog.object.extend(proto, peer_proposal_response_pb); +goog.exportSymbol('proto.fabric.view_data.FabricView', null, global); +goog.exportSymbol('proto.fabric.view_data.FabricView.EndorsedProposalResponse', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.fabric.view_data.FabricView = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.fabric.view_data.FabricView.repeatedFields_, null); +}; +goog.inherits(proto.fabric.view_data.FabricView, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.fabric.view_data.FabricView.displayName = 'proto.fabric.view_data.FabricView'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.fabric.view_data.FabricView.EndorsedProposalResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.fabric.view_data.FabricView.EndorsedProposalResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.fabric.view_data.FabricView.EndorsedProposalResponse.displayName = 'proto.fabric.view_data.FabricView.EndorsedProposalResponse'; +} + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.fabric.view_data.FabricView.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.fabric.view_data.FabricView.prototype.toObject = function(opt_includeInstance) { + return proto.fabric.view_data.FabricView.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.fabric.view_data.FabricView} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.fabric.view_data.FabricView.toObject = function(includeInstance, msg) { + var f, obj = { + endorsedProposalResponsesList: jspb.Message.toObjectList(msg.getEndorsedProposalResponsesList(), + proto.fabric.view_data.FabricView.EndorsedProposalResponse.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.fabric.view_data.FabricView} + */ +proto.fabric.view_data.FabricView.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.fabric.view_data.FabricView; + return proto.fabric.view_data.FabricView.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.fabric.view_data.FabricView} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.fabric.view_data.FabricView} + */ +proto.fabric.view_data.FabricView.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.fabric.view_data.FabricView.EndorsedProposalResponse; + reader.readMessage(value,proto.fabric.view_data.FabricView.EndorsedProposalResponse.deserializeBinaryFromReader); + msg.addEndorsedProposalResponses(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.fabric.view_data.FabricView.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.fabric.view_data.FabricView.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.fabric.view_data.FabricView} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.fabric.view_data.FabricView.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getEndorsedProposalResponsesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.fabric.view_data.FabricView.EndorsedProposalResponse.serializeBinaryToWriter + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.fabric.view_data.FabricView.EndorsedProposalResponse.prototype.toObject = function(opt_includeInstance) { + return proto.fabric.view_data.FabricView.EndorsedProposalResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.fabric.view_data.FabricView.EndorsedProposalResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.fabric.view_data.FabricView.EndorsedProposalResponse.toObject = function(includeInstance, msg) { + var f, obj = { + payload: (f = msg.getPayload()) && peer_proposal_response_pb.ProposalResponsePayload.toObject(includeInstance, f), + endorsement: (f = msg.getEndorsement()) && peer_proposal_response_pb.Endorsement.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.fabric.view_data.FabricView.EndorsedProposalResponse} + */ +proto.fabric.view_data.FabricView.EndorsedProposalResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.fabric.view_data.FabricView.EndorsedProposalResponse; + return proto.fabric.view_data.FabricView.EndorsedProposalResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.fabric.view_data.FabricView.EndorsedProposalResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.fabric.view_data.FabricView.EndorsedProposalResponse} + */ +proto.fabric.view_data.FabricView.EndorsedProposalResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new peer_proposal_response_pb.ProposalResponsePayload; + reader.readMessage(value,peer_proposal_response_pb.ProposalResponsePayload.deserializeBinaryFromReader); + msg.setPayload(value); + break; + case 2: + var value = new peer_proposal_response_pb.Endorsement; + reader.readMessage(value,peer_proposal_response_pb.Endorsement.deserializeBinaryFromReader); + msg.setEndorsement(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.fabric.view_data.FabricView.EndorsedProposalResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.fabric.view_data.FabricView.EndorsedProposalResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.fabric.view_data.FabricView.EndorsedProposalResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.fabric.view_data.FabricView.EndorsedProposalResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPayload(); + if (f != null) { + writer.writeMessage( + 1, + f, + peer_proposal_response_pb.ProposalResponsePayload.serializeBinaryToWriter + ); + } + f = message.getEndorsement(); + if (f != null) { + writer.writeMessage( + 2, + f, + peer_proposal_response_pb.Endorsement.serializeBinaryToWriter + ); + } +}; + + +/** + * optional protos.ProposalResponsePayload payload = 1; + * @return {?proto.protos.ProposalResponsePayload} + */ +proto.fabric.view_data.FabricView.EndorsedProposalResponse.prototype.getPayload = function() { + return /** @type{?proto.protos.ProposalResponsePayload} */ ( + jspb.Message.getWrapperField(this, peer_proposal_response_pb.ProposalResponsePayload, 1)); +}; + + +/** + * @param {?proto.protos.ProposalResponsePayload|undefined} value + * @return {!proto.fabric.view_data.FabricView.EndorsedProposalResponse} returns this +*/ +proto.fabric.view_data.FabricView.EndorsedProposalResponse.prototype.setPayload = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.fabric.view_data.FabricView.EndorsedProposalResponse} returns this + */ +proto.fabric.view_data.FabricView.EndorsedProposalResponse.prototype.clearPayload = function() { + return this.setPayload(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.fabric.view_data.FabricView.EndorsedProposalResponse.prototype.hasPayload = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional protos.Endorsement endorsement = 2; + * @return {?proto.protos.Endorsement} + */ +proto.fabric.view_data.FabricView.EndorsedProposalResponse.prototype.getEndorsement = function() { + return /** @type{?proto.protos.Endorsement} */ ( + jspb.Message.getWrapperField(this, peer_proposal_response_pb.Endorsement, 2)); +}; + + +/** + * @param {?proto.protos.Endorsement|undefined} value + * @return {!proto.fabric.view_data.FabricView.EndorsedProposalResponse} returns this +*/ +proto.fabric.view_data.FabricView.EndorsedProposalResponse.prototype.setEndorsement = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.fabric.view_data.FabricView.EndorsedProposalResponse} returns this + */ +proto.fabric.view_data.FabricView.EndorsedProposalResponse.prototype.clearEndorsement = function() { + return this.setEndorsement(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.fabric.view_data.FabricView.EndorsedProposalResponse.prototype.hasEndorsement = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * repeated EndorsedProposalResponse endorsed_proposal_responses = 1; + * @return {!Array} + */ +proto.fabric.view_data.FabricView.prototype.getEndorsedProposalResponsesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.fabric.view_data.FabricView.EndorsedProposalResponse, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.fabric.view_data.FabricView} returns this +*/ +proto.fabric.view_data.FabricView.prototype.setEndorsedProposalResponsesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.fabric.view_data.FabricView.EndorsedProposalResponse=} opt_value + * @param {number=} opt_index + * @return {!proto.fabric.view_data.FabricView.EndorsedProposalResponse} + */ +proto.fabric.view_data.FabricView.prototype.addEndorsedProposalResponses = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.fabric.view_data.FabricView.EndorsedProposalResponse, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.fabric.view_data.FabricView} returns this + */ +proto.fabric.view_data.FabricView.prototype.clearEndorsedProposalResponsesList = function() { + return this.setEndorsedProposalResponsesList([]); +}; + + +goog.object.extend(exports, proto.fabric.view_data); diff --git a/weaver/common/protos-js/identity/agent_grpc_pb.d.ts b/weaver/common/protos-js/identity/agent_grpc_pb.d.ts new file mode 100644 index 00000000000..a9af15a7ea5 --- /dev/null +++ b/weaver/common/protos-js/identity/agent_grpc_pb.d.ts @@ -0,0 +1,110 @@ +// package: identity.agent +// file: identity/agent.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as grpc from "@grpc/grpc-js"; +import * as identity_agent_pb from "../identity/agent_pb"; +import * as common_ack_pb from "../common/ack_pb"; + +interface IIINAgentService extends grpc.ServiceDefinition { + syncExternalState: IIINAgentService_ISyncExternalState; + requestIdentityConfiguration: IIINAgentService_IRequestIdentityConfiguration; + sendIdentityConfiguration: IIINAgentService_ISendIdentityConfiguration; + requestAttestation: IIINAgentService_IRequestAttestation; + sendAttestation: IIINAgentService_ISendAttestation; +} + +interface IIINAgentService_ISyncExternalState extends grpc.MethodDefinition { + path: "/identity.agent.IINAgent/SyncExternalState"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IIINAgentService_IRequestIdentityConfiguration extends grpc.MethodDefinition { + path: "/identity.agent.IINAgent/RequestIdentityConfiguration"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IIINAgentService_ISendIdentityConfiguration extends grpc.MethodDefinition { + path: "/identity.agent.IINAgent/SendIdentityConfiguration"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IIINAgentService_IRequestAttestation extends grpc.MethodDefinition { + path: "/identity.agent.IINAgent/RequestAttestation"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IIINAgentService_ISendAttestation extends grpc.MethodDefinition { + path: "/identity.agent.IINAgent/SendAttestation"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} + +export const IINAgentService: IIINAgentService; + +export interface IIINAgentServer extends grpc.UntypedServiceImplementation { + syncExternalState: grpc.handleUnaryCall; + requestIdentityConfiguration: grpc.handleUnaryCall; + sendIdentityConfiguration: grpc.handleUnaryCall; + requestAttestation: grpc.handleUnaryCall; + sendAttestation: grpc.handleUnaryCall; +} + +export interface IIINAgentClient { + syncExternalState(request: identity_agent_pb.SecurityDomainMemberIdentity, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + syncExternalState(request: identity_agent_pb.SecurityDomainMemberIdentity, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + syncExternalState(request: identity_agent_pb.SecurityDomainMemberIdentity, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + requestIdentityConfiguration(request: identity_agent_pb.SecurityDomainMemberIdentityRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + requestIdentityConfiguration(request: identity_agent_pb.SecurityDomainMemberIdentityRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + requestIdentityConfiguration(request: identity_agent_pb.SecurityDomainMemberIdentityRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendIdentityConfiguration(request: identity_agent_pb.AttestedMembership, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendIdentityConfiguration(request: identity_agent_pb.AttestedMembership, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendIdentityConfiguration(request: identity_agent_pb.AttestedMembership, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + requestAttestation(request: identity_agent_pb.CounterAttestedMembership, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + requestAttestation(request: identity_agent_pb.CounterAttestedMembership, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + requestAttestation(request: identity_agent_pb.CounterAttestedMembership, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendAttestation(request: identity_agent_pb.CounterAttestedMembership, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendAttestation(request: identity_agent_pb.CounterAttestedMembership, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendAttestation(request: identity_agent_pb.CounterAttestedMembership, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; +} + +export class IINAgentClient extends grpc.Client implements IIINAgentClient { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: Partial); + public syncExternalState(request: identity_agent_pb.SecurityDomainMemberIdentity, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public syncExternalState(request: identity_agent_pb.SecurityDomainMemberIdentity, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public syncExternalState(request: identity_agent_pb.SecurityDomainMemberIdentity, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public requestIdentityConfiguration(request: identity_agent_pb.SecurityDomainMemberIdentityRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public requestIdentityConfiguration(request: identity_agent_pb.SecurityDomainMemberIdentityRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public requestIdentityConfiguration(request: identity_agent_pb.SecurityDomainMemberIdentityRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendIdentityConfiguration(request: identity_agent_pb.AttestedMembership, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendIdentityConfiguration(request: identity_agent_pb.AttestedMembership, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendIdentityConfiguration(request: identity_agent_pb.AttestedMembership, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public requestAttestation(request: identity_agent_pb.CounterAttestedMembership, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public requestAttestation(request: identity_agent_pb.CounterAttestedMembership, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public requestAttestation(request: identity_agent_pb.CounterAttestedMembership, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendAttestation(request: identity_agent_pb.CounterAttestedMembership, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendAttestation(request: identity_agent_pb.CounterAttestedMembership, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendAttestation(request: identity_agent_pb.CounterAttestedMembership, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; +} diff --git a/weaver/common/protos-js/identity/agent_grpc_pb.js b/weaver/common/protos-js/identity/agent_grpc_pb.js new file mode 100644 index 00000000000..793a1f3efb5 --- /dev/null +++ b/weaver/common/protos-js/identity/agent_grpc_pb.js @@ -0,0 +1,133 @@ +// GENERATED CODE -- DO NOT EDIT! + +// Original file comments: +// Copyright IBM Corp. All Rights Reserved. +// +// SPDX-License-Identifier: Apache-2.0 +// +'use strict'; +var grpc = require('@grpc/grpc-js'); +var identity_agent_pb = require('../identity/agent_pb.js'); +var common_ack_pb = require('../common/ack_pb.js'); + +function serialize_common_ack_Ack(arg) { + if (!(arg instanceof common_ack_pb.Ack)) { + throw new Error('Expected argument of type common.ack.Ack'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_common_ack_Ack(buffer_arg) { + return common_ack_pb.Ack.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_identity_agent_AttestedMembership(arg) { + if (!(arg instanceof identity_agent_pb.AttestedMembership)) { + throw new Error('Expected argument of type identity.agent.AttestedMembership'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_identity_agent_AttestedMembership(buffer_arg) { + return identity_agent_pb.AttestedMembership.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_identity_agent_CounterAttestedMembership(arg) { + if (!(arg instanceof identity_agent_pb.CounterAttestedMembership)) { + throw new Error('Expected argument of type identity.agent.CounterAttestedMembership'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_identity_agent_CounterAttestedMembership(buffer_arg) { + return identity_agent_pb.CounterAttestedMembership.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_identity_agent_SecurityDomainMemberIdentity(arg) { + if (!(arg instanceof identity_agent_pb.SecurityDomainMemberIdentity)) { + throw new Error('Expected argument of type identity.agent.SecurityDomainMemberIdentity'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_identity_agent_SecurityDomainMemberIdentity(buffer_arg) { + return identity_agent_pb.SecurityDomainMemberIdentity.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_identity_agent_SecurityDomainMemberIdentityRequest(arg) { + if (!(arg instanceof identity_agent_pb.SecurityDomainMemberIdentityRequest)) { + throw new Error('Expected argument of type identity.agent.SecurityDomainMemberIdentityRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_identity_agent_SecurityDomainMemberIdentityRequest(buffer_arg) { + return identity_agent_pb.SecurityDomainMemberIdentityRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +// definitions of all messages used in the datatransfer protocol +var IINAgentService = exports.IINAgentService = { + // user or agent triggers a sync of external/foreign network unit's state +syncExternalState: { + path: '/identity.agent.IINAgent/SyncExternalState', + requestStream: false, + responseStream: false, + requestType: identity_agent_pb.SecurityDomainMemberIdentity, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_identity_agent_SecurityDomainMemberIdentity, + requestDeserialize: deserialize_identity_agent_SecurityDomainMemberIdentity, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + // Requesting network unit's state from a foreign IIN agent. +requestIdentityConfiguration: { + path: '/identity.agent.IINAgent/RequestIdentityConfiguration', + requestStream: false, + responseStream: false, + requestType: identity_agent_pb.SecurityDomainMemberIdentityRequest, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_identity_agent_SecurityDomainMemberIdentityRequest, + requestDeserialize: deserialize_identity_agent_SecurityDomainMemberIdentityRequest, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + // Handling network unit's state sent by a foreign IIN agent. +sendIdentityConfiguration: { + path: '/identity.agent.IINAgent/SendIdentityConfiguration', + requestStream: false, + responseStream: false, + requestType: identity_agent_pb.AttestedMembership, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_identity_agent_AttestedMembership, + requestDeserialize: deserialize_identity_agent_AttestedMembership, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + // Requesting attestation from a local IIN agent. +requestAttestation: { + path: '/identity.agent.IINAgent/RequestAttestation', + requestStream: false, + responseStream: false, + requestType: identity_agent_pb.CounterAttestedMembership, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_identity_agent_CounterAttestedMembership, + requestDeserialize: deserialize_identity_agent_CounterAttestedMembership, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + // Handling attestation sent by a local IIN agent. +sendAttestation: { + path: '/identity.agent.IINAgent/SendAttestation', + requestStream: false, + responseStream: false, + requestType: identity_agent_pb.CounterAttestedMembership, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_identity_agent_CounterAttestedMembership, + requestDeserialize: deserialize_identity_agent_CounterAttestedMembership, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, +}; + +exports.IINAgentClient = grpc.makeGenericClientConstructor(IINAgentService); diff --git a/weaver/common/protos-js/identity/agent_pb.d.ts b/weaver/common/protos-js/identity/agent_pb.d.ts new file mode 100644 index 00000000000..f2ac849e46e --- /dev/null +++ b/weaver/common/protos-js/identity/agent_pb.d.ts @@ -0,0 +1,212 @@ +// package: identity.agent +// file: identity/agent.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; +import * as common_ack_pb from "../common/ack_pb"; + +export class SecurityDomainMemberIdentity extends jspb.Message { + getSecurityDomain(): string; + setSecurityDomain(value: string): SecurityDomainMemberIdentity; + getMemberId(): string; + setMemberId(value: string): SecurityDomainMemberIdentity; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SecurityDomainMemberIdentity.AsObject; + static toObject(includeInstance: boolean, msg: SecurityDomainMemberIdentity): SecurityDomainMemberIdentity.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SecurityDomainMemberIdentity, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SecurityDomainMemberIdentity; + static deserializeBinaryFromReader(message: SecurityDomainMemberIdentity, reader: jspb.BinaryReader): SecurityDomainMemberIdentity; +} + +export namespace SecurityDomainMemberIdentity { + export type AsObject = { + securityDomain: string, + memberId: string, + } +} + +export class SecurityDomainMemberIdentityRequest extends jspb.Message { + + hasSourceNetwork(): boolean; + clearSourceNetwork(): void; + getSourceNetwork(): SecurityDomainMemberIdentity | undefined; + setSourceNetwork(value?: SecurityDomainMemberIdentity): SecurityDomainMemberIdentityRequest; + + hasRequestingNetwork(): boolean; + clearRequestingNetwork(): void; + getRequestingNetwork(): SecurityDomainMemberIdentity | undefined; + setRequestingNetwork(value?: SecurityDomainMemberIdentity): SecurityDomainMemberIdentityRequest; + getNonce(): string; + setNonce(value: string): SecurityDomainMemberIdentityRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SecurityDomainMemberIdentityRequest.AsObject; + static toObject(includeInstance: boolean, msg: SecurityDomainMemberIdentityRequest): SecurityDomainMemberIdentityRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SecurityDomainMemberIdentityRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SecurityDomainMemberIdentityRequest; + static deserializeBinaryFromReader(message: SecurityDomainMemberIdentityRequest, reader: jspb.BinaryReader): SecurityDomainMemberIdentityRequest; +} + +export namespace SecurityDomainMemberIdentityRequest { + export type AsObject = { + sourceNetwork?: SecurityDomainMemberIdentity.AsObject, + requestingNetwork?: SecurityDomainMemberIdentity.AsObject, + nonce: string, + } +} + +export class Attestation extends jspb.Message { + + hasUnitIdentity(): boolean; + clearUnitIdentity(): void; + getUnitIdentity(): SecurityDomainMemberIdentity | undefined; + setUnitIdentity(value?: SecurityDomainMemberIdentity): Attestation; + getCertificate(): string; + setCertificate(value: string): Attestation; + getSignature(): string; + setSignature(value: string): Attestation; + getNonce(): string; + setNonce(value: string): Attestation; + getTimestamp(): number; + setTimestamp(value: number): Attestation; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Attestation.AsObject; + static toObject(includeInstance: boolean, msg: Attestation): Attestation.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Attestation, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Attestation; + static deserializeBinaryFromReader(message: Attestation, reader: jspb.BinaryReader): Attestation; +} + +export namespace Attestation { + export type AsObject = { + unitIdentity?: SecurityDomainMemberIdentity.AsObject, + certificate: string, + signature: string, + nonce: string, + timestamp: number, + } +} + +export class AttestedMembership extends jspb.Message { + + hasMembership(): boolean; + clearMembership(): void; + getMembership(): string; + setMembership(value: string): AttestedMembership; + + hasError(): boolean; + clearError(): void; + getError(): string; + setError(value: string): AttestedMembership; + + hasAttestation(): boolean; + clearAttestation(): void; + getAttestation(): Attestation | undefined; + setAttestation(value?: Attestation): AttestedMembership; + + getResponseCase(): AttestedMembership.ResponseCase; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AttestedMembership.AsObject; + static toObject(includeInstance: boolean, msg: AttestedMembership): AttestedMembership.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AttestedMembership, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AttestedMembership; + static deserializeBinaryFromReader(message: AttestedMembership, reader: jspb.BinaryReader): AttestedMembership; +} + +export namespace AttestedMembership { + export type AsObject = { + membership: string, + error: string, + attestation?: Attestation.AsObject, + } + + export enum ResponseCase { + RESPONSE_NOT_SET = 0, + MEMBERSHIP = 1, + ERROR = 2, + } + +} + +export class CounterAttestedMembership extends jspb.Message { + + hasAttestedMembershipSet(): boolean; + clearAttestedMembershipSet(): void; + getAttestedMembershipSet(): string; + setAttestedMembershipSet(value: string): CounterAttestedMembership; + + hasError(): boolean; + clearError(): void; + getError(): string; + setError(value: string): CounterAttestedMembership; + clearAttestationsList(): void; + getAttestationsList(): Array; + setAttestationsList(value: Array): CounterAttestedMembership; + addAttestations(value?: Attestation, index?: number): Attestation; + + getResponseCase(): CounterAttestedMembership.ResponseCase; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): CounterAttestedMembership.AsObject; + static toObject(includeInstance: boolean, msg: CounterAttestedMembership): CounterAttestedMembership.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: CounterAttestedMembership, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): CounterAttestedMembership; + static deserializeBinaryFromReader(message: CounterAttestedMembership, reader: jspb.BinaryReader): CounterAttestedMembership; +} + +export namespace CounterAttestedMembership { + export type AsObject = { + attestedMembershipSet: string, + error: string, + attestationsList: Array, + } + + + export class AttestedMembershipSet extends jspb.Message { + getMembership(): string; + setMembership(value: string): AttestedMembershipSet; + clearAttestationsList(): void; + getAttestationsList(): Array; + setAttestationsList(value: Array): AttestedMembershipSet; + addAttestations(value?: Attestation, index?: number): Attestation; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AttestedMembershipSet.AsObject; + static toObject(includeInstance: boolean, msg: AttestedMembershipSet): AttestedMembershipSet.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AttestedMembershipSet, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AttestedMembershipSet; + static deserializeBinaryFromReader(message: AttestedMembershipSet, reader: jspb.BinaryReader): AttestedMembershipSet; + } + + export namespace AttestedMembershipSet { + export type AsObject = { + membership: string, + attestationsList: Array, + } + } + + + export enum ResponseCase { + RESPONSE_NOT_SET = 0, + ATTESTED_MEMBERSHIP_SET = 1, + ERROR = 2, + } + +} diff --git a/weaver/common/protos-js/identity/agent_pb.js b/weaver/common/protos-js/identity/agent_pb.js new file mode 100644 index 00000000000..947f5b26215 --- /dev/null +++ b/weaver/common/protos-js/identity/agent_pb.js @@ -0,0 +1,1568 @@ +// source: identity/agent.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +var common_ack_pb = require('../common/ack_pb.js'); +goog.object.extend(proto, common_ack_pb); +goog.exportSymbol('proto.identity.agent.Attestation', null, global); +goog.exportSymbol('proto.identity.agent.AttestedMembership', null, global); +goog.exportSymbol('proto.identity.agent.AttestedMembership.ResponseCase', null, global); +goog.exportSymbol('proto.identity.agent.CounterAttestedMembership', null, global); +goog.exportSymbol('proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet', null, global); +goog.exportSymbol('proto.identity.agent.CounterAttestedMembership.ResponseCase', null, global); +goog.exportSymbol('proto.identity.agent.SecurityDomainMemberIdentity', null, global); +goog.exportSymbol('proto.identity.agent.SecurityDomainMemberIdentityRequest', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.identity.agent.SecurityDomainMemberIdentity = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.identity.agent.SecurityDomainMemberIdentity, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.identity.agent.SecurityDomainMemberIdentity.displayName = 'proto.identity.agent.SecurityDomainMemberIdentity'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.identity.agent.SecurityDomainMemberIdentityRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.identity.agent.SecurityDomainMemberIdentityRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.identity.agent.SecurityDomainMemberIdentityRequest.displayName = 'proto.identity.agent.SecurityDomainMemberIdentityRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.identity.agent.Attestation = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.identity.agent.Attestation, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.identity.agent.Attestation.displayName = 'proto.identity.agent.Attestation'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.identity.agent.AttestedMembership = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.identity.agent.AttestedMembership.oneofGroups_); +}; +goog.inherits(proto.identity.agent.AttestedMembership, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.identity.agent.AttestedMembership.displayName = 'proto.identity.agent.AttestedMembership'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.identity.agent.CounterAttestedMembership = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.identity.agent.CounterAttestedMembership.repeatedFields_, proto.identity.agent.CounterAttestedMembership.oneofGroups_); +}; +goog.inherits(proto.identity.agent.CounterAttestedMembership, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.identity.agent.CounterAttestedMembership.displayName = 'proto.identity.agent.CounterAttestedMembership'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet.repeatedFields_, null); +}; +goog.inherits(proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet.displayName = 'proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.identity.agent.SecurityDomainMemberIdentity.prototype.toObject = function(opt_includeInstance) { + return proto.identity.agent.SecurityDomainMemberIdentity.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.identity.agent.SecurityDomainMemberIdentity} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.identity.agent.SecurityDomainMemberIdentity.toObject = function(includeInstance, msg) { + var f, obj = { + securityDomain: jspb.Message.getFieldWithDefault(msg, 1, ""), + memberId: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.identity.agent.SecurityDomainMemberIdentity} + */ +proto.identity.agent.SecurityDomainMemberIdentity.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.identity.agent.SecurityDomainMemberIdentity; + return proto.identity.agent.SecurityDomainMemberIdentity.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.identity.agent.SecurityDomainMemberIdentity} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.identity.agent.SecurityDomainMemberIdentity} + */ +proto.identity.agent.SecurityDomainMemberIdentity.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setSecurityDomain(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setMemberId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.identity.agent.SecurityDomainMemberIdentity.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.identity.agent.SecurityDomainMemberIdentity.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.identity.agent.SecurityDomainMemberIdentity} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.identity.agent.SecurityDomainMemberIdentity.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSecurityDomain(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getMemberId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string security_domain = 1; + * @return {string} + */ +proto.identity.agent.SecurityDomainMemberIdentity.prototype.getSecurityDomain = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.identity.agent.SecurityDomainMemberIdentity} returns this + */ +proto.identity.agent.SecurityDomainMemberIdentity.prototype.setSecurityDomain = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string member_id = 2; + * @return {string} + */ +proto.identity.agent.SecurityDomainMemberIdentity.prototype.getMemberId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.identity.agent.SecurityDomainMemberIdentity} returns this + */ +proto.identity.agent.SecurityDomainMemberIdentity.prototype.setMemberId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.identity.agent.SecurityDomainMemberIdentityRequest.prototype.toObject = function(opt_includeInstance) { + return proto.identity.agent.SecurityDomainMemberIdentityRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.identity.agent.SecurityDomainMemberIdentityRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.identity.agent.SecurityDomainMemberIdentityRequest.toObject = function(includeInstance, msg) { + var f, obj = { + sourceNetwork: (f = msg.getSourceNetwork()) && proto.identity.agent.SecurityDomainMemberIdentity.toObject(includeInstance, f), + requestingNetwork: (f = msg.getRequestingNetwork()) && proto.identity.agent.SecurityDomainMemberIdentity.toObject(includeInstance, f), + nonce: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.identity.agent.SecurityDomainMemberIdentityRequest} + */ +proto.identity.agent.SecurityDomainMemberIdentityRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.identity.agent.SecurityDomainMemberIdentityRequest; + return proto.identity.agent.SecurityDomainMemberIdentityRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.identity.agent.SecurityDomainMemberIdentityRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.identity.agent.SecurityDomainMemberIdentityRequest} + */ +proto.identity.agent.SecurityDomainMemberIdentityRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.identity.agent.SecurityDomainMemberIdentity; + reader.readMessage(value,proto.identity.agent.SecurityDomainMemberIdentity.deserializeBinaryFromReader); + msg.setSourceNetwork(value); + break; + case 2: + var value = new proto.identity.agent.SecurityDomainMemberIdentity; + reader.readMessage(value,proto.identity.agent.SecurityDomainMemberIdentity.deserializeBinaryFromReader); + msg.setRequestingNetwork(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setNonce(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.identity.agent.SecurityDomainMemberIdentityRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.identity.agent.SecurityDomainMemberIdentityRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.identity.agent.SecurityDomainMemberIdentityRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.identity.agent.SecurityDomainMemberIdentityRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSourceNetwork(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.identity.agent.SecurityDomainMemberIdentity.serializeBinaryToWriter + ); + } + f = message.getRequestingNetwork(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.identity.agent.SecurityDomainMemberIdentity.serializeBinaryToWriter + ); + } + f = message.getNonce(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional SecurityDomainMemberIdentity source_network = 1; + * @return {?proto.identity.agent.SecurityDomainMemberIdentity} + */ +proto.identity.agent.SecurityDomainMemberIdentityRequest.prototype.getSourceNetwork = function() { + return /** @type{?proto.identity.agent.SecurityDomainMemberIdentity} */ ( + jspb.Message.getWrapperField(this, proto.identity.agent.SecurityDomainMemberIdentity, 1)); +}; + + +/** + * @param {?proto.identity.agent.SecurityDomainMemberIdentity|undefined} value + * @return {!proto.identity.agent.SecurityDomainMemberIdentityRequest} returns this +*/ +proto.identity.agent.SecurityDomainMemberIdentityRequest.prototype.setSourceNetwork = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.identity.agent.SecurityDomainMemberIdentityRequest} returns this + */ +proto.identity.agent.SecurityDomainMemberIdentityRequest.prototype.clearSourceNetwork = function() { + return this.setSourceNetwork(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.identity.agent.SecurityDomainMemberIdentityRequest.prototype.hasSourceNetwork = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional SecurityDomainMemberIdentity requesting_network = 2; + * @return {?proto.identity.agent.SecurityDomainMemberIdentity} + */ +proto.identity.agent.SecurityDomainMemberIdentityRequest.prototype.getRequestingNetwork = function() { + return /** @type{?proto.identity.agent.SecurityDomainMemberIdentity} */ ( + jspb.Message.getWrapperField(this, proto.identity.agent.SecurityDomainMemberIdentity, 2)); +}; + + +/** + * @param {?proto.identity.agent.SecurityDomainMemberIdentity|undefined} value + * @return {!proto.identity.agent.SecurityDomainMemberIdentityRequest} returns this +*/ +proto.identity.agent.SecurityDomainMemberIdentityRequest.prototype.setRequestingNetwork = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.identity.agent.SecurityDomainMemberIdentityRequest} returns this + */ +proto.identity.agent.SecurityDomainMemberIdentityRequest.prototype.clearRequestingNetwork = function() { + return this.setRequestingNetwork(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.identity.agent.SecurityDomainMemberIdentityRequest.prototype.hasRequestingNetwork = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional string nonce = 3; + * @return {string} + */ +proto.identity.agent.SecurityDomainMemberIdentityRequest.prototype.getNonce = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.identity.agent.SecurityDomainMemberIdentityRequest} returns this + */ +proto.identity.agent.SecurityDomainMemberIdentityRequest.prototype.setNonce = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.identity.agent.Attestation.prototype.toObject = function(opt_includeInstance) { + return proto.identity.agent.Attestation.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.identity.agent.Attestation} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.identity.agent.Attestation.toObject = function(includeInstance, msg) { + var f, obj = { + unitIdentity: (f = msg.getUnitIdentity()) && proto.identity.agent.SecurityDomainMemberIdentity.toObject(includeInstance, f), + certificate: jspb.Message.getFieldWithDefault(msg, 2, ""), + signature: jspb.Message.getFieldWithDefault(msg, 3, ""), + nonce: jspb.Message.getFieldWithDefault(msg, 4, ""), + timestamp: jspb.Message.getFieldWithDefault(msg, 5, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.identity.agent.Attestation} + */ +proto.identity.agent.Attestation.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.identity.agent.Attestation; + return proto.identity.agent.Attestation.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.identity.agent.Attestation} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.identity.agent.Attestation} + */ +proto.identity.agent.Attestation.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.identity.agent.SecurityDomainMemberIdentity; + reader.readMessage(value,proto.identity.agent.SecurityDomainMemberIdentity.deserializeBinaryFromReader); + msg.setUnitIdentity(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setCertificate(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setSignature(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setNonce(value); + break; + case 5: + var value = /** @type {number} */ (reader.readUint64()); + msg.setTimestamp(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.identity.agent.Attestation.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.identity.agent.Attestation.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.identity.agent.Attestation} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.identity.agent.Attestation.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUnitIdentity(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.identity.agent.SecurityDomainMemberIdentity.serializeBinaryToWriter + ); + } + f = message.getCertificate(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getSignature(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getNonce(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getTimestamp(); + if (f !== 0) { + writer.writeUint64( + 5, + f + ); + } +}; + + +/** + * optional SecurityDomainMemberIdentity unit_identity = 1; + * @return {?proto.identity.agent.SecurityDomainMemberIdentity} + */ +proto.identity.agent.Attestation.prototype.getUnitIdentity = function() { + return /** @type{?proto.identity.agent.SecurityDomainMemberIdentity} */ ( + jspb.Message.getWrapperField(this, proto.identity.agent.SecurityDomainMemberIdentity, 1)); +}; + + +/** + * @param {?proto.identity.agent.SecurityDomainMemberIdentity|undefined} value + * @return {!proto.identity.agent.Attestation} returns this +*/ +proto.identity.agent.Attestation.prototype.setUnitIdentity = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.identity.agent.Attestation} returns this + */ +proto.identity.agent.Attestation.prototype.clearUnitIdentity = function() { + return this.setUnitIdentity(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.identity.agent.Attestation.prototype.hasUnitIdentity = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional string certificate = 2; + * @return {string} + */ +proto.identity.agent.Attestation.prototype.getCertificate = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.identity.agent.Attestation} returns this + */ +proto.identity.agent.Attestation.prototype.setCertificate = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string signature = 3; + * @return {string} + */ +proto.identity.agent.Attestation.prototype.getSignature = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.identity.agent.Attestation} returns this + */ +proto.identity.agent.Attestation.prototype.setSignature = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string nonce = 4; + * @return {string} + */ +proto.identity.agent.Attestation.prototype.getNonce = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.identity.agent.Attestation} returns this + */ +proto.identity.agent.Attestation.prototype.setNonce = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional uint64 timestamp = 5; + * @return {number} + */ +proto.identity.agent.Attestation.prototype.getTimestamp = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.identity.agent.Attestation} returns this + */ +proto.identity.agent.Attestation.prototype.setTimestamp = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.identity.agent.AttestedMembership.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.identity.agent.AttestedMembership.ResponseCase = { + RESPONSE_NOT_SET: 0, + MEMBERSHIP: 1, + ERROR: 2 +}; + +/** + * @return {proto.identity.agent.AttestedMembership.ResponseCase} + */ +proto.identity.agent.AttestedMembership.prototype.getResponseCase = function() { + return /** @type {proto.identity.agent.AttestedMembership.ResponseCase} */(jspb.Message.computeOneofCase(this, proto.identity.agent.AttestedMembership.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.identity.agent.AttestedMembership.prototype.toObject = function(opt_includeInstance) { + return proto.identity.agent.AttestedMembership.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.identity.agent.AttestedMembership} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.identity.agent.AttestedMembership.toObject = function(includeInstance, msg) { + var f, obj = { + membership: jspb.Message.getFieldWithDefault(msg, 1, ""), + error: jspb.Message.getFieldWithDefault(msg, 2, ""), + attestation: (f = msg.getAttestation()) && proto.identity.agent.Attestation.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.identity.agent.AttestedMembership} + */ +proto.identity.agent.AttestedMembership.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.identity.agent.AttestedMembership; + return proto.identity.agent.AttestedMembership.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.identity.agent.AttestedMembership} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.identity.agent.AttestedMembership} + */ +proto.identity.agent.AttestedMembership.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setMembership(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setError(value); + break; + case 3: + var value = new proto.identity.agent.Attestation; + reader.readMessage(value,proto.identity.agent.Attestation.deserializeBinaryFromReader); + msg.setAttestation(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.identity.agent.AttestedMembership.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.identity.agent.AttestedMembership.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.identity.agent.AttestedMembership} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.identity.agent.AttestedMembership.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeString( + 2, + f + ); + } + f = message.getAttestation(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.identity.agent.Attestation.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string membership = 1; + * @return {string} + */ +proto.identity.agent.AttestedMembership.prototype.getMembership = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.identity.agent.AttestedMembership} returns this + */ +proto.identity.agent.AttestedMembership.prototype.setMembership = function(value) { + return jspb.Message.setOneofField(this, 1, proto.identity.agent.AttestedMembership.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.identity.agent.AttestedMembership} returns this + */ +proto.identity.agent.AttestedMembership.prototype.clearMembership = function() { + return jspb.Message.setOneofField(this, 1, proto.identity.agent.AttestedMembership.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.identity.agent.AttestedMembership.prototype.hasMembership = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional string error = 2; + * @return {string} + */ +proto.identity.agent.AttestedMembership.prototype.getError = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.identity.agent.AttestedMembership} returns this + */ +proto.identity.agent.AttestedMembership.prototype.setError = function(value) { + return jspb.Message.setOneofField(this, 2, proto.identity.agent.AttestedMembership.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.identity.agent.AttestedMembership} returns this + */ +proto.identity.agent.AttestedMembership.prototype.clearError = function() { + return jspb.Message.setOneofField(this, 2, proto.identity.agent.AttestedMembership.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.identity.agent.AttestedMembership.prototype.hasError = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional Attestation attestation = 3; + * @return {?proto.identity.agent.Attestation} + */ +proto.identity.agent.AttestedMembership.prototype.getAttestation = function() { + return /** @type{?proto.identity.agent.Attestation} */ ( + jspb.Message.getWrapperField(this, proto.identity.agent.Attestation, 3)); +}; + + +/** + * @param {?proto.identity.agent.Attestation|undefined} value + * @return {!proto.identity.agent.AttestedMembership} returns this +*/ +proto.identity.agent.AttestedMembership.prototype.setAttestation = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.identity.agent.AttestedMembership} returns this + */ +proto.identity.agent.AttestedMembership.prototype.clearAttestation = function() { + return this.setAttestation(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.identity.agent.AttestedMembership.prototype.hasAttestation = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.identity.agent.CounterAttestedMembership.repeatedFields_ = [3]; + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.identity.agent.CounterAttestedMembership.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.identity.agent.CounterAttestedMembership.ResponseCase = { + RESPONSE_NOT_SET: 0, + ATTESTED_MEMBERSHIP_SET: 1, + ERROR: 2 +}; + +/** + * @return {proto.identity.agent.CounterAttestedMembership.ResponseCase} + */ +proto.identity.agent.CounterAttestedMembership.prototype.getResponseCase = function() { + return /** @type {proto.identity.agent.CounterAttestedMembership.ResponseCase} */(jspb.Message.computeOneofCase(this, proto.identity.agent.CounterAttestedMembership.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.identity.agent.CounterAttestedMembership.prototype.toObject = function(opt_includeInstance) { + return proto.identity.agent.CounterAttestedMembership.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.identity.agent.CounterAttestedMembership} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.identity.agent.CounterAttestedMembership.toObject = function(includeInstance, msg) { + var f, obj = { + attestedMembershipSet: jspb.Message.getFieldWithDefault(msg, 1, ""), + error: jspb.Message.getFieldWithDefault(msg, 2, ""), + attestationsList: jspb.Message.toObjectList(msg.getAttestationsList(), + proto.identity.agent.Attestation.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.identity.agent.CounterAttestedMembership} + */ +proto.identity.agent.CounterAttestedMembership.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.identity.agent.CounterAttestedMembership; + return proto.identity.agent.CounterAttestedMembership.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.identity.agent.CounterAttestedMembership} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.identity.agent.CounterAttestedMembership} + */ +proto.identity.agent.CounterAttestedMembership.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setAttestedMembershipSet(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setError(value); + break; + case 3: + var value = new proto.identity.agent.Attestation; + reader.readMessage(value,proto.identity.agent.Attestation.deserializeBinaryFromReader); + msg.addAttestations(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.identity.agent.CounterAttestedMembership.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.identity.agent.CounterAttestedMembership.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.identity.agent.CounterAttestedMembership} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.identity.agent.CounterAttestedMembership.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeString( + 2, + f + ); + } + f = message.getAttestationsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.identity.agent.Attestation.serializeBinaryToWriter + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet.prototype.toObject = function(opt_includeInstance) { + return proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet.toObject = function(includeInstance, msg) { + var f, obj = { + membership: jspb.Message.getFieldWithDefault(msg, 1, ""), + attestationsList: jspb.Message.toObjectList(msg.getAttestationsList(), + proto.identity.agent.Attestation.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet} + */ +proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet; + return proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet} + */ +proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setMembership(value); + break; + case 2: + var value = new proto.identity.agent.Attestation; + reader.readMessage(value,proto.identity.agent.Attestation.deserializeBinaryFromReader); + msg.addAttestations(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMembership(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getAttestationsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.identity.agent.Attestation.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string membership = 1; + * @return {string} + */ +proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet.prototype.getMembership = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet} returns this + */ +proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet.prototype.setMembership = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * repeated Attestation attestations = 2; + * @return {!Array} + */ +proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet.prototype.getAttestationsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.identity.agent.Attestation, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet} returns this +*/ +proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet.prototype.setAttestationsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.identity.agent.Attestation=} opt_value + * @param {number=} opt_index + * @return {!proto.identity.agent.Attestation} + */ +proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet.prototype.addAttestations = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.identity.agent.Attestation, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet} returns this + */ +proto.identity.agent.CounterAttestedMembership.AttestedMembershipSet.prototype.clearAttestationsList = function() { + return this.setAttestationsList([]); +}; + + +/** + * optional string attested_membership_set = 1; + * @return {string} + */ +proto.identity.agent.CounterAttestedMembership.prototype.getAttestedMembershipSet = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.identity.agent.CounterAttestedMembership} returns this + */ +proto.identity.agent.CounterAttestedMembership.prototype.setAttestedMembershipSet = function(value) { + return jspb.Message.setOneofField(this, 1, proto.identity.agent.CounterAttestedMembership.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.identity.agent.CounterAttestedMembership} returns this + */ +proto.identity.agent.CounterAttestedMembership.prototype.clearAttestedMembershipSet = function() { + return jspb.Message.setOneofField(this, 1, proto.identity.agent.CounterAttestedMembership.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.identity.agent.CounterAttestedMembership.prototype.hasAttestedMembershipSet = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional string error = 2; + * @return {string} + */ +proto.identity.agent.CounterAttestedMembership.prototype.getError = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.identity.agent.CounterAttestedMembership} returns this + */ +proto.identity.agent.CounterAttestedMembership.prototype.setError = function(value) { + return jspb.Message.setOneofField(this, 2, proto.identity.agent.CounterAttestedMembership.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.identity.agent.CounterAttestedMembership} returns this + */ +proto.identity.agent.CounterAttestedMembership.prototype.clearError = function() { + return jspb.Message.setOneofField(this, 2, proto.identity.agent.CounterAttestedMembership.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.identity.agent.CounterAttestedMembership.prototype.hasError = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * repeated Attestation attestations = 3; + * @return {!Array} + */ +proto.identity.agent.CounterAttestedMembership.prototype.getAttestationsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.identity.agent.Attestation, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.identity.agent.CounterAttestedMembership} returns this +*/ +proto.identity.agent.CounterAttestedMembership.prototype.setAttestationsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.identity.agent.Attestation=} opt_value + * @param {number=} opt_index + * @return {!proto.identity.agent.Attestation} + */ +proto.identity.agent.CounterAttestedMembership.prototype.addAttestations = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.identity.agent.Attestation, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.identity.agent.CounterAttestedMembership} returns this + */ +proto.identity.agent.CounterAttestedMembership.prototype.clearAttestationsList = function() { + return this.setAttestationsList([]); +}; + + +goog.object.extend(exports, proto.identity.agent); diff --git a/weaver/common/protos-js/msp/identities_pb.d.ts b/weaver/common/protos-js/msp/identities_pb.d.ts new file mode 100644 index 00000000000..a2978632d1a --- /dev/null +++ b/weaver/common/protos-js/msp/identities_pb.d.ts @@ -0,0 +1,74 @@ +// package: msp +// file: msp/identities.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; + +export class SerializedIdentity extends jspb.Message { + getMspid(): string; + setMspid(value: string): SerializedIdentity; + getIdBytes(): Uint8Array | string; + getIdBytes_asU8(): Uint8Array; + getIdBytes_asB64(): string; + setIdBytes(value: Uint8Array | string): SerializedIdentity; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SerializedIdentity.AsObject; + static toObject(includeInstance: boolean, msg: SerializedIdentity): SerializedIdentity.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SerializedIdentity, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SerializedIdentity; + static deserializeBinaryFromReader(message: SerializedIdentity, reader: jspb.BinaryReader): SerializedIdentity; +} + +export namespace SerializedIdentity { + export type AsObject = { + mspid: string, + idBytes: Uint8Array | string, + } +} + +export class SerializedIdemixIdentity extends jspb.Message { + getNymX(): Uint8Array | string; + getNymX_asU8(): Uint8Array; + getNymX_asB64(): string; + setNymX(value: Uint8Array | string): SerializedIdemixIdentity; + getNymY(): Uint8Array | string; + getNymY_asU8(): Uint8Array; + getNymY_asB64(): string; + setNymY(value: Uint8Array | string): SerializedIdemixIdentity; + getOu(): Uint8Array | string; + getOu_asU8(): Uint8Array; + getOu_asB64(): string; + setOu(value: Uint8Array | string): SerializedIdemixIdentity; + getRole(): Uint8Array | string; + getRole_asU8(): Uint8Array; + getRole_asB64(): string; + setRole(value: Uint8Array | string): SerializedIdemixIdentity; + getProof(): Uint8Array | string; + getProof_asU8(): Uint8Array; + getProof_asB64(): string; + setProof(value: Uint8Array | string): SerializedIdemixIdentity; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SerializedIdemixIdentity.AsObject; + static toObject(includeInstance: boolean, msg: SerializedIdemixIdentity): SerializedIdemixIdentity.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SerializedIdemixIdentity, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SerializedIdemixIdentity; + static deserializeBinaryFromReader(message: SerializedIdemixIdentity, reader: jspb.BinaryReader): SerializedIdemixIdentity; +} + +export namespace SerializedIdemixIdentity { + export type AsObject = { + nymX: Uint8Array | string, + nymY: Uint8Array | string, + ou: Uint8Array | string, + role: Uint8Array | string, + proof: Uint8Array | string, + } +} diff --git a/weaver/common/protos-js/msp/identities_pb.js b/weaver/common/protos-js/msp/identities_pb.js new file mode 100644 index 00000000000..316e4669584 --- /dev/null +++ b/weaver/common/protos-js/msp/identities_pb.js @@ -0,0 +1,622 @@ +// source: msp/identities.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +goog.exportSymbol('proto.msp.SerializedIdemixIdentity', null, global); +goog.exportSymbol('proto.msp.SerializedIdentity', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.msp.SerializedIdentity = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.msp.SerializedIdentity, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.msp.SerializedIdentity.displayName = 'proto.msp.SerializedIdentity'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.msp.SerializedIdemixIdentity = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.msp.SerializedIdemixIdentity, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.msp.SerializedIdemixIdentity.displayName = 'proto.msp.SerializedIdemixIdentity'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.msp.SerializedIdentity.prototype.toObject = function(opt_includeInstance) { + return proto.msp.SerializedIdentity.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.msp.SerializedIdentity} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.msp.SerializedIdentity.toObject = function(includeInstance, msg) { + var f, obj = { + mspid: jspb.Message.getFieldWithDefault(msg, 1, ""), + idBytes: msg.getIdBytes_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.msp.SerializedIdentity} + */ +proto.msp.SerializedIdentity.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.msp.SerializedIdentity; + return proto.msp.SerializedIdentity.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.msp.SerializedIdentity} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.msp.SerializedIdentity} + */ +proto.msp.SerializedIdentity.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setMspid(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setIdBytes(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.msp.SerializedIdentity.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.msp.SerializedIdentity.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.msp.SerializedIdentity} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.msp.SerializedIdentity.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMspid(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getIdBytes_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional string mspid = 1; + * @return {string} + */ +proto.msp.SerializedIdentity.prototype.getMspid = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.msp.SerializedIdentity} returns this + */ +proto.msp.SerializedIdentity.prototype.setMspid = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional bytes id_bytes = 2; + * @return {!(string|Uint8Array)} + */ +proto.msp.SerializedIdentity.prototype.getIdBytes = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes id_bytes = 2; + * This is a type-conversion wrapper around `getIdBytes()` + * @return {string} + */ +proto.msp.SerializedIdentity.prototype.getIdBytes_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getIdBytes())); +}; + + +/** + * optional bytes id_bytes = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getIdBytes()` + * @return {!Uint8Array} + */ +proto.msp.SerializedIdentity.prototype.getIdBytes_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getIdBytes())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.msp.SerializedIdentity} returns this + */ +proto.msp.SerializedIdentity.prototype.setIdBytes = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.msp.SerializedIdemixIdentity.prototype.toObject = function(opt_includeInstance) { + return proto.msp.SerializedIdemixIdentity.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.msp.SerializedIdemixIdentity} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.msp.SerializedIdemixIdentity.toObject = function(includeInstance, msg) { + var f, obj = { + nymX: msg.getNymX_asB64(), + nymY: msg.getNymY_asB64(), + ou: msg.getOu_asB64(), + role: msg.getRole_asB64(), + proof: msg.getProof_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.msp.SerializedIdemixIdentity} + */ +proto.msp.SerializedIdemixIdentity.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.msp.SerializedIdemixIdentity; + return proto.msp.SerializedIdemixIdentity.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.msp.SerializedIdemixIdentity} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.msp.SerializedIdemixIdentity} + */ +proto.msp.SerializedIdemixIdentity.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setNymX(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setNymY(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOu(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setRole(value); + break; + case 5: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setProof(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.msp.SerializedIdemixIdentity.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.msp.SerializedIdemixIdentity.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.msp.SerializedIdemixIdentity} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.msp.SerializedIdemixIdentity.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getNymX_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getNymY_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getOu_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getRole_asU8(); + if (f.length > 0) { + writer.writeBytes( + 4, + f + ); + } + f = message.getProof_asU8(); + if (f.length > 0) { + writer.writeBytes( + 5, + f + ); + } +}; + + +/** + * optional bytes nym_x = 1; + * @return {!(string|Uint8Array)} + */ +proto.msp.SerializedIdemixIdentity.prototype.getNymX = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes nym_x = 1; + * This is a type-conversion wrapper around `getNymX()` + * @return {string} + */ +proto.msp.SerializedIdemixIdentity.prototype.getNymX_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getNymX())); +}; + + +/** + * optional bytes nym_x = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getNymX()` + * @return {!Uint8Array} + */ +proto.msp.SerializedIdemixIdentity.prototype.getNymX_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getNymX())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.msp.SerializedIdemixIdentity} returns this + */ +proto.msp.SerializedIdemixIdentity.prototype.setNymX = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes nym_y = 2; + * @return {!(string|Uint8Array)} + */ +proto.msp.SerializedIdemixIdentity.prototype.getNymY = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes nym_y = 2; + * This is a type-conversion wrapper around `getNymY()` + * @return {string} + */ +proto.msp.SerializedIdemixIdentity.prototype.getNymY_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getNymY())); +}; + + +/** + * optional bytes nym_y = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getNymY()` + * @return {!Uint8Array} + */ +proto.msp.SerializedIdemixIdentity.prototype.getNymY_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getNymY())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.msp.SerializedIdemixIdentity} returns this + */ +proto.msp.SerializedIdemixIdentity.prototype.setNymY = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * optional bytes ou = 3; + * @return {!(string|Uint8Array)} + */ +proto.msp.SerializedIdemixIdentity.prototype.getOu = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes ou = 3; + * This is a type-conversion wrapper around `getOu()` + * @return {string} + */ +proto.msp.SerializedIdemixIdentity.prototype.getOu_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOu())); +}; + + +/** + * optional bytes ou = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOu()` + * @return {!Uint8Array} + */ +proto.msp.SerializedIdemixIdentity.prototype.getOu_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOu())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.msp.SerializedIdemixIdentity} returns this + */ +proto.msp.SerializedIdemixIdentity.prototype.setOu = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); +}; + + +/** + * optional bytes role = 4; + * @return {!(string|Uint8Array)} + */ +proto.msp.SerializedIdemixIdentity.prototype.getRole = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * optional bytes role = 4; + * This is a type-conversion wrapper around `getRole()` + * @return {string} + */ +proto.msp.SerializedIdemixIdentity.prototype.getRole_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getRole())); +}; + + +/** + * optional bytes role = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getRole()` + * @return {!Uint8Array} + */ +proto.msp.SerializedIdemixIdentity.prototype.getRole_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getRole())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.msp.SerializedIdemixIdentity} returns this + */ +proto.msp.SerializedIdemixIdentity.prototype.setRole = function(value) { + return jspb.Message.setProto3BytesField(this, 4, value); +}; + + +/** + * optional bytes proof = 5; + * @return {!(string|Uint8Array)} + */ +proto.msp.SerializedIdemixIdentity.prototype.getProof = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * optional bytes proof = 5; + * This is a type-conversion wrapper around `getProof()` + * @return {string} + */ +proto.msp.SerializedIdemixIdentity.prototype.getProof_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getProof())); +}; + + +/** + * optional bytes proof = 5; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getProof()` + * @return {!Uint8Array} + */ +proto.msp.SerializedIdemixIdentity.prototype.getProof_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getProof())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.msp.SerializedIdemixIdentity} returns this + */ +proto.msp.SerializedIdemixIdentity.prototype.setProof = function(value) { + return jspb.Message.setProto3BytesField(this, 5, value); +}; + + +goog.object.extend(exports, proto.msp); diff --git a/weaver/common/protos-js/msp/msp_principal_pb.d.ts b/weaver/common/protos-js/msp/msp_principal_pb.d.ts new file mode 100644 index 00000000000..61c36e3c9c9 --- /dev/null +++ b/weaver/common/protos-js/msp/msp_principal_pb.d.ts @@ -0,0 +1,149 @@ +// package: common +// file: msp/msp_principal.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; + +export class MSPPrincipal extends jspb.Message { + getPrincipalClassification(): MSPPrincipal.Classification; + setPrincipalClassification(value: MSPPrincipal.Classification): MSPPrincipal; + getPrincipal(): Uint8Array | string; + getPrincipal_asU8(): Uint8Array; + getPrincipal_asB64(): string; + setPrincipal(value: Uint8Array | string): MSPPrincipal; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): MSPPrincipal.AsObject; + static toObject(includeInstance: boolean, msg: MSPPrincipal): MSPPrincipal.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: MSPPrincipal, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): MSPPrincipal; + static deserializeBinaryFromReader(message: MSPPrincipal, reader: jspb.BinaryReader): MSPPrincipal; +} + +export namespace MSPPrincipal { + export type AsObject = { + principalClassification: MSPPrincipal.Classification, + principal: Uint8Array | string, + } + + export enum Classification { + ROLE = 0, + ORGANIZATION_UNIT = 1, + IDENTITY = 2, + ANONYMITY = 3, + COMBINED = 4, + } + +} + +export class OrganizationUnit extends jspb.Message { + getMspIdentifier(): string; + setMspIdentifier(value: string): OrganizationUnit; + getOrganizationalUnitIdentifier(): string; + setOrganizationalUnitIdentifier(value: string): OrganizationUnit; + getCertifiersIdentifier(): Uint8Array | string; + getCertifiersIdentifier_asU8(): Uint8Array; + getCertifiersIdentifier_asB64(): string; + setCertifiersIdentifier(value: Uint8Array | string): OrganizationUnit; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): OrganizationUnit.AsObject; + static toObject(includeInstance: boolean, msg: OrganizationUnit): OrganizationUnit.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: OrganizationUnit, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): OrganizationUnit; + static deserializeBinaryFromReader(message: OrganizationUnit, reader: jspb.BinaryReader): OrganizationUnit; +} + +export namespace OrganizationUnit { + export type AsObject = { + mspIdentifier: string, + organizationalUnitIdentifier: string, + certifiersIdentifier: Uint8Array | string, + } +} + +export class MSPRole extends jspb.Message { + getMspIdentifier(): string; + setMspIdentifier(value: string): MSPRole; + getRole(): MSPRole.MSPRoleType; + setRole(value: MSPRole.MSPRoleType): MSPRole; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): MSPRole.AsObject; + static toObject(includeInstance: boolean, msg: MSPRole): MSPRole.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: MSPRole, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): MSPRole; + static deserializeBinaryFromReader(message: MSPRole, reader: jspb.BinaryReader): MSPRole; +} + +export namespace MSPRole { + export type AsObject = { + mspIdentifier: string, + role: MSPRole.MSPRoleType, + } + + export enum MSPRoleType { + MEMBER = 0, + ADMIN = 1, + CLIENT = 2, + PEER = 3, + ORDERER = 4, + } + +} + +export class MSPIdentityAnonymity extends jspb.Message { + getAnonymityType(): MSPIdentityAnonymity.MSPIdentityAnonymityType; + setAnonymityType(value: MSPIdentityAnonymity.MSPIdentityAnonymityType): MSPIdentityAnonymity; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): MSPIdentityAnonymity.AsObject; + static toObject(includeInstance: boolean, msg: MSPIdentityAnonymity): MSPIdentityAnonymity.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: MSPIdentityAnonymity, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): MSPIdentityAnonymity; + static deserializeBinaryFromReader(message: MSPIdentityAnonymity, reader: jspb.BinaryReader): MSPIdentityAnonymity; +} + +export namespace MSPIdentityAnonymity { + export type AsObject = { + anonymityType: MSPIdentityAnonymity.MSPIdentityAnonymityType, + } + + export enum MSPIdentityAnonymityType { + NOMINAL = 0, + ANONYMOUS = 1, + } + +} + +export class CombinedPrincipal extends jspb.Message { + clearPrincipalsList(): void; + getPrincipalsList(): Array; + setPrincipalsList(value: Array): CombinedPrincipal; + addPrincipals(value?: MSPPrincipal, index?: number): MSPPrincipal; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): CombinedPrincipal.AsObject; + static toObject(includeInstance: boolean, msg: CombinedPrincipal): CombinedPrincipal.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: CombinedPrincipal, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): CombinedPrincipal; + static deserializeBinaryFromReader(message: CombinedPrincipal, reader: jspb.BinaryReader): CombinedPrincipal; +} + +export namespace CombinedPrincipal { + export type AsObject = { + principalsList: Array, + } +} diff --git a/weaver/common/protos-js/msp/msp_principal_pb.js b/weaver/common/protos-js/msp/msp_principal_pb.js new file mode 100644 index 00000000000..acf9ef3c73c --- /dev/null +++ b/weaver/common/protos-js/msp/msp_principal_pb.js @@ -0,0 +1,1015 @@ +// source: msp/msp_principal.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +goog.exportSymbol('proto.common.CombinedPrincipal', null, global); +goog.exportSymbol('proto.common.MSPIdentityAnonymity', null, global); +goog.exportSymbol('proto.common.MSPIdentityAnonymity.MSPIdentityAnonymityType', null, global); +goog.exportSymbol('proto.common.MSPPrincipal', null, global); +goog.exportSymbol('proto.common.MSPPrincipal.Classification', null, global); +goog.exportSymbol('proto.common.MSPRole', null, global); +goog.exportSymbol('proto.common.MSPRole.MSPRoleType', null, global); +goog.exportSymbol('proto.common.OrganizationUnit', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.MSPPrincipal = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.MSPPrincipal, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.MSPPrincipal.displayName = 'proto.common.MSPPrincipal'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.OrganizationUnit = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.OrganizationUnit, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.OrganizationUnit.displayName = 'proto.common.OrganizationUnit'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.MSPRole = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.MSPRole, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.MSPRole.displayName = 'proto.common.MSPRole'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.MSPIdentityAnonymity = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.common.MSPIdentityAnonymity, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.MSPIdentityAnonymity.displayName = 'proto.common.MSPIdentityAnonymity'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.CombinedPrincipal = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.common.CombinedPrincipal.repeatedFields_, null); +}; +goog.inherits(proto.common.CombinedPrincipal, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.CombinedPrincipal.displayName = 'proto.common.CombinedPrincipal'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.MSPPrincipal.prototype.toObject = function(opt_includeInstance) { + return proto.common.MSPPrincipal.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.MSPPrincipal} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.MSPPrincipal.toObject = function(includeInstance, msg) { + var f, obj = { + principalClassification: jspb.Message.getFieldWithDefault(msg, 1, 0), + principal: msg.getPrincipal_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.MSPPrincipal} + */ +proto.common.MSPPrincipal.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.MSPPrincipal; + return proto.common.MSPPrincipal.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.MSPPrincipal} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.MSPPrincipal} + */ +proto.common.MSPPrincipal.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.common.MSPPrincipal.Classification} */ (reader.readEnum()); + msg.setPrincipalClassification(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setPrincipal(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.MSPPrincipal.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.MSPPrincipal.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.MSPPrincipal} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.MSPPrincipal.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPrincipalClassification(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getPrincipal_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.common.MSPPrincipal.Classification = { + ROLE: 0, + ORGANIZATION_UNIT: 1, + IDENTITY: 2, + ANONYMITY: 3, + COMBINED: 4 +}; + +/** + * optional Classification principal_classification = 1; + * @return {!proto.common.MSPPrincipal.Classification} + */ +proto.common.MSPPrincipal.prototype.getPrincipalClassification = function() { + return /** @type {!proto.common.MSPPrincipal.Classification} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.common.MSPPrincipal.Classification} value + * @return {!proto.common.MSPPrincipal} returns this + */ +proto.common.MSPPrincipal.prototype.setPrincipalClassification = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional bytes principal = 2; + * @return {!(string|Uint8Array)} + */ +proto.common.MSPPrincipal.prototype.getPrincipal = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes principal = 2; + * This is a type-conversion wrapper around `getPrincipal()` + * @return {string} + */ +proto.common.MSPPrincipal.prototype.getPrincipal_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPrincipal())); +}; + + +/** + * optional bytes principal = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPrincipal()` + * @return {!Uint8Array} + */ +proto.common.MSPPrincipal.prototype.getPrincipal_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPrincipal())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.common.MSPPrincipal} returns this + */ +proto.common.MSPPrincipal.prototype.setPrincipal = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.OrganizationUnit.prototype.toObject = function(opt_includeInstance) { + return proto.common.OrganizationUnit.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.OrganizationUnit} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.OrganizationUnit.toObject = function(includeInstance, msg) { + var f, obj = { + mspIdentifier: jspb.Message.getFieldWithDefault(msg, 1, ""), + organizationalUnitIdentifier: jspb.Message.getFieldWithDefault(msg, 2, ""), + certifiersIdentifier: msg.getCertifiersIdentifier_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.OrganizationUnit} + */ +proto.common.OrganizationUnit.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.OrganizationUnit; + return proto.common.OrganizationUnit.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.OrganizationUnit} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.OrganizationUnit} + */ +proto.common.OrganizationUnit.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setMspIdentifier(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setOrganizationalUnitIdentifier(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setCertifiersIdentifier(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.OrganizationUnit.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.OrganizationUnit.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.OrganizationUnit} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.OrganizationUnit.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMspIdentifier(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getOrganizationalUnitIdentifier(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getCertifiersIdentifier_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } +}; + + +/** + * optional string msp_identifier = 1; + * @return {string} + */ +proto.common.OrganizationUnit.prototype.getMspIdentifier = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.OrganizationUnit} returns this + */ +proto.common.OrganizationUnit.prototype.setMspIdentifier = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string organizational_unit_identifier = 2; + * @return {string} + */ +proto.common.OrganizationUnit.prototype.getOrganizationalUnitIdentifier = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.OrganizationUnit} returns this + */ +proto.common.OrganizationUnit.prototype.setOrganizationalUnitIdentifier = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional bytes certifiers_identifier = 3; + * @return {!(string|Uint8Array)} + */ +proto.common.OrganizationUnit.prototype.getCertifiersIdentifier = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes certifiers_identifier = 3; + * This is a type-conversion wrapper around `getCertifiersIdentifier()` + * @return {string} + */ +proto.common.OrganizationUnit.prototype.getCertifiersIdentifier_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getCertifiersIdentifier())); +}; + + +/** + * optional bytes certifiers_identifier = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getCertifiersIdentifier()` + * @return {!Uint8Array} + */ +proto.common.OrganizationUnit.prototype.getCertifiersIdentifier_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getCertifiersIdentifier())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.common.OrganizationUnit} returns this + */ +proto.common.OrganizationUnit.prototype.setCertifiersIdentifier = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.MSPRole.prototype.toObject = function(opt_includeInstance) { + return proto.common.MSPRole.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.MSPRole} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.MSPRole.toObject = function(includeInstance, msg) { + var f, obj = { + mspIdentifier: jspb.Message.getFieldWithDefault(msg, 1, ""), + role: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.MSPRole} + */ +proto.common.MSPRole.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.MSPRole; + return proto.common.MSPRole.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.MSPRole} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.MSPRole} + */ +proto.common.MSPRole.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setMspIdentifier(value); + break; + case 2: + var value = /** @type {!proto.common.MSPRole.MSPRoleType} */ (reader.readEnum()); + msg.setRole(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.MSPRole.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.MSPRole.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.MSPRole} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.MSPRole.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMspIdentifier(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getRole(); + if (f !== 0.0) { + writer.writeEnum( + 2, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.common.MSPRole.MSPRoleType = { + MEMBER: 0, + ADMIN: 1, + CLIENT: 2, + PEER: 3, + ORDERER: 4 +}; + +/** + * optional string msp_identifier = 1; + * @return {string} + */ +proto.common.MSPRole.prototype.getMspIdentifier = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.MSPRole} returns this + */ +proto.common.MSPRole.prototype.setMspIdentifier = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional MSPRoleType role = 2; + * @return {!proto.common.MSPRole.MSPRoleType} + */ +proto.common.MSPRole.prototype.getRole = function() { + return /** @type {!proto.common.MSPRole.MSPRoleType} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {!proto.common.MSPRole.MSPRoleType} value + * @return {!proto.common.MSPRole} returns this + */ +proto.common.MSPRole.prototype.setRole = function(value) { + return jspb.Message.setProto3EnumField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.MSPIdentityAnonymity.prototype.toObject = function(opt_includeInstance) { + return proto.common.MSPIdentityAnonymity.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.MSPIdentityAnonymity} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.MSPIdentityAnonymity.toObject = function(includeInstance, msg) { + var f, obj = { + anonymityType: jspb.Message.getFieldWithDefault(msg, 1, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.MSPIdentityAnonymity} + */ +proto.common.MSPIdentityAnonymity.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.MSPIdentityAnonymity; + return proto.common.MSPIdentityAnonymity.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.MSPIdentityAnonymity} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.MSPIdentityAnonymity} + */ +proto.common.MSPIdentityAnonymity.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.common.MSPIdentityAnonymity.MSPIdentityAnonymityType} */ (reader.readEnum()); + msg.setAnonymityType(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.MSPIdentityAnonymity.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.MSPIdentityAnonymity.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.MSPIdentityAnonymity} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.MSPIdentityAnonymity.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAnonymityType(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.common.MSPIdentityAnonymity.MSPIdentityAnonymityType = { + NOMINAL: 0, + ANONYMOUS: 1 +}; + +/** + * optional MSPIdentityAnonymityType anonymity_type = 1; + * @return {!proto.common.MSPIdentityAnonymity.MSPIdentityAnonymityType} + */ +proto.common.MSPIdentityAnonymity.prototype.getAnonymityType = function() { + return /** @type {!proto.common.MSPIdentityAnonymity.MSPIdentityAnonymityType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.common.MSPIdentityAnonymity.MSPIdentityAnonymityType} value + * @return {!proto.common.MSPIdentityAnonymity} returns this + */ +proto.common.MSPIdentityAnonymity.prototype.setAnonymityType = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.common.CombinedPrincipal.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.CombinedPrincipal.prototype.toObject = function(opt_includeInstance) { + return proto.common.CombinedPrincipal.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.CombinedPrincipal} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.CombinedPrincipal.toObject = function(includeInstance, msg) { + var f, obj = { + principalsList: jspb.Message.toObjectList(msg.getPrincipalsList(), + proto.common.MSPPrincipal.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.CombinedPrincipal} + */ +proto.common.CombinedPrincipal.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.CombinedPrincipal; + return proto.common.CombinedPrincipal.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.CombinedPrincipal} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.CombinedPrincipal} + */ +proto.common.CombinedPrincipal.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.common.MSPPrincipal; + reader.readMessage(value,proto.common.MSPPrincipal.deserializeBinaryFromReader); + msg.addPrincipals(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.CombinedPrincipal.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.CombinedPrincipal.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.CombinedPrincipal} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.CombinedPrincipal.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPrincipalsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.common.MSPPrincipal.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated MSPPrincipal principals = 1; + * @return {!Array} + */ +proto.common.CombinedPrincipal.prototype.getPrincipalsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.common.MSPPrincipal, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.common.CombinedPrincipal} returns this +*/ +proto.common.CombinedPrincipal.prototype.setPrincipalsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.common.MSPPrincipal=} opt_value + * @param {number=} opt_index + * @return {!proto.common.MSPPrincipal} + */ +proto.common.CombinedPrincipal.prototype.addPrincipals = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.common.MSPPrincipal, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.common.CombinedPrincipal} returns this + */ +proto.common.CombinedPrincipal.prototype.clearPrincipalsList = function() { + return this.setPrincipalsList([]); +}; + + +goog.object.extend(exports, proto.common); diff --git a/weaver/common/protos-js/networks/networks_grpc_pb.d.ts b/weaver/common/protos-js/networks/networks_grpc_pb.d.ts new file mode 100644 index 00000000000..7361155e614 --- /dev/null +++ b/weaver/common/protos-js/networks/networks_grpc_pb.d.ts @@ -0,0 +1,163 @@ +// package: networks.networks +// file: networks/networks.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as grpc from "@grpc/grpc-js"; +import * as networks_networks_pb from "../networks/networks_pb"; +import * as common_ack_pb from "../common/ack_pb"; +import * as common_state_pb from "../common/state_pb"; +import * as common_events_pb from "../common/events_pb"; + +interface INetworkService extends grpc.ServiceDefinition { + requestState: INetworkService_IRequestState; + getState: INetworkService_IGetState; + requestDatabase: INetworkService_IRequestDatabase; + requestAssetTransfer: INetworkService_IRequestAssetTransfer; + subscribeEvent: INetworkService_ISubscribeEvent; + getEventSubscriptionState: INetworkService_IGetEventSubscriptionState; + unsubscribeEvent: INetworkService_IUnsubscribeEvent; + getEventStates: INetworkService_IGetEventStates; +} + +interface INetworkService_IRequestState extends grpc.MethodDefinition { + path: "/networks.networks.Network/RequestState"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface INetworkService_IGetState extends grpc.MethodDefinition { + path: "/networks.networks.Network/GetState"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface INetworkService_IRequestDatabase extends grpc.MethodDefinition { + path: "/networks.networks.Network/RequestDatabase"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface INetworkService_IRequestAssetTransfer extends grpc.MethodDefinition { + path: "/networks.networks.Network/RequestAssetTransfer"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface INetworkService_ISubscribeEvent extends grpc.MethodDefinition { + path: "/networks.networks.Network/SubscribeEvent"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface INetworkService_IGetEventSubscriptionState extends grpc.MethodDefinition { + path: "/networks.networks.Network/GetEventSubscriptionState"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface INetworkService_IUnsubscribeEvent extends grpc.MethodDefinition { + path: "/networks.networks.Network/UnsubscribeEvent"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface INetworkService_IGetEventStates extends grpc.MethodDefinition { + path: "/networks.networks.Network/GetEventStates"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} + +export const NetworkService: INetworkService; + +export interface INetworkServer extends grpc.UntypedServiceImplementation { + requestState: grpc.handleUnaryCall; + getState: grpc.handleUnaryCall; + requestDatabase: grpc.handleUnaryCall; + requestAssetTransfer: grpc.handleUnaryCall; + subscribeEvent: grpc.handleUnaryCall; + getEventSubscriptionState: grpc.handleUnaryCall; + unsubscribeEvent: grpc.handleUnaryCall; + getEventStates: grpc.handleUnaryCall; +} + +export interface INetworkClient { + requestState(request: networks_networks_pb.NetworkQuery, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + requestState(request: networks_networks_pb.NetworkQuery, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + requestState(request: networks_networks_pb.NetworkQuery, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + getState(request: networks_networks_pb.GetStateMessage, callback: (error: grpc.ServiceError | null, response: common_state_pb.RequestState) => void): grpc.ClientUnaryCall; + getState(request: networks_networks_pb.GetStateMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_state_pb.RequestState) => void): grpc.ClientUnaryCall; + getState(request: networks_networks_pb.GetStateMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_state_pb.RequestState) => void): grpc.ClientUnaryCall; + requestDatabase(request: networks_networks_pb.DbName, callback: (error: grpc.ServiceError | null, response: networks_networks_pb.RelayDatabase) => void): grpc.ClientUnaryCall; + requestDatabase(request: networks_networks_pb.DbName, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: networks_networks_pb.RelayDatabase) => void): grpc.ClientUnaryCall; + requestDatabase(request: networks_networks_pb.DbName, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: networks_networks_pb.RelayDatabase) => void): grpc.ClientUnaryCall; + requestAssetTransfer(request: networks_networks_pb.NetworkAssetTransfer, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + requestAssetTransfer(request: networks_networks_pb.NetworkAssetTransfer, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + requestAssetTransfer(request: networks_networks_pb.NetworkAssetTransfer, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + subscribeEvent(request: networks_networks_pb.NetworkEventSubscription, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + subscribeEvent(request: networks_networks_pb.NetworkEventSubscription, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + subscribeEvent(request: networks_networks_pb.NetworkEventSubscription, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + getEventSubscriptionState(request: networks_networks_pb.GetStateMessage, callback: (error: grpc.ServiceError | null, response: common_events_pb.EventSubscriptionState) => void): grpc.ClientUnaryCall; + getEventSubscriptionState(request: networks_networks_pb.GetStateMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_events_pb.EventSubscriptionState) => void): grpc.ClientUnaryCall; + getEventSubscriptionState(request: networks_networks_pb.GetStateMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_events_pb.EventSubscriptionState) => void): grpc.ClientUnaryCall; + unsubscribeEvent(request: networks_networks_pb.NetworkEventUnsubscription, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + unsubscribeEvent(request: networks_networks_pb.NetworkEventUnsubscription, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + unsubscribeEvent(request: networks_networks_pb.NetworkEventUnsubscription, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + getEventStates(request: networks_networks_pb.GetStateMessage, callback: (error: grpc.ServiceError | null, response: common_events_pb.EventStates) => void): grpc.ClientUnaryCall; + getEventStates(request: networks_networks_pb.GetStateMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_events_pb.EventStates) => void): grpc.ClientUnaryCall; + getEventStates(request: networks_networks_pb.GetStateMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_events_pb.EventStates) => void): grpc.ClientUnaryCall; +} + +export class NetworkClient extends grpc.Client implements INetworkClient { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: Partial); + public requestState(request: networks_networks_pb.NetworkQuery, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public requestState(request: networks_networks_pb.NetworkQuery, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public requestState(request: networks_networks_pb.NetworkQuery, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public getState(request: networks_networks_pb.GetStateMessage, callback: (error: grpc.ServiceError | null, response: common_state_pb.RequestState) => void): grpc.ClientUnaryCall; + public getState(request: networks_networks_pb.GetStateMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_state_pb.RequestState) => void): grpc.ClientUnaryCall; + public getState(request: networks_networks_pb.GetStateMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_state_pb.RequestState) => void): grpc.ClientUnaryCall; + public requestDatabase(request: networks_networks_pb.DbName, callback: (error: grpc.ServiceError | null, response: networks_networks_pb.RelayDatabase) => void): grpc.ClientUnaryCall; + public requestDatabase(request: networks_networks_pb.DbName, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: networks_networks_pb.RelayDatabase) => void): grpc.ClientUnaryCall; + public requestDatabase(request: networks_networks_pb.DbName, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: networks_networks_pb.RelayDatabase) => void): grpc.ClientUnaryCall; + public requestAssetTransfer(request: networks_networks_pb.NetworkAssetTransfer, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public requestAssetTransfer(request: networks_networks_pb.NetworkAssetTransfer, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public requestAssetTransfer(request: networks_networks_pb.NetworkAssetTransfer, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public subscribeEvent(request: networks_networks_pb.NetworkEventSubscription, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public subscribeEvent(request: networks_networks_pb.NetworkEventSubscription, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public subscribeEvent(request: networks_networks_pb.NetworkEventSubscription, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public getEventSubscriptionState(request: networks_networks_pb.GetStateMessage, callback: (error: grpc.ServiceError | null, response: common_events_pb.EventSubscriptionState) => void): grpc.ClientUnaryCall; + public getEventSubscriptionState(request: networks_networks_pb.GetStateMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_events_pb.EventSubscriptionState) => void): grpc.ClientUnaryCall; + public getEventSubscriptionState(request: networks_networks_pb.GetStateMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_events_pb.EventSubscriptionState) => void): grpc.ClientUnaryCall; + public unsubscribeEvent(request: networks_networks_pb.NetworkEventUnsubscription, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public unsubscribeEvent(request: networks_networks_pb.NetworkEventUnsubscription, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public unsubscribeEvent(request: networks_networks_pb.NetworkEventUnsubscription, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public getEventStates(request: networks_networks_pb.GetStateMessage, callback: (error: grpc.ServiceError | null, response: common_events_pb.EventStates) => void): grpc.ClientUnaryCall; + public getEventStates(request: networks_networks_pb.GetStateMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_events_pb.EventStates) => void): grpc.ClientUnaryCall; + public getEventStates(request: networks_networks_pb.GetStateMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_events_pb.EventStates) => void): grpc.ClientUnaryCall; +} diff --git a/weaver/common/protos-js/networks/networks_grpc_pb.js b/weaver/common/protos-js/networks/networks_grpc_pb.js new file mode 100644 index 00000000000..6cb23eb4ab5 --- /dev/null +++ b/weaver/common/protos-js/networks/networks_grpc_pb.js @@ -0,0 +1,242 @@ +// GENERATED CODE -- DO NOT EDIT! + +// Original file comments: +// Copyright IBM Corp. All Rights Reserved. +// +// SPDX-License-Identifier: Apache-2.0 +// +'use strict'; +var grpc = require('@grpc/grpc-js'); +var networks_networks_pb = require('../networks/networks_pb.js'); +var common_ack_pb = require('../common/ack_pb.js'); +var common_state_pb = require('../common/state_pb.js'); +var common_events_pb = require('../common/events_pb.js'); + +function serialize_common_ack_Ack(arg) { + if (!(arg instanceof common_ack_pb.Ack)) { + throw new Error('Expected argument of type common.ack.Ack'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_common_ack_Ack(buffer_arg) { + return common_ack_pb.Ack.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_common_events_EventStates(arg) { + if (!(arg instanceof common_events_pb.EventStates)) { + throw new Error('Expected argument of type common.events.EventStates'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_common_events_EventStates(buffer_arg) { + return common_events_pb.EventStates.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_common_events_EventSubscriptionState(arg) { + if (!(arg instanceof common_events_pb.EventSubscriptionState)) { + throw new Error('Expected argument of type common.events.EventSubscriptionState'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_common_events_EventSubscriptionState(buffer_arg) { + return common_events_pb.EventSubscriptionState.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_common_state_RequestState(arg) { + if (!(arg instanceof common_state_pb.RequestState)) { + throw new Error('Expected argument of type common.state.RequestState'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_common_state_RequestState(buffer_arg) { + return common_state_pb.RequestState.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_networks_networks_DbName(arg) { + if (!(arg instanceof networks_networks_pb.DbName)) { + throw new Error('Expected argument of type networks.networks.DbName'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_networks_networks_DbName(buffer_arg) { + return networks_networks_pb.DbName.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_networks_networks_GetStateMessage(arg) { + if (!(arg instanceof networks_networks_pb.GetStateMessage)) { + throw new Error('Expected argument of type networks.networks.GetStateMessage'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_networks_networks_GetStateMessage(buffer_arg) { + return networks_networks_pb.GetStateMessage.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_networks_networks_NetworkAssetTransfer(arg) { + if (!(arg instanceof networks_networks_pb.NetworkAssetTransfer)) { + throw new Error('Expected argument of type networks.networks.NetworkAssetTransfer'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_networks_networks_NetworkAssetTransfer(buffer_arg) { + return networks_networks_pb.NetworkAssetTransfer.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_networks_networks_NetworkEventSubscription(arg) { + if (!(arg instanceof networks_networks_pb.NetworkEventSubscription)) { + throw new Error('Expected argument of type networks.networks.NetworkEventSubscription'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_networks_networks_NetworkEventSubscription(buffer_arg) { + return networks_networks_pb.NetworkEventSubscription.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_networks_networks_NetworkEventUnsubscription(arg) { + if (!(arg instanceof networks_networks_pb.NetworkEventUnsubscription)) { + throw new Error('Expected argument of type networks.networks.NetworkEventUnsubscription'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_networks_networks_NetworkEventUnsubscription(buffer_arg) { + return networks_networks_pb.NetworkEventUnsubscription.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_networks_networks_NetworkQuery(arg) { + if (!(arg instanceof networks_networks_pb.NetworkQuery)) { + throw new Error('Expected argument of type networks.networks.NetworkQuery'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_networks_networks_NetworkQuery(buffer_arg) { + return networks_networks_pb.NetworkQuery.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_networks_networks_RelayDatabase(arg) { + if (!(arg instanceof networks_networks_pb.RelayDatabase)) { + throw new Error('Expected argument of type networks.networks.RelayDatabase'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_networks_networks_RelayDatabase(buffer_arg) { + return networks_networks_pb.RelayDatabase.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +// This service is the interface for how the network communicates with +// its relay. +var NetworkService = exports.NetworkService = { + // Data Sharing endpoints +// endpoint for a network to request remote relay state via local relay +requestState: { + path: '/networks.networks.Network/RequestState', + requestStream: false, + responseStream: false, + requestType: networks_networks_pb.NetworkQuery, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_networks_networks_NetworkQuery, + requestDeserialize: deserialize_networks_networks_NetworkQuery, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + // This rpc endpoint is for polling the local relay for request state. +getState: { + path: '/networks.networks.Network/GetState', + requestStream: false, + responseStream: false, + requestType: networks_networks_pb.GetStateMessage, + responseType: common_state_pb.RequestState, + requestSerialize: serialize_networks_networks_GetStateMessage, + requestDeserialize: deserialize_networks_networks_GetStateMessage, + responseSerialize: serialize_common_state_RequestState, + responseDeserialize: deserialize_common_state_RequestState, + }, + // NOTE: This rpc is just for debugging. +requestDatabase: { + path: '/networks.networks.Network/RequestDatabase', + requestStream: false, + responseStream: false, + requestType: networks_networks_pb.DbName, + responseType: networks_networks_pb.RelayDatabase, + requestSerialize: serialize_networks_networks_DbName, + requestDeserialize: deserialize_networks_networks_DbName, + responseSerialize: serialize_networks_networks_RelayDatabase, + responseDeserialize: deserialize_networks_networks_RelayDatabase, + }, + // SATP endpoints +// endpoint for a network to request asset transfer to a receiving gateway via local gateway +requestAssetTransfer: { + path: '/networks.networks.Network/RequestAssetTransfer', + requestStream: false, + responseStream: false, + requestType: networks_networks_pb.NetworkAssetTransfer, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_networks_networks_NetworkAssetTransfer, + requestDeserialize: deserialize_networks_networks_NetworkAssetTransfer, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + // Event endpoints +// endpoint for a client to subscribe to event via local relay initiating subscription flow. +subscribeEvent: { + path: '/networks.networks.Network/SubscribeEvent', + requestStream: false, + responseStream: false, + requestType: networks_networks_pb.NetworkEventSubscription, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_networks_networks_NetworkEventSubscription, + requestDeserialize: deserialize_networks_networks_NetworkEventSubscription, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + // This rpc endpoint is for polling the local relay for subscription state. +getEventSubscriptionState: { + path: '/networks.networks.Network/GetEventSubscriptionState', + requestStream: false, + responseStream: false, + requestType: networks_networks_pb.GetStateMessage, + responseType: common_events_pb.EventSubscriptionState, + requestSerialize: serialize_networks_networks_GetStateMessage, + requestDeserialize: deserialize_networks_networks_GetStateMessage, + responseSerialize: serialize_common_events_EventSubscriptionState, + responseDeserialize: deserialize_common_events_EventSubscriptionState, + }, + // endpoint for a client to subscribe to event via local relay initiating subscription flow. +unsubscribeEvent: { + path: '/networks.networks.Network/UnsubscribeEvent', + requestStream: false, + responseStream: false, + requestType: networks_networks_pb.NetworkEventUnsubscription, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_networks_networks_NetworkEventUnsubscription, + requestDeserialize: deserialize_networks_networks_NetworkEventUnsubscription, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + // endpoint for a client to fetch received events. +// Note: events are marked as deleted from relay database as soon as client fetches them. +getEventStates: { + path: '/networks.networks.Network/GetEventStates', + requestStream: false, + responseStream: false, + requestType: networks_networks_pb.GetStateMessage, + responseType: common_events_pb.EventStates, + requestSerialize: serialize_networks_networks_GetStateMessage, + requestDeserialize: deserialize_networks_networks_GetStateMessage, + responseSerialize: serialize_common_events_EventStates, + responseDeserialize: deserialize_common_events_EventStates, + }, +}; + +exports.NetworkClient = grpc.makeGenericClientConstructor(NetworkService); diff --git a/weaver/common/protos-js/networks/networks_pb.d.ts b/weaver/common/protos-js/networks/networks_pb.d.ts new file mode 100644 index 00000000000..27746b43fad --- /dev/null +++ b/weaver/common/protos-js/networks/networks_pb.d.ts @@ -0,0 +1,226 @@ +// package: networks.networks +// file: networks/networks.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; +import * as common_ack_pb from "../common/ack_pb"; +import * as common_state_pb from "../common/state_pb"; +import * as common_events_pb from "../common/events_pb"; + +export class DbName extends jspb.Message { + getName(): string; + setName(value: string): DbName; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DbName.AsObject; + static toObject(includeInstance: boolean, msg: DbName): DbName.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: DbName, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DbName; + static deserializeBinaryFromReader(message: DbName, reader: jspb.BinaryReader): DbName; +} + +export namespace DbName { + export type AsObject = { + name: string, + } +} + +export class RelayDatabase extends jspb.Message { + + getPairsMap(): jspb.Map; + clearPairsMap(): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): RelayDatabase.AsObject; + static toObject(includeInstance: boolean, msg: RelayDatabase): RelayDatabase.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: RelayDatabase, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): RelayDatabase; + static deserializeBinaryFromReader(message: RelayDatabase, reader: jspb.BinaryReader): RelayDatabase; +} + +export namespace RelayDatabase { + export type AsObject = { + + pairsMap: Array<[string, string]>, + } +} + +export class GetStateMessage extends jspb.Message { + getRequestId(): string; + setRequestId(value: string): GetStateMessage; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetStateMessage.AsObject; + static toObject(includeInstance: boolean, msg: GetStateMessage): GetStateMessage.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetStateMessage, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetStateMessage; + static deserializeBinaryFromReader(message: GetStateMessage, reader: jspb.BinaryReader): GetStateMessage; +} + +export namespace GetStateMessage { + export type AsObject = { + requestId: string, + } +} + +export class NetworkQuery extends jspb.Message { + clearPolicyList(): void; + getPolicyList(): Array; + setPolicyList(value: Array): NetworkQuery; + addPolicy(value: string, index?: number): string; + getAddress(): string; + setAddress(value: string): NetworkQuery; + getRequestingRelay(): string; + setRequestingRelay(value: string): NetworkQuery; + getRequestingNetwork(): string; + setRequestingNetwork(value: string): NetworkQuery; + getCertificate(): string; + setCertificate(value: string): NetworkQuery; + getRequestorSignature(): string; + setRequestorSignature(value: string): NetworkQuery; + getNonce(): string; + setNonce(value: string): NetworkQuery; + getRequestingOrg(): string; + setRequestingOrg(value: string): NetworkQuery; + getConfidential(): boolean; + setConfidential(value: boolean): NetworkQuery; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): NetworkQuery.AsObject; + static toObject(includeInstance: boolean, msg: NetworkQuery): NetworkQuery.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: NetworkQuery, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): NetworkQuery; + static deserializeBinaryFromReader(message: NetworkQuery, reader: jspb.BinaryReader): NetworkQuery; +} + +export namespace NetworkQuery { + export type AsObject = { + policyList: Array, + address: string, + requestingRelay: string, + requestingNetwork: string, + certificate: string, + requestorSignature: string, + nonce: string, + requestingOrg: string, + confidential: boolean, + } +} + +export class NetworkEventSubscription extends jspb.Message { + + hasEventMatcher(): boolean; + clearEventMatcher(): void; + getEventMatcher(): common_events_pb.EventMatcher | undefined; + setEventMatcher(value?: common_events_pb.EventMatcher): NetworkEventSubscription; + + hasQuery(): boolean; + clearQuery(): void; + getQuery(): NetworkQuery | undefined; + setQuery(value?: NetworkQuery): NetworkEventSubscription; + + hasEventPublicationSpec(): boolean; + clearEventPublicationSpec(): void; + getEventPublicationSpec(): common_events_pb.EventPublication | undefined; + setEventPublicationSpec(value?: common_events_pb.EventPublication): NetworkEventSubscription; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): NetworkEventSubscription.AsObject; + static toObject(includeInstance: boolean, msg: NetworkEventSubscription): NetworkEventSubscription.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: NetworkEventSubscription, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): NetworkEventSubscription; + static deserializeBinaryFromReader(message: NetworkEventSubscription, reader: jspb.BinaryReader): NetworkEventSubscription; +} + +export namespace NetworkEventSubscription { + export type AsObject = { + eventMatcher?: common_events_pb.EventMatcher.AsObject, + query?: NetworkQuery.AsObject, + eventPublicationSpec?: common_events_pb.EventPublication.AsObject, + } +} + +export class NetworkEventUnsubscription extends jspb.Message { + + hasRequest(): boolean; + clearRequest(): void; + getRequest(): NetworkEventSubscription | undefined; + setRequest(value?: NetworkEventSubscription): NetworkEventUnsubscription; + getRequestId(): string; + setRequestId(value: string): NetworkEventUnsubscription; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): NetworkEventUnsubscription.AsObject; + static toObject(includeInstance: boolean, msg: NetworkEventUnsubscription): NetworkEventUnsubscription.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: NetworkEventUnsubscription, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): NetworkEventUnsubscription; + static deserializeBinaryFromReader(message: NetworkEventUnsubscription, reader: jspb.BinaryReader): NetworkEventUnsubscription; +} + +export namespace NetworkEventUnsubscription { + export type AsObject = { + request?: NetworkEventSubscription.AsObject, + requestId: string, + } +} + +export class NetworkAssetTransfer extends jspb.Message { + getAssetType(): string; + setAssetType(value: string): NetworkAssetTransfer; + getAssetId(): string; + setAssetId(value: string): NetworkAssetTransfer; + getSender(): string; + setSender(value: string): NetworkAssetTransfer; + getSourceContractId(): string; + setSourceContractId(value: string): NetworkAssetTransfer; + getSourceRelay(): string; + setSourceRelay(value: string): NetworkAssetTransfer; + getSourceNetwork(): string; + setSourceNetwork(value: string): NetworkAssetTransfer; + getDestinationRelay(): string; + setDestinationRelay(value: string): NetworkAssetTransfer; + getDestinationNetwork(): string; + setDestinationNetwork(value: string): NetworkAssetTransfer; + getRecipient(): string; + setRecipient(value: string): NetworkAssetTransfer; + getDestinationContractId(): string; + setDestinationContractId(value: string): NetworkAssetTransfer; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): NetworkAssetTransfer.AsObject; + static toObject(includeInstance: boolean, msg: NetworkAssetTransfer): NetworkAssetTransfer.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: NetworkAssetTransfer, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): NetworkAssetTransfer; + static deserializeBinaryFromReader(message: NetworkAssetTransfer, reader: jspb.BinaryReader): NetworkAssetTransfer; +} + +export namespace NetworkAssetTransfer { + export type AsObject = { + assetType: string, + assetId: string, + sender: string, + sourceContractId: string, + sourceRelay: string, + sourceNetwork: string, + destinationRelay: string, + destinationNetwork: string, + recipient: string, + destinationContractId: string, + } +} diff --git a/weaver/common/protos-js/networks/networks_pb.js b/weaver/common/protos-js/networks/networks_pb.js new file mode 100644 index 00000000000..0f03c742f12 --- /dev/null +++ b/weaver/common/protos-js/networks/networks_pb.js @@ -0,0 +1,1807 @@ +// source: networks/networks.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +var common_ack_pb = require('../common/ack_pb.js'); +goog.object.extend(proto, common_ack_pb); +var common_state_pb = require('../common/state_pb.js'); +goog.object.extend(proto, common_state_pb); +var common_events_pb = require('../common/events_pb.js'); +goog.object.extend(proto, common_events_pb); +goog.exportSymbol('proto.networks.networks.DbName', null, global); +goog.exportSymbol('proto.networks.networks.GetStateMessage', null, global); +goog.exportSymbol('proto.networks.networks.NetworkAssetTransfer', null, global); +goog.exportSymbol('proto.networks.networks.NetworkEventSubscription', null, global); +goog.exportSymbol('proto.networks.networks.NetworkEventUnsubscription', null, global); +goog.exportSymbol('proto.networks.networks.NetworkQuery', null, global); +goog.exportSymbol('proto.networks.networks.RelayDatabase', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.networks.networks.DbName = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.networks.networks.DbName, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.networks.networks.DbName.displayName = 'proto.networks.networks.DbName'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.networks.networks.RelayDatabase = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.networks.networks.RelayDatabase, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.networks.networks.RelayDatabase.displayName = 'proto.networks.networks.RelayDatabase'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.networks.networks.GetStateMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.networks.networks.GetStateMessage, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.networks.networks.GetStateMessage.displayName = 'proto.networks.networks.GetStateMessage'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.networks.networks.NetworkQuery = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.networks.networks.NetworkQuery.repeatedFields_, null); +}; +goog.inherits(proto.networks.networks.NetworkQuery, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.networks.networks.NetworkQuery.displayName = 'proto.networks.networks.NetworkQuery'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.networks.networks.NetworkEventSubscription = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.networks.networks.NetworkEventSubscription, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.networks.networks.NetworkEventSubscription.displayName = 'proto.networks.networks.NetworkEventSubscription'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.networks.networks.NetworkEventUnsubscription = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.networks.networks.NetworkEventUnsubscription, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.networks.networks.NetworkEventUnsubscription.displayName = 'proto.networks.networks.NetworkEventUnsubscription'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.networks.networks.NetworkAssetTransfer = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.networks.networks.NetworkAssetTransfer, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.networks.networks.NetworkAssetTransfer.displayName = 'proto.networks.networks.NetworkAssetTransfer'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.networks.networks.DbName.prototype.toObject = function(opt_includeInstance) { + return proto.networks.networks.DbName.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.networks.networks.DbName} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.networks.networks.DbName.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.networks.networks.DbName} + */ +proto.networks.networks.DbName.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.networks.networks.DbName; + return proto.networks.networks.DbName.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.networks.networks.DbName} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.networks.networks.DbName} + */ +proto.networks.networks.DbName.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.networks.networks.DbName.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.networks.networks.DbName.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.networks.networks.DbName} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.networks.networks.DbName.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.networks.networks.DbName.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.networks.networks.DbName} returns this + */ +proto.networks.networks.DbName.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.networks.networks.RelayDatabase.prototype.toObject = function(opt_includeInstance) { + return proto.networks.networks.RelayDatabase.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.networks.networks.RelayDatabase} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.networks.networks.RelayDatabase.toObject = function(includeInstance, msg) { + var f, obj = { + pairsMap: (f = msg.getPairsMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.networks.networks.RelayDatabase} + */ +proto.networks.networks.RelayDatabase.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.networks.networks.RelayDatabase; + return proto.networks.networks.RelayDatabase.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.networks.networks.RelayDatabase} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.networks.networks.RelayDatabase} + */ +proto.networks.networks.RelayDatabase.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = msg.getPairsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.networks.networks.RelayDatabase.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.networks.networks.RelayDatabase.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.networks.networks.RelayDatabase} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.networks.networks.RelayDatabase.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPairsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * map pairs = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.networks.networks.RelayDatabase.prototype.getPairsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.networks.networks.RelayDatabase} returns this + */ +proto.networks.networks.RelayDatabase.prototype.clearPairsMap = function() { + this.getPairsMap().clear(); + return this;}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.networks.networks.GetStateMessage.prototype.toObject = function(opt_includeInstance) { + return proto.networks.networks.GetStateMessage.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.networks.networks.GetStateMessage} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.networks.networks.GetStateMessage.toObject = function(includeInstance, msg) { + var f, obj = { + requestId: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.networks.networks.GetStateMessage} + */ +proto.networks.networks.GetStateMessage.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.networks.networks.GetStateMessage; + return proto.networks.networks.GetStateMessage.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.networks.networks.GetStateMessage} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.networks.networks.GetStateMessage} + */ +proto.networks.networks.GetStateMessage.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setRequestId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.networks.networks.GetStateMessage.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.networks.networks.GetStateMessage.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.networks.networks.GetStateMessage} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.networks.networks.GetStateMessage.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRequestId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string request_id = 1; + * @return {string} + */ +proto.networks.networks.GetStateMessage.prototype.getRequestId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.networks.networks.GetStateMessage} returns this + */ +proto.networks.networks.GetStateMessage.prototype.setRequestId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.networks.networks.NetworkQuery.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.networks.networks.NetworkQuery.prototype.toObject = function(opt_includeInstance) { + return proto.networks.networks.NetworkQuery.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.networks.networks.NetworkQuery} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.networks.networks.NetworkQuery.toObject = function(includeInstance, msg) { + var f, obj = { + policyList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f, + address: jspb.Message.getFieldWithDefault(msg, 2, ""), + requestingRelay: jspb.Message.getFieldWithDefault(msg, 3, ""), + requestingNetwork: jspb.Message.getFieldWithDefault(msg, 4, ""), + certificate: jspb.Message.getFieldWithDefault(msg, 5, ""), + requestorSignature: jspb.Message.getFieldWithDefault(msg, 6, ""), + nonce: jspb.Message.getFieldWithDefault(msg, 7, ""), + requestingOrg: jspb.Message.getFieldWithDefault(msg, 8, ""), + confidential: jspb.Message.getBooleanFieldWithDefault(msg, 9, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.networks.networks.NetworkQuery} + */ +proto.networks.networks.NetworkQuery.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.networks.networks.NetworkQuery; + return proto.networks.networks.NetworkQuery.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.networks.networks.NetworkQuery} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.networks.networks.NetworkQuery} + */ +proto.networks.networks.NetworkQuery.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.addPolicy(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setAddress(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setRequestingRelay(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setRequestingNetwork(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setCertificate(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setRequestorSignature(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setNonce(value); + break; + case 8: + var value = /** @type {string} */ (reader.readString()); + msg.setRequestingOrg(value); + break; + case 9: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setConfidential(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.networks.networks.NetworkQuery.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.networks.networks.NetworkQuery.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.networks.networks.NetworkQuery} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.networks.networks.NetworkQuery.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPolicyList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } + f = message.getAddress(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getRequestingRelay(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getRequestingNetwork(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getCertificate(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getRequestorSignature(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getNonce(); + if (f.length > 0) { + writer.writeString( + 7, + f + ); + } + f = message.getRequestingOrg(); + if (f.length > 0) { + writer.writeString( + 8, + f + ); + } + f = message.getConfidential(); + if (f) { + writer.writeBool( + 9, + f + ); + } +}; + + +/** + * repeated string policy = 1; + * @return {!Array} + */ +proto.networks.networks.NetworkQuery.prototype.getPolicyList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.networks.networks.NetworkQuery} returns this + */ +proto.networks.networks.NetworkQuery.prototype.setPolicyList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.networks.networks.NetworkQuery} returns this + */ +proto.networks.networks.NetworkQuery.prototype.addPolicy = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.networks.networks.NetworkQuery} returns this + */ +proto.networks.networks.NetworkQuery.prototype.clearPolicyList = function() { + return this.setPolicyList([]); +}; + + +/** + * optional string address = 2; + * @return {string} + */ +proto.networks.networks.NetworkQuery.prototype.getAddress = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.networks.networks.NetworkQuery} returns this + */ +proto.networks.networks.NetworkQuery.prototype.setAddress = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string requesting_relay = 3; + * @return {string} + */ +proto.networks.networks.NetworkQuery.prototype.getRequestingRelay = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.networks.networks.NetworkQuery} returns this + */ +proto.networks.networks.NetworkQuery.prototype.setRequestingRelay = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string requesting_network = 4; + * @return {string} + */ +proto.networks.networks.NetworkQuery.prototype.getRequestingNetwork = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.networks.networks.NetworkQuery} returns this + */ +proto.networks.networks.NetworkQuery.prototype.setRequestingNetwork = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string certificate = 5; + * @return {string} + */ +proto.networks.networks.NetworkQuery.prototype.getCertificate = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.networks.networks.NetworkQuery} returns this + */ +proto.networks.networks.NetworkQuery.prototype.setCertificate = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string requestor_signature = 6; + * @return {string} + */ +proto.networks.networks.NetworkQuery.prototype.getRequestorSignature = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.networks.networks.NetworkQuery} returns this + */ +proto.networks.networks.NetworkQuery.prototype.setRequestorSignature = function(value) { + return jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional string nonce = 7; + * @return {string} + */ +proto.networks.networks.NetworkQuery.prototype.getNonce = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * @param {string} value + * @return {!proto.networks.networks.NetworkQuery} returns this + */ +proto.networks.networks.NetworkQuery.prototype.setNonce = function(value) { + return jspb.Message.setProto3StringField(this, 7, value); +}; + + +/** + * optional string requesting_org = 8; + * @return {string} + */ +proto.networks.networks.NetworkQuery.prototype.getRequestingOrg = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); +}; + + +/** + * @param {string} value + * @return {!proto.networks.networks.NetworkQuery} returns this + */ +proto.networks.networks.NetworkQuery.prototype.setRequestingOrg = function(value) { + return jspb.Message.setProto3StringField(this, 8, value); +}; + + +/** + * optional bool confidential = 9; + * @return {boolean} + */ +proto.networks.networks.NetworkQuery.prototype.getConfidential = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 9, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.networks.networks.NetworkQuery} returns this + */ +proto.networks.networks.NetworkQuery.prototype.setConfidential = function(value) { + return jspb.Message.setProto3BooleanField(this, 9, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.networks.networks.NetworkEventSubscription.prototype.toObject = function(opt_includeInstance) { + return proto.networks.networks.NetworkEventSubscription.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.networks.networks.NetworkEventSubscription} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.networks.networks.NetworkEventSubscription.toObject = function(includeInstance, msg) { + var f, obj = { + eventMatcher: (f = msg.getEventMatcher()) && common_events_pb.EventMatcher.toObject(includeInstance, f), + query: (f = msg.getQuery()) && proto.networks.networks.NetworkQuery.toObject(includeInstance, f), + eventPublicationSpec: (f = msg.getEventPublicationSpec()) && common_events_pb.EventPublication.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.networks.networks.NetworkEventSubscription} + */ +proto.networks.networks.NetworkEventSubscription.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.networks.networks.NetworkEventSubscription; + return proto.networks.networks.NetworkEventSubscription.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.networks.networks.NetworkEventSubscription} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.networks.networks.NetworkEventSubscription} + */ +proto.networks.networks.NetworkEventSubscription.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new common_events_pb.EventMatcher; + reader.readMessage(value,common_events_pb.EventMatcher.deserializeBinaryFromReader); + msg.setEventMatcher(value); + break; + case 2: + var value = new proto.networks.networks.NetworkQuery; + reader.readMessage(value,proto.networks.networks.NetworkQuery.deserializeBinaryFromReader); + msg.setQuery(value); + break; + case 3: + var value = new common_events_pb.EventPublication; + reader.readMessage(value,common_events_pb.EventPublication.deserializeBinaryFromReader); + msg.setEventPublicationSpec(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.networks.networks.NetworkEventSubscription.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.networks.networks.NetworkEventSubscription.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.networks.networks.NetworkEventSubscription} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.networks.networks.NetworkEventSubscription.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getEventMatcher(); + if (f != null) { + writer.writeMessage( + 1, + f, + common_events_pb.EventMatcher.serializeBinaryToWriter + ); + } + f = message.getQuery(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.networks.networks.NetworkQuery.serializeBinaryToWriter + ); + } + f = message.getEventPublicationSpec(); + if (f != null) { + writer.writeMessage( + 3, + f, + common_events_pb.EventPublication.serializeBinaryToWriter + ); + } +}; + + +/** + * optional common.events.EventMatcher event_matcher = 1; + * @return {?proto.common.events.EventMatcher} + */ +proto.networks.networks.NetworkEventSubscription.prototype.getEventMatcher = function() { + return /** @type{?proto.common.events.EventMatcher} */ ( + jspb.Message.getWrapperField(this, common_events_pb.EventMatcher, 1)); +}; + + +/** + * @param {?proto.common.events.EventMatcher|undefined} value + * @return {!proto.networks.networks.NetworkEventSubscription} returns this +*/ +proto.networks.networks.NetworkEventSubscription.prototype.setEventMatcher = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.networks.networks.NetworkEventSubscription} returns this + */ +proto.networks.networks.NetworkEventSubscription.prototype.clearEventMatcher = function() { + return this.setEventMatcher(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.networks.networks.NetworkEventSubscription.prototype.hasEventMatcher = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional NetworkQuery query = 2; + * @return {?proto.networks.networks.NetworkQuery} + */ +proto.networks.networks.NetworkEventSubscription.prototype.getQuery = function() { + return /** @type{?proto.networks.networks.NetworkQuery} */ ( + jspb.Message.getWrapperField(this, proto.networks.networks.NetworkQuery, 2)); +}; + + +/** + * @param {?proto.networks.networks.NetworkQuery|undefined} value + * @return {!proto.networks.networks.NetworkEventSubscription} returns this +*/ +proto.networks.networks.NetworkEventSubscription.prototype.setQuery = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.networks.networks.NetworkEventSubscription} returns this + */ +proto.networks.networks.NetworkEventSubscription.prototype.clearQuery = function() { + return this.setQuery(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.networks.networks.NetworkEventSubscription.prototype.hasQuery = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional common.events.EventPublication event_publication_spec = 3; + * @return {?proto.common.events.EventPublication} + */ +proto.networks.networks.NetworkEventSubscription.prototype.getEventPublicationSpec = function() { + return /** @type{?proto.common.events.EventPublication} */ ( + jspb.Message.getWrapperField(this, common_events_pb.EventPublication, 3)); +}; + + +/** + * @param {?proto.common.events.EventPublication|undefined} value + * @return {!proto.networks.networks.NetworkEventSubscription} returns this +*/ +proto.networks.networks.NetworkEventSubscription.prototype.setEventPublicationSpec = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.networks.networks.NetworkEventSubscription} returns this + */ +proto.networks.networks.NetworkEventSubscription.prototype.clearEventPublicationSpec = function() { + return this.setEventPublicationSpec(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.networks.networks.NetworkEventSubscription.prototype.hasEventPublicationSpec = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.networks.networks.NetworkEventUnsubscription.prototype.toObject = function(opt_includeInstance) { + return proto.networks.networks.NetworkEventUnsubscription.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.networks.networks.NetworkEventUnsubscription} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.networks.networks.NetworkEventUnsubscription.toObject = function(includeInstance, msg) { + var f, obj = { + request: (f = msg.getRequest()) && proto.networks.networks.NetworkEventSubscription.toObject(includeInstance, f), + requestId: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.networks.networks.NetworkEventUnsubscription} + */ +proto.networks.networks.NetworkEventUnsubscription.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.networks.networks.NetworkEventUnsubscription; + return proto.networks.networks.NetworkEventUnsubscription.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.networks.networks.NetworkEventUnsubscription} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.networks.networks.NetworkEventUnsubscription} + */ +proto.networks.networks.NetworkEventUnsubscription.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.networks.networks.NetworkEventSubscription; + reader.readMessage(value,proto.networks.networks.NetworkEventSubscription.deserializeBinaryFromReader); + msg.setRequest(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setRequestId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.networks.networks.NetworkEventUnsubscription.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.networks.networks.NetworkEventUnsubscription.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.networks.networks.NetworkEventUnsubscription} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.networks.networks.NetworkEventUnsubscription.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRequest(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.networks.networks.NetworkEventSubscription.serializeBinaryToWriter + ); + } + f = message.getRequestId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional NetworkEventSubscription request = 1; + * @return {?proto.networks.networks.NetworkEventSubscription} + */ +proto.networks.networks.NetworkEventUnsubscription.prototype.getRequest = function() { + return /** @type{?proto.networks.networks.NetworkEventSubscription} */ ( + jspb.Message.getWrapperField(this, proto.networks.networks.NetworkEventSubscription, 1)); +}; + + +/** + * @param {?proto.networks.networks.NetworkEventSubscription|undefined} value + * @return {!proto.networks.networks.NetworkEventUnsubscription} returns this +*/ +proto.networks.networks.NetworkEventUnsubscription.prototype.setRequest = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.networks.networks.NetworkEventUnsubscription} returns this + */ +proto.networks.networks.NetworkEventUnsubscription.prototype.clearRequest = function() { + return this.setRequest(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.networks.networks.NetworkEventUnsubscription.prototype.hasRequest = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional string request_id = 2; + * @return {string} + */ +proto.networks.networks.NetworkEventUnsubscription.prototype.getRequestId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.networks.networks.NetworkEventUnsubscription} returns this + */ +proto.networks.networks.NetworkEventUnsubscription.prototype.setRequestId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.networks.networks.NetworkAssetTransfer.prototype.toObject = function(opt_includeInstance) { + return proto.networks.networks.NetworkAssetTransfer.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.networks.networks.NetworkAssetTransfer} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.networks.networks.NetworkAssetTransfer.toObject = function(includeInstance, msg) { + var f, obj = { + assetType: jspb.Message.getFieldWithDefault(msg, 1, ""), + assetId: jspb.Message.getFieldWithDefault(msg, 2, ""), + sender: jspb.Message.getFieldWithDefault(msg, 3, ""), + sourceContractId: jspb.Message.getFieldWithDefault(msg, 4, ""), + sourceRelay: jspb.Message.getFieldWithDefault(msg, 5, ""), + sourceNetwork: jspb.Message.getFieldWithDefault(msg, 6, ""), + destinationRelay: jspb.Message.getFieldWithDefault(msg, 7, ""), + destinationNetwork: jspb.Message.getFieldWithDefault(msg, 8, ""), + recipient: jspb.Message.getFieldWithDefault(msg, 9, ""), + destinationContractId: jspb.Message.getFieldWithDefault(msg, 10, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.networks.networks.NetworkAssetTransfer} + */ +proto.networks.networks.NetworkAssetTransfer.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.networks.networks.NetworkAssetTransfer; + return proto.networks.networks.NetworkAssetTransfer.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.networks.networks.NetworkAssetTransfer} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.networks.networks.NetworkAssetTransfer} + */ +proto.networks.networks.NetworkAssetTransfer.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setAssetType(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setAssetId(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setSender(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setSourceContractId(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setSourceRelay(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setSourceNetwork(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setDestinationRelay(value); + break; + case 8: + var value = /** @type {string} */ (reader.readString()); + msg.setDestinationNetwork(value); + break; + case 9: + var value = /** @type {string} */ (reader.readString()); + msg.setRecipient(value); + break; + case 10: + var value = /** @type {string} */ (reader.readString()); + msg.setDestinationContractId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.networks.networks.NetworkAssetTransfer.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.networks.networks.NetworkAssetTransfer.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.networks.networks.NetworkAssetTransfer} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.networks.networks.NetworkAssetTransfer.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAssetType(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getAssetId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getSender(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getSourceContractId(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getSourceRelay(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getSourceNetwork(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getDestinationRelay(); + if (f.length > 0) { + writer.writeString( + 7, + f + ); + } + f = message.getDestinationNetwork(); + if (f.length > 0) { + writer.writeString( + 8, + f + ); + } + f = message.getRecipient(); + if (f.length > 0) { + writer.writeString( + 9, + f + ); + } + f = message.getDestinationContractId(); + if (f.length > 0) { + writer.writeString( + 10, + f + ); + } +}; + + +/** + * optional string asset_type = 1; + * @return {string} + */ +proto.networks.networks.NetworkAssetTransfer.prototype.getAssetType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.networks.networks.NetworkAssetTransfer} returns this + */ +proto.networks.networks.NetworkAssetTransfer.prototype.setAssetType = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string asset_id = 2; + * @return {string} + */ +proto.networks.networks.NetworkAssetTransfer.prototype.getAssetId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.networks.networks.NetworkAssetTransfer} returns this + */ +proto.networks.networks.NetworkAssetTransfer.prototype.setAssetId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string sender = 3; + * @return {string} + */ +proto.networks.networks.NetworkAssetTransfer.prototype.getSender = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.networks.networks.NetworkAssetTransfer} returns this + */ +proto.networks.networks.NetworkAssetTransfer.prototype.setSender = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string source_contract_id = 4; + * @return {string} + */ +proto.networks.networks.NetworkAssetTransfer.prototype.getSourceContractId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.networks.networks.NetworkAssetTransfer} returns this + */ +proto.networks.networks.NetworkAssetTransfer.prototype.setSourceContractId = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string source_relay = 5; + * @return {string} + */ +proto.networks.networks.NetworkAssetTransfer.prototype.getSourceRelay = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.networks.networks.NetworkAssetTransfer} returns this + */ +proto.networks.networks.NetworkAssetTransfer.prototype.setSourceRelay = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string source_network = 6; + * @return {string} + */ +proto.networks.networks.NetworkAssetTransfer.prototype.getSourceNetwork = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.networks.networks.NetworkAssetTransfer} returns this + */ +proto.networks.networks.NetworkAssetTransfer.prototype.setSourceNetwork = function(value) { + return jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional string destination_relay = 7; + * @return {string} + */ +proto.networks.networks.NetworkAssetTransfer.prototype.getDestinationRelay = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * @param {string} value + * @return {!proto.networks.networks.NetworkAssetTransfer} returns this + */ +proto.networks.networks.NetworkAssetTransfer.prototype.setDestinationRelay = function(value) { + return jspb.Message.setProto3StringField(this, 7, value); +}; + + +/** + * optional string destination_network = 8; + * @return {string} + */ +proto.networks.networks.NetworkAssetTransfer.prototype.getDestinationNetwork = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); +}; + + +/** + * @param {string} value + * @return {!proto.networks.networks.NetworkAssetTransfer} returns this + */ +proto.networks.networks.NetworkAssetTransfer.prototype.setDestinationNetwork = function(value) { + return jspb.Message.setProto3StringField(this, 8, value); +}; + + +/** + * optional string recipient = 9; + * @return {string} + */ +proto.networks.networks.NetworkAssetTransfer.prototype.getRecipient = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, "")); +}; + + +/** + * @param {string} value + * @return {!proto.networks.networks.NetworkAssetTransfer} returns this + */ +proto.networks.networks.NetworkAssetTransfer.prototype.setRecipient = function(value) { + return jspb.Message.setProto3StringField(this, 9, value); +}; + + +/** + * optional string destination_contract_id = 10; + * @return {string} + */ +proto.networks.networks.NetworkAssetTransfer.prototype.getDestinationContractId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 10, "")); +}; + + +/** + * @param {string} value + * @return {!proto.networks.networks.NetworkAssetTransfer} returns this + */ +proto.networks.networks.NetworkAssetTransfer.prototype.setDestinationContractId = function(value) { + return jspb.Message.setProto3StringField(this, 10, value); +}; + + +goog.object.extend(exports, proto.networks.networks); diff --git a/weaver/common/protos-js/package.json b/weaver/common/protos-js/package.json index e9355f3aac6..54d9823694f 100644 --- a/weaver/common/protos-js/package.json +++ b/weaver/common/protos-js/package.json @@ -32,7 +32,6 @@ "./identity/*": "./identity/*.js", "./relay/*": "./relay/*.js" }, - "main": "index.js", "scripts": { "build": "sh ./build-protos.sh", "test": "echo \"Error: no test specified\" && exit 1" @@ -40,6 +39,7 @@ "dependencies": { "@grpc/grpc-js": "1.11.2", "@grpc/proto-loader": "0.7.13", + "@types/node": "18.19.0", "google-protobuf": "3.21.4", "grpc-tools": "1.12.4" }, diff --git a/weaver/common/protos-js/peer/chaincode_pb.d.ts b/weaver/common/protos-js/peer/chaincode_pb.d.ts new file mode 100644 index 00000000000..4e07b4212e9 --- /dev/null +++ b/weaver/common/protos-js/peer/chaincode_pb.d.ts @@ -0,0 +1,259 @@ +// package: protos +// file: peer/chaincode.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; +import * as common_policies_pb from "../common/policies_pb"; + +export class ChaincodeID extends jspb.Message { + getPath(): string; + setPath(value: string): ChaincodeID; + getName(): string; + setName(value: string): ChaincodeID; + getVersion(): string; + setVersion(value: string): ChaincodeID; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ChaincodeID.AsObject; + static toObject(includeInstance: boolean, msg: ChaincodeID): ChaincodeID.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ChaincodeID, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ChaincodeID; + static deserializeBinaryFromReader(message: ChaincodeID, reader: jspb.BinaryReader): ChaincodeID; +} + +export namespace ChaincodeID { + export type AsObject = { + path: string, + name: string, + version: string, + } +} + +export class ChaincodeInput extends jspb.Message { + clearArgsList(): void; + getArgsList(): Array; + getArgsList_asU8(): Array; + getArgsList_asB64(): Array; + setArgsList(value: Array): ChaincodeInput; + addArgs(value: Uint8Array | string, index?: number): Uint8Array | string; + + getDecorationsMap(): jspb.Map; + clearDecorationsMap(): void; + getIsInit(): boolean; + setIsInit(value: boolean): ChaincodeInput; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ChaincodeInput.AsObject; + static toObject(includeInstance: boolean, msg: ChaincodeInput): ChaincodeInput.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ChaincodeInput, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ChaincodeInput; + static deserializeBinaryFromReader(message: ChaincodeInput, reader: jspb.BinaryReader): ChaincodeInput; +} + +export namespace ChaincodeInput { + export type AsObject = { + argsList: Array, + + decorationsMap: Array<[string, Uint8Array | string]>, + isInit: boolean, + } +} + +export class ChaincodeSpec extends jspb.Message { + getType(): ChaincodeSpec.Type; + setType(value: ChaincodeSpec.Type): ChaincodeSpec; + + hasChaincodeId(): boolean; + clearChaincodeId(): void; + getChaincodeId(): ChaincodeID | undefined; + setChaincodeId(value?: ChaincodeID): ChaincodeSpec; + + hasInput(): boolean; + clearInput(): void; + getInput(): ChaincodeInput | undefined; + setInput(value?: ChaincodeInput): ChaincodeSpec; + getTimeout(): number; + setTimeout(value: number): ChaincodeSpec; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ChaincodeSpec.AsObject; + static toObject(includeInstance: boolean, msg: ChaincodeSpec): ChaincodeSpec.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ChaincodeSpec, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ChaincodeSpec; + static deserializeBinaryFromReader(message: ChaincodeSpec, reader: jspb.BinaryReader): ChaincodeSpec; +} + +export namespace ChaincodeSpec { + export type AsObject = { + type: ChaincodeSpec.Type, + chaincodeId?: ChaincodeID.AsObject, + input?: ChaincodeInput.AsObject, + timeout: number, + } + + export enum Type { + UNDEFINED = 0, + GOLANG = 1, + NODE = 2, + CAR = 3, + JAVA = 4, + } + +} + +export class ChaincodeDeploymentSpec extends jspb.Message { + + hasChaincodeSpec(): boolean; + clearChaincodeSpec(): void; + getChaincodeSpec(): ChaincodeSpec | undefined; + setChaincodeSpec(value?: ChaincodeSpec): ChaincodeDeploymentSpec; + getCodePackage(): Uint8Array | string; + getCodePackage_asU8(): Uint8Array; + getCodePackage_asB64(): string; + setCodePackage(value: Uint8Array | string): ChaincodeDeploymentSpec; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ChaincodeDeploymentSpec.AsObject; + static toObject(includeInstance: boolean, msg: ChaincodeDeploymentSpec): ChaincodeDeploymentSpec.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ChaincodeDeploymentSpec, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ChaincodeDeploymentSpec; + static deserializeBinaryFromReader(message: ChaincodeDeploymentSpec, reader: jspb.BinaryReader): ChaincodeDeploymentSpec; +} + +export namespace ChaincodeDeploymentSpec { + export type AsObject = { + chaincodeSpec?: ChaincodeSpec.AsObject, + codePackage: Uint8Array | string, + } +} + +export class ChaincodeInvocationSpec extends jspb.Message { + + hasChaincodeSpec(): boolean; + clearChaincodeSpec(): void; + getChaincodeSpec(): ChaincodeSpec | undefined; + setChaincodeSpec(value?: ChaincodeSpec): ChaincodeInvocationSpec; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ChaincodeInvocationSpec.AsObject; + static toObject(includeInstance: boolean, msg: ChaincodeInvocationSpec): ChaincodeInvocationSpec.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ChaincodeInvocationSpec, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ChaincodeInvocationSpec; + static deserializeBinaryFromReader(message: ChaincodeInvocationSpec, reader: jspb.BinaryReader): ChaincodeInvocationSpec; +} + +export namespace ChaincodeInvocationSpec { + export type AsObject = { + chaincodeSpec?: ChaincodeSpec.AsObject, + } +} + +export class LifecycleEvent extends jspb.Message { + getChaincodeName(): string; + setChaincodeName(value: string): LifecycleEvent; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): LifecycleEvent.AsObject; + static toObject(includeInstance: boolean, msg: LifecycleEvent): LifecycleEvent.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: LifecycleEvent, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): LifecycleEvent; + static deserializeBinaryFromReader(message: LifecycleEvent, reader: jspb.BinaryReader): LifecycleEvent; +} + +export namespace LifecycleEvent { + export type AsObject = { + chaincodeName: string, + } +} + +export class CDSData extends jspb.Message { + getHash(): Uint8Array | string; + getHash_asU8(): Uint8Array; + getHash_asB64(): string; + setHash(value: Uint8Array | string): CDSData; + getMetadatahash(): Uint8Array | string; + getMetadatahash_asU8(): Uint8Array; + getMetadatahash_asB64(): string; + setMetadatahash(value: Uint8Array | string): CDSData; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): CDSData.AsObject; + static toObject(includeInstance: boolean, msg: CDSData): CDSData.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: CDSData, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): CDSData; + static deserializeBinaryFromReader(message: CDSData, reader: jspb.BinaryReader): CDSData; +} + +export namespace CDSData { + export type AsObject = { + hash: Uint8Array | string, + metadatahash: Uint8Array | string, + } +} + +export class ChaincodeData extends jspb.Message { + getName(): string; + setName(value: string): ChaincodeData; + getVersion(): string; + setVersion(value: string): ChaincodeData; + getEscc(): string; + setEscc(value: string): ChaincodeData; + getVscc(): string; + setVscc(value: string): ChaincodeData; + + hasPolicy(): boolean; + clearPolicy(): void; + getPolicy(): common_policies_pb.SignaturePolicyEnvelope | undefined; + setPolicy(value?: common_policies_pb.SignaturePolicyEnvelope): ChaincodeData; + getData(): Uint8Array | string; + getData_asU8(): Uint8Array; + getData_asB64(): string; + setData(value: Uint8Array | string): ChaincodeData; + getId(): Uint8Array | string; + getId_asU8(): Uint8Array; + getId_asB64(): string; + setId(value: Uint8Array | string): ChaincodeData; + + hasInstantiationPolicy(): boolean; + clearInstantiationPolicy(): void; + getInstantiationPolicy(): common_policies_pb.SignaturePolicyEnvelope | undefined; + setInstantiationPolicy(value?: common_policies_pb.SignaturePolicyEnvelope): ChaincodeData; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ChaincodeData.AsObject; + static toObject(includeInstance: boolean, msg: ChaincodeData): ChaincodeData.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ChaincodeData, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ChaincodeData; + static deserializeBinaryFromReader(message: ChaincodeData, reader: jspb.BinaryReader): ChaincodeData; +} + +export namespace ChaincodeData { + export type AsObject = { + name: string, + version: string, + escc: string, + vscc: string, + policy?: common_policies_pb.SignaturePolicyEnvelope.AsObject, + data: Uint8Array | string, + id: Uint8Array | string, + instantiationPolicy?: common_policies_pb.SignaturePolicyEnvelope.AsObject, + } +} diff --git a/weaver/common/protos-js/peer/chaincode_pb.js b/weaver/common/protos-js/peer/chaincode_pb.js new file mode 100644 index 00000000000..b5183b7e4b2 --- /dev/null +++ b/weaver/common/protos-js/peer/chaincode_pb.js @@ -0,0 +1,2033 @@ +// source: peer/chaincode.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +var common_policies_pb = require('../common/policies_pb.js'); +goog.object.extend(proto, common_policies_pb); +goog.exportSymbol('proto.protos.CDSData', null, global); +goog.exportSymbol('proto.protos.ChaincodeData', null, global); +goog.exportSymbol('proto.protos.ChaincodeDeploymentSpec', null, global); +goog.exportSymbol('proto.protos.ChaincodeID', null, global); +goog.exportSymbol('proto.protos.ChaincodeInput', null, global); +goog.exportSymbol('proto.protos.ChaincodeInvocationSpec', null, global); +goog.exportSymbol('proto.protos.ChaincodeSpec', null, global); +goog.exportSymbol('proto.protos.ChaincodeSpec.Type', null, global); +goog.exportSymbol('proto.protos.LifecycleEvent', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protos.ChaincodeID = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protos.ChaincodeID, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.protos.ChaincodeID.displayName = 'proto.protos.ChaincodeID'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protos.ChaincodeInput = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protos.ChaincodeInput.repeatedFields_, null); +}; +goog.inherits(proto.protos.ChaincodeInput, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.protos.ChaincodeInput.displayName = 'proto.protos.ChaincodeInput'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protos.ChaincodeSpec = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protos.ChaincodeSpec, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.protos.ChaincodeSpec.displayName = 'proto.protos.ChaincodeSpec'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protos.ChaincodeDeploymentSpec = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protos.ChaincodeDeploymentSpec, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.protos.ChaincodeDeploymentSpec.displayName = 'proto.protos.ChaincodeDeploymentSpec'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protos.ChaincodeInvocationSpec = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protos.ChaincodeInvocationSpec, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.protos.ChaincodeInvocationSpec.displayName = 'proto.protos.ChaincodeInvocationSpec'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protos.LifecycleEvent = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protos.LifecycleEvent, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.protos.LifecycleEvent.displayName = 'proto.protos.LifecycleEvent'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protos.CDSData = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protos.CDSData, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.protos.CDSData.displayName = 'proto.protos.CDSData'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protos.ChaincodeData = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protos.ChaincodeData, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.protos.ChaincodeData.displayName = 'proto.protos.ChaincodeData'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.protos.ChaincodeID.prototype.toObject = function(opt_includeInstance) { + return proto.protos.ChaincodeID.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protos.ChaincodeID} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.ChaincodeID.toObject = function(includeInstance, msg) { + var f, obj = { + path: jspb.Message.getFieldWithDefault(msg, 1, ""), + name: jspb.Message.getFieldWithDefault(msg, 2, ""), + version: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protos.ChaincodeID} + */ +proto.protos.ChaincodeID.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protos.ChaincodeID; + return proto.protos.ChaincodeID.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protos.ChaincodeID} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protos.ChaincodeID} + */ +proto.protos.ChaincodeID.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setPath(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setVersion(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protos.ChaincodeID.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protos.ChaincodeID.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protos.ChaincodeID} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.ChaincodeID.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPath(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getVersion(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional string path = 1; + * @return {string} + */ +proto.protos.ChaincodeID.prototype.getPath = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.protos.ChaincodeID} returns this + */ +proto.protos.ChaincodeID.prototype.setPath = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string name = 2; + * @return {string} + */ +proto.protos.ChaincodeID.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.protos.ChaincodeID} returns this + */ +proto.protos.ChaincodeID.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string version = 3; + * @return {string} + */ +proto.protos.ChaincodeID.prototype.getVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.protos.ChaincodeID} returns this + */ +proto.protos.ChaincodeID.prototype.setVersion = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protos.ChaincodeInput.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.protos.ChaincodeInput.prototype.toObject = function(opt_includeInstance) { + return proto.protos.ChaincodeInput.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protos.ChaincodeInput} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.ChaincodeInput.toObject = function(includeInstance, msg) { + var f, obj = { + argsList: msg.getArgsList_asB64(), + decorationsMap: (f = msg.getDecorationsMap()) ? f.toObject(includeInstance, undefined) : [], + isInit: jspb.Message.getBooleanFieldWithDefault(msg, 3, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protos.ChaincodeInput} + */ +proto.protos.ChaincodeInput.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protos.ChaincodeInput; + return proto.protos.ChaincodeInput.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protos.ChaincodeInput} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protos.ChaincodeInput} + */ +proto.protos.ChaincodeInput.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addArgs(value); + break; + case 2: + var value = msg.getDecorationsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readBytes, null, "", ""); + }); + break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsInit(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protos.ChaincodeInput.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protos.ChaincodeInput.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protos.ChaincodeInput} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.ChaincodeInput.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getArgsList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 1, + f + ); + } + f = message.getDecorationsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeBytes); + } + f = message.getIsInit(); + if (f) { + writer.writeBool( + 3, + f + ); + } +}; + + +/** + * repeated bytes args = 1; + * @return {!(Array|Array)} + */ +proto.protos.ChaincodeInput.prototype.getArgsList = function() { + return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * repeated bytes args = 1; + * This is a type-conversion wrapper around `getArgsList()` + * @return {!Array} + */ +proto.protos.ChaincodeInput.prototype.getArgsList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getArgsList())); +}; + + +/** + * repeated bytes args = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getArgsList()` + * @return {!Array} + */ +proto.protos.ChaincodeInput.prototype.getArgsList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getArgsList())); +}; + + +/** + * @param {!(Array|Array)} value + * @return {!proto.protos.ChaincodeInput} returns this + */ +proto.protos.ChaincodeInput.prototype.setArgsList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.protos.ChaincodeInput} returns this + */ +proto.protos.ChaincodeInput.prototype.addArgs = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.protos.ChaincodeInput} returns this + */ +proto.protos.ChaincodeInput.prototype.clearArgsList = function() { + return this.setArgsList([]); +}; + + +/** + * map decorations = 2; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.protos.ChaincodeInput.prototype.getDecorationsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 2, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.protos.ChaincodeInput} returns this + */ +proto.protos.ChaincodeInput.prototype.clearDecorationsMap = function() { + this.getDecorationsMap().clear(); + return this;}; + + +/** + * optional bool is_init = 3; + * @return {boolean} + */ +proto.protos.ChaincodeInput.prototype.getIsInit = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.protos.ChaincodeInput} returns this + */ +proto.protos.ChaincodeInput.prototype.setIsInit = function(value) { + return jspb.Message.setProto3BooleanField(this, 3, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.protos.ChaincodeSpec.prototype.toObject = function(opt_includeInstance) { + return proto.protos.ChaincodeSpec.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protos.ChaincodeSpec} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.ChaincodeSpec.toObject = function(includeInstance, msg) { + var f, obj = { + type: jspb.Message.getFieldWithDefault(msg, 1, 0), + chaincodeId: (f = msg.getChaincodeId()) && proto.protos.ChaincodeID.toObject(includeInstance, f), + input: (f = msg.getInput()) && proto.protos.ChaincodeInput.toObject(includeInstance, f), + timeout: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protos.ChaincodeSpec} + */ +proto.protos.ChaincodeSpec.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protos.ChaincodeSpec; + return proto.protos.ChaincodeSpec.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protos.ChaincodeSpec} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protos.ChaincodeSpec} + */ +proto.protos.ChaincodeSpec.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.protos.ChaincodeSpec.Type} */ (reader.readEnum()); + msg.setType(value); + break; + case 2: + var value = new proto.protos.ChaincodeID; + reader.readMessage(value,proto.protos.ChaincodeID.deserializeBinaryFromReader); + msg.setChaincodeId(value); + break; + case 3: + var value = new proto.protos.ChaincodeInput; + reader.readMessage(value,proto.protos.ChaincodeInput.deserializeBinaryFromReader); + msg.setInput(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt32()); + msg.setTimeout(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protos.ChaincodeSpec.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protos.ChaincodeSpec.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protos.ChaincodeSpec} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.ChaincodeSpec.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getType(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getChaincodeId(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.protos.ChaincodeID.serializeBinaryToWriter + ); + } + f = message.getInput(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.protos.ChaincodeInput.serializeBinaryToWriter + ); + } + f = message.getTimeout(); + if (f !== 0) { + writer.writeInt32( + 4, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.protos.ChaincodeSpec.Type = { + UNDEFINED: 0, + GOLANG: 1, + NODE: 2, + CAR: 3, + JAVA: 4 +}; + +/** + * optional Type type = 1; + * @return {!proto.protos.ChaincodeSpec.Type} + */ +proto.protos.ChaincodeSpec.prototype.getType = function() { + return /** @type {!proto.protos.ChaincodeSpec.Type} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.protos.ChaincodeSpec.Type} value + * @return {!proto.protos.ChaincodeSpec} returns this + */ +proto.protos.ChaincodeSpec.prototype.setType = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional ChaincodeID chaincode_id = 2; + * @return {?proto.protos.ChaincodeID} + */ +proto.protos.ChaincodeSpec.prototype.getChaincodeId = function() { + return /** @type{?proto.protos.ChaincodeID} */ ( + jspb.Message.getWrapperField(this, proto.protos.ChaincodeID, 2)); +}; + + +/** + * @param {?proto.protos.ChaincodeID|undefined} value + * @return {!proto.protos.ChaincodeSpec} returns this +*/ +proto.protos.ChaincodeSpec.prototype.setChaincodeId = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.protos.ChaincodeSpec} returns this + */ +proto.protos.ChaincodeSpec.prototype.clearChaincodeId = function() { + return this.setChaincodeId(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.protos.ChaincodeSpec.prototype.hasChaincodeId = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional ChaincodeInput input = 3; + * @return {?proto.protos.ChaincodeInput} + */ +proto.protos.ChaincodeSpec.prototype.getInput = function() { + return /** @type{?proto.protos.ChaincodeInput} */ ( + jspb.Message.getWrapperField(this, proto.protos.ChaincodeInput, 3)); +}; + + +/** + * @param {?proto.protos.ChaincodeInput|undefined} value + * @return {!proto.protos.ChaincodeSpec} returns this +*/ +proto.protos.ChaincodeSpec.prototype.setInput = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.protos.ChaincodeSpec} returns this + */ +proto.protos.ChaincodeSpec.prototype.clearInput = function() { + return this.setInput(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.protos.ChaincodeSpec.prototype.hasInput = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional int32 timeout = 4; + * @return {number} + */ +proto.protos.ChaincodeSpec.prototype.getTimeout = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.protos.ChaincodeSpec} returns this + */ +proto.protos.ChaincodeSpec.prototype.setTimeout = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.protos.ChaincodeDeploymentSpec.prototype.toObject = function(opt_includeInstance) { + return proto.protos.ChaincodeDeploymentSpec.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protos.ChaincodeDeploymentSpec} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.ChaincodeDeploymentSpec.toObject = function(includeInstance, msg) { + var f, obj = { + chaincodeSpec: (f = msg.getChaincodeSpec()) && proto.protos.ChaincodeSpec.toObject(includeInstance, f), + codePackage: msg.getCodePackage_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protos.ChaincodeDeploymentSpec} + */ +proto.protos.ChaincodeDeploymentSpec.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protos.ChaincodeDeploymentSpec; + return proto.protos.ChaincodeDeploymentSpec.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protos.ChaincodeDeploymentSpec} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protos.ChaincodeDeploymentSpec} + */ +proto.protos.ChaincodeDeploymentSpec.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protos.ChaincodeSpec; + reader.readMessage(value,proto.protos.ChaincodeSpec.deserializeBinaryFromReader); + msg.setChaincodeSpec(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setCodePackage(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protos.ChaincodeDeploymentSpec.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protos.ChaincodeDeploymentSpec.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protos.ChaincodeDeploymentSpec} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.ChaincodeDeploymentSpec.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getChaincodeSpec(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.protos.ChaincodeSpec.serializeBinaryToWriter + ); + } + f = message.getCodePackage_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } +}; + + +/** + * optional ChaincodeSpec chaincode_spec = 1; + * @return {?proto.protos.ChaincodeSpec} + */ +proto.protos.ChaincodeDeploymentSpec.prototype.getChaincodeSpec = function() { + return /** @type{?proto.protos.ChaincodeSpec} */ ( + jspb.Message.getWrapperField(this, proto.protos.ChaincodeSpec, 1)); +}; + + +/** + * @param {?proto.protos.ChaincodeSpec|undefined} value + * @return {!proto.protos.ChaincodeDeploymentSpec} returns this +*/ +proto.protos.ChaincodeDeploymentSpec.prototype.setChaincodeSpec = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.protos.ChaincodeDeploymentSpec} returns this + */ +proto.protos.ChaincodeDeploymentSpec.prototype.clearChaincodeSpec = function() { + return this.setChaincodeSpec(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.protos.ChaincodeDeploymentSpec.prototype.hasChaincodeSpec = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional bytes code_package = 3; + * @return {!(string|Uint8Array)} + */ +proto.protos.ChaincodeDeploymentSpec.prototype.getCodePackage = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes code_package = 3; + * This is a type-conversion wrapper around `getCodePackage()` + * @return {string} + */ +proto.protos.ChaincodeDeploymentSpec.prototype.getCodePackage_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getCodePackage())); +}; + + +/** + * optional bytes code_package = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getCodePackage()` + * @return {!Uint8Array} + */ +proto.protos.ChaincodeDeploymentSpec.prototype.getCodePackage_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getCodePackage())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.protos.ChaincodeDeploymentSpec} returns this + */ +proto.protos.ChaincodeDeploymentSpec.prototype.setCodePackage = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.protos.ChaincodeInvocationSpec.prototype.toObject = function(opt_includeInstance) { + return proto.protos.ChaincodeInvocationSpec.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protos.ChaincodeInvocationSpec} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.ChaincodeInvocationSpec.toObject = function(includeInstance, msg) { + var f, obj = { + chaincodeSpec: (f = msg.getChaincodeSpec()) && proto.protos.ChaincodeSpec.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protos.ChaincodeInvocationSpec} + */ +proto.protos.ChaincodeInvocationSpec.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protos.ChaincodeInvocationSpec; + return proto.protos.ChaincodeInvocationSpec.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protos.ChaincodeInvocationSpec} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protos.ChaincodeInvocationSpec} + */ +proto.protos.ChaincodeInvocationSpec.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protos.ChaincodeSpec; + reader.readMessage(value,proto.protos.ChaincodeSpec.deserializeBinaryFromReader); + msg.setChaincodeSpec(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protos.ChaincodeInvocationSpec.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protos.ChaincodeInvocationSpec.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protos.ChaincodeInvocationSpec} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.ChaincodeInvocationSpec.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getChaincodeSpec(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.protos.ChaincodeSpec.serializeBinaryToWriter + ); + } +}; + + +/** + * optional ChaincodeSpec chaincode_spec = 1; + * @return {?proto.protos.ChaincodeSpec} + */ +proto.protos.ChaincodeInvocationSpec.prototype.getChaincodeSpec = function() { + return /** @type{?proto.protos.ChaincodeSpec} */ ( + jspb.Message.getWrapperField(this, proto.protos.ChaincodeSpec, 1)); +}; + + +/** + * @param {?proto.protos.ChaincodeSpec|undefined} value + * @return {!proto.protos.ChaincodeInvocationSpec} returns this +*/ +proto.protos.ChaincodeInvocationSpec.prototype.setChaincodeSpec = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.protos.ChaincodeInvocationSpec} returns this + */ +proto.protos.ChaincodeInvocationSpec.prototype.clearChaincodeSpec = function() { + return this.setChaincodeSpec(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.protos.ChaincodeInvocationSpec.prototype.hasChaincodeSpec = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.protos.LifecycleEvent.prototype.toObject = function(opt_includeInstance) { + return proto.protos.LifecycleEvent.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protos.LifecycleEvent} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.LifecycleEvent.toObject = function(includeInstance, msg) { + var f, obj = { + chaincodeName: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protos.LifecycleEvent} + */ +proto.protos.LifecycleEvent.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protos.LifecycleEvent; + return proto.protos.LifecycleEvent.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protos.LifecycleEvent} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protos.LifecycleEvent} + */ +proto.protos.LifecycleEvent.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setChaincodeName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protos.LifecycleEvent.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protos.LifecycleEvent.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protos.LifecycleEvent} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.LifecycleEvent.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getChaincodeName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string chaincode_name = 1; + * @return {string} + */ +proto.protos.LifecycleEvent.prototype.getChaincodeName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.protos.LifecycleEvent} returns this + */ +proto.protos.LifecycleEvent.prototype.setChaincodeName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.protos.CDSData.prototype.toObject = function(opt_includeInstance) { + return proto.protos.CDSData.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protos.CDSData} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.CDSData.toObject = function(includeInstance, msg) { + var f, obj = { + hash: msg.getHash_asB64(), + metadatahash: msg.getMetadatahash_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protos.CDSData} + */ +proto.protos.CDSData.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protos.CDSData; + return proto.protos.CDSData.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protos.CDSData} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protos.CDSData} + */ +proto.protos.CDSData.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setHash(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setMetadatahash(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protos.CDSData.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protos.CDSData.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protos.CDSData} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.CDSData.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getHash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getMetadatahash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional bytes hash = 1; + * @return {!(string|Uint8Array)} + */ +proto.protos.CDSData.prototype.getHash = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes hash = 1; + * This is a type-conversion wrapper around `getHash()` + * @return {string} + */ +proto.protos.CDSData.prototype.getHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getHash())); +}; + + +/** + * optional bytes hash = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getHash()` + * @return {!Uint8Array} + */ +proto.protos.CDSData.prototype.getHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getHash())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.protos.CDSData} returns this + */ +proto.protos.CDSData.prototype.setHash = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes metadatahash = 2; + * @return {!(string|Uint8Array)} + */ +proto.protos.CDSData.prototype.getMetadatahash = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes metadatahash = 2; + * This is a type-conversion wrapper around `getMetadatahash()` + * @return {string} + */ +proto.protos.CDSData.prototype.getMetadatahash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getMetadatahash())); +}; + + +/** + * optional bytes metadatahash = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getMetadatahash()` + * @return {!Uint8Array} + */ +proto.protos.CDSData.prototype.getMetadatahash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getMetadatahash())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.protos.CDSData} returns this + */ +proto.protos.CDSData.prototype.setMetadatahash = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.protos.ChaincodeData.prototype.toObject = function(opt_includeInstance) { + return proto.protos.ChaincodeData.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protos.ChaincodeData} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.ChaincodeData.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + version: jspb.Message.getFieldWithDefault(msg, 2, ""), + escc: jspb.Message.getFieldWithDefault(msg, 3, ""), + vscc: jspb.Message.getFieldWithDefault(msg, 4, ""), + policy: (f = msg.getPolicy()) && common_policies_pb.SignaturePolicyEnvelope.toObject(includeInstance, f), + data: msg.getData_asB64(), + id: msg.getId_asB64(), + instantiationPolicy: (f = msg.getInstantiationPolicy()) && common_policies_pb.SignaturePolicyEnvelope.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protos.ChaincodeData} + */ +proto.protos.ChaincodeData.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protos.ChaincodeData; + return proto.protos.ChaincodeData.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protos.ChaincodeData} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protos.ChaincodeData} + */ +proto.protos.ChaincodeData.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setVersion(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setEscc(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setVscc(value); + break; + case 5: + var value = new common_policies_pb.SignaturePolicyEnvelope; + reader.readMessage(value,common_policies_pb.SignaturePolicyEnvelope.deserializeBinaryFromReader); + msg.setPolicy(value); + break; + case 6: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setData(value); + break; + case 7: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setId(value); + break; + case 8: + var value = new common_policies_pb.SignaturePolicyEnvelope; + reader.readMessage(value,common_policies_pb.SignaturePolicyEnvelope.deserializeBinaryFromReader); + msg.setInstantiationPolicy(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protos.ChaincodeData.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protos.ChaincodeData.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protos.ChaincodeData} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.ChaincodeData.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getVersion(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getEscc(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getVscc(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getPolicy(); + if (f != null) { + writer.writeMessage( + 5, + f, + common_policies_pb.SignaturePolicyEnvelope.serializeBinaryToWriter + ); + } + f = message.getData_asU8(); + if (f.length > 0) { + writer.writeBytes( + 6, + f + ); + } + f = message.getId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 7, + f + ); + } + f = message.getInstantiationPolicy(); + if (f != null) { + writer.writeMessage( + 8, + f, + common_policies_pb.SignaturePolicyEnvelope.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.protos.ChaincodeData.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.protos.ChaincodeData} returns this + */ +proto.protos.ChaincodeData.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string version = 2; + * @return {string} + */ +proto.protos.ChaincodeData.prototype.getVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.protos.ChaincodeData} returns this + */ +proto.protos.ChaincodeData.prototype.setVersion = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string escc = 3; + * @return {string} + */ +proto.protos.ChaincodeData.prototype.getEscc = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.protos.ChaincodeData} returns this + */ +proto.protos.ChaincodeData.prototype.setEscc = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string vscc = 4; + * @return {string} + */ +proto.protos.ChaincodeData.prototype.getVscc = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.protos.ChaincodeData} returns this + */ +proto.protos.ChaincodeData.prototype.setVscc = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional common.SignaturePolicyEnvelope policy = 5; + * @return {?proto.common.SignaturePolicyEnvelope} + */ +proto.protos.ChaincodeData.prototype.getPolicy = function() { + return /** @type{?proto.common.SignaturePolicyEnvelope} */ ( + jspb.Message.getWrapperField(this, common_policies_pb.SignaturePolicyEnvelope, 5)); +}; + + +/** + * @param {?proto.common.SignaturePolicyEnvelope|undefined} value + * @return {!proto.protos.ChaincodeData} returns this +*/ +proto.protos.ChaincodeData.prototype.setPolicy = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.protos.ChaincodeData} returns this + */ +proto.protos.ChaincodeData.prototype.clearPolicy = function() { + return this.setPolicy(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.protos.ChaincodeData.prototype.hasPolicy = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional bytes data = 6; + * @return {!(string|Uint8Array)} + */ +proto.protos.ChaincodeData.prototype.getData = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * optional bytes data = 6; + * This is a type-conversion wrapper around `getData()` + * @return {string} + */ +proto.protos.ChaincodeData.prototype.getData_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getData())); +}; + + +/** + * optional bytes data = 6; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getData()` + * @return {!Uint8Array} + */ +proto.protos.ChaincodeData.prototype.getData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getData())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.protos.ChaincodeData} returns this + */ +proto.protos.ChaincodeData.prototype.setData = function(value) { + return jspb.Message.setProto3BytesField(this, 6, value); +}; + + +/** + * optional bytes id = 7; + * @return {!(string|Uint8Array)} + */ +proto.protos.ChaincodeData.prototype.getId = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * optional bytes id = 7; + * This is a type-conversion wrapper around `getId()` + * @return {string} + */ +proto.protos.ChaincodeData.prototype.getId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getId())); +}; + + +/** + * optional bytes id = 7; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getId()` + * @return {!Uint8Array} + */ +proto.protos.ChaincodeData.prototype.getId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getId())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.protos.ChaincodeData} returns this + */ +proto.protos.ChaincodeData.prototype.setId = function(value) { + return jspb.Message.setProto3BytesField(this, 7, value); +}; + + +/** + * optional common.SignaturePolicyEnvelope instantiation_policy = 8; + * @return {?proto.common.SignaturePolicyEnvelope} + */ +proto.protos.ChaincodeData.prototype.getInstantiationPolicy = function() { + return /** @type{?proto.common.SignaturePolicyEnvelope} */ ( + jspb.Message.getWrapperField(this, common_policies_pb.SignaturePolicyEnvelope, 8)); +}; + + +/** + * @param {?proto.common.SignaturePolicyEnvelope|undefined} value + * @return {!proto.protos.ChaincodeData} returns this +*/ +proto.protos.ChaincodeData.prototype.setInstantiationPolicy = function(value) { + return jspb.Message.setWrapperField(this, 8, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.protos.ChaincodeData} returns this + */ +proto.protos.ChaincodeData.prototype.clearInstantiationPolicy = function() { + return this.setInstantiationPolicy(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.protos.ChaincodeData.prototype.hasInstantiationPolicy = function() { + return jspb.Message.getField(this, 8) != null; +}; + + +goog.object.extend(exports, proto.protos); diff --git a/weaver/common/protos-js/peer/proposal_pb.d.ts b/weaver/common/protos-js/peer/proposal_pb.d.ts new file mode 100644 index 00000000000..798ae1082ab --- /dev/null +++ b/weaver/common/protos-js/peer/proposal_pb.d.ts @@ -0,0 +1,157 @@ +// package: protos +// file: peer/proposal.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; +import * as peer_chaincode_pb from "../peer/chaincode_pb"; +import * as peer_proposal_response_pb from "../peer/proposal_response_pb"; + +export class SignedProposal extends jspb.Message { + getProposalBytes(): Uint8Array | string; + getProposalBytes_asU8(): Uint8Array; + getProposalBytes_asB64(): string; + setProposalBytes(value: Uint8Array | string): SignedProposal; + getSignature(): Uint8Array | string; + getSignature_asU8(): Uint8Array; + getSignature_asB64(): string; + setSignature(value: Uint8Array | string): SignedProposal; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SignedProposal.AsObject; + static toObject(includeInstance: boolean, msg: SignedProposal): SignedProposal.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SignedProposal, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SignedProposal; + static deserializeBinaryFromReader(message: SignedProposal, reader: jspb.BinaryReader): SignedProposal; +} + +export namespace SignedProposal { + export type AsObject = { + proposalBytes: Uint8Array | string, + signature: Uint8Array | string, + } +} + +export class Proposal extends jspb.Message { + getHeader(): Uint8Array | string; + getHeader_asU8(): Uint8Array; + getHeader_asB64(): string; + setHeader(value: Uint8Array | string): Proposal; + getPayload(): Uint8Array | string; + getPayload_asU8(): Uint8Array; + getPayload_asB64(): string; + setPayload(value: Uint8Array | string): Proposal; + getExtension$(): Uint8Array | string; + getExtension_asU8(): Uint8Array; + getExtension_asB64(): string; + setExtension$(value: Uint8Array | string): Proposal; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Proposal.AsObject; + static toObject(includeInstance: boolean, msg: Proposal): Proposal.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Proposal, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Proposal; + static deserializeBinaryFromReader(message: Proposal, reader: jspb.BinaryReader): Proposal; +} + +export namespace Proposal { + export type AsObject = { + header: Uint8Array | string, + payload: Uint8Array | string, + extension: Uint8Array | string, + } +} + +export class ChaincodeHeaderExtension extends jspb.Message { + + hasChaincodeId(): boolean; + clearChaincodeId(): void; + getChaincodeId(): peer_chaincode_pb.ChaincodeID | undefined; + setChaincodeId(value?: peer_chaincode_pb.ChaincodeID): ChaincodeHeaderExtension; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ChaincodeHeaderExtension.AsObject; + static toObject(includeInstance: boolean, msg: ChaincodeHeaderExtension): ChaincodeHeaderExtension.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ChaincodeHeaderExtension, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ChaincodeHeaderExtension; + static deserializeBinaryFromReader(message: ChaincodeHeaderExtension, reader: jspb.BinaryReader): ChaincodeHeaderExtension; +} + +export namespace ChaincodeHeaderExtension { + export type AsObject = { + chaincodeId?: peer_chaincode_pb.ChaincodeID.AsObject, + } +} + +export class ChaincodeProposalPayload extends jspb.Message { + getInput(): Uint8Array | string; + getInput_asU8(): Uint8Array; + getInput_asB64(): string; + setInput(value: Uint8Array | string): ChaincodeProposalPayload; + + getTransientmapMap(): jspb.Map; + clearTransientmapMap(): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ChaincodeProposalPayload.AsObject; + static toObject(includeInstance: boolean, msg: ChaincodeProposalPayload): ChaincodeProposalPayload.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ChaincodeProposalPayload, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ChaincodeProposalPayload; + static deserializeBinaryFromReader(message: ChaincodeProposalPayload, reader: jspb.BinaryReader): ChaincodeProposalPayload; +} + +export namespace ChaincodeProposalPayload { + export type AsObject = { + input: Uint8Array | string, + + transientmapMap: Array<[string, Uint8Array | string]>, + } +} + +export class ChaincodeAction extends jspb.Message { + getResults(): Uint8Array | string; + getResults_asU8(): Uint8Array; + getResults_asB64(): string; + setResults(value: Uint8Array | string): ChaincodeAction; + getEvents(): Uint8Array | string; + getEvents_asU8(): Uint8Array; + getEvents_asB64(): string; + setEvents(value: Uint8Array | string): ChaincodeAction; + + hasResponse(): boolean; + clearResponse(): void; + getResponse(): peer_proposal_response_pb.Response | undefined; + setResponse(value?: peer_proposal_response_pb.Response): ChaincodeAction; + + hasChaincodeId(): boolean; + clearChaincodeId(): void; + getChaincodeId(): peer_chaincode_pb.ChaincodeID | undefined; + setChaincodeId(value?: peer_chaincode_pb.ChaincodeID): ChaincodeAction; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ChaincodeAction.AsObject; + static toObject(includeInstance: boolean, msg: ChaincodeAction): ChaincodeAction.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ChaincodeAction, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ChaincodeAction; + static deserializeBinaryFromReader(message: ChaincodeAction, reader: jspb.BinaryReader): ChaincodeAction; +} + +export namespace ChaincodeAction { + export type AsObject = { + results: Uint8Array | string, + events: Uint8Array | string, + response?: peer_proposal_response_pb.Response.AsObject, + chaincodeId?: peer_chaincode_pb.ChaincodeID.AsObject, + } +} diff --git a/weaver/common/protos-js/peer/proposal_pb.js b/weaver/common/protos-js/peer/proposal_pb.js new file mode 100644 index 00000000000..fc969c8d3cc --- /dev/null +++ b/weaver/common/protos-js/peer/proposal_pb.js @@ -0,0 +1,1256 @@ +// source: peer/proposal.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +var peer_chaincode_pb = require('../peer/chaincode_pb.js'); +goog.object.extend(proto, peer_chaincode_pb); +var peer_proposal_response_pb = require('../peer/proposal_response_pb.js'); +goog.object.extend(proto, peer_proposal_response_pb); +goog.exportSymbol('proto.protos.ChaincodeAction', null, global); +goog.exportSymbol('proto.protos.ChaincodeHeaderExtension', null, global); +goog.exportSymbol('proto.protos.ChaincodeProposalPayload', null, global); +goog.exportSymbol('proto.protos.Proposal', null, global); +goog.exportSymbol('proto.protos.SignedProposal', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protos.SignedProposal = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protos.SignedProposal, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.protos.SignedProposal.displayName = 'proto.protos.SignedProposal'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protos.Proposal = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protos.Proposal, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.protos.Proposal.displayName = 'proto.protos.Proposal'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protos.ChaincodeHeaderExtension = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protos.ChaincodeHeaderExtension, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.protos.ChaincodeHeaderExtension.displayName = 'proto.protos.ChaincodeHeaderExtension'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protos.ChaincodeProposalPayload = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protos.ChaincodeProposalPayload, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.protos.ChaincodeProposalPayload.displayName = 'proto.protos.ChaincodeProposalPayload'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protos.ChaincodeAction = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protos.ChaincodeAction, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.protos.ChaincodeAction.displayName = 'proto.protos.ChaincodeAction'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.protos.SignedProposal.prototype.toObject = function(opt_includeInstance) { + return proto.protos.SignedProposal.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protos.SignedProposal} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.SignedProposal.toObject = function(includeInstance, msg) { + var f, obj = { + proposalBytes: msg.getProposalBytes_asB64(), + signature: msg.getSignature_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protos.SignedProposal} + */ +proto.protos.SignedProposal.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protos.SignedProposal; + return proto.protos.SignedProposal.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protos.SignedProposal} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protos.SignedProposal} + */ +proto.protos.SignedProposal.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setProposalBytes(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setSignature(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protos.SignedProposal.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protos.SignedProposal.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protos.SignedProposal} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.SignedProposal.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProposalBytes_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getSignature_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional bytes proposal_bytes = 1; + * @return {!(string|Uint8Array)} + */ +proto.protos.SignedProposal.prototype.getProposalBytes = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes proposal_bytes = 1; + * This is a type-conversion wrapper around `getProposalBytes()` + * @return {string} + */ +proto.protos.SignedProposal.prototype.getProposalBytes_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getProposalBytes())); +}; + + +/** + * optional bytes proposal_bytes = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getProposalBytes()` + * @return {!Uint8Array} + */ +proto.protos.SignedProposal.prototype.getProposalBytes_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getProposalBytes())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.protos.SignedProposal} returns this + */ +proto.protos.SignedProposal.prototype.setProposalBytes = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes signature = 2; + * @return {!(string|Uint8Array)} + */ +proto.protos.SignedProposal.prototype.getSignature = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes signature = 2; + * This is a type-conversion wrapper around `getSignature()` + * @return {string} + */ +proto.protos.SignedProposal.prototype.getSignature_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getSignature())); +}; + + +/** + * optional bytes signature = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getSignature()` + * @return {!Uint8Array} + */ +proto.protos.SignedProposal.prototype.getSignature_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getSignature())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.protos.SignedProposal} returns this + */ +proto.protos.SignedProposal.prototype.setSignature = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.protos.Proposal.prototype.toObject = function(opt_includeInstance) { + return proto.protos.Proposal.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protos.Proposal} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.Proposal.toObject = function(includeInstance, msg) { + var f, obj = { + header: msg.getHeader_asB64(), + payload: msg.getPayload_asB64(), + extension: msg.getExtension_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protos.Proposal} + */ +proto.protos.Proposal.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protos.Proposal; + return proto.protos.Proposal.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protos.Proposal} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protos.Proposal} + */ +proto.protos.Proposal.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setHeader(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setPayload(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setExtension$(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protos.Proposal.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protos.Proposal.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protos.Proposal} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.Proposal.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getHeader_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getPayload_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getExtension_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } +}; + + +/** + * optional bytes header = 1; + * @return {!(string|Uint8Array)} + */ +proto.protos.Proposal.prototype.getHeader = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes header = 1; + * This is a type-conversion wrapper around `getHeader()` + * @return {string} + */ +proto.protos.Proposal.prototype.getHeader_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getHeader())); +}; + + +/** + * optional bytes header = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getHeader()` + * @return {!Uint8Array} + */ +proto.protos.Proposal.prototype.getHeader_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getHeader())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.protos.Proposal} returns this + */ +proto.protos.Proposal.prototype.setHeader = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes payload = 2; + * @return {!(string|Uint8Array)} + */ +proto.protos.Proposal.prototype.getPayload = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes payload = 2; + * This is a type-conversion wrapper around `getPayload()` + * @return {string} + */ +proto.protos.Proposal.prototype.getPayload_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPayload())); +}; + + +/** + * optional bytes payload = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPayload()` + * @return {!Uint8Array} + */ +proto.protos.Proposal.prototype.getPayload_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPayload())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.protos.Proposal} returns this + */ +proto.protos.Proposal.prototype.setPayload = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * optional bytes extension = 3; + * @return {!(string|Uint8Array)} + */ +proto.protos.Proposal.prototype.getExtension$ = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes extension = 3; + * This is a type-conversion wrapper around `getExtension$()` + * @return {string} + */ +proto.protos.Proposal.prototype.getExtension_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getExtension$())); +}; + + +/** + * optional bytes extension = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getExtension$()` + * @return {!Uint8Array} + */ +proto.protos.Proposal.prototype.getExtension_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getExtension$())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.protos.Proposal} returns this + */ +proto.protos.Proposal.prototype.setExtension$ = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.protos.ChaincodeHeaderExtension.prototype.toObject = function(opt_includeInstance) { + return proto.protos.ChaincodeHeaderExtension.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protos.ChaincodeHeaderExtension} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.ChaincodeHeaderExtension.toObject = function(includeInstance, msg) { + var f, obj = { + chaincodeId: (f = msg.getChaincodeId()) && peer_chaincode_pb.ChaincodeID.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protos.ChaincodeHeaderExtension} + */ +proto.protos.ChaincodeHeaderExtension.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protos.ChaincodeHeaderExtension; + return proto.protos.ChaincodeHeaderExtension.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protos.ChaincodeHeaderExtension} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protos.ChaincodeHeaderExtension} + */ +proto.protos.ChaincodeHeaderExtension.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 2: + var value = new peer_chaincode_pb.ChaincodeID; + reader.readMessage(value,peer_chaincode_pb.ChaincodeID.deserializeBinaryFromReader); + msg.setChaincodeId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protos.ChaincodeHeaderExtension.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protos.ChaincodeHeaderExtension.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protos.ChaincodeHeaderExtension} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.ChaincodeHeaderExtension.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getChaincodeId(); + if (f != null) { + writer.writeMessage( + 2, + f, + peer_chaincode_pb.ChaincodeID.serializeBinaryToWriter + ); + } +}; + + +/** + * optional ChaincodeID chaincode_id = 2; + * @return {?proto.protos.ChaincodeID} + */ +proto.protos.ChaincodeHeaderExtension.prototype.getChaincodeId = function() { + return /** @type{?proto.protos.ChaincodeID} */ ( + jspb.Message.getWrapperField(this, peer_chaincode_pb.ChaincodeID, 2)); +}; + + +/** + * @param {?proto.protos.ChaincodeID|undefined} value + * @return {!proto.protos.ChaincodeHeaderExtension} returns this +*/ +proto.protos.ChaincodeHeaderExtension.prototype.setChaincodeId = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.protos.ChaincodeHeaderExtension} returns this + */ +proto.protos.ChaincodeHeaderExtension.prototype.clearChaincodeId = function() { + return this.setChaincodeId(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.protos.ChaincodeHeaderExtension.prototype.hasChaincodeId = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.protos.ChaincodeProposalPayload.prototype.toObject = function(opt_includeInstance) { + return proto.protos.ChaincodeProposalPayload.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protos.ChaincodeProposalPayload} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.ChaincodeProposalPayload.toObject = function(includeInstance, msg) { + var f, obj = { + input: msg.getInput_asB64(), + transientmapMap: (f = msg.getTransientmapMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protos.ChaincodeProposalPayload} + */ +proto.protos.ChaincodeProposalPayload.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protos.ChaincodeProposalPayload; + return proto.protos.ChaincodeProposalPayload.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protos.ChaincodeProposalPayload} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protos.ChaincodeProposalPayload} + */ +proto.protos.ChaincodeProposalPayload.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setInput(value); + break; + case 2: + var value = msg.getTransientmapMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readBytes, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protos.ChaincodeProposalPayload.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protos.ChaincodeProposalPayload.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protos.ChaincodeProposalPayload} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.ChaincodeProposalPayload.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getInput_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getTransientmapMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeBytes); + } +}; + + +/** + * optional bytes input = 1; + * @return {!(string|Uint8Array)} + */ +proto.protos.ChaincodeProposalPayload.prototype.getInput = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes input = 1; + * This is a type-conversion wrapper around `getInput()` + * @return {string} + */ +proto.protos.ChaincodeProposalPayload.prototype.getInput_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getInput())); +}; + + +/** + * optional bytes input = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getInput()` + * @return {!Uint8Array} + */ +proto.protos.ChaincodeProposalPayload.prototype.getInput_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getInput())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.protos.ChaincodeProposalPayload} returns this + */ +proto.protos.ChaincodeProposalPayload.prototype.setInput = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * map TransientMap = 2; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.protos.ChaincodeProposalPayload.prototype.getTransientmapMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 2, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.protos.ChaincodeProposalPayload} returns this + */ +proto.protos.ChaincodeProposalPayload.prototype.clearTransientmapMap = function() { + this.getTransientmapMap().clear(); + return this;}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.protos.ChaincodeAction.prototype.toObject = function(opt_includeInstance) { + return proto.protos.ChaincodeAction.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protos.ChaincodeAction} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.ChaincodeAction.toObject = function(includeInstance, msg) { + var f, obj = { + results: msg.getResults_asB64(), + events: msg.getEvents_asB64(), + response: (f = msg.getResponse()) && peer_proposal_response_pb.Response.toObject(includeInstance, f), + chaincodeId: (f = msg.getChaincodeId()) && peer_chaincode_pb.ChaincodeID.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protos.ChaincodeAction} + */ +proto.protos.ChaincodeAction.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protos.ChaincodeAction; + return proto.protos.ChaincodeAction.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protos.ChaincodeAction} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protos.ChaincodeAction} + */ +proto.protos.ChaincodeAction.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setResults(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setEvents(value); + break; + case 3: + var value = new peer_proposal_response_pb.Response; + reader.readMessage(value,peer_proposal_response_pb.Response.deserializeBinaryFromReader); + msg.setResponse(value); + break; + case 4: + var value = new peer_chaincode_pb.ChaincodeID; + reader.readMessage(value,peer_chaincode_pb.ChaincodeID.deserializeBinaryFromReader); + msg.setChaincodeId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protos.ChaincodeAction.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protos.ChaincodeAction.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protos.ChaincodeAction} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.ChaincodeAction.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getResults_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getEvents_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getResponse(); + if (f != null) { + writer.writeMessage( + 3, + f, + peer_proposal_response_pb.Response.serializeBinaryToWriter + ); + } + f = message.getChaincodeId(); + if (f != null) { + writer.writeMessage( + 4, + f, + peer_chaincode_pb.ChaincodeID.serializeBinaryToWriter + ); + } +}; + + +/** + * optional bytes results = 1; + * @return {!(string|Uint8Array)} + */ +proto.protos.ChaincodeAction.prototype.getResults = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes results = 1; + * This is a type-conversion wrapper around `getResults()` + * @return {string} + */ +proto.protos.ChaincodeAction.prototype.getResults_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getResults())); +}; + + +/** + * optional bytes results = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getResults()` + * @return {!Uint8Array} + */ +proto.protos.ChaincodeAction.prototype.getResults_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getResults())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.protos.ChaincodeAction} returns this + */ +proto.protos.ChaincodeAction.prototype.setResults = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes events = 2; + * @return {!(string|Uint8Array)} + */ +proto.protos.ChaincodeAction.prototype.getEvents = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes events = 2; + * This is a type-conversion wrapper around `getEvents()` + * @return {string} + */ +proto.protos.ChaincodeAction.prototype.getEvents_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getEvents())); +}; + + +/** + * optional bytes events = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getEvents()` + * @return {!Uint8Array} + */ +proto.protos.ChaincodeAction.prototype.getEvents_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getEvents())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.protos.ChaincodeAction} returns this + */ +proto.protos.ChaincodeAction.prototype.setEvents = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * optional Response response = 3; + * @return {?proto.protos.Response} + */ +proto.protos.ChaincodeAction.prototype.getResponse = function() { + return /** @type{?proto.protos.Response} */ ( + jspb.Message.getWrapperField(this, peer_proposal_response_pb.Response, 3)); +}; + + +/** + * @param {?proto.protos.Response|undefined} value + * @return {!proto.protos.ChaincodeAction} returns this +*/ +proto.protos.ChaincodeAction.prototype.setResponse = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.protos.ChaincodeAction} returns this + */ +proto.protos.ChaincodeAction.prototype.clearResponse = function() { + return this.setResponse(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.protos.ChaincodeAction.prototype.hasResponse = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional ChaincodeID chaincode_id = 4; + * @return {?proto.protos.ChaincodeID} + */ +proto.protos.ChaincodeAction.prototype.getChaincodeId = function() { + return /** @type{?proto.protos.ChaincodeID} */ ( + jspb.Message.getWrapperField(this, peer_chaincode_pb.ChaincodeID, 4)); +}; + + +/** + * @param {?proto.protos.ChaincodeID|undefined} value + * @return {!proto.protos.ChaincodeAction} returns this +*/ +proto.protos.ChaincodeAction.prototype.setChaincodeId = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.protos.ChaincodeAction} returns this + */ +proto.protos.ChaincodeAction.prototype.clearChaincodeId = function() { + return this.setChaincodeId(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.protos.ChaincodeAction.prototype.hasChaincodeId = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +goog.object.extend(exports, proto.protos); diff --git a/weaver/common/protos-js/peer/proposal_response_pb.d.ts b/weaver/common/protos-js/peer/proposal_response_pb.d.ts new file mode 100644 index 00000000000..f9b1e258f4b --- /dev/null +++ b/weaver/common/protos-js/peer/proposal_response_pb.d.ts @@ -0,0 +1,133 @@ +// package: protos +// file: peer/proposal_response.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; +import * as google_protobuf_timestamp_pb from "google-protobuf/google/protobuf/timestamp_pb"; + +export class ProposalResponse extends jspb.Message { + getVersion(): number; + setVersion(value: number): ProposalResponse; + + hasTimestamp(): boolean; + clearTimestamp(): void; + getTimestamp(): google_protobuf_timestamp_pb.Timestamp | undefined; + setTimestamp(value?: google_protobuf_timestamp_pb.Timestamp): ProposalResponse; + + hasResponse(): boolean; + clearResponse(): void; + getResponse(): Response | undefined; + setResponse(value?: Response): ProposalResponse; + getPayload(): Uint8Array | string; + getPayload_asU8(): Uint8Array; + getPayload_asB64(): string; + setPayload(value: Uint8Array | string): ProposalResponse; + + hasEndorsement(): boolean; + clearEndorsement(): void; + getEndorsement(): Endorsement | undefined; + setEndorsement(value?: Endorsement): ProposalResponse; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ProposalResponse.AsObject; + static toObject(includeInstance: boolean, msg: ProposalResponse): ProposalResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ProposalResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ProposalResponse; + static deserializeBinaryFromReader(message: ProposalResponse, reader: jspb.BinaryReader): ProposalResponse; +} + +export namespace ProposalResponse { + export type AsObject = { + version: number, + timestamp?: google_protobuf_timestamp_pb.Timestamp.AsObject, + response?: Response.AsObject, + payload: Uint8Array | string, + endorsement?: Endorsement.AsObject, + } +} + +export class Response extends jspb.Message { + getStatus(): number; + setStatus(value: number): Response; + getMessage(): string; + setMessage(value: string): Response; + getPayload(): Uint8Array | string; + getPayload_asU8(): Uint8Array; + getPayload_asB64(): string; + setPayload(value: Uint8Array | string): Response; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Response.AsObject; + static toObject(includeInstance: boolean, msg: Response): Response.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Response, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Response; + static deserializeBinaryFromReader(message: Response, reader: jspb.BinaryReader): Response; +} + +export namespace Response { + export type AsObject = { + status: number, + message: string, + payload: Uint8Array | string, + } +} + +export class ProposalResponsePayload extends jspb.Message { + getProposalHash(): Uint8Array | string; + getProposalHash_asU8(): Uint8Array; + getProposalHash_asB64(): string; + setProposalHash(value: Uint8Array | string): ProposalResponsePayload; + getExtension$(): Uint8Array | string; + getExtension_asU8(): Uint8Array; + getExtension_asB64(): string; + setExtension$(value: Uint8Array | string): ProposalResponsePayload; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ProposalResponsePayload.AsObject; + static toObject(includeInstance: boolean, msg: ProposalResponsePayload): ProposalResponsePayload.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ProposalResponsePayload, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ProposalResponsePayload; + static deserializeBinaryFromReader(message: ProposalResponsePayload, reader: jspb.BinaryReader): ProposalResponsePayload; +} + +export namespace ProposalResponsePayload { + export type AsObject = { + proposalHash: Uint8Array | string, + extension: Uint8Array | string, + } +} + +export class Endorsement extends jspb.Message { + getEndorser(): Uint8Array | string; + getEndorser_asU8(): Uint8Array; + getEndorser_asB64(): string; + setEndorser(value: Uint8Array | string): Endorsement; + getSignature(): Uint8Array | string; + getSignature_asU8(): Uint8Array; + getSignature_asB64(): string; + setSignature(value: Uint8Array | string): Endorsement; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Endorsement.AsObject; + static toObject(includeInstance: boolean, msg: Endorsement): Endorsement.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Endorsement, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Endorsement; + static deserializeBinaryFromReader(message: Endorsement, reader: jspb.BinaryReader): Endorsement; +} + +export namespace Endorsement { + export type AsObject = { + endorser: Uint8Array | string, + signature: Uint8Array | string, + } +} diff --git a/weaver/common/protos-js/peer/proposal_response_pb.js b/weaver/common/protos-js/peer/proposal_response_pb.js new file mode 100644 index 00000000000..ed5513bb02e --- /dev/null +++ b/weaver/common/protos-js/peer/proposal_response_pb.js @@ -0,0 +1,1081 @@ +// source: peer/proposal_response.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js'); +goog.object.extend(proto, google_protobuf_timestamp_pb); +goog.exportSymbol('proto.protos.Endorsement', null, global); +goog.exportSymbol('proto.protos.ProposalResponse', null, global); +goog.exportSymbol('proto.protos.ProposalResponsePayload', null, global); +goog.exportSymbol('proto.protos.Response', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protos.ProposalResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protos.ProposalResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.protos.ProposalResponse.displayName = 'proto.protos.ProposalResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protos.Response = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protos.Response, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.protos.Response.displayName = 'proto.protos.Response'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protos.ProposalResponsePayload = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protos.ProposalResponsePayload, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.protos.ProposalResponsePayload.displayName = 'proto.protos.ProposalResponsePayload'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protos.Endorsement = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protos.Endorsement, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.protos.Endorsement.displayName = 'proto.protos.Endorsement'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.protos.ProposalResponse.prototype.toObject = function(opt_includeInstance) { + return proto.protos.ProposalResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protos.ProposalResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.ProposalResponse.toObject = function(includeInstance, msg) { + var f, obj = { + version: jspb.Message.getFieldWithDefault(msg, 1, 0), + timestamp: (f = msg.getTimestamp()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), + response: (f = msg.getResponse()) && proto.protos.Response.toObject(includeInstance, f), + payload: msg.getPayload_asB64(), + endorsement: (f = msg.getEndorsement()) && proto.protos.Endorsement.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protos.ProposalResponse} + */ +proto.protos.ProposalResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protos.ProposalResponse; + return proto.protos.ProposalResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protos.ProposalResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protos.ProposalResponse} + */ +proto.protos.ProposalResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setVersion(value); + break; + case 2: + var value = new google_protobuf_timestamp_pb.Timestamp; + reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); + msg.setTimestamp(value); + break; + case 4: + var value = new proto.protos.Response; + reader.readMessage(value,proto.protos.Response.deserializeBinaryFromReader); + msg.setResponse(value); + break; + case 5: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setPayload(value); + break; + case 6: + var value = new proto.protos.Endorsement; + reader.readMessage(value,proto.protos.Endorsement.deserializeBinaryFromReader); + msg.setEndorsement(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protos.ProposalResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protos.ProposalResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protos.ProposalResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.ProposalResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getVersion(); + if (f !== 0) { + writer.writeInt32( + 1, + f + ); + } + f = message.getTimestamp(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter + ); + } + f = message.getResponse(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.protos.Response.serializeBinaryToWriter + ); + } + f = message.getPayload_asU8(); + if (f.length > 0) { + writer.writeBytes( + 5, + f + ); + } + f = message.getEndorsement(); + if (f != null) { + writer.writeMessage( + 6, + f, + proto.protos.Endorsement.serializeBinaryToWriter + ); + } +}; + + +/** + * optional int32 version = 1; + * @return {number} + */ +proto.protos.ProposalResponse.prototype.getVersion = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.protos.ProposalResponse} returns this + */ +proto.protos.ProposalResponse.prototype.setVersion = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional google.protobuf.Timestamp timestamp = 2; + * @return {?proto.google.protobuf.Timestamp} + */ +proto.protos.ProposalResponse.prototype.getTimestamp = function() { + return /** @type{?proto.google.protobuf.Timestamp} */ ( + jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 2)); +}; + + +/** + * @param {?proto.google.protobuf.Timestamp|undefined} value + * @return {!proto.protos.ProposalResponse} returns this +*/ +proto.protos.ProposalResponse.prototype.setTimestamp = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.protos.ProposalResponse} returns this + */ +proto.protos.ProposalResponse.prototype.clearTimestamp = function() { + return this.setTimestamp(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.protos.ProposalResponse.prototype.hasTimestamp = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional Response response = 4; + * @return {?proto.protos.Response} + */ +proto.protos.ProposalResponse.prototype.getResponse = function() { + return /** @type{?proto.protos.Response} */ ( + jspb.Message.getWrapperField(this, proto.protos.Response, 4)); +}; + + +/** + * @param {?proto.protos.Response|undefined} value + * @return {!proto.protos.ProposalResponse} returns this +*/ +proto.protos.ProposalResponse.prototype.setResponse = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.protos.ProposalResponse} returns this + */ +proto.protos.ProposalResponse.prototype.clearResponse = function() { + return this.setResponse(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.protos.ProposalResponse.prototype.hasResponse = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional bytes payload = 5; + * @return {!(string|Uint8Array)} + */ +proto.protos.ProposalResponse.prototype.getPayload = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * optional bytes payload = 5; + * This is a type-conversion wrapper around `getPayload()` + * @return {string} + */ +proto.protos.ProposalResponse.prototype.getPayload_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPayload())); +}; + + +/** + * optional bytes payload = 5; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPayload()` + * @return {!Uint8Array} + */ +proto.protos.ProposalResponse.prototype.getPayload_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPayload())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.protos.ProposalResponse} returns this + */ +proto.protos.ProposalResponse.prototype.setPayload = function(value) { + return jspb.Message.setProto3BytesField(this, 5, value); +}; + + +/** + * optional Endorsement endorsement = 6; + * @return {?proto.protos.Endorsement} + */ +proto.protos.ProposalResponse.prototype.getEndorsement = function() { + return /** @type{?proto.protos.Endorsement} */ ( + jspb.Message.getWrapperField(this, proto.protos.Endorsement, 6)); +}; + + +/** + * @param {?proto.protos.Endorsement|undefined} value + * @return {!proto.protos.ProposalResponse} returns this +*/ +proto.protos.ProposalResponse.prototype.setEndorsement = function(value) { + return jspb.Message.setWrapperField(this, 6, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.protos.ProposalResponse} returns this + */ +proto.protos.ProposalResponse.prototype.clearEndorsement = function() { + return this.setEndorsement(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.protos.ProposalResponse.prototype.hasEndorsement = function() { + return jspb.Message.getField(this, 6) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.protos.Response.prototype.toObject = function(opt_includeInstance) { + return proto.protos.Response.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protos.Response} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.Response.toObject = function(includeInstance, msg) { + var f, obj = { + status: jspb.Message.getFieldWithDefault(msg, 1, 0), + message: jspb.Message.getFieldWithDefault(msg, 2, ""), + payload: msg.getPayload_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protos.Response} + */ +proto.protos.Response.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protos.Response; + return proto.protos.Response.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protos.Response} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protos.Response} + */ +proto.protos.Response.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setStatus(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setMessage(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setPayload(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protos.Response.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protos.Response.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protos.Response} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.Response.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStatus(); + if (f !== 0) { + writer.writeInt32( + 1, + f + ); + } + f = message.getMessage(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getPayload_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } +}; + + +/** + * optional int32 status = 1; + * @return {number} + */ +proto.protos.Response.prototype.getStatus = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.protos.Response} returns this + */ +proto.protos.Response.prototype.setStatus = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional string message = 2; + * @return {string} + */ +proto.protos.Response.prototype.getMessage = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.protos.Response} returns this + */ +proto.protos.Response.prototype.setMessage = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional bytes payload = 3; + * @return {!(string|Uint8Array)} + */ +proto.protos.Response.prototype.getPayload = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes payload = 3; + * This is a type-conversion wrapper around `getPayload()` + * @return {string} + */ +proto.protos.Response.prototype.getPayload_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPayload())); +}; + + +/** + * optional bytes payload = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPayload()` + * @return {!Uint8Array} + */ +proto.protos.Response.prototype.getPayload_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPayload())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.protos.Response} returns this + */ +proto.protos.Response.prototype.setPayload = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.protos.ProposalResponsePayload.prototype.toObject = function(opt_includeInstance) { + return proto.protos.ProposalResponsePayload.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protos.ProposalResponsePayload} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.ProposalResponsePayload.toObject = function(includeInstance, msg) { + var f, obj = { + proposalHash: msg.getProposalHash_asB64(), + extension: msg.getExtension_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protos.ProposalResponsePayload} + */ +proto.protos.ProposalResponsePayload.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protos.ProposalResponsePayload; + return proto.protos.ProposalResponsePayload.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protos.ProposalResponsePayload} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protos.ProposalResponsePayload} + */ +proto.protos.ProposalResponsePayload.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setProposalHash(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setExtension$(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protos.ProposalResponsePayload.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protos.ProposalResponsePayload.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protos.ProposalResponsePayload} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.ProposalResponsePayload.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProposalHash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getExtension_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional bytes proposal_hash = 1; + * @return {!(string|Uint8Array)} + */ +proto.protos.ProposalResponsePayload.prototype.getProposalHash = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes proposal_hash = 1; + * This is a type-conversion wrapper around `getProposalHash()` + * @return {string} + */ +proto.protos.ProposalResponsePayload.prototype.getProposalHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getProposalHash())); +}; + + +/** + * optional bytes proposal_hash = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getProposalHash()` + * @return {!Uint8Array} + */ +proto.protos.ProposalResponsePayload.prototype.getProposalHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getProposalHash())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.protos.ProposalResponsePayload} returns this + */ +proto.protos.ProposalResponsePayload.prototype.setProposalHash = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes extension = 2; + * @return {!(string|Uint8Array)} + */ +proto.protos.ProposalResponsePayload.prototype.getExtension$ = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes extension = 2; + * This is a type-conversion wrapper around `getExtension$()` + * @return {string} + */ +proto.protos.ProposalResponsePayload.prototype.getExtension_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getExtension$())); +}; + + +/** + * optional bytes extension = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getExtension$()` + * @return {!Uint8Array} + */ +proto.protos.ProposalResponsePayload.prototype.getExtension_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getExtension$())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.protos.ProposalResponsePayload} returns this + */ +proto.protos.ProposalResponsePayload.prototype.setExtension$ = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.protos.Endorsement.prototype.toObject = function(opt_includeInstance) { + return proto.protos.Endorsement.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protos.Endorsement} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.Endorsement.toObject = function(includeInstance, msg) { + var f, obj = { + endorser: msg.getEndorser_asB64(), + signature: msg.getSignature_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protos.Endorsement} + */ +proto.protos.Endorsement.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protos.Endorsement; + return proto.protos.Endorsement.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protos.Endorsement} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protos.Endorsement} + */ +proto.protos.Endorsement.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setEndorser(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setSignature(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protos.Endorsement.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protos.Endorsement.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protos.Endorsement} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protos.Endorsement.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getEndorser_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getSignature_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional bytes endorser = 1; + * @return {!(string|Uint8Array)} + */ +proto.protos.Endorsement.prototype.getEndorser = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes endorser = 1; + * This is a type-conversion wrapper around `getEndorser()` + * @return {string} + */ +proto.protos.Endorsement.prototype.getEndorser_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getEndorser())); +}; + + +/** + * optional bytes endorser = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getEndorser()` + * @return {!Uint8Array} + */ +proto.protos.Endorsement.prototype.getEndorser_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getEndorser())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.protos.Endorsement} returns this + */ +proto.protos.Endorsement.prototype.setEndorser = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes signature = 2; + * @return {!(string|Uint8Array)} + */ +proto.protos.Endorsement.prototype.getSignature = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes signature = 2; + * This is a type-conversion wrapper around `getSignature()` + * @return {string} + */ +proto.protos.Endorsement.prototype.getSignature_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getSignature())); +}; + + +/** + * optional bytes signature = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getSignature()` + * @return {!Uint8Array} + */ +proto.protos.Endorsement.prototype.getSignature_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getSignature())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.protos.Endorsement} returns this + */ +proto.protos.Endorsement.prototype.setSignature = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + +goog.object.extend(exports, proto.protos); diff --git a/weaver/common/protos-js/relay/datatransfer_grpc_pb.d.ts b/weaver/common/protos-js/relay/datatransfer_grpc_pb.d.ts new file mode 100644 index 00000000000..150b8c51624 --- /dev/null +++ b/weaver/common/protos-js/relay/datatransfer_grpc_pb.d.ts @@ -0,0 +1,78 @@ +// package: relay.datatransfer +// file: relay/datatransfer.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as grpc from "@grpc/grpc-js"; +import * as relay_datatransfer_pb from "../relay/datatransfer_pb"; +import * as common_ack_pb from "../common/ack_pb"; +import * as common_state_pb from "../common/state_pb"; +import * as common_query_pb from "../common/query_pb"; + +interface IDataTransferService extends grpc.ServiceDefinition { + requestState: IDataTransferService_IRequestState; + sendState: IDataTransferService_ISendState; + sendDriverState: IDataTransferService_ISendDriverState; +} + +interface IDataTransferService_IRequestState extends grpc.MethodDefinition { + path: "/relay.datatransfer.DataTransfer/RequestState"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IDataTransferService_ISendState extends grpc.MethodDefinition { + path: "/relay.datatransfer.DataTransfer/SendState"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IDataTransferService_ISendDriverState extends grpc.MethodDefinition { + path: "/relay.datatransfer.DataTransfer/SendDriverState"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} + +export const DataTransferService: IDataTransferService; + +export interface IDataTransferServer extends grpc.UntypedServiceImplementation { + requestState: grpc.handleUnaryCall; + sendState: grpc.handleUnaryCall; + sendDriverState: grpc.handleUnaryCall; +} + +export interface IDataTransferClient { + requestState(request: common_query_pb.Query, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + requestState(request: common_query_pb.Query, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + requestState(request: common_query_pb.Query, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendState(request: common_state_pb.ViewPayload, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendState(request: common_state_pb.ViewPayload, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendState(request: common_state_pb.ViewPayload, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendDriverState(request: common_state_pb.ViewPayload, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendDriverState(request: common_state_pb.ViewPayload, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendDriverState(request: common_state_pb.ViewPayload, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; +} + +export class DataTransferClient extends grpc.Client implements IDataTransferClient { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: Partial); + public requestState(request: common_query_pb.Query, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public requestState(request: common_query_pb.Query, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public requestState(request: common_query_pb.Query, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendState(request: common_state_pb.ViewPayload, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendState(request: common_state_pb.ViewPayload, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendState(request: common_state_pb.ViewPayload, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendDriverState(request: common_state_pb.ViewPayload, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendDriverState(request: common_state_pb.ViewPayload, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendDriverState(request: common_state_pb.ViewPayload, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; +} diff --git a/weaver/common/protos-js/relay/datatransfer_grpc_pb.js b/weaver/common/protos-js/relay/datatransfer_grpc_pb.js new file mode 100644 index 00000000000..2da832397ec --- /dev/null +++ b/weaver/common/protos-js/relay/datatransfer_grpc_pb.js @@ -0,0 +1,90 @@ +// GENERATED CODE -- DO NOT EDIT! + +// Original file comments: +// Copyright IBM Corp. All Rights Reserved. +// +// SPDX-License-Identifier: Apache-2.0 +// +'use strict'; +var grpc = require('@grpc/grpc-js'); +var common_ack_pb = require('../common/ack_pb.js'); +var common_state_pb = require('../common/state_pb.js'); +var common_query_pb = require('../common/query_pb.js'); + +function serialize_common_ack_Ack(arg) { + if (!(arg instanceof common_ack_pb.Ack)) { + throw new Error('Expected argument of type common.ack.Ack'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_common_ack_Ack(buffer_arg) { + return common_ack_pb.Ack.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_common_query_Query(arg) { + if (!(arg instanceof common_query_pb.Query)) { + throw new Error('Expected argument of type common.query.Query'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_common_query_Query(buffer_arg) { + return common_query_pb.Query.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_common_state_ViewPayload(arg) { + if (!(arg instanceof common_state_pb.ViewPayload)) { + throw new Error('Expected argument of type common.state.ViewPayload'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_common_state_ViewPayload(buffer_arg) { + return common_state_pb.ViewPayload.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +// definitions of all messages used in the datatransfer protocol +var DataTransferService = exports.DataTransferService = { + // the requesting relay sends a RequestState request to the remote relay with a +// query defining the data it wants to receive +requestState: { + path: '/relay.datatransfer.DataTransfer/RequestState', + requestStream: false, + responseStream: false, + requestType: common_query_pb.Query, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_common_query_Query, + requestDeserialize: deserialize_common_query_Query, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + // the remote relay asynchronously sends back the requested data with +// SendState +sendState: { + path: '/relay.datatransfer.DataTransfer/SendState', + requestStream: false, + responseStream: false, + requestType: common_state_pb.ViewPayload, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_common_state_ViewPayload, + requestDeserialize: deserialize_common_state_ViewPayload, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + // Handling state sent from the driver. +sendDriverState: { + path: '/relay.datatransfer.DataTransfer/SendDriverState', + requestStream: false, + responseStream: false, + requestType: common_state_pb.ViewPayload, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_common_state_ViewPayload, + requestDeserialize: deserialize_common_state_ViewPayload, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, +}; + +exports.DataTransferClient = grpc.makeGenericClientConstructor(DataTransferService); diff --git a/weaver/common/protos-js/relay/datatransfer_pb.d.ts b/weaver/common/protos-js/relay/datatransfer_pb.d.ts new file mode 100644 index 00000000000..84a0744fafe --- /dev/null +++ b/weaver/common/protos-js/relay/datatransfer_pb.d.ts @@ -0,0 +1,10 @@ +// package: relay.datatransfer +// file: relay/datatransfer.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; +import * as common_ack_pb from "../common/ack_pb"; +import * as common_state_pb from "../common/state_pb"; +import * as common_query_pb from "../common/query_pb"; diff --git a/weaver/common/protos-js/relay/datatransfer_pb.js b/weaver/common/protos-js/relay/datatransfer_pb.js new file mode 100644 index 00000000000..1bd6306fc9d --- /dev/null +++ b/weaver/common/protos-js/relay/datatransfer_pb.js @@ -0,0 +1,29 @@ +// source: relay/datatransfer.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +var common_ack_pb = require('../common/ack_pb.js'); +goog.object.extend(proto, common_ack_pb); +var common_state_pb = require('../common/state_pb.js'); +goog.object.extend(proto, common_state_pb); +var common_query_pb = require('../common/query_pb.js'); +goog.object.extend(proto, common_query_pb); diff --git a/weaver/common/protos-js/relay/events_grpc_pb.d.ts b/weaver/common/protos-js/relay/events_grpc_pb.d.ts new file mode 100644 index 00000000000..f7989177930 --- /dev/null +++ b/weaver/common/protos-js/relay/events_grpc_pb.d.ts @@ -0,0 +1,128 @@ +// package: relay.events +// file: relay/events.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as grpc from "@grpc/grpc-js"; +import * as relay_events_pb from "../relay/events_pb"; +import * as common_ack_pb from "../common/ack_pb"; +import * as common_events_pb from "../common/events_pb"; +import * as common_state_pb from "../common/state_pb"; + +interface IEventSubscribeService extends grpc.ServiceDefinition { + subscribeEvent: IEventSubscribeService_ISubscribeEvent; + sendSubscriptionStatus: IEventSubscribeService_ISendSubscriptionStatus; + sendDriverSubscriptionStatus: IEventSubscribeService_ISendDriverSubscriptionStatus; +} + +interface IEventSubscribeService_ISubscribeEvent extends grpc.MethodDefinition { + path: "/relay.events.EventSubscribe/SubscribeEvent"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IEventSubscribeService_ISendSubscriptionStatus extends grpc.MethodDefinition { + path: "/relay.events.EventSubscribe/SendSubscriptionStatus"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IEventSubscribeService_ISendDriverSubscriptionStatus extends grpc.MethodDefinition { + path: "/relay.events.EventSubscribe/SendDriverSubscriptionStatus"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} + +export const EventSubscribeService: IEventSubscribeService; + +export interface IEventSubscribeServer extends grpc.UntypedServiceImplementation { + subscribeEvent: grpc.handleUnaryCall; + sendSubscriptionStatus: grpc.handleUnaryCall; + sendDriverSubscriptionStatus: grpc.handleUnaryCall; +} + +export interface IEventSubscribeClient { + subscribeEvent(request: common_events_pb.EventSubscription, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + subscribeEvent(request: common_events_pb.EventSubscription, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + subscribeEvent(request: common_events_pb.EventSubscription, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendSubscriptionStatus(request: common_ack_pb.Ack, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendSubscriptionStatus(request: common_ack_pb.Ack, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendSubscriptionStatus(request: common_ack_pb.Ack, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendDriverSubscriptionStatus(request: common_ack_pb.Ack, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendDriverSubscriptionStatus(request: common_ack_pb.Ack, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendDriverSubscriptionStatus(request: common_ack_pb.Ack, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; +} + +export class EventSubscribeClient extends grpc.Client implements IEventSubscribeClient { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: Partial); + public subscribeEvent(request: common_events_pb.EventSubscription, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public subscribeEvent(request: common_events_pb.EventSubscription, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public subscribeEvent(request: common_events_pb.EventSubscription, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendSubscriptionStatus(request: common_ack_pb.Ack, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendSubscriptionStatus(request: common_ack_pb.Ack, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendSubscriptionStatus(request: common_ack_pb.Ack, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendDriverSubscriptionStatus(request: common_ack_pb.Ack, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendDriverSubscriptionStatus(request: common_ack_pb.Ack, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendDriverSubscriptionStatus(request: common_ack_pb.Ack, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; +} + +interface IEventPublishService extends grpc.ServiceDefinition { + sendDriverState: IEventPublishService_ISendDriverState; + sendState: IEventPublishService_ISendState; +} + +interface IEventPublishService_ISendDriverState extends grpc.MethodDefinition { + path: "/relay.events.EventPublish/SendDriverState"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IEventPublishService_ISendState extends grpc.MethodDefinition { + path: "/relay.events.EventPublish/SendState"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} + +export const EventPublishService: IEventPublishService; + +export interface IEventPublishServer extends grpc.UntypedServiceImplementation { + sendDriverState: grpc.handleUnaryCall; + sendState: grpc.handleUnaryCall; +} + +export interface IEventPublishClient { + sendDriverState(request: common_state_pb.ViewPayload, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendDriverState(request: common_state_pb.ViewPayload, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendDriverState(request: common_state_pb.ViewPayload, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendState(request: common_state_pb.ViewPayload, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendState(request: common_state_pb.ViewPayload, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendState(request: common_state_pb.ViewPayload, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; +} + +export class EventPublishClient extends grpc.Client implements IEventPublishClient { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: Partial); + public sendDriverState(request: common_state_pb.ViewPayload, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendDriverState(request: common_state_pb.ViewPayload, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendDriverState(request: common_state_pb.ViewPayload, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendState(request: common_state_pb.ViewPayload, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendState(request: common_state_pb.ViewPayload, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendState(request: common_state_pb.ViewPayload, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; +} diff --git a/weaver/common/protos-js/relay/events_grpc_pb.js b/weaver/common/protos-js/relay/events_grpc_pb.js new file mode 100644 index 00000000000..cf806afedf5 --- /dev/null +++ b/weaver/common/protos-js/relay/events_grpc_pb.js @@ -0,0 +1,117 @@ +// GENERATED CODE -- DO NOT EDIT! + +// Original file comments: +// Copyright IBM Corp. All Rights Reserved. +// +// SPDX-License-Identifier: Apache-2.0 +// +'use strict'; +var grpc = require('@grpc/grpc-js'); +var common_ack_pb = require('../common/ack_pb.js'); +var common_events_pb = require('../common/events_pb.js'); +var common_state_pb = require('../common/state_pb.js'); + +function serialize_common_ack_Ack(arg) { + if (!(arg instanceof common_ack_pb.Ack)) { + throw new Error('Expected argument of type common.ack.Ack'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_common_ack_Ack(buffer_arg) { + return common_ack_pb.Ack.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_common_events_EventSubscription(arg) { + if (!(arg instanceof common_events_pb.EventSubscription)) { + throw new Error('Expected argument of type common.events.EventSubscription'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_common_events_EventSubscription(buffer_arg) { + return common_events_pb.EventSubscription.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_common_state_ViewPayload(arg) { + if (!(arg instanceof common_state_pb.ViewPayload)) { + throw new Error('Expected argument of type common.state.ViewPayload'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_common_state_ViewPayload(buffer_arg) { + return common_state_pb.ViewPayload.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +var EventSubscribeService = exports.EventSubscribeService = { + // the dest-relay forwards the request from client as EventSubscription to the src-relay +subscribeEvent: { + path: '/relay.events.EventSubscribe/SubscribeEvent', + requestStream: false, + responseStream: false, + requestType: common_events_pb.EventSubscription, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_common_events_EventSubscription, + requestDeserialize: deserialize_common_events_EventSubscription, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + // Src-relay based upon query (EventSubscription) forwards the same response (Ack) +// from driver to the dest-relay by calling a new endpoint in dest-relay +sendSubscriptionStatus: { + path: '/relay.events.EventSubscribe/SendSubscriptionStatus', + requestStream: false, + responseStream: false, + requestType: common_ack_pb.Ack, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_common_ack_Ack, + requestDeserialize: deserialize_common_ack_Ack, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + // Src-driver status of event subscription (Ack) +// to the src-relay by calling a new endpoint in src-relay +sendDriverSubscriptionStatus: { + path: '/relay.events.EventSubscribe/SendDriverSubscriptionStatus', + requestStream: false, + responseStream: false, + requestType: common_ack_pb.Ack, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_common_ack_Ack, + requestDeserialize: deserialize_common_ack_Ack, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, +}; + +exports.EventSubscribeClient = grpc.makeGenericClientConstructor(EventSubscribeService); +var EventPublishService = exports.EventPublishService = { + // src-driver forwards the state as part of event subscription to src-relay +sendDriverState: { + path: '/relay.events.EventPublish/SendDriverState', + requestStream: false, + responseStream: false, + requestType: common_state_pb.ViewPayload, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_common_state_ViewPayload, + requestDeserialize: deserialize_common_state_ViewPayload, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + // src-relay will forward the state as part of event subscription to dest-relay +sendState: { + path: '/relay.events.EventPublish/SendState', + requestStream: false, + responseStream: false, + requestType: common_state_pb.ViewPayload, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_common_state_ViewPayload, + requestDeserialize: deserialize_common_state_ViewPayload, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, +}; + +exports.EventPublishClient = grpc.makeGenericClientConstructor(EventPublishService); diff --git a/weaver/common/protos-js/relay/events_pb.d.ts b/weaver/common/protos-js/relay/events_pb.d.ts new file mode 100644 index 00000000000..26536b2a51f --- /dev/null +++ b/weaver/common/protos-js/relay/events_pb.d.ts @@ -0,0 +1,10 @@ +// package: relay.events +// file: relay/events.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; +import * as common_ack_pb from "../common/ack_pb"; +import * as common_events_pb from "../common/events_pb"; +import * as common_state_pb from "../common/state_pb"; diff --git a/weaver/common/protos-js/relay/events_pb.js b/weaver/common/protos-js/relay/events_pb.js new file mode 100644 index 00000000000..f715d22ee94 --- /dev/null +++ b/weaver/common/protos-js/relay/events_pb.js @@ -0,0 +1,29 @@ +// source: relay/events.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +var common_ack_pb = require('../common/ack_pb.js'); +goog.object.extend(proto, common_ack_pb); +var common_events_pb = require('../common/events_pb.js'); +goog.object.extend(proto, common_events_pb); +var common_state_pb = require('../common/state_pb.js'); +goog.object.extend(proto, common_state_pb); diff --git a/weaver/common/protos-js/relay/satp_grpc_pb.d.ts b/weaver/common/protos-js/relay/satp_grpc_pb.d.ts new file mode 100644 index 00000000000..dbb5ac9cfe0 --- /dev/null +++ b/weaver/common/protos-js/relay/satp_grpc_pb.d.ts @@ -0,0 +1,229 @@ +// package: relay.satp +// file: relay/satp.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as grpc from "@grpc/grpc-js"; +import * as relay_satp_pb from "../relay/satp_pb"; +import * as common_ack_pb from "../common/ack_pb"; + +interface ISATPService extends grpc.ServiceDefinition { + transferProposalClaims: ISATPService_ITransferProposalClaims; + transferProposalReceipt: ISATPService_ITransferProposalReceipt; + transferCommence: ISATPService_ITransferCommence; + ackCommence: ISATPService_IAckCommence; + sendAssetStatus: ISATPService_ISendAssetStatus; + lockAssertion: ISATPService_ILockAssertion; + lockAssertionReceipt: ISATPService_ILockAssertionReceipt; + commitPrepare: ISATPService_ICommitPrepare; + commitReady: ISATPService_ICommitReady; + commitFinalAssertion: ISATPService_ICommitFinalAssertion; + ackFinalReceipt: ISATPService_IAckFinalReceipt; + transferCompleted: ISATPService_ITransferCompleted; +} + +interface ISATPService_ITransferProposalClaims extends grpc.MethodDefinition { + path: "/relay.satp.SATP/TransferProposalClaims"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface ISATPService_ITransferProposalReceipt extends grpc.MethodDefinition { + path: "/relay.satp.SATP/TransferProposalReceipt"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface ISATPService_ITransferCommence extends grpc.MethodDefinition { + path: "/relay.satp.SATP/TransferCommence"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface ISATPService_IAckCommence extends grpc.MethodDefinition { + path: "/relay.satp.SATP/AckCommence"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface ISATPService_ISendAssetStatus extends grpc.MethodDefinition { + path: "/relay.satp.SATP/SendAssetStatus"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface ISATPService_ILockAssertion extends grpc.MethodDefinition { + path: "/relay.satp.SATP/LockAssertion"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface ISATPService_ILockAssertionReceipt extends grpc.MethodDefinition { + path: "/relay.satp.SATP/LockAssertionReceipt"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface ISATPService_ICommitPrepare extends grpc.MethodDefinition { + path: "/relay.satp.SATP/CommitPrepare"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface ISATPService_ICommitReady extends grpc.MethodDefinition { + path: "/relay.satp.SATP/CommitReady"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface ISATPService_ICommitFinalAssertion extends grpc.MethodDefinition { + path: "/relay.satp.SATP/CommitFinalAssertion"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface ISATPService_IAckFinalReceipt extends grpc.MethodDefinition { + path: "/relay.satp.SATP/AckFinalReceipt"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface ISATPService_ITransferCompleted extends grpc.MethodDefinition { + path: "/relay.satp.SATP/TransferCompleted"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} + +export const SATPService: ISATPService; + +export interface ISATPServer extends grpc.UntypedServiceImplementation { + transferProposalClaims: grpc.handleUnaryCall; + transferProposalReceipt: grpc.handleUnaryCall; + transferCommence: grpc.handleUnaryCall; + ackCommence: grpc.handleUnaryCall; + sendAssetStatus: grpc.handleUnaryCall; + lockAssertion: grpc.handleUnaryCall; + lockAssertionReceipt: grpc.handleUnaryCall; + commitPrepare: grpc.handleUnaryCall; + commitReady: grpc.handleUnaryCall; + commitFinalAssertion: grpc.handleUnaryCall; + ackFinalReceipt: grpc.handleUnaryCall; + transferCompleted: grpc.handleUnaryCall; +} + +export interface ISATPClient { + transferProposalClaims(request: relay_satp_pb.TransferProposalClaimsRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + transferProposalClaims(request: relay_satp_pb.TransferProposalClaimsRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + transferProposalClaims(request: relay_satp_pb.TransferProposalClaimsRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + transferProposalReceipt(request: relay_satp_pb.TransferProposalReceiptRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + transferProposalReceipt(request: relay_satp_pb.TransferProposalReceiptRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + transferProposalReceipt(request: relay_satp_pb.TransferProposalReceiptRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + transferCommence(request: relay_satp_pb.TransferCommenceRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + transferCommence(request: relay_satp_pb.TransferCommenceRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + transferCommence(request: relay_satp_pb.TransferCommenceRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + ackCommence(request: relay_satp_pb.AckCommenceRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + ackCommence(request: relay_satp_pb.AckCommenceRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + ackCommence(request: relay_satp_pb.AckCommenceRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendAssetStatus(request: relay_satp_pb.SendAssetStatusRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendAssetStatus(request: relay_satp_pb.SendAssetStatusRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + sendAssetStatus(request: relay_satp_pb.SendAssetStatusRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + lockAssertion(request: relay_satp_pb.LockAssertionRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + lockAssertion(request: relay_satp_pb.LockAssertionRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + lockAssertion(request: relay_satp_pb.LockAssertionRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + lockAssertionReceipt(request: relay_satp_pb.LockAssertionReceiptRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + lockAssertionReceipt(request: relay_satp_pb.LockAssertionReceiptRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + lockAssertionReceipt(request: relay_satp_pb.LockAssertionReceiptRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + commitPrepare(request: relay_satp_pb.CommitPrepareRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + commitPrepare(request: relay_satp_pb.CommitPrepareRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + commitPrepare(request: relay_satp_pb.CommitPrepareRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + commitReady(request: relay_satp_pb.CommitReadyRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + commitReady(request: relay_satp_pb.CommitReadyRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + commitReady(request: relay_satp_pb.CommitReadyRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + commitFinalAssertion(request: relay_satp_pb.CommitFinalAssertionRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + commitFinalAssertion(request: relay_satp_pb.CommitFinalAssertionRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + commitFinalAssertion(request: relay_satp_pb.CommitFinalAssertionRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + ackFinalReceipt(request: relay_satp_pb.AckFinalReceiptRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + ackFinalReceipt(request: relay_satp_pb.AckFinalReceiptRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + ackFinalReceipt(request: relay_satp_pb.AckFinalReceiptRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + transferCompleted(request: relay_satp_pb.TransferCompletedRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + transferCompleted(request: relay_satp_pb.TransferCompletedRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + transferCompleted(request: relay_satp_pb.TransferCompletedRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; +} + +export class SATPClient extends grpc.Client implements ISATPClient { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: Partial); + public transferProposalClaims(request: relay_satp_pb.TransferProposalClaimsRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public transferProposalClaims(request: relay_satp_pb.TransferProposalClaimsRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public transferProposalClaims(request: relay_satp_pb.TransferProposalClaimsRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public transferProposalReceipt(request: relay_satp_pb.TransferProposalReceiptRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public transferProposalReceipt(request: relay_satp_pb.TransferProposalReceiptRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public transferProposalReceipt(request: relay_satp_pb.TransferProposalReceiptRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public transferCommence(request: relay_satp_pb.TransferCommenceRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public transferCommence(request: relay_satp_pb.TransferCommenceRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public transferCommence(request: relay_satp_pb.TransferCommenceRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public ackCommence(request: relay_satp_pb.AckCommenceRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public ackCommence(request: relay_satp_pb.AckCommenceRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public ackCommence(request: relay_satp_pb.AckCommenceRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendAssetStatus(request: relay_satp_pb.SendAssetStatusRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendAssetStatus(request: relay_satp_pb.SendAssetStatusRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public sendAssetStatus(request: relay_satp_pb.SendAssetStatusRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public lockAssertion(request: relay_satp_pb.LockAssertionRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public lockAssertion(request: relay_satp_pb.LockAssertionRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public lockAssertion(request: relay_satp_pb.LockAssertionRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public lockAssertionReceipt(request: relay_satp_pb.LockAssertionReceiptRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public lockAssertionReceipt(request: relay_satp_pb.LockAssertionReceiptRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public lockAssertionReceipt(request: relay_satp_pb.LockAssertionReceiptRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public commitPrepare(request: relay_satp_pb.CommitPrepareRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public commitPrepare(request: relay_satp_pb.CommitPrepareRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public commitPrepare(request: relay_satp_pb.CommitPrepareRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public commitReady(request: relay_satp_pb.CommitReadyRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public commitReady(request: relay_satp_pb.CommitReadyRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public commitReady(request: relay_satp_pb.CommitReadyRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public commitFinalAssertion(request: relay_satp_pb.CommitFinalAssertionRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public commitFinalAssertion(request: relay_satp_pb.CommitFinalAssertionRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public commitFinalAssertion(request: relay_satp_pb.CommitFinalAssertionRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public ackFinalReceipt(request: relay_satp_pb.AckFinalReceiptRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public ackFinalReceipt(request: relay_satp_pb.AckFinalReceiptRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public ackFinalReceipt(request: relay_satp_pb.AckFinalReceiptRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public transferCompleted(request: relay_satp_pb.TransferCompletedRequest, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public transferCompleted(request: relay_satp_pb.TransferCompletedRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; + public transferCompleted(request: relay_satp_pb.TransferCompletedRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: common_ack_pb.Ack) => void): grpc.ClientUnaryCall; +} diff --git a/weaver/common/protos-js/relay/satp_grpc_pb.js b/weaver/common/protos-js/relay/satp_grpc_pb.js new file mode 100644 index 00000000000..5bd6a75b043 --- /dev/null +++ b/weaver/common/protos-js/relay/satp_grpc_pb.js @@ -0,0 +1,303 @@ +// GENERATED CODE -- DO NOT EDIT! + +'use strict'; +var grpc = require('@grpc/grpc-js'); +var relay_satp_pb = require('../relay/satp_pb.js'); +var common_ack_pb = require('../common/ack_pb.js'); + +function serialize_common_ack_Ack(arg) { + if (!(arg instanceof common_ack_pb.Ack)) { + throw new Error('Expected argument of type common.ack.Ack'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_common_ack_Ack(buffer_arg) { + return common_ack_pb.Ack.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_relay_satp_AckCommenceRequest(arg) { + if (!(arg instanceof relay_satp_pb.AckCommenceRequest)) { + throw new Error('Expected argument of type relay.satp.AckCommenceRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_relay_satp_AckCommenceRequest(buffer_arg) { + return relay_satp_pb.AckCommenceRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_relay_satp_AckFinalReceiptRequest(arg) { + if (!(arg instanceof relay_satp_pb.AckFinalReceiptRequest)) { + throw new Error('Expected argument of type relay.satp.AckFinalReceiptRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_relay_satp_AckFinalReceiptRequest(buffer_arg) { + return relay_satp_pb.AckFinalReceiptRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_relay_satp_CommitFinalAssertionRequest(arg) { + if (!(arg instanceof relay_satp_pb.CommitFinalAssertionRequest)) { + throw new Error('Expected argument of type relay.satp.CommitFinalAssertionRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_relay_satp_CommitFinalAssertionRequest(buffer_arg) { + return relay_satp_pb.CommitFinalAssertionRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_relay_satp_CommitPrepareRequest(arg) { + if (!(arg instanceof relay_satp_pb.CommitPrepareRequest)) { + throw new Error('Expected argument of type relay.satp.CommitPrepareRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_relay_satp_CommitPrepareRequest(buffer_arg) { + return relay_satp_pb.CommitPrepareRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_relay_satp_CommitReadyRequest(arg) { + if (!(arg instanceof relay_satp_pb.CommitReadyRequest)) { + throw new Error('Expected argument of type relay.satp.CommitReadyRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_relay_satp_CommitReadyRequest(buffer_arg) { + return relay_satp_pb.CommitReadyRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_relay_satp_LockAssertionReceiptRequest(arg) { + if (!(arg instanceof relay_satp_pb.LockAssertionReceiptRequest)) { + throw new Error('Expected argument of type relay.satp.LockAssertionReceiptRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_relay_satp_LockAssertionReceiptRequest(buffer_arg) { + return relay_satp_pb.LockAssertionReceiptRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_relay_satp_LockAssertionRequest(arg) { + if (!(arg instanceof relay_satp_pb.LockAssertionRequest)) { + throw new Error('Expected argument of type relay.satp.LockAssertionRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_relay_satp_LockAssertionRequest(buffer_arg) { + return relay_satp_pb.LockAssertionRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_relay_satp_SendAssetStatusRequest(arg) { + if (!(arg instanceof relay_satp_pb.SendAssetStatusRequest)) { + throw new Error('Expected argument of type relay.satp.SendAssetStatusRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_relay_satp_SendAssetStatusRequest(buffer_arg) { + return relay_satp_pb.SendAssetStatusRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_relay_satp_TransferCommenceRequest(arg) { + if (!(arg instanceof relay_satp_pb.TransferCommenceRequest)) { + throw new Error('Expected argument of type relay.satp.TransferCommenceRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_relay_satp_TransferCommenceRequest(buffer_arg) { + return relay_satp_pb.TransferCommenceRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_relay_satp_TransferCompletedRequest(arg) { + if (!(arg instanceof relay_satp_pb.TransferCompletedRequest)) { + throw new Error('Expected argument of type relay.satp.TransferCompletedRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_relay_satp_TransferCompletedRequest(buffer_arg) { + return relay_satp_pb.TransferCompletedRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_relay_satp_TransferProposalClaimsRequest(arg) { + if (!(arg instanceof relay_satp_pb.TransferProposalClaimsRequest)) { + throw new Error('Expected argument of type relay.satp.TransferProposalClaimsRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_relay_satp_TransferProposalClaimsRequest(buffer_arg) { + return relay_satp_pb.TransferProposalClaimsRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_relay_satp_TransferProposalReceiptRequest(arg) { + if (!(arg instanceof relay_satp_pb.TransferProposalReceiptRequest)) { + throw new Error('Expected argument of type relay.satp.TransferProposalReceiptRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_relay_satp_TransferProposalReceiptRequest(buffer_arg) { + return relay_satp_pb.TransferProposalReceiptRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +var SATPService = exports.SATPService = { + // The sender gateway sends a TransferProposalClaims request to initiate an asset transfer. +// Depending on the proposal, multiple rounds of communication between the two gateways may happen. +transferProposalClaims: { + path: '/relay.satp.SATP/TransferProposalClaims', + requestStream: false, + responseStream: false, + requestType: relay_satp_pb.TransferProposalClaimsRequest, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_relay_satp_TransferProposalClaimsRequest, + requestDeserialize: deserialize_relay_satp_TransferProposalClaimsRequest, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + // The sender gateway sends a TransferProposalClaims request to signal to the receiver gateway +// that the it is ready to start the transfer of the digital asset +transferProposalReceipt: { + path: '/relay.satp.SATP/TransferProposalReceipt', + requestStream: false, + responseStream: false, + requestType: relay_satp_pb.TransferProposalReceiptRequest, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_relay_satp_TransferProposalReceiptRequest, + requestDeserialize: deserialize_relay_satp_TransferProposalReceiptRequest, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + // The sender gateway sends a TransferCommence request to signal to the receiver gateway +// that the it is ready to start the transfer of the digital asset +transferCommence: { + path: '/relay.satp.SATP/TransferCommence', + requestStream: false, + responseStream: false, + requestType: relay_satp_pb.TransferCommenceRequest, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_relay_satp_TransferCommenceRequest, + requestDeserialize: deserialize_relay_satp_TransferCommenceRequest, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + // The receiver gateway sends a AckCommence request to the sender gateway to indicate agreement +// to proceed with the asset transfe +ackCommence: { + path: '/relay.satp.SATP/AckCommence', + requestStream: false, + responseStream: false, + requestType: relay_satp_pb.AckCommenceRequest, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_relay_satp_AckCommenceRequest, + requestDeserialize: deserialize_relay_satp_AckCommenceRequest, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + // Stage 2 endpoints +// +sendAssetStatus: { + path: '/relay.satp.SATP/SendAssetStatus', + requestStream: false, + responseStream: false, + requestType: relay_satp_pb.SendAssetStatusRequest, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_relay_satp_SendAssetStatusRequest, + requestDeserialize: deserialize_relay_satp_SendAssetStatusRequest, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + // The sender gateway sends a LockAssertion request to convey a signed claim to the receiver gateway +// declaring that the asset in question has been locked or escrowed by the sender gateway in +// the origin network (e.g. to prevent double spending) +lockAssertion: { + path: '/relay.satp.SATP/LockAssertion', + requestStream: false, + responseStream: false, + requestType: relay_satp_pb.LockAssertionRequest, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_relay_satp_LockAssertionRequest, + requestDeserialize: deserialize_relay_satp_LockAssertionRequest, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + // The receiver gateway sends a LockAssertionReceipt request to the sender gateway to indicate acceptance +// of the claim(s) delivered by the sender gateway in the previous message +lockAssertionReceipt: { + path: '/relay.satp.SATP/LockAssertionReceipt', + requestStream: false, + responseStream: false, + requestType: relay_satp_pb.LockAssertionReceiptRequest, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_relay_satp_LockAssertionReceiptRequest, + requestDeserialize: deserialize_relay_satp_LockAssertionReceiptRequest, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + commitPrepare: { + path: '/relay.satp.SATP/CommitPrepare', + requestStream: false, + responseStream: false, + requestType: relay_satp_pb.CommitPrepareRequest, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_relay_satp_CommitPrepareRequest, + requestDeserialize: deserialize_relay_satp_CommitPrepareRequest, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + commitReady: { + path: '/relay.satp.SATP/CommitReady', + requestStream: false, + responseStream: false, + requestType: relay_satp_pb.CommitReadyRequest, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_relay_satp_CommitReadyRequest, + requestDeserialize: deserialize_relay_satp_CommitReadyRequest, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + commitFinalAssertion: { + path: '/relay.satp.SATP/CommitFinalAssertion', + requestStream: false, + responseStream: false, + requestType: relay_satp_pb.CommitFinalAssertionRequest, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_relay_satp_CommitFinalAssertionRequest, + requestDeserialize: deserialize_relay_satp_CommitFinalAssertionRequest, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + ackFinalReceipt: { + path: '/relay.satp.SATP/AckFinalReceipt', + requestStream: false, + responseStream: false, + requestType: relay_satp_pb.AckFinalReceiptRequest, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_relay_satp_AckFinalReceiptRequest, + requestDeserialize: deserialize_relay_satp_AckFinalReceiptRequest, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, + transferCompleted: { + path: '/relay.satp.SATP/TransferCompleted', + requestStream: false, + responseStream: false, + requestType: relay_satp_pb.TransferCompletedRequest, + responseType: common_ack_pb.Ack, + requestSerialize: serialize_relay_satp_TransferCompletedRequest, + requestDeserialize: deserialize_relay_satp_TransferCompletedRequest, + responseSerialize: serialize_common_ack_Ack, + responseDeserialize: deserialize_common_ack_Ack, + }, +}; + +exports.SATPClient = grpc.makeGenericClientConstructor(SATPService); +// Stage 1 endpoints diff --git a/weaver/common/protos-js/relay/satp_pb.d.ts b/weaver/common/protos-js/relay/satp_pb.d.ts new file mode 100644 index 00000000000..b4d0f317777 --- /dev/null +++ b/weaver/common/protos-js/relay/satp_pb.d.ts @@ -0,0 +1,470 @@ +// package: relay.satp +// file: relay/satp.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; +import * as common_ack_pb from "../common/ack_pb"; + +export class TransferProposalClaimsRequest extends jspb.Message { + getMessageType(): string; + setMessageType(value: string): TransferProposalClaimsRequest; + getAssetAssetId(): string; + setAssetAssetId(value: string): TransferProposalClaimsRequest; + getAssetProfileId(): string; + setAssetProfileId(value: string): TransferProposalClaimsRequest; + getVerifiedOriginatorEntityId(): string; + setVerifiedOriginatorEntityId(value: string): TransferProposalClaimsRequest; + getVerifiedBeneficiaryEntityId(): string; + setVerifiedBeneficiaryEntityId(value: string): TransferProposalClaimsRequest; + getOriginatorPubkey(): string; + setOriginatorPubkey(value: string): TransferProposalClaimsRequest; + getBeneficiaryPubkey(): string; + setBeneficiaryPubkey(value: string): TransferProposalClaimsRequest; + getSenderGatewayNetworkId(): string; + setSenderGatewayNetworkId(value: string): TransferProposalClaimsRequest; + getRecipientGatewayNetworkId(): string; + setRecipientGatewayNetworkId(value: string): TransferProposalClaimsRequest; + getClientIdentityPubkey(): string; + setClientIdentityPubkey(value: string): TransferProposalClaimsRequest; + getServerIdentityPubkey(): string; + setServerIdentityPubkey(value: string): TransferProposalClaimsRequest; + getSenderGatewayOwnerId(): string; + setSenderGatewayOwnerId(value: string): TransferProposalClaimsRequest; + getReceiverGatewayOwnerId(): string; + setReceiverGatewayOwnerId(value: string): TransferProposalClaimsRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TransferProposalClaimsRequest.AsObject; + static toObject(includeInstance: boolean, msg: TransferProposalClaimsRequest): TransferProposalClaimsRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: TransferProposalClaimsRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TransferProposalClaimsRequest; + static deserializeBinaryFromReader(message: TransferProposalClaimsRequest, reader: jspb.BinaryReader): TransferProposalClaimsRequest; +} + +export namespace TransferProposalClaimsRequest { + export type AsObject = { + messageType: string, + assetAssetId: string, + assetProfileId: string, + verifiedOriginatorEntityId: string, + verifiedBeneficiaryEntityId: string, + originatorPubkey: string, + beneficiaryPubkey: string, + senderGatewayNetworkId: string, + recipientGatewayNetworkId: string, + clientIdentityPubkey: string, + serverIdentityPubkey: string, + senderGatewayOwnerId: string, + receiverGatewayOwnerId: string, + } +} + +export class TransferProposalReceiptRequest extends jspb.Message { + getMessageType(): string; + setMessageType(value: string): TransferProposalReceiptRequest; + getAssetAssetId(): string; + setAssetAssetId(value: string): TransferProposalReceiptRequest; + getAssetProfileId(): string; + setAssetProfileId(value: string): TransferProposalReceiptRequest; + getVerifiedOriginatorEntityId(): string; + setVerifiedOriginatorEntityId(value: string): TransferProposalReceiptRequest; + getVerifiedBeneficiaryEntityId(): string; + setVerifiedBeneficiaryEntityId(value: string): TransferProposalReceiptRequest; + getOriginatorPubkey(): string; + setOriginatorPubkey(value: string): TransferProposalReceiptRequest; + getBeneficiaryPubkey(): string; + setBeneficiaryPubkey(value: string): TransferProposalReceiptRequest; + getSenderGatewayNetworkId(): string; + setSenderGatewayNetworkId(value: string): TransferProposalReceiptRequest; + getRecipientGatewayNetworkId(): string; + setRecipientGatewayNetworkId(value: string): TransferProposalReceiptRequest; + getClientIdentityPubkey(): string; + setClientIdentityPubkey(value: string): TransferProposalReceiptRequest; + getServerIdentityPubkey(): string; + setServerIdentityPubkey(value: string): TransferProposalReceiptRequest; + getSenderGatewayOwnerId(): string; + setSenderGatewayOwnerId(value: string): TransferProposalReceiptRequest; + getReceiverGatewayOwnerId(): string; + setReceiverGatewayOwnerId(value: string): TransferProposalReceiptRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TransferProposalReceiptRequest.AsObject; + static toObject(includeInstance: boolean, msg: TransferProposalReceiptRequest): TransferProposalReceiptRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: TransferProposalReceiptRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TransferProposalReceiptRequest; + static deserializeBinaryFromReader(message: TransferProposalReceiptRequest, reader: jspb.BinaryReader): TransferProposalReceiptRequest; +} + +export namespace TransferProposalReceiptRequest { + export type AsObject = { + messageType: string, + assetAssetId: string, + assetProfileId: string, + verifiedOriginatorEntityId: string, + verifiedBeneficiaryEntityId: string, + originatorPubkey: string, + beneficiaryPubkey: string, + senderGatewayNetworkId: string, + recipientGatewayNetworkId: string, + clientIdentityPubkey: string, + serverIdentityPubkey: string, + senderGatewayOwnerId: string, + receiverGatewayOwnerId: string, + } +} + +export class TransferCommenceRequest extends jspb.Message { + getMessageType(): string; + setMessageType(value: string): TransferCommenceRequest; + getSessionId(): string; + setSessionId(value: string): TransferCommenceRequest; + getTransferContextId(): string; + setTransferContextId(value: string): TransferCommenceRequest; + getClientIdentityPubkey(): string; + setClientIdentityPubkey(value: string): TransferCommenceRequest; + getServerIdentityPubkey(): string; + setServerIdentityPubkey(value: string): TransferCommenceRequest; + getHashTransferInitClaims(): string; + setHashTransferInitClaims(value: string): TransferCommenceRequest; + getHashPrevMessage(): string; + setHashPrevMessage(value: string): TransferCommenceRequest; + getClientTransferNumber(): string; + setClientTransferNumber(value: string): TransferCommenceRequest; + getClientSignature(): string; + setClientSignature(value: string): TransferCommenceRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TransferCommenceRequest.AsObject; + static toObject(includeInstance: boolean, msg: TransferCommenceRequest): TransferCommenceRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: TransferCommenceRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TransferCommenceRequest; + static deserializeBinaryFromReader(message: TransferCommenceRequest, reader: jspb.BinaryReader): TransferCommenceRequest; +} + +export namespace TransferCommenceRequest { + export type AsObject = { + messageType: string, + sessionId: string, + transferContextId: string, + clientIdentityPubkey: string, + serverIdentityPubkey: string, + hashTransferInitClaims: string, + hashPrevMessage: string, + clientTransferNumber: string, + clientSignature: string, + } +} + +export class AckCommenceRequest extends jspb.Message { + getMessageType(): string; + setMessageType(value: string): AckCommenceRequest; + getSessionId(): string; + setSessionId(value: string): AckCommenceRequest; + getTransferContextId(): string; + setTransferContextId(value: string): AckCommenceRequest; + getClientIdentityPubkey(): string; + setClientIdentityPubkey(value: string): AckCommenceRequest; + getServerIdentityPubkey(): string; + setServerIdentityPubkey(value: string): AckCommenceRequest; + getHashPrevMessage(): string; + setHashPrevMessage(value: string): AckCommenceRequest; + getServerTransferNumber(): string; + setServerTransferNumber(value: string): AckCommenceRequest; + getServerSignature(): string; + setServerSignature(value: string): AckCommenceRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AckCommenceRequest.AsObject; + static toObject(includeInstance: boolean, msg: AckCommenceRequest): AckCommenceRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AckCommenceRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AckCommenceRequest; + static deserializeBinaryFromReader(message: AckCommenceRequest, reader: jspb.BinaryReader): AckCommenceRequest; +} + +export namespace AckCommenceRequest { + export type AsObject = { + messageType: string, + sessionId: string, + transferContextId: string, + clientIdentityPubkey: string, + serverIdentityPubkey: string, + hashPrevMessage: string, + serverTransferNumber: string, + serverSignature: string, + } +} + +export class SendAssetStatusRequest extends jspb.Message { + getMessageType(): string; + setMessageType(value: string): SendAssetStatusRequest; + getSessionId(): string; + setSessionId(value: string): SendAssetStatusRequest; + getTransferContextId(): string; + setTransferContextId(value: string): SendAssetStatusRequest; + getClientIdentityPubkey(): string; + setClientIdentityPubkey(value: string): SendAssetStatusRequest; + getServerIdentityPubkey(): string; + setServerIdentityPubkey(value: string): SendAssetStatusRequest; + getHashPrevMessage(): string; + setHashPrevMessage(value: string): SendAssetStatusRequest; + getServerTransferNumber(): string; + setServerTransferNumber(value: string): SendAssetStatusRequest; + getServerSignature(): string; + setServerSignature(value: string): SendAssetStatusRequest; + getStatus(): string; + setStatus(value: string): SendAssetStatusRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SendAssetStatusRequest.AsObject; + static toObject(includeInstance: boolean, msg: SendAssetStatusRequest): SendAssetStatusRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SendAssetStatusRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SendAssetStatusRequest; + static deserializeBinaryFromReader(message: SendAssetStatusRequest, reader: jspb.BinaryReader): SendAssetStatusRequest; +} + +export namespace SendAssetStatusRequest { + export type AsObject = { + messageType: string, + sessionId: string, + transferContextId: string, + clientIdentityPubkey: string, + serverIdentityPubkey: string, + hashPrevMessage: string, + serverTransferNumber: string, + serverSignature: string, + status: string, + } +} + +export class LockAssertionRequest extends jspb.Message { + getMessageType(): string; + setMessageType(value: string): LockAssertionRequest; + getSessionId(): string; + setSessionId(value: string): LockAssertionRequest; + getTransferContextId(): string; + setTransferContextId(value: string): LockAssertionRequest; + getClientIdentityPubkey(): string; + setClientIdentityPubkey(value: string): LockAssertionRequest; + getServerIdentityPubkey(): string; + setServerIdentityPubkey(value: string): LockAssertionRequest; + getLockAssertionClaim(): string; + setLockAssertionClaim(value: string): LockAssertionRequest; + getLockAssertionClaimFormat(): string; + setLockAssertionClaimFormat(value: string): LockAssertionRequest; + getLockAssertionExpiration(): string; + setLockAssertionExpiration(value: string): LockAssertionRequest; + getHashPrevMessage(): string; + setHashPrevMessage(value: string): LockAssertionRequest; + getClientTransferNumber(): string; + setClientTransferNumber(value: string): LockAssertionRequest; + getClientSignature(): string; + setClientSignature(value: string): LockAssertionRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): LockAssertionRequest.AsObject; + static toObject(includeInstance: boolean, msg: LockAssertionRequest): LockAssertionRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: LockAssertionRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): LockAssertionRequest; + static deserializeBinaryFromReader(message: LockAssertionRequest, reader: jspb.BinaryReader): LockAssertionRequest; +} + +export namespace LockAssertionRequest { + export type AsObject = { + messageType: string, + sessionId: string, + transferContextId: string, + clientIdentityPubkey: string, + serverIdentityPubkey: string, + lockAssertionClaim: string, + lockAssertionClaimFormat: string, + lockAssertionExpiration: string, + hashPrevMessage: string, + clientTransferNumber: string, + clientSignature: string, + } +} + +export class LockAssertionReceiptRequest extends jspb.Message { + getMessageType(): string; + setMessageType(value: string): LockAssertionReceiptRequest; + getSessionId(): string; + setSessionId(value: string): LockAssertionReceiptRequest; + getTransferContextId(): string; + setTransferContextId(value: string): LockAssertionReceiptRequest; + getClientIdentityPubkey(): string; + setClientIdentityPubkey(value: string): LockAssertionReceiptRequest; + getServerIdentityPubkey(): string; + setServerIdentityPubkey(value: string): LockAssertionReceiptRequest; + getHashPrevMessage(): string; + setHashPrevMessage(value: string): LockAssertionReceiptRequest; + getServerTransferNumber(): string; + setServerTransferNumber(value: string): LockAssertionReceiptRequest; + getServerSignature(): string; + setServerSignature(value: string): LockAssertionReceiptRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): LockAssertionReceiptRequest.AsObject; + static toObject(includeInstance: boolean, msg: LockAssertionReceiptRequest): LockAssertionReceiptRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: LockAssertionReceiptRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): LockAssertionReceiptRequest; + static deserializeBinaryFromReader(message: LockAssertionReceiptRequest, reader: jspb.BinaryReader): LockAssertionReceiptRequest; +} + +export namespace LockAssertionReceiptRequest { + export type AsObject = { + messageType: string, + sessionId: string, + transferContextId: string, + clientIdentityPubkey: string, + serverIdentityPubkey: string, + hashPrevMessage: string, + serverTransferNumber: string, + serverSignature: string, + } +} + +export class CommitPrepareRequest extends jspb.Message { + getMessageType(): string; + setMessageType(value: string): CommitPrepareRequest; + getSessionId(): string; + setSessionId(value: string): CommitPrepareRequest; + getTransferContextId(): string; + setTransferContextId(value: string): CommitPrepareRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): CommitPrepareRequest.AsObject; + static toObject(includeInstance: boolean, msg: CommitPrepareRequest): CommitPrepareRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: CommitPrepareRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): CommitPrepareRequest; + static deserializeBinaryFromReader(message: CommitPrepareRequest, reader: jspb.BinaryReader): CommitPrepareRequest; +} + +export namespace CommitPrepareRequest { + export type AsObject = { + messageType: string, + sessionId: string, + transferContextId: string, + } +} + +export class CommitReadyRequest extends jspb.Message { + getMessageType(): string; + setMessageType(value: string): CommitReadyRequest; + getSessionId(): string; + setSessionId(value: string): CommitReadyRequest; + getTransferContextId(): string; + setTransferContextId(value: string): CommitReadyRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): CommitReadyRequest.AsObject; + static toObject(includeInstance: boolean, msg: CommitReadyRequest): CommitReadyRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: CommitReadyRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): CommitReadyRequest; + static deserializeBinaryFromReader(message: CommitReadyRequest, reader: jspb.BinaryReader): CommitReadyRequest; +} + +export namespace CommitReadyRequest { + export type AsObject = { + messageType: string, + sessionId: string, + transferContextId: string, + } +} + +export class CommitFinalAssertionRequest extends jspb.Message { + getMessageType(): string; + setMessageType(value: string): CommitFinalAssertionRequest; + getSessionId(): string; + setSessionId(value: string): CommitFinalAssertionRequest; + getTransferContextId(): string; + setTransferContextId(value: string): CommitFinalAssertionRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): CommitFinalAssertionRequest.AsObject; + static toObject(includeInstance: boolean, msg: CommitFinalAssertionRequest): CommitFinalAssertionRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: CommitFinalAssertionRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): CommitFinalAssertionRequest; + static deserializeBinaryFromReader(message: CommitFinalAssertionRequest, reader: jspb.BinaryReader): CommitFinalAssertionRequest; +} + +export namespace CommitFinalAssertionRequest { + export type AsObject = { + messageType: string, + sessionId: string, + transferContextId: string, + } +} + +export class AckFinalReceiptRequest extends jspb.Message { + getMessageType(): string; + setMessageType(value: string): AckFinalReceiptRequest; + getSessionId(): string; + setSessionId(value: string): AckFinalReceiptRequest; + getTransferContextId(): string; + setTransferContextId(value: string): AckFinalReceiptRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AckFinalReceiptRequest.AsObject; + static toObject(includeInstance: boolean, msg: AckFinalReceiptRequest): AckFinalReceiptRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AckFinalReceiptRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AckFinalReceiptRequest; + static deserializeBinaryFromReader(message: AckFinalReceiptRequest, reader: jspb.BinaryReader): AckFinalReceiptRequest; +} + +export namespace AckFinalReceiptRequest { + export type AsObject = { + messageType: string, + sessionId: string, + transferContextId: string, + } +} + +export class TransferCompletedRequest extends jspb.Message { + getMessageType(): string; + setMessageType(value: string): TransferCompletedRequest; + getSessionId(): string; + setSessionId(value: string): TransferCompletedRequest; + getTransferContextId(): string; + setTransferContextId(value: string): TransferCompletedRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TransferCompletedRequest.AsObject; + static toObject(includeInstance: boolean, msg: TransferCompletedRequest): TransferCompletedRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: TransferCompletedRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TransferCompletedRequest; + static deserializeBinaryFromReader(message: TransferCompletedRequest, reader: jspb.BinaryReader): TransferCompletedRequest; +} + +export namespace TransferCompletedRequest { + export type AsObject = { + messageType: string, + sessionId: string, + transferContextId: string, + } +} diff --git a/weaver/common/protos-js/relay/satp_pb.js b/weaver/common/protos-js/relay/satp_pb.js new file mode 100644 index 00000000000..c238bfd3266 --- /dev/null +++ b/weaver/common/protos-js/relay/satp_pb.js @@ -0,0 +1,4070 @@ +// source: relay/satp.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +var common_ack_pb = require('../common/ack_pb.js'); +goog.object.extend(proto, common_ack_pb); +goog.exportSymbol('proto.relay.satp.AckCommenceRequest', null, global); +goog.exportSymbol('proto.relay.satp.AckFinalReceiptRequest', null, global); +goog.exportSymbol('proto.relay.satp.CommitFinalAssertionRequest', null, global); +goog.exportSymbol('proto.relay.satp.CommitPrepareRequest', null, global); +goog.exportSymbol('proto.relay.satp.CommitReadyRequest', null, global); +goog.exportSymbol('proto.relay.satp.LockAssertionReceiptRequest', null, global); +goog.exportSymbol('proto.relay.satp.LockAssertionRequest', null, global); +goog.exportSymbol('proto.relay.satp.SendAssetStatusRequest', null, global); +goog.exportSymbol('proto.relay.satp.TransferCommenceRequest', null, global); +goog.exportSymbol('proto.relay.satp.TransferCompletedRequest', null, global); +goog.exportSymbol('proto.relay.satp.TransferProposalClaimsRequest', null, global); +goog.exportSymbol('proto.relay.satp.TransferProposalReceiptRequest', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.relay.satp.TransferProposalClaimsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.relay.satp.TransferProposalClaimsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.relay.satp.TransferProposalClaimsRequest.displayName = 'proto.relay.satp.TransferProposalClaimsRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.relay.satp.TransferProposalReceiptRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.relay.satp.TransferProposalReceiptRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.relay.satp.TransferProposalReceiptRequest.displayName = 'proto.relay.satp.TransferProposalReceiptRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.relay.satp.TransferCommenceRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.relay.satp.TransferCommenceRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.relay.satp.TransferCommenceRequest.displayName = 'proto.relay.satp.TransferCommenceRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.relay.satp.AckCommenceRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.relay.satp.AckCommenceRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.relay.satp.AckCommenceRequest.displayName = 'proto.relay.satp.AckCommenceRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.relay.satp.SendAssetStatusRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.relay.satp.SendAssetStatusRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.relay.satp.SendAssetStatusRequest.displayName = 'proto.relay.satp.SendAssetStatusRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.relay.satp.LockAssertionRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.relay.satp.LockAssertionRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.relay.satp.LockAssertionRequest.displayName = 'proto.relay.satp.LockAssertionRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.relay.satp.LockAssertionReceiptRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.relay.satp.LockAssertionReceiptRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.relay.satp.LockAssertionReceiptRequest.displayName = 'proto.relay.satp.LockAssertionReceiptRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.relay.satp.CommitPrepareRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.relay.satp.CommitPrepareRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.relay.satp.CommitPrepareRequest.displayName = 'proto.relay.satp.CommitPrepareRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.relay.satp.CommitReadyRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.relay.satp.CommitReadyRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.relay.satp.CommitReadyRequest.displayName = 'proto.relay.satp.CommitReadyRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.relay.satp.CommitFinalAssertionRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.relay.satp.CommitFinalAssertionRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.relay.satp.CommitFinalAssertionRequest.displayName = 'proto.relay.satp.CommitFinalAssertionRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.relay.satp.AckFinalReceiptRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.relay.satp.AckFinalReceiptRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.relay.satp.AckFinalReceiptRequest.displayName = 'proto.relay.satp.AckFinalReceiptRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.relay.satp.TransferCompletedRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.relay.satp.TransferCompletedRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.relay.satp.TransferCompletedRequest.displayName = 'proto.relay.satp.TransferCompletedRequest'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.relay.satp.TransferProposalClaimsRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.relay.satp.TransferProposalClaimsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.relay.satp.TransferProposalClaimsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + messageType: jspb.Message.getFieldWithDefault(msg, 1, ""), + assetAssetId: jspb.Message.getFieldWithDefault(msg, 2, ""), + assetProfileId: jspb.Message.getFieldWithDefault(msg, 3, ""), + verifiedOriginatorEntityId: jspb.Message.getFieldWithDefault(msg, 4, ""), + verifiedBeneficiaryEntityId: jspb.Message.getFieldWithDefault(msg, 5, ""), + originatorPubkey: jspb.Message.getFieldWithDefault(msg, 6, ""), + beneficiaryPubkey: jspb.Message.getFieldWithDefault(msg, 7, ""), + senderGatewayNetworkId: jspb.Message.getFieldWithDefault(msg, 8, ""), + recipientGatewayNetworkId: jspb.Message.getFieldWithDefault(msg, 9, ""), + clientIdentityPubkey: jspb.Message.getFieldWithDefault(msg, 10, ""), + serverIdentityPubkey: jspb.Message.getFieldWithDefault(msg, 11, ""), + senderGatewayOwnerId: jspb.Message.getFieldWithDefault(msg, 12, ""), + receiverGatewayOwnerId: jspb.Message.getFieldWithDefault(msg, 13, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.relay.satp.TransferProposalClaimsRequest} + */ +proto.relay.satp.TransferProposalClaimsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.relay.satp.TransferProposalClaimsRequest; + return proto.relay.satp.TransferProposalClaimsRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.relay.satp.TransferProposalClaimsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.relay.satp.TransferProposalClaimsRequest} + */ +proto.relay.satp.TransferProposalClaimsRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setMessageType(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setAssetAssetId(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setAssetProfileId(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setVerifiedOriginatorEntityId(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setVerifiedBeneficiaryEntityId(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setOriginatorPubkey(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setBeneficiaryPubkey(value); + break; + case 8: + var value = /** @type {string} */ (reader.readString()); + msg.setSenderGatewayNetworkId(value); + break; + case 9: + var value = /** @type {string} */ (reader.readString()); + msg.setRecipientGatewayNetworkId(value); + break; + case 10: + var value = /** @type {string} */ (reader.readString()); + msg.setClientIdentityPubkey(value); + break; + case 11: + var value = /** @type {string} */ (reader.readString()); + msg.setServerIdentityPubkey(value); + break; + case 12: + var value = /** @type {string} */ (reader.readString()); + msg.setSenderGatewayOwnerId(value); + break; + case 13: + var value = /** @type {string} */ (reader.readString()); + msg.setReceiverGatewayOwnerId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.relay.satp.TransferProposalClaimsRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.relay.satp.TransferProposalClaimsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.relay.satp.TransferProposalClaimsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMessageType(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getAssetAssetId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getAssetProfileId(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getVerifiedOriginatorEntityId(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getVerifiedBeneficiaryEntityId(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getOriginatorPubkey(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getBeneficiaryPubkey(); + if (f.length > 0) { + writer.writeString( + 7, + f + ); + } + f = message.getSenderGatewayNetworkId(); + if (f.length > 0) { + writer.writeString( + 8, + f + ); + } + f = message.getRecipientGatewayNetworkId(); + if (f.length > 0) { + writer.writeString( + 9, + f + ); + } + f = message.getClientIdentityPubkey(); + if (f.length > 0) { + writer.writeString( + 10, + f + ); + } + f = message.getServerIdentityPubkey(); + if (f.length > 0) { + writer.writeString( + 11, + f + ); + } + f = message.getSenderGatewayOwnerId(); + if (f.length > 0) { + writer.writeString( + 12, + f + ); + } + f = message.getReceiverGatewayOwnerId(); + if (f.length > 0) { + writer.writeString( + 13, + f + ); + } +}; + + +/** + * optional string message_type = 1; + * @return {string} + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.getMessageType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalClaimsRequest} returns this + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.setMessageType = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string asset_asset_id = 2; + * @return {string} + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.getAssetAssetId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalClaimsRequest} returns this + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.setAssetAssetId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string asset_profile_id = 3; + * @return {string} + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.getAssetProfileId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalClaimsRequest} returns this + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.setAssetProfileId = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string verified_originator_entity_id = 4; + * @return {string} + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.getVerifiedOriginatorEntityId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalClaimsRequest} returns this + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.setVerifiedOriginatorEntityId = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string verified_beneficiary_entity_id = 5; + * @return {string} + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.getVerifiedBeneficiaryEntityId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalClaimsRequest} returns this + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.setVerifiedBeneficiaryEntityId = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string originator_pubkey = 6; + * @return {string} + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.getOriginatorPubkey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalClaimsRequest} returns this + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.setOriginatorPubkey = function(value) { + return jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional string beneficiary_pubkey = 7; + * @return {string} + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.getBeneficiaryPubkey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalClaimsRequest} returns this + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.setBeneficiaryPubkey = function(value) { + return jspb.Message.setProto3StringField(this, 7, value); +}; + + +/** + * optional string sender_gateway_network_id = 8; + * @return {string} + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.getSenderGatewayNetworkId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalClaimsRequest} returns this + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.setSenderGatewayNetworkId = function(value) { + return jspb.Message.setProto3StringField(this, 8, value); +}; + + +/** + * optional string recipient_gateway_network_id = 9; + * @return {string} + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.getRecipientGatewayNetworkId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalClaimsRequest} returns this + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.setRecipientGatewayNetworkId = function(value) { + return jspb.Message.setProto3StringField(this, 9, value); +}; + + +/** + * optional string client_identity_pubkey = 10; + * @return {string} + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.getClientIdentityPubkey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 10, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalClaimsRequest} returns this + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.setClientIdentityPubkey = function(value) { + return jspb.Message.setProto3StringField(this, 10, value); +}; + + +/** + * optional string server_identity_pubkey = 11; + * @return {string} + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.getServerIdentityPubkey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 11, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalClaimsRequest} returns this + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.setServerIdentityPubkey = function(value) { + return jspb.Message.setProto3StringField(this, 11, value); +}; + + +/** + * optional string sender_gateway_owner_id = 12; + * @return {string} + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.getSenderGatewayOwnerId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 12, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalClaimsRequest} returns this + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.setSenderGatewayOwnerId = function(value) { + return jspb.Message.setProto3StringField(this, 12, value); +}; + + +/** + * optional string receiver_gateway_owner_id = 13; + * @return {string} + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.getReceiverGatewayOwnerId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 13, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalClaimsRequest} returns this + */ +proto.relay.satp.TransferProposalClaimsRequest.prototype.setReceiverGatewayOwnerId = function(value) { + return jspb.Message.setProto3StringField(this, 13, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.toObject = function(opt_includeInstance) { + return proto.relay.satp.TransferProposalReceiptRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.relay.satp.TransferProposalReceiptRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.relay.satp.TransferProposalReceiptRequest.toObject = function(includeInstance, msg) { + var f, obj = { + messageType: jspb.Message.getFieldWithDefault(msg, 1, ""), + assetAssetId: jspb.Message.getFieldWithDefault(msg, 2, ""), + assetProfileId: jspb.Message.getFieldWithDefault(msg, 3, ""), + verifiedOriginatorEntityId: jspb.Message.getFieldWithDefault(msg, 4, ""), + verifiedBeneficiaryEntityId: jspb.Message.getFieldWithDefault(msg, 5, ""), + originatorPubkey: jspb.Message.getFieldWithDefault(msg, 6, ""), + beneficiaryPubkey: jspb.Message.getFieldWithDefault(msg, 7, ""), + senderGatewayNetworkId: jspb.Message.getFieldWithDefault(msg, 8, ""), + recipientGatewayNetworkId: jspb.Message.getFieldWithDefault(msg, 9, ""), + clientIdentityPubkey: jspb.Message.getFieldWithDefault(msg, 10, ""), + serverIdentityPubkey: jspb.Message.getFieldWithDefault(msg, 11, ""), + senderGatewayOwnerId: jspb.Message.getFieldWithDefault(msg, 12, ""), + receiverGatewayOwnerId: jspb.Message.getFieldWithDefault(msg, 13, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.relay.satp.TransferProposalReceiptRequest} + */ +proto.relay.satp.TransferProposalReceiptRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.relay.satp.TransferProposalReceiptRequest; + return proto.relay.satp.TransferProposalReceiptRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.relay.satp.TransferProposalReceiptRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.relay.satp.TransferProposalReceiptRequest} + */ +proto.relay.satp.TransferProposalReceiptRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setMessageType(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setAssetAssetId(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setAssetProfileId(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setVerifiedOriginatorEntityId(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setVerifiedBeneficiaryEntityId(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setOriginatorPubkey(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setBeneficiaryPubkey(value); + break; + case 8: + var value = /** @type {string} */ (reader.readString()); + msg.setSenderGatewayNetworkId(value); + break; + case 9: + var value = /** @type {string} */ (reader.readString()); + msg.setRecipientGatewayNetworkId(value); + break; + case 10: + var value = /** @type {string} */ (reader.readString()); + msg.setClientIdentityPubkey(value); + break; + case 11: + var value = /** @type {string} */ (reader.readString()); + msg.setServerIdentityPubkey(value); + break; + case 12: + var value = /** @type {string} */ (reader.readString()); + msg.setSenderGatewayOwnerId(value); + break; + case 13: + var value = /** @type {string} */ (reader.readString()); + msg.setReceiverGatewayOwnerId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.relay.satp.TransferProposalReceiptRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.relay.satp.TransferProposalReceiptRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.relay.satp.TransferProposalReceiptRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMessageType(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getAssetAssetId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getAssetProfileId(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getVerifiedOriginatorEntityId(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getVerifiedBeneficiaryEntityId(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getOriginatorPubkey(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getBeneficiaryPubkey(); + if (f.length > 0) { + writer.writeString( + 7, + f + ); + } + f = message.getSenderGatewayNetworkId(); + if (f.length > 0) { + writer.writeString( + 8, + f + ); + } + f = message.getRecipientGatewayNetworkId(); + if (f.length > 0) { + writer.writeString( + 9, + f + ); + } + f = message.getClientIdentityPubkey(); + if (f.length > 0) { + writer.writeString( + 10, + f + ); + } + f = message.getServerIdentityPubkey(); + if (f.length > 0) { + writer.writeString( + 11, + f + ); + } + f = message.getSenderGatewayOwnerId(); + if (f.length > 0) { + writer.writeString( + 12, + f + ); + } + f = message.getReceiverGatewayOwnerId(); + if (f.length > 0) { + writer.writeString( + 13, + f + ); + } +}; + + +/** + * optional string message_type = 1; + * @return {string} + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.getMessageType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalReceiptRequest} returns this + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.setMessageType = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string asset_asset_id = 2; + * @return {string} + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.getAssetAssetId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalReceiptRequest} returns this + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.setAssetAssetId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string asset_profile_id = 3; + * @return {string} + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.getAssetProfileId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalReceiptRequest} returns this + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.setAssetProfileId = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string verified_originator_entity_id = 4; + * @return {string} + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.getVerifiedOriginatorEntityId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalReceiptRequest} returns this + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.setVerifiedOriginatorEntityId = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string verified_beneficiary_entity_id = 5; + * @return {string} + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.getVerifiedBeneficiaryEntityId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalReceiptRequest} returns this + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.setVerifiedBeneficiaryEntityId = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string originator_pubkey = 6; + * @return {string} + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.getOriginatorPubkey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalReceiptRequest} returns this + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.setOriginatorPubkey = function(value) { + return jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional string beneficiary_pubkey = 7; + * @return {string} + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.getBeneficiaryPubkey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalReceiptRequest} returns this + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.setBeneficiaryPubkey = function(value) { + return jspb.Message.setProto3StringField(this, 7, value); +}; + + +/** + * optional string sender_gateway_network_id = 8; + * @return {string} + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.getSenderGatewayNetworkId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalReceiptRequest} returns this + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.setSenderGatewayNetworkId = function(value) { + return jspb.Message.setProto3StringField(this, 8, value); +}; + + +/** + * optional string recipient_gateway_network_id = 9; + * @return {string} + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.getRecipientGatewayNetworkId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalReceiptRequest} returns this + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.setRecipientGatewayNetworkId = function(value) { + return jspb.Message.setProto3StringField(this, 9, value); +}; + + +/** + * optional string client_identity_pubkey = 10; + * @return {string} + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.getClientIdentityPubkey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 10, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalReceiptRequest} returns this + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.setClientIdentityPubkey = function(value) { + return jspb.Message.setProto3StringField(this, 10, value); +}; + + +/** + * optional string server_identity_pubkey = 11; + * @return {string} + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.getServerIdentityPubkey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 11, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalReceiptRequest} returns this + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.setServerIdentityPubkey = function(value) { + return jspb.Message.setProto3StringField(this, 11, value); +}; + + +/** + * optional string sender_gateway_owner_id = 12; + * @return {string} + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.getSenderGatewayOwnerId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 12, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalReceiptRequest} returns this + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.setSenderGatewayOwnerId = function(value) { + return jspb.Message.setProto3StringField(this, 12, value); +}; + + +/** + * optional string receiver_gateway_owner_id = 13; + * @return {string} + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.getReceiverGatewayOwnerId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 13, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferProposalReceiptRequest} returns this + */ +proto.relay.satp.TransferProposalReceiptRequest.prototype.setReceiverGatewayOwnerId = function(value) { + return jspb.Message.setProto3StringField(this, 13, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.relay.satp.TransferCommenceRequest.prototype.toObject = function(opt_includeInstance) { + return proto.relay.satp.TransferCommenceRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.relay.satp.TransferCommenceRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.relay.satp.TransferCommenceRequest.toObject = function(includeInstance, msg) { + var f, obj = { + messageType: jspb.Message.getFieldWithDefault(msg, 1, ""), + sessionId: jspb.Message.getFieldWithDefault(msg, 2, ""), + transferContextId: jspb.Message.getFieldWithDefault(msg, 3, ""), + clientIdentityPubkey: jspb.Message.getFieldWithDefault(msg, 4, ""), + serverIdentityPubkey: jspb.Message.getFieldWithDefault(msg, 5, ""), + hashTransferInitClaims: jspb.Message.getFieldWithDefault(msg, 6, ""), + hashPrevMessage: jspb.Message.getFieldWithDefault(msg, 7, ""), + clientTransferNumber: jspb.Message.getFieldWithDefault(msg, 8, ""), + clientSignature: jspb.Message.getFieldWithDefault(msg, 9, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.relay.satp.TransferCommenceRequest} + */ +proto.relay.satp.TransferCommenceRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.relay.satp.TransferCommenceRequest; + return proto.relay.satp.TransferCommenceRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.relay.satp.TransferCommenceRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.relay.satp.TransferCommenceRequest} + */ +proto.relay.satp.TransferCommenceRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setMessageType(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setSessionId(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setTransferContextId(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setClientIdentityPubkey(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setServerIdentityPubkey(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setHashTransferInitClaims(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setHashPrevMessage(value); + break; + case 8: + var value = /** @type {string} */ (reader.readString()); + msg.setClientTransferNumber(value); + break; + case 9: + var value = /** @type {string} */ (reader.readString()); + msg.setClientSignature(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.relay.satp.TransferCommenceRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.relay.satp.TransferCommenceRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.relay.satp.TransferCommenceRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.relay.satp.TransferCommenceRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMessageType(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getSessionId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getTransferContextId(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getClientIdentityPubkey(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getServerIdentityPubkey(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getHashTransferInitClaims(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getHashPrevMessage(); + if (f.length > 0) { + writer.writeString( + 7, + f + ); + } + f = message.getClientTransferNumber(); + if (f.length > 0) { + writer.writeString( + 8, + f + ); + } + f = message.getClientSignature(); + if (f.length > 0) { + writer.writeString( + 9, + f + ); + } +}; + + +/** + * optional string message_type = 1; + * @return {string} + */ +proto.relay.satp.TransferCommenceRequest.prototype.getMessageType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferCommenceRequest} returns this + */ +proto.relay.satp.TransferCommenceRequest.prototype.setMessageType = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string session_id = 2; + * @return {string} + */ +proto.relay.satp.TransferCommenceRequest.prototype.getSessionId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferCommenceRequest} returns this + */ +proto.relay.satp.TransferCommenceRequest.prototype.setSessionId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string transfer_context_id = 3; + * @return {string} + */ +proto.relay.satp.TransferCommenceRequest.prototype.getTransferContextId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferCommenceRequest} returns this + */ +proto.relay.satp.TransferCommenceRequest.prototype.setTransferContextId = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string client_identity_pubkey = 4; + * @return {string} + */ +proto.relay.satp.TransferCommenceRequest.prototype.getClientIdentityPubkey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferCommenceRequest} returns this + */ +proto.relay.satp.TransferCommenceRequest.prototype.setClientIdentityPubkey = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string server_identity_pubkey = 5; + * @return {string} + */ +proto.relay.satp.TransferCommenceRequest.prototype.getServerIdentityPubkey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferCommenceRequest} returns this + */ +proto.relay.satp.TransferCommenceRequest.prototype.setServerIdentityPubkey = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string hash_transfer_init_claims = 6; + * @return {string} + */ +proto.relay.satp.TransferCommenceRequest.prototype.getHashTransferInitClaims = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferCommenceRequest} returns this + */ +proto.relay.satp.TransferCommenceRequest.prototype.setHashTransferInitClaims = function(value) { + return jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional string hash_prev_message = 7; + * @return {string} + */ +proto.relay.satp.TransferCommenceRequest.prototype.getHashPrevMessage = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferCommenceRequest} returns this + */ +proto.relay.satp.TransferCommenceRequest.prototype.setHashPrevMessage = function(value) { + return jspb.Message.setProto3StringField(this, 7, value); +}; + + +/** + * optional string client_transfer_number = 8; + * @return {string} + */ +proto.relay.satp.TransferCommenceRequest.prototype.getClientTransferNumber = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferCommenceRequest} returns this + */ +proto.relay.satp.TransferCommenceRequest.prototype.setClientTransferNumber = function(value) { + return jspb.Message.setProto3StringField(this, 8, value); +}; + + +/** + * optional string client_signature = 9; + * @return {string} + */ +proto.relay.satp.TransferCommenceRequest.prototype.getClientSignature = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferCommenceRequest} returns this + */ +proto.relay.satp.TransferCommenceRequest.prototype.setClientSignature = function(value) { + return jspb.Message.setProto3StringField(this, 9, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.relay.satp.AckCommenceRequest.prototype.toObject = function(opt_includeInstance) { + return proto.relay.satp.AckCommenceRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.relay.satp.AckCommenceRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.relay.satp.AckCommenceRequest.toObject = function(includeInstance, msg) { + var f, obj = { + messageType: jspb.Message.getFieldWithDefault(msg, 1, ""), + sessionId: jspb.Message.getFieldWithDefault(msg, 2, ""), + transferContextId: jspb.Message.getFieldWithDefault(msg, 3, ""), + clientIdentityPubkey: jspb.Message.getFieldWithDefault(msg, 4, ""), + serverIdentityPubkey: jspb.Message.getFieldWithDefault(msg, 5, ""), + hashPrevMessage: jspb.Message.getFieldWithDefault(msg, 6, ""), + serverTransferNumber: jspb.Message.getFieldWithDefault(msg, 7, ""), + serverSignature: jspb.Message.getFieldWithDefault(msg, 8, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.relay.satp.AckCommenceRequest} + */ +proto.relay.satp.AckCommenceRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.relay.satp.AckCommenceRequest; + return proto.relay.satp.AckCommenceRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.relay.satp.AckCommenceRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.relay.satp.AckCommenceRequest} + */ +proto.relay.satp.AckCommenceRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setMessageType(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setSessionId(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setTransferContextId(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setClientIdentityPubkey(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setServerIdentityPubkey(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setHashPrevMessage(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setServerTransferNumber(value); + break; + case 8: + var value = /** @type {string} */ (reader.readString()); + msg.setServerSignature(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.relay.satp.AckCommenceRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.relay.satp.AckCommenceRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.relay.satp.AckCommenceRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.relay.satp.AckCommenceRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMessageType(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getSessionId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getTransferContextId(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getClientIdentityPubkey(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getServerIdentityPubkey(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getHashPrevMessage(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getServerTransferNumber(); + if (f.length > 0) { + writer.writeString( + 7, + f + ); + } + f = message.getServerSignature(); + if (f.length > 0) { + writer.writeString( + 8, + f + ); + } +}; + + +/** + * optional string message_type = 1; + * @return {string} + */ +proto.relay.satp.AckCommenceRequest.prototype.getMessageType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.AckCommenceRequest} returns this + */ +proto.relay.satp.AckCommenceRequest.prototype.setMessageType = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string session_id = 2; + * @return {string} + */ +proto.relay.satp.AckCommenceRequest.prototype.getSessionId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.AckCommenceRequest} returns this + */ +proto.relay.satp.AckCommenceRequest.prototype.setSessionId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string transfer_context_id = 3; + * @return {string} + */ +proto.relay.satp.AckCommenceRequest.prototype.getTransferContextId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.AckCommenceRequest} returns this + */ +proto.relay.satp.AckCommenceRequest.prototype.setTransferContextId = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string client_identity_pubkey = 4; + * @return {string} + */ +proto.relay.satp.AckCommenceRequest.prototype.getClientIdentityPubkey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.AckCommenceRequest} returns this + */ +proto.relay.satp.AckCommenceRequest.prototype.setClientIdentityPubkey = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string server_identity_pubkey = 5; + * @return {string} + */ +proto.relay.satp.AckCommenceRequest.prototype.getServerIdentityPubkey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.AckCommenceRequest} returns this + */ +proto.relay.satp.AckCommenceRequest.prototype.setServerIdentityPubkey = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string hash_prev_message = 6; + * @return {string} + */ +proto.relay.satp.AckCommenceRequest.prototype.getHashPrevMessage = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.AckCommenceRequest} returns this + */ +proto.relay.satp.AckCommenceRequest.prototype.setHashPrevMessage = function(value) { + return jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional string server_transfer_number = 7; + * @return {string} + */ +proto.relay.satp.AckCommenceRequest.prototype.getServerTransferNumber = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.AckCommenceRequest} returns this + */ +proto.relay.satp.AckCommenceRequest.prototype.setServerTransferNumber = function(value) { + return jspb.Message.setProto3StringField(this, 7, value); +}; + + +/** + * optional string server_signature = 8; + * @return {string} + */ +proto.relay.satp.AckCommenceRequest.prototype.getServerSignature = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.AckCommenceRequest} returns this + */ +proto.relay.satp.AckCommenceRequest.prototype.setServerSignature = function(value) { + return jspb.Message.setProto3StringField(this, 8, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.relay.satp.SendAssetStatusRequest.prototype.toObject = function(opt_includeInstance) { + return proto.relay.satp.SendAssetStatusRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.relay.satp.SendAssetStatusRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.relay.satp.SendAssetStatusRequest.toObject = function(includeInstance, msg) { + var f, obj = { + messageType: jspb.Message.getFieldWithDefault(msg, 1, ""), + sessionId: jspb.Message.getFieldWithDefault(msg, 2, ""), + transferContextId: jspb.Message.getFieldWithDefault(msg, 3, ""), + clientIdentityPubkey: jspb.Message.getFieldWithDefault(msg, 4, ""), + serverIdentityPubkey: jspb.Message.getFieldWithDefault(msg, 5, ""), + hashPrevMessage: jspb.Message.getFieldWithDefault(msg, 6, ""), + serverTransferNumber: jspb.Message.getFieldWithDefault(msg, 7, ""), + serverSignature: jspb.Message.getFieldWithDefault(msg, 8, ""), + status: jspb.Message.getFieldWithDefault(msg, 9, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.relay.satp.SendAssetStatusRequest} + */ +proto.relay.satp.SendAssetStatusRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.relay.satp.SendAssetStatusRequest; + return proto.relay.satp.SendAssetStatusRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.relay.satp.SendAssetStatusRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.relay.satp.SendAssetStatusRequest} + */ +proto.relay.satp.SendAssetStatusRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setMessageType(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setSessionId(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setTransferContextId(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setClientIdentityPubkey(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setServerIdentityPubkey(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setHashPrevMessage(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setServerTransferNumber(value); + break; + case 8: + var value = /** @type {string} */ (reader.readString()); + msg.setServerSignature(value); + break; + case 9: + var value = /** @type {string} */ (reader.readString()); + msg.setStatus(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.relay.satp.SendAssetStatusRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.relay.satp.SendAssetStatusRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.relay.satp.SendAssetStatusRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.relay.satp.SendAssetStatusRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMessageType(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getSessionId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getTransferContextId(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getClientIdentityPubkey(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getServerIdentityPubkey(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getHashPrevMessage(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getServerTransferNumber(); + if (f.length > 0) { + writer.writeString( + 7, + f + ); + } + f = message.getServerSignature(); + if (f.length > 0) { + writer.writeString( + 8, + f + ); + } + f = message.getStatus(); + if (f.length > 0) { + writer.writeString( + 9, + f + ); + } +}; + + +/** + * optional string message_type = 1; + * @return {string} + */ +proto.relay.satp.SendAssetStatusRequest.prototype.getMessageType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.SendAssetStatusRequest} returns this + */ +proto.relay.satp.SendAssetStatusRequest.prototype.setMessageType = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string session_id = 2; + * @return {string} + */ +proto.relay.satp.SendAssetStatusRequest.prototype.getSessionId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.SendAssetStatusRequest} returns this + */ +proto.relay.satp.SendAssetStatusRequest.prototype.setSessionId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string transfer_context_id = 3; + * @return {string} + */ +proto.relay.satp.SendAssetStatusRequest.prototype.getTransferContextId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.SendAssetStatusRequest} returns this + */ +proto.relay.satp.SendAssetStatusRequest.prototype.setTransferContextId = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string client_identity_pubkey = 4; + * @return {string} + */ +proto.relay.satp.SendAssetStatusRequest.prototype.getClientIdentityPubkey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.SendAssetStatusRequest} returns this + */ +proto.relay.satp.SendAssetStatusRequest.prototype.setClientIdentityPubkey = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string server_identity_pubkey = 5; + * @return {string} + */ +proto.relay.satp.SendAssetStatusRequest.prototype.getServerIdentityPubkey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.SendAssetStatusRequest} returns this + */ +proto.relay.satp.SendAssetStatusRequest.prototype.setServerIdentityPubkey = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string hash_prev_message = 6; + * @return {string} + */ +proto.relay.satp.SendAssetStatusRequest.prototype.getHashPrevMessage = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.SendAssetStatusRequest} returns this + */ +proto.relay.satp.SendAssetStatusRequest.prototype.setHashPrevMessage = function(value) { + return jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional string server_transfer_number = 7; + * @return {string} + */ +proto.relay.satp.SendAssetStatusRequest.prototype.getServerTransferNumber = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.SendAssetStatusRequest} returns this + */ +proto.relay.satp.SendAssetStatusRequest.prototype.setServerTransferNumber = function(value) { + return jspb.Message.setProto3StringField(this, 7, value); +}; + + +/** + * optional string server_signature = 8; + * @return {string} + */ +proto.relay.satp.SendAssetStatusRequest.prototype.getServerSignature = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.SendAssetStatusRequest} returns this + */ +proto.relay.satp.SendAssetStatusRequest.prototype.setServerSignature = function(value) { + return jspb.Message.setProto3StringField(this, 8, value); +}; + + +/** + * optional string status = 9; + * @return {string} + */ +proto.relay.satp.SendAssetStatusRequest.prototype.getStatus = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.SendAssetStatusRequest} returns this + */ +proto.relay.satp.SendAssetStatusRequest.prototype.setStatus = function(value) { + return jspb.Message.setProto3StringField(this, 9, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.relay.satp.LockAssertionRequest.prototype.toObject = function(opt_includeInstance) { + return proto.relay.satp.LockAssertionRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.relay.satp.LockAssertionRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.relay.satp.LockAssertionRequest.toObject = function(includeInstance, msg) { + var f, obj = { + messageType: jspb.Message.getFieldWithDefault(msg, 1, ""), + sessionId: jspb.Message.getFieldWithDefault(msg, 2, ""), + transferContextId: jspb.Message.getFieldWithDefault(msg, 3, ""), + clientIdentityPubkey: jspb.Message.getFieldWithDefault(msg, 4, ""), + serverIdentityPubkey: jspb.Message.getFieldWithDefault(msg, 5, ""), + lockAssertionClaim: jspb.Message.getFieldWithDefault(msg, 6, ""), + lockAssertionClaimFormat: jspb.Message.getFieldWithDefault(msg, 7, ""), + lockAssertionExpiration: jspb.Message.getFieldWithDefault(msg, 8, ""), + hashPrevMessage: jspb.Message.getFieldWithDefault(msg, 9, ""), + clientTransferNumber: jspb.Message.getFieldWithDefault(msg, 10, ""), + clientSignature: jspb.Message.getFieldWithDefault(msg, 11, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.relay.satp.LockAssertionRequest} + */ +proto.relay.satp.LockAssertionRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.relay.satp.LockAssertionRequest; + return proto.relay.satp.LockAssertionRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.relay.satp.LockAssertionRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.relay.satp.LockAssertionRequest} + */ +proto.relay.satp.LockAssertionRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setMessageType(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setSessionId(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setTransferContextId(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setClientIdentityPubkey(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setServerIdentityPubkey(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setLockAssertionClaim(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setLockAssertionClaimFormat(value); + break; + case 8: + var value = /** @type {string} */ (reader.readString()); + msg.setLockAssertionExpiration(value); + break; + case 9: + var value = /** @type {string} */ (reader.readString()); + msg.setHashPrevMessage(value); + break; + case 10: + var value = /** @type {string} */ (reader.readString()); + msg.setClientTransferNumber(value); + break; + case 11: + var value = /** @type {string} */ (reader.readString()); + msg.setClientSignature(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.relay.satp.LockAssertionRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.relay.satp.LockAssertionRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.relay.satp.LockAssertionRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.relay.satp.LockAssertionRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMessageType(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getSessionId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getTransferContextId(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getClientIdentityPubkey(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getServerIdentityPubkey(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getLockAssertionClaim(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getLockAssertionClaimFormat(); + if (f.length > 0) { + writer.writeString( + 7, + f + ); + } + f = message.getLockAssertionExpiration(); + if (f.length > 0) { + writer.writeString( + 8, + f + ); + } + f = message.getHashPrevMessage(); + if (f.length > 0) { + writer.writeString( + 9, + f + ); + } + f = message.getClientTransferNumber(); + if (f.length > 0) { + writer.writeString( + 10, + f + ); + } + f = message.getClientSignature(); + if (f.length > 0) { + writer.writeString( + 11, + f + ); + } +}; + + +/** + * optional string message_type = 1; + * @return {string} + */ +proto.relay.satp.LockAssertionRequest.prototype.getMessageType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.LockAssertionRequest} returns this + */ +proto.relay.satp.LockAssertionRequest.prototype.setMessageType = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string session_id = 2; + * @return {string} + */ +proto.relay.satp.LockAssertionRequest.prototype.getSessionId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.LockAssertionRequest} returns this + */ +proto.relay.satp.LockAssertionRequest.prototype.setSessionId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string transfer_context_id = 3; + * @return {string} + */ +proto.relay.satp.LockAssertionRequest.prototype.getTransferContextId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.LockAssertionRequest} returns this + */ +proto.relay.satp.LockAssertionRequest.prototype.setTransferContextId = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string client_identity_pubkey = 4; + * @return {string} + */ +proto.relay.satp.LockAssertionRequest.prototype.getClientIdentityPubkey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.LockAssertionRequest} returns this + */ +proto.relay.satp.LockAssertionRequest.prototype.setClientIdentityPubkey = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string server_identity_pubkey = 5; + * @return {string} + */ +proto.relay.satp.LockAssertionRequest.prototype.getServerIdentityPubkey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.LockAssertionRequest} returns this + */ +proto.relay.satp.LockAssertionRequest.prototype.setServerIdentityPubkey = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string lock_assertion_claim = 6; + * @return {string} + */ +proto.relay.satp.LockAssertionRequest.prototype.getLockAssertionClaim = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.LockAssertionRequest} returns this + */ +proto.relay.satp.LockAssertionRequest.prototype.setLockAssertionClaim = function(value) { + return jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional string lock_assertion_claim_format = 7; + * @return {string} + */ +proto.relay.satp.LockAssertionRequest.prototype.getLockAssertionClaimFormat = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.LockAssertionRequest} returns this + */ +proto.relay.satp.LockAssertionRequest.prototype.setLockAssertionClaimFormat = function(value) { + return jspb.Message.setProto3StringField(this, 7, value); +}; + + +/** + * optional string lock_assertion_expiration = 8; + * @return {string} + */ +proto.relay.satp.LockAssertionRequest.prototype.getLockAssertionExpiration = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.LockAssertionRequest} returns this + */ +proto.relay.satp.LockAssertionRequest.prototype.setLockAssertionExpiration = function(value) { + return jspb.Message.setProto3StringField(this, 8, value); +}; + + +/** + * optional string hash_prev_message = 9; + * @return {string} + */ +proto.relay.satp.LockAssertionRequest.prototype.getHashPrevMessage = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.LockAssertionRequest} returns this + */ +proto.relay.satp.LockAssertionRequest.prototype.setHashPrevMessage = function(value) { + return jspb.Message.setProto3StringField(this, 9, value); +}; + + +/** + * optional string client_transfer_number = 10; + * @return {string} + */ +proto.relay.satp.LockAssertionRequest.prototype.getClientTransferNumber = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 10, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.LockAssertionRequest} returns this + */ +proto.relay.satp.LockAssertionRequest.prototype.setClientTransferNumber = function(value) { + return jspb.Message.setProto3StringField(this, 10, value); +}; + + +/** + * optional string client_signature = 11; + * @return {string} + */ +proto.relay.satp.LockAssertionRequest.prototype.getClientSignature = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 11, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.LockAssertionRequest} returns this + */ +proto.relay.satp.LockAssertionRequest.prototype.setClientSignature = function(value) { + return jspb.Message.setProto3StringField(this, 11, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.relay.satp.LockAssertionReceiptRequest.prototype.toObject = function(opt_includeInstance) { + return proto.relay.satp.LockAssertionReceiptRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.relay.satp.LockAssertionReceiptRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.relay.satp.LockAssertionReceiptRequest.toObject = function(includeInstance, msg) { + var f, obj = { + messageType: jspb.Message.getFieldWithDefault(msg, 1, ""), + sessionId: jspb.Message.getFieldWithDefault(msg, 2, ""), + transferContextId: jspb.Message.getFieldWithDefault(msg, 3, ""), + clientIdentityPubkey: jspb.Message.getFieldWithDefault(msg, 4, ""), + serverIdentityPubkey: jspb.Message.getFieldWithDefault(msg, 5, ""), + hashPrevMessage: jspb.Message.getFieldWithDefault(msg, 6, ""), + serverTransferNumber: jspb.Message.getFieldWithDefault(msg, 7, ""), + serverSignature: jspb.Message.getFieldWithDefault(msg, 8, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.relay.satp.LockAssertionReceiptRequest} + */ +proto.relay.satp.LockAssertionReceiptRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.relay.satp.LockAssertionReceiptRequest; + return proto.relay.satp.LockAssertionReceiptRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.relay.satp.LockAssertionReceiptRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.relay.satp.LockAssertionReceiptRequest} + */ +proto.relay.satp.LockAssertionReceiptRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setMessageType(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setSessionId(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setTransferContextId(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setClientIdentityPubkey(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setServerIdentityPubkey(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setHashPrevMessage(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setServerTransferNumber(value); + break; + case 8: + var value = /** @type {string} */ (reader.readString()); + msg.setServerSignature(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.relay.satp.LockAssertionReceiptRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.relay.satp.LockAssertionReceiptRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.relay.satp.LockAssertionReceiptRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.relay.satp.LockAssertionReceiptRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMessageType(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getSessionId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getTransferContextId(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getClientIdentityPubkey(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getServerIdentityPubkey(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getHashPrevMessage(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getServerTransferNumber(); + if (f.length > 0) { + writer.writeString( + 7, + f + ); + } + f = message.getServerSignature(); + if (f.length > 0) { + writer.writeString( + 8, + f + ); + } +}; + + +/** + * optional string message_type = 1; + * @return {string} + */ +proto.relay.satp.LockAssertionReceiptRequest.prototype.getMessageType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.LockAssertionReceiptRequest} returns this + */ +proto.relay.satp.LockAssertionReceiptRequest.prototype.setMessageType = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string session_id = 2; + * @return {string} + */ +proto.relay.satp.LockAssertionReceiptRequest.prototype.getSessionId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.LockAssertionReceiptRequest} returns this + */ +proto.relay.satp.LockAssertionReceiptRequest.prototype.setSessionId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string transfer_context_id = 3; + * @return {string} + */ +proto.relay.satp.LockAssertionReceiptRequest.prototype.getTransferContextId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.LockAssertionReceiptRequest} returns this + */ +proto.relay.satp.LockAssertionReceiptRequest.prototype.setTransferContextId = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string client_identity_pubkey = 4; + * @return {string} + */ +proto.relay.satp.LockAssertionReceiptRequest.prototype.getClientIdentityPubkey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.LockAssertionReceiptRequest} returns this + */ +proto.relay.satp.LockAssertionReceiptRequest.prototype.setClientIdentityPubkey = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string server_identity_pubkey = 5; + * @return {string} + */ +proto.relay.satp.LockAssertionReceiptRequest.prototype.getServerIdentityPubkey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.LockAssertionReceiptRequest} returns this + */ +proto.relay.satp.LockAssertionReceiptRequest.prototype.setServerIdentityPubkey = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string hash_prev_message = 6; + * @return {string} + */ +proto.relay.satp.LockAssertionReceiptRequest.prototype.getHashPrevMessage = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.LockAssertionReceiptRequest} returns this + */ +proto.relay.satp.LockAssertionReceiptRequest.prototype.setHashPrevMessage = function(value) { + return jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional string server_transfer_number = 7; + * @return {string} + */ +proto.relay.satp.LockAssertionReceiptRequest.prototype.getServerTransferNumber = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.LockAssertionReceiptRequest} returns this + */ +proto.relay.satp.LockAssertionReceiptRequest.prototype.setServerTransferNumber = function(value) { + return jspb.Message.setProto3StringField(this, 7, value); +}; + + +/** + * optional string server_signature = 8; + * @return {string} + */ +proto.relay.satp.LockAssertionReceiptRequest.prototype.getServerSignature = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.LockAssertionReceiptRequest} returns this + */ +proto.relay.satp.LockAssertionReceiptRequest.prototype.setServerSignature = function(value) { + return jspb.Message.setProto3StringField(this, 8, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.relay.satp.CommitPrepareRequest.prototype.toObject = function(opt_includeInstance) { + return proto.relay.satp.CommitPrepareRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.relay.satp.CommitPrepareRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.relay.satp.CommitPrepareRequest.toObject = function(includeInstance, msg) { + var f, obj = { + messageType: jspb.Message.getFieldWithDefault(msg, 1, ""), + sessionId: jspb.Message.getFieldWithDefault(msg, 2, ""), + transferContextId: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.relay.satp.CommitPrepareRequest} + */ +proto.relay.satp.CommitPrepareRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.relay.satp.CommitPrepareRequest; + return proto.relay.satp.CommitPrepareRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.relay.satp.CommitPrepareRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.relay.satp.CommitPrepareRequest} + */ +proto.relay.satp.CommitPrepareRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setMessageType(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setSessionId(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setTransferContextId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.relay.satp.CommitPrepareRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.relay.satp.CommitPrepareRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.relay.satp.CommitPrepareRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.relay.satp.CommitPrepareRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMessageType(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getSessionId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getTransferContextId(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional string message_type = 1; + * @return {string} + */ +proto.relay.satp.CommitPrepareRequest.prototype.getMessageType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.CommitPrepareRequest} returns this + */ +proto.relay.satp.CommitPrepareRequest.prototype.setMessageType = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string session_id = 2; + * @return {string} + */ +proto.relay.satp.CommitPrepareRequest.prototype.getSessionId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.CommitPrepareRequest} returns this + */ +proto.relay.satp.CommitPrepareRequest.prototype.setSessionId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string transfer_context_id = 3; + * @return {string} + */ +proto.relay.satp.CommitPrepareRequest.prototype.getTransferContextId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.CommitPrepareRequest} returns this + */ +proto.relay.satp.CommitPrepareRequest.prototype.setTransferContextId = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.relay.satp.CommitReadyRequest.prototype.toObject = function(opt_includeInstance) { + return proto.relay.satp.CommitReadyRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.relay.satp.CommitReadyRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.relay.satp.CommitReadyRequest.toObject = function(includeInstance, msg) { + var f, obj = { + messageType: jspb.Message.getFieldWithDefault(msg, 1, ""), + sessionId: jspb.Message.getFieldWithDefault(msg, 2, ""), + transferContextId: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.relay.satp.CommitReadyRequest} + */ +proto.relay.satp.CommitReadyRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.relay.satp.CommitReadyRequest; + return proto.relay.satp.CommitReadyRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.relay.satp.CommitReadyRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.relay.satp.CommitReadyRequest} + */ +proto.relay.satp.CommitReadyRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setMessageType(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setSessionId(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setTransferContextId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.relay.satp.CommitReadyRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.relay.satp.CommitReadyRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.relay.satp.CommitReadyRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.relay.satp.CommitReadyRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMessageType(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getSessionId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getTransferContextId(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional string message_type = 1; + * @return {string} + */ +proto.relay.satp.CommitReadyRequest.prototype.getMessageType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.CommitReadyRequest} returns this + */ +proto.relay.satp.CommitReadyRequest.prototype.setMessageType = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string session_id = 2; + * @return {string} + */ +proto.relay.satp.CommitReadyRequest.prototype.getSessionId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.CommitReadyRequest} returns this + */ +proto.relay.satp.CommitReadyRequest.prototype.setSessionId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string transfer_context_id = 3; + * @return {string} + */ +proto.relay.satp.CommitReadyRequest.prototype.getTransferContextId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.CommitReadyRequest} returns this + */ +proto.relay.satp.CommitReadyRequest.prototype.setTransferContextId = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.relay.satp.CommitFinalAssertionRequest.prototype.toObject = function(opt_includeInstance) { + return proto.relay.satp.CommitFinalAssertionRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.relay.satp.CommitFinalAssertionRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.relay.satp.CommitFinalAssertionRequest.toObject = function(includeInstance, msg) { + var f, obj = { + messageType: jspb.Message.getFieldWithDefault(msg, 1, ""), + sessionId: jspb.Message.getFieldWithDefault(msg, 2, ""), + transferContextId: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.relay.satp.CommitFinalAssertionRequest} + */ +proto.relay.satp.CommitFinalAssertionRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.relay.satp.CommitFinalAssertionRequest; + return proto.relay.satp.CommitFinalAssertionRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.relay.satp.CommitFinalAssertionRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.relay.satp.CommitFinalAssertionRequest} + */ +proto.relay.satp.CommitFinalAssertionRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setMessageType(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setSessionId(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setTransferContextId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.relay.satp.CommitFinalAssertionRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.relay.satp.CommitFinalAssertionRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.relay.satp.CommitFinalAssertionRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.relay.satp.CommitFinalAssertionRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMessageType(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getSessionId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getTransferContextId(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional string message_type = 1; + * @return {string} + */ +proto.relay.satp.CommitFinalAssertionRequest.prototype.getMessageType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.CommitFinalAssertionRequest} returns this + */ +proto.relay.satp.CommitFinalAssertionRequest.prototype.setMessageType = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string session_id = 2; + * @return {string} + */ +proto.relay.satp.CommitFinalAssertionRequest.prototype.getSessionId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.CommitFinalAssertionRequest} returns this + */ +proto.relay.satp.CommitFinalAssertionRequest.prototype.setSessionId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string transfer_context_id = 3; + * @return {string} + */ +proto.relay.satp.CommitFinalAssertionRequest.prototype.getTransferContextId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.CommitFinalAssertionRequest} returns this + */ +proto.relay.satp.CommitFinalAssertionRequest.prototype.setTransferContextId = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.relay.satp.AckFinalReceiptRequest.prototype.toObject = function(opt_includeInstance) { + return proto.relay.satp.AckFinalReceiptRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.relay.satp.AckFinalReceiptRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.relay.satp.AckFinalReceiptRequest.toObject = function(includeInstance, msg) { + var f, obj = { + messageType: jspb.Message.getFieldWithDefault(msg, 1, ""), + sessionId: jspb.Message.getFieldWithDefault(msg, 2, ""), + transferContextId: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.relay.satp.AckFinalReceiptRequest} + */ +proto.relay.satp.AckFinalReceiptRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.relay.satp.AckFinalReceiptRequest; + return proto.relay.satp.AckFinalReceiptRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.relay.satp.AckFinalReceiptRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.relay.satp.AckFinalReceiptRequest} + */ +proto.relay.satp.AckFinalReceiptRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setMessageType(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setSessionId(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setTransferContextId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.relay.satp.AckFinalReceiptRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.relay.satp.AckFinalReceiptRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.relay.satp.AckFinalReceiptRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.relay.satp.AckFinalReceiptRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMessageType(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getSessionId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getTransferContextId(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional string message_type = 1; + * @return {string} + */ +proto.relay.satp.AckFinalReceiptRequest.prototype.getMessageType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.AckFinalReceiptRequest} returns this + */ +proto.relay.satp.AckFinalReceiptRequest.prototype.setMessageType = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string session_id = 2; + * @return {string} + */ +proto.relay.satp.AckFinalReceiptRequest.prototype.getSessionId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.AckFinalReceiptRequest} returns this + */ +proto.relay.satp.AckFinalReceiptRequest.prototype.setSessionId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string transfer_context_id = 3; + * @return {string} + */ +proto.relay.satp.AckFinalReceiptRequest.prototype.getTransferContextId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.AckFinalReceiptRequest} returns this + */ +proto.relay.satp.AckFinalReceiptRequest.prototype.setTransferContextId = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.relay.satp.TransferCompletedRequest.prototype.toObject = function(opt_includeInstance) { + return proto.relay.satp.TransferCompletedRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.relay.satp.TransferCompletedRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.relay.satp.TransferCompletedRequest.toObject = function(includeInstance, msg) { + var f, obj = { + messageType: jspb.Message.getFieldWithDefault(msg, 1, ""), + sessionId: jspb.Message.getFieldWithDefault(msg, 2, ""), + transferContextId: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.relay.satp.TransferCompletedRequest} + */ +proto.relay.satp.TransferCompletedRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.relay.satp.TransferCompletedRequest; + return proto.relay.satp.TransferCompletedRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.relay.satp.TransferCompletedRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.relay.satp.TransferCompletedRequest} + */ +proto.relay.satp.TransferCompletedRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setMessageType(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setSessionId(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setTransferContextId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.relay.satp.TransferCompletedRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.relay.satp.TransferCompletedRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.relay.satp.TransferCompletedRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.relay.satp.TransferCompletedRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMessageType(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getSessionId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getTransferContextId(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional string message_type = 1; + * @return {string} + */ +proto.relay.satp.TransferCompletedRequest.prototype.getMessageType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferCompletedRequest} returns this + */ +proto.relay.satp.TransferCompletedRequest.prototype.setMessageType = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string session_id = 2; + * @return {string} + */ +proto.relay.satp.TransferCompletedRequest.prototype.getSessionId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferCompletedRequest} returns this + */ +proto.relay.satp.TransferCompletedRequest.prototype.setSessionId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string transfer_context_id = 3; + * @return {string} + */ +proto.relay.satp.TransferCompletedRequest.prototype.getTransferContextId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.relay.satp.TransferCompletedRequest} returns this + */ +proto.relay.satp.TransferCompletedRequest.prototype.setTransferContextId = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +goog.object.extend(exports, proto.relay.satp); diff --git a/weaver/common/protos-js/tsconfig.json b/weaver/common/protos-js/tsconfig.json new file mode 100644 index 00000000000..bb6d2fdfa3c --- /dev/null +++ b/weaver/common/protos-js/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "outDir": "./build", + "allowJs": true, + "target": "es5", + "esModuleInterop": true, + "module": "commonjs" + }, + "include": ["common/*","corda/*","driver/*","fabric/*","identity/*","msp/*","networks/*","peer/*","relay/*"], + "exclude": ["node_modules","build"], + "skipLibCheck": true, + "resolveJsonModule": true +} \ No newline at end of file diff --git a/weaver/sdks/fabric/interoperation-node-sdk/tsconfig.cacti.json b/weaver/sdks/fabric/interoperation-node-sdk/tsconfig.cacti.json new file mode 100644 index 00000000000..8223274f322 --- /dev/null +++ b/weaver/sdks/fabric/interoperation-node-sdk/tsconfig.cacti.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../../tsconfig.base.json", + "compilerOptions": { + "composite": true, + "allowJs": true, + "outDir": "./dist/lib/", + "declarationDir": "dist/lib", + "resolveJsonModule": true, + "rootDir": "./src", + "strict": false /* Enable all strict type-checking options. */, + "noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */ + + "tsBuildInfoFile": "../../../../.build-cache/weaver-fabric-node-sdk.tsbuildinfo" + }, + "include": ["src/**/*"], + "references": [ + ] +} \ No newline at end of file diff --git a/weaver/tests/network-setups/fabric/dev/Makefile b/weaver/tests/network-setups/fabric/dev/Makefile index c7142789ebd..5aa380b62a1 100644 --- a/weaver/tests/network-setups/fabric/dev/Makefile +++ b/weaver/tests/network-setups/fabric/dev/Makefile @@ -131,7 +131,7 @@ remove-network2: clean: remove +docker system prune -f || true +rm -rf config || true - +chmod -R 755 ../shared/chaincode/interop + +chmod -R 755 ../shared/chaincode/interop || true +rm -rf ../shared/chaincode/* .PHONY: clean-all diff --git a/yarn.lock b/yarn.lock index 73222648ea7..7e72f030f35 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9032,6 +9032,22 @@ __metadata: languageName: node linkType: hard +"@hyperledger/cacti-copm-core@workspace:^, @hyperledger/cacti-copm-core@workspace:packages/cacti-copm-core": + version: 0.0.0-use.local + resolution: "@hyperledger/cacti-copm-core@workspace:packages/cacti-copm-core" + dependencies: + "@bufbuild/buf": "npm:1.30.0" + "@bufbuild/protobuf": "npm:1.10.0" + "@bufbuild/protoc-gen-es": "npm:1.8.0" + "@connectrpc/connect": "npm:1.4.0" + "@connectrpc/connect-node": "npm:1.4.0" + "@connectrpc/protoc-gen-connect-es": "npm:1.4.0" + "@hyperledger/cacti-weaver-sdk-fabric": "npm:2.0.0-rc.4" + "@hyperledger/cactus-common": "npm:2.0.0-rc.4" + "@openapitools/openapi-generator-cli": "npm:2.13.4" + languageName: unknown + linkType: soft + "@hyperledger/cacti-example-cbdc-bridging-frontend@workspace:examples/cactus-example-cbdc-bridging-frontend": version: 0.0.0-use.local resolution: "@hyperledger/cacti-example-cbdc-bridging-frontend@workspace:examples/cactus-example-cbdc-bridging-frontend" @@ -9116,6 +9132,33 @@ __metadata: languageName: unknown linkType: soft +"@hyperledger/cacti-plugin-copm-fabric@workspace:packages/cacti-plugin-copm-fabric": + version: 0.0.0-use.local + resolution: "@hyperledger/cacti-plugin-copm-fabric@workspace:packages/cacti-plugin-copm-fabric" + dependencies: + "@bufbuild/buf": "npm:1.30.0" + "@bufbuild/protobuf": "npm:1.10.0" + "@bufbuild/protoc-gen-es": "npm:1.8.0" + "@connectrpc/connect": "npm:1.4.0" + "@connectrpc/connect-node": "npm:1.4.0" + "@connectrpc/protoc-gen-connect-es": "npm:1.4.0" + "@hyperledger/cacti-copm-core": "workspace:^" + "@hyperledger/cacti-weaver-protos-js": "npm:2.0.0-rc.4" + "@hyperledger/cacti-weaver-sdk-fabric": "npm:2.0.0-rc.4" + "@hyperledger/cactus-cmd-api-server": "npm:2.0.0-rc.4" + "@hyperledger/cactus-common": "npm:2.0.0-rc.4" + "@hyperledger/cactus-core": "npm:2.0.0-rc.4" + "@hyperledger/cactus-core-api": "npm:2.0.0-rc.4" + "@hyperledger/cactus-plugin-keychain-memory": "npm:2.0.0-rc.4" + "@hyperledger/cactus-plugin-ledger-connector-fabric": "workspace:^" + "@hyperledger/cactus-test-tooling": "npm:2.0.0-rc.4" + "@openapitools/openapi-generator-cli": "npm:2.13.4" + fabric-ca-client: "npm:2.2.20" + fabric-common: "npm:2.2.20" + fabric-network: "npm:2.2.20" + languageName: unknown + linkType: soft + "@hyperledger/cacti-plugin-ledger-connector-stellar@workspace:packages/cacti-plugin-ledger-connector-stellar": version: 0.0.0-use.local resolution: "@hyperledger/cacti-plugin-ledger-connector-stellar@workspace:packages/cacti-plugin-ledger-connector-stellar" @@ -9298,6 +9341,7 @@ __metadata: dependencies: "@grpc/grpc-js": "npm:1.11.2" "@grpc/proto-loader": "npm:0.7.13" + "@types/node": "npm:18.19.0" google-protobuf: "npm:3.21.4" grpc-tools: "npm:1.12.4" grpc_tools_node_protoc_ts: "npm:5.3.3" @@ -10399,7 +10443,7 @@ __metadata: languageName: unknown linkType: soft -"@hyperledger/cactus-plugin-ledger-connector-fabric@npm:2.0.0-rc.4, @hyperledger/cactus-plugin-ledger-connector-fabric@workspace:packages/cactus-plugin-ledger-connector-fabric": +"@hyperledger/cactus-plugin-ledger-connector-fabric@npm:2.0.0-rc.4, @hyperledger/cactus-plugin-ledger-connector-fabric@workspace:^, @hyperledger/cactus-plugin-ledger-connector-fabric@workspace:packages/cactus-plugin-ledger-connector-fabric": version: 0.0.0-use.local resolution: "@hyperledger/cactus-plugin-ledger-connector-fabric@workspace:packages/cactus-plugin-ledger-connector-fabric" dependencies: @@ -13105,6 +13149,38 @@ __metadata: languageName: node linkType: hard +"@nestjs/axios@npm:3.0.2": + version: 3.0.2 + resolution: "@nestjs/axios@npm:3.0.2" + peerDependencies: + "@nestjs/common": ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 + axios: ^1.3.1 + rxjs: ^6.0.0 || ^7.0.0 + checksum: 10/00866a630596ab6aad4f27dd91aceb600b9db605a5307d359f0898177b020a77764782d8b102a25ed227a0f2d5f0679c5b68967261aec71d445be3f3f028ec84 + languageName: node + linkType: hard + +"@nestjs/common@npm:10.3.0": + version: 10.3.0 + resolution: "@nestjs/common@npm:10.3.0" + dependencies: + iterare: "npm:1.2.1" + tslib: "npm:2.6.2" + uid: "npm:2.0.2" + peerDependencies: + class-transformer: "*" + class-validator: "*" + reflect-metadata: ^0.1.12 + rxjs: ^7.1.0 + peerDependenciesMeta: + class-transformer: + optional: true + class-validator: + optional: true + checksum: 10/bedb3437e6517df423526409b5a70cc33c52b557d17bd74ca12ab09a37ad5ff4ecdece44db625e3d702e21d308bc49d5419afe1752181af6aafdee3a27c9d394 + languageName: node + linkType: hard + "@nestjs/common@npm:9.3.11": version: 9.3.11 resolution: "@nestjs/common@npm:9.3.11" @@ -13129,6 +13205,34 @@ __metadata: languageName: node linkType: hard +"@nestjs/core@npm:10.3.0": + version: 10.3.0 + resolution: "@nestjs/core@npm:10.3.0" + dependencies: + "@nuxtjs/opencollective": "npm:0.3.2" + fast-safe-stringify: "npm:2.1.1" + iterare: "npm:1.2.1" + path-to-regexp: "npm:3.2.0" + tslib: "npm:2.6.2" + uid: "npm:2.0.2" + peerDependencies: + "@nestjs/common": ^10.0.0 + "@nestjs/microservices": ^10.0.0 + "@nestjs/platform-express": ^10.0.0 + "@nestjs/websockets": ^10.0.0 + reflect-metadata: ^0.1.12 + rxjs: ^7.1.0 + peerDependenciesMeta: + "@nestjs/microservices": + optional: true + "@nestjs/platform-express": + optional: true + "@nestjs/websockets": + optional: true + checksum: 10/4bdeed0f203e55b4a1edf0031df55b6bf059c1f9faf6f86ac70e08a6e279c2d494df858ea251cbef915aa0df27b6534d1baace2847a3be7853bf07c1ad3a196f + languageName: node + linkType: hard + "@nestjs/core@npm:9.3.11": version: 9.3.11 resolution: "@nestjs/core@npm:9.3.11" @@ -14022,6 +14126,34 @@ __metadata: languageName: node linkType: hard +"@openapitools/openapi-generator-cli@npm:2.13.4": + version: 2.13.4 + resolution: "@openapitools/openapi-generator-cli@npm:2.13.4" + dependencies: + "@nestjs/axios": "npm:3.0.2" + "@nestjs/common": "npm:10.3.0" + "@nestjs/core": "npm:10.3.0" + "@nuxtjs/opencollective": "npm:0.3.2" + axios: "npm:1.6.8" + chalk: "npm:4.1.2" + commander: "npm:8.3.0" + compare-versions: "npm:4.1.4" + concurrently: "npm:6.5.1" + console.table: "npm:0.10.0" + fs-extra: "npm:10.1.0" + glob: "npm:7.2.3" + https-proxy-agent: "npm:7.0.4" + inquirer: "npm:8.2.6" + lodash: "npm:4.17.21" + reflect-metadata: "npm:0.1.13" + rxjs: "npm:7.8.1" + tslib: "npm:2.6.2" + bin: + openapi-generator-cli: main.js + checksum: 10/87efe136d4c223ff71ba8a31569623ed16de28b839ad50b01340c55ebebf6a7c82ce1caa79c8491ed090477f7928357b483f62e2f362c0311e7c1efcbf9b1307 + languageName: node + linkType: hard + "@openapitools/openapi-generator-cli@npm:2.7.0": version: 2.7.0 resolution: "@openapitools/openapi-generator-cli@npm:2.7.0" @@ -17440,6 +17572,15 @@ __metadata: languageName: node linkType: hard +"@types/node@npm:18.19.0": + version: 18.19.0 + resolution: "@types/node@npm:18.19.0" + dependencies: + undici-types: "npm:~5.26.4" + checksum: 10/dfaf489b31098d5184aa6ce07fec9619d05b2c953a319b23b0f46e4c901b9996d87da8c193ea388488119ccc8e79ce228d769b7a59077ac6645aa86c826b56cd + languageName: node + linkType: hard + "@types/node@npm:20.4.7": version: 20.4.7 resolution: "@types/node@npm:20.4.7" @@ -31270,6 +31411,20 @@ __metadata: languageName: node linkType: hard +"glob@npm:7.2.3, glob@npm:^7.0.3, glob@npm:^7.1.2, glob@npm:^7.2.3": + version: 7.2.3 + resolution: "glob@npm:7.2.3" + dependencies: + fs.realpath: "npm:^1.0.0" + inflight: "npm:^1.0.4" + inherits: "npm:2" + minimatch: "npm:^3.1.1" + once: "npm:^1.3.0" + path-is-absolute: "npm:^1.0.0" + checksum: 10/59452a9202c81d4508a43b8af7082ca5c76452b9fcc4a9ab17655822e6ce9b21d4f8fbadabe4fe3faef448294cec249af305e2cd824b7e9aaf689240e5e96a7b + languageName: node + linkType: hard + "glob@npm:^10.2.2": version: 10.3.4 resolution: "glob@npm:10.3.4" @@ -31316,20 +31471,6 @@ __metadata: languageName: node linkType: hard -"glob@npm:^7.0.3, glob@npm:^7.1.2, glob@npm:^7.2.3": - version: 7.2.3 - resolution: "glob@npm:7.2.3" - dependencies: - fs.realpath: "npm:^1.0.0" - inflight: "npm:^1.0.4" - inherits: "npm:2" - minimatch: "npm:^3.1.1" - once: "npm:^1.3.0" - path-is-absolute: "npm:^1.0.0" - checksum: 10/59452a9202c81d4508a43b8af7082ca5c76452b9fcc4a9ab17655822e6ce9b21d4f8fbadabe4fe3faef448294cec249af305e2cd824b7e9aaf689240e5e96a7b - languageName: node - linkType: hard - "glob@npm:^8.0.1": version: 8.0.1 resolution: "glob@npm:8.0.1" @@ -52112,6 +52253,15 @@ __metadata: languageName: node linkType: hard +"uid@npm:2.0.2": + version: 2.0.2 + resolution: "uid@npm:2.0.2" + dependencies: + "@lukeed/csprng": "npm:^1.0.0" + checksum: 10/18f6da43d8e1b8643077e8123f877b4506759d9accc15337140a1bf7c99f299a66e88b27ab4c640e66e6a10f19e3a85afa45fdf830dd4bab7570d07a3d51e073 + languageName: node + linkType: hard + "uint8-varint@npm:^2.0.1": version: 2.0.1 resolution: "uint8-varint@npm:2.0.1" @@ -52181,6 +52331,13 @@ __metadata: languageName: node linkType: hard +"undici-types@npm:~5.26.4": + version: 5.26.5 + resolution: "undici-types@npm:5.26.5" + checksum: 10/0097779d94bc0fd26f0418b3a05472410408877279141ded2bd449167be1aed7ea5b76f756562cb3586a07f251b90799bab22d9019ceba49c037c76445f7cddd + languageName: node + linkType: hard + "undici@npm:6.11.1": version: 6.11.1 resolution: "undici@npm:6.11.1"