@shencom/api
Version:
shencom api group
1,528 lines (1,506 loc) • 53.7 kB
TypeScript
import { Instance, RequestConfig } from '@shencom/request';
type Http = Instance;
/**
* 初始化 API 配置。此函数应在应用启动时调用一次。
* @param http Http 实例
* @param url API 基础 URL
*/
declare function init(http: Http, url: string): void;
declare module 'axios' {
interface AxiosRequestConfig {
isFilterEmpty?: boolean;
errcode?: string;
}
}
interface ScResponse<T> {
data: T;
errcode: string;
errmsg: string;
}
/** 展开对象类型 */
type Unfurl<T> = T extends Record<string, unknown> ? { [K in keyof T]: T[K] } : T;
type Dictionary<T = any> = Record<string, T>;
/** 类型二选一 */
type OneOf<T, U> =
| ({ [K in keyof T]?: undefined } & U)
| ({ [K in keyof U]?: undefined } & T) extends infer O
? { [K in keyof O]: O[K] }
: never;
type ResUserInfo = Unfurl<SC.User.RootInfo>;
interface ResAdditionalUserInfo {
additionalInformation: ResUserInfo;
}
/** 获取sccode */
declare const ApiGetScCode: () => Promise<ScResponse<{
code: string;
}>>;
/** sccode 登录 */
declare const ApiScCodeLogin: (code: string, headers?: Record<string, any>) => Promise<ScResponse<SC.User.RootInfo>>;
type ReqPhoneAndPassword = Unfurl<{
phone: string;
password: string;
}>;
declare const ApiPhoneAndPasswordLogin: (body: ReqPhoneAndPassword, headers?: Record<string, any>) => Promise<ScResponse<SC.User.RootInfo>>;
type ReqScOAuthSecuser = Unfurl<{
/** 应用ID */
appId: string;
/** 应用密钥 */
appSecret?: string;
/** 向量 */
iv?: string;
/** aesKey */
key?: string;
/** 跳转租户的 scid,若需要自动创建新用户时自动关联指定权限,才传此参数 */
scid?: string;
}>;
declare const ApiScOAuthSecuser: (params: ReqScOAuthSecuser, headers?: Record<string, any>) => Promise<ScResponse<{
appId: string;
appSecret?: string | undefined;
iv?: string | undefined;
key?: string | undefined;
scid?: string | undefined;
}>>;
type ReqScOAuthToken = Unfurl<{
/** 应用ID */
appid: string;
/** 随机值 */
content: string;
/** 签名 */
nonce: string;
/** 时间戳 */
signature: string;
/** 内容 */
timestamp: string;
}>;
declare const ApiScOAuthLogin: (params: ReqScOAuthToken, headers?: Record<string, any>) => Promise<ScResponse<SC.User.RootInfo>>;
/** refreshToken续期token */
declare const ApiRefreshToken: (refreshToken: string, headers?: Record<string, any>) => Promise<ScResponse<SC.User.RootInfo>>;
interface ImageCode {
/** 图形验证码 */
imageCode: string;
/** 图形验证码的校验码 */
uuid: string;
}
interface SmsCode {
/** 短信验证码 */
code: string;
}
type ReqPhoneOrUsernameAndPasswordAndCode = OneOf<ImageCode, SmsCode> & {
username: string;
password: string;
};
/**
* 租户端
* - 手机号 + 密码 + 验证码
* - 用户名 + 密码 + 验证码
* - 手机号 + 密码 + 图形验证码
* - 用户名 + 密码 + 图形验证码
*
* @description 短信验证需要使用有权限的接口发送
*/
declare const ApiPhoneOrUsernameAndPasswordAndCodeLogin: (body: ReqPhoneOrUsernameAndPasswordAndCode, headers?: Record<string, any>) => Promise<ScResponse<ResAdditionalUserInfo>>;
/**
* 平台端
* - 手机号 + 密码 + 验证码
* - 用户名 + 密码 + 验证码
* - 手机号 + 密码 + 图形验证码
* - 用户名 + 密码 + 图形验证码
*
* @description 短信验证需要使用平台端的接口发送
*/
declare const ApiPhoneOrUsernameAndPasswordAndCodeLoginPlatform: (body: ReqPhoneOrUsernameAndPasswordAndCode, headers?: Record<string, any>) => Promise<ScResponse<ResAdditionalUserInfo>>;
interface ResPhoneOrUsernameAndPassword {
/** 手机号 | 用户名 */
username: string;
/** 密码 */
password: string;
}
/**
* 手机号或用户名 + 密码登录
* - 手机号 + 密码
* - 用户名 + 密码
*/
declare const ApiPhoneOrUsernameAndPasswordLogin: (body: ResPhoneOrUsernameAndPassword, headers?: Record<string, any>) => Promise<ScResponse<ResAdditionalUserInfo>>;
/** 租户端-更新系统用户信息 */
declare const ApiSysUpdateInfo: (body: Unfurl<SC.User.UpdateSysInfo>, headers?: Record<string, any>) => Promise<ScResponse<SC.User.Info>>;
/** 平台端-更新系统用户信息 */
declare const ApiSysUpdateInfoPlatform: (body: Unfurl<SC.User.UpdateSysInfo>, headers?: Record<string, any>) => Promise<ScResponse<SC.User.Info>>;
interface ReqPhoneAndCodeLoginOrRegister {
/** 手机号 */
phone: string;
/** 验证码 */
code: string;
}
/** 手机号验证码登录
* @description 未注册的手机号,会自动注册
*/
declare const ApiPhoneAndCodeLoginOrRegister: (body: ReqPhoneAndCodeLoginOrRegister, headers?: Record<string, any>) => Promise<ScResponse<SC.User.RootInfo>>;
interface ReqPhoneAndCodeLogin {
/** 手机号 */
phone: string;
/** 验证码 */
code: string;
}
/** 手机号验证码登录 */
declare const ApiPhoneAndCodeLogin: (body: ReqPhoneAndCodeLogin, headers?: Record<string, any>) => Promise<ScResponse<SC.User.RootInfo>>;
/** 获取明文的当前系统用户信息 */
declare const ApiGetPlaintextUserInfo: () => Promise<ScResponse<SC.User.Info>>;
interface ReqUserSysUpdate {
/** userId */
id: string;
/** 旧密码 */
oldPassword: string;
/** 新密码 */
password: string;
}
/** 租户端-系统用户自行更改密码 */
declare const ApiUserSysUpdate: (body: ReqUserSysUpdate, headers?: Record<string, any>) => Promise<ScResponse<boolean>>;
/** 平台端-系统用户自行更改密码 */
declare const ApiUserSysUpdatePlatform: (body: ReqUserSysUpdate, headers?: Record<string, any>) => Promise<ScResponse<boolean>>;
interface ReqResetPwd {
/** 手机号或用户名 */
param: string;
/** 验证码 */
code: string;
/** 新密码 */
password: string;
}
/** 租户端-通过手机号或用户名找回密码 */
declare const ApiResetPwd: (body: ReqResetPwd, headers?: Record<string, any>) => Promise<ScResponse<void>>;
/** 平台端-通过手机号或用户名找回密码 */
declare const ApiResetPwdPlatform: (body: ReqResetPwd, headers?: Record<string, any>) => Promise<ScResponse<void>>;
interface ResNeedChangePassword {
/** 是否需要修改密码 */
needChange: boolean;
/** 上次修改密码时间 */
lastChangePwdTime: string;
/** 1 为首次密码变更 2 为定期密码更新 */
changeType?: number;
/** 变更频率 */
frequencyOfPwdChanges?: number;
}
/** 是否需要修改密码 */
declare const ApiNeedChangePwd: (headers?: Record<string, any>) => Promise<ScResponse<ResNeedChangePassword>>;
interface ReqNeedGraphic {
/** 手机号或用户名 */
username: string;
}
/**
* 判断当前租户发送短信是否需要图形验证
* @deprecated 获取验证码接口已经做了图形验证
* @return {boolean} 是否需要验证码
*/
declare const ApiNeedGraphic: (body: ReqNeedGraphic, headers?: Record<string, any>) => Promise<ScResponse<boolean>>;
/** 手机号或用户名 */
type ReqValidateImage = OneOf<{
username?: string;
}, OneOf<{
param?: string;
}, {
phone?: string;
}>>;
interface ResValidateImage {
image: string;
}
/** 获取图形验证码 */
declare const ApiValidateImage: (body: ReqValidateImage, headers?: Record<string, any>) => Promise<ScResponse<ResValidateImage>>;
/** 登出 */
declare const ApiLogOut: (headers?: Record<string, any>) => Promise<ScResponse<{
[x: string]: any;
}>>;
interface ReqIlhLogin {
appid: string;
content: string;
nonce: string;
timestamp: string;
signature: string;
}
interface ResIlhOauthLogin {
openid: string;
phoneNumber: string;
oAuth2AccessToken: SC.User.RootInfo;
tokenid: string;
creditableLevelOfAccount: string;
}
declare const ApiIlhOauthLogin: (body: ReqIlhLogin, headers?: Record<string, any>) => Promise<ScResponse<ResIlhOauthLogin>>;
interface ReqWechatBindPhoneByEncrypt {
encryptedData: string;
iv: string;
appid: string;
openid: string;
code: string;
}
interface ReqWechatBindPhoneByRecord {
code: string;
appid: string;
/** 使用历史绑定账号登录的一次性 key */
recordId?: string;
}
type ReqWechatBindPhone = ReqWechatBindPhoneByEncrypt | ReqWechatBindPhoneByRecord;
/** 微信小程序手机号绑定并登录 */
declare const ApiWechatMiniBindPhone: (body: Unfurl<ReqWechatBindPhone>, headers?: Record<string, any>) => Promise<ScResponse<SC.User.RootInfo>>;
interface ReqWechatMiniLogin {
code: string;
appid: string;
}
/** 微信小程序登录 */
declare const ApiWechatMiniLogin: (body: Unfurl<ReqWechatMiniLogin>, headers?: Record<string, any>) => Promise<ScResponse<SC.User.RootInfo>>;
type ResWechatCodeLogin = {
openid: string;
oAuth2AccessToken: SC.User.RootInfo;
} | string;
/** 微信二维码登录 */
declare const ApiWechatCodeLogin: (code: string) => Promise<ScResponse<ResWechatCodeLogin>>;
/** 更新微信信息 */
declare const ApiWechatUpdateInfo: (body: Unfurl<SC.User.UpdateWxInfo>, headers?: Record<string, any>) => Promise<ScResponse<SC.User.RootInfo>>;
/** 退出微信登录状态 */
declare const ApiWechatLogout: (headers?: Record<string, any>) => Promise<ScResponse<{
[x: string]: any;
}>>;
interface ReqCodeBindPhone {
/** 手机号 */
phone: string;
/** 验证码 */
code: string;
/** 微信 token */
wxToken?: string;
}
/** 绑定微信用户登录 */
declare const ApiWechatCodeBindPhone: (body: Unfurl<ReqCodeBindPhone>, headers?: Record<string, any>) => Promise<ScResponse<SC.User.RootInfo>>;
interface ReqWechatCodeInfo {
/** 静默授权 code */
code: string;
/** 当前应用 scid */
scid: string;
}
interface ResWechatCodeInfo {
user: SC.User.Info;
sctoken: string;
expiration: number;
refreshToken: SC.User.RefreshToken;
}
/** 通过 code 获取用户信息 */
declare const ApiWechatCodeAuth: (body: ReqWechatCodeInfo, headers?: Record<string, any>) => Promise<ScResponse<ResWechatCodeInfo>>;
interface ReqWechatAuthUrl {
scid: string;
}
interface ResWechatAuthUrl {
redirect_url: string;
}
/** 获取授权跳转链接 */
declare const ApiWechatAuthUrl: (body: ReqWechatAuthUrl, headers?: Record<string, any>) => Promise<ScResponse<ResWechatAuthUrl>>;
interface ReqWechatUserRecords {
/** 静默授权 code */
code: string;
/** 当前小程序 appid */
appid: string;
}
interface ResWechatUserRecords {
/** 用于账号登录的一次性key */
id: string;
phone: string;
openid: string;
appid: string;
}
/** 获取微信用户绑定过的账号列表 */
declare const ApiWechatUserRecords: (body: ReqWechatUserRecords, headers?: Record<string, any>) => Promise<ScResponse<ResWechatUserRecords[]>>;
interface ReqWechatBindPhoneUpdate {
code: string;
phone: string;
openid: string;
}
/** 平台端-通过手机号绑定微信扫码登录 */
declare const ApiWechatBindPhonePlatform: (body: ReqWechatBindPhoneUpdate, headers?: Record<string, any>) => Promise<ScResponse<SC.User.RootInfo>>;
/** 租户端-通过手机号绑定微信扫码登录 */
declare const ApiWechatBindPhone: (body: ReqWechatBindPhoneUpdate, headers?: Record<string, any>) => Promise<ScResponse<SC.User.RootInfo>>;
interface ResYzyGetAuthUrl {
code?: string;
/** 授权后重定向地址 */
redirectUri: string;
accessToken?: string;
refreshToken?: string;
}
interface ResYzyToken {
accessToken: string;
refreshToken: string;
expiresIn: number;
}
/**
* 粤政易-获取粤政易授权链接
* @param {ResYzyGetAuthUrl} 授权配置
* @return {string} 授权重定向 uri
*/
declare const ApiYzyGetAuthUrl: (body: ResYzyGetAuthUrl, headers?: Record<string, any>) => Promise<ScResponse<string>>;
/**
* 粤政易-通过授权 code 获取 access_token
* @param {string} 粤政易重定向拼接的 code 参数
* @return {ResYzyToken} 粤政易用户 access_token
*/
declare const ApiYzyCodeAuth: (code: string, headers?: Record<string, any>) => Promise<ScResponse<ResYzyToken>>;
/**
* 粤政易-根据access_token验证登陆状态是否有效
* @param {string} 粤政易 accessToken
* @return {boolean} 有效-true,无效-errcode(5000)
*/
declare const ApiYzyAuthVerify: (accessToken: string, headers?: Record<string, any>) => Promise<ScResponse<boolean>>;
/**
* 粤政易-通过refresh_token置换新的access_toke
* @param {string} 粤政易授权一起返回的 refresh_token
* @return {ResYzyToken} 粤政易用户 access_token
*/
declare const ApiYzyRefreshToken: (refreshToken: string, headers?: Record<string, any>) => Promise<ScResponse<Omit<ResYzyToken, "refreshToken">>>;
/**
* 粤政易-通过access_token获取用户信息
* @param {string} 粤政易 accessToken
* @return {ResIlhOauthLogin} Oauth 授权的用户信息
*/
declare const ApiYzyLogin: (accessToken: string, headers?: Record<string, any>) => Promise<ScResponse<ResIlhOauthLogin>>;
/**
* 粤政易-退出登录
* @param {string} 粤政易 accessToken
* @return {string} 粤政易退出登录的重定向 uri
*/
declare const ApiYzyLogout: (accessToken: string, headers?: Record<string, any>) => Promise<ScResponse<string>>;
interface ManagementSingOptions {
/** `0:私有`,`1:开放`,`默认: 1` */
open?: 0 | 1;
/** 上传到的位置 `0: aliyunoss`,`1: minio`,`默认: 0` */
target?: 0 | 1;
}
interface ManagementUploadOptions extends ManagementSingOptions {
/** 音频文件时长,单位:秒 */
fileLength?: number;
expiry?: number;
}
type Ids$1 = string | string[];
type FileInfo = File | {
path: string;
size: number;
};
/** 文件详情 */
declare const ApiFileShow: (body: {
ids: Ids$1;
}, headers?: Record<string, any>) => Promise<ScResponse<SC.File.Info[]>>;
/**
* 获取oss直传所需Policy和签名
* @param {string} open `0:私有`,`1:开放`,`默认: 1`
* @param {string} target 上传到的位置 上传到的位置 `0: aliyunoss`,`1: minio`,`默认: 0`
*/
declare const ApiFileOssSign: (body?: Unfurl<ManagementSingOptions>, headers?: Record<string, any>) => Promise<ScResponse<SC.OSS.Sign>>;
/** 和 sign 的区别是上传指定的文件 */
type ReqFileOssSignV2 = Unfurl<ManagementSingOptions & {
/** 文件名, 后端主要用于校验文件类型等 */
name: string;
}>;
/**
* 获取oss直传所需Policy和签名 V2
* @param {string} open `0:私有`,`1:开放`,`默认: 1`
* @param {string} target 上传到的位置 上传到的位置 `0: aliyunoss`,`1: minio`,`默认: 0`
* @param {string} name 文件名,需要带上文件后缀,eg:`test.png`
*/
declare const ApiFileOssSignV2: (body: ReqFileOssSignV2, headers?: Record<string, any>) => Promise<ScResponse<SC.OSS.SignV2>>;
type ReqFileOssBatchSignV2 = Unfurl<ManagementSingOptions & {
names: string[];
}>;
/**
* 批量获取oss直传所需Policy和签名 V2
* @param {string} open `0:私有`,`1:开放`,`默认: 1`
* @param {string} target 上传到的位置 上传到的位置 `0: aliyunoss`,`1: minio`,`默认: 0`
* @param {string[]} names 文件名,需要带上文件后缀,eg:`["test.png", "211.jpeg"]`
*/
declare const ApiFileOssBatchSignV2: (body: ReqFileOssBatchSignV2, headers?: Record<string, any>) => Promise<ScResponse<SC.OSS.SignV2[]>>;
interface ReqFileOssUpload extends SC.OSS.Sign {
/** 文件随机名称 */
fileName: string;
/** 文件 */
file: FileInfo;
}
type ResFileOssUpload = Omit<SC.File.Info, 'createdAt' | 'remark' | 'id' | 'memo'>;
/**
* oss签名上传文件
* @param {object} file 文件对象
* @param {object} fileName 文件随机名
* @param {string} accessid OSS 的 `AccessKeyId`
* @param {string} host 上传存储空间的访问域名
* @param {string} signature 签名信息
* @param {string} policy 上传所需policy信息
* @param {string} dir 用户上传文件时指定的前缀
* @link https://help.aliyun.com/document_detail/31988.htm?spm=a2c4g.31925.0.0.67fe5918MHHN8l#reference-smp-nsw-wdb
*/
declare const ApiFileOssUpload: (body: Unfurl<ReqFileOssUpload>, custom?: RequestConfig) => Promise<ResFileOssUpload>;
interface ReqFileOssUploadV2 extends SC.OSS.SignV2 {
/** 文件随机名称 */
fileName: string;
/** 文件 */
file: FileInfo;
}
/**
* oss签名上传文件 V2
* @param {object} file 文件对象
* @param {object} fileName 文件随机名
* @param {string} accessid OSS 的 `AccessKeyId`
* @param {string} host 上传存储空间的访问域名
* @param {string} signature 签名信息
* @param {string} policy 上传所需policy信息
* @param {string} objectName 上传至 oss 的完整文件路径
* @link https://help.aliyun.com/document_detail/31988.htm?spm=a2c4g.31925.0.0.67fe5918MHHN8l#reference-smp-nsw-wdb
*/
declare const ApiFileOssUploadV2: (body: Unfurl<ReqFileOssUploadV2>, custom?: RequestConfig) => Promise<ResFileOssUpload>;
type ReqFileUpdate = Pick<SC.File.Info, 'fileName' | 'name' | 'remoteUrl'> & {
/** etag字段 */
remark?: string;
etag?: string;
fileSize?: number;
};
/** 将 oss 文件信息更新到数据库 */
declare const ApiFileUpdate: (body: Unfurl<ReqFileUpdate>, headers?: Record<string, any>) => Promise<ScResponse<SC.File.Info>>;
type ReqFileUpload = ManagementSingOptions & {
/** 文件信息 */
file: FileInfo;
/** 访问链接是否下载 */
isDownload?: boolean;
/** 通过 isDownload 属性控制 */
disposition?: string;
};
interface ResFileUpload {
id: string;
etag: string;
name: string;
fileName: string;
fileSize: string;
url: string;
}
/** 服务器上传 */
declare const ApiFileUpload: (body: FormData | Unfurl<ReqFileUpload>, custom?: RequestConfig) => Promise<ScResponse<ResFileUpload>>;
interface ResStsToken {
/** oss accessKeyId */
accessid: string;
/** oss accessKeySecret */
accessSecret: string;
/** 过期时间,秒 */
expire: number;
bucket: string;
region: string;
securityToken: string;
}
/**
* 获取临时sts-token【全功能】
*
* @param target 文件源 aliyunoss: 0, minio: 1, 默认: 0
* @param open 文件权限 开放: 0, 私有文件: 1, 默认: 1
*/
declare const ApiFileStsToken: (body?: Unfurl<Partial<ManagementSingOptions & {
bucketName?: string;
}>>, headers?: Record<string, any>) => Promise<ScResponse<ResStsToken>>;
interface PresignedResponse {
id: string;
/** 有效时间 */
expiry: number;
/** 文件名 */
name: string;
/** 文件链接 */
url: string;
}
/**
* 获取私有临时文件访问链接
*
* @param ids id
* @param expiry 有效时间单位秒
* @param target 文件源 aliyunoss: 0, minio: 1, 默认: 0
* @param open 文件权限 开放: 0, 私有文件: 1, 默认: 1
*/
declare const ApiFilePresigned: (body: Unfurl<Omit<ManagementUploadOptions, 'open'>>, headers?: Record<string, any>) => Promise<ScResponse<PresignedResponse[]>>;
/**
* 判断是否重复照片
* @param {string} etag - 文件返回的etag
*/
declare const ApiFileExist: (body: {
etag: string;
}, headers?: Record<string, any>) => Promise<ScResponse<SC.File.Info[]>>;
interface ReqCheckFile {
origin: string;
files: {
id: string;
etag: string;
}[];
}
/**
* 判断重复照片
* @param origin - 业务标识符,若不传则当前检测租户下所有文件
* @param files - 重复的文件列表
* @param files.id - 重复的文件id
* @param files.etag - 重复的文件etag
*/
declare const ApiFileRepeat: (body: ReqCheckFile, headers?: Record<string, any>) => Promise<ScResponse<ReqCheckFile>>;
type Ids = string | string[];
/** gis详情 */
declare const ApiGisShow: (body: {
ids: Ids;
}, headers?: Record<string, any>) => Promise<ScResponse<SC.Gis.Point[]>>;
type ReqGisCreate = Unfurl<{
lat?: number | string;
lng?: number | string;
addr?: string;
mapType?: 'gaode' | 'baidu' | 'tencent';
}>;
/** 创建gis */
declare const ApiGisCreate: (body: ReqGisCreate, headers?: Record<string, any>) => Promise<ScResponse<SC.Gis.Point>>;
/** 根据经纬度获取区域 */
declare const ApiFindRegionByLngLat: (body: {
lng: number;
lat: number;
}, headers?: Record<string, any>) => Promise<ScResponse<{
regionId: string;
name: string;
}[]>>;
/** 获取栏目 tree */
declare const ApiCMSCategoryTree: (body: SC.API.IndexBodyInterface, headers?: Record<string, any>) => Promise<ScResponse<SC.API.IndexInterface<CategoryIndex>>>;
/** 获取栏目 index */
declare const ApiCMSCategoryIndex: (body: SC.API.IndexBodyInterface, headers?: Record<string, any>) => Promise<ScResponse<SC.API.IndexInterface<CategoryIndex>>>;
interface ReqCMSArticlesIndex extends SC.API.IndexBodyInterface {
categoryId?: string;
}
/** 获取内容列表 */
declare const ApiCMSArticlesIndex: (body: ReqCMSArticlesIndex, headers?: Record<string, any>) => Promise<ScResponse<SC.API.IndexInterface<ArticlesIndex>>>;
interface ReqCMSArticlesShow extends Dictionary<any> {
id: string;
}
interface ArticlesDetail extends SC.CSM.Articles {
content: string;
referUrl: string;
}
/** 获取文章内容 */
declare const ApiCMSArticlesShow: (body: Unfurl<ReqCMSArticlesShow>, headers?: Record<string, any>) => Promise<ScResponse<ArticlesDetail>>;
/** 获取公众号JSSDK配置 */
declare const ApiWechatGetConfig: (scid: string) => Promise<ScResponse<wx.ConfigOptions>>;
interface ReqGetYyzSDKConfig {
url: string;
token?: string;
}
interface ResGetYyzSDKConfig {
agentid: string;
appid: jWeixin.ConfigOptions['appId'];
nonce: jWeixin.ConfigOptions['nonceStr'];
timestamp: jWeixin.ConfigOptions['timestamp'];
signature: jWeixin.ConfigOptions['signature'];
}
/** 获取粤政易JSSDK配置 */
declare const ApiYyzGetSDKConfig: ({ url, token }: ReqGetYyzSDKConfig, headers?: Record<string, any>) => Promise<ScResponse<ResGetYyzSDKConfig>>;
interface ReqWechatGetQrcode {
/** 重定向链接 */
redirect: string;
}
/** 获取微信登录二维码 */
declare const ApiWechatGetQrcode: (body: ReqWechatGetQrcode) => Promise<ScResponse<string>>;
interface ResAMapGeocodeGeo {
status: string;
info: string;
infocode: string;
count: string;
geocodes: Geocode[];
}
interface Geocode {
formatted_address: string;
country: string;
province: string;
citycode: string;
city: string;
district: string;
township: string[];
neighborhood: Neighborhood;
building: Neighborhood;
adcode: string;
street: string;
number: string;
location: string;
level: string;
}
interface Neighborhood {
name: string[];
type: string[];
}
interface ReqAMapGeocodeGeo {
/** 规则遵循:国家、省份、城市、区县、城镇、乡村、街道、门牌号码、屋邨、大厦,如:北京市朝阳区阜通东大街6号。 */
address: string;
/** 可选输入内容包括:指定城市的中文(如北京)、指定城市的中文全拼(beijing)、citycode(010)、adcode(110000),不支持县级市。当指定城市查询内容为空时,会进行全国范围内的地址转换检索。adcode信息可参考城市编码表获取 */
city?: string;
}
/**
* 官方接口说明: https://lbs.amap.com/api/webservice/guide/api/georegeo
* @summary 高德-地理编码
* @param key
* @param address 规则遵循:国家、省份、城市、区县、城镇、乡村、街道、门牌号码、屋邨、大厦,如:北京市朝阳区阜通东大街6号。
* @param city 指定查询的城市
*/
declare const ApiAMapGeocodeGeo: (body: Unfurl<ReqAMapGeocodeGeo>, headers?: Record<string, any>) => Promise<ResAMapGeocodeGeo>;
interface ResAMapGeocodeRegeo {
info: string;
infocode: string;
regeocode: Regeocode;
status: string;
}
interface Regeocode {
formatted_address: string;
addressComponent: AddressComponent;
pois: Pois[];
roads: Road[];
roadinters: Roadinter[];
aois: Aois[];
}
interface Aois {
id: string;
name: string;
adcode: string;
location: string;
area: string;
distance: string;
type: string;
}
interface Roadinter {
direction: string;
distance: string;
location: string;
first_id: string;
first_name: string;
second_id: string;
second_name: string;
}
interface Road {
direction: string;
distance: string;
id: string;
location: string;
name: string;
}
interface Pois {
id: string;
name: string;
type: string;
tel: string[];
direction: string;
distance: string;
location: string;
address: string;
poiweight: string;
businessarea: string;
}
interface AddressComponent {
country: string;
province: string;
city: string[];
citycode: string;
district: string;
adcode: string;
township: string;
towncode: string;
neighborhood: {
name: string;
type: string;
};
building: {
name: string;
type: string;
};
streetNumber: StreetNumber;
businessAreas: BusinessArea[];
}
interface BusinessArea {
location: string;
name: string;
id: string;
}
interface StreetNumber {
street: string;
number: string;
location: string;
direction: string;
distance: string;
}
type ReqAMapGeocodeRegeo = Unfurl<{
/** location 经纬度坐标;最多支持20个坐标点;多个点之间用\"|\"分割。 */
location: string;
/** 支持传入POI TYPECODE及名称;支持传入多个POI类型,多值间用“|”分隔 */
poitype?: string;
/** 查询POI的半径范围。取值范围:0~3000,单位:米 */
radius?: number;
/** 参数默认取值是 base,也就是返回基本地址信息;extensions 参数取值为 all 时会返回基本地址信息、附近 POI 内容、道路信息以及道路交叉口信息。 */
extensions?: 'all' | 'base';
/** true为批量查询。batch=false为单点查询 */
batch?: boolean;
/** 以下内容需要 extensions 参数为 all 时才生效。 可选值:0,1 当roadlevel=0时,显示所有道路 当roadlevel=1时,过滤非主干道路,仅输出主干道路数据 */
roadlevel?: 0 | 1;
}>;
/**
* 官方接口说明: https://lbs.amap.com/api/webservice/guide/api/georegeo
* @summary 高德-逆地理编码
* @param key
* @param location 经纬度坐标;最多支持20个坐标点;多个点之间用\"|\"分割。
* @param poitype 支持传入POI TYPECODE及名称;支持传入多个POI类型,多值间用“|”分隔
* @param radius 查询POI的半径范围。取值范围:0~3000,单位:米
* @param extensions 返回结果控制
* @param batch batch=true为批量查询。batch=false为单点查询
* @param roadlevel 可选值:1,当roadlevel=1时,过滤非主干道路,仅输出主干道路数据
*/
declare const ApiAMapGeocodeRegeo: (body: ReqAMapGeocodeRegeo, headers?: Record<string, any>) => Promise<ResAMapGeocodeRegeo>;
interface Forecast {
adcode?: string;
casts?: Cast[];
city?: string;
province?: string;
reporttime?: string;
}
interface Cast {
date: string;
daypower: string;
daytemp: string;
dayweather: string;
daywind: string;
nightpower: string;
nighttemp: string;
nightweather: string;
nightwind: string;
week: string;
}
interface Live {
province: string;
city: string;
adcode: string;
weather: string;
temperature: string;
winddirection: string;
windpower: string;
humidity: string;
reporttime: string;
temperature_float: string;
humidity_float: string;
}
type ReqAMapWeather = Unfurl<{
/** 输入城市的adcode,adcode信息可参考城市编码表 */
city: string;
/** 可选值:base/all base:返回实况天气 all:返回预报天气 */
extensions?: 'base' | 'all';
}>;
/**
* 官方接口说明: https://lbs.amap.com/api/webservice/guide/api/weatherinfo
* @summary 高德-天气查询
* @param key
* @param city 输入城市的adcode,adcode信息可参考城市编码表
* @param extensions 可选值:base/all base:返回实况天气 all:返回预报天气
*/
declare const ApiAMapWeather: (body: ReqAMapWeather, headers?: Record<string, any>) => Promise<{
count: string;
forecasts?: Forecast[] | undefined;
info: string;
infocode: string;
status: string;
lives?: Live[] | undefined;
}>;
type ReqAMapIP = Unfurl<{
ip?: string;
}>;
interface ResAMapIP {
adcode: string;
city: string;
info: string;
infocode: string;
province: string;
rectangle: string;
status: string;
}
/**
* 官方接口说明: https://lbs.amap.com/api/webservice/guide/api/ipconfig
* @summary 高德-IP定位
* @param key
* @param ip 需要搜索的IP地址(仅支持国内) 若用户不填写IP,则取客户http之中的请求来进行定位
*/
declare const ApiAMapIP: (body: ReqAMapIP, headers?: Record<string, any>) => Promise<ResAMapIP>;
interface ReqAMapInputtips {
/** 查询关键词 */
keywords: string;
/**
* 服务可支持传入多个分类,多个类型剑用“|”分隔
* 可选值:POI 分类名称、分类代码
* 此处强烈建议使用分类代码,否则可能会得到不符合预期的结果
*/
type?: string;
/**
* 格式:“X,Y”(经度,纬度),不可以包含空格
* 建议使用 location 参数,可在此 location 附近优先返回搜索关键词信息
* 在请求参数 city 不为空时生效
*/
location?: string;
/**
* 搜索城市
* 可选值:citycode、adcode,不支持县级市。
* 如:010/110000
* adcode 信息可参考 城市编码表 获取。
* 填入此参数后,会尽量优先返回此城市数据,但是不一定仅局限此城市结果,若仅需要某个城市数据请调用 citylimit 参数。
* 如:在深圳市搜天安门,返回北京天安门结果。
*/
city?: string;
/**
* 仅返回指定城市数据
* 可选值:true/false
*/
citylimit?: string;
/**
* 返回的数据类型
* 多种数据类型用“|”分隔,可选值:all-返回所有数据类型、poi-返回POI数据类型、bus-返回公交站点数据类型、busline-返回公交线路数据类型
*/
datatype?: string;
/**
* 数字签名[https://lbs.amap.com/faq/quota-key/key/41169]
*/
sig?: string;
/**
* 返回数据格式类型
* 可选值:JSON,XML
*/
output?: string;
/**
* 回调函数
* callback 值是用户定义的函数名称,此参数只在 output=JSON 时有效
*/
callback?: string;
}
interface ResAMapInputtips {
info: string;
infocode: string;
status: string;
tips: Tip[];
}
interface Tip {
adcode: string;
address: string;
city: string[];
district: string;
id: string;
location: string;
name: string;
typecode: string;
}
/**
* 官方接口说明: https://lbs.amap.com/api/webservice/guide/api-advanced/inputtips
* @summary 高德-输入提示
* @param keywords 输入提示关键字
* @param city 输入提示城市
* @param citylimit 可选值:true/false
* @param type 可选值:POI 分类名称、分类代码
* @param sig 数字签名
* @param location 可选值:X,Y
* @param datatype 可选值:all/poi/bus/busline
* @param output 可选值:json/xml
* @param callback 可选值:回调函数名称
*/
declare const ApiAMapInputtips: (body: ReqAMapInputtips, headers?: Record<string, any>) => Promise<ResAMapInputtips>;
interface QQMapResultRoot<T> {
message: string;
request_id: string;
result: T;
status: number;
}
interface Location {
lat: number;
lng: number;
}
interface Addresscomponent {
nation: string;
province: string;
city: string;
district: string;
street: string;
street_number: string;
}
type ResQQMapGeocodeGeo = QQMapResultRoot<GeocodeGeoResult>;
interface ReqQQMapGeocodeGeo {
key: string;
/** 规则遵循:国家、省份、城市、区县、城镇、乡村、街道、门牌号码、屋邨、大厦,如:北京市朝阳区阜通东大街6号。 */
address: string;
}
interface GeocodeGeoResult {
title: string;
location: Location;
ad_info: GeocodeGeoAdinfo;
address_components: Addresscomponent;
similarity: number;
deviation: number;
reliability: number;
level: number;
}
interface GeocodeGeoAdinfo {
adcode: string;
}
/**
* 官方接口说明: https://lbs.qq.com/service/webService/webServiceGuide/webServiceGcoder
* @summary 腾讯-逆地址解析
* @param key
* @param location 经纬度(GCJ02坐标系),格式: location=lat<纬度>,lng<经度>
* @param getPoi 是否返回周边地点(POI)列表,可选值: 0 不返回(默认) 1 返回
*/
declare const ApiQQMapGeocodeGeo: (body: Unfurl<ReqQQMapGeocodeGeo>, headers?: Record<string, any>) => Promise<ResQQMapGeocodeGeo>;
type ReqQQMapGeocodeRegeo = Unfurl<{
key: string;
/** 经纬度(GCJ02坐标系),格式:location=lat<纬度>,lng<经度> */
location: string;
/** 是否返回周边地点(POI)列表,可选值:
0 不返回(默认)
1 返回
*/
get_poi?: 0 | 1;
/** 周边POI列表控制
* 参考官网
*/
poi_options?: number;
}>;
type ResQQMapGeocodeRegeo = QQMapResultRoot<GeocodeRegeoResult>;
interface GeocodeRegeoResult {
location: Location;
address: string;
formatted_addresses: GeocodeRegeoFormattedaddresses;
address_component: Addresscomponent;
ad_info: GeocodeRegeoAdinfo;
address_reference: GeocodeRegeoAddressReference;
}
interface GeocodeRegeoAddressReference {
business_area: GeocodeRegeoBusinessarea;
famous_area: GeocodeRegeoBusinessarea;
crossroad: GeocodeRegeoBusinessarea;
town: GeocodeRegeoBusinessarea;
street_number: GeocodeRegeoBusinessarea;
street: GeocodeRegeoBusinessarea;
landmark_l2: GeocodeRegeoBusinessarea;
}
interface GeocodeRegeoBusinessarea {
id: string;
title: string;
location: Location;
_distance: number;
_dir_desc: string;
}
interface GeocodeRegeoAdinfo {
nation_code: string;
adcode: string;
city_code: string;
name: string;
location: Location;
nation: string;
province: string;
city: string;
district: string;
}
interface GeocodeRegeoFormattedaddresses {
recommend: string;
rough: string;
}
/**
* 官方接口说明: https://lbs.qq.com/service/webService/webServiceGuide/webServiceGcoder
* @summary 腾讯-逆地址解析
* @param key
* @param location 经纬度(GCJ02坐标系),格式: location=lat<纬度>,lng<经度>
* @param getPoi 是否返回周边地点(POI)列表,可选值: 0 不返回(默认) 1 返回
*/
declare const ApiQQMapGeocodeRegeo: (body: Unfurl<ReqQQMapGeocodeRegeo>, headers?: Record<string, any>) => Promise<ResQQMapGeocodeRegeo>;
type ReqQQMapIP = Unfurl<{
key: string;
ip?: string;
}>;
type ResQQMapIP = QQMapResultRoot<IPResult>;
interface IPResult {
ad_info: IPAdInfo;
ip: string;
location: Location;
}
interface IPAdInfo {
adcode: number;
city: string;
district: string;
nation: string;
province: string;
}
/**
* 官方接口说明: https://lbs.qq.com/service/webService/webServiceGuide/webServiceIp
* @summary 腾讯-IP定位
* @param key
* @param ip IP地址,缺省时会使用请求端的IP
*/
declare const ApiQQMapIP: (body: Unfurl<ReqQQMapIP>, headers?: Record<string, any>) => Promise<ResQQMapIP>;
interface SmsPhone {
phone: string;
}
interface SmsUsername {
username: string;
}
/**
* 租户端-发送短信
* @param {string} phone 手机号
* @return errcode=615002 - 需要图形验证码
* @return errcode=500010 - 您操作太频繁,请稍后再试
*/
declare const ApiSmsTenants: (body: OneOf<SmsPhone, SmsUsername>, headers?: Record<string, any>) => Promise<ScResponse<{
[x: string]: any;
}>>;
/**
* 平台端-发送短信
* @param {string} phone 手机号
* @return errcode=615002 - 需要图形验证码
* @return errcode=500010 - 您操作太频繁,请稍后再试
*/
declare const ApiSmsPlatform: (body: OneOf<SmsPhone, SmsUsername>, headers?: Record<string, any>) => Promise<ScResponse<{
[x: string]: any;
}>>;
/**
* 移动端-发送短信;没有系统用户限制
* @param {string} phone 手机号
*/
declare const ApiSmsUnbound: (body: SmsPhone, headers?: Record<string, any>) => Promise<ScResponse<{
[x: string]: any;
}>>;
declare const sortType: readonly ["ASC", "DESC"];
type SortType = (typeof sortType)[number];
interface ISorts<P extends string = string> {
/** 筛选字段 */
orderField: P;
/** 筛选类型 */
orderType: SortType | (string & {});
}
type IIndexSorts<P extends string = string> = ISorts<P>[];
/**
* 排序参数生成格式方法
*
* @export
* @param {string} prop 排序字段
* @param {SortType} [type] 排序类型 (默认: DESC)
* @param {[string, SortType?][]} params 同 [prop, orderType]
*
* @example
* ```js
* ApiSortsConstruct('aaa') // { orderField: 'aaa', orderType: 'DESC' }
* ApiSortsConstruct('aaa', 'ASC') // { orderField: 'aaa', orderType: 'ASC' }
* ApiSortsConstruct([['aaa', 'ASC'], ['bbb']]) // [{ orderField: 'aaa', orderType: 'ASC' }, { orderField: 'bbb', orderType: 'DESC' }]
* ```
* @returns {IIndexSorts}
*/
declare function ApiSortsConstruct(prop: string, type?: SortType): IIndexSorts;
declare function ApiSortsConstruct(params: [string, SortType?][]): IIndexSorts;
declare function ApiSortsConstruct(params: [string, string?][]): IIndexSorts;
/**
* @deprecated 请使用 ApiSortsConstruct 代替
*/
declare const ApiSortsHandler: typeof ApiSortsConstruct;
/**
* 将排序对象转换为键值对格式
*
* @export
* @param {{ orderField: string, orderType: SortType }} sort 排序对象
* @param {Array<{ orderField: string, orderType: SortType }>} sorts 排序对象数组
*
* @example
* ```js
* ApiSortsDestructure({ orderField: 'aaa', orderType: 'DESC' }) // { "aaa": "DESC" }
* ApiSortsDestructure([{ orderField: 'aaa', orderType: 'DESC' }, { orderField: 'bbb', orderType: 'ASC' }])
* // { "aaa": "DESC", "bbb": "ASC" }
* ```
* @returns {Record<string, SortType>} 键值对格式的排序对象
*/
declare function ApiSortsDestructure(sort: ISorts): Record<string, SortType>;
declare function ApiSortsDestructure(sorts: ISorts[]): Record<string, SortType>;
/**
* 从排序数组中删除指定字段的排序条件
*
* @export
* @param {IIndexSorts} sorts 排序条件数组
* @param {string | string[]} deleteProps 要删除的字段名(单个字符串或字符串数组)
*
* @example
* ```js
* // 删除单个字段的排序
* const sorts = [{ orderField: 'createTime', orderType: 'DESC' }, { orderField: 'updateTime', orderType: 'ASC' }];
* ApiSortsDelete(sorts, 'createTime'); // [{ orderField: 'updateTime', orderType: 'ASC' }]
*
* // 删除多个字段的排序
* const sorts = [
* { orderField: 'createTime', orderType: 'DESC' },
* { orderField: 'updateTime', orderType: 'ASC' },
* { orderField: 'name', orderType: 'ASC' }
* ];
* ApiSortsDelete(sorts, ['createTime', 'name']); // [{ orderField: 'updateTime', orderType: 'ASC' }]
*
* // 当结果为空数组时返回null
* const sorts = [{ orderField: 'createTime', orderType: 'DESC' }];
* ApiSortsDelete(sorts, 'createTime'); // null
* ```
*
* @returns {IIndexSorts | null} 删除后的排序数组,如果为空则返回null
*/
declare function ApiSortsDelete(sorts: IIndexSorts, deleteProps: string | string[]): IIndexSorts | null;
/**
* 查询操作类型枚举
*
* @export
* @enum {string}
*/
declare enum OperateEnum {
/** 等于 */
EQ = "EQ",
/** 小于 */
LT = "LT",
/** 大于 */
GT = "GT",
/** 小于等于 */
LTE = "LTE",
/** 大于等于 */
GTE = "GTE",
/** 不等于 */
NEQ = "NEQ",
/** 包含 */
IN = "IN",
/** 非空 */
NN = "NN",
/** 为空 */
NULL = "NULL",
/** 区间 */
BTW = "BTW",
/** 模糊匹配 */
LIKE = "LIKE",
/** 左模糊匹配 */
LL = "LL",
/** 右模糊匹配 */
RL = "RL"
}
/**
* 查询逻辑关系枚举
*
* @export
* @enum {string}
*/
declare enum LrEnum {
/** 并且 */
AND = "and",
/** 或者 */
OR = "or"
}
declare const LR: readonly [{
readonly label: "并且";
readonly value: LrEnum.AND;
}, {
readonly label: "或者";
readonly value: LrEnum.OR;
}];
declare const operateType: {
readonly number: readonly [{
readonly label: "=";
readonly value: OperateEnum.EQ;
}, {
readonly label: "<";
readonly value: OperateEnum.LT;
}, {
readonly label: ">";
readonly value: OperateEnum.GT;
}, {
readonly label: "≤";
readonly value: OperateEnum.LTE;
}, {
readonly label: "≥";
readonly value: OperateEnum.GTE;
}, {
readonly label: "≠";
readonly value: OperateEnum.NEQ;
}, {
readonly label: "包括";
readonly value: OperateEnum.IN;
}, {
readonly label: "非空";
readonly value: OperateEnum.NN;
}, {
readonly label: "为空";
readonly value: OperateEnum.NULL;
}, {
readonly label: "区间";
readonly value: OperateEnum.BTW;
}];
readonly date: readonly [{
readonly label: "匹配";
readonly value: OperateEnum.LIKE;
}, {
readonly label: "早于";
readonly value: OperateEnum.LT;
}, {
readonly label: "晚于";
readonly value: OperateEnum.GT;
}, {
readonly label: "非空";
readonly value: OperateEnum.NN;
}, {
readonly label: "为空";
readonly value: OperateEnum.NULL;
}];
readonly string: readonly [{
readonly label: "模糊匹配";
readonly value: OperateEnum.LIKE;
}, {
readonly label: "=";
readonly value: OperateEnum.EQ;
}, {
readonly label: "≠";
readonly value: OperateEnum.NEQ;
}, {
readonly label: "包括";
readonly value: OperateEnum.IN;
}, {
readonly label: "左模糊匹配";
readonly value: OperateEnum.LL;
}, {
readonly label: "右模糊匹配";
readonly value: OperateEnum.RL;
}, {
readonly label: "非空";
readonly value: OperateEnum.NN;
}, {
readonly label: "为空";
readonly value: OperateEnum.NULL;
}];
readonly rangeDateTime: readonly [{
readonly label: "介于";
readonly value: OperateEnum.BTW;
}];
readonly select: readonly [{
readonly label: "包括";
readonly value: OperateEnum.IN;
}];
};
type QueryLr = (typeof LR)[number]['value'];
type OperateType = keyof typeof operateType;
type Operate = OperateEnum;
interface IQuery<P extends string = string> {
/** 搜索关联 */
lr?: QueryLr | (string & {});
/** 搜索方式 */
operate: Operate | (string & {});
/** 搜索字段 */
prop: P;
/** 搜索值 */
value: any;
}
type IIndexQuery<P extends string = string> = {
exps: IQuery<P>[];
}[];
interface IIndexInterface<T> {
/** 是否第一页 */
first: boolean;
/** 是否加载完 */
last: boolean;
/** 当前页数 */
number: number;
/** 每页个数 */
size: number;
/** 总数 */
totalElements: number;
/** 总页数 */
totalPages: number;
/** 列表 */
content: T[];
}
interface IIndexBodyInterface<P extends string = string> {
/** 页数,默认: 0 */
page?: number;
/** 个数,默认: 10 */
size?: number;
query?: IIndexQuery<P>;
sorts?: IIndexSorts<P>;
}
interface IExportBodyInterface {
page?: number;
size?: number;
query?: IIndexQuery;
cfg: {
/** 导出模式: 0选中 | 1全部 */
mode: 0 | 1;
/** 导出名称 */
name?: string;
/** 导出类型 */
type: 'XLS' | 'XLSX' | 'CSV' | (string & {});
/** 导出字段名 */
cols: string[];
};
}
declare namespace SC$1 {
namespace API {
/** 操作符 */
type Operate = Operate;
/** 搜索关联 */
type Lr = QueryLr;
/** 搜索类型 */
type Query = IQuery;
/** 筛选字段 */
type Sorts = ISorts;
/** index 接口查询参数类型 */
type IndexQuery = IIndexQuery;
/** index 接口排序参数类型 */
type IndexSorts = IIndexSorts;
/** 分页接口 */
type IndexInterface<T = Record<string, any>> = IIndexInterface<T>;
/** index 接口参数类型 */
type IndexBodyInterface = IIndexBodyInterface;
/** export 接口参数类型 */
type ExportBodyInterface = IExportBodyInterface;
}
}
type QueryValue = string | number | null | undefined;
/**
* 创建单个查询条件表达式
*
* @export
* @param {QueryValue} val 查询的值
* @param {string} prop 后端字段
* @param {Operate} [operate] 筛选条件 (默认: OperateEnum.LIKE)
* @param {QueryLr} [lr] 逻辑关系(and/or)
*
* @example
* ```js
* ApiQueryItemConstruct('张三', 'name') // { value: '张三', prop: 'name', operate: 'LIKE' }
* ApiQueryItemConstruct(100, 'age', OperateEnum.EQ) // { value: 100, prop: 'age', operate: 'EQ' }
* ApiQueryItemConstruct('2022-01-01', 'createTime', OperateEnum.BTW) // { value: '2022-01-01', prop: 'createTime', operate: 'BTW' }
* ApiQueryItemConstruct(null, 'status') // null
* ApiQueryItemConstruct(undefined, 'status') // null
* ApiQueryItemConstruct('', 'status') // null
* ```
* @returns {SC.API.Query | null} 查询条件表达式,如果值为null、undefined或空字符串则返回null
*/
declare function ApiQueryItemConstruct(val: QueryValue, prop: string, operate?: Operate, lr?: QueryLr): SC$1.API.Query | null;
/**
* 查询参数生成格式方法
*
* @export
* @param {string | number | null} val 查询的值
* @param {string} prop 后端字段
* @param {Query['operate']} [operateType] 筛选条件 (默认: string)
* @param {[val, prop, operateType?][]} params - 同 [val, prop, operateType]
*
* @example
* ```js
* ApiQueryHandler('1', 'active')
* ApiQueryHandler('2020-08-03', 'createdAt', OperateEnum.RANGE_DATE_TIME)
* ApiQueryHandler([[1, 'active'], ['2020-08-03', 'createdAt', OperateEnum.RANGE_DATE_TIME, LrEnum.AND]]);
* ```
* @deprecated 请使用 ApiQueryItemConstruct 代替
* @returns {SC.API.IndexQuery}
*/
declare function ApiQueryHandler(val: QueryValue, prop: string, operate?: OperateType | Operate, lr?: QueryLr): SC$1.API.IndexQuery;
declare function ApiQueryHandler(params: [QueryValue, string, (OperateType | Operate)?, QueryLr?][]): SC$1.API.IndexQuery;
/**
* 创建查询条件表达式数组
*
* @export
* @param {QueryValue} val 查询的值
* @param {string} prop 后端字段
* @param {Operate} [operate] 筛选条件 (默认: OperateEnum.LIKE)
* @param {QueryLr} [lr] 逻辑关系(and/or)
* @param {[QueryValue, string, Operate?, QueryLr?][]} params 同 [val, prop, operate, lr]
*
* @example
* ```js
* ApiQueryConstruct('张三', 'name')
* // 返回: [{ value: '张三', prop: 'name', operate: 'LIKE' }]
*
* ApiQueryConstruct([
* [100, 'age', OperateEnum.EQ],
* ['张三', 'name', OperateEnum.LIKE, LrEnum.AND]
* ])
* // 返回: [
* // { value: 100, prop: 'age', operate: 'EQ' },
* // { value: '张三', prop: 'name', operate: 'LIKE', lr: 'and' }
* // ]
* ```
* @returns {SC.API.Query[]} 查询条件表达式数组
*/
declare function ApiQueryConstruct(val: QueryValue, prop: string, operate?: Operate, lr?: QueryLr): SC$1.API.Query[];
declare function ApiQueryConstruct(params: [QueryValue, string, Operate?, QueryLr?][]): SC$1.API.Query[];
/**
* 将查询条件转换为键值对格式
*
* @export
* @param {SC.API.Query} query 单个查询条件
* @param {SC.API.Query[]} queries 查询条件数组
*
* @example
* ```js
* ApiQueryDestructure({ value: '张三', prop: 'name', operate: 'LIKE' }) // { "name": "张三" }
* ApiQueryDestructure([
* { value: 100, prop: 'age', operate: 'EQ' },
* { value: '张三', prop: 'name', operate: 'LIKE', lr: 'and' }
* ]) // { "age": 100, "name": "张三" }
* ```
* @returns {Record<string, any>} 键值对格式的查询条件
*/
declare function ApiQueryDestructure(query: SC$1.API.Query): Record<string, any>;
declare function ApiQueryDestructure(queries: SC$1.API.Query[]): Record<string, any>;
/**
* 向查询条件数组中插入查询条件
*
* @export
* @param {SC.API.Query[]} query 查询条件数组
* @param {SC.API.Query | SC.API.Query[]} insertQuery 要插入的查询条件
*
* @example
* ```js
* // 向查询条件中插入单个条件
* const query = [{ value: 100, prop: 'age', operate: 'EQ' }];
* const newQuery = { value: '张三', prop: 'name', operate: 'LIKE', lr: LrEnum.AND };
* ApiQueryInsert(query, newQuery)
* // 返回: [
* // { value: 100, prop: 'age', operate: 'EQ' },
* // { value: '张三', prop: 'name', operate: 'LIKE', lr: LrEnum.AND }
* // ]
*
* // 向查询条件中插入多个条件
* const query = [{ value: 100, prop: 'age', operate: 'EQ' }];
* const newQueries = [
* { value: '张三', prop: 'name', operate: 'LIKE', lr: LrEnum.AND },
* { value: 1, prop: 'gender', operate: 'EQ', lr: LrEnum.AND }
* ];
* ApiQueryInsert(query, newQueries)
* // 返回: [
* // { value: 100, prop: 'age', operate: 'EQ' },
* // { value: '张三', prop: 'name', operate: 'LIKE', lr: LrEnum.AND },
* // { value: 1, prop: 'gender', operate: 'EQ', lr: LrEnum.AND }
* // ]
* ```
*
* @returns {SC.API.Query[]} 插入后的查询条件数组
*/
declare function ApiQueryInsert(query: SC$1.API.Query[], insertQuery: SC$1.API.Query | SC$1.API.Query[]): SC$1.API.Query[];
/**
* 从查询条件数组中删除指定字段的查询条件
*
* @export
* @param {SC.API.Query[]} query 查询条件数组
* @param {string | string[]} deleteProps 要删除的字段名(单个字符串或字符串数组)
*
* @example
* ```js
* // 删除单个字段的查询条件
* const query = [
* { value: 100, prop: 'age', operate: 'EQ' },
* { value: '张三', prop: 'name', operate: 'LIKE', lr: LrEnum.AND }
* ];
* ApiQueryDelete(query, 'age')
* // 返回: [{ value: '张三', prop: 'name', operate: 'LIKE', lr: LrEnum.AND }]
*
* // 删除多个字段的查询条件
* const query = [
* { value: 100, prop: 'age', operate: 'EQ' },
* { value: '张三', prop: 'name', operate: 'LIKE', lr: LrEnum.AND },
* { value: 1, prop: 'gender', operate: 'EQ', lr: LrEnum.AND }
* ];
* ApiQueryDelete(query, ['age', 'gender'])
* // 返回: [{ value: '张三', prop: 'name', operate: 'LIKE', lr: LrEnum.AND }]
*
* // 当结果为空数组时返回null
* const query = [{ value: 100, prop: 'age', operate: 'EQ' }];
* ApiQueryDelete(query, 'age') // null
* ```
*
* @returns {SC.API.Query[] | null} 删除后的查询条件数组,如果为空则返回null
*/
declare function ApiQueryDelete(query: SC$1.API.Query[], deleteProps: string | string[]): SC$1.API.Query[] | null;
export { ApiAMapGeocodeGeo, ApiAMapGeocodeRegeo, ApiAMapIP, ApiAMapInputtips, ApiAMapWeather, ApiCMSArticlesIndex, ApiCMSArticlesShow, ApiCMSCategoryIndex, ApiCMSCategoryTree, ApiFileExist, ApiFileOssBatchSignV2, ApiFileOssSign, ApiFileOssSignV2, ApiFileOssUpload, ApiFileOssUploadV2, ApiFilePresigned, ApiFileRepeat, ApiFileShow, ApiFileStsToken, ApiFileUpdate, ApiFileUpload, ApiFindRegionByLngLat, ApiGetPlaintextUserInfo, ApiGetScCode, ApiGisCreate, ApiGisShow, ApiIlhOauthLogin, ApiLogOut, ApiNeedChangePwd, ApiNeedGraphic, ApiPhoneAndCodeLogin, ApiPhoneAndCodeLoginOrRegister, ApiPhoneAndPasswordLogin, ApiPhoneOrUsernameAndPasswordAndCodeLogin, ApiPhoneOrUsernameAndPasswordAndCodeLoginPlatform, ApiPhoneOrUsernameAndPasswordLogin, ApiQQMapGeocodeGeo, ApiQQMapGeocodeRegeo, ApiQQMapIP, ApiQueryConstruct, ApiQueryDelete, ApiQueryDestructure, ApiQueryHandler, ApiQueryInsert, ApiQueryItemConstruct, ApiRefreshToken, ApiResetPwd, ApiResetPwdPlatform, ApiScCodeLogin, ApiScOAuthLogin, ApiScOAuthSecuser, ApiSmsPlatform, ApiSmsTenants, ApiSmsUnbound, ApiSortsConstruct, ApiSortsDelete, ApiSortsDestructure, ApiSortsHandler, ApiSysUpdateInfo, ApiSysUpdateInfoPlatform, ApiUserSysUpdate, ApiUserSysUpdatePlatform, ApiValidateImage, ApiWechatAuthUrl, ApiWechatBindPhone, ApiWechatBindPhonePlatform, ApiWechatCodeAuth, ApiWechatCodeBindPhone, ApiWechatCodeLogin, ApiWechatGetConfig, ApiWechatGetQrcode, ApiWechatLogout, ApiWechatMiniBindPhone, ApiWechatMiniLogin, ApiWechatUpdateInfo, ApiWechatUserRecords, ApiYyzGetSDKConfig, ApiYzyAuthVerify, ApiYzyCodeAuth, ApiYzyGetAuthUrl, ApiYzyLogin, ApiYzyLogout, ApiYzyRefreshToken, ArticlesDetail, Forecast, GeocodeGeoResult, GeocodeRegeoResult, IIndexSorts, IPResult, ISorts, Live, LrEnum, OperateEnum, PresignedResponse, QQMapResultRoot, ReqAMapInputtips, ReqCheckFile, ResAMapGeocodeGeo, ResAMapGeocodeRegeo, ResAMapIP, ResAMapInputtips, ResAdditionalUserInfo, ResFileUpload, ResGetYyzSDKConfig, ResIlhOauthLogin, ResNeedChangePassword, ResStsToken, ResValidateImage, ResWechatAuthUrl, ResWechatCodeInfo, ResWechatUserRecords, ResYzyToken, SortType, init, sortType };