
Security News
Risky Biz Podcast: AI Agents Are Raising the Stakes for Software Supply Chain Security
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.
obelisk-card-sdk
Advanced tools
下载 SDK 压缩包并解压后,直接使用:
const ObeliskCardSDK = require('./index.js');
在项目目录下:
npm install ./path/to/sdk
或者将 SDK 文件复制到项目中,然后在 package.json 中添加:
{
"dependencies": {
"obelisk-card-sdk": "file:./path/to/sdk"
}
}
然后运行:
npm install
npm install obelisk-card-sdk
✅ SDK 已发布到 npm! 您可以直接使用 npm 安装。
查看包信息:https://www.npmjs.com/package/obelisk-card-sdk
SDK 需要以下依赖:
npm install axios
注意:crypto 是 Node.js 内置模块,无需安装。
const ObeliskCardSDK = require('obelisk-card-sdk');
// 初始化SDK
const sdk = new ObeliskCardSDK({
apiKey: 'YOUR_API_KEY',
apiSecret: 'YOUR_API_SECRET',
baseUrl: 'https://api.example.com'
});
// 获取商品分类列表
async function example() {
try {
const groups = await sdk.getGroups();
console.log('分类列表:', groups);
// 获取商品列表
const products = await sdk.getProducts({ groupId: 1, page: 1, limit: 20 });
console.log('商品列表:', products);
// 采购商品
const order = await sdk.purchaseProduct({
productId: 1,
quantity: 1,
externalOrderSn: 'ORDER_123456'
});
console.log('订单信息:', order);
} catch (error) {
console.error('错误:', error.message);
}
}
example();
获取商品分类列表
参数:
params.page (number, 可选) - 页码params.limit (number, 可选) - 每页数量返回: Promise<{ groups: Array }>
获取商品列表
参数:
params.groupId (number, 可选) - 分类IDparams.page (number, 可选) - 页码params.limit (number, 可选) - 每页数量返回: Promise<{ products: Array, total: number, page: number, limit: number }>
批量获取商品
参数:
data.products (Array<{productId: number, groupId?: number}>) - 商品查询列表(最多100个),每个元素包含productId(必需)和可选的groupId返回: Promise<{ products: Array }>
查询余额
参数:
params.currency (string, 可选) - 显示货币(如:USDT、CNY)返回: Promise<{ balance: number, currency: string }>
采购商品
参数:
data.productId (number) - 商品IDdata.quantity (number) - 购买数量data.externalOrderSn (string, 可选) - 外部订单号返回: Promise<{ orderSn: string, status: string, carmis: Array<string> }>
查询订单
参数:
orderSn (string) - 订单号(系统订单号或外部订单号)返回: Promise<{ orderSn: string, status: string, carmis: Array<string> }>
获取订单列表
参数:
params.page (number, 可选) - 页码params.limit (number, 可选) - 每页数量params.status (number, 可选) - 订单状态返回: Promise<{ orders: Array, total: number, page: number, limit: number }>
所有方法在请求失败时会抛出错误,请使用 try-catch 捕获:
try {
const result = await sdk.getProducts();
} catch (error) {
console.error('请求失败:', error.message);
}
MIT
FAQs
方尖碑发卡系统供应商API SDK for Node.js
The npm package obelisk-card-sdk receives a total of 1 weekly downloads. As such, obelisk-card-sdk popularity was classified as not popular.
We found that obelisk-card-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Security News
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.

Research
/Security News
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.