@firebase/rules-unit-testing 2.0.1-canary.85d2c4d29 → 2.0.1-canary.d3041d875
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/dist/index.cjs.js +8 -8
- package/package.json +4 -4
package/dist/index.cjs.js
CHANGED
|
@@ -154,7 +154,7 @@ function makeUrl(hostAndPort, path) {
|
|
|
154
154
|
* @private
|
|
155
155
|
*/
|
|
156
156
|
function discoverEmulators(hub, fetch) {
|
|
157
|
-
if (fetch === void 0) { fetch = fetch__default[
|
|
157
|
+
if (fetch === void 0) { fetch = fetch__default["default"]; }
|
|
158
158
|
return __awaiter(this, void 0, void 0, function () {
|
|
159
159
|
var res, emulators, data;
|
|
160
160
|
return __generator(this, function (_a) {
|
|
@@ -341,7 +341,7 @@ var RulesTestEnvironmentImpl = /** @class */ (function () {
|
|
|
341
341
|
case 0:
|
|
342
342
|
this.checkNotDestroyed();
|
|
343
343
|
assertEmulatorRunning(this.emulators, 'firestore');
|
|
344
|
-
return [4 /*yield*/, fetch__default[
|
|
344
|
+
return [4 /*yield*/, fetch__default["default"](makeUrl(this.emulators.firestore, "/emulator/v1/projects/" + this.projectId + "/databases/(default)/documents"), {
|
|
345
345
|
method: 'DELETE'
|
|
346
346
|
})];
|
|
347
347
|
case 1:
|
|
@@ -457,7 +457,7 @@ var RulesTestContextImpl = /** @class */ (function () {
|
|
|
457
457
|
'return a Promise that resolves when the operations are done.');
|
|
458
458
|
}
|
|
459
459
|
if (!this.app) {
|
|
460
|
-
this.app = firebase__default[
|
|
460
|
+
this.app = firebase__default["default"].initializeApp({ projectId: this.projectId }, "_Firebase_RulesUnitTesting_" + Date.now() + "_" + Math.random());
|
|
461
461
|
}
|
|
462
462
|
return this.app;
|
|
463
463
|
};
|
|
@@ -504,7 +504,7 @@ function loadDatabaseRules(hostAndPort, databaseName, rules) {
|
|
|
504
504
|
case 0:
|
|
505
505
|
url = makeUrl(hostAndPort, '/.settings/rules.json');
|
|
506
506
|
url.searchParams.append('ns', databaseName);
|
|
507
|
-
return [4 /*yield*/, fetch__default[
|
|
507
|
+
return [4 /*yield*/, fetch__default["default"](url, {
|
|
508
508
|
method: 'PUT',
|
|
509
509
|
headers: { Authorization: 'Bearer owner' },
|
|
510
510
|
body: rules
|
|
@@ -528,7 +528,7 @@ function loadFirestoreRules(hostAndPort, projectId, rules) {
|
|
|
528
528
|
var resp, _a;
|
|
529
529
|
return __generator(this, function (_b) {
|
|
530
530
|
switch (_b.label) {
|
|
531
|
-
case 0: return [4 /*yield*/, fetch__default[
|
|
531
|
+
case 0: return [4 /*yield*/, fetch__default["default"](makeUrl(hostAndPort, "/emulator/v1/projects/" + projectId + ":securityRules"), {
|
|
532
532
|
method: 'PUT',
|
|
533
533
|
body: JSON.stringify({
|
|
534
534
|
rules: {
|
|
@@ -555,7 +555,7 @@ function loadStorageRules(hostAndPort, rules) {
|
|
|
555
555
|
var resp, _a;
|
|
556
556
|
return __generator(this, function (_b) {
|
|
557
557
|
switch (_b.label) {
|
|
558
|
-
case 0: return [4 /*yield*/, fetch__default[
|
|
558
|
+
case 0: return [4 /*yield*/, fetch__default["default"](makeUrl(hostAndPort, '/internal/setRules'), {
|
|
559
559
|
method: 'PUT',
|
|
560
560
|
headers: {
|
|
561
561
|
'Content-Type': 'application/json'
|
|
@@ -715,7 +715,7 @@ function withFunctionTriggersDisabled(fnOrHub, maybeFn) {
|
|
|
715
715
|
}
|
|
716
716
|
hub.host = fixHostname(hub.host);
|
|
717
717
|
makeUrl(hub, '/functions/disableBackgroundTriggers');
|
|
718
|
-
return [4 /*yield*/, fetch__default[
|
|
718
|
+
return [4 /*yield*/, fetch__default["default"](makeUrl(hub, '/functions/disableBackgroundTriggers'), {
|
|
719
719
|
method: 'PUT'
|
|
720
720
|
})];
|
|
721
721
|
case 1:
|
|
@@ -731,7 +731,7 @@ function withFunctionTriggersDisabled(fnOrHub, maybeFn) {
|
|
|
731
731
|
case 3:
|
|
732
732
|
result = _a.sent();
|
|
733
733
|
return [3 /*break*/, 6];
|
|
734
|
-
case 4: return [4 /*yield*/, fetch__default[
|
|
734
|
+
case 4: return [4 /*yield*/, fetch__default["default"](makeUrl(hub, '/functions/enableBackgroundTriggers'), {
|
|
735
735
|
method: 'PUT'
|
|
736
736
|
})];
|
|
737
737
|
case 5:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firebase/rules-unit-testing",
|
|
3
|
-
"version": "2.0.1-canary.
|
|
3
|
+
"version": "2.0.1-canary.d3041d875",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
},
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"rollup": "2.
|
|
23
|
+
"rollup": "2.57.0",
|
|
24
24
|
"rollup-plugin-typescript2": "0.30.0"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"firebase": "9.1.0-canary.
|
|
27
|
+
"firebase": "9.1.0-canary.d3041d875"
|
|
28
28
|
},
|
|
29
29
|
"repository": {
|
|
30
30
|
"directory": "packages/rules-unit-testing",
|
|
@@ -36,6 +36,6 @@
|
|
|
36
36
|
"url": "https://github.com/firebase/firebase-js-sdk/issues"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"node-fetch": "2.6.
|
|
39
|
+
"node-fetch": "2.6.5"
|
|
40
40
|
}
|
|
41
41
|
}
|