UNPKG

3.02 kBJavaScriptView Raw
1/*! firebase-admin v10.0.0 */
2"use strict";
3/*!
4 * Copyright 2020 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 */
18Object.defineProperty(exports, "__esModule", { value: true });
19exports.getProjectManagement = void 0;
20/**
21 * Firebase project management.
22 *
23 * @packageDocumentation
24 */
25var app_1 = require("../app");
26var project_management_1 = require("./project-management");
27var app_metadata_1 = require("./app-metadata");
28Object.defineProperty(exports, "AppPlatform", { enumerable: true, get: function () { return app_metadata_1.AppPlatform; } });
29var project_management_2 = require("./project-management");
30Object.defineProperty(exports, "ProjectManagement", { enumerable: true, get: function () { return project_management_2.ProjectManagement; } });
31var android_app_1 = require("./android-app");
32Object.defineProperty(exports, "AndroidApp", { enumerable: true, get: function () { return android_app_1.AndroidApp; } });
33Object.defineProperty(exports, "ShaCertificate", { enumerable: true, get: function () { return android_app_1.ShaCertificate; } });
34var ios_app_1 = require("./ios-app");
35Object.defineProperty(exports, "IosApp", { enumerable: true, get: function () { return ios_app_1.IosApp; } });
36/**
37 * Gets the {@link ProjectManagement} service for the default app or a given app.
38 *
39 * `getProjectManagement()` can be called with no arguments to access the
40 * default app's `ProjectManagement` service, or as `getProjectManagement(app)` to access
41 * the `ProjectManagement` service associated with a specific app.
42 *
43 * @example
44 * ```javascript
45 * // Get the ProjectManagement service for the default app
46 * const defaultProjectManagement = getProjectManagement();
47 * ```
48 *
49 * @example
50 * ```javascript
51 * // Get the ProjectManagement service for a given app
52 * const otherProjectManagement = getProjectManagement(otherApp);
53 * ```
54 *
55 * @param app - Optional app whose `ProjectManagement` service
56 * to return. If not provided, the default `ProjectManagement` service will
57 * be returned. *
58 * @returns The default `ProjectManagement` service if no app is provided or the
59 * `ProjectManagement` service associated with the provided app.
60 */
61function getProjectManagement(app) {
62 if (typeof app === 'undefined') {
63 app = app_1.getApp();
64 }
65 var firebaseApp = app;
66 return firebaseApp.getOrInitService('projectManagement', function (app) { return new project_management_1.ProjectManagement(app); });
67}
68exports.getProjectManagement = getProjectManagement;