Help Center/ Huawei Cloud Astro Zero/ API Reference/ APIs/ Scripts/ Obtaining the Built-in Library Declaration of a Script
Updated on 2025-03-21 GMT+08:00

Obtaining the Built-in Library Declaration of a Script

Function

This API is used to obtain the declaration of the built-in library of a script. It is a synchronous API. (Invocation result is returned only after the function execution is complete.) The API can also be used to obtain the TypeScript library that can be invoked by Huawei Cloud Astro Zero, including script functions and function information, and obtain the standard library of the ES5 syntax.

The script functions that can be invoked by Huawei Cloud Astro Zero must be mapped to the go function to become a part of the TypeScript library.

URI

GET Huawei Cloud Astro Zero domain name/u-route/baas/script/v1.0/declaration

Request Parameters

None

Response Parameters

Table 1 Response parameters

Parameter

Type

Description

resCode

String

Explanation

Return code.

Value

If the request is successful, 0 is returned. For details about other error codes, see Error Codes.

resMsg

String

Explanation

Message returned.

Value

If the request is successful, Success is returned. In other cases, an error message is returned.

Result

result object

Explanation

Content returned when the request is successful.

Table 2 result parameters

Parameter

Type

Description

bingo.d.ts

String

Explanation

Invoked script library.

Value

None

lib.es5.d.ts

String

Explanation

Standard library of ES5 syntax.

Value

None

Example Request

To obtain the declaration of a built-in library, send the following request:
GET https://Huawei Cloud Astro Zero domain name/u-route/baas/script/v1.0/declaration

Example Response

{
    "resCode": "0",
    "resMsg": "Success",
    "result": {
        "bingo.d.ts": "string",
        "lib.es5.d.ts": "string"
    }
}

Status Code

See Status Codes.

Error Code

See Error Codes.