pipedrive 22.3.1-rc.2 → 22.3.1-rc.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. package/CHANGELOG.md +6 -4
  2. package/api/activities-api.ts +1 -24
  3. package/api/activity-fields-api.ts +1 -24
  4. package/api/activity-types-api.ts +1 -21
  5. package/api/billing-api.ts +1 -24
  6. package/api/call-logs-api.ts +1 -24
  7. package/api/channels-api.ts +1 -24
  8. package/api/currencies-api.ts +1 -24
  9. package/api/deal-fields-api.ts +1 -24
  10. package/api/deals-api.ts +1 -24
  11. package/api/files-api.ts +1 -24
  12. package/api/filters-api.ts +1 -24
  13. package/api/goals-api.ts +1 -24
  14. package/api/item-search-api.ts +1 -24
  15. package/api/lead-labels-api.ts +1 -21
  16. package/api/lead-sources-api.ts +1 -24
  17. package/api/leads-api.ts +1 -24
  18. package/api/legacy-teams-api.ts +1 -24
  19. package/api/mailbox-api.ts +1 -24
  20. package/api/note-fields-api.ts +1 -24
  21. package/api/notes-api.ts +1 -21
  22. package/api/organization-fields-api.ts +1 -24
  23. package/api/organization-relationships-api.ts +1 -24
  24. package/api/organizations-api.ts +1 -24
  25. package/api/permission-sets-api.ts +1 -24
  26. package/api/person-fields-api.ts +1 -21
  27. package/api/persons-api.ts +1 -24
  28. package/api/pipelines-api.ts +1 -24
  29. package/api/product-fields-api.ts +1 -24
  30. package/api/products-api.ts +1 -24
  31. package/api/project-templates-api.ts +1 -24
  32. package/api/projects-api.ts +1 -24
  33. package/api/recents-api.ts +1 -24
  34. package/api/roles-api.ts +1 -24
  35. package/api/stages-api.ts +1 -24
  36. package/api/subscriptions-api.ts +1 -24
  37. package/api/tasks-api.ts +1 -24
  38. package/api/user-connections-api.ts +1 -24
  39. package/api/user-settings-api.ts +1 -24
  40. package/api/users-api.ts +1 -24
  41. package/api/webhooks-api.ts +1 -21
  42. package/base.ts +23 -0
  43. package/common.ts +0 -1
  44. package/configuration.ts +3 -1
  45. package/dist/api/activities-api.js +7 -30
  46. package/dist/api/activity-fields-api.js +1 -24
  47. package/dist/api/activity-types-api.js +0 -20
  48. package/dist/api/billing-api.js +1 -24
  49. package/dist/api/call-logs-api.js +5 -28
  50. package/dist/api/channels-api.js +4 -27
  51. package/dist/api/currencies-api.js +1 -24
  52. package/dist/api/deal-fields-api.js +6 -29
  53. package/dist/api/deals-api.js +28 -51
  54. package/dist/api/files-api.js +11 -34
  55. package/dist/api/filters-api.js +7 -30
  56. package/dist/api/goals-api.js +5 -28
  57. package/dist/api/item-search-api.js +2 -25
  58. package/dist/api/lead-labels-api.js +0 -20
  59. package/dist/api/lead-sources-api.js +1 -24
  60. package/dist/api/leads-api.js +7 -30
  61. package/dist/api/legacy-teams-api.js +8 -31
  62. package/dist/api/mailbox-api.js +7 -30
  63. package/dist/api/note-fields-api.js +1 -24
  64. package/dist/api/notes-api.js +0 -20
  65. package/dist/api/organization-fields-api.js +6 -29
  66. package/dist/api/organization-relationships-api.js +5 -28
  67. package/dist/api/organizations-api.js +19 -42
  68. package/dist/api/permission-sets-api.js +3 -26
  69. package/dist/api/person-fields-api.js +0 -20
  70. package/dist/api/persons-api.js +21 -44
  71. package/dist/api/pipelines-api.js +8 -31
  72. package/dist/api/product-fields-api.js +6 -29
  73. package/dist/api/products-api.js +12 -35
  74. package/dist/api/project-templates-api.js +4 -27
  75. package/dist/api/projects-api.js +14 -37
  76. package/dist/api/recents-api.js +1 -24
  77. package/dist/api/roles-api.js +12 -35
  78. package/dist/api/stages-api.js +7 -30
  79. package/dist/api/subscriptions-api.js +9 -32
  80. package/dist/api/tasks-api.js +5 -28
  81. package/dist/api/user-connections-api.js +1 -24
  82. package/dist/api/user-settings-api.js +1 -24
  83. package/dist/api/users-api.js +10 -33
  84. package/dist/api/webhooks-api.js +0 -20
  85. package/dist/base.js +20 -0
  86. package/dist/common.d.ts +0 -1
  87. package/dist/common.js +1 -2
  88. package/dist/configuration.d.ts +1 -0
  89. package/dist/configuration.js +1 -1
  90. package/dist/esm/api/activities-api.js +0 -23
  91. package/dist/esm/api/activity-fields-api.js +0 -23
  92. package/dist/esm/api/activity-types-api.js +0 -20
  93. package/dist/esm/api/billing-api.js +0 -23
  94. package/dist/esm/api/call-logs-api.js +0 -23
  95. package/dist/esm/api/channels-api.js +0 -23
  96. package/dist/esm/api/currencies-api.js +0 -23
  97. package/dist/esm/api/deal-fields-api.js +0 -23
  98. package/dist/esm/api/deals-api.js +0 -23
  99. package/dist/esm/api/files-api.js +0 -23
  100. package/dist/esm/api/filters-api.js +0 -23
  101. package/dist/esm/api/goals-api.js +0 -23
  102. package/dist/esm/api/item-search-api.js +0 -23
  103. package/dist/esm/api/lead-labels-api.js +0 -20
  104. package/dist/esm/api/lead-sources-api.js +0 -23
  105. package/dist/esm/api/leads-api.js +0 -23
  106. package/dist/esm/api/legacy-teams-api.js +0 -23
  107. package/dist/esm/api/mailbox-api.js +0 -23
  108. package/dist/esm/api/note-fields-api.js +0 -23
  109. package/dist/esm/api/notes-api.js +0 -20
  110. package/dist/esm/api/organization-fields-api.js +0 -23
  111. package/dist/esm/api/organization-relationships-api.js +0 -23
  112. package/dist/esm/api/organizations-api.js +0 -23
  113. package/dist/esm/api/permission-sets-api.js +0 -23
  114. package/dist/esm/api/person-fields-api.js +0 -20
  115. package/dist/esm/api/persons-api.js +0 -23
  116. package/dist/esm/api/pipelines-api.js +0 -23
  117. package/dist/esm/api/product-fields-api.js +0 -23
  118. package/dist/esm/api/products-api.js +0 -23
  119. package/dist/esm/api/project-templates-api.js +0 -23
  120. package/dist/esm/api/projects-api.js +0 -23
  121. package/dist/esm/api/recents-api.js +0 -23
  122. package/dist/esm/api/roles-api.js +0 -23
  123. package/dist/esm/api/stages-api.js +0 -23
  124. package/dist/esm/api/subscriptions-api.js +0 -23
  125. package/dist/esm/api/tasks-api.js +0 -23
  126. package/dist/esm/api/user-connections-api.js +0 -23
  127. package/dist/esm/api/user-settings-api.js +0 -23
  128. package/dist/esm/api/users-api.js +0 -23
  129. package/dist/esm/api/webhooks-api.js +0 -20
  130. package/dist/esm/base.js +20 -0
  131. package/dist/esm/common.d.ts +0 -1
  132. package/dist/esm/common.js +0 -1
  133. package/dist/esm/configuration.d.ts +1 -0
  134. package/dist/esm/configuration.js +1 -1
  135. package/docs/CallLogObject.md +2 -1
  136. package/docs/DealsApi.md +14 -8
  137. package/docs/FiltersApi.md +4 -1
  138. package/docs/GetDeal.md +1 -1
  139. package/docs/GetDealRelatedObjects.md +11 -0
  140. package/docs/GetDealsRelatedObjects.md +3 -3
  141. package/docs/ItemSearchApi.md +2 -2
  142. package/docs/LeadsApi.md +4 -1
  143. package/docs/MailboxApi.md +2 -2
  144. package/docs/MeetingsApi.md +118 -0
  145. package/docs/OrganizationsApi.md +10 -4
  146. package/docs/PersonsApi.md +14 -5
  147. package/docs/PostDealParticipants.md +1 -1
  148. package/docs/PostDealParticipantsRelatedObjects.md +10 -0
  149. package/docs/ProductsApi.md +2 -2
  150. package/docs/RecentsApi.md +2 -2
  151. package/docs/ResponseCallLogObject.md +2 -1
  152. package/docs/UserProviderLinkCreateRequest.md +12 -0
  153. package/docs/UserProviderLinkErrorResponse.md +10 -0
  154. package/docs/UserProviderLinkSuccessResponse.md +10 -0
  155. package/docs/UserProviderLinkSuccessResponseData.md +9 -0
  156. package/docs/UsersApi.md +2 -2
  157. package/package.json +3 -3
  158. package/src/api/MeetingsApi.js +181 -0
  159. package/src/model/GetDealRelatedObjects.js +101 -0
  160. package/src/model/PostDealParticipantsRelatedObjects.js +90 -0
  161. package/src/model/UserProviderLinkCreateRequest.js +120 -0
  162. package/src/model/UserProviderLinkErrorResponse.js +90 -0
  163. package/src/model/UserProviderLinkSuccessResponse.js +90 -0
  164. package/src/model/UserProviderLinkSuccessResponseData.js +79 -0
  165. package/test/functional/access-token.test.js +5 -5
  166. package/test/functional/authorisation.test.js +5 -8
@@ -24,9 +24,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.UserConnectionsApi = exports.UserConnectionsApiFactory = exports.UserConnectionsApiFp = exports.UserConnectionsApiAxiosParamCreator = void 0;
26
26
  const axios_1 = require("axios");
27
- // URLSearchParams not necessarily used
28
- // @ts-ignore
29
- const url_1 = require("url");
30
27
  // Some imports not used depending on template conditions
31
28
  // @ts-ignore
32
29
  const common_1 = require("../common");
@@ -47,7 +44,7 @@ const UserConnectionsApiAxiosParamCreator = function (configuration) {
47
44
  getUserConnections: () => __awaiter(this, void 0, void 0, function* () {
48
45
  const localVarPath = `/userConnections`;
49
46
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
50
- const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
47
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
51
48
  let baseOptions;
52
49
  if (configuration) {
53
50
  baseOptions = configuration.baseOptions;
@@ -76,26 +73,6 @@ exports.UserConnectionsApiAxiosParamCreator = UserConnectionsApiAxiosParamCreato
76
73
  * @export
77
74
  */
78
75
  const UserConnectionsApiFp = function (configuration) {
79
- /**
80
- * Axios interceptor to add the SDK version as a User-Agent header
81
- * */
82
- axios_1.default.interceptors.request.use(function (config) {
83
- const version = require("../../package.json").version;
84
- config.headers['User-Agent'] = `Pipedrive-SDK-Javascript-${version}`;
85
- return config;
86
- });
87
- /**
88
- * Axios response interceptor to modify response structure
89
- */
90
- axios_1.default.interceptors.response.use(function (response) {
91
- return response.hasOwnProperty('success') ? response : response.data;
92
- }, function (error) {
93
- var _a;
94
- if ((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) {
95
- return Promise.reject(error.response.data);
96
- }
97
- return Promise.reject(error);
98
- });
99
76
  const localVarAxiosParamCreator = (0, exports.UserConnectionsApiAxiosParamCreator)(configuration);
100
77
  return {
101
78
  /**
@@ -24,9 +24,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.UserSettingsApi = exports.UserSettingsApiFactory = exports.UserSettingsApiFp = exports.UserSettingsApiAxiosParamCreator = void 0;
26
26
  const axios_1 = require("axios");
27
- // URLSearchParams not necessarily used
28
- // @ts-ignore
29
- const url_1 = require("url");
30
27
  // Some imports not used depending on template conditions
31
28
  // @ts-ignore
32
29
  const common_1 = require("../common");
@@ -47,7 +44,7 @@ const UserSettingsApiAxiosParamCreator = function (configuration) {
47
44
  getUserSettings: () => __awaiter(this, void 0, void 0, function* () {
48
45
  const localVarPath = `/userSettings`;
49
46
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
50
- const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
47
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
51
48
  let baseOptions;
52
49
  if (configuration) {
53
50
  baseOptions = configuration.baseOptions;
@@ -76,26 +73,6 @@ exports.UserSettingsApiAxiosParamCreator = UserSettingsApiAxiosParamCreator;
76
73
  * @export
77
74
  */
78
75
  const UserSettingsApiFp = function (configuration) {
79
- /**
80
- * Axios interceptor to add the SDK version as a User-Agent header
81
- * */
82
- axios_1.default.interceptors.request.use(function (config) {
83
- const version = require("../../package.json").version;
84
- config.headers['User-Agent'] = `Pipedrive-SDK-Javascript-${version}`;
85
- return config;
86
- });
87
- /**
88
- * Axios response interceptor to modify response structure
89
- */
90
- axios_1.default.interceptors.response.use(function (response) {
91
- return response.hasOwnProperty('success') ? response : response.data;
92
- }, function (error) {
93
- var _a;
94
- if ((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) {
95
- return Promise.reject(error.response.data);
96
- }
97
- return Promise.reject(error);
98
- });
99
76
  const localVarAxiosParamCreator = (0, exports.UserSettingsApiAxiosParamCreator)(configuration);
100
77
  return {
101
78
  /**
@@ -24,9 +24,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.UsersApi = exports.UsersApiFactory = exports.UsersApiFp = exports.UsersApiAxiosParamCreator = void 0;
26
26
  const axios_1 = require("axios");
27
- // URLSearchParams not necessarily used
28
- // @ts-ignore
29
- const url_1 = require("url");
30
27
  // Some imports not used depending on template conditions
31
28
  // @ts-ignore
32
29
  const common_1 = require("../common");
@@ -48,7 +45,7 @@ const UsersApiAxiosParamCreator = function (configuration) {
48
45
  addUser: (AddUserRequest) => __awaiter(this, void 0, void 0, function* () {
49
46
  const localVarPath = `/users`;
50
47
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
51
- const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
48
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
52
49
  let baseOptions;
53
50
  if (configuration) {
54
51
  baseOptions = configuration.baseOptions;
@@ -84,7 +81,7 @@ const UsersApiAxiosParamCreator = function (configuration) {
84
81
  (0, common_1.assertParamExists)('findUsersByName', 'term', term);
85
82
  const localVarPath = `/users/find`;
86
83
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
87
- const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
84
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
88
85
  let baseOptions;
89
86
  if (configuration) {
90
87
  baseOptions = configuration.baseOptions;
@@ -120,7 +117,7 @@ const UsersApiAxiosParamCreator = function (configuration) {
120
117
  getCurrentUser: () => __awaiter(this, void 0, void 0, function* () {
121
118
  const localVarPath = `/users/me`;
122
119
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
123
- const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
120
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
124
121
  let baseOptions;
125
122
  if (configuration) {
126
123
  baseOptions = configuration.baseOptions;
@@ -154,7 +151,7 @@ const UsersApiAxiosParamCreator = function (configuration) {
154
151
  const localVarPath = `/users/{id}`
155
152
  .replace(`{${"id"}}`, encodeURIComponent(String(id)));
156
153
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
157
- const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
154
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
158
155
  let baseOptions;
159
156
  if (configuration) {
160
157
  baseOptions = configuration.baseOptions;
@@ -188,7 +185,7 @@ const UsersApiAxiosParamCreator = function (configuration) {
188
185
  const localVarPath = `/users/{id}/followers`
189
186
  .replace(`{${"id"}}`, encodeURIComponent(String(id)));
190
187
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
191
- const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
188
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
192
189
  let baseOptions;
193
190
  if (configuration) {
194
191
  baseOptions = configuration.baseOptions;
@@ -222,7 +219,7 @@ const UsersApiAxiosParamCreator = function (configuration) {
222
219
  const localVarPath = `/users/{id}/permissions`
223
220
  .replace(`{${"id"}}`, encodeURIComponent(String(id)));
224
221
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
225
- const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
222
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
226
223
  let baseOptions;
227
224
  if (configuration) {
228
225
  baseOptions = configuration.baseOptions;
@@ -258,7 +255,7 @@ const UsersApiAxiosParamCreator = function (configuration) {
258
255
  const localVarPath = `/users/{id}/roleAssignments`
259
256
  .replace(`{${"id"}}`, encodeURIComponent(String(id)));
260
257
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
261
- const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
258
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
262
259
  let baseOptions;
263
260
  if (configuration) {
264
261
  baseOptions = configuration.baseOptions;
@@ -298,7 +295,7 @@ const UsersApiAxiosParamCreator = function (configuration) {
298
295
  const localVarPath = `/users/{id}/roleSettings`
299
296
  .replace(`{${"id"}}`, encodeURIComponent(String(id)));
300
297
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
301
- const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
298
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
302
299
  let baseOptions;
303
300
  if (configuration) {
304
301
  baseOptions = configuration.baseOptions;
@@ -328,7 +325,7 @@ const UsersApiAxiosParamCreator = function (configuration) {
328
325
  getUsers: () => __awaiter(this, void 0, void 0, function* () {
329
326
  const localVarPath = `/users`;
330
327
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
331
- const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
328
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
332
329
  let baseOptions;
333
330
  if (configuration) {
334
331
  baseOptions = configuration.baseOptions;
@@ -363,7 +360,7 @@ const UsersApiAxiosParamCreator = function (configuration) {
363
360
  const localVarPath = `/users/{id}`
364
361
  .replace(`{${"id"}}`, encodeURIComponent(String(id)));
365
362
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
366
- const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
363
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
367
364
  let baseOptions;
368
365
  if (configuration) {
369
366
  baseOptions = configuration.baseOptions;
@@ -394,26 +391,6 @@ exports.UsersApiAxiosParamCreator = UsersApiAxiosParamCreator;
394
391
  * @export
395
392
  */
396
393
  const UsersApiFp = function (configuration) {
397
- /**
398
- * Axios interceptor to add the SDK version as a User-Agent header
399
- * */
400
- axios_1.default.interceptors.request.use(function (config) {
401
- const version = require("../../package.json").version;
402
- config.headers['User-Agent'] = `Pipedrive-SDK-Javascript-${version}`;
403
- return config;
404
- });
405
- /**
406
- * Axios response interceptor to modify response structure
407
- */
408
- axios_1.default.interceptors.response.use(function (response) {
409
- return response.hasOwnProperty('success') ? response : response.data;
410
- }, function (error) {
411
- var _a;
412
- if ((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) {
413
- return Promise.reject(error.response.data);
414
- }
415
- return Promise.reject(error);
416
- });
417
394
  const localVarAxiosParamCreator = (0, exports.UsersApiAxiosParamCreator)(configuration);
418
395
  return {
419
396
  /**
@@ -140,26 +140,6 @@ exports.WebhooksApiAxiosParamCreator = WebhooksApiAxiosParamCreator;
140
140
  * @export
141
141
  */
142
142
  const WebhooksApiFp = function (configuration) {
143
- /**
144
- * Axios interceptor to add the SDK version as a User-Agent header
145
- * */
146
- axios_1.default.interceptors.request.use(function (config) {
147
- const version = require("../../package.json").version;
148
- config.headers['User-Agent'] = `Pipedrive-SDK-Javascript-${version}`;
149
- return config;
150
- });
151
- /**
152
- * Axios response interceptor to modify response structure
153
- */
154
- axios_1.default.interceptors.response.use(function (response) {
155
- return response.hasOwnProperty('success') ? response : response.data;
156
- }, function (error) {
157
- var _a;
158
- if ((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) {
159
- return Promise.reject(error.response.data);
160
- }
161
- return Promise.reject(error);
162
- });
163
143
  const localVarAxiosParamCreator = (0, exports.WebhooksApiAxiosParamCreator)(configuration);
164
144
  return {
165
145
  /**
package/dist/base.js CHANGED
@@ -26,6 +26,26 @@ exports.COLLECTION_FORMATS = {
26
26
  tsv: "\t",
27
27
  pipes: "|",
28
28
  };
29
+ /**
30
+ * Axios interceptor to add the SDK version as a User-Agent header
31
+ * */
32
+ axios_1.default.interceptors.request.use(function (config) {
33
+ const version = require("../package.json").version;
34
+ config.headers['User-Agent'] = `Pipedrive-SDK-Javascript-${version}`;
35
+ return config;
36
+ });
37
+ /**
38
+ * Axios response interceptor to modify response structure
39
+ */
40
+ axios_1.default.interceptors.response.use(function (response) {
41
+ return response ? (response.hasOwnProperty('success') ? response : response.data) : response;
42
+ }, function (error) {
43
+ var _a;
44
+ if ((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) {
45
+ return Promise.reject(error.response.data);
46
+ }
47
+ return Promise.reject(error);
48
+ });
29
49
  /**
30
50
  *
31
51
  * @export
package/dist/common.d.ts CHANGED
@@ -12,7 +12,6 @@
12
12
  import { Configuration } from "./configuration";
13
13
  import { RequestArgs } from "./base";
14
14
  import { AxiosInstance, AxiosResponse } from 'axios';
15
- import { URL } from 'url';
16
15
  /**
17
16
  *
18
17
  * @export
package/dist/common.js CHANGED
@@ -24,7 +24,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
26
26
  const base_1 = require("./base");
27
- const url_1 = require("url");
28
27
  /**
29
28
  *
30
29
  * @export
@@ -119,7 +118,7 @@ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
119
118
  * @export
120
119
  */
121
120
  const setSearchParams = function (url, ...objects) {
122
- const searchParams = new url_1.URLSearchParams(url.search);
121
+ const searchParams = new URLSearchParams(url.search);
123
122
  setFlattenedQueryParams(searchParams, objects);
124
123
  url.search = searchParams.toString();
125
124
  };
@@ -21,6 +21,7 @@ export interface Parameters {
21
21
  clientId: string;
22
22
  clientSecret: string;
23
23
  redirectUri: string;
24
+ host?: string;
24
25
  }
25
26
  export type ParamKey = keyof Parameters;
26
27
  export declare class OAuth2Configuration {
@@ -28,7 +28,6 @@ const qs_1 = require("qs");
28
28
  ;
29
29
  class OAuth2Configuration {
30
30
  constructor(params) {
31
- this.host = "https://oauth.pipedrive.com";
32
31
  this.accessToken = null;
33
32
  this.refreshToken = null;
34
33
  this.scope = null;
@@ -127,6 +126,7 @@ class OAuth2Configuration {
127
126
  this.clientId = this.validateParam(params, 'clientId');
128
127
  this.clientSecret = this.validateParam(params, 'clientSecret');
129
128
  this.redirectUri = this.validateParam(params, 'redirectUri');
129
+ this.host = params.host || "https://oauth.pipedrive.com";
130
130
  }
131
131
  get authorizationUrl() {
132
132
  return `${this.host}/oauth/authorize?client_id=${this.clientId}&redirect_uri=${encodeURIComponent(this.redirectUri)}`;
@@ -21,9 +21,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import globalAxios from 'axios';
24
- // URLSearchParams not necessarily used
25
- // @ts-ignore
26
- import { URL } from 'url';
27
24
  // Some imports not used depending on template conditions
28
25
  // @ts-ignore
29
26
  import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
@@ -340,26 +337,6 @@ export const ActivitiesApiAxiosParamCreator = function (configuration) {
340
337
  * @export
341
338
  */
342
339
  export const ActivitiesApiFp = function (configuration) {
343
- /**
344
- * Axios interceptor to add the SDK version as a User-Agent header
345
- * */
346
- globalAxios.interceptors.request.use(function (config) {
347
- const version = require("../../package.json").version;
348
- config.headers['User-Agent'] = `Pipedrive-SDK-Javascript-${version}`;
349
- return config;
350
- });
351
- /**
352
- * Axios response interceptor to modify response structure
353
- */
354
- globalAxios.interceptors.response.use(function (response) {
355
- return response.hasOwnProperty('success') ? response : response.data;
356
- }, function (error) {
357
- var _a;
358
- if ((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) {
359
- return Promise.reject(error.response.data);
360
- }
361
- return Promise.reject(error);
362
- });
363
340
  const localVarAxiosParamCreator = ActivitiesApiAxiosParamCreator(configuration);
364
341
  return {
365
342
  /**
@@ -21,9 +21,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import globalAxios from 'axios';
24
- // URLSearchParams not necessarily used
25
- // @ts-ignore
26
- import { URL } from 'url';
27
24
  // Some imports not used depending on template conditions
28
25
  // @ts-ignore
29
26
  import { DUMMY_BASE_URL, setApiKeyToObject, setOAuthToObject, setSearchParams, toPathString, createRequestFunction } from '../common';
@@ -72,26 +69,6 @@ export const ActivityFieldsApiAxiosParamCreator = function (configuration) {
72
69
  * @export
73
70
  */
74
71
  export const ActivityFieldsApiFp = function (configuration) {
75
- /**
76
- * Axios interceptor to add the SDK version as a User-Agent header
77
- * */
78
- globalAxios.interceptors.request.use(function (config) {
79
- const version = require("../../package.json").version;
80
- config.headers['User-Agent'] = `Pipedrive-SDK-Javascript-${version}`;
81
- return config;
82
- });
83
- /**
84
- * Axios response interceptor to modify response structure
85
- */
86
- globalAxios.interceptors.response.use(function (response) {
87
- return response.hasOwnProperty('success') ? response : response.data;
88
- }, function (error) {
89
- var _a;
90
- if ((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) {
91
- return Promise.reject(error.response.data);
92
- }
93
- return Promise.reject(error);
94
- });
95
72
  const localVarAxiosParamCreator = ActivityFieldsApiAxiosParamCreator(configuration);
96
73
  return {
97
74
  /**
@@ -209,26 +209,6 @@ export const ActivityTypesApiAxiosParamCreator = function (configuration) {
209
209
  * @export
210
210
  */
211
211
  export const ActivityTypesApiFp = function (configuration) {
212
- /**
213
- * Axios interceptor to add the SDK version as a User-Agent header
214
- * */
215
- globalAxios.interceptors.request.use(function (config) {
216
- const version = require("../../package.json").version;
217
- config.headers['User-Agent'] = `Pipedrive-SDK-Javascript-${version}`;
218
- return config;
219
- });
220
- /**
221
- * Axios response interceptor to modify response structure
222
- */
223
- globalAxios.interceptors.response.use(function (response) {
224
- return response.hasOwnProperty('success') ? response : response.data;
225
- }, function (error) {
226
- var _a;
227
- if ((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) {
228
- return Promise.reject(error.response.data);
229
- }
230
- return Promise.reject(error);
231
- });
232
212
  const localVarAxiosParamCreator = ActivityTypesApiAxiosParamCreator(configuration);
233
213
  return {
234
214
  /**
@@ -21,9 +21,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import globalAxios from 'axios';
24
- // URLSearchParams not necessarily used
25
- // @ts-ignore
26
- import { URL } from 'url';
27
24
  // Some imports not used depending on template conditions
28
25
  // @ts-ignore
29
26
  import { DUMMY_BASE_URL, setApiKeyToObject, setOAuthToObject, setSearchParams, toPathString, createRequestFunction } from '../common';
@@ -72,26 +69,6 @@ export const BillingApiAxiosParamCreator = function (configuration) {
72
69
  * @export
73
70
  */
74
71
  export const BillingApiFp = function (configuration) {
75
- /**
76
- * Axios interceptor to add the SDK version as a User-Agent header
77
- * */
78
- globalAxios.interceptors.request.use(function (config) {
79
- const version = require("../../package.json").version;
80
- config.headers['User-Agent'] = `Pipedrive-SDK-Javascript-${version}`;
81
- return config;
82
- });
83
- /**
84
- * Axios response interceptor to modify response structure
85
- */
86
- globalAxios.interceptors.response.use(function (response) {
87
- return response.hasOwnProperty('success') ? response : response.data;
88
- }, function (error) {
89
- var _a;
90
- if ((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) {
91
- return Promise.reject(error.response.data);
92
- }
93
- return Promise.reject(error);
94
- });
95
72
  const localVarAxiosParamCreator = BillingApiAxiosParamCreator(configuration);
96
73
  return {
97
74
  /**
@@ -21,9 +21,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import globalAxios from 'axios';
24
- // URLSearchParams not necessarily used
25
- // @ts-ignore
26
- import { URL } from 'url';
27
24
  // Some imports not used depending on template conditions
28
25
  // @ts-ignore
29
26
  import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
@@ -224,26 +221,6 @@ export const CallLogsApiAxiosParamCreator = function (configuration) {
224
221
  * @export
225
222
  */
226
223
  export const CallLogsApiFp = function (configuration) {
227
- /**
228
- * Axios interceptor to add the SDK version as a User-Agent header
229
- * */
230
- globalAxios.interceptors.request.use(function (config) {
231
- const version = require("../../package.json").version;
232
- config.headers['User-Agent'] = `Pipedrive-SDK-Javascript-${version}`;
233
- return config;
234
- });
235
- /**
236
- * Axios response interceptor to modify response structure
237
- */
238
- globalAxios.interceptors.response.use(function (response) {
239
- return response.hasOwnProperty('success') ? response : response.data;
240
- }, function (error) {
241
- var _a;
242
- if ((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) {
243
- return Promise.reject(error.response.data);
244
- }
245
- return Promise.reject(error);
246
- });
247
224
  const localVarAxiosParamCreator = CallLogsApiAxiosParamCreator(configuration);
248
225
  return {
249
226
  /**
@@ -21,9 +21,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import globalAxios from 'axios';
24
- // URLSearchParams not necessarily used
25
- // @ts-ignore
26
- import { URL } from 'url';
27
24
  // Some imports not used depending on template conditions
28
25
  // @ts-ignore
29
26
  import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
@@ -180,26 +177,6 @@ export const ChannelsApiAxiosParamCreator = function (configuration) {
180
177
  * @export
181
178
  */
182
179
  export const ChannelsApiFp = function (configuration) {
183
- /**
184
- * Axios interceptor to add the SDK version as a User-Agent header
185
- * */
186
- globalAxios.interceptors.request.use(function (config) {
187
- const version = require("../../package.json").version;
188
- config.headers['User-Agent'] = `Pipedrive-SDK-Javascript-${version}`;
189
- return config;
190
- });
191
- /**
192
- * Axios response interceptor to modify response structure
193
- */
194
- globalAxios.interceptors.response.use(function (response) {
195
- return response.hasOwnProperty('success') ? response : response.data;
196
- }, function (error) {
197
- var _a;
198
- if ((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) {
199
- return Promise.reject(error.response.data);
200
- }
201
- return Promise.reject(error);
202
- });
203
180
  const localVarAxiosParamCreator = ChannelsApiAxiosParamCreator(configuration);
204
181
  return {
205
182
  /**
@@ -21,9 +21,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import globalAxios from 'axios';
24
- // URLSearchParams not necessarily used
25
- // @ts-ignore
26
- import { URL } from 'url';
27
24
  // Some imports not used depending on template conditions
28
25
  // @ts-ignore
29
26
  import { DUMMY_BASE_URL, setApiKeyToObject, setOAuthToObject, setSearchParams, toPathString, createRequestFunction } from '../common';
@@ -76,26 +73,6 @@ export const CurrenciesApiAxiosParamCreator = function (configuration) {
76
73
  * @export
77
74
  */
78
75
  export const CurrenciesApiFp = function (configuration) {
79
- /**
80
- * Axios interceptor to add the SDK version as a User-Agent header
81
- * */
82
- globalAxios.interceptors.request.use(function (config) {
83
- const version = require("../../package.json").version;
84
- config.headers['User-Agent'] = `Pipedrive-SDK-Javascript-${version}`;
85
- return config;
86
- });
87
- /**
88
- * Axios response interceptor to modify response structure
89
- */
90
- globalAxios.interceptors.response.use(function (response) {
91
- return response.hasOwnProperty('success') ? response : response.data;
92
- }, function (error) {
93
- var _a;
94
- if ((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) {
95
- return Promise.reject(error.response.data);
96
- }
97
- return Promise.reject(error);
98
- });
99
76
  const localVarAxiosParamCreator = CurrenciesApiAxiosParamCreator(configuration);
100
77
  return {
101
78
  /**
@@ -21,9 +21,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import globalAxios from 'axios';
24
- // URLSearchParams not necessarily used
25
- // @ts-ignore
26
- import { URL } from 'url';
27
24
  // Some imports not used depending on template conditions
28
25
  // @ts-ignore
29
26
  import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
@@ -254,26 +251,6 @@ export const DealFieldsApiAxiosParamCreator = function (configuration) {
254
251
  * @export
255
252
  */
256
253
  export const DealFieldsApiFp = function (configuration) {
257
- /**
258
- * Axios interceptor to add the SDK version as a User-Agent header
259
- * */
260
- globalAxios.interceptors.request.use(function (config) {
261
- const version = require("../../package.json").version;
262
- config.headers['User-Agent'] = `Pipedrive-SDK-Javascript-${version}`;
263
- return config;
264
- });
265
- /**
266
- * Axios response interceptor to modify response structure
267
- */
268
- globalAxios.interceptors.response.use(function (response) {
269
- return response.hasOwnProperty('success') ? response : response.data;
270
- }, function (error) {
271
- var _a;
272
- if ((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) {
273
- return Promise.reject(error.response.data);
274
- }
275
- return Promise.reject(error);
276
- });
277
254
  const localVarAxiosParamCreator = DealFieldsApiAxiosParamCreator(configuration);
278
255
  return {
279
256
  /**
@@ -21,9 +21,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import globalAxios from 'axios';
24
- // URLSearchParams not necessarily used
25
- // @ts-ignore
26
- import { URL } from 'url';
27
24
  // Some imports not used depending on template conditions
28
25
  // @ts-ignore
29
26
  import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
@@ -1249,26 +1246,6 @@ export const DealsApiAxiosParamCreator = function (configuration) {
1249
1246
  * @export
1250
1247
  */
1251
1248
  export const DealsApiFp = function (configuration) {
1252
- /**
1253
- * Axios interceptor to add the SDK version as a User-Agent header
1254
- * */
1255
- globalAxios.interceptors.request.use(function (config) {
1256
- const version = require("../../package.json").version;
1257
- config.headers['User-Agent'] = `Pipedrive-SDK-Javascript-${version}`;
1258
- return config;
1259
- });
1260
- /**
1261
- * Axios response interceptor to modify response structure
1262
- */
1263
- globalAxios.interceptors.response.use(function (response) {
1264
- return response.hasOwnProperty('success') ? response : response.data;
1265
- }, function (error) {
1266
- var _a;
1267
- if ((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) {
1268
- return Promise.reject(error.response.data);
1269
- }
1270
- return Promise.reject(error);
1271
- });
1272
1249
  const localVarAxiosParamCreator = DealsApiAxiosParamCreator(configuration);
1273
1250
  return {
1274
1251
  /**