firebase-rest-firestore 1.6.0 → 1.6.3

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.
@@ -584,13 +584,10 @@ class FirestoreClient {
584
584
  }
585
585
  const url = `${(0, path_1.getFirestoreBasePath)(this.config.projectId, this.config.databaseId, this.config)}/${collectionName}/${documentId}`;
586
586
  const firestoreData = (0, converter_1.convertToFirestoreDocument)(data);
587
- const token = await this.getToken();
587
+ const headers = await this.prepareHeaders();
588
588
  const response = await fetch(url, {
589
589
  method: "PATCH",
590
- headers: {
591
- "Content-Type": "application/json",
592
- Authorization: `Bearer ${token}`,
593
- },
590
+ headers,
594
591
  body: JSON.stringify(firestoreData),
595
592
  });
596
593
  if (!response.ok) {
@@ -580,13 +580,10 @@ export class FirestoreClient {
580
580
  }
581
581
  const url = `${getFirestoreBasePath(this.config.projectId, this.config.databaseId, this.config)}/${collectionName}/${documentId}`;
582
582
  const firestoreData = convertToFirestoreDocument(data);
583
- const token = await this.getToken();
583
+ const headers = await this.prepareHeaders();
584
584
  const response = await fetch(url, {
585
585
  method: "PATCH",
586
- headers: {
587
- "Content-Type": "application/json",
588
- Authorization: `Bearer ${token}`,
589
- },
586
+ headers,
590
587
  body: JSON.stringify(firestoreData),
591
588
  });
592
589
  if (!response.ok) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firebase-rest-firestore",
3
- "version": "1.6.0",
3
+ "version": "1.6.3",
4
4
  "description": "Firebase Firestore REST API client for Edge runtime environments",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -23,7 +23,7 @@
23
23
  "emulator:start": "cd test/emulator && firebase emulators:start -P demo-test-project",
24
24
  "emulator:stop": "npx kill-port -y 4089 8089 9089",
25
25
  "test": "vitest",
26
- "test:unit": "vitest run test/converter.test.ts test/references.test.ts test/field-value.test.ts",
26
+ "test:unit": "vitest run test/converter.test.ts test/references.test.ts test/field-value.test.ts test/request-headers.test.ts",
27
27
  "test:emulator": "bash test/scripts/test-with-emulator.sh"
28
28
  },
29
29
  "keywords": [
@@ -39,17 +39,17 @@
39
39
  "author": "",
40
40
  "license": "MIT",
41
41
  "dependencies": {
42
- "jose": "^4.14.4"
42
+ "jose": "^6.2.10"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@semantic-release/changelog": "^6.0.3",
46
46
  "@semantic-release/git": "^10.0.1",
47
- "@types/node": "^18.16.0",
47
+ "@types/node": "^26.1.1",
48
48
  "concurrently": "^8.2.2",
49
- "dotenv": "^16.4.7",
50
- "semantic-release": "^24.2.3",
51
- "typescript": "^5.0.4",
52
- "vitest": "^3.0.9"
49
+ "dotenv": "^17.4.2",
50
+ "semantic-release": "25.0.8",
51
+ "typescript": "^7.0.2",
52
+ "vitest": "^4.1.11"
53
53
  },
54
54
  "engines": {
55
55
  "node": ">=20.8.1"