# saxo-cli

> saxo-cli 适用于Saxo 2b

Latest version **1.0.5** (published 2022-12-26) · ISC license · 0 weekly downloads

## Install

```sh
npm install saxo-cli
pnpm add saxo-cli
yarn add saxo-cli
bun add saxo-cli
```

Provides the command `saxo-cli`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2022-12-26 |
| First published | 2022-04-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 25.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | jiayu.zhang@saxofintech.com |
| Maintainers | zjyzooo |

## Links

- npm: https://www.npmjs.com/package/saxo-cli
- npm.io page: https://npm.io/package/saxo-cli

## Dependencies (2)

- [request](https://npm.io/package/request.md) ^2.88.2
- [commander](https://npm.io/package/commander.md) ^9.2.0

## Recent versions

- 1.0.5 (latest) — 2022-12-26
- 1.0.4 — 2022-08-25
- 1.0.3 — 2022-05-23
- 1.0.2 — 2022-04-22
- 1.0.1 — 2022-04-21
- 1.0.0 — 2022-04-21

## README

# Intro 
saxo-cli 适用于Saxo 2b

# Install
`$ npm install saxo-cli`
<br />

# Usage
## deploy
saxo-cli -d 构建docker镜像，并重新部署rancher服务
1. 配置package.json添加如下配置
```
saxo: {
  deploy: {
    "exe": "docker执行文件的路径 如 C:\\Program Files\\Docker Desktop.exe 非必填",
    "AccessKey": "rancher 的 AccessKey",
    "SecretKey": "rancher 的 SecretKey",
    "name": "镜像名称", 
    "namespace": "镜像所在命名空间",
    "version": "版本号",
    "url": "rancher上复制的url 如 https://rancher.com/p/xxxx/workload/deployment:namespace:webapp",
    "dockerfile": " dockerfile的名称 默认【Dockerfile】",
  }
}
或者
saxo: {
  deploy: {
    "exe": "docker执行文件的路径 如 C:\\Program Files\\Docker Desktop.exe 非必填",
    "AccessKey": "rancher 的 AccessKey",
    "SecretKey": "rancher 的 SecretKey",
    "works": {
      "dev": {
        "name": "dev镜像名称", 
        "namespace": "dev镜像所在命名空间",
        "version": "dev版本号",
        "url": "rancher上复制的url 如 https://rancher.com/p/xxxx/workload/deployment:namespace:webapp",
        "dockerfile": " dockerfile的名称 默认【Dockerfile】",
      },
      "prod": {
        "name": "prod镜像名称", 
        "namespace": "prod镜像所在命名空间",
        "version": "prod版本号",
        "url": "rancher上复制的url 如 https://rancher.com/p/xxxx/workload/production:namespace:webapp",
        "dockerfile": " dockerfile的名称 默认【Dockerfile】",
      }
    }
  }
}
```
2. 根目录添加 dockerfile
3. 运行saxo-cli -d
<br />

## swagger
saxo-cli --swagger url to typescript api

1. 配置 package.json 或者添加saxo.config.js
```
saxo: {
"swagger": {
    typeFormat:{},
    responseFormat: {},
    output: {
      path: '',
      apiBefore: '',
    },
  }
}

typeFormat // custom type formatter ,Object or function(type: string): string ==> interface xxx
typeFormat: {
  "integer": "number"
}
typeFormat: function(type) {
  return type === 1 ? 'COLOR' : 'SIZE'
}

responseFormat // custom response formatter ,Object or function(type: string): string ==> Promise<xxx>
responseFormat: {
  "integer": "number"
}
responseFormat: function(type) {
  return type === 'object' ? Promise<Record<string, string>> : 'any'
}

output: {
  path: // output path ,default is ./api
  apiBefore: 'import * from xxx' // insert custom content into api file. default is null
}

```
2. `$ saxo-cli --swagger http://xxx.xxx.com/v2/api-doc (swagger api-docs url)`

---
_Source: https://npm.io/package/saxo-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
