@firebase/firestore 3.4.13 → 3.4.14-canary.47895fe5b
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
|
@@ -14,7 +14,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
14
14
|
|
|
15
15
|
var nodeFetch__default = /*#__PURE__*/_interopDefaultLegacy(nodeFetch);
|
|
16
16
|
|
|
17
|
-
const version$1 = "3.4.
|
|
17
|
+
const version$1 = "3.4.14-canary.47895fe5b";
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* @license
|
|
@@ -67,7 +67,7 @@ User.GOOGLE_CREDENTIALS = new User('google-credentials-uid');
|
|
|
67
67
|
User.FIRST_PARTY = new User('first-party-uid');
|
|
68
68
|
User.MOCK_USER = new User('mock-user');
|
|
69
69
|
|
|
70
|
-
const version = "9.9.
|
|
70
|
+
const version = "9.9.3-canary.47895fe5b";
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* @license
|
|
@@ -514,19 +514,41 @@ class LiteAuthCredentialsProvider {
|
|
|
514
514
|
* safer to keep the implementation as-is.
|
|
515
515
|
*/
|
|
516
516
|
class FirstPartyToken {
|
|
517
|
-
constructor(gapi, sessionIndex, iamToken) {
|
|
517
|
+
constructor(gapi, sessionIndex, iamToken, authTokenFactory) {
|
|
518
|
+
this.gapi = gapi;
|
|
519
|
+
this.sessionIndex = sessionIndex;
|
|
520
|
+
this.iamToken = iamToken;
|
|
521
|
+
this.authTokenFactory = authTokenFactory;
|
|
518
522
|
this.type = 'FirstParty';
|
|
519
523
|
this.user = User.FIRST_PARTY;
|
|
520
|
-
this.
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
524
|
+
this._headers = new Map();
|
|
525
|
+
}
|
|
526
|
+
/** Gets an authorization token, using a provided factory function, or falling back to First Party GAPI. */
|
|
527
|
+
getAuthToken() {
|
|
528
|
+
if (this.authTokenFactory) {
|
|
529
|
+
return this.authTokenFactory();
|
|
525
530
|
}
|
|
526
|
-
|
|
527
|
-
this.
|
|
531
|
+
else {
|
|
532
|
+
// Make sure this really is a Gapi client.
|
|
533
|
+
hardAssert(!!(typeof this.gapi === 'object' &&
|
|
534
|
+
this.gapi !== null &&
|
|
535
|
+
this.gapi['auth'] &&
|
|
536
|
+
this.gapi['auth']['getAuthHeaderValueForFirstParty']));
|
|
537
|
+
return this.gapi['auth']['getAuthHeaderValueForFirstParty']([]);
|
|
528
538
|
}
|
|
529
539
|
}
|
|
540
|
+
get headers() {
|
|
541
|
+
this._headers.set('X-Goog-AuthUser', this.sessionIndex);
|
|
542
|
+
// Use array notation to prevent minification
|
|
543
|
+
const authHeaderTokenValue = this.getAuthToken();
|
|
544
|
+
if (authHeaderTokenValue) {
|
|
545
|
+
this._headers.set('Authorization', authHeaderTokenValue);
|
|
546
|
+
}
|
|
547
|
+
if (this.iamToken) {
|
|
548
|
+
this._headers.set('X-Goog-Iam-Authorization-Token', this.iamToken);
|
|
549
|
+
}
|
|
550
|
+
return this._headers;
|
|
551
|
+
}
|
|
530
552
|
}
|
|
531
553
|
/*
|
|
532
554
|
* Provides user credentials required for the Firestore JavaScript SDK
|
|
@@ -534,13 +556,14 @@ class FirstPartyToken {
|
|
|
534
556
|
* to applications hosted by Google.
|
|
535
557
|
*/
|
|
536
558
|
class FirstPartyAuthCredentialsProvider {
|
|
537
|
-
constructor(gapi, sessionIndex, iamToken) {
|
|
559
|
+
constructor(gapi, sessionIndex, iamToken, authTokenFactory) {
|
|
538
560
|
this.gapi = gapi;
|
|
539
561
|
this.sessionIndex = sessionIndex;
|
|
540
562
|
this.iamToken = iamToken;
|
|
563
|
+
this.authTokenFactory = authTokenFactory;
|
|
541
564
|
}
|
|
542
565
|
getToken() {
|
|
543
|
-
return Promise.resolve(new FirstPartyToken(this.gapi, this.sessionIndex, this.iamToken));
|
|
566
|
+
return Promise.resolve(new FirstPartyToken(this.gapi, this.sessionIndex, this.iamToken, this.authTokenFactory));
|
|
544
567
|
}
|
|
545
568
|
start(asyncQueue, changeListener) {
|
|
546
569
|
// Fire with initial uid.
|
|
@@ -597,12 +620,7 @@ function makeAuthCredentialsProvider(credentials) {
|
|
|
597
620
|
switch (credentials['type']) {
|
|
598
621
|
case 'gapi':
|
|
599
622
|
const client = credentials['client'];
|
|
600
|
-
|
|
601
|
-
hardAssert(!!(typeof client === 'object' &&
|
|
602
|
-
client !== null &&
|
|
603
|
-
client['auth'] &&
|
|
604
|
-
client['auth']['getAuthHeaderValueForFirstParty']));
|
|
605
|
-
return new FirstPartyAuthCredentialsProvider(client, credentials['sessionIndex'] || '0', credentials['iamToken'] || null);
|
|
623
|
+
return new FirstPartyAuthCredentialsProvider(client, credentials['sessionIndex'] || '0', credentials['iamToken'] || null, credentials['authTokenFactory'] || null);
|
|
606
624
|
case 'provider':
|
|
607
625
|
return credentials['client'];
|
|
608
626
|
default:
|