@mearl/client 2.16.4 → 2.17.0

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.
@@ -308,8 +308,8 @@ export declare const COMMANDS: readonly [{
308
308
  readonly description: "签名使用的 appKey,默认 12574478";
309
309
  }, {
310
310
  readonly name: "env";
311
- readonly type: "\"online\" | \"pre\"";
312
- readonly description: "请求环境,默认 online";
311
+ readonly type: "\"prod\" | \"pre\"";
312
+ readonly description: "请求环境,默认 prod";
313
313
  }, {
314
314
  readonly name: "timeout";
315
315
  readonly type: "number";
@@ -856,7 +856,7 @@ export declare const COMMANDS: readonly [{
856
856
  readonly examples: ["set_device_emulation --payload '{\"enabled\":true,\"preset\":\"iphone-17-pro\"}'", "set_device_emulation --payload '{\"enabled\":true,\"preset\":\"pixel-11\",\"orientation\":\"landscape\"}'", "set_device_emulation --payload '{\"enabled\":true,\"preset\":\"ipad-mini-a17-pro\",\"orientation\":\"landscape\",\"deviceShell\":true,\"splitScreen\":true}'", "set_device_emulation --payload '{\"enabled\":false}'"];
857
857
  }, {
858
858
  readonly name: "set_app_profile";
859
- readonly description: "设置 App 客户端环境与 JSBridge;传 emulation 时由同一个命令联动设备模拟,省略时不改变设备状态";
859
+ readonly description: "设置 App 客户端环境与 JSBridge;可同时设置 MTop 页面接口环境,传 emulation 时联动设备模拟";
860
860
  readonly summary: "设置或清除目标标签页的 App 容器模拟";
861
861
  readonly params: [{
862
862
  readonly name: "enabled";
@@ -883,6 +883,10 @@ export declare const COMMANDS: readonly [{
883
883
  readonly name: "bridgeConfig";
884
884
  readonly type: "object";
885
885
  readonly description: "声明式覆盖桥方法,形如 {methods:{api:{behavior|response|noop,silent?}}};不执行配置脚本";
886
+ }, {
887
+ readonly name: "mtopEnv";
888
+ readonly type: "\"default\" | \"prod\" | \"pre\"";
889
+ readonly description: "可选 MTop 页面接口环境;default 关闭环境改写,省略时保持当前设置。扩展模式全局生效,CDP 模式仅作用于目标 tab";
886
890
  }, {
887
891
  readonly name: "emulation";
888
892
  readonly type: "object";
@@ -897,7 +901,7 @@ export declare const COMMANDS: readonly [{
897
901
  readonly required: true;
898
902
  readonly description: "目标标签页 ID";
899
903
  }];
900
- readonly examples: ["set_app_profile --payload '{\"enabled\":true,\"profile\":\"fliggy\"}'", "set_app_profile --payload '{\"enabled\":true,\"profile\":\"fliggy\",\"emulation\":{}}'", "set_app_profile --payload '{\"enabled\":true,\"profile\":\"alipay\",\"emulation\":{\"preset\":\"pixel-11\",\"deviceShell\":true}}'", "set_app_profile --payload '{\"enabled\":true,\"profile\":\"fliggy\",\"emulation\":{\"preset\":\"ipad-mini-a17-pro\",\"orientation\":\"landscape\",\"deviceShell\":true,\"splitScreen\":true}}'", "set_app_profile --payload '{\"enabled\":false}'", "set_app_profile --payload '{\"enabled\":false,\"emulation\":{}}'"];
904
+ readonly examples: ["set_app_profile --payload '{\"enabled\":true,\"profile\":\"fliggy\"}'", "set_app_profile --payload '{\"enabled\":true,\"profile\":\"fliggy\",\"mtopEnv\":\"pre\"}'", "set_app_profile --payload '{\"enabled\":false,\"mtopEnv\":\"prod\"}'", "set_app_profile --payload '{\"enabled\":true,\"profile\":\"fliggy\",\"emulation\":{}}'", "set_app_profile --payload '{\"enabled\":true,\"profile\":\"alipay\",\"emulation\":{\"preset\":\"pixel-11\",\"deviceShell\":true}}'", "set_app_profile --payload '{\"enabled\":true,\"profile\":\"fliggy\",\"emulation\":{\"preset\":\"ipad-mini-a17-pro\",\"orientation\":\"landscape\",\"deviceShell\":true,\"splitScreen\":true}}'", "set_app_profile --payload '{\"enabled\":false}'", "set_app_profile --payload '{\"enabled\":false,\"emulation\":{}}'"];
901
905
  }, {
902
906
  readonly name: "set_timezone";
903
907
  readonly description: "覆盖目标 tab 的时区,传空字符串恢复浏览器默认时区";
package/dist/commands.js CHANGED
@@ -214,7 +214,7 @@ export const COMMANDS = [
214
214
  { name: 'version', type: 'string', description: 'API 版本,默认 1.0' },
215
215
  { name: 'method', type: 'string', description: 'HTTP 方法,默认 GET' },
216
216
  { name: 'appKey', type: 'string', description: '签名使用的 appKey,默认 12574478' },
217
- { name: 'env', type: '"online" | "pre"', description: '请求环境,默认 online' },
217
+ { name: 'env', type: '"prod" | "pre"', description: '请求环境,默认 prod' },
218
218
  { name: 'timeout', type: 'number', description: '超时毫秒数,默认 10000' },
219
219
  ],
220
220
  examples: [
@@ -794,7 +794,7 @@ export const COMMANDS = [
794
794
  },
795
795
  {
796
796
  name: 'set_app_profile',
797
- description: '设置 App 客户端环境与 JSBridge;传 emulation 时由同一个命令联动设备模拟,省略时不改变设备状态',
797
+ description: '设置 App 客户端环境与 JSBridge;可同时设置 MTop 页面接口环境,传 emulation 时联动设备模拟',
798
798
  summary: '设置或清除目标标签页的 App 容器模拟',
799
799
  params: [
800
800
  { name: 'enabled', type: 'boolean', required: true, description: 'true=启用,false=清除' },
@@ -815,6 +815,11 @@ export const COMMANDS = [
815
815
  type: 'object',
816
816
  description: '声明式覆盖桥方法,形如 {methods:{api:{behavior|response|noop,silent?}}};不执行配置脚本',
817
817
  },
818
+ {
819
+ name: 'mtopEnv',
820
+ type: '"default" | "prod" | "pre"',
821
+ description: '可选 MTop 页面接口环境;default 关闭环境改写,省略时保持当前设置。扩展模式全局生效,CDP 模式仅作用于目标 tab',
822
+ },
818
823
  {
819
824
  name: 'emulation',
820
825
  type: 'object',
@@ -825,6 +830,8 @@ export const COMMANDS = [
825
830
  ],
826
831
  examples: [
827
832
  `set_app_profile --payload '{"enabled":true,"profile":"fliggy"}'`,
833
+ `set_app_profile --payload '{"enabled":true,"profile":"fliggy","mtopEnv":"pre"}'`,
834
+ `set_app_profile --payload '{"enabled":false,"mtopEnv":"prod"}'`,
828
835
  `set_app_profile --payload '{"enabled":true,"profile":"fliggy","emulation":{}}'`,
829
836
  `set_app_profile --payload '{"enabled":true,"profile":"alipay","emulation":{"preset":"pixel-11","deviceShell":true}}'`,
830
837
  `set_app_profile --payload '{"enabled":true,"profile":"fliggy","emulation":{"preset":"ipad-mini-a17-pro","orientation":"landscape","deviceShell":true,"splitScreen":true}}'`,
@@ -95,13 +95,15 @@ export interface SendRequestParams {
95
95
  responseType?: 'json' | 'text' | 'auto';
96
96
  timeout?: number;
97
97
  }
98
+ export type MtopEnvironmentTarget = 'prod' | 'pre';
99
+ export type MtopEnvironment = 'default' | MtopEnvironmentTarget;
98
100
  export interface SendMtopRequestParams {
99
101
  api: string;
100
102
  data?: unknown;
101
103
  version?: string;
102
104
  method?: string;
103
105
  appKey?: string;
104
- env?: string;
106
+ env?: MtopEnvironmentTarget;
105
107
  timeout?: number;
106
108
  headers?: Record<string, string>;
107
109
  ttid?: string;
@@ -427,6 +429,11 @@ export interface SetAppProfileParams {
427
429
  deviceModel?: string;
428
430
  /** 按方法覆盖档案内置桥配置,仅支持受控行为、固定 JSON 回包和成功空实现 */
429
431
  bridgeConfig?: AppBridgeConfig;
432
+ /**
433
+ * 可选 MTop 接口环境。default 关闭环境改写;省略时保持当前设置。
434
+ * 扩展模式与插件设置页共享并全局生效;CDP 模式仅作用于目标 tab。
435
+ */
436
+ mtopEnv?: MtopEnvironment;
430
437
  /**
431
438
  * 可选设备联动参数。传入时显式字段覆盖档案推荐设备,空对象使用推荐设备且默认开启
432
439
  * deviceShell;省略时不设置或清除该 tab 的设备状态。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mearl/client",
3
- "version": "2.16.4",
3
+ "version": "2.17.0",
4
4
  "description": "Unified Mearl SDK & CLI for local and remote browsers",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -59,8 +59,8 @@
59
59
  "commander": "^15.0.0",
60
60
  "fastest-levenshtein": "^1.0.16",
61
61
  "ws": "^8.18.0",
62
- "@mearl/cloud-types": "2.16.4",
63
- "@mearl/provider": "2.16.4"
62
+ "@mearl/provider": "2.17.0",
63
+ "@mearl/cloud-types": "2.17.0"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@types/node": "^24.9.1",