@firebase/firestore 4.7.11-firebase-studio-sdk-integration.226be0bb1 → 4.7.11-firebase-studio-sdk-integration.9de25069c

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.
@@ -4,11 +4,11 @@ import { Component as o } from "@firebase/component";
4
4
 
5
5
  import { Logger as a, LogLevel as u } from "@firebase/logger";
6
6
 
7
- import { FirebaseError as _, isCloudWorkstation as c, base64 as l, DecodeBase64StringError as h, getDefaultEmulatorHostnameAndPort as d, testConnectionAlive as f, deepEqual as E, createMockUserToken as m, getModularInstance as T } from "@firebase/util";
7
+ import { FirebaseError as _, isCloudWorkstation as c, base64 as l, DecodeBase64StringError as h, getDefaultEmulatorHostnameAndPort as d, pingServer as f, deepEqual as E, createMockUserToken as m, getModularInstance as T } from "@firebase/util";
8
8
 
9
9
  import { Integer as A } from "@firebase/webchannel-wrapper/bloom-blob";
10
10
 
11
- const P = "4.7.11-firebase-studio-sdk-integration.226be0bb1";
11
+ const P = "4.7.11-firebase-studio-sdk-integration.9de25069c";
12
12
 
13
13
  /**
14
14
  * @license
@@ -69,7 +69,7 @@ User.MOCK_USER = new User("mock-user");
69
69
  * See the License for the specific language governing permissions and
70
70
  * limitations under the License.
71
71
  */
72
- let R = "11.6.1-firebase-studio-sdk-integration.226be0bb1";
72
+ let R = "11.6.1-firebase-studio-sdk-integration.9de25069c";
73
73
 
74
74
  /**
75
75
  * @license
@@ -223,7 +223,7 @@ e) {
223
223
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
224
224
  * See the License for the specific language governing permissions and
225
225
  * limitations under the License.
226
- */ const V = "ok", p = "cancelled", y = "unknown", g = "invalid-argument", w = "deadline-exceeded", F = "not-found", v = "already-exists", b = "permission-denied", D = "unauthenticated", C = "resource-exhausted", S = "failed-precondition", N = "aborted", O = "out-of-range", q = "unimplemented", B = "internal", $ = "unavailable", Q = "data-loss";
226
+ */ const V = "ok", p = "cancelled", y = "unknown", g = "invalid-argument", w = "deadline-exceeded", F = "not-found", v = "already-exists", D = "permission-denied", b = "unauthenticated", C = "resource-exhausted", S = "failed-precondition", N = "aborted", O = "out-of-range", q = "unimplemented", B = "internal", $ = "unavailable", Q = "data-loss";
227
227
 
228
228
  /** An error returned by a Firestore operation. */ class FirestoreError extends _ {
229
229
  /** @hideconstructor */
@@ -1143,7 +1143,9 @@ class __PRIVATE_RestConnection {
1143
1143
  "google-cloud-resource-prefix": this.R,
1144
1144
  "x-goog-request-params": this.I
1145
1145
  };
1146
- return this.F(a, n, i), this.v(t, o, a, r, this.databaseInfo.isUsingEmulator).then((e => (__PRIVATE_logDebug(x, `Received RPC '${t}' ${s}: `, e),
1146
+ this.F(a, n, i);
1147
+ const {host: u} = new URL(o), _ = c(u);
1148
+ return this.v(t, o, a, r, _).then((e => (__PRIVATE_logDebug(x, `Received RPC '${t}' ${s}: `, e),
1147
1149
  e)), (e => {
1148
1150
  throw __PRIVATE_logWarn(x, `RPC '${t}' ${s} failed with error: `, e, "url: ", o, "request:", r),
1149
1151
  e;
@@ -1241,11 +1243,11 @@ function __PRIVATE_mapCodeFromHttpStatus(t) {
1241
1243
  // return Code.OUT_OF_RANGE;
1242
1244
  case 401:
1243
1245
  // Unauthorized
1244
- return D;
1246
+ return b;
1245
1247
 
1246
1248
  case 403:
1247
1249
  // Forbidden
1248
- return b;
1250
+ return D;
1249
1251
 
1250
1252
  case 404:
1251
1253
  // Not Found
@@ -1334,7 +1336,7 @@ class __PRIVATE_FetchConnection extends __PRIVATE_RestConnection {
1334
1336
  headers: r,
1335
1337
  body: o
1336
1338
  };
1337
- c(new URL(e).host) && i && (t.credentials = "include"), a = await fetch(e, t);
1339
+ i && (t.credentials = "include"), a = await fetch(e, t);
1338
1340
  } catch (t) {
1339
1341
  const e = t;
1340
1342
  throw new FirestoreError(__PRIVATE_mapCodeFromHttpStatus(e.status), "Request failed with error: " + e.statusText);
@@ -4101,13 +4103,13 @@ class __PRIVATE_ExponentialBackoff {
4101
4103
  }
4102
4104
  /** Invokes the provided RPC with auth and AppCheck tokens. */ V(t, e, r, n) {
4103
4105
  return this.rt(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([i, s]) => this.connection.V(t, __PRIVATE_toResourcePath(e, r), n, i, s))).catch((t => {
4104
- throw "FirebaseError" === t.name ? (t.code === D && (this.authCredentials.invalidateToken(),
4106
+ throw "FirebaseError" === t.name ? (t.code === b && (this.authCredentials.invalidateToken(),
4105
4107
  this.appCheckCredentials.invalidateToken()), t) : new FirestoreError(y, t.toString());
4106
4108
  }));
4107
4109
  }
4108
4110
  /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ D(t, e, r, n, i) {
4109
4111
  return this.rt(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, o]) => this.connection.D(t, __PRIVATE_toResourcePath(e, r), n, s, o, i))).catch((t => {
4110
- throw "FirebaseError" === t.name ? (t.code === D && (this.authCredentials.invalidateToken(),
4112
+ throw "FirebaseError" === t.name ? (t.code === b && (this.authCredentials.invalidateToken(),
4111
4113
  this.appCheckCredentials.invalidateToken()), t) : new FirestoreError(y, t.toString());
4112
4114
  }));
4113
4115
  }
@@ -7057,13 +7059,13 @@ class __PRIVATE_TransactionRunner {
7057
7059
  case $:
7058
7060
  // Unauthenticated means something went wrong with our token and we need
7059
7061
  // to retry with new credentials which will happen automatically.
7060
- case D:
7062
+ case b:
7061
7063
  return !1;
7062
7064
 
7063
7065
  case g:
7064
7066
  case F:
7065
7067
  case v:
7066
- case b:
7068
+ case D:
7067
7069
  case S:
7068
7070
  // Aborted might be retried in some scenarios, but that is dependent on
7069
7071
  // the context and should handled individually by the calling code.
@@ -7214,10 +7216,10 @@ class __PRIVATE_AsyncQueueImpl {
7214
7216
  constructor(t = Promise.resolve()) {
7215
7217
  // A list of retryable operations. Retryable operations are run in order and
7216
7218
  // retried with backoff.
7217
- this.bt = [],
7219
+ this.Dt = [],
7218
7220
  // Is this AsyncQueue being shut down? Once it is set to true, it will not
7219
7221
  // be changed again.
7220
- this.Dt = !1,
7222
+ this.bt = !1,
7221
7223
  // Operations scheduled to be queued in the future. Operations are
7222
7224
  // automatically removed after they are run or canceled.
7223
7225
  this.Ct = [],
@@ -7244,7 +7246,7 @@ class __PRIVATE_AsyncQueueImpl {
7244
7246
  e && "function" == typeof e.addEventListener && e.addEventListener("visibilitychange", this.Bt);
7245
7247
  }
7246
7248
  get isShuttingDown() {
7247
- return this.Dt;
7249
+ return this.bt;
7248
7250
  }
7249
7251
  /**
7250
7252
  * Adds a new operation to the queue without waiting for it to complete (i.e.
@@ -7259,33 +7261,33 @@ class __PRIVATE_AsyncQueueImpl {
7259
7261
  this.kt(t);
7260
7262
  }
7261
7263
  enterRestrictedMode(t) {
7262
- if (!this.Dt) {
7263
- this.Dt = !0, this.Ot = t || !1;
7264
+ if (!this.bt) {
7265
+ this.bt = !0, this.Ot = t || !1;
7264
7266
  const e = getDocument();
7265
7267
  e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.Bt);
7266
7268
  }
7267
7269
  }
7268
7270
  enqueue(t) {
7269
- if (this.Qt(), this.Dt)
7271
+ if (this.Qt(), this.bt)
7270
7272
  // Return a Promise which never resolves.
7271
7273
  return new Promise((() => {}));
7272
7274
  // Create a deferred Promise that we can return to the callee. This
7273
7275
  // allows us to return a "hanging Promise" only to the callee and still
7274
7276
  // advance the queue even when the operation is not run.
7275
7277
  const e = new __PRIVATE_Deferred;
7276
- return this.kt((() => this.Dt && this.Ot ? Promise.resolve() : (t().then(e.resolve, e.reject),
7278
+ return this.kt((() => this.bt && this.Ot ? Promise.resolve() : (t().then(e.resolve, e.reject),
7277
7279
  e.promise))).then((() => e.promise));
7278
7280
  }
7279
7281
  enqueueRetryable(t) {
7280
- this.enqueueAndForget((() => (this.bt.push(t), this.Lt())));
7282
+ this.enqueueAndForget((() => (this.Dt.push(t), this.Lt())));
7281
7283
  }
7282
7284
  /**
7283
7285
  * Runs the next operation from the retryable queue. If the operation fails,
7284
7286
  * reschedules with backoff.
7285
7287
  */ async Lt() {
7286
- if (0 !== this.bt.length) {
7288
+ if (0 !== this.Dt.length) {
7287
7289
  try {
7288
- await this.bt[0](), this.bt.shift(), this.Vt.reset();
7290
+ await this.Dt[0](), this.Dt.shift(), this.Vt.reset();
7289
7291
  } catch (t) {
7290
7292
  if (!
7291
7293
  /**
@@ -7313,7 +7315,7 @@ class __PRIVATE_AsyncQueueImpl {
7313
7315
  // Failure will be handled by AsyncQueue
7314
7316
  __PRIVATE_logDebug(dt, "Operation failed with retryable error: " + t);
7315
7317
  }
7316
- this.bt.length > 0 &&
7318
+ this.Dt.length > 0 &&
7317
7319
  // If there are additional operations, we re-schedule `retryNextOp()`.
7318
7320
  // This is necessary to run retryable operations that failed during
7319
7321
  // their initial attempt since we don't know whether they are already