@friggframework/api-module-hubspot 1.1.5-canary.5.6b3e9b0.0 → 1.1.6-canary.c3fd6fe.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/CHANGELOG.md +37 -0
- package/api.js +53 -20
- package/package.json +3 -2
- package/tests/api.test.js +6 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,40 @@
|
|
|
1
|
+
# v1.1.5 (Mon May 06 2024)
|
|
2
|
+
|
|
3
|
+
:tada: This release contains work from a new contributor! :tada:
|
|
4
|
+
|
|
5
|
+
Thank you, Sean Matthews ([@seanspeaks](https://github.com/seanspeaks)), for all your work!
|
|
6
|
+
|
|
7
|
+
#### 🐛 Bug Fix
|
|
8
|
+
|
|
9
|
+
- HubSpot API Method Updates [#5](https://github.com/friggframework/api-module-library/pull/5) ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
10
|
+
- remove .only ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
11
|
+
- differentiate the two versions of batch association delete, generic and label specific ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
12
|
+
- correct inherited parameter naming (confusion between object and object type) ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
13
|
+
- add method for clearing list ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
14
|
+
- Merge branch 'refs/heads/main' into feature/42m-needed-hubspot-api-methods ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
15
|
+
- property update working ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
16
|
+
- update implementation of properties methods ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
17
|
+
- association label and association batch requests implemented and tested ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
18
|
+
- Bump independent versions \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks))
|
|
19
|
+
- remove .only tests [#3](https://github.com/friggframework/api-module-library/pull/3) ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
20
|
+
- update to getListById to follow convention in this api at least [#3](https://github.com/friggframework/api-module-library/pull/3) ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
21
|
+
- add getList [#3](https://github.com/friggframework/api-module-library/pull/3) ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
22
|
+
- remove client reference [#3](https://github.com/friggframework/api-module-library/pull/3) ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
23
|
+
- add list addition, creation, deletion [#3](https://github.com/friggframework/api-module-library/pull/3) ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
24
|
+
- remove unnecessary dependency [#1](https://github.com/friggframework/api-module-library/pull/1) ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
25
|
+
- add methods and tests for list search and label retrieval [#1](https://github.com/friggframework/api-module-library/pull/1) ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
26
|
+
|
|
27
|
+
#### ⚠️ Pushed to `main`
|
|
28
|
+
|
|
29
|
+
- Publish ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
30
|
+
|
|
31
|
+
#### Authors: 2
|
|
32
|
+
|
|
33
|
+
- [@MichaelRyanWebber](https://github.com/MichaelRyanWebber)
|
|
34
|
+
- Sean Matthews ([@seanspeaks](https://github.com/seanspeaks))
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
1
38
|
# v1.1.4 (Wed Apr 17 2024)
|
|
2
39
|
|
|
3
40
|
#### 🐛 Bug Fix
|
package/api.js
CHANGED
|
@@ -26,14 +26,16 @@ class Api extends OAuth2Requester {
|
|
|
26
26
|
deals: '/crm/v3/objects/deals',
|
|
27
27
|
dealById: (dealId) => `/crm/v3/objects/deals/${dealId}`,
|
|
28
28
|
searchDeals: '/crm/v3/objects/deals/search',
|
|
29
|
-
readBatchAssociations: (
|
|
30
|
-
`/crm/v4/associations/${
|
|
31
|
-
createBatchAssociations: (
|
|
32
|
-
`/crm/v4/associations/${
|
|
33
|
-
createBatchAssociationsDefault: (
|
|
34
|
-
`/crm/v4/associations/${
|
|
35
|
-
deleteBatchAssociations: (
|
|
36
|
-
`/crm/v4/associations/${
|
|
29
|
+
readBatchAssociations: (fromObjectType, toObjectType) =>
|
|
30
|
+
`/crm/v4/associations/${fromObjectType}/${toObjectType}/batch/read`,
|
|
31
|
+
createBatchAssociations: (fromObjectType, toObjectType) =>
|
|
32
|
+
`/crm/v4/associations/${fromObjectType}/${toObjectType}/batch/create`,
|
|
33
|
+
createBatchAssociationsDefault: (fromObjectType, toObjectType) =>
|
|
34
|
+
`/crm/v4/associations/${fromObjectType}/${toObjectType}/batch/associate/default`,
|
|
35
|
+
deleteBatchAssociations: (fromObjectType, toObjectType) =>
|
|
36
|
+
`/crm/v4/associations/${fromObjectType}/${toObjectType}/batch/archive`,
|
|
37
|
+
deleteBatchAssociationLabels: (fromObjectType, toObjectType) =>
|
|
38
|
+
`/crm/v4/associations/${fromObjectType}/${toObjectType}/batch/labels/archive`,
|
|
37
39
|
v1DealInfo: (dealId) => `/deals/v1/deal/${dealId}`,
|
|
38
40
|
getPipelineDetails: (objType) => `/crm/v3/pipelines/${objType}`,
|
|
39
41
|
getOwnerById: (ownerId) => `/owners/v2/owners/${ownerId}`,
|
|
@@ -65,7 +67,8 @@ class Api extends OAuth2Requester {
|
|
|
65
67
|
lists: '/crm/v3/lists',
|
|
66
68
|
listById: (listId) => `/crm/v3/lists/${listId}`,
|
|
67
69
|
listSearch: '/crm/v3/lists/search',
|
|
68
|
-
|
|
70
|
+
listMemberships: (listId) => `/crm/v3/lists/${listId}/memberships`,
|
|
71
|
+
listMembershipsAddRemove: (listId) => `/crm/v3/lists/${listId}/memberships/add-and-remove`,
|
|
69
72
|
associations: (fromObject, toObject) => `/crm/v4/associations/${fromObject}/${toObject}`,
|
|
70
73
|
associationLabels: (fromObject, toObject) => `/crm/v4/associations/${fromObject}/${toObject}/labels`,
|
|
71
74
|
|
|
@@ -895,13 +898,13 @@ class Api extends OAuth2Requester {
|
|
|
895
898
|
return this._get(options);
|
|
896
899
|
}
|
|
897
900
|
|
|
898
|
-
async getBatchAssociations(
|
|
901
|
+
async getBatchAssociations(fromObjectType, toObjectType, inputs) {
|
|
899
902
|
const postBody = {inputs};
|
|
900
903
|
|
|
901
904
|
const options = {
|
|
902
905
|
url:
|
|
903
906
|
this.baseUrl +
|
|
904
|
-
this.URLs.readBatchAssociations(
|
|
907
|
+
this.URLs.readBatchAssociations(fromObjectType, toObjectType),
|
|
905
908
|
body: postBody,
|
|
906
909
|
};
|
|
907
910
|
|
|
@@ -910,13 +913,13 @@ class Api extends OAuth2Requester {
|
|
|
910
913
|
return results;
|
|
911
914
|
}
|
|
912
915
|
|
|
913
|
-
async createBatchAssociations(
|
|
916
|
+
async createBatchAssociations(fromObjectType, toObjectType, inputs) {
|
|
914
917
|
const postBody = {inputs};
|
|
915
918
|
|
|
916
919
|
const options = {
|
|
917
920
|
url:
|
|
918
921
|
this.baseUrl +
|
|
919
|
-
this.URLs.createBatchAssociations(
|
|
922
|
+
this.URLs.createBatchAssociations(fromObjectType, toObjectType),
|
|
920
923
|
body: postBody,
|
|
921
924
|
};
|
|
922
925
|
|
|
@@ -925,11 +928,11 @@ class Api extends OAuth2Requester {
|
|
|
925
928
|
return results;
|
|
926
929
|
}
|
|
927
930
|
|
|
928
|
-
async createBatchAssociationsDefault(
|
|
931
|
+
async createBatchAssociationsDefault(fromObjectType, toObjectType, inputs) {
|
|
929
932
|
const options = {
|
|
930
933
|
url:
|
|
931
934
|
this.baseUrl +
|
|
932
|
-
this.URLs.createBatchAssociationsDefault(
|
|
935
|
+
this.URLs.createBatchAssociationsDefault(fromObjectType, toObjectType),
|
|
933
936
|
body: {inputs},
|
|
934
937
|
};
|
|
935
938
|
|
|
@@ -938,11 +941,23 @@ class Api extends OAuth2Requester {
|
|
|
938
941
|
return results;
|
|
939
942
|
}
|
|
940
943
|
|
|
941
|
-
async deleteBatchAssociations(
|
|
944
|
+
async deleteBatchAssociations(fromObjectType, toObjectType, inputs) {
|
|
942
945
|
const options = {
|
|
943
946
|
url:
|
|
944
947
|
this.baseUrl +
|
|
945
|
-
this.URLs.deleteBatchAssociations(
|
|
948
|
+
this.URLs.deleteBatchAssociations(fromObjectType, toObjectType),
|
|
949
|
+
body: {inputs},
|
|
950
|
+
returnFullRes: true,
|
|
951
|
+
};
|
|
952
|
+
|
|
953
|
+
return this._post(options);
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
async deleteBatchAssociationLabels(fromObjectType, toObjectType, inputs) {
|
|
957
|
+
const options = {
|
|
958
|
+
url:
|
|
959
|
+
this.baseUrl +
|
|
960
|
+
this.URLs.deleteBatchAssociationLabels(fromObjectType, toObjectType),
|
|
946
961
|
body: {inputs},
|
|
947
962
|
returnFullRes: true,
|
|
948
963
|
};
|
|
@@ -1022,15 +1037,33 @@ class Api extends OAuth2Requester {
|
|
|
1022
1037
|
return this._delete(options);
|
|
1023
1038
|
}
|
|
1024
1039
|
|
|
1025
|
-
async
|
|
1040
|
+
async removeAllListMembers(listId) {
|
|
1026
1041
|
const options = {
|
|
1027
|
-
url: this.baseUrl + this.URLs.
|
|
1042
|
+
url: this.baseUrl + this.URLs.listMemberships(listId),
|
|
1043
|
+
};
|
|
1044
|
+
return this._delete(options);
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
async addAndRemoveFromList(listId, idsToAdd, idsToRemove) {
|
|
1048
|
+
const options = {
|
|
1049
|
+
url: this.baseUrl + this.URLs.listMembershipsAddRemove(listId),
|
|
1028
1050
|
body: {
|
|
1029
|
-
"recordIdsToAdd":
|
|
1051
|
+
"recordIdsToAdd": idsToAdd,
|
|
1052
|
+
"recordIdsToRemove": idsToRemove
|
|
1030
1053
|
},
|
|
1031
1054
|
};
|
|
1032
1055
|
return this._put(options);
|
|
1033
1056
|
}
|
|
1057
|
+
|
|
1058
|
+
async addToList(listId, recordIds) {
|
|
1059
|
+
return this.addAndRemoveFromList(listId, recordIds, []);
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
async removeFromList(listId, recordIds) {
|
|
1063
|
+
return this.addAndRemoveFromList(listId, [], recordIds);
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
|
|
1034
1067
|
}
|
|
1035
1068
|
|
|
1036
1069
|
module.exports = {Api};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/api-module-hubspot",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6-canary.c3fd6fe.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",
|
|
@@ -17,10 +17,11 @@
|
|
|
17
17
|
"eslint": "^8.22.0",
|
|
18
18
|
"jest": "^28.1.3",
|
|
19
19
|
"jest-environment-jsdom": "^28.1.3",
|
|
20
|
+
"open": "^10.1.0",
|
|
20
21
|
"prettier": "^2.7.1"
|
|
21
22
|
},
|
|
22
23
|
"dependencies": {
|
|
23
24
|
"@friggframework/core": "^1.1.2"
|
|
24
25
|
},
|
|
25
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "c3fd6fed4e780d492e18d81d9b62782eb7165a49"
|
|
26
27
|
}
|
package/tests/api.test.js
CHANGED
|
@@ -732,6 +732,10 @@ describe(`${config.label} API tests`, () => {
|
|
|
732
732
|
// HS has a typo in the response "recordsIds" instead of "recordIds"
|
|
733
733
|
expect(response.recordsIdsAdded).toHaveLength(1);
|
|
734
734
|
})
|
|
735
|
+
it('Should remove all records from list', async () => {
|
|
736
|
+
const response = await api.removeAllListMembers(createdListId);
|
|
737
|
+
expect(response.status).toBe(204);
|
|
738
|
+
})
|
|
735
739
|
it('Should delete a list', async () => {
|
|
736
740
|
const response = await api.deleteList(createdListId);
|
|
737
741
|
expect(response).toBeDefined();
|
|
@@ -859,7 +863,7 @@ describe(`${config.label} API tests`, () => {
|
|
|
859
863
|
to: {id: toCompany}
|
|
860
864
|
}
|
|
861
865
|
});
|
|
862
|
-
const response = await api.
|
|
866
|
+
const response = await api.deleteBatchAssociationLabels(
|
|
863
867
|
testObjType,
|
|
864
868
|
'COMPANY',
|
|
865
869
|
inputs
|
|
@@ -889,7 +893,7 @@ describe(`${config.label} API tests`, () => {
|
|
|
889
893
|
});
|
|
890
894
|
});
|
|
891
895
|
|
|
892
|
-
describe
|
|
896
|
+
describe('Properties requests', () => {
|
|
893
897
|
let groupeName;
|
|
894
898
|
it('Should retrieve a property', async () => {
|
|
895
899
|
const response = await api.getPropertyByName('tests', 'word');
|