Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
ts-np-jsdoc
Advanced tools
Zalo Mini apps SDK. Contains all methods separated by categories
import apis from 'zmp-sdk;
▸ getAccessToken(): Promise<any>
Get Access Token.
async
function
getAccessToken
example
apis.getAccessToken().then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Returns: Promise<any>
▸ login(): Promise<any>
Login to call more action.
async
function
Login
example
apis.login().then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Returns: Promise<any>
▸ getVersion(): string
Get the current version of sdk.
Returns: string
Zalo Mini App version.
▸ clearStorage(option
: ClearStorageDataType): Promise<any>
Clears the data cached locally.
async
function
clearStorage
example
apis.clearStorage({
prefix: "prefix" // optional
}).then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Name | Type |
---|---|
option | ClearStorageDataType |
Returns: Promise<any>
▸ getStorage(object
: GetStorageDataType): Promise<any>
Asynchronously gets the content of the specified key from the local cache.
async
function
getStorage
example
apis.getStorage({
key: "key",
isPrefix: false
}).then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Name | Type |
---|---|
object | GetStorageDataType |
Returns: Promise<any>
▸ getStorageInfo(): Promise<any>
Asynchronously gets the information related to the current storage.
async
function
getStorageInfo
example
apis.getStorageInfo().then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Returns: Promise<any>
▸ removeStorage(object
: RemoveStorageDataType): Promise<any>
Removes the specified key from the local cache.
async
function
removeStorage
example
apis.removeStorage({
key: 'key'
}).then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Name | Type |
---|---|
object | RemoveStorageDataType |
Returns: Promise<any>
▸ setStorage(object
: SetStorageDataType): Promise<any>
Stores data in the specified key in the local cache. This operation will overwrite the original content of the key.
async
function
setStorage
example
apis.setStorage({
key: "key",
data: "value"
}).then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Name | Type |
---|---|
object | SetStorageDataType |
Returns: Promise<any>
▸ getNetworkType(): Promise<NetworkTypeSuccessCallback>
Gets the network type.
async
function
getNetworkType
example
zmpApis.getNetworkType().then((res) => {
console.log(res.networkType);
}).catch((error) => {
console.log("Fail");
});
Returns: Promise<NetworkTypeSuccessCallback>
Promise object
▸ setDeviceOrientation(object
: DeviceOrientationType): Promise<any>
Sets the color of the navigation bar in the page.
async
function
setDeviceOrientation
example
apis.setDeviceOrientation({
rotate: 0
}).then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Name | Type |
---|---|
object | DeviceOrientationType |
Returns: Promise<any>
▸ setNavigationBarColor(object
: NavBarColorType): Promise<any>
Sets the color of the navigation bar in the page.
async
function
setNavigationBarColor
example
apis.setNavigationBarColor({
color: "#000000"
}).then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Name | Type |
---|---|
object | NavBarColorType |
Returns: Promise<any>
▸ setNavigationBarLeftButton(object
: NavBarLeftMenuType): Promise<any>
Dynamically sets the left button of the current page.
async
function
setNavigationBarLeftButton
example
apis.setNavigationBarLeftButton({
buttonType: 1,
confirmToExit: 1,
dialogMessage: 'Bạn có muốn đóng app này không?'
}).then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Name | Type |
---|---|
object | NavBarLeftMenuType |
Returns: Promise<any>
▸ setNavigationBarTitle(object
: NavBarTitleType): Promise<any>
Dynamically sets the title of the current page.
async
function
setNavigationBarTitle
example
apis.setNavigationBarTitle({ title: "Current Page" }).then((res) => { console.log("Success"); }).catch((error) => { console.log("Fail"); });
Name | Type |
---|---|
object | NavBarTitleType |
Returns: Promise<any>
▸ getUserInfo(): Promise<any>
Gets user information
async
function
getUserInfo
example
apis.getUserInfo().then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Returns: Promise<any>
FAQs
TS release template
We found that ts-np-jsdoc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.