@tstdl/base 0.92.156 → 0.92.158

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.
@@ -137,6 +137,7 @@ export declare class AuthenticationClientService<AdditionalTokenPayload extends
137
137
  * @param data Additional authentication data. If not provided, the data from before impersonation is used.
138
138
  */
139
139
  unimpersonate(data?: AuthenticationData): Promise<void>;
140
+ changeSecret(subject: string, currentSecret: string, newSecret: string): Promise<void>;
140
141
  /**
141
142
  * Initialize a secret reset
142
143
  * @param subject The subject to reset the secret for
@@ -278,6 +278,9 @@ let AuthenticationClientService = class AuthenticationClientService {
278
278
  }
279
279
  });
280
280
  }
281
+ async changeSecret(subject, currentSecret, newSecret) {
282
+ await this.client.changeSecret({ subject, currentSecret, newSecret });
283
+ }
281
284
  /**
282
285
  * Initialize a secret reset
283
286
  * @param subject The subject to reset the secret for
package/core.js CHANGED
@@ -5,7 +5,7 @@ import { LogLevel, Logger } from './logger/index.js';
5
5
  import { LOG_LEVEL } from './logger/tokens.js';
6
6
  import { initializeSignals, setProcessShutdownLogger } from './process-shutdown.js';
7
7
  import { timeout } from './utils/timing.js';
8
- import { assertDefinedPass, isDefined, isUndefined } from './utils/type-guards.js';
8
+ import { assertDefinedPass, isDefined } from './utils/type-guards.js';
9
9
  if (globalThis.tstdlLoaded == true) {
10
10
  console.error(new Error('tstdl seems to be loaded multiple times. This is likely an error as some modules won\'t work as intended this way.'));
11
11
  }
@@ -17,10 +17,7 @@ let _isDevMode = true;
17
17
  * @deprecated Usage of `getGlobalInjector` should be avoided. Use `Application` scoped injector instead.
18
18
  */
19
19
  export function getGlobalInjector() {
20
- if (isUndefined(globalInjector)) {
21
- globalInjector = new Injector('GlobalInjector');
22
- }
23
- return globalInjector;
20
+ return globalInjector ??= new Injector('GlobalInjector');
24
21
  }
25
22
  export function isDevMode() {
26
23
  return _isDevMode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.92.156",
3
+ "version": "0.92.158",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -1,4 +1,3 @@
1
- import { setTimeout } from 'node:timers';
2
1
  import { CancellationToken } from './cancellation/index.js';
3
2
  import { isDefined, isUndefined } from './utils/type-guards.js';
4
3
  const quitSignals = ['SIGTERM', 'SIGINT', 'SIGHUP', 'SIGBREAK'];