firebase-admin 9.100.0-alpha.0 → 10.0.2
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 -3
- package/lib/app/core.d.ts +15 -22
- package/lib/app/core.js +1 -1
- package/lib/app/credential-factory.d.ts +17 -33
- package/lib/app/credential-factory.js +17 -33
- package/lib/app/credential-internal.d.ts +10 -9
- package/lib/app/credential-internal.js +15 -13
- package/lib/app/credential.d.ts +3 -9
- package/lib/app/credential.js +1 -1
- package/lib/app/firebase-app.d.ts +6 -30
- package/lib/app/firebase-app.js +72 -216
- package/lib/app/firebase-namespace.d.ts +28 -34
- package/lib/app/firebase-namespace.js +119 -99
- package/lib/app/index.d.ts +6 -1
- package/lib/app/index.js +1 -1
- package/lib/app/lifecycle.d.ts +24 -3
- package/lib/app/lifecycle.js +119 -25
- package/lib/app-check/app-check-api-client-internal.d.ts +32 -0
- package/lib/app-check/app-check-api-client-internal.js +197 -0
- package/lib/app-check/app-check-api.d.ts +95 -0
- package/lib/app-check/app-check-api.js +19 -0
- package/lib/app-check/app-check-namespace.d.ts +65 -0
- package/lib/app-check/app-check-namespace.js +18 -0
- package/lib/app-check/app-check.d.ts +49 -0
- package/lib/app-check/app-check.js +82 -0
- package/lib/app-check/index.d.ts +53 -0
- package/lib/app-check/index.js +63 -0
- package/lib/app-check/token-generator.d.ts +25 -0
- package/lib/app-check/token-generator.js +159 -0
- package/lib/app-check/token-verifier.d.ts +17 -0
- package/lib/app-check/token-verifier.js +151 -0
- package/lib/auth/action-code-settings-builder.d.ts +1 -1
- package/lib/auth/action-code-settings-builder.js +2 -2
- package/lib/auth/auth-api-request.d.ts +28 -32
- package/lib/auth/auth-api-request.js +167 -125
- package/lib/auth/auth-config.d.ts +123 -21
- package/lib/auth/auth-config.js +85 -34
- package/lib/auth/auth-namespace.d.ts +157 -4
- package/lib/auth/auth-namespace.js +1 -1
- package/lib/auth/auth.d.ts +5 -3
- package/lib/auth/auth.js +6 -4
- package/lib/auth/base-auth.d.ts +134 -116
- package/lib/auth/base-auth.js +213 -143
- package/lib/auth/identifier.d.ts +5 -5
- package/lib/auth/identifier.js +1 -1
- package/lib/auth/index.d.ts +10 -5
- package/lib/auth/index.js +9 -4
- package/lib/auth/tenant-manager.d.ts +19 -19
- package/lib/auth/tenant-manager.js +21 -25
- package/lib/auth/tenant.d.ts +14 -5
- package/lib/auth/tenant.js +19 -11
- package/lib/auth/token-generator.d.ts +7 -108
- package/lib/auth/token-generator.js +52 -145
- package/lib/auth/token-verifier.d.ts +3 -4
- package/lib/auth/token-verifier.js +96 -145
- package/lib/auth/user-import-builder.d.ts +11 -11
- package/lib/auth/user-import-builder.js +9 -9
- package/lib/auth/user-record.d.ts +23 -15
- package/lib/auth/user-record.js +30 -20
- package/lib/credential/index.d.ts +18 -35
- package/lib/credential/index.js +17 -33
- package/lib/database/database-namespace.d.ts +39 -10
- package/lib/database/database-namespace.js +1 -1
- package/lib/database/database.d.ts +16 -6
- package/lib/database/database.js +61 -6
- package/lib/database/index.d.ts +19 -18
- package/lib/database/index.js +21 -23
- package/lib/default-namespace.d.ts +7 -1
- package/lib/default-namespace.js +4 -4
- package/lib/esm/app/index.js +10 -0
- package/lib/esm/app-check/index.js +4 -0
- package/lib/esm/auth/index.js +14 -0
- package/lib/esm/database/index.js +6 -0
- package/lib/esm/firestore/index.js +24 -0
- package/lib/esm/installations/index.js +4 -0
- package/lib/esm/instance-id/index.js +4 -0
- package/lib/esm/machine-learning/index.js +5 -0
- package/lib/esm/messaging/index.js +4 -0
- package/lib/esm/package.json +1 -0
- package/lib/esm/project-management/index.js +8 -0
- package/lib/esm/remote-config/index.js +4 -0
- package/lib/esm/security-rules/index.js +6 -0
- package/lib/esm/storage/index.js +4 -0
- package/lib/firebase-namespace-api.d.ts +12 -6
- package/lib/firebase-namespace-api.js +5 -1
- package/lib/firestore/firestore-internal.d.ts +2 -2
- package/lib/firestore/firestore-internal.js +2 -2
- package/lib/firestore/firestore-namespace.d.ts +6 -1
- package/lib/firestore/firestore-namespace.js +2 -1
- package/lib/firestore/index.d.ts +36 -4
- package/lib/firestore/index.js +29 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/installations/index.d.ts +52 -0
- package/lib/installations/index.js +62 -0
- package/lib/installations/installations-namespace.d.ts +55 -0
- package/lib/installations/installations-namespace.js +18 -0
- package/lib/{instance-id/instance-id-request-internal.d.ts → installations/installations-request-handler.d.ts} +8 -8
- package/lib/{instance-id/instance-id-request-internal.js → installations/installations-request-handler.js} +23 -23
- package/lib/installations/installations.d.ts +38 -0
- package/lib/installations/installations.js +63 -0
- package/lib/instance-id/index.d.ts +20 -9
- package/lib/instance-id/index.js +20 -9
- package/lib/instance-id/instance-id-namespace.d.ts +9 -8
- package/lib/instance-id/instance-id-namespace.js +1 -1
- package/lib/instance-id/instance-id.d.ts +8 -6
- package/lib/instance-id/instance-id.js +20 -11
- package/lib/machine-learning/index.d.ts +29 -27
- package/lib/machine-learning/index.js +29 -27
- package/lib/machine-learning/machine-learning-api-client.d.ts +1 -1
- package/lib/machine-learning/machine-learning-api-client.js +4 -4
- package/lib/machine-learning/machine-learning-namespace.d.ts +33 -8
- package/lib/machine-learning/machine-learning-namespace.js +1 -1
- package/lib/machine-learning/machine-learning-utils.d.ts +1 -1
- package/lib/machine-learning/machine-learning-utils.js +1 -1
- package/lib/machine-learning/machine-learning.d.ts +19 -19
- package/lib/machine-learning/machine-learning.js +20 -20
- package/lib/messaging/batch-request-internal.d.ts +3 -3
- package/lib/messaging/batch-request-internal.js +9 -9
- package/lib/messaging/index.d.ts +11 -9
- package/lib/messaging/index.js +11 -9
- package/lib/messaging/messaging-api-request-internal.d.ts +8 -8
- package/lib/messaging/messaging-api-request-internal.js +8 -8
- package/lib/messaging/messaging-api.d.ts +79 -75
- package/lib/messaging/messaging-api.js +1 -1
- package/lib/messaging/messaging-errors-internal.d.ts +5 -5
- package/lib/messaging/messaging-errors-internal.js +7 -7
- package/lib/messaging/messaging-internal.d.ts +1 -1
- package/lib/messaging/messaging-internal.js +6 -31
- package/lib/messaging/messaging-namespace.d.ts +105 -8
- package/lib/messaging/messaging-namespace.js +1 -1
- package/lib/messaging/messaging.d.ts +70 -86
- package/lib/messaging/messaging.js +76 -89
- package/lib/project-management/android-app.d.ts +11 -12
- package/lib/project-management/android-app.js +13 -14
- package/lib/project-management/app-metadata.d.ts +1 -1
- package/lib/project-management/app-metadata.js +1 -1
- package/lib/project-management/index.d.ts +11 -9
- package/lib/project-management/index.js +11 -9
- package/lib/project-management/ios-app.d.ts +6 -7
- package/lib/project-management/ios-app.js +6 -7
- package/lib/project-management/project-management-api-request-internal.d.ts +1 -80
- package/lib/project-management/project-management-api-request-internal.js +14 -14
- package/lib/project-management/project-management-namespace.d.ts +31 -9
- package/lib/project-management/project-management-namespace.js +1 -1
- package/lib/project-management/project-management.d.ts +18 -21
- package/lib/project-management/project-management.js +19 -22
- package/lib/remote-config/index.d.ts +12 -10
- package/lib/remote-config/index.js +11 -9
- package/lib/remote-config/remote-config-api-client-internal.d.ts +1 -1
- package/lib/remote-config/remote-config-api-client-internal.js +2 -2
- package/lib/remote-config/remote-config-api.d.ts +12 -2
- package/lib/remote-config/remote-config-api.js +1 -1
- package/lib/remote-config/remote-config-namespace.d.ts +50 -9
- package/lib/remote-config/remote-config-namespace.js +1 -1
- package/lib/remote-config/remote-config.d.ts +19 -21
- package/lib/remote-config/remote-config.js +25 -25
- package/lib/security-rules/index.d.ts +12 -10
- package/lib/security-rules/index.js +12 -10
- package/lib/security-rules/security-rules-api-client-internal.d.ts +1 -1
- package/lib/security-rules/security-rules-api-client-internal.js +1 -1
- package/lib/security-rules/security-rules-internal.d.ts +1 -1
- package/lib/security-rules/security-rules-internal.js +1 -1
- package/lib/security-rules/security-rules-namespace.d.ts +43 -28
- package/lib/security-rules/security-rules-namespace.js +1 -1
- package/lib/security-rules/security-rules.d.ts +39 -42
- package/lib/security-rules/security-rules.js +38 -39
- package/lib/storage/index.d.ts +9 -7
- package/lib/storage/index.js +9 -7
- package/lib/storage/storage-namespace.d.ts +7 -6
- package/lib/storage/storage-namespace.js +1 -1
- package/lib/storage/storage.d.ts +3 -3
- package/lib/storage/storage.js +14 -4
- package/lib/utils/api-request.d.ts +24 -24
- package/lib/utils/api-request.js +25 -25
- package/lib/utils/crypto-signer.d.ts +128 -0
- package/lib/utils/crypto-signer.js +237 -0
- package/lib/utils/deep-copy.d.ts +6 -6
- package/lib/utils/deep-copy.js +6 -6
- package/lib/utils/error.d.ts +69 -36
- package/lib/utils/error.js +98 -43
- package/lib/utils/index.d.ts +30 -19
- package/lib/utils/index.js +47 -20
- package/lib/utils/jwt.d.ts +131 -0
- package/lib/utils/jwt.js +355 -0
- package/lib/utils/validator.d.ts +37 -37
- package/lib/utils/validator.js +37 -37
- package/package.json +126 -53
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright 2021 Google Inc.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { App } from '../app/index';
|
|
18
|
+
/**
|
|
19
|
+
* The `Installations` service for the current app.
|
|
20
|
+
*/
|
|
21
|
+
export declare class Installations {
|
|
22
|
+
private app_;
|
|
23
|
+
private requestHandler;
|
|
24
|
+
/**
|
|
25
|
+
* Deletes the specified installation ID and the associated data from Firebase.
|
|
26
|
+
*
|
|
27
|
+
* @param fid - The Firebase installation ID to be deleted.
|
|
28
|
+
*
|
|
29
|
+
* @returns A promise fulfilled when the installation ID is deleted.
|
|
30
|
+
*/
|
|
31
|
+
deleteInstallation(fid: string): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the app associated with this Installations instance.
|
|
34
|
+
*
|
|
35
|
+
* @returns The app associated with this Installations instance.
|
|
36
|
+
*/
|
|
37
|
+
get app(): App;
|
|
38
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
|
+
"use strict";
|
|
3
|
+
/*!
|
|
4
|
+
* Copyright 2021 Google Inc.
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.Installations = void 0;
|
|
20
|
+
var error_1 = require("../utils/error");
|
|
21
|
+
var installations_request_handler_1 = require("./installations-request-handler");
|
|
22
|
+
var validator = require("../utils/validator");
|
|
23
|
+
/**
|
|
24
|
+
* The `Installations` service for the current app.
|
|
25
|
+
*/
|
|
26
|
+
var Installations = /** @class */ (function () {
|
|
27
|
+
/**
|
|
28
|
+
* @param app - The app for this Installations service.
|
|
29
|
+
* @constructor
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
function Installations(app) {
|
|
33
|
+
if (!validator.isNonNullObject(app) || !('options' in app)) {
|
|
34
|
+
throw new error_1.FirebaseInstallationsError(error_1.InstallationsClientErrorCode.INVALID_ARGUMENT, 'First argument passed to admin.installations() must be a valid Firebase app instance.');
|
|
35
|
+
}
|
|
36
|
+
this.app_ = app;
|
|
37
|
+
this.requestHandler = new installations_request_handler_1.FirebaseInstallationsRequestHandler(app);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Deletes the specified installation ID and the associated data from Firebase.
|
|
41
|
+
*
|
|
42
|
+
* @param fid - The Firebase installation ID to be deleted.
|
|
43
|
+
*
|
|
44
|
+
* @returns A promise fulfilled when the installation ID is deleted.
|
|
45
|
+
*/
|
|
46
|
+
Installations.prototype.deleteInstallation = function (fid) {
|
|
47
|
+
return this.requestHandler.deleteInstallation(fid);
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(Installations.prototype, "app", {
|
|
50
|
+
/**
|
|
51
|
+
* Returns the app associated with this Installations instance.
|
|
52
|
+
*
|
|
53
|
+
* @returns The app associated with this Installations instance.
|
|
54
|
+
*/
|
|
55
|
+
get: function () {
|
|
56
|
+
return this.app_;
|
|
57
|
+
},
|
|
58
|
+
enumerable: false,
|
|
59
|
+
configurable: true
|
|
60
|
+
});
|
|
61
|
+
return Installations;
|
|
62
|
+
}());
|
|
63
|
+
exports.Installations = Installations;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2020 Google Inc.
|
|
4
4
|
*
|
|
@@ -14,18 +14,24 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
/**
|
|
18
|
+
* Firebase Instance ID service.
|
|
19
|
+
*
|
|
20
|
+
* @packageDocumentation
|
|
21
|
+
*/
|
|
17
22
|
import { App } from '../app/index';
|
|
18
23
|
import { InstanceId } from './instance-id';
|
|
19
24
|
export { InstanceId };
|
|
20
25
|
/**
|
|
21
|
-
* Gets the {@link InstanceId
|
|
22
|
-
*
|
|
26
|
+
* Gets the {@link InstanceId} service for the default app or a given app.
|
|
27
|
+
*
|
|
28
|
+
* This API is deprecated. Developers are advised to use the
|
|
29
|
+
* {@link firebase-admin.installations#getInstallations}
|
|
30
|
+
* API to delete their instance IDs and Firebase installation IDs.
|
|
23
31
|
*
|
|
24
32
|
* `getInstanceId()` can be called with no arguments to access the default
|
|
25
|
-
* app's
|
|
26
|
-
* `
|
|
27
|
-
* {@link InstanceId `InstanceId`} service associated with a
|
|
28
|
-
* specific app.
|
|
33
|
+
* app's `InstanceId` service or as `getInstanceId(app)` to access the
|
|
34
|
+
* `InstanceId` service associated with a specific app.
|
|
29
35
|
*
|
|
30
36
|
* @example
|
|
31
37
|
* ```javascript
|
|
@@ -39,12 +45,17 @@ export { InstanceId };
|
|
|
39
45
|
* const otherInstanceId = getInstanceId(otherApp);
|
|
40
46
|
*```
|
|
41
47
|
*
|
|
42
|
-
*
|
|
48
|
+
* This API is deprecated. Developers are advised to use the `admin.installations()`
|
|
49
|
+
* API to delete their instance IDs and Firebase installation IDs.
|
|
50
|
+
*
|
|
51
|
+
* @param app - Optional app whose `InstanceId` service to
|
|
43
52
|
* return. If not provided, the default `InstanceId` service will be
|
|
44
53
|
* returned.
|
|
45
54
|
*
|
|
46
|
-
* @
|
|
55
|
+
* @returns The default `InstanceId` service if
|
|
47
56
|
* no app is provided or the `InstanceId` service associated with the
|
|
48
57
|
* provided app.
|
|
58
|
+
*
|
|
59
|
+
* @deprecated Use {@link firebase-admin.installations#getInstallations} instead.
|
|
49
60
|
*/
|
|
50
61
|
export declare function getInstanceId(app?: App): InstanceId;
|
package/lib/instance-id/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2020 Google Inc.
|
|
@@ -17,18 +17,24 @@
|
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
19
|
exports.getInstanceId = exports.InstanceId = void 0;
|
|
20
|
+
/**
|
|
21
|
+
* Firebase Instance ID service.
|
|
22
|
+
*
|
|
23
|
+
* @packageDocumentation
|
|
24
|
+
*/
|
|
20
25
|
var index_1 = require("../app/index");
|
|
21
26
|
var instance_id_1 = require("./instance-id");
|
|
22
27
|
Object.defineProperty(exports, "InstanceId", { enumerable: true, get: function () { return instance_id_1.InstanceId; } });
|
|
23
28
|
/**
|
|
24
|
-
* Gets the {@link InstanceId
|
|
25
|
-
*
|
|
29
|
+
* Gets the {@link InstanceId} service for the default app or a given app.
|
|
30
|
+
*
|
|
31
|
+
* This API is deprecated. Developers are advised to use the
|
|
32
|
+
* {@link firebase-admin.installations#getInstallations}
|
|
33
|
+
* API to delete their instance IDs and Firebase installation IDs.
|
|
26
34
|
*
|
|
27
35
|
* `getInstanceId()` can be called with no arguments to access the default
|
|
28
|
-
* app's
|
|
29
|
-
* `
|
|
30
|
-
* {@link InstanceId `InstanceId`} service associated with a
|
|
31
|
-
* specific app.
|
|
36
|
+
* app's `InstanceId` service or as `getInstanceId(app)` to access the
|
|
37
|
+
* `InstanceId` service associated with a specific app.
|
|
32
38
|
*
|
|
33
39
|
* @example
|
|
34
40
|
* ```javascript
|
|
@@ -42,13 +48,18 @@ Object.defineProperty(exports, "InstanceId", { enumerable: true, get: function (
|
|
|
42
48
|
* const otherInstanceId = getInstanceId(otherApp);
|
|
43
49
|
*```
|
|
44
50
|
*
|
|
45
|
-
*
|
|
51
|
+
* This API is deprecated. Developers are advised to use the `admin.installations()`
|
|
52
|
+
* API to delete their instance IDs and Firebase installation IDs.
|
|
53
|
+
*
|
|
54
|
+
* @param app - Optional app whose `InstanceId` service to
|
|
46
55
|
* return. If not provided, the default `InstanceId` service will be
|
|
47
56
|
* returned.
|
|
48
57
|
*
|
|
49
|
-
* @
|
|
58
|
+
* @returns The default `InstanceId` service if
|
|
50
59
|
* no app is provided or the `InstanceId` service associated with the
|
|
51
60
|
* provided app.
|
|
61
|
+
*
|
|
62
|
+
* @deprecated Use {@link firebase-admin.installations#getInstallations} instead.
|
|
52
63
|
*/
|
|
53
64
|
function getInstanceId(app) {
|
|
54
65
|
if (typeof app === 'undefined') {
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
import { App } from '../app/index';
|
|
3
3
|
import { InstanceId as TInstanceId } from './instance-id';
|
|
4
4
|
/**
|
|
5
|
-
* Gets the {@link
|
|
5
|
+
* Gets the {@link firebase-admin.instance-id#InstanceId} service for the
|
|
6
6
|
* default app or a given app.
|
|
7
7
|
*
|
|
8
8
|
* `admin.instanceId()` can be called with no arguments to access the default
|
|
9
|
-
* app's
|
|
10
|
-
* `
|
|
11
|
-
* {@link instanceId.InstanceId `InstanceId`} service associated with a
|
|
12
|
-
* specific app.
|
|
9
|
+
* app's `InstanceId` service or as `admin.instanceId(app)` to access the
|
|
10
|
+
* `InstanceId` service associated with a specific app.
|
|
13
11
|
*
|
|
14
12
|
* @example
|
|
15
13
|
* ```javascript
|
|
@@ -23,15 +21,18 @@ import { InstanceId as TInstanceId } from './instance-id';
|
|
|
23
21
|
* var otherInstanceId = admin.instanceId(otherApp);
|
|
24
22
|
*```
|
|
25
23
|
*
|
|
26
|
-
* @param app Optional app whose `InstanceId` service to
|
|
24
|
+
* @param app - Optional app whose `InstanceId` service to
|
|
27
25
|
* return. If not provided, the default `InstanceId` service will be
|
|
28
26
|
* returned.
|
|
29
27
|
*
|
|
30
|
-
* @
|
|
28
|
+
* @returns The default `InstanceId` service if
|
|
31
29
|
* no app is provided or the `InstanceId` service associated with the
|
|
32
30
|
* provided app.
|
|
33
31
|
*/
|
|
34
32
|
export declare function instanceId(app?: App): instanceId.InstanceId;
|
|
35
33
|
export declare namespace instanceId {
|
|
34
|
+
/**
|
|
35
|
+
* Type alias to {@link firebase-admin.instance-id#InstanceId}.
|
|
36
|
+
*/
|
|
36
37
|
type InstanceId = TInstanceId;
|
|
37
38
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2020 Google Inc.
|
|
4
4
|
*
|
|
@@ -18,28 +18,30 @@ import { App } from '../app/index';
|
|
|
18
18
|
/**
|
|
19
19
|
* The `InstanceId` service enables deleting the Firebase instance IDs
|
|
20
20
|
* associated with Firebase client app instances.
|
|
21
|
+
*
|
|
22
|
+
* @deprecated Use {@link firebase-admin.installations#Installations} instead.
|
|
21
23
|
*/
|
|
22
24
|
export declare class InstanceId {
|
|
23
25
|
private app_;
|
|
24
|
-
private requestHandler;
|
|
25
26
|
/**
|
|
26
27
|
* Deletes the specified instance ID and the associated data from Firebase.
|
|
27
28
|
*
|
|
28
29
|
* Note that Google Analytics for Firebase uses its own form of Instance ID to
|
|
29
30
|
* keep track of analytics data. Therefore deleting a Firebase Instance ID does
|
|
30
31
|
* not delete Analytics data. See
|
|
31
|
-
*
|
|
32
|
+
* {@link https://firebase.google.com/support/privacy/manage-iids#delete_an_instance_id |
|
|
33
|
+
* Delete an Instance ID}
|
|
32
34
|
* for more information.
|
|
33
35
|
*
|
|
34
|
-
* @param instanceId The instance ID to be deleted.
|
|
36
|
+
* @param instanceId - The instance ID to be deleted.
|
|
35
37
|
*
|
|
36
|
-
* @
|
|
38
|
+
* @returns A promise fulfilled when the instance ID is deleted.
|
|
37
39
|
*/
|
|
38
40
|
deleteInstanceId(instanceId: string): Promise<void>;
|
|
39
41
|
/**
|
|
40
42
|
* Returns the app associated with this InstanceId instance.
|
|
41
43
|
*
|
|
42
|
-
* @
|
|
44
|
+
* @returns The app associated with this InstanceId instance.
|
|
43
45
|
*/
|
|
44
46
|
get app(): App;
|
|
45
47
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2020 Google Inc.
|
|
@@ -17,16 +17,18 @@
|
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
19
|
exports.InstanceId = void 0;
|
|
20
|
+
var installations_1 = require("../installations");
|
|
20
21
|
var error_1 = require("../utils/error");
|
|
21
|
-
var instance_id_request_internal_1 = require("./instance-id-request-internal");
|
|
22
22
|
var validator = require("../utils/validator");
|
|
23
23
|
/**
|
|
24
24
|
* The `InstanceId` service enables deleting the Firebase instance IDs
|
|
25
25
|
* associated with Firebase client app instances.
|
|
26
|
+
*
|
|
27
|
+
* @deprecated Use {@link firebase-admin.installations#Installations} instead.
|
|
26
28
|
*/
|
|
27
29
|
var InstanceId = /** @class */ (function () {
|
|
28
30
|
/**
|
|
29
|
-
* @param app The app for this InstanceId service.
|
|
31
|
+
* @param app - The app for this InstanceId service.
|
|
30
32
|
* @constructor
|
|
31
33
|
* @internal
|
|
32
34
|
*/
|
|
@@ -35,7 +37,6 @@ var InstanceId = /** @class */ (function () {
|
|
|
35
37
|
throw new error_1.FirebaseInstanceIdError(error_1.InstanceIdClientErrorCode.INVALID_ARGUMENT, 'First argument passed to instanceId() must be a valid Firebase app instance.');
|
|
36
38
|
}
|
|
37
39
|
this.app_ = app;
|
|
38
|
-
this.requestHandler = new instance_id_request_internal_1.FirebaseInstanceIdRequestHandler(app);
|
|
39
40
|
}
|
|
40
41
|
/**
|
|
41
42
|
* Deletes the specified instance ID and the associated data from Firebase.
|
|
@@ -43,24 +44,32 @@ var InstanceId = /** @class */ (function () {
|
|
|
43
44
|
* Note that Google Analytics for Firebase uses its own form of Instance ID to
|
|
44
45
|
* keep track of analytics data. Therefore deleting a Firebase Instance ID does
|
|
45
46
|
* not delete Analytics data. See
|
|
46
|
-
*
|
|
47
|
+
* {@link https://firebase.google.com/support/privacy/manage-iids#delete_an_instance_id |
|
|
48
|
+
* Delete an Instance ID}
|
|
47
49
|
* for more information.
|
|
48
50
|
*
|
|
49
|
-
* @param instanceId The instance ID to be deleted.
|
|
51
|
+
* @param instanceId - The instance ID to be deleted.
|
|
50
52
|
*
|
|
51
|
-
* @
|
|
53
|
+
* @returns A promise fulfilled when the instance ID is deleted.
|
|
52
54
|
*/
|
|
53
55
|
InstanceId.prototype.deleteInstanceId = function (instanceId) {
|
|
54
|
-
return this.
|
|
55
|
-
.
|
|
56
|
-
|
|
56
|
+
return installations_1.getInstallations(this.app).deleteInstallation(instanceId)
|
|
57
|
+
.catch(function (err) {
|
|
58
|
+
if (err instanceof error_1.FirebaseInstallationsError) {
|
|
59
|
+
var code = err.code.replace('installations/', '');
|
|
60
|
+
if (code === error_1.InstallationsClientErrorCode.INVALID_INSTALLATION_ID.code) {
|
|
61
|
+
code = error_1.InstanceIdClientErrorCode.INVALID_INSTANCE_ID.code;
|
|
62
|
+
}
|
|
63
|
+
throw new error_1.FirebaseInstanceIdError({ code: code, message: err.message });
|
|
64
|
+
}
|
|
65
|
+
throw err;
|
|
57
66
|
});
|
|
58
67
|
};
|
|
59
68
|
Object.defineProperty(InstanceId.prototype, "app", {
|
|
60
69
|
/**
|
|
61
70
|
* Returns the app associated with this InstanceId instance.
|
|
62
71
|
*
|
|
63
|
-
* @
|
|
72
|
+
* @returns The app associated with this InstanceId instance.
|
|
64
73
|
*/
|
|
65
74
|
get: function () {
|
|
66
75
|
return this.app_;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2020 Google Inc.
|
|
4
4
|
*
|
|
@@ -14,37 +14,39 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
/**
|
|
18
|
+
* Firebase Machine Learning.
|
|
19
|
+
*
|
|
20
|
+
* @packageDocumentation
|
|
21
|
+
*/
|
|
17
22
|
import { App } from '../app';
|
|
18
23
|
import { MachineLearning } from './machine-learning';
|
|
19
24
|
export { MachineLearning, ListModelsResult, Model, TFLiteModel, } from './machine-learning';
|
|
20
25
|
export { AutoMLTfliteModelOptions, GcsTfliteModelOptions, ListModelsOptions, ModelOptions, ModelOptionsBase, } from './machine-learning-api-client';
|
|
21
26
|
/**
|
|
22
|
-
* Gets the {@link
|
|
23
|
-
* default app or a given app.
|
|
27
|
+
* Gets the {@link MachineLearning} service for the default app or a given app.
|
|
24
28
|
*
|
|
25
29
|
* `getMachineLearning()` can be called with no arguments to access the
|
|
26
|
-
* default app's
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
* `MachineLearning` service associated with the provided app.
|
|
49
|
-
*/
|
|
30
|
+
* default app's `MachineLearning` service or as `getMachineLearning(app)` to access
|
|
31
|
+
* the `MachineLearning` service associated with a specific app.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```javascript
|
|
35
|
+
* // Get the MachineLearning service for the default app
|
|
36
|
+
* const defaultMachineLearning = getMachineLearning();
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```javascript
|
|
41
|
+
* // Get the MachineLearning service for a given app
|
|
42
|
+
* const otherMachineLearning = getMachineLearning(otherApp);
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @param app - Optional app whose `MachineLearning` service to
|
|
46
|
+
* return. If not provided, the default `MachineLearning` service
|
|
47
|
+
* will be returned.
|
|
48
|
+
*
|
|
49
|
+
* @returns The default `MachineLearning` service if no app is provided or the
|
|
50
|
+
* `MachineLearning` service associated with the provided app.
|
|
51
|
+
*/
|
|
50
52
|
export declare function getMachineLearning(app?: App): MachineLearning;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2020 Google Inc.
|
|
@@ -17,40 +17,42 @@
|
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
19
|
exports.getMachineLearning = void 0;
|
|
20
|
+
/**
|
|
21
|
+
* Firebase Machine Learning.
|
|
22
|
+
*
|
|
23
|
+
* @packageDocumentation
|
|
24
|
+
*/
|
|
20
25
|
var app_1 = require("../app");
|
|
21
26
|
var machine_learning_1 = require("./machine-learning");
|
|
22
27
|
var machine_learning_2 = require("./machine-learning");
|
|
23
28
|
Object.defineProperty(exports, "MachineLearning", { enumerable: true, get: function () { return machine_learning_2.MachineLearning; } });
|
|
24
29
|
Object.defineProperty(exports, "Model", { enumerable: true, get: function () { return machine_learning_2.Model; } });
|
|
25
30
|
/**
|
|
26
|
-
* Gets the {@link
|
|
27
|
-
* default app or a given app.
|
|
31
|
+
* Gets the {@link MachineLearning} service for the default app or a given app.
|
|
28
32
|
*
|
|
29
33
|
* `getMachineLearning()` can be called with no arguments to access the
|
|
30
|
-
* default app's
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
* `MachineLearning` service associated with the provided app.
|
|
53
|
-
*/
|
|
34
|
+
* default app's `MachineLearning` service or as `getMachineLearning(app)` to access
|
|
35
|
+
* the `MachineLearning` service associated with a specific app.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```javascript
|
|
39
|
+
* // Get the MachineLearning service for the default app
|
|
40
|
+
* const defaultMachineLearning = getMachineLearning();
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```javascript
|
|
45
|
+
* // Get the MachineLearning service for a given app
|
|
46
|
+
* const otherMachineLearning = getMachineLearning(otherApp);
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @param app - Optional app whose `MachineLearning` service to
|
|
50
|
+
* return. If not provided, the default `MachineLearning` service
|
|
51
|
+
* will be returned.
|
|
52
|
+
*
|
|
53
|
+
* @returns The default `MachineLearning` service if no app is provided or the
|
|
54
|
+
* `MachineLearning` service associated with the provided app.
|
|
55
|
+
*/
|
|
54
56
|
function getMachineLearning(app) {
|
|
55
57
|
if (typeof app === 'undefined') {
|
|
56
58
|
app = app_1.getApp();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2020 Google Inc.
|
|
@@ -152,8 +152,8 @@ var MachineLearningApiClient = /** @class */ (function () {
|
|
|
152
152
|
/**
|
|
153
153
|
* Handles a Long Running Operation coming back from the server.
|
|
154
154
|
*
|
|
155
|
-
* @param op The operation to handle
|
|
156
|
-
* @param options The options for polling
|
|
155
|
+
* @param op - The operation to handle
|
|
156
|
+
* @param options - The options for polling
|
|
157
157
|
*/
|
|
158
158
|
MachineLearningApiClient.prototype.handleOperation = function (op, options) {
|
|
159
159
|
if (op.done) {
|
|
@@ -221,7 +221,7 @@ var MachineLearningApiClient = /** @class */ (function () {
|
|
|
221
221
|
/**
|
|
222
222
|
* Gets the specified resource from the ML API. Resource names must be the full names including project
|
|
223
223
|
* number prefix.
|
|
224
|
-
* @param fullName Full resource name of the resource to get. e.g. projects/123465/operations/987654
|
|
224
|
+
* @param fullName - Full resource name of the resource to get. e.g. projects/123465/operations/987654
|
|
225
225
|
* @returns {Promise<T>} A promise that fulfulls with the resource.
|
|
226
226
|
*/
|
|
227
227
|
MachineLearningApiClient.prototype.getResourceWithFullName = function (fullName) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2021 Google Inc.
|
|
4
4
|
*
|
|
@@ -18,14 +18,12 @@ import { App } from '../app';
|
|
|
18
18
|
import { ListModelsResult as TListModelsResult, MachineLearning as TMachineLearning, Model as TModel, TFLiteModel as TTFLiteModel } from './machine-learning';
|
|
19
19
|
import { AutoMLTfliteModelOptions as TAutoMLTfliteModelOptions, GcsTfliteModelOptions as TGcsTfliteModelOptions, ListModelsOptions as TListModelsOptions, ModelOptions as TModelOptions, ModelOptionsBase as TModelOptionsBase } from './machine-learning-api-client';
|
|
20
20
|
/**
|
|
21
|
-
* Gets the {@link
|
|
21
|
+
* Gets the {@link firebase-admin.machine-learning#MachineLearning} service for the
|
|
22
22
|
* default app or a given app.
|
|
23
23
|
*
|
|
24
24
|
* `admin.machineLearning()` can be called with no arguments to access the
|
|
25
|
-
* default app's
|
|
26
|
-
* `MachineLearning`
|
|
27
|
-
* the {@link machineLearning.MachineLearning `MachineLearning`}
|
|
28
|
-
* service associated with a specific app.
|
|
25
|
+
* default app's `MachineLearning` service or as `admin.machineLearning(app)` to access
|
|
26
|
+
* the `MachineLearning` service associated with a specific app.
|
|
29
27
|
*
|
|
30
28
|
* @example
|
|
31
29
|
* ```javascript
|
|
@@ -39,22 +37,49 @@ import { AutoMLTfliteModelOptions as TAutoMLTfliteModelOptions, GcsTfliteModelOp
|
|
|
39
37
|
* var otherMachineLearning = admin.machineLearning(otherApp);
|
|
40
38
|
* ```
|
|
41
39
|
*
|
|
42
|
-
* @param app Optional app whose `MachineLearning` service to
|
|
40
|
+
* @param app - Optional app whose `MachineLearning` service to
|
|
43
41
|
* return. If not provided, the default `MachineLearning` service
|
|
44
42
|
* will be returned.
|
|
45
43
|
*
|
|
46
|
-
* @
|
|
44
|
+
* @returns The default `MachineLearning` service if no app is provided or the
|
|
47
45
|
* `MachineLearning` service associated with the provided app.
|
|
48
46
|
*/
|
|
49
47
|
export declare function machineLearning(app?: App): machineLearning.MachineLearning;
|
|
50
48
|
export declare namespace machineLearning {
|
|
49
|
+
/**
|
|
50
|
+
* Type alias to {@link firebase-admin.machine-learning#ListModelsResult}.
|
|
51
|
+
*/
|
|
51
52
|
type ListModelsResult = TListModelsResult;
|
|
53
|
+
/**
|
|
54
|
+
* Type alias to {@link firebase-admin.machine-learning#MachineLearning}.
|
|
55
|
+
*/
|
|
52
56
|
type MachineLearning = TMachineLearning;
|
|
57
|
+
/**
|
|
58
|
+
* Type alias to {@link firebase-admin.machine-learning#Model}.
|
|
59
|
+
*/
|
|
53
60
|
type Model = TModel;
|
|
61
|
+
/**
|
|
62
|
+
* Type alias to {@link firebase-admin.machine-learning#TFLiteModel}.
|
|
63
|
+
*/
|
|
54
64
|
type TFLiteModel = TTFLiteModel;
|
|
65
|
+
/**
|
|
66
|
+
* Type alias to {@link firebase-admin.machine-learning#AutoMLTfliteModelOptions}.
|
|
67
|
+
*/
|
|
55
68
|
type AutoMLTfliteModelOptions = TAutoMLTfliteModelOptions;
|
|
69
|
+
/**
|
|
70
|
+
* Type alias to {@link firebase-admin.machine-learning#GcsTfliteModelOptions}.
|
|
71
|
+
*/
|
|
56
72
|
type GcsTfliteModelOptions = TGcsTfliteModelOptions;
|
|
73
|
+
/**
|
|
74
|
+
* Type alias to {@link firebase-admin.machine-learning#ListModelsOptions}.
|
|
75
|
+
*/
|
|
57
76
|
type ListModelsOptions = TListModelsOptions;
|
|
77
|
+
/**
|
|
78
|
+
* Type alias to {@link firebase-admin.machine-learning#ModelOptions}.
|
|
79
|
+
*/
|
|
58
80
|
type ModelOptions = TModelOptions;
|
|
81
|
+
/**
|
|
82
|
+
* Type alias to {@link firebase-admin.machine-learning#ModelOptionsBase}.
|
|
83
|
+
*/
|
|
59
84
|
type ModelOptionsBase = TModelOptionsBase;
|
|
60
85
|
}
|