@firebase/firestore 4.7.10-auth-redirect-credentials.82faa0828 → 4.7.10-auth-redirect-credentials.b424e5897

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 (34) hide show
  1. package/dist/firestore/src/core/database_info.d.ts +2 -1
  2. package/dist/firestore/src/global_index.d.ts +2 -1
  3. package/dist/firestore/src/platform/browser/webchannel_connection.d.ts +1 -1
  4. package/dist/firestore/src/platform/browser_lite/fetch_connection.d.ts +1 -1
  5. package/dist/firestore/src/remote/rest_connection.d.ts +1 -1
  6. package/dist/index.cjs.js +17 -16
  7. package/dist/index.cjs.js.map +1 -1
  8. package/dist/index.esm2017.js +17 -16
  9. package/dist/index.esm2017.js.map +1 -1
  10. package/dist/index.node.cjs.js +6 -4
  11. package/dist/index.node.cjs.js.map +1 -1
  12. package/dist/index.node.mjs +6 -4
  13. package/dist/index.node.mjs.map +1 -1
  14. package/dist/index.rn.js +17 -16
  15. package/dist/index.rn.js.map +1 -1
  16. package/dist/internal.d.ts +2 -1
  17. package/dist/lite/firestore/src/core/database_info.d.ts +2 -1
  18. package/dist/lite/firestore/src/platform/browser/webchannel_connection.d.ts +1 -1
  19. package/dist/lite/firestore/src/platform/browser_lite/fetch_connection.d.ts +1 -1
  20. package/dist/lite/firestore/src/remote/rest_connection.d.ts +1 -1
  21. package/dist/lite/index.browser.esm2017.js +18 -17
  22. package/dist/lite/index.browser.esm2017.js.map +1 -1
  23. package/dist/lite/index.cjs.js +18 -17
  24. package/dist/lite/index.cjs.js.map +1 -1
  25. package/dist/lite/index.node.cjs.js +9 -7
  26. package/dist/lite/index.node.cjs.js.map +1 -1
  27. package/dist/lite/index.node.mjs +9 -7
  28. package/dist/lite/index.node.mjs.map +1 -1
  29. package/dist/lite/index.rn.esm2017.js +18 -17
  30. package/dist/lite/index.rn.esm2017.js.map +1 -1
  31. package/dist/lite/internal.d.ts +2 -1
  32. package/dist/lite/private.d.ts +2 -1
  33. package/dist/private.d.ts +2 -1
  34. package/package.json +9 -9
@@ -26,6 +26,7 @@ export declare class DatabaseInfo {
26
26
  readonly autoDetectLongPolling: boolean;
27
27
  readonly longPollingOptions: ExperimentalLongPollingOptions;
28
28
  readonly useFetchStreams: boolean;
29
+ readonly isUsingEmulator: boolean;
29
30
  /**
30
31
  * Constructs a DatabaseInfo using the provided host, databaseId and
31
32
  * persistenceKey.
@@ -44,7 +45,7 @@ export declare class DatabaseInfo {
44
45
  * @param useFetchStreams Whether to use the Fetch API instead of
45
46
  * XMLHTTPRequest
46
47
  */
47
- constructor(databaseId: DatabaseId, appId: string, persistenceKey: string, host: string, ssl: boolean, forceLongPolling: boolean, autoDetectLongPolling: boolean, longPollingOptions: ExperimentalLongPollingOptions, useFetchStreams: boolean);
48
+ constructor(databaseId: DatabaseId, appId: string, persistenceKey: string, host: string, ssl: boolean, forceLongPolling: boolean, autoDetectLongPolling: boolean, longPollingOptions: ExperimentalLongPollingOptions, useFetchStreams: boolean, isUsingEmulator: boolean);
48
49
  }
49
50
  /** The default database name for a project. */
50
51
  export declare const DEFAULT_DATABASE_NAME = "(default)";
@@ -823,6 +823,7 @@ declare class DatabaseInfo {
823
823
  readonly autoDetectLongPolling: boolean;
824
824
  readonly longPollingOptions: ExperimentalLongPollingOptions;
825
825
  readonly useFetchStreams: boolean;
826
+ readonly isUsingEmulator: boolean;
826
827
  /**
827
828
  * Constructs a DatabaseInfo using the provided host, databaseId and
828
829
  * persistenceKey.
@@ -841,7 +842,7 @@ declare class DatabaseInfo {
841
842
  * @param useFetchStreams Whether to use the Fetch API instead of
842
843
  * XMLHTTPRequest
843
844
  */
844
- constructor(databaseId: DatabaseId, appId: string, persistenceKey: string, host: string, ssl: boolean, forceLongPolling: boolean, autoDetectLongPolling: boolean, longPollingOptions: ExperimentalLongPollingOptions, useFetchStreams: boolean);
845
+ constructor(databaseId: DatabaseId, appId: string, persistenceKey: string, host: string, ssl: boolean, forceLongPolling: boolean, autoDetectLongPolling: boolean, longPollingOptions: ExperimentalLongPollingOptions, useFetchStreams: boolean, isUsingEmulator: boolean);
845
846
  }
846
847
  /**
847
848
  * Represents the database ID a Firestore client is associated with.
@@ -25,6 +25,6 @@ export declare class WebChannelConnection extends RestConnection {
25
25
  private readonly useFetchStreams;
26
26
  private readonly longPollingOptions;
27
27
  constructor(info: DatabaseInfo);
28
- protected performRPCRequest<Req, Resp>(rpcName: string, url: string, headers: StringMap, body: Req): Promise<Resp>;
28
+ protected performRPCRequest<Req, Resp>(rpcName: string, url: string, headers: StringMap, body: Req, _isUsingEmulator: boolean): Promise<Resp>;
29
29
  openStream<Req, Resp>(rpcName: string, authToken: Token | null, appCheckToken: Token | null): Stream<Req, Resp>;
30
30
  }
@@ -24,5 +24,5 @@ import { StringMap } from '../../util/types';
24
24
  */
25
25
  export declare class FetchConnection extends RestConnection {
26
26
  openStream<Req, Resp>(rpcName: string, token: Token | null): Stream<Req, Resp>;
27
- protected performRPCRequest<Req, Resp>(rpcName: string, url: string, headers: StringMap, body: Req): Promise<Resp>;
27
+ protected performRPCRequest<Req, Resp>(rpcName: string, url: string, headers: StringMap, body: Req, isUsingEmulator: boolean): Promise<Resp>;
28
28
  }
@@ -42,7 +42,7 @@ export declare abstract class RestConnection implements Connection {
42
42
  /**
43
43
  * Performs an RPC request using an implementation specific networking layer.
44
44
  */
45
- protected abstract performRPCRequest<Req, Resp>(rpcName: string, url: string, headers: StringMap, body: Req): Promise<Resp>;
45
+ protected abstract performRPCRequest<Req, Resp>(rpcName: string, url: string, headers: StringMap, body: Req, isUsingEmulator: boolean): Promise<Resp>;
46
46
  private makeUrl;
47
47
  /**
48
48
  * Closes and cleans up any resources associated with the connection. This
package/dist/index.cjs.js CHANGED
@@ -9,7 +9,7 @@ var util = require('@firebase/util');
9
9
  var bloomBlob = require('@firebase/webchannel-wrapper/bloom-blob');
10
10
  var webchannelBlob = require('@firebase/webchannel-wrapper/webchannel-blob');
11
11
 
12
- const S = "@firebase/firestore", D = "4.7.10-auth-redirect-credentials.82faa0828";
12
+ const S = "@firebase/firestore", D = "4.7.10-auth-redirect-credentials.b424e5897";
13
13
 
14
14
  /**
15
15
  * @license
@@ -71,7 +71,7 @@ User.MOCK_USER = new User("mock-user");
71
71
  * See the License for the specific language governing permissions and
72
72
  * limitations under the License.
73
73
  */
74
- let v = "11.6.0-auth-redirect-credentials.82faa0828";
74
+ let v = "11.6.0-auth-redirect-credentials.b424e5897";
75
75
 
76
76
  /**
77
77
  * @license
@@ -3349,10 +3349,10 @@ function __PRIVATE_getPreviousValue(e) {
3349
3349
  * @param useFetchStreams Whether to use the Fetch API instead of
3350
3350
  * XMLHTTPRequest
3351
3351
  */
3352
- constructor(e, t, n, r, i, s, o, _, a) {
3352
+ constructor(e, t, n, r, i, s, o, _, a, u) {
3353
3353
  this.databaseId = e, this.appId = t, this.persistenceKey = n, this.host = r, this.ssl = i,
3354
3354
  this.forceLongPolling = s, this.autoDetectLongPolling = o, this.longPollingOptions = _,
3355
- this.useFetchStreams = a;
3355
+ this.useFetchStreams = a, this.isUsingEmulator = u;
3356
3356
  }
3357
3357
  }
3358
3358
 
@@ -14041,7 +14041,7 @@ class __PRIVATE_RestConnection {
14041
14041
  "google-cloud-resource-prefix": this.ko,
14042
14042
  "x-goog-request-params": this.qo
14043
14043
  };
14044
- return this.Uo(_, r, i), this.Ko(e, o, _, n).then((t => (__PRIVATE_logDebug(Kt, `Received RPC '${e}' ${s}: `, t),
14044
+ return this.Uo(_, r, i), this.Ko(e, o, _, n, this.databaseInfo.isUsingEmulator).then((t => (__PRIVATE_logDebug(Kt, `Received RPC '${e}' ${s}: `, t),
14045
14045
  t)), (t => {
14046
14046
  throw __PRIVATE_logWarn(Kt, `RPC '${e}' ${s} failed with error: `, t, "url: ", o, "request:", n),
14047
14047
  t;
@@ -14160,26 +14160,26 @@ class __PRIVATE_WebChannelConnection extends __PRIVATE_RestConnection {
14160
14160
  super(e), this.forceLongPolling = e.forceLongPolling, this.autoDetectLongPolling = e.autoDetectLongPolling,
14161
14161
  this.useFetchStreams = e.useFetchStreams, this.longPollingOptions = e.longPollingOptions;
14162
14162
  }
14163
- Ko(e, t, n, r) {
14164
- const i = __PRIVATE_generateUniqueDebugId();
14165
- return new Promise(((s, o) => {
14163
+ Ko(e, t, n, r, i) {
14164
+ const s = __PRIVATE_generateUniqueDebugId();
14165
+ return new Promise(((i, o) => {
14166
14166
  const _ = new webchannelBlob.XhrIo;
14167
14167
  _.setWithCredentials(!0), _.listenOnce(webchannelBlob.EventType.COMPLETE, (() => {
14168
14168
  try {
14169
14169
  switch (_.getLastErrorCode()) {
14170
14170
  case webchannelBlob.ErrorCode.NO_ERROR:
14171
14171
  const t = _.getResponseJson();
14172
- __PRIVATE_logDebug(Gt, `XHR for RPC '${e}' ${i} received:`, JSON.stringify(t)),
14173
- s(t);
14172
+ __PRIVATE_logDebug(Gt, `XHR for RPC '${e}' ${s} received:`, JSON.stringify(t)),
14173
+ i(t);
14174
14174
  break;
14175
14175
 
14176
14176
  case webchannelBlob.ErrorCode.TIMEOUT:
14177
- __PRIVATE_logDebug(Gt, `RPC '${e}' ${i} timed out`), o(new FirestoreError(F.DEADLINE_EXCEEDED, "Request time out"));
14177
+ __PRIVATE_logDebug(Gt, `RPC '${e}' ${s} timed out`), o(new FirestoreError(F.DEADLINE_EXCEEDED, "Request time out"));
14178
14178
  break;
14179
14179
 
14180
14180
  case webchannelBlob.ErrorCode.HTTP_ERROR:
14181
14181
  const n = _.getStatus();
14182
- if (__PRIVATE_logDebug(Gt, `RPC '${e}' ${i} failed with status:`, n, "response text:", _.getResponseText()),
14182
+ if (__PRIVATE_logDebug(Gt, `RPC '${e}' ${s} failed with status:`, n, "response text:", _.getResponseText()),
14183
14183
  n > 0) {
14184
14184
  let e = _.getResponseJson();
14185
14185
  Array.isArray(e) && (e = e[0]);
@@ -14200,17 +14200,17 @@ class __PRIVATE_WebChannelConnection extends __PRIVATE_RestConnection {
14200
14200
  default:
14201
14201
  fail(9055, {
14202
14202
  s_: e,
14203
- streamId: i,
14203
+ streamId: s,
14204
14204
  o_: _.getLastErrorCode(),
14205
14205
  __: _.getLastError()
14206
14206
  });
14207
14207
  }
14208
14208
  } finally {
14209
- __PRIVATE_logDebug(Gt, `RPC '${e}' ${i} completed.`);
14209
+ __PRIVATE_logDebug(Gt, `RPC '${e}' ${s} completed.`);
14210
14210
  }
14211
14211
  }));
14212
14212
  const a = JSON.stringify(r);
14213
- __PRIVATE_logDebug(Gt, `RPC '${e}' ${i} sending request:`, r), _.send(t, "POST", a, n, 15);
14213
+ __PRIVATE_logDebug(Gt, `RPC '${e}' ${s} sending request:`, r), _.send(t, "POST", a, n, 15);
14214
14214
  }));
14215
14215
  }
14216
14216
  a_(e, t, n) {
@@ -19269,7 +19269,8 @@ function getFirestore(e, n) {
19269
19269
  function __PRIVATE_configureFirestore(e) {
19270
19270
  var t, n, r;
19271
19271
  const i = e._freezeSettings(), s = function __PRIVATE_makeDatabaseInfo(e, t, n, r) {
19272
- return new DatabaseInfo(e, t, n, r.host, r.ssl, r.experimentalForceLongPolling, r.experimentalAutoDetectLongPolling, __PRIVATE_cloneLongPollingOptions(r.experimentalLongPollingOptions), r.useFetchStreams);
19272
+ const i = r;
19273
+ return new DatabaseInfo(e, t, n, r.host, r.ssl, r.experimentalForceLongPolling, r.experimentalAutoDetectLongPolling, __PRIVATE_cloneLongPollingOptions(r.experimentalLongPollingOptions), r.useFetchStreams, void 0 !== i.emulatorOptions);
19273
19274
  }(e._databaseId, (null === (t = e._app) || void 0 === t ? void 0 : t.options.appId) || "", e._persistenceKey, i);
19274
19275
  e._componentsProvider || (null === (n = i.localCache) || void 0 === n ? void 0 : n._offlineComponentProvider) && (null === (r = i.localCache) || void 0 === r ? void 0 : r._onlineComponentProvider) && (e._componentsProvider = {
19275
19276
  _offline: i.localCache._offlineComponentProvider,