@tstdl/base 0.84.9 → 0.84.11

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.
@@ -3,7 +3,7 @@ import type { Injectable } from '../container/interfaces.js';
3
3
  import { resolveArgumentType } from '../container/interfaces.js';
4
4
  import type { AsyncDisposable } from '../disposable/disposable.js';
5
5
  import { disposeAsync } from '../disposable/disposable.js';
6
- import type { Json } from '../types.js';
6
+ import type { Record } from '../types.js';
7
7
  import type { Opaque } from 'type-fest';
8
8
  import type { NewBrowserContextOptions } from './browser-controller.js';
9
9
  import type { PageControllerOptions } from './page-controller.js';
@@ -15,7 +15,7 @@ export type NewPageOptions = {
15
15
  extraHttpHeaders?: Record<string, string>;
16
16
  controllerOptions?: PageControllerOptions;
17
17
  };
18
- export type BrowserContextState = Opaque<Json, 'BrowserContextState'>;
18
+ export type BrowserContextState = Opaque<string | Record<string | number, unknown>, 'BrowserContextState'>;
19
19
  export type BrowserContextControllerArgument = NewBrowserContextOptions;
20
20
  export declare class BrowserContextController implements AsyncDisposable, Injectable<BrowserContextControllerArgument> {
21
21
  private readonly options;
@@ -11,7 +11,7 @@ export declare class BrowserServiceOptions {
11
11
  export type BrowserServiceArgument = BrowserServiceOptions;
12
12
  export type NewBrowserOptions = {
13
13
  browser?: 'chromium' | 'firefox' | 'webkit';
14
- headless?: boolean;
14
+ headless?: boolean | 'new';
15
15
  windowSize?: {
16
16
  width: number;
17
17
  height: number;
package/browser/utils.js CHANGED
@@ -26,7 +26,14 @@ var import_object = require("../utils/object/object.js");
26
26
  function getLaunchOptions(options) {
27
27
  const { windowSize, browserArguments, headless } = options;
28
28
  const args = [`--window-size=${windowSize?.width ?? 1e3},${windowSize?.height ?? 1e3}`, ...browserArguments ?? []];
29
- return { headless, args };
29
+ if (options.headless == "new") {
30
+ args.push("--headless=new");
31
+ }
32
+ return {
33
+ ignoreDefaultArgs: options.headless == "new" ? ["--headless"] : void 0,
34
+ headless: headless != false,
35
+ args
36
+ };
30
37
  }
31
38
  function mergeNewBrowserContextOptions(a, b, c) {
32
39
  const mergedExtraHttpHeaders = { ...a?.extraHttpHeaders, ...b?.extraHttpHeaders, ...c?.extraHttpHeaders };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.84.9",
3
+ "version": "0.84.11",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -20,7 +20,6 @@
20
20
  "tsc-alias:watch": "tsc-alias --watch"
21
21
  },
22
22
  "dependencies": {
23
- "@angular/core": "^16.0.0",
24
23
  "luxon": "^3.3",
25
24
  "reflect-metadata": "^0.1",
26
25
  "rxjs": "^7.8",
@@ -49,20 +48,20 @@
49
48
  "@elastic/elasticsearch": "^8.7",
50
49
  "@koa/router": "^12.0",
51
50
  "@tstdl/angular": "^0.84",
52
- "@zxcvbn-ts/core": "^2.2",
53
- "@zxcvbn-ts/language-common": "^2.0",
54
- "@zxcvbn-ts/language-de": "^2.1",
55
- "@zxcvbn-ts/language-en": "^2.1",
51
+ "@zxcvbn-ts/core": "^3.0",
52
+ "@zxcvbn-ts/language-common": "^3.0",
53
+ "@zxcvbn-ts/language-de": "^3.0",
54
+ "@zxcvbn-ts/language-en": "^3.0",
56
55
  "chroma-js": "^2.4",
57
56
  "handlebars": "^4.7",
58
57
  "knex": "^2.4",
59
58
  "koa": "^2.14",
60
59
  "minio": "^7.1",
61
60
  "mjml": "^4.14",
62
- "mongodb": "^5.4",
61
+ "mongodb": "^5.5",
63
62
  "nodemailer": "^6.9",
64
63
  "playwright": "^1.33",
65
- "preact": "^10.13",
64
+ "preact": "^10.14",
66
65
  "preact-render-to-string": "^6.0",
67
66
  "undici": "^5.22",
68
67
  "urlpattern-polyfill": "^8.0"
@@ -43,7 +43,7 @@ async function checkPassword(password, { checkForPwned = true } = {}) {
43
43
  checkForPwned ? Promise.race([(0, import_have_i_been_pwned.haveIBeenPwned)(password).catch(() => void 0), (0, import_timing.timeout)(1e3).then(() => void 0)]) : void 0
44
44
  ]);
45
45
  const pwnedWarnings = (0, import_type_guards.isNotNullOrUndefined)(pwnedResult) && pwnedResult > 0 ? [import_password_check_localization.passwordCheckLocalizationKeys.tstdl.passwordCheck.warnings.pwned[import_property_name.propertyName]] : [];
46
- const warnings = zxcvbnResult.feedback.warning ? [...pwnedWarnings, import_password_check_localization.passwordCheckLocalizationKeys.tstdl.passwordCheck.warnings[zxcvbnResult.feedback.warning][import_property_name.propertyName]] : pwnedWarnings;
46
+ const warnings = (0, import_type_guards.isNotNullOrUndefined)(zxcvbnResult.feedback.warning) ? [...pwnedWarnings, import_password_check_localization.passwordCheckLocalizationKeys.tstdl.passwordCheck.warnings[zxcvbnResult.feedback.warning][import_property_name.propertyName]] : pwnedWarnings;
47
47
  const suggestions = zxcvbnResult.feedback.suggestions.map((suggestion) => import_password_check_localization.passwordCheckLocalizationKeys.tstdl.passwordCheck.suggestions[suggestion][import_property_name.propertyName]);
48
48
  return {
49
49
  strength: (pwnedResult ?? 0) > 0 ? 0 : zxcvbnResult.score,
@@ -63,9 +63,9 @@ async function importZxcvbn() {
63
63
  const [{ zxcvbnAsync, zxcvbnOptions }, common, english, german] = await Promise.all([
64
64
  import("@zxcvbn-ts/core"),
65
65
  /* eslint-disable @typescript-eslint/no-unnecessary-condition */
66
- import("@zxcvbn-ts/language-common").then((module2) => module2.default),
67
- import("@zxcvbn-ts/language-en").then((module2) => module2.default),
68
- import("@zxcvbn-ts/language-de").then((module2) => module2.default)
66
+ import("@zxcvbn-ts/language-common"),
67
+ import("@zxcvbn-ts/language-en"),
68
+ import("@zxcvbn-ts/language-de")
69
69
  /* eslint-enable @typescript-eslint/no-unnecessary-condition */
70
70
  ]);
71
71
  const options = {