@tstdl/base 0.84.18 → 0.84.19
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.
|
@@ -17,7 +17,7 @@ export type CreateTokenData<AdditionalTokenPayload extends Record> = {
|
|
|
17
17
|
subject: string;
|
|
18
18
|
sessionId: string;
|
|
19
19
|
refreshTokenExpiration: number;
|
|
20
|
-
timestamp
|
|
20
|
+
timestamp?: number;
|
|
21
21
|
};
|
|
22
22
|
export declare class AuthenticationServiceOptions {
|
|
23
23
|
/**
|
|
@@ -225,7 +225,7 @@ let AuthenticationService = class AuthenticationService2 {
|
|
|
225
225
|
return this.subjectResolver?.resolveSubject(subject) ?? subject;
|
|
226
226
|
}
|
|
227
227
|
/** Creates a token without session or refresh token and is not saved in database */
|
|
228
|
-
async createToken({ tokenVersion, jwtId, issuedAt, expiration, additionalTokenPayload, subject, sessionId, refreshTokenExpiration, timestamp }) {
|
|
228
|
+
async createToken({ tokenVersion, jwtId, issuedAt, expiration, additionalTokenPayload, subject, sessionId, refreshTokenExpiration, timestamp = (0, import_date_time.currentTimestamp)() }) {
|
|
229
229
|
const header = {
|
|
230
230
|
v: tokenVersion ?? this.tokenVersion,
|
|
231
231
|
alg: "HS256",
|
|
@@ -69,7 +69,7 @@ let BrowserService = class BrowserService2 {
|
|
|
69
69
|
async [import_disposable.disposeAsync]() {
|
|
70
70
|
return this.dispose();
|
|
71
71
|
}
|
|
72
|
-
async newBrowser(options
|
|
72
|
+
async newBrowser(options) {
|
|
73
73
|
const mergedOptions = { ...this.options?.defaultNewBrowserOptions, ...options };
|
|
74
74
|
const launchOptions = (0, import_utils.getLaunchOptions)(mergedOptions);
|
|
75
75
|
const browser = await (0, import_module.getBrowserType)(mergedOptions.browser).launch(launchOptions);
|
package/core.d.ts
CHANGED
|
@@ -5,7 +5,8 @@ import { LogLevel, Logger } from './logger/index.js';
|
|
|
5
5
|
export declare const CORE_LOGGER: InjectionToken<Logger, any>;
|
|
6
6
|
export declare const disposer: AsyncDisposer;
|
|
7
7
|
export declare function isDevMode(): boolean;
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function isProdMode(): boolean;
|
|
9
|
+
export declare function enableProdMode(): void;
|
|
9
10
|
export declare function connect(name: string, connectFunction: (() => Promise<any>), logger: Logger, maxTries?: number): Promise<void>;
|
|
10
11
|
export declare function disposeInstances(): Promise<void>;
|
|
11
12
|
export type CoreConfiguration = {
|
package/core.js
CHANGED
|
@@ -23,8 +23,9 @@ __export(core_exports, {
|
|
|
23
23
|
connect: () => connect,
|
|
24
24
|
disposeInstances: () => disposeInstances,
|
|
25
25
|
disposer: () => disposer,
|
|
26
|
-
|
|
27
|
-
isDevMode: () => isDevMode
|
|
26
|
+
enableProdMode: () => enableProdMode,
|
|
27
|
+
isDevMode: () => isDevMode,
|
|
28
|
+
isProdMode: () => isProdMode
|
|
28
29
|
});
|
|
29
30
|
module.exports = __toCommonJS(core_exports);
|
|
30
31
|
var import_container = require("./container/index.js");
|
|
@@ -39,7 +40,10 @@ let _isDevMode = true;
|
|
|
39
40
|
function isDevMode() {
|
|
40
41
|
return _isDevMode;
|
|
41
42
|
}
|
|
42
|
-
function
|
|
43
|
+
function isProdMode() {
|
|
44
|
+
return _isDevMode;
|
|
45
|
+
}
|
|
46
|
+
function enableProdMode() {
|
|
43
47
|
_isDevMode = false;
|
|
44
48
|
}
|
|
45
49
|
async function connect(name, connectFunction, logger, maxTries = 5) {
|
|
@@ -67,7 +71,7 @@ async function disposeInstances() {
|
|
|
67
71
|
let coreLogPrefix;
|
|
68
72
|
function configureTstdl(config = {}) {
|
|
69
73
|
if (config.production == true) {
|
|
70
|
-
|
|
74
|
+
enableProdMode();
|
|
71
75
|
}
|
|
72
76
|
import_container.container.register(import_logger2.Logger, { useToken: config.logger ?? import_logger.ConsoleLogger });
|
|
73
77
|
import_container.container.registerSingleton(import_logger2.LogLevel, { useFactory: (level) => (0, import_type_guards.assertDefinedPass)(level, "LogLevel argument not provided") }, { defaultArgumentProvider: () => config.logLevel ?? import_logger2.LogLevel.Trace });
|