firebase-admin
Advanced tools
Comparing version 6.3.0 to 6.4.0
@@ -5,4 +5,22 @@ # Unreleased | ||
# v6.4.0 | ||
- [added] `messaging.Aps` type now supports configuring a critical sound. | ||
A new `messaging.CriticalSound` type has been introduced for this purpose. | ||
- [added] `messaging.AndroidNotification` type now supports `channel_id`. | ||
- [added] `AppOptions` now accepts an optional `http.Agent` object. The | ||
`http.Agent` specified via this API is used when the SDK makes backend | ||
HTTP calls. This can be used when it is required to deploy the Admin SDK | ||
behind a proxy. | ||
- [added] `admin.credential.cert()`, `admin.credential.applicationDefault()`, | ||
and `admin.credential.refreshToken()` methods now accept an `http.Agent` | ||
as an optional argument. If specified, the `http.Agent` will be used | ||
when calling Google backend servers to fetch OAuth2 access tokens. | ||
- [added] `messaging.AndroidNotification`type now supports channel_id. | ||
# v6.3.0 | ||
- [added] A new `ProjectManagement` service, which includes the ability to | ||
create, list, and get details about Android and iOS apps associated with your | ||
Firebase Project. | ||
- [added] `messaging.ApsAlert` type now supports subtitle in its payload. | ||
@@ -26,5 +44,2 @@ | ||
`QueryDocumentSnapshot` types from the `admin.firestore` namespace. | ||
- [added] A new `ProjectManagement` service, which includes the ability to | ||
create, list, and get details about Android and iOS apps associated with your | ||
Firebase Project. | ||
@@ -31,0 +46,0 @@ # v6.0.0 |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ /*! |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -34,3 +34,3 @@ /*! | ||
var FIREBASE_AUTH_HEADER = { | ||
'X-Client-Version': 'Node/Admin/6.3.0', | ||
'X-Client-Version': 'Node/Admin/6.4.0', | ||
}; | ||
@@ -37,0 +37,0 @@ /** Firebase Auth request timeout duration in milliseconds. */ |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ /*! |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -171,6 +171,7 @@ /*! | ||
var CertCredential = /** @class */ (function () { | ||
function CertCredential(serviceAccountPathOrObject) { | ||
function CertCredential(serviceAccountPathOrObject, httpAgent) { | ||
this.certificate = (typeof serviceAccountPathOrObject === 'string') ? | ||
Certificate.fromPath(serviceAccountPathOrObject) : new Certificate(serviceAccountPathOrObject); | ||
this.httpClient = new api_request_1.HttpClient(); | ||
this.httpAgent = httpAgent; | ||
} | ||
@@ -188,2 +189,3 @@ CertCredential.prototype.getAccessToken = function () { | ||
data: postData, | ||
httpAgent: this.httpAgent, | ||
}; | ||
@@ -221,6 +223,7 @@ return requestAccessToken(this.httpClient, request); | ||
var RefreshTokenCredential = /** @class */ (function () { | ||
function RefreshTokenCredential(refreshTokenPathOrObject) { | ||
function RefreshTokenCredential(refreshTokenPathOrObject, httpAgent) { | ||
this.refreshToken = (typeof refreshTokenPathOrObject === 'string') ? | ||
RefreshToken.fromPath(refreshTokenPathOrObject) : new RefreshToken(refreshTokenPathOrObject); | ||
this.httpClient = new api_request_1.HttpClient(); | ||
this.httpAgent = httpAgent; | ||
} | ||
@@ -239,2 +242,3 @@ RefreshTokenCredential.prototype.getAccessToken = function () { | ||
data: postData, | ||
httpAgent: this.httpAgent, | ||
}; | ||
@@ -255,4 +259,5 @@ return requestAccessToken(this.httpClient, request); | ||
var MetadataServiceCredential = /** @class */ (function () { | ||
function MetadataServiceCredential() { | ||
function MetadataServiceCredential(httpAgent) { | ||
this.httpClient = new api_request_1.HttpClient(); | ||
this.httpAgent = httpAgent; | ||
} | ||
@@ -263,2 +268,3 @@ MetadataServiceCredential.prototype.getAccessToken = function () { | ||
url: "http://" + GOOGLE_METADATA_SERVICE_HOST + GOOGLE_METADATA_SERVICE_PATH, | ||
httpAgent: this.httpAgent, | ||
}; | ||
@@ -278,6 +284,6 @@ return requestAccessToken(this.httpClient, request); | ||
var ApplicationDefaultCredential = /** @class */ (function () { | ||
function ApplicationDefaultCredential() { | ||
function ApplicationDefaultCredential(httpAgent) { | ||
if (process.env.GOOGLE_APPLICATION_CREDENTIALS) { | ||
var serviceAccount = Certificate.fromPath(process.env.GOOGLE_APPLICATION_CREDENTIALS); | ||
this.credential_ = new CertCredential(serviceAccount); | ||
this.credential_ = new CertCredential(serviceAccount, httpAgent); | ||
return; | ||
@@ -288,6 +294,6 @@ } | ||
if (refreshToken) { | ||
this.credential_ = new RefreshTokenCredential(refreshToken); | ||
this.credential_ = new RefreshTokenCredential(refreshToken, httpAgent); | ||
return; | ||
} | ||
this.credential_ = new MetadataServiceCredential(); | ||
this.credential_ = new MetadataServiceCredential(httpAgent); | ||
} | ||
@@ -294,0 +300,0 @@ ApplicationDefaultCredential.prototype.getAccessToken = function () { |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ /*! |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ /*! |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ /*! |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ /*! |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ /*! |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ /*! |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -217,19 +217,19 @@ /*! | ||
var firebaseCredential = { | ||
cert: function (serviceAccountPathOrObject) { | ||
cert: function (serviceAccountPathOrObject, httpAgent) { | ||
var stringifiedServiceAccount = JSON.stringify(serviceAccountPathOrObject); | ||
if (!(stringifiedServiceAccount in globalCertCreds)) { | ||
globalCertCreds[stringifiedServiceAccount] = new credential_1.CertCredential(serviceAccountPathOrObject); | ||
globalCertCreds[stringifiedServiceAccount] = new credential_1.CertCredential(serviceAccountPathOrObject, httpAgent); | ||
} | ||
return globalCertCreds[stringifiedServiceAccount]; | ||
}, | ||
refreshToken: function (refreshTokenPathOrObject) { | ||
refreshToken: function (refreshTokenPathOrObject, httpAgent) { | ||
var stringifiedRefreshToken = JSON.stringify(refreshTokenPathOrObject); | ||
if (!(stringifiedRefreshToken in globalRefreshTokenCreds)) { | ||
globalRefreshTokenCreds[stringifiedRefreshToken] = new credential_1.RefreshTokenCredential(refreshTokenPathOrObject); | ||
globalRefreshTokenCreds[stringifiedRefreshToken] = new credential_1.RefreshTokenCredential(refreshTokenPathOrObject, httpAgent); | ||
} | ||
return globalRefreshTokenCreds[stringifiedRefreshToken]; | ||
}, | ||
applicationDefault: function () { | ||
applicationDefault: function (httpAgent) { | ||
if (typeof globalAppDefaultCred === 'undefined') { | ||
globalAppDefaultCred = new credential_1.ApplicationDefaultCredential(); | ||
globalAppDefaultCred = new credential_1.ApplicationDefaultCredential(httpAgent); | ||
} | ||
@@ -250,3 +250,3 @@ return globalAppDefaultCred; | ||
this.credential = firebaseCredential; | ||
this.SDK_VERSION = '6.3.0'; | ||
this.SDK_VERSION = '6.4.0'; | ||
/* tslint:disable */ | ||
@@ -253,0 +253,0 @@ // TODO(jwenger): Database is the only consumer of firebase.Promise. We should update it to use |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ /*! |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ /*! |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
/*! | ||
@@ -20,2 +20,3 @@ * Copyright 2017 Google Inc. | ||
import * as _firestore from '@google-cloud/firestore'; | ||
import {Agent} from 'http'; | ||
@@ -54,2 +55,3 @@ declare namespace admin { | ||
projectId?: string; | ||
httpAgent?: Agent; | ||
} | ||
@@ -275,5 +277,5 @@ | ||
function applicationDefault(): admin.credential.Credential; | ||
function cert(serviceAccountPathOrObject: string|admin.ServiceAccount): admin.credential.Credential; | ||
function refreshToken(refreshTokenPathOrObject: string|Object): admin.credential.Credential; | ||
function applicationDefault(httpAgent?: Agent): admin.credential.Credential; | ||
function cert(serviceAccountPathOrObject: string|admin.ServiceAccount, httpAgent?: Agent): admin.credential.Credential; | ||
function refreshToken(refreshTokenPathOrObject: string|Object, httpAgent?: Agent): admin.credential.Credential; | ||
} | ||
@@ -438,2 +440,3 @@ | ||
titleLocArgs?: string[]; | ||
channelId?: string; | ||
}; | ||
@@ -454,3 +457,3 @@ | ||
badge?: number; | ||
sound?: string; | ||
sound?: string | CriticalSound; | ||
contentAvailable?: boolean; | ||
@@ -477,2 +480,8 @@ mutableContent?: boolean; | ||
type CriticalSound = { | ||
critical?: boolean; | ||
name?: string; | ||
volume?: number; | ||
} | ||
type Notification = { | ||
@@ -479,0 +488,0 @@ title?: string; |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ /*! |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ /*! |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ /*! |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -26,3 +26,3 @@ /*! | ||
var FIREBASE_MESSAGING_HEADERS = { | ||
'Sdk-Version': 'Node/Admin/6.3.0', | ||
'Sdk-Version': 'Node/Admin/6.4.0', | ||
'access_token_auth': 'true', | ||
@@ -29,0 +29,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -158,2 +158,3 @@ /*! | ||
validateApsAlert(aps.alert); | ||
validateApsSound(aps.sound); | ||
var propertyMappings = { | ||
@@ -189,2 +190,30 @@ contentAvailable: 'content-available', | ||
} | ||
function validateApsSound(sound) { | ||
if (typeof sound === 'undefined' || validator.isString(sound)) { | ||
return; | ||
} | ||
else if (!validator.isNonNullObject(sound)) { | ||
throw new error_1.FirebaseMessagingError(error_1.MessagingClientErrorCode.INVALID_PAYLOAD, 'apns.payload.aps.sound must be a string or a non-null object'); | ||
} | ||
var volume = sound.volume; | ||
if (typeof volume !== 'undefined') { | ||
if (!validator.isNumber(volume)) { | ||
throw new error_1.FirebaseMessagingError(error_1.MessagingClientErrorCode.INVALID_PAYLOAD, 'apns.payload.aps.sound.volume must be a number'); | ||
} | ||
if (volume < 0 || volume > 1) { | ||
throw new error_1.FirebaseMessagingError(error_1.MessagingClientErrorCode.INVALID_PAYLOAD, 'apns.payload.aps.sound.volume must be in the interval [0, 1]'); | ||
} | ||
} | ||
var soundObject = sound; | ||
var key = 'critical'; | ||
var critical = soundObject[key]; | ||
if (typeof critical !== 'undefined' && critical !== 1) { | ||
if (critical === true) { | ||
soundObject[key] = 1; | ||
} | ||
else { | ||
delete soundObject[key]; | ||
} | ||
} | ||
} | ||
/** | ||
@@ -301,2 +330,3 @@ * Checks if the given alert object is valid. Alert could be a string or a complex object. | ||
titleLocArgs: 'title_loc_args', | ||
channelId: 'channel_id', | ||
}; | ||
@@ -303,0 +333,0 @@ index_1.renameProperties(notification, propertyMappings); |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -29,5 +29,6 @@ /*! | ||
} | ||
this.resourceName = "projects/-/androidApps/" + appId; | ||
} | ||
AndroidApp.prototype.getMetadata = function () { | ||
return this.requestHandler.getAndroidMetadata(this.appId) | ||
return this.requestHandler.getResource(this.resourceName) | ||
.then(function (responseData) { | ||
@@ -50,6 +51,6 @@ project_management_api_request_1.assertServerResponse(validator.isNonNullObject(responseData), responseData, 'getMetadata()\'s responseData must be a non-null object.'); | ||
AndroidApp.prototype.setDisplayName = function (newDisplayName) { | ||
return this.requestHandler.setAndroidDisplayName(this.appId, newDisplayName); | ||
return this.requestHandler.setDisplayName(this.resourceName, newDisplayName); | ||
}; | ||
AndroidApp.prototype.getShaCertificates = function () { | ||
return this.requestHandler.getAndroidShaCertificates(this.appId) | ||
return this.requestHandler.getAndroidShaCertificates(this.resourceName) | ||
.then(function (responseData) { | ||
@@ -72,6 +73,6 @@ project_management_api_request_1.assertServerResponse(validator.isNonNullObject(responseData), responseData, 'getShaCertificates()\'s responseData must be a non-null object.'); | ||
AndroidApp.prototype.addShaCertificate = function (certificateToAdd) { | ||
return this.requestHandler.addAndroidShaCertificate(this.appId, certificateToAdd); | ||
return this.requestHandler.addAndroidShaCertificate(this.resourceName, certificateToAdd); | ||
}; | ||
AndroidApp.prototype.deleteShaCertificate = function (certificateToDelete) { | ||
return this.requestHandler.deleteAndroidShaCertificate(certificateToDelete); | ||
return this.requestHandler.deleteResource(certificateToDelete.resourceName); | ||
}; | ||
@@ -83,3 +84,3 @@ /** | ||
AndroidApp.prototype.getConfig = function () { | ||
return this.requestHandler.getAndroidConfig(this.appId) | ||
return this.requestHandler.getConfig(this.resourceName) | ||
.then(function (responseData) { | ||
@@ -86,0 +87,0 @@ project_management_api_request_1.assertServerResponse(validator.isNonNullObject(responseData), responseData, 'getConfig()\'s responseData must be a non-null object.'); |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -29,5 +29,6 @@ /*! | ||
} | ||
this.resourceName = "projects/-/iosApps/" + appId; | ||
} | ||
IosApp.prototype.getMetadata = function () { | ||
return this.requestHandler.getIosMetadata(this.appId) | ||
return this.requestHandler.getResource(this.resourceName) | ||
.then(function (responseData) { | ||
@@ -50,3 +51,3 @@ project_management_api_request_1.assertServerResponse(validator.isNonNullObject(responseData), responseData, 'getMetadata()\'s responseData must be a non-null object.'); | ||
IosApp.prototype.setDisplayName = function (newDisplayName) { | ||
return this.requestHandler.setIosDisplayName(this.appId, newDisplayName); | ||
return this.requestHandler.setDisplayName(this.resourceName, newDisplayName); | ||
}; | ||
@@ -58,3 +59,3 @@ /** | ||
IosApp.prototype.getConfig = function () { | ||
return this.requestHandler.getIosConfig(this.appId) | ||
return this.requestHandler.getConfig(this.resourceName) | ||
.then(function (responseData) { | ||
@@ -61,0 +62,0 @@ project_management_api_request_1.assertServerResponse(validator.isNonNullObject(responseData), responseData, 'getConfig()\'s responseData must be a non-null object.'); |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -30,3 +30,3 @@ /*! | ||
var PROJECT_MANAGEMENT_HEADERS = { | ||
'X-Client-Version': 'Node/Admin/6.3.0', | ||
'X-Client-Version': 'Node/Admin/6.4.0', | ||
}; | ||
@@ -100,11 +100,23 @@ /** Project management request timeout duration in milliseconds. */ | ||
}; | ||
ProjectManagementRequestHandler.prototype.listAndroidApps = function (projectId) { | ||
return this.invokeRequestHandler('GET', "projects/" + projectId + "/androidApps?page_size=" + LIST_APPS_MAX_PAGE_SIZE, | ||
/** | ||
* @param {string} parentResourceName Fully-qualified resource name of the project whose Android | ||
* apps you want to list. | ||
*/ | ||
ProjectManagementRequestHandler.prototype.listAndroidApps = function (parentResourceName) { | ||
return this.invokeRequestHandler('GET', parentResourceName + "/androidApps?page_size=" + LIST_APPS_MAX_PAGE_SIZE, | ||
/* requestData */ null, 'v1beta1'); | ||
}; | ||
ProjectManagementRequestHandler.prototype.listIosApps = function (projectId) { | ||
return this.invokeRequestHandler('GET', "projects/" + projectId + "/iosApps?page_size=" + LIST_APPS_MAX_PAGE_SIZE, | ||
/** | ||
* @param {string} parentResourceName Fully-qualified resource name of the project whose iOS apps | ||
* you want to list. | ||
*/ | ||
ProjectManagementRequestHandler.prototype.listIosApps = function (parentResourceName) { | ||
return this.invokeRequestHandler('GET', parentResourceName + "/iosApps?page_size=" + LIST_APPS_MAX_PAGE_SIZE, | ||
/* requestData */ null, 'v1beta1'); | ||
}; | ||
ProjectManagementRequestHandler.prototype.createAndroidApp = function (projectId, packageName, displayName) { | ||
/** | ||
* @param {string} parentResourceName Fully-qualified resource name of the project that you want | ||
* to create the Android app within. | ||
*/ | ||
ProjectManagementRequestHandler.prototype.createAndroidApp = function (parentResourceName, packageName, displayName) { | ||
var _this = this; | ||
@@ -118,3 +130,3 @@ var requestData = { | ||
return this | ||
.invokeRequestHandler('POST', "projects/" + projectId + "/androidApps", requestData, 'v1beta1') | ||
.invokeRequestHandler('POST', parentResourceName + "/androidApps", requestData, 'v1beta1') | ||
.then(function (responseData) { | ||
@@ -126,3 +138,7 @@ assertServerResponse(validator.isNonNullObject(responseData), responseData, "createAndroidApp's responseData must be a non-null object."); | ||
}; | ||
ProjectManagementRequestHandler.prototype.createIosApp = function (projectId, bundleId, displayName) { | ||
/** | ||
* @param {string} parentResourceName Fully-qualified resource name of the project that you want | ||
* to create the iOS app within. | ||
*/ | ||
ProjectManagementRequestHandler.prototype.createIosApp = function (parentResourceName, bundleId, displayName) { | ||
var _this = this; | ||
@@ -136,3 +152,3 @@ var requestData = { | ||
return this | ||
.invokeRequestHandler('POST', "projects/" + projectId + "/iosApps", requestData, 'v1beta1') | ||
.invokeRequestHandler('POST', parentResourceName + "/iosApps", requestData, 'v1beta1') | ||
.then(function (responseData) { | ||
@@ -144,9 +160,7 @@ assertServerResponse(validator.isNonNullObject(responseData), responseData, "createIosApp's responseData must be a non-null object."); | ||
}; | ||
ProjectManagementRequestHandler.prototype.getAndroidMetadata = function (appId) { | ||
return this.invokeRequestHandler('GET', "projects/-/androidApps/" + appId, /* requestData */ null, 'v1beta1'); | ||
}; | ||
ProjectManagementRequestHandler.prototype.getIosMetadata = function (appId) { | ||
return this.invokeRequestHandler('GET', "projects/-/iosApps/" + appId, /* requestData */ null, 'v1beta1'); | ||
}; | ||
ProjectManagementRequestHandler.prototype.setAndroidDisplayName = function (appId, newDisplayName) { | ||
/** | ||
* @param {string} resourceName Fully-qualified resource name of the entity whose display name you | ||
* want to set. | ||
*/ | ||
ProjectManagementRequestHandler.prototype.setDisplayName = function (resourceName, newDisplayName) { | ||
var requestData = { | ||
@@ -156,17 +170,17 @@ displayName: newDisplayName, | ||
return this | ||
.invokeRequestHandler('PATCH', "projects/-/androidApps/" + appId + "?update_mask=display_name", requestData, 'v1beta1') | ||
.invokeRequestHandler('PATCH', resourceName + "?update_mask=display_name", requestData, 'v1beta1') | ||
.then(function () { return null; }); | ||
}; | ||
ProjectManagementRequestHandler.prototype.setIosDisplayName = function (appId, newDisplayName) { | ||
var requestData = { | ||
displayName: newDisplayName, | ||
}; | ||
return this | ||
.invokeRequestHandler('PATCH', "projects/-/iosApps/" + appId + "?update_mask=display_name", requestData, 'v1beta1') | ||
.then(function () { return null; }); | ||
/** | ||
* @param {string} parentResourceName Fully-qualified resource name of the Android app whose SHA | ||
* certificates you want to get. | ||
*/ | ||
ProjectManagementRequestHandler.prototype.getAndroidShaCertificates = function (parentResourceName) { | ||
return this.invokeRequestHandler('GET', parentResourceName + "/sha", /* requestData */ null, 'v1beta1'); | ||
}; | ||
ProjectManagementRequestHandler.prototype.getAndroidShaCertificates = function (appId) { | ||
return this.invokeRequestHandler('GET', "projects/-/androidApps/" + appId + "/sha", /* requestData */ null, 'v1beta1'); | ||
}; | ||
ProjectManagementRequestHandler.prototype.addAndroidShaCertificate = function (appId, certificate) { | ||
/** | ||
* @param {string} parentResourceName Fully-qualified resource name of the Android app that you | ||
* want to add the given SHA certificate to. | ||
*/ | ||
ProjectManagementRequestHandler.prototype.addAndroidShaCertificate = function (parentResourceName, certificate) { | ||
var requestData = { | ||
@@ -177,16 +191,28 @@ shaHash: certificate.shaHash, | ||
return this | ||
.invokeRequestHandler('POST', "projects/-/androidApps/" + appId + "/sha", requestData, 'v1beta1') | ||
.invokeRequestHandler('POST', parentResourceName + "/sha", requestData, 'v1beta1') | ||
.then(function () { return null; }); | ||
}; | ||
ProjectManagementRequestHandler.prototype.deleteAndroidShaCertificate = function (certificateToDelete) { | ||
/** | ||
* @param {string} parentResourceName Fully-qualified resource name of the app whose config you | ||
* want to get. | ||
*/ | ||
ProjectManagementRequestHandler.prototype.getConfig = function (parentResourceName) { | ||
return this.invokeRequestHandler('GET', parentResourceName + "/config", /* requestData */ null, 'v1beta1'); | ||
}; | ||
/** | ||
* @param {string} parentResourceName Fully-qualified resource name of the entity that you want to | ||
* get. | ||
*/ | ||
ProjectManagementRequestHandler.prototype.getResource = function (parentResourceName) { | ||
return this.invokeRequestHandler('GET', parentResourceName, /* requestData */ null, 'v1beta1'); | ||
}; | ||
/** | ||
* @param {string} resourceName Fully-qualified resource name of the entity that you want to | ||
* delete. | ||
*/ | ||
ProjectManagementRequestHandler.prototype.deleteResource = function (resourceName) { | ||
return this | ||
.invokeRequestHandler('DELETE', certificateToDelete.resourceName, /* requestData */ null, 'v1beta1') | ||
.invokeRequestHandler('DELETE', resourceName, /* requestData */ null, 'v1beta1') | ||
.then(function () { return null; }); | ||
}; | ||
ProjectManagementRequestHandler.prototype.getAndroidConfig = function (appId) { | ||
return this.invokeRequestHandler('GET', "projects/-/androidApps/" + appId + "/config", /* requestData */ null, 'v1beta1'); | ||
}; | ||
ProjectManagementRequestHandler.prototype.getIosConfig = function (appId) { | ||
return this.invokeRequestHandler('GET', "projects/-/iosApps/" + appId + "/config", /* requestData */ null, 'v1beta1'); | ||
}; | ||
ProjectManagementRequestHandler.prototype.pollRemoteOperationWithExponentialBackoff = function (operationResourceName) { | ||
@@ -193,0 +219,0 @@ var _this = this; |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -64,2 +64,3 @@ /*! | ||
} | ||
this.resourceName = "projects/" + this.projectId; | ||
this.requestHandler = new project_management_api_request_1.ProjectManagementRequestHandler(app); | ||
@@ -96,3 +97,3 @@ } | ||
var _this = this; | ||
return this.requestHandler.createAndroidApp(this.projectId, packageName, displayName) | ||
return this.requestHandler.createAndroidApp(this.resourceName, packageName, displayName) | ||
.then(function (responseData) { | ||
@@ -109,3 +110,3 @@ project_management_api_request_1.assertServerResponse(validator.isNonNullObject(responseData), responseData, 'createAndroidApp()\'s responseData must be a non-null object.'); | ||
var _this = this; | ||
return this.requestHandler.createIosApp(this.projectId, bundleId, displayName) | ||
return this.requestHandler.createIosApp(this.resourceName, bundleId, displayName) | ||
.then(function (responseData) { | ||
@@ -123,4 +124,4 @@ project_management_api_request_1.assertServerResponse(validator.isNonNullObject(responseData), responseData, 'createIosApp()\'s responseData must be a non-null object.'); | ||
var listPromise = (platform === 'android') ? | ||
this.requestHandler.listAndroidApps(this.projectId) | ||
: this.requestHandler.listIosApps(this.projectId); | ||
this.requestHandler.listAndroidApps(this.resourceName) | ||
: this.requestHandler.listIosApps(this.resourceName); | ||
return listPromise | ||
@@ -127,0 +128,0 @@ .then(function (responseData) { |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ /*! |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -177,7 +177,12 @@ /*! | ||
var isHttps = protocol === 'https:'; | ||
var port = parsed.port; | ||
if (!port) { | ||
port = isHttps ? '443' : '80'; | ||
} | ||
var options = { | ||
hostname: parsed.hostname, | ||
port: parsed.port, | ||
port: port, | ||
path: parsed.path, | ||
method: config.method, | ||
agent: config.httpAgent, | ||
headers: headers, | ||
@@ -287,2 +292,5 @@ }; | ||
requestCopy.headers[authHeader] = "Bearer " + accessTokenObj.accessToken; | ||
if (!requestCopy.httpAgent && _this.app.options.httpAgent) { | ||
requestCopy.httpAgent = _this.app.options.httpAgent; | ||
} | ||
return _super.prototype.send.call(_this, requestCopy); | ||
@@ -289,0 +297,0 @@ }); |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ /*! |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ /*! |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ /*! |
@@ -1,2 +0,2 @@ | ||
/*! firebase-admin v6.3.0 */ | ||
/*! firebase-admin v6.4.0 */ | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ /*! |
{ | ||
"name": "firebase-admin", | ||
"version": "6.3.0", | ||
"version": "6.4.0", | ||
"description": "Firebase admin SDK for Node.js", | ||
@@ -5,0 +5,0 @@ "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
403791
8114