tencentads-cli 1.1.1 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -21,6 +21,8 @@ npm 会根据当前操作系统自动安装对应平台的子包(`optionalDepe
21
21
 
22
22
  ## CLI 使用
23
23
 
24
+ ### `tencentads`(当前版本,Go 二进制)
25
+
24
26
  ```bash
25
27
  # 登录鉴权
26
28
  tencentads auth login
@@ -31,75 +33,14 @@ tencentads auth status
31
33
  # 退出登录
32
34
  tencentads auth logout
33
35
 
34
- # API 调用(JSON 模式)
35
- tencentads api '{"method":"GET","path":"/v3.0/adgroups/get","account_id":123456}'
36
-
37
- # API 调用(Flag 模式)
38
- tencentads api --method GET --path /v3.0/adgroups/get --account-id 123456
39
-
40
36
  # 查看帮助
41
37
  tencentads help
42
38
  ```
43
39
 
44
- ## 发布流程
45
-
46
- > 源码位于 `marketing-legion/`,发布脚本位于本仓库 `scripts/publish-cli-go.sh`。
47
-
48
- ### 前置条件
49
-
50
- 在 [npmjs.com → Access Tokens](https://www.npmjs.com/settings/~/tokens) 生成一个 **Granular Access Token**,对 `tencentads-*` 包授予 Read and Write 权限。
51
-
52
- ### 完整发布步骤
53
-
54
- **1. 更新版本号**
55
-
56
- ```bash
57
- # 修改 tencentads/VERSION
58
- echo "1.x.x" > /path/to/tencentads/VERSION
59
- ```
60
-
61
- **2. 编译 Go 二进制(全平台)**
62
-
63
- ```bash
64
- cd /path/to/tencentads
65
- bash build.sh --mode=release
66
- ```
67
-
68
- **3. 打包 npm 子包**
40
+ ### `tencentads-cli`(旧版,不再升级)
69
41
 
70
- ```bash
71
- cd /path/to/marketing-legion
72
- node scripts/build-cli-go.mjs # 默认 multi 模式,输出到 dist/tencentads-skills/tencentads-cli-npmjs/packages/
73
- ```
74
-
75
- **4. 同步到发布仓库**
76
-
77
- ```bash
78
- bash release-skills.sh --sync
79
- ```
80
-
81
- **5. 发布到 npm**
82
-
83
- ```bash
84
- cd dist/tencentads-skills-repo
85
-
86
- # 使用 Access Token(推荐)
87
- bash scripts/publish-cli-go.sh --version 1.x.x --token <NPM_TOKEN>
88
-
89
- # 或通过环境变量
90
- export NPM_TOKEN=<your-token>
91
- bash scripts/publish-cli-go.sh --version 1.x.x
92
- ```
42
+ `tencentads-cli` 为早期 Node.js 版本,保留以兼容现有集成,不再接受新功能更新。
93
43
 
94
- 发布脚本会依次发布 6 个平台子包 + 主包 `tencentads-cli`,共 7 个包。
95
-
96
- **6. 验证发布结果**
97
-
98
- ```bash
99
- for pkg in tencentads-cli tencentads-darwin-x64 tencentads-darwin-arm64 tencentads-linux-x64 tencentads-linux-arm64 tencentads-windows-amd64 tencentads-windows-arm64; do
100
- echo -n "$pkg: "; npm view $pkg version
101
- done
102
- ```
103
44
 
104
45
  ## 环境要求
105
46
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tencentads-cli",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "通用腾讯广告 API CLI 工具 — 封装鉴权与 API 调用",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -11,10 +11,19 @@
11
11
  "api",
12
12
  "advertising"
13
13
  ],
14
+ "type": "module",
15
+ "main": "dist/index.js",
16
+ "types": "dist/index.d.ts",
14
17
  "bin": {
15
- "tencentads": "./bin/tencentads.js",
18
+ "tencentads": "./bin/tencentads.cjs",
16
19
  "tencentads-cli": "./dist/bin.js"
17
20
  },
21
+ "exports": {
22
+ ".": {
23
+ "import": "./dist/index.js",
24
+ "types": "./dist/index.d.ts"
25
+ }
26
+ },
18
27
  "files": [
19
28
  "bin/",
20
29
  "dist/",
@@ -22,18 +31,29 @@
22
31
  "README.md"
23
32
  ],
24
33
  "optionalDependencies": {
25
- "tencentads-darwin-x64": "1.1.1",
26
- "tencentads-darwin-arm64": "1.1.1",
27
- "tencentads-linux-x64": "1.1.1",
28
- "tencentads-linux-arm64": "1.1.1",
29
- "tencentads-windows-amd64": "1.1.1",
30
- "tencentads-windows-arm64": "1.1.1"
34
+ "tencentads-darwin-x64": "1.1.3",
35
+ "tencentads-darwin-arm64": "1.1.3",
36
+ "tencentads-linux-x64": "1.1.3",
37
+ "tencentads-linux-arm64": "1.1.3",
38
+ "tencentads-windows-amd64": "1.1.3",
39
+ "tencentads-windows-arm64": "1.1.3"
31
40
  },
32
41
  "scripts": {
33
- "publish:npm": "bash ../scripts/publish-cli-go.sh --version 1.1.0 --registry https://registry.npmjs.org",
34
- "publish:beta": "bash ../scripts/publish-cli-go.sh --version 1.1.0 --tag beta --registry https://registry.npmjs.org",
35
- "publish:npm:token": "bash ../scripts/publish-cli-go.sh --version 1.1.0 --token $NPM_TOKEN --registry https://registry.npmjs.org",
36
- "publish:beta:token": "bash ../scripts/publish-cli-go.sh --version 1.1.0 --tag beta --token $NPM_TOKEN --registry https://registry.npmjs.org"
42
+ "build": "tsc",
43
+ "build:obfuscate": "tsc && node scripts/obfuscate.mjs",
44
+ "check": "tsc --noEmit",
45
+ "clean": "rm -rf dist",
46
+ "dev": "tsc --watch",
47
+ "prepublishOnly": "npm run clean && npm run build:obfuscate",
48
+ "publish:npm": "bash ../scripts/publish-cli-go.sh --version 1.1.1 --registry https://registry.npmjs.org",
49
+ "publish:beta": "bash ../scripts/publish-cli-go.sh --version 1.1.1 --tag beta --registry https://registry.npmjs.org",
50
+ "publish:npm:token": "bash ../scripts/publish-cli-go.sh --version 1.1.1 --token $NPM_TOKEN --registry https://registry.npmjs.org",
51
+ "publish:beta:token": "bash ../scripts/publish-cli-go.sh --version 1.1.1 --tag beta --token $NPM_TOKEN --registry https://registry.npmjs.org"
52
+ },
53
+ "devDependencies": {
54
+ "@types/node": "^20.11.0",
55
+ "javascript-obfuscator": "^4.1.1",
56
+ "typescript": "^5.3.0"
37
57
  },
38
58
  "engines": {
39
59
  "node": ">=18.0.0"
File without changes