Skip to content

Commit 88cb40f

Browse files
committed
docs: Refined ts code and cleaned up JS Doc.
Ticket: TW-138
1 parent 031e5b1 commit 88cb40f

File tree

3 files changed

+98
-79
lines changed

3 files changed

+98
-79
lines changed

src/advancedWalletManager/routers/healthCheck.ts

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,37 +16,43 @@ const VersionResponse: HttpResponse = {
1616
};
1717

1818
/**
19-
* Ping Check
19+
* Ping AWM
20+
*
21+
* Test your connection to the Advanced Wallet Manager (AWM) server.
22+
*
23+
* @tag Advanced Wallets
24+
* @operationId v1.health.ping.awm
25+
*/
26+
const PingRoute = httpRoute({
27+
method: 'POST',
28+
path: '/ping',
29+
request: httpRequest({}),
30+
response: PingResponse,
31+
description: 'Health check endpoint that returns server status',
32+
});
33+
34+
/**
35+
* Check AWM Version
36+
*
37+
* Check your version of the Advanced Wallet Manager (AWM) server.
2038
*
2139
* @tag Advanced Wallets
22-
* @operationId v1.health.ping
23-
* @private
40+
* @operationId v1.health.version.awm
2441
*/
42+
const VersionRoute = httpRoute({
43+
method: 'GET',
44+
path: '/version',
45+
request: httpRequest({}),
46+
response: VersionResponse,
47+
description: 'Returns the current version of the server',
48+
});
49+
2550
export const HealthCheckApiSpec = apiSpec({
26-
'v1.health.ping': {
27-
post: httpRoute({
28-
method: 'POST',
29-
path: '/ping',
30-
request: httpRequest({}),
31-
response: PingResponse,
32-
description: 'Health check endpoint that returns server status',
33-
}),
51+
'v1.health.ping.awm': {
52+
post: PingRoute,
3453
},
35-
/**
36-
* Version Check
37-
*
38-
* @tag Advanced Wallets
39-
* @operationId v1.health.version
40-
* @private
41-
*/
42-
'v1.health.version': {
43-
get: httpRoute({
44-
method: 'GET',
45-
path: '/version',
46-
request: httpRequest({}),
47-
response: VersionResponse,
48-
description: 'Returns the current version of the server',
49-
}),
54+
'v1.health.version.awm': {
55+
get: VersionRoute,
5056
},
5157
});
5258

@@ -56,7 +62,7 @@ export function createHealthCheckRouter(): WrappedRouter<typeof HealthCheckApiSp
5662
decodeErrorFormatter: customDecodeErrorFormatter,
5763
});
5864
// Ping endpoint handler
59-
router.post('v1.health.ping', [
65+
router.post('v1.health.ping.awm', [
6066
responseHandler(() =>
6167
Response.ok({
6268
status: 'advanced wallet manager server is ok!',
@@ -66,7 +72,7 @@ export function createHealthCheckRouter(): WrappedRouter<typeof HealthCheckApiSp
6672
]);
6773

6874
// Version endpoint handler
69-
router.get('v1.health.version', [
75+
router.get('v1.health.version.awm', [
7076
responseHandler(() =>
7177
Response.ok({
7278
version: pjson.version,

src/masterBitgoExpress/routers/awmExpressHealth.ts

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,37 +30,43 @@ const VersionAwmResponse: HttpResponse = {
3030
};
3131

3232
/**
33-
* Ping Check
33+
* Ping AWM & MBE Connection
34+
*
35+
* Test your connection between the Advanced Wallet Manager (AWM) and the Master Bitgo Express (MBE) servers.
3436
*
3537
* @tag Advanced Wallets
3638
* @operationId v1.advancedwalletmanager.ping
37-
* @private
3839
*/
40+
const PingAwmRoute = httpRoute({
41+
method: 'POST',
42+
path: '/ping/advancedWalletManager',
43+
request: httpRequest({}),
44+
response: PingAwmResponse,
45+
description: 'Ping the advanced wallet manager server',
46+
});
47+
48+
/**
49+
* Check AWM & MBE Version
50+
*
51+
* Check your version of the connection between the Advanced Wallet Manager (AWM) and the Master Bitgo Express (MBE) servers.
52+
*
53+
* @tag Advanced Wallets
54+
* @operationId v1.advancedwalletmanager.version
55+
*/
56+
const VersionAwmRoute = httpRoute({
57+
method: 'GET',
58+
path: '/version/advancedWalletManager',
59+
request: httpRequest({}),
60+
response: VersionAwmResponse,
61+
description: 'Get the version of the advanced wallet manager server',
62+
});
63+
3964
export const AdvancedWalletManagerHealthSpec = apiSpec({
4065
'v1.advancedwalletmanager.ping': {
41-
post: httpRoute({
42-
method: 'POST',
43-
path: '/ping/advancedWalletManager',
44-
request: httpRequest({}),
45-
response: PingAwmResponse,
46-
description: 'Ping the advanced wallet manager server',
47-
}),
66+
post: PingAwmRoute,
4867
},
49-
/**
50-
* Version Check
51-
*
52-
* @tag Advanced Wallets
53-
* @operationId v1.advancedwalletmanager.version
54-
* @private
55-
*/
5668
'v1.advancedwalletmanager.version': {
57-
get: httpRoute({
58-
method: 'GET',
59-
path: '/version/advancedWalletManager',
60-
request: httpRequest({}),
61-
response: VersionAwmResponse,
62-
description: 'Get the version of the advanced wallet manager server',
63-
}),
69+
get: VersionAwmRoute,
6470
},
6571
});
6672

src/masterBitgoExpress/routers/healthCheck.ts

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,37 +16,44 @@ const VersionResponse: HttpResponse = {
1616
};
1717

1818
/**
19-
* Ping Check
19+
* Ping MBE
20+
*
21+
* Test your connection to the Master Bitgo Express (MBE) server.
2022
*
2123
* @tag Advanced Wallets
22-
* @operationId v1.health.ping
23-
* @private
24+
* @operationId v1.health.ping.mbe
2425
*/
26+
const PingRoute = httpRoute({
27+
method: 'POST',
28+
path: '/ping',
29+
request: httpRequest({}),
30+
response: PingResponse,
31+
description: 'Health check endpoint that returns server status',
32+
});
33+
34+
/**
35+
* Check MBE Version
36+
*
37+
* Check your version of the Master Bitgo Express (MBE) server.
38+
*
39+
* @tag Advanced Wallets
40+
* @operationId v1.health.version.mbe
41+
*/
42+
const VersionRoute = httpRoute({
43+
method: 'GET',
44+
path: '/version',
45+
request: httpRequest({}),
46+
response: VersionResponse,
47+
description: 'Returns the current version of the server',
48+
});
49+
2550
export const HealthCheckApiSpec = apiSpec({
26-
'v1.health.ping': {
27-
post: httpRoute({
28-
method: 'POST',
29-
path: '/ping',
30-
request: httpRequest({}),
31-
response: PingResponse,
32-
description: 'Health check endpoint that returns server status',
33-
}),
51+
'v1.health.ping.mbe': {
52+
post: PingRoute,
3453
},
35-
/**
36-
* Version Check
37-
*
38-
* @tag Advanced Wallets
39-
* @operationId v1.health.version
40-
* @private
41-
*/
42-
'v1.health.version': {
43-
get: httpRoute({
44-
method: 'GET',
45-
path: '/version',
46-
request: httpRequest({}),
47-
response: VersionResponse,
48-
description: 'Returns the current version of the server',
49-
}),
54+
55+
'v1.health.version.mbe': {
56+
get: VersionRoute,
5057
},
5158
});
5259

@@ -59,7 +66,7 @@ export function createHealthCheckRouter(
5966
});
6067

6168
// Ping endpoint handler
62-
router.post('v1.health.ping', [
69+
router.post('v1.health.ping.mbe', [
6370
responseHandler(() =>
6471
Response.ok({
6572
status: `${serverType} server is ok!`,
@@ -69,7 +76,7 @@ export function createHealthCheckRouter(
6976
]);
7077

7178
// Version endpoint handler
72-
router.get('v1.health.version', [
79+
router.get('v1.health.version.mbe', [
7380
responseHandler(() =>
7481
Response.ok({
7582
version: pjson.version,

0 commit comments

Comments
 (0)