firebase-admin 9.3.0 → 9.5.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/auth/action-code-settings-builder.js +1 -1
- package/lib/auth/auth-api-request.js +98 -25
- package/lib/auth/auth-config.js +15 -15
- package/lib/auth/auth.js +82 -61
- package/lib/auth/identifier.js +3 -2
- package/lib/auth/index.d.ts +1868 -0
- package/lib/{credential/credential-interfaces.js → auth/index.js} +1 -1
- package/lib/auth/tenant-manager.js +1 -1
- package/lib/auth/tenant.js +7 -1
- package/lib/auth/token-generator.js +6 -4
- package/lib/auth/token-verifier.js +32 -36
- package/lib/auth/user-import-builder.js +18 -15
- package/lib/auth/user-record.js +4 -4
- package/lib/credential/credential-internal.js +1 -2
- package/lib/credential/credential.js +8 -122
- package/lib/credential/index.d.ts +169 -0
- package/lib/credential/index.js +5 -17
- package/lib/database/database-internal.js +19 -26
- package/lib/database/index.d.ts +89 -0
- package/lib/database/index.js +12 -28
- package/lib/default-namespace.js +2 -1
- package/lib/firebase-app.js +26 -48
- package/lib/firebase-namespace-api.d.ts +238 -0
- package/lib/{firebase-service.js → firebase-namespace-api.js} +2 -2
- package/lib/{database/database.js → firebase-namespace.d.ts} +14 -7
- package/lib/firebase-namespace.js +22 -92
- package/lib/firestore/firestore-internal.js +2 -19
- package/lib/firestore/index.d.ts +50 -0
- package/lib/firestore/index.js +28 -43
- package/lib/index.d.ts +3 -932
- package/lib/index.js +2 -1
- package/lib/instance-id/index.d.ts +81 -0
- package/lib/instance-id/index.js +1 -10
- package/lib/instance-id/instance-id-request-internal.js +2 -1
- package/lib/instance-id/instance-id.js +1 -19
- package/lib/machine-learning/index.d.ts +249 -0
- package/lib/{messaging/messaging-types.js → machine-learning/index.js} +2 -2
- package/lib/machine-learning/machine-learning-api-client.js +1 -1
- package/lib/machine-learning/machine-learning-utils.js +1 -1
- package/lib/machine-learning/machine-learning.js +3 -22
- package/lib/messaging/batch-request-internal.js +1 -1
- package/lib/messaging/index.d.ts +1174 -0
- package/lib/messaging/index.js +1 -24
- package/lib/messaging/messaging-api-request-internal.js +2 -1
- package/lib/messaging/messaging-errors-internal.js +1 -1
- package/lib/messaging/messaging-internal.js +1 -1
- package/lib/messaging/messaging.js +21 -25
- package/lib/project-management/android-app.js +7 -6
- package/lib/project-management/index.d.ts +363 -0
- package/lib/project-management/index.js +23 -25
- package/lib/project-management/ios-app.js +5 -4
- package/lib/project-management/project-management-api-request-internal.js +5 -5
- package/lib/project-management/project-management.js +9 -26
- package/lib/remote-config/index.d.ts +359 -0
- package/lib/remote-config/index.js +1 -26
- package/lib/remote-config/remote-config-api-client-internal.js +3 -3
- package/lib/remote-config/remote-config.js +15 -32
- package/lib/security-rules/index.d.ts +216 -0
- package/lib/security-rules/index.js +1 -24
- package/lib/security-rules/security-rules-api-client-internal.js +1 -1
- package/lib/security-rules/security-rules-internal.js +1 -1
- package/lib/security-rules/security-rules.js +6 -15
- package/lib/storage/index.d.ts +60 -0
- package/lib/storage/index.js +1 -10
- package/lib/storage/storage.js +2 -19
- package/lib/utils/api-request.js +10 -3
- package/lib/utils/deep-copy.js +2 -1
- package/lib/utils/error.js +2 -1
- package/lib/utils/index.js +6 -5
- package/lib/utils/validator.js +2 -1
- package/package.json +15 -12
- package/lib/auth.d.ts +0 -2016
- package/lib/credential.d.ts +0 -150
- package/lib/database.d.ts +0 -1663
- package/lib/instance-id.d.ts +0 -37
- package/lib/messaging.d.ts +0 -1341
- package/lib/project-management/app-metadata.js +0 -37
- package/lib/project-management.d.ts +0 -361
- package/lib/remote-config/remote-config-api-client.js +0 -36
- package/lib/remote-config.d.ts +0 -350
- package/lib/security-rules.d.ts +0 -192
- package/lib/storage.d.ts +0 -40
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
/*! firebase-admin v9.
|
|
1
|
+
/*! firebase-admin v9.5.0 */
|
|
2
2
|
/*!
|
|
3
|
+
* @license
|
|
3
4
|
* Copyright 2017 Google Inc.
|
|
4
5
|
*
|
|
5
6
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -15,937 +16,7 @@
|
|
|
15
16
|
* limitations under the License.
|
|
16
17
|
*/
|
|
17
18
|
|
|
18
|
-
import * as
|
|
19
|
-
import { Agent } from 'http';
|
|
20
|
-
|
|
21
|
-
import * as _auth from './auth';
|
|
22
|
-
import * as _credential from './credential';
|
|
23
|
-
import * as _database from './database';
|
|
24
|
-
import * as _messaging from './messaging';
|
|
25
|
-
import * as _instanceId from './instance-id';
|
|
26
|
-
import * as _projectManagement from './project-management';
|
|
27
|
-
import * as _remoteConfig from './remote-config';
|
|
28
|
-
import * as _securityRules from './security-rules';
|
|
29
|
-
import * as _storage from './storage';
|
|
30
|
-
|
|
31
|
-
/* eslint-disable @typescript-eslint/ban-types */
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* `admin` is a global namespace from which all Firebase Admin
|
|
35
|
-
* services are accessed.
|
|
36
|
-
*/
|
|
37
|
-
declare namespace admin {
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* `FirebaseError` is a subclass of the standard JavaScript `Error` object. In
|
|
41
|
-
* addition to a message string and stack trace, it contains a string code.
|
|
42
|
-
*/
|
|
43
|
-
interface FirebaseError {
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Error codes are strings using the following format: `"service/string-code"`.
|
|
47
|
-
* Some examples include `"auth/invalid-uid"` and
|
|
48
|
-
* `"messaging/invalid-recipient"`.
|
|
49
|
-
*
|
|
50
|
-
* While the message for a given error can change, the code will remain the same
|
|
51
|
-
* between backward-compatible versions of the Firebase SDK.
|
|
52
|
-
*/
|
|
53
|
-
code: string;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* An explanatory message for the error that just occurred.
|
|
57
|
-
*
|
|
58
|
-
* This message is designed to be helpful to you, the developer. Because
|
|
59
|
-
* it generally does not convey meaningful information to end users,
|
|
60
|
-
* this message should not be displayed in your application.
|
|
61
|
-
*/
|
|
62
|
-
message: string;
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* A string value containing the execution backtrace when the error originally
|
|
66
|
-
* occurred.
|
|
67
|
-
*
|
|
68
|
-
* This information can be useful to you and can be sent to
|
|
69
|
-
* {@link https://firebase.google.com/support/ Firebase Support} to help
|
|
70
|
-
* explain the cause of an error.
|
|
71
|
-
*/
|
|
72
|
-
stack: string;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* @return A JSON-serializable representation of this object.
|
|
76
|
-
*/
|
|
77
|
-
toJSON(): Object;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Composite type which includes both a `FirebaseError` object and an index
|
|
82
|
-
* which can be used to get the errored item.
|
|
83
|
-
*
|
|
84
|
-
* @example
|
|
85
|
-
* ```javascript
|
|
86
|
-
* var registrationTokens = [token1, token2, token3];
|
|
87
|
-
* admin.messaging().subscribeToTopic(registrationTokens, 'topic-name')
|
|
88
|
-
* .then(function(response) {
|
|
89
|
-
* if (response.failureCount > 0) {
|
|
90
|
-
* console.log("Following devices unsucessfully subscribed to topic:");
|
|
91
|
-
* response.errors.forEach(function(error) {
|
|
92
|
-
* var invalidToken = registrationTokens[error.index];
|
|
93
|
-
* console.log(invalidToken, error.error);
|
|
94
|
-
* });
|
|
95
|
-
* } else {
|
|
96
|
-
* console.log("All devices successfully subscribed to topic:", response);
|
|
97
|
-
* }
|
|
98
|
-
* })
|
|
99
|
-
* .catch(function(error) {
|
|
100
|
-
* console.log("Error subscribing to topic:", error);
|
|
101
|
-
* });
|
|
102
|
-
*```
|
|
103
|
-
*/
|
|
104
|
-
interface FirebaseArrayIndexError {
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* The index of the errored item within the original array passed as part of the
|
|
108
|
-
* called API method.
|
|
109
|
-
*/
|
|
110
|
-
index: number;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* The error object.
|
|
114
|
-
*/
|
|
115
|
-
error: FirebaseError;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
interface ServiceAccount {
|
|
119
|
-
projectId?: string;
|
|
120
|
-
clientEmail?: string;
|
|
121
|
-
privateKey?: string;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
interface GoogleOAuthAccessToken {
|
|
125
|
-
access_token: string;
|
|
126
|
-
expires_in: number;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Available options to pass to [`initializeApp()`](admin#.initializeApp).
|
|
131
|
-
*/
|
|
132
|
-
interface AppOptions {
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* A {@link admin.credential.Credential `Credential`} object used to
|
|
136
|
-
* authenticate the Admin SDK.
|
|
137
|
-
*
|
|
138
|
-
* See [Initialize the SDK](/docs/admin/setup#initialize_the_sdk) for detailed
|
|
139
|
-
* documentation and code samples.
|
|
140
|
-
*/
|
|
141
|
-
credential?: admin.credential.Credential;
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* The object to use as the [`auth`](/docs/reference/security/database/#auth)
|
|
145
|
-
* variable in your Realtime Database Rules when the Admin SDK reads from or
|
|
146
|
-
* writes to the Realtime Database. This allows you to downscope the Admin SDK
|
|
147
|
-
* from its default full read and write privileges.
|
|
148
|
-
*
|
|
149
|
-
* You can pass `null` to act as an unauthenticated client.
|
|
150
|
-
*
|
|
151
|
-
* See
|
|
152
|
-
* [Authenticate with limited privileges](/docs/database/admin/start#authenticate-with-limited-privileges)
|
|
153
|
-
* for detailed documentation and code samples.
|
|
154
|
-
*/
|
|
155
|
-
databaseAuthVariableOverride?: object | null;
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* The URL of the Realtime Database from which to read and write data.
|
|
159
|
-
*/
|
|
160
|
-
databaseURL?: string;
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* The ID of the service account to be used for signing custom tokens. This
|
|
164
|
-
* can be found in the `client_email` field of a service account JSON file.
|
|
165
|
-
*/
|
|
166
|
-
serviceAccountId?: string;
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* The name of the Google Cloud Storage bucket used for storing application data.
|
|
170
|
-
* Use only the bucket name without any prefixes or additions (do *not* prefix
|
|
171
|
-
* the name with "gs://").
|
|
172
|
-
*/
|
|
173
|
-
storageBucket?: string;
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* The ID of the Google Cloud project associated with the App.
|
|
177
|
-
*/
|
|
178
|
-
projectId?: string;
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* An [HTTP Agent](https://nodejs.org/api/http.html#http_class_http_agent)
|
|
182
|
-
* to be used when making outgoing HTTP calls. This Agent instance is used
|
|
183
|
-
* by all services that make REST calls (e.g. `auth`, `messaging`,
|
|
184
|
-
* `projectManagement`).
|
|
185
|
-
*
|
|
186
|
-
* Realtime Database and Firestore use other means of communicating with
|
|
187
|
-
* the backend servers, so they do not use this HTTP Agent. `Credential`
|
|
188
|
-
* instances also do not use this HTTP Agent, but instead support
|
|
189
|
-
* specifying an HTTP Agent in the corresponding factory methods.
|
|
190
|
-
*/
|
|
191
|
-
httpAgent?: Agent;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
const SDK_VERSION: string;
|
|
195
|
-
const apps: (admin.app.App | null)[];
|
|
196
|
-
|
|
197
|
-
function app(name?: string): admin.app.App;
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* Gets the {@link admin.auth.Auth `Auth`} service for the default app or a
|
|
201
|
-
* given app.
|
|
202
|
-
*
|
|
203
|
-
* `admin.auth()` can be called with no arguments to access the default app's
|
|
204
|
-
* {@link admin.auth.Auth `Auth`} service or as `admin.auth(app)` to access the
|
|
205
|
-
* {@link admin.auth.Auth `Auth`} service associated with a specific app.
|
|
206
|
-
*
|
|
207
|
-
* @example
|
|
208
|
-
* ```javascript
|
|
209
|
-
* // Get the Auth service for the default app
|
|
210
|
-
* var defaultAuth = admin.auth();
|
|
211
|
-
* ```
|
|
212
|
-
*
|
|
213
|
-
* @example
|
|
214
|
-
* ```javascript
|
|
215
|
-
* // Get the Auth service for a given app
|
|
216
|
-
* var otherAuth = admin.auth(otherApp);
|
|
217
|
-
* ```
|
|
218
|
-
*
|
|
219
|
-
*/
|
|
220
|
-
function auth(app?: admin.app.App): admin.auth.Auth;
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Gets the {@link admin.database.Database `Database`} service for the default
|
|
224
|
-
* app or a given app.
|
|
225
|
-
*
|
|
226
|
-
* `admin.database()` can be called with no arguments to access the default
|
|
227
|
-
* app's {@link admin.database.Database `Database`} service or as
|
|
228
|
-
* `admin.database(app)` to access the
|
|
229
|
-
* {@link admin.database.Database `Database`} service associated with a specific
|
|
230
|
-
* app.
|
|
231
|
-
*
|
|
232
|
-
* `admin.database` is also a namespace that can be used to access global
|
|
233
|
-
* constants and methods associated with the `Database` service.
|
|
234
|
-
*
|
|
235
|
-
* @example
|
|
236
|
-
* ```javascript
|
|
237
|
-
* // Get the Database service for the default app
|
|
238
|
-
* var defaultDatabase = admin.database();
|
|
239
|
-
* ```
|
|
240
|
-
*
|
|
241
|
-
* @example
|
|
242
|
-
* ```javascript
|
|
243
|
-
* // Get the Database service for a specific app
|
|
244
|
-
* var otherDatabase = admin.database(app);
|
|
245
|
-
* ```
|
|
246
|
-
*
|
|
247
|
-
* @param App whose `Database` service to
|
|
248
|
-
* return. If not provided, the default `Database` service will be returned.
|
|
249
|
-
*
|
|
250
|
-
* @return The default `Database` service if no app
|
|
251
|
-
* is provided or the `Database` service associated with the provided app.
|
|
252
|
-
*/
|
|
253
|
-
function database(app?: admin.app.App): admin.database.Database;
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Gets the {@link admin.messaging.Messaging `Messaging`} service for the
|
|
257
|
-
* default app or a given app.
|
|
258
|
-
*
|
|
259
|
-
* `admin.messaging()` can be called with no arguments to access the default
|
|
260
|
-
* app's {@link admin.messaging.Messaging `Messaging`} service or as
|
|
261
|
-
* `admin.messaging(app)` to access the
|
|
262
|
-
* {@link admin.messaging.Messaging `Messaging`} service associated with a
|
|
263
|
-
* specific app.
|
|
264
|
-
*
|
|
265
|
-
* @example
|
|
266
|
-
* ```javascript
|
|
267
|
-
* // Get the Messaging service for the default app
|
|
268
|
-
* var defaultMessaging = admin.messaging();
|
|
269
|
-
* ```
|
|
270
|
-
*
|
|
271
|
-
* @example
|
|
272
|
-
* ```javascript
|
|
273
|
-
* // Get the Messaging service for a given app
|
|
274
|
-
* var otherMessaging = admin.messaging(otherApp);
|
|
275
|
-
* ```
|
|
276
|
-
*
|
|
277
|
-
* @param app Optional app whose `Messaging` service to
|
|
278
|
-
* return. If not provided, the default `Messaging` service will be returned.
|
|
279
|
-
*
|
|
280
|
-
* @return The default `Messaging` service if no
|
|
281
|
-
* app is provided or the `Messaging` service associated with the provided
|
|
282
|
-
* app.
|
|
283
|
-
*/
|
|
284
|
-
function messaging(app?: admin.app.App): admin.messaging.Messaging;
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* Gets the {@link admin.storage.Storage `Storage`} service for the
|
|
288
|
-
* default app or a given app.
|
|
289
|
-
*
|
|
290
|
-
* `admin.storage()` can be called with no arguments to access the default
|
|
291
|
-
* app's {@link admin.storage.Storage `Storage`} service or as
|
|
292
|
-
* `admin.storage(app)` to access the
|
|
293
|
-
* {@link admin.storage.Storage `Storage`} service associated with a
|
|
294
|
-
* specific app.
|
|
295
|
-
*
|
|
296
|
-
* @example
|
|
297
|
-
* ```javascript
|
|
298
|
-
* // Get the Storage service for the default app
|
|
299
|
-
* var defaultStorage = admin.storage();
|
|
300
|
-
* ```
|
|
301
|
-
*
|
|
302
|
-
* @example
|
|
303
|
-
* ```javascript
|
|
304
|
-
* // Get the Storage service for a given app
|
|
305
|
-
* var otherStorage = admin.storage(otherApp);
|
|
306
|
-
* ```
|
|
307
|
-
*/
|
|
308
|
-
function storage(app?: admin.app.App): admin.storage.Storage;
|
|
309
|
-
|
|
310
|
-
/**
|
|
311
|
-
*
|
|
312
|
-
* @param app A Firebase App instance
|
|
313
|
-
* @returns A [Firestore](https://cloud.google.com/nodejs/docs/reference/firestore/latest/Firestore)
|
|
314
|
-
* instance as defined in the `@google-cloud/firestore` package.
|
|
315
|
-
*/
|
|
316
|
-
function firestore(app?: admin.app.App): admin.firestore.Firestore;
|
|
317
|
-
|
|
318
|
-
/**
|
|
319
|
-
* Gets the {@link admin.instanceId.InstanceId `InstanceId`} service for the
|
|
320
|
-
* default app or a given app.
|
|
321
|
-
*
|
|
322
|
-
* `admin.instanceId()` can be called with no arguments to access the default
|
|
323
|
-
* app's {@link admin.instanceId.InstanceId `InstanceId`} service or as
|
|
324
|
-
* `admin.instanceId(app)` to access the
|
|
325
|
-
* {@link admin.instanceId.InstanceId `InstanceId`} service associated with a
|
|
326
|
-
* specific app.
|
|
327
|
-
*
|
|
328
|
-
* @example
|
|
329
|
-
* ```javascript
|
|
330
|
-
* // Get the Instance ID service for the default app
|
|
331
|
-
* var defaultInstanceId = admin.instanceId();
|
|
332
|
-
* ```
|
|
333
|
-
*
|
|
334
|
-
* @example
|
|
335
|
-
* ```javascript
|
|
336
|
-
* // Get the Instance ID service for a given app
|
|
337
|
-
* var otherInstanceId = admin.instanceId(otherApp);
|
|
338
|
-
*```
|
|
339
|
-
*
|
|
340
|
-
* @param app Optional app whose `InstanceId` service to
|
|
341
|
-
* return. If not provided, the default `InstanceId` service will be
|
|
342
|
-
* returned.
|
|
343
|
-
*
|
|
344
|
-
* @return The default `InstanceId` service if
|
|
345
|
-
* no app is provided or the `InstanceId` service associated with the
|
|
346
|
-
* provided app.
|
|
347
|
-
*/
|
|
348
|
-
function instanceId(app?: admin.app.App): admin.instanceId.InstanceId;
|
|
349
|
-
|
|
350
|
-
/**
|
|
351
|
-
* Gets the {@link admin.projectManagement.ProjectManagement
|
|
352
|
-
* `ProjectManagement`} service for the default app or a given app.
|
|
353
|
-
*
|
|
354
|
-
* `admin.projectManagement()` can be called with no arguments to access the
|
|
355
|
-
* default app's {@link admin.projectManagement.ProjectManagement
|
|
356
|
-
* `ProjectManagement`} service, or as `admin.projectManagement(app)` to access
|
|
357
|
-
* the {@link admin.projectManagement.ProjectManagement `ProjectManagement`}
|
|
358
|
-
* service associated with a specific app.
|
|
359
|
-
*
|
|
360
|
-
* @example
|
|
361
|
-
* ```javascript
|
|
362
|
-
* // Get the ProjectManagement service for the default app
|
|
363
|
-
* var defaultProjectManagement = admin.projectManagement();
|
|
364
|
-
* ```
|
|
365
|
-
*
|
|
366
|
-
* @example
|
|
367
|
-
* ```javascript
|
|
368
|
-
* // Get the ProjectManagement service for a given app
|
|
369
|
-
* var otherProjectManagement = admin.projectManagement(otherApp);
|
|
370
|
-
* ```
|
|
371
|
-
*
|
|
372
|
-
* @param app Optional app whose `ProjectManagement` service
|
|
373
|
-
* to return. If not provided, the default `ProjectManagement` service will
|
|
374
|
-
* be returned. *
|
|
375
|
-
* @return The default `ProjectManagement` service if no app is provided or the
|
|
376
|
-
* `ProjectManagement` service associated with the provided app.
|
|
377
|
-
*/
|
|
378
|
-
function projectManagement(app?: admin.app.App): admin.projectManagement.ProjectManagement;
|
|
379
|
-
|
|
380
|
-
/**
|
|
381
|
-
* Gets the {@link admin.remoteConfig.RemoteConfig `RemoteConfig`} service for the
|
|
382
|
-
* default app or a given app.
|
|
383
|
-
*
|
|
384
|
-
* `admin.remoteConfig()` can be called with no arguments to access the default
|
|
385
|
-
* app's {@link admin.remoteConfig.RemoteConfig `RemoteConfig`} service or as
|
|
386
|
-
* `admin.remoteConfig(app)` to access the
|
|
387
|
-
* {@link admin.remoteConfig.RemoteConfig `RemoteConfig`} service associated with a
|
|
388
|
-
* specific app.
|
|
389
|
-
*
|
|
390
|
-
* @example
|
|
391
|
-
* ```javascript
|
|
392
|
-
* // Get the `RemoteConfig` service for the default app
|
|
393
|
-
* var defaultRemoteConfig = admin.remoteConfig();
|
|
394
|
-
* ```
|
|
395
|
-
*
|
|
396
|
-
* @example
|
|
397
|
-
* ```javascript
|
|
398
|
-
* // Get the `RemoteConfig` service for a given app
|
|
399
|
-
* var otherRemoteConfig = admin.remoteConfig(otherApp);
|
|
400
|
-
* ```
|
|
401
|
-
*
|
|
402
|
-
* @param app Optional app for which to return the `RemoteConfig` service.
|
|
403
|
-
* If not provided, the default `RemoteConfig` service is returned.
|
|
404
|
-
*
|
|
405
|
-
* @return The default `RemoteConfig` service if no
|
|
406
|
-
* app is provided, or the `RemoteConfig` service associated with the provided
|
|
407
|
-
* app.
|
|
408
|
-
*/
|
|
409
|
-
function remoteConfig(app?: admin.app.App): admin.remoteConfig.RemoteConfig;
|
|
410
|
-
|
|
411
|
-
/**
|
|
412
|
-
* Gets the {@link admin.securityRules.SecurityRules
|
|
413
|
-
* `SecurityRules`} service for the default app or a given app.
|
|
414
|
-
*
|
|
415
|
-
* `admin.securityRules()` can be called with no arguments to access the
|
|
416
|
-
* default app's {@link admin.securityRules.SecurityRules
|
|
417
|
-
* `SecurityRules`} service, or as `admin.securityRules(app)` to access
|
|
418
|
-
* the {@link admin.securityRules.SecurityRules `SecurityRules`}
|
|
419
|
-
* service associated with a specific app.
|
|
420
|
-
*
|
|
421
|
-
* @example
|
|
422
|
-
* ```javascript
|
|
423
|
-
* // Get the SecurityRules service for the default app
|
|
424
|
-
* var defaultSecurityRules = admin.securityRules();
|
|
425
|
-
* ```
|
|
426
|
-
*
|
|
427
|
-
* @example
|
|
428
|
-
* ```javascript
|
|
429
|
-
* // Get the SecurityRules service for a given app
|
|
430
|
-
* var otherSecurityRules = admin.securityRules(otherApp);
|
|
431
|
-
* ```
|
|
432
|
-
*
|
|
433
|
-
* @param app Optional app to return the `SecurityRules` service
|
|
434
|
-
* for. If not provided, the default `SecurityRules` service
|
|
435
|
-
* is returned.
|
|
436
|
-
* @return The default `SecurityRules` service if no app is provided, or the
|
|
437
|
-
* `SecurityRules` service associated with the provided app.
|
|
438
|
-
*/
|
|
439
|
-
function securityRules(app?: admin.app.App): admin.securityRules.SecurityRules;
|
|
440
|
-
|
|
441
|
-
/**
|
|
442
|
-
* Gets the {@link admin.machineLearning.MachineLearning `MachineLearning`} service for the
|
|
443
|
-
* default app or a given app.
|
|
444
|
-
*
|
|
445
|
-
* `admin.machineLearning()` can be called with no arguments to access the
|
|
446
|
-
* default app's {@link admin.machineLearning.MachineLearning
|
|
447
|
-
* `MachineLearning`} service or as `admin.machineLearning(app)` to access
|
|
448
|
-
* the {@link admin.machineLearning.MachineLearning `MachineLearning`}
|
|
449
|
-
* service associated with a specific app.
|
|
450
|
-
*
|
|
451
|
-
* @example
|
|
452
|
-
* ```javascript
|
|
453
|
-
* // Get the MachineLearning service for the default app
|
|
454
|
-
* var defaultMachineLearning = admin.machineLearning();
|
|
455
|
-
* ```
|
|
456
|
-
*
|
|
457
|
-
* @example
|
|
458
|
-
* ```javascript
|
|
459
|
-
* // Get the MachineLearning service for a given app
|
|
460
|
-
* var otherMachineLearning = admin.machineLearning(otherApp);
|
|
461
|
-
* ```
|
|
462
|
-
*
|
|
463
|
-
* @param app Optional app whose `MachineLearning` service to
|
|
464
|
-
* return. If not provided, the default `MachineLearning` service
|
|
465
|
-
* will be returned.
|
|
466
|
-
*
|
|
467
|
-
* @return The default `MachineLearning` service if no app is provided or the
|
|
468
|
-
* `MachineLearning` service associated with the provided app.
|
|
469
|
-
*/
|
|
470
|
-
function machineLearning(app?: admin.app.App): admin.machineLearning.MachineLearning;
|
|
471
|
-
|
|
472
|
-
function initializeApp(options?: admin.AppOptions, name?: string): admin.app.App;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
declare namespace admin.app {
|
|
476
|
-
/**
|
|
477
|
-
* A Firebase app holds the initialization information for a collection of
|
|
478
|
-
* services.
|
|
479
|
-
*
|
|
480
|
-
* Do not call this constructor directly. Instead, use
|
|
481
|
-
* {@link
|
|
482
|
-
* https://firebase.google.com/docs/reference/admin/node/admin#.initializeApp
|
|
483
|
-
* `admin.initializeApp()`}
|
|
484
|
-
* to create an app.
|
|
485
|
-
*/
|
|
486
|
-
interface App {
|
|
487
|
-
|
|
488
|
-
/**
|
|
489
|
-
* The (read-only) name for this app.
|
|
490
|
-
*
|
|
491
|
-
* The default app's name is `"[DEFAULT]"`.
|
|
492
|
-
*
|
|
493
|
-
* @example
|
|
494
|
-
* ```javascript
|
|
495
|
-
* // The default app's name is "[DEFAULT]"
|
|
496
|
-
* admin.initializeApp(defaultAppConfig);
|
|
497
|
-
* console.log(admin.app().name); // "[DEFAULT]"
|
|
498
|
-
* ```
|
|
499
|
-
*
|
|
500
|
-
* @example
|
|
501
|
-
* ```javascript
|
|
502
|
-
* // A named app's name is what you provide to initializeApp()
|
|
503
|
-
* var otherApp = admin.initializeApp(otherAppConfig, "other");
|
|
504
|
-
* console.log(otherApp.name); // "other"
|
|
505
|
-
* ```
|
|
506
|
-
*/
|
|
507
|
-
name: string;
|
|
508
|
-
|
|
509
|
-
/**
|
|
510
|
-
* The (read-only) configuration options for this app. These are the original
|
|
511
|
-
* parameters given in
|
|
512
|
-
* {@link
|
|
513
|
-
* https://firebase.google.com/docs/reference/admin/node/admin#.initializeApp
|
|
514
|
-
* `admin.initializeApp()`}.
|
|
515
|
-
*
|
|
516
|
-
* @example
|
|
517
|
-
* ```javascript
|
|
518
|
-
* var app = admin.initializeApp(config);
|
|
519
|
-
* console.log(app.options.credential === config.credential); // true
|
|
520
|
-
* console.log(app.options.databaseURL === config.databaseURL); // true
|
|
521
|
-
* ```
|
|
522
|
-
*/
|
|
523
|
-
options: admin.AppOptions;
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
auth(): admin.auth.Auth;
|
|
527
|
-
database(url?: string): admin.database.Database;
|
|
528
|
-
firestore(): admin.firestore.Firestore;
|
|
529
|
-
instanceId(): admin.instanceId.InstanceId;
|
|
530
|
-
machineLearning(): admin.machineLearning.MachineLearning;
|
|
531
|
-
messaging(): admin.messaging.Messaging;
|
|
532
|
-
projectManagement(): admin.projectManagement.ProjectManagement;
|
|
533
|
-
remoteConfig(): admin.remoteConfig.RemoteConfig;
|
|
534
|
-
securityRules(): admin.securityRules.SecurityRules;
|
|
535
|
-
storage(): admin.storage.Storage;
|
|
536
|
-
|
|
537
|
-
/**
|
|
538
|
-
* Renders this local `FirebaseApp` unusable and frees the resources of
|
|
539
|
-
* all associated services (though it does *not* clean up any backend
|
|
540
|
-
* resources). When running the SDK locally, this method
|
|
541
|
-
* must be called to ensure graceful termination of the process.
|
|
542
|
-
*
|
|
543
|
-
* @example
|
|
544
|
-
* ```javascript
|
|
545
|
-
* app.delete()
|
|
546
|
-
* .then(function() {
|
|
547
|
-
* console.log("App deleted successfully");
|
|
548
|
-
* })
|
|
549
|
-
* .catch(function(error) {
|
|
550
|
-
* console.log("Error deleting app:", error);
|
|
551
|
-
* });
|
|
552
|
-
* ```
|
|
553
|
-
*/
|
|
554
|
-
delete(): Promise<void>;
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
declare namespace admin.auth {
|
|
559
|
-
export import UserMetadata = _auth.admin.auth.UserMetadata;
|
|
560
|
-
export import UserInfo = _auth.admin.auth.UserInfo;
|
|
561
|
-
export import UserRecord = _auth.admin.auth.UserRecord;
|
|
562
|
-
export import UpdateRequest = _auth.admin.auth.UpdateRequest;
|
|
563
|
-
export import CreateRequest = _auth.admin.auth.CreateRequest;
|
|
564
|
-
export import DecodedIdToken = _auth.admin.auth.DecodedIdToken;
|
|
565
|
-
export import ListUsersResult = _auth.admin.auth.ListUsersResult;
|
|
566
|
-
export import HashAlgorithmType = _auth.admin.auth.HashAlgorithmType;
|
|
567
|
-
export import UserImportOptions = _auth.admin.auth.UserImportOptions;
|
|
568
|
-
export import UserImportResult = _auth.admin.auth.UserImportResult;
|
|
569
|
-
export import UserImportRecord = _auth.admin.auth.UserImportRecord;
|
|
570
|
-
export import SessionCookieOptions = _auth.admin.auth.SessionCookieOptions;
|
|
571
|
-
export import ActionCodeSettings = _auth.admin.auth.ActionCodeSettings;
|
|
572
|
-
export import Tenant = _auth.admin.auth.Tenant;
|
|
573
|
-
export import UpdateTenantRequest = _auth.admin.auth.UpdateTenantRequest;
|
|
574
|
-
export import CreateTenantRequest = _auth.admin.auth.CreateTenantRequest;
|
|
575
|
-
export import ListTenantsResult = _auth.admin.auth.ListTenantsResult;
|
|
576
|
-
export import AuthProviderConfigFilter = _auth.admin.auth.AuthProviderConfigFilter;
|
|
577
|
-
export import AuthProviderConfig = _auth.admin.auth.AuthProviderConfig;
|
|
578
|
-
export import SAMLAuthProviderConfig = _auth.admin.auth.SAMLAuthProviderConfig;
|
|
579
|
-
export import OIDCAuthProviderConfig = _auth.admin.auth.OIDCAuthProviderConfig;
|
|
580
|
-
export import SAMLUpdateAuthProviderRequest = _auth.admin.auth.SAMLUpdateAuthProviderRequest;
|
|
581
|
-
export import OIDCUpdateAuthProviderRequest = _auth.admin.auth.OIDCUpdateAuthProviderRequest;
|
|
582
|
-
export import ListProviderConfigResults = _auth.admin.auth.ListProviderConfigResults;
|
|
583
|
-
export import UpdateAuthProviderRequest = _auth.admin.auth.UpdateAuthProviderRequest;
|
|
584
|
-
export import BaseAuth = _auth.admin.auth.BaseAuth;
|
|
585
|
-
export import TenantAwareAuth = _auth.admin.auth.TenantAwareAuth;
|
|
586
|
-
export import Auth = _auth.admin.auth.Auth;
|
|
587
|
-
export import TenantManager = _auth.admin.auth.TenantManager;
|
|
588
|
-
export import MultiFactorInfo = _auth.admin.auth.MultiFactorInfo;
|
|
589
|
-
export import PhoneMultiFactorInfo = _auth.admin.auth.PhoneMultiFactorInfo;
|
|
590
|
-
export import CreateMultiFactorInfoRequest = _auth.admin.auth.CreateMultiFactorInfoRequest;
|
|
591
|
-
export import CreatePhoneMultiFactorInfoRequest = _auth.admin.auth.CreatePhoneMultiFactorInfoRequest;
|
|
592
|
-
export import UpdateMultiFactorInfoRequest = _auth.admin.auth.UpdateMultiFactorInfoRequest;
|
|
593
|
-
export import UpdatePhoneMultiFactorInfoRequest = _auth.admin.auth.UpdatePhoneMultiFactorInfoRequest;
|
|
594
|
-
export import MultiFactorCreateSettings = _auth.admin.auth.MultiFactorCreateSettings;
|
|
595
|
-
export import MultiFactorUpdateSettings = _auth.admin.auth.MultiFactorUpdateSettings;
|
|
596
|
-
export import DeleteUsersResult = _auth.admin.auth.DeleteUsersResult;
|
|
597
|
-
export import GetUsersResult = _auth.admin.auth.GetUsersResult;
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
declare namespace admin.credential {
|
|
601
|
-
export import Credential = _credential.admin.credential.Credential;
|
|
602
|
-
export import applicationDefault = _credential.admin.credential.applicationDefault;
|
|
603
|
-
export import cert = _credential.admin.credential.cert;
|
|
604
|
-
export import refreshToken = _credential.admin.credential.refreshToken;
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
declare namespace admin.database {
|
|
608
|
-
export import Database = _database.admin.database.Database;
|
|
609
|
-
export import DataSnapshot = _database.admin.database.DataSnapshot;
|
|
610
|
-
export import OnDisconnect = _database.admin.database.OnDisconnect;
|
|
611
|
-
export import EventType = _database.admin.database.EventType;
|
|
612
|
-
export import Query = _database.admin.database.Query;
|
|
613
|
-
export import Reference = _database.admin.database.Reference;
|
|
614
|
-
export import ThenableReference = _database.admin.database.ThenableReference;
|
|
615
|
-
export import enableLogging = _database.admin.database.enableLogging;
|
|
616
|
-
export import ServerValue = _database.admin.database.ServerValue;
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
declare namespace admin.messaging {
|
|
620
|
-
export import Message = _messaging.admin.messaging.Message;
|
|
621
|
-
export import MulticastMessage = _messaging.admin.messaging.MulticastMessage;
|
|
622
|
-
export import AndroidConfig = _messaging.admin.messaging.AndroidConfig;
|
|
623
|
-
export import AndroidNotification = _messaging.admin.messaging.AndroidNotification;
|
|
624
|
-
export import LightSettings = _messaging.admin.messaging.LightSettings;
|
|
625
|
-
export import AndroidFcmOptions = _messaging.admin.messaging.AndroidFcmOptions;
|
|
626
|
-
export import ApnsConfig = _messaging.admin.messaging.ApnsConfig;
|
|
627
|
-
export import ApnsPayload = _messaging.admin.messaging.ApnsPayload;
|
|
628
|
-
export import Aps = _messaging.admin.messaging.Aps;
|
|
629
|
-
export import ApsAlert = _messaging.admin.messaging.ApsAlert;
|
|
630
|
-
export import CriticalSound = _messaging.admin.messaging.CriticalSound;
|
|
631
|
-
export import ApnsFcmOptions = _messaging.admin.messaging.ApnsFcmOptions;
|
|
632
|
-
export import FcmOptions = _messaging.admin.messaging.FcmOptions;
|
|
633
|
-
export import Notification = _messaging.admin.messaging.Notification;
|
|
634
|
-
export import WebpushConfig = _messaging.admin.messaging.WebpushConfig;
|
|
635
|
-
export import WebpushFcmOptions = _messaging.admin.messaging.WebpushFcmOptions;
|
|
636
|
-
export import WebpushNotification = _messaging.admin.messaging.WebpushNotification;
|
|
637
|
-
export import MessagingTopicManagementResponse = _messaging.admin.messaging.MessagingTopicManagementResponse;
|
|
638
|
-
export import BatchResponse = _messaging.admin.messaging.BatchResponse;
|
|
639
|
-
export import SendResponse = _messaging.admin.messaging.SendResponse;
|
|
640
|
-
export import Messaging = _messaging.admin.messaging.Messaging;
|
|
641
|
-
|
|
642
|
-
// Legacy API types.
|
|
643
|
-
export import DataMessagePayload = _messaging.admin.messaging.DataMessagePayload;
|
|
644
|
-
export import NotificationMessagePayload = _messaging.admin.messaging.NotificationMessagePayload;
|
|
645
|
-
export import MessagingPayload = _messaging.admin.messaging.MessagingPayload;
|
|
646
|
-
export import MessagingOptions = _messaging.admin.messaging.MessagingOptions;
|
|
647
|
-
export import MessagingDevicesResponse = _messaging.admin.messaging.MessagingDevicesResponse;
|
|
648
|
-
export import MessagingDeviceResult = _messaging.admin.messaging.MessagingDeviceResult;
|
|
649
|
-
export import MessagingDeviceGroupResponse = _messaging.admin.messaging.MessagingDeviceGroupResponse;
|
|
650
|
-
export import MessagingTopicResponse = _messaging.admin.messaging.MessagingTopicResponse;
|
|
651
|
-
export import MessagingConditionResponse = _messaging.admin.messaging.MessagingConditionResponse;
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
declare namespace admin.storage {
|
|
655
|
-
export import Storage = _storage.admin.storage.Storage;
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
declare namespace admin.firestore {
|
|
659
|
-
export import v1beta1 = _firestore.v1beta1;
|
|
660
|
-
export import v1 = _firestore.v1;
|
|
661
|
-
|
|
662
|
-
export import CollectionReference = _firestore.CollectionReference;
|
|
663
|
-
export import DocumentData = _firestore.DocumentData;
|
|
664
|
-
export import DocumentReference = _firestore.DocumentReference;
|
|
665
|
-
export import DocumentSnapshot = _firestore.DocumentSnapshot;
|
|
666
|
-
export import FieldPath = _firestore.FieldPath;
|
|
667
|
-
export import FieldValue = _firestore.FieldValue;
|
|
668
|
-
export import Firestore = _firestore.Firestore;
|
|
669
|
-
export import GeoPoint = _firestore.GeoPoint;
|
|
670
|
-
export import Query = _firestore.Query;
|
|
671
|
-
export import QueryDocumentSnapshot = _firestore.QueryDocumentSnapshot;
|
|
672
|
-
export import QuerySnapshot = _firestore.QuerySnapshot;
|
|
673
|
-
export import Timestamp = _firestore.Timestamp;
|
|
674
|
-
export import Transaction = _firestore.Transaction;
|
|
675
|
-
export import WriteBatch = _firestore.WriteBatch;
|
|
676
|
-
export import WriteResult = _firestore.WriteResult;
|
|
677
|
-
|
|
678
|
-
export import setLogFunction = _firestore.setLogFunction;
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
declare namespace admin.instanceId {
|
|
682
|
-
export import InstanceId = _instanceId.admin.instanceId.InstanceId;
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
declare namespace admin.projectManagement {
|
|
686
|
-
export import ShaCertificate = _projectManagement.admin.projectManagement.ShaCertificate;
|
|
687
|
-
export import AppMetadata = _projectManagement.admin.projectManagement.AppMetadata;
|
|
688
|
-
export import AppPlatform = _projectManagement.admin.projectManagement.AppPlatform;
|
|
689
|
-
export import AndroidAppMetadata = _projectManagement.admin.projectManagement.AndroidAppMetadata;
|
|
690
|
-
export import IosAppMetadata = _projectManagement.admin.projectManagement.IosAppMetadata;
|
|
691
|
-
export import AndroidApp = _projectManagement.admin.projectManagement.AndroidApp;
|
|
692
|
-
export import IosApp = _projectManagement.admin.projectManagement.IosApp;
|
|
693
|
-
export import ProjectManagement = _projectManagement.admin.projectManagement.ProjectManagement;
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
declare namespace admin.remoteConfig {
|
|
697
|
-
export import TagColor = _remoteConfig.admin.remoteConfig.TagColor;
|
|
698
|
-
export import RemoteConfigTemplate = _remoteConfig.admin.remoteConfig.RemoteConfigTemplate;
|
|
699
|
-
export import RemoteConfigParameter = _remoteConfig.admin.remoteConfig.RemoteConfigParameter;
|
|
700
|
-
export import RemoteConfigParameterGroup = _remoteConfig.admin.remoteConfig.RemoteConfigParameterGroup;
|
|
701
|
-
export import RemoteConfigCondition = _remoteConfig.admin.remoteConfig.RemoteConfigCondition;
|
|
702
|
-
export import ExplicitParameterValue = _remoteConfig.admin.remoteConfig.ExplicitParameterValue;
|
|
703
|
-
export import InAppDefaultValue = _remoteConfig.admin.remoteConfig.InAppDefaultValue;
|
|
704
|
-
export import RemoteConfigParameterValue = _remoteConfig.admin.remoteConfig.RemoteConfigParameterValue;
|
|
705
|
-
export import Version = _remoteConfig.admin.remoteConfig.Version;
|
|
706
|
-
export import ListVersionsOptions = _remoteConfig.admin.remoteConfig.ListVersionsOptions;
|
|
707
|
-
export import ListVersionsResult = _remoteConfig.admin.remoteConfig.ListVersionsResult;
|
|
708
|
-
export import RemoteConfigUser = _remoteConfig.admin.remoteConfig.RemoteConfigUser;
|
|
709
|
-
export import RemoteConfig = _remoteConfig.admin.remoteConfig.RemoteConfig;
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
declare namespace admin.securityRules {
|
|
713
|
-
export import RulesFile = _securityRules.admin.securityRules.RulesFile;
|
|
714
|
-
export import RulesetMetadata = _securityRules.admin.securityRules.RulesetMetadata;
|
|
715
|
-
export import Ruleset = _securityRules.admin.securityRules.Ruleset;
|
|
716
|
-
export import RulesetMetadataList = _securityRules.admin.securityRules.RulesetMetadataList;
|
|
717
|
-
export import SecurityRules = _securityRules.admin.securityRules.SecurityRules;
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
declare namespace admin.machineLearning {
|
|
721
|
-
/**
|
|
722
|
-
* Firebase ML Model input objects
|
|
723
|
-
*/
|
|
724
|
-
interface ModelOptionsBase {
|
|
725
|
-
displayName?: string;
|
|
726
|
-
tags?: string[];
|
|
727
|
-
}
|
|
728
|
-
interface GcsTfliteModelOptions extends ModelOptionsBase {
|
|
729
|
-
tfliteModel: {
|
|
730
|
-
gcsTfliteUri: string;
|
|
731
|
-
};
|
|
732
|
-
}
|
|
733
|
-
interface AutoMLTfliteModelOptions extends ModelOptionsBase {
|
|
734
|
-
tfliteModel: {
|
|
735
|
-
automlModel: string;
|
|
736
|
-
};
|
|
737
|
-
}
|
|
738
|
-
type ModelOptions = ModelOptionsBase | GcsTfliteModelOptions | AutoMLTfliteModelOptions;
|
|
739
|
-
|
|
740
|
-
/**
|
|
741
|
-
* A TensorFlow Lite Model output object
|
|
742
|
-
*
|
|
743
|
-
* One of either the `gcsTfliteUri` or `automlModel` properties will be
|
|
744
|
-
* defined.
|
|
745
|
-
*/
|
|
746
|
-
interface TFLiteModel {
|
|
747
|
-
/** The size of the model. */
|
|
748
|
-
readonly sizeBytes: number;
|
|
749
|
-
|
|
750
|
-
/** The URI from which the model was originally provided to Firebase. */
|
|
751
|
-
readonly gcsTfliteUri?: string;
|
|
752
|
-
/**
|
|
753
|
-
* The AutoML model reference from which the model was originally provided
|
|
754
|
-
* to Firebase.
|
|
755
|
-
*/
|
|
756
|
-
readonly automlModel?: string;
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
/**
|
|
760
|
-
* A Firebase ML Model output object
|
|
761
|
-
*/
|
|
762
|
-
interface Model {
|
|
763
|
-
/** The ID of the model. */
|
|
764
|
-
readonly modelId: string;
|
|
765
|
-
|
|
766
|
-
/**
|
|
767
|
-
* The model's name. This is the name you use from your app to load the
|
|
768
|
-
* model.
|
|
769
|
-
*/
|
|
770
|
-
readonly displayName: string;
|
|
771
|
-
|
|
772
|
-
/**
|
|
773
|
-
* The model's tags, which can be used to group or filter models in list
|
|
774
|
-
* operations.
|
|
775
|
-
*/
|
|
776
|
-
readonly tags?: string[];
|
|
777
|
-
|
|
778
|
-
/** The timestamp of the model's creation. */
|
|
779
|
-
readonly createTime: string;
|
|
780
|
-
|
|
781
|
-
/** The timestamp of the model's most recent update. */
|
|
782
|
-
readonly updateTime: string;
|
|
783
|
-
|
|
784
|
-
/** Error message when model validation fails. */
|
|
785
|
-
readonly validationError?: string;
|
|
786
|
-
|
|
787
|
-
/** True if the model is published. */
|
|
788
|
-
readonly published: boolean;
|
|
789
|
-
|
|
790
|
-
/**
|
|
791
|
-
* The ETag identifier of the current version of the model. This value
|
|
792
|
-
* changes whenever you update any of the model's properties.
|
|
793
|
-
*/
|
|
794
|
-
readonly etag: string;
|
|
795
|
-
|
|
796
|
-
/**
|
|
797
|
-
* The hash of the model's `tflite` file. This value changes only when
|
|
798
|
-
* you upload a new TensorFlow Lite model.
|
|
799
|
-
*/
|
|
800
|
-
readonly modelHash?: string;
|
|
801
|
-
|
|
802
|
-
/**
|
|
803
|
-
* True if the model is locked by a server-side operation. You can't make
|
|
804
|
-
* changes to a locked model. See {@link waitForUnlocked `waitForUnlocked()`}.
|
|
805
|
-
*/
|
|
806
|
-
readonly locked: boolean;
|
|
807
|
-
|
|
808
|
-
/**
|
|
809
|
-
* Wait for the model to be unlocked.
|
|
810
|
-
*
|
|
811
|
-
* @param {number} maxTimeMillis The maximum time in milliseconds to wait.
|
|
812
|
-
* If not specified, a default maximum of 2 minutes is used.
|
|
813
|
-
*
|
|
814
|
-
* @return {Promise<void>} A promise that resolves when the model is unlocked
|
|
815
|
-
* or the maximum wait time has passed.
|
|
816
|
-
*/
|
|
817
|
-
waitForUnlocked(maxTimeMillis?: number): Promise<void>;
|
|
818
|
-
|
|
819
|
-
/**
|
|
820
|
-
* Return the model as a JSON object.
|
|
821
|
-
*/
|
|
822
|
-
toJSON(): {[key: string]: any};
|
|
823
|
-
|
|
824
|
-
/** Metadata about the model's TensorFlow Lite model file. */
|
|
825
|
-
readonly tfliteModel?: TFLiteModel;
|
|
826
|
-
}
|
|
827
|
-
|
|
828
|
-
/**
|
|
829
|
-
* Interface representing options for listing Models.
|
|
830
|
-
*/
|
|
831
|
-
interface ListModelsOptions {
|
|
832
|
-
/**
|
|
833
|
-
* An expression that specifies how to filter the results.
|
|
834
|
-
*
|
|
835
|
-
* Examples:
|
|
836
|
-
*
|
|
837
|
-
* ```
|
|
838
|
-
* display_name = your_model
|
|
839
|
-
* display_name : experimental_*
|
|
840
|
-
* tags: face_detector AND tags: experimental
|
|
841
|
-
* state.published = true
|
|
842
|
-
* ```
|
|
843
|
-
*
|
|
844
|
-
* See https://firebase.google.com/docs/ml/manage-hosted-models#list_your_projects_models
|
|
845
|
-
*/
|
|
846
|
-
filter?: string;
|
|
847
|
-
|
|
848
|
-
/** The number of results to return in each page. */
|
|
849
|
-
pageSize?: number;
|
|
850
|
-
|
|
851
|
-
/** A token that specifies the result page to return. */
|
|
852
|
-
pageToken?: string;
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
/** Response object for a listModels operation. */
|
|
856
|
-
interface ListModelsResult {
|
|
857
|
-
/** A list of models in your project. */
|
|
858
|
-
readonly models: Model[];
|
|
859
|
-
|
|
860
|
-
/**
|
|
861
|
-
* A token you can use to retrieve the next page of results. If null, the
|
|
862
|
-
* current page is the final page.
|
|
863
|
-
*/
|
|
864
|
-
readonly pageToken?: string;
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
/**
|
|
869
|
-
* The Firebase `MachineLearning` service interface.
|
|
870
|
-
*
|
|
871
|
-
* Do not call this constructor directly. Instead, use
|
|
872
|
-
* [`admin.machineLearning()`](admin.machineLearning#machineLearning).
|
|
873
|
-
*/
|
|
874
|
-
interface MachineLearning {
|
|
875
|
-
/**
|
|
876
|
-
* The {@link admin.app.App} associated with the current `MachineLearning`
|
|
877
|
-
* service instance.
|
|
878
|
-
*/
|
|
879
|
-
app: admin.app.App;
|
|
880
|
-
|
|
881
|
-
/**
|
|
882
|
-
* Creates a model in the current Firebase project.
|
|
883
|
-
*
|
|
884
|
-
* @param {ModelOptions} model The model to create.
|
|
885
|
-
*
|
|
886
|
-
* @return {Promise<Model>} A Promise fulfilled with the created model.
|
|
887
|
-
*/
|
|
888
|
-
createModel(model: ModelOptions): Promise<Model>;
|
|
889
|
-
|
|
890
|
-
/**
|
|
891
|
-
* Updates a model's metadata or model file.
|
|
892
|
-
*
|
|
893
|
-
* @param {string} modelId The ID of the model to update.
|
|
894
|
-
* @param {ModelOptions} model The model fields to update.
|
|
895
|
-
*
|
|
896
|
-
* @return {Promise<Model>} A Promise fulfilled with the updated model.
|
|
897
|
-
*/
|
|
898
|
-
updateModel(modelId: string, model: ModelOptions): Promise<Model>;
|
|
899
|
-
|
|
900
|
-
/**
|
|
901
|
-
* Publishes a Firebase ML model.
|
|
902
|
-
*
|
|
903
|
-
* A published model can be downloaded to client apps.
|
|
904
|
-
*
|
|
905
|
-
* @param {string} modelId The ID of the model to publish.
|
|
906
|
-
*
|
|
907
|
-
* @return {Promise<Model>} A Promise fulfilled with the published model.
|
|
908
|
-
*/
|
|
909
|
-
publishModel(modelId: string): Promise<Model>;
|
|
910
|
-
|
|
911
|
-
/**
|
|
912
|
-
* Unpublishes a Firebase ML model.
|
|
913
|
-
*
|
|
914
|
-
* @param {string} modelId The ID of the model to unpublish.
|
|
915
|
-
*
|
|
916
|
-
* @return {Promise<Model>} A Promise fulfilled with the unpublished model.
|
|
917
|
-
*/
|
|
918
|
-
unpublishModel(modelId: string): Promise<Model>;
|
|
919
|
-
|
|
920
|
-
/**
|
|
921
|
-
* Gets the model specified by the given ID.
|
|
922
|
-
*
|
|
923
|
-
* @param {string} modelId The ID of the model to get.
|
|
924
|
-
*
|
|
925
|
-
* @return {Promise<Model>} A Promise fulfilled with the model object.
|
|
926
|
-
*/
|
|
927
|
-
getModel(modelId: string): Promise<Model>;
|
|
928
|
-
|
|
929
|
-
/**
|
|
930
|
-
* Lists the current project's models.
|
|
931
|
-
*
|
|
932
|
-
* @param {ListModelsOptions} options The listing options.
|
|
933
|
-
*
|
|
934
|
-
* @return {Promise<ListModelsResult>} A promise that
|
|
935
|
-
* resolves with the current (filtered) list of models and the next page
|
|
936
|
-
* token. For the last page, an empty list of models and no page token
|
|
937
|
-
* are returned.
|
|
938
|
-
*/
|
|
939
|
-
listModels(options?: ListModelsOptions): Promise<ListModelsResult>;
|
|
940
|
-
|
|
941
|
-
/**
|
|
942
|
-
* Deletes a model from the current project.
|
|
943
|
-
*
|
|
944
|
-
* @param {string} modelId The ID of the model to delete.
|
|
945
|
-
*/
|
|
946
|
-
deleteModel(modelId: string): Promise<void>;
|
|
947
|
-
}
|
|
948
|
-
}
|
|
19
|
+
import * as admin from './firebase-namespace';
|
|
949
20
|
|
|
950
21
|
declare module 'firebase-admin' {
|
|
951
22
|
}
|