@firebase/firestore-compat 0.4.0-20230301000120 → 0.4.0-20250716004940

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.
Files changed (85) hide show
  1. package/dist/index.cjs.js +980 -972
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/{index.esm2017.js → index.esm.js} +981 -973
  4. package/dist/index.esm.js.map +1 -0
  5. package/dist/index.node.cjs.js +980 -972
  6. package/dist/index.node.cjs.js.map +1 -1
  7. package/dist/index.rn.js +980 -972
  8. package/dist/index.rn.js.map +1 -1
  9. package/dist/node-esm/index.node.esm.js +980 -972
  10. package/dist/node-esm/index.node.esm.js.map +1 -1
  11. package/dist/node-esm/src/api/blob.d.ts +29 -29
  12. package/dist/node-esm/src/api/database.d.ts +228 -228
  13. package/dist/node-esm/src/api/field_path.d.ts +36 -36
  14. package/dist/node-esm/src/api/field_value.d.ts +29 -29
  15. package/dist/node-esm/src/api/geo_point.d.ts +17 -17
  16. package/dist/node-esm/src/api/observer.d.ts +29 -29
  17. package/dist/node-esm/src/api/timestamp.d.ts +17 -17
  18. package/dist/node-esm/src/config.d.ts +28 -28
  19. package/dist/node-esm/src/index.console.d.ts +48 -48
  20. package/dist/node-esm/src/index.d.ts +49 -49
  21. package/dist/node-esm/src/index.node.d.ts +22 -22
  22. package/dist/node-esm/src/index.rn.d.ts +22 -22
  23. package/dist/node-esm/src/register-module.d.ts +42 -42
  24. package/dist/node-esm/src/util/input_validation.d.ts +18 -18
  25. package/dist/node-esm/test/array_transforms.test.d.ts +17 -17
  26. package/dist/node-esm/test/batch_writes.test.d.ts +17 -17
  27. package/dist/node-esm/test/bootstrap.d.ts +17 -17
  28. package/dist/node-esm/test/bundle.test.d.ts +17 -17
  29. package/dist/node-esm/test/cursor.test.d.ts +17 -17
  30. package/dist/node-esm/test/database.test.d.ts +17 -17
  31. package/dist/node-esm/test/fields.test.d.ts +17 -17
  32. package/dist/node-esm/test/get_options.test.d.ts +17 -17
  33. package/dist/node-esm/test/numeric_transforms.test.d.ts +17 -17
  34. package/dist/node-esm/test/query.test.d.ts +17 -17
  35. package/dist/node-esm/test/server_timestamp.test.d.ts +17 -17
  36. package/dist/node-esm/test/smoke.test.d.ts +17 -17
  37. package/dist/node-esm/test/transactions.test.d.ts +17 -17
  38. package/dist/node-esm/test/type.test.d.ts +17 -17
  39. package/dist/node-esm/test/util/equality_matcher.d.ts +33 -33
  40. package/dist/node-esm/test/util/events_accumulator.d.ts +39 -39
  41. package/dist/node-esm/test/util/firebase_export.d.ts +29 -29
  42. package/dist/node-esm/test/util/helpers.d.ts +49 -49
  43. package/dist/node-esm/test/util/promise.d.ts +28 -28
  44. package/dist/node-esm/test/util/settings.d.ts +23 -23
  45. package/dist/node-esm/test/validation.test.d.ts +17 -17
  46. package/dist/src/api/blob.d.ts +29 -29
  47. package/dist/src/api/database.d.ts +228 -228
  48. package/dist/src/api/field_path.d.ts +36 -36
  49. package/dist/src/api/field_value.d.ts +29 -29
  50. package/dist/src/api/geo_point.d.ts +17 -17
  51. package/dist/src/api/observer.d.ts +29 -29
  52. package/dist/src/api/timestamp.d.ts +17 -17
  53. package/dist/src/config.d.ts +28 -28
  54. package/dist/src/index.console.d.ts +48 -48
  55. package/dist/src/index.d.ts +117 -85
  56. package/dist/src/index.node.d.ts +22 -22
  57. package/dist/src/index.rn.d.ts +22 -22
  58. package/dist/src/register-module.d.ts +42 -42
  59. package/dist/src/util/input_validation.d.ts +18 -18
  60. package/dist/test/array_transforms.test.d.ts +17 -17
  61. package/dist/test/batch_writes.test.d.ts +17 -17
  62. package/dist/test/bootstrap.d.ts +17 -17
  63. package/dist/test/bundle.test.d.ts +17 -17
  64. package/dist/test/cursor.test.d.ts +17 -17
  65. package/dist/test/database.test.d.ts +17 -17
  66. package/dist/test/fields.test.d.ts +17 -17
  67. package/dist/test/get_options.test.d.ts +17 -17
  68. package/dist/test/numeric_transforms.test.d.ts +17 -17
  69. package/dist/test/query.test.d.ts +17 -17
  70. package/dist/test/server_timestamp.test.d.ts +17 -17
  71. package/dist/test/smoke.test.d.ts +17 -17
  72. package/dist/test/transactions.test.d.ts +17 -17
  73. package/dist/test/type.test.d.ts +17 -17
  74. package/dist/test/util/equality_matcher.d.ts +33 -33
  75. package/dist/test/util/events_accumulator.d.ts +39 -39
  76. package/dist/test/util/firebase_export.d.ts +29 -29
  77. package/dist/test/util/helpers.d.ts +49 -49
  78. package/dist/test/util/promise.d.ts +28 -28
  79. package/dist/test/util/settings.d.ts +23 -23
  80. package/dist/test/validation.test.d.ts +17 -17
  81. package/package.json +25 -23
  82. package/CHANGELOG.md +0 -330
  83. package/dist/index.esm2017.js.map +0 -1
  84. package/dist/index.esm5.js +0 -1196
  85. package/dist/index.esm5.js.map +0 -1
@@ -1,49 +1,49 @@
1
- /**
2
- * @license
3
- * Copyright 2022 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import * as firestore from '@firebase/firestore-types';
18
- export declare function isPersistenceAvailable(): boolean;
19
- declare type ApiSuiteFunction = (message: string, testSuite: (persistence: boolean) => void) => void;
20
- interface ApiDescribe {
21
- (message: string, testSuite: (persistence: boolean) => void): void;
22
- skip: ApiSuiteFunction;
23
- only: ApiSuiteFunction;
24
- }
25
- export declare const apiDescribe: ApiDescribe;
26
- /** Converts the documents in a QuerySnapshot to an array with the data of each document. */
27
- export declare function toDataArray(docSet: firestore.QuerySnapshot): firestore.DocumentData[];
28
- /** Converts the changes in a QuerySnapshot to an array with the data of each document. */
29
- export declare function toChangesArray(docSet: firestore.QuerySnapshot, options?: firestore.SnapshotListenOptions): firestore.DocumentData[];
30
- export declare function toDataMap(docSet: firestore.QuerySnapshot): {
31
- [field: string]: firestore.DocumentData;
32
- };
33
- /** Converts a DocumentSet to an array with the id of each document */
34
- export declare function toIds(docSet: firestore.QuerySnapshot): string[];
35
- export declare function withTestDb(persistence: boolean, fn: (db: firestore.FirebaseFirestore) => Promise<void>): Promise<void>;
36
- /** Runs provided fn with a db for an alternate project id. */
37
- export declare function withAlternateTestDb(persistence: boolean, fn: (db: firestore.FirebaseFirestore) => Promise<void>): Promise<void>;
38
- export declare function withTestDbs(persistence: boolean, numDbs: number, fn: (db: firestore.FirebaseFirestore[]) => Promise<void>): Promise<void>;
39
- export declare function withTestDbsSettings(persistence: boolean, projectId: string, settings: firestore.Settings, numDbs: number, fn: (db: firestore.FirebaseFirestore[]) => Promise<void>): Promise<void>;
40
- export declare function withTestDoc(persistence: boolean, fn: (doc: firestore.DocumentReference) => Promise<void>): Promise<void>;
41
- export declare function withTestDocAndSettings(persistence: boolean, settings: firestore.Settings, fn: (doc: firestore.DocumentReference) => Promise<void>): Promise<void>;
42
- export declare function withTestDocAndInitialData(persistence: boolean, initialData: firestore.DocumentData | null, fn: (doc: firestore.DocumentReference) => Promise<void>): Promise<void>;
43
- export declare function withTestCollection(persistence: boolean, docs: {
44
- [key: string]: firestore.DocumentData;
45
- }, fn: (collection: firestore.CollectionReference) => Promise<void>): Promise<void>;
46
- export declare function withTestCollectionSettings(persistence: boolean, settings: firestore.Settings, docs: {
47
- [key: string]: firestore.DocumentData;
48
- }, fn: (collection: firestore.CollectionReference) => Promise<void>): Promise<void>;
49
- export {};
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import * as firestore from '@firebase/firestore-types';
18
+ export declare function isPersistenceAvailable(): boolean;
19
+ type ApiSuiteFunction = (message: string, testSuite: (persistence: boolean) => void) => void;
20
+ interface ApiDescribe {
21
+ (message: string, testSuite: (persistence: boolean) => void): void;
22
+ skip: ApiSuiteFunction;
23
+ only: ApiSuiteFunction;
24
+ }
25
+ export declare const apiDescribe: ApiDescribe;
26
+ /** Converts the documents in a QuerySnapshot to an array with the data of each document. */
27
+ export declare function toDataArray(docSet: firestore.QuerySnapshot): firestore.DocumentData[];
28
+ /** Converts the changes in a QuerySnapshot to an array with the data of each document. */
29
+ export declare function toChangesArray(docSet: firestore.QuerySnapshot, options?: firestore.SnapshotListenOptions): firestore.DocumentData[];
30
+ export declare function toDataMap(docSet: firestore.QuerySnapshot): {
31
+ [field: string]: firestore.DocumentData;
32
+ };
33
+ /** Converts a DocumentSet to an array with the id of each document */
34
+ export declare function toIds(docSet: firestore.QuerySnapshot): string[];
35
+ export declare function withTestDb(persistence: boolean, fn: (db: firestore.FirebaseFirestore) => Promise<void>): Promise<void>;
36
+ /** Runs provided fn with a db for an alternate project id. */
37
+ export declare function withAlternateTestDb(persistence: boolean, fn: (db: firestore.FirebaseFirestore) => Promise<void>): Promise<void>;
38
+ export declare function withTestDbs(persistence: boolean, numDbs: number, fn: (db: firestore.FirebaseFirestore[]) => Promise<void>): Promise<void>;
39
+ export declare function withTestDbsSettings(persistence: boolean, projectId: string, settings: firestore.Settings, numDbs: number, fn: (db: firestore.FirebaseFirestore[]) => Promise<void>): Promise<void>;
40
+ export declare function withTestDoc(persistence: boolean, fn: (doc: firestore.DocumentReference) => Promise<void>): Promise<void>;
41
+ export declare function withTestDocAndSettings(persistence: boolean, settings: firestore.Settings, fn: (doc: firestore.DocumentReference) => Promise<void>): Promise<void>;
42
+ export declare function withTestDocAndInitialData(persistence: boolean, initialData: firestore.DocumentData | null, fn: (doc: firestore.DocumentReference) => Promise<void>): Promise<void>;
43
+ export declare function withTestCollection(persistence: boolean, docs: {
44
+ [key: string]: firestore.DocumentData;
45
+ }, fn: (collection: firestore.CollectionReference) => Promise<void>): Promise<void>;
46
+ export declare function withTestCollectionSettings(persistence: boolean, settings: firestore.Settings, docs: {
47
+ [key: string]: firestore.DocumentData;
48
+ }, fn: (collection: firestore.CollectionReference) => Promise<void>): Promise<void>;
49
+ export {};
@@ -1,28 +1,28 @@
1
- /**
2
- * @license
3
- * Copyright 2022 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- export interface Resolver<R> {
18
- (value: R | Promise<R>): void;
19
- }
20
- export interface Rejecter {
21
- (reason?: Error): void;
22
- }
23
- export declare class Deferred<R> {
24
- promise: Promise<R>;
25
- resolve: Resolver<R>;
26
- reject: Rejecter;
27
- constructor();
28
- }
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export interface Resolver<R> {
18
+ (value: R | Promise<R>): void;
19
+ }
20
+ export interface Rejecter {
21
+ (reason?: Error): void;
22
+ }
23
+ export declare class Deferred<R> {
24
+ promise: Promise<R>;
25
+ resolve: Resolver<R>;
26
+ reject: Rejecter;
27
+ constructor();
28
+ }
@@ -1,23 +1,23 @@
1
- /**
2
- * @license
3
- * Copyright 2022 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- export declare const USE_EMULATOR: boolean;
18
- export declare const DEFAULT_SETTINGS: {
19
- host: string;
20
- ssl: boolean;
21
- };
22
- export declare const DEFAULT_PROJECT_ID: any;
23
- export declare const ALT_PROJECT_ID = "test-db2";
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export declare const USE_EMULATOR: boolean;
18
+ export declare const DEFAULT_SETTINGS: {
19
+ host: string;
20
+ ssl: boolean;
21
+ };
22
+ export declare const DEFAULT_PROJECT_ID: any;
23
+ export declare const ALT_PROJECT_ID = "test-db2";
@@ -1,17 +1,17 @@
1
- /**
2
- * @license
3
- * Copyright 2022 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- export {};
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export {};
@@ -1,29 +1,29 @@
1
- /**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { Bytes } from '@firebase/firestore';
18
- import { Compat } from '@firebase/util';
19
- /** Immutable class holding a blob (binary data) */
20
- export declare class Blob implements Compat<Bytes> {
21
- readonly _delegate: Bytes;
22
- constructor(_delegate: Bytes);
23
- static fromBase64String(base64: string): Blob;
24
- static fromUint8Array(array: Uint8Array): Blob;
25
- toBase64(): string;
26
- toUint8Array(): Uint8Array;
27
- isEqual(other: Blob): boolean;
28
- toString(): string;
29
- }
1
+ /**
2
+ * @license
3
+ * Copyright 2017 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { Bytes } from '@firebase/firestore';
18
+ import { Compat } from '@firebase/util';
19
+ /** Immutable class holding a blob (binary data) */
20
+ export declare class Blob implements Compat<Bytes> {
21
+ readonly _delegate: Bytes;
22
+ constructor(_delegate: Bytes);
23
+ static fromBase64String(base64: string): Blob;
24
+ static fromUint8Array(array: Uint8Array): Blob;
25
+ toBase64(): string;
26
+ toUint8Array(): Uint8Array;
27
+ isEqual(other: Blob): boolean;
28
+ toString(): string;
29
+ }