@iblai/iblai-api 4.261.1-core → 4.262.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 +943 -123
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +941 -124
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +943 -123
- package/dist/index.umd.js.map +1 -1
- package/dist/types/index.d.ts +16 -0
- package/dist/types/models/LifecycleStageEnum.d.ts +14 -0
- package/dist/types/models/Organization.d.ts +34 -0
- package/dist/types/models/PaginatedOrganizationList.d.ts +7 -0
- package/dist/types/models/PaginatedPersonList.d.ts +7 -0
- package/dist/types/models/PatchedOrganization.d.ts +34 -0
- package/dist/types/models/PatchedPerson.d.ts +73 -0
- package/dist/types/models/Person.d.ts +73 -0
- package/dist/types/models/PersonInviteConflict.d.ts +12 -0
- package/dist/types/models/PersonInviteRequest.d.ts +18 -0
- package/dist/types/models/PersonInviteResponse.d.ts +37 -0
- package/dist/types/models/PersonLinkUserRequest.d.ts +6 -0
- package/dist/types/models/PersonMergeRequest.d.ts +10 -0
- package/dist/types/models/PersonMergeResponse.d.ts +17 -0
- package/dist/types/services/CrmService.d.ts +222 -0
- package/dist/types/services/OrganizationsService.d.ts +83 -0
- package/dist/types/services/PersonsService.d.ts +142 -0
- package/package.json +1 -1
- package/sdk_schema.yml +1803 -1
- package/src/core/OpenAPI.ts +1 -1
- package/src/index.ts +16 -0
- package/src/models/LifecycleStageEnum.ts +18 -0
- package/src/models/Organization.ts +39 -0
- package/src/models/PaginatedOrganizationList.ts +12 -0
- package/src/models/PaginatedPersonList.ts +12 -0
- package/src/models/PatchedOrganization.ts +39 -0
- package/src/models/PatchedPerson.ts +78 -0
- package/src/models/Person.ts +78 -0
- package/src/models/PersonInviteConflict.ts +17 -0
- package/src/models/PersonInviteRequest.ts +23 -0
- package/src/models/PersonInviteResponse.ts +42 -0
- package/src/models/PersonLinkUserRequest.ts +11 -0
- package/src/models/PersonMergeRequest.ts +15 -0
- package/src/models/PersonMergeResponse.ts +22 -0
- package/src/services/CrmService.ts +481 -0
- package/src/services/OrganizationsService.ts +186 -0
- package/src/services/PersonsService.ts +304 -0
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
import type { PaginatedPersonList } from '../models/PaginatedPersonList';
|
|
6
|
+
import type { PatchedPerson } from '../models/PatchedPerson';
|
|
7
|
+
import type { Person } from '../models/Person';
|
|
8
|
+
import type { PersonInviteRequest } from '../models/PersonInviteRequest';
|
|
9
|
+
import type { PersonInviteResponse } from '../models/PersonInviteResponse';
|
|
10
|
+
import type { PersonLinkUserRequest } from '../models/PersonLinkUserRequest';
|
|
11
|
+
import type { PersonMergeRequest } from '../models/PersonMergeRequest';
|
|
12
|
+
import type { PersonMergeResponse } from '../models/PersonMergeResponse';
|
|
13
|
+
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
14
|
+
import { OpenAPI } from '../core/OpenAPI';
|
|
15
|
+
import { request as __request } from '../core/request';
|
|
16
|
+
export class PersonsService {
|
|
17
|
+
/**
|
|
18
|
+
* List persons
|
|
19
|
+
* 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`.
|
|
20
|
+
*
|
|
21
|
+
* **Required permission:** `Ibl.CRM/Persons/list`.
|
|
22
|
+
* @returns PaginatedPersonList
|
|
23
|
+
* @throws ApiError
|
|
24
|
+
*/
|
|
25
|
+
public static personsList({
|
|
26
|
+
createdAtGte,
|
|
27
|
+
createdAtLte,
|
|
28
|
+
lifecycleStage,
|
|
29
|
+
metadataHasKey,
|
|
30
|
+
organization,
|
|
31
|
+
owner,
|
|
32
|
+
page,
|
|
33
|
+
pageSize,
|
|
34
|
+
}: {
|
|
35
|
+
createdAtGte?: string,
|
|
36
|
+
createdAtLte?: string,
|
|
37
|
+
/**
|
|
38
|
+
* Funnel position. Free-form transitions in v0.
|
|
39
|
+
*
|
|
40
|
+
* * `lead` - Lead
|
|
41
|
+
* * `qualified` - Qualified
|
|
42
|
+
* * `opportunity` - Opportunity
|
|
43
|
+
* * `customer` - Customer
|
|
44
|
+
* * `churned` - Churned
|
|
45
|
+
*/
|
|
46
|
+
lifecycleStage?: 'churned' | 'customer' | 'lead' | 'opportunity' | 'qualified',
|
|
47
|
+
metadataHasKey?: string,
|
|
48
|
+
organization?: string,
|
|
49
|
+
owner?: number,
|
|
50
|
+
/**
|
|
51
|
+
* A page number within the paginated result set.
|
|
52
|
+
*/
|
|
53
|
+
page?: number,
|
|
54
|
+
/**
|
|
55
|
+
* Number of results to return per page.
|
|
56
|
+
*/
|
|
57
|
+
pageSize?: number,
|
|
58
|
+
}): CancelablePromise<PaginatedPersonList> {
|
|
59
|
+
return __request(OpenAPI, {
|
|
60
|
+
method: 'GET',
|
|
61
|
+
url: '/persons/',
|
|
62
|
+
query: {
|
|
63
|
+
'created_at__gte': createdAtGte,
|
|
64
|
+
'created_at__lte': createdAtLte,
|
|
65
|
+
'lifecycle_stage': lifecycleStage,
|
|
66
|
+
'metadata__has_key': metadataHasKey,
|
|
67
|
+
'organization': organization,
|
|
68
|
+
'owner': owner,
|
|
69
|
+
'page': page,
|
|
70
|
+
'page_size': pageSize,
|
|
71
|
+
},
|
|
72
|
+
errors: {
|
|
73
|
+
401: `Authentication required.`,
|
|
74
|
+
403: `Missing required permission \`Ibl.CRM/Persons/list\`.`,
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Create a person
|
|
80
|
+
* Creates a new person in your Platform. The Platform is inferred from your credentials. If `organization` is supplied, it must reference an organization in your Platform.
|
|
81
|
+
*
|
|
82
|
+
* **Required permission:** `Ibl.CRM/Persons/write`.
|
|
83
|
+
* @returns Person
|
|
84
|
+
* @throws ApiError
|
|
85
|
+
*/
|
|
86
|
+
public static personsCreate({
|
|
87
|
+
requestBody,
|
|
88
|
+
}: {
|
|
89
|
+
requestBody: Person,
|
|
90
|
+
}): CancelablePromise<Person> {
|
|
91
|
+
return __request(OpenAPI, {
|
|
92
|
+
method: 'POST',
|
|
93
|
+
url: '/persons/',
|
|
94
|
+
body: requestBody,
|
|
95
|
+
mediaType: 'application/json',
|
|
96
|
+
errors: {
|
|
97
|
+
400: `Validation error.`,
|
|
98
|
+
403: `Missing required permission \`Ibl.CRM/Persons/write\`.`,
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Retrieve a person
|
|
104
|
+
* Returns a single person by id.
|
|
105
|
+
*
|
|
106
|
+
* **Required permission:** `Ibl.CRM/Persons/read`.
|
|
107
|
+
* @returns Person
|
|
108
|
+
* @throws ApiError
|
|
109
|
+
*/
|
|
110
|
+
public static personsRetrieve({
|
|
111
|
+
id,
|
|
112
|
+
}: {
|
|
113
|
+
id: string,
|
|
114
|
+
}): CancelablePromise<Person> {
|
|
115
|
+
return __request(OpenAPI, {
|
|
116
|
+
method: 'GET',
|
|
117
|
+
url: '/persons/{id}/',
|
|
118
|
+
path: {
|
|
119
|
+
'id': id,
|
|
120
|
+
},
|
|
121
|
+
errors: {
|
|
122
|
+
403: `Missing required permission \`Ibl.CRM/Persons/read\`.`,
|
|
123
|
+
404: `Person not found.`,
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Replace a person
|
|
129
|
+
* Replaces all editable fields on the person.
|
|
130
|
+
*
|
|
131
|
+
* **Required permission:** `Ibl.CRM/Persons/write`.
|
|
132
|
+
* @returns Person
|
|
133
|
+
* @throws ApiError
|
|
134
|
+
*/
|
|
135
|
+
public static personsUpdate({
|
|
136
|
+
id,
|
|
137
|
+
requestBody,
|
|
138
|
+
}: {
|
|
139
|
+
id: string,
|
|
140
|
+
requestBody: Person,
|
|
141
|
+
}): CancelablePromise<Person> {
|
|
142
|
+
return __request(OpenAPI, {
|
|
143
|
+
method: 'PUT',
|
|
144
|
+
url: '/persons/{id}/',
|
|
145
|
+
path: {
|
|
146
|
+
'id': id,
|
|
147
|
+
},
|
|
148
|
+
body: requestBody,
|
|
149
|
+
mediaType: 'application/json',
|
|
150
|
+
errors: {
|
|
151
|
+
400: `Validation error.`,
|
|
152
|
+
403: `Missing required permission \`Ibl.CRM/Persons/write\`.`,
|
|
153
|
+
404: `Person not found.`,
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Update a person
|
|
159
|
+
* Updates only the supplied fields on the person.
|
|
160
|
+
*
|
|
161
|
+
* **Required permission:** `Ibl.CRM/Persons/write`.
|
|
162
|
+
* @returns Person
|
|
163
|
+
* @throws ApiError
|
|
164
|
+
*/
|
|
165
|
+
public static personsPartialUpdate({
|
|
166
|
+
id,
|
|
167
|
+
requestBody,
|
|
168
|
+
}: {
|
|
169
|
+
id: string,
|
|
170
|
+
requestBody?: PatchedPerson,
|
|
171
|
+
}): CancelablePromise<Person> {
|
|
172
|
+
return __request(OpenAPI, {
|
|
173
|
+
method: 'PATCH',
|
|
174
|
+
url: '/persons/{id}/',
|
|
175
|
+
path: {
|
|
176
|
+
'id': id,
|
|
177
|
+
},
|
|
178
|
+
body: requestBody,
|
|
179
|
+
mediaType: 'application/json',
|
|
180
|
+
errors: {
|
|
181
|
+
400: `Validation error.`,
|
|
182
|
+
403: `Missing required permission \`Ibl.CRM/Persons/write\`.`,
|
|
183
|
+
404: `Person not found.`,
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Delete a person
|
|
189
|
+
* Deletes the person.
|
|
190
|
+
*
|
|
191
|
+
* **Required permission:** `Ibl.CRM/Persons/delete`.
|
|
192
|
+
* @returns void
|
|
193
|
+
* @throws ApiError
|
|
194
|
+
*/
|
|
195
|
+
public static personsDestroy({
|
|
196
|
+
id,
|
|
197
|
+
}: {
|
|
198
|
+
id: string,
|
|
199
|
+
}): CancelablePromise<void> {
|
|
200
|
+
return __request(OpenAPI, {
|
|
201
|
+
method: 'DELETE',
|
|
202
|
+
url: '/persons/{id}/',
|
|
203
|
+
path: {
|
|
204
|
+
'id': id,
|
|
205
|
+
},
|
|
206
|
+
errors: {
|
|
207
|
+
403: `Missing required permission \`Ibl.CRM/Persons/delete\`.`,
|
|
208
|
+
404: `Person not found.`,
|
|
209
|
+
},
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Invite a person to the platform
|
|
214
|
+
* Sends a platform invitation to the person's `primary_email`. On acceptance, the invitee joins your Platform with the privileges configured in the request body.
|
|
215
|
+
*
|
|
216
|
+
* Returns `409 Conflict` if an active invitation already exists for this email in your Platform, and `422 Unprocessable Entity` if the person is already linked to a platform user.
|
|
217
|
+
*
|
|
218
|
+
* **Required permission:** `Ibl.CRM/Invite/action`.
|
|
219
|
+
* @returns PersonInviteResponse
|
|
220
|
+
* @throws ApiError
|
|
221
|
+
*/
|
|
222
|
+
public static personsInviteCreate({
|
|
223
|
+
id,
|
|
224
|
+
requestBody,
|
|
225
|
+
}: {
|
|
226
|
+
id: string,
|
|
227
|
+
requestBody?: PersonInviteRequest,
|
|
228
|
+
}): CancelablePromise<PersonInviteResponse> {
|
|
229
|
+
return __request(OpenAPI, {
|
|
230
|
+
method: 'POST',
|
|
231
|
+
url: '/persons/{id}/invite/',
|
|
232
|
+
path: {
|
|
233
|
+
'id': id,
|
|
234
|
+
},
|
|
235
|
+
body: requestBody,
|
|
236
|
+
mediaType: 'application/json',
|
|
237
|
+
errors: {
|
|
238
|
+
400: `Person has no \`primary_email\`; cannot invite.`,
|
|
239
|
+
403: `Missing required permission \`Ibl.CRM/Invite/action\`.`,
|
|
240
|
+
404: `Person not found.`,
|
|
241
|
+
422: `Person is already linked to a platform user.`,
|
|
242
|
+
},
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Bind a person to an existing platform user
|
|
247
|
+
* Links this person to an existing platform user. The target user must already be a member of your Platform — if they are not, send them an invitation via `POST /persons/{id}/invite/` instead.
|
|
248
|
+
*
|
|
249
|
+
* This call is idempotent: linking a person that is already bound to the same user is a no-op. Re-linking a person that is already bound to a *different* user is refused; the existing binding is preserved and the unchanged person is returned.
|
|
250
|
+
*
|
|
251
|
+
* **Required permission:** `Ibl.CRM/Persons/write`.
|
|
252
|
+
* @returns Person
|
|
253
|
+
* @throws ApiError
|
|
254
|
+
*/
|
|
255
|
+
public static personsLinkUserCreate({
|
|
256
|
+
id,
|
|
257
|
+
requestBody,
|
|
258
|
+
}: {
|
|
259
|
+
id: string,
|
|
260
|
+
requestBody: PersonLinkUserRequest,
|
|
261
|
+
}): CancelablePromise<Person> {
|
|
262
|
+
return __request(OpenAPI, {
|
|
263
|
+
method: 'POST',
|
|
264
|
+
url: '/persons/{id}/link-user/',
|
|
265
|
+
path: {
|
|
266
|
+
'id': id,
|
|
267
|
+
},
|
|
268
|
+
body: requestBody,
|
|
269
|
+
mediaType: 'application/json',
|
|
270
|
+
errors: {
|
|
271
|
+
400: `Validation error.`,
|
|
272
|
+
403: `Missing required permission \`Ibl.CRM/Persons/write\`, or the target user is not a member of your Platform.`,
|
|
273
|
+
404: `Person or user not found.`,
|
|
274
|
+
},
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Merge duplicate persons into a primary
|
|
279
|
+
* Marks each person in `duplicate_ids` as inactive and reports how many related records (deals, activities, tags) were re-parented onto `primary_id`.
|
|
280
|
+
*
|
|
281
|
+
* All ids — both the primary and every duplicate — must belong to your Platform. `primary_id` may not appear in `duplicate_ids`.
|
|
282
|
+
*
|
|
283
|
+
* **Required permission:** `Ibl.CRM/Persons/write`.
|
|
284
|
+
* @returns PersonMergeResponse
|
|
285
|
+
* @throws ApiError
|
|
286
|
+
*/
|
|
287
|
+
public static personsMergeCreate({
|
|
288
|
+
requestBody,
|
|
289
|
+
}: {
|
|
290
|
+
requestBody: PersonMergeRequest,
|
|
291
|
+
}): CancelablePromise<PersonMergeResponse> {
|
|
292
|
+
return __request(OpenAPI, {
|
|
293
|
+
method: 'POST',
|
|
294
|
+
url: '/persons/merge/',
|
|
295
|
+
body: requestBody,
|
|
296
|
+
mediaType: 'application/json',
|
|
297
|
+
errors: {
|
|
298
|
+
400: `Validation error: the primary appears in duplicates, or one or more ids belong to another Platform.`,
|
|
299
|
+
403: `Missing required permission \`Ibl.CRM/Persons/write\`.`,
|
|
300
|
+
404: `Primary person not found.`,
|
|
301
|
+
},
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
}
|