@firebase/app-check 0.5.11 → 0.5.12

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,11 @@
1
1
  # @firebase/app-check
2
2
 
3
+ ## 0.5.12
4
+
5
+ ### Patch Changes
6
+
7
+ - [`f36d627af`](https://github.com/firebase/firebase-js-sdk/commit/f36d627af6e1f5ed98e21f9be29f59d2c8c503cb) [#6439](https://github.com/firebase/firebase-js-sdk/pull/6439) - Fix logic to trigger app check throttling
8
+
3
9
  ## 0.5.11
4
10
 
5
11
  ### Patch Changes
@@ -1063,7 +1063,7 @@ function internalFactory(appCheck) {
1063
1063
  }
1064
1064
 
1065
1065
  var name = "@firebase/app-check";
1066
- var version = "0.5.11";
1066
+ var version = "0.5.12";
1067
1067
 
1068
1068
  /**
1069
1069
  * @license
@@ -1241,11 +1241,11 @@ var ReCaptchaV3Provider = /** @class */ (function () {
1241
1241
  * @internal
1242
1242
  */
1243
1243
  ReCaptchaV3Provider.prototype.getToken = function () {
1244
- var _a;
1244
+ var _a, _b;
1245
1245
  return __awaiter(this, void 0, void 0, function () {
1246
1246
  var attestedClaimsToken, result, e_1;
1247
- return __generator(this, function (_b) {
1248
- switch (_b.label) {
1247
+ return __generator(this, function (_c) {
1248
+ switch (_c.label) {
1249
1249
  case 0:
1250
1250
  throwIfThrottled(this._throttleData);
1251
1251
  return [4 /*yield*/, getToken$1(this._app).catch(function (_e) {
@@ -1253,18 +1253,18 @@ var ReCaptchaV3Provider = /** @class */ (function () {
1253
1253
  throw ERROR_FACTORY.create("recaptcha-error" /* RECAPTCHA_ERROR */);
1254
1254
  })];
1255
1255
  case 1:
1256
- attestedClaimsToken = _b.sent();
1257
- _b.label = 2;
1256
+ attestedClaimsToken = _c.sent();
1257
+ _c.label = 2;
1258
1258
  case 2:
1259
- _b.trys.push([2, 4, , 5]);
1259
+ _c.trys.push([2, 4, , 5]);
1260
1260
  return [4 /*yield*/, exchangeToken(getExchangeRecaptchaV3TokenRequest(this._app, attestedClaimsToken), this._heartbeatServiceProvider)];
1261
1261
  case 3:
1262
- result = _b.sent();
1262
+ result = _c.sent();
1263
1263
  return [3 /*break*/, 5];
1264
1264
  case 4:
1265
- e_1 = _b.sent();
1266
- if (e_1.code === "fetch-status-error" /* FETCH_STATUS_ERROR */) {
1267
- this._throttleData = setBackoff(Number((_a = e_1.customData) === null || _a === void 0 ? void 0 : _a.httpStatus), this._throttleData);
1265
+ e_1 = _c.sent();
1266
+ if ((_a = e_1.code) === null || _a === void 0 ? void 0 : _a.includes("fetch-status-error" /* FETCH_STATUS_ERROR */)) {
1267
+ this._throttleData = setBackoff(Number((_b = e_1.customData) === null || _b === void 0 ? void 0 : _b.httpStatus), this._throttleData);
1268
1268
  throw ERROR_FACTORY.create("throttled" /* THROTTLED */, {
1269
1269
  time: getDurationString(this._throttleData.allowRequestsAfter - Date.now()),
1270
1270
  httpStatus: this._throttleData.httpStatus
@@ -1328,11 +1328,11 @@ var ReCaptchaEnterpriseProvider = /** @class */ (function () {
1328
1328
  * @internal
1329
1329
  */
1330
1330
  ReCaptchaEnterpriseProvider.prototype.getToken = function () {
1331
- var _a;
1331
+ var _a, _b;
1332
1332
  return __awaiter(this, void 0, void 0, function () {
1333
1333
  var attestedClaimsToken, result, e_2;
1334
- return __generator(this, function (_b) {
1335
- switch (_b.label) {
1334
+ return __generator(this, function (_c) {
1335
+ switch (_c.label) {
1336
1336
  case 0:
1337
1337
  throwIfThrottled(this._throttleData);
1338
1338
  return [4 /*yield*/, getToken$1(this._app).catch(function (_e) {
@@ -1340,18 +1340,18 @@ var ReCaptchaEnterpriseProvider = /** @class */ (function () {
1340
1340
  throw ERROR_FACTORY.create("recaptcha-error" /* RECAPTCHA_ERROR */);
1341
1341
  })];
1342
1342
  case 1:
1343
- attestedClaimsToken = _b.sent();
1344
- _b.label = 2;
1343
+ attestedClaimsToken = _c.sent();
1344
+ _c.label = 2;
1345
1345
  case 2:
1346
- _b.trys.push([2, 4, , 5]);
1346
+ _c.trys.push([2, 4, , 5]);
1347
1347
  return [4 /*yield*/, exchangeToken(getExchangeRecaptchaEnterpriseTokenRequest(this._app, attestedClaimsToken), this._heartbeatServiceProvider)];
1348
1348
  case 3:
1349
- result = _b.sent();
1349
+ result = _c.sent();
1350
1350
  return [3 /*break*/, 5];
1351
1351
  case 4:
1352
- e_2 = _b.sent();
1353
- if (e_2.code === "fetch-status-error" /* FETCH_STATUS_ERROR */) {
1354
- this._throttleData = setBackoff(Number((_a = e_2.customData) === null || _a === void 0 ? void 0 : _a.httpStatus), this._throttleData);
1352
+ e_2 = _c.sent();
1353
+ if ((_a = e_2.code) === null || _a === void 0 ? void 0 : _a.includes("fetch-status-error" /* FETCH_STATUS_ERROR */)) {
1354
+ this._throttleData = setBackoff(Number((_b = e_2.customData) === null || _b === void 0 ? void 0 : _b.httpStatus), this._throttleData);
1355
1355
  throw ERROR_FACTORY.create("throttled" /* THROTTLED */, {
1356
1356
  time: getDurationString(this._throttleData.allowRequestsAfter - Date.now()),
1357
1357
  httpStatus: this._throttleData.httpStatus