epx 数据
epx 是命令行客户端 Emporix 商业 APIs。 。 。 . 它能帮助你读取,脚本, 并改变一个Emporix租户的数据 从终端右.
联合国 (原始内容存档于2018-09-26) (英语). commercial-cloud-institutions.github.io/emporix-cli 覆盖安装,认证,每个命令,以及Emporix API覆盖.
有了Epx,你可以:
- 阅读产品、类别、目录、价格、可用性、客户、订单和近乎 其它 Emporix 资源作为表格,CSV,JSON,YAML,或JSON Lines.
- 过滤、排序和页面通过任何列表而不写入呼号代码 .
- 安全更改数据: 每封信都用
--dry-run问之前 它发出. - 调用任意 Emporix API 端点
epx api,只使用您命名的 OAuth 瞄准镜. - 以稳定的输出和退出代码可靠地显示缺失项目 范围.
epx是一个非官方的项目. 它不隶属于Emporix或得到其认可.
安装
epx是一个用于macOS,Linux和Windows的单二进制,运行于x64 (amd64)和arm64上.
安装脚本
在 macOS 或 Linux 上:
curl -fsSL https://github.com/commerce-cloud-integrations/emporix-cli/releases/latest/download/install.sh | sh
在 Windows( PowerShell) 上:
powershell -ExecutionPolicy ByPass -c "irm https://github.com/commerce-cloud-integrations/emporix-cli/releases/latest/download/install.ps1 | iex"
剧本下载您平台的最新版本, 对照该版本的
校验和安装 epx 输入 ~/.local/bin (关于窗口) %LOCALAPPDATA%\Programs\epx\bin(中文(简体) )
,将目录添加到您的 PATH 如果需要的话。 在macOS和Linux上,它安装
男人的页面进入 ~/.local/share/man/man1设置 EPX_VERSION (例如: v0.3.0锁定一个释放, EPX_INSTALL_DIR 改为
选择目录,或 EPX_NO_MODIFY_PATH=1 留下你的外壳简介.
土生土长
在 macOS 或 Linux 上:
brew install commerce-cloud-integrations/tap/epx
Homebrew安装了二进制, 人页和外壳完成为bash, zsh和鱼.
转弯
在 Windows 上, 在 PowerShell 中:
scoop bucket add commerce-cloud-integrations https://github.com/commerce-cloud-integrations/scoop-bucket
scoop install commerce-cloud-integrations/epx
无
与节点.js 18或后:
npm install --global @commercecloudintegrations/epx-cli
npm 只安装您的平台的二进制 。 没有编译和安装脚本 运行。 在不安装的情况下运行 epx 一次 :
npx @commercecloudintegrations/epx-cli version
释放归档
每个 释放 持有 每个平台存档和一个校验和文件。 例如,在 Linux x64 上:
version=v0.3.0
base=https://github.com/commerce-cloud-integrations/emporix-cli/releases/download/$version
curl -fsSLO "$base/epx_${version}_linux_amd64.tar.gz" &&
curl -fsSLO "$base/epx_${version}_checksums.txt" &&
sha256sum --check --ignore-missing "epx_${version}_checksums.txt" &&
tar -xzf "epx_${version}_linux_amd64.tar.gz" &&
sudo install "epx_${version}_linux_amd64/epx" /usr/local/bin/epx
在macOS上,使用 shasum -a 256 --check --ignore-missing 改为 sha256sum。 。 。 .
走开
与去1.27.3或后:
go install github.com/commerce-cloud-integrations/emporix-cli/cmd/epx@latest
从源
git clone https://github.com/commerce-cloud-integrations/emporix-cli.git
cd emporix-cli
go build -o bin/epx ./cmd/epx
升级
| 安装于 | 升级 |
|---|---|
| 土生土长 | brew upgrade epx |
| 转弯 | scoop update epx |
| 无 | npm update --global @commercecloudintegrations/epx-cli |
| 安装脚本 | 再运行剧本. |
| 释放归档 | 将二进制替换为新发行的一出. |
| 走开 | 运行 go install 再来一次. |
未加载
- 如果您使用配置文件,请用
epx profile remove NAME,其中也删除 它的客户端从OS密钥链的秘密. - 删除 epx :
brew uninstall epx, (中文(简体) ),scoop uninstall epx或者说npm uninstall --global @commercecloudintegrations/epx-cli,或删除epx安装的二进制 . - 删除
epx配置目录中的文件夹 :~/.config在Linux上,~/Library/Application Support在macOS上,%AppData%在视窗上.
开始
由 Emporix API 键认证 。 创建一个仅包含范围 命令,然后通过环境将其交给 epx:
export EMPORIX_TENANT=acme1
export EMPORIX_CLIENT_ID=...
export EMPORIX_CLIENT_SECRET=...
或者把它保存在档案里, 其客户端的秘密到OS键链:
epx profile add dev --tenant acme1 --client-id ... --site AcmeStore_NL # asks for the secret
然后让你的第一个读到:
epx auth status --scope product.product_read_unpublished # check the key and its scopes
epx sites list
epx products list --query published:false --sort code:desc --limit 20
epx products get 100200 -o json
epx api get '/catalog/{tenant}/catalogs' # any endpoint
并在发送前预览一则信件:
epx units create --file gram.json --dry-run # print the exact request
epx units create --file gram.json # send it after you confirm
使用量
epx [command]
# Run `--help` for detailed information about a command, its flags, and its scopes
epx [command] --help
# Or read the manual: epx, and each top-level command (installed by Homebrew, the script and npm)
man epx
man epx-products
图标
每个命令的帮助都指定它所要求的 OAuth 范围 。 这个 CLI 参考 文档 所有命令和旗帜.
| 区域 | 图标 |
|---|---|
| 产品和目录 | products, (中文(简体) ), categories, (中文(简体) ), category-trees, (中文(简体) ), catalogs, (中文(简体) ), brands, (中文(简体) ), labels, (中文(简体) ), media, (中文(简体) ), product-templates, (中文(简体) ), units |
| 价格和晋升 | prices, (中文(简体) ), price-lists, (中文(简体) ), price-models, (中文(简体) ), fees, (中文(简体) ), taxes, (中文(简体) ), currencies, (中文(简体) ), exchange-rates, (中文(简体) ), coupons, (中文(简体) ), reward-points |
| 库存和航运 | availability, (中文(简体) ), shipping, (中文(简体) ), delivery-times |
| 客户和B2B | customers, (中文(简体) ), segments, (中文(简体) ), legal-entities, (中文(简体) ), customer-locations, (中文(简体) ), contact-assignments, (中文(简体) ), shopping-lists |
| 订单和离职 | carts, (中文(简体) ), quotes, (中文(简体) ), orders, (中文(简体) ), returns, (中文(简体) ), invoice-jobs, (中文(简体) ), payment-modes, (中文(简体) ), payment-transactions |
| 供应商 | vendors, (中文(简体) ), vendor-locations |
| 租户设置 | sites, (中文(简体) ), countries, (中文(简体) ), regions, (中文(简体) ), configurations, (中文(简体) ), iam, (中文(简体) ), webhooks, (中文(简体) ), schemas, (中文(简体) ), custom-entities, (中文(简体) ), sequential-ids, (中文(简体) ), session-contexts, (中文(简体) ), imports, (中文(简体) ), changelog |
| 搜索和人工智能 | search, (中文(简体) ), indexing, (中文(简体) ), ai |
| 任何终点 | api get|post|put|patch|delete |
| epx 本身 | auth, (中文(简体) ), profile, (中文(简体) ), completion, (中文(简体) ), version |
安全问题
- 读取不改变,包括Emporix担任POST或PUT的,例如: 搜索和运输引文.
- 写作清晰. 每个字都显示了它的确切要求
--dry-run,在 它发送(仅在输入它删除的内容时删除),需要--yes在脚本中,并且 一旦它到达Emporix,就再也没有发送过. - 起码的特权. 每个命令都要求一个只具有其所需范围的信使,以及
当您的 API 密钥缺少一个时, 退出代码 3 失败, 而不是默默返回更少
数据。 需要可写入范围的读取器
--allow-write-scope。 。 。 . - 全权证书保密. epx从环境或剖面读取其 API 密钥, 永远不要从旗帜, 也不要打印它的标志或客户秘密.
- 一个主机,只有HTTPS. 请求只到配置的 API 主机, 超越 HTTPS( Plain HTTP) 只有回回地址,如本地测试服务器),而再定向则从未被跟踪.
-o json 财务报告和审定财务报表 -o yaml emporix发送时打印答复,包括机密。 见
安保模式。 。 。 .
退出代码
| 代码 | 含义 |
|---|---|
0 | 成绩 |
1 | 错误 |
2 | 无效的使用或配置; 无发送 |
3 | 认证失败或缺少范围 |
4 | 未找到 |
5 | 相冲突:项目自阅读后已更改, 已经存在, 或无法接受当前状态的变化; 错误表示下一步要做什么 |
文档
这个 epx 文档 覆盖 安装、认证、输出格式、列表、书写、脚本和 Emporix API 覆盖 联 合 国 每一个命令. 职责. md 列出 Emporix API 操作 epx 发送,每个参考版本.
发展
epx 以 Go 写 眼镜蛇。 。 。 .
go build -o bin/epx ./cmd/epx
go test ./... # API calls go to local fake servers; no credentials needed
除了眼镜蛇之外,Epx还取决于 键盘 联 合 国 oS 密钥链中的客户端密钥( 无 cgo), 以及 x/ 任期 财务报告和审定财务报表 x/ sys 类型 在不显示的情况下读取一个秘密,并在Windows上锁定配置文件.
见 捐款额 报告错误或发送更改, 警卫 报告脆弱性,以及 变动情况 联 合 国 每个版本的更改.
许可证
凭 Apache 许可证 2.0。 。 。 .
epx 由下列设备维护: 商业云集。 。 。 .
