mirror of
https://github.com/hanzoai/firebase-js-sdk.git
synced 2026-09-24 16:59:10 +00:00
chore(deps): Remove "request" dependency (#10174)
This commit is contained in:
committed by
GitHub
parent
f39f48f8ea
commit
165df7a1f2
@@ -79,7 +79,6 @@
|
||||
"@types/mocha": "9.1.1",
|
||||
"@types/mz": "2.7.8",
|
||||
"@types/node": "18.19.83",
|
||||
"@types/request": "2.48.12",
|
||||
"@types/sinon": "9.0.11",
|
||||
"@types/sinon-chai": "3.2.12",
|
||||
"@types/tmp": "0.2.6",
|
||||
@@ -140,7 +139,6 @@
|
||||
"postinstall-postinstall": "2.1.0",
|
||||
"prettier": "3.9.4",
|
||||
"protobufjs-cli": "^1.1.3",
|
||||
"request": "2.88.2",
|
||||
"rollup": "4.62.2",
|
||||
"rollup-plugin-license": "3.7.1",
|
||||
"semver": "7.7.1",
|
||||
|
||||
@@ -38,22 +38,23 @@ export class DatabaseEmulator extends Emulator {
|
||||
this.namespace = namespace;
|
||||
}
|
||||
|
||||
setPublicRules(): Promise<number> {
|
||||
async setPublicRules(): Promise<number> {
|
||||
const jsonRules = JSON.stringify(rulesJSON);
|
||||
console.log(`Setting rule ${jsonRules} to emulator ...`);
|
||||
return new Promise<number>((resolve, reject) => {
|
||||
request.put(
|
||||
{
|
||||
uri: `http://localhost:${this.port}/.settings/rules.json?ns=${this.namespace}`,
|
||||
headers: { Authorization: 'Bearer owner' },
|
||||
body: jsonRules
|
||||
const response = await fetch(
|
||||
`http://localhost:${this.port}/.settings/rules.json?ns=${this.namespace}`,
|
||||
{
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'Authorization': 'Bearer owner',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
(error, response, body) => {
|
||||
if (error) reject(error);
|
||||
console.log(`Done setting public rule to emulator: ${body}.`);
|
||||
resolve(response.statusCode);
|
||||
}
|
||||
);
|
||||
});
|
||||
body: jsonRules,
|
||||
signal: AbortSignal.timeout(10000)
|
||||
}
|
||||
);
|
||||
const body = await response.text();
|
||||
console.log(`Done setting public rule to emulator: ${body}.`);
|
||||
return response.status;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3731,16 +3731,6 @@
|
||||
resolved "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz#50ae4353eaaddc04044279812f52c8c65857dbcb"
|
||||
integrity sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==
|
||||
|
||||
"@types/[email protected]":
|
||||
version "2.48.12"
|
||||
resolved "https://registry.npmjs.org/@types/request/-/request-2.48.12.tgz#0f590f615a10f87da18e9790ac94c29ec4c5ef30"
|
||||
integrity sha512-G3sY+NpsA9jnwm0ixhAFQSJ3Q9JkpLZpJbI3GMv0mIAT0y3mRabYeINzal5WOChIiaTEGQYlHOKgkaM9EisWHw==
|
||||
dependencies:
|
||||
"@types/caseless" "*"
|
||||
"@types/node" "*"
|
||||
"@types/tough-cookie" "*"
|
||||
form-data "^2.5.0"
|
||||
|
||||
"@types/request@^2.48.8":
|
||||
version "2.48.13"
|
||||
resolved "https://registry.npmjs.org/@types/request/-/request-2.48.13.tgz#abdf4256524e801ea8fdda54320f083edb5a6b80"
|
||||
@@ -8301,16 +8291,6 @@ [email protected], form-data@^4.0.5:
|
||||
hasown "^2.0.2"
|
||||
mime-types "^2.1.12"
|
||||
|
||||
form-data@^2.5.0:
|
||||
version "2.5.2"
|
||||
resolved "https://registry.npmjs.org/form-data/-/form-data-2.5.2.tgz#dc653743d1de2fcc340ceea38079daf6e9069fd2"
|
||||
integrity sha512-GgwY0PS7DbXqajuGf4OYlsrIu3zgxD6Vvql43IBhm6MahqA5SK/7mwhtNj2AdH2z35YR34ujJ7BN+3fFC3jP5Q==
|
||||
dependencies:
|
||||
asynckit "^0.4.0"
|
||||
combined-stream "^1.0.6"
|
||||
mime-types "^2.1.12"
|
||||
safe-buffer "^5.2.1"
|
||||
|
||||
form-data@^2.5.5:
|
||||
version "2.5.6"
|
||||
resolved "https://registry.npmjs.org/form-data/-/form-data-2.5.6.tgz#ef39b3d99e2fc9f25420c0db7962fe36cafcd244"
|
||||
@@ -14784,7 +14764,7 @@ replacestream@^4.0.3:
|
||||
object-assign "^4.0.1"
|
||||
readable-stream "^2.0.2"
|
||||
|
||||
[email protected], request@^2.88.0, request@^2.88.2:
|
||||
request@^2.88.0, request@^2.88.2:
|
||||
version "2.88.2"
|
||||
resolved "https://registry.npmjs.org/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3"
|
||||
integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==
|
||||
|
||||
Reference in New Issue
Block a user