Skip to content

Commit b78cbc4

Browse files
authored
Update to firebase-functions 6 (#243)
* firebase-functions + /v1; firebase-functions/v2 - /v2
1 parent c3c9abc commit b78cbc4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+92
-91
lines changed

package-lock.json

Lines changed: 10 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"@types/mocha": "^5.2.7",
4949
"chai": "^4.2.0",
5050
"firebase-admin": "^12.0.0",
51-
"firebase-functions": "^4.9.0",
51+
"firebase-functions": "^6.0.1",
5252
"firebase-tools": "^8.9.2",
5353
"mocha": "^6.2.2",
5454
"prettier": "^1.19.1",
@@ -58,7 +58,7 @@
5858
},
5959
"peerDependencies": {
6060
"firebase-admin": "^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0",
61-
"firebase-functions": ">=4.9.0",
61+
"firebase-functions": ">=6.0.1",
6262
"jest": ">=28.0.0"
6363
},
6464
"engines": {

spec/cloudevent/generate.ts

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

2323
import { expect } from 'chai';
2424

25-
import { alerts, storage } from 'firebase-functions/v2';
25+
import { alerts, storage } from 'firebase-functions';
2626
import { generateMockCloudEvent } from '../../src/cloudevent/generate';
2727

2828
describe('generate (CloudEvent)', () => {

spec/main.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
// SOFTWARE.
2222

2323
import { expect } from 'chai';
24-
import * as functions from 'firebase-functions';
24+
import * as functions from 'firebase-functions/v1';
2525
import { set } from 'lodash';
2626

2727
import { mockConfig, makeChange, wrap } from '../src/main';
2828
import { _makeResourceName, _extractParams } from '../src/v1';
2929
import { features } from '../src/features';
3030
import { FirebaseFunctionsTest } from '../src/lifecycle';
31-
import { alerts } from 'firebase-functions/v2';
31+
import { alerts } from 'firebase-functions';
3232
import { wrapV2 } from '../src/v2';
3333

3434
describe('main', () => {

spec/providers/https.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect } from 'chai';
2-
import * as functions from 'firebase-functions';
2+
import * as functions from 'firebase-functions/v1';
33
import fft = require('../../src/index');
44

55
const cfToUpperCaseOnRequest = functions.https.onRequest((req, res) => {

spec/providers/scheduled.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as sinon from 'sinon';
2-
import * as functions from 'firebase-functions';
2+
import * as functions from 'firebase-functions/v1';
33
import fft = require('../../src/index');
44
import { WrappedScheduledFunction } from '../../src/main';
55

spec/v2.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import {
3535
eventarc,
3636
https,
3737
firestore,
38-
} from 'firebase-functions/v2';
38+
} from 'firebase-functions';
3939
import { defineString } from 'firebase-functions/params';
4040
import { makeDataSnapshot } from '../src/providers/database';
4141
import { makeDocumentSnapshot } from '../src/providers/firestore';

src/cloudevent/generate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import {
33
CloudFunction,
44
database,
55
pubsub,
6-
} from 'firebase-functions/v2';
6+
} from 'firebase-functions';
77
import {
88
DocumentSnapshot,
99
QueryDocumentSnapshot,
1010
} from 'firebase-admin/firestore';
1111
import { LIST_OF_MOCK_CLOUD_EVENT_PARTIALS } from './mocks/partials';
1212
import { DeepPartial } from './types';
13-
import { Change } from 'firebase-functions';
13+
import { Change } from 'firebase-functions/v1';
1414
import merge from 'ts-deepmerge';
1515

1616
/**

src/cloudevent/mocks/alerts/alerts-on-alert-published.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { DeepPartial, MockCloudEventAbstractFactory } from '../../types';
2-
import { CloudFunction } from 'firebase-functions/v2';
2+
import { CloudFunction } from 'firebase-functions';
33
import {
44
APP_ID,
55
getBaseCloudEvent,
66
getEventType,
77
PROJECT_ID,
88
} from '../helpers';
9-
import { FirebaseAlertData, AlertEvent } from 'firebase-functions/v2/alerts';
9+
import { FirebaseAlertData, AlertEvent } from 'firebase-functions/alerts';
1010

1111
export const alertsOnAlertPublished: MockCloudEventAbstractFactory<AlertEvent<
1212
FirebaseAlertData

src/cloudevent/mocks/alerts/app-distribution-on-new-tester-ios-device-published.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { DeepPartial, MockCloudEventAbstractFactory } from '../../types';
2-
import { CloudFunction } from 'firebase-functions/v2';
2+
import { CloudFunction } from 'firebase-functions';
33
import {
44
getBaseCloudEvent,
55
getEventFilters,
@@ -9,7 +9,7 @@ import {
99
import {
1010
AppDistributionEvent,
1111
NewTesterDevicePayload,
12-
} from 'firebase-functions/v2/alerts/appDistribution';
12+
} from 'firebase-functions/alerts/appDistribution';
1313

1414
export const alertsAppDistributionOnNewTesterIosDevicePublished: MockCloudEventAbstractFactory<AppDistributionEvent<
1515
NewTesterDevicePayload

0 commit comments

Comments
 (0)