fires2rest 0.0.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 JacobLinCool
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,201 @@
1
+ # Fires2REST
2
+
3
+ Fires2REST (Firestore REST with Transactions) is a TypeScript library that provides a simple and efficient way to perform transactions and other operations on Firestore documents using the REST API.
4
+
5
+ ## Why "Fires2REST"
6
+
7
+ Firestore REST with Transactions → Firestore RES**T** → FirestoREST → Fires2REST
8
+
9
+ ## Features
10
+
11
+ - 🔥 **Full Firestore REST API support** - CRUD operations via REST
12
+ - ⚡ **Transaction support** - Atomic reads and writes with automatic retry
13
+ - 🎯 **TypeScript first** - Full type safety with generics
14
+ - 🌐 **Serverless ready** - Works in Cloudflare Workers, Deno, Bun, and any JS runtime
15
+ - 📦 **Zero dependencies** - Only `jose` for JWT auth
16
+ - 🔄 **FieldValue support** - serverTimestamp, increment, delete, arrayUnion, arrayRemove
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ pnpm install fires2rest
22
+ ```
23
+
24
+ ## Quick Start
25
+
26
+ ```typescript
27
+ import { Firestore, FieldValue } from "fires2rest";
28
+
29
+ // Initialize with service account credentials
30
+ const db = new Firestore({
31
+ projectId: "your-project-id",
32
+ clientEmail: "your-service-account@project.iam.gserviceaccount.com",
33
+ privateKey: "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
34
+ });
35
+
36
+ // Get a document
37
+ const userRef = db.doc("users/alice");
38
+ const snap = await userRef.get();
39
+
40
+ if (snap.exists) {
41
+ console.log(snap.data()); // { name: "Alice", age: 30 }
42
+ }
43
+
44
+ // Set a document
45
+ await userRef.set({
46
+ name: "Alice",
47
+ age: 30,
48
+ createdAt: FieldValue.serverTimestamp(),
49
+ });
50
+
51
+ // Update a document
52
+ await userRef.update({
53
+ age: 31,
54
+ visits: FieldValue.increment(1),
55
+ });
56
+
57
+ // Delete a document
58
+ await userRef.delete();
59
+ ```
60
+
61
+ ## Transactions
62
+
63
+ Transactions provide atomic read-modify-write operations:
64
+
65
+ ```typescript
66
+ // Transfer balance between accounts
67
+ const result = await db.runTransaction(async (txn) => {
68
+ const fromRef = db.doc("accounts/alice");
69
+ const toRef = db.doc("accounts/bob");
70
+
71
+ const fromSnap = await txn.get(fromRef);
72
+ const toSnap = await txn.get(toRef);
73
+
74
+ const fromBalance = fromSnap.data()?.balance ?? 0;
75
+ const toBalance = toSnap.data()?.balance ?? 0;
76
+
77
+ if (fromBalance < 100) {
78
+ throw new Error("Insufficient balance");
79
+ }
80
+
81
+ txn.update(fromRef, { balance: fromBalance - 100 });
82
+ txn.update(toRef, { balance: toBalance + 100 });
83
+
84
+ return { transferred: 100 };
85
+ });
86
+ ```
87
+
88
+ ## API Reference
89
+
90
+ ### `Firestore`
91
+
92
+ Main client class.
93
+
94
+ ```typescript
95
+ const db = new Firestore(config: AuthConfig, databaseId?: string);
96
+ ```
97
+
98
+ - `config.projectId` - Firebase project ID
99
+ - `config.clientEmail` - Service account email
100
+ - `config.privateKey` - Service account private key (PEM format)
101
+ - `databaseId` - Optional, defaults to `"(default)"`
102
+
103
+ **Methods:**
104
+
105
+ - `collection(path)` - Get a `CollectionReference`
106
+ - `doc(path)` - Get a `DocumentReference`
107
+ - `runTransaction(updateFn, options?)` - Run a transaction
108
+
109
+ ### `DocumentReference<T>`
110
+
111
+ Reference to a document.
112
+
113
+ **Properties:**
114
+
115
+ - `id` - Document ID
116
+ - `path` - Full document path
117
+ - `parent` - Parent `CollectionReference`
118
+
119
+ **Methods:**
120
+
121
+ - `get()` - Get document snapshot
122
+ - `set(data, options?)` - Set document data (options: `{ merge: boolean }`)
123
+ - `update(data)` - Update document fields
124
+ - `delete()` - Delete document
125
+ - `collection(path)` - Get a subcollection
126
+
127
+ ### `CollectionReference<T>`
128
+
129
+ Reference to a collection.
130
+
131
+ **Properties:**
132
+
133
+ - `id` - Collection ID
134
+ - `path` - Full collection path
135
+
136
+ **Methods:**
137
+
138
+ - `doc(id?)` - Get a `DocumentReference` (auto-generates ID if not provided)
139
+ - `add(data)` - Add document with auto-generated ID
140
+
141
+ ### `FieldValue`
142
+
143
+ Special field values for atomic operations.
144
+
145
+ ```typescript
146
+ FieldValue.serverTimestamp(); // Server-generated timestamp
147
+ FieldValue.increment(n); // Increment numeric field by n
148
+ FieldValue.delete(); // Delete this field
149
+ FieldValue.arrayUnion(...elements); // Add unique elements to array
150
+ FieldValue.arrayRemove(...elements); // Remove elements from array
151
+ ```
152
+
153
+ ### `GeoPoint`
154
+
155
+ Represents a geographic coordinate.
156
+
157
+ ```typescript
158
+ const location = new GeoPoint(37.7749, -122.4194);
159
+ ```
160
+
161
+ ### `Timestamp`
162
+
163
+ Represents a timestamp with nanosecond precision.
164
+
165
+ ```typescript
166
+ const now = Timestamp.now();
167
+ const fromDate = Timestamp.fromDate(new Date());
168
+ const fromMillis = Timestamp.fromMillis(Date.now());
169
+ ```
170
+
171
+ ## Type Safety
172
+
173
+ Use generics for type-safe document data:
174
+
175
+ ```typescript
176
+ interface User {
177
+ name: string;
178
+ email: string;
179
+ age: number;
180
+ }
181
+
182
+ const userRef = db.doc("users/alice") as DocumentReference<User>;
183
+ const snap = await userRef.get();
184
+
185
+ const user = snap.data(); // User | undefined
186
+ console.log(user?.name); // TypeScript knows this is string
187
+ ```
188
+
189
+ ## Environment Variables
190
+
191
+ Set up your service account credentials:
192
+
193
+ ```bash
194
+ FIREBASE_PROJECT_ID=your-project-id
195
+ FIREBASE_CLIENT_EMAIL=your-service-account@project.iam.gserviceaccount.com
196
+ FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"
197
+ ```
198
+
199
+ ## License
200
+
201
+ MIT
@@ -0,0 +1,426 @@
1
+ //#region src/types.d.ts
2
+ /**
3
+ * Firestore REST API Types
4
+ *
5
+ * These types match the Firestore REST API v1 specification.
6
+ * @see https://firebase.google.com/docs/firestore/reference/rest
7
+ */
8
+ /** A null value in Firestore */
9
+ interface NullValue {
10
+ nullValue: null;
11
+ }
12
+ /** A boolean value in Firestore */
13
+ interface BooleanValue {
14
+ booleanValue: boolean;
15
+ }
16
+ /** An integer value in Firestore (stored as string for 64-bit precision) */
17
+ interface IntegerValue {
18
+ integerValue: string;
19
+ }
20
+ /** A double/float value in Firestore */
21
+ interface DoubleValue {
22
+ doubleValue: number;
23
+ }
24
+ /** A timestamp value in Firestore (RFC3339 format) */
25
+ interface TimestampValue {
26
+ timestampValue: string;
27
+ }
28
+ /** A string value in Firestore */
29
+ interface StringValue {
30
+ stringValue: string;
31
+ }
32
+ /** A bytes value in Firestore (base64 encoded) */
33
+ interface BytesValue {
34
+ bytesValue: string;
35
+ }
36
+ /** A reference to another document */
37
+ interface ReferenceValue {
38
+ referenceValue: string;
39
+ }
40
+ /** A geographic point (latitude/longitude) */
41
+ interface GeoPointValue {
42
+ geoPointValue: {
43
+ latitude: number;
44
+ longitude: number;
45
+ };
46
+ }
47
+ /** An array value containing other Firestore values */
48
+ interface ArrayValue {
49
+ arrayValue: {
50
+ values?: FirestoreValue[];
51
+ };
52
+ }
53
+ /** A map/object value containing named fields */
54
+ interface MapValue {
55
+ mapValue: {
56
+ fields?: Record<string, FirestoreValue>;
57
+ };
58
+ }
59
+ /** Union of all possible Firestore value types */
60
+ type FirestoreValue = NullValue | BooleanValue | IntegerValue | DoubleValue | TimestampValue | StringValue | BytesValue | ReferenceValue | GeoPointValue | ArrayValue | MapValue;
61
+ /** A Firestore document as returned by the REST API */
62
+ interface FirestoreDocument {
63
+ /** The resource name of the document */
64
+ name?: string;
65
+ /** The document fields */
66
+ fields?: Record<string, FirestoreValue>;
67
+ /** Timestamp when the document was created */
68
+ createTime?: string;
69
+ /** Timestamp when the document was last updated */
70
+ updateTime?: string;
71
+ }
72
+ /** A precondition for a write operation */
73
+ interface Precondition {
74
+ /** Document must exist */
75
+ exists?: boolean;
76
+ /** Document must have been last updated at this time */
77
+ updateTime?: string;
78
+ }
79
+ /** A field transform operation */
80
+ interface FieldTransform {
81
+ /** The path of the field to transform */
82
+ fieldPath: string;
83
+ /** Set to server request time */
84
+ setToServerValue?: "REQUEST_TIME";
85
+ /** Increment numeric value */
86
+ increment?: FirestoreValue;
87
+ /** Maximum of current value and given value */
88
+ maximum?: FirestoreValue;
89
+ /** Minimum of current value and given value */
90
+ minimum?: FirestoreValue;
91
+ /** Append elements to array (if not present) */
92
+ appendMissingElements?: ArrayValue["arrayValue"];
93
+ /** Remove elements from array */
94
+ removeAllFromArray?: ArrayValue["arrayValue"];
95
+ }
96
+ /** A document transformation */
97
+ interface DocumentTransform {
98
+ /** The name of the document to transform */
99
+ document: string;
100
+ /** The field transforms to apply */
101
+ fieldTransforms: FieldTransform[];
102
+ }
103
+ /** A write operation */
104
+ interface Write {
105
+ /** A document to write (set) */
106
+ update?: FirestoreDocument;
107
+ /** A document to delete */
108
+ delete?: string;
109
+ /** A document transformation */
110
+ transform?: DocumentTransform;
111
+ /** Fields to update (for partial updates) */
112
+ updateMask?: {
113
+ fieldPaths: string[];
114
+ };
115
+ /** Transforms to apply after update */
116
+ updateTransforms?: FieldTransform[];
117
+ /** Precondition for this write */
118
+ currentDocument?: Precondition;
119
+ }
120
+ /** Result of a write operation */
121
+ interface WriteResult {
122
+ /** The last update time of the document after applying the write */
123
+ updateTime?: string;
124
+ /** The results of applying transforms */
125
+ transformResults?: FirestoreValue[];
126
+ }
127
+ /** Options for beginning a transaction */
128
+ interface TransactionOptions {
129
+ /** Read-only transaction options */
130
+ readOnly?: {
131
+ /** Read documents at the given time (RFC3339) */
132
+ readTime?: string;
133
+ };
134
+ /** Read-write transaction options */
135
+ readWrite?: {
136
+ /** Retry transaction starting from this ID */
137
+ retryTransaction?: string;
138
+ };
139
+ }
140
+ /** Response from commit */
141
+ interface CommitResponse {
142
+ /** Results of each write operation */
143
+ writeResults?: WriteResult[];
144
+ /** Time the commit occurred */
145
+ commitTime: string;
146
+ }
147
+ /** Authentication configuration for Firestore */
148
+ interface AuthConfig$1 {
149
+ /** The Firebase project ID */
150
+ projectId: string;
151
+ /** The service account private key (PEM format) */
152
+ privateKey: string;
153
+ /** The service account email */
154
+ clientEmail: string;
155
+ }
156
+ /** Document data type - what users work with */
157
+ type DocumentData = Record<string, unknown>;
158
+ /** A snapshot of a document at a point in time */
159
+ interface DocumentSnapshot<T = DocumentData> {
160
+ /** Whether the document exists */
161
+ readonly exists: boolean;
162
+ /** The document ID */
163
+ readonly id: string;
164
+ /** The full document path */
165
+ readonly path: string;
166
+ /** The document data, or undefined if it doesn't exist */
167
+ data(): T | undefined;
168
+ /** Get a specific field value */
169
+ get(fieldPath: string): unknown;
170
+ /** Time the document was created */
171
+ readonly createTime?: Date;
172
+ /** Time the document was last updated */
173
+ readonly updateTime?: Date;
174
+ }
175
+ //#endregion
176
+ //#region src/references.d.ts
177
+ interface FirestoreClientInterface {
178
+ _getDocument(path: string, transactionId?: string): Promise<FirestoreDocument | null>;
179
+ _getDocumentName(path: string): string;
180
+ _setDocument(path: string, data: Record<string, unknown>, options?: {
181
+ merge?: boolean;
182
+ }): Promise<WriteResult>;
183
+ _updateDocument(path: string, data: Record<string, unknown>): Promise<WriteResult>;
184
+ _deleteDocument(path: string): Promise<void>;
185
+ }
186
+ /**
187
+ * A reference to a Firestore document.
188
+ */
189
+ declare class DocumentReference<T = DocumentData> {
190
+ private readonly _firestore;
191
+ readonly id: string;
192
+ readonly path: string;
193
+ constructor(_firestore: FirestoreClientInterface, path: string);
194
+ /**
195
+ * Get the parent collection reference.
196
+ */
197
+ get parent(): CollectionReference<T>;
198
+ /**
199
+ * Get a subcollection of this document.
200
+ */
201
+ collection(collectionPath: string): CollectionReference;
202
+ /**
203
+ * Get the document.
204
+ */
205
+ get(): Promise<DocumentSnapshot<T>>;
206
+ /**
207
+ * Set the document data.
208
+ */
209
+ set(data: T, options?: {
210
+ merge?: boolean;
211
+ }): Promise<WriteResult>;
212
+ /**
213
+ * Update the document data.
214
+ */
215
+ update(data: Partial<T>): Promise<WriteResult>;
216
+ /**
217
+ * Delete the document.
218
+ */
219
+ delete(): Promise<void>;
220
+ }
221
+ /**
222
+ * A reference to a Firestore collection.
223
+ */
224
+ declare class CollectionReference<T = DocumentData> {
225
+ private readonly _firestore;
226
+ readonly id: string;
227
+ readonly path: string;
228
+ constructor(_firestore: FirestoreClientInterface, path: string);
229
+ /**
230
+ * Get a document reference in this collection.
231
+ * If no ID is provided, a random one will be generated.
232
+ */
233
+ doc(documentId?: string): DocumentReference<T>;
234
+ /**
235
+ * Add a new document with an auto-generated ID.
236
+ */
237
+ add(data: T): Promise<DocumentReference<T>>;
238
+ }
239
+ //#endregion
240
+ //#region src/transaction.d.ts
241
+ /**
242
+ * A Firestore transaction.
243
+ * All reads must happen before any writes.
244
+ */
245
+ declare class Transaction {
246
+ private readonly _firestore;
247
+ private readonly _transactionId;
248
+ private readonly _writes;
249
+ constructor(_firestore: FirestoreClientInterface & {
250
+ _getDocument(path: string, transactionId?: string): Promise<FirestoreDocument | null>;
251
+ }, _transactionId: string);
252
+ /**
253
+ * Get a document within this transaction.
254
+ */
255
+ get<T = DocumentData>(ref: DocumentReference<T>): Promise<DocumentSnapshot<T>>;
256
+ /**
257
+ * Queue a set operation.
258
+ */
259
+ set<T = DocumentData>(ref: DocumentReference<T>, data: T, options?: {
260
+ merge?: boolean;
261
+ }): Transaction;
262
+ /**
263
+ * Queue an update operation.
264
+ */
265
+ update<T = DocumentData>(ref: DocumentReference<T>, data: Partial<T>): Transaction;
266
+ /**
267
+ * Queue a delete operation.
268
+ */
269
+ delete(ref: DocumentReference): Transaction;
270
+ /** @internal */
271
+ _getWrites(): Write[];
272
+ /** @internal */
273
+ _getTransactionId(): string;
274
+ }
275
+ //#endregion
276
+ //#region src/client.d.ts
277
+ /**
278
+ * Firestore REST API client.
279
+ */
280
+ declare class Firestore implements FirestoreClientInterface {
281
+ private readonly _config;
282
+ private readonly _databaseId;
283
+ private _token;
284
+ private _tokenExpiry;
285
+ constructor(config: AuthConfig$1, databaseId?: string);
286
+ /**
287
+ * Get a collection reference.
288
+ */
289
+ collection(collectionPath: string): CollectionReference;
290
+ /**
291
+ * Get a document reference.
292
+ */
293
+ doc(documentPath: string): DocumentReference;
294
+ /**
295
+ * Run a transaction.
296
+ */
297
+ runTransaction<R>(updateFn: (transaction: Transaction) => Promise<R>, options?: {
298
+ maxAttempts?: number;
299
+ }): Promise<R>;
300
+ /** @internal */
301
+ _getToken(): Promise<string>;
302
+ /** @internal */
303
+ _getDatabasePath(): string;
304
+ /** @internal */
305
+ _getDocumentName(path: string): string;
306
+ /** @internal */
307
+ _getDocument(path: string, transactionId?: string): Promise<FirestoreDocument | null>;
308
+ /** @internal */
309
+ _setDocument(path: string, data: Record<string, unknown>, options?: {
310
+ merge?: boolean;
311
+ }): Promise<WriteResult>;
312
+ /** @internal */
313
+ _updateDocument(path: string, data: Record<string, unknown>): Promise<WriteResult>;
314
+ /** @internal */
315
+ _deleteDocument(path: string): Promise<void>;
316
+ /** @internal */
317
+ _beginTransaction(retryTransaction?: string): Promise<string>;
318
+ /** @internal */
319
+ _commitTransaction(transactionId: string, writes: Write[]): Promise<CommitResponse>;
320
+ }
321
+ //#endregion
322
+ //#region src/field-value.d.ts
323
+ /** Base class for FieldValue sentinels */
324
+ declare abstract class FieldValueBase {
325
+ readonly __isFieldValue__: true;
326
+ abstract readonly _type: string;
327
+ }
328
+ /** Server timestamp sentinel */
329
+ declare class ServerTimestampValue extends FieldValueBase {
330
+ readonly _type = "serverTimestamp";
331
+ }
332
+ /** Delete field sentinel */
333
+ declare class DeleteFieldValue extends FieldValueBase {
334
+ readonly _type = "delete";
335
+ }
336
+ /** Increment sentinel */
337
+ declare class IncrementValue extends FieldValueBase {
338
+ readonly amount: number;
339
+ readonly _type = "increment";
340
+ constructor(amount: number);
341
+ }
342
+ /** Array union sentinel */
343
+ declare class ArrayUnionValue extends FieldValueBase {
344
+ readonly elements: unknown[];
345
+ readonly _type = "arrayUnion";
346
+ constructor(elements: unknown[]);
347
+ }
348
+ /** Array remove sentinel */
349
+ declare class ArrayRemoveValue extends FieldValueBase {
350
+ readonly elements: unknown[];
351
+ readonly _type = "arrayRemove";
352
+ constructor(elements: unknown[]);
353
+ }
354
+ /** FieldValue sentinel type */
355
+ type FieldValueType = ServerTimestampValue | DeleteFieldValue | IncrementValue | ArrayUnionValue | ArrayRemoveValue;
356
+ /**
357
+ * FieldValue factory for creating sentinel values
358
+ */
359
+ declare const FieldValue: {
360
+ /**
361
+ * Returns a sentinel to include a server-generated timestamp in the written data.
362
+ */
363
+ serverTimestamp(): FieldValueType;
364
+ /**
365
+ * Returns a sentinel to delete a field.
366
+ */
367
+ delete(): FieldValueType;
368
+ /**
369
+ * Returns a sentinel to increment a numeric field by the given amount.
370
+ */
371
+ increment(amount: number): FieldValueType;
372
+ /**
373
+ * Returns a sentinel to union elements into an array field.
374
+ * Only adds elements not already present.
375
+ */
376
+ arrayUnion(...elements: unknown[]): FieldValueType;
377
+ /**
378
+ * Returns a sentinel to remove elements from an array field.
379
+ */
380
+ arrayRemove(...elements: unknown[]): FieldValueType;
381
+ };
382
+ //#endregion
383
+ //#region src/value.d.ts
384
+ /**
385
+ * Represents a geographic point (latitude/longitude).
386
+ */
387
+ declare class GeoPoint {
388
+ readonly latitude: number;
389
+ readonly longitude: number;
390
+ constructor(latitude: number, longitude: number);
391
+ isEqual(other: GeoPoint): boolean;
392
+ }
393
+ /**
394
+ * Represents a Firestore timestamp with nanosecond precision.
395
+ */
396
+ declare class Timestamp {
397
+ readonly seconds: number;
398
+ readonly nanoseconds: number;
399
+ constructor(seconds: number, nanoseconds: number);
400
+ static now(): Timestamp;
401
+ static fromDate(date: Date): Timestamp;
402
+ static fromMillis(milliseconds: number): Timestamp;
403
+ toDate(): Date;
404
+ toMillis(): number;
405
+ isEqual(other: Timestamp): boolean;
406
+ }
407
+ /**
408
+ * Convert a JavaScript value to Firestore REST format.
409
+ */
410
+ declare function toFirestoreValue(value: unknown): FirestoreValue;
411
+ /**
412
+ * Convert a Firestore REST value to JavaScript.
413
+ */
414
+ declare function fromFirestoreValue(value: FirestoreValue): unknown;
415
+ //#endregion
416
+ //#region src/auth.d.ts
417
+ interface AuthConfig {
418
+ projectId: string;
419
+ privateKey: string;
420
+ clientEmail: string;
421
+ }
422
+ declare function createJWT(config: AuthConfig): Promise<string>;
423
+ declare function getFirestoreToken(config: AuthConfig): Promise<string>;
424
+ //#endregion
425
+ export { CollectionReference, type DocumentData, DocumentReference, type DocumentSnapshot, type FieldTransform, FieldValue, Firestore, type FirestoreDocument, type FirestoreValue, GeoPoint, Timestamp, Transaction, type TransactionOptions, type Write, type WriteResult, createJWT, fromFirestoreValue, getFirestoreToken, toFirestoreValue };
426
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/references.ts","../src/transaction.ts","../src/client.ts","../src/field-value.ts","../src/value.ts","../src/auth.ts"],"sourcesContent":[],"mappings":";;AAYA;AAKA;AAKA;AAKA;AAKA;AAKA;AAKiB,UA9BA,SAAA,CA8BA;EAKjB,SAAiB,EAAA,IAAA;AAKjB;AAQA;AAOiB,UAlDA,YAAA,CAoDe;EAKhC,YAAY,EAAA,OAAA;;;AAGN,UAvDW,YAAA,CAuDX;EACA,YAAA,EAAA,MAAA;;;AAGA,UAtDW,WAAA,CAsDX;EACA,WAAA,EAAA,MAAA;;;AAGA,UArDW,cAAA,CAqDX;EAAA,cAAA,EAAA,MAAA;AAON;AAgBA;AAQiB,UA/EA,WAAA,CA+EA;EAMD,WAAA,EAAA,MAAA;;;AAMY,UAtFX,UAAA,CAsFW;EAEH,UAAA,EAAA,MAAA;;AAIzB;AAQiB,UA/FA,cAAA,CA+FA;EAEJ,cAAA,EAAA,MAAA;;;AAUS,UAtGL,aAAA,CAsGK;EAAA,aAAA,EAAA;IAItB,QAAiB,EAAA,MAAA;IAYjB,SAAiB,EAAA,MAAA;EAwBjB,CAAA;AAwBA;AAUA;AAOiB,UA/KA,UAAA,CA+KA;EAAqB,UAAA,EAAA;IAQ1B,MAAA,CAAA,EArLK,cAqLL,EAAA;EAIc,CAAA;;;UApLT,QAAA;;aAEA,eAAe;ECEhC,CAAA;;;AAQc,KDLF,cAAA,GACN,SCIQ,GDHR,YCGQ,GDFR,YCEQ,GDDR,WCCQ,GDAR,cCAQ,GDCR,WCDQ,GDER,UCFQ,GDGR,cCHQ,GDIR,aCJQ,GDKR,UCLQ,GDMR,QCNQ;;AAEP,UDWU,iBAAA,CCXV;EAGO;EACC,IAAA,CAAA,EAAA,MAAA;EAAR;EAC4B,MAAA,CAAA,EDUtB,MCVsB,CAAA,MAAA,EDUP,cCVO,CAAA;EAAA;EAMnC,UAAa,CAAA,EAAA,MAAA;EAAsB;EAKE,UAAA,CAAA,EA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