@firebase/firestore 3.4.8-canary.69baecadd → 3.4.8-canary.6ceff4db0
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/firestore/lite/index.d.ts +1 -0
- package/dist/firestore/src/api/transaction.d.ts +2 -1
- package/dist/firestore/src/api/transaction_options.d.ts +17 -0
- package/dist/firestore/src/api.d.ts +1 -0
- package/dist/firestore/src/core/firestore_client.d.ts +2 -1
- package/dist/firestore/src/core/transaction_options.d.ts +25 -0
- package/dist/firestore/src/core/transaction_runner.d.ts +3 -2
- package/dist/firestore/src/lite-api/transaction.d.ts +2 -1
- package/dist/firestore/src/lite-api/transaction_options.d.ts +23 -0
- package/dist/index.d.ts +24 -1
- package/dist/index.esm2017.js +95 -71
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +105 -82
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +36 -9
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +36 -9
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +241 -217
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +25 -1
- package/dist/lite/firestore/lite/index.d.ts +1 -0
- package/dist/lite/firestore/src/api/transaction.d.ts +2 -1
- package/dist/lite/firestore/src/api/transaction_options.d.ts +17 -0
- package/dist/lite/firestore/src/api.d.ts +1 -0
- package/dist/lite/firestore/src/core/firestore_client.d.ts +2 -1
- package/dist/lite/firestore/src/core/transaction_options.d.ts +25 -0
- package/dist/lite/firestore/src/core/transaction_runner.d.ts +3 -2
- package/dist/lite/firestore/src/lite-api/transaction.d.ts +2 -1
- package/dist/lite/firestore/src/lite-api/transaction_options.d.ts +23 -0
- package/dist/lite/index.browser.esm2017.js +180 -157
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +112 -110
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.d.ts +24 -1
- package/dist/lite/index.node.cjs.js +34 -7
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +34 -7
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +204 -181
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +25 -1
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +13 -13
- package/dist/lite/packages/firestore/lite/index.d.ts +1 -0
- package/dist/lite/packages/firestore/src/api/transaction.d.ts +2 -1
- package/dist/lite/packages/firestore/src/api/transaction_options.d.ts +17 -0
- package/dist/lite/packages/firestore/src/api.d.ts +1 -0
- package/dist/lite/packages/firestore/src/core/firestore_client.d.ts +2 -1
- package/dist/lite/packages/firestore/src/core/transaction_options.d.ts +25 -0
- package/dist/lite/packages/firestore/src/core/transaction_runner.d.ts +3 -2
- package/dist/lite/packages/firestore/src/lite-api/transaction.d.ts +2 -1
- package/dist/lite/packages/firestore/src/lite-api/transaction_options.d.ts +23 -0
- package/dist/lite/private.d.ts +25 -1
- package/dist/packages/firestore/dist/index.esm2017.d.ts +30 -29
- package/dist/packages/firestore/lite/index.d.ts +1 -0
- package/dist/packages/firestore/src/api/transaction.d.ts +2 -1
- package/dist/packages/firestore/src/api/transaction_options.d.ts +17 -0
- package/dist/packages/firestore/src/api.d.ts +1 -0
- package/dist/packages/firestore/src/core/firestore_client.d.ts +2 -1
- package/dist/packages/firestore/src/core/transaction_options.d.ts +25 -0
- package/dist/packages/firestore/src/core/transaction_runner.d.ts +3 -2
- package/dist/packages/firestore/src/lite-api/transaction.d.ts +2 -1
- package/dist/packages/firestore/src/lite-api/transaction_options.d.ts +23 -0
- package/dist/private.d.ts +25 -1
- package/package.json +10 -10
|
@@ -0,0 +1,25 @@
|
|
|
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 DEFAULT_TRANSACTION_OPTIONS: TransactionOptions;
|
|
18
|
+
/**
|
|
19
|
+
* Options to customize transaction behavior.
|
|
20
|
+
*/
|
|
21
|
+
export declare interface TransactionOptions {
|
|
22
|
+
/** Maximum number of attempts to commit, after which transaction fails. Default is 5. */
|
|
23
|
+
readonly maxAttempts: number;
|
|
24
|
+
}
|
|
25
|
+
export declare function validateTransactionOptions(options: TransactionOptions): void;
|
|
@@ -18,7 +18,7 @@ import { Datastore } from '../remote/datastore';
|
|
|
18
18
|
import { AsyncQueue } from '../util/async_queue';
|
|
19
19
|
import { Deferred } from '../util/promise';
|
|
20
20
|
import { Transaction } from './transaction';
|
|
21
|
-
|
|
21
|
+
import { TransactionOptions } from './transaction_options';
|
|
22
22
|
/**
|
|
23
23
|
* TransactionRunner encapsulates the logic needed to run and retry transactions
|
|
24
24
|
* with backoff.
|
|
@@ -26,11 +26,12 @@ export declare const DEFAULT_MAX_ATTEMPTS_COUNT = 5;
|
|
|
26
26
|
export declare class TransactionRunner<T> {
|
|
27
27
|
private readonly asyncQueue;
|
|
28
28
|
private readonly datastore;
|
|
29
|
+
private readonly options;
|
|
29
30
|
private readonly updateFunction;
|
|
30
31
|
private readonly deferred;
|
|
31
32
|
private attemptsRemaining;
|
|
32
33
|
private backoff;
|
|
33
|
-
constructor(asyncQueue: AsyncQueue, datastore: Datastore, updateFunction: (transaction: Transaction) => Promise<T>, deferred: Deferred<T>);
|
|
34
|
+
constructor(asyncQueue: AsyncQueue, datastore: Datastore, options: TransactionOptions, updateFunction: (transaction: Transaction) => Promise<T>, deferred: Deferred<T>);
|
|
34
35
|
/** Runs the transaction and sets the result on deferred. */
|
|
35
36
|
run(): void;
|
|
36
37
|
private runWithBackOff;
|
|
@@ -19,6 +19,7 @@ import { Firestore } from './database';
|
|
|
19
19
|
import { FieldPath } from './field_path';
|
|
20
20
|
import { DocumentReference, PartialWithFieldValue, SetOptions, UpdateData, WithFieldValue } from './reference';
|
|
21
21
|
import { DocumentSnapshot } from './snapshot';
|
|
22
|
+
import { TransactionOptions } from './transaction_options';
|
|
22
23
|
/**
|
|
23
24
|
* A reference to a transaction.
|
|
24
25
|
*
|
|
@@ -116,4 +117,4 @@ export declare class Transaction {
|
|
|
116
117
|
* `updateFunction `is returned here. Otherwise, if the transaction failed, a
|
|
117
118
|
* rejected promise with the corresponding failure error is returned.
|
|
118
119
|
*/
|
|
119
|
-
export declare function runTransaction<T>(firestore: Firestore, updateFunction: (transaction: Transaction) => Promise<T
|
|
120
|
+
export declare function runTransaction<T>(firestore: Firestore, updateFunction: (transaction: Transaction) => Promise<T>, options?: TransactionOptions): Promise<T>;
|
|
@@ -0,0 +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
|
+
/**
|
|
18
|
+
* Options to customize transaction behavior.
|
|
19
|
+
*/
|
|
20
|
+
export declare interface TransactionOptions {
|
|
21
|
+
/** Maximum number of attempts to commit, after which transaction fails. Default is 5. */
|
|
22
|
+
readonly maxAttempts?: number;
|
|
23
|
+
}
|
package/dist/private.d.ts
CHANGED
|
@@ -4282,7 +4282,7 @@ declare type Resolver<T> = (value?: T) => void;
|
|
|
4282
4282
|
* `updateFunction `is returned here. Otherwise, if the transaction failed, a
|
|
4283
4283
|
* rejected promise with the corresponding failure error is returned.
|
|
4284
4284
|
*/
|
|
4285
|
-
export declare function runTransaction<T>(firestore: Firestore, updateFunction: (transaction: Transaction) => Promise<T
|
|
4285
|
+
export declare function runTransaction<T>(firestore: Firestore, updateFunction: (transaction: Transaction) => Promise<T>, options?: TransactionOptions): Promise<T>;
|
|
4286
4286
|
|
|
4287
4287
|
/**
|
|
4288
4288
|
* Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to
|
|
@@ -5359,6 +5359,30 @@ declare class Transaction_3 {
|
|
|
5359
5359
|
private ensureCommitNotCalled;
|
|
5360
5360
|
}
|
|
5361
5361
|
|
|
5362
|
+
/**
|
|
5363
|
+
* @license
|
|
5364
|
+
* Copyright 2022 Google LLC
|
|
5365
|
+
*
|
|
5366
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5367
|
+
* you may not use this file except in compliance with the License.
|
|
5368
|
+
* You may obtain a copy of the License at
|
|
5369
|
+
*
|
|
5370
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5371
|
+
*
|
|
5372
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
5373
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
5374
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
5375
|
+
* See the License for the specific language governing permissions and
|
|
5376
|
+
* limitations under the License.
|
|
5377
|
+
*/
|
|
5378
|
+
/**
|
|
5379
|
+
* Options to customize transaction behavior.
|
|
5380
|
+
*/
|
|
5381
|
+
export declare interface TransactionOptions {
|
|
5382
|
+
/** Maximum number of attempts to commit, after which transaction fails. Default is 5. */
|
|
5383
|
+
readonly maxAttempts?: number;
|
|
5384
|
+
}
|
|
5385
|
+
|
|
5362
5386
|
/** Used to represent a field transform on a mutation. */
|
|
5363
5387
|
declare class TransformOperation {
|
|
5364
5388
|
private _;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firebase/firestore",
|
|
3
|
-
"version": "3.4.8-canary.
|
|
3
|
+
"version": "3.4.8-canary.6ceff4db0",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=10.10.0"
|
|
6
6
|
},
|
|
@@ -77,22 +77,22 @@
|
|
|
77
77
|
"lite/package.json"
|
|
78
78
|
],
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@firebase/component": "0.5.13-canary.
|
|
81
|
-
"@firebase/logger": "0.3.2-canary.
|
|
82
|
-
"@firebase/util": "1.5.2-canary.
|
|
83
|
-
"@firebase/webchannel-wrapper": "0.6.1-canary.
|
|
80
|
+
"@firebase/component": "0.5.13-canary.6ceff4db0",
|
|
81
|
+
"@firebase/logger": "0.3.2-canary.6ceff4db0",
|
|
82
|
+
"@firebase/util": "1.5.2-canary.6ceff4db0",
|
|
83
|
+
"@firebase/webchannel-wrapper": "0.6.1-canary.6ceff4db0",
|
|
84
84
|
"@grpc/grpc-js": "^1.3.2",
|
|
85
85
|
"@grpc/proto-loader": "^0.6.0",
|
|
86
86
|
"node-fetch": "2.6.7",
|
|
87
87
|
"tslib": "^2.1.0"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
90
|
-
"@firebase/app": "0.7.22-canary.
|
|
90
|
+
"@firebase/app": "0.7.22-canary.6ceff4db0"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
|
-
"@firebase/app": "0.7.22-canary.
|
|
94
|
-
"@firebase/app-compat": "0.1.23-canary.
|
|
95
|
-
"@firebase/auth": "0.19.12-canary.
|
|
93
|
+
"@firebase/app": "0.7.22-canary.6ceff4db0",
|
|
94
|
+
"@firebase/app-compat": "0.1.23-canary.6ceff4db0",
|
|
95
|
+
"@firebase/auth": "0.19.12-canary.6ceff4db0",
|
|
96
96
|
"@rollup/plugin-alias": "3.1.5",
|
|
97
97
|
"@rollup/plugin-json": "4.1.0",
|
|
98
98
|
"@types/eslint": "7.28.0",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"rollup-plugin-sourcemaps": "0.6.3",
|
|
107
107
|
"rollup-plugin-terser": "7.0.2",
|
|
108
108
|
"rollup-plugin-typescript2": "0.30.0",
|
|
109
|
-
"ts-node": "10.
|
|
109
|
+
"ts-node": "10.7.0",
|
|
110
110
|
"typescript": "4.2.2"
|
|
111
111
|
},
|
|
112
112
|
"repository": {
|