@iblai/iblai-api 4.415.0-core → 4.416.0-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 +648 -30
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +649 -31
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +648 -30
- package/dist/index.umd.js.map +1 -1
- package/dist/types/index.d.ts +27 -1
- package/dist/types/models/Activity.d.ts +6 -2
- package/dist/types/models/Deal.d.ts +14 -2
- package/dist/types/models/DealBoard.d.ts +7 -0
- package/dist/types/models/DealBoardStage.d.ts +19 -0
- package/dist/types/models/DirEnum.d.ts +8 -0
- package/dist/types/models/Favorite.d.ts +28 -0
- package/dist/types/models/HistoryEntry.d.ts +15 -0
- package/dist/types/models/HistoryEntryActionEnum.d.ts +12 -0
- package/dist/types/models/ObjectTypeEnum.d.ts +12 -0
- package/dist/types/models/Overview.d.ts +24 -0
- package/dist/types/models/OverviewActivities.d.ts +5 -0
- package/dist/types/models/OverviewCount.d.ts +3 -0
- package/dist/types/models/OverviewDeals.d.ts +22 -0
- package/dist/types/models/OverviewMonth.d.ts +10 -0
- package/dist/types/models/OverviewStage.d.ts +13 -0
- package/dist/types/models/PaginatedFavoriteList.d.ts +7 -0
- package/dist/types/models/PaginatedSavedViewList.d.ts +7 -0
- package/dist/types/models/PatchedActivity.d.ts +6 -2
- package/dist/types/models/PatchedDeal.d.ts +14 -2
- package/dist/types/models/PatchedPerson.d.ts +4 -0
- package/dist/types/models/PatchedPipeline.d.ts +1 -1
- package/dist/types/models/PatchedSavedView.d.ts +41 -0
- package/dist/types/models/Person.d.ts +4 -0
- package/dist/types/models/Pipeline.d.ts +1 -1
- package/dist/types/models/PipelineStageReorderRequest.d.ts +6 -0
- package/dist/types/models/SavedView.d.ts +41 -0
- package/dist/types/models/SavedViewTypeEnum.d.ts +8 -0
- package/dist/types/models/SearchDeal.d.ts +40 -0
- package/dist/types/models/SearchOrganization.d.ts +10 -0
- package/dist/types/models/SearchPerson.d.ts +33 -0
- package/dist/types/models/SearchResponse.d.ts +12 -0
- package/dist/types/models/{DealStatusEnum.d.ts → Status05cEnum.d.ts} +1 -1
- package/dist/types/models/_Column.d.ts +7 -0
- package/dist/types/models/_Filter.d.ts +8 -0
- package/dist/types/models/_Sort.d.ts +5 -0
- package/dist/types/services/CrmService.d.ts +523 -12
- package/package.json +1 -1
- package/sdk_schema.yml +1905 -27
- package/src/core/OpenAPI.ts +1 -1
- package/src/index.ts +27 -1
- package/src/models/Activity.ts +6 -2
- package/src/models/Deal.ts +14 -2
- package/src/models/DealBoard.ts +12 -0
- package/src/models/DealBoardStage.ts +24 -0
- package/src/models/DirEnum.ts +12 -0
- package/src/models/Favorite.ts +33 -0
- package/src/models/HistoryEntry.ts +20 -0
- package/src/models/HistoryEntryActionEnum.ts +16 -0
- package/src/models/ObjectTypeEnum.ts +16 -0
- package/src/models/Overview.ts +29 -0
- package/src/models/OverviewActivities.ts +10 -0
- package/src/models/OverviewCount.ts +8 -0
- package/src/models/OverviewDeals.ts +27 -0
- package/src/models/OverviewMonth.ts +15 -0
- package/src/models/OverviewStage.ts +18 -0
- package/src/models/PaginatedFavoriteList.ts +12 -0
- package/src/models/PaginatedSavedViewList.ts +12 -0
- package/src/models/PatchedActivity.ts +6 -2
- package/src/models/PatchedDeal.ts +14 -2
- package/src/models/PatchedPerson.ts +4 -0
- package/src/models/PatchedPipeline.ts +1 -1
- package/src/models/PatchedSavedView.ts +46 -0
- package/src/models/Person.ts +4 -0
- package/src/models/Pipeline.ts +1 -1
- package/src/models/PipelineStageReorderRequest.ts +11 -0
- package/src/models/SavedView.ts +46 -0
- package/src/models/SavedViewTypeEnum.ts +12 -0
- package/src/models/SearchDeal.ts +45 -0
- package/src/models/SearchOrganization.ts +15 -0
- package/src/models/SearchPerson.ts +38 -0
- package/src/models/SearchResponse.ts +17 -0
- package/src/models/{DealStatusEnum.ts → Status05cEnum.ts} +1 -1
- package/src/models/_Column.ts +12 -0
- package/src/models/_Filter.ts +13 -0
- package/src/models/_Sort.ts +10 -0
- package/src/services/CrmService.ts +924 -4
|
@@ -5,18 +5,24 @@
|
|
|
5
5
|
import type { _TagAttachRequest } from '../models/_TagAttachRequest';
|
|
6
6
|
import type { Activity } from '../models/Activity';
|
|
7
7
|
import type { Deal } from '../models/Deal';
|
|
8
|
+
import type { DealBoard } from '../models/DealBoard';
|
|
8
9
|
import type { DealLostRequest } from '../models/DealLostRequest';
|
|
9
10
|
import type { DealMoveStageRequest } from '../models/DealMoveStageRequest';
|
|
10
11
|
import type { DealWonRequest } from '../models/DealWonRequest';
|
|
12
|
+
import type { Favorite } from '../models/Favorite';
|
|
13
|
+
import type { HistoryEntry } from '../models/HistoryEntry';
|
|
11
14
|
import type { LeadSource } from '../models/LeadSource';
|
|
12
15
|
import type { Organization } from '../models/Organization';
|
|
16
|
+
import type { Overview } from '../models/Overview';
|
|
13
17
|
import type { PaginatedActivityList } from '../models/PaginatedActivityList';
|
|
14
18
|
import type { PaginatedDealList } from '../models/PaginatedDealList';
|
|
19
|
+
import type { PaginatedFavoriteList } from '../models/PaginatedFavoriteList';
|
|
15
20
|
import type { PaginatedLeadSourceList } from '../models/PaginatedLeadSourceList';
|
|
16
21
|
import type { PaginatedOrganizationList } from '../models/PaginatedOrganizationList';
|
|
17
22
|
import type { PaginatedPersonList } from '../models/PaginatedPersonList';
|
|
18
23
|
import type { PaginatedPipelineList } from '../models/PaginatedPipelineList';
|
|
19
24
|
import type { PaginatedPipelineStageList } from '../models/PaginatedPipelineStageList';
|
|
25
|
+
import type { PaginatedSavedViewList } from '../models/PaginatedSavedViewList';
|
|
20
26
|
import type { PaginatedTagList } from '../models/PaginatedTagList';
|
|
21
27
|
import type { PatchedActivity } from '../models/PatchedActivity';
|
|
22
28
|
import type { PatchedDeal } from '../models/PatchedDeal';
|
|
@@ -25,6 +31,7 @@ import type { PatchedOrganization } from '../models/PatchedOrganization';
|
|
|
25
31
|
import type { PatchedPerson } from '../models/PatchedPerson';
|
|
26
32
|
import type { PatchedPipeline } from '../models/PatchedPipeline';
|
|
27
33
|
import type { PatchedPipelineStage } from '../models/PatchedPipelineStage';
|
|
34
|
+
import type { PatchedSavedView } from '../models/PatchedSavedView';
|
|
28
35
|
import type { PatchedTag } from '../models/PatchedTag';
|
|
29
36
|
import type { Person } from '../models/Person';
|
|
30
37
|
import type { PersonInviteRequest } from '../models/PersonInviteRequest';
|
|
@@ -34,6 +41,9 @@ import type { PersonMergeRequest } from '../models/PersonMergeRequest';
|
|
|
34
41
|
import type { PersonMergeResponse } from '../models/PersonMergeResponse';
|
|
35
42
|
import type { Pipeline } from '../models/Pipeline';
|
|
36
43
|
import type { PipelineStage } from '../models/PipelineStage';
|
|
44
|
+
import type { PipelineStageReorderRequest } from '../models/PipelineStageReorderRequest';
|
|
45
|
+
import type { SavedView } from '../models/SavedView';
|
|
46
|
+
import type { SearchResponse } from '../models/SearchResponse';
|
|
37
47
|
import type { Tag } from '../models/Tag';
|
|
38
48
|
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
39
49
|
import { OpenAPI } from '../core/OpenAPI';
|
|
@@ -41,27 +51,46 @@ import { request as __request } from '../core/request';
|
|
|
41
51
|
export class CrmService {
|
|
42
52
|
/**
|
|
43
53
|
* List activities
|
|
44
|
-
* 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`.
|
|
54
|
+
* Returns a paginated list of Activities in your Platform. Supports filtering by `type`, `is_done`, `owner`, `deal`, `person`, `organization`, schedule-from ranges, and `metadata__has_key`.
|
|
45
55
|
*
|
|
46
56
|
* **Required permission:** `Ibl.CRM/Activities/list`.
|
|
47
57
|
* @returns PaginatedActivityList
|
|
48
58
|
* @throws ApiError
|
|
49
59
|
*/
|
|
50
60
|
public static crmActivitiesList({
|
|
61
|
+
dateFilter,
|
|
51
62
|
deal,
|
|
63
|
+
endDate,
|
|
52
64
|
isDone,
|
|
53
65
|
metadataHasKey,
|
|
66
|
+
ordering,
|
|
67
|
+
organization,
|
|
54
68
|
owner,
|
|
55
69
|
page,
|
|
56
70
|
pageSize,
|
|
57
71
|
person,
|
|
58
72
|
scheduleFromGte,
|
|
59
73
|
scheduleFromLte,
|
|
74
|
+
search,
|
|
75
|
+
startDate,
|
|
60
76
|
type,
|
|
61
77
|
}: {
|
|
78
|
+
/**
|
|
79
|
+
* Only rows created in this window. `custom` needs `start_date` and `end_date`.
|
|
80
|
+
*/
|
|
81
|
+
dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom',
|
|
62
82
|
deal?: number,
|
|
83
|
+
/**
|
|
84
|
+
* Last day of a custom window, inclusive (YYYY-MM-DD).
|
|
85
|
+
*/
|
|
86
|
+
endDate?: string,
|
|
63
87
|
isDone?: boolean,
|
|
64
88
|
metadataHasKey?: string,
|
|
89
|
+
/**
|
|
90
|
+
* Which field to use when ordering the results.
|
|
91
|
+
*/
|
|
92
|
+
ordering?: string,
|
|
93
|
+
organization?: string,
|
|
65
94
|
owner?: number,
|
|
66
95
|
/**
|
|
67
96
|
* A page number within the paginated result set.
|
|
@@ -74,6 +103,14 @@ export class CrmService {
|
|
|
74
103
|
person?: string,
|
|
75
104
|
scheduleFromGte?: string,
|
|
76
105
|
scheduleFromLte?: string,
|
|
106
|
+
/**
|
|
107
|
+
* A search term.
|
|
108
|
+
*/
|
|
109
|
+
search?: string,
|
|
110
|
+
/**
|
|
111
|
+
* First day of a custom window (YYYY-MM-DD).
|
|
112
|
+
*/
|
|
113
|
+
startDate?: string,
|
|
77
114
|
/**
|
|
78
115
|
* Interaction kind.
|
|
79
116
|
*
|
|
@@ -91,15 +128,21 @@ export class CrmService {
|
|
|
91
128
|
method: 'GET',
|
|
92
129
|
url: '/api/crm/activities/',
|
|
93
130
|
query: {
|
|
131
|
+
'date_filter': dateFilter,
|
|
94
132
|
'deal': deal,
|
|
133
|
+
'end_date': endDate,
|
|
95
134
|
'is_done': isDone,
|
|
96
135
|
'metadata__has_key': metadataHasKey,
|
|
136
|
+
'ordering': ordering,
|
|
137
|
+
'organization': organization,
|
|
97
138
|
'owner': owner,
|
|
98
139
|
'page': page,
|
|
99
140
|
'page_size': pageSize,
|
|
100
141
|
'person': person,
|
|
101
142
|
'schedule_from__gte': scheduleFromGte,
|
|
102
143
|
'schedule_from__lte': scheduleFromLte,
|
|
144
|
+
'search': search,
|
|
145
|
+
'start_date': startDate,
|
|
103
146
|
'type': type,
|
|
104
147
|
},
|
|
105
148
|
errors: {
|
|
@@ -110,7 +153,7 @@ export class CrmService {
|
|
|
110
153
|
}
|
|
111
154
|
/**
|
|
112
155
|
* Create an activity
|
|
113
|
-
* Creates an Activity.
|
|
156
|
+
* Creates an Activity. At least one of `deal`, `person` or `organization` must be supplied; all must belong to your Platform.
|
|
114
157
|
*
|
|
115
158
|
* **Required permission:** `Ibl.CRM/Activities/action`.
|
|
116
159
|
* @returns Activity
|
|
@@ -293,25 +336,42 @@ export class CrmService {
|
|
|
293
336
|
public static crmDealsList({
|
|
294
337
|
createdAtGte,
|
|
295
338
|
createdAtLte,
|
|
339
|
+
dateFilter,
|
|
340
|
+
endDate,
|
|
296
341
|
expectedCloseDateGte,
|
|
297
342
|
expectedCloseDateLte,
|
|
298
343
|
metadataHasKey,
|
|
344
|
+
ordering,
|
|
299
345
|
organization,
|
|
300
346
|
owner,
|
|
301
347
|
page,
|
|
302
348
|
pageSize,
|
|
303
349
|
person,
|
|
304
350
|
pipeline,
|
|
351
|
+
search,
|
|
305
352
|
source,
|
|
306
353
|
stage,
|
|
354
|
+
startDate,
|
|
307
355
|
status,
|
|
308
356
|
tags,
|
|
309
357
|
}: {
|
|
310
358
|
createdAtGte?: string,
|
|
311
359
|
createdAtLte?: string,
|
|
360
|
+
/**
|
|
361
|
+
* Only rows created in this window. `custom` needs `start_date` and `end_date`.
|
|
362
|
+
*/
|
|
363
|
+
dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom',
|
|
364
|
+
/**
|
|
365
|
+
* Last day of a custom window, inclusive (YYYY-MM-DD).
|
|
366
|
+
*/
|
|
367
|
+
endDate?: string,
|
|
312
368
|
expectedCloseDateGte?: string,
|
|
313
369
|
expectedCloseDateLte?: string,
|
|
314
370
|
metadataHasKey?: string,
|
|
371
|
+
/**
|
|
372
|
+
* Which field to use when ordering the results.
|
|
373
|
+
*/
|
|
374
|
+
ordering?: string,
|
|
315
375
|
organization?: string,
|
|
316
376
|
owner?: number,
|
|
317
377
|
/**
|
|
@@ -324,8 +384,16 @@ export class CrmService {
|
|
|
324
384
|
pageSize?: number,
|
|
325
385
|
person?: string,
|
|
326
386
|
pipeline?: number,
|
|
387
|
+
/**
|
|
388
|
+
* A search term.
|
|
389
|
+
*/
|
|
390
|
+
search?: string,
|
|
327
391
|
source?: number,
|
|
328
392
|
stage?: number,
|
|
393
|
+
/**
|
|
394
|
+
* First day of a custom window (YYYY-MM-DD).
|
|
395
|
+
*/
|
|
396
|
+
startDate?: string,
|
|
329
397
|
/**
|
|
330
398
|
* Service-managed (read-only in serializer). Derived from the destination stage's is_won/is_lost.
|
|
331
399
|
*
|
|
@@ -342,17 +410,22 @@ export class CrmService {
|
|
|
342
410
|
query: {
|
|
343
411
|
'created_at__gte': createdAtGte,
|
|
344
412
|
'created_at__lte': createdAtLte,
|
|
413
|
+
'date_filter': dateFilter,
|
|
414
|
+
'end_date': endDate,
|
|
345
415
|
'expected_close_date__gte': expectedCloseDateGte,
|
|
346
416
|
'expected_close_date__lte': expectedCloseDateLte,
|
|
347
417
|
'metadata__has_key': metadataHasKey,
|
|
418
|
+
'ordering': ordering,
|
|
348
419
|
'organization': organization,
|
|
349
420
|
'owner': owner,
|
|
350
421
|
'page': page,
|
|
351
422
|
'page_size': pageSize,
|
|
352
423
|
'person': person,
|
|
353
424
|
'pipeline': pipeline,
|
|
425
|
+
'search': search,
|
|
354
426
|
'source': source,
|
|
355
427
|
'stage': stage,
|
|
428
|
+
'start_date': startDate,
|
|
356
429
|
'status': status,
|
|
357
430
|
'tags': tags,
|
|
358
431
|
},
|
|
@@ -508,6 +581,34 @@ export class CrmService {
|
|
|
508
581
|
},
|
|
509
582
|
});
|
|
510
583
|
}
|
|
584
|
+
/**
|
|
585
|
+
* Field-change history for this record
|
|
586
|
+
* The record's audit entries (create and field updates), newest first, up to 200, each with `changes: {field: [old, new]}` as strings (a null reads `"None"`). The actor is the platform user who made the change. Bulk writes (a person merge, links a delete clears) leave no entry.
|
|
587
|
+
*
|
|
588
|
+
* **Required permission:** the record's `read` verb.
|
|
589
|
+
* @returns HistoryEntry
|
|
590
|
+
* @throws ApiError
|
|
591
|
+
*/
|
|
592
|
+
public static crmDealsHistoryList({
|
|
593
|
+
id,
|
|
594
|
+
}: {
|
|
595
|
+
/**
|
|
596
|
+
* A unique integer value identifying this deal.
|
|
597
|
+
*/
|
|
598
|
+
id: number,
|
|
599
|
+
}): CancelablePromise<Array<HistoryEntry>> {
|
|
600
|
+
return __request(OpenAPI, {
|
|
601
|
+
method: 'GET',
|
|
602
|
+
url: '/api/crm/deals/{id}/history/',
|
|
603
|
+
path: {
|
|
604
|
+
'id': id,
|
|
605
|
+
},
|
|
606
|
+
errors: {
|
|
607
|
+
403: `Missing the record's \`read\` permission.`,
|
|
608
|
+
404: `Record not found.`,
|
|
609
|
+
},
|
|
610
|
+
});
|
|
611
|
+
}
|
|
511
612
|
/**
|
|
512
613
|
* Mark a deal as lost
|
|
513
614
|
* 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.
|
|
@@ -672,6 +773,253 @@ export class CrmService {
|
|
|
672
773
|
},
|
|
673
774
|
});
|
|
674
775
|
}
|
|
776
|
+
/**
|
|
777
|
+
* Deals grouped by stage (the board)
|
|
778
|
+
* Every deal of one pipeline grouped by stage, in `sort_order`, with per-stage count, value and probability-weighted value. Each stage carries its newest `limit` deals; `has_more` says the stage holds more. The list filters (`owner`, `source`, `tags`, `search`, `status`, …) apply; `stage` is the grouping and `ordering` is ignored.
|
|
779
|
+
*
|
|
780
|
+
* **Required permission:** `Ibl.CRM/Deals/list`.
|
|
781
|
+
* @returns DealBoard
|
|
782
|
+
* @throws ApiError
|
|
783
|
+
*/
|
|
784
|
+
public static crmDealsBoardRetrieve({
|
|
785
|
+
createdAtGte,
|
|
786
|
+
createdAtLte,
|
|
787
|
+
dateFilter,
|
|
788
|
+
endDate,
|
|
789
|
+
expectedCloseDateGte,
|
|
790
|
+
expectedCloseDateLte,
|
|
791
|
+
limit,
|
|
792
|
+
metadataHasKey,
|
|
793
|
+
organization,
|
|
794
|
+
owner,
|
|
795
|
+
person,
|
|
796
|
+
pipeline,
|
|
797
|
+
search,
|
|
798
|
+
source,
|
|
799
|
+
stage,
|
|
800
|
+
startDate,
|
|
801
|
+
status,
|
|
802
|
+
tags,
|
|
803
|
+
}: {
|
|
804
|
+
createdAtGte?: string,
|
|
805
|
+
createdAtLte?: string,
|
|
806
|
+
/**
|
|
807
|
+
* Only rows created in this window. `custom` needs `start_date` and `end_date`.
|
|
808
|
+
*/
|
|
809
|
+
dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom',
|
|
810
|
+
/**
|
|
811
|
+
* Last day of a custom window, inclusive (YYYY-MM-DD).
|
|
812
|
+
*/
|
|
813
|
+
endDate?: string,
|
|
814
|
+
expectedCloseDateGte?: string,
|
|
815
|
+
expectedCloseDateLte?: string,
|
|
816
|
+
/**
|
|
817
|
+
* Deals per stage, 1–200 (default 100).
|
|
818
|
+
*/
|
|
819
|
+
limit?: number,
|
|
820
|
+
metadataHasKey?: string,
|
|
821
|
+
organization?: string,
|
|
822
|
+
owner?: number,
|
|
823
|
+
person?: string,
|
|
824
|
+
/**
|
|
825
|
+
* Pipeline id (default: the default pipeline).
|
|
826
|
+
*/
|
|
827
|
+
pipeline?: number,
|
|
828
|
+
/**
|
|
829
|
+
* A search term.
|
|
830
|
+
*/
|
|
831
|
+
search?: string,
|
|
832
|
+
source?: number,
|
|
833
|
+
stage?: number,
|
|
834
|
+
/**
|
|
835
|
+
* First day of a custom window (YYYY-MM-DD).
|
|
836
|
+
*/
|
|
837
|
+
startDate?: string,
|
|
838
|
+
/**
|
|
839
|
+
* Service-managed (read-only in serializer). Derived from the destination stage's is_won/is_lost.
|
|
840
|
+
*
|
|
841
|
+
* * `open` - Open
|
|
842
|
+
* * `won` - Won
|
|
843
|
+
* * `lost` - Lost
|
|
844
|
+
*/
|
|
845
|
+
status?: 'lost' | 'open' | 'won',
|
|
846
|
+
tags?: string,
|
|
847
|
+
}): CancelablePromise<DealBoard> {
|
|
848
|
+
return __request(OpenAPI, {
|
|
849
|
+
method: 'GET',
|
|
850
|
+
url: '/api/crm/deals/board/',
|
|
851
|
+
query: {
|
|
852
|
+
'created_at__gte': createdAtGte,
|
|
853
|
+
'created_at__lte': createdAtLte,
|
|
854
|
+
'date_filter': dateFilter,
|
|
855
|
+
'end_date': endDate,
|
|
856
|
+
'expected_close_date__gte': expectedCloseDateGte,
|
|
857
|
+
'expected_close_date__lte': expectedCloseDateLte,
|
|
858
|
+
'limit': limit,
|
|
859
|
+
'metadata__has_key': metadataHasKey,
|
|
860
|
+
'organization': organization,
|
|
861
|
+
'owner': owner,
|
|
862
|
+
'person': person,
|
|
863
|
+
'pipeline': pipeline,
|
|
864
|
+
'search': search,
|
|
865
|
+
'source': source,
|
|
866
|
+
'stage': stage,
|
|
867
|
+
'start_date': startDate,
|
|
868
|
+
'status': status,
|
|
869
|
+
'tags': tags,
|
|
870
|
+
},
|
|
871
|
+
errors: {
|
|
872
|
+
400: `Bad \`pipeline\` or \`limit\`.`,
|
|
873
|
+
403: `Missing required permission \`Ibl.CRM/Deals/list\`.`,
|
|
874
|
+
404: `Pipeline not found.`,
|
|
875
|
+
},
|
|
876
|
+
});
|
|
877
|
+
}
|
|
878
|
+
/**
|
|
879
|
+
* List my favorites
|
|
880
|
+
* Your starred persons, organizations and deals in this Platform, newest first.
|
|
881
|
+
*
|
|
882
|
+
* **Required permission:** `Ibl.CRM/Favorites/list`.
|
|
883
|
+
* @returns PaginatedFavoriteList
|
|
884
|
+
* @throws ApiError
|
|
885
|
+
*/
|
|
886
|
+
public static crmFavoritesList({
|
|
887
|
+
dateFilter,
|
|
888
|
+
deal,
|
|
889
|
+
endDate,
|
|
890
|
+
ordering,
|
|
891
|
+
organization,
|
|
892
|
+
page,
|
|
893
|
+
pageSize,
|
|
894
|
+
person,
|
|
895
|
+
startDate,
|
|
896
|
+
}: {
|
|
897
|
+
/**
|
|
898
|
+
* Only rows created in this window. `custom` needs `start_date` and `end_date`.
|
|
899
|
+
*/
|
|
900
|
+
dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom',
|
|
901
|
+
deal?: number,
|
|
902
|
+
/**
|
|
903
|
+
* Last day of a custom window, inclusive (YYYY-MM-DD).
|
|
904
|
+
*/
|
|
905
|
+
endDate?: string,
|
|
906
|
+
/**
|
|
907
|
+
* Which field to use when ordering the results.
|
|
908
|
+
*/
|
|
909
|
+
ordering?: string,
|
|
910
|
+
organization?: string,
|
|
911
|
+
/**
|
|
912
|
+
* A page number within the paginated result set.
|
|
913
|
+
*/
|
|
914
|
+
page?: number,
|
|
915
|
+
/**
|
|
916
|
+
* Number of results to return per page.
|
|
917
|
+
*/
|
|
918
|
+
pageSize?: number,
|
|
919
|
+
person?: string,
|
|
920
|
+
/**
|
|
921
|
+
* First day of a custom window (YYYY-MM-DD).
|
|
922
|
+
*/
|
|
923
|
+
startDate?: string,
|
|
924
|
+
}): CancelablePromise<PaginatedFavoriteList> {
|
|
925
|
+
return __request(OpenAPI, {
|
|
926
|
+
method: 'GET',
|
|
927
|
+
url: '/api/crm/favorites/',
|
|
928
|
+
query: {
|
|
929
|
+
'date_filter': dateFilter,
|
|
930
|
+
'deal': deal,
|
|
931
|
+
'end_date': endDate,
|
|
932
|
+
'ordering': ordering,
|
|
933
|
+
'organization': organization,
|
|
934
|
+
'page': page,
|
|
935
|
+
'page_size': pageSize,
|
|
936
|
+
'person': person,
|
|
937
|
+
'start_date': startDate,
|
|
938
|
+
},
|
|
939
|
+
errors: {
|
|
940
|
+
401: `Authentication required.`,
|
|
941
|
+
403: `Missing required permission \`Ibl.CRM/Favorites/list\`.`,
|
|
942
|
+
},
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
/**
|
|
946
|
+
* Star a record
|
|
947
|
+
* Stars exactly one of `person`, `organization`, `deal`. Starring a record you already starred returns the existing favorite with `200`. You also need the target's `read` permission.
|
|
948
|
+
*
|
|
949
|
+
* **Required permission:** `Ibl.CRM/Favorites/action`.
|
|
950
|
+
* @returns Favorite
|
|
951
|
+
* @throws ApiError
|
|
952
|
+
*/
|
|
953
|
+
public static crmFavoritesCreate({
|
|
954
|
+
requestBody,
|
|
955
|
+
}: {
|
|
956
|
+
requestBody?: Favorite,
|
|
957
|
+
}): CancelablePromise<Favorite> {
|
|
958
|
+
return __request(OpenAPI, {
|
|
959
|
+
method: 'POST',
|
|
960
|
+
url: '/api/crm/favorites/',
|
|
961
|
+
body: requestBody,
|
|
962
|
+
mediaType: 'application/json',
|
|
963
|
+
errors: {
|
|
964
|
+
400: `Not exactly one target.`,
|
|
965
|
+
403: `Missing \`Ibl.CRM/Favorites/action\` or the target's \`read\`.`,
|
|
966
|
+
},
|
|
967
|
+
});
|
|
968
|
+
}
|
|
969
|
+
/**
|
|
970
|
+
* One of your favorites
|
|
971
|
+
* **Required permission:** `Ibl.CRM/Favorites/read`.
|
|
972
|
+
* @returns Favorite
|
|
973
|
+
* @throws ApiError
|
|
974
|
+
*/
|
|
975
|
+
public static crmFavoritesRetrieve({
|
|
976
|
+
id,
|
|
977
|
+
}: {
|
|
978
|
+
/**
|
|
979
|
+
* A unique integer value identifying this favorite.
|
|
980
|
+
*/
|
|
981
|
+
id: number,
|
|
982
|
+
}): CancelablePromise<Favorite> {
|
|
983
|
+
return __request(OpenAPI, {
|
|
984
|
+
method: 'GET',
|
|
985
|
+
url: '/api/crm/favorites/{id}/',
|
|
986
|
+
path: {
|
|
987
|
+
'id': id,
|
|
988
|
+
},
|
|
989
|
+
errors: {
|
|
990
|
+
403: `Missing required permission \`Ibl.CRM/Favorites/read\`.`,
|
|
991
|
+
404: `Favorite not found.`,
|
|
992
|
+
},
|
|
993
|
+
});
|
|
994
|
+
}
|
|
995
|
+
/**
|
|
996
|
+
* Unstar a record
|
|
997
|
+
* Removes one of your favorites.
|
|
998
|
+
*
|
|
999
|
+
* **Required permission:** `Ibl.CRM/Favorites/delete`.
|
|
1000
|
+
* @returns void
|
|
1001
|
+
* @throws ApiError
|
|
1002
|
+
*/
|
|
1003
|
+
public static crmFavoritesDestroy({
|
|
1004
|
+
id,
|
|
1005
|
+
}: {
|
|
1006
|
+
/**
|
|
1007
|
+
* A unique integer value identifying this favorite.
|
|
1008
|
+
*/
|
|
1009
|
+
id: number,
|
|
1010
|
+
}): CancelablePromise<void> {
|
|
1011
|
+
return __request(OpenAPI, {
|
|
1012
|
+
method: 'DELETE',
|
|
1013
|
+
url: '/api/crm/favorites/{id}/',
|
|
1014
|
+
path: {
|
|
1015
|
+
'id': id,
|
|
1016
|
+
},
|
|
1017
|
+
errors: {
|
|
1018
|
+
403: `Missing required permission \`Ibl.CRM/Favorites/delete\`.`,
|
|
1019
|
+
404: `Favorite not found.`,
|
|
1020
|
+
},
|
|
1021
|
+
});
|
|
1022
|
+
}
|
|
675
1023
|
/**
|
|
676
1024
|
* List lead sources
|
|
677
1025
|
* Returns a paginated list of LeadSources in your Platform.
|
|
@@ -682,12 +1030,29 @@ export class CrmService {
|
|
|
682
1030
|
*/
|
|
683
1031
|
public static crmLeadSourcesList({
|
|
684
1032
|
code,
|
|
1033
|
+
dateFilter,
|
|
1034
|
+
endDate,
|
|
685
1035
|
name,
|
|
1036
|
+
ordering,
|
|
686
1037
|
page,
|
|
687
1038
|
pageSize,
|
|
1039
|
+
search,
|
|
1040
|
+
startDate,
|
|
688
1041
|
}: {
|
|
689
1042
|
code?: string,
|
|
1043
|
+
/**
|
|
1044
|
+
* Only rows created in this window. `custom` needs `start_date` and `end_date`.
|
|
1045
|
+
*/
|
|
1046
|
+
dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom',
|
|
1047
|
+
/**
|
|
1048
|
+
* Last day of a custom window, inclusive (YYYY-MM-DD).
|
|
1049
|
+
*/
|
|
1050
|
+
endDate?: string,
|
|
690
1051
|
name?: string,
|
|
1052
|
+
/**
|
|
1053
|
+
* Which field to use when ordering the results.
|
|
1054
|
+
*/
|
|
1055
|
+
ordering?: string,
|
|
691
1056
|
/**
|
|
692
1057
|
* A page number within the paginated result set.
|
|
693
1058
|
*/
|
|
@@ -696,15 +1061,28 @@ export class CrmService {
|
|
|
696
1061
|
* Number of results to return per page.
|
|
697
1062
|
*/
|
|
698
1063
|
pageSize?: number,
|
|
1064
|
+
/**
|
|
1065
|
+
* A search term.
|
|
1066
|
+
*/
|
|
1067
|
+
search?: string,
|
|
1068
|
+
/**
|
|
1069
|
+
* First day of a custom window (YYYY-MM-DD).
|
|
1070
|
+
*/
|
|
1071
|
+
startDate?: string,
|
|
699
1072
|
}): CancelablePromise<PaginatedLeadSourceList> {
|
|
700
1073
|
return __request(OpenAPI, {
|
|
701
1074
|
method: 'GET',
|
|
702
1075
|
url: '/api/crm/lead-sources/',
|
|
703
1076
|
query: {
|
|
704
1077
|
'code': code,
|
|
1078
|
+
'date_filter': dateFilter,
|
|
1079
|
+
'end_date': endDate,
|
|
705
1080
|
'name': name,
|
|
1081
|
+
'ordering': ordering,
|
|
706
1082
|
'page': page,
|
|
707
1083
|
'page_size': pageSize,
|
|
1084
|
+
'search': search,
|
|
1085
|
+
'start_date': startDate,
|
|
708
1086
|
},
|
|
709
1087
|
errors: {
|
|
710
1088
|
401: `Authentication required.`,
|
|
@@ -867,13 +1245,30 @@ export class CrmService {
|
|
|
867
1245
|
* @throws ApiError
|
|
868
1246
|
*/
|
|
869
1247
|
public static crmOrganizationsList({
|
|
1248
|
+
dateFilter,
|
|
1249
|
+
endDate,
|
|
870
1250
|
name,
|
|
1251
|
+
ordering,
|
|
871
1252
|
owner,
|
|
872
1253
|
page,
|
|
873
1254
|
pageSize,
|
|
1255
|
+
search,
|
|
1256
|
+
startDate,
|
|
874
1257
|
tags,
|
|
875
1258
|
}: {
|
|
1259
|
+
/**
|
|
1260
|
+
* Only rows created in this window. `custom` needs `start_date` and `end_date`.
|
|
1261
|
+
*/
|
|
1262
|
+
dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom',
|
|
1263
|
+
/**
|
|
1264
|
+
* Last day of a custom window, inclusive (YYYY-MM-DD).
|
|
1265
|
+
*/
|
|
1266
|
+
endDate?: string,
|
|
876
1267
|
name?: string,
|
|
1268
|
+
/**
|
|
1269
|
+
* Which field to use when ordering the results.
|
|
1270
|
+
*/
|
|
1271
|
+
ordering?: string,
|
|
877
1272
|
owner?: number,
|
|
878
1273
|
/**
|
|
879
1274
|
* A page number within the paginated result set.
|
|
@@ -883,16 +1278,29 @@ export class CrmService {
|
|
|
883
1278
|
* Number of results to return per page.
|
|
884
1279
|
*/
|
|
885
1280
|
pageSize?: number,
|
|
1281
|
+
/**
|
|
1282
|
+
* A search term.
|
|
1283
|
+
*/
|
|
1284
|
+
search?: string,
|
|
1285
|
+
/**
|
|
1286
|
+
* First day of a custom window (YYYY-MM-DD).
|
|
1287
|
+
*/
|
|
1288
|
+
startDate?: string,
|
|
886
1289
|
tags?: string,
|
|
887
1290
|
}): CancelablePromise<PaginatedOrganizationList> {
|
|
888
1291
|
return __request(OpenAPI, {
|
|
889
1292
|
method: 'GET',
|
|
890
1293
|
url: '/api/crm/organizations/',
|
|
891
1294
|
query: {
|
|
1295
|
+
'date_filter': dateFilter,
|
|
1296
|
+
'end_date': endDate,
|
|
892
1297
|
'name': name,
|
|
1298
|
+
'ordering': ordering,
|
|
893
1299
|
'owner': owner,
|
|
894
1300
|
'page': page,
|
|
895
1301
|
'page_size': pageSize,
|
|
1302
|
+
'search': search,
|
|
1303
|
+
'start_date': startDate,
|
|
896
1304
|
'tags': tags,
|
|
897
1305
|
},
|
|
898
1306
|
errors: {
|
|
@@ -1012,7 +1420,7 @@ export class CrmService {
|
|
|
1012
1420
|
}
|
|
1013
1421
|
/**
|
|
1014
1422
|
* Delete an organization
|
|
1015
|
-
* Deletes the organization.
|
|
1423
|
+
* Deletes the organization. Persons and deals linked to it are kept with the reference cleared; activities attached only to it are deleted, the rest just lose the link.
|
|
1016
1424
|
*
|
|
1017
1425
|
* **Required permission:** `Ibl.CRM/Organizations/delete`.
|
|
1018
1426
|
* @returns void
|
|
@@ -1035,6 +1443,31 @@ export class CrmService {
|
|
|
1035
1443
|
},
|
|
1036
1444
|
});
|
|
1037
1445
|
}
|
|
1446
|
+
/**
|
|
1447
|
+
* Field-change history for this record
|
|
1448
|
+
* The record's audit entries (create and field updates), newest first, up to 200, each with `changes: {field: [old, new]}` as strings (a null reads `"None"`). The actor is the platform user who made the change. Bulk writes (a person merge, links a delete clears) leave no entry.
|
|
1449
|
+
*
|
|
1450
|
+
* **Required permission:** the record's `read` verb.
|
|
1451
|
+
* @returns HistoryEntry
|
|
1452
|
+
* @throws ApiError
|
|
1453
|
+
*/
|
|
1454
|
+
public static crmOrganizationsHistoryList({
|
|
1455
|
+
id,
|
|
1456
|
+
}: {
|
|
1457
|
+
id: string,
|
|
1458
|
+
}): CancelablePromise<Array<HistoryEntry>> {
|
|
1459
|
+
return __request(OpenAPI, {
|
|
1460
|
+
method: 'GET',
|
|
1461
|
+
url: '/api/crm/organizations/{id}/history/',
|
|
1462
|
+
path: {
|
|
1463
|
+
'id': id,
|
|
1464
|
+
},
|
|
1465
|
+
errors: {
|
|
1466
|
+
403: `Missing the record's \`read\` permission.`,
|
|
1467
|
+
404: `Record not found.`,
|
|
1468
|
+
},
|
|
1469
|
+
});
|
|
1470
|
+
}
|
|
1038
1471
|
/**
|
|
1039
1472
|
* Attach a tag to this record
|
|
1040
1473
|
* Attaches an existing Tag to this record. Both the Tag and the record must belong to your Platform. Returns `409 Conflict` with the existing `assignment_id` if the tag is already attached.
|
|
@@ -1094,6 +1527,55 @@ export class CrmService {
|
|
|
1094
1527
|
},
|
|
1095
1528
|
});
|
|
1096
1529
|
}
|
|
1530
|
+
/**
|
|
1531
|
+
* CRM overview
|
|
1532
|
+
* Dashboard figures: person and organization counts, open-deal count and value (plain and probability-weighted), this month's won / lost deals, open deals per stage of one pipeline, six months of won / lost history, and activities due today or overdue. Sections you may not `list` are omitted.
|
|
1533
|
+
*
|
|
1534
|
+
* `date_filter` (or `start_date` + `end_date`) adds `period_*` siblings for that window.
|
|
1535
|
+
*
|
|
1536
|
+
* **Required permission:** the `list` verb of each section.
|
|
1537
|
+
* @returns Overview
|
|
1538
|
+
* @throws ApiError
|
|
1539
|
+
*/
|
|
1540
|
+
public static crmOverviewRetrieve({
|
|
1541
|
+
dateFilter,
|
|
1542
|
+
endDate,
|
|
1543
|
+
pipeline,
|
|
1544
|
+
startDate,
|
|
1545
|
+
}: {
|
|
1546
|
+
/**
|
|
1547
|
+
* Window for the `period_*` figures.
|
|
1548
|
+
*/
|
|
1549
|
+
dateFilter?: '30d' | '7d' | '90d' | 'all_time' | 'custom' | 'today',
|
|
1550
|
+
/**
|
|
1551
|
+
* Custom window end.
|
|
1552
|
+
*/
|
|
1553
|
+
endDate?: string,
|
|
1554
|
+
/**
|
|
1555
|
+
* Pipeline for `deals.by_stage` (default: the default pipeline).
|
|
1556
|
+
*/
|
|
1557
|
+
pipeline?: number,
|
|
1558
|
+
/**
|
|
1559
|
+
* Custom window start.
|
|
1560
|
+
*/
|
|
1561
|
+
startDate?: string,
|
|
1562
|
+
}): CancelablePromise<Overview> {
|
|
1563
|
+
return __request(OpenAPI, {
|
|
1564
|
+
method: 'GET',
|
|
1565
|
+
url: '/api/crm/overview/',
|
|
1566
|
+
query: {
|
|
1567
|
+
'date_filter': dateFilter,
|
|
1568
|
+
'end_date': endDate,
|
|
1569
|
+
'pipeline': pipeline,
|
|
1570
|
+
'start_date': startDate,
|
|
1571
|
+
},
|
|
1572
|
+
errors: {
|
|
1573
|
+
400: `Invalid window or pipeline parameter.`,
|
|
1574
|
+
403: `No CRM list permission.`,
|
|
1575
|
+
404: `Pipeline not found.`,
|
|
1576
|
+
},
|
|
1577
|
+
});
|
|
1578
|
+
}
|
|
1097
1579
|
/**
|
|
1098
1580
|
* List persons
|
|
1099
1581
|
* Returns a paginated list of persons in your Platform. Supports filtering by `lifecycle_stage`, `owner`, `organization`, `created_at__gte`/`created_at__lte`, and `metadata__has_key`.
|
|
@@ -1103,18 +1585,33 @@ export class CrmService {
|
|
|
1103
1585
|
* @throws ApiError
|
|
1104
1586
|
*/
|
|
1105
1587
|
public static crmPersonsList({
|
|
1588
|
+
active,
|
|
1106
1589
|
createdAtGte,
|
|
1107
1590
|
createdAtLte,
|
|
1591
|
+
dateFilter,
|
|
1592
|
+
endDate,
|
|
1108
1593
|
lifecycleStage,
|
|
1109
1594
|
metadataHasKey,
|
|
1595
|
+
ordering,
|
|
1110
1596
|
organization,
|
|
1111
1597
|
owner,
|
|
1112
1598
|
page,
|
|
1113
1599
|
pageSize,
|
|
1600
|
+
search,
|
|
1601
|
+
startDate,
|
|
1114
1602
|
tags,
|
|
1115
1603
|
}: {
|
|
1604
|
+
active?: boolean,
|
|
1116
1605
|
createdAtGte?: string,
|
|
1117
1606
|
createdAtLte?: string,
|
|
1607
|
+
/**
|
|
1608
|
+
* Only rows created in this window. `custom` needs `start_date` and `end_date`.
|
|
1609
|
+
*/
|
|
1610
|
+
dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom',
|
|
1611
|
+
/**
|
|
1612
|
+
* Last day of a custom window, inclusive (YYYY-MM-DD).
|
|
1613
|
+
*/
|
|
1614
|
+
endDate?: string,
|
|
1118
1615
|
/**
|
|
1119
1616
|
* Funnel position. Transitions are unrestricted — any stage may move to any other.
|
|
1120
1617
|
*
|
|
@@ -1126,6 +1623,10 @@ export class CrmService {
|
|
|
1126
1623
|
*/
|
|
1127
1624
|
lifecycleStage?: 'churned' | 'customer' | 'lead' | 'opportunity' | 'qualified',
|
|
1128
1625
|
metadataHasKey?: string,
|
|
1626
|
+
/**
|
|
1627
|
+
* Which field to use when ordering the results.
|
|
1628
|
+
*/
|
|
1629
|
+
ordering?: string,
|
|
1129
1630
|
organization?: string,
|
|
1130
1631
|
owner?: number,
|
|
1131
1632
|
/**
|
|
@@ -1136,20 +1637,34 @@ export class CrmService {
|
|
|
1136
1637
|
* Number of results to return per page.
|
|
1137
1638
|
*/
|
|
1138
1639
|
pageSize?: number,
|
|
1640
|
+
/**
|
|
1641
|
+
* A search term.
|
|
1642
|
+
*/
|
|
1643
|
+
search?: string,
|
|
1644
|
+
/**
|
|
1645
|
+
* First day of a custom window (YYYY-MM-DD).
|
|
1646
|
+
*/
|
|
1647
|
+
startDate?: string,
|
|
1139
1648
|
tags?: string,
|
|
1140
1649
|
}): CancelablePromise<PaginatedPersonList> {
|
|
1141
1650
|
return __request(OpenAPI, {
|
|
1142
1651
|
method: 'GET',
|
|
1143
1652
|
url: '/api/crm/persons/',
|
|
1144
1653
|
query: {
|
|
1654
|
+
'active': active,
|
|
1145
1655
|
'created_at__gte': createdAtGte,
|
|
1146
1656
|
'created_at__lte': createdAtLte,
|
|
1657
|
+
'date_filter': dateFilter,
|
|
1658
|
+
'end_date': endDate,
|
|
1147
1659
|
'lifecycle_stage': lifecycleStage,
|
|
1148
1660
|
'metadata__has_key': metadataHasKey,
|
|
1661
|
+
'ordering': ordering,
|
|
1149
1662
|
'organization': organization,
|
|
1150
1663
|
'owner': owner,
|
|
1151
1664
|
'page': page,
|
|
1152
1665
|
'page_size': pageSize,
|
|
1666
|
+
'search': search,
|
|
1667
|
+
'start_date': startDate,
|
|
1153
1668
|
'tags': tags,
|
|
1154
1669
|
},
|
|
1155
1670
|
errors: {
|
|
@@ -1269,7 +1784,7 @@ export class CrmService {
|
|
|
1269
1784
|
}
|
|
1270
1785
|
/**
|
|
1271
1786
|
* Delete a person
|
|
1272
|
-
* Deletes the person.
|
|
1787
|
+
* Deletes the person. Fails with `409 Conflict` if any Deal still references it.
|
|
1273
1788
|
*
|
|
1274
1789
|
* **Required permission:** `Ibl.CRM/Persons/delete`.
|
|
1275
1790
|
* @returns void
|
|
@@ -1289,6 +1804,32 @@ export class CrmService {
|
|
|
1289
1804
|
errors: {
|
|
1290
1805
|
403: `Missing required permission \`Ibl.CRM/Persons/delete\`.`,
|
|
1291
1806
|
404: `Person not found.`,
|
|
1807
|
+
409: `Person still has Deals attached.`,
|
|
1808
|
+
},
|
|
1809
|
+
});
|
|
1810
|
+
}
|
|
1811
|
+
/**
|
|
1812
|
+
* Field-change history for this record
|
|
1813
|
+
* The record's audit entries (create and field updates), newest first, up to 200, each with `changes: {field: [old, new]}` as strings (a null reads `"None"`). The actor is the platform user who made the change. Bulk writes (a person merge, links a delete clears) leave no entry.
|
|
1814
|
+
*
|
|
1815
|
+
* **Required permission:** the record's `read` verb.
|
|
1816
|
+
* @returns HistoryEntry
|
|
1817
|
+
* @throws ApiError
|
|
1818
|
+
*/
|
|
1819
|
+
public static crmPersonsHistoryList({
|
|
1820
|
+
id,
|
|
1821
|
+
}: {
|
|
1822
|
+
id: string,
|
|
1823
|
+
}): CancelablePromise<Array<HistoryEntry>> {
|
|
1824
|
+
return __request(OpenAPI, {
|
|
1825
|
+
method: 'GET',
|
|
1826
|
+
url: '/api/crm/persons/{id}/history/',
|
|
1827
|
+
path: {
|
|
1828
|
+
'id': id,
|
|
1829
|
+
},
|
|
1830
|
+
errors: {
|
|
1831
|
+
403: `Missing the record's \`read\` permission.`,
|
|
1832
|
+
404: `Record not found.`,
|
|
1292
1833
|
},
|
|
1293
1834
|
});
|
|
1294
1835
|
}
|
|
@@ -1453,14 +1994,31 @@ export class CrmService {
|
|
|
1453
1994
|
*/
|
|
1454
1995
|
public static crmPipelinesList({
|
|
1455
1996
|
code,
|
|
1997
|
+
dateFilter,
|
|
1998
|
+
endDate,
|
|
1456
1999
|
isDefault,
|
|
1457
2000
|
name,
|
|
2001
|
+
ordering,
|
|
1458
2002
|
page,
|
|
1459
2003
|
pageSize,
|
|
2004
|
+
search,
|
|
2005
|
+
startDate,
|
|
1460
2006
|
}: {
|
|
1461
2007
|
code?: string,
|
|
2008
|
+
/**
|
|
2009
|
+
* Only rows created in this window. `custom` needs `start_date` and `end_date`.
|
|
2010
|
+
*/
|
|
2011
|
+
dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom',
|
|
2012
|
+
/**
|
|
2013
|
+
* Last day of a custom window, inclusive (YYYY-MM-DD).
|
|
2014
|
+
*/
|
|
2015
|
+
endDate?: string,
|
|
1462
2016
|
isDefault?: boolean,
|
|
1463
2017
|
name?: string,
|
|
2018
|
+
/**
|
|
2019
|
+
* Which field to use when ordering the results.
|
|
2020
|
+
*/
|
|
2021
|
+
ordering?: string,
|
|
1464
2022
|
/**
|
|
1465
2023
|
* A page number within the paginated result set.
|
|
1466
2024
|
*/
|
|
@@ -1469,16 +2027,29 @@ export class CrmService {
|
|
|
1469
2027
|
* Number of results to return per page.
|
|
1470
2028
|
*/
|
|
1471
2029
|
pageSize?: number,
|
|
2030
|
+
/**
|
|
2031
|
+
* A search term.
|
|
2032
|
+
*/
|
|
2033
|
+
search?: string,
|
|
2034
|
+
/**
|
|
2035
|
+
* First day of a custom window (YYYY-MM-DD).
|
|
2036
|
+
*/
|
|
2037
|
+
startDate?: string,
|
|
1472
2038
|
}): CancelablePromise<PaginatedPipelineList> {
|
|
1473
2039
|
return __request(OpenAPI, {
|
|
1474
2040
|
method: 'GET',
|
|
1475
2041
|
url: '/api/crm/pipelines/',
|
|
1476
2042
|
query: {
|
|
1477
2043
|
'code': code,
|
|
2044
|
+
'date_filter': dateFilter,
|
|
2045
|
+
'end_date': endDate,
|
|
1478
2046
|
'is_default': isDefault,
|
|
1479
2047
|
'name': name,
|
|
2048
|
+
'ordering': ordering,
|
|
1480
2049
|
'page': page,
|
|
1481
2050
|
'page_size': pageSize,
|
|
2051
|
+
'search': search,
|
|
2052
|
+
'start_date': startDate,
|
|
1482
2053
|
},
|
|
1483
2054
|
errors: {
|
|
1484
2055
|
401: `Authentication required.`,
|
|
@@ -1521,15 +2092,32 @@ export class CrmService {
|
|
|
1521
2092
|
public static crmPipelinesStagesList({
|
|
1522
2093
|
pipelinePk,
|
|
1523
2094
|
code,
|
|
2095
|
+
dateFilter,
|
|
2096
|
+
endDate,
|
|
1524
2097
|
isLost,
|
|
1525
2098
|
isWon,
|
|
2099
|
+
ordering,
|
|
1526
2100
|
page,
|
|
1527
2101
|
pageSize,
|
|
2102
|
+
search,
|
|
2103
|
+
startDate,
|
|
1528
2104
|
}: {
|
|
1529
2105
|
pipelinePk: number,
|
|
1530
2106
|
code?: string,
|
|
2107
|
+
/**
|
|
2108
|
+
* Only rows created in this window. `custom` needs `start_date` and `end_date`.
|
|
2109
|
+
*/
|
|
2110
|
+
dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom',
|
|
2111
|
+
/**
|
|
2112
|
+
* Last day of a custom window, inclusive (YYYY-MM-DD).
|
|
2113
|
+
*/
|
|
2114
|
+
endDate?: string,
|
|
1531
2115
|
isLost?: boolean,
|
|
1532
2116
|
isWon?: boolean,
|
|
2117
|
+
/**
|
|
2118
|
+
* Which field to use when ordering the results.
|
|
2119
|
+
*/
|
|
2120
|
+
ordering?: string,
|
|
1533
2121
|
/**
|
|
1534
2122
|
* A page number within the paginated result set.
|
|
1535
2123
|
*/
|
|
@@ -1538,6 +2126,14 @@ export class CrmService {
|
|
|
1538
2126
|
* Number of results to return per page.
|
|
1539
2127
|
*/
|
|
1540
2128
|
pageSize?: number,
|
|
2129
|
+
/**
|
|
2130
|
+
* A search term.
|
|
2131
|
+
*/
|
|
2132
|
+
search?: string,
|
|
2133
|
+
/**
|
|
2134
|
+
* First day of a custom window (YYYY-MM-DD).
|
|
2135
|
+
*/
|
|
2136
|
+
startDate?: string,
|
|
1541
2137
|
}): CancelablePromise<PaginatedPipelineStageList> {
|
|
1542
2138
|
return __request(OpenAPI, {
|
|
1543
2139
|
method: 'GET',
|
|
@@ -1547,10 +2143,15 @@ export class CrmService {
|
|
|
1547
2143
|
},
|
|
1548
2144
|
query: {
|
|
1549
2145
|
'code': code,
|
|
2146
|
+
'date_filter': dateFilter,
|
|
2147
|
+
'end_date': endDate,
|
|
1550
2148
|
'is_lost': isLost,
|
|
1551
2149
|
'is_won': isWon,
|
|
2150
|
+
'ordering': ordering,
|
|
1552
2151
|
'page': page,
|
|
1553
2152
|
'page_size': pageSize,
|
|
2153
|
+
'search': search,
|
|
2154
|
+
'start_date': startDate,
|
|
1554
2155
|
},
|
|
1555
2156
|
errors: {
|
|
1556
2157
|
403: `Missing required permission \`Ibl.CRM/Pipelines/list\`.`,
|
|
@@ -1834,6 +2435,73 @@ export class CrmService {
|
|
|
1834
2435
|
},
|
|
1835
2436
|
});
|
|
1836
2437
|
}
|
|
2438
|
+
/**
|
|
2439
|
+
* Reorder a pipeline's stages
|
|
2440
|
+
* Sets `sort_order` on every stage of the Pipeline from the position of its id in `order`, in one transaction. `order` must list each stage of this Pipeline exactly once.
|
|
2441
|
+
*
|
|
2442
|
+
* **Required permission:** `Ibl.CRM/Pipelines/write`.
|
|
2443
|
+
* @returns Pipeline
|
|
2444
|
+
* @throws ApiError
|
|
2445
|
+
*/
|
|
2446
|
+
public static crmPipelinesStagesReorderCreate({
|
|
2447
|
+
id,
|
|
2448
|
+
requestBody,
|
|
2449
|
+
}: {
|
|
2450
|
+
/**
|
|
2451
|
+
* A unique integer value identifying this pipeline.
|
|
2452
|
+
*/
|
|
2453
|
+
id: number,
|
|
2454
|
+
requestBody: PipelineStageReorderRequest,
|
|
2455
|
+
}): CancelablePromise<Pipeline> {
|
|
2456
|
+
return __request(OpenAPI, {
|
|
2457
|
+
method: 'POST',
|
|
2458
|
+
url: '/api/crm/pipelines/{id}/stages/reorder/',
|
|
2459
|
+
path: {
|
|
2460
|
+
'id': id,
|
|
2461
|
+
},
|
|
2462
|
+
body: requestBody,
|
|
2463
|
+
mediaType: 'application/json',
|
|
2464
|
+
errors: {
|
|
2465
|
+
400: `\`order\` is not a permutation of the stages.`,
|
|
2466
|
+
403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
|
|
2467
|
+
404: `Pipeline not found.`,
|
|
2468
|
+
},
|
|
2469
|
+
});
|
|
2470
|
+
}
|
|
2471
|
+
/**
|
|
2472
|
+
* Search persons, organizations and deals
|
|
2473
|
+
* Case-insensitive substring match on person name / email / job title, organization name and deal title, up to `limit` rows per bucket. A bucket is present only when you hold that resource's `list` permission.
|
|
2474
|
+
*
|
|
2475
|
+
* **Required permission:** `Ibl.CRM/Persons/list`, `Ibl.CRM/Organizations/list` or `Ibl.CRM/Deals/list` (at least one).
|
|
2476
|
+
* @returns SearchResponse
|
|
2477
|
+
* @throws ApiError
|
|
2478
|
+
*/
|
|
2479
|
+
public static crmSearchRetrieve({
|
|
2480
|
+
q,
|
|
2481
|
+
limit,
|
|
2482
|
+
}: {
|
|
2483
|
+
/**
|
|
2484
|
+
* Search text.
|
|
2485
|
+
*/
|
|
2486
|
+
q: string,
|
|
2487
|
+
/**
|
|
2488
|
+
* Rows per bucket, 1–25 (default 8).
|
|
2489
|
+
*/
|
|
2490
|
+
limit?: number,
|
|
2491
|
+
}): CancelablePromise<SearchResponse> {
|
|
2492
|
+
return __request(OpenAPI, {
|
|
2493
|
+
method: 'GET',
|
|
2494
|
+
url: '/api/crm/search/',
|
|
2495
|
+
query: {
|
|
2496
|
+
'limit': limit,
|
|
2497
|
+
'q': q,
|
|
2498
|
+
},
|
|
2499
|
+
errors: {
|
|
2500
|
+
400: `\`q\` missing or \`limit\` out of range.`,
|
|
2501
|
+
403: `No CRM list permission.`,
|
|
2502
|
+
},
|
|
2503
|
+
});
|
|
2504
|
+
}
|
|
1837
2505
|
/**
|
|
1838
2506
|
* List tags
|
|
1839
2507
|
* Returns a paginated list of Tags in your Platform. Supports filtering by `name` (case-insensitive substring) and `created_at__gte`/`created_at__lte` ISO timestamp ranges.
|
|
@@ -1845,13 +2513,30 @@ export class CrmService {
|
|
|
1845
2513
|
public static crmTagsList({
|
|
1846
2514
|
createdAtGte,
|
|
1847
2515
|
createdAtLte,
|
|
2516
|
+
dateFilter,
|
|
2517
|
+
endDate,
|
|
1848
2518
|
name,
|
|
2519
|
+
ordering,
|
|
1849
2520
|
page,
|
|
1850
2521
|
pageSize,
|
|
2522
|
+
search,
|
|
2523
|
+
startDate,
|
|
1851
2524
|
}: {
|
|
1852
2525
|
createdAtGte?: string,
|
|
1853
2526
|
createdAtLte?: string,
|
|
2527
|
+
/**
|
|
2528
|
+
* Only rows created in this window. `custom` needs `start_date` and `end_date`.
|
|
2529
|
+
*/
|
|
2530
|
+
dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom',
|
|
2531
|
+
/**
|
|
2532
|
+
* Last day of a custom window, inclusive (YYYY-MM-DD).
|
|
2533
|
+
*/
|
|
2534
|
+
endDate?: string,
|
|
1854
2535
|
name?: string,
|
|
2536
|
+
/**
|
|
2537
|
+
* Which field to use when ordering the results.
|
|
2538
|
+
*/
|
|
2539
|
+
ordering?: string,
|
|
1855
2540
|
/**
|
|
1856
2541
|
* A page number within the paginated result set.
|
|
1857
2542
|
*/
|
|
@@ -1860,6 +2545,14 @@ export class CrmService {
|
|
|
1860
2545
|
* Number of results to return per page.
|
|
1861
2546
|
*/
|
|
1862
2547
|
pageSize?: number,
|
|
2548
|
+
/**
|
|
2549
|
+
* A search term.
|
|
2550
|
+
*/
|
|
2551
|
+
search?: string,
|
|
2552
|
+
/**
|
|
2553
|
+
* First day of a custom window (YYYY-MM-DD).
|
|
2554
|
+
*/
|
|
2555
|
+
startDate?: string,
|
|
1863
2556
|
}): CancelablePromise<PaginatedTagList> {
|
|
1864
2557
|
return __request(OpenAPI, {
|
|
1865
2558
|
method: 'GET',
|
|
@@ -1867,9 +2560,14 @@ export class CrmService {
|
|
|
1867
2560
|
query: {
|
|
1868
2561
|
'created_at__gte': createdAtGte,
|
|
1869
2562
|
'created_at__lte': createdAtLte,
|
|
2563
|
+
'date_filter': dateFilter,
|
|
2564
|
+
'end_date': endDate,
|
|
1870
2565
|
'name': name,
|
|
2566
|
+
'ordering': ordering,
|
|
1871
2567
|
'page': page,
|
|
1872
2568
|
'page_size': pageSize,
|
|
2569
|
+
'search': search,
|
|
2570
|
+
'start_date': startDate,
|
|
1873
2571
|
},
|
|
1874
2572
|
errors: {
|
|
1875
2573
|
401: `Authentication required.`,
|
|
@@ -2023,4 +2721,226 @@ export class CrmService {
|
|
|
2023
2721
|
},
|
|
2024
2722
|
});
|
|
2025
2723
|
}
|
|
2724
|
+
/**
|
|
2725
|
+
* List my saved views
|
|
2726
|
+
* Your saved views in this Platform; filter with `object_type`.
|
|
2727
|
+
*
|
|
2728
|
+
* **Required permission:** `Ibl.CRM/Views/list`.
|
|
2729
|
+
* @returns PaginatedSavedViewList
|
|
2730
|
+
* @throws ApiError
|
|
2731
|
+
*/
|
|
2732
|
+
public static crmViewsList({
|
|
2733
|
+
dateFilter,
|
|
2734
|
+
endDate,
|
|
2735
|
+
objectType,
|
|
2736
|
+
ordering,
|
|
2737
|
+
page,
|
|
2738
|
+
pageSize,
|
|
2739
|
+
search,
|
|
2740
|
+
startDate,
|
|
2741
|
+
type,
|
|
2742
|
+
}: {
|
|
2743
|
+
/**
|
|
2744
|
+
* Only rows created in this window. `custom` needs `start_date` and `end_date`.
|
|
2745
|
+
*/
|
|
2746
|
+
dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom',
|
|
2747
|
+
/**
|
|
2748
|
+
* Last day of a custom window, inclusive (YYYY-MM-DD).
|
|
2749
|
+
*/
|
|
2750
|
+
endDate?: string,
|
|
2751
|
+
/**
|
|
2752
|
+
* The list this view belongs to.
|
|
2753
|
+
*
|
|
2754
|
+
* * `persons` - Persons
|
|
2755
|
+
* * `organizations` - Organizations
|
|
2756
|
+
* * `deals` - Deals
|
|
2757
|
+
* * `activities` - Activities
|
|
2758
|
+
*/
|
|
2759
|
+
objectType?: 'activities' | 'deals' | 'organizations' | 'persons',
|
|
2760
|
+
/**
|
|
2761
|
+
* Which field to use when ordering the results.
|
|
2762
|
+
*/
|
|
2763
|
+
ordering?: string,
|
|
2764
|
+
/**
|
|
2765
|
+
* A page number within the paginated result set.
|
|
2766
|
+
*/
|
|
2767
|
+
page?: number,
|
|
2768
|
+
/**
|
|
2769
|
+
* Number of results to return per page.
|
|
2770
|
+
*/
|
|
2771
|
+
pageSize?: number,
|
|
2772
|
+
/**
|
|
2773
|
+
* A search term.
|
|
2774
|
+
*/
|
|
2775
|
+
search?: string,
|
|
2776
|
+
/**
|
|
2777
|
+
* First day of a custom window (YYYY-MM-DD).
|
|
2778
|
+
*/
|
|
2779
|
+
startDate?: string,
|
|
2780
|
+
/**
|
|
2781
|
+
* `kanban` is available for deals only.
|
|
2782
|
+
*
|
|
2783
|
+
* * `table` - Table
|
|
2784
|
+
* * `kanban` - Kanban
|
|
2785
|
+
*/
|
|
2786
|
+
type?: 'kanban' | 'table',
|
|
2787
|
+
}): CancelablePromise<PaginatedSavedViewList> {
|
|
2788
|
+
return __request(OpenAPI, {
|
|
2789
|
+
method: 'GET',
|
|
2790
|
+
url: '/api/crm/views/',
|
|
2791
|
+
query: {
|
|
2792
|
+
'date_filter': dateFilter,
|
|
2793
|
+
'end_date': endDate,
|
|
2794
|
+
'object_type': objectType,
|
|
2795
|
+
'ordering': ordering,
|
|
2796
|
+
'page': page,
|
|
2797
|
+
'page_size': pageSize,
|
|
2798
|
+
'search': search,
|
|
2799
|
+
'start_date': startDate,
|
|
2800
|
+
'type': type,
|
|
2801
|
+
},
|
|
2802
|
+
errors: {
|
|
2803
|
+
401: `Authentication required.`,
|
|
2804
|
+
403: `Missing required permission \`Ibl.CRM/Views/list\`.`,
|
|
2805
|
+
},
|
|
2806
|
+
});
|
|
2807
|
+
}
|
|
2808
|
+
/**
|
|
2809
|
+
* Save a view
|
|
2810
|
+
* Stores columns, filters, sorts and (for deals) a kanban grouping under a name unique to you and the list.
|
|
2811
|
+
*
|
|
2812
|
+
* **Required permission:** `Ibl.CRM/Views/action`.
|
|
2813
|
+
* @returns SavedView
|
|
2814
|
+
* @throws ApiError
|
|
2815
|
+
*/
|
|
2816
|
+
public static crmViewsCreate({
|
|
2817
|
+
requestBody,
|
|
2818
|
+
}: {
|
|
2819
|
+
requestBody: SavedView,
|
|
2820
|
+
}): CancelablePromise<SavedView> {
|
|
2821
|
+
return __request(OpenAPI, {
|
|
2822
|
+
method: 'POST',
|
|
2823
|
+
url: '/api/crm/views/',
|
|
2824
|
+
body: requestBody,
|
|
2825
|
+
mediaType: 'application/json',
|
|
2826
|
+
errors: {
|
|
2827
|
+
400: `Validation error.`,
|
|
2828
|
+
403: `Missing required permission \`Ibl.CRM/Views/action\`.`,
|
|
2829
|
+
},
|
|
2830
|
+
});
|
|
2831
|
+
}
|
|
2832
|
+
/**
|
|
2833
|
+
* Retrieve a saved view
|
|
2834
|
+
* **Required permission:** `Ibl.CRM/Views/read`.
|
|
2835
|
+
* @returns SavedView
|
|
2836
|
+
* @throws ApiError
|
|
2837
|
+
*/
|
|
2838
|
+
public static crmViewsRetrieve({
|
|
2839
|
+
id,
|
|
2840
|
+
}: {
|
|
2841
|
+
/**
|
|
2842
|
+
* A unique integer value identifying this saved view.
|
|
2843
|
+
*/
|
|
2844
|
+
id: number,
|
|
2845
|
+
}): CancelablePromise<SavedView> {
|
|
2846
|
+
return __request(OpenAPI, {
|
|
2847
|
+
method: 'GET',
|
|
2848
|
+
url: '/api/crm/views/{id}/',
|
|
2849
|
+
path: {
|
|
2850
|
+
'id': id,
|
|
2851
|
+
},
|
|
2852
|
+
errors: {
|
|
2853
|
+
403: `Missing required permission \`Ibl.CRM/Views/read\`.`,
|
|
2854
|
+
404: `View not found.`,
|
|
2855
|
+
},
|
|
2856
|
+
});
|
|
2857
|
+
}
|
|
2858
|
+
/**
|
|
2859
|
+
* Replace a saved view
|
|
2860
|
+
* **Required permission:** `Ibl.CRM/Views/write`.
|
|
2861
|
+
* @returns SavedView
|
|
2862
|
+
* @throws ApiError
|
|
2863
|
+
*/
|
|
2864
|
+
public static crmViewsUpdate({
|
|
2865
|
+
id,
|
|
2866
|
+
requestBody,
|
|
2867
|
+
}: {
|
|
2868
|
+
/**
|
|
2869
|
+
* A unique integer value identifying this saved view.
|
|
2870
|
+
*/
|
|
2871
|
+
id: number,
|
|
2872
|
+
requestBody: SavedView,
|
|
2873
|
+
}): CancelablePromise<SavedView> {
|
|
2874
|
+
return __request(OpenAPI, {
|
|
2875
|
+
method: 'PUT',
|
|
2876
|
+
url: '/api/crm/views/{id}/',
|
|
2877
|
+
path: {
|
|
2878
|
+
'id': id,
|
|
2879
|
+
},
|
|
2880
|
+
body: requestBody,
|
|
2881
|
+
mediaType: 'application/json',
|
|
2882
|
+
errors: {
|
|
2883
|
+
400: `Validation error.`,
|
|
2884
|
+
403: `Missing required permission \`Ibl.CRM/Views/write\`.`,
|
|
2885
|
+
404: `View not found.`,
|
|
2886
|
+
},
|
|
2887
|
+
});
|
|
2888
|
+
}
|
|
2889
|
+
/**
|
|
2890
|
+
* Update a saved view
|
|
2891
|
+
* **Required permission:** `Ibl.CRM/Views/write`.
|
|
2892
|
+
* @returns SavedView
|
|
2893
|
+
* @throws ApiError
|
|
2894
|
+
*/
|
|
2895
|
+
public static crmViewsPartialUpdate({
|
|
2896
|
+
id,
|
|
2897
|
+
requestBody,
|
|
2898
|
+
}: {
|
|
2899
|
+
/**
|
|
2900
|
+
* A unique integer value identifying this saved view.
|
|
2901
|
+
*/
|
|
2902
|
+
id: number,
|
|
2903
|
+
requestBody?: PatchedSavedView,
|
|
2904
|
+
}): CancelablePromise<SavedView> {
|
|
2905
|
+
return __request(OpenAPI, {
|
|
2906
|
+
method: 'PATCH',
|
|
2907
|
+
url: '/api/crm/views/{id}/',
|
|
2908
|
+
path: {
|
|
2909
|
+
'id': id,
|
|
2910
|
+
},
|
|
2911
|
+
body: requestBody,
|
|
2912
|
+
mediaType: 'application/json',
|
|
2913
|
+
errors: {
|
|
2914
|
+
400: `Validation error.`,
|
|
2915
|
+
403: `Missing required permission \`Ibl.CRM/Views/write\`.`,
|
|
2916
|
+
404: `View not found.`,
|
|
2917
|
+
},
|
|
2918
|
+
});
|
|
2919
|
+
}
|
|
2920
|
+
/**
|
|
2921
|
+
* Delete a saved view
|
|
2922
|
+
* **Required permission:** `Ibl.CRM/Views/delete`.
|
|
2923
|
+
* @returns void
|
|
2924
|
+
* @throws ApiError
|
|
2925
|
+
*/
|
|
2926
|
+
public static crmViewsDestroy({
|
|
2927
|
+
id,
|
|
2928
|
+
}: {
|
|
2929
|
+
/**
|
|
2930
|
+
* A unique integer value identifying this saved view.
|
|
2931
|
+
*/
|
|
2932
|
+
id: number,
|
|
2933
|
+
}): CancelablePromise<void> {
|
|
2934
|
+
return __request(OpenAPI, {
|
|
2935
|
+
method: 'DELETE',
|
|
2936
|
+
url: '/api/crm/views/{id}/',
|
|
2937
|
+
path: {
|
|
2938
|
+
'id': id,
|
|
2939
|
+
},
|
|
2940
|
+
errors: {
|
|
2941
|
+
403: `Missing required permission \`Ibl.CRM/Views/delete\`.`,
|
|
2942
|
+
404: `View not found.`,
|
|
2943
|
+
},
|
|
2944
|
+
});
|
|
2945
|
+
}
|
|
2026
2946
|
}
|