@friggframework/api-module-hubspot 1.2.0-canary.293.5731c31.0 → 2.0.0-next.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.
- package/.eslintrc.json +1 -1
- package/CHANGELOG.md +179 -29
- package/LICENSE.md +10 -3
- package/README.md +1 -1
- package/api.js +211 -219
- package/defaultConfig.json +12 -7
- package/definition.js +11 -9
- package/index.js +2 -2
- package/jest-setup.js +1 -1
- package/jest-teardown.js +1 -1
- package/package.json +6 -7
- package/tests/api.test.js +365 -36
- package/tests/auther.test.js +4 -4
package/defaultConfig.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
2
|
+
"name": "hubspot",
|
|
3
|
+
"label": "HubSpot",
|
|
4
|
+
"productUrl": "https://hubspot.com",
|
|
5
|
+
"apiDocs": "https://developers.hubspot.com",
|
|
6
|
+
"logoUrl": "https://friggframework.org/assets/img/hubspot-icon.jpeg",
|
|
7
|
+
"categories": [
|
|
8
|
+
"Marketing",
|
|
9
|
+
"Sales",
|
|
10
|
+
"CMS",
|
|
11
|
+
"Marketing Automation"
|
|
12
|
+
],
|
|
13
|
+
"description": "HubSpot is an all-in-one Marketing and Sales solution for scaling companies"
|
|
9
14
|
}
|
package/definition.js
CHANGED
|
@@ -5,19 +5,21 @@ const config = require('./defaultConfig.json')
|
|
|
5
5
|
|
|
6
6
|
const Definition = {
|
|
7
7
|
API: Api,
|
|
8
|
-
getName: function() {
|
|
8
|
+
getName: function () {
|
|
9
|
+
return config.name
|
|
10
|
+
},
|
|
9
11
|
moduleName: config.name,
|
|
10
12
|
modelName: 'HubSpot',
|
|
11
13
|
requiredAuthMethods: {
|
|
12
|
-
getToken: async function(api, params){
|
|
14
|
+
getToken: async function (api, params) {
|
|
13
15
|
const code = get(params.data, 'code');
|
|
14
16
|
return api.getTokenFromCode(code);
|
|
15
17
|
},
|
|
16
|
-
getEntityDetails: async function(api, callbackParams, tokenResponse, userId) {
|
|
18
|
+
getEntityDetails: async function (api, callbackParams, tokenResponse, userId) {
|
|
17
19
|
const userDetails = await api.getUserDetails();
|
|
18
20
|
return {
|
|
19
|
-
identifiers: {
|
|
20
|
-
details: {
|
|
21
|
+
identifiers: {externalId: userDetails.portalId, user: userId},
|
|
22
|
+
details: {name: userDetails.hub_domain},
|
|
21
23
|
}
|
|
22
24
|
},
|
|
23
25
|
apiPropertiesToPersist: {
|
|
@@ -26,14 +28,14 @@ const Definition = {
|
|
|
26
28
|
],
|
|
27
29
|
entity: [],
|
|
28
30
|
},
|
|
29
|
-
getCredentialDetails: async function(api, userId) {
|
|
31
|
+
getCredentialDetails: async function (api, userId) {
|
|
30
32
|
const userDetails = await api.getUserDetails();
|
|
31
33
|
return {
|
|
32
|
-
identifiers: {
|
|
34
|
+
identifiers: {externalId: userDetails.portalId, user: userId},
|
|
33
35
|
details: {}
|
|
34
36
|
};
|
|
35
37
|
},
|
|
36
|
-
testAuthRequest: async function(api){
|
|
38
|
+
testAuthRequest: async function (api) {
|
|
37
39
|
return api.getUserDetails()
|
|
38
40
|
},
|
|
39
41
|
},
|
|
@@ -45,4 +47,4 @@ const Definition = {
|
|
|
45
47
|
}
|
|
46
48
|
};
|
|
47
49
|
|
|
48
|
-
module.exports = {
|
|
50
|
+
module.exports = {Definition};
|
package/index.js
CHANGED
package/jest-setup.js
CHANGED
package/jest-teardown.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {globalTeardown} = require('@friggframework/test');
|
|
2
2
|
module.exports = globalTeardown;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/api-module-hubspot",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-next.0",
|
|
4
4
|
"prettier": "@friggframework/prettier-config",
|
|
5
5
|
"description": "HubSpot API module that lets the Frigg Framework interact with HubSpot",
|
|
6
6
|
"main": "index.js",
|
|
@@ -11,17 +11,16 @@
|
|
|
11
11
|
"author": "",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@friggframework/devtools": "1.2
|
|
14
|
+
"@friggframework/devtools": "^1.1.2",
|
|
15
|
+
"@friggframework/test": "^1.1.2",
|
|
15
16
|
"dotenv": "^16.0.3",
|
|
16
17
|
"eslint": "^8.22.0",
|
|
17
18
|
"jest": "^28.1.3",
|
|
18
19
|
"jest-environment-jsdom": "^28.1.3",
|
|
19
|
-
"
|
|
20
|
-
"prettier": "^2.7.1",
|
|
21
|
-
"sinon": "^14.0.0"
|
|
20
|
+
"prettier": "^2.7.1"
|
|
22
21
|
},
|
|
23
22
|
"dependencies": {
|
|
24
|
-
"@friggframework/core": "1.2
|
|
23
|
+
"@friggframework/core": "^1.1.2"
|
|
25
24
|
},
|
|
26
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "62b0e5a36d3df54945134203c548c023b2edceae"
|
|
27
26
|
}
|