@mikoto_zero/minigame-open-mcp
Version:
TapTap Open API MCP Server - Documentation and Management APIs for TapTap Minigame and H5 Games (Leaderboard, and more features coming)
96 lines (93 loc) • 2.08 kB
TypeScript
/* tslint:disable */
/* eslint-disable */
/* auto-generated by NAPI-RS */
/**
* Compute X-Tap-Sign signature
*
* This function generates the X-Tap-Sign header value using the embedded CLIENT_SECRET.
*
* ## Signature Format
*
* ```text
* sign_parts = "{method}
{url}
{headers_part}
{body}
"
* signature = base64(HMAC-SHA256(sign_parts, CLIENT_SECRET))
* ```
*
* ## Arguments
*
* * `method` - HTTP method (GET, POST, etc.)
* * `url` - Request URL path with query string (e.g., "/api/v1/apps?client_id=xxx")
* * `headers_part` - Sorted X-Tap-* headers in format "key:value
key:value"
* * `body` - Request body (empty string for GET requests)
*
* ## Returns
*
* Base64-encoded HMAC-SHA256 signature
*
* ## Example
*
* ```javascript
* const signature = computeTapSign(
* "POST",
* "/api/v1/apps?client_id=xxx",
* "x-tap-nonce:abc123
x-tap-ts:1234567890",
* '{"name":"test"}'
* );
* ```
*/
export declare function computeTapSign(method: string, url: string, headersPart: string, body: string): string
/**
* Get the embedded CLIENT_ID
*
* This returns the CLIENT_ID that was embedded at compile time.
* Useful for the MCP server to include in API requests.
*
* ## Returns
*
* The CLIENT_ID as a string
*
* ## Example
*
* ```javascript
* const clientId = getClientId();
* // Use in API requests: ?client_id=${clientId}
* ```
*/
export declare function getClientId(): string
/**
* Verify module integrity
*
* Performs basic checks to ensure the native module is intact and functional.
*
* ## Returns
*
* `true` if the module is functional, throws error otherwise
*
* ## Example
*
* ```javascript
* try {
* const ok = verifyIntegrity();
* console.log('Native signer is ready');
* } catch (e) {
* console.error('Native signer failed integrity check:', e);
* }
* ```
*/
export declare function verifyIntegrity(): boolean
/**
* Get version information
*
* Returns the version of the native signer module.
*
* ## Returns
*
* Version string in format "x.y.z"
*/
export declare function getVersion(): string