@distrohelena/canton-typescript-sdk 0.1.32 → 0.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +220 -9
- package/dist/cjs/client/external-party-activation-client.js +20 -10
- package/dist/cjs/core/errors/active-contracts-traversal-error.js +12 -0
- package/dist/cjs/core/polling/poll-until-async.js +26 -0
- package/dist/cjs/core/types/active-contracts-traversal-options.js +26 -0
- package/dist/cjs/core/types/command-deduplication-period.js +2 -0
- package/dist/cjs/core/types/operation-deadline.js +42 -0
- package/dist/cjs/core/types/requests/allocate-party-request.js +2 -0
- package/dist/cjs/core/types/requests/finalize-decentralized-party-request.js +6 -0
- package/dist/cjs/core/types/requests/submit-command-request.js +43 -0
- package/dist/cjs/core/types/requests/wait-for-party-hosting-request.js +40 -0
- package/dist/cjs/index.js +13 -27
- package/dist/cjs/query/grpc/grpc-contract-query-client.js +33 -16
- package/dist/cjs/services/party-management/decentralized-party-lifecycle.js +28 -3
- package/dist/cjs/services/party-management/party-management-service-client.js +3 -0
- package/dist/cjs/services/state/state-service-client.js +1 -1
- package/dist/cjs/services/topology-aggregation/topology-aggregation-service-client.js +36 -0
- package/dist/cjs/transports/grpc/grpc-channel-factory.js +5 -7
- package/dist/cjs/transports/grpc/grpc-transport.js +31 -15
- package/dist/cjs/transports/grpc/mappers/command-deduplication-mapper.js +22 -0
- package/dist/cjs/transports/grpc/mappers/commands-mapper.js +3 -4
- package/dist/cjs/transports/grpc/mappers/interactive-command-mapper.js +5 -3
- package/dist/cjs/transports/grpc/mappers/parties-mapper.js +1 -12
- package/dist/cjs/transports/json/mappers/commands-mapper.js +5 -1
- package/dist/cjs/transports/json/mappers/parties-mapper.js +1 -0
- package/dist/client/external-party-activation-client.js +20 -10
- package/dist/client/external-party-activation-response.d.ts +1 -1
- package/dist/core/errors/active-contracts-traversal-error.d.ts +5 -0
- package/dist/core/errors/active-contracts-traversal-error.js +8 -0
- package/dist/core/polling/poll-until-async.d.ts +10 -0
- package/dist/core/polling/poll-until-async.js +23 -0
- package/dist/core/transports/transport.interface.d.ts +11 -3
- package/dist/core/types/active-contracts-traversal-options.d.ts +11 -0
- package/dist/core/types/active-contracts-traversal-options.js +22 -0
- package/dist/core/types/command-deduplication-period.d.ts +7 -0
- package/dist/core/types/command-deduplication-period.js +1 -0
- package/dist/core/types/operation-deadline.d.ts +13 -0
- package/dist/core/types/operation-deadline.js +38 -0
- package/dist/core/types/requests/allocate-party-request.d.ts +2 -0
- package/dist/core/types/requests/allocate-party-request.js +2 -0
- package/dist/core/types/requests/finalize-decentralized-party-request.d.ts +6 -0
- package/dist/core/types/requests/finalize-decentralized-party-request.js +6 -0
- package/dist/core/types/requests/submit-command-request.d.ts +5 -0
- package/dist/core/types/requests/submit-command-request.js +43 -0
- package/dist/core/types/requests/wait-for-party-hosting-request.d.ts +14 -0
- package/dist/core/types/requests/wait-for-party-hosting-request.js +36 -0
- package/dist/index.d.ts +5 -11
- package/dist/index.js +4 -11
- package/dist/query/grpc/grpc-contract-query-client.js +33 -16
- package/dist/services/party-management/decentralized-party-lifecycle.d.ts +1 -1
- package/dist/services/party-management/decentralized-party-lifecycle.js +28 -3
- package/dist/services/party-management/party-management-service-client.js +3 -0
- package/dist/services/state/state-service-client.d.ts +1 -1
- package/dist/services/state/state-service-client.js +1 -1
- package/dist/services/topology-aggregation/topology-aggregation-service-client.d.ts +4 -1
- package/dist/services/topology-aggregation/topology-aggregation-service-client.js +36 -0
- package/dist/services/topology-manager-read/topology-manager-read-service-client.d.ts +3 -1
- package/dist/services/user-management/user-management-service-client.d.ts +7 -1
- package/dist/transports/grpc/grpc-channel-factory.d.ts +0 -1
- package/dist/transports/grpc/grpc-channel-factory.js +5 -7
- package/dist/transports/grpc/grpc-transport.d.ts +10 -3
- package/dist/transports/grpc/grpc-transport.js +31 -15
- package/dist/transports/grpc/mappers/command-deduplication-mapper.d.ts +5 -0
- package/dist/transports/grpc/mappers/command-deduplication-mapper.js +19 -0
- package/dist/transports/grpc/mappers/commands-mapper.js +3 -4
- package/dist/transports/grpc/mappers/interactive-command-mapper.js +5 -3
- package/dist/transports/grpc/mappers/parties-mapper.d.ts +3 -7
- package/dist/transports/grpc/mappers/parties-mapper.js +1 -10
- package/dist/transports/json/json-transport.d.ts +10 -5
- package/dist/transports/json/mappers/commands-mapper.js +5 -1
- package/dist/transports/json/mappers/parties-mapper.d.ts +1 -0
- package/dist/transports/json/mappers/parties-mapper.js +1 -0
- package/node/participant-358-synchronizer.mjs +174 -0
- package/node/start-local-participant-358.sh +214 -0
- package/node/stop-local-participant-358.sh +18 -0
- package/node/test-participant-358-sidecar-smoke.sh +19 -0
- package/node/test-participant-358-sidecar.sh +113 -0
- package/package.json +18 -2
- package/dist/cjs/core/types/health-check-status.js +0 -10
- package/dist/cjs/core/types/requests/get-ledger-api-version-request.js +0 -6
- package/dist/cjs/core/types/requests/get-package-references-request.js +0 -10
- package/dist/cjs/core/types/requests/get-participant-id-request.js +0 -7
- package/dist/cjs/core/types/requests/get-participant-status-request.js +0 -6
- package/dist/cjs/core/types/requests/health-check-request.js +0 -10
- package/dist/cjs/core/types/responses/get-ledger-api-version-response.js +0 -12
- package/dist/cjs/core/types/responses/get-package-references-response.js +0 -10
- package/dist/cjs/core/types/responses/get-participant-id-response.js +0 -10
- package/dist/cjs/core/types/responses/get-participant-status-response.js +0 -12
- package/dist/cjs/core/types/responses/health-check-response.js +0 -10
- package/dist/cjs/transports/grpc/mappers/health-mapper.js +0 -24
- package/dist/cjs/transports/grpc/mappers/participant-status-mapper.js +0 -58
- package/dist/core/types/health-check-status.d.ts +0 -6
- package/dist/core/types/health-check-status.js +0 -7
- package/dist/core/types/requests/get-ledger-api-version-request.d.ts +0 -2
- package/dist/core/types/requests/get-ledger-api-version-request.js +0 -2
- package/dist/core/types/requests/get-package-references-request.d.ts +0 -6
- package/dist/core/types/requests/get-package-references-request.js +0 -6
- package/dist/core/types/requests/get-participant-id-request.d.ts +0 -3
- package/dist/core/types/requests/get-participant-id-request.js +0 -3
- package/dist/core/types/requests/get-participant-status-request.d.ts +0 -2
- package/dist/core/types/requests/get-participant-status-request.js +0 -2
- package/dist/core/types/requests/health-check-request.d.ts +0 -6
- package/dist/core/types/requests/health-check-request.js +0 -6
- package/dist/core/types/responses/get-ledger-api-version-response.d.ts +0 -8
- package/dist/core/types/responses/get-ledger-api-version-response.js +0 -8
- package/dist/core/types/responses/get-package-references-response.d.ts +0 -7
- package/dist/core/types/responses/get-package-references-response.js +0 -6
- package/dist/core/types/responses/get-participant-id-response.d.ts +0 -6
- package/dist/core/types/responses/get-participant-id-response.js +0 -6
- package/dist/core/types/responses/get-participant-status-response.d.ts +0 -10
- package/dist/core/types/responses/get-participant-status-response.js +0 -8
- package/dist/core/types/responses/health-check-response.d.ts +0 -7
- package/dist/core/types/responses/health-check-response.js +0 -6
- package/dist/transports/grpc/mappers/health-mapper.d.ts +0 -5
- package/dist/transports/grpc/mappers/health-mapper.js +0 -21
- package/dist/transports/grpc/mappers/participant-status-mapper.d.ts +0 -5
- package/dist/transports/grpc/mappers/participant-status-mapper.js +0 -54
- package/node/.generated/start-local/additional-config.extra-participants.conf +0 -72
- package/node/.generated/start-local/additional-config.extra-validators.conf +0 -105
- package/node/.generated/start-local/compose-extra-participants.yaml +0 -366
- package/node/.generated/start-local/extra-participants.env +0 -88
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
REPO_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
5
|
+
START_SCRIPT="$REPO_ROOT/node/start-local-participant-358.sh"
|
|
6
|
+
STOP_SCRIPT="$REPO_ROOT/node/stop-local-participant-358.sh"
|
|
7
|
+
|
|
8
|
+
[[ -x "$START_SCRIPT" ]]
|
|
9
|
+
[[ -x "$STOP_SCRIPT" ]]
|
|
10
|
+
grep -Fq 'export SDK_EXAMPLE_LEDGER_ENDPOINT=localhost:$LEDGER_PORT' "$START_SCRIPT"
|
|
11
|
+
grep -Fq 'export SDK_EXAMPLE_LEDGER_ADMIN_ENDPOINT=localhost:$LEDGER_PORT' "$START_SCRIPT"
|
|
12
|
+
grep -Fq 'export SDK_EXAMPLE_PARTICIPANT_ADMIN_ENDPOINT=localhost:$ADMIN_PORT' "$START_SCRIPT"
|
|
13
|
+
grep -Fq 'ensure-ledger-user-read-rights' "$START_SCRIPT"
|
|
14
|
+
grep -Fq 'canReadAsAnyParty' "$REPO_ROOT/node/participant-358-synchronizer.mjs"
|
|
15
|
+
|
|
16
|
+
tmpdir="$(mktemp -d)"
|
|
17
|
+
trap 'rm -rf "$tmpdir"' EXIT
|
|
18
|
+
|
|
19
|
+
stubbin="$tmpdir/bin"
|
|
20
|
+
mkdir -p "$stubbin"
|
|
21
|
+
cat > "$stubbin/docker" <<'EOF'
|
|
22
|
+
#!/usr/bin/env bash
|
|
23
|
+
set -euo pipefail
|
|
24
|
+
printf '%s\n' "$*" >> "$DOCKER_LOG"
|
|
25
|
+
if [[ "$1" == "compose" && "$2" == "version" ]]; then
|
|
26
|
+
exit 0
|
|
27
|
+
fi
|
|
28
|
+
EOF
|
|
29
|
+
chmod +x "$stubbin/docker"
|
|
30
|
+
|
|
31
|
+
runtime_dir="$tmpdir/runtime"
|
|
32
|
+
docker_log="$tmpdir/docker.log"
|
|
33
|
+
test_ledger_port=18901
|
|
34
|
+
test_admin_port=18902
|
|
35
|
+
test_json_port=18975
|
|
36
|
+
PATH="$stubbin:$PATH" \
|
|
37
|
+
DOCKER_LOG="$docker_log" \
|
|
38
|
+
PARTICIPANT_358_RUNTIME_DIR="$runtime_dir" \
|
|
39
|
+
PARTICIPANT_358_LEDGER_PORT="$test_ledger_port" \
|
|
40
|
+
PARTICIPANT_358_ADMIN_PORT="$test_admin_port" \
|
|
41
|
+
PARTICIPANT_358_JSON_PORT="$test_json_port" \
|
|
42
|
+
PARTICIPANT_358_SKIP_SYNCHRONIZER_CONNECT=1 \
|
|
43
|
+
"$START_SCRIPT"
|
|
44
|
+
|
|
45
|
+
grep -Fqx 'name: canton-participant-358' "$runtime_dir/compose.yaml"
|
|
46
|
+
grep -Fqx ' participant358:' "$runtime_dir/compose.yaml"
|
|
47
|
+
if grep -Fqx ' canton:' "$runtime_dir/compose.yaml"; then
|
|
48
|
+
echo 'sidecar must not claim the quickstart canton DNS alias' >&2
|
|
49
|
+
exit 1
|
|
50
|
+
fi
|
|
51
|
+
grep -Fqx ' image: ghcr.io/digital-asset/decentralized-canton-sync/docker/canton:0.6.12' "$runtime_dir/compose.yaml"
|
|
52
|
+
grep -Fqx ' image: postgres:16' "$runtime_dir/compose.yaml"
|
|
53
|
+
grep -Fqx ' - default' "$runtime_dir/compose.yaml"
|
|
54
|
+
grep -Fqx ' - localnet' "$runtime_dir/compose.yaml"
|
|
55
|
+
grep -Fqx ' databaseName = participant358' "$runtime_dir/canton.conf"
|
|
56
|
+
grep -Fqx ' admin-api {' "$runtime_dir/canton.conf"
|
|
57
|
+
grep -Fqx ' address = "0.0.0.0"' "$runtime_dir/canton.conf"
|
|
58
|
+
grep -Fqx ' port = 5002' "$runtime_dir/canton.conf"
|
|
59
|
+
grep -Fqx " - \"127.0.0.1:$test_ledger_port:5001\"" "$runtime_dir/compose.yaml"
|
|
60
|
+
grep -Fqx " - \"127.0.0.1:$test_admin_port:5002\"" "$runtime_dir/compose.yaml"
|
|
61
|
+
grep -Fqx " - \"127.0.0.1:$test_json_port:7575\"" "$runtime_dir/compose.yaml"
|
|
62
|
+
grep -Fqx ' port = 5002' "$runtime_dir/canton.conf"
|
|
63
|
+
grep -Fqx ' port = 7575' "$runtime_dir/canton.conf"
|
|
64
|
+
grep -Fq 'PARTICIPANT_358_SYNCHRONIZER_CONFIG=' "$runtime_dir/participant-358.env"
|
|
65
|
+
grep -Fq 'PARTICIPANT_358_LEDGER_TOKEN_FILE=' "$runtime_dir/participant-358.env"
|
|
66
|
+
test -s "$runtime_dir/ledger-api-user.token"
|
|
67
|
+
node -e '
|
|
68
|
+
const token = require("node:fs").readFileSync(process.argv[1], "utf8").trim();
|
|
69
|
+
const payload = JSON.parse(Buffer.from(token.split(".")[1], "base64url"));
|
|
70
|
+
if (payload.sub !== "ledger-api-user") throw new Error("unexpected token subject");
|
|
71
|
+
if (payload.aud !== "https://canton.network.global") throw new Error("unexpected token audience");
|
|
72
|
+
if (!Number.isInteger(payload.iat)) throw new Error("token is missing iat");
|
|
73
|
+
if (!Number.isInteger(payload.exp) || payload.exp <= payload.iat) throw new Error("token is missing a future exp");
|
|
74
|
+
if (payload.exp - payload.iat !== 300) throw new Error("token lifetime must be 300 seconds");
|
|
75
|
+
' "$runtime_dir/ledger-api-user.token"
|
|
76
|
+
grep -F -- '--project-name canton-participant-358' "$docker_log"
|
|
77
|
+
grep -Fqx ' name: quickstart' "$runtime_dir/compose.yaml"
|
|
78
|
+
|
|
79
|
+
docker_calls_before_refresh="$(wc -l < "$docker_log")"
|
|
80
|
+
refresh_output="$(
|
|
81
|
+
PATH="$stubbin:$PATH" \
|
|
82
|
+
DOCKER_LOG="$docker_log" \
|
|
83
|
+
PARTICIPANT_358_RUNTIME_DIR="$runtime_dir" \
|
|
84
|
+
"$START_SCRIPT" --refresh-token
|
|
85
|
+
)"
|
|
86
|
+
[[ "$(wc -l < "$docker_log")" == "$docker_calls_before_refresh" ]]
|
|
87
|
+
[[ "$(stat -c '%a' "$runtime_dir/ledger-api-user.token")" == 600 ]]
|
|
88
|
+
grep -Fqx "export SDK_TEST_LEDGER_BEARER_TOKEN=\"\$(cat $runtime_dir/ledger-api-user.token)\"" <<<"$refresh_output"
|
|
89
|
+
grep -Fqx "export SDK_TEST_LEDGER_ADMIN_BEARER_TOKEN=\"\$(cat $runtime_dir/ledger-api-user.token)\"" <<<"$refresh_output"
|
|
90
|
+
grep -Fqx "export SDK_TEST_PARTICIPANT_ADMIN_BEARER_TOKEN=\"\$(cat $runtime_dir/ledger-api-user.token)\"" <<<"$refresh_output"
|
|
91
|
+
grep -Fqx "export SDK_EXAMPLE_BEARER_TOKEN=\"\$(cat $runtime_dir/ledger-api-user.token)\"" <<<"$refresh_output"
|
|
92
|
+
[[ "$(wc -l <<<"$refresh_output")" == 4 ]]
|
|
93
|
+
|
|
94
|
+
if "$START_SCRIPT" --unknown >/dev/null 2>&1; then
|
|
95
|
+
echo 'sidecar launcher accepted an unknown argument' >&2
|
|
96
|
+
exit 1
|
|
97
|
+
fi
|
|
98
|
+
|
|
99
|
+
if PATH="$stubbin:$PATH" PARTICIPANT_358_LEDGER_PORT=3901 "$START_SCRIPT" >/dev/null 2>&1; then
|
|
100
|
+
echo 'sidecar launcher accepted a CN Quickstart Ledger port' >&2
|
|
101
|
+
exit 1
|
|
102
|
+
fi
|
|
103
|
+
|
|
104
|
+
PATH="$stubbin:$PATH" \
|
|
105
|
+
DOCKER_LOG="$docker_log" \
|
|
106
|
+
PARTICIPANT_358_RUNTIME_DIR="$runtime_dir" \
|
|
107
|
+
"$STOP_SCRIPT"
|
|
108
|
+
|
|
109
|
+
grep -F -- '--project-name canton-participant-358' "$docker_log"
|
|
110
|
+
if grep -Eq -- '(^| )down( |$).*quickstart|quickstart.*(^| )down( |$)' "$docker_log"; then
|
|
111
|
+
echo 'stop launcher targeted quickstart' >&2
|
|
112
|
+
exit 1
|
|
113
|
+
fi
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@distrohelena/canton-typescript-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.35",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
],
|
|
14
14
|
"bin": {
|
|
15
15
|
"canton-localnet-start": "node/start-local.sh",
|
|
16
|
-
"canton-localnet-stop": "node/stop-local.sh"
|
|
16
|
+
"canton-localnet-stop": "node/stop-local.sh",
|
|
17
|
+
"canton-localnet-participant-358-start": "node/start-local-participant-358.sh",
|
|
18
|
+
"canton-localnet-participant-358-stop": "node/stop-local-participant-358.sh"
|
|
17
19
|
},
|
|
18
20
|
"keywords": [
|
|
19
21
|
"canton",
|
|
@@ -86,12 +88,26 @@
|
|
|
86
88
|
"example:party:hosted": "npm run build && node --loader ts-node/esm examples/10-hosted-party.ts",
|
|
87
89
|
"example:party:external": "npm run build && node --loader ts-node/esm examples/20-external-party-ed25519.ts",
|
|
88
90
|
"example:party:decentralized": "npm run build && node --loader ts-node/esm examples/30-decentralized-party-ed25519.ts",
|
|
91
|
+
"example:dar:upload": "npm run build && node --loader ts-node/esm examples/40-dar-upload.ts",
|
|
92
|
+
"example:contract:create-exercise": "npm run build && node --loader ts-node/esm examples/50-create-and-exercise.ts",
|
|
93
|
+
"example:contract:query": "npm run build && node --loader ts-node/esm examples/60-query-active-contracts.ts",
|
|
94
|
+
"example:updates:stream": "npm run build && node --loader ts-node/esm examples/61-stream-updates.ts",
|
|
95
|
+
"example:user:rights": "npm run build && node --loader ts-node/esm examples/70-user-rights.ts",
|
|
96
|
+
"example:topology:party-hosting": "npm run build && node --loader ts-node/esm examples/80-topology-inspection.ts",
|
|
97
|
+
"example:workflow:atomic": "npm run build && node --loader ts-node/esm examples/90-atomic-create-and-exercise.ts",
|
|
98
|
+
"example:workflow:retry": "npm run build && node --loader ts-node/esm examples/91-idempotent-command-retry.ts",
|
|
99
|
+
"example:workflow:resume": "npm run build && node --loader ts-node/esm examples/92-resume-update-stream.ts",
|
|
100
|
+
"example:workflow:stale-contract": "npm run build && node --loader ts-node/esm examples/93-archive-and-stale-contract.ts",
|
|
89
101
|
"lint": "eslint . --max-warnings=0",
|
|
90
102
|
"lint:fix": "eslint . --fix --max-warnings=0",
|
|
91
103
|
"start:local-ledger": "bash node/start-local.sh",
|
|
92
104
|
"stop:local-ledger": "bash node/stop-local.sh",
|
|
105
|
+
"start:local-participant-358": "bash node/start-local-participant-358.sh",
|
|
106
|
+
"stop:local-participant-358": "bash node/stop-local-participant-358.sh",
|
|
93
107
|
"test:start-local-script": "bash node/test-start-local.sh",
|
|
94
108
|
"test:stop-local-script": "bash node/test-stop-local.sh",
|
|
109
|
+
"test:participant-358-sidecar-script": "bash node/test-participant-358-sidecar.sh",
|
|
110
|
+
"test:participant-358-sidecar-smoke": "bash node/test-participant-358-sidecar-smoke.sh",
|
|
95
111
|
"test": "vitest run --maxWorkers=1 --testTimeout=15000",
|
|
96
112
|
"test:property": "vitest run tests/property --maxWorkers=1 --testTimeout=15000",
|
|
97
113
|
"test:live": "vitest run tests/live --maxWorkers=1 --testTimeout=15000",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HealthCheckStatus = void 0;
|
|
4
|
-
var HealthCheckStatus;
|
|
5
|
-
(function (HealthCheckStatus) {
|
|
6
|
-
HealthCheckStatus["unknown"] = "unknown";
|
|
7
|
-
HealthCheckStatus["serving"] = "serving";
|
|
8
|
-
HealthCheckStatus["notServing"] = "notServing";
|
|
9
|
-
HealthCheckStatus["serviceUnknown"] = "serviceUnknown";
|
|
10
|
-
})(HealthCheckStatus || (exports.HealthCheckStatus = HealthCheckStatus = {}));
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetPackageReferencesRequest = void 0;
|
|
4
|
-
class GetPackageReferencesRequest {
|
|
5
|
-
packageId;
|
|
6
|
-
constructor(init) {
|
|
7
|
-
this.packageId = init.packageId;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.GetPackageReferencesRequest = GetPackageReferencesRequest;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HealthCheckRequest = void 0;
|
|
4
|
-
class HealthCheckRequest {
|
|
5
|
-
service;
|
|
6
|
-
constructor(init = {}) {
|
|
7
|
-
this.service = init.service;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.HealthCheckRequest = HealthCheckRequest;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetLedgerApiVersionResponse = void 0;
|
|
4
|
-
class GetLedgerApiVersionResponse {
|
|
5
|
-
version;
|
|
6
|
-
features;
|
|
7
|
-
constructor(init) {
|
|
8
|
-
this.version = init.version;
|
|
9
|
-
this.features = init.features;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
exports.GetLedgerApiVersionResponse = GetLedgerApiVersionResponse;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetPackageReferencesResponse = void 0;
|
|
4
|
-
class GetPackageReferencesResponse {
|
|
5
|
-
dars;
|
|
6
|
-
constructor(init) {
|
|
7
|
-
this.dars = [...init.dars];
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.GetPackageReferencesResponse = GetPackageReferencesResponse;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetParticipantIdResponse = void 0;
|
|
4
|
-
class GetParticipantIdResponse {
|
|
5
|
-
participantId;
|
|
6
|
-
constructor(init) {
|
|
7
|
-
this.participantId = init.participantId;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.GetParticipantIdResponse = GetParticipantIdResponse;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetParticipantStatusResponse = void 0;
|
|
4
|
-
class GetParticipantStatusResponse {
|
|
5
|
-
status;
|
|
6
|
-
notInitialized;
|
|
7
|
-
constructor(init) {
|
|
8
|
-
this.status = init.status;
|
|
9
|
-
this.notInitialized = init.notInitialized;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
exports.GetParticipantStatusResponse = GetParticipantStatusResponse;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HealthCheckResponse = void 0;
|
|
4
|
-
class HealthCheckResponse {
|
|
5
|
-
status;
|
|
6
|
-
constructor(init) {
|
|
7
|
-
this.status = init.status;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.HealthCheckResponse = HealthCheckResponse;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapGrpcHealthCheckResponse = mapGrpcHealthCheckResponse;
|
|
4
|
-
const health_check_status_js_1 = require("../../../core/types/health-check-status.js");
|
|
5
|
-
const health_check_response_js_1 = require("../../../core/types/responses/health-check-response.js");
|
|
6
|
-
const health_js_1 = require("../generated/canton/google/grpc/health/v1/health.js");
|
|
7
|
-
function mapGrpcHealthCheckResponse(payload) {
|
|
8
|
-
return new health_check_response_js_1.HealthCheckResponse({
|
|
9
|
-
status: mapGrpcHealthStatus(payload.status),
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
function mapGrpcHealthStatus(status) {
|
|
13
|
-
switch (status) {
|
|
14
|
-
case health_js_1.HealthCheckResponse_ServingStatus.SERVING:
|
|
15
|
-
return health_check_status_js_1.HealthCheckStatus.serving;
|
|
16
|
-
case health_js_1.HealthCheckResponse_ServingStatus.NOT_SERVING:
|
|
17
|
-
return health_check_status_js_1.HealthCheckStatus.notServing;
|
|
18
|
-
case health_js_1.HealthCheckResponse_ServingStatus.SERVICE_UNKNOWN:
|
|
19
|
-
return health_check_status_js_1.HealthCheckStatus.serviceUnknown;
|
|
20
|
-
case health_js_1.HealthCheckResponse_ServingStatus.UNKNOWN:
|
|
21
|
-
default:
|
|
22
|
-
return health_check_status_js_1.HealthCheckStatus.unknown;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapGrpcGetParticipantStatusRequest = mapGrpcGetParticipantStatusRequest;
|
|
4
|
-
exports.mapGrpcParticipantStatusResponse = mapGrpcParticipantStatusResponse;
|
|
5
|
-
const get_participant_status_response_js_1 = require("../../../core/types/responses/get-participant-status-response.js");
|
|
6
|
-
const connected_synchronizer_health_js_1 = require("../../../core/types/connected-synchronizer-health.js");
|
|
7
|
-
const connected_synchronizer_status_js_1 = require("../../../core/types/connected-synchronizer-status.js");
|
|
8
|
-
const participant_node_status_js_1 = require("../../../core/types/participant-node-status.js");
|
|
9
|
-
const participant_status_service_js_1 = require("../generated/canton/com/digitalasset/canton/admin/participant/v30/participant_status_service.js");
|
|
10
|
-
const admin_status_mapper_js_1 = require("./admin-status-mapper.js");
|
|
11
|
-
function mapGrpcGetParticipantStatusRequest(_request) {
|
|
12
|
-
return {};
|
|
13
|
-
}
|
|
14
|
-
function mapGrpcParticipantStatusResponse(payload) {
|
|
15
|
-
switch (payload.kind?.oneofKind) {
|
|
16
|
-
case "status":
|
|
17
|
-
return new get_participant_status_response_js_1.GetParticipantStatusResponse({
|
|
18
|
-
status: mapGrpcParticipantNodeStatus(payload.kind.status),
|
|
19
|
-
});
|
|
20
|
-
case "notInitialized":
|
|
21
|
-
return new get_participant_status_response_js_1.GetParticipantStatusResponse({
|
|
22
|
-
notInitialized: (0, admin_status_mapper_js_1.mapGrpcAdminNotInitializedStatus)(payload.kind.notInitialized),
|
|
23
|
-
});
|
|
24
|
-
default:
|
|
25
|
-
return new get_participant_status_response_js_1.GetParticipantStatusResponse({});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function mapGrpcParticipantNodeStatus(payload) {
|
|
29
|
-
const commonStatus = (0, admin_status_mapper_js_1.mapGrpcAdminNodeStatus)(payload.commonStatus);
|
|
30
|
-
return new participant_node_status_js_1.ParticipantNodeStatus({
|
|
31
|
-
uid: commonStatus.uid,
|
|
32
|
-
uptime: commonStatus.uptime,
|
|
33
|
-
ports: { ...commonStatus.ports },
|
|
34
|
-
active: payload.active ?? commonStatus.active,
|
|
35
|
-
topologyQueues: commonStatus.topologyQueues,
|
|
36
|
-
components: [...commonStatus.components],
|
|
37
|
-
version: commonStatus.version,
|
|
38
|
-
connectedSynchronizers: (payload.connectedSynchronizers ?? []).map((item) => mapGrpcConnectedSynchronizerStatus(item)),
|
|
39
|
-
supportedProtocolVersions: [...(payload.supportedProtocolVersions ?? [])],
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
function mapGrpcConnectedSynchronizerStatus(payload) {
|
|
43
|
-
return new connected_synchronizer_status_js_1.ConnectedSynchronizerStatus({
|
|
44
|
-
physicalSynchronizerId: payload.physicalSynchronizerId ?? "",
|
|
45
|
-
health: mapGrpcConnectedSynchronizerHealth(payload.health),
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
function mapGrpcConnectedSynchronizerHealth(value) {
|
|
49
|
-
switch (value) {
|
|
50
|
-
case participant_status_service_js_1.ConnectedSynchronizer_Health.HEALTHY:
|
|
51
|
-
return connected_synchronizer_health_js_1.ConnectedSynchronizerHealth.healthy;
|
|
52
|
-
case participant_status_service_js_1.ConnectedSynchronizer_Health.UNHEALTHY:
|
|
53
|
-
return connected_synchronizer_health_js_1.ConnectedSynchronizerHealth.unhealthy;
|
|
54
|
-
case participant_status_service_js_1.ConnectedSynchronizer_Health.UNSPECIFIED:
|
|
55
|
-
default:
|
|
56
|
-
return connected_synchronizer_health_js_1.ConnectedSynchronizerHealth.unspecified;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export var HealthCheckStatus;
|
|
2
|
-
(function (HealthCheckStatus) {
|
|
3
|
-
HealthCheckStatus["unknown"] = "unknown";
|
|
4
|
-
HealthCheckStatus["serving"] = "serving";
|
|
5
|
-
HealthCheckStatus["notServing"] = "notServing";
|
|
6
|
-
HealthCheckStatus["serviceUnknown"] = "serviceUnknown";
|
|
7
|
-
})(HealthCheckStatus || (HealthCheckStatus = {}));
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { AdminNotInitializedStatus } from "../admin-not-initialized-status.js";
|
|
2
|
-
import { ParticipantNodeStatus } from "../participant-node-status.js";
|
|
3
|
-
export declare class GetParticipantStatusResponse {
|
|
4
|
-
readonly status?: ParticipantNodeStatus;
|
|
5
|
-
readonly notInitialized?: AdminNotInitializedStatus;
|
|
6
|
-
constructor(init: {
|
|
7
|
-
status?: ParticipantNodeStatus;
|
|
8
|
-
notInitialized?: AdminNotInitializedStatus;
|
|
9
|
-
});
|
|
10
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { HealthCheckResponse } from "../../../core/types/responses/health-check-response.js";
|
|
2
|
-
import { HealthCheckResponse_ServingStatus } from "../generated/canton/google/grpc/health/v1/health.js";
|
|
3
|
-
export declare function mapGrpcHealthCheckResponse(payload: {
|
|
4
|
-
status: HealthCheckResponse_ServingStatus;
|
|
5
|
-
}): HealthCheckResponse;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { HealthCheckStatus } from "../../../core/types/health-check-status.js";
|
|
2
|
-
import { HealthCheckResponse } from "../../../core/types/responses/health-check-response.js";
|
|
3
|
-
import { HealthCheckResponse_ServingStatus } from "../generated/canton/google/grpc/health/v1/health.js";
|
|
4
|
-
export function mapGrpcHealthCheckResponse(payload) {
|
|
5
|
-
return new HealthCheckResponse({
|
|
6
|
-
status: mapGrpcHealthStatus(payload.status),
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
function mapGrpcHealthStatus(status) {
|
|
10
|
-
switch (status) {
|
|
11
|
-
case HealthCheckResponse_ServingStatus.SERVING:
|
|
12
|
-
return HealthCheckStatus.serving;
|
|
13
|
-
case HealthCheckResponse_ServingStatus.NOT_SERVING:
|
|
14
|
-
return HealthCheckStatus.notServing;
|
|
15
|
-
case HealthCheckResponse_ServingStatus.SERVICE_UNKNOWN:
|
|
16
|
-
return HealthCheckStatus.serviceUnknown;
|
|
17
|
-
case HealthCheckResponse_ServingStatus.UNKNOWN:
|
|
18
|
-
default:
|
|
19
|
-
return HealthCheckStatus.unknown;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { GetParticipantStatusRequest } from "../../../core/types/requests/get-participant-status-request.js";
|
|
2
|
-
import { GetParticipantStatusResponse } from "../../../core/types/responses/get-participant-status-response.js";
|
|
3
|
-
import { ParticipantStatusResponse } from "../generated/canton/com/digitalasset/canton/admin/participant/v30/participant_status_service.js";
|
|
4
|
-
export declare function mapGrpcGetParticipantStatusRequest(_request: GetParticipantStatusRequest): Record<string, never>;
|
|
5
|
-
export declare function mapGrpcParticipantStatusResponse(payload: Partial<ParticipantStatusResponse>): GetParticipantStatusResponse;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { GetParticipantStatusResponse } from "../../../core/types/responses/get-participant-status-response.js";
|
|
2
|
-
import { ConnectedSynchronizerHealth } from "../../../core/types/connected-synchronizer-health.js";
|
|
3
|
-
import { ConnectedSynchronizerStatus } from "../../../core/types/connected-synchronizer-status.js";
|
|
4
|
-
import { ParticipantNodeStatus } from "../../../core/types/participant-node-status.js";
|
|
5
|
-
import { ConnectedSynchronizer_Health, } from "../generated/canton/com/digitalasset/canton/admin/participant/v30/participant_status_service.js";
|
|
6
|
-
import { mapGrpcAdminNodeStatus, mapGrpcAdminNotInitializedStatus, } from "./admin-status-mapper.js";
|
|
7
|
-
export function mapGrpcGetParticipantStatusRequest(_request) {
|
|
8
|
-
return {};
|
|
9
|
-
}
|
|
10
|
-
export function mapGrpcParticipantStatusResponse(payload) {
|
|
11
|
-
switch (payload.kind?.oneofKind) {
|
|
12
|
-
case "status":
|
|
13
|
-
return new GetParticipantStatusResponse({
|
|
14
|
-
status: mapGrpcParticipantNodeStatus(payload.kind.status),
|
|
15
|
-
});
|
|
16
|
-
case "notInitialized":
|
|
17
|
-
return new GetParticipantStatusResponse({
|
|
18
|
-
notInitialized: mapGrpcAdminNotInitializedStatus(payload.kind.notInitialized),
|
|
19
|
-
});
|
|
20
|
-
default:
|
|
21
|
-
return new GetParticipantStatusResponse({});
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function mapGrpcParticipantNodeStatus(payload) {
|
|
25
|
-
const commonStatus = mapGrpcAdminNodeStatus(payload.commonStatus);
|
|
26
|
-
return new ParticipantNodeStatus({
|
|
27
|
-
uid: commonStatus.uid,
|
|
28
|
-
uptime: commonStatus.uptime,
|
|
29
|
-
ports: { ...commonStatus.ports },
|
|
30
|
-
active: payload.active ?? commonStatus.active,
|
|
31
|
-
topologyQueues: commonStatus.topologyQueues,
|
|
32
|
-
components: [...commonStatus.components],
|
|
33
|
-
version: commonStatus.version,
|
|
34
|
-
connectedSynchronizers: (payload.connectedSynchronizers ?? []).map((item) => mapGrpcConnectedSynchronizerStatus(item)),
|
|
35
|
-
supportedProtocolVersions: [...(payload.supportedProtocolVersions ?? [])],
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
function mapGrpcConnectedSynchronizerStatus(payload) {
|
|
39
|
-
return new ConnectedSynchronizerStatus({
|
|
40
|
-
physicalSynchronizerId: payload.physicalSynchronizerId ?? "",
|
|
41
|
-
health: mapGrpcConnectedSynchronizerHealth(payload.health),
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
function mapGrpcConnectedSynchronizerHealth(value) {
|
|
45
|
-
switch (value) {
|
|
46
|
-
case ConnectedSynchronizer_Health.HEALTHY:
|
|
47
|
-
return ConnectedSynchronizerHealth.healthy;
|
|
48
|
-
case ConnectedSynchronizer_Health.UNHEALTHY:
|
|
49
|
-
return ConnectedSynchronizerHealth.unhealthy;
|
|
50
|
-
case ConnectedSynchronizer_Health.UNSPECIFIED:
|
|
51
|
-
default:
|
|
52
|
-
return ConnectedSynchronizerHealth.unspecified;
|
|
53
|
-
}
|
|
54
|
-
}
|