
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
@steedos/data-import
Advanced tools
<!-- * @Author: sunhaolin@hotoa.com * @Date: 2021-10-21 09:57:01 * @LastEditors: 孙浩林 sunhaolin@steedos.com * @LastEditTime: 2023-11-14 11:13:54 * @Description: --> ## 功能说明 - 此包是系统设置中的数据导入功能,可通过excel导入对象数据
module.exports = {
/**
* Events
*/
events: {
// 系统初始化成功
'service-cloud-init.succeeded': async function (ctx) {
await this.broker.call("@steedos/data-import.importData", {
data: {
"csv": csvData,
"json": jsonData,
},
spaceId,
onlyInsert: true,
})
}
},
};
/**
* 参数示例:
{
data: {
"csv": [{ objectName: 'warehouse', records: [ [Object] ]],
"json": [{ objectName: 'house', records: [ [Object] ]],
},
spaceId,
onlyInsert: true,
}
*/
"importData": {
params: {
data: {
type: "object",
props: {
csv: {
type: "array",
items: {
type: "object",
props: {
objectName: { type: "string" },
records: { type: "array", items: "object" },
}
},
optional: true,
},
json: {
type: "array",
items: {
type: "object",
props: {
objectName: { type: "string" },
records: { type: "array", items: "object" },
}
},
optional: true,
},
}
},
spaceId: { type: "string" },
onlyInsert: { type: "boolean", optional: true, default: true }, // 仅新增,在导入数据之前先检查,如果存在任意一条记录,则不执行导入,默认true,如果是false, 则如果存在则执行更新操作。
},
async handler(ctx) {
}
}
mongoexport --uri="mongodb://192.168.3.31:27017/steedos-apps" --jsonArray --collection=contract_types --out=contract_types.data.jsonmongoexport --uri="mongodb://192.168.3.31:27017/steedos-apps" --collection=contract_types --type=csv --fields=name,code --out=contract_types.data.csvjson、csv中文件请使用utf-8编码
main\default\data文件夹后执行以下命令mongoexport --uri="mongodb://192.168.3.31:27017/steedos-apps" --collection=contract_types --type=csv --fields=name,code --out=contract_types.data.csv
mongoexport --uri="mongodb://192.168.3.31:27017/steedos-apps" --jsonArray --collection=contracts --out=contracts.data.json
FAQs
<!-- * @Author: sunhaolin@hotoa.com * @Date: 2021-10-21 09:57:01 * @LastEditors: 孙浩林 sunhaolin@steedos.com * @LastEditTime: 2023-11-14 11:13:54 * @Description: --> ## 功能说明 - 此包是系统设置中的数据导入功能,可通过excel导入对象数据
The npm package @steedos/data-import receives a total of 1,986 weekly downloads. As such, @steedos/data-import popularity was classified as popular.
We found that @steedos/data-import demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 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.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.