Skip to content

TypeScript Get URL Application Latest Upgrade Information

Use this method to get the latest upgrade strategy for URL applications.

Request Parameter List

ParameterTypeDescription
requestUrlUpgradeRequestSet specific interface request parameters, please refer to URL Application Get Upgrade Strategy

Return Value List

Return ValueTypeDescription
resultUrlUpgradeResponseInterface return value, specific interface return parameters, please refer to URL Application Get Upgrade Strategy

Example Code

You can use the following code to get the latest upgrade strategy.

typescript
const {
    default: Client,
    Config,
    UrlUpgradeRequest,
    FileUpgradeRequest
} = require('@toolsetlink/upgradelink-api-typescript');

// Test getting URL upgrade information
async function testGetUrlUpgrade() {
    try {
        // Initialize client
        const config = new Config({
            accessKey: 'mui2W50H1j-OC4xD6PgQag',
            accessSecret: 'PEbdHFGC0uO_Pch7XWBQTMsFRxKPQAM2565eP8LJ3gc',
        });
        const client = new Client(config);

        // Construct request parameters
        const request = new UrlUpgradeRequest({
            urlKey: 'uJ47NPeT7qjLa1gL3sVHqw',
            versionCode: 1,
            appointVersionCode: 0,
            devModelKey: '',
            devKey: ''
        });

        // Send request
        const response = await client.UrlUpgrade(request);

        // Print response results
        console.log('\nURL upgrade information response:');
        console.log(`code: ${response.code}`);
        console.log(`msg: ${response.msg}`);
        console.log('data:');
        console.log(`  urlKey: ${response.data.urlKey}`);
        console.log(`  versionName: ${response.data.versionName}`);
        console.log(`  versionCode: ${response.data.versionCode}`);
        console.log(`  urlPath: ${response.data.urlPath}`);
        console.log(`  upgradeType: ${response.data.upgradeType}`);
        console.log(`  promptUpgradeContent: ${response.data.promptUpgradeContent}`);
    } catch (error) {
        console.error('\nFailed to get URL upgrade information:', error);
    }
}

toolsetlink@163.com