@aloma.io/integration-sdk 3.8.54 → 3.8.55

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.
@@ -1,310 +0,0 @@
1
- import {AbstractController} from '@aloma.io/integration-sdk';
2
-
3
- export default class CompaniesResource extends AbstractController {
4
-
5
- /**
6
- * Retrieve a batch of companies
7
- *
8
- * Retrieve a batch of companies by ID (`companyId`) or by a unique property (`idProperty`). You can specify what is returned using the `properties` query parameter.
9
- *
10
- * @param {boolean} archived (optional) - Whether to return only results that have been archived. [query]
11
- *
12
- * @param {Object} body (required) - Request body
13
- *
14
- * @returns {Promise<Object>} POST /crm/v3/objects/companies/batch/read response
15
- */
16
- async read(archived?: any, body?: any) {
17
- const url = '/crm/v3/objects/companies/batch/read';
18
- const options: any = {
19
- method: 'POST',
20
- params: {},
21
- body,
22
- };
23
-
24
- // Add query parameters
25
- if (archived !== undefined) {
26
- options.params.archived = archived;
27
- }
28
-
29
- return this.api.fetch(url, options);
30
- }
31
-
32
- /**
33
- * Retrieve companies
34
- *
35
- * Retrieve all companies, using query parameters to control the information that gets returned.
36
- *
37
- * @param {integer} limit (optional) - The maximum number of results to display per page. [query]
38
- * @param {string} after (optional) - The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. [query]
39
- * @param {array} properties (optional) - A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. [query]
40
- * @param {array} propertiesWithHistory (optional) - A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of companies that can be read by a single request. [query]
41
- * @param {array} associations (optional) - A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. [query]
42
- * @param {boolean} archived (optional) - Whether to return only results that have been archived. [query]
43
- *
44
- * @returns {Promise<Object>} GET /crm/v3/objects/companies response
45
- */
46
- async getPage(limit?: any, after?: any, properties?: any, propertiesWithHistory?: any, associations?: any, archived?: any) {
47
- const url = '/crm/v3/objects/companies';
48
- const options: any = {
49
- method: 'GET',
50
- params: {},
51
- };
52
-
53
- // Add query parameters
54
- if (limit !== undefined) {
55
- options.params.limit = limit;
56
- }
57
- if (after !== undefined) {
58
- options.params.after = after;
59
- }
60
- if (properties !== undefined) {
61
- options.params.properties = properties;
62
- }
63
- if (propertiesWithHistory !== undefined) {
64
- options.params.propertiesWithHistory = propertiesWithHistory;
65
- }
66
- if (associations !== undefined) {
67
- options.params.associations = associations;
68
- }
69
- if (archived !== undefined) {
70
- options.params.archived = archived;
71
- }
72
-
73
- return this.api.fetch(url, options);
74
- }
75
-
76
- /**
77
- * Create a company
78
- *
79
- * Create a single company. Include a `properties` object to define [property values](https://developers.hubspot.com/docs/guides/api/crm/properties) for the company, along with an `associations` array to define [associations](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4) with other CRM records.
80
- *
81
- * @param {Object} body (required) - Request body
82
- *
83
- * @returns {Promise<Object>} POST /crm/v3/objects/companies response
84
- */
85
- async create(body?: any) {
86
- const url = '/crm/v3/objects/companies';
87
- const options: any = {
88
- method: 'POST',
89
- body,
90
- };
91
-
92
- return this.api.fetch(url, options);
93
- }
94
-
95
- /**
96
- * Search for companies
97
- *
98
- * Search for companies by filtering on properties, searching through associations, and sorting results. Learn more about [CRM search](https://developers.hubspot.com/docs/guides/api/crm/search#make-a-search-request).
99
- *
100
- * @param {Object} body (required) - Request body
101
- *
102
- * @returns {Promise<Object>} POST /crm/v3/objects/companies/search response
103
- */
104
- async doSearch(body?: any) {
105
- const url = '/crm/v3/objects/companies/search';
106
- const options: any = {
107
- method: 'POST',
108
- body,
109
- };
110
-
111
- return this.api.fetch(url, options);
112
- }
113
-
114
- /**
115
- * Retrieve a company
116
- *
117
- * Retrieve a company by its ID (`companyId`) or by a unique property (`idProperty`). You can specify what is returned using the `properties` query parameter.
118
- *
119
- * @param {string} companyId (required) - The ID of the company [path]
120
- * @param {array} properties (optional) - A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. [query]
121
- * @param {array} propertiesWithHistory (optional) - A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. [query]
122
- * @param {array} associations (optional) - A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. [query]
123
- * @param {boolean} archived (optional) - Whether to return only results that have been archived. [query]
124
- * @param {string} idProperty (optional) - The name of a property whose values are unique for this object [query]
125
- *
126
- * @returns {Promise<Object>} GET /crm/v3/objects/companies/{companyId} response
127
- */
128
- async getById(companyId: string, properties?: any, propertiesWithHistory?: any, associations?: any, archived?: any, idProperty?: any) {
129
- // Build URL with path parameters
130
- let url = '/crm/v3/objects/companies/{companyId}';
131
- if (companyId) {
132
- url = url.replace('{companyId}', companyId);
133
- }
134
-
135
- const options: any = {
136
- method: 'GET',
137
- params: {},
138
- };
139
-
140
- // Add query parameters
141
- if (properties !== undefined) {
142
- options.params.properties = properties;
143
- }
144
- if (propertiesWithHistory !== undefined) {
145
- options.params.propertiesWithHistory = propertiesWithHistory;
146
- }
147
- if (associations !== undefined) {
148
- options.params.associations = associations;
149
- }
150
- if (archived !== undefined) {
151
- options.params.archived = archived;
152
- }
153
- if (idProperty !== undefined) {
154
- options.params.idProperty = idProperty;
155
- }
156
-
157
- return this.api.fetch(url, options);
158
- }
159
-
160
- /**
161
- * Update a company
162
- *
163
- * Update a company by ID (`companyId`) or unique property value (`idProperty`). Provided property values will be overwritten. Read-only and non-existent properties will result in an error. Properties values can be cleared by passing an empty string.
164
- *
165
- * @param {string} companyId (required) [path]
166
- * @param {string} idProperty (optional) - The name of a property whose values are unique for this object [query]
167
- *
168
- * @param {Object} body (required) - Request body
169
- *
170
- * @returns {Promise<Object>} PATCH /crm/v3/objects/companies/{companyId} response
171
- */
172
- async update(companyId: string, idProperty?: any, body?: any) {
173
- // Build URL with path parameters
174
- let url = '/crm/v3/objects/companies/{companyId}';
175
- if (companyId) {
176
- url = url.replace('{companyId}', companyId);
177
- }
178
-
179
- const options: any = {
180
- method: 'PATCH',
181
- params: {},
182
- body,
183
- };
184
-
185
- // Add query parameters
186
- if (idProperty !== undefined) {
187
- options.params.idProperty = idProperty;
188
- }
189
-
190
- return this.api.fetch(url, options);
191
- }
192
-
193
- /**
194
- * Archive a company
195
- *
196
- * Delete a company by ID. Deleted companies can be restored within 90 days of deletion. Learn more about [restoring records](https://knowledge.hubspot.com/records/restore-deleted-records).
197
- *
198
- * @param {string} companyId (required) [path]
199
- *
200
- * @returns {Promise<Object>} DELETE /crm/v3/objects/companies/{companyId} response
201
- */
202
- async archive(companyId: string) {
203
- // Build URL with path parameters
204
- let url = '/crm/v3/objects/companies/{companyId}';
205
- if (companyId) {
206
- url = url.replace('{companyId}', companyId);
207
- }
208
-
209
- const options: any = {
210
- method: 'DELETE',
211
- };
212
-
213
- return this.api.fetch(url, options);
214
- }
215
-
216
- /**
217
- * Create or update a batch of companies by unique property values
218
- *
219
- * Create or update companies identified by a unique property value as specified by the `idProperty` query parameter. `idProperty` query param refers to a property whose values are unique for the object.
220
- *
221
- * @param {Object} body (required) - Request body
222
- *
223
- * @returns {Promise<Object>} POST /crm/v3/objects/companies/batch/upsert response
224
- */
225
- async upsert(body?: any) {
226
- const url = '/crm/v3/objects/companies/batch/upsert';
227
- const options: any = {
228
- method: 'POST',
229
- body,
230
- };
231
-
232
- return this.api.fetch(url, options);
233
- }
234
-
235
- /**
236
- * Create a batch of companies
237
- *
238
- * Create a batch of companies. The `inputs` array can contain a `properties` object to define property values for each company, along with an `associations` array to define [associations](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4) with other CRM records.
239
- *
240
- * @param {Object} body (required) - Request body
241
- *
242
- * @returns {Promise<Object>} POST /crm/v3/objects/companies/batch/create response
243
- */
244
- async create(body?: any) {
245
- const url = '/crm/v3/objects/companies/batch/create';
246
- const options: any = {
247
- method: 'POST',
248
- body,
249
- };
250
-
251
- return this.api.fetch(url, options);
252
- }
253
-
254
- /**
255
- * Update a batch of companies
256
- *
257
- * Update a batch of companies by ID.
258
- *
259
- * @param {Object} body (required) - Request body
260
- *
261
- * @returns {Promise<Object>} POST /crm/v3/objects/companies/batch/update response
262
- */
263
- async update(body?: any) {
264
- const url = '/crm/v3/objects/companies/batch/update';
265
- const options: any = {
266
- method: 'POST',
267
- body,
268
- };
269
-
270
- return this.api.fetch(url, options);
271
- }
272
-
273
- /**
274
- * Archive a batch of companies
275
- *
276
- * Delete a batch of companies by ID. Deleted companies can be restored within 90 days of deletion. Learn more about [restoring records](https://knowledge.hubspot.com/records/restore-deleted-records).
277
- *
278
- * @param {Object} body (required) - Request body
279
- *
280
- * @returns {Promise<Object>} POST /crm/v3/objects/companies/batch/archive response
281
- */
282
- async archive(body?: any) {
283
- const url = '/crm/v3/objects/companies/batch/archive';
284
- const options: any = {
285
- method: 'POST',
286
- body,
287
- };
288
-
289
- return this.api.fetch(url, options);
290
- }
291
-
292
- /**
293
- * Merge two companies
294
- *
295
- * Merge two company records. Learn more about [merging records](https://knowledge.hubspot.com/records/merge-records).
296
- *
297
- * @param {Object} body (required) - Request body
298
- *
299
- * @returns {Promise<Object>} POST /crm/v3/objects/companies/merge response
300
- */
301
- async merge(body?: any) {
302
- const url = '/crm/v3/objects/companies/merge';
303
- const options: any = {
304
- method: 'POST',
305
- body,
306
- };
307
-
308
- return this.api.fetch(url, options);
309
- }
310
- }
@@ -1,310 +0,0 @@
1
- import {AbstractController} from '@aloma.io/integration-sdk';
2
-
3
- export default class Controller extends AbstractController {
4
-
5
- /**
6
- * Retrieve a batch of companies
7
- *
8
- * Retrieve a batch of companies by ID (`companyId`) or by a unique property (`idProperty`). You can specify what is returned using the `properties` query parameter.
9
- *
10
- * @param {boolean} archived (optional) - Whether to return only results that have been archived. [query]
11
- *
12
- * @param {Object} body (required) - Request body
13
- *
14
- * @returns {Promise<Object>} POST /crm/v3/objects/companies/batch/read response
15
- */
16
- async read(archived?: any, body?: any) {
17
- const url = '/crm/v3/objects/companies/batch/read';
18
- const options: any = {
19
- method: 'POST',
20
- params: {},
21
- body,
22
- };
23
-
24
- // Add query parameters
25
- if (archived !== undefined) {
26
- options.params.archived = archived;
27
- }
28
-
29
- return this.api.fetch(url, options);
30
- }
31
-
32
- /**
33
- * Retrieve companies
34
- *
35
- * Retrieve all companies, using query parameters to control the information that gets returned.
36
- *
37
- * @param {integer} limit (optional) - The maximum number of results to display per page. [query]
38
- * @param {string} after (optional) - The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. [query]
39
- * @param {array} properties (optional) - A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. [query]
40
- * @param {array} propertiesWithHistory (optional) - A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of companies that can be read by a single request. [query]
41
- * @param {array} associations (optional) - A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. [query]
42
- * @param {boolean} archived (optional) - Whether to return only results that have been archived. [query]
43
- *
44
- * @returns {Promise<Object>} GET /crm/v3/objects/companies response
45
- */
46
- async getPage(limit?: any, after?: any, properties?: any, propertiesWithHistory?: any, associations?: any, archived?: any) {
47
- const url = '/crm/v3/objects/companies';
48
- const options: any = {
49
- method: 'GET',
50
- params: {},
51
- };
52
-
53
- // Add query parameters
54
- if (limit !== undefined) {
55
- options.params.limit = limit;
56
- }
57
- if (after !== undefined) {
58
- options.params.after = after;
59
- }
60
- if (properties !== undefined) {
61
- options.params.properties = properties;
62
- }
63
- if (propertiesWithHistory !== undefined) {
64
- options.params.propertiesWithHistory = propertiesWithHistory;
65
- }
66
- if (associations !== undefined) {
67
- options.params.associations = associations;
68
- }
69
- if (archived !== undefined) {
70
- options.params.archived = archived;
71
- }
72
-
73
- return this.api.fetch(url, options);
74
- }
75
-
76
- /**
77
- * Create a company
78
- *
79
- * Create a single company. Include a `properties` object to define [property values](https://developers.hubspot.com/docs/guides/api/crm/properties) for the company, along with an `associations` array to define [associations](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4) with other CRM records.
80
- *
81
- * @param {Object} body (required) - Request body
82
- *
83
- * @returns {Promise<Object>} POST /crm/v3/objects/companies response
84
- */
85
- async create(body?: any) {
86
- const url = '/crm/v3/objects/companies';
87
- const options: any = {
88
- method: 'POST',
89
- body,
90
- };
91
-
92
- return this.api.fetch(url, options);
93
- }
94
-
95
- /**
96
- * Search for companies
97
- *
98
- * Search for companies by filtering on properties, searching through associations, and sorting results. Learn more about [CRM search](https://developers.hubspot.com/docs/guides/api/crm/search#make-a-search-request).
99
- *
100
- * @param {Object} body (required) - Request body
101
- *
102
- * @returns {Promise<Object>} POST /crm/v3/objects/companies/search response
103
- */
104
- async doSearch(body?: any) {
105
- const url = '/crm/v3/objects/companies/search';
106
- const options: any = {
107
- method: 'POST',
108
- body,
109
- };
110
-
111
- return this.api.fetch(url, options);
112
- }
113
-
114
- /**
115
- * Retrieve a company
116
- *
117
- * Retrieve a company by its ID (`companyId`) or by a unique property (`idProperty`). You can specify what is returned using the `properties` query parameter.
118
- *
119
- * @param {string} companyId (required) - The ID of the company [path]
120
- * @param {array} properties (optional) - A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. [query]
121
- * @param {array} propertiesWithHistory (optional) - A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. [query]
122
- * @param {array} associations (optional) - A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. [query]
123
- * @param {boolean} archived (optional) - Whether to return only results that have been archived. [query]
124
- * @param {string} idProperty (optional) - The name of a property whose values are unique for this object [query]
125
- *
126
- * @returns {Promise<Object>} GET /crm/v3/objects/companies/{companyId} response
127
- */
128
- async getById(companyId: string, properties?: any, propertiesWithHistory?: any, associations?: any, archived?: any, idProperty?: any) {
129
- // Build URL with path parameters
130
- let url = '/crm/v3/objects/companies/{companyId}';
131
- if (companyId) {
132
- url = url.replace('{companyId}', companyId);
133
- }
134
-
135
- const options: any = {
136
- method: 'GET',
137
- params: {},
138
- };
139
-
140
- // Add query parameters
141
- if (properties !== undefined) {
142
- options.params.properties = properties;
143
- }
144
- if (propertiesWithHistory !== undefined) {
145
- options.params.propertiesWithHistory = propertiesWithHistory;
146
- }
147
- if (associations !== undefined) {
148
- options.params.associations = associations;
149
- }
150
- if (archived !== undefined) {
151
- options.params.archived = archived;
152
- }
153
- if (idProperty !== undefined) {
154
- options.params.idProperty = idProperty;
155
- }
156
-
157
- return this.api.fetch(url, options);
158
- }
159
-
160
- /**
161
- * Update a company
162
- *
163
- * Update a company by ID (`companyId`) or unique property value (`idProperty`). Provided property values will be overwritten. Read-only and non-existent properties will result in an error. Properties values can be cleared by passing an empty string.
164
- *
165
- * @param {string} companyId (required) [path]
166
- * @param {string} idProperty (optional) - The name of a property whose values are unique for this object [query]
167
- *
168
- * @param {Object} body (required) - Request body
169
- *
170
- * @returns {Promise<Object>} PATCH /crm/v3/objects/companies/{companyId} response
171
- */
172
- async update(companyId: string, idProperty?: any, body?: any) {
173
- // Build URL with path parameters
174
- let url = '/crm/v3/objects/companies/{companyId}';
175
- if (companyId) {
176
- url = url.replace('{companyId}', companyId);
177
- }
178
-
179
- const options: any = {
180
- method: 'PATCH',
181
- params: {},
182
- body,
183
- };
184
-
185
- // Add query parameters
186
- if (idProperty !== undefined) {
187
- options.params.idProperty = idProperty;
188
- }
189
-
190
- return this.api.fetch(url, options);
191
- }
192
-
193
- /**
194
- * Archive a company
195
- *
196
- * Delete a company by ID. Deleted companies can be restored within 90 days of deletion. Learn more about [restoring records](https://knowledge.hubspot.com/records/restore-deleted-records).
197
- *
198
- * @param {string} companyId (required) [path]
199
- *
200
- * @returns {Promise<Object>} DELETE /crm/v3/objects/companies/{companyId} response
201
- */
202
- async archive(companyId: string) {
203
- // Build URL with path parameters
204
- let url = '/crm/v3/objects/companies/{companyId}';
205
- if (companyId) {
206
- url = url.replace('{companyId}', companyId);
207
- }
208
-
209
- const options: any = {
210
- method: 'DELETE',
211
- };
212
-
213
- return this.api.fetch(url, options);
214
- }
215
-
216
- /**
217
- * Create or update a batch of companies by unique property values
218
- *
219
- * Create or update companies identified by a unique property value as specified by the `idProperty` query parameter. `idProperty` query param refers to a property whose values are unique for the object.
220
- *
221
- * @param {Object} body (required) - Request body
222
- *
223
- * @returns {Promise<Object>} POST /crm/v3/objects/companies/batch/upsert response
224
- */
225
- async upsert(body?: any) {
226
- const url = '/crm/v3/objects/companies/batch/upsert';
227
- const options: any = {
228
- method: 'POST',
229
- body,
230
- };
231
-
232
- return this.api.fetch(url, options);
233
- }
234
-
235
- /**
236
- * Create a batch of companies
237
- *
238
- * Create a batch of companies. The `inputs` array can contain a `properties` object to define property values for each company, along with an `associations` array to define [associations](https://developers.hubspot.com/docs/guides/api/crm/associations/associations-v4) with other CRM records.
239
- *
240
- * @param {Object} body (required) - Request body
241
- *
242
- * @returns {Promise<Object>} POST /crm/v3/objects/companies/batch/create response
243
- */
244
- async create(body?: any) {
245
- const url = '/crm/v3/objects/companies/batch/create';
246
- const options: any = {
247
- method: 'POST',
248
- body,
249
- };
250
-
251
- return this.api.fetch(url, options);
252
- }
253
-
254
- /**
255
- * Update a batch of companies
256
- *
257
- * Update a batch of companies by ID.
258
- *
259
- * @param {Object} body (required) - Request body
260
- *
261
- * @returns {Promise<Object>} POST /crm/v3/objects/companies/batch/update response
262
- */
263
- async update(body?: any) {
264
- const url = '/crm/v3/objects/companies/batch/update';
265
- const options: any = {
266
- method: 'POST',
267
- body,
268
- };
269
-
270
- return this.api.fetch(url, options);
271
- }
272
-
273
- /**
274
- * Archive a batch of companies
275
- *
276
- * Delete a batch of companies by ID. Deleted companies can be restored within 90 days of deletion. Learn more about [restoring records](https://knowledge.hubspot.com/records/restore-deleted-records).
277
- *
278
- * @param {Object} body (required) - Request body
279
- *
280
- * @returns {Promise<Object>} POST /crm/v3/objects/companies/batch/archive response
281
- */
282
- async archive(body?: any) {
283
- const url = '/crm/v3/objects/companies/batch/archive';
284
- const options: any = {
285
- method: 'POST',
286
- body,
287
- };
288
-
289
- return this.api.fetch(url, options);
290
- }
291
-
292
- /**
293
- * Merge two companies
294
- *
295
- * Merge two company records. Learn more about [merging records](https://knowledge.hubspot.com/records/merge-records).
296
- *
297
- * @param {Object} body (required) - Request body
298
- *
299
- * @returns {Promise<Object>} POST /crm/v3/objects/companies/merge response
300
- */
301
- async merge(body?: any) {
302
- const url = '/crm/v3/objects/companies/merge';
303
- const options: any = {
304
- method: 'POST',
305
- body,
306
- };
307
-
308
- return this.api.fetch(url, options);
309
- }
310
- }