@tstdl/base 0.93.189 → 0.93.191

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.
@@ -27,6 +27,8 @@ export declare class GenkitModuleOptions {
27
27
  plugins?: GenkitOptions['plugins'];
28
28
  /** Default Genkit options */
29
29
  options?: Omit<GenkitOptions, 'plugins'>;
30
+ /** Gemini model configuration default options */
31
+ modelOptions?: GeminiConfig;
30
32
  }
31
33
  /**
32
34
  * Configures the {@link AiService}.
@@ -20,6 +20,8 @@ export class GenkitModuleOptions {
20
20
  plugins;
21
21
  /** Default Genkit options */
22
22
  options;
23
+ /** Gemini model configuration default options */
24
+ modelOptions;
23
25
  }
24
26
  /**
25
27
  * Configures the {@link AiService}.
@@ -61,10 +63,11 @@ export function injectGenkit(options) {
61
63
  ].filter(isNotNull),
62
64
  });
63
65
  }
64
- function injectModel(...args) {
66
+ function injectModel(name, config) {
65
67
  const moduleOptions = inject(GenkitModuleOptions, undefined, { optional: true }) ?? {};
66
68
  const provider = isDefined(moduleOptions.vertex) ? vertexAI : googleAI;
67
- return provider.model(...args);
69
+ const mergedConfig = { ...moduleOptions.modelOptions, ...config };
70
+ return provider.model(name, mergedConfig);
68
71
  }
69
72
  const _injectModel = injectModel;
70
73
  export function injectMultiLocationModel(model, config) {
@@ -558,10 +558,6 @@ let AuthenticationClientService = class AuthenticationClientService {
558
558
  // If lock is held by another instance/tab, wait briefly for it to finish (passive sync)
559
559
  if (!lockResult.success) {
560
560
  await waitForNextAction(5000);
561
- // If another tab successfully refreshed, the expiration will have changed
562
- if (this.token()?.exp !== token.exp) {
563
- this.forceRefreshRequested.set(false);
564
- }
565
561
  }
566
562
  // Protection against tight loops (e.g. if server clock is ahead and sync failed)
567
563
  const newToken = this.token();
@@ -1,7 +1,6 @@
1
1
  import { firstValueFrom, race, timeout as rxjsTimeout } from 'rxjs';
2
2
  import { HttpError } from '../../http/index.js';
3
3
  import { supportsCookies } from '../../supports.js';
4
- import { timeout } from '../../utils/timing.js';
5
4
  import { isDefined } from '../../utils/type-guards.js';
6
5
  import { cacheValueOrAsyncProvider } from '../../utils/value-or-provider.js';
7
6
  import { dontWaitForValidToken } from '../authentication.api.js';
@@ -19,15 +18,13 @@ export function waitForAuthenticationMiddleware(authenticationServiceOrProvider)
19
18
  while (!authenticationService.hasValidToken && authenticationService.isLoggedIn()) {
20
19
  const race$ = race([
21
20
  authenticationService.validToken$,
21
+ authenticationService.loggedOut$,
22
22
  request.cancellationSignal,
23
23
  ]);
24
24
  await firstValueFrom(race$.pipe(rxjsTimeout(30000))).catch(() => undefined);
25
- if (request.cancellationSignal.isSet) {
25
+ if (request.cancellationSignal.isSet || !authenticationService.isLoggedIn()) {
26
26
  break;
27
27
  }
28
- if (!authenticationService.hasValidToken && authenticationService.isLoggedIn()) {
29
- await timeout(100);
30
- }
31
28
  }
32
29
  }
33
30
  await next();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.93.189",
3
+ "version": "0.93.191",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -153,8 +153,8 @@
153
153
  "type-fest": "^5.5"
154
154
  },
155
155
  "peerDependencies": {
156
- "@aws-sdk/client-s3": "^3.1022",
157
- "@aws-sdk/s3-request-presigner": "^3.1022",
156
+ "@aws-sdk/client-s3": "^3.1024",
157
+ "@aws-sdk/s3-request-presigner": "^3.1024",
158
158
  "@genkit-ai/google-genai": "^1.31",
159
159
  "@google-cloud/storage": "^7.19",
160
160
  "@toon-format/toon": "^2.1.0",
@@ -190,13 +190,13 @@
190
190
  "@types/luxon": "3.7",
191
191
  "@types/mjml": "4.7",
192
192
  "@types/node": "25",
193
- "@types/nodemailer": "7.0",
193
+ "@types/nodemailer": "8.0",
194
194
  "@types/pg": "8.20",
195
195
  "@vitest/coverage-v8": "4.1",
196
196
  "@vitest/ui": "4.1",
197
197
  "concurrently": "9.2",
198
198
  "drizzle-kit": "0.31",
199
- "eslint": "10.1",
199
+ "eslint": "10.2",
200
200
  "globals": "17.4",
201
201
  "tsc-alias": "1.8",
202
202
  "typedoc-github-wiki-theme": "2.1",
@@ -1,13 +1,16 @@
1
1
  import { computed, signal } from './api.js';
2
2
  export function createNotifier() {
3
3
  const sourceSignal = signal(0);
4
- const notifier = {
4
+ return {
5
5
  listen: sourceSignal.asReadonly(),
6
- notify: () => sourceSignal.update((v) => v + 1),
7
- computed: (computation, options) => computed(() => {
8
- notifier.listen();
9
- return computation();
10
- }, options),
6
+ notify() {
7
+ sourceSignal.update((v) => v + 1);
8
+ },
9
+ computed(computation, options) {
10
+ return computed(() => {
11
+ sourceSignal();
12
+ return computation();
13
+ }, options);
14
+ },
11
15
  };
12
- return notifier;
13
16
  }