Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 34 additions & 28 deletions src/advancedWalletManager/routers/healthCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,43 @@ const VersionResponse: HttpResponse = {
};

/**
* Ping Check
* Ping (AWM)
*
* Test your connection to the Advanced Wallet Manager (AWM) server.
*
* @tag Advanced Wallets
* @operationId advancedwallet.awm.ping
*/
const PingRoute = httpRoute({
method: 'POST',
path: '/ping',
request: httpRequest({}),
response: PingResponse,
description: 'Health check endpoint that returns server status',
});

/**
* Check Version (AWM)
*
* Check your version of the Advanced Wallet Manager (AWM) server.
*
* @tag Advanced Wallets
* @operationId v1.health.ping
* @private
* @operationId advancedwallet.awm.version
*/
const VersionRoute = httpRoute({
method: 'GET',
path: '/version',
request: httpRequest({}),
response: VersionResponse,
description: 'Returns the current version of the server',
});

export const HealthCheckApiSpec = apiSpec({
'v1.health.ping': {
post: httpRoute({
method: 'POST',
path: '/ping',
request: httpRequest({}),
response: PingResponse,
description: 'Health check endpoint that returns server status',
}),
'advancedwallet.awm.ping': {
post: PingRoute,
},
/**
* Version Check
*
* @tag Advanced Wallets
* @operationId v1.health.version
* @private
*/
'v1.health.version': {
get: httpRoute({
method: 'GET',
path: '/version',
request: httpRequest({}),
response: VersionResponse,
description: 'Returns the current version of the server',
}),
'advancedwallet.awm.version': {
get: VersionRoute,
},
});

Expand All @@ -56,7 +62,7 @@ export function createHealthCheckRouter(): WrappedRouter<typeof HealthCheckApiSp
decodeErrorFormatter: customDecodeErrorFormatter,
});
// Ping endpoint handler
router.post('v1.health.ping', [
router.post('advancedwallet.awm.ping', [
responseHandler(() =>
Response.ok({
status: 'advanced wallet manager server is ok!',
Expand All @@ -66,7 +72,7 @@ export function createHealthCheckRouter(): WrappedRouter<typeof HealthCheckApiSp
]);

// Version endpoint handler
router.get('v1.health.version', [
router.get('advancedwallet.awm.version', [
responseHandler(() =>
Response.ok({
version: pjson.version,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ export class AdvancedWalletManagerClient {
async ping(): Promise<PingResponseType> {
try {
logger.info('Pinging Advanced Wallet Manager at: %s', this.baseUrl);
let request = this.apiClient['v1.health.ping'].post({});
let request = this.apiClient['advancedwallet.awm.ping'].post({});

if (this.tlsMode === TlsMode.MTLS) {
request = request.agent(this.createHttpsAgent());
Expand All @@ -371,7 +371,7 @@ export class AdvancedWalletManagerClient {
async getVersion(): Promise<VersionResponseType> {
try {
logger.info('Getting version information from Advanced Wallet Manager');
let request = this.apiClient['v1.health.version'].get({});
let request = this.apiClient['advancedwallet.awm.version'].get({});

if (this.tlsMode === TlsMode.MTLS) {
request = request.agent(this.createHttpsAgent());
Expand Down
2 changes: 1 addition & 1 deletion src/masterBitgoExpress/routers/accelerateRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const AccelerateResponse: HttpResponse = {
* Use this endpoint only with advanced wallets. For other wallet types, use [Accelerate Transaction](https://developers.bitgo.com/reference/expresswalletacceleratetx).
*
* @tag Advanced Wallets
* @operationId advancedwalletacceleratetx
* @operationId advancedwallet.accelerate.tx
*/
export const AccelerateRoute = httpRoute({
method: 'POST',
Expand Down
62 changes: 34 additions & 28 deletions src/masterBitgoExpress/routers/awmExpressHealth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,37 +30,43 @@ const VersionAwmResponse: HttpResponse = {
};

/**
* Ping Check
* Ping (MBE-to-AWM)
*
* Test your connection between the Advanced Wallet Manager (AWM) and the Master Bitgo Express (MBE) servers.
*
* @tag Advanced Wallets
* @operationId advancedwallet.mbe.awm.ping
*/
const PingAwmRoute = httpRoute({
method: 'POST',
path: '/ping/advancedWalletManager',
request: httpRequest({}),
response: PingAwmResponse,
description: 'Ping the advanced wallet manager server',
});

/**
* Check Version (MBE-to-AWM)
*
* Use the Master Bitgo Express (MBE) server to check your version of the Advanced Wallet Manager (AWM) server. Calling this endpoint instructs the MBE server to call [Check AWM Version](https://developers.bitgo.com/reference/v1healthversionawm).
*
* @tag Advanced Wallets
* @operationId v1.advancedwalletmanager.ping
* @private
* @operationId advancedwallet.mbe.awm.version
*/
const VersionAwmRoute = httpRoute({
method: 'GET',
path: '/version/advancedWalletManager',
request: httpRequest({}),
response: VersionAwmResponse,
description: 'Get the version of the advanced wallet manager server',
});

export const AdvancedWalletManagerHealthSpec = apiSpec({
'v1.advancedwalletmanager.ping': {
post: httpRoute({
method: 'POST',
path: '/ping/advancedWalletManager',
request: httpRequest({}),
response: PingAwmResponse,
description: 'Ping the advanced wallet manager server',
}),
'advancedwallet.mbe.awm.ping': {
post: PingAwmRoute,
},
/**
* Version Check
*
* @tag Advanced Wallets
* @operationId v1.advancedwalletmanager.version
* @private
*/
'v1.advancedwalletmanager.version': {
get: httpRoute({
method: 'GET',
path: '/version/advancedWalletManager',
request: httpRequest({}),
response: VersionAwmResponse,
description: 'Get the version of the advanced wallet manager server',
}),
'advancedwallet.mbe.awm.version': {
get: VersionAwmRoute,
},
});

Expand All @@ -76,7 +82,7 @@ export function createAdvancedWalletManagerHealthRouter(
const awmClient = new AdvancedWalletManagerClient(cfg);

// Ping endpoint handler
router.post('v1.advancedwalletmanager.ping', [
router.post('advancedwallet.mbe.awm.ping', [
responseHandler(async () => {
logger.debug('Pinging advanced wallet manager');

Expand All @@ -101,7 +107,7 @@ export function createAdvancedWalletManagerHealthRouter(
}),
]);

router.get('v1.advancedwalletmanager.version', [
router.get('advancedwallet.mbe.awm.version', [
responseHandler(async () => {
try {
// Use the client's getVersion method instead of direct HTTP request
Expand Down
2 changes: 1 addition & 1 deletion src/masterBitgoExpress/routers/consolidateRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const ConsolidateResponse: HttpResponse = {
* Use this endpoint only with advanced wallets. For other wallet types, use [Consolidate account (simple)](https://developers.bitgo.com/reference/expresswalletconsolidateaccount).
*
* @tag Advanced Wallets
* @operationId advancedwalletconsolidate
* @operationId advancedwallet.consolidate
*/
export const ConsolidateRoute = httpRoute({
method: 'POST',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const ConsolidateUnspentsResponse: HttpResponse = {
* Use this endpoint only with advanced wallets. For other wallet types, use [Consolidate unspents (simple)](https://developers.bitgo.com/reference/expresswalletconsolidateunspents).
*
* @tag Advanced Wallets
* @operationId advancedwalletconsolidateunspents
* @operationId advancedwallet.consolidate.unspents
*/
export const ConsolidateUnspentsRoute = httpRoute({
method: 'POST',
Expand Down
2 changes: 1 addition & 1 deletion src/masterBitgoExpress/routers/generateWalletRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ const GenerateWalletRequest = {
* 5. Creates the wallet on BitGo with the 3 keys.
*
* @tag Advanced Wallets
* @operationId advancedwalletgenerate
* @operationId advancedwallet.generate
*/
export const WalletGenerateRoute = httpRoute({
method: 'POST',
Expand Down
63 changes: 35 additions & 28 deletions src/masterBitgoExpress/routers/healthCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,44 @@ const VersionResponse: HttpResponse = {
};

/**
* Ping Check
* Ping (MBE)
*
* Test your connection to the Master Bitgo Express (MBE) server.
*
* @tag Advanced Wallets
* @operationId v1.health.ping
* @private
* @operationId advancedwallet.mbe.ping
*/
const PingRoute = httpRoute({
method: 'POST',
path: '/ping',
request: httpRequest({}),
response: PingResponse,
description: 'Health check endpoint that returns server status',
});

/**
* Check Version (MBE)
*
* Check your version of the Master Bitgo Express (MBE) server.
*
* @tag Advanced Wallets
* @operationId advancedwallet.mbe.version
*/
const VersionRoute = httpRoute({
method: 'GET',
path: '/version',
request: httpRequest({}),
response: VersionResponse,
description: 'Returns the current version of the server',
});

export const HealthCheckApiSpec = apiSpec({
'v1.health.ping': {
post: httpRoute({
method: 'POST',
path: '/ping',
request: httpRequest({}),
response: PingResponse,
description: 'Health check endpoint that returns server status',
}),
'advancedwallet.mbe.ping': {
post: PingRoute,
},
/**
* Version Check
*
* @tag Advanced Wallets
* @operationId v1.health.version
* @private
*/
'v1.health.version': {
get: httpRoute({
method: 'GET',
path: '/version',
request: httpRequest({}),
response: VersionResponse,
description: 'Returns the current version of the server',
}),

'advancedwallet.mbe.version': {
get: VersionRoute,
},
});

Expand All @@ -59,7 +66,7 @@ export function createHealthCheckRouter(
});

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

// Version endpoint handler
router.get('v1.health.version', [
router.get('advancedwallet.mbe.version', [
responseHandler(() =>
Response.ok({
version: pjson.version,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const RecoveryConsolidationsWalletResponse: HttpResponse = {
* Use this endpoint only with advanced wallets. For other wallet types, use the [Wallet Recovery Wizard](https://developers.bitgo.com/docs/wallets-recover#/).
*
* @tag Advanced Wallets
* @operationId advancedwalletconsolidaterecovery
* @operationId advancedwallet.consolidate.recovery
*/
export const RecoveryConsolidationsRoute = httpRoute({
method: 'POST',
Expand Down
2 changes: 1 addition & 1 deletion src/masterBitgoExpress/routers/recoveryRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ const RecoveryWalletRequest = {
* Use this endpoint only with advanced wallets. For other wallet types, use the [Wallet Recovery Wizard](https://developers.bitgo.com/docs/wallets-recover#/).
*
* @tag Advanced Wallets
* @operationId advancedwalletrecovery
* @operationId advancedwallet.recovery
*/
export const RecoveryRoute = httpRoute({
method: 'POST',
Expand Down
2 changes: 1 addition & 1 deletion src/masterBitgoExpress/routers/sendManyRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export const SendManyResponse: HttpResponse = {
* Use this endpoint only with advanced wallets. For other wallet types, use [Send to many](https://developers.bitgo.com/reference/expresswalletsendmany).
*
* @tag Advanced Wallets
* @operationId advancedwalletsendmany
* @operationId advancedwallet.sendmany
*/
export const SendManyRoute = httpRoute({
method: 'POST',
Expand Down
2 changes: 1 addition & 1 deletion src/masterBitgoExpress/routers/signAndSendMpcRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const SignMpcResponse: HttpResponse = {
* Use this endpoint only with advanced wallets. For other wallet types, use [Sign MPC transaction](https://developers.bitgo.com/reference/expresswalletsigntxtss).
*
* @tag Advanced Wallets
* @operationId advancedwalletsigntxtss
* @operationId advancedwallet.sign.tx.tss
*/
export const SignAndSendMpcRoute = httpRoute({
method: 'POST',
Expand Down