
Research
/Security News
Coruna Respawned: Compromised art-template npm Package Leads to iOS Browser Exploit Kit
Compromised npm package art-template delivered a Coruna-like iOS Safari exploit framework through a watering-hole attack.
@cloudbase/wx-cloud-client-sdk
Advanced tools
微信云开发客户端 SDK,提供数据模型、MySQL/RDB 数据库和用户认证能力。
npm install @cloudbase/wx-cloud-client-sdk
import { init } from '@cloudbase/wx-cloud-client-sdk';
// 使用微信云开发实例初始化
const client = init(wx.cloud, {
envId: 'your-env-id',
});
// 创建数据
const { data } = await client.models.yourModel.create({
data: { title: 'Hello', content: 'World' },
});
// 查询列表
const {
data: { records, total },
} = await client.models.yourModel.list({
filter: { where: { title: { $eq: 'Hello' } } },
pageSize: 10,
pageNumber: 1,
getCount: true,
});
// 更新数据
await client.models.yourModel.update({
data: { title: 'Updated' },
filter: { where: { _id: { $eq: 'record-id' } } },
});
// 删除数据
await client.models.yourModel.delete({
filter: { where: { _id: { $eq: 'record-id' } } },
});
// 获取数据库客户端
const mysql = client.mysql({ database: 'your-database' });
// 或使用别名
const rdb = client.rdb({ database: 'your-database' });
// 查询所有字段
const users = await mysql.from('users').select('*');
// 查询指定字段
const users = await mysql.from('users').select('id, name, email');
// 条件查询
const activeUsers = await mysql.from('users').select('*').eq('status', 'active');
// 多条件查询
const result = await mysql
.from('users')
.select('*')
.eq('status', 'active')
.gte('age', 18)
.order('created_at', { ascending: false })
.limit(10);
// 插入单条
await mysql.from('users').insert({ name: 'test', email: 'test@example.com' });
// 插入多条
await mysql.from('users').insert([
{ name: 'user1', email: 'user1@example.com' },
{ name: 'user2', email: 'user2@example.com' },
]);
await mysql.from('users').update({ status: 'inactive' }).eq('id', 1);
await mysql.from('users').delete().eq('id', 1);
// 获取 auth 实例
const auth = client.auth;
// 微信小程序 OpenID 静默登录,用户不存在则注册成外部注册用户
await auth.signInWithOpenId();
// 获取登录状态
const { data } = auth.getSession();
// 登出
await auth.signOut();
初始化 SDK(使用云函数调用)。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| cloud | CloudBaseInstance | 是 | 微信云开发实例 |
| options.envId | string | 否 | 环境 ID |
create(params) - 创建单条数据createMany(params) - 批量创建数据update(params) - 更新单条数据updateMany(params) - 批量更新数据upsert(params) - 创建或更新数据delete(params) - 删除单条数据deleteMany(params) - 批量删除数据get(params) - 获取单条数据list(params) - 获取数据列表runSQLTemplate(params) - 执行 SQL 模板FAQs
wx cloud client sdk
The npm package @cloudbase/wx-cloud-client-sdk receives a total of 9,463 weekly downloads. As such, @cloudbase/wx-cloud-client-sdk popularity was classified as popular.
We found that @cloudbase/wx-cloud-client-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 14 open source maintainers 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
Compromised npm package art-template delivered a Coruna-like iOS Safari exploit framework through a watering-hole attack.

Company News
As AI accelerates how code is written and shipped, Socket is scaling to protect the software supply chain from the growing wave of attacks targeting open source dependencies.

Company News
Socket is scaling to defend open source against supply chain attacks as AI accelerates software development.