svelte-firekit 0.1.5 → 0.1.7
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/components/Collection.svelte +49 -75
- package/dist/components/Doc.svelte +56 -38
- package/dist/components/firebase-app.svelte +4 -1
- package/dist/firebase.d.ts +9 -0
- package/dist/firebase.js +24 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/services/analytics.d.ts +272 -0
- package/dist/services/analytics.js +476 -0
- package/dist/services/auth.d.ts +26 -21
- package/dist/services/auth.js +93 -22
- package/dist/services/collection.svelte.d.ts +1 -14
- package/dist/services/collection.svelte.js +10 -85
- package/dist/services/index.d.ts +9 -0
- package/dist/services/index.js +10 -0
- package/dist/services/mutations.d.ts +5 -37
- package/dist/services/mutations.js +43 -140
- package/dist/services/presence.svelte.d.ts +1 -22
- package/dist/services/presence.svelte.js +1 -101
- package/dist/types/analytics.d.ts +84 -0
- package/dist/types/analytics.js +6 -0
- package/dist/types/auth.d.ts +65 -7
- package/dist/types/collection.d.ts +0 -25
- package/dist/types/firebase.d.ts +2 -0
- package/dist/types/index.d.ts +4 -3
- package/dist/types/index.js +2 -0
- package/dist/types/mutations.d.ts +0 -22
- package/dist/types/presence.d.ts +0 -20
- package/package.json +1 -1
package/dist/types/auth.d.ts
CHANGED
|
@@ -37,6 +37,46 @@ export interface AuthState {
|
|
|
37
37
|
loading: boolean;
|
|
38
38
|
initialized: boolean;
|
|
39
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Base authentication result interface
|
|
42
|
+
*/
|
|
43
|
+
export interface AuthResult {
|
|
44
|
+
success: boolean;
|
|
45
|
+
user: UserProfile;
|
|
46
|
+
method: AuthMethodType;
|
|
47
|
+
timestamp: Date;
|
|
48
|
+
additionalData?: Record<string, any>;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Sign-in result interface
|
|
52
|
+
*/
|
|
53
|
+
export interface SignInResult extends AuthResult {
|
|
54
|
+
isNewUser: boolean;
|
|
55
|
+
requiresEmailVerification?: boolean;
|
|
56
|
+
requiresPhoneVerification?: boolean;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Registration result interface
|
|
60
|
+
*/
|
|
61
|
+
export interface RegistrationResult extends AuthResult {
|
|
62
|
+
emailVerificationSent: boolean;
|
|
63
|
+
requiresEmailVerification: boolean;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* OAuth sign-in result interface
|
|
67
|
+
*/
|
|
68
|
+
export interface OAuthSignInResult extends SignInResult {
|
|
69
|
+
provider: OAuthProviderType;
|
|
70
|
+
accessToken?: string;
|
|
71
|
+
refreshToken?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Phone verification result interface
|
|
75
|
+
*/
|
|
76
|
+
export interface PhoneVerificationResult {
|
|
77
|
+
verificationId: string;
|
|
78
|
+
confirm: (code: string) => Promise<SignInResult>;
|
|
79
|
+
}
|
|
40
80
|
/**
|
|
41
81
|
* Password update result interface
|
|
42
82
|
*/
|
|
@@ -52,13 +92,6 @@ export interface AccountDeletionResult {
|
|
|
52
92
|
success: boolean;
|
|
53
93
|
message: string;
|
|
54
94
|
}
|
|
55
|
-
/**
|
|
56
|
-
* Phone verification result interface
|
|
57
|
-
*/
|
|
58
|
-
export interface PhoneVerificationResult {
|
|
59
|
-
verificationId: string;
|
|
60
|
-
confirm: (code: string) => Promise<UserProfile>;
|
|
61
|
-
}
|
|
62
95
|
/**
|
|
63
96
|
* User registration data interface
|
|
64
97
|
*/
|
|
@@ -75,6 +108,31 @@ export interface UserProfileUpdateData {
|
|
|
75
108
|
displayName?: string;
|
|
76
109
|
photoURL?: string;
|
|
77
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Profile update result interface
|
|
113
|
+
*/
|
|
114
|
+
export interface ProfileUpdateResult {
|
|
115
|
+
success: boolean;
|
|
116
|
+
user: UserProfile;
|
|
117
|
+
updatedFields: string[];
|
|
118
|
+
message: string;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Email verification result interface
|
|
122
|
+
*/
|
|
123
|
+
export interface EmailVerificationResult {
|
|
124
|
+
success: boolean;
|
|
125
|
+
message: string;
|
|
126
|
+
emailSent: boolean;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Password reset result interface
|
|
130
|
+
*/
|
|
131
|
+
export interface PasswordResetResult {
|
|
132
|
+
success: boolean;
|
|
133
|
+
message: string;
|
|
134
|
+
emailSent: boolean;
|
|
135
|
+
}
|
|
78
136
|
/**
|
|
79
137
|
* OAuth provider types
|
|
80
138
|
*/
|
|
@@ -133,31 +133,6 @@ export interface DocumentChange<T> {
|
|
|
133
133
|
/** Change timestamp */
|
|
134
134
|
timestamp: Date;
|
|
135
135
|
}
|
|
136
|
-
/**
|
|
137
|
-
* Collection event types
|
|
138
|
-
*/
|
|
139
|
-
export type CollectionEventType = 'data_changed' | 'document_added' | 'document_modified' | 'document_removed' | 'error' | 'loading_started' | 'loading_finished' | 'query_changed' | 'cache_hit' | 'cache_miss';
|
|
140
|
-
/**
|
|
141
|
-
* Collection event interface
|
|
142
|
-
*/
|
|
143
|
-
export interface CollectionEvent<T> {
|
|
144
|
-
/** Event type */
|
|
145
|
-
type: CollectionEventType;
|
|
146
|
-
/** Event data */
|
|
147
|
-
data?: any;
|
|
148
|
-
/** Document changes */
|
|
149
|
-
changes?: DocumentChange<T>[];
|
|
150
|
-
/** Error if applicable */
|
|
151
|
-
error?: CollectionError;
|
|
152
|
-
/** Event timestamp */
|
|
153
|
-
timestamp: Date;
|
|
154
|
-
/** Collection path */
|
|
155
|
-
path?: string;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Collection event callback function type
|
|
159
|
-
*/
|
|
160
|
-
export type CollectionEventCallback<T> = (event: CollectionEvent<T>) => void;
|
|
161
136
|
/**
|
|
162
137
|
* Collection metadata interface
|
|
163
138
|
*/
|
package/dist/types/firebase.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { Auth } from 'firebase/auth';
|
|
|
4
4
|
import type { Functions } from 'firebase/functions';
|
|
5
5
|
import type { Database } from 'firebase/database';
|
|
6
6
|
import type { FirebaseStorage } from 'firebase/storage';
|
|
7
|
+
import type { Analytics } from 'firebase/analytics';
|
|
7
8
|
/**
|
|
8
9
|
* Type definition for required Firebase environment variables
|
|
9
10
|
*/
|
|
@@ -38,6 +39,7 @@ export interface FirebaseServiceInstance {
|
|
|
38
39
|
functions: Functions | null;
|
|
39
40
|
database: Database | null;
|
|
40
41
|
storage: FirebaseStorage | null;
|
|
42
|
+
analytics: Analytics | null;
|
|
41
43
|
status: FirebaseServiceStatus;
|
|
42
44
|
initializationError: Error | null;
|
|
43
45
|
isBrowser: boolean;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './auth.js';
|
|
2
|
+
export * from './analytics.js';
|
|
2
3
|
export * from './firebase.js';
|
|
3
|
-
export type { CollectionState, CollectionOptions, PaginationConfig, CacheConfig, ErrorHandlingConfig, QueryBuilder, FirestoreOperator, CollectionChangeType, DocumentChange,
|
|
4
|
+
export type { CollectionState, CollectionOptions, PaginationConfig, CacheConfig, ErrorHandlingConfig, QueryBuilder, FirestoreOperator, CollectionChangeType, DocumentChange, CollectionMetadata, CollectionStats, CollectionErrorCode, CollectionError, CollectionSubscription, CollectionQueryResult, CollectionAggregation, ListenerConfig as CollectionListenerConfig, CollectionPerformanceMetrics } from './collection.js';
|
|
4
5
|
export type { DocumentState, DocumentOptions, MutationOptions as DocumentMutationOptions, MutationResponse as DocumentMutationResponse, BatchOperation as DocumentBatchOperation, BatchResult as DocumentBatchResult, ListenerConfig as DocumentListenerConfig, CacheEntry, CacheSource, DocumentErrorCode, DocumentError, DocumentFieldValue, DocumentUpdateData, DocumentMetadata, DocumentSnapshot, DocumentQueryConstraint, DocumentObserver, DocumentSubscription, DocumentAnalytics, DocumentPerformanceMetrics } from './document.js';
|
|
5
|
-
export type { MutationResponse as MutationMutationResponse, MutationMetadata, MutationOptions as MutationMutationOptions, ValidationResult, RetryConfig, TransactionOptions, BatchOperation as MutationBatchOperation, BatchResult as MutationBatchResult, BatchOperationResult, BatchMetadata, MutationOperationType, TimestampFields, FieldValueOperations, ExistenceCheckResult, BulkMutationConfig, OptimisticUpdateConfig, MutationErrorCode, MutationError,
|
|
6
|
-
export type { GeolocationConfig, PresenceConfig, Location, DeviceInfo, SessionData, UserPresence, PresenceStats,
|
|
6
|
+
export type { MutationResponse as MutationMutationResponse, MutationMetadata, MutationOptions as MutationMutationOptions, ValidationResult, RetryConfig, TransactionOptions, BatchOperation as MutationBatchOperation, BatchResult as MutationBatchResult, BatchOperationResult, BatchMetadata, MutationOperationType, TimestampFields, FieldValueOperations, ExistenceCheckResult, BulkMutationConfig, OptimisticUpdateConfig, MutationErrorCode, MutationError, MutationAnalytics } from './mutations.js';
|
|
7
|
+
export type { GeolocationConfig, PresenceConfig, Location, DeviceInfo, SessionData, UserPresence, PresenceStats, GeolocationProvider, SessionStorage, PresenceService, ConnectionInfo, BrowserCapabilities, PresenceFilter, BulkPresenceUpdate, PresenceQueryOptions, CustomPresenceStatus, PresenceAnalytics, PresenceErrorCode, PresenceError } from './presence.js';
|
package/dist/types/index.js
CHANGED
|
@@ -330,28 +330,6 @@ export declare class MutationError extends Error {
|
|
|
330
330
|
/**
|
|
331
331
|
* Mutation event types for tracking operations
|
|
332
332
|
*/
|
|
333
|
-
export type MutationEventType = 'mutation_start' | 'mutation_success' | 'mutation_error' | 'mutation_retry' | 'batch_start' | 'batch_progress' | 'batch_complete' | 'validation_failed' | 'optimistic_update' | 'rollback';
|
|
334
|
-
/**
|
|
335
|
-
* Mutation event interface
|
|
336
|
-
*/
|
|
337
|
-
export interface MutationEvent {
|
|
338
|
-
/** Event type */
|
|
339
|
-
type: MutationEventType;
|
|
340
|
-
/** Event data */
|
|
341
|
-
data?: any;
|
|
342
|
-
/** Error if applicable */
|
|
343
|
-
error?: MutationError;
|
|
344
|
-
/** Event timestamp */
|
|
345
|
-
timestamp: Date;
|
|
346
|
-
/** Operation ID for tracking */
|
|
347
|
-
operationId?: string;
|
|
348
|
-
/** User who triggered the event */
|
|
349
|
-
userId?: string;
|
|
350
|
-
}
|
|
351
|
-
/**
|
|
352
|
-
* Mutation event callback function type
|
|
353
|
-
*/
|
|
354
|
-
export type MutationEventCallback = (event: MutationEvent) => void;
|
|
355
333
|
/**
|
|
356
334
|
* Mutation analytics data
|
|
357
335
|
*/
|
package/dist/types/presence.d.ts
CHANGED
|
@@ -113,25 +113,6 @@ export interface PresenceStats {
|
|
|
113
113
|
averageSessionDuration: number;
|
|
114
114
|
lastActivity: string;
|
|
115
115
|
}
|
|
116
|
-
/**
|
|
117
|
-
* Presence event types
|
|
118
|
-
*/
|
|
119
|
-
export type PresenceEventType = 'status_change' | 'session_created' | 'session_updated' | 'session_expired' | 'location_update' | 'location_error' | 'error' | 'init' | 'disconnect' | 'reconnect' | 'consent_requested' | 'consent_granted' | 'consent_denied' | 'device_detected' | 'visibility_change';
|
|
120
|
-
/**
|
|
121
|
-
* Presence event structure
|
|
122
|
-
*/
|
|
123
|
-
export interface PresenceEvent {
|
|
124
|
-
type: PresenceEventType;
|
|
125
|
-
data?: any;
|
|
126
|
-
error?: Error;
|
|
127
|
-
timestamp: number;
|
|
128
|
-
sessionId?: string;
|
|
129
|
-
userId?: string;
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Presence event callback function type
|
|
133
|
-
*/
|
|
134
|
-
export type PresenceEventCallback = (event: PresenceEvent) => void;
|
|
135
116
|
/**
|
|
136
117
|
* Geolocation provider interface
|
|
137
118
|
*/
|
|
@@ -159,7 +140,6 @@ export interface PresenceService {
|
|
|
159
140
|
getCurrentSession(): SessionData | null;
|
|
160
141
|
getAllSessions(): SessionData[];
|
|
161
142
|
getPresenceStats(): PresenceStats;
|
|
162
|
-
addEventListener(callback: PresenceEventCallback): () => void;
|
|
163
143
|
dispose(): Promise<void>;
|
|
164
144
|
}
|
|
165
145
|
/**
|