@firebase/remote-config 0.3.8-canary.f43b2b467 → 0.3.9-20220609194004

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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # @firebase/remote-config
2
2
 
3
+ ## 0.3.9-20220609194004
4
+
5
+ ### Patch Changes
6
+
7
+ - [`2cd1cc76f`](https://github.com/firebase/firebase-js-sdk/commit/2cd1cc76f2a308135cd60f424fe09084a34b5cb5) [#6307](https://github.com/firebase/firebase-js-sdk/pull/6307) (fixes [#6300](https://github.com/firebase/firebase-js-sdk/issues/6300)) - fix: add type declarations to exports field
8
+
9
+ - Updated dependencies [[`2cd1cc76f`](https://github.com/firebase/firebase-js-sdk/commit/2cd1cc76f2a308135cd60f424fe09084a34b5cb5)]:
10
+ - @firebase/app@0.7.26-20220609194004
11
+ - @firebase/component@0.5.15-20220609194004
12
+ - @firebase/installations@0.5.10-20220609194004
13
+ - @firebase/logger@0.3.3-20220609194004
14
+ - @firebase/util@1.6.1-20220609194004
15
+
3
16
  ## 0.3.8
4
17
 
5
18
  ### Patch Changes
@@ -6,7 +6,7 @@ import { __awaiter, __generator, __assign } from 'tslib';
6
6
  import '@firebase/installations';
7
7
 
8
8
  var name = "@firebase/remote-config";
9
- var version = "0.3.8-canary.f43b2b467";
9
+ var version = "0.3.9-20220609194004";
10
10
 
11
11
  /**
12
12
  * @license
@@ -577,16 +577,17 @@ var RestClient = /** @class */ (function () {
577
577
  * @throws a {@link ErrorCode.FETCH_STATUS} error if the service returns an HTTP error status.
578
578
  */
579
579
  RestClient.prototype.fetch = function (request) {
580
+ var _a, _b, _c;
580
581
  return __awaiter(this, void 0, void 0, function () {
581
- var _a, installationId, installationToken, urlBase, url, headers, requestBody, options, fetchPromise, timeoutPromise, response, originalError_1, errorCode, status, responseEtag, config, state, responseBody, originalError_2;
582
- return __generator(this, function (_b) {
583
- switch (_b.label) {
582
+ var _d, installationId, installationToken, urlBase, url, headers, requestBody, options, fetchPromise, timeoutPromise, response, originalError_1, errorCode, status, responseEtag, config, state, responseBody, originalError_2;
583
+ return __generator(this, function (_e) {
584
+ switch (_e.label) {
584
585
  case 0: return [4 /*yield*/, Promise.all([
585
586
  this.firebaseInstallations.getId(),
586
587
  this.firebaseInstallations.getToken()
587
588
  ])];
588
589
  case 1:
589
- _a = _b.sent(), installationId = _a[0], installationToken = _a[1];
590
+ _d = _e.sent(), installationId = _d[0], installationToken = _d[1];
590
591
  urlBase = window.FIREBASE_REMOTE_CONFIG_URL_BASE ||
591
592
  'https://firebaseremoteconfig.googleapis.com';
592
593
  url = urlBase + "/v1/projects/" + this.projectId + "/namespaces/" + this.namespace + ":fetch?key=" + this.apiKey;
@@ -621,46 +622,46 @@ var RestClient = /** @class */ (function () {
621
622
  reject(error);
622
623
  });
623
624
  });
624
- _b.label = 2;
625
+ _e.label = 2;
625
626
  case 2:
626
- _b.trys.push([2, 5, , 6]);
627
+ _e.trys.push([2, 5, , 6]);
627
628
  return [4 /*yield*/, Promise.race([fetchPromise, timeoutPromise])];
628
629
  case 3:
629
- _b.sent();
630
+ _e.sent();
630
631
  return [4 /*yield*/, fetchPromise];
631
632
  case 4:
632
- response = _b.sent();
633
+ response = _e.sent();
633
634
  return [3 /*break*/, 6];
634
635
  case 5:
635
- originalError_1 = _b.sent();
636
+ originalError_1 = _e.sent();
636
637
  errorCode = "fetch-client-network" /* FETCH_NETWORK */;
637
- if (originalError_1.name === 'AbortError') {
638
+ if (((_a = originalError_1) === null || _a === void 0 ? void 0 : _a.name) === 'AbortError') {
638
639
  errorCode = "fetch-timeout" /* FETCH_TIMEOUT */;
639
640
  }
640
641
  throw ERROR_FACTORY.create(errorCode, {
641
- originalErrorMessage: originalError_1.message
642
+ originalErrorMessage: (_b = originalError_1) === null || _b === void 0 ? void 0 : _b.message
642
643
  });
643
644
  case 6:
644
645
  status = response.status;
645
646
  responseEtag = response.headers.get('ETag') || undefined;
646
647
  if (!(response.status === 200)) return [3 /*break*/, 11];
647
648
  responseBody = void 0;
648
- _b.label = 7;
649
+ _e.label = 7;
649
650
  case 7:
650
- _b.trys.push([7, 9, , 10]);
651
+ _e.trys.push([7, 9, , 10]);
651
652
  return [4 /*yield*/, response.json()];
652
653
  case 8:
653
- responseBody = _b.sent();
654
+ responseBody = _e.sent();
654
655
  return [3 /*break*/, 10];
655
656
  case 9:
656
- originalError_2 = _b.sent();
657
+ originalError_2 = _e.sent();
657
658
  throw ERROR_FACTORY.create("fetch-client-parse" /* FETCH_PARSE */, {
658
- originalErrorMessage: originalError_2.message
659
+ originalErrorMessage: (_c = originalError_2) === null || _c === void 0 ? void 0 : _c.message
659
660
  });
660
661
  case 10:
661
662
  config = responseBody['entries'];
662
663
  state = responseBody['state'];
663
- _b.label = 11;
664
+ _e.label = 11;
664
665
  case 11:
665
666
  // Normalizes based on legacy state.
666
667
  if (state === 'INSTANCE_STATE_UNSPECIFIED') {
@@ -929,9 +930,10 @@ var RemoteConfig = /** @class */ (function () {
929
930
  * Converts an error event associated with a {@link IDBRequest} to a {@link FirebaseError}.
930
931
  */
931
932
  function toFirebaseError(event, errorCode) {
933
+ var _a;
932
934
  var originalError = event.target.error || undefined;
933
935
  return ERROR_FACTORY.create(errorCode, {
934
- originalErrorMessage: originalError && originalError.message
936
+ originalErrorMessage: originalError && ((_a = originalError) === null || _a === void 0 ? void 0 : _a.message)
935
937
  });
936
938
  }
937
939
  /**
@@ -950,6 +952,7 @@ var DB_VERSION = 1;
950
952
  // Visible for testing.
951
953
  function openDatabase() {
952
954
  return new Promise(function (resolve, reject) {
955
+ var _a;
953
956
  try {
954
957
  var request = indexedDB.open(DB_NAME, DB_VERSION);
955
958
  request.onerror = function (event) {
@@ -975,7 +978,7 @@ function openDatabase() {
975
978
  }
976
979
  catch (error) {
977
980
  reject(ERROR_FACTORY.create("storage-open" /* STORAGE_OPEN */, {
978
- originalErrorMessage: error
981
+ originalErrorMessage: (_a = error) === null || _a === void 0 ? void 0 : _a.message
979
982
  }));
980
983
  }
981
984
  });
@@ -1047,6 +1050,7 @@ var Storage = /** @class */ (function () {
1047
1050
  case 1:
1048
1051
  db = _a.sent();
1049
1052
  return [2 /*return*/, new Promise(function (resolve, reject) {
1053
+ var _a;
1050
1054
  var transaction = db.transaction([APP_NAMESPACE_STORE], 'readonly');
1051
1055
  var objectStore = transaction.objectStore(APP_NAMESPACE_STORE);
1052
1056
  var compositeKey = _this.createCompositeKey(key);
@@ -1067,7 +1071,7 @@ var Storage = /** @class */ (function () {
1067
1071
  }
1068
1072
  catch (e) {
1069
1073
  reject(ERROR_FACTORY.create("storage-get" /* STORAGE_GET */, {
1070
- originalErrorMessage: e && e.message
1074
+ originalErrorMessage: (_a = e) === null || _a === void 0 ? void 0 : _a.message
1071
1075
  }));
1072
1076
  }
1073
1077
  })];
@@ -1085,6 +1089,7 @@ var Storage = /** @class */ (function () {
1085
1089
  case 1:
1086
1090
  db = _a.sent();
1087
1091
  return [2 /*return*/, new Promise(function (resolve, reject) {
1092
+ var _a;
1088
1093
  var transaction = db.transaction([APP_NAMESPACE_STORE], 'readwrite');
1089
1094
  var objectStore = transaction.objectStore(APP_NAMESPACE_STORE);
1090
1095
  var compositeKey = _this.createCompositeKey(key);
@@ -1102,7 +1107,7 @@ var Storage = /** @class */ (function () {
1102
1107
  }
1103
1108
  catch (e) {
1104
1109
  reject(ERROR_FACTORY.create("storage-set" /* STORAGE_SET */, {
1105
- originalErrorMessage: e && e.message
1110
+ originalErrorMessage: (_a = e) === null || _a === void 0 ? void 0 : _a.message
1106
1111
  }));
1107
1112
  }
1108
1113
  })];
@@ -1120,6 +1125,7 @@ var Storage = /** @class */ (function () {
1120
1125
  case 1:
1121
1126
  db = _a.sent();
1122
1127
  return [2 /*return*/, new Promise(function (resolve, reject) {
1128
+ var _a;
1123
1129
  var transaction = db.transaction([APP_NAMESPACE_STORE], 'readwrite');
1124
1130
  var objectStore = transaction.objectStore(APP_NAMESPACE_STORE);
1125
1131
  var compositeKey = _this.createCompositeKey(key);
@@ -1134,7 +1140,7 @@ var Storage = /** @class */ (function () {
1134
1140
  }
1135
1141
  catch (e) {
1136
1142
  reject(ERROR_FACTORY.create("storage-delete" /* STORAGE_DELETE */, {
1137
- originalErrorMessage: e && e.message
1143
+ originalErrorMessage: (_a = e) === null || _a === void 0 ? void 0 : _a.message
1138
1144
  }));
1139
1145
  }
1140
1146
  })];