backend-manager 3.2.155 → 3.2.157

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backend-manager",
3
- "version": "3.2.155",
3
+ "version": "3.2.157",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
@@ -1004,6 +1004,37 @@ Manager.prototype.setupCustomServer = function (_library, options) {
1004
1004
  });
1005
1005
  }
1006
1006
 
1007
+ // Setup Custom Server
1008
+ Manager.prototype.getApp = function (id) {
1009
+ const self = this;
1010
+
1011
+ // Get the app
1012
+ return new Promise(function(resolve, reject) {
1013
+ const fetch = require('wonderful-fetch');
1014
+
1015
+ // Set ID
1016
+ id = id || self.config.app.id;
1017
+
1018
+ // If no ID, reject
1019
+ if (!id) {
1020
+ return reject(new Error('No ID provided'));
1021
+ }
1022
+
1023
+ // Fetch the app
1024
+ fetch(`https://us-central1-itw-creative-works.cloudfunctions.net/getApp`, {
1025
+ method: 'post',
1026
+ response: 'json',
1027
+ timeout: 30000,
1028
+ tries: 3,
1029
+ body: {
1030
+ id: id,
1031
+ }
1032
+ })
1033
+ .then((r) => resolve(r))
1034
+ .catch((e) => reject(e));
1035
+ });
1036
+ }
1037
+
1007
1038
  function resolveProjectPackage(dir) {
1008
1039
  try {
1009
1040
  return require(path.resolve(dir, 'functions', 'package.json'));