Skip to content

Commit

Permalink
feat(fcm): Exposed FCM APIs from firebase-admin/messaging entry point (
Browse files Browse the repository at this point in the history
…#1153)

* feat(fcm): Exposed FCM APIs from firebase-admin/messaging entry point

* Update src/messaging/messaging-api.ts

Co-authored-by: Lahiru Maramba <[email protected]>

Co-authored-by: Lahiru Maramba <[email protected]>
  • Loading branch information
hiranya911 and lahirumaramba authored Feb 4, 2021
1 parent b865bf9 commit 4e019f1
Show file tree
Hide file tree
Showing 13 changed files with 1,914 additions and 1,627 deletions.
397 changes: 126 additions & 271 deletions etc/firebase-admin.api.md

Large diffs are not rendered by default.

430 changes: 430 additions & 0 deletions etc/firebase-admin.messaging.api.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions generate-reports.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const entryPoints = {
'firebase-admin/database': './lib/database/index.d.ts',
'firebase-admin/firestore': './lib/firestore/index.d.ts',
'firebase-admin/instance-id': './lib/instance-id/index.d.ts',
'firebase-admin/messaging': './lib/messaging/index.d.ts',
'firebase-admin/remote-config': './lib/remote-config/index.d.ts',
};

Expand Down
1 change: 1 addition & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ gulp.task('compile', function() {
'lib/database/*.d.ts',
'lib/firestore/*.d.ts',
'lib/instance-id/*.d.ts',
'lib/messaging/*.d.ts',
'lib/remote-config/*.d.ts',
'!lib/utils/index.d.ts',
];
Expand Down
12 changes: 5 additions & 7 deletions src/app/firebase-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ import { deepCopy } from '../utils/deep-copy';
import { FirebaseNamespaceInternals } from './firebase-namespace';
import { AppErrorCodes, FirebaseAppError } from '../utils/error';

import { Auth } from '../auth/auth';
import { Auth } from '../auth/index';
import { MachineLearning } from '../machine-learning/machine-learning';
import { Messaging } from '../messaging/messaging';
import { Messaging } from '../messaging/index';
import { Storage } from '../storage/storage';
import { Database } from '../database/index';
import { Firestore } from '@google-cloud/firestore';
import { Firestore } from '../firestore/index';
import { InstanceId } from '../instance-id/index';
import { ProjectManagement } from '../project-management/project-management';
import { SecurityRules } from '../security-rules/security-rules';
Expand Down Expand Up @@ -293,10 +293,8 @@ export class FirebaseApp implements app.App {
* @return The Messaging service instance of this app.
*/
public messaging(): Messaging {
return this.ensureService_('messaging', () => {
const messagingService: typeof Messaging = require('../messaging/messaging').Messaging;
return new messagingService(this);
});
const fn = require('../messaging/index').getMessaging;
return fn(this);
}

/**
Expand Down
Loading

0 comments on commit 4e019f1

Please sign in to comment.