@memlab/cli 1.0.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.
Files changed (198) hide show
  1. package/README.md +11 -0
  2. package/bin/memlab +14 -0
  3. package/dist/BaseCommand.d.ts +37 -0
  4. package/dist/BaseCommand.d.ts.map +1 -0
  5. package/dist/BaseCommand.js +132 -0
  6. package/dist/Dispatcher.d.ts +35 -0
  7. package/dist/Dispatcher.d.ts.map +1 -0
  8. package/dist/Dispatcher.js +205 -0
  9. package/dist/TypesThirdParty.d.ts +17 -0
  10. package/dist/TypesThirdParty.d.ts.map +1 -0
  11. package/dist/TypesThirdParty.js +10 -0
  12. package/dist/commands/CleanLoggerDataCommand.d.ts +20 -0
  13. package/dist/commands/CleanLoggerDataCommand.d.ts.map +1 -0
  14. package/dist/commands/CleanLoggerDataCommand.js +50 -0
  15. package/dist/commands/CleanRunDataCommand.d.ts +20 -0
  16. package/dist/commands/CleanRunDataCommand.d.ts.map +1 -0
  17. package/dist/commands/CleanRunDataCommand.js +48 -0
  18. package/dist/commands/InitDirectoryCommand.d.ts +20 -0
  19. package/dist/commands/InitDirectoryCommand.d.ts.map +1 -0
  20. package/dist/commands/InitDirectoryCommand.js +48 -0
  21. package/dist/commands/ListScenariosCommand.d.ts +17 -0
  22. package/dist/commands/ListScenariosCommand.d.ts.map +1 -0
  23. package/dist/commands/ListScenariosCommand.js +51 -0
  24. package/dist/commands/MemLabRunCommand.d.ts +20 -0
  25. package/dist/commands/MemLabRunCommand.d.ts.map +1 -0
  26. package/dist/commands/MemLabRunCommand.js +66 -0
  27. package/dist/commands/PrintSummaryCommand.d.ts +20 -0
  28. package/dist/commands/PrintSummaryCommand.d.ts.map +1 -0
  29. package/dist/commands/PrintSummaryCommand.js +55 -0
  30. package/dist/commands/ResetDirectoryCommand.d.ts +19 -0
  31. package/dist/commands/ResetDirectoryCommand.d.ts.map +1 -0
  32. package/dist/commands/ResetDirectoryCommand.js +46 -0
  33. package/dist/commands/RunMeasureCommand.d.ts +20 -0
  34. package/dist/commands/RunMeasureCommand.d.ts.map +1 -0
  35. package/dist/commands/RunMeasureCommand.js +82 -0
  36. package/dist/commands/WarmupAppCommand.d.ts +20 -0
  37. package/dist/commands/WarmupAppCommand.d.ts.map +1 -0
  38. package/dist/commands/WarmupAppCommand.js +65 -0
  39. package/dist/commands/heap/CheckLeakCommand.d.ts +21 -0
  40. package/dist/commands/heap/CheckLeakCommand.d.ts.map +1 -0
  41. package/dist/commands/heap/CheckLeakCommand.js +94 -0
  42. package/dist/commands/heap/GetRetainerTraceCommand.d.ts +21 -0
  43. package/dist/commands/heap/GetRetainerTraceCommand.d.ts.map +1 -0
  44. package/dist/commands/heap/GetRetainerTraceCommand.js +92 -0
  45. package/dist/commands/heap/HeapAnalysisCommand.d.ts +21 -0
  46. package/dist/commands/heap/HeapAnalysisCommand.d.ts.map +1 -0
  47. package/dist/commands/heap/HeapAnalysisCommand.js +98 -0
  48. package/dist/commands/heap/HeapAnalysisSubCommandWrapper.d.ts +23 -0
  49. package/dist/commands/heap/HeapAnalysisSubCommandWrapper.d.ts.map +1 -0
  50. package/dist/commands/heap/HeapAnalysisSubCommandWrapper.js +68 -0
  51. package/dist/commands/helper/HelperCommand.d.ts +37 -0
  52. package/dist/commands/helper/HelperCommand.d.ts.map +1 -0
  53. package/dist/commands/helper/HelperCommand.js +262 -0
  54. package/dist/commands/helper/lib/CommandOrder.d.ts +13 -0
  55. package/dist/commands/helper/lib/CommandOrder.d.ts.map +1 -0
  56. package/dist/commands/helper/lib/CommandOrder.js +42 -0
  57. package/dist/commands/helper/lib/Types.d.ts +16 -0
  58. package/dist/commands/helper/lib/Types.d.ts.map +1 -0
  59. package/dist/commands/helper/lib/Types.js +11 -0
  60. package/dist/commands/query/QueryDefaultWorkDirCommand.d.ts +20 -0
  61. package/dist/commands/query/QueryDefaultWorkDirCommand.d.ts.map +1 -0
  62. package/dist/commands/query/QueryDefaultWorkDirCommand.js +67 -0
  63. package/dist/commands/snapshot/CheckXvfbSupportCommand.d.ts +18 -0
  64. package/dist/commands/snapshot/CheckXvfbSupportCommand.d.ts.map +1 -0
  65. package/dist/commands/snapshot/CheckXvfbSupportCommand.js +55 -0
  66. package/dist/commands/snapshot/Snapshot.d.ts +11 -0
  67. package/dist/commands/snapshot/Snapshot.d.ts.map +1 -0
  68. package/dist/commands/snapshot/Snapshot.js +47 -0
  69. package/dist/commands/snapshot/TakeSnapshotCommand.d.ts +20 -0
  70. package/dist/commands/snapshot/TakeSnapshotCommand.d.ts.map +1 -0
  71. package/dist/commands/snapshot/TakeSnapshotCommand.js +80 -0
  72. package/dist/commands/snapshot/WarmupAndSnapshotCommand.d.ts +18 -0
  73. package/dist/commands/snapshot/WarmupAndSnapshotCommand.d.ts.map +1 -0
  74. package/dist/commands/snapshot/WarmupAndSnapshotCommand.js +49 -0
  75. package/dist/commands/test/BrowserTest.d.ts +11 -0
  76. package/dist/commands/test/BrowserTest.d.ts.map +1 -0
  77. package/dist/commands/test/BrowserTest.js +41 -0
  78. package/dist/commands/test/RunAllInteractionTestsCommand.d.ts +19 -0
  79. package/dist/commands/test/RunAllInteractionTestsCommand.d.ts.map +1 -0
  80. package/dist/commands/test/RunAllInteractionTestsCommand.js +71 -0
  81. package/dist/commands/test/RunInteractionTestCommand.d.ts +19 -0
  82. package/dist/commands/test/RunInteractionTestCommand.d.ts.map +1 -0
  83. package/dist/commands/test/RunInteractionTestCommand.js +75 -0
  84. package/dist/index.d.ts +11 -0
  85. package/dist/index.d.ts.map +1 -0
  86. package/dist/index.js +26 -0
  87. package/dist/options/AppOption.d.ts +19 -0
  88. package/dist/options/AppOption.d.ts.map +1 -0
  89. package/dist/options/AppOption.js +42 -0
  90. package/dist/options/DebugOption.d.ts +18 -0
  91. package/dist/options/DebugOption.d.ts.map +1 -0
  92. package/dist/options/DebugOption.js +37 -0
  93. package/dist/options/DisableXvfbOption.d.ts +18 -0
  94. package/dist/options/DisableXvfbOption.d.ts.map +1 -0
  95. package/dist/options/DisableXvfbOption.js +37 -0
  96. package/dist/options/FullExecutionOption.d.ts +18 -0
  97. package/dist/options/FullExecutionOption.d.ts.map +1 -0
  98. package/dist/options/FullExecutionOption.js +37 -0
  99. package/dist/options/HeapNodeIdOption.d.ts +19 -0
  100. package/dist/options/HeapNodeIdOption.d.ts.map +1 -0
  101. package/dist/options/HeapNodeIdOption.js +46 -0
  102. package/dist/options/HelperOption.d.ts +19 -0
  103. package/dist/options/HelperOption.d.ts.map +1 -0
  104. package/dist/options/HelperOption.js +39 -0
  105. package/dist/options/InteractionOption.d.ts +19 -0
  106. package/dist/options/InteractionOption.d.ts.map +1 -0
  107. package/dist/options/InteractionOption.js +42 -0
  108. package/dist/options/NumberOfRunsOption.d.ts +20 -0
  109. package/dist/options/NumberOfRunsOption.d.ts.map +1 -0
  110. package/dist/options/NumberOfRunsOption.js +44 -0
  111. package/dist/options/RemoteBrowserDebugOption.d.ts +18 -0
  112. package/dist/options/RemoteBrowserDebugOption.d.ts.map +1 -0
  113. package/dist/options/RemoteBrowserDebugOption.js +37 -0
  114. package/dist/options/RunningModeOption.d.ts +19 -0
  115. package/dist/options/RunningModeOption.d.ts.map +1 -0
  116. package/dist/options/RunningModeOption.js +40 -0
  117. package/dist/options/ScenarioFileOption.d.ts +19 -0
  118. package/dist/options/ScenarioFileOption.d.ts.map +1 -0
  119. package/dist/options/ScenarioFileOption.js +44 -0
  120. package/dist/options/SetContinuousTestOption.d.ts +18 -0
  121. package/dist/options/SetContinuousTestOption.d.ts.map +1 -0
  122. package/dist/options/SetContinuousTestOption.js +37 -0
  123. package/dist/options/SetDeviceOption.d.ts +19 -0
  124. package/dist/options/SetDeviceOption.d.ts.map +1 -0
  125. package/dist/options/SetDeviceOption.js +46 -0
  126. package/dist/options/SetWorkingDirectoryOption.d.ts +20 -0
  127. package/dist/options/SetWorkingDirectoryOption.d.ts.map +1 -0
  128. package/dist/options/SetWorkingDirectoryOption.js +40 -0
  129. package/dist/options/SilentOption.d.ts +19 -0
  130. package/dist/options/SilentOption.d.ts.map +1 -0
  131. package/dist/options/SilentOption.js +40 -0
  132. package/dist/options/SkipExtraOperationOption.d.ts +18 -0
  133. package/dist/options/SkipExtraOperationOption.d.ts.map +1 -0
  134. package/dist/options/SkipExtraOperationOption.js +37 -0
  135. package/dist/options/SkipGCOption.d.ts +18 -0
  136. package/dist/options/SkipGCOption.d.ts.map +1 -0
  137. package/dist/options/SkipGCOption.js +37 -0
  138. package/dist/options/SkipScreenshotOption.d.ts +18 -0
  139. package/dist/options/SkipScreenshotOption.d.ts.map +1 -0
  140. package/dist/options/SkipScreenshotOption.js +37 -0
  141. package/dist/options/SkipScrollOption.d.ts +18 -0
  142. package/dist/options/SkipScrollOption.d.ts.map +1 -0
  143. package/dist/options/SkipScrollOption.js +37 -0
  144. package/dist/options/SkipSnapshotOption.d.ts +18 -0
  145. package/dist/options/SkipSnapshotOption.d.ts.map +1 -0
  146. package/dist/options/SkipSnapshotOption.js +37 -0
  147. package/dist/options/SkipWarmupOption.d.ts +18 -0
  148. package/dist/options/SkipWarmupOption.d.ts.map +1 -0
  149. package/dist/options/SkipWarmupOption.js +37 -0
  150. package/dist/options/VerboseOption.d.ts +19 -0
  151. package/dist/options/VerboseOption.d.ts.map +1 -0
  152. package/dist/options/VerboseOption.js +40 -0
  153. package/dist/options/heap/BaselineFileOption.d.ts +18 -0
  154. package/dist/options/heap/BaselineFileOption.d.ts.map +1 -0
  155. package/dist/options/heap/BaselineFileOption.js +53 -0
  156. package/dist/options/heap/FinalFileOption.d.ts +18 -0
  157. package/dist/options/heap/FinalFileOption.d.ts.map +1 -0
  158. package/dist/options/heap/FinalFileOption.js +53 -0
  159. package/dist/options/heap/JSEngineOption.d.ts +18 -0
  160. package/dist/options/heap/JSEngineOption.d.ts.map +1 -0
  161. package/dist/options/heap/JSEngineOption.js +46 -0
  162. package/dist/options/heap/LogTraceAsClusterOption.d.ts +18 -0
  163. package/dist/options/heap/LogTraceAsClusterOption.d.ts.map +1 -0
  164. package/dist/options/heap/LogTraceAsClusterOption.js +37 -0
  165. package/dist/options/heap/OversizeThresholdOption.d.ts +19 -0
  166. package/dist/options/heap/OversizeThresholdOption.d.ts.map +1 -0
  167. package/dist/options/heap/OversizeThresholdOption.js +45 -0
  168. package/dist/options/heap/SnapshotDirectoryOption.d.ts +18 -0
  169. package/dist/options/heap/SnapshotDirectoryOption.d.ts.map +1 -0
  170. package/dist/options/heap/SnapshotDirectoryOption.js +50 -0
  171. package/dist/options/heap/SnapshotFileOption.d.ts +18 -0
  172. package/dist/options/heap/SnapshotFileOption.d.ts.map +1 -0
  173. package/dist/options/heap/SnapshotFileOption.js +50 -0
  174. package/dist/options/heap/TargetFileOption.d.ts +18 -0
  175. package/dist/options/heap/TargetFileOption.d.ts.map +1 -0
  176. package/dist/options/heap/TargetFileOption.js +53 -0
  177. package/dist/options/heap/TraceAllObjectsOption.d.ts +18 -0
  178. package/dist/options/heap/TraceAllObjectsOption.d.ts.map +1 -0
  179. package/dist/options/heap/TraceAllObjectsOption.js +38 -0
  180. package/dist/options/heap/leak-filter/LeakFilterFileOption.d.ts +19 -0
  181. package/dist/options/heap/leak-filter/LeakFilterFileOption.d.ts.map +1 -0
  182. package/dist/options/heap/leak-filter/LeakFilterFileOption.js +41 -0
  183. package/dist/options/heap/leak-filter/examples/FilterLib.d.ts +12 -0
  184. package/dist/options/heap/leak-filter/examples/FilterLib.d.ts.map +1 -0
  185. package/dist/options/heap/leak-filter/examples/FilterLib.js +30 -0
  186. package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-1.d.ts +13 -0
  187. package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-1.d.ts.map +1 -0
  188. package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-1.js +30 -0
  189. package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-2.d.ts +16 -0
  190. package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-2.d.ts.map +1 -0
  191. package/dist/options/heap/leak-filter/examples/dup-string-as-leak.example-2.js +28 -0
  192. package/dist/options/heap/leak-filter/examples/large-object-as-leak.example.d.ts +3 -0
  193. package/dist/options/heap/leak-filter/examples/large-object-as-leak.example.d.ts.map +1 -0
  194. package/dist/options/heap/leak-filter/examples/large-object-as-leak.example.js +13 -0
  195. package/dist/runner.d.ts +11 -0
  196. package/dist/runner.d.ts.map +1 -0
  197. package/dist/runner.js +38 -0
  198. package/package.json +59 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FullExecutionOption.d.ts","sourceRoot":"","sources":["../../src/options/FullExecutionOption.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,UAAU;IACzD,aAAa,IAAI,MAAM;IAIvB,cAAc,IAAI,MAAM;IAIlB,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAKnE"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ *
8
+ * @emails oncall+ws_labs
9
+ * @format
10
+ */
11
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13
+ return new (P || (P = Promise))(function (resolve, reject) {
14
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
15
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
18
+ });
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ const core_1 = require("@memlab/core");
22
+ class FullExecutionOption extends core_1.BaseOption {
23
+ getOptionName() {
24
+ return 'full';
25
+ }
26
+ getDescription() {
27
+ return 'take heap snapshot for every step in E2E interaction';
28
+ }
29
+ parse(config, args) {
30
+ return __awaiter(this, void 0, void 0, function* () {
31
+ if (args.full) {
32
+ config.isFullRun = true;
33
+ }
34
+ });
35
+ }
36
+ }
37
+ exports.default = FullExecutionOption;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @emails oncall+ws_labs
8
+ * @format
9
+ */
10
+ import type { ParsedArgs } from 'minimist';
11
+ import type { MemLabConfig } from '@memlab/core';
12
+ import { BaseOption } from '@memlab/core';
13
+ export default class HeapNodeIdOption extends BaseOption {
14
+ getOptionName(): string;
15
+ getDescription(): string;
16
+ getExampleValues(): string[];
17
+ parse(config: MemLabConfig, args: ParsedArgs): Promise<void>;
18
+ }
19
+ //# sourceMappingURL=HeapNodeIdOption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HeapNodeIdOption.d.ts","sourceRoot":"","sources":["../../src/options/HeapNodeIdOption.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,UAAU;IACtD,aAAa,IAAI,MAAM;IAIvB,cAAc,IAAI,MAAM;IAIxB,gBAAgB,IAAI,MAAM,EAAE;IAItB,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAWnE"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ *
8
+ * @emails oncall+ws_labs
9
+ * @format
10
+ */
11
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13
+ return new (P || (P = Promise))(function (resolve, reject) {
14
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
15
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
18
+ });
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ const core_1 = require("@memlab/core");
22
+ class HeapNodeIdOption extends core_1.BaseOption {
23
+ getOptionName() {
24
+ return 'nodeId';
25
+ }
26
+ getDescription() {
27
+ return 'set heap node ID';
28
+ }
29
+ getExampleValues() {
30
+ return ['14123123', '@14123123'];
31
+ }
32
+ parse(config, args) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ if (args[this.getOptionName()]) {
35
+ if (!args.nodeId) {
36
+ return;
37
+ }
38
+ if (typeof args.nodeId === 'string' && args.nodeId.startsWith('@')) {
39
+ args.nodeId = args.nodeId.slice(1);
40
+ }
41
+ config.focusFiberNodeId = Number(args.nodeId);
42
+ }
43
+ });
44
+ }
45
+ }
46
+ exports.default = HeapNodeIdOption;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @emails oncall+ws_labs
8
+ * @format
9
+ */
10
+ import type { ParsedArgs } from 'minimist';
11
+ import type { MemLabConfig } from '@memlab/core';
12
+ import { BaseOption } from '@memlab/core';
13
+ export default class HelperOption extends BaseOption {
14
+ getOptionName(): string;
15
+ getOptionShortcut(): string;
16
+ getDescription(): string;
17
+ parse(_config: MemLabConfig, _args: ParsedArgs): Promise<void>;
18
+ }
19
+ //# sourceMappingURL=HelperOption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HelperOption.d.ts","sourceRoot":"","sources":["../../src/options/HelperOption.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,UAAU;IAClD,aAAa,IAAI,MAAM;IAIvB,iBAAiB,IAAI,MAAM;IAI3B,cAAc,IAAI,MAAM;IAKlB,KAAK,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAGrE"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ *
8
+ * @emails oncall+ws_labs
9
+ * @format
10
+ */
11
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13
+ return new (P || (P = Promise))(function (resolve, reject) {
14
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
15
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
18
+ });
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ const core_1 = require("@memlab/core");
22
+ class HelperOption extends core_1.BaseOption {
23
+ getOptionName() {
24
+ return 'help';
25
+ }
26
+ getOptionShortcut() {
27
+ return 'h';
28
+ }
29
+ getDescription() {
30
+ return 'print helper text';
31
+ }
32
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
33
+ parse(_config, _args) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ // the logic is done in dispatcher
36
+ });
37
+ }
38
+ }
39
+ exports.default = HelperOption;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @emails oncall+ws_labs
8
+ * @format
9
+ */
10
+ import type { ParsedArgs } from 'minimist';
11
+ import type { MemLabConfig } from '@memlab/core';
12
+ import { BaseOption } from '@memlab/core';
13
+ export default class InteractionOption extends BaseOption {
14
+ getOptionName(): string;
15
+ getDescription(): string;
16
+ getExampleValues(): string[];
17
+ parse(config: MemLabConfig, args: ParsedArgs): Promise<void>;
18
+ }
19
+ //# sourceMappingURL=InteractionOption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InteractionOption.d.ts","sourceRoot":"","sources":["../../src/options/InteractionOption.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,UAAU;IACvD,aAAa,IAAI,MAAM;IAIvB,cAAc,IAAI,MAAM;IAIxB,gBAAgB,IAAI,MAAM,EAAE;IAItB,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAOnE"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ *
8
+ * @emails oncall+ws_labs
9
+ * @format
10
+ */
11
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13
+ return new (P || (P = Promise))(function (resolve, reject) {
14
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
15
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
18
+ });
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ const core_1 = require("@memlab/core");
22
+ class InteractionOption extends core_1.BaseOption {
23
+ getOptionName() {
24
+ return 'interaction';
25
+ }
26
+ getDescription() {
27
+ return 'set name for onboarded interaction';
28
+ }
29
+ getExampleValues() {
30
+ return ['watch', 'campaign-tab'];
31
+ }
32
+ parse(config, args) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ if (args.interaction) {
35
+ config.targetTab = Array.isArray(args.interaction)
36
+ ? args.interaction[args.interaction.length - 1]
37
+ : args.interaction;
38
+ }
39
+ });
40
+ }
41
+ }
42
+ exports.default = InteractionOption;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @emails oncall+ws_labs
8
+ * @format
9
+ */
10
+ import type { ParsedArgs } from 'minimist';
11
+ import type { AnyRecord, MemLabConfig } from '@memlab/core';
12
+ import { BaseOption } from '@memlab/core';
13
+ export default class NumberOfRunsOption extends BaseOption {
14
+ static DEFAULT_NUM_RUNS: number;
15
+ getOptionName(): string;
16
+ getDescription(): string;
17
+ getExampleValues(): string[];
18
+ parse(config: MemLabConfig, args: ParsedArgs): Promise<AnyRecord>;
19
+ }
20
+ //# sourceMappingURL=NumberOfRunsOption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NumberOfRunsOption.d.ts","sourceRoot":"","sources":["../../src/options/NumberOfRunsOption.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAC,SAAS,EAAE,YAAY,EAAC,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU;IACxD,OAAc,gBAAgB,SAAM;IACpC,aAAa,IAAI,MAAM;IAIvB,cAAc,IAAI,MAAM;IAIxB,gBAAgB,IAAI,MAAM,EAAE;IAItB,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;CAQxE"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ *
8
+ * @emails oncall+ws_labs
9
+ * @format
10
+ */
11
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13
+ return new (P || (P = Promise))(function (resolve, reject) {
14
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
15
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
18
+ });
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ const core_1 = require("@memlab/core");
22
+ class NumberOfRunsOption extends core_1.BaseOption {
23
+ getOptionName() {
24
+ return 'run-num';
25
+ }
26
+ getDescription() {
27
+ return 'set number of runs';
28
+ }
29
+ getExampleValues() {
30
+ return ['5'];
31
+ }
32
+ parse(config, args) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ const ret = Object.create(null);
35
+ const name = this.getOptionName();
36
+ ret.numOfRuns = args[name]
37
+ ? args[name] | 0
38
+ : NumberOfRunsOption.DEFAULT_NUM_RUNS;
39
+ return ret;
40
+ });
41
+ }
42
+ }
43
+ exports.default = NumberOfRunsOption;
44
+ NumberOfRunsOption.DEFAULT_NUM_RUNS = 10;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @emails oncall+ws_labs
8
+ * @format
9
+ */
10
+ import type { ParsedArgs } from 'minimist';
11
+ import type { MemLabConfig } from '@memlab/core';
12
+ import { BaseOption } from '@memlab/core';
13
+ export default class RemoteBrowserDebugOption extends BaseOption {
14
+ getOptionName(): string;
15
+ getDescription(): string;
16
+ parse(config: MemLabConfig, args: ParsedArgs): Promise<void>;
17
+ }
18
+ //# sourceMappingURL=RemoteBrowserDebugOption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RemoteBrowserDebugOption.d.ts","sourceRoot":"","sources":["../../src/options/RemoteBrowserDebugOption.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,UAAU;IAC9D,aAAa,IAAI,MAAM;IAIvB,cAAc,IAAI,MAAM;IAIlB,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAKnE"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ *
8
+ * @emails oncall+ws_labs
9
+ * @format
10
+ */
11
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13
+ return new (P || (P = Promise))(function (resolve, reject) {
14
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
15
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
18
+ });
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ const core_1 = require("@memlab/core");
22
+ class RemoteBrowserDebugOption extends core_1.BaseOption {
23
+ getOptionName() {
24
+ return 'local-puppeteer';
25
+ }
26
+ getDescription() {
27
+ return 'enable remote browser instance debugging via local puppeteer';
28
+ }
29
+ parse(config, args) {
30
+ return __awaiter(this, void 0, void 0, function* () {
31
+ if (args['local-puppeteer']) {
32
+ config.isLocalPuppeteer = true;
33
+ }
34
+ });
35
+ }
36
+ }
37
+ exports.default = RemoteBrowserDebugOption;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @emails oncall+ws_labs
8
+ * @format
9
+ */
10
+ import type { ParsedArgs } from 'minimist';
11
+ import type { MemLabConfig } from '@memlab/core';
12
+ import { BaseOption } from '@memlab/core';
13
+ export default class RunningModeOption extends BaseOption {
14
+ getOptionName(): string;
15
+ getDescription(): string;
16
+ getExampleValues(): string[];
17
+ parse(config: MemLabConfig, args: ParsedArgs): Promise<void>;
18
+ }
19
+ //# sourceMappingURL=RunningModeOption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RunningModeOption.d.ts","sourceRoot":"","sources":["../../src/options/RunningModeOption.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAQ,MAAM,cAAc,CAAC;AAE/C,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,UAAU;IACvD,aAAa,IAAI,MAAM;IAIvB,cAAc,IAAI,MAAM;IAIxB,gBAAgB,IAAI,MAAM,EAAE;IAItB,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAKnE"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ *
8
+ * @emails oncall+ws_labs
9
+ * @format
10
+ */
11
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13
+ return new (P || (P = Promise))(function (resolve, reject) {
14
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
15
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
18
+ });
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ const core_1 = require("@memlab/core");
22
+ class RunningModeOption extends core_1.BaseOption {
23
+ getOptionName() {
24
+ return 'run-mode';
25
+ }
26
+ getDescription() {
27
+ return 'set running mode';
28
+ }
29
+ getExampleValues() {
30
+ return ['regular', 'measure', 'interaction-test'];
31
+ }
32
+ parse(config, args) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ if (args['run-mode']) {
35
+ config.runningMode = core_1.modes.get(args['run-mode'], config);
36
+ }
37
+ });
38
+ }
39
+ }
40
+ exports.default = RunningModeOption;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @emails oncall+ws_labs
8
+ * @format
9
+ */
10
+ import type { ParsedArgs } from 'minimist';
11
+ import type { MemLabConfig } from '@memlab/core';
12
+ import { BaseOption } from '@memlab/core';
13
+ export default class ScenarioFileOption extends BaseOption {
14
+ getOptionName(): string;
15
+ getDescription(): string;
16
+ getExampleValues(): string[];
17
+ parse(config: MemLabConfig, args: ParsedArgs): Promise<void>;
18
+ }
19
+ //# sourceMappingURL=ScenarioFileOption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScenarioFileOption.d.ts","sourceRoot":"","sources":["../../src/options/ScenarioFileOption.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAQ,MAAM,cAAc,CAAC;AAG/C,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU;IACxD,aAAa,IAAI,MAAM;IAIvB,cAAc,IAAI,MAAM;IAIxB,gBAAgB,IAAI,MAAM,EAAE;IAItB,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAQnE"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ *
8
+ * @emails oncall+ws_labs
9
+ * @format
10
+ */
11
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13
+ return new (P || (P = Promise))(function (resolve, reject) {
14
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
15
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
18
+ });
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ const core_1 = require("@memlab/core");
22
+ const e2e_1 = require("@memlab/e2e");
23
+ class ScenarioFileOption extends core_1.BaseOption {
24
+ getOptionName() {
25
+ return 'scenario';
26
+ }
27
+ getDescription() {
28
+ return 'set file path loading test scenario';
29
+ }
30
+ getExampleValues() {
31
+ return ['/tmp/scenario.js'];
32
+ }
33
+ parse(config, args) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ if (args.scenario) {
36
+ const scenarioFile = args.scenario;
37
+ // load scenario file and get target app name
38
+ config.scenario = core_1.utils.loadScenario(scenarioFile);
39
+ config.targetApp = e2e_1.E2EUtils.getScenarioAppName(config.scenario);
40
+ }
41
+ });
42
+ }
43
+ }
44
+ exports.default = ScenarioFileOption;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @emails oncall+ws_labs
8
+ * @format
9
+ */
10
+ import type { ParsedArgs } from 'minimist';
11
+ import type { MemLabConfig } from '@memlab/core';
12
+ import { BaseOption } from '@memlab/core';
13
+ export default class SetContinuousTestOption extends BaseOption {
14
+ getOptionName(): string;
15
+ getDescription(): string;
16
+ parse(config: MemLabConfig, args: ParsedArgs): Promise<void>;
17
+ }
18
+ //# sourceMappingURL=SetContinuousTestOption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SetContinuousTestOption.d.ts","sourceRoot":"","sources":["../../src/options/SetContinuousTestOption.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,UAAU;IAC7D,aAAa,IAAI,MAAM;IAIvB,cAAc,IAAI,MAAM;IAIlB,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAKnE"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ *
8
+ * @emails oncall+ws_labs
9
+ * @format
10
+ */
11
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13
+ return new (P || (P = Promise))(function (resolve, reject) {
14
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
15
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
18
+ });
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ const core_1 = require("@memlab/core");
22
+ class SetContinuousTestOption extends core_1.BaseOption {
23
+ getOptionName() {
24
+ return 'sc';
25
+ }
26
+ getDescription() {
27
+ return 'set to continuous test mode';
28
+ }
29
+ parse(config, args) {
30
+ return __awaiter(this, void 0, void 0, function* () {
31
+ if (args['ContinuousTest'] || args[this.getOptionName()]) {
32
+ config.isContinuousTest = true;
33
+ }
34
+ });
35
+ }
36
+ }
37
+ exports.default = SetContinuousTestOption;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @emails oncall+ws_labs
8
+ * @format
9
+ */
10
+ import type { ParsedArgs } from 'minimist';
11
+ import type { MemLabConfig } from '@memlab/core';
12
+ import { BaseOption } from '@memlab/core';
13
+ export default class SetDeviceOption extends BaseOption {
14
+ getOptionName(): string;
15
+ getDescription(): string;
16
+ getExampleValues(): string[];
17
+ parse(config: MemLabConfig, args: ParsedArgs): Promise<void>;
18
+ }
19
+ //# sourceMappingURL=SetDeviceOption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SetDeviceOption.d.ts","sourceRoot":"","sources":["../../src/options/SetDeviceOption.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAW,MAAM,cAAc,CAAC;AASlD,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,UAAU;IACrD,aAAa,IAAI,MAAM;IAIvB,cAAc,IAAI,MAAM;IAIxB,gBAAgB,IAAI,MAAM,EAAE;IAItB,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAKnE"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ *
8
+ * @emails oncall+ws_labs
9
+ * @format
10
+ */
11
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13
+ return new (P || (P = Promise))(function (resolve, reject) {
14
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
15
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
18
+ });
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ const core_1 = require("@memlab/core");
22
+ const devices = core_1.constant.isFRL
23
+ ? {}
24
+ : core_1.constant.isFB
25
+ ? require('puppeteer-core/DeviceDescriptors')
26
+ : // eslint-disable-next-line @typescript-eslint/no-var-requires
27
+ require('puppeteer').devices;
28
+ class SetDeviceOption extends core_1.BaseOption {
29
+ getOptionName() {
30
+ return 'device';
31
+ }
32
+ getDescription() {
33
+ return 'set the device type to emulate';
34
+ }
35
+ getExampleValues() {
36
+ return Object.keys(devices);
37
+ }
38
+ parse(config, args) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ if (args.device) {
41
+ config.setDevice(args.device, { manualOverride: true });
42
+ }
43
+ });
44
+ }
45
+ }
46
+ exports.default = SetDeviceOption;