@open-xamu-co/firebase-nuxt 1.1.0 → 1.1.1-next.2
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 +60 -0
- package/README.md +0 -2
- package/dist/module.json +1 -1
- package/dist/runtime/functions/utils/event.js +1 -1
- package/dist/runtime/functions/utils/firebase.d.ts +2 -2
- package/dist/runtime/functions/utils/firebase.js +6 -1
- package/dist/runtime/functions/utils/search.js +2 -2
- package/dist/runtime/functions/utils/slugs.js +1 -1
- package/dist/runtime/server/api/all-collection-document.get.d.ts +1 -1
- package/dist/runtime/server/api/all-collection-document.get.js +3 -3
- package/dist/runtime/server/api/all-collection.get.js +3 -3
- package/dist/runtime/server/api/media.get.js +3 -3
- package/dist/runtime/server/utils/firestore.d.ts +1 -1
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
Firebase nuxt
|
|
2
2
|
|
|
3
|
+
## [1.1.1-next.2](https://github.com/xamu-co/firebase-nuxt/compare/v1.1.1-next.1...v1.1.1-next.2) (2026-01-10)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* handle get app errors on get firebase helper ([3e6f7f1](https://github.com/xamu-co/firebase-nuxt/commit/3e6f7f1c35bc2b23595d6e5ce01755b8da9a8efc))
|
|
9
|
+
|
|
10
|
+
## [1.1.1-next.1](https://github.com/xamu-co/firebase-nuxt/compare/v1.1.0...v1.1.1-next.1) (2026-01-10)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* resolve firebase deploy sdk compatibility ([fd7df17](https://github.com/xamu-co/firebase-nuxt/commit/fd7df1779f772ddcc0ebd868a70f82633491d7ca))
|
|
16
|
+
* validate instance first ([7726ce7](https://github.com/xamu-co/firebase-nuxt/commit/7726ce71c80f0c3840c529a210871bf248dfec5f))
|
|
17
|
+
|
|
3
18
|
# [1.1.0](https://github.com/xamu-co/firebase-nuxt/compare/v1.0.0...v1.1.0) (2026-01-08)
|
|
4
19
|
|
|
5
20
|
|
|
@@ -15,6 +30,51 @@ Firebase nuxt
|
|
|
15
30
|
* conditional media handler ([d472288](https://github.com/xamu-co/firebase-nuxt/commit/d4722881de6b4b7238e3bcc3fd31378dd8fb1489))
|
|
16
31
|
* get instance documents & files ([4846801](https://github.com/xamu-co/firebase-nuxt/commit/4846801d6b80fb95fde8475943ef872351ba43ac))
|
|
17
32
|
|
|
33
|
+
# [1.0.0-next.5](https://github.com/xamu-co/firebase-nuxt/compare/v1.0.0-next.4...v1.0.0-next.5) (2026-01-08)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Bug Fixes
|
|
37
|
+
|
|
38
|
+
* remove problematic schema ([c53c195](https://github.com/xamu-co/firebase-nuxt/commit/c53c1952d5713e75479d4d32d99645d5fccb9a1f))
|
|
39
|
+
|
|
40
|
+
# [1.0.0-next.4](https://github.com/xamu-co/firebase-nuxt/compare/v1.0.0-next.3...v1.0.0-next.4) (2026-01-08)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Bug Fixes
|
|
44
|
+
|
|
45
|
+
* include missing distributables ([a455111](https://github.com/xamu-co/firebase-nuxt/commit/a455111cb9500bc5755590cdd45da4b6e46f8ee3))
|
|
46
|
+
|
|
47
|
+
# [1.0.0-next.3](https://github.com/xamu-co/firebase-nuxt/compare/v1.0.0-next.2...v1.0.0-next.3) (2026-01-08)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
### Bug Fixes
|
|
51
|
+
|
|
52
|
+
* make stable ([38ba0fe](https://github.com/xamu-co/firebase-nuxt/commit/38ba0fea5aa365c9c5354df566d3181a3e716d5c))
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
### Features
|
|
56
|
+
|
|
57
|
+
* conditional media handler ([d472288](https://github.com/xamu-co/firebase-nuxt/commit/d4722881de6b4b7238e3bcc3fd31378dd8fb1489))
|
|
58
|
+
|
|
59
|
+
# [1.0.0-next.2](https://github.com/xamu-co/firebase-nuxt/compare/v1.0.0-next.1...v1.0.0-next.2) (2026-01-08)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
### Features
|
|
63
|
+
|
|
64
|
+
* get instance documents & files ([4846801](https://github.com/xamu-co/firebase-nuxt/commit/4846801d6b80fb95fde8475943ef872351ba43ac))
|
|
65
|
+
|
|
66
|
+
# 1.0.0-next.1 (2026-01-08)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
### Bug Fixes
|
|
70
|
+
|
|
71
|
+
* include upload worker ([00facd4](https://github.com/xamu-co/firebase-nuxt/commit/00facd4048c90f6f363b61c452175c48b7e92bfa))
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
### Features
|
|
75
|
+
|
|
76
|
+
* initial commit ([a3e9a1d](https://github.com/xamu-co/firebase-nuxt/commit/a3e9a1d81d2b947216c0c2c1d48f03bdd4c3acb7))
|
|
77
|
+
|
|
18
78
|
# 1.0.0 (2026-01-08)
|
|
19
79
|
|
|
20
80
|
|
package/README.md
CHANGED
|
@@ -36,8 +36,6 @@ yarn build
|
|
|
36
36
|
|
|
37
37
|
## Extras
|
|
38
38
|
|
|
39
|
-
Due to an [issue with volar](https://github.com/vuejs/language-tools/issues/5018#issuecomment-2495098549), typescript version is fixed at @5.6.3
|
|
40
|
-
|
|
41
39
|
Firebase requires 2 keys, the private one from recaptcha, and the site key from recaptcha enterprise. The former one is passed from the config file.
|
|
42
40
|
|
|
43
41
|
For app check create the key from Recaptcha v3 console instead of enterprise to avoid issues with legacy keys validation. The debug token allows bypassing the validation on dev environments
|
package/dist/module.json
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { omit } from "lodash-es";
|
|
2
1
|
import {
|
|
3
2
|
onDocumentDeleted,
|
|
4
3
|
onDocumentCreated,
|
|
@@ -6,6 +5,7 @@ import {
|
|
|
6
5
|
} from "firebase-functions/v2/firestore";
|
|
7
6
|
import { onSchedule as onScheduleV2 } from "firebase-functions/v2/scheduler";
|
|
8
7
|
import { onTaskDispatched } from "firebase-functions/tasks";
|
|
8
|
+
import omit from "lodash-es/omit.js";
|
|
9
9
|
import { getFirebase } from "./firebase.js";
|
|
10
10
|
import { makeFunctionsLogger } from "./logger.js";
|
|
11
11
|
function getDocumentPath(collectionPath) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type AppOptions } from "firebase-admin/app";
|
|
1
|
+
import { type App, type AppOptions } from "firebase-admin/app";
|
|
2
2
|
export declare function getFirebase(at?: string, appOptions?: AppOptions): {
|
|
3
|
-
firebaseApp:
|
|
3
|
+
firebaseApp: App;
|
|
4
4
|
firebaseFirestore: FirebaseFirestore.Firestore;
|
|
5
5
|
firebaseAuth: import("firebase-admin/auth").Auth;
|
|
6
6
|
firebaseStorage: import("firebase-admin/storage").Storage;
|
|
@@ -5,7 +5,12 @@ import { getStorage } from "firebase-admin/storage";
|
|
|
5
5
|
export function getFirebase(at = "Unknown", appOptions) {
|
|
6
6
|
if (import.meta.client) throw new Error("This function is only available in server context");
|
|
7
7
|
try {
|
|
8
|
-
|
|
8
|
+
let firebaseApp;
|
|
9
|
+
try {
|
|
10
|
+
firebaseApp = getApps().length ? getApp() : initializeApp(appOptions);
|
|
11
|
+
} catch (err) {
|
|
12
|
+
firebaseApp = initializeApp(appOptions);
|
|
13
|
+
}
|
|
9
14
|
const firebaseFirestore = getFirestore(firebaseApp);
|
|
10
15
|
const firebaseAuth = getAuth(firebaseApp);
|
|
11
16
|
const firebaseStorage = getStorage();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import words from "lodash-es/words";
|
|
2
|
-
import deburr from "lodash-es/deburr";
|
|
1
|
+
import words from "lodash-es/words.js";
|
|
2
|
+
import deburr from "lodash-es/deburr.js";
|
|
3
3
|
export function getWords(phrase) {
|
|
4
4
|
return words(deburr(phrase.toUpperCase())).map((word) => word.replace(/[^a-z0-9]/gi, ""));
|
|
5
5
|
}
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @auth guest
|
|
5
5
|
*/
|
|
6
|
-
declare const _default: import("../types/index.js").CachedEventHandler<import("h3").EventHandlerRequest, Promise<void |
|
|
6
|
+
declare const _default: import("../types/index.js").CachedEventHandler<import("h3").EventHandlerRequest, Promise<void | FirebaseFirestore.DocumentData>>;
|
|
7
7
|
export default _default;
|
|
@@ -24,13 +24,13 @@ export default defineConditionallyCachedEventHandler(
|
|
|
24
24
|
}
|
|
25
25
|
let collectionRef = firebaseFirestore.collection(collectionId);
|
|
26
26
|
if (event.path.startsWith("/api/instance/all")) {
|
|
27
|
-
if (!
|
|
27
|
+
if (!currentInstanceRef) {
|
|
28
|
+
throw createError({ statusCode: 401, statusMessage: "Missing instance" });
|
|
29
|
+
} else if (!readInstanceCollection(collectionId, event.context)) {
|
|
28
30
|
throw createError({
|
|
29
31
|
statusCode: 401,
|
|
30
32
|
statusMessage: `Can't get "instance/${collectionId}" document`
|
|
31
33
|
});
|
|
32
|
-
} else if (!currentInstanceRef) {
|
|
33
|
-
throw createError({ statusCode: 401, statusMessage: "Missing instance" });
|
|
34
34
|
}
|
|
35
35
|
collectionRef = currentInstanceRef.collection(collectionId);
|
|
36
36
|
} else if (!readCollection(collectionId, event.context)) {
|
|
@@ -26,13 +26,13 @@ export default defineConditionallyCachedEventHandler(
|
|
|
26
26
|
}
|
|
27
27
|
let query = firebaseFirestore.collection(collectionId);
|
|
28
28
|
if (event.path.startsWith("/api/instance/all")) {
|
|
29
|
-
if (!
|
|
29
|
+
if (!currentInstanceRef) {
|
|
30
|
+
throw createError({ statusCode: 401, statusMessage: "Missing instance" });
|
|
31
|
+
} else if (!readInstanceCollection(collectionId, event.context)) {
|
|
30
32
|
throw createError({
|
|
31
33
|
statusCode: 401,
|
|
32
34
|
statusMessage: `Can't list "instance/${collectionId}"`
|
|
33
35
|
});
|
|
34
|
-
} else if (!currentInstanceRef) {
|
|
35
|
-
throw createError({ statusCode: 401, statusMessage: "Missing instance" });
|
|
36
36
|
}
|
|
37
37
|
query = currentInstanceRef.collection(collectionId);
|
|
38
38
|
} else if (!readCollection(collectionId, event.context)) {
|
|
@@ -29,13 +29,13 @@ const cachedBufferHandler = defineCachedFunction(
|
|
|
29
29
|
const [baseAndExtension] = path.split("?");
|
|
30
30
|
const [, collectionId, , fileOrSubCollectionId] = baseAndExtension.split("/");
|
|
31
31
|
if (collectionId === "instances" && !fileOrSubCollectionId.includes(".")) {
|
|
32
|
-
if (!
|
|
32
|
+
if (!currentInstanceRef) {
|
|
33
|
+
throw createError({ statusCode: 401, statusMessage: "Missing instance" });
|
|
34
|
+
} else if (!readInstanceCollection(fileOrSubCollectionId, event.context)) {
|
|
33
35
|
throw createError({
|
|
34
36
|
statusCode: 401,
|
|
35
37
|
statusMessage: `Can't get "instance/${fileOrSubCollectionId}" file`
|
|
36
38
|
});
|
|
37
|
-
} else if (!currentInstanceRef) {
|
|
38
|
-
throw createError({ statusCode: 401, statusMessage: "Missing instance" });
|
|
39
39
|
}
|
|
40
40
|
} else if (!readCollection(collectionId, event.context)) {
|
|
41
41
|
throw createError({
|
|
@@ -10,7 +10,7 @@ export declare function debugFirebaseServer<T extends EventHandlerRequest>(event
|
|
|
10
10
|
/**
|
|
11
11
|
* This one is used on api endpoints
|
|
12
12
|
*/
|
|
13
|
-
export declare function resolveServerDocumentRefs<T extends PseudoNode, R extends FirebaseDocument = FirebaseDocument>(event: H3Event, snapshot?: DocumentSnapshot<T>, collection?: string, withAuth?: boolean): Promise<R | undefined>;
|
|
13
|
+
export declare function resolveServerDocumentRefs<T extends PseudoNode, R extends FirebaseDocument = FirebaseDocument>(event: H3Event, snapshot?: DocumentSnapshot<T, R>, collection?: string, withAuth?: boolean): Promise<R | undefined>;
|
|
14
14
|
/**
|
|
15
15
|
* Resolve general refs
|
|
16
16
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-xamu-co/firebase-nuxt",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1-next.2",
|
|
4
4
|
"description": "Nuxt 3 module for the xamu project",
|
|
5
5
|
"author": "@xamu-co",
|
|
6
6
|
"type": "module",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"@pinia/nuxt": "^0.11.0",
|
|
91
91
|
"firebase": "^11.0.2",
|
|
92
92
|
"firebase-admin": "^13.6.0",
|
|
93
|
-
"firebase-functions": "^
|
|
93
|
+
"firebase-functions": "^7.0.3",
|
|
94
94
|
"lodash-es": "^4.17.21",
|
|
95
95
|
"nuxt-csurf": "^1.6.5",
|
|
96
96
|
"pinia": "^3.0.2",
|
|
@@ -160,5 +160,6 @@
|
|
|
160
160
|
},
|
|
161
161
|
"browserslist": [
|
|
162
162
|
"defaults"
|
|
163
|
-
]
|
|
163
|
+
],
|
|
164
|
+
"stableVersion": "1.1.0"
|
|
164
165
|
}
|