automation_model 1.0.170 → 1.0.172

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/lib/popups.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import type { Page } from 'playwright';
1
+ import type { Page } from "playwright";
2
2
  export declare const closeUnexpectedPopups: (page: Page) => Promise<void>;
package/lib/popups.js CHANGED
@@ -1,24 +1,27 @@
1
- import * as fs from 'fs';
1
+ import * as fs from "fs";
2
2
  let config = null;
3
3
  export const closeUnexpectedPopups = async (page) => {
4
4
  if (!config) {
5
- const ai_config_file_content = fs.readFileSync('ai_config.json', 'utf8');
5
+ if (!fs.existsSync("ai_config.json")) {
6
+ return;
7
+ }
8
+ const ai_config_file_content = fs.readFileSync("ai_config.json", "utf8");
6
9
  config = JSON.parse(ai_config_file_content);
7
10
  }
8
- const popups = config['on_dialog'];
11
+ const popups = config["on_dialog"];
9
12
  if (!popups)
10
13
  return;
11
14
  if (!Array.isArray(popups)) {
12
- console.error('on_dialog in ai_config.json must be an array of {dialog_css:string, dismiss_css:string}');
15
+ console.error("on_dialog in ai_config.json must be an array of {dialog_css:string, dismiss_css:string}");
13
16
  return;
14
17
  }
15
18
  for (const { dialog_css, dismiss_css } of popups) {
16
19
  try {
17
20
  const popup = page.locator(dialog_css);
18
- if (!await popup.isVisible())
21
+ if (!(await popup.isVisible()))
19
22
  continue;
20
23
  const dismiss_button = page.locator(dismiss_css);
21
- if (!await dismiss_button.isVisible()) {
24
+ if (!(await dismiss_button.isVisible())) {
22
25
  throw Error(`dismiss_css ${dismiss_css} not found`);
23
26
  }
24
27
  await dismiss_button.click();
package/lib/popups.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"popups.js","sourceRoot":"","sources":["../../src/popups.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAKzB,IAAI,MAAM,GAAmB,IAAI,CAAC;AAElC,MAAM,CAAC,MAAM,qBAAq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ACX,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE;YACpC,OAAO;SACR;QACD,MAAM,sBAAsB,GAAG,EAAE,CAAC,YAAY,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;QACzE,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAa,CAAC;KACzD;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;IACnC,IAAI,CAAC,MAAM;QAAE,OAAO;IACpB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QAC1B,OAAO,CAAC,KAAK,CAAC,yFAAyF,CAAC,CAAC;QACzG,OAAO;KACR;IACD,KAAK,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,MAAM,EAAE;QAChD,IAAI;YACF,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;YACvC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,SAAS,EAAE,CAAC;gBAAE,SAAS;YACzC,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;YACjD,IAAI,CAAC,CAAC,MAAM,cAAc,CAAC,SAAS,EAAE,CAAC,EAAE;gBACvC,MAAM,KAAK,CAAC,eAAe,WAAW,YAAY,CAAC,CAAC;aACrD;YACD,MAAM,cAAc,CAAC,KAAK,EAAE,CAAC;SAC9B;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,CAAC,KAAK,CAAC,wBAAwB,KAAK,EAAE,CAAC,CAAC;SAChD;KACF;AACH,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "automation_model",
3
- "version": "1.0.170",
3
+ "version": "1.0.172",
4
4
  "description": "An automation infrastructure module to be use for generative AI automation projects.",
5
5
  "main": "lib/index.js",
6
6
  "type": "module",