appium-android-driver 9.14.7 → 9.14.8

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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [9.14.8](https://github.com/appium/appium-android-driver/compare/v9.14.7...v9.14.8) (2024-12-19)
2
+
3
+ ### Bug Fixes
4
+
5
+ * Adjust log level for BiDi events ([#974](https://github.com/appium/appium-android-driver/issues/974)) ([3a4e264](https://github.com/appium/appium-android-driver/commit/3a4e264f9337f66fe3a1945755d2bf25b891d99f))
6
+
1
7
  ## [9.14.7](https://github.com/appium/appium-android-driver/compare/v9.14.6...v9.14.7) (2024-12-14)
2
8
 
3
9
  ### Miscellaneous Chores
@@ -1 +1 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../lib/commands/bidi/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAOvE,OAAO,KAAK,EAAE,YAAY,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AAY3D,eAAO,MAAM,uBAAuB,gBAAiB,MAAM,UAAU,MAAM,wBAE1E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B,gBAAiB,MAAM,wBAElE,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAczG"}
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../lib/commands/bidi/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAOrF,OAAO,KAAK,EAAE,YAAY,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AAa3D,eAAO,MAAM,uBAAuB,gBAAiB,MAAM,UAAU,MAAM,wBAE1E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B,gBAAiB,MAAM,wBAElE,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAczG"}
@@ -1,9 +1,13 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.makeObsoleteContextUpdatedEvent = exports.makeContextUpdatedEvent = void 0;
4
7
  exports.makeLogEntryAddedEvent = makeLogEntryAddedEvent;
5
8
  const helpers_1 = require("../context/helpers");
6
9
  const constants_1 = require("./constants");
10
+ const lodash_1 = __importDefault(require("lodash"));
7
11
  function toContextUpdatedEvent(method, contextName) {
8
12
  return {
9
13
  method,
@@ -26,7 +30,7 @@ function makeLogEntryAddedEvent(entry, context, type) {
26
30
  method: constants_1.LOG_ENTRY_ADDED_EVENT,
27
31
  params: {
28
32
  type,
29
- level: entry.level,
33
+ level: adjustLogLevel(entry.level),
30
34
  source: {
31
35
  realm: '',
32
36
  },
@@ -35,4 +39,16 @@ function makeLogEntryAddedEvent(entry, context, type) {
35
39
  },
36
40
  };
37
41
  }
42
+ function adjustLogLevel(originalLevel) {
43
+ const originalLevelLc = lodash_1.default.toLower(originalLevel);
44
+ switch (originalLevelLc) {
45
+ case 'debug':
46
+ case 'info':
47
+ case 'warn':
48
+ case 'error':
49
+ return originalLevelLc;
50
+ default:
51
+ return 'info';
52
+ }
53
+ }
38
54
  //# sourceMappingURL=models.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../lib/commands/bidi/models.ts"],"names":[],"mappings":";;;AA8BA,wDAcC;AA3CD,gDAAgD;AAChD,2CAIqB;AAGrB,SAAS,qBAAqB,CAAC,MAAc,EAAE,WAAmB;IAChE,OAA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AAE,CAAC,qBAAqB,CACnG,IAAA,iCAAqB,EAAC,MAAM,CAAC,EAAE,WAAW,CAC3C,CAAC;AAFW,QAAA,uBAAuB,2BAElC;AAEF;;GAEG;AACI,MAAM,+BAA+B,GAAG,CAAC,WAAmB,EAAE,EAAE,CAAC,qBAAqB,CAC3F,0CAA8B,EAAE,WAAW,CAC5C,CAAC;AAFW,QAAA,+BAA+B,mCAE1C;AAEF,SAAgB,sBAAsB,CAAC,KAAe,EAAE,OAAe,EAAE,IAAY;IACnF,OAAO;QACL,OAAO;QACP,MAAM,EAAE,iCAAqB;QAC7B,MAAM,EAAE;YACN,IAAI;YACJ,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC;YAClC,MAAM,EAAE;gBACN,KAAK,EAAE,EAAE;aACV;YACD,IAAI,EAAE,KAAK,CAAC,OAAO;YACnB,SAAS,EAAE,KAAK,CAAC,SAAS;SAC3B;KACF,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,aAAqB;IAC3C,MAAM,eAAe,GAAG,gBAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACjD,QAAQ,eAAe,EAAE,CAAC;QACxB,KAAK,OAAO,CAAC;QACb,KAAK,MAAM,CAAC;QACZ,KAAK,MAAM,CAAC;QACZ,KAAK,OAAO;YACV,OAAO,eAA+B,CAAC;QACzC;YACE,OAAO,MAAM,CAAC;IAClB,CAAC;AACH,CAAC"}
@@ -5,9 +5,10 @@ interface BiDiEvent<TParams> {
5
5
  interface LogEntrySource {
6
6
  realm: string;
7
7
  }
8
+ export type BiDiLogLevel = 'debug' | 'info' | 'warn' | 'error';
8
9
  interface LogEntryAddedEventParams {
9
10
  type: string;
10
- level: string;
11
+ level: BiDiLogLevel;
11
12
  source: LogEntrySource;
12
13
  text: string;
13
14
  timestamp: number;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../lib/commands/bidi/types.ts"],"names":[],"mappings":"AAAA,U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KAAK,CAAC;CACxB;AAGD,MAAM,WAAW,mBAAoB,SAAQ,SAAS,CAAC,oBAAoB,CAAC;CAAG"}
@@ -1,4 +1,4 @@
1
- import type { LogEntryAddedEvent, ContextUpdatedEvent } from './types';
1
+ import type { BiDiLogLevel, LogEntryAddedEvent, ContextUpdatedEvent } from './types';
2
2
  import { NATIVE_WIN } from '../context/helpers';
3
3
  import {
4
4
  CONTEXT_UPDATED_EVENT,
@@ -6,6 +6,7 @@ import {
6
6
  CONTEXT_UPDATED_EVENT_OBSOLETE,
7
7
  } from './constants';
8
8
  import type { LogcatRecord as LogEntry } from 'appium-adb';
9
+ import _ from 'lodash';
9
10
 
10
11
  function toContextUpdatedEvent(method: string, contextName: string): ContextUpdatedEvent {
11
12
  return {
@@ -34,7 +35,7 @@ export function makeLogEntryAddedEvent(entry: LogEntry, context: string, type: s
34
35
  method: LOG_ENTRY_ADDED_EVENT,
35
36
  params: {
36
37
  type,
37
- level: entry.level,
38
+ level: adjustLogLevel(entry.level),
38
39
  source: {
39
40
  realm: '',
40
41
  },
@@ -43,3 +44,16 @@ export function makeLogEntryAddedEvent(entry: LogEntry, context: string, type: s
43
44
  },
44
45
  };
45
46
  }
47
+
48
+ function adjustLogLevel(originalLevel: string): BiDiLogLevel {
49
+ const originalLevelLc = _.toLower(originalLevel);
50
+ switch (originalLevelLc) {
51
+ case 'debug':
52
+ case 'info':
53
+ case 'warn':
54
+ case 'error':
55
+ return originalLevelLc as BiDiLogLevel;
56
+ default:
57
+ return 'info';
58
+ }
59
+ }
@@ -7,9 +7,11 @@ interface LogEntrySource {
7
7
  realm: string;
8
8
  }
9
9
 
10
+ export type BiDiLogLevel = 'debug' | 'info' | 'warn' | 'error';
11
+
10
12
  interface LogEntryAddedEventParams {
11
13
  type: string;
12
- level: string;
14
+ level: BiDiLogLevel;
13
15
  source: LogEntrySource;
14
16
  text: string;
15
17
  timestamp: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium-android-driver",
3
- "version": "9.14.7",
3
+ "version": "9.14.8",
4
4
  "description": "Android UiAutomator and Chrome support for Appium",
5
5
  "keywords": [
6
6
  "appium",