@idevconn/create-icore 0.9.3 → 0.10.1
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/cli.js +755 -190
- package/dist/index.cjs +778 -213
- package/dist/index.js +771 -206
- package/package.json +4 -4
- package/templates/.yarn/releases/{yarn-4.16.0.cjs → yarn-4.17.0.cjs} +326 -326
- package/templates/.yarnrc.yml +1 -1
- package/templates/apps/api/package.json +6 -6
- package/templates/apps/microservices/auth/package.json +4 -4
- package/templates/apps/microservices/jobs/package.json +5 -5
- package/templates/apps/microservices/notes/package.json +5 -5
- package/templates/apps/microservices/payment/package.json +4 -4
- package/templates/apps/microservices/upload/package.json +6 -6
- package/templates/apps/templates/client-antd/package.json +2 -2
- package/templates/apps/templates/client-mui/package.json +4 -4
- package/templates/apps/templates/client-shadcn/package.json +7 -7
- package/templates/apps/templates/client-shadcn/src/components/ui/button.tsx +1 -2
- package/templates/libs/auth-client/package.json +3 -3
- package/templates/libs/auth-strategies/firebase/package.json +5 -4
- package/templates/libs/auth-strategies/firebase/src/lib/firebase-auth.module.ts +2 -1
- package/templates/libs/auth-strategies/mongodb/package.json +4 -4
- package/templates/libs/auth-strategies/supabase/package.json +5 -5
- package/templates/libs/db-strategies/firestore/package.json +5 -4
- package/templates/libs/db-strategies/firestore/src/lib/firestore-db.module.ts +2 -1
- package/templates/libs/db-strategies/mongodb/package.json +3 -3
- package/templates/libs/db-strategies/supabase/package.json +5 -5
- package/templates/libs/firebase-admin/package.json +2 -2
- package/templates/libs/firebase-admin/src/lib/__tests__/firebase-admin.unit.test.ts +11 -11
- package/templates/libs/firebase-admin/src/lib/firebase-admin.ts +6 -6
- package/templates/libs/jobs-client/package.json +4 -4
- package/templates/libs/notes-client/package.json +3 -3
- package/templates/libs/payment-client/package.json +3 -3
- package/templates/libs/shared/package.json +2 -2
- package/templates/libs/storage-strategies/cloudinary/package.json +4 -4
- package/templates/libs/storage-strategies/firebase/package.json +5 -4
- package/templates/libs/storage-strategies/firebase/src/lib/firebase-storage.module.ts +4 -1
- package/templates/libs/storage-strategies/mongodb/package.json +3 -3
- package/templates/libs/storage-strategies/supabase/package.json +5 -5
- package/templates/libs/template-shared/package.json +8 -8
- package/templates/libs/upload-client/package.json +3 -3
- package/templates/libs/vite-plugins/package.json +3 -3
- package/templates/package.json +32 -32
- package/templates/tools/create-icore/_template-shell/package.json +32 -32
package/templates/.yarnrc.yml
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
"private": true,
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@types/express": "^5.0.6",
|
|
7
|
-
"@types/multer": "
|
|
7
|
+
"@types/multer": "^2.1.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@bull-board/api": "^7.1
|
|
11
|
-
"@bull-board/express": "^7.1
|
|
10
|
+
"@bull-board/api": "^7.2.1",
|
|
11
|
+
"@bull-board/express": "^7.2.1",
|
|
12
12
|
"@casl/ability": "^7.0.0",
|
|
13
13
|
"@icore/auth-client": "*",
|
|
14
14
|
"@icore/jobs-client": "*",
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"@icore/shared": "*",
|
|
18
18
|
"@icore/upload-client": "*",
|
|
19
19
|
"@idevconn/payment": "^1.2.0",
|
|
20
|
-
"@nestjs/common": "^11.1.
|
|
20
|
+
"@nestjs/common": "^11.1.27",
|
|
21
21
|
"@nestjs/config": "^4.0.4",
|
|
22
|
-
"@nestjs/core": "^11.1.
|
|
23
|
-
"@nestjs/platform-express": "^11.1.
|
|
22
|
+
"@nestjs/core": "^11.1.27",
|
|
23
|
+
"@nestjs/platform-express": "^11.1.27",
|
|
24
24
|
"@nestjs/swagger": "^11.4.4",
|
|
25
25
|
"@nestjs/throttler": "^6.5.0",
|
|
26
26
|
"cookie-parser": "^1.4.7",
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
"@icore/auth-supabase": "*",
|
|
8
8
|
"@icore/firebase-admin": "*",
|
|
9
9
|
"@icore/shared": "*",
|
|
10
|
-
"@nestjs/common": "^11.1.
|
|
10
|
+
"@nestjs/common": "^11.1.27",
|
|
11
11
|
"@nestjs/config": "^4.0.4",
|
|
12
|
-
"@nestjs/core": "^11.1.
|
|
13
|
-
"@nestjs/microservices": "^11.1.
|
|
14
|
-
"@supabase/supabase-js": "^2.
|
|
12
|
+
"@nestjs/core": "^11.1.27",
|
|
13
|
+
"@nestjs/microservices": "^11.1.27",
|
|
14
|
+
"@supabase/supabase-js": "^2.108.2",
|
|
15
15
|
"reflect-metadata": "^0.2.2",
|
|
16
16
|
"rxjs": "^7.8.2",
|
|
17
17
|
"tslib": "^2.8.1"
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
"private": true,
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@icore/shared": "*",
|
|
7
|
-
"@nestjs/common": "^11.1.
|
|
7
|
+
"@nestjs/common": "^11.1.27",
|
|
8
8
|
"@nestjs/config": "^4.0.4",
|
|
9
|
-
"@nestjs/core": "^11.1.
|
|
10
|
-
"bullmq": "^5.
|
|
11
|
-
"ioredis": "^5.11.
|
|
9
|
+
"@nestjs/core": "^11.1.27",
|
|
10
|
+
"bullmq": "^5.79.1",
|
|
11
|
+
"ioredis": "^5.11.1",
|
|
12
12
|
"reflect-metadata": "^0.2.2",
|
|
13
13
|
"rxjs": "^7.8.2",
|
|
14
|
-
"tslib": "^2.
|
|
14
|
+
"tslib": "^2.8.1"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
"@icore/db-supabase": "*",
|
|
8
8
|
"@icore/firebase-admin": "*",
|
|
9
9
|
"@icore/shared": "*",
|
|
10
|
-
"@nestjs/common": "^11.1.
|
|
10
|
+
"@nestjs/common": "^11.1.27",
|
|
11
11
|
"@nestjs/config": "^4.0.4",
|
|
12
|
-
"@nestjs/core": "^11.1.
|
|
13
|
-
"@nestjs/microservices": "^11.1.
|
|
14
|
-
"@supabase/supabase-js": "^2.
|
|
12
|
+
"@nestjs/core": "^11.1.27",
|
|
13
|
+
"@nestjs/microservices": "^11.1.27",
|
|
14
|
+
"@supabase/supabase-js": "^2.108.2",
|
|
15
15
|
"reflect-metadata": "^0.2.2",
|
|
16
16
|
"rxjs": "^7.8.2",
|
|
17
|
-
"tslib": "^2.
|
|
17
|
+
"tslib": "^2.8.1"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@icore/shared": "*",
|
|
7
7
|
"@idevconn/payment": "^1.2.0",
|
|
8
|
-
"@nestjs/common": "^11.1.
|
|
8
|
+
"@nestjs/common": "^11.1.27",
|
|
9
9
|
"@nestjs/config": "^4.0.4",
|
|
10
|
-
"@nestjs/core": "^11.1.
|
|
11
|
-
"@nestjs/microservices": "^11.1.
|
|
10
|
+
"@nestjs/core": "^11.1.27",
|
|
11
|
+
"@nestjs/microservices": "^11.1.27",
|
|
12
12
|
"reflect-metadata": "^0.2.2",
|
|
13
13
|
"rxjs": "^7.8.2",
|
|
14
|
-
"tslib": "^2.
|
|
14
|
+
"tslib": "^2.8.1"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
"@icore/storage-cloudinary": "*",
|
|
9
9
|
"@icore/storage-firebase": "*",
|
|
10
10
|
"@icore/storage-supabase": "*",
|
|
11
|
-
"@nestjs/common": "^11.1.
|
|
11
|
+
"@nestjs/common": "^11.1.27",
|
|
12
12
|
"@nestjs/config": "^4.0.4",
|
|
13
|
-
"@nestjs/core": "^11.1.
|
|
14
|
-
"@nestjs/microservices": "^11.1.
|
|
15
|
-
"@supabase/supabase-js": "^2.
|
|
16
|
-
"cloudinary": "^2.
|
|
13
|
+
"@nestjs/core": "^11.1.27",
|
|
14
|
+
"@nestjs/microservices": "^11.1.27",
|
|
15
|
+
"@supabase/supabase-js": "^2.108.2",
|
|
16
|
+
"cloudinary": "^2.10.0",
|
|
17
17
|
"reflect-metadata": "^0.2.2",
|
|
18
18
|
"rxjs": "^7.8.2",
|
|
19
|
-
"tslib": "^2.
|
|
19
|
+
"tslib": "^2.8.1"
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
"version": "0.0.1",
|
|
4
4
|
"private": true,
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@emotion/react": "^11",
|
|
7
|
-
"@emotion/styled": "^11",
|
|
8
|
-
"@mui/icons-material": "^6",
|
|
9
|
-
"@mui/material": "^6"
|
|
6
|
+
"@emotion/react": "^11.14.0",
|
|
7
|
+
"@emotion/styled": "^11.14.1",
|
|
8
|
+
"@mui/icons-material": "^6.5.0",
|
|
9
|
+
"@mui/material": "^6.5.0"
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
"version": "0.0.1",
|
|
4
4
|
"private": true,
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@radix-ui/react-dialog": "^1.1.
|
|
7
|
-
"@radix-ui/react-dropdown-menu": "^2.1.
|
|
8
|
-
"@radix-ui/react-label": "^2.1.
|
|
9
|
-
"@radix-ui/react-slot": "^1.
|
|
10
|
-
"@tailwindcss/vite": "^4.3.
|
|
6
|
+
"@radix-ui/react-dialog": "^1.1.17",
|
|
7
|
+
"@radix-ui/react-dropdown-menu": "^2.1.18",
|
|
8
|
+
"@radix-ui/react-label": "^2.1.10",
|
|
9
|
+
"@radix-ui/react-slot": "^1.3.0",
|
|
10
|
+
"@tailwindcss/vite": "^4.3.1",
|
|
11
11
|
"class-variance-authority": "^0.7.1",
|
|
12
12
|
"clsx": "^2.1.1",
|
|
13
|
-
"lucide-react": "^1.
|
|
13
|
+
"lucide-react": "^1.21.0",
|
|
14
14
|
"sonner": "^2.0.7",
|
|
15
15
|
"tailwind-merge": "^3.6.0",
|
|
16
|
-
"tailwindcss": "^4"
|
|
16
|
+
"tailwindcss": "^4.3.1"
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -32,8 +32,7 @@ const buttonVariants = cva(
|
|
|
32
32
|
);
|
|
33
33
|
|
|
34
34
|
export interface ButtonProps
|
|
35
|
-
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
36
|
-
VariantProps<typeof buttonVariants> {
|
|
35
|
+
extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
37
36
|
asChild?: boolean;
|
|
38
37
|
}
|
|
39
38
|
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
"types": "./src/index.ts",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@icore/shared": "*",
|
|
10
|
-
"@nestjs/common": "^11.1.
|
|
11
|
-
"@nestjs/microservices": "^11.1.
|
|
10
|
+
"@nestjs/common": "^11.1.27",
|
|
11
|
+
"@nestjs/microservices": "^11.1.27",
|
|
12
12
|
"rxjs": "^7.8.2",
|
|
13
|
-
"tslib": "^2.
|
|
13
|
+
"tslib": "^2.8.1"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -8,12 +8,13 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@icore/firebase-admin": "*",
|
|
10
10
|
"@icore/shared": "*",
|
|
11
|
-
"@nestjs/common": "^11.1.
|
|
11
|
+
"@nestjs/common": "^11.1.27",
|
|
12
12
|
"@nestjs/config": "^4.0.4",
|
|
13
|
-
"
|
|
13
|
+
"firebase-admin": "^14.1.0",
|
|
14
|
+
"tslib": "^2.8.1"
|
|
14
15
|
},
|
|
15
16
|
"devDependencies": {
|
|
16
|
-
"@nestjs/testing": "^11.
|
|
17
|
-
"vitest": "^4.
|
|
17
|
+
"@nestjs/testing": "^11.1.27",
|
|
18
|
+
"vitest": "^4.1.9"
|
|
18
19
|
}
|
|
19
20
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Module, DynamicModule } from '@nestjs/common';
|
|
2
2
|
import { ConfigService } from '@nestjs/config';
|
|
3
3
|
import { getFirebaseAdmin, FIREBASE_ADMIN_REQUIRED_ENV } from '@icore/firebase-admin';
|
|
4
|
+
import { getAuth } from 'firebase-admin/auth';
|
|
4
5
|
import { buildStrategyWithFallback, FakeAuthStrategy } from '@icore/shared';
|
|
5
6
|
import type { AuthStrategy } from '@icore/shared';
|
|
6
7
|
import { FirebaseAuthStrategy } from './firebase-auth.strategy';
|
|
@@ -28,7 +29,7 @@ export class FirebaseAuthModule {
|
|
|
28
29
|
const identityToolkit = new HttpIdentityToolkitClient(
|
|
29
30
|
cfg.getOrThrow<string>('FIREBASE_WEB_API_KEY'),
|
|
30
31
|
);
|
|
31
|
-
return new FirebaseAuthStrategy({ identityToolkit, adminAuth: app
|
|
32
|
+
return new FirebaseAuthStrategy({ identityToolkit, adminAuth: getAuth(app) });
|
|
32
33
|
},
|
|
33
34
|
fake: () => new FakeAuthStrategy(),
|
|
34
35
|
}),
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@icore/shared": "*",
|
|
14
|
-
"@nestjs/common": "^11.1.
|
|
14
|
+
"@nestjs/common": "^11.1.27",
|
|
15
15
|
"@nestjs/config": "^4.0.4",
|
|
16
16
|
"@nestjs/mongoose": "^11.0.4",
|
|
17
17
|
"bcrypt": "^6.0.0",
|
|
18
|
-
"jsonwebtoken": "^9.0.
|
|
18
|
+
"jsonwebtoken": "^9.0.3",
|
|
19
19
|
"mongodb-memory-server": "^11.2.0",
|
|
20
|
-
"mongoose": "^9.
|
|
21
|
-
"tslib": "^2.
|
|
20
|
+
"mongoose": "^9.7.2",
|
|
21
|
+
"tslib": "^2.8.1"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
"types": "./src/index.ts",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@icore/shared": "*",
|
|
10
|
-
"@nestjs/common": "^11.1.
|
|
10
|
+
"@nestjs/common": "^11.1.27",
|
|
11
11
|
"@nestjs/config": "^4.0.4",
|
|
12
|
-
"@supabase/supabase-js": "^2.
|
|
13
|
-
"tslib": "^2.
|
|
12
|
+
"@supabase/supabase-js": "^2.108.2",
|
|
13
|
+
"tslib": "^2.8.1"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@nestjs/testing": "^11.
|
|
17
|
-
"vitest": "^4.
|
|
16
|
+
"@nestjs/testing": "^11.1.27",
|
|
17
|
+
"vitest": "^4.1.9"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -8,12 +8,13 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@icore/firebase-admin": "*",
|
|
10
10
|
"@icore/shared": "*",
|
|
11
|
-
"@nestjs/common": "^11.1.
|
|
11
|
+
"@nestjs/common": "^11.1.27",
|
|
12
12
|
"@nestjs/config": "^4.0.4",
|
|
13
|
-
"
|
|
13
|
+
"firebase-admin": "^14.1.0",
|
|
14
|
+
"tslib": "^2.8.1"
|
|
14
15
|
},
|
|
15
16
|
"devDependencies": {
|
|
16
|
-
"@nestjs/testing": "^11.
|
|
17
|
-
"vitest": "^4.
|
|
17
|
+
"@nestjs/testing": "^11.1.27",
|
|
18
|
+
"vitest": "^4.1.9"
|
|
18
19
|
}
|
|
19
20
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Module, DynamicModule } from '@nestjs/common';
|
|
2
2
|
import { ConfigService } from '@nestjs/config';
|
|
3
3
|
import { getFirebaseAdmin, FIREBASE_ADMIN_REQUIRED_ENV } from '@icore/firebase-admin';
|
|
4
|
+
import { getFirestore } from 'firebase-admin/firestore';
|
|
4
5
|
import { buildStrategyWithFallback, FakeDBStrategy } from '@icore/shared';
|
|
5
6
|
import type { DBStrategy } from '@icore/shared';
|
|
6
7
|
import { FirestoreDBStrategy } from './firestore-db.strategy';
|
|
@@ -25,7 +26,7 @@ export class FirestoreDbModule {
|
|
|
25
26
|
build: () => {
|
|
26
27
|
const app = getFirebaseAdmin(cfg);
|
|
27
28
|
return new FirestoreDBStrategy({
|
|
28
|
-
db: app
|
|
29
|
+
db: getFirestore(app) as unknown as ConstructorParameters<
|
|
29
30
|
typeof FirestoreDBStrategy
|
|
30
31
|
>[0]['db'],
|
|
31
32
|
});
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
"types": "./src/index.d.ts",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@icore/shared": "*",
|
|
10
|
-
"@nestjs/common": "^11.1.
|
|
10
|
+
"@nestjs/common": "^11.1.27",
|
|
11
11
|
"@nestjs/config": "^4.0.4",
|
|
12
12
|
"@nestjs/mongoose": "^11.0.4",
|
|
13
13
|
"mongodb-memory-server": "^11.2.0",
|
|
14
|
-
"mongoose": "^9.
|
|
15
|
-
"tslib": "^2.
|
|
14
|
+
"mongoose": "^9.7.2",
|
|
15
|
+
"tslib": "^2.8.1"
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
"types": "./src/index.ts",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@icore/shared": "*",
|
|
10
|
-
"@nestjs/common": "^11.1.
|
|
10
|
+
"@nestjs/common": "^11.1.27",
|
|
11
11
|
"@nestjs/config": "^4.0.4",
|
|
12
|
-
"@supabase/supabase-js": "^2.
|
|
13
|
-
"tslib": "^2.
|
|
12
|
+
"@supabase/supabase-js": "^2.108.2",
|
|
13
|
+
"tslib": "^2.8.1"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@nestjs/testing": "^11.
|
|
17
|
-
"vitest": "^4.
|
|
16
|
+
"@nestjs/testing": "^11.1.27",
|
|
17
|
+
"vitest": "^4.1.9"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
2
|
|
|
3
|
-
const { apps, cert, initializeApp,
|
|
3
|
+
const { apps, cert, initializeApp, getApp, getApps } = vi.hoisted(() => {
|
|
4
4
|
const apps: unknown[] = [];
|
|
5
5
|
return {
|
|
6
6
|
apps,
|
|
@@ -10,17 +10,16 @@ const { apps, cert, initializeApp, app } = vi.hoisted(() => {
|
|
|
10
10
|
apps.push(created);
|
|
11
11
|
return created;
|
|
12
12
|
}),
|
|
13
|
-
|
|
13
|
+
getApp: vi.fn(() => apps[0]),
|
|
14
|
+
getApps: vi.fn(() => apps),
|
|
14
15
|
};
|
|
15
16
|
});
|
|
16
17
|
|
|
17
|
-
vi.mock('firebase-admin', () => ({
|
|
18
|
-
|
|
19
|
-
return apps;
|
|
20
|
-
},
|
|
21
|
-
app,
|
|
18
|
+
vi.mock('firebase-admin/app', () => ({
|
|
19
|
+
cert,
|
|
22
20
|
initializeApp,
|
|
23
|
-
|
|
21
|
+
getApp,
|
|
22
|
+
getApps,
|
|
24
23
|
}));
|
|
25
24
|
|
|
26
25
|
import { FIREBASE_ADMIN_REQUIRED_ENV, getFirebaseAdmin } from '../firebase-admin';
|
|
@@ -59,7 +58,8 @@ describe('getFirebaseAdmin', () => {
|
|
|
59
58
|
apps.length = 0;
|
|
60
59
|
cert.mockClear();
|
|
61
60
|
initializeApp.mockClear();
|
|
62
|
-
|
|
61
|
+
getApp.mockClear();
|
|
62
|
+
getApps.mockClear();
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
afterEach(() => vi.restoreAllMocks());
|
|
@@ -94,12 +94,12 @@ describe('getFirebaseAdmin', () => {
|
|
|
94
94
|
expect(sa['private_key']).not.toContain('\\n');
|
|
95
95
|
});
|
|
96
96
|
|
|
97
|
-
it('initializes the default app only once (guards on
|
|
97
|
+
it('initializes the default app only once (guards on getApps)', () => {
|
|
98
98
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
99
99
|
const cfg = makeCfg() as any;
|
|
100
100
|
getFirebaseAdmin(cfg);
|
|
101
101
|
getFirebaseAdmin(cfg);
|
|
102
102
|
expect(initializeApp).toHaveBeenCalledTimes(1);
|
|
103
|
-
expect(
|
|
103
|
+
expect(getApp).toHaveBeenCalledTimes(1); // second call returns the existing app
|
|
104
104
|
});
|
|
105
105
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { initializeApp, getApps, getApp, cert, App, ServiceAccount } from 'firebase-admin/app';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Minimal structural view of NestJS's `ConfigService` — just the two readers
|
|
@@ -46,11 +46,11 @@ export const FIREBASE_ADMIN_REQUIRED_ENV = [
|
|
|
46
46
|
* tokens from project_id/client_email/private_key, but feeding the complete
|
|
47
47
|
* downloaded JSON keeps the code aligned with the documented FB_ADMIN_* env.
|
|
48
48
|
*/
|
|
49
|
-
export function getFirebaseAdmin(cfg: FirebaseConfigReader):
|
|
50
|
-
if (
|
|
49
|
+
export function getFirebaseAdmin(cfg: FirebaseConfigReader): App {
|
|
50
|
+
if (getApps().length > 0) return getApp();
|
|
51
51
|
|
|
52
|
-
return
|
|
53
|
-
credential:
|
|
52
|
+
return initializeApp({
|
|
53
|
+
credential: cert({
|
|
54
54
|
type: cfg.getOrThrow<string>('FB_ADMIN_TYPE'),
|
|
55
55
|
project_id: cfg.getOrThrow<string>('FB_ADMIN_PROJECT_ID'),
|
|
56
56
|
private_key_id: cfg.getOrThrow<string>('FB_ADMIN_PRIVATE_KEY_ID'),
|
|
@@ -62,7 +62,7 @@ export function getFirebaseAdmin(cfg: FirebaseConfigReader): admin.app.App {
|
|
|
62
62
|
auth_provider_x509_cert_url: cfg.getOrThrow<string>('FB_ADMIN_AUTH_PROVIDER_X509_CERT_URL'),
|
|
63
63
|
client_x509_cert_url: cfg.getOrThrow<string>('FB_ADMIN_CLIENT_X509_CERT_URL'),
|
|
64
64
|
universe_domain: cfg.getOrThrow<string>('FB_ADMIN_UNIVERSE_DOMAIN'),
|
|
65
|
-
} as
|
|
65
|
+
} as ServiceAccount),
|
|
66
66
|
// Optional: the storage MS also passes the bucket name explicitly to
|
|
67
67
|
// .bucket(); set here too so admin.storage().bucket() (no arg) works.
|
|
68
68
|
storageBucket: cfg.get<string>('FIREBASE_STORAGE_BUCKET'),
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
"types": "./src/index.ts",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@icore/shared": "*",
|
|
10
|
-
"@nestjs/common": "^11.1.
|
|
10
|
+
"@nestjs/common": "^11.1.27",
|
|
11
11
|
"@nestjs/config": "^4.0.4",
|
|
12
|
-
"bullmq": "^5.
|
|
13
|
-
"ioredis": "^5.
|
|
14
|
-
"tslib": "^2.
|
|
12
|
+
"bullmq": "^5.79.1",
|
|
13
|
+
"ioredis": "^5.11.1",
|
|
14
|
+
"tslib": "^2.8.1"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
"types": "./src/index.ts",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@icore/shared": "*",
|
|
10
|
-
"@nestjs/common": "^11.1.
|
|
11
|
-
"@nestjs/microservices": "^11.1.
|
|
10
|
+
"@nestjs/common": "^11.1.27",
|
|
11
|
+
"@nestjs/microservices": "^11.1.27",
|
|
12
12
|
"rxjs": "^7.8.2",
|
|
13
|
-
"tslib": "^2.
|
|
13
|
+
"tslib": "^2.8.1"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@icore/shared": "*",
|
|
10
10
|
"@idevconn/payment": "^1.2.0",
|
|
11
|
-
"@nestjs/common": "^11.1.
|
|
12
|
-
"@nestjs/microservices": "^11.1.
|
|
11
|
+
"@nestjs/common": "^11.1.27",
|
|
12
|
+
"@nestjs/microservices": "^11.1.27",
|
|
13
13
|
"rxjs": "^7.8.2",
|
|
14
|
-
"tslib": "^2.
|
|
14
|
+
"tslib": "^2.8.1"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
"types": "./src/index.ts",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@icore/shared": "*",
|
|
10
|
-
"@nestjs/common": "^11.1.
|
|
10
|
+
"@nestjs/common": "^11.1.27",
|
|
11
11
|
"@nestjs/config": "^4.0.4",
|
|
12
12
|
"cloudinary": "^2.10.0",
|
|
13
|
-
"tslib": "^2.
|
|
13
|
+
"tslib": "^2.8.1"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@nestjs/testing": "^11.
|
|
17
|
-
"vitest": "^4.
|
|
16
|
+
"@nestjs/testing": "^11.1.27",
|
|
17
|
+
"vitest": "^4.1.9"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -8,12 +8,13 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@icore/firebase-admin": "*",
|
|
10
10
|
"@icore/shared": "*",
|
|
11
|
-
"@nestjs/common": "^11.1.
|
|
11
|
+
"@nestjs/common": "^11.1.27",
|
|
12
12
|
"@nestjs/config": "^4.0.4",
|
|
13
|
-
"
|
|
13
|
+
"firebase-admin": "^14.1.0",
|
|
14
|
+
"tslib": "^2.8.1"
|
|
14
15
|
},
|
|
15
16
|
"devDependencies": {
|
|
16
|
-
"@nestjs/testing": "^11.
|
|
17
|
-
"vitest": "^4.
|
|
17
|
+
"@nestjs/testing": "^11.1.27",
|
|
18
|
+
"vitest": "^4.1.9"
|
|
18
19
|
}
|
|
19
20
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Module, DynamicModule } from '@nestjs/common';
|
|
2
2
|
import { ConfigService } from '@nestjs/config';
|
|
3
3
|
import { getFirebaseAdmin, FIREBASE_ADMIN_REQUIRED_ENV } from '@icore/firebase-admin';
|
|
4
|
+
import { getStorage } from 'firebase-admin/storage';
|
|
4
5
|
import { buildStrategyWithFallback, FakeStorageStrategy } from '@icore/shared';
|
|
5
6
|
import type { StorageStrategy } from '@icore/shared';
|
|
6
7
|
import {
|
|
@@ -32,7 +33,9 @@ export class FirebaseStorageModule {
|
|
|
32
33
|
const bucketName = cfg.getOrThrow<string>('FIREBASE_STORAGE_BUCKET');
|
|
33
34
|
const app = getFirebaseAdmin(cfg);
|
|
34
35
|
return new FirebaseStorageStrategy({
|
|
35
|
-
bucket: app
|
|
36
|
+
bucket: getStorage(app).bucket(
|
|
37
|
+
bucketName,
|
|
38
|
+
) as unknown as FirebaseStorageBucketLike,
|
|
36
39
|
});
|
|
37
40
|
},
|
|
38
41
|
fake: () => new FakeStorageStrategy(),
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
"types": "./src/index.d.ts",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@icore/shared": "*",
|
|
10
|
-
"@nestjs/common": "^11.1.
|
|
10
|
+
"@nestjs/common": "^11.1.27",
|
|
11
11
|
"@nestjs/config": "^4.0.4",
|
|
12
12
|
"@nestjs/mongoose": "^11.0.4",
|
|
13
13
|
"mongodb-memory-server": "^11.2.0",
|
|
14
|
-
"mongoose": "^9.
|
|
15
|
-
"tslib": "^2.
|
|
14
|
+
"mongoose": "^9.7.2",
|
|
15
|
+
"tslib": "^2.8.1"
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
"types": "./src/index.ts",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@icore/shared": "*",
|
|
10
|
-
"@nestjs/common": "^11.1.
|
|
10
|
+
"@nestjs/common": "^11.1.27",
|
|
11
11
|
"@nestjs/config": "^4.0.4",
|
|
12
|
-
"@supabase/supabase-js": "^2.
|
|
13
|
-
"tslib": "^2.
|
|
12
|
+
"@supabase/supabase-js": "^2.108.2",
|
|
13
|
+
"tslib": "^2.8.1"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@nestjs/testing": "^11.
|
|
17
|
-
"vitest": "^4.
|
|
16
|
+
"@nestjs/testing": "^11.1.27",
|
|
17
|
+
"vitest": "^4.1.9"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@casl/react": "^7.0.0",
|
|
10
10
|
"@icore/shared": "*",
|
|
11
|
-
"@idevconn/api-client": "
|
|
12
|
-
"@idevconn/use-draft": "
|
|
13
|
-
"i18next": "^26.
|
|
14
|
-
"react-i18next": "^17.0.
|
|
15
|
-
"tslib": "^2.
|
|
16
|
-
"zustand": "^5.0.
|
|
11
|
+
"@idevconn/api-client": "^0.3.0",
|
|
12
|
+
"@idevconn/use-draft": "^0.2.0",
|
|
13
|
+
"i18next": "^26.3.2",
|
|
14
|
+
"react-i18next": "^17.0.8",
|
|
15
|
+
"tslib": "^2.8.1",
|
|
16
|
+
"zustand": "^5.0.14"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"react": "^19.
|
|
20
|
-
"react-dom": "^19.
|
|
19
|
+
"react": "^19.2.7",
|
|
20
|
+
"react-dom": "^19.2.7"
|
|
21
21
|
}
|
|
22
22
|
}
|