clefbase 2.0.4 → 2.0.5
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.
- package/dist/cli-src/cli/commands/init.js +231 -55
- package/dist/cli.js +232 -56
- package/dist/functions.d.ts +2 -2
- package/dist/functions.d.ts.map +1 -1
- package/dist/functions.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +27 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -414,16 +414,14 @@ can return any JSON-serialisable value.
|
|
|
414
414
|
### FunctionContext shape
|
|
415
415
|
|
|
416
416
|
\`\`\`ts
|
|
417
|
+
import type { FunctionContext, AuthUser } from "clefbase";
|
|
418
|
+
|
|
417
419
|
interface FunctionContext {
|
|
418
420
|
/** Payload supplied by the caller (HTTP) or the event (triggers). */
|
|
419
|
-
data
|
|
421
|
+
data?: unknown;
|
|
420
422
|
|
|
421
423
|
/** Populated when the caller includes a valid auth token. */
|
|
422
|
-
auth?:
|
|
423
|
-
uid: string;
|
|
424
|
-
email?: string;
|
|
425
|
-
metadata: Record<string, unknown>;
|
|
426
|
-
};
|
|
424
|
+
auth?: AuthUser;
|
|
427
425
|
|
|
428
426
|
/** Describes what fired the function. */
|
|
429
427
|
trigger: {
|
|
@@ -619,7 +617,11 @@ const FUNCTIONS_TSCONFIG = `{
|
|
|
619
617
|
"strict": true,
|
|
620
618
|
"esModuleInterop": true,
|
|
621
619
|
"skipLibCheck": true,
|
|
622
|
-
"outDir": "dist"
|
|
620
|
+
"outDir": "dist",
|
|
621
|
+
"baseUrl": ".",
|
|
622
|
+
"paths": {
|
|
623
|
+
"@/*": ["src/*"]
|
|
624
|
+
}
|
|
623
625
|
},
|
|
624
626
|
"include": ["src/**/*"],
|
|
625
627
|
"exclude": ["node_modules", "dist"]
|
|
@@ -1180,90 +1182,248 @@ function printUsageHint(cfg, authSetup) {
|
|
|
1180
1182
|
}
|
|
1181
1183
|
// ─── Template Fallbacks ──────────────────────────────────────────────────
|
|
1182
1184
|
const AUTH_CONTEXT_FALLBACK = `'use client';
|
|
1185
|
+
|
|
1183
1186
|
import React, { createContext, useContext, useEffect, useState } from 'react';
|
|
1184
1187
|
import type { AuthUser } from 'clefbase';
|
|
1185
|
-
import { getAuth } from 'clefbase';
|
|
1188
|
+
import { getAuth, getDatabase } from 'clefbase';
|
|
1186
1189
|
|
|
1187
|
-
|
|
1190
|
+
/**
|
|
1191
|
+
* Base user data interface stored in the 'users' collection.
|
|
1192
|
+
* Extend this in your app for custom fields.
|
|
1193
|
+
*/
|
|
1194
|
+
export interface UserData {
|
|
1195
|
+
uid: string;
|
|
1196
|
+
email: string;
|
|
1197
|
+
displayName?: string;
|
|
1198
|
+
photoUrl?: string;
|
|
1199
|
+
createdAt?: string;
|
|
1200
|
+
[key: string]: unknown;
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
/**
|
|
1204
|
+
* Auth context for managing authentication state and user data in your React app.
|
|
1205
|
+
* Wraps the clefbase Auth SDK with React Context integration.
|
|
1206
|
+
*
|
|
1207
|
+
* Features:
|
|
1208
|
+
* - User state management with auth listener
|
|
1209
|
+
* - User profile data synced from database's 'users' collection
|
|
1210
|
+
* - Token persistence (handled by SDK)
|
|
1211
|
+
* - Auth modal state
|
|
1212
|
+
* - Error handling and loading states
|
|
1213
|
+
* - Auto-create user doc on first signup
|
|
1214
|
+
* - Auto-sync user data on signin
|
|
1215
|
+
*/
|
|
1216
|
+
|
|
1217
|
+
interface AuthContextType<T extends UserData = UserData> {
|
|
1218
|
+
/** Currently authenticated user, or null if not signed in */
|
|
1188
1219
|
user: AuthUser | null;
|
|
1220
|
+
/** User profile data from the 'users' collection, or null if not signed in */
|
|
1221
|
+
userData: T | null;
|
|
1222
|
+
/** Authentication token */
|
|
1189
1223
|
token: string | null;
|
|
1224
|
+
/** True while auth state is being restored or operations are pending */
|
|
1190
1225
|
loading: boolean;
|
|
1226
|
+
/** Error message from last failed operation */
|
|
1191
1227
|
error: string | null;
|
|
1228
|
+
/** True if auth modal is open */
|
|
1192
1229
|
isAuthModalOpen: boolean;
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1230
|
+
|
|
1231
|
+
// ── Auth modal management ────────────────────────────────────────────────
|
|
1232
|
+
|
|
1233
|
+
/**
|
|
1234
|
+
* Open the auth modal for sign in / sign up.
|
|
1235
|
+
* The modal at auth.cleforyx.com handles the actual authentication.
|
|
1236
|
+
* After success, auth state updates automatically.
|
|
1237
|
+
*/
|
|
1238
|
+
openAuthModal: () => void;
|
|
1239
|
+
|
|
1240
|
+
/**
|
|
1241
|
+
* Close the auth modal programmatically.
|
|
1242
|
+
*/
|
|
1243
|
+
closeAuthModal: () => void;
|
|
1244
|
+
|
|
1245
|
+
/**
|
|
1246
|
+
* Manually sync user data from the database.
|
|
1247
|
+
*/
|
|
1248
|
+
syncUserData: () => Promise<void>;
|
|
1249
|
+
|
|
1250
|
+
/**
|
|
1251
|
+
* Update user data in the database.
|
|
1252
|
+
*/
|
|
1253
|
+
updateUserData: (updates: Partial<Omit<T, 'uid'>>) => Promise<void>;
|
|
1254
|
+
|
|
1255
|
+
/**
|
|
1256
|
+
* Verify email with a verification code.
|
|
1257
|
+
*/
|
|
1197
1258
|
verifyEmail: (code: string) => Promise<void>;
|
|
1259
|
+
|
|
1260
|
+
/**
|
|
1261
|
+
* Request a password reset email.
|
|
1262
|
+
*/
|
|
1198
1263
|
sendPasswordResetEmail: (email: string) => Promise<void>;
|
|
1264
|
+
|
|
1265
|
+
/**
|
|
1266
|
+
* Sign out the current user and clear data.
|
|
1267
|
+
*/
|
|
1268
|
+
signOut: () => Promise<void>;
|
|
1269
|
+
|
|
1270
|
+
/**
|
|
1271
|
+
* Refresh user data from auth server.
|
|
1272
|
+
*/
|
|
1199
1273
|
refreshUser: () => Promise<void>;
|
|
1200
|
-
openAuthModal: () => void;
|
|
1201
|
-
closeAuthModal: () => void;
|
|
1202
1274
|
}
|
|
1203
1275
|
|
|
1204
1276
|
const AuthContext = createContext<AuthContextType | undefined>(undefined);
|
|
1205
1277
|
|
|
1206
|
-
|
|
1278
|
+
/**
|
|
1279
|
+
* Hook to use auth context in your components.
|
|
1280
|
+
*/
|
|
1281
|
+
export function useAuth<T extends UserData = UserData>(): AuthContextType<T> {
|
|
1207
1282
|
const context = useContext(AuthContext);
|
|
1208
|
-
if (!context)
|
|
1209
|
-
|
|
1283
|
+
if (!context) {
|
|
1284
|
+
throw new Error('useAuth() must be used within <AuthProvider>');
|
|
1285
|
+
}
|
|
1286
|
+
return context as AuthContextType<T>;
|
|
1210
1287
|
}
|
|
1211
1288
|
|
|
1289
|
+
/**
|
|
1290
|
+
* Provider component that wraps your app with authentication.
|
|
1291
|
+
*/
|
|
1212
1292
|
export function AuthProvider({ children }: { children: React.ReactNode }) {
|
|
1293
|
+
// State
|
|
1213
1294
|
const [user, setUser] = useState<AuthUser | null>(null);
|
|
1295
|
+
const [userData, setUserData] = useState<UserData | null>(null);
|
|
1214
1296
|
const [token, setToken] = useState<string | null>(null);
|
|
1215
1297
|
const [loading, setLoading] = useState(true);
|
|
1216
1298
|
const [error, setError] = useState<string | null>(null);
|
|
1217
1299
|
const [isAuthModalOpen, setIsAuthModalOpen] = useState(false);
|
|
1300
|
+
|
|
1301
|
+
// Get auth and database services from clefbase
|
|
1218
1302
|
const auth = getAuth();
|
|
1303
|
+
const db = getDatabase();
|
|
1304
|
+
|
|
1305
|
+
// ── Helper: sync user data from database ────────────────────────────────
|
|
1306
|
+
|
|
1307
|
+
const syncUserDataInternal = async (uid: string): Promise<void> => {
|
|
1308
|
+
try {
|
|
1309
|
+
const doc = await db.collection('users').doc(uid).get();
|
|
1310
|
+
if (doc) {
|
|
1311
|
+
setUserData(doc as UserData);
|
|
1312
|
+
} else {
|
|
1313
|
+
// First login - create user doc
|
|
1314
|
+
const authUser = auth.currentUser;
|
|
1315
|
+
if (authUser) {
|
|
1316
|
+
const newUserData: UserData = {
|
|
1317
|
+
uid: authUser.uid,
|
|
1318
|
+
email: authUser.email,
|
|
1319
|
+
displayName: authUser.displayName,
|
|
1320
|
+
photoUrl: authUser.photoUrl,
|
|
1321
|
+
createdAt: new Date().toISOString(),
|
|
1322
|
+
};
|
|
1323
|
+
await db.collection('users').doc(uid).set(newUserData);
|
|
1324
|
+
setUserData(newUserData);
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
} catch (err) {
|
|
1328
|
+
console.error('Error syncing user data:', err);
|
|
1329
|
+
}
|
|
1330
|
+
};
|
|
1331
|
+
|
|
1332
|
+
// ── Initialize on mount ────────────────────────────────────────────────
|
|
1219
1333
|
|
|
1220
1334
|
useEffect(() => {
|
|
1221
1335
|
const initAuth = async () => {
|
|
1222
1336
|
try {
|
|
1223
1337
|
setLoading(true);
|
|
1338
|
+
|
|
1224
1339
|
const currentUser = auth.currentUser;
|
|
1225
1340
|
const currentToken = auth.currentToken;
|
|
1341
|
+
|
|
1226
1342
|
setUser(currentUser);
|
|
1227
1343
|
setToken(currentToken);
|
|
1228
|
-
|
|
1344
|
+
|
|
1345
|
+
if (currentUser) {
|
|
1346
|
+
await syncUserDataInternal(currentUser.uid);
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
const unsubscribe = auth.onAuthStateChanged(async (newUser) => {
|
|
1229
1350
|
setUser(newUser);
|
|
1230
|
-
|
|
1351
|
+
if (newUser) {
|
|
1352
|
+
setToken(auth.currentToken);
|
|
1353
|
+
await syncUserDataInternal(newUser.uid);
|
|
1354
|
+
} else {
|
|
1355
|
+
setToken(null);
|
|
1356
|
+
setUserData(null);
|
|
1357
|
+
}
|
|
1231
1358
|
});
|
|
1359
|
+
|
|
1232
1360
|
setLoading(false);
|
|
1361
|
+
|
|
1233
1362
|
return () => unsubscribe();
|
|
1234
1363
|
} catch (err) {
|
|
1235
|
-
console.error('Auth
|
|
1364
|
+
console.error('Auth initialization error:', err);
|
|
1236
1365
|
setLoading(false);
|
|
1237
1366
|
}
|
|
1238
1367
|
};
|
|
1368
|
+
|
|
1239
1369
|
initAuth();
|
|
1240
|
-
}, [auth]);
|
|
1370
|
+
}, [auth, db]);
|
|
1371
|
+
|
|
1372
|
+
// ── Error handling helper ──────────────────────────────────────────────
|
|
1241
1373
|
|
|
1242
1374
|
const handleError = (err: unknown): string => {
|
|
1243
|
-
if (err instanceof Error)
|
|
1244
|
-
|
|
1245
|
-
|
|
1375
|
+
if (err instanceof Error) {
|
|
1376
|
+
return err.message;
|
|
1377
|
+
}
|
|
1378
|
+
if (typeof err === 'string') {
|
|
1379
|
+
return err;
|
|
1380
|
+
}
|
|
1381
|
+
return 'An unknown error occurred';
|
|
1246
1382
|
};
|
|
1247
1383
|
|
|
1248
|
-
|
|
1384
|
+
// ── User data methods ──────────────────────────────────────────────────
|
|
1385
|
+
|
|
1386
|
+
const syncUserData = async (): Promise<void> => {
|
|
1387
|
+
if (!user) {
|
|
1388
|
+
setUserData(null);
|
|
1389
|
+
return;
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1249
1392
|
try {
|
|
1250
|
-
|
|
1251
|
-
setLoading(true);
|
|
1252
|
-
await auth.signIn(email, password);
|
|
1393
|
+
await syncUserDataInternal(user.uid);
|
|
1253
1394
|
} catch (err) {
|
|
1254
1395
|
const message = handleError(err);
|
|
1255
1396
|
setError(message);
|
|
1256
1397
|
throw err;
|
|
1257
|
-
} finally {
|
|
1258
|
-
setLoading(false);
|
|
1259
1398
|
}
|
|
1260
1399
|
};
|
|
1261
1400
|
|
|
1262
|
-
const
|
|
1401
|
+
const updateUserData = async (
|
|
1402
|
+
updates: Partial<Omit<UserData, 'uid'>>
|
|
1403
|
+
): Promise<void> => {
|
|
1404
|
+
if (!user) {
|
|
1405
|
+
throw new Error('User not authenticated');
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1263
1408
|
try {
|
|
1264
1409
|
setError(null);
|
|
1265
1410
|
setLoading(true);
|
|
1266
|
-
|
|
1411
|
+
|
|
1412
|
+
const authUpdates: Record<string, unknown> = {};
|
|
1413
|
+
if ('displayName' in updates) {
|
|
1414
|
+
authUpdates.displayName = updates.displayName;
|
|
1415
|
+
}
|
|
1416
|
+
if ('photoUrl' in updates) {
|
|
1417
|
+
authUpdates.photoUrl = updates.photoUrl;
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
if (Object.keys(authUpdates).length > 0) {
|
|
1421
|
+
await auth.updateProfile(authUpdates);
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
await db.collection('users').doc(user.uid).update(updates);
|
|
1425
|
+
|
|
1426
|
+
setUserData((prev) => (prev ? { ...prev, ...updates } : null));
|
|
1267
1427
|
} catch (err) {
|
|
1268
1428
|
const message = handleError(err);
|
|
1269
1429
|
setError(message);
|
|
@@ -1273,6 +1433,8 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
|
|
|
1273
1433
|
}
|
|
1274
1434
|
};
|
|
1275
1435
|
|
|
1436
|
+
// ── Auth methods ───────────────────────────────────────────────────────
|
|
1437
|
+
|
|
1276
1438
|
const signOut = async () => {
|
|
1277
1439
|
try {
|
|
1278
1440
|
setError(null);
|
|
@@ -1280,20 +1442,7 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
|
|
|
1280
1442
|
await auth.signOut();
|
|
1281
1443
|
setUser(null);
|
|
1282
1444
|
setToken(null);
|
|
1283
|
-
|
|
1284
|
-
const message = handleError(err);
|
|
1285
|
-
setError(message);
|
|
1286
|
-
throw err;
|
|
1287
|
-
} finally {
|
|
1288
|
-
setLoading(false);
|
|
1289
|
-
}
|
|
1290
|
-
};
|
|
1291
|
-
|
|
1292
|
-
const updateProfile = async (updates: any) => {
|
|
1293
|
-
try {
|
|
1294
|
-
setError(null);
|
|
1295
|
-
setLoading(true);
|
|
1296
|
-
await auth.updateProfile(updates);
|
|
1445
|
+
setUserData(null);
|
|
1297
1446
|
} catch (err) {
|
|
1298
1447
|
const message = handleError(err);
|
|
1299
1448
|
setError(message);
|
|
@@ -1344,13 +1493,33 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
|
|
|
1344
1493
|
}
|
|
1345
1494
|
};
|
|
1346
1495
|
|
|
1347
|
-
|
|
1348
|
-
|
|
1496
|
+
// ── Modal management ───────────────────────────────────────────────────
|
|
1497
|
+
|
|
1498
|
+
const openAuthModal = () => {
|
|
1499
|
+
setIsAuthModalOpen(true);
|
|
1500
|
+
};
|
|
1501
|
+
|
|
1502
|
+
const closeAuthModal = () => {
|
|
1503
|
+
setIsAuthModalOpen(false);
|
|
1504
|
+
};
|
|
1505
|
+
|
|
1506
|
+
// ── Provider value ────────────────────────────────────────────────────
|
|
1349
1507
|
|
|
1350
1508
|
const value: AuthContextType = {
|
|
1351
|
-
user,
|
|
1352
|
-
|
|
1353
|
-
|
|
1509
|
+
user,
|
|
1510
|
+
userData,
|
|
1511
|
+
token,
|
|
1512
|
+
loading,
|
|
1513
|
+
error,
|
|
1514
|
+
isAuthModalOpen,
|
|
1515
|
+
syncUserData,
|
|
1516
|
+
updateUserData,
|
|
1517
|
+
verifyEmail,
|
|
1518
|
+
sendPasswordResetEmail,
|
|
1519
|
+
signOut,
|
|
1520
|
+
refreshUser,
|
|
1521
|
+
openAuthModal,
|
|
1522
|
+
closeAuthModal,
|
|
1354
1523
|
};
|
|
1355
1524
|
|
|
1356
1525
|
return (
|
|
@@ -1358,10 +1527,17 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
|
|
|
1358
1527
|
{!loading && children}
|
|
1359
1528
|
</AuthContext.Provider>
|
|
1360
1529
|
);
|
|
1361
|
-
}
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
/**
|
|
1533
|
+
* CUSTOMIZATION GUIDE
|
|
1534
|
+
*
|
|
1535
|
+
* Extend UserData with custom fields, sync to database, and use useAuth<MyType>().
|
|
1536
|
+
*/
|
|
1537
|
+
`;
|
|
1362
1538
|
const AUTH_MODAL_FALLBACK = `'use client';
|
|
1363
1539
|
import React, { useEffect, CSSProperties } from 'react';
|
|
1364
|
-
import { useAuth } from '
|
|
1540
|
+
import { useAuth } from '@/context/AuthContext';
|
|
1365
1541
|
|
|
1366
1542
|
export default function AuthModal({ isOpen, onClose, overlayStyle, cardStyle, showCloseButton = true, backdropDismiss = true }: any) {
|
|
1367
1543
|
const { closeAuthModal } = useAuth();
|
|
@@ -1413,7 +1589,7 @@ export default function AuthModal({ isOpen, onClose, overlayStyle, cardStyle, sh
|
|
|
1413
1589
|
}`;
|
|
1414
1590
|
const PROTECTED_ROUTE_FALLBACK = `'use client';
|
|
1415
1591
|
import React from 'react';
|
|
1416
|
-
import { useAuth } from '
|
|
1592
|
+
import { useAuth } from '@/context/AuthContext';
|
|
1417
1593
|
|
|
1418
1594
|
export function ProtectedRoute({ children, LoadingComponent, onUnauthorized }: any) {
|
|
1419
1595
|
const { user, loading, openAuthModal } = useAuth();
|
package/dist/cli.js
CHANGED
|
@@ -34196,16 +34196,14 @@ can return any JSON-serialisable value.
|
|
|
34196
34196
|
### FunctionContext shape
|
|
34197
34197
|
|
|
34198
34198
|
\`\`\`ts
|
|
34199
|
+
import type { FunctionContext, AuthUser } from "clefbase";
|
|
34200
|
+
|
|
34199
34201
|
interface FunctionContext {
|
|
34200
34202
|
/** Payload supplied by the caller (HTTP) or the event (triggers). */
|
|
34201
|
-
data
|
|
34203
|
+
data?: unknown;
|
|
34202
34204
|
|
|
34203
34205
|
/** Populated when the caller includes a valid auth token. */
|
|
34204
|
-
auth?:
|
|
34205
|
-
uid: string;
|
|
34206
|
-
email?: string;
|
|
34207
|
-
metadata: Record<string, unknown>;
|
|
34208
|
-
};
|
|
34206
|
+
auth?: AuthUser;
|
|
34209
34207
|
|
|
34210
34208
|
/** Describes what fired the function. */
|
|
34211
34209
|
trigger: {
|
|
@@ -34401,7 +34399,11 @@ var FUNCTIONS_TSCONFIG = `{
|
|
|
34401
34399
|
"strict": true,
|
|
34402
34400
|
"esModuleInterop": true,
|
|
34403
34401
|
"skipLibCheck": true,
|
|
34404
|
-
"outDir": "dist"
|
|
34402
|
+
"outDir": "dist",
|
|
34403
|
+
"baseUrl": ".",
|
|
34404
|
+
"paths": {
|
|
34405
|
+
"@/*": ["src/*"]
|
|
34406
|
+
}
|
|
34405
34407
|
},
|
|
34406
34408
|
"include": ["src/**/*"],
|
|
34407
34409
|
"exclude": ["node_modules", "dist"]
|
|
@@ -34935,90 +34937,248 @@ function printUsageHint(cfg, authSetup) {
|
|
|
34935
34937
|
console.log();
|
|
34936
34938
|
}
|
|
34937
34939
|
var AUTH_CONTEXT_FALLBACK = `'use client';
|
|
34940
|
+
|
|
34938
34941
|
import React, { createContext, useContext, useEffect, useState } from 'react';
|
|
34939
34942
|
import type { AuthUser } from 'clefbase';
|
|
34940
|
-
import { getAuth } from 'clefbase';
|
|
34943
|
+
import { getAuth, getDatabase } from 'clefbase';
|
|
34941
34944
|
|
|
34942
|
-
|
|
34945
|
+
/**
|
|
34946
|
+
* Base user data interface stored in the 'users' collection.
|
|
34947
|
+
* Extend this in your app for custom fields.
|
|
34948
|
+
*/
|
|
34949
|
+
export interface UserData {
|
|
34950
|
+
uid: string;
|
|
34951
|
+
email: string;
|
|
34952
|
+
displayName?: string;
|
|
34953
|
+
photoUrl?: string;
|
|
34954
|
+
createdAt?: string;
|
|
34955
|
+
[key: string]: unknown;
|
|
34956
|
+
}
|
|
34957
|
+
|
|
34958
|
+
/**
|
|
34959
|
+
* Auth context for managing authentication state and user data in your React app.
|
|
34960
|
+
* Wraps the clefbase Auth SDK with React Context integration.
|
|
34961
|
+
*
|
|
34962
|
+
* Features:
|
|
34963
|
+
* - User state management with auth listener
|
|
34964
|
+
* - User profile data synced from database's 'users' collection
|
|
34965
|
+
* - Token persistence (handled by SDK)
|
|
34966
|
+
* - Auth modal state
|
|
34967
|
+
* - Error handling and loading states
|
|
34968
|
+
* - Auto-create user doc on first signup
|
|
34969
|
+
* - Auto-sync user data on signin
|
|
34970
|
+
*/
|
|
34971
|
+
|
|
34972
|
+
interface AuthContextType<T extends UserData = UserData> {
|
|
34973
|
+
/** Currently authenticated user, or null if not signed in */
|
|
34943
34974
|
user: AuthUser | null;
|
|
34975
|
+
/** User profile data from the 'users' collection, or null if not signed in */
|
|
34976
|
+
userData: T | null;
|
|
34977
|
+
/** Authentication token */
|
|
34944
34978
|
token: string | null;
|
|
34979
|
+
/** True while auth state is being restored or operations are pending */
|
|
34945
34980
|
loading: boolean;
|
|
34981
|
+
/** Error message from last failed operation */
|
|
34946
34982
|
error: string | null;
|
|
34983
|
+
/** True if auth modal is open */
|
|
34947
34984
|
isAuthModalOpen: boolean;
|
|
34948
|
-
|
|
34949
|
-
|
|
34950
|
-
|
|
34951
|
-
|
|
34985
|
+
|
|
34986
|
+
// \u2500\u2500 Auth modal management \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
34987
|
+
|
|
34988
|
+
/**
|
|
34989
|
+
* Open the auth modal for sign in / sign up.
|
|
34990
|
+
* The modal at auth.cleforyx.com handles the actual authentication.
|
|
34991
|
+
* After success, auth state updates automatically.
|
|
34992
|
+
*/
|
|
34993
|
+
openAuthModal: () => void;
|
|
34994
|
+
|
|
34995
|
+
/**
|
|
34996
|
+
* Close the auth modal programmatically.
|
|
34997
|
+
*/
|
|
34998
|
+
closeAuthModal: () => void;
|
|
34999
|
+
|
|
35000
|
+
/**
|
|
35001
|
+
* Manually sync user data from the database.
|
|
35002
|
+
*/
|
|
35003
|
+
syncUserData: () => Promise<void>;
|
|
35004
|
+
|
|
35005
|
+
/**
|
|
35006
|
+
* Update user data in the database.
|
|
35007
|
+
*/
|
|
35008
|
+
updateUserData: (updates: Partial<Omit<T, 'uid'>>) => Promise<void>;
|
|
35009
|
+
|
|
35010
|
+
/**
|
|
35011
|
+
* Verify email with a verification code.
|
|
35012
|
+
*/
|
|
34952
35013
|
verifyEmail: (code: string) => Promise<void>;
|
|
35014
|
+
|
|
35015
|
+
/**
|
|
35016
|
+
* Request a password reset email.
|
|
35017
|
+
*/
|
|
34953
35018
|
sendPasswordResetEmail: (email: string) => Promise<void>;
|
|
35019
|
+
|
|
35020
|
+
/**
|
|
35021
|
+
* Sign out the current user and clear data.
|
|
35022
|
+
*/
|
|
35023
|
+
signOut: () => Promise<void>;
|
|
35024
|
+
|
|
35025
|
+
/**
|
|
35026
|
+
* Refresh user data from auth server.
|
|
35027
|
+
*/
|
|
34954
35028
|
refreshUser: () => Promise<void>;
|
|
34955
|
-
openAuthModal: () => void;
|
|
34956
|
-
closeAuthModal: () => void;
|
|
34957
35029
|
}
|
|
34958
35030
|
|
|
34959
35031
|
const AuthContext = createContext<AuthContextType | undefined>(undefined);
|
|
34960
35032
|
|
|
34961
|
-
|
|
35033
|
+
/**
|
|
35034
|
+
* Hook to use auth context in your components.
|
|
35035
|
+
*/
|
|
35036
|
+
export function useAuth<T extends UserData = UserData>(): AuthContextType<T> {
|
|
34962
35037
|
const context = useContext(AuthContext);
|
|
34963
|
-
if (!context)
|
|
34964
|
-
|
|
35038
|
+
if (!context) {
|
|
35039
|
+
throw new Error('useAuth() must be used within <AuthProvider>');
|
|
35040
|
+
}
|
|
35041
|
+
return context as AuthContextType<T>;
|
|
34965
35042
|
}
|
|
34966
35043
|
|
|
35044
|
+
/**
|
|
35045
|
+
* Provider component that wraps your app with authentication.
|
|
35046
|
+
*/
|
|
34967
35047
|
export function AuthProvider({ children }: { children: React.ReactNode }) {
|
|
35048
|
+
// State
|
|
34968
35049
|
const [user, setUser] = useState<AuthUser | null>(null);
|
|
35050
|
+
const [userData, setUserData] = useState<UserData | null>(null);
|
|
34969
35051
|
const [token, setToken] = useState<string | null>(null);
|
|
34970
35052
|
const [loading, setLoading] = useState(true);
|
|
34971
35053
|
const [error, setError] = useState<string | null>(null);
|
|
34972
35054
|
const [isAuthModalOpen, setIsAuthModalOpen] = useState(false);
|
|
35055
|
+
|
|
35056
|
+
// Get auth and database services from clefbase
|
|
34973
35057
|
const auth = getAuth();
|
|
35058
|
+
const db = getDatabase();
|
|
35059
|
+
|
|
35060
|
+
// \u2500\u2500 Helper: sync user data from database \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
35061
|
+
|
|
35062
|
+
const syncUserDataInternal = async (uid: string): Promise<void> => {
|
|
35063
|
+
try {
|
|
35064
|
+
const doc = await db.collection('users').doc(uid).get();
|
|
35065
|
+
if (doc) {
|
|
35066
|
+
setUserData(doc as UserData);
|
|
35067
|
+
} else {
|
|
35068
|
+
// First login - create user doc
|
|
35069
|
+
const authUser = auth.currentUser;
|
|
35070
|
+
if (authUser) {
|
|
35071
|
+
const newUserData: UserData = {
|
|
35072
|
+
uid: authUser.uid,
|
|
35073
|
+
email: authUser.email,
|
|
35074
|
+
displayName: authUser.displayName,
|
|
35075
|
+
photoUrl: authUser.photoUrl,
|
|
35076
|
+
createdAt: new Date().toISOString(),
|
|
35077
|
+
};
|
|
35078
|
+
await db.collection('users').doc(uid).set(newUserData);
|
|
35079
|
+
setUserData(newUserData);
|
|
35080
|
+
}
|
|
35081
|
+
}
|
|
35082
|
+
} catch (err) {
|
|
35083
|
+
console.error('Error syncing user data:', err);
|
|
35084
|
+
}
|
|
35085
|
+
};
|
|
35086
|
+
|
|
35087
|
+
// \u2500\u2500 Initialize on mount \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
34974
35088
|
|
|
34975
35089
|
useEffect(() => {
|
|
34976
35090
|
const initAuth = async () => {
|
|
34977
35091
|
try {
|
|
34978
35092
|
setLoading(true);
|
|
35093
|
+
|
|
34979
35094
|
const currentUser = auth.currentUser;
|
|
34980
35095
|
const currentToken = auth.currentToken;
|
|
35096
|
+
|
|
34981
35097
|
setUser(currentUser);
|
|
34982
35098
|
setToken(currentToken);
|
|
34983
|
-
|
|
35099
|
+
|
|
35100
|
+
if (currentUser) {
|
|
35101
|
+
await syncUserDataInternal(currentUser.uid);
|
|
35102
|
+
}
|
|
35103
|
+
|
|
35104
|
+
const unsubscribe = auth.onAuthStateChanged(async (newUser) => {
|
|
34984
35105
|
setUser(newUser);
|
|
34985
|
-
|
|
35106
|
+
if (newUser) {
|
|
35107
|
+
setToken(auth.currentToken);
|
|
35108
|
+
await syncUserDataInternal(newUser.uid);
|
|
35109
|
+
} else {
|
|
35110
|
+
setToken(null);
|
|
35111
|
+
setUserData(null);
|
|
35112
|
+
}
|
|
34986
35113
|
});
|
|
35114
|
+
|
|
34987
35115
|
setLoading(false);
|
|
35116
|
+
|
|
34988
35117
|
return () => unsubscribe();
|
|
34989
35118
|
} catch (err) {
|
|
34990
|
-
console.error('Auth
|
|
35119
|
+
console.error('Auth initialization error:', err);
|
|
34991
35120
|
setLoading(false);
|
|
34992
35121
|
}
|
|
34993
35122
|
};
|
|
35123
|
+
|
|
34994
35124
|
initAuth();
|
|
34995
|
-
}, [auth]);
|
|
35125
|
+
}, [auth, db]);
|
|
35126
|
+
|
|
35127
|
+
// \u2500\u2500 Error handling helper \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
34996
35128
|
|
|
34997
35129
|
const handleError = (err: unknown): string => {
|
|
34998
|
-
if (err instanceof Error)
|
|
34999
|
-
|
|
35000
|
-
|
|
35130
|
+
if (err instanceof Error) {
|
|
35131
|
+
return err.message;
|
|
35132
|
+
}
|
|
35133
|
+
if (typeof err === 'string') {
|
|
35134
|
+
return err;
|
|
35135
|
+
}
|
|
35136
|
+
return 'An unknown error occurred';
|
|
35001
35137
|
};
|
|
35002
35138
|
|
|
35003
|
-
|
|
35139
|
+
// \u2500\u2500 User data methods \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
35140
|
+
|
|
35141
|
+
const syncUserData = async (): Promise<void> => {
|
|
35142
|
+
if (!user) {
|
|
35143
|
+
setUserData(null);
|
|
35144
|
+
return;
|
|
35145
|
+
}
|
|
35146
|
+
|
|
35004
35147
|
try {
|
|
35005
|
-
|
|
35006
|
-
setLoading(true);
|
|
35007
|
-
await auth.signIn(email, password);
|
|
35148
|
+
await syncUserDataInternal(user.uid);
|
|
35008
35149
|
} catch (err) {
|
|
35009
35150
|
const message = handleError(err);
|
|
35010
35151
|
setError(message);
|
|
35011
35152
|
throw err;
|
|
35012
|
-
} finally {
|
|
35013
|
-
setLoading(false);
|
|
35014
35153
|
}
|
|
35015
35154
|
};
|
|
35016
35155
|
|
|
35017
|
-
const
|
|
35156
|
+
const updateUserData = async (
|
|
35157
|
+
updates: Partial<Omit<UserData, 'uid'>>
|
|
35158
|
+
): Promise<void> => {
|
|
35159
|
+
if (!user) {
|
|
35160
|
+
throw new Error('User not authenticated');
|
|
35161
|
+
}
|
|
35162
|
+
|
|
35018
35163
|
try {
|
|
35019
35164
|
setError(null);
|
|
35020
35165
|
setLoading(true);
|
|
35021
|
-
|
|
35166
|
+
|
|
35167
|
+
const authUpdates: Record<string, unknown> = {};
|
|
35168
|
+
if ('displayName' in updates) {
|
|
35169
|
+
authUpdates.displayName = updates.displayName;
|
|
35170
|
+
}
|
|
35171
|
+
if ('photoUrl' in updates) {
|
|
35172
|
+
authUpdates.photoUrl = updates.photoUrl;
|
|
35173
|
+
}
|
|
35174
|
+
|
|
35175
|
+
if (Object.keys(authUpdates).length > 0) {
|
|
35176
|
+
await auth.updateProfile(authUpdates);
|
|
35177
|
+
}
|
|
35178
|
+
|
|
35179
|
+
await db.collection('users').doc(user.uid).update(updates);
|
|
35180
|
+
|
|
35181
|
+
setUserData((prev) => (prev ? { ...prev, ...updates } : null));
|
|
35022
35182
|
} catch (err) {
|
|
35023
35183
|
const message = handleError(err);
|
|
35024
35184
|
setError(message);
|
|
@@ -35028,6 +35188,8 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
|
|
|
35028
35188
|
}
|
|
35029
35189
|
};
|
|
35030
35190
|
|
|
35191
|
+
// \u2500\u2500 Auth methods \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
35192
|
+
|
|
35031
35193
|
const signOut = async () => {
|
|
35032
35194
|
try {
|
|
35033
35195
|
setError(null);
|
|
@@ -35035,20 +35197,7 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
|
|
|
35035
35197
|
await auth.signOut();
|
|
35036
35198
|
setUser(null);
|
|
35037
35199
|
setToken(null);
|
|
35038
|
-
|
|
35039
|
-
const message = handleError(err);
|
|
35040
|
-
setError(message);
|
|
35041
|
-
throw err;
|
|
35042
|
-
} finally {
|
|
35043
|
-
setLoading(false);
|
|
35044
|
-
}
|
|
35045
|
-
};
|
|
35046
|
-
|
|
35047
|
-
const updateProfile = async (updates: any) => {
|
|
35048
|
-
try {
|
|
35049
|
-
setError(null);
|
|
35050
|
-
setLoading(true);
|
|
35051
|
-
await auth.updateProfile(updates);
|
|
35200
|
+
setUserData(null);
|
|
35052
35201
|
} catch (err) {
|
|
35053
35202
|
const message = handleError(err);
|
|
35054
35203
|
setError(message);
|
|
@@ -35099,13 +35248,33 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
|
|
|
35099
35248
|
}
|
|
35100
35249
|
};
|
|
35101
35250
|
|
|
35102
|
-
|
|
35103
|
-
|
|
35251
|
+
// \u2500\u2500 Modal management \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
35252
|
+
|
|
35253
|
+
const openAuthModal = () => {
|
|
35254
|
+
setIsAuthModalOpen(true);
|
|
35255
|
+
};
|
|
35256
|
+
|
|
35257
|
+
const closeAuthModal = () => {
|
|
35258
|
+
setIsAuthModalOpen(false);
|
|
35259
|
+
};
|
|
35260
|
+
|
|
35261
|
+
// \u2500\u2500 Provider value \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
35104
35262
|
|
|
35105
35263
|
const value: AuthContextType = {
|
|
35106
|
-
user,
|
|
35107
|
-
|
|
35108
|
-
|
|
35264
|
+
user,
|
|
35265
|
+
userData,
|
|
35266
|
+
token,
|
|
35267
|
+
loading,
|
|
35268
|
+
error,
|
|
35269
|
+
isAuthModalOpen,
|
|
35270
|
+
syncUserData,
|
|
35271
|
+
updateUserData,
|
|
35272
|
+
verifyEmail,
|
|
35273
|
+
sendPasswordResetEmail,
|
|
35274
|
+
signOut,
|
|
35275
|
+
refreshUser,
|
|
35276
|
+
openAuthModal,
|
|
35277
|
+
closeAuthModal,
|
|
35109
35278
|
};
|
|
35110
35279
|
|
|
35111
35280
|
return (
|
|
@@ -35113,10 +35282,17 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
|
|
|
35113
35282
|
{!loading && children}
|
|
35114
35283
|
</AuthContext.Provider>
|
|
35115
35284
|
);
|
|
35116
|
-
}
|
|
35285
|
+
}
|
|
35286
|
+
|
|
35287
|
+
/**
|
|
35288
|
+
* CUSTOMIZATION GUIDE
|
|
35289
|
+
*
|
|
35290
|
+
* Extend UserData with custom fields, sync to database, and use useAuth<MyType>().
|
|
35291
|
+
*/
|
|
35292
|
+
`;
|
|
35117
35293
|
var AUTH_MODAL_FALLBACK = `'use client';
|
|
35118
35294
|
import React, { useEffect, CSSProperties } from 'react';
|
|
35119
|
-
import { useAuth } from '
|
|
35295
|
+
import { useAuth } from '@/context/AuthContext';
|
|
35120
35296
|
|
|
35121
35297
|
export default function AuthModal({ isOpen, onClose, overlayStyle, cardStyle, showCloseButton = true, backdropDismiss = true }: any) {
|
|
35122
35298
|
const { closeAuthModal } = useAuth();
|
|
@@ -35168,7 +35344,7 @@ export default function AuthModal({ isOpen, onClose, overlayStyle, cardStyle, sh
|
|
|
35168
35344
|
}`;
|
|
35169
35345
|
var PROTECTED_ROUTE_FALLBACK = `'use client';
|
|
35170
35346
|
import React from 'react';
|
|
35171
|
-
import { useAuth } from '
|
|
35347
|
+
import { useAuth } from '@/context/AuthContext';
|
|
35172
35348
|
|
|
35173
35349
|
export function ProtectedRoute({ children, LoadingComponent, onUnauthorized }: any) {
|
|
35174
35350
|
const { user, loading, openAuthModal } = useAuth();
|
|
@@ -35938,7 +36114,7 @@ async function promptRequired(message) {
|
|
|
35938
36114
|
}
|
|
35939
36115
|
|
|
35940
36116
|
// package.json
|
|
35941
|
-
var version = "2.0.
|
|
36117
|
+
var version = "2.0.5";
|
|
35942
36118
|
|
|
35943
36119
|
// src/cli/index.ts
|
|
35944
36120
|
var program2 = new Command();
|
package/dist/functions.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpClient } from "./http";
|
|
2
|
-
import type { FunctionRuntime, FunctionTrigger, FunctionTriggerType, FunctionDef, FunctionExecution, FunctionsConfig, FunctionStats, DeployFunctionOptions, HttpsCallableResult } from "./types";
|
|
3
|
-
export type { FunctionRuntime, FunctionTrigger, FunctionTriggerType, FunctionDef, FunctionExecution, FunctionsConfig, FunctionStats, DeployFunctionOptions, HttpsCallableResult, };
|
|
2
|
+
import type { FunctionRuntime, FunctionTrigger, FunctionTriggerType, FunctionContext, FunctionDef, FunctionExecution, FunctionsConfig, FunctionStats, DeployFunctionOptions, HttpsCallableResult } from "./types";
|
|
3
|
+
export type { FunctionRuntime, FunctionTrigger, FunctionTriggerType, FunctionContext, FunctionDef, FunctionExecution, FunctionsConfig, FunctionStats, DeployFunctionOptions, HttpsCallableResult, };
|
|
4
4
|
/**
|
|
5
5
|
* Thrown by all Functions SDK methods when the server returns an error
|
|
6
6
|
* or the function itself errors / times out.
|
package/dist/functions.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../src/functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC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;IADlC,gBAAgB;gBACa,KAAK,EAAE,UAAU;IAI9C;;;OAGG;IACG,WAAW,CACf,IAAI,CAAC,EAAE;QAAE,uBAAuB,CAAC,EAAE,MAAM,CAAC;QAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAAE,GACrE,OAAO,CAAC,eAAe,CAAC;IAM3B;;;;;OAKG;IACG,MAAM,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,WAAW,CAAC;IAMlE;;;OAGG;IACG,IAAI,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAMpC;;;OAGG;IACG,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAQvE;;;;;OAKG;IACG,IAAI,CAAC,MAAM,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO,EAC5C,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAgBxC;;;;;OAKG;IACG,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;CAKzE"}
|
package/dist/functions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../src/functions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../src/functions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwEA,sCAKC;AAWD,oCAMC;AAgBD,wCAKC;AAQD,wCAKC;AAQD,sCAEC;AAQD,sDAMC;AA2BD,oCAEC;AA8BD,wCAeC;AAjOD,mCAAwC;AA2BxC,iFAAiF;AAEjF;;;;;;;;;;;;;;;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S,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED,6EAA6E;IAE7E;;;OAGG;IACH,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAgB,GAAG,CAAC,CAAC;IAC5C,CAAC;IAED,6EAA6E;IAE7E;;;OAGG;IACH,KAAK,CAAC,MAAM,CAAC,IAAY;QACvB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CACtB,IAAI,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAC/B,CAAC;IACJ,CAAC;IAED,6EAA6E;IAE7E;;;;;OAKG;IACH,KAAK,CAAC,IAAI,CACR,IAAY,EACZ,IAAa;QAEb,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAC1B,SAAS,kBAAkB,CAAC,IAAI,CAAC,EAAE,EACnC,EAAE,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,CACvB,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,GAAG,YAAY,qBAAa,EAAE,CAAC;gBACjC,MAAM,IAAI,cAAc,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;YACpD,CAAC;YACD,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC;IAED,6EAA6E;IAE7E;;;;;OAKG;IACH,KAAK,CAAC,UAAU,CAAC,IAAY,EAAE,KAAK,GAAG,EAAE;QACvC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CACnB,IAAI,kBAAkB,CAAC,IAAI,CAAC,qBAAqB,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CACxE,CAAC;IACJ,CAAC;CACF;AAxFD,8CAwFC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ export { EmailVerificationCard } from "./react/EmailVerificationCard";
|
|
|
56
56
|
export { ClefbaseHosting, SiteReference } from "./hosting";
|
|
57
57
|
export type { HostingSite, HostingDeploy, HostingFile, DeployResult, DeployOptions, HostingStatus, DeployStatus, } from "./hosting";
|
|
58
58
|
export { ClefbaseFunctions, FunctionsError, httpsCallable, callFunction, deployFunction, deleteFunction, listFunctions, getFunctionExecutions, setAuthToken, deployFromFile, } from "./functions";
|
|
59
|
-
export type { FunctionRuntime, FunctionTrigger, FunctionTriggerType, FunctionDef, FunctionExecution, FunctionsConfig, FunctionStats, DeployFunctionOptions, HttpsCallableResult, } from "./functions";
|
|
59
|
+
export type { FunctionRuntime, FunctionTrigger, FunctionTriggerType, FunctionContext, FunctionDef, FunctionExecution, FunctionsConfig, FunctionStats, DeployFunctionOptions, HttpsCallableResult, } from "./functions";
|
|
60
60
|
export { ClefbaseAI, AIError, generateText, generateImage, generateVideo, generateEmbedding, } from "./ai";
|
|
61
61
|
export type { AIModel, AIProvider, AIModelCategory, GenerateTextOptions, GenerateTextResult, GenerateImageOptions, GenerateImageResult, GeneratedMediaFile, GenerateVideoOptions, GenerateVideoResult, GenerateEmbeddingOptions, GenerateEmbeddingResult, AIUsageRecord, AIUsageStats, } from "./ai";
|
|
62
62
|
export { FieldValue, FieldValueSentinel } from "./field_value";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAGH,OAAO,EACL,WAAW,EACX,YAAY,EACZ,MAAM,EACN,WAAW,EACX,OAAO,EACP,UAAU,EACV,UAAU,EACV,YAAY,EACZ,KAAK,GACN,MAAM,OAAO,CAAC;AAGf,OAAO,EACL,QAAQ,EACR,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,KAAK,EACL,UAAU,EACV,WAAW,EACX,cAAc,GACf,MAAM,MAAM,CAAC;AAGd,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,C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qB,EACrB,YAAY,EACZ,cAAc,GACf,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,UAAU,EACV,OAAO,EACP,YAAY,EACZ,aAAa,EACb,aAAa,EACb,iBAAiB,GAClB,MAAM,MAAM,CAAC;AAEd,YAAY,EACV,OAAO,EACP,UAAU,EACV,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EACvB,aAAa,EACb,YAAY,GACb,MAAM,MAAM,CAAC;AAGd,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC/D,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGpD,YAAY,EACV,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,cAAc,EACd,WAAW,EACX,UAAU,EACV,QAAQ,EACR,WAAW,EACX,UAAU,EACV,WAAW,GACZ,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;;;AAEH,iFAAiF;AACjF,6BAUe;AATb,kGAAA,WAAW,OAAA;AACX,mGAAA,YAAY,OAAA;AACZ,6FAAA,MAAM,OAAA;AACN,kGAAA,WAAW,OAAA;AACX,8FAAA,OAAO,OAAA;AACP,iGAAA,UAAU,OAAA;AACV,iGAAA,UAAU,O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environment variables injected into the function subprocess */
|
|
187
187
|
env?: Record<string, string>;
|
|
188
188
|
}
|
|
189
|
+
/**
|
|
190
|
+
* Context passed to function handlers.
|
|
191
|
+
* Available in both Node.js and Python runtimes.
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* ```typescript
|
|
195
|
+
* export async function handler(ctx: FunctionContext) {
|
|
196
|
+
* console.log(ctx.data); // payload from caller
|
|
197
|
+
* console.log(ctx.auth); // authenticated user (if valid token passed)
|
|
198
|
+
* console.log(ctx.trigger); // what triggered the function
|
|
199
|
+
* console.log(ctx.env); // environment variables
|
|
200
|
+
* }
|
|
201
|
+
* ```
|
|
202
|
+
*/
|
|
203
|
+
export interface FunctionContext {
|
|
204
|
+
/** Payload from the function caller or trigger event */
|
|
205
|
+
data?: unknown;
|
|
206
|
+
/** Authenticated user if a valid token was passed, otherwise undefined */
|
|
207
|
+
auth?: AuthUser;
|
|
208
|
+
/** Describes what triggered the function (http call, schedule, database event, etc.) */
|
|
209
|
+
trigger: FunctionTrigger & {
|
|
210
|
+
timestamp: string;
|
|
211
|
+
[key: string]: unknown;
|
|
212
|
+
};
|
|
213
|
+
/** Environment variables injected at deploy time */
|
|
214
|
+
env: Record<string, string>;
|
|
215
|
+
}
|
|
189
216
|
/** A deployed function definition as returned by the server */
|
|
190
217
|
export interface FunctionDef {
|
|
191
218
|
id: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC7B,6EAA6E;IAC7E,SAAS,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC;CAChB;AAID,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU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,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,iDAAiD;AACjD,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC,GAAG,OAAO;IAC9C,qCAAqC;IACrC,IAAI,EAAE,CAAC,CAAC;IACR,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;CACpB;AAID,qBAAa,aAAc,SAAQ,KAAK;aAGpB,IAAI,CAAC,EAAE,MAAM;aACb,MAAM,CAAC,EAAE,MAAM;gBAF/B,OAAO,EAAE,MAAM,EACC,IAAI,CAAC,EAAE,MAAM,YAAA,EACb,MAAM,CAAC,EAAE,MAAM,YAAA;CAQlC"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,iFAAiF;;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,iFAAiF;;;AAsTjF,iFAAiF;AAEjF,MAAa,aAAc,SAAQ,KAAK;IACtC,YACE,OAAe,EACC,IAAa,EACb,MAAe;QAE/B,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,SAAI,GAAJ,IAAI,CAAS;QACb,WAAM,GAAN,MAAM,CAAS;QAG/B,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAC5B,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;CACF;AAZD,sCAYC"}
|