@b360/get-api-key 1.0.0 → 2.0.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.
Files changed (2) hide show
  1. package/index.js +4 -5
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -7,10 +7,9 @@ var config = require('@b360/config');
7
7
  // var api_key = DEFAULT_KEYS['api_key'];
8
8
 
9
9
  // sample
10
- exports.GetApiKey = async (username, key="cloudVersion", appType, appCategory, appApiUrl = '', appApiKey = '', appPluginUrl = '') => {
11
- var DEFAULT_KEYS = config(appType, appCategory, appApiUrl, appApiKey, appPluginUrl);
12
- var myHeaders = new Headers();
13
- myHeaders.append("REFERER", DEFAULT_KEYS['api_url']);
10
+ exports.GetApiKey = async (username, key="cloudVersion", appType, appCategory, appApiUrl = '', appApiKey = '', appPluginUrl = '', appHeaders = {}) => {
11
+ var DEFAULT_KEYS = config(appType, appCategory, appApiUrl, appApiKey, appPluginUrl, appHeaders);
12
+ var myHeaders = new Headers({ ...DEFAULT_KEYS.headers });
14
13
  // myHeaders.append("REFERER", "http://localhost/websites/b360/api/");
15
14
  var formdata = new FormData();
16
15
  formdata.append("username",username);
@@ -40,4 +39,4 @@ exports.GetApiKey = async (username, key="cloudVersion", appType, appCategory, a
40
39
  console.log('error', error)
41
40
  return error;
42
41
  });
43
- }
42
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b360/get-api-key",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "description": "sample description",
5
5
  "main": "index.js",
6
6
  "author": "uday veduruvada",