@firebase/firestore 3.4.13 → 3.4.14-canary.6f4ba2525
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/CHANGELOG.md +8 -0
- package/dist/firestore/src/api/credentials.d.ts +13 -3
- package/dist/firestore/src/api/index_configuration.d.ts +7 -8
- package/dist/firestore/src/api.d.ts +1 -1
- package/dist/firestore/src/local/indexeddb_schema.d.ts +1 -3
- package/dist/firestore/src/local/local_store_impl.d.ts +2 -0
- package/dist/firestore/src/util/array.d.ts +18 -0
- package/dist/firestore/test/unit/local/counting_query_engine.d.ts +11 -0
- package/dist/firestore/test/unit/local/local_store_indexeddb.test.d.ts +17 -0
- package/dist/firestore/test/unit/specs/index_spec.test.d.ts +17 -0
- package/dist/firestore/test/unit/specs/spec_builder.d.ts +5 -0
- package/dist/firestore/test/unit/specs/spec_test_runner.d.ts +8 -0
- package/dist/firestore/test/unit/util/array.test.d.ts +17 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.esm2017.js +3737 -3589
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +3721 -3604
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +250 -53
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +250 -53
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +3676 -3529
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +13 -13
- package/dist/lite/firestore/src/api/credentials.d.ts +13 -3
- package/dist/lite/firestore/src/api/index_configuration.d.ts +7 -8
- package/dist/lite/firestore/src/api.d.ts +1 -1
- package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +1 -3
- package/dist/lite/firestore/src/local/local_store_impl.d.ts +2 -0
- package/dist/lite/firestore/src/util/array.d.ts +18 -0
- package/dist/lite/firestore/test/unit/local/counting_query_engine.d.ts +11 -0
- package/dist/lite/firestore/test/unit/local/local_store_indexeddb.test.d.ts +17 -0
- package/dist/lite/firestore/test/unit/specs/index_spec.test.d.ts +17 -0
- package/dist/lite/firestore/test/unit/specs/spec_builder.d.ts +5 -0
- package/dist/lite/firestore/test/unit/specs/spec_test_runner.d.ts +8 -0
- package/dist/lite/firestore/test/unit/util/array.test.d.ts +17 -0
- package/dist/lite/index.browser.esm2017.js +232 -222
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +485 -469
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.node.cjs.js +36 -18
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +36 -18
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +232 -222
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +3 -0
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +23 -23
- package/dist/lite/packages/firestore/src/api/credentials.d.ts +13 -3
- package/dist/lite/packages/firestore/src/api/index_configuration.d.ts +7 -8
- package/dist/lite/packages/firestore/src/api.d.ts +1 -1
- package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +1 -3
- package/dist/lite/packages/firestore/src/local/local_store_impl.d.ts +2 -0
- package/dist/lite/packages/firestore/src/util/array.d.ts +18 -0
- package/dist/lite/packages/firestore/test/unit/local/counting_query_engine.d.ts +11 -0
- package/dist/lite/packages/firestore/test/unit/local/local_store_indexeddb.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/unit/specs/index_spec.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/unit/specs/spec_builder.d.ts +5 -0
- package/dist/lite/packages/firestore/test/unit/specs/spec_test_runner.d.ts +8 -0
- package/dist/lite/packages/firestore/test/unit/util/array.test.d.ts +17 -0
- package/dist/lite/private.d.ts +3 -0
- package/dist/packages/firestore/dist/index.esm2017.d.ts +193 -193
- package/dist/packages/firestore/src/api/credentials.d.ts +13 -3
- package/dist/packages/firestore/src/api/index_configuration.d.ts +7 -8
- package/dist/packages/firestore/src/api.d.ts +1 -1
- package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +1 -3
- package/dist/packages/firestore/src/local/local_store_impl.d.ts +2 -0
- package/dist/packages/firestore/src/util/array.d.ts +18 -0
- package/dist/packages/firestore/test/unit/local/counting_query_engine.d.ts +11 -0
- package/dist/packages/firestore/test/unit/local/local_store_indexeddb.test.d.ts +17 -0
- package/dist/packages/firestore/test/unit/specs/index_spec.test.d.ts +17 -0
- package/dist/packages/firestore/test/unit/specs/spec_builder.d.ts +5 -0
- package/dist/packages/firestore/test/unit/specs/spec_test_runner.d.ts +8 -0
- package/dist/packages/firestore/test/unit/util/array.test.d.ts +17 -0
- package/dist/private.d.ts +4 -1
- package/package.json +10 -9
package/dist/lite/index.node.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { FirebaseError, createMockUserToken, getModularInstance } from '@firebas
|
|
|
6
6
|
import nodeFetch from 'node-fetch';
|
|
7
7
|
import { randomBytes as randomBytes$1 } from 'crypto';
|
|
8
8
|
|
|
9
|
-
const version$1 = "3.4.
|
|
9
|
+
const version$1 = "3.4.14-canary.6f4ba2525";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @license
|
|
@@ -59,7 +59,7 @@ User.GOOGLE_CREDENTIALS = new User('google-credentials-uid');
|
|
|
59
59
|
User.FIRST_PARTY = new User('first-party-uid');
|
|
60
60
|
User.MOCK_USER = new User('mock-user');
|
|
61
61
|
|
|
62
|
-
const version = "9.9.
|
|
62
|
+
const version = "9.9.2-canary.6f4ba2525";
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
* @license
|
|
@@ -506,19 +506,41 @@ class LiteAuthCredentialsProvider {
|
|
|
506
506
|
* safer to keep the implementation as-is.
|
|
507
507
|
*/
|
|
508
508
|
class FirstPartyToken {
|
|
509
|
-
constructor(gapi, sessionIndex, iamToken) {
|
|
509
|
+
constructor(gapi, sessionIndex, iamToken, authTokenFactory) {
|
|
510
|
+
this.gapi = gapi;
|
|
511
|
+
this.sessionIndex = sessionIndex;
|
|
512
|
+
this.iamToken = iamToken;
|
|
513
|
+
this.authTokenFactory = authTokenFactory;
|
|
510
514
|
this.type = 'FirstParty';
|
|
511
515
|
this.user = User.FIRST_PARTY;
|
|
512
|
-
this.
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
516
|
+
this._headers = new Map();
|
|
517
|
+
}
|
|
518
|
+
/** Gets an authorization token, using a provided factory function, or falling back to First Party GAPI. */
|
|
519
|
+
getAuthToken() {
|
|
520
|
+
if (this.authTokenFactory) {
|
|
521
|
+
return this.authTokenFactory();
|
|
517
522
|
}
|
|
518
|
-
|
|
519
|
-
this.
|
|
523
|
+
else {
|
|
524
|
+
// Make sure this really is a Gapi client.
|
|
525
|
+
hardAssert(!!(typeof this.gapi === 'object' &&
|
|
526
|
+
this.gapi !== null &&
|
|
527
|
+
this.gapi['auth'] &&
|
|
528
|
+
this.gapi['auth']['getAuthHeaderValueForFirstParty']));
|
|
529
|
+
return this.gapi['auth']['getAuthHeaderValueForFirstParty']([]);
|
|
520
530
|
}
|
|
521
531
|
}
|
|
532
|
+
get headers() {
|
|
533
|
+
this._headers.set('X-Goog-AuthUser', this.sessionIndex);
|
|
534
|
+
// Use array notation to prevent minification
|
|
535
|
+
const authHeaderTokenValue = this.getAuthToken();
|
|
536
|
+
if (authHeaderTokenValue) {
|
|
537
|
+
this._headers.set('Authorization', authHeaderTokenValue);
|
|
538
|
+
}
|
|
539
|
+
if (this.iamToken) {
|
|
540
|
+
this._headers.set('X-Goog-Iam-Authorization-Token', this.iamToken);
|
|
541
|
+
}
|
|
542
|
+
return this._headers;
|
|
543
|
+
}
|
|
522
544
|
}
|
|
523
545
|
/*
|
|
524
546
|
* Provides user credentials required for the Firestore JavaScript SDK
|
|
@@ -526,13 +548,14 @@ class FirstPartyToken {
|
|
|
526
548
|
* to applications hosted by Google.
|
|
527
549
|
*/
|
|
528
550
|
class FirstPartyAuthCredentialsProvider {
|
|
529
|
-
constructor(gapi, sessionIndex, iamToken) {
|
|
551
|
+
constructor(gapi, sessionIndex, iamToken, authTokenFactory) {
|
|
530
552
|
this.gapi = gapi;
|
|
531
553
|
this.sessionIndex = sessionIndex;
|
|
532
554
|
this.iamToken = iamToken;
|
|
555
|
+
this.authTokenFactory = authTokenFactory;
|
|
533
556
|
}
|
|
534
557
|
getToken() {
|
|
535
|
-
return Promise.resolve(new FirstPartyToken(this.gapi, this.sessionIndex, this.iamToken));
|
|
558
|
+
return Promise.resolve(new FirstPartyToken(this.gapi, this.sessionIndex, this.iamToken, this.authTokenFactory));
|
|
536
559
|
}
|
|
537
560
|
start(asyncQueue, changeListener) {
|
|
538
561
|
// Fire with initial uid.
|
|
@@ -589,12 +612,7 @@ function makeAuthCredentialsProvider(credentials) {
|
|
|
589
612
|
switch (credentials['type']) {
|
|
590
613
|
case 'gapi':
|
|
591
614
|
const client = credentials['client'];
|
|
592
|
-
|
|
593
|
-
hardAssert(!!(typeof client === 'object' &&
|
|
594
|
-
client !== null &&
|
|
595
|
-
client['auth'] &&
|
|
596
|
-
client['auth']['getAuthHeaderValueForFirstParty']));
|
|
597
|
-
return new FirstPartyAuthCredentialsProvider(client, credentials['sessionIndex'] || '0', credentials['iamToken'] || null);
|
|
615
|
+
return new FirstPartyAuthCredentialsProvider(client, credentials['sessionIndex'] || '0', credentials['iamToken'] || null, credentials['authTokenFactory'] || null);
|
|
598
616
|
case 'provider':
|
|
599
617
|
return credentials['client'];
|
|
600
618
|
default:
|