@iblai/iblai-api 4.265.1-core → 4.265.2-core
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/dist/index.cjs.js +2168 -258
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +2165 -259
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +2168 -258
- package/dist/index.umd.js.map +1 -1
- package/dist/types/index.d.ts +26 -1
- package/dist/types/models/Activity.d.ts +83 -0
- package/dist/types/models/ActivityTypeEnum.d.ts +18 -0
- package/dist/types/models/Deal.d.ts +83 -0
- package/dist/types/models/DealLostRequest.d.ts +10 -0
- package/dist/types/models/DealMoveStageRequest.d.ts +10 -0
- package/dist/types/models/DealStatusEnum.d.ts +10 -0
- package/dist/types/models/DealWonRequest.d.ts +6 -0
- package/dist/types/models/LeadSource.d.ts +30 -0
- package/dist/types/models/NotificationTemplateDetail.d.ts +24 -2
- package/dist/types/models/NotificationTemplateList.d.ts +5 -2
- package/dist/types/models/Organization.d.ts +1 -1
- package/dist/types/models/PaginatedActivityList.d.ts +7 -0
- package/dist/types/models/PaginatedDealList.d.ts +7 -0
- package/dist/types/models/PaginatedLeadSourceList.d.ts +7 -0
- package/dist/types/models/PaginatedPipelineList.d.ts +7 -0
- package/dist/types/models/PaginatedPipelineStageList.d.ts +7 -0
- package/dist/types/models/PatchedActivity.d.ts +83 -0
- package/dist/types/models/PatchedDeal.d.ts +83 -0
- package/dist/types/models/PatchedLeadSource.d.ts +30 -0
- package/dist/types/models/PatchedNotificationTemplateDetail.d.ts +24 -2
- package/dist/types/models/PatchedOrganization.d.ts +1 -1
- package/dist/types/models/PatchedPipeline.d.ts +34 -0
- package/dist/types/models/PatchedPipelineStage.d.ts +40 -0
- package/dist/types/models/Pipeline.d.ts +34 -0
- package/dist/types/models/PipelineStage.d.ts +40 -0
- package/dist/types/models/RecipientsRecipientModeEnum.d.ts +14 -0
- package/dist/types/models/{TypeD36Enum.d.ts → Type4b7Enum.d.ts} +7 -1
- package/dist/types/services/ActivitiesService.d.ts +126 -0
- package/dist/types/services/CrmService.d.ts +553 -1
- package/dist/types/services/DealsService.d.ts +160 -0
- package/dist/types/services/LeadSourcesService.d.ts +95 -0
- package/dist/types/services/PersonsService.d.ts +1 -1
- package/dist/types/services/PipelinesService.d.ts +183 -0
- package/package.json +1 -1
- package/sdk_schema.yml +4093 -141
- package/src/core/OpenAPI.ts +1 -1
- package/src/index.ts +26 -1
- package/src/models/Activity.ts +88 -0
- package/src/models/ActivityTypeEnum.ts +22 -0
- package/src/models/Deal.ts +88 -0
- package/src/models/DealLostRequest.ts +15 -0
- package/src/models/DealMoveStageRequest.ts +15 -0
- package/src/models/DealStatusEnum.ts +14 -0
- package/src/models/DealWonRequest.ts +11 -0
- package/src/models/LeadSource.ts +35 -0
- package/src/models/NotificationTemplateDetail.ts +24 -2
- package/src/models/NotificationTemplateList.ts +5 -2
- package/src/models/Organization.ts +1 -1
- package/src/models/PaginatedActivityList.ts +12 -0
- package/src/models/PaginatedDealList.ts +12 -0
- package/src/models/PaginatedLeadSourceList.ts +12 -0
- package/src/models/PaginatedPipelineList.ts +12 -0
- package/src/models/PaginatedPipelineStageList.ts +12 -0
- package/src/models/PatchedActivity.ts +88 -0
- package/src/models/PatchedDeal.ts +88 -0
- package/src/models/PatchedLeadSource.ts +35 -0
- package/src/models/PatchedNotificationTemplateDetail.ts +24 -2
- package/src/models/PatchedOrganization.ts +1 -1
- package/src/models/PatchedPipeline.ts +39 -0
- package/src/models/PatchedPipelineStage.ts +45 -0
- package/src/models/Pipeline.ts +39 -0
- package/src/models/PipelineStage.ts +45 -0
- package/src/models/RecipientsRecipientModeEnum.ts +18 -0
- package/src/models/{TypeD36Enum.ts → Type4b7Enum.ts} +7 -1
- package/src/services/ActivitiesService.ts +255 -0
- package/src/services/CrmService.ts +1161 -1
- package/src/services/DealsService.ts +337 -0
- package/src/services/LeadSourcesService.ts +198 -0
- package/src/services/PersonsService.ts +1 -1
- package/src/services/PipelinesService.ts +406 -0
|
@@ -2,21 +2,790 @@
|
|
|
2
2
|
/* istanbul ignore file */
|
|
3
3
|
/* tslint:disable */
|
|
4
4
|
/* eslint-disable */
|
|
5
|
+
import type { Activity } from '../models/Activity';
|
|
6
|
+
import type { Deal } from '../models/Deal';
|
|
7
|
+
import type { DealLostRequest } from '../models/DealLostRequest';
|
|
8
|
+
import type { DealMoveStageRequest } from '../models/DealMoveStageRequest';
|
|
9
|
+
import type { DealWonRequest } from '../models/DealWonRequest';
|
|
10
|
+
import type { LeadSource } from '../models/LeadSource';
|
|
5
11
|
import type { Organization } from '../models/Organization';
|
|
12
|
+
import type { PaginatedActivityList } from '../models/PaginatedActivityList';
|
|
13
|
+
import type { PaginatedDealList } from '../models/PaginatedDealList';
|
|
14
|
+
import type { PaginatedLeadSourceList } from '../models/PaginatedLeadSourceList';
|
|
6
15
|
import type { PaginatedOrganizationList } from '../models/PaginatedOrganizationList';
|
|
7
16
|
import type { PaginatedPersonList } from '../models/PaginatedPersonList';
|
|
17
|
+
import type { PaginatedPipelineList } from '../models/PaginatedPipelineList';
|
|
18
|
+
import type { PaginatedPipelineStageList } from '../models/PaginatedPipelineStageList';
|
|
19
|
+
import type { PatchedActivity } from '../models/PatchedActivity';
|
|
20
|
+
import type { PatchedDeal } from '../models/PatchedDeal';
|
|
21
|
+
import type { PatchedLeadSource } from '../models/PatchedLeadSource';
|
|
8
22
|
import type { PatchedOrganization } from '../models/PatchedOrganization';
|
|
9
23
|
import type { PatchedPerson } from '../models/PatchedPerson';
|
|
24
|
+
import type { PatchedPipeline } from '../models/PatchedPipeline';
|
|
25
|
+
import type { PatchedPipelineStage } from '../models/PatchedPipelineStage';
|
|
10
26
|
import type { Person } from '../models/Person';
|
|
11
27
|
import type { PersonInviteRequest } from '../models/PersonInviteRequest';
|
|
12
28
|
import type { PersonInviteResponse } from '../models/PersonInviteResponse';
|
|
13
29
|
import type { PersonLinkUserRequest } from '../models/PersonLinkUserRequest';
|
|
14
30
|
import type { PersonMergeRequest } from '../models/PersonMergeRequest';
|
|
15
31
|
import type { PersonMergeResponse } from '../models/PersonMergeResponse';
|
|
32
|
+
import type { Pipeline } from '../models/Pipeline';
|
|
33
|
+
import type { PipelineStage } from '../models/PipelineStage';
|
|
16
34
|
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
17
35
|
import { OpenAPI } from '../core/OpenAPI';
|
|
18
36
|
import { request as __request } from '../core/request';
|
|
19
37
|
export class CrmService {
|
|
38
|
+
/**
|
|
39
|
+
* List activities
|
|
40
|
+
* Returns a paginated list of Activities in your Platform. Supports filtering by `type`, `is_done`, `owner`, `deal`, `person`, schedule-from ranges, and `metadata__has_key`.
|
|
41
|
+
*
|
|
42
|
+
* **Required permission:** `Ibl.CRM/Activities/list`.
|
|
43
|
+
* @returns PaginatedActivityList
|
|
44
|
+
* @throws ApiError
|
|
45
|
+
*/
|
|
46
|
+
public static crmActivitiesList({
|
|
47
|
+
deal,
|
|
48
|
+
isDone,
|
|
49
|
+
metadataHasKey,
|
|
50
|
+
owner,
|
|
51
|
+
page,
|
|
52
|
+
pageSize,
|
|
53
|
+
person,
|
|
54
|
+
scheduleFromGte,
|
|
55
|
+
scheduleFromLte,
|
|
56
|
+
type,
|
|
57
|
+
}: {
|
|
58
|
+
deal?: number,
|
|
59
|
+
isDone?: boolean,
|
|
60
|
+
metadataHasKey?: string,
|
|
61
|
+
owner?: number,
|
|
62
|
+
/**
|
|
63
|
+
* A page number within the paginated result set.
|
|
64
|
+
*/
|
|
65
|
+
page?: number,
|
|
66
|
+
/**
|
|
67
|
+
* Number of results to return per page.
|
|
68
|
+
*/
|
|
69
|
+
pageSize?: number,
|
|
70
|
+
person?: string,
|
|
71
|
+
scheduleFromGte?: string,
|
|
72
|
+
scheduleFromLte?: string,
|
|
73
|
+
/**
|
|
74
|
+
* Interaction kind.
|
|
75
|
+
*
|
|
76
|
+
* * `call` - Call
|
|
77
|
+
* * `meeting` - Meeting
|
|
78
|
+
* * `email` - Email
|
|
79
|
+
* * `note` - Note
|
|
80
|
+
* * `task` - Task
|
|
81
|
+
* * `lunch` - Lunch
|
|
82
|
+
* * `deadline` - Deadline
|
|
83
|
+
*/
|
|
84
|
+
type?: 'call' | 'deadline' | 'email' | 'lunch' | 'meeting' | 'note' | 'task',
|
|
85
|
+
}): CancelablePromise<PaginatedActivityList> {
|
|
86
|
+
return __request(OpenAPI, {
|
|
87
|
+
method: 'GET',
|
|
88
|
+
url: '/api/crm/activities/',
|
|
89
|
+
query: {
|
|
90
|
+
'deal': deal,
|
|
91
|
+
'is_done': isDone,
|
|
92
|
+
'metadata__has_key': metadataHasKey,
|
|
93
|
+
'owner': owner,
|
|
94
|
+
'page': page,
|
|
95
|
+
'page_size': pageSize,
|
|
96
|
+
'person': person,
|
|
97
|
+
'schedule_from__gte': scheduleFromGte,
|
|
98
|
+
'schedule_from__lte': scheduleFromLte,
|
|
99
|
+
'type': type,
|
|
100
|
+
},
|
|
101
|
+
errors: {
|
|
102
|
+
401: `Authentication required.`,
|
|
103
|
+
403: `Missing required permission \`Ibl.CRM/Activities/list\`.`,
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Create an activity
|
|
109
|
+
* Creates an Activity. Either `deal` or `person` must be supplied; both must belong to your Platform.
|
|
110
|
+
*
|
|
111
|
+
* **Required permission:** `Ibl.CRM/Activities/write`.
|
|
112
|
+
* @returns Activity
|
|
113
|
+
* @throws ApiError
|
|
114
|
+
*/
|
|
115
|
+
public static crmActivitiesCreate({
|
|
116
|
+
requestBody,
|
|
117
|
+
}: {
|
|
118
|
+
requestBody: Activity,
|
|
119
|
+
}): CancelablePromise<Activity> {
|
|
120
|
+
return __request(OpenAPI, {
|
|
121
|
+
method: 'POST',
|
|
122
|
+
url: '/api/crm/activities/',
|
|
123
|
+
body: requestBody,
|
|
124
|
+
mediaType: 'application/json',
|
|
125
|
+
errors: {
|
|
126
|
+
400: `Validation error.`,
|
|
127
|
+
403: `Missing required permission \`Ibl.CRM/Activities/write\`.`,
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Retrieve an activity
|
|
133
|
+
* Returns a single Activity by id.
|
|
134
|
+
*
|
|
135
|
+
* **Required permission:** `Ibl.CRM/Activities/read`.
|
|
136
|
+
* @returns Activity
|
|
137
|
+
* @throws ApiError
|
|
138
|
+
*/
|
|
139
|
+
public static crmActivitiesRetrieve({
|
|
140
|
+
id,
|
|
141
|
+
}: {
|
|
142
|
+
/**
|
|
143
|
+
* A unique integer value identifying this activity.
|
|
144
|
+
*/
|
|
145
|
+
id: number,
|
|
146
|
+
}): CancelablePromise<Activity> {
|
|
147
|
+
return __request(OpenAPI, {
|
|
148
|
+
method: 'GET',
|
|
149
|
+
url: '/api/crm/activities/{id}/',
|
|
150
|
+
path: {
|
|
151
|
+
'id': id,
|
|
152
|
+
},
|
|
153
|
+
errors: {
|
|
154
|
+
403: `Missing required permission \`Ibl.CRM/Activities/read\`.`,
|
|
155
|
+
404: `Activity not found.`,
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Replace an activity
|
|
161
|
+
* Replaces all editable fields on the Activity.
|
|
162
|
+
*
|
|
163
|
+
* **Required permission:** `Ibl.CRM/Activities/write`.
|
|
164
|
+
* @returns Activity
|
|
165
|
+
* @throws ApiError
|
|
166
|
+
*/
|
|
167
|
+
public static crmActivitiesUpdate({
|
|
168
|
+
id,
|
|
169
|
+
requestBody,
|
|
170
|
+
}: {
|
|
171
|
+
/**
|
|
172
|
+
* A unique integer value identifying this activity.
|
|
173
|
+
*/
|
|
174
|
+
id: number,
|
|
175
|
+
requestBody: Activity,
|
|
176
|
+
}): CancelablePromise<Activity> {
|
|
177
|
+
return __request(OpenAPI, {
|
|
178
|
+
method: 'PUT',
|
|
179
|
+
url: '/api/crm/activities/{id}/',
|
|
180
|
+
path: {
|
|
181
|
+
'id': id,
|
|
182
|
+
},
|
|
183
|
+
body: requestBody,
|
|
184
|
+
mediaType: 'application/json',
|
|
185
|
+
errors: {
|
|
186
|
+
400: `Validation error.`,
|
|
187
|
+
403: `Missing required permission \`Ibl.CRM/Activities/write\`.`,
|
|
188
|
+
404: `Activity not found.`,
|
|
189
|
+
},
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Update an activity
|
|
194
|
+
* Updates only the supplied fields on the Activity.
|
|
195
|
+
*
|
|
196
|
+
* **Required permission:** `Ibl.CRM/Activities/write`.
|
|
197
|
+
* @returns Activity
|
|
198
|
+
* @throws ApiError
|
|
199
|
+
*/
|
|
200
|
+
public static crmActivitiesPartialUpdate({
|
|
201
|
+
id,
|
|
202
|
+
requestBody,
|
|
203
|
+
}: {
|
|
204
|
+
/**
|
|
205
|
+
* A unique integer value identifying this activity.
|
|
206
|
+
*/
|
|
207
|
+
id: number,
|
|
208
|
+
requestBody?: PatchedActivity,
|
|
209
|
+
}): CancelablePromise<Activity> {
|
|
210
|
+
return __request(OpenAPI, {
|
|
211
|
+
method: 'PATCH',
|
|
212
|
+
url: '/api/crm/activities/{id}/',
|
|
213
|
+
path: {
|
|
214
|
+
'id': id,
|
|
215
|
+
},
|
|
216
|
+
body: requestBody,
|
|
217
|
+
mediaType: 'application/json',
|
|
218
|
+
errors: {
|
|
219
|
+
400: `Validation error.`,
|
|
220
|
+
403: `Missing required permission \`Ibl.CRM/Activities/write\`.`,
|
|
221
|
+
404: `Activity not found.`,
|
|
222
|
+
},
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Delete an activity
|
|
227
|
+
* Deletes the Activity.
|
|
228
|
+
*
|
|
229
|
+
* **Required permission:** `Ibl.CRM/Activities/delete`.
|
|
230
|
+
* @returns void
|
|
231
|
+
* @throws ApiError
|
|
232
|
+
*/
|
|
233
|
+
public static crmActivitiesDestroy({
|
|
234
|
+
id,
|
|
235
|
+
}: {
|
|
236
|
+
/**
|
|
237
|
+
* A unique integer value identifying this activity.
|
|
238
|
+
*/
|
|
239
|
+
id: number,
|
|
240
|
+
}): CancelablePromise<void> {
|
|
241
|
+
return __request(OpenAPI, {
|
|
242
|
+
method: 'DELETE',
|
|
243
|
+
url: '/api/crm/activities/{id}/',
|
|
244
|
+
path: {
|
|
245
|
+
'id': id,
|
|
246
|
+
},
|
|
247
|
+
errors: {
|
|
248
|
+
403: `Missing required permission \`Ibl.CRM/Activities/delete\`.`,
|
|
249
|
+
404: `Activity not found.`,
|
|
250
|
+
},
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Mark an activity as done
|
|
255
|
+
* Flips `is_done=True` and stamps `done_at` if it isn't already set. Idempotent — calling on an already-done Activity preserves the original `done_at`.
|
|
256
|
+
*
|
|
257
|
+
* **Required permission:** `Ibl.CRM/Activities/write`.
|
|
258
|
+
* @returns Activity
|
|
259
|
+
* @throws ApiError
|
|
260
|
+
*/
|
|
261
|
+
public static crmActivitiesDoneCreate({
|
|
262
|
+
id,
|
|
263
|
+
}: {
|
|
264
|
+
/**
|
|
265
|
+
* A unique integer value identifying this activity.
|
|
266
|
+
*/
|
|
267
|
+
id: number,
|
|
268
|
+
}): CancelablePromise<Activity> {
|
|
269
|
+
return __request(OpenAPI, {
|
|
270
|
+
method: 'POST',
|
|
271
|
+
url: '/api/crm/activities/{id}/done/',
|
|
272
|
+
path: {
|
|
273
|
+
'id': id,
|
|
274
|
+
},
|
|
275
|
+
errors: {
|
|
276
|
+
403: `Missing required permission \`Ibl.CRM/Activities/write\`.`,
|
|
277
|
+
404: `Activity not found.`,
|
|
278
|
+
},
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* List deals
|
|
283
|
+
* Returns a paginated list of Deals in your Platform. Supports filtering by `status`, `pipeline`, `stage`, `owner`, `source`, `person`, `organization`, expected-close-date and created-at ranges, and `metadata__has_key`.
|
|
284
|
+
*
|
|
285
|
+
* **Required permission:** `Ibl.CRM/Deals/list`.
|
|
286
|
+
* @returns PaginatedDealList
|
|
287
|
+
* @throws ApiError
|
|
288
|
+
*/
|
|
289
|
+
public static crmDealsList({
|
|
290
|
+
createdAtGte,
|
|
291
|
+
createdAtLte,
|
|
292
|
+
expectedCloseDateGte,
|
|
293
|
+
expectedCloseDateLte,
|
|
294
|
+
metadataHasKey,
|
|
295
|
+
organization,
|
|
296
|
+
owner,
|
|
297
|
+
page,
|
|
298
|
+
pageSize,
|
|
299
|
+
person,
|
|
300
|
+
pipeline,
|
|
301
|
+
source,
|
|
302
|
+
stage,
|
|
303
|
+
status,
|
|
304
|
+
}: {
|
|
305
|
+
createdAtGte?: string,
|
|
306
|
+
createdAtLte?: string,
|
|
307
|
+
expectedCloseDateGte?: string,
|
|
308
|
+
expectedCloseDateLte?: string,
|
|
309
|
+
metadataHasKey?: string,
|
|
310
|
+
organization?: string,
|
|
311
|
+
owner?: number,
|
|
312
|
+
/**
|
|
313
|
+
* A page number within the paginated result set.
|
|
314
|
+
*/
|
|
315
|
+
page?: number,
|
|
316
|
+
/**
|
|
317
|
+
* Number of results to return per page.
|
|
318
|
+
*/
|
|
319
|
+
pageSize?: number,
|
|
320
|
+
person?: string,
|
|
321
|
+
pipeline?: number,
|
|
322
|
+
source?: number,
|
|
323
|
+
stage?: number,
|
|
324
|
+
/**
|
|
325
|
+
* Service-managed (read-only in serializer). Derived from the destination stage's is_won/is_lost.
|
|
326
|
+
*
|
|
327
|
+
* * `open` - Open
|
|
328
|
+
* * `won` - Won
|
|
329
|
+
* * `lost` - Lost
|
|
330
|
+
*/
|
|
331
|
+
status?: 'lost' | 'open' | 'won',
|
|
332
|
+
}): CancelablePromise<PaginatedDealList> {
|
|
333
|
+
return __request(OpenAPI, {
|
|
334
|
+
method: 'GET',
|
|
335
|
+
url: '/api/crm/deals/',
|
|
336
|
+
query: {
|
|
337
|
+
'created_at__gte': createdAtGte,
|
|
338
|
+
'created_at__lte': createdAtLte,
|
|
339
|
+
'expected_close_date__gte': expectedCloseDateGte,
|
|
340
|
+
'expected_close_date__lte': expectedCloseDateLte,
|
|
341
|
+
'metadata__has_key': metadataHasKey,
|
|
342
|
+
'organization': organization,
|
|
343
|
+
'owner': owner,
|
|
344
|
+
'page': page,
|
|
345
|
+
'page_size': pageSize,
|
|
346
|
+
'person': person,
|
|
347
|
+
'pipeline': pipeline,
|
|
348
|
+
'source': source,
|
|
349
|
+
'stage': stage,
|
|
350
|
+
'status': status,
|
|
351
|
+
},
|
|
352
|
+
errors: {
|
|
353
|
+
401: `Authentication required.`,
|
|
354
|
+
403: `Missing required permission \`Ibl.CRM/Deals/list\`.`,
|
|
355
|
+
},
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Create a deal
|
|
360
|
+
* Creates a new Deal. All FK targets (`person`, `organization`, `pipeline`, `stage`, `source`) must belong to your Platform; `stage` must belong to `pipeline`. `status` and `closed_at` are service-managed — passing them returns `400`.
|
|
361
|
+
*
|
|
362
|
+
* **Required permission:** `Ibl.CRM/Deals/write`.
|
|
363
|
+
* @returns Deal
|
|
364
|
+
* @throws ApiError
|
|
365
|
+
*/
|
|
366
|
+
public static crmDealsCreate({
|
|
367
|
+
requestBody,
|
|
368
|
+
}: {
|
|
369
|
+
requestBody: Deal,
|
|
370
|
+
}): CancelablePromise<Deal> {
|
|
371
|
+
return __request(OpenAPI, {
|
|
372
|
+
method: 'POST',
|
|
373
|
+
url: '/api/crm/deals/',
|
|
374
|
+
body: requestBody,
|
|
375
|
+
mediaType: 'application/json',
|
|
376
|
+
errors: {
|
|
377
|
+
400: `Validation error.`,
|
|
378
|
+
403: `Missing required permission \`Ibl.CRM/Deals/write\`.`,
|
|
379
|
+
},
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Retrieve a deal
|
|
384
|
+
* Returns a single Deal by id.
|
|
385
|
+
*
|
|
386
|
+
* **Required permission:** `Ibl.CRM/Deals/read`.
|
|
387
|
+
* @returns Deal
|
|
388
|
+
* @throws ApiError
|
|
389
|
+
*/
|
|
390
|
+
public static crmDealsRetrieve({
|
|
391
|
+
id,
|
|
392
|
+
}: {
|
|
393
|
+
/**
|
|
394
|
+
* A unique integer value identifying this deal.
|
|
395
|
+
*/
|
|
396
|
+
id: number,
|
|
397
|
+
}): CancelablePromise<Deal> {
|
|
398
|
+
return __request(OpenAPI, {
|
|
399
|
+
method: 'GET',
|
|
400
|
+
url: '/api/crm/deals/{id}/',
|
|
401
|
+
path: {
|
|
402
|
+
'id': id,
|
|
403
|
+
},
|
|
404
|
+
errors: {
|
|
405
|
+
403: `Missing required permission \`Ibl.CRM/Deals/read\`.`,
|
|
406
|
+
404: `Deal not found.`,
|
|
407
|
+
},
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Replace a deal
|
|
412
|
+
* Replaces all editable fields on the Deal.
|
|
413
|
+
*
|
|
414
|
+
* **Required permission:** `Ibl.CRM/Deals/write`.
|
|
415
|
+
* @returns Deal
|
|
416
|
+
* @throws ApiError
|
|
417
|
+
*/
|
|
418
|
+
public static crmDealsUpdate({
|
|
419
|
+
id,
|
|
420
|
+
requestBody,
|
|
421
|
+
}: {
|
|
422
|
+
/**
|
|
423
|
+
* A unique integer value identifying this deal.
|
|
424
|
+
*/
|
|
425
|
+
id: number,
|
|
426
|
+
requestBody: Deal,
|
|
427
|
+
}): CancelablePromise<Deal> {
|
|
428
|
+
return __request(OpenAPI, {
|
|
429
|
+
method: 'PUT',
|
|
430
|
+
url: '/api/crm/deals/{id}/',
|
|
431
|
+
path: {
|
|
432
|
+
'id': id,
|
|
433
|
+
},
|
|
434
|
+
body: requestBody,
|
|
435
|
+
mediaType: 'application/json',
|
|
436
|
+
errors: {
|
|
437
|
+
400: `Validation error.`,
|
|
438
|
+
403: `Missing required permission \`Ibl.CRM/Deals/write\`.`,
|
|
439
|
+
404: `Deal not found.`,
|
|
440
|
+
},
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Update a deal
|
|
445
|
+
* Updates only the supplied fields on the Deal. Direct writes to `status` or `closed_at` are rejected with `400` — use `POST /deals/{id}/move-stage/`, `won/`, or `lost/`.
|
|
446
|
+
*
|
|
447
|
+
* **Required permission:** `Ibl.CRM/Deals/write`.
|
|
448
|
+
* @returns Deal
|
|
449
|
+
* @throws ApiError
|
|
450
|
+
*/
|
|
451
|
+
public static crmDealsPartialUpdate({
|
|
452
|
+
id,
|
|
453
|
+
requestBody,
|
|
454
|
+
}: {
|
|
455
|
+
/**
|
|
456
|
+
* A unique integer value identifying this deal.
|
|
457
|
+
*/
|
|
458
|
+
id: number,
|
|
459
|
+
requestBody?: PatchedDeal,
|
|
460
|
+
}): CancelablePromise<Deal> {
|
|
461
|
+
return __request(OpenAPI, {
|
|
462
|
+
method: 'PATCH',
|
|
463
|
+
url: '/api/crm/deals/{id}/',
|
|
464
|
+
path: {
|
|
465
|
+
'id': id,
|
|
466
|
+
},
|
|
467
|
+
body: requestBody,
|
|
468
|
+
mediaType: 'application/json',
|
|
469
|
+
errors: {
|
|
470
|
+
400: `Validation error.`,
|
|
471
|
+
403: `Missing required permission \`Ibl.CRM/Deals/write\`.`,
|
|
472
|
+
404: `Deal not found.`,
|
|
473
|
+
},
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Delete a deal
|
|
478
|
+
* Deletes the Deal.
|
|
479
|
+
*
|
|
480
|
+
* **Required permission:** `Ibl.CRM/Deals/delete`.
|
|
481
|
+
* @returns void
|
|
482
|
+
* @throws ApiError
|
|
483
|
+
*/
|
|
484
|
+
public static crmDealsDestroy({
|
|
485
|
+
id,
|
|
486
|
+
}: {
|
|
487
|
+
/**
|
|
488
|
+
* A unique integer value identifying this deal.
|
|
489
|
+
*/
|
|
490
|
+
id: number,
|
|
491
|
+
}): CancelablePromise<void> {
|
|
492
|
+
return __request(OpenAPI, {
|
|
493
|
+
method: 'DELETE',
|
|
494
|
+
url: '/api/crm/deals/{id}/',
|
|
495
|
+
path: {
|
|
496
|
+
'id': id,
|
|
497
|
+
},
|
|
498
|
+
errors: {
|
|
499
|
+
403: `Missing required permission \`Ibl.CRM/Deals/delete\`.`,
|
|
500
|
+
404: `Deal not found.`,
|
|
501
|
+
},
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Mark a deal as lost
|
|
506
|
+
* Moves the Deal into a closed-lost stage and persists `lost_reason`. If `stage_code` is omitted, the first `is_lost=True` stage in the Deal's pipeline (by sort order) is used.
|
|
507
|
+
*
|
|
508
|
+
* **Required permission:** `Ibl.CRM/Deals/write`.
|
|
509
|
+
* @returns Deal
|
|
510
|
+
* @throws ApiError
|
|
511
|
+
*/
|
|
512
|
+
public static crmDealsLostCreate({
|
|
513
|
+
id,
|
|
514
|
+
requestBody,
|
|
515
|
+
}: {
|
|
516
|
+
/**
|
|
517
|
+
* A unique integer value identifying this deal.
|
|
518
|
+
*/
|
|
519
|
+
id: number,
|
|
520
|
+
requestBody: DealLostRequest,
|
|
521
|
+
}): CancelablePromise<Deal> {
|
|
522
|
+
return __request(OpenAPI, {
|
|
523
|
+
method: 'POST',
|
|
524
|
+
url: '/api/crm/deals/{id}/lost/',
|
|
525
|
+
path: {
|
|
526
|
+
'id': id,
|
|
527
|
+
},
|
|
528
|
+
body: requestBody,
|
|
529
|
+
mediaType: 'application/json',
|
|
530
|
+
errors: {
|
|
531
|
+
400: `Missing \`lost_reason\`, no \`is_lost\` stage configured, or the supplied stage_code is not flagged is_lost=True.`,
|
|
532
|
+
403: `Missing required permission \`Ibl.CRM/Deals/write\`.`,
|
|
533
|
+
404: `Deal not found.`,
|
|
534
|
+
},
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Move a deal to a different stage
|
|
539
|
+
* Moves the Deal to the stage identified by `stage_id` or `stage_code`. The target stage must belong to this Deal's pipeline. Records an audit Activity and emits `deal_stage_changed`. `Deal.status` is recomputed from the new stage's `is_won` / `is_lost` flags.
|
|
540
|
+
*
|
|
541
|
+
* **Required permission:** `Ibl.CRM/Deals/write`.
|
|
542
|
+
* @returns Deal
|
|
543
|
+
* @throws ApiError
|
|
544
|
+
*/
|
|
545
|
+
public static crmDealsMoveStageCreate({
|
|
546
|
+
id,
|
|
547
|
+
requestBody,
|
|
548
|
+
}: {
|
|
549
|
+
/**
|
|
550
|
+
* A unique integer value identifying this deal.
|
|
551
|
+
*/
|
|
552
|
+
id: number,
|
|
553
|
+
requestBody?: DealMoveStageRequest,
|
|
554
|
+
}): CancelablePromise<Deal> {
|
|
555
|
+
return __request(OpenAPI, {
|
|
556
|
+
method: 'POST',
|
|
557
|
+
url: '/api/crm/deals/{id}/move-stage/',
|
|
558
|
+
path: {
|
|
559
|
+
'id': id,
|
|
560
|
+
},
|
|
561
|
+
body: requestBody,
|
|
562
|
+
mediaType: 'application/json',
|
|
563
|
+
errors: {
|
|
564
|
+
400: `Validation error (e.g. stage not in pipeline).`,
|
|
565
|
+
403: `Missing required permission \`Ibl.CRM/Deals/write\`.`,
|
|
566
|
+
404: `Deal or stage not found.`,
|
|
567
|
+
},
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Mark a deal as won
|
|
572
|
+
* Moves the Deal into a closed-won stage and sets `status='won'`. If `stage_code` is omitted, the first `is_won=True` stage in the Deal's pipeline (by sort order) is used.
|
|
573
|
+
*
|
|
574
|
+
* **Required permission:** `Ibl.CRM/Deals/write`.
|
|
575
|
+
* @returns Deal
|
|
576
|
+
* @throws ApiError
|
|
577
|
+
*/
|
|
578
|
+
public static crmDealsWonCreate({
|
|
579
|
+
id,
|
|
580
|
+
requestBody,
|
|
581
|
+
}: {
|
|
582
|
+
/**
|
|
583
|
+
* A unique integer value identifying this deal.
|
|
584
|
+
*/
|
|
585
|
+
id: number,
|
|
586
|
+
requestBody?: DealWonRequest,
|
|
587
|
+
}): CancelablePromise<Deal> {
|
|
588
|
+
return __request(OpenAPI, {
|
|
589
|
+
method: 'POST',
|
|
590
|
+
url: '/api/crm/deals/{id}/won/',
|
|
591
|
+
path: {
|
|
592
|
+
'id': id,
|
|
593
|
+
},
|
|
594
|
+
body: requestBody,
|
|
595
|
+
mediaType: 'application/json',
|
|
596
|
+
errors: {
|
|
597
|
+
400: `No \`is_won\` stage configured, or the supplied stage_code is not flagged is_won=True.`,
|
|
598
|
+
403: `Missing required permission \`Ibl.CRM/Deals/write\`.`,
|
|
599
|
+
404: `Deal not found.`,
|
|
600
|
+
},
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* List lead sources
|
|
605
|
+
* Returns a paginated list of LeadSources in your Platform.
|
|
606
|
+
*
|
|
607
|
+
* **Required permission:** `Ibl.CRM/Pipelines/list`.
|
|
608
|
+
* @returns PaginatedLeadSourceList
|
|
609
|
+
* @throws ApiError
|
|
610
|
+
*/
|
|
611
|
+
public static crmLeadSourcesList({
|
|
612
|
+
code,
|
|
613
|
+
name,
|
|
614
|
+
page,
|
|
615
|
+
pageSize,
|
|
616
|
+
}: {
|
|
617
|
+
code?: string,
|
|
618
|
+
name?: string,
|
|
619
|
+
/**
|
|
620
|
+
* A page number within the paginated result set.
|
|
621
|
+
*/
|
|
622
|
+
page?: number,
|
|
623
|
+
/**
|
|
624
|
+
* Number of results to return per page.
|
|
625
|
+
*/
|
|
626
|
+
pageSize?: number,
|
|
627
|
+
}): CancelablePromise<PaginatedLeadSourceList> {
|
|
628
|
+
return __request(OpenAPI, {
|
|
629
|
+
method: 'GET',
|
|
630
|
+
url: '/api/crm/lead-sources/',
|
|
631
|
+
query: {
|
|
632
|
+
'code': code,
|
|
633
|
+
'name': name,
|
|
634
|
+
'page': page,
|
|
635
|
+
'page_size': pageSize,
|
|
636
|
+
},
|
|
637
|
+
errors: {
|
|
638
|
+
401: `Authentication required.`,
|
|
639
|
+
403: `Missing required permission \`Ibl.CRM/Pipelines/list\`.`,
|
|
640
|
+
},
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* Create a lead source
|
|
645
|
+
* Creates a new LeadSource in your Platform. `code` must be unique.
|
|
646
|
+
*
|
|
647
|
+
* **Required permission:** `Ibl.CRM/Pipelines/write`.
|
|
648
|
+
* @returns LeadSource
|
|
649
|
+
* @throws ApiError
|
|
650
|
+
*/
|
|
651
|
+
public static crmLeadSourcesCreate({
|
|
652
|
+
requestBody,
|
|
653
|
+
}: {
|
|
654
|
+
requestBody: LeadSource,
|
|
655
|
+
}): CancelablePromise<LeadSource> {
|
|
656
|
+
return __request(OpenAPI, {
|
|
657
|
+
method: 'POST',
|
|
658
|
+
url: '/api/crm/lead-sources/',
|
|
659
|
+
body: requestBody,
|
|
660
|
+
mediaType: 'application/json',
|
|
661
|
+
errors: {
|
|
662
|
+
400: `Validation error.`,
|
|
663
|
+
403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
|
|
664
|
+
},
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* Retrieve a lead source
|
|
669
|
+
* Returns a single LeadSource by id.
|
|
670
|
+
*
|
|
671
|
+
* **Required permission:** `Ibl.CRM/Pipelines/read`.
|
|
672
|
+
* @returns LeadSource
|
|
673
|
+
* @throws ApiError
|
|
674
|
+
*/
|
|
675
|
+
public static crmLeadSourcesRetrieve({
|
|
676
|
+
id,
|
|
677
|
+
}: {
|
|
678
|
+
/**
|
|
679
|
+
* A unique integer value identifying this lead source.
|
|
680
|
+
*/
|
|
681
|
+
id: number,
|
|
682
|
+
}): CancelablePromise<LeadSource> {
|
|
683
|
+
return __request(OpenAPI, {
|
|
684
|
+
method: 'GET',
|
|
685
|
+
url: '/api/crm/lead-sources/{id}/',
|
|
686
|
+
path: {
|
|
687
|
+
'id': id,
|
|
688
|
+
},
|
|
689
|
+
errors: {
|
|
690
|
+
403: `Missing required permission \`Ibl.CRM/Pipelines/read\`.`,
|
|
691
|
+
404: `LeadSource not found.`,
|
|
692
|
+
},
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
/**
|
|
696
|
+
* Replace a lead source
|
|
697
|
+
* Replaces all editable fields on the LeadSource.
|
|
698
|
+
*
|
|
699
|
+
* **Required permission:** `Ibl.CRM/Pipelines/write`.
|
|
700
|
+
* @returns LeadSource
|
|
701
|
+
* @throws ApiError
|
|
702
|
+
*/
|
|
703
|
+
public static crmLeadSourcesUpdate({
|
|
704
|
+
id,
|
|
705
|
+
requestBody,
|
|
706
|
+
}: {
|
|
707
|
+
/**
|
|
708
|
+
* A unique integer value identifying this lead source.
|
|
709
|
+
*/
|
|
710
|
+
id: number,
|
|
711
|
+
requestBody: LeadSource,
|
|
712
|
+
}): CancelablePromise<LeadSource> {
|
|
713
|
+
return __request(OpenAPI, {
|
|
714
|
+
method: 'PUT',
|
|
715
|
+
url: '/api/crm/lead-sources/{id}/',
|
|
716
|
+
path: {
|
|
717
|
+
'id': id,
|
|
718
|
+
},
|
|
719
|
+
body: requestBody,
|
|
720
|
+
mediaType: 'application/json',
|
|
721
|
+
errors: {
|
|
722
|
+
400: `Validation error.`,
|
|
723
|
+
403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
|
|
724
|
+
404: `LeadSource not found.`,
|
|
725
|
+
},
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
/**
|
|
729
|
+
* Update a lead source
|
|
730
|
+
* Updates only the supplied fields on the LeadSource.
|
|
731
|
+
*
|
|
732
|
+
* **Required permission:** `Ibl.CRM/Pipelines/write`.
|
|
733
|
+
* @returns LeadSource
|
|
734
|
+
* @throws ApiError
|
|
735
|
+
*/
|
|
736
|
+
public static crmLeadSourcesPartialUpdate({
|
|
737
|
+
id,
|
|
738
|
+
requestBody,
|
|
739
|
+
}: {
|
|
740
|
+
/**
|
|
741
|
+
* A unique integer value identifying this lead source.
|
|
742
|
+
*/
|
|
743
|
+
id: number,
|
|
744
|
+
requestBody?: PatchedLeadSource,
|
|
745
|
+
}): CancelablePromise<LeadSource> {
|
|
746
|
+
return __request(OpenAPI, {
|
|
747
|
+
method: 'PATCH',
|
|
748
|
+
url: '/api/crm/lead-sources/{id}/',
|
|
749
|
+
path: {
|
|
750
|
+
'id': id,
|
|
751
|
+
},
|
|
752
|
+
body: requestBody,
|
|
753
|
+
mediaType: 'application/json',
|
|
754
|
+
errors: {
|
|
755
|
+
400: `Validation error.`,
|
|
756
|
+
403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
|
|
757
|
+
404: `LeadSource not found.`,
|
|
758
|
+
},
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
/**
|
|
762
|
+
* Delete a lead source
|
|
763
|
+
* Deletes the LeadSource. Any Deals referencing it have their `source` cleared.
|
|
764
|
+
*
|
|
765
|
+
* **Required permission:** `Ibl.CRM/Pipelines/delete`.
|
|
766
|
+
* @returns void
|
|
767
|
+
* @throws ApiError
|
|
768
|
+
*/
|
|
769
|
+
public static crmLeadSourcesDestroy({
|
|
770
|
+
id,
|
|
771
|
+
}: {
|
|
772
|
+
/**
|
|
773
|
+
* A unique integer value identifying this lead source.
|
|
774
|
+
*/
|
|
775
|
+
id: number,
|
|
776
|
+
}): CancelablePromise<void> {
|
|
777
|
+
return __request(OpenAPI, {
|
|
778
|
+
method: 'DELETE',
|
|
779
|
+
url: '/api/crm/lead-sources/{id}/',
|
|
780
|
+
path: {
|
|
781
|
+
'id': id,
|
|
782
|
+
},
|
|
783
|
+
errors: {
|
|
784
|
+
403: `Missing required permission \`Ibl.CRM/Pipelines/delete\`.`,
|
|
785
|
+
404: `LeadSource not found.`,
|
|
786
|
+
},
|
|
787
|
+
});
|
|
788
|
+
}
|
|
20
789
|
/**
|
|
21
790
|
* List organizations
|
|
22
791
|
* Returns a paginated list of organizations in your Platform. Supports filtering by `owner` and by `name` (case-insensitive substring match).
|
|
@@ -212,7 +981,7 @@ export class CrmService {
|
|
|
212
981
|
createdAtGte?: string,
|
|
213
982
|
createdAtLte?: string,
|
|
214
983
|
/**
|
|
215
|
-
* Funnel position.
|
|
984
|
+
* Funnel position. Transitions are unrestricted — any stage may move to any other.
|
|
216
985
|
*
|
|
217
986
|
* * `lead` - Lead
|
|
218
987
|
* * `qualified` - Qualified
|
|
@@ -478,4 +1247,395 @@ export class CrmService {
|
|
|
478
1247
|
},
|
|
479
1248
|
});
|
|
480
1249
|
}
|
|
1250
|
+
/**
|
|
1251
|
+
* List pipelines
|
|
1252
|
+
* Returns a paginated list of Pipelines in your Platform. Each Pipeline includes its ordered `stages` inline.
|
|
1253
|
+
*
|
|
1254
|
+
* **Required permission:** `Ibl.CRM/Pipelines/list`.
|
|
1255
|
+
* @returns PaginatedPipelineList
|
|
1256
|
+
* @throws ApiError
|
|
1257
|
+
*/
|
|
1258
|
+
public static crmPipelinesList({
|
|
1259
|
+
code,
|
|
1260
|
+
isDefault,
|
|
1261
|
+
name,
|
|
1262
|
+
page,
|
|
1263
|
+
pageSize,
|
|
1264
|
+
}: {
|
|
1265
|
+
code?: string,
|
|
1266
|
+
isDefault?: boolean,
|
|
1267
|
+
name?: string,
|
|
1268
|
+
/**
|
|
1269
|
+
* A page number within the paginated result set.
|
|
1270
|
+
*/
|
|
1271
|
+
page?: number,
|
|
1272
|
+
/**
|
|
1273
|
+
* Number of results to return per page.
|
|
1274
|
+
*/
|
|
1275
|
+
pageSize?: number,
|
|
1276
|
+
}): CancelablePromise<PaginatedPipelineList> {
|
|
1277
|
+
return __request(OpenAPI, {
|
|
1278
|
+
method: 'GET',
|
|
1279
|
+
url: '/api/crm/pipelines/',
|
|
1280
|
+
query: {
|
|
1281
|
+
'code': code,
|
|
1282
|
+
'is_default': isDefault,
|
|
1283
|
+
'name': name,
|
|
1284
|
+
'page': page,
|
|
1285
|
+
'page_size': pageSize,
|
|
1286
|
+
},
|
|
1287
|
+
errors: {
|
|
1288
|
+
401: `Authentication required.`,
|
|
1289
|
+
403: `Missing required permission \`Ibl.CRM/Pipelines/list\`.`,
|
|
1290
|
+
},
|
|
1291
|
+
});
|
|
1292
|
+
}
|
|
1293
|
+
/**
|
|
1294
|
+
* Create a pipeline
|
|
1295
|
+
* Creates a new Pipeline. `code` must be unique within your Platform. Promoting another Pipeline to `is_default=true` while one already exists will fail — unset the existing default first.
|
|
1296
|
+
*
|
|
1297
|
+
* **Required permission:** `Ibl.CRM/Pipelines/write`.
|
|
1298
|
+
* @returns Pipeline
|
|
1299
|
+
* @throws ApiError
|
|
1300
|
+
*/
|
|
1301
|
+
public static crmPipelinesCreate({
|
|
1302
|
+
requestBody,
|
|
1303
|
+
}: {
|
|
1304
|
+
requestBody: Pipeline,
|
|
1305
|
+
}): CancelablePromise<Pipeline> {
|
|
1306
|
+
return __request(OpenAPI, {
|
|
1307
|
+
method: 'POST',
|
|
1308
|
+
url: '/api/crm/pipelines/',
|
|
1309
|
+
body: requestBody,
|
|
1310
|
+
mediaType: 'application/json',
|
|
1311
|
+
errors: {
|
|
1312
|
+
400: `Validation error.`,
|
|
1313
|
+
403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
|
|
1314
|
+
},
|
|
1315
|
+
});
|
|
1316
|
+
}
|
|
1317
|
+
/**
|
|
1318
|
+
* List stages for a pipeline
|
|
1319
|
+
* Returns the ordered list of PipelineStages for the given Pipeline.
|
|
1320
|
+
*
|
|
1321
|
+
* **Required permission:** `Ibl.CRM/Pipelines/list`.
|
|
1322
|
+
* @returns PaginatedPipelineStageList
|
|
1323
|
+
* @throws ApiError
|
|
1324
|
+
*/
|
|
1325
|
+
public static crmPipelinesStagesList({
|
|
1326
|
+
pipelinePk,
|
|
1327
|
+
code,
|
|
1328
|
+
isLost,
|
|
1329
|
+
isWon,
|
|
1330
|
+
page,
|
|
1331
|
+
pageSize,
|
|
1332
|
+
}: {
|
|
1333
|
+
pipelinePk: number,
|
|
1334
|
+
code?: string,
|
|
1335
|
+
isLost?: boolean,
|
|
1336
|
+
isWon?: boolean,
|
|
1337
|
+
/**
|
|
1338
|
+
* A page number within the paginated result set.
|
|
1339
|
+
*/
|
|
1340
|
+
page?: number,
|
|
1341
|
+
/**
|
|
1342
|
+
* Number of results to return per page.
|
|
1343
|
+
*/
|
|
1344
|
+
pageSize?: number,
|
|
1345
|
+
}): CancelablePromise<PaginatedPipelineStageList> {
|
|
1346
|
+
return __request(OpenAPI, {
|
|
1347
|
+
method: 'GET',
|
|
1348
|
+
url: '/api/crm/pipelines/{pipeline_pk}/stages/',
|
|
1349
|
+
path: {
|
|
1350
|
+
'pipeline_pk': pipelinePk,
|
|
1351
|
+
},
|
|
1352
|
+
query: {
|
|
1353
|
+
'code': code,
|
|
1354
|
+
'is_lost': isLost,
|
|
1355
|
+
'is_won': isWon,
|
|
1356
|
+
'page': page,
|
|
1357
|
+
'page_size': pageSize,
|
|
1358
|
+
},
|
|
1359
|
+
errors: {
|
|
1360
|
+
403: `Missing required permission \`Ibl.CRM/Pipelines/list\`.`,
|
|
1361
|
+
404: `Pipeline not found.`,
|
|
1362
|
+
},
|
|
1363
|
+
});
|
|
1364
|
+
}
|
|
1365
|
+
/**
|
|
1366
|
+
* Create a stage
|
|
1367
|
+
* Creates a new PipelineStage in the URL Pipeline. `code` must be unique within that Pipeline. At most one of `is_won` / `is_lost` may be true.
|
|
1368
|
+
*
|
|
1369
|
+
* **Required permission:** `Ibl.CRM/Pipelines/write`.
|
|
1370
|
+
* @returns PipelineStage
|
|
1371
|
+
* @throws ApiError
|
|
1372
|
+
*/
|
|
1373
|
+
public static crmPipelinesStagesCreate({
|
|
1374
|
+
pipelinePk,
|
|
1375
|
+
requestBody,
|
|
1376
|
+
}: {
|
|
1377
|
+
pipelinePk: number,
|
|
1378
|
+
requestBody: PipelineStage,
|
|
1379
|
+
}): CancelablePromise<PipelineStage> {
|
|
1380
|
+
return __request(OpenAPI, {
|
|
1381
|
+
method: 'POST',
|
|
1382
|
+
url: '/api/crm/pipelines/{pipeline_pk}/stages/',
|
|
1383
|
+
path: {
|
|
1384
|
+
'pipeline_pk': pipelinePk,
|
|
1385
|
+
},
|
|
1386
|
+
body: requestBody,
|
|
1387
|
+
mediaType: 'application/json',
|
|
1388
|
+
errors: {
|
|
1389
|
+
400: `Validation error.`,
|
|
1390
|
+
403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
|
|
1391
|
+
404: `Pipeline not found.`,
|
|
1392
|
+
},
|
|
1393
|
+
});
|
|
1394
|
+
}
|
|
1395
|
+
/**
|
|
1396
|
+
* Retrieve a stage
|
|
1397
|
+
* Returns a single PipelineStage by id (must belong to the URL Pipeline).
|
|
1398
|
+
*
|
|
1399
|
+
* **Required permission:** `Ibl.CRM/Pipelines/read`.
|
|
1400
|
+
* @returns PipelineStage
|
|
1401
|
+
* @throws ApiError
|
|
1402
|
+
*/
|
|
1403
|
+
public static crmPipelinesStagesRetrieve({
|
|
1404
|
+
id,
|
|
1405
|
+
pipelinePk,
|
|
1406
|
+
}: {
|
|
1407
|
+
id: number,
|
|
1408
|
+
pipelinePk: number,
|
|
1409
|
+
}): CancelablePromise<PipelineStage> {
|
|
1410
|
+
return __request(OpenAPI, {
|
|
1411
|
+
method: 'GET',
|
|
1412
|
+
url: '/api/crm/pipelines/{pipeline_pk}/stages/{id}/',
|
|
1413
|
+
path: {
|
|
1414
|
+
'id': id,
|
|
1415
|
+
'pipeline_pk': pipelinePk,
|
|
1416
|
+
},
|
|
1417
|
+
errors: {
|
|
1418
|
+
403: `Missing required permission \`Ibl.CRM/Pipelines/read\`.`,
|
|
1419
|
+
404: `Stage not found in this Pipeline.`,
|
|
1420
|
+
},
|
|
1421
|
+
});
|
|
1422
|
+
}
|
|
1423
|
+
/**
|
|
1424
|
+
* Replace a stage
|
|
1425
|
+
* Replaces all editable fields on the PipelineStage.
|
|
1426
|
+
*
|
|
1427
|
+
* **Required permission:** `Ibl.CRM/Pipelines/write`.
|
|
1428
|
+
* @returns PipelineStage
|
|
1429
|
+
* @throws ApiError
|
|
1430
|
+
*/
|
|
1431
|
+
public static crmPipelinesStagesUpdate({
|
|
1432
|
+
id,
|
|
1433
|
+
pipelinePk,
|
|
1434
|
+
requestBody,
|
|
1435
|
+
}: {
|
|
1436
|
+
id: number,
|
|
1437
|
+
pipelinePk: number,
|
|
1438
|
+
requestBody: PipelineStage,
|
|
1439
|
+
}): CancelablePromise<PipelineStage> {
|
|
1440
|
+
return __request(OpenAPI, {
|
|
1441
|
+
method: 'PUT',
|
|
1442
|
+
url: '/api/crm/pipelines/{pipeline_pk}/stages/{id}/',
|
|
1443
|
+
path: {
|
|
1444
|
+
'id': id,
|
|
1445
|
+
'pipeline_pk': pipelinePk,
|
|
1446
|
+
},
|
|
1447
|
+
body: requestBody,
|
|
1448
|
+
mediaType: 'application/json',
|
|
1449
|
+
errors: {
|
|
1450
|
+
400: `Validation error.`,
|
|
1451
|
+
403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
|
|
1452
|
+
404: `Stage not found in this Pipeline.`,
|
|
1453
|
+
},
|
|
1454
|
+
});
|
|
1455
|
+
}
|
|
1456
|
+
/**
|
|
1457
|
+
* Update a stage
|
|
1458
|
+
* Updates only the supplied fields on the PipelineStage.
|
|
1459
|
+
*
|
|
1460
|
+
* **Required permission:** `Ibl.CRM/Pipelines/write`.
|
|
1461
|
+
* @returns PipelineStage
|
|
1462
|
+
* @throws ApiError
|
|
1463
|
+
*/
|
|
1464
|
+
public static crmPipelinesStagesPartialUpdate({
|
|
1465
|
+
id,
|
|
1466
|
+
pipelinePk,
|
|
1467
|
+
requestBody,
|
|
1468
|
+
}: {
|
|
1469
|
+
id: number,
|
|
1470
|
+
pipelinePk: number,
|
|
1471
|
+
requestBody?: PatchedPipelineStage,
|
|
1472
|
+
}): CancelablePromise<PipelineStage> {
|
|
1473
|
+
return __request(OpenAPI, {
|
|
1474
|
+
method: 'PATCH',
|
|
1475
|
+
url: '/api/crm/pipelines/{pipeline_pk}/stages/{id}/',
|
|
1476
|
+
path: {
|
|
1477
|
+
'id': id,
|
|
1478
|
+
'pipeline_pk': pipelinePk,
|
|
1479
|
+
},
|
|
1480
|
+
body: requestBody,
|
|
1481
|
+
mediaType: 'application/json',
|
|
1482
|
+
errors: {
|
|
1483
|
+
400: `Validation error.`,
|
|
1484
|
+
403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
|
|
1485
|
+
404: `Stage not found in this Pipeline.`,
|
|
1486
|
+
},
|
|
1487
|
+
});
|
|
1488
|
+
}
|
|
1489
|
+
/**
|
|
1490
|
+
* Delete a stage
|
|
1491
|
+
* Deletes the PipelineStage. Fails with `409 Conflict` if any Deal still references it (FK is PROTECTed).
|
|
1492
|
+
*
|
|
1493
|
+
* **Required permission:** `Ibl.CRM/Pipelines/delete`.
|
|
1494
|
+
* @returns void
|
|
1495
|
+
* @throws ApiError
|
|
1496
|
+
*/
|
|
1497
|
+
public static crmPipelinesStagesDestroy({
|
|
1498
|
+
id,
|
|
1499
|
+
pipelinePk,
|
|
1500
|
+
}: {
|
|
1501
|
+
id: number,
|
|
1502
|
+
pipelinePk: number,
|
|
1503
|
+
}): CancelablePromise<void> {
|
|
1504
|
+
return __request(OpenAPI, {
|
|
1505
|
+
method: 'DELETE',
|
|
1506
|
+
url: '/api/crm/pipelines/{pipeline_pk}/stages/{id}/',
|
|
1507
|
+
path: {
|
|
1508
|
+
'id': id,
|
|
1509
|
+
'pipeline_pk': pipelinePk,
|
|
1510
|
+
},
|
|
1511
|
+
errors: {
|
|
1512
|
+
403: `Missing required permission \`Ibl.CRM/Pipelines/delete\`.`,
|
|
1513
|
+
404: `Stage not found in this Pipeline.`,
|
|
1514
|
+
409: `Stage still has Deals attached.`,
|
|
1515
|
+
},
|
|
1516
|
+
});
|
|
1517
|
+
}
|
|
1518
|
+
/**
|
|
1519
|
+
* Retrieve a pipeline
|
|
1520
|
+
* Returns a single Pipeline by id, including its ordered `stages`.
|
|
1521
|
+
*
|
|
1522
|
+
* **Required permission:** `Ibl.CRM/Pipelines/read`.
|
|
1523
|
+
* @returns Pipeline
|
|
1524
|
+
* @throws ApiError
|
|
1525
|
+
*/
|
|
1526
|
+
public static crmPipelinesRetrieve({
|
|
1527
|
+
id,
|
|
1528
|
+
}: {
|
|
1529
|
+
/**
|
|
1530
|
+
* A unique integer value identifying this pipeline.
|
|
1531
|
+
*/
|
|
1532
|
+
id: number,
|
|
1533
|
+
}): CancelablePromise<Pipeline> {
|
|
1534
|
+
return __request(OpenAPI, {
|
|
1535
|
+
method: 'GET',
|
|
1536
|
+
url: '/api/crm/pipelines/{id}/',
|
|
1537
|
+
path: {
|
|
1538
|
+
'id': id,
|
|
1539
|
+
},
|
|
1540
|
+
errors: {
|
|
1541
|
+
403: `Missing required permission \`Ibl.CRM/Pipelines/read\`.`,
|
|
1542
|
+
404: `Pipeline not found.`,
|
|
1543
|
+
},
|
|
1544
|
+
});
|
|
1545
|
+
}
|
|
1546
|
+
/**
|
|
1547
|
+
* Replace a pipeline
|
|
1548
|
+
* Replaces all editable fields on the Pipeline.
|
|
1549
|
+
*
|
|
1550
|
+
* **Required permission:** `Ibl.CRM/Pipelines/write`.
|
|
1551
|
+
* @returns Pipeline
|
|
1552
|
+
* @throws ApiError
|
|
1553
|
+
*/
|
|
1554
|
+
public static crmPipelinesUpdate({
|
|
1555
|
+
id,
|
|
1556
|
+
requestBody,
|
|
1557
|
+
}: {
|
|
1558
|
+
/**
|
|
1559
|
+
* A unique integer value identifying this pipeline.
|
|
1560
|
+
*/
|
|
1561
|
+
id: number,
|
|
1562
|
+
requestBody: Pipeline,
|
|
1563
|
+
}): CancelablePromise<Pipeline> {
|
|
1564
|
+
return __request(OpenAPI, {
|
|
1565
|
+
method: 'PUT',
|
|
1566
|
+
url: '/api/crm/pipelines/{id}/',
|
|
1567
|
+
path: {
|
|
1568
|
+
'id': id,
|
|
1569
|
+
},
|
|
1570
|
+
body: requestBody,
|
|
1571
|
+
mediaType: 'application/json',
|
|
1572
|
+
errors: {
|
|
1573
|
+
400: `Validation error.`,
|
|
1574
|
+
403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
|
|
1575
|
+
404: `Pipeline not found.`,
|
|
1576
|
+
},
|
|
1577
|
+
});
|
|
1578
|
+
}
|
|
1579
|
+
/**
|
|
1580
|
+
* Update a pipeline
|
|
1581
|
+
* Updates only the supplied fields on the Pipeline.
|
|
1582
|
+
*
|
|
1583
|
+
* **Required permission:** `Ibl.CRM/Pipelines/write`.
|
|
1584
|
+
* @returns Pipeline
|
|
1585
|
+
* @throws ApiError
|
|
1586
|
+
*/
|
|
1587
|
+
public static crmPipelinesPartialUpdate({
|
|
1588
|
+
id,
|
|
1589
|
+
requestBody,
|
|
1590
|
+
}: {
|
|
1591
|
+
/**
|
|
1592
|
+
* A unique integer value identifying this pipeline.
|
|
1593
|
+
*/
|
|
1594
|
+
id: number,
|
|
1595
|
+
requestBody?: PatchedPipeline,
|
|
1596
|
+
}): CancelablePromise<Pipeline> {
|
|
1597
|
+
return __request(OpenAPI, {
|
|
1598
|
+
method: 'PATCH',
|
|
1599
|
+
url: '/api/crm/pipelines/{id}/',
|
|
1600
|
+
path: {
|
|
1601
|
+
'id': id,
|
|
1602
|
+
},
|
|
1603
|
+
body: requestBody,
|
|
1604
|
+
mediaType: 'application/json',
|
|
1605
|
+
errors: {
|
|
1606
|
+
400: `Validation error.`,
|
|
1607
|
+
403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
|
|
1608
|
+
404: `Pipeline not found.`,
|
|
1609
|
+
},
|
|
1610
|
+
});
|
|
1611
|
+
}
|
|
1612
|
+
/**
|
|
1613
|
+
* Delete a pipeline
|
|
1614
|
+
* Deletes the Pipeline. Fails with `409 Conflict` if any Deal still references it (FK is PROTECTed).
|
|
1615
|
+
*
|
|
1616
|
+
* **Required permission:** `Ibl.CRM/Pipelines/delete`.
|
|
1617
|
+
* @returns void
|
|
1618
|
+
* @throws ApiError
|
|
1619
|
+
*/
|
|
1620
|
+
public static crmPipelinesDestroy({
|
|
1621
|
+
id,
|
|
1622
|
+
}: {
|
|
1623
|
+
/**
|
|
1624
|
+
* A unique integer value identifying this pipeline.
|
|
1625
|
+
*/
|
|
1626
|
+
id: number,
|
|
1627
|
+
}): CancelablePromise<void> {
|
|
1628
|
+
return __request(OpenAPI, {
|
|
1629
|
+
method: 'DELETE',
|
|
1630
|
+
url: '/api/crm/pipelines/{id}/',
|
|
1631
|
+
path: {
|
|
1632
|
+
'id': id,
|
|
1633
|
+
},
|
|
1634
|
+
errors: {
|
|
1635
|
+
403: `Missing required permission \`Ibl.CRM/Pipelines/delete\`.`,
|
|
1636
|
+
404: `Pipeline not found.`,
|
|
1637
|
+
409: `Pipeline still has Deals attached.`,
|
|
1638
|
+
},
|
|
1639
|
+
});
|
|
1640
|
+
}
|
|
481
1641
|
}
|