firebase-functions 3.24.1 → 4.0.0-rc.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/README.md +7 -9
- package/lib/bin/firebase-functions.js +13 -15
- package/lib/common/app.d.ts +14 -0
- package/lib/common/app.js +62 -0
- package/lib/common/change.d.ts +0 -5
- package/lib/common/change.js +5 -7
- package/lib/common/config.d.ts +6 -0
- package/lib/common/config.js +49 -0
- package/lib/common/debug.js +2 -2
- package/lib/common/encoding.d.ts +0 -8
- package/lib/common/encoding.js +6 -29
- package/lib/common/options.d.ts +14 -0
- package/lib/common/options.js +44 -0
- package/lib/common/params.d.ts +32 -0
- package/lib/common/params.js +23 -0
- package/lib/common/providers/database.d.ts +17 -19
- package/lib/common/providers/database.js +68 -39
- package/lib/common/providers/https.d.ts +11 -52
- package/lib/common/providers/https.js +115 -110
- package/lib/common/providers/identity.d.ts +8 -8
- package/lib/common/providers/identity.js +71 -79
- package/lib/common/providers/tasks.d.ts +11 -10
- package/lib/common/providers/tasks.js +10 -9
- package/lib/common/timezone.js +538 -538
- package/lib/common/trace.d.ts +14 -0
- package/lib/common/trace.js +69 -0
- package/lib/{encoder.d.ts → common/utilities/encoder.d.ts} +0 -0
- package/lib/{encoder.js → common/utilities/encoder.js} +1 -1
- package/lib/{utilities → common/utilities}/path-pattern.d.ts +0 -0
- package/lib/{utilities → common/utilities}/path-pattern.js +17 -16
- package/lib/{utilities → common/utilities}/path.d.ts +0 -0
- package/lib/{utilities → common/utilities}/path.js +5 -7
- package/lib/{utils.d.ts → common/utilities/utils.d.ts} +1 -1
- package/lib/{utils.js → common/utilities/utils.js} +18 -12
- package/lib/logger/common.d.ts +1 -3
- package/lib/logger/common.js +9 -14
- package/lib/logger/compat.js +9 -9
- package/lib/logger/index.d.ts +1 -1
- package/lib/logger/index.js +24 -30
- package/lib/{v2/params → params}/index.d.ts +22 -9
- package/lib/{v2/params → params}/index.js +22 -14
- package/lib/params/types.d.ts +180 -0
- package/lib/params/types.js +289 -0
- package/lib/runtime/loader.js +12 -14
- package/lib/runtime/manifest.d.ts +56 -24
- package/lib/runtime/manifest.js +114 -4
- package/lib/v1/cloud-functions.d.ts +232 -0
- package/lib/v1/cloud-functions.js +205 -0
- package/lib/v1/config.d.ts +8 -0
- package/lib/v1/config.js +75 -0
- package/lib/{function-builder.d.ts → v1/function-builder.d.ts} +16 -16
- package/lib/{function-builder.js → v1/function-builder.js} +56 -46
- package/lib/v1/function-configuration.d.ts +197 -0
- package/lib/v1/function-configuration.js +70 -0
- package/lib/v1/index.d.ts +20 -0
- package/lib/{index.js → v1/index.js} +5 -10
- package/lib/{providers → v1/providers}/analytics.d.ts +5 -11
- package/lib/{providers → v1/providers}/analytics.js +49 -43
- package/lib/{providers → v1/providers}/auth.d.ts +28 -18
- package/lib/{providers → v1/providers}/auth.js +45 -34
- package/lib/{providers → v1/providers}/database.d.ts +25 -42
- package/lib/{providers → v1/providers}/database.js +46 -46
- package/lib/{providers → v1/providers}/firestore.d.ts +15 -33
- package/lib/{providers → v1/providers}/firestore.js +40 -44
- package/lib/{providers → v1/providers}/https.d.ts +3 -8
- package/lib/{providers → v1/providers}/https.js +14 -22
- package/lib/{providers → v1/providers}/pubsub.d.ts +8 -16
- package/lib/{providers → v1/providers}/pubsub.js +22 -26
- package/lib/{providers → v1/providers}/remoteConfig.d.ts +2 -11
- package/lib/{providers → v1/providers}/remoteConfig.js +9 -9
- package/lib/{providers → v1/providers}/storage.d.ts +11 -26
- package/lib/{providers → v1/providers}/storage.js +24 -29
- package/lib/{providers → v1/providers}/tasks.d.ts +6 -8
- package/lib/{providers → v1/providers}/tasks.js +12 -17
- package/lib/{providers → v1/providers}/testLab.d.ts +86 -46
- package/lib/{providers → v1/providers}/testLab.js +14 -14
- package/lib/v2/core.d.ts +4 -5
- package/lib/v2/index.d.ts +16 -14
- package/lib/v2/index.js +5 -1
- package/lib/v2/options.d.ts +52 -32
- package/lib/v2/options.js +32 -47
- package/lib/v2/providers/alerts/alerts.d.ts +20 -18
- package/lib/v2/providers/alerts/alerts.js +9 -6
- package/lib/v2/providers/alerts/appDistribution.d.ts +28 -26
- package/lib/v2/providers/alerts/appDistribution.js +8 -7
- package/lib/v2/providers/alerts/billing.d.ts +5 -5
- package/lib/v2/providers/alerts/billing.js +5 -4
- package/lib/v2/providers/alerts/crashlytics.d.ts +32 -30
- package/lib/v2/providers/alerts/crashlytics.js +10 -9
- package/lib/v2/providers/alerts/index.d.ts +5 -5
- package/lib/v2/providers/alerts/performance.d.ts +3 -3
- package/lib/v2/providers/alerts/performance.js +5 -7
- package/lib/v2/providers/database.d.ts +41 -38
- package/lib/v2/providers/database.js +22 -17
- package/lib/v2/providers/eventarc.d.ts +25 -23
- package/lib/v2/providers/eventarc.js +10 -7
- package/lib/v2/providers/https.d.ts +43 -33
- package/lib/v2/providers/https.js +18 -56
- package/lib/v2/providers/identity.d.ts +25 -23
- package/lib/v2/providers/identity.js +10 -7
- package/lib/v2/providers/pubsub.d.ts +25 -23
- package/lib/v2/providers/pubsub.js +11 -27
- package/lib/v2/providers/remoteConfig.d.ts +63 -0
- package/lib/v2/providers/remoteConfig.js +65 -0
- package/lib/v2/providers/scheduler.d.ts +14 -12
- package/lib/v2/providers/scheduler.js +16 -14
- package/lib/v2/providers/storage.d.ts +32 -30
- package/lib/v2/providers/storage.js +16 -32
- package/lib/v2/providers/tasks.d.ts +30 -26
- package/lib/v2/providers/tasks.js +14 -31
- package/lib/v2/providers/testLab.d.ts +110 -0
- package/lib/v2/providers/testLab.js +65 -0
- package/lib/v2/trace.d.ts +4 -0
- package/lib/v2/trace.js +21 -0
- package/package.json +61 -66
- package/lib/apps.d.ts +0 -35
- package/lib/apps.js +0 -112
- package/lib/cloud-functions.d.ts +0 -231
- package/lib/cloud-functions.js +0 -251
- package/lib/config.d.ts +0 -24
- package/lib/config.js +0 -117
- package/lib/function-configuration.d.ts +0 -108
- package/lib/function-configuration.js +0 -71
- package/lib/handler-builder.d.ts +0 -256
- package/lib/handler-builder.js +0 -349
- package/lib/index.d.ts +0 -19
- package/lib/setup.d.ts +0 -1
- package/lib/setup.js +0 -60
- package/lib/v2/params/types.d.ts +0 -118
- package/lib/v2/params/types.js +0 -196
|
@@ -22,17 +22,19 @@
|
|
|
22
22
|
// SOFTWARE.
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
24
|
exports.DataSnapshot = void 0;
|
|
25
|
-
const
|
|
26
|
-
const
|
|
25
|
+
const database = require("firebase-admin/database");
|
|
26
|
+
const config_1 = require("../../common/config");
|
|
27
|
+
const path_1 = require("../../common/utilities/path");
|
|
27
28
|
/**
|
|
28
|
-
* Interface representing a Firebase Realtime
|
|
29
|
+
* Interface representing a Firebase Realtime database data snapshot.
|
|
29
30
|
*/
|
|
30
31
|
class DataSnapshot {
|
|
31
|
-
constructor(data, path, // path
|
|
32
|
+
constructor(data, path, // path is undefined for the database root
|
|
32
33
|
app, instance) {
|
|
33
34
|
var _a, _b;
|
|
34
35
|
this.app = app;
|
|
35
|
-
|
|
36
|
+
const config = (0, config_1.firebaseConfig)();
|
|
37
|
+
if ((_b = (_a = app === null || app === void 0 ? void 0 : app.options) === null || _a === void 0 ? void 0 : _a.databaseURL) === null || _b === void 0 ? void 0 : _b.startsWith("http:")) {
|
|
36
38
|
// In this case we're dealing with an emulator
|
|
37
39
|
this.instance = app.options.databaseURL;
|
|
38
40
|
}
|
|
@@ -43,40 +45,50 @@ class DataSnapshot {
|
|
|
43
45
|
else if (app) {
|
|
44
46
|
this.instance = app.options.databaseURL;
|
|
45
47
|
}
|
|
48
|
+
else if (config.databaseURL) {
|
|
49
|
+
this.instance = config.databaseURL;
|
|
50
|
+
}
|
|
46
51
|
else if (process.env.GCLOUD_PROJECT) {
|
|
47
|
-
this.instance =
|
|
48
|
-
'https://' + process.env.GCLOUD_PROJECT + '.firebaseio.com';
|
|
52
|
+
this.instance = "https://" + process.env.GCLOUD_PROJECT + "-default-rtdb.firebaseio.com";
|
|
49
53
|
}
|
|
50
54
|
this._path = path;
|
|
51
55
|
this._data = data;
|
|
52
56
|
}
|
|
53
57
|
/**
|
|
54
58
|
* Returns a [`Reference`](/docs/reference/admin/node/admin.database.Reference)
|
|
55
|
-
* to the
|
|
59
|
+
* to the database location where the triggering write occurred. Has
|
|
56
60
|
* full read and write access.
|
|
57
61
|
*/
|
|
58
62
|
get ref() {
|
|
59
63
|
if (!this.app) {
|
|
60
64
|
// may be unpopulated in user's unit tests
|
|
61
|
-
throw new Error(
|
|
62
|
-
|
|
65
|
+
throw new Error("Please supply a Firebase app in the constructor for DataSnapshot" +
|
|
66
|
+
" in order to use the .ref method.");
|
|
63
67
|
}
|
|
64
68
|
if (!this._ref) {
|
|
65
|
-
|
|
69
|
+
let db;
|
|
70
|
+
if (this.instance) {
|
|
71
|
+
db = database.getDatabaseWithUrl(this.instance, this.app);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
db = database.getDatabase(this.app);
|
|
75
|
+
}
|
|
76
|
+
this._ref = db.ref(this._fullPath());
|
|
66
77
|
}
|
|
67
78
|
return this._ref;
|
|
68
79
|
}
|
|
69
80
|
/**
|
|
70
81
|
* The key (last part of the path) of the location of this `DataSnapshot`.
|
|
71
82
|
*
|
|
72
|
-
* The last token in a
|
|
83
|
+
* The last token in a database location is considered its key. For example,
|
|
73
84
|
* "ada" is the key for the `/users/ada/` node. Accessing the key on any
|
|
74
|
-
* `DataSnapshot`
|
|
75
|
-
* However, accessing the key on the root URL of a
|
|
85
|
+
* `DataSnapshot` returns the key for the location that generated it.
|
|
86
|
+
* However, accessing the key on the root URL of a database returns `null`.
|
|
76
87
|
*/
|
|
77
88
|
get key() {
|
|
78
|
-
const
|
|
79
|
-
|
|
89
|
+
const segments = (0, path_1.pathParts)(this._fullPath());
|
|
90
|
+
const last = segments[segments.length - 1];
|
|
91
|
+
return !last || last === "" ? null : last;
|
|
80
92
|
}
|
|
81
93
|
/**
|
|
82
94
|
* Extracts a JavaScript value from a `DataSnapshot`.
|
|
@@ -86,21 +98,23 @@ class DataSnapshot {
|
|
|
86
98
|
* return `null`, indicating that the `DataSnapshot` is empty (contains no
|
|
87
99
|
* data).
|
|
88
100
|
*
|
|
89
|
-
* @return The
|
|
101
|
+
* @return The snapshot's contents as a JavaScript value (Object,
|
|
90
102
|
* Array, string, number, boolean, or `null`).
|
|
91
103
|
*/
|
|
92
104
|
val() {
|
|
93
105
|
const parts = (0, path_1.pathParts)(this._childPath);
|
|
94
|
-
|
|
95
|
-
|
|
106
|
+
let source = this._data;
|
|
107
|
+
if (parts.length) {
|
|
108
|
+
for (const part of parts) {
|
|
109
|
+
source = source[part];
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
const node = source !== null && source !== void 0 ? source : null;
|
|
96
113
|
return this._checkAndConvertToArray(node);
|
|
97
114
|
}
|
|
98
115
|
/**
|
|
99
116
|
* Exports the entire contents of the `DataSnapshot` as a JavaScript object.
|
|
100
117
|
*
|
|
101
|
-
* The `exportVal()` method is similar to `val()`, except priority information
|
|
102
|
-
* is included (if available), making it suitable for backing up your data.
|
|
103
|
-
*
|
|
104
118
|
* @return The contents of the `DataSnapshot` as a JavaScript value
|
|
105
119
|
* (Object, Array, string, number, boolean, or `null`).
|
|
106
120
|
*/
|
|
@@ -126,7 +140,14 @@ class DataSnapshot {
|
|
|
126
140
|
* @return `true` if this `DataSnapshot` contains any data; otherwise, `false`.
|
|
127
141
|
*/
|
|
128
142
|
exists() {
|
|
129
|
-
|
|
143
|
+
const val = this.val();
|
|
144
|
+
if (!val || val === null) {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
if (typeof val === "object" && Object.keys(val).length === 0) {
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
return true;
|
|
130
151
|
}
|
|
131
152
|
/**
|
|
132
153
|
* Gets a `DataSnapshot` for the location at the specified relative path.
|
|
@@ -151,22 +172,22 @@ class DataSnapshot {
|
|
|
151
172
|
* JavaScript object returned by `val()` is not guaranteed to match the ordering
|
|
152
173
|
* on the server nor the ordering of `child_added` events. That is where
|
|
153
174
|
* `forEach()` comes in handy. It guarantees the children of a `DataSnapshot`
|
|
154
|
-
*
|
|
175
|
+
* can be iterated in their query order.
|
|
155
176
|
*
|
|
156
177
|
* If no explicit `orderBy*()` method is used, results are returned
|
|
157
178
|
* ordered by key (unless priorities are used, in which case, results are
|
|
158
179
|
* returned by priority).
|
|
159
180
|
*
|
|
160
|
-
* @param action A function that
|
|
181
|
+
* @param action A function that is called for each child `DataSnapshot`.
|
|
161
182
|
* The callback can return `true` to cancel further enumeration.
|
|
162
183
|
*
|
|
163
184
|
* @return `true` if enumeration was canceled due to your callback
|
|
164
185
|
* returning `true`.
|
|
165
186
|
*/
|
|
166
187
|
forEach(action) {
|
|
167
|
-
const val = this.val();
|
|
168
|
-
if (
|
|
169
|
-
return
|
|
188
|
+
const val = this.val() || {};
|
|
189
|
+
if (typeof val === "object") {
|
|
190
|
+
return Object.keys(val).some((key) => action(this.child(key)) === true);
|
|
170
191
|
}
|
|
171
192
|
return false;
|
|
172
193
|
}
|
|
@@ -187,14 +208,14 @@ class DataSnapshot {
|
|
|
187
208
|
* You can use `hasChildren()` to determine if a `DataSnapshot` has any
|
|
188
209
|
* children. If it does, you can enumerate them using `forEach()`. If it
|
|
189
210
|
* doesn't, then either this snapshot contains a primitive value (which can be
|
|
190
|
-
* retrieved with `val()`) or it is empty (in which case, `val()`
|
|
211
|
+
* retrieved with `val()`) or it is empty (in which case, `val()` returns
|
|
191
212
|
* `null`).
|
|
192
213
|
*
|
|
193
214
|
* @return `true` if this snapshot has any children; else `false`.
|
|
194
215
|
*/
|
|
195
216
|
hasChildren() {
|
|
196
217
|
const val = this.val();
|
|
197
|
-
return
|
|
218
|
+
return val !== null && typeof val === "object" && Object.keys(val).length > 0;
|
|
198
219
|
}
|
|
199
220
|
/**
|
|
200
221
|
* Returns the number of child properties of this `DataSnapshot`.
|
|
@@ -203,7 +224,7 @@ class DataSnapshot {
|
|
|
203
224
|
*/
|
|
204
225
|
numChildren() {
|
|
205
226
|
const val = this.val();
|
|
206
|
-
return
|
|
227
|
+
return val !== null && typeof val === "object" ? Object.keys(val).length : 0;
|
|
207
228
|
}
|
|
208
229
|
/**
|
|
209
230
|
* Returns a JSON-serializable representation of this object.
|
|
@@ -218,10 +239,10 @@ class DataSnapshot {
|
|
|
218
239
|
* @hidden
|
|
219
240
|
*/
|
|
220
241
|
_checkAndConvertToArray(node) {
|
|
221
|
-
if (node === null || typeof node ===
|
|
242
|
+
if (node === null || typeof node === "undefined") {
|
|
222
243
|
return null;
|
|
223
244
|
}
|
|
224
|
-
if (typeof node !==
|
|
245
|
+
if (typeof node !== "object") {
|
|
225
246
|
return node;
|
|
226
247
|
}
|
|
227
248
|
const obj = {};
|
|
@@ -233,7 +254,12 @@ class DataSnapshot {
|
|
|
233
254
|
continue;
|
|
234
255
|
}
|
|
235
256
|
const childNode = node[key];
|
|
236
|
-
|
|
257
|
+
const v = this._checkAndConvertToArray(childNode);
|
|
258
|
+
if (v === null) {
|
|
259
|
+
// Empty child node
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
262
|
+
obj[key] = v;
|
|
237
263
|
numKeys++;
|
|
238
264
|
const integerRegExp = /^(0|[1-9]\d*)$/;
|
|
239
265
|
if (allIntegerKeys && integerRegExp.test(key)) {
|
|
@@ -243,12 +269,16 @@ class DataSnapshot {
|
|
|
243
269
|
allIntegerKeys = false;
|
|
244
270
|
}
|
|
245
271
|
}
|
|
272
|
+
if (numKeys === 0) {
|
|
273
|
+
// Empty node
|
|
274
|
+
return null;
|
|
275
|
+
}
|
|
246
276
|
if (allIntegerKeys && maxKey < 2 * numKeys) {
|
|
247
277
|
// convert to array.
|
|
248
278
|
const array = [];
|
|
249
|
-
|
|
250
|
-
array[key] =
|
|
251
|
-
}
|
|
279
|
+
for (const key of Object.keys(obj)) {
|
|
280
|
+
array[key] = obj[key];
|
|
281
|
+
}
|
|
252
282
|
return array;
|
|
253
283
|
}
|
|
254
284
|
return obj;
|
|
@@ -264,8 +294,7 @@ class DataSnapshot {
|
|
|
264
294
|
}
|
|
265
295
|
/** @hidden */
|
|
266
296
|
_fullPath() {
|
|
267
|
-
|
|
268
|
-
return out;
|
|
297
|
+
return (this._path || "") + "/" + (this._childPath || "");
|
|
269
298
|
}
|
|
270
299
|
}
|
|
271
300
|
exports.DataSnapshot = DataSnapshot;
|
|
@@ -1,54 +1,13 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import * as express from
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
2
|
+
import * as express from "express";
|
|
3
|
+
import { DecodedAppCheckToken } from "firebase-admin/app-check";
|
|
4
|
+
import { DecodedIdToken } from "firebase-admin/auth";
|
|
5
|
+
import { TaskContext } from "./tasks";
|
|
6
|
+
/** An express request with the wire format representation of the request body. */
|
|
6
7
|
export interface Request extends express.Request {
|
|
7
8
|
/** The wire format representation of the request body. */
|
|
8
9
|
rawBody: Buffer;
|
|
9
10
|
}
|
|
10
|
-
interface DecodedAppCheckToken {
|
|
11
|
-
/**
|
|
12
|
-
* The issuer identifier for the issuer of the response.
|
|
13
|
-
*
|
|
14
|
-
* This value is a URL with the format
|
|
15
|
-
* `https://firebaseappcheck.googleapis.com/<PROJECT_NUMBER>`, where `<PROJECT_NUMBER>` is the
|
|
16
|
-
* same project number specified in the [`aud`](#aud) property.
|
|
17
|
-
*/
|
|
18
|
-
iss: string;
|
|
19
|
-
/**
|
|
20
|
-
* The Firebase App ID corresponding to the app the token belonged to.
|
|
21
|
-
*
|
|
22
|
-
* As a convenience, this value is copied over to the [`app_id`](#app_id) property.
|
|
23
|
-
*/
|
|
24
|
-
sub: string;
|
|
25
|
-
/**
|
|
26
|
-
* The audience for which this token is intended.
|
|
27
|
-
*
|
|
28
|
-
* This value is a JSON array of two strings, the first is the project number of your
|
|
29
|
-
* Firebase project, and the second is the project ID of the same project.
|
|
30
|
-
*/
|
|
31
|
-
aud: string[];
|
|
32
|
-
/**
|
|
33
|
-
* The App Check token's expiration time, in seconds since the Unix epoch. That is, the
|
|
34
|
-
* time at which this App Check token expires and should no longer be considered valid.
|
|
35
|
-
*/
|
|
36
|
-
exp: number;
|
|
37
|
-
/**
|
|
38
|
-
* The App Check token's issued-at time, in seconds since the Unix epoch. That is, the
|
|
39
|
-
* time at which this App Check token was issued and should start to be considered
|
|
40
|
-
* valid.;
|
|
41
|
-
*/
|
|
42
|
-
iat: number;
|
|
43
|
-
/**
|
|
44
|
-
* The App ID corresponding to the App the App Check token belonged to.
|
|
45
|
-
*
|
|
46
|
-
* This value is not actually one of the JWT token claims. It is added as a
|
|
47
|
-
* convenience, and is set as the value of the [`sub`](#sub) property.
|
|
48
|
-
*/
|
|
49
|
-
app_id: string;
|
|
50
|
-
[key: string]: any;
|
|
51
|
-
}
|
|
52
11
|
/**
|
|
53
12
|
* The interface for AppCheck tokens verified in Callable functions
|
|
54
13
|
*/
|
|
@@ -61,7 +20,7 @@ export interface AppCheckData {
|
|
|
61
20
|
*/
|
|
62
21
|
export interface AuthData {
|
|
63
22
|
uid: string;
|
|
64
|
-
token:
|
|
23
|
+
token: DecodedIdToken;
|
|
65
24
|
}
|
|
66
25
|
/**
|
|
67
26
|
* The interface for metadata for the API as passed to the handler.
|
|
@@ -111,9 +70,9 @@ export interface CallableRequest<T = any> {
|
|
|
111
70
|
}
|
|
112
71
|
/**
|
|
113
72
|
* The set of Firebase Functions status codes. The codes are the same at the
|
|
114
|
-
* ones exposed by gRPC
|
|
115
|
-
* https://github.com/grpc/grpc/blob/master/doc/statuscodes.md
|
|
73
|
+
* ones exposed by {@link https://github.com/grpc/grpc/blob/master/doc/statuscodes.md | gRPC}.
|
|
116
74
|
*
|
|
75
|
+
* @remarks
|
|
117
76
|
* Possible values:
|
|
118
77
|
*
|
|
119
78
|
* - `cancelled`: The operation was cancelled (typically by the caller).
|
|
@@ -164,9 +123,9 @@ export interface CallableRequest<T = any> {
|
|
|
164
123
|
* - `unauthenticated`: The request does not have valid authentication
|
|
165
124
|
* credentials for the operation.
|
|
166
125
|
*/
|
|
167
|
-
export declare type FunctionsErrorCode =
|
|
126
|
+
export declare type FunctionsErrorCode = "ok" | "cancelled" | "unknown" | "invalid-argument" | "deadline-exceeded" | "not-found" | "already-exists" | "permission-denied" | "resource-exhausted" | "failed-precondition" | "aborted" | "out-of-range" | "unimplemented" | "internal" | "unavailable" | "data-loss" | "unauthenticated";
|
|
168
127
|
/** @hidden */
|
|
169
|
-
export declare type CanonicalErrorCodeName =
|
|
128
|
+
export declare type CanonicalErrorCodeName = "OK" | "CANCELLED" | "UNKNOWN" | "INVALID_ARGUMENT" | "DEADLINE_EXCEEDED" | "NOT_FOUND" | "ALREADY_EXISTS" | "PERMISSION_DENIED" | "UNAUTHENTICATED" | "RESOURCE_EXHAUSTED" | "FAILED_PRECONDITION" | "ABORTED" | "OUT_OF_RANGE" | "UNIMPLEMENTED" | "INTERNAL" | "UNAVAILABLE" | "DATA_LOSS";
|
|
170
129
|
/** @hidden */
|
|
171
130
|
interface HttpErrorCode {
|
|
172
131
|
canonicalName: CanonicalErrorCodeName;
|
|
@@ -232,7 +191,7 @@ export declare function decode(data: any): any;
|
|
|
232
191
|
*
|
|
233
192
|
*/
|
|
234
193
|
/** @hidden */
|
|
235
|
-
declare type TokenStatus =
|
|
194
|
+
declare type TokenStatus = "MISSING" | "VALID" | "INVALID";
|
|
236
195
|
/** @interanl */
|
|
237
196
|
export declare function checkAuthToken(req: Request, ctx: CallableContext | TaskContext): Promise<TokenStatus>;
|
|
238
197
|
export {};
|