@newbeebox/newbeebox-client-web-sdk 1.0.9 → 1.0.11

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
@@ -45,14 +45,15 @@ console.log(info);
45
45
 
46
46
  获取当前用户的订阅信息。
47
47
 
48
- #### `InstallWoWAddon(game_version_id, mod_id): Promise<any>`
48
+ #### `InstallWoWAddon(game_version_id, addon_id, secret_key?): Promise<any>`
49
49
 
50
50
  安装魔兽世界插件。
51
51
 
52
52
  | 参数 | 类型 | 说明 |
53
53
  |------|------|------|
54
54
  | game_version_id | string \| number | 游戏版本ID |
55
- | mod_id | string \| number | 插件ID |
55
+ | addon_id | string \| number | 插件ID |
56
+ | secret_key | string | 密钥(可选) |
56
57
 
57
58
  #### `Patch(tool_name, data?): Promise<any>`
58
59
 
package/index.js CHANGED
@@ -145,21 +145,25 @@ export class NewBeeClient {
145
145
  }
146
146
 
147
147
  // 安装魔兽世界插件
148
- async InstallWoWAddon(game_version_id, mod_id) {
148
+ async InstallWoWAddon(game_version_id, addon_id, secret_key) {
149
149
  this._ensureInitialized();
150
150
 
151
151
  let install_response = null;
152
152
  try {
153
+ const body = {
154
+ app_id: this.app_id,
155
+ game_version_id: game_version_id,
156
+ addon_id: addon_id
157
+ };
158
+ if (secret_key) {
159
+ body.secret_key = secret_key;
160
+ }
153
161
  let response = await fetch(CLIENT_SERVICE_BASE_URL + ":" + this.newbee_client_port + "/tool/wow_install_addon", {
154
162
  method: "POST",
155
163
  headers: {
156
164
  "Content-Type": 'application/json',
157
165
  },
158
- body: JSON.stringify({
159
- app_id: this.app_id,
160
- game_version_id: game_version_id,
161
- mod_id: mod_id
162
- })
166
+ body: JSON.stringify(body)
163
167
  });
164
168
 
165
169
  install_response = await response.json();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newbeebox/newbeebox-client-web-sdk",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "NewBeeBox Client SDK for Web",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/types/index.d.ts CHANGED
@@ -37,10 +37,11 @@ export class NewBeeClient {
37
37
  /**
38
38
  * 安装魔兽世界插件
39
39
  * @param game_version_id 游戏版本ID
40
- * @param mod_id 插件ID
40
+ * @param addon_id 插件ID
41
+ * @param secret_key 密钥(可选)
41
42
  * @return {Promise<any>}
42
43
  */
43
- InstallWoWAddon(game_version_id: string | number, mod_id: string | number): Promise<any>;
44
+ InstallWoWAddon(game_version_id: string | number, addon_id: string | number, secret_key?: string): Promise<any>;
44
45
 
45
46
  /**
46
47
  * 通用请求接口