Skip to content

Commit 540834f

Browse files
feat: Update firebase-functions imports to remove /v2 (#1217)
This commit updates all Node.js samples in the /Node directory to use the new default firebase-functions imports. All instances of `firebase-functions/v2/*` have been replaced with `firebase-functions/*`. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: Jeff Huleatt <[email protected]>
1 parent f8d6246 commit 540834f

File tree

26 files changed

+34
-34
lines changed

26 files changed

+34
-34
lines changed

Node/alerts-to-discord/functions/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717

1818
const {
1919
onNewFatalIssuePublished,
20-
} = require("firebase-functions/v2/alerts/crashlytics");
20+
} = require("firebase-functions/alerts/crashlytics");
2121
const {
2222
onNewTesterIosDevicePublished,
23-
} = require("firebase-functions/v2/alerts/appDistribution");
23+
} = require("firebase-functions/alerts/appDistribution");
2424
const {
2525
onThresholdAlertPublished,
26-
} = require("firebase-functions/v2/alerts/performance");
26+
} = require("firebase-functions/alerts/performance");
2727
const logger = require("firebase-functions/logger");
2828
// [END v2import]
2929

Node/app-distribution-feedback-to-jira/functions/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
import {
18-
onInAppFeedbackPublished} from "firebase-functions/v2/alerts/appDistribution";
18+
onInAppFeedbackPublished} from "firebase-functions/alerts/appDistribution";
1919
import {defineInt, defineSecret, defineString} from "firebase-functions/params";
2020
import logger from "firebase-functions/logger";
2121
import fetch from "node-fetch";

Node/call-vertex-remote-config-server/functions/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
// [START remote_config_server_vertex_init]
19-
const { onCall, HttpsError } = require("firebase-functions/v2/https");
19+
const { onCall, HttpsError } = require("firebase-functions/https");
2020
const logger = require("firebase-functions/logger");
2121

2222
const { initializeApp } = require("firebase-admin/app");

Node/delete-unused-accounts-cron/functions/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
// [START all]
1919
// [START import]
2020
// The Cloud Functions for Firebase SDK to set up triggers and logging.
21-
const {onSchedule} = require("firebase-functions/v2/scheduler");
21+
const {onSchedule} = require("firebase-functions/scheduler");
2222
const {logger} = require("firebase-functions");
2323

2424
// The Firebase Admin SDK to delete inactive users.

Node/fcm-notifications/functions/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {getAuth} from "firebase-admin/auth";
1919
import {getDatabase} from "firebase-admin/database";
2020
import {getMessaging} from "firebase-admin/messaging";
2121
import {log, warn} from "firebase-functions/logger";
22-
import {onValueWritten} from "firebase-functions/v2/database";
22+
import {onValueWritten} from "firebase-functions/database";
2323

2424
initializeApp();
2525
const auth = getAuth();

Node/instrument-with-opentelemetry/functions/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
const {onCall} = require("firebase-functions/v2/https");
17+
const {onCall} = require("firebase-functions/https");
1818
const logger = require("firebase-functions/logger");
1919
const {initializeApp} = require("firebase-admin/app");
2020
const {getFirestore} = require("firebase-admin/firestore");

Node/quickstarts/auth-blocking-functions/functions/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const {
1818
beforeUserCreated,
1919
beforeUserSignedIn,
2020
HttpsError,
21-
} = require("firebase-functions/v2/identity");
21+
} = require("firebase-functions/identity");
2222
const {admin} = require("firebase-admin");
2323

2424
admin.initializeApp();

Node/quickstarts/callable-functions-streaming/functions/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
// [START full-sample]
1818
// Dependencies for callable functions.
19-
const {onCall, HttpsError} = require("firebase-functions/v2/https");
19+
const {onCall, HttpsError} = require("firebase-functions/https");
2020

2121
/**
2222
* Gets the weather from the national weather service

Node/quickstarts/callable-functions/functions/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
// [START imports]
1818
// Dependencies for callable functions.
19-
const {onCall, HttpsError} = require("firebase-functions/v2/https");
20-
const {logger} = require("firebase-functions/v2");
19+
const {onCall, HttpsError} = require("firebase-functions/https");
20+
const {logger} = require("firebase-functions");
2121

2222
// Dependencies for the addMessage function.
2323
const {getDatabase} = require("firebase-admin/database");

Node/quickstarts/custom-events/functions/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
// [START import]
18-
const {onCustomEventPublished} = require("firebase-functions/v2/eventarc");
18+
const {onCustomEventPublished} = require("firebase-functions/eventarc");
1919
const logger = require("firebase-functions/logger");
2020
const {initializeApp} = require("firebase-admin/app");
2121
const {getFirestore} = require("firebase-admin/firestore");

0 commit comments

Comments
 (0)