firebase-functions 7.0.0-rc.1 → 7.0.0
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/lib/esm/logger/index.mjs +15 -1
- package/lib/esm/v2/index.mjs +2 -2
- package/lib/logger/index.d.ts +13 -0
- package/lib/logger/index.js +15 -0
- package/lib/v1/cloud-functions.d.ts +2 -2
- package/lib/v1/providers/firestore.d.ts +3 -3
- package/lib/v2/index.d.ts +2 -2
- package/lib/v2/index.js +1 -6
- package/package.json +5 -5
package/lib/esm/logger/index.mjs
CHANGED
|
@@ -9,6 +9,7 @@ var logger_exports = /* @__PURE__ */ __export({
|
|
|
9
9
|
error: () => error,
|
|
10
10
|
info: () => info,
|
|
11
11
|
log: () => log,
|
|
12
|
+
logger: () => logger,
|
|
12
13
|
warn: () => warn,
|
|
13
14
|
write: () => write
|
|
14
15
|
});
|
|
@@ -126,6 +127,19 @@ function entryFromArgs(severity, args) {
|
|
|
126
127
|
}
|
|
127
128
|
return out;
|
|
128
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Logger object containing all logging methods.
|
|
132
|
+
*
|
|
133
|
+
* Mockable for testing purposes.
|
|
134
|
+
*/
|
|
135
|
+
const logger = {
|
|
136
|
+
write,
|
|
137
|
+
debug,
|
|
138
|
+
log,
|
|
139
|
+
info,
|
|
140
|
+
warn,
|
|
141
|
+
error
|
|
142
|
+
};
|
|
129
143
|
|
|
130
144
|
//#endregion
|
|
131
|
-
export { debug, error, info, log, logger_exports, warn, write };
|
|
145
|
+
export { debug, error, info, log, logger, logger_exports, warn, write };
|
package/lib/esm/v2/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { traceContext } from "../common/trace.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { logger } from "../logger/index.mjs";
|
|
3
3
|
import { params_exports } from "../params/index.mjs";
|
|
4
4
|
import { setApp } from "../common/app.mjs";
|
|
5
5
|
import { Change } from "../common/change.mjs";
|
|
@@ -25,4 +25,4 @@ import { dataconnect_exports } from "./providers/dataconnect.mjs";
|
|
|
25
25
|
const app = { setEmulatedAdminApp: setApp };
|
|
26
26
|
|
|
27
27
|
//#endregion
|
|
28
|
-
export { Change, alerts_exports as alerts, app, config, database_exports as database, dataconnect_exports as dataconnect, eventarc_exports as eventarc, firestore_exports as firestore, https_exports as https, identity_exports as identity,
|
|
28
|
+
export { Change, alerts_exports as alerts, app, config, database_exports as database, dataconnect_exports as dataconnect, eventarc_exports as eventarc, firestore_exports as firestore, https_exports as https, identity_exports as identity, logger, onInit, params_exports as params, pubsub_exports as pubsub, remoteConfig_exports as remoteConfig, scheduler_exports as scheduler, setGlobalOptions, storage_exports as storage, tasks_exports as tasks, testLab_exports as testLab, traceContext };
|
package/lib/logger/index.d.ts
CHANGED
|
@@ -55,3 +55,16 @@ export declare function warn(...args: any[]): void;
|
|
|
55
55
|
* @public
|
|
56
56
|
*/
|
|
57
57
|
export declare function error(...args: any[]): void;
|
|
58
|
+
/**
|
|
59
|
+
* Logger object containing all logging methods.
|
|
60
|
+
*
|
|
61
|
+
* Mockable for testing purposes.
|
|
62
|
+
*/
|
|
63
|
+
export declare const logger: {
|
|
64
|
+
write: typeof write;
|
|
65
|
+
debug: typeof debug;
|
|
66
|
+
log: typeof log;
|
|
67
|
+
info: typeof info;
|
|
68
|
+
warn: typeof warn;
|
|
69
|
+
error: typeof error;
|
|
70
|
+
};
|
package/lib/logger/index.js
CHANGED
|
@@ -10,6 +10,7 @@ var logger_exports = /* @__PURE__ */ require_rolldown_runtime.__export({
|
|
|
10
10
|
error: () => error,
|
|
11
11
|
info: () => info,
|
|
12
12
|
log: () => log,
|
|
13
|
+
logger: () => logger,
|
|
13
14
|
warn: () => warn,
|
|
14
15
|
write: () => write
|
|
15
16
|
});
|
|
@@ -127,12 +128,26 @@ function entryFromArgs(severity, args) {
|
|
|
127
128
|
}
|
|
128
129
|
return out;
|
|
129
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* Logger object containing all logging methods.
|
|
133
|
+
*
|
|
134
|
+
* Mockable for testing purposes.
|
|
135
|
+
*/
|
|
136
|
+
const logger = {
|
|
137
|
+
write,
|
|
138
|
+
debug,
|
|
139
|
+
log,
|
|
140
|
+
info,
|
|
141
|
+
warn,
|
|
142
|
+
error
|
|
143
|
+
};
|
|
130
144
|
|
|
131
145
|
//#endregion
|
|
132
146
|
exports.debug = debug;
|
|
133
147
|
exports.error = error;
|
|
134
148
|
exports.info = info;
|
|
135
149
|
exports.log = log;
|
|
150
|
+
exports.logger = logger;
|
|
136
151
|
Object.defineProperty(exports, 'logger_exports', {
|
|
137
152
|
enumerable: true,
|
|
138
153
|
get: function () {
|
|
@@ -6,7 +6,7 @@ export { Change } from "../common/change";
|
|
|
6
6
|
/**
|
|
7
7
|
* Wire format for an event.
|
|
8
8
|
*/
|
|
9
|
-
export interface
|
|
9
|
+
export interface LegacyEvent {
|
|
10
10
|
/**
|
|
11
11
|
* Wire format for an event context.
|
|
12
12
|
*/
|
|
@@ -281,7 +281,7 @@ export interface BlockingFunction {
|
|
|
281
281
|
* from your JavaScript file to define a Cloud Function.
|
|
282
282
|
*
|
|
283
283
|
* This type is a special JavaScript function which takes a templated
|
|
284
|
-
* `
|
|
284
|
+
* `LegacyEvent` object as its only argument.
|
|
285
285
|
*/
|
|
286
286
|
export interface CloudFunction<T> extends Runnable<T> {
|
|
287
287
|
(input: any, context?: any): PromiseLike<any> | any;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as firestore from "firebase-admin/firestore";
|
|
2
2
|
import { Change } from "../../common/change";
|
|
3
3
|
import { ParamsOf } from "../../common/params";
|
|
4
|
-
import { CloudFunction,
|
|
4
|
+
import { CloudFunction, LegacyEvent, EventContext } from "../cloud-functions";
|
|
5
5
|
import { DeploymentOptions } from "../function-configuration";
|
|
6
6
|
export type DocumentSnapshot = firestore.DocumentSnapshot;
|
|
7
7
|
export type QueryDocumentSnapshot = firestore.QueryDocumentSnapshot;
|
|
@@ -29,8 +29,8 @@ export declare class NamespaceBuilder {
|
|
|
29
29
|
constructor(database: string, options: DeploymentOptions, namespace?: string);
|
|
30
30
|
document<Path extends string>(path: Path): DocumentBuilder<Path>;
|
|
31
31
|
}
|
|
32
|
-
export declare function snapshotConstructor(event:
|
|
33
|
-
export declare function beforeSnapshotConstructor(event:
|
|
32
|
+
export declare function snapshotConstructor(event: LegacyEvent): DocumentSnapshot;
|
|
33
|
+
export declare function beforeSnapshotConstructor(event: LegacyEvent): DocumentSnapshot;
|
|
34
34
|
export declare class DocumentBuilder<Path extends string> {
|
|
35
35
|
private triggerResource;
|
|
36
36
|
private options;
|
package/lib/v2/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* from `firebase-functions/v2/pubsub`.
|
|
6
6
|
* @packageDocumentation
|
|
7
7
|
*/
|
|
8
|
-
import * as logger from "../logger";
|
|
9
8
|
import * as alerts from "./providers/alerts";
|
|
10
9
|
import * as database from "./providers/database";
|
|
11
10
|
import * as eventarc from "./providers/eventarc";
|
|
@@ -19,7 +18,8 @@ import * as remoteConfig from "./providers/remoteConfig";
|
|
|
19
18
|
import * as testLab from "./providers/testLab";
|
|
20
19
|
import * as firestore from "./providers/firestore";
|
|
21
20
|
import * as dataconnect from "./providers/dataconnect";
|
|
22
|
-
export { alerts, database, storage, https, identity, pubsub,
|
|
21
|
+
export { alerts, database, storage, https, identity, pubsub, tasks, eventarc, scheduler, remoteConfig, testLab, firestore, dataconnect, };
|
|
22
|
+
export { logger } from "../logger";
|
|
23
23
|
export { setGlobalOptions } from "./options";
|
|
24
24
|
export type { GlobalOptions, SupportedRegion, MemoryOption, VpcEgressSetting, IngressSetting, EventHandlerOptions, } from "./options";
|
|
25
25
|
export { onInit } from "./core";
|
package/lib/v2/index.js
CHANGED
|
@@ -70,12 +70,7 @@ Object.defineProperty(exports, 'identity', {
|
|
|
70
70
|
return require_v2_providers_identity.identity_exports;
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
|
-
|
|
74
|
-
enumerable: true,
|
|
75
|
-
get: function () {
|
|
76
|
-
return require_logger_index.logger_exports;
|
|
77
|
-
}
|
|
78
|
-
});
|
|
73
|
+
exports.logger = require_logger_index.logger;
|
|
79
74
|
exports.onInit = require_common_onInit.onInit;
|
|
80
75
|
Object.defineProperty(exports, 'params', {
|
|
81
76
|
enumerable: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firebase-functions",
|
|
3
|
-
"version": "7.0.0
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Firebase SDK for Cloud Functions",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"firebase",
|
|
@@ -307,16 +307,16 @@
|
|
|
307
307
|
"typesVersions": {
|
|
308
308
|
"*": {
|
|
309
309
|
"logger": [
|
|
310
|
-
"lib/logger"
|
|
310
|
+
"lib/logger/index"
|
|
311
311
|
],
|
|
312
312
|
"logger/compat": [
|
|
313
313
|
"lib/logger/compat"
|
|
314
314
|
],
|
|
315
315
|
"params": [
|
|
316
|
-
"lib/params"
|
|
316
|
+
"lib/params/index"
|
|
317
317
|
],
|
|
318
318
|
"v1": [
|
|
319
|
-
"lib/v1"
|
|
319
|
+
"lib/v1/index"
|
|
320
320
|
],
|
|
321
321
|
"v1/analytics": [
|
|
322
322
|
"lib/v1/providers/analytics"
|
|
@@ -406,7 +406,7 @@
|
|
|
406
406
|
"lib/v2/providers/dataconnect"
|
|
407
407
|
],
|
|
408
408
|
"v2": [
|
|
409
|
-
"lib/v2"
|
|
409
|
+
"lib/v2/index"
|
|
410
410
|
],
|
|
411
411
|
"v2/core": [
|
|
412
412
|
"lib/v2/core"
|