@dereekb/firebase-server 9.8.0 → 9.9.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/CHANGELOG.md +18 -0
- package/README.md +4 -5
- package/mailgun/package.json +42 -0
- package/mailgun/src/index.d.ts +1 -0
- package/mailgun/src/index.js +5 -0
- package/mailgun/src/index.js.map +1 -0
- package/mailgun/src/lib/auth.mailgun.d.ts +17 -0
- package/mailgun/src/lib/auth.mailgun.js +35 -0
- package/mailgun/src/lib/auth.mailgun.js.map +1 -0
- package/mailgun/src/lib/index.d.ts +1 -0
- package/mailgun/src/lib/index.js +5 -0
- package/mailgun/src/lib/index.js.map +1 -0
- package/package.json +12 -7
- package/src/lib/auth/auth.service.d.ts +6 -2
- package/src/lib/auth/auth.service.js +3 -2
- package/src/lib/auth/auth.service.js.map +1 -1
- package/src/lib/env/env.service.d.ts +1 -1
- package/src/lib/env/env.service.js.map +1 -1
- package/src/lib/env/index.d.ts +0 -1
- package/src/lib/env/index.js +0 -1
- package/src/lib/env/index.js.map +1 -1
- package/src/lib/nest/app.d.ts +2 -2
- package/src/lib/nest/app.js +2 -1
- package/src/lib/nest/app.js.map +1 -1
- package/src/lib/nest/env/env.config.d.ts +3 -19
- package/src/lib/nest/env/env.nest.d.ts +7 -4
- package/src/lib/nest/env/env.nest.js +8 -10
- package/src/lib/nest/env/env.nest.js.map +1 -1
- package/src/lib/nest/env/env.service.d.ts +3 -8
- package/src/lib/nest/env/env.service.js +4 -19
- package/src/lib/nest/env/env.service.js.map +1 -1
- package/test/package.json +10 -10
- package/test/src/lib/firebase/firebase.admin.nest.d.ts +6 -5
- package/test/src/lib/firebase/firebase.admin.nest.js +6 -5
- package/test/src/lib/firebase/firebase.admin.nest.js.map +1 -1
- package/src/lib/env/env.d.ts +0 -4
- package/src/lib/env/env.js +0 -11
- package/src/lib/env/env.js.map +0 -1
- package/test/CHANGELOG.md +0 -553
- package/test/README.md +0 -11
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [9.9.1](https://github.com/dereekb/dbx-components/compare/v9.9.0-dev...v9.9.1) (2022-09-18)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* fixed dependencies for release ([7c57c7e](https://github.com/dereekb/dbx-components/commit/7c57c7ef5df664b8df2641fb3b50b82b3fb2c650))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [9.9.0](https://github.com/dereekb/dbx-components/compare/v9.8.0-dev...v9.9.0) (2022-09-17)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* mailgun ([#16](https://github.com/dereekb/dbx-components/issues/16)) ([9c7d4cc](https://github.com/dereekb/dbx-components/commit/9c7d4cc997e86b664ff7e2bc6e04392e650b7910))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
5
23
|
# [9.8.0](https://github.com/dereekb/dbx-components/compare/v9.7.7-dev...v9.8.0) (2022-09-15)
|
|
6
24
|
|
|
7
25
|
|
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
@dereekb/firebase-server
|
|
2
|
+
=======
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
The sources for this package are in the main [@dereekb/dbx-components](https://github.com/dereekb/dbx-components) repo. Please file issues and pull requests against that repo.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Run `nx test firebase-server` to execute the unit tests via [Jest](https://jestjs.io).
|
|
6
|
+
License: MIT
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dereekb/firebase-server/mailgun",
|
|
3
|
+
"version": "9.9.1",
|
|
4
|
+
"type": "commonjs",
|
|
5
|
+
"main": "./src/index.js",
|
|
6
|
+
"typings": "./src/index.d.ts",
|
|
7
|
+
"dependencies": {},
|
|
8
|
+
"peerDependencies": {
|
|
9
|
+
"@dereekb/nestjs/mailgun": "9.9.1",
|
|
10
|
+
"@nestjs/common": "^9.0.0",
|
|
11
|
+
"mailgun.js": "^8.0.0",
|
|
12
|
+
"form-data": "4.0.0",
|
|
13
|
+
"@dereekb/util": "9.9.1",
|
|
14
|
+
"lodash.isequal": "^4.5.0",
|
|
15
|
+
"make-error": "^1.3.0",
|
|
16
|
+
"ts-essentials": "^9.1.2",
|
|
17
|
+
"extra-set": "^2.2.11",
|
|
18
|
+
"@dereekb/nestjs": "9.9.1",
|
|
19
|
+
"@nestjs/config": "^2.0.1",
|
|
20
|
+
"@dereekb/firebase-server": "9.9.1",
|
|
21
|
+
"jsonwebtoken": "^8.0.0",
|
|
22
|
+
"@dereekb/firebase": "9.9.1",
|
|
23
|
+
"rxjs": "^7.5.0",
|
|
24
|
+
"firebase": "^9.9.2",
|
|
25
|
+
"@dereekb/rxjs": "9.9.1",
|
|
26
|
+
"ms": "^3.0.0-canary.1",
|
|
27
|
+
"@dereekb/model": "9.9.1",
|
|
28
|
+
"class-transformer": "^0.5.1",
|
|
29
|
+
"class-validator": "^0.13.2",
|
|
30
|
+
"@dereekb/date": "9.9.1",
|
|
31
|
+
"date-fns": "^2.29.0",
|
|
32
|
+
"date-fns-tz": "^1.3.0",
|
|
33
|
+
"rrule": "git+https://git@github.com/dereekb/rrule#2b13b1ea881059ba2ecfec380e12ef244ef54570",
|
|
34
|
+
"@vvo/tzdb": "^6.56.0",
|
|
35
|
+
"firebase-functions": "^3.22.0",
|
|
36
|
+
"firebase-admin": "^11.0.0",
|
|
37
|
+
"@google-cloud/firestore": "^5.0.2",
|
|
38
|
+
"@nestjs/core": "^9.0.0",
|
|
39
|
+
"@nestjs/platform-express": "^9.0.0",
|
|
40
|
+
"tslib": "^2.0.0"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './lib';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/firebase-server/mailgun/src/index.ts"],"names":[],"mappings":";;;AAAA,gDAAsB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MailgunService, MailgunTemplateEmailRequest } from '@dereekb/nestjs/mailgun';
|
|
2
|
+
import { AbstractFirebaseServerNewUserService, FirebaseServerAuthNewUserSetupDetails, FirebaseServerAuthService, FirebaseServerAuthUserContext } from '@dereekb/firebase-server';
|
|
3
|
+
/**
|
|
4
|
+
* MailgunTemplateEmailRequest for AbstractMailgunContentFirebaseServerNewUserService.
|
|
5
|
+
*
|
|
6
|
+
* Omits the "to" input since it gets configured by the input.
|
|
7
|
+
*/
|
|
8
|
+
export declare type NewUserMailgunContentRequest = Omit<MailgunTemplateEmailRequest, 'to'>;
|
|
9
|
+
/**
|
|
10
|
+
* Abstract FirebaseServerNewUserService implementation that sends an email to a template on Mailgun.
|
|
11
|
+
*/
|
|
12
|
+
export declare abstract class AbstractMailgunContentFirebaseServerNewUserService<U extends FirebaseServerAuthUserContext = FirebaseServerAuthUserContext> extends AbstractFirebaseServerNewUserService<U> {
|
|
13
|
+
readonly mailgunService: MailgunService;
|
|
14
|
+
constructor(authService: FirebaseServerAuthService<U>, mailgunService: MailgunService);
|
|
15
|
+
protected sendSetupContentToUser(user: FirebaseServerAuthNewUserSetupDetails<U>): Promise<void>;
|
|
16
|
+
protected abstract buildNewUserMailgunContentRequest(user: FirebaseServerAuthNewUserSetupDetails<U>): Promise<NewUserMailgunContentRequest>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AbstractMailgunContentFirebaseServerNewUserService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const firebase_server_1 = require("@dereekb/firebase-server");
|
|
6
|
+
/**
|
|
7
|
+
* Abstract FirebaseServerNewUserService implementation that sends an email to a template on Mailgun.
|
|
8
|
+
*/
|
|
9
|
+
class AbstractMailgunContentFirebaseServerNewUserService extends firebase_server_1.AbstractFirebaseServerNewUserService {
|
|
10
|
+
constructor(authService, mailgunService) {
|
|
11
|
+
super(authService);
|
|
12
|
+
this.mailgunService = mailgunService;
|
|
13
|
+
}
|
|
14
|
+
sendSetupContentToUser(user) {
|
|
15
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
const userRecord = yield user.userContext.loadRecord();
|
|
17
|
+
const { setupPassword } = user.claims;
|
|
18
|
+
const { uid, displayName, email } = userRecord;
|
|
19
|
+
if (!email) {
|
|
20
|
+
throw new Error(`Email is not present/available for the user record "${userRecord.uid}"`);
|
|
21
|
+
}
|
|
22
|
+
const baseRequest = yield this.buildNewUserMailgunContentRequest(user);
|
|
23
|
+
yield this.mailgunService.sendTemplateEmail(Object.assign(Object.assign({}, baseRequest), { to: {
|
|
24
|
+
email,
|
|
25
|
+
userVariables: {
|
|
26
|
+
uid,
|
|
27
|
+
displayName,
|
|
28
|
+
setupPassword
|
|
29
|
+
}
|
|
30
|
+
} }));
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.AbstractMailgunContentFirebaseServerNewUserService = AbstractMailgunContentFirebaseServerNewUserService;
|
|
35
|
+
//# sourceMappingURL=auth.mailgun.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.mailgun.js","sourceRoot":"","sources":["../../../../../../packages/firebase-server/mailgun/src/lib/auth.mailgun.ts"],"names":[],"mappings":";;;;AACA,8DAAiL;AASjL;;GAEG;AACH,MAAsB,kDAA4H,SAAQ,sDAAuC;IAC/L,YAAY,WAAyC,EAAW,cAA8B;QAC5F,KAAK,CAAC,WAAW,CAAC,CAAC;QAD2C,mBAAc,GAAd,cAAc,CAAgB;IAE9F,CAAC;IAEe,sBAAsB,CAAC,IAA8C;;YACnF,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC;YACvD,MAAM,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC;YACtC,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC;YAE/C,IAAI,CAAC,KAAK,EAAE;gBACV,MAAM,IAAI,KAAK,CAAC,uDAAuD,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC;aAC3F;YAED,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,iCAAiC,CAAC,IAAI,CAAC,CAAC;YACvE,MAAM,IAAI,CAAC,cAAc,CAAC,iBAAiB,iCACtC,WAAW,KACd,EAAE,EAAE;oBACF,KAAK;oBACL,aAAa,EAAE;wBACb,GAAG;wBACH,WAAW;wBACX,aAAa;qBACd;iBACF,IACD,CAAC;QACL,CAAC;KAAA;CAGF;AA7BD,gHA6BC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './auth.mailgun';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/firebase-server/mailgun/src/lib/index.ts"],"names":[],"mappings":";;;AAAA,yDAA+B"}
|
package/package.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/firebase-server",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.9.1",
|
|
4
4
|
"devDependencies": {
|
|
5
5
|
"firebase-functions-test": "2.0.2"
|
|
6
6
|
},
|
|
7
7
|
"peerDependencies": {
|
|
8
8
|
"jsonwebtoken": "^8.0.0",
|
|
9
|
-
"@dereekb/firebase": "9.
|
|
9
|
+
"@dereekb/firebase": "9.9.1",
|
|
10
10
|
"rxjs": "^7.5.0",
|
|
11
11
|
"firebase": "^9.9.2",
|
|
12
|
-
"@dereekb/util": "9.
|
|
12
|
+
"@dereekb/util": "9.9.1",
|
|
13
13
|
"lodash.isequal": "^4.5.0",
|
|
14
14
|
"make-error": "^1.3.0",
|
|
15
15
|
"ts-essentials": "^9.1.2",
|
|
16
16
|
"extra-set": "^2.2.11",
|
|
17
|
-
"@dereekb/rxjs": "9.
|
|
17
|
+
"@dereekb/rxjs": "9.9.1",
|
|
18
18
|
"ms": "^3.0.0-canary.1",
|
|
19
|
-
"@dereekb/model": "9.
|
|
19
|
+
"@dereekb/model": "9.9.1",
|
|
20
20
|
"class-transformer": "^0.5.1",
|
|
21
21
|
"class-validator": "^0.13.2",
|
|
22
|
-
"@dereekb/date": "9.
|
|
22
|
+
"@dereekb/date": "9.9.1",
|
|
23
23
|
"date-fns": "^2.29.0",
|
|
24
24
|
"date-fns-tz": "^1.3.0",
|
|
25
25
|
"rrule": "git+https://git@github.com/dereekb/rrule#2b13b1ea881059ba2ecfec380e12ef244ef54570",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@nestjs/common": "^9.0.0",
|
|
31
31
|
"@nestjs/core": "^9.0.0",
|
|
32
32
|
"@nestjs/platform-express": "^9.0.0",
|
|
33
|
-
"@dereekb/nestjs": "9.
|
|
33
|
+
"@dereekb/nestjs": "9.9.1",
|
|
34
34
|
"@nestjs/config": "^2.0.1",
|
|
35
35
|
"tslib": "^2.0.0"
|
|
36
36
|
},
|
|
@@ -44,6 +44,11 @@
|
|
|
44
44
|
"main": "./test/index.js",
|
|
45
45
|
"types": "./test/index.d.ts",
|
|
46
46
|
"default": "./test/index.js"
|
|
47
|
+
},
|
|
48
|
+
"./mailgun": {
|
|
49
|
+
"main": "./mailgun/index.js",
|
|
50
|
+
"types": "./mailgun/index.d.ts",
|
|
51
|
+
"default": "./mailgun/index.js"
|
|
47
52
|
}
|
|
48
53
|
},
|
|
49
54
|
"main": "./src/index.js",
|
|
@@ -154,6 +154,10 @@ export interface FirebaseServerAuthInitializeNewUser {
|
|
|
154
154
|
* Specific user identifier to use.
|
|
155
155
|
*/
|
|
156
156
|
readonly uid?: FirebaseAuthUserId;
|
|
157
|
+
/**
|
|
158
|
+
* User's display name
|
|
159
|
+
*/
|
|
160
|
+
readonly displayName?: string;
|
|
157
161
|
/**
|
|
158
162
|
* Email for the new user, if applicable.
|
|
159
163
|
*/
|
|
@@ -211,11 +215,11 @@ export declare abstract class AbstractFirebaseServerNewUserService<U extends Fir
|
|
|
211
215
|
markUserSetupAsComplete(uid: FirebaseAuthUserId): Promise<boolean>;
|
|
212
216
|
protected createNewUser(input: FirebaseServerAuthInitializeNewUser): Promise<FirebaseServerAuthCreateNewUserResult>;
|
|
213
217
|
protected generateRandomSetupPassword(): FirebaseServerAuthSetupPassword;
|
|
214
|
-
protected abstract sendSetupContentToUser(user:
|
|
218
|
+
protected abstract sendSetupContentToUser(user: FirebaseServerAuthNewUserSetupDetails<U>): Promise<void>;
|
|
215
219
|
protected updateClaimsToClearUser(userContext: U): Promise<void>;
|
|
216
220
|
}
|
|
217
221
|
export declare class NoSetupContentFirebaseServerNewUserService<U extends FirebaseServerAuthUserContext = FirebaseServerAuthUserContext> extends AbstractFirebaseServerNewUserService<U> {
|
|
218
|
-
protected sendSetupContentToUser(user:
|
|
222
|
+
protected sendSetupContentToUser(user: FirebaseServerAuthNewUserSetupDetails<U>): Promise<void>;
|
|
219
223
|
}
|
|
220
224
|
/**
|
|
221
225
|
* Reference to a FirebaseServerAuthService
|
|
@@ -128,7 +128,7 @@ class AbstractFirebaseServerNewUserService {
|
|
|
128
128
|
}
|
|
129
129
|
initializeNewUser(input) {
|
|
130
130
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
131
|
-
const { uid, email, phone, sendSetupContent: sendSetupEmail } = input;
|
|
131
|
+
const { uid, displayName, email, phone, sendSetupContent: sendSetupEmail } = input;
|
|
132
132
|
let userRecordPromise;
|
|
133
133
|
if (uid) {
|
|
134
134
|
userRecordPromise = this.authService.auth.getUser(uid);
|
|
@@ -223,10 +223,11 @@ class AbstractFirebaseServerNewUserService {
|
|
|
223
223
|
}
|
|
224
224
|
createNewUser(input) {
|
|
225
225
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
226
|
-
const { uid, email, phone: phoneNumber, setupPassword: inputPassword } = input;
|
|
226
|
+
const { uid, displayName, email, phone: phoneNumber, setupPassword: inputPassword } = input;
|
|
227
227
|
const password = inputPassword !== null && inputPassword !== void 0 ? inputPassword : this.generateRandomSetupPassword();
|
|
228
228
|
const user = yield this.authService.auth.createUser({
|
|
229
229
|
uid,
|
|
230
|
+
displayName,
|
|
230
231
|
email,
|
|
231
232
|
phoneNumber,
|
|
232
233
|
password
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.service.js","sourceRoot":"","sources":["../../../../../../packages/firebase-server/src/lib/auth/auth.service.ts"],"names":[],"mappings":";;;;AAGA,wCAAuY;AACvY,iDAA+F;AAC/F,iDAAkF;AAClF,
|
|
1
|
+
{"version":3,"file":"auth.service.js","sourceRoot":"","sources":["../../../../../../packages/firebase-server/src/lib/auth/auth.service.ts"],"names":[],"mappings":";;;;AAGA,wCAAuY;AACvY,iDAA+F;AAC/F,iDAAkF;AAClF,wCAA2E;AAC3E,2CAAqD;AA2ErD,MAAsB,qCAAqC;IAGzD,YAAqB,OAAU,EAAW,GAAuB;QAA5C,YAAO,GAAP,OAAO,CAAG;QAAW,QAAG,GAAH,GAAG,CAAoB;QAFhD,gBAAW,GAAG,IAAA,mBAAY,EAAC,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAEnB,CAAC;IAE/D,MAAM;;YACV,OAAO,IAAA,kCAAsB,EAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5E,CAAC;KAAA;IAED,UAAU;QACR,OAAO,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I,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC;gBAC5C,SAAS;gBACT,YAAY,EAAE,MAAM;gBACpB,KAAK,EAAE,IAAA,kDAAmC,EAAC,IAAI,CAAC,KAAK,CAAC;aACvD,CAAC;SACH;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAvDD,8EAuDC"}
|
|
@@ -7,9 +7,9 @@ export interface FirebaseServerEnvServiceRef<S extends FirebaseServerEnvService
|
|
|
7
7
|
export declare abstract class FirebaseServerEnvService {
|
|
8
8
|
abstract readonly isTestingEnv: boolean;
|
|
9
9
|
abstract readonly isProduction: boolean;
|
|
10
|
+
abstract readonly developerToolsEnabled: boolean;
|
|
10
11
|
/**
|
|
11
12
|
* @deprecated use isDeveloperToolsEnabled instead.
|
|
12
13
|
*/
|
|
13
14
|
abstract readonly isDevelopmentToolsEnabled: boolean;
|
|
14
|
-
abstract readonly developerToolsEnabled: boolean;
|
|
15
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.service.js","sourceRoot":"","sources":["../../../../../../packages/firebase-server/src/lib/env/env.service.ts"],"names":[],"mappings":";;;AAOA,MAAsB,wBAAwB;
|
|
1
|
+
{"version":3,"file":"env.service.js","sourceRoot":"","sources":["../../../../../../packages/firebase-server/src/lib/env/env.service.ts"],"names":[],"mappings":";;;AAOA,MAAsB,wBAAwB;CAS7C;AATD,4DASC"}
|
package/src/lib/env/index.d.ts
CHANGED
package/src/lib/env/index.js
CHANGED
package/src/lib/env/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/firebase-server/src/lib/env/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/firebase-server/src/lib/env/index.ts"],"names":[],"mappings":";;;AAAA,wDAA8B"}
|
package/src/lib/nest/app.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { INestApplicationContext, NestApplicationOptions, Provider } from '@nest
|
|
|
3
3
|
import * as express from 'express';
|
|
4
4
|
import * as admin from 'firebase-admin';
|
|
5
5
|
import { StorageBucketId } from '@dereekb/firebase';
|
|
6
|
-
import {
|
|
6
|
+
import { ServerEnvironmentConfig } from '@dereekb/nestjs';
|
|
7
7
|
export interface NestServer {
|
|
8
8
|
server: express.Express;
|
|
9
9
|
nest: NestAppPromiseGetter;
|
|
@@ -64,6 +64,6 @@ export interface NestServerInstanceConfig<T> {
|
|
|
64
64
|
readonly applicationOptions?: NestApplicationOptions;
|
|
65
65
|
}
|
|
66
66
|
export interface NestServerEnvironmentConfig {
|
|
67
|
-
environment:
|
|
67
|
+
environment: ServerEnvironmentConfig;
|
|
68
68
|
}
|
|
69
69
|
export declare function nestServerInstance<T>(config: NestServerInstanceConfig<T>): NestServerInstance<T>;
|
package/src/lib/nest/app.js
CHANGED
|
@@ -11,6 +11,7 @@ const middleware_1 = require("./middleware");
|
|
|
11
11
|
const storage_module_1 = require("./storage/storage.module");
|
|
12
12
|
const env_service_1 = require("../env/env.service");
|
|
13
13
|
const env_1 = require("./env");
|
|
14
|
+
const nestjs_1 = require("@dereekb/nestjs");
|
|
14
15
|
class FirebaseNestServerRootModule {
|
|
15
16
|
}
|
|
16
17
|
exports.FirebaseNestServerRootModule = FirebaseNestServerRootModule;
|
|
@@ -27,7 +28,7 @@ function nestServerInstance(config) {
|
|
|
27
28
|
const providers = [(0, firebase_module_1.firebaseServerAppTokenProvider)((0, util_1.asGetter)(firebaseApp))];
|
|
28
29
|
// configure environment providers
|
|
29
30
|
if ((env === null || env === void 0 ? void 0 : env.environment) != null) {
|
|
30
|
-
providers.push((0,
|
|
31
|
+
providers.push((0, nestjs_1.serverEnvTokenProvider)(env.environment));
|
|
31
32
|
if (config.configureEnvService !== false) {
|
|
32
33
|
providers.push({
|
|
33
34
|
provide: env_service_1.FirebaseServerEnvService,
|
package/src/lib/nest/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../../../../packages/firebase-server/src/lib/nest/app.ts"],"names":[],"mappings":";;;;AAAA,wCAAoG;AAEpG,uCAA2C;AAC3C,+DAA0D;AAC1D,mCAAmC;AACnC,gEAA4E;AAE5E,6CAAmH;AAEnH,6DAA6F;AAC7F,oDAA8D;AAC9D,+
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../../../../packages/firebase-server/src/lib/nest/app.ts"],"names":[],"mappings":";;;;AAAA,wCAAoG;AAEpG,uCAA2C;AAC3C,+DAA0D;AAC1D,mCAAmC;AACnC,gEAA4E;AAE5E,6CAAmH;AAEnH,6DAA6F;AAC7F,oDAA8D;AAC9D,+BAAwD;AACxD,4CAAkF;AA4BlF,MAAa,4BAA4B;CAAG;AAA5C,oEAA4C;AAyC5C,SAAgB,kBAAkB,CAAI,MAAmC;IACvE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,GAAG,MAAM,CAAC;IACpI,MAAM,YAAY,GAAG,IAAI,GAAG,EAAsB,CAAC;IAEnD,MAAM,cAAc,GAAG,CAAC,WAA0B,EAAE,GAAiC,EAAc,EAAE;QACnG,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC;QACjC,MAAM,oBAAoB,GAAG,yBAAyB,aAAzB,yBAAyB,cAAzB,yBAAyB,GAAI,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC;QAE5F,IAAI,UAAU,GAAG,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAE3C,IAAI,CAAC,UAAU,EAAE;YACf,MAAM,MAAM,GAAG,OAAO,EAAE,CAAC;YACzB,MAAM,gBAAgB,GAAG,CAAO,eAAgC,EAAE,EAAE;gBAClE,MAAM,SAAS,GAAmC,CAAC,IAAA,gDAA8B,EAAC,IAAA,eAAQ,EAAC,WAAW,CAAC,C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from '@dereekb/nestjs';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Explicitly states whether or not this is a production environment, and optionally some other config.
|
|
5
|
-
*
|
|
6
|
-
* This config is not meant to replace other typical configurations, like .env files, but instead is part of the build system.
|
|
3
|
+
* @Deprecated use ServerEnvironmentServiceConfig instead.
|
|
7
4
|
*/
|
|
8
|
-
export
|
|
9
|
-
/**
|
|
10
|
-
* Whether or not this is a production environment.
|
|
11
|
-
*/
|
|
12
|
-
production: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* (Optional) Whether or not custom "developer tools" should be enabled.
|
|
15
|
-
*
|
|
16
|
-
* In general this is referred to in order to check whether or not to allow skipping typical safety checks in order to speed up local development.
|
|
17
|
-
*
|
|
18
|
-
* This is always false when production is true.
|
|
19
|
-
*/
|
|
20
|
-
developerToolsEnabled?: boolean;
|
|
21
|
-
}
|
|
5
|
+
export declare type FirebaseServerEnvironmentConfig = ServerEnvironmentConfig;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { serverEnvTokenProvider } from '@dereekb/nestjs';
|
|
2
|
+
import { InjectionToken } from '@nestjs/common';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* @Deprecated use SERVER_ENV_TOKEN instead.
|
|
5
5
|
*/
|
|
6
6
|
export declare const FIREBASE_SERVER_ENV_TOKEN: InjectionToken;
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated use serverEnvTokenProvider() instead.
|
|
9
|
+
*/
|
|
10
|
+
export declare const firebaseServerEnvTokenProvider: typeof serverEnvTokenProvider;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.firebaseServerEnvTokenProvider = exports.FIREBASE_SERVER_ENV_TOKEN = void 0;
|
|
4
|
-
|
|
4
|
+
const nestjs_1 = require("@dereekb/nestjs");
|
|
5
|
+
// MARK: Compat
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
+
* @Deprecated use SERVER_ENV_TOKEN instead.
|
|
7
8
|
*/
|
|
8
|
-
exports.FIREBASE_SERVER_ENV_TOKEN =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
exports.firebaseServerEnvTokenProvider = firebaseServerEnvTokenProvider;
|
|
9
|
+
exports.FIREBASE_SERVER_ENV_TOKEN = nestjs_1.SERVER_ENV_TOKEN;
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated use serverEnvTokenProvider() instead.
|
|
12
|
+
*/
|
|
13
|
+
exports.firebaseServerEnvTokenProvider = nestjs_1.serverEnvTokenProvider;
|
|
16
14
|
//# sourceMappingURL=env.nest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.nest.js","sourceRoot":"","sources":["../../../../../../../packages/firebase-server/src/lib/nest/env/env.nest.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"env.nest.js","sourceRoot":"","sources":["../../../../../../../packages/firebase-server/src/lib/nest/env/env.nest.ts"],"names":[],"mappings":";;;AAAA,4CAA2E;AAG3E,eAAe;AACf;;GAEG;AACU,QAAA,yBAAyB,GAAmB,yBAAgB,CAAC;AAE1E;;GAEG;AACU,QAAA,8BAA8B,GAAG,+BAAsB,CAAC"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
+
import { ServerEnvironmentService } from '@dereekb/nestjs';
|
|
1
2
|
import { FirebaseServerEnvService } from '../../env';
|
|
2
|
-
|
|
3
|
-
export declare class DefaultFirebaseServerEnvService implements FirebaseServerEnvService {
|
|
4
|
-
readonly env: FirebaseServerEnvironmentConfig;
|
|
5
|
-
constructor(env: FirebaseServerEnvironmentConfig);
|
|
6
|
-
get isTestingEnv(): boolean;
|
|
7
|
-
get isProduction(): boolean;
|
|
3
|
+
export declare class DefaultFirebaseServerEnvService extends ServerEnvironmentService implements FirebaseServerEnvService {
|
|
8
4
|
/**
|
|
9
|
-
* @deprecated use isDeveloperToolsEnabled instead.
|
|
5
|
+
* @deprecated use isDeveloperToolsEnabled instead.z
|
|
10
6
|
*/
|
|
11
7
|
get isDevelopmentToolsEnabled(): boolean;
|
|
12
|
-
get developerToolsEnabled(): boolean;
|
|
13
8
|
}
|
|
@@ -2,33 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DefaultFirebaseServerEnvService = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const nestjs_1 = require("@dereekb/nestjs");
|
|
5
6
|
const common_1 = require("@nestjs/common");
|
|
6
|
-
|
|
7
|
-
const env_nest_1 = require("./env.nest");
|
|
8
|
-
let DefaultFirebaseServerEnvService = class DefaultFirebaseServerEnvService {
|
|
9
|
-
constructor(env) {
|
|
10
|
-
this.env = env;
|
|
11
|
-
}
|
|
12
|
-
get isTestingEnv() {
|
|
13
|
-
return (0, env_1.isTestNodeEnv)();
|
|
14
|
-
}
|
|
15
|
-
get isProduction() {
|
|
16
|
-
return this.env.production;
|
|
17
|
-
}
|
|
7
|
+
let DefaultFirebaseServerEnvService = class DefaultFirebaseServerEnvService extends nestjs_1.ServerEnvironmentService {
|
|
18
8
|
/**
|
|
19
|
-
* @deprecated use isDeveloperToolsEnabled instead.
|
|
9
|
+
* @deprecated use isDeveloperToolsEnabled instead.z
|
|
20
10
|
*/
|
|
21
11
|
get isDevelopmentToolsEnabled() {
|
|
22
12
|
return this.developerToolsEnabled;
|
|
23
13
|
}
|
|
24
|
-
get developerToolsEnabled() {
|
|
25
|
-
return Boolean(!this.isProduction && this.env.developerToolsEnabled);
|
|
26
|
-
}
|
|
27
14
|
};
|
|
28
15
|
DefaultFirebaseServerEnvService = tslib_1.__decorate([
|
|
29
|
-
(0, common_1.Injectable)()
|
|
30
|
-
tslib_1.__param(0, (0, common_1.Inject)(env_nest_1.FIREBASE_SERVER_ENV_TOKEN)),
|
|
31
|
-
tslib_1.__metadata("design:paramtypes", [Object])
|
|
16
|
+
(0, common_1.Injectable)()
|
|
32
17
|
], DefaultFirebaseServerEnvService);
|
|
33
18
|
exports.DefaultFirebaseServerEnvService = DefaultFirebaseServerEnvService;
|
|
34
19
|
//# sourceMappingURL=env.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.service.js","sourceRoot":"","sources":["../../../../../../../packages/firebase-server/src/lib/nest/env/env.service.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"env.service.js","sourceRoot":"","sources":["../../../../../../../packages/firebase-server/src/lib/nest/env/env.service.ts"],"names":[],"mappings":";;;;AAAA,4CAA2D;AAC3D,2CAA4C;AAI5C,IAAa,+BAA+B,GAA5C,MAAa,+BAAgC,SAAQ,iCAAwB;IAC3E;;OAEG;IACH,IAAI,yBAAyB;QAC3B,OAAO,IAAI,CAAC,qBAAqB,CAAC;IACpC,CAAC;CACF,CAAA;AAPY,+BAA+B;IAD3C,IAAA,mBAAU,GAAE;GACA,+BAA+B,CAO3C;AAPY,0EAA+B"}
|
package/test/package.json
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/firebase-server/test",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.9.1",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./src/index.d.ts",
|
|
7
7
|
"dependencies": {},
|
|
8
8
|
"peerDependencies": {
|
|
9
|
-
"@dereekb/firebase": "9.
|
|
9
|
+
"@dereekb/firebase": "9.9.1",
|
|
10
10
|
"rxjs": "^7.5.0",
|
|
11
11
|
"firebase": "^9.9.2",
|
|
12
|
-
"@dereekb/util": "9.
|
|
12
|
+
"@dereekb/util": "9.9.1",
|
|
13
13
|
"lodash.isequal": "^4.5.0",
|
|
14
14
|
"make-error": "^1.3.0",
|
|
15
15
|
"ts-essentials": "^9.1.2",
|
|
16
16
|
"extra-set": "^2.2.11",
|
|
17
|
-
"@dereekb/rxjs": "9.
|
|
17
|
+
"@dereekb/rxjs": "9.9.1",
|
|
18
18
|
"ms": "^3.0.0-canary.1",
|
|
19
|
-
"@dereekb/model": "9.
|
|
19
|
+
"@dereekb/model": "9.9.1",
|
|
20
20
|
"class-transformer": "^0.5.1",
|
|
21
21
|
"class-validator": "^0.13.2",
|
|
22
|
-
"@dereekb/date": "9.
|
|
22
|
+
"@dereekb/date": "9.9.1",
|
|
23
23
|
"date-fns": "^2.29.0",
|
|
24
24
|
"date-fns-tz": "^1.3.0",
|
|
25
25
|
"rrule": "git+https://git@github.com/dereekb/rrule#2b13b1ea881059ba2ecfec380e12ef244ef54570",
|
|
26
26
|
"@vvo/tzdb": "^6.56.0",
|
|
27
|
-
"@dereekb/util/test": "9.
|
|
27
|
+
"@dereekb/util/test": "9.9.1",
|
|
28
28
|
"firebase-admin": "^11.0.0",
|
|
29
29
|
"jsonwebtoken": "^8.0.0",
|
|
30
30
|
"firebase-functions": "^3.22.0",
|
|
31
31
|
"@nestjs/common": "^9.0.0",
|
|
32
32
|
"@google-cloud/firestore": "^5.0.2",
|
|
33
|
-
"@dereekb/firebase/test": "9.
|
|
34
|
-
"@dereekb/firebase-server": "9.
|
|
33
|
+
"@dereekb/firebase/test": "9.9.1",
|
|
34
|
+
"@dereekb/firebase-server": "9.9.1",
|
|
35
35
|
"@nestjs/core": "^9.0.0",
|
|
36
36
|
"@nestjs/platform-express": "^9.0.0",
|
|
37
|
-
"@dereekb/nestjs": "9.
|
|
37
|
+
"@dereekb/nestjs": "9.9.1",
|
|
38
38
|
"@nestjs/config": "^2.0.1",
|
|
39
39
|
"tslib": "^2.0.0"
|
|
40
40
|
}
|
|
@@ -2,9 +2,10 @@ import { AbstractChildJestTestContextFixture, JestBuildTestsWithContextFunction,
|
|
|
2
2
|
import { AbstractFirebaseAdminTestContextInstanceChild, FirebaseAdminTestContextInstance } from './firebase.admin';
|
|
3
3
|
import { Abstract, INestApplicationContext, Provider, Type } from '@nestjs/common';
|
|
4
4
|
import { StorageBucketId } from '@dereekb/firebase';
|
|
5
|
-
import {
|
|
5
|
+
import { NestAppPromiseGetter } from '@dereekb/firebase-server';
|
|
6
6
|
import { TestingModule } from '@nestjs/testing';
|
|
7
7
|
import { ArrayOrValue, ClassType, Getter } from '@dereekb/util';
|
|
8
|
+
import { ServerEnvironmentConfig } from '@dereekb/nestjs';
|
|
8
9
|
export interface FirebaseAdminNestTestContext {
|
|
9
10
|
readonly nest: TestingModule;
|
|
10
11
|
readonly nestAppPromiseGetter: NestAppPromiseGetter;
|
|
@@ -38,17 +39,17 @@ export interface FirebaseAdminNestTestConfig<PI extends FirebaseAdminTestContext
|
|
|
38
39
|
*/
|
|
39
40
|
nestModules: ArrayOrValue<ClassType>;
|
|
40
41
|
/**
|
|
41
|
-
* Whether or not to inject the
|
|
42
|
+
* Whether or not to inject the env service provider (and serverEnvTokenProvider()) by default.
|
|
42
43
|
*
|
|
43
44
|
* If false will affect the default envConfig value.
|
|
44
45
|
*/
|
|
45
|
-
|
|
46
|
+
injectServerEnvServiceProvider?: boolean;
|
|
46
47
|
/**
|
|
47
|
-
* (Optional)
|
|
48
|
+
* (Optional) ServerEnvironmentServiceConfig. Overrides the default which sets production=false.
|
|
48
49
|
*
|
|
49
50
|
* If injectFirebaseServerEnvServiceProvider is false then this requires a value to be provided in order to be injected.
|
|
50
51
|
*/
|
|
51
|
-
envConfig?:
|
|
52
|
+
envConfig?: ServerEnvironmentConfig;
|
|
52
53
|
/**
|
|
53
54
|
* Whether or not to inject the firebase server provider (firebaseServerAppTokenProvider()).
|
|
54
55
|
*
|