Skip to content

Commit

Permalink
fix(js/plugins/firebase): fix imports for ESM compatibility in fireba…
Browse files Browse the repository at this point in the history
…se auth
  • Loading branch information
pavelgj committed Dec 10, 2024
1 parent 780ca7d commit cd34f3b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions js/plugins/firebase/src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import { Response } from 'express';
import { DecodedIdToken, getAuth } from 'firebase-admin/auth';
import { __RequestWithAuth, z } from 'genkit';
import { FunctionFlowAuth } from './functions';
import { initializeAppIfNecessary } from './helpers';
import { FunctionFlowAuth } from './functions.js';
import { initializeAppIfNecessary } from './helpers.js';

export function firebaseAuth<I extends z.ZodTypeAny>(
policy: (user: DecodedIdToken, input: z.infer<I>) => void | Promise<void>
Expand Down
2 changes: 1 addition & 1 deletion js/plugins/firebase/tests/auth_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { describe, expect, it } from '@jest/globals';
import { firebaseAuth } from '../src/auth';
import { firebaseAuth } from '../lib/auth.js';

describe('firebaseAuth', () => {
it('config unset throws', async () => {
Expand Down
2 changes: 2 additions & 0 deletions js/testapps/esm/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { checks } from '@genkit-ai/checks';
import { devLocalVectorstore } from '@genkit-ai/dev-local-vectorstore';
import { genkitEval } from '@genkit-ai/evaluator';
import { enableFirebaseTelemetry } from '@genkit-ai/firebase';
import { firebaseAuth } from '@genkit-ai/firebase/auth';
import { enableGoogleCloudTelemetry } from '@genkit-ai/google-cloud';
import { googleAI } from '@genkit-ai/googleai';
import { vertexAI } from '@genkit-ai/vertexai';
Expand All @@ -42,5 +43,6 @@ pinecone;
chroma;
devLocalVectorstore;
genkitEval;
firebaseAuth;

export const ai = genkit({});

0 comments on commit cd34f3b

Please sign in to comment.