1
1
import * as admin from "firebase-admin" ;
2
- import * as functions from "firebase-functions" ;
2
+ import * as functions from "firebase-functions/v1 " ;
3
3
import { REGION } from "../region" ;
4
4
import { sanitizeData } from "../utils" ;
5
5
6
- export const firestoreDocumentOnCreateTests : any = functions
6
+ export const firestoreDocumentOnCreateTests = functions
7
7
. runWith ( {
8
8
timeoutSeconds : 540 ,
9
9
} )
10
10
. region ( REGION )
11
11
. firestore . document ( "tests/{testId}" )
12
- . onCreate ( async ( snapshot , context ) => {
12
+ . onCreate ( async ( _snapshot , context ) => {
13
13
const testId = context . params . testId ;
14
14
await admin
15
15
. firestore ( )
@@ -18,13 +18,13 @@ export const firestoreDocumentOnCreateTests: any = functions
18
18
. set ( sanitizeData ( context ) ) ;
19
19
} ) ;
20
20
21
- export const firestoreDocumentOnDeleteTests : any = functions
21
+ export const firestoreDocumentOnDeleteTests = functions
22
22
. runWith ( {
23
23
timeoutSeconds : 540 ,
24
24
} )
25
25
. region ( REGION )
26
26
. firestore . document ( "tests/{testId}" )
27
- . onDelete ( async ( snapshot , context ) => {
27
+ . onDelete ( async ( _snapshot , context ) => {
28
28
const testId = context . params . testId ;
29
29
await admin
30
30
. firestore ( )
@@ -33,13 +33,13 @@ export const firestoreDocumentOnDeleteTests: any = functions
33
33
. set ( sanitizeData ( context ) ) ;
34
34
} ) ;
35
35
36
- export const firestoreDocumentOnUpdateTests : any = functions
36
+ export const firestoreDocumentOnUpdateTests = functions
37
37
. runWith ( {
38
38
timeoutSeconds : 540 ,
39
39
} )
40
40
. region ( REGION )
41
41
. firestore . document ( "tests/{testId}" )
42
- . onUpdate ( async ( change , context ) => {
42
+ . onUpdate ( async ( _change , context ) => {
43
43
const testId = context . params . testId ;
44
44
await admin
45
45
. firestore ( )
@@ -48,13 +48,13 @@ export const firestoreDocumentOnUpdateTests: any = functions
48
48
. set ( sanitizeData ( context ) ) ;
49
49
} ) ;
50
50
51
- export const firestoreDocumentOnWriteTests : any = functions
51
+ export const firestoreDocumentOnWriteTests = functions
52
52
. runWith ( {
53
53
timeoutSeconds : 540 ,
54
54
} )
55
55
. region ( REGION )
56
56
. firestore . document ( "tests/{testId}" )
57
- . onWrite ( async ( change , context ) => {
57
+ . onWrite ( async ( _change , context ) => {
58
58
const testId = context . params . testId ;
59
59
await admin
60
60
. firestore ( )
0 commit comments