firebase-functions 6.6.0 → 7.0.0-rc.1
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/_virtual/rolldown_runtime.js +34 -0
- package/lib/bin/firebase-functions.js +78 -103
- package/lib/common/app.js +35 -55
- package/lib/common/change.js +54 -75
- package/lib/common/config.js +41 -41
- package/lib/common/debug.js +23 -47
- package/lib/common/encoding.js +59 -82
- package/lib/common/onInit.js +26 -28
- package/lib/common/options.js +22 -42
- package/lib/common/params.d.ts +6 -6
- package/lib/common/params.js +0 -23
- package/lib/common/providers/database.js +270 -300
- package/lib/common/providers/firestore.js +66 -92
- package/lib/common/providers/https.d.ts +0 -1
- package/lib/common/providers/https.js +537 -539
- package/lib/common/providers/identity.js +393 -444
- package/lib/common/providers/tasks.js +64 -98
- package/lib/common/timezone.js +544 -542
- package/lib/common/trace.d.ts +0 -1
- package/lib/common/trace.js +63 -55
- package/lib/common/utilities/assertions.d.ts +11 -0
- package/lib/common/utilities/assertions.js +18 -0
- package/lib/common/utilities/encoder.js +20 -37
- package/lib/common/utilities/path-pattern.js +106 -132
- package/lib/common/utilities/path.js +28 -27
- package/lib/common/utilities/utils.js +23 -45
- package/lib/esm/_virtual/rolldown_runtime.mjs +16 -0
- package/lib/esm/bin/firebase-functions.mjs +91 -0
- package/lib/esm/common/app.mjs +39 -0
- package/lib/esm/common/change.mjs +57 -0
- package/lib/esm/common/config.mjs +45 -0
- package/lib/esm/common/debug.mjs +28 -0
- package/lib/esm/common/encoding.mjs +69 -0
- package/lib/esm/common/onInit.mjs +33 -0
- package/lib/esm/common/options.mjs +22 -0
- package/lib/esm/common/params.mjs +1 -0
- package/lib/esm/common/providers/database.mjs +269 -0
- package/lib/esm/common/providers/firestore.mjs +78 -0
- package/lib/esm/common/providers/https.mjs +573 -0
- package/lib/esm/common/providers/identity.mjs +428 -0
- package/lib/esm/common/providers/tasks.mjs +67 -0
- package/lib/esm/common/timezone.mjs +544 -0
- package/lib/esm/common/trace.mjs +73 -0
- package/lib/esm/common/utilities/assertions.mjs +17 -0
- package/lib/esm/common/utilities/encoder.mjs +21 -0
- package/lib/esm/common/utilities/path-pattern.mjs +116 -0
- package/lib/esm/common/utilities/path.mjs +35 -0
- package/lib/esm/common/utilities/utils.mjs +29 -0
- package/lib/esm/function-configuration.mjs +1 -0
- package/lib/esm/logger/common.mjs +23 -0
- package/lib/esm/logger/compat.mjs +25 -0
- package/lib/esm/logger/index.mjs +131 -0
- package/lib/esm/params/index.mjs +160 -0
- package/lib/esm/params/types.mjs +400 -0
- package/lib/esm/runtime/loader.mjs +132 -0
- package/lib/esm/runtime/manifest.mjs +134 -0
- package/lib/esm/types/global.d.mjs +1 -0
- package/lib/esm/v1/cloud-functions.mjs +206 -0
- package/lib/esm/v1/config.mjs +14 -0
- package/lib/esm/v1/function-builder.mjs +252 -0
- package/lib/esm/v1/function-configuration.mjs +72 -0
- package/lib/esm/v1/index.mjs +27 -0
- package/lib/esm/v1/providers/analytics.mjs +212 -0
- package/lib/esm/v1/providers/auth.mjs +156 -0
- package/lib/esm/v1/providers/database.mjs +243 -0
- package/lib/esm/v1/providers/firestore.mjs +131 -0
- package/lib/esm/v1/providers/https.mjs +82 -0
- package/lib/esm/v1/providers/pubsub.mjs +175 -0
- package/lib/esm/v1/providers/remoteConfig.mjs +64 -0
- package/lib/esm/v1/providers/storage.mjs +163 -0
- package/lib/esm/v1/providers/tasks.mjs +63 -0
- package/lib/esm/v1/providers/testLab.mjs +94 -0
- package/lib/esm/v2/core.mjs +4 -0
- package/lib/esm/v2/index.mjs +28 -0
- package/lib/esm/v2/options.mjs +102 -0
- package/lib/esm/v2/providers/alerts/alerts.mjs +85 -0
- package/lib/esm/v2/providers/alerts/appDistribution.mjs +75 -0
- package/lib/esm/v2/providers/alerts/billing.mjs +51 -0
- package/lib/esm/v2/providers/alerts/crashlytics.mjs +122 -0
- package/lib/esm/v2/providers/alerts/index.mjs +22 -0
- package/lib/esm/v2/providers/alerts/performance.mjs +66 -0
- package/lib/esm/v2/providers/database.mjs +197 -0
- package/lib/esm/v2/providers/dataconnect.mjs +130 -0
- package/lib/esm/v2/providers/eventarc.mjs +51 -0
- package/lib/esm/v2/providers/firestore.mjs +294 -0
- package/lib/esm/v2/providers/https.mjs +210 -0
- package/lib/esm/v2/providers/identity.mjs +103 -0
- package/lib/esm/v2/providers/pubsub.mjs +148 -0
- package/lib/esm/v2/providers/remoteConfig.mjs +52 -0
- package/lib/esm/v2/providers/scheduler.mjs +84 -0
- package/lib/esm/v2/providers/storage.mjs +155 -0
- package/lib/esm/v2/providers/tasks.mjs +65 -0
- package/lib/esm/v2/providers/testLab.mjs +53 -0
- package/lib/esm/v2/trace.mjs +20 -0
- package/lib/function-configuration.d.ts +0 -0
- package/lib/function-configuration.js +0 -0
- package/lib/logger/common.js +21 -41
- package/lib/logger/compat.js +18 -33
- package/lib/logger/index.js +119 -130
- package/lib/params/index.d.ts +4 -2
- package/lib/params/index.js +150 -144
- package/lib/params/types.js +389 -423
- package/lib/runtime/loader.js +114 -148
- package/lib/runtime/manifest.js +106 -126
- package/lib/types/global.d.js +0 -0
- package/lib/v1/cloud-functions.d.ts +2 -2
- package/lib/v1/cloud-functions.js +193 -241
- package/lib/v1/config.d.ts +4 -7
- package/lib/v1/config.js +13 -75
- package/lib/v1/function-builder.js +239 -368
- package/lib/v1/function-configuration.js +70 -63
- package/lib/v1/index.js +118 -73
- package/lib/v1/providers/analytics.js +188 -235
- package/lib/v1/providers/auth.d.ts +2 -1
- package/lib/v1/providers/auth.js +159 -164
- package/lib/v1/providers/database.js +237 -242
- package/lib/v1/providers/firestore.js +131 -130
- package/lib/v1/providers/https.d.ts +2 -1
- package/lib/v1/providers/https.js +79 -86
- package/lib/v1/providers/pubsub.js +175 -172
- package/lib/v1/providers/remoteConfig.js +64 -68
- package/lib/v1/providers/storage.js +161 -163
- package/lib/v1/providers/tasks.d.ts +1 -1
- package/lib/v1/providers/tasks.js +65 -80
- package/lib/v1/providers/testLab.js +94 -94
- package/lib/v2/core.d.ts +1 -1
- package/lib/v2/core.js +5 -32
- package/lib/v2/index.d.ts +6 -3
- package/lib/v2/index.js +123 -75
- package/lib/v2/options.js +88 -114
- package/lib/v2/providers/alerts/alerts.js +76 -95
- package/lib/v2/providers/alerts/appDistribution.js +73 -78
- package/lib/v2/providers/alerts/billing.js +49 -53
- package/lib/v2/providers/alerts/crashlytics.js +110 -102
- package/lib/v2/providers/alerts/index.js +56 -53
- package/lib/v2/providers/alerts/performance.js +64 -74
- package/lib/v2/providers/database.js +177 -180
- package/lib/v2/providers/dataconnect.d.ts +95 -0
- package/lib/v2/providers/dataconnect.js +137 -0
- package/lib/v2/providers/eventarc.js +55 -77
- package/lib/v2/providers/firestore.js +262 -260
- package/lib/v2/providers/https.d.ts +3 -2
- package/lib/v2/providers/https.js +210 -247
- package/lib/v2/providers/identity.d.ts +2 -1
- package/lib/v2/providers/identity.js +96 -105
- package/lib/v2/providers/pubsub.js +149 -167
- package/lib/v2/providers/remoteConfig.js +54 -63
- package/lib/v2/providers/scheduler.js +84 -96
- package/lib/v2/providers/storage.js +147 -162
- package/lib/v2/providers/tasks.d.ts +1 -1
- package/lib/v2/providers/tasks.js +68 -95
- package/lib/v2/providers/testLab.js +55 -64
- package/lib/v2/trace.js +18 -19
- package/package.json +321 -88
- package/protos/compiledFirestore.mjs +3512 -0
- package/protos/update.sh +28 -7
package/lib/logger/index.js
CHANGED
|
@@ -1,154 +1,143 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
// SOFTWARE.
|
|
23
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.error = exports.warn = exports.info = exports.log = exports.debug = exports.write = void 0;
|
|
25
|
-
const util_1 = require("util");
|
|
26
|
-
const trace_1 = require("../common/trace");
|
|
27
|
-
const common_1 = require("./common");
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
2
|
+
const require_common_trace = require('../common/trace.js');
|
|
3
|
+
const require_logger_common = require('./common.js');
|
|
4
|
+
let util = require("util");
|
|
5
|
+
util = require_rolldown_runtime.__toESM(util);
|
|
6
|
+
|
|
7
|
+
//#region src/logger/index.ts
|
|
8
|
+
var logger_exports = /* @__PURE__ */ require_rolldown_runtime.__export({
|
|
9
|
+
debug: () => debug,
|
|
10
|
+
error: () => error,
|
|
11
|
+
info: () => info,
|
|
12
|
+
log: () => log,
|
|
13
|
+
warn: () => warn,
|
|
14
|
+
write: () => write
|
|
15
|
+
});
|
|
28
16
|
/** @internal */
|
|
29
17
|
function removeCircular(obj, refs = new Set()) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
else {
|
|
65
|
-
returnObj[k] = "[Error - defined in the prototype but missing in the object]";
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
refs.delete(obj);
|
|
69
|
-
return returnObj;
|
|
18
|
+
if (typeof obj !== "object" || !obj) {
|
|
19
|
+
return obj;
|
|
20
|
+
}
|
|
21
|
+
if (obj.toJSON && typeof obj.toJSON === "function") {
|
|
22
|
+
return obj.toJSON();
|
|
23
|
+
}
|
|
24
|
+
if (refs.has(obj)) {
|
|
25
|
+
return "[Circular]";
|
|
26
|
+
} else {
|
|
27
|
+
refs.add(obj);
|
|
28
|
+
}
|
|
29
|
+
let returnObj;
|
|
30
|
+
if (Array.isArray(obj)) {
|
|
31
|
+
returnObj = new Array(obj.length);
|
|
32
|
+
} else {
|
|
33
|
+
returnObj = {};
|
|
34
|
+
}
|
|
35
|
+
for (const k in obj) {
|
|
36
|
+
if (obj.hasOwnProperty(k)) {
|
|
37
|
+
try {
|
|
38
|
+
if (refs.has(obj[k])) {
|
|
39
|
+
returnObj[k] = "[Circular]";
|
|
40
|
+
} else {
|
|
41
|
+
returnObj[k] = removeCircular(obj[k], refs);
|
|
42
|
+
}
|
|
43
|
+
} catch {
|
|
44
|
+
returnObj[k] = "[Error - cannot serialize]";
|
|
45
|
+
}
|
|
46
|
+
} else {
|
|
47
|
+
returnObj[k] = "[Error - defined in the prototype but missing in the object]";
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
refs.delete(obj);
|
|
51
|
+
return returnObj;
|
|
70
52
|
}
|
|
71
53
|
/**
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
54
|
+
* Writes a `LogEntry` to `stdout`/`stderr` (depending on severity).
|
|
55
|
+
* @param entry - The `LogEntry` including severity, message, and any additional structured metadata.
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
76
58
|
function write(entry) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
59
|
+
const ctx = require_common_trace.traceContext.getStore();
|
|
60
|
+
if (ctx?.traceId) {
|
|
61
|
+
entry["logging.googleapis.com/trace"] = `projects/${process.env.GCLOUD_PROJECT}/traces/${ctx.traceId}`;
|
|
62
|
+
}
|
|
63
|
+
require_logger_common.UNPATCHED_CONSOLE[require_logger_common.CONSOLE_SEVERITY[entry.severity]](JSON.stringify(removeCircular(entry)));
|
|
82
64
|
}
|
|
83
|
-
exports.write = write;
|
|
84
65
|
/**
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
66
|
+
* Writes a `DEBUG` severity log. If the last argument provided is a plain object,
|
|
67
|
+
* it is added to the `jsonPayload` in the Cloud Logging entry.
|
|
68
|
+
* @param args - Arguments, concatenated into the log message with space separators.
|
|
69
|
+
* @public
|
|
70
|
+
*/
|
|
90
71
|
function debug(...args) {
|
|
91
|
-
|
|
72
|
+
write(entryFromArgs("DEBUG", args));
|
|
92
73
|
}
|
|
93
|
-
exports.debug = debug;
|
|
94
74
|
/**
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
75
|
+
* Writes an `INFO` severity log. If the last argument provided is a plain object,
|
|
76
|
+
* it is added to the `jsonPayload` in the Cloud Logging entry.
|
|
77
|
+
* @param args - Arguments, concatenated into the log message with space separators.
|
|
78
|
+
* @public
|
|
79
|
+
*/
|
|
100
80
|
function log(...args) {
|
|
101
|
-
|
|
81
|
+
write(entryFromArgs("INFO", args));
|
|
102
82
|
}
|
|
103
|
-
exports.log = log;
|
|
104
83
|
/**
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
84
|
+
* Writes an `INFO` severity log. If the last argument provided is a plain object,
|
|
85
|
+
* it is added to the `jsonPayload` in the Cloud Logging entry.
|
|
86
|
+
* @param args - Arguments, concatenated into the log message with space separators.
|
|
87
|
+
* @public
|
|
88
|
+
*/
|
|
110
89
|
function info(...args) {
|
|
111
|
-
|
|
90
|
+
write(entryFromArgs("INFO", args));
|
|
112
91
|
}
|
|
113
|
-
exports.info = info;
|
|
114
92
|
/**
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
93
|
+
* Writes a `WARNING` severity log. If the last argument provided is a plain object,
|
|
94
|
+
* it is added to the `jsonPayload` in the Cloud Logging entry.
|
|
95
|
+
* @param args - Arguments, concatenated into the log message with space separators.
|
|
96
|
+
* @public
|
|
97
|
+
*/
|
|
120
98
|
function warn(...args) {
|
|
121
|
-
|
|
99
|
+
write(entryFromArgs("WARNING", args));
|
|
122
100
|
}
|
|
123
|
-
exports.warn = warn;
|
|
124
101
|
/**
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
102
|
+
* Writes an `ERROR` severity log. If the last argument provided is a plain object,
|
|
103
|
+
* it is added to the `jsonPayload` in the Cloud Logging entry.
|
|
104
|
+
* @param args - Arguments, concatenated into the log message with space separators.
|
|
105
|
+
* @public
|
|
106
|
+
*/
|
|
130
107
|
function error(...args) {
|
|
131
|
-
|
|
108
|
+
write(entryFromArgs("ERROR", args));
|
|
132
109
|
}
|
|
133
|
-
exports.error = error;
|
|
134
110
|
/** @hidden */
|
|
135
111
|
function entryFromArgs(severity, args) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
return out;
|
|
112
|
+
let entry = {};
|
|
113
|
+
const lastArg = args[args.length - 1];
|
|
114
|
+
if (lastArg && typeof lastArg === "object" && lastArg.constructor === Object) {
|
|
115
|
+
entry = args.pop();
|
|
116
|
+
}
|
|
117
|
+
let message = (0, util.format)(...args);
|
|
118
|
+
if (severity === "ERROR" && !args.find((arg) => arg instanceof Error)) {
|
|
119
|
+
message = new Error(message).stack || message;
|
|
120
|
+
}
|
|
121
|
+
const out = {
|
|
122
|
+
...entry,
|
|
123
|
+
severity
|
|
124
|
+
};
|
|
125
|
+
if (message) {
|
|
126
|
+
out.message = message;
|
|
127
|
+
}
|
|
128
|
+
return out;
|
|
154
129
|
}
|
|
130
|
+
|
|
131
|
+
//#endregion
|
|
132
|
+
exports.debug = debug;
|
|
133
|
+
exports.error = error;
|
|
134
|
+
exports.info = info;
|
|
135
|
+
exports.log = log;
|
|
136
|
+
Object.defineProperty(exports, 'logger_exports', {
|
|
137
|
+
enumerable: true,
|
|
138
|
+
get: function () {
|
|
139
|
+
return logger_exports;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
exports.warn = warn;
|
|
143
|
+
exports.write = write;
|
package/lib/params/index.d.ts
CHANGED
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
* @alpha
|
|
4
4
|
*/
|
|
5
5
|
import { BooleanParam, Expression, IntParam, Param, ParamOptions, SecretParam, JsonSecretParam, StringParam, ListParam } from "./types";
|
|
6
|
-
export { BUCKET_PICKER,
|
|
7
|
-
export {
|
|
6
|
+
export { BUCKET_PICKER, select, multiSelect } from "./types";
|
|
7
|
+
export type { TextInput, SelectInput, SelectOptions, MultiSelectInput } from "./types";
|
|
8
|
+
export { Expression };
|
|
9
|
+
export type { ParamOptions };
|
|
8
10
|
type SecretOrExpr = Param<any> | SecretParam | JsonSecretParam<any>;
|
|
9
11
|
export declare const declaredParams: SecretOrExpr[];
|
|
10
12
|
/**
|
package/lib/params/index.js
CHANGED
|
@@ -1,176 +1,182 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
2
|
+
const require_params_types = require('./types.js');
|
|
3
|
+
|
|
4
|
+
//#region src/params/index.ts
|
|
5
|
+
var params_exports = /* @__PURE__ */ require_rolldown_runtime.__export({
|
|
6
|
+
BUCKET_PICKER: () => require_params_types.BUCKET_PICKER,
|
|
7
|
+
Expression: () => require_params_types.Expression,
|
|
8
|
+
clearParams: () => clearParams,
|
|
9
|
+
databaseURL: () => databaseURL,
|
|
10
|
+
declaredParams: () => declaredParams,
|
|
11
|
+
defineBoolean: () => defineBoolean,
|
|
12
|
+
defineFloat: () => defineFloat,
|
|
13
|
+
defineInt: () => defineInt,
|
|
14
|
+
defineJsonSecret: () => defineJsonSecret,
|
|
15
|
+
defineList: () => defineList,
|
|
16
|
+
defineSecret: () => defineSecret,
|
|
17
|
+
defineString: () => defineString,
|
|
18
|
+
gcloudProject: () => gcloudProject,
|
|
19
|
+
multiSelect: () => require_params_types.multiSelect,
|
|
20
|
+
projectID: () => projectID,
|
|
21
|
+
select: () => require_params_types.select,
|
|
22
|
+
storageBucket: () => storageBucket
|
|
23
|
+
});
|
|
24
|
+
const declaredParams = [];
|
|
25
25
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
Object.defineProperty(exports, "Expression", { enumerable: true, get: function () { return types_1.Expression; } });
|
|
31
|
-
var types_2 = require("./types");
|
|
32
|
-
Object.defineProperty(exports, "BUCKET_PICKER", { enumerable: true, get: function () { return types_2.BUCKET_PICKER; } });
|
|
33
|
-
Object.defineProperty(exports, "select", { enumerable: true, get: function () { return types_2.select; } });
|
|
34
|
-
Object.defineProperty(exports, "multiSelect", { enumerable: true, get: function () { return types_2.multiSelect; } });
|
|
35
|
-
exports.declaredParams = [];
|
|
36
|
-
/**
|
|
37
|
-
* Use a helper to manage the list such that parameters are uniquely
|
|
38
|
-
* registered once only but order is preserved.
|
|
39
|
-
* @internal
|
|
40
|
-
*/
|
|
26
|
+
* Use a helper to manage the list such that parameters are uniquely
|
|
27
|
+
* registered once only but order is preserved.
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
41
30
|
function registerParam(param) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
31
|
+
for (let i = 0; i < declaredParams.length; i++) {
|
|
32
|
+
if (declaredParams[i].name === param.name) {
|
|
33
|
+
declaredParams.splice(i, 1);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
declaredParams.push(param);
|
|
48
37
|
}
|
|
49
38
|
/**
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
39
|
+
* For testing.
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
53
42
|
function clearParams() {
|
|
54
|
-
|
|
43
|
+
declaredParams.splice(0, declaredParams.length);
|
|
55
44
|
}
|
|
56
|
-
exports.clearParams = clearParams;
|
|
57
45
|
/**
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
46
|
+
* A built-in parameter that resolves to the default RTDB database URL associated
|
|
47
|
+
* with the project, without prompting the deployer. Empty string if none exists.
|
|
48
|
+
*/
|
|
49
|
+
const databaseURL = new require_params_types.InternalExpression("DATABASE_URL", (env) => JSON.parse(env.FIREBASE_CONFIG)?.databaseURL || "");
|
|
62
50
|
/**
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
51
|
+
* A built-in parameter that resolves to the Cloud project ID associated with
|
|
52
|
+
* the project, without prompting the deployer.
|
|
53
|
+
*/
|
|
54
|
+
const projectID = new require_params_types.InternalExpression("PROJECT_ID", (env) => JSON.parse(env.FIREBASE_CONFIG)?.projectId || "");
|
|
67
55
|
/**
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
56
|
+
* A built-in parameter that resolves to the Cloud project ID, without prompting
|
|
57
|
+
* the deployer.
|
|
58
|
+
*/
|
|
59
|
+
const gcloudProject = new require_params_types.InternalExpression("GCLOUD_PROJECT", (env) => JSON.parse(env.FIREBASE_CONFIG)?.projectId || "");
|
|
72
60
|
/**
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
61
|
+
* A builtin parameter that resolves to the Cloud storage bucket associated
|
|
62
|
+
* with the function, without prompting the deployer. Empty string if not
|
|
63
|
+
* defined.
|
|
64
|
+
*/
|
|
65
|
+
const storageBucket = new require_params_types.InternalExpression("STORAGE_BUCKET", (env) => JSON.parse(env.FIREBASE_CONFIG)?.storageBucket || "");
|
|
78
66
|
/**
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
67
|
+
* Declares a secret param, that will persist values only in Cloud Secret Manager.
|
|
68
|
+
* Secrets are stored internally as bytestrings. Use `ParamOptions.as` to provide type
|
|
69
|
+
* hinting during parameter resolution.
|
|
70
|
+
*
|
|
71
|
+
* @param name The name of the environment variable to use to load the parameter.
|
|
72
|
+
* @returns A parameter with a `string` return type for `.value`.
|
|
73
|
+
*/
|
|
86
74
|
function defineSecret(name) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
75
|
+
const param = new require_params_types.SecretParam(name);
|
|
76
|
+
registerParam(param);
|
|
77
|
+
return param;
|
|
90
78
|
}
|
|
91
|
-
exports.defineSecret = defineSecret;
|
|
92
79
|
/**
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
80
|
+
* Declares a secret parameter that retrieves a structured JSON object in Cloud Secret Manager.
|
|
81
|
+
* This is useful for managing groups of related configuration values, such as all settings
|
|
82
|
+
* for a third-party API, as a single unit.
|
|
83
|
+
*
|
|
84
|
+
* The secret value must be a valid JSON string. At runtime, the value will be automatically parsed
|
|
85
|
+
* and returned as a JavaScript object. If the value is not set or is not valid JSON, an error will be thrown.
|
|
86
|
+
*
|
|
87
|
+
* @param name The name of the environment variable to use to load the parameter.
|
|
88
|
+
* @returns A parameter whose `.value()` method returns the parsed JSON object.
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
104
91
|
function defineJsonSecret(name) {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
92
|
+
const param = new require_params_types.JsonSecretParam(name);
|
|
93
|
+
registerParam(param);
|
|
94
|
+
return param;
|
|
108
95
|
}
|
|
109
|
-
exports.defineJsonSecret = defineJsonSecret;
|
|
110
96
|
/**
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
97
|
+
* Declare a string parameter.
|
|
98
|
+
*
|
|
99
|
+
* @param name The name of the environment variable to use to load the parameter.
|
|
100
|
+
* @param options Configuration options for the parameter.
|
|
101
|
+
* @returns A parameter with a `string` return type for `.value`.
|
|
102
|
+
*/
|
|
117
103
|
function defineString(name, options = {}) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
104
|
+
const param = new require_params_types.StringParam(name, options);
|
|
105
|
+
registerParam(param);
|
|
106
|
+
return param;
|
|
121
107
|
}
|
|
122
|
-
exports.defineString = defineString;
|
|
123
108
|
/**
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
109
|
+
* Declare a boolean parameter.
|
|
110
|
+
*
|
|
111
|
+
* @param name The name of the environment variable to use to load the parameter.
|
|
112
|
+
* @param options Configuration options for the parameter.
|
|
113
|
+
* @returns A parameter with a `boolean` return type for `.value`.
|
|
114
|
+
*/
|
|
130
115
|
function defineBoolean(name, options = {}) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
116
|
+
const param = new require_params_types.BooleanParam(name, options);
|
|
117
|
+
registerParam(param);
|
|
118
|
+
return param;
|
|
134
119
|
}
|
|
135
|
-
exports.defineBoolean = defineBoolean;
|
|
136
120
|
/**
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
121
|
+
* Declare an integer parameter.
|
|
122
|
+
*
|
|
123
|
+
* @param name The name of the environment variable to use to load the parameter.
|
|
124
|
+
* @param options Configuration options for the parameter.
|
|
125
|
+
* @returns A parameter with a `number` return type for `.value`.
|
|
126
|
+
*/
|
|
143
127
|
function defineInt(name, options = {}) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
128
|
+
const param = new require_params_types.IntParam(name, options);
|
|
129
|
+
registerParam(param);
|
|
130
|
+
return param;
|
|
147
131
|
}
|
|
148
|
-
exports.defineInt = defineInt;
|
|
149
132
|
/**
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
133
|
+
* Declare a float parameter.
|
|
134
|
+
*
|
|
135
|
+
* @param name The name of the environment variable to use to load the parameter.
|
|
136
|
+
* @param options Configuration options for the parameter.
|
|
137
|
+
* @returns A parameter with a `number` return type for `.value`.
|
|
138
|
+
*
|
|
139
|
+
* @internal
|
|
140
|
+
*/
|
|
158
141
|
function defineFloat(name, options = {}) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
142
|
+
const param = new require_params_types.FloatParam(name, options);
|
|
143
|
+
registerParam(param);
|
|
144
|
+
return param;
|
|
162
145
|
}
|
|
163
|
-
exports.defineFloat = defineFloat;
|
|
164
146
|
/**
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
147
|
+
* Declare a list parameter.
|
|
148
|
+
*
|
|
149
|
+
* @param name The name of the environment variable to use to load the parameter.
|
|
150
|
+
* @param options Configuration options for the parameter.
|
|
151
|
+
* @returns A parameter with a `string[]` return type for `.value`.
|
|
152
|
+
*/
|
|
171
153
|
function defineList(name, options = {}) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
154
|
+
const param = new require_params_types.ListParam(name, options);
|
|
155
|
+
registerParam(param);
|
|
156
|
+
return param;
|
|
175
157
|
}
|
|
158
|
+
|
|
159
|
+
//#endregion
|
|
160
|
+
exports.BUCKET_PICKER = require_params_types.BUCKET_PICKER;
|
|
161
|
+
exports.Expression = require_params_types.Expression;
|
|
162
|
+
exports.clearParams = clearParams;
|
|
163
|
+
exports.databaseURL = databaseURL;
|
|
164
|
+
exports.declaredParams = declaredParams;
|
|
165
|
+
exports.defineBoolean = defineBoolean;
|
|
166
|
+
exports.defineFloat = defineFloat;
|
|
167
|
+
exports.defineInt = defineInt;
|
|
168
|
+
exports.defineJsonSecret = defineJsonSecret;
|
|
176
169
|
exports.defineList = defineList;
|
|
170
|
+
exports.defineSecret = defineSecret;
|
|
171
|
+
exports.defineString = defineString;
|
|
172
|
+
exports.gcloudProject = gcloudProject;
|
|
173
|
+
exports.multiSelect = require_params_types.multiSelect;
|
|
174
|
+
Object.defineProperty(exports, 'params_exports', {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
get: function () {
|
|
177
|
+
return params_exports;
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
exports.projectID = projectID;
|
|
181
|
+
exports.select = require_params_types.select;
|
|
182
|
+
exports.storageBucket = storageBucket;
|