@cloud/document - v25.1.0

AstroZero JavaScript standard library

This article is an overview of the'AstroZero' platform JavaScript standard library.

For more information on the features of the'AstroZero' JavaScript engine, please read:

AstroZero JavaScript Engine Introduction

Before reading each specific standard library usage, read the following topic to give you an idea of how to invoke the AstroZero script:

How does use Action to invoke scripts?

System

context

The context library provides basic information for obtaining the execution context of the system, such as

  • Obtain the login user information: getUserName, getUserId, getLocale
  • Obtain the login token: getToken
  • Obtain the time zone information: login user time zone getTimeZone, tenant time zone getOrganizationTimeZone -......

sys

sys provides the ability to invoke some common operations of the system engine, such as:

  • Invoke the BO interface invokeSimpleBo.
  • Invoke Flow: inovkeFlow
  • Send an asynchronous event: sendEvent, sendDelayEvent
  • Send system email: sendEmail
  • Send restaction: sendRest -......

date

date is a complex library. Its complexity lies not in the use of interfaces, but in the use of the AstroZero time zone.

For details, see Time Processing.

error

error defines the error handling mechanism of the AstroZero platform.

runtime

runtime provides some runtime-related functions, such as:

  • Sleep: sleep
  • Obtain stack information: stack

Core Engine Library

Network

http

Supports basic http client functions.

multipart

Uploading files using multipart/form-data is supported in the following scenarios: Example of uploading a file to the

Other common libraries involved in network operations

Encryption and decryption

crypto

Supports common encryption and decryption functions, such as:

  • Symmetric algorithm: AES CBC, AES GCM
  • Asymmetric algorithm: RSA
  • Hash algorithm: MD5, SHA1, SHA256 -......

For details, see crypto Usage Example.

##Database

object

The object encapsulates the CRUD operation of the object engine. For details, see the following: object Usage Example

sql

sql encapsulates SQL statements. For details, see: sql Usage Example

For details about the syntax of sql, see sql Syntax.

Other databases involved in database operations:

Third-party system interconnection

Tool Library

Unit Test

How to do unit testing, please refer to the document: