凌鲨微应用API大全

@linksaas-minapp/api

获取微应用信息

export interface MinAppInfo {userId: string; //用户ID(未登录为空字符串)userDisplayName: string;crossHttp: boolean;//打开redis代理时会设置redisProxyToken?: string;redisProxyAddr?: string;//打开mongo代理时会设置mongoProxyToken?: string;mongoProxyAddr?: string;//打开sql代理时会设置(目前支持mysql和postgres)sqlProxyToken?: string;sqlProxyAddr?: string;//打开ssh代理是会设置sshProxyToken?: string;sshProxyAddr?: string;
}export function getMinAppInfo(): MinAppInfo | undefined {// eslint-disable-next-line @typescript-eslint/no-unsafe-member-accessreturn (window as any).minApp as MinAppInfo | undefined;
}

min_app_fs

获取本地文件操作的能力,需要用户授权。

使用

import min_app_fs from "@linksaas-minapp/api";

接口

export interface File {file_name: string;file_data: Uint8Array;
}export interface Filter {name: string;extensions: string[];
}//读取本地文件
export async function readFile(projectId: string, multi: boolean, filterName: string = "", extensions: string[] = []): Promise<File[]>;//写本地文件
export async function writeFile(projectId: string, fileName: string, fileData: Uint8Array): Promise<void>;//获取文件或目录
export async function openDialog(title: string, dir: boolean, saveName: string = "", filters: Filter[] = []): Promise<string>;

min_app_shell

打开浏览器访问指定url,需要用户授权。

使用

import min_app_shell from "@linksaas-minapp/api";

接口

export async function openBrowser(projectId: string, url: string): Promise<void> 

min_app_store

供微应用使用的kv数据库,每个微应用的数据是独立的。所有数据都是加密存储的。

使用

import min_app_store from "@linksaas-minapp/api";

接口

export interface KeyValue {key: Uint8Array,value: Uint8Array,
}// 存储数据
export async function setData(key: Uint8Array, value: Uint8Array): Promise<void>;// 根据key获取数据
export async function getData(key: Uint8Array): Promise<Uint8Array>;// 根据key删除数据
export async function removeData(key: Uint8Array): Promise<void>;// 列出所有数据
export async function listAll(): Promise<KeyValue[]>;

@linksaas-minapp/grpc-proxy-api

获取调用grpc接口的能力,需要用户授权。
api可以对proto文件进行编译,生成结果文件。通过结果文件可以获取接口信息,生成调用数据,进行远程调用。

使用

import * as grpc_proxy_api from "@linksaas-minapp/grpc-proxy-api";

接口

export interface InvokeError {error: string;
}export interface MethodInfo {methodName: string;clientStream: boolean;serverStream: boolean;
}export interface ServiceInfo {serviceName: string;methodList: MethodInfo[];
}export interface MethodWithServiceInfo {serviceName: string;method: MethodInfo;
}//获取解析结果文件
export async function getResultFile(grpcApiId: string): Promise<string>;//生成解析结果文件
export async function genResultFile(grpcApiId: string, rootPath: string, importPathList: string[]): Promise<void>;//读取协议描述信息
export async function readProtoDesc(grpcApiId: string): Promise<ServiceInfo[]>;//生成请求数据
export async function genReqData(grpcApiId: string, serviceName: string, methodName: string): Promise<string>;//请求grpc
export async function callMethod(grpcApiId: string, serviceName: string, methodName: string, remoteAddr: string, secure: boolean, reqData: string): Promise<string>;

@linksaas-minapp/mongo-proxy-api

获取访问mongo数据库的能力,需要用户授权。

接口是通过openapi tools自动生成的代码。

ConnectionApi

方法说明
connectionOpenPost连接数mongo据库
connectionClosePost关闭mongo数据库连接
connectionListPost列出所有数据库连接

DatabaseApi

方法说明
databaseListPost列出指定连接上所有数据库

CollectionApi

方法说明
collectionDeletePost删除记录
collectionFindPost查询记录
collectionInsertPost插入记录
collectionListPost列出数据表
collectionUpdatePost更新记录
viewListPost列出索引

@linksaas-minapp/redis-proxy-api

获取访问redis数据库的能力,需要用户授权。

接口是通过openapi tools自动生成的代码。

ConnectionApi

方法说明
openPost连接redis数据库
closePost关闭redis连接
listPost列出redis连接

CmdApi

方法说明
execPost执行redis指令

实现的命令

核心命令

async copy(srcKey: string, destKey: string): Promise<number>;
async del(...keyList: string[]): Promise<number>;
async dump(key: string): Promise<string>;
async exists(...keyList: string[]): Promise<number>;
async expire(key: string, seconds: number, option: "" | "NX" | "XX" | "GT" | "LT" = ""): Promise<number>;
async expireAt(key: string, unixTimeStamp: number, option: "" | "NX" | "XX" | "GT" | "LT" = ""): Promise<number>;
async expireTime(key: string): Promise<number> ;
async keys(pattern: string): Promise<string[]>;
async migrate(host: string, port: number, dbIndex: number, timeout: number, keyList: string[],username: string = "", password: string = "", copy: boolean = false, replace: boolean = false): Promise<string>;
async move(key: string, dbIndex: number): Promise<number>;
async objectEncoding(key: string): Promise<string | null>;
async objectFreq(key: string): Promise<number>;
async objectIdleTime(key: string): Promise<number>;
async objectRefCount(key: string): Promise<number>;
async persist(key: string): Promise<number>;
async pexpire(key: string, milliSeconds: number, option: "" | "NX" | "XX" | "GT" | "LT" = ""): Promise<number> ;
async pexpireAt(key: string, unixMilliSeconds: number, option: "" | "NX" | "XX" | "GT" | "LT" = ""): Promise<number>;
async pexpireTime(key: string): Promise<number>;
async pttl(key: string): Promise<number>;
async randomKey(): Promise<string | null>;
async rename(key: string, newKey: string): Promise<string>;
async renameNx(key: string, newKey: string): Promise<number>;
async restore(key: string, ttl: number, serValue: string, replace: boolean = false, absTtl: boolean = false, idelTime: number = 0, freq: number = 0): Promise<string>;
async scan(cursor: number, pattern: string = "", count: number = 0, scanType: "" | "string" | "list" | "set" | "zset" | "hash" = ""): Promise<unknown>;
async sort(key: string, by: string = "", offset: number = 0, limit: number = 0, getList: string[] = [], sort: "" | "ASC" | "DESC" = "", alpha: boolean = false, storeKey: string = ""): Promise<unknown>;
async sortRo(key: string, by: string = "", offset: number = 0, limit: number = 0, getList: string[] = [], sort: "" | "ASC" | "DESC" = "", alpha: boolean = false): Promise<unknown>;
async touch(keyList: string[]): Promise<number>;
async getType(key: string): Promise<null | string>;
async unlink(keyList:string[]):Promise<number>;

hash相关命令

async hdel(key: string, fieldList: string[]): Promise<number>;
async hexists(key: string, field: string): Promise<number>;
async hget(key: string, field: string): Promise<string | null>;
async hgetAll(key: string): Promise<string[]>;
async hincrBy(key: string, field: string, value: number): Promise<number>;
async hincrByFloat(key: string, field: string, value: number): Promise<string>;
async hkeys(key: string): Promise<string[]>;
async hlen(key: string): Promise<number>;
async hmget(key: string, filedList: string[]): Promise<string[]>;
async hrandField(key: string, count: number = 0, withValues: boolean = false): Promise<unknown>;
async hscan(key: string, cursor: number, pattern: string = "", count: number = 0): Promise<unknown>;
async hset(key: string, fieldValueList: FieldValue[]): Promise<number>;
async hsetnx(key: string, field: string, value: string): Promise<number>;
async hstrlen(key: string, field: string): Promise<number>;
async hvals(key: string): Promise<string[]>;

list相关命令

async blmove(srcKey: string, destKey: string, timeout: number, srcOpt: "LEFT" | "RIGHT", destOpt: "" | "LEFT" | "RIGHT"): Promise<string | null>;
async blmpop(timeout: number, numkeys: number, keyList: string[], opt: "LEFT" | "RIGHT", count: number = 0): Promise<unknown>;
async blpop(keyList: string[], timeout: number): Promise<unknown>;
async brpop(keyList: string[], timeout: number): Promise<unknown>;
async lindex(key: string, index: number): Promise<string | null>;
async linsert(key: string, opt: "BEFORE" | "AFTER", pivot: string, value: string): Promise<number>;
async llen(key: string): Promise<number>;
async lmove(srcKey: string, destKey: string, srcOpt: "LEFT" | "RIGHT", destOpt: "LEFT" | "RIGHT"): Promise<string | null> ;
async lmpop(numkeys: number, keyList: string[], opt: "LEFT" | "RIGHT", count: number = 0): Promise<unknown>;
async lpop(key: string, count: number = 0): Promise<unknown>;
async lpos(key: string, value: string, rank: number = 0, count: number = 0, maxlen: number = 0): Promise<unknown>;
async lpush(key: string, valueList: string[]): Promise<number>;
async lpushx(key: string, valueList: string[]): Promise<number>;
async lrange(key: string, start: number, stop: number): Promise<string[]>;
async lrem(key: string, count: number, value: string): Promise<number>;
async lset(key: string, index: number, value: string): Promise<string>;
async ltrim(key: string, start: number, stop: number): Promise<string>;
async rpop(key: string, count: number = 0): Promise<unknown>;
async rpush(key: string, valueList: string[]): Promise<number>;
async rpushx(key: string, valueList: string[]): Promise<number>;

set相关命令

async sadd(key: string, valueList: string[]): Promise<number>;
async scard(key: string): Promise<number>;
async sdiff(keyList: string[]): Promise<string[]>;
async sdiffStore(destkey: string, keyList: string[]): Promise<number>;
async sinter(keyList: string[]): Promise<string[]>;
async sinterCard(numkeys: number, keyList: string[], limit: number = 0): Promise<number>;
async sinterStore(destkey: string, keyList: string[]): Promise<number>;
async sismember(key: string, value: string): Promise<number>;
async smembers(key: string): Promise<string[]>;
async smismember(key: string, valueList: string[]): Promise<number[]>;
async smove(key: string, destKey: string, value: string): Promise<number>;
async spop(key: string, count: number = 0): Promise<unknown>;
async srandmember(key: string, count: number = 0): Promise<unknown>;
async srem(key: string, valueList: string[]): Promise<number>;
async sscan(key: string, cursor: number, pattern: string = "", count: number = 0): Promise<unknown>;
async sunion(keyList: string[]): Promise<string[]>;
async sunionStore(destKey: string, keyList: string[]): Promise<number>

sortset相关命令

async bzmpop(timeout: number, numkeys: number, keyList: string[], opt: "MIN" | "MAX", count: number = 0): Promise<unknown>;
async bzpopmax(keyList: string[], timeout: number): Promise<unknown>;
async bzpopmin(keyList: string[], timeout: number): Promise<unknown>;
async zadd(key: string, valueScoreList: ValueScore[], option: "" | "NX" | "XX" = "", cmp: "" | "GT" | "LT" = "", ch: boolean = false, incr: boolean = false): Promise<unknown>;
async zcard(key: string): Promise<number>;
async zcount(key: string, min: number, max: number): Promise<number>;
async zdiff(numkeys: number, keyList: string[], withScores: boolean = false): Promise<string[]>;
async zdiffStore(destKey: string, numkeys: number, keyList: string[]): Promise<number>;
async zincrBy(key: string, increment: number, value: string): Promise<string>;
async zinter(numkeys: number, keyList: string[], weightList: number[] = [], aggOpt: "" | "SUM" | "MIN" | "MAX" = "", withScores: boolean = false): Promise<string[]>;
async zinterCard(numkeys: number, keyList: string[], limit: number = 0): Promise<number>;
async zinterStore(destKey: string, numkeys: number, keyList: string[], weightList: number[] = [], aggOpt: "" | "SUM" | "MIN" | "MAX" = ""): Promise<number>;
async zlexCount(key: string, min: number, max: number): Promise<number>;
async zmpop(numkeys: number, keyList: string[], option: "MIN" | "MAX", count: number = 0): Promise<unknown>;
async zmscore(key: string, valueList: string[]): Promise<unknown>;
async zpopMax(key: string, count: number = 0): Promise<string[]>;
async zpopMin(key: string, count: number = 0): Promise<string[]>;
async zrandMember(key: string, count: number = 0, withScores: boolean = false): Promise<unknown>;
async zrange(key: string, start: number, stop: number, byOpt: "" | "BYSCORE" | "BYLEX" = "", rev: boolean = false, offset: number = 0, limit: number = 0, withScores: boolean = false): Promise<string[]>;
async zrangeStore(destKey: string, key: string, min: number, max: number, byOpt: "" | "BYSCORE" | "BYLEX" = "", rev: boolean = false, offset: number = 0, limit: number = 0): Promise<number>;
async zrank(key: string, value: string, withScores: boolean = false): Promise<unknown>;
async zrem(key: string, valueList: string[]): Promise<number>;
async zremRangeByLex(key: string, min: string, max: string): Promise<number>;
async zremRangeByRank(key: string, start: number, stop: number): Promise<number>;
async zremRangeByScore(key: string, min: number, max: number): Promise<number>;
async zrevRank(key: string, value: string, withScores: boolean = false): Promise<unknown>;
async zscan(key: string, cursor: number, pattern: string = "", count: number = 0): Promise<unknown>;
async zscore(key: string, value: string): Promise<string>;
async zunion(numkeys: number, keyList: string[], weightList: number[] = [], aggOpt: "" | "SUM" | "MIN" | "MAX" = "", withScores: boolean = false): Promise<string[]>;
async zunionStore(destKey: string, numkeys: number, keyList: string[], weightList: number[] = [], aggOpt: "" | "SUM" | "MIN" | "MAX" = ""): Promise<number>;

str项目命令

async append(key: string, value: string): Promise<number>;
async decr(key: string): Promise<number>;
async decrBy(key: string, value: number): Promise<number>;
async get(key: string): Promise<null | string>;
async getDel(key: string): Promise<null | string>;
async getEx(key: string, optType: "" | "EX" | "PX" | "EXAT" | "PXAT" | "PERSIST" = "", optValue: number = 0): Promise<null | string>;
async getRange(key: string, start: number, end: number): Promise<string>;
async incr(key: string): Promise<number>;
async incrBy(key: string, value: number): Promise<number>;
async incByFloat(key: string, value: number): Promise<string>;
async mget(keyList: string[]): Promise<unknown[]>;
async mset(keyValueList: KeyValue[]): Promise<string>;
async msetnx(keyValueList: KeyValue[]): Promise<number>;
sync set(key: string, value: string, setType: "" | "NX" | "XX" = "", doGet: boolean = false,optType: "" | "EX" | "PX" | "EXAT" | "PXAT" | "KEEPTTL" = "", optValue: number = 0): Promise<null | string>;
async setRange(key: string, offset: number, value: string): Promise<number>;
async strlen(key: string): Promise<number>;

@linksaas-minapp/sql-proxy-api

获取访问mysql或postgres数据库的能力,需要用户授权。

接口是通过openapi tools自动生成的代码。

ConnectionApi

方法说明
connectionOpenPost连接数据库
connectionClosePost关闭数据库连接
connectionListPost列出数据库连接

DatabaseApi

方法说明
databaseListPost列出数据库

TableApi

方法说明
tableListPost列出数据表
tableQueryPost查询数据表
tableRawQueryPost执行裸sql

@linksaas-minapp/ssh-proxy-api

获取访问ssh服务的能力,需要用户授权。

接口是通过openapi tools自动生成的代码。

ConnectionApi

方法说明
connectionOpenPost连接SSH服务
connectionClosePost关闭SSH连接
connectionListPost列出SSH连接

PortforwardApi

方法说明
portforwardOpenPost打开端口转发
portforwardClosePost关闭端口转发
portforwardListPost列出端口转发

SftpApi

方法说明
sftpDownloadPost下载文件
sftpListDirPost列出目录
sftpMkDirPost创建目录
sftpReadTextPost读取文本内容
sftpRemovePost删除目录或文件
sftpRenamePost文件目录重命名
sftpUploadPost上传文件
sftpWorkDirPost获取当前工作目录

@linksaas-minapp/netutil-api

获取访问网络诊断的能力,需要用户授权。

接口是通过openapi tools自动生成的代码。

DnsApi

方法说明
dnsQueryPost查询dns

IcmpApi

方法说明
icmpPingPost检查机器是否可达

ScanApi

方法说明
scanTcpportPost扫描TCP端口

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/726829.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Dgraph 入门教程二《 快速开始》

1、Clound 云 云地址&#xff1a;Dgraph Cloud 登录Clound 云后&#xff0c;可以用云上的东西操作&#xff0c;可以用谷歌账号或者github账号登录。 启动云 &#xff08;1&#xff09;在云控制台&#xff0c;点击 Launch new backend. &#xff08;2&#xff09;选择计划&…

【PowerMockito:编写单元测试过程中原方法使用@Value注解注入的属性出现空指针】

错误场景 执行到Value的属性时会出现空指针&#xff0c;因为Value的属性为null 解决方法 在测试类调用被测试方法前&#xff0c;提前设置属性值&#xff0c;属性可以先自己定义好 ReflectionTestUtils.setField(endpointConnectionService, "exportUdpList", lis…

修改Yaml文件报错“块映射中的子元素无效”

开发环境 Golandpbyaml文件开发的 错误信息 新增了一个配置项&#xff0c;随后提示&#xff1a;“块映射中的子元素无效” 错误原因 yaml文件的格式要求严格&#xff0c;在:的后面要求有一个 空格&#xff0c;本次就是漏掉错误导致的犯错。 其他可能原因 以下答案来自GP…

工业深度学习异常缺陷检测实战

在工业生产过程中&#xff0c;由于现有技术、工作条件等因素的不足和局限性&#xff0c;极易影响制成品的质量。其中&#xff0c;表面缺陷是产品质量受到影响的最直观表现&#xff0c;因此&#xff0c;为了保证合格率和可靠的质量&#xff0c;必须进行产品表面缺陷检测。 “缺陷…

流动性、价格发现与安全性:NFG在二级市场和交易所的联动效应

每天五分钟一套互联网知识&#xff0c;大家好我是啊浩说模式 在数字经济蓬勃发展的今天&#xff0c;非同质化代币&#xff08;NFT&#xff09;作为区块链技术的重要应用之一&#xff0c;正逐渐改变着传统艺术品、收藏品市场的格局。其中&#xff0c;NFG作为NFT领域的一个细分领…

制片管理工具:提高制片效率的必备工具

一、什么是制片管理工具 制片管理工具是一种为制片人提供支持和协助的软件或工具&#xff0c;并提供一种集中管理制作进度、任务分配、成本预算、资源管理和进度跟踪的方式。它可以帮助制片人在项目的开发、制作和发布方面更有效地进行规划和监督&#xff0c;确保整个流程能够…

LLM | Gemma的初体验

一起来体验一下吧~ 技术报告书&#xff1a;jgoogle/gemma-7b-it Hugging Facegemma-report.pdf (storage.googleapis.com) 代码1 &#xff1a;google-deepmind/gemma: Open weights LLM from Google DeepMind. (github.com) 代码2 &#xff1a;https://github.com/google/gem…

如何根据 tcode查询对应 bapi

有时会查不到&#xff0c;此时需要 google 一下 对应程序&#xff0c;或tcode bapi tcode MD04 MD_STOCK_REQUIREMENTS_LIST_API 参考 https://blog.csdn.net/weixin_45499651/article/details/104050517 SAP ABAP 各模块的BAPI函数汇总 https://blog.csdn.net/yishangbin…

使用cargo国内镜像

1、进入C:\Users\Administrator\.cargo&#xff0c;Administrator是你的用户名。 2、删除.package-cache文件。 3、新建一个config文件&#xff0c;即新建一个txt文档&#xff0c;然后将文档的文件后缀删除。 4、输入一下内容。 #.cargo目录下创建文件config&#xff0c;文…

报名开启丨掘金海外,探寻泛娱乐社交APP出海新风口

随着国内泛娱乐行业用户规模趋于见顶&#xff0c;泛娱乐社交APP转向出海是必然趋势。 根据行业数据显示&#xff0c;有超过35%的国内实时社交企业已启动或者正在规划出海&#xff0c;而其中出海商户的音视频流量增长均超过了100&#xff05;。尤其是在东南亚、中东、拉美等新兴…

Maya笔记 软选择

文章目录 1什么是软选择2注意3如何打开软选择3.1方法一3.2方法二 4调整软选择的范围5衰减模式5.1体积模式5.2表面模式 6衰减曲线 1什么是软选择 也就是渐变选择&#xff0c;从中心点向外影响力度越来越小 软选择针对的是点线面这些模型元素 下图中展示了对被软选择的区域移动…

Rust入门:Rust如何调用C静态库的函数

关于Rust调用C&#xff0c;因为接口比较复杂&#xff0c;貌似Rust不打算支持。而对于C函数&#xff0c;则相对支持较好。 如果要研究C/Rust相互关系的话&#xff0c;可以参考&#xff1a; https://docs.rs/cxx/latest/cxx/ Rust ❤️ C 这里只对调用C静态库做一个最简短的介…

Hi1102A和Hi1105比照浅析

Hi1102A和Hi1105V500都是属于海思旗下的两款WIFIBTGNSSFM四功能一体(江湖俗称四合一)高性能方案&#xff0c;应该可以推出&#xff0c;这个原本是在手机方案集成使用的&#xff0c;本身海思有视频安防主控HI315X系列平台&#xff0c;如果搭配上自己的无线phy芯片&#xff0c;一…

干货教程【软件篇】如何在Windows上安装Python环境以及设置国内源(Miniconda/Anaconda安装)

本文章涉及的所有安装包均在文章下方公众号中&#xff0c;回复python即可获取资源。 也可关注我们的官方网站&#xff1a; 考拉AI 小白安装前须了解一下 Python解释器是用来解释运行我们编写的Python代码。 Python标准库是Python自带的一系列标准模块&#xff0c;提供了各种…

gitlab仓库迁移

简介&#xff1a; 场景1&#xff1a; 公司新开展的业务&#xff0c;需要从WN公司的tfs服务器将代码同步到本公司的gitlab&#xff0c;需要完全克隆&#xff0c;保留所有分支&#xff0c;所有提交记录 场景2&#xff1a; 在gitlab上 前端人员需要完全克隆一个库&#xff0c;也是…

浏览器修改接口返回数据展示在页面上

前端自己调试&#xff0c;想修改接口返回来的数据&#xff0c;然后展示在页面上 举例 接口返回了数据&#xff0c;想要修改此数据 这时就可以修改数据了&#xff0c;修改完成保存 然后刷新页面就会使用本地保存的数据了

Linux编程3.4 进程-进程标识

1、相关函数 #include<unistd.h> #include<sys/types.h> pid_t getpid(void); 获得当前进程ID uid_t getuid(void); 获得当前进程的实际用户ID uit_t geteuid(void); 获得当前进程的有效用户ID git_t getgid(void); 获得当前进程的用户组ID pit_t getppid(…

信号处理--基于单通道脑电信号EEG的睡眠分期评估

背景 睡眠对人体健康很重要。监测人体的睡眠分期对于人体健康和医疗具有重要意义。 亮点 架构在第一层使用两个具有不同滤波器大小的 CNN 和双向 LSTM。 CNN 可以被训练来学习滤波器&#xff0c;以从原始单通道 EEG 中提取时不变特征&#xff0c;而双向 LSTM 可以被训练来将…

数据库-DDL

show databases; 查询所有数据库 select database(); 查询当前数据库 use 数据库名&#xff1b; 使用数据库 creat database[if not exists] 数据库名…