@browserless.io/browserless 2.24.0-beta-5 → 2.24.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 (77) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/bin/browserless.js +1 -1
  3. package/build/browsers/browsers.playwright.d.ts +1 -0
  4. package/build/browsers/browsers.playwright.js +3 -0
  5. package/build/browsers/index.d.ts +2 -1
  6. package/build/browsers/index.js +28 -7
  7. package/build/http.d.ts +5 -0
  8. package/build/http.js +1 -0
  9. package/build/routes/chrome/http/content.post.body.json +8 -8
  10. package/build/routes/chrome/http/content.post.query.json +4 -0
  11. package/build/routes/chrome/http/download.post.query.json +4 -0
  12. package/build/routes/chrome/http/function.post.query.json +4 -0
  13. package/build/routes/chrome/http/pdf.post.body.json +8 -8
  14. package/build/routes/chrome/http/pdf.post.query.json +4 -0
  15. package/build/routes/chrome/http/performance.post.query.json +4 -0
  16. package/build/routes/chrome/http/scrape.post.body.json +8 -8
  17. package/build/routes/chrome/http/scrape.post.query.json +4 -0
  18. package/build/routes/chrome/http/screenshot.post.body.json +8 -8
  19. package/build/routes/chrome/http/screenshot.post.query.json +4 -0
  20. package/build/routes/chrome/tests/kill-sessions.spec.d.ts +1 -0
  21. package/build/routes/chrome/tests/kill-sessions.spec.js +80 -0
  22. package/build/routes/chrome/ws/browser.query.json +4 -0
  23. package/build/routes/chrome/ws/cdp.query.json +4 -0
  24. package/build/routes/chrome/ws/page.query.json +4 -0
  25. package/build/routes/chrome/ws/playwright.query.json +4 -0
  26. package/build/routes/chromium/http/content.post.body.json +8 -8
  27. package/build/routes/chromium/http/content.post.query.json +4 -0
  28. package/build/routes/chromium/http/download.post.query.json +4 -0
  29. package/build/routes/chromium/http/function.post.query.json +4 -0
  30. package/build/routes/chromium/http/pdf.post.body.json +8 -8
  31. package/build/routes/chromium/http/pdf.post.query.json +4 -0
  32. package/build/routes/chromium/http/performance.post.query.json +4 -0
  33. package/build/routes/chromium/http/scrape.post.body.json +8 -8
  34. package/build/routes/chromium/http/scrape.post.query.json +4 -0
  35. package/build/routes/chromium/http/screenshot.post.body.json +8 -8
  36. package/build/routes/chromium/http/screenshot.post.query.json +4 -0
  37. package/build/routes/chromium/tests/kill-sessions.spec.d.ts +1 -0
  38. package/build/routes/chromium/tests/kill-sessions.spec.js +80 -0
  39. package/build/routes/chromium/tests/websocket.spec.js +23 -0
  40. package/build/routes/chromium/ws/browser.query.json +4 -0
  41. package/build/routes/chromium/ws/cdp.query.json +4 -0
  42. package/build/routes/chromium/ws/page.query.json +4 -0
  43. package/build/routes/chromium/ws/playwright.query.json +4 -0
  44. package/build/routes/firefox/tests/kill-sessions.spec.d.ts +1 -0
  45. package/build/routes/firefox/tests/kill-sessions.spec.js +72 -0
  46. package/build/routes/firefox/ws/playwright.query.json +4 -0
  47. package/build/routes/management/http/kill.get.d.ts +21 -0
  48. package/build/routes/management/http/kill.get.js +19 -0
  49. package/build/routes/management/http/kill.get.query.json +193 -0
  50. package/build/routes/management/http/meta.get.js +3 -2
  51. package/build/routes/management/http/sessions.get.query.json +1 -0
  52. package/build/routes/management/tests/management.spec.js +12 -0
  53. package/build/routes/webkit/tests/kill-sessions.spec.d.ts +1 -0
  54. package/build/routes/webkit/tests/kill-sessions.spec.js +72 -0
  55. package/build/routes/webkit/ws/playwright.query.json +4 -0
  56. package/build/types.d.ts +2 -0
  57. package/build/types.js +1 -0
  58. package/build/utils.d.ts +1 -1
  59. package/build/utils.js +1 -10
  60. package/package.json +5 -5
  61. package/src/browsers/browsers.playwright.ts +3 -0
  62. package/src/browsers/index.ts +33 -12
  63. package/src/http.ts +6 -0
  64. package/src/routes/chrome/tests/kill-sessions.spec.ts +99 -0
  65. package/src/routes/chromium/tests/kill-sessions.spec.ts +99 -0
  66. package/src/routes/chromium/tests/websocket.spec.ts +29 -0
  67. package/src/routes/firefox/tests/kill-sessions.spec.ts +99 -0
  68. package/src/routes/management/http/kill.get.ts +40 -0
  69. package/src/routes/management/http/meta.get.ts +12 -10
  70. package/src/routes/management/tests/management.spec.ts +19 -0
  71. package/src/routes/webkit/tests/kill-sessions.spec.ts +99 -0
  72. package/src/types.ts +1 -0
  73. package/src/utils.ts +2 -11
  74. package/static/docs/swagger.json +297 -10
  75. package/static/docs/swagger.min.json +296 -9
  76. package/static/function/client.js +39 -25
  77. package/static/function/index.html +39 -25
@@ -2006,50 +2006,64 @@
2006
2006
  createDebug.namespaces = namespaces;
2007
2007
  createDebug.names = [];
2008
2008
  createDebug.skips = [];
2009
- let i;
2010
- const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
2011
- const len = split.length;
2012
- for (i = 0; i < len; i++) {
2013
- if (!split[i]) {
2014
- continue;
2009
+ const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(" ", ",").split(",").filter(Boolean);
2010
+ for (const ns of split) {
2011
+ if (ns[0] === "-") {
2012
+ createDebug.skips.push(ns.slice(1));
2013
+ } else {
2014
+ createDebug.names.push(ns);
2015
2015
  }
2016
- namespaces = split[i].replace(/\*/g, ".*?");
2017
- if (namespaces[0] === "-") {
2018
- createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$"));
2016
+ }
2017
+ }
2018
+ function matchesTemplate(search, template) {
2019
+ let searchIndex = 0;
2020
+ let templateIndex = 0;
2021
+ let starIndex = -1;
2022
+ let matchIndex = 0;
2023
+ while (searchIndex < search.length) {
2024
+ if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
2025
+ if (template[templateIndex] === "*") {
2026
+ starIndex = templateIndex;
2027
+ matchIndex = searchIndex;
2028
+ templateIndex++;
2029
+ } else {
2030
+ searchIndex++;
2031
+ templateIndex++;
2032
+ }
2033
+ } else if (starIndex !== -1) {
2034
+ templateIndex = starIndex + 1;
2035
+ matchIndex++;
2036
+ searchIndex = matchIndex;
2019
2037
  } else {
2020
- createDebug.names.push(new RegExp("^" + namespaces + "$"));
2038
+ return false;
2021
2039
  }
2022
2040
  }
2041
+ while (templateIndex < template.length && template[templateIndex] === "*") {
2042
+ templateIndex++;
2043
+ }
2044
+ return templateIndex === template.length;
2023
2045
  }
2024
2046
  function disable() {
2025
2047
  const namespaces = [
2026
- ...createDebug.names.map(toNamespace),
2027
- ...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace)
2048
+ ...createDebug.names,
2049
+ ...createDebug.skips.map((namespace) => "-" + namespace)
2028
2050
  ].join(",");
2029
2051
  createDebug.enable("");
2030
2052
  return namespaces;
2031
2053
  }
2032
2054
  function enabled(name) {
2033
- if (name[name.length - 1] === "*") {
2034
- return true;
2035
- }
2036
- let i;
2037
- let len;
2038
- for (i = 0, len = createDebug.skips.length; i < len; i++) {
2039
- if (createDebug.skips[i].test(name)) {
2055
+ for (const skip of createDebug.skips) {
2056
+ if (matchesTemplate(name, skip)) {
2040
2057
  return false;
2041
2058
  }
2042
2059
  }
2043
- for (i = 0, len = createDebug.names.length; i < len; i++) {
2044
- if (createDebug.names[i].test(name)) {
2060
+ for (const ns of createDebug.names) {
2061
+ if (matchesTemplate(name, ns)) {
2045
2062
  return true;
2046
2063
  }
2047
2064
  }
2048
2065
  return false;
2049
2066
  }
2050
- function toNamespace(regexp) {
2051
- return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
2052
- }
2053
2067
  function coerce(val) {
2054
2068
  if (val instanceof Error) {
2055
2069
  return val.stack || val.message;
@@ -4387,7 +4401,7 @@
4387
4401
  // node_modules/puppeteer-core/lib/esm/puppeteer/generated/version.js
4388
4402
  init_dirname();
4389
4403
  init_buffer2();
4390
- var packageVersion = "23.10.0";
4404
+ var packageVersion = "23.10.1";
4391
4405
 
4392
4406
  // node_modules/puppeteer-core/lib/esm/puppeteer/util/assert.js
4393
4407
  init_dirname();