@iblai/iblai-api 4.488.0-ai → 4.489.0-ai

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.
Files changed (33) hide show
  1. package/dist/index.cjs.js +172 -45
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +173 -46
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.umd.js +172 -45
  6. package/dist/index.umd.js.map +1 -1
  7. package/dist/types/index.d.ts +6 -1
  8. package/dist/types/models/ChannelIdentity.d.ts +10 -0
  9. package/dist/types/models/ChannelIdentityPreview.d.ts +12 -0
  10. package/dist/types/models/ChannelIdentityRedeem.d.ts +6 -0
  11. package/dist/types/models/LinkedViaEnum.d.ts +8 -0
  12. package/dist/types/models/NotificationTemplateDetail.d.ts +3 -2
  13. package/dist/types/models/NotificationTemplateList.d.ts +3 -2
  14. package/dist/types/models/PaginatedChannelIdentities.d.ts +7 -0
  15. package/dist/types/models/PatchedNotificationTemplateDetail.d.ts +3 -2
  16. package/dist/types/models/{Type6d9Enum.d.ts → TypeCb4Enum.d.ts} +3 -1
  17. package/dist/types/services/V1AgentsService.d.ts +2 -2
  18. package/dist/types/services/V1ChannelsService.d.ts +88 -0
  19. package/package.json +1 -1
  20. package/sdk_schema.yml +320 -6
  21. package/src/core/OpenAPI.ts +1 -1
  22. package/src/index.ts +6 -1
  23. package/src/models/ChannelIdentity.ts +15 -0
  24. package/src/models/ChannelIdentityPreview.ts +17 -0
  25. package/src/models/ChannelIdentityRedeem.ts +11 -0
  26. package/src/models/LinkedViaEnum.ts +12 -0
  27. package/src/models/NotificationTemplateDetail.ts +3 -2
  28. package/src/models/NotificationTemplateList.ts +3 -2
  29. package/src/models/PaginatedChannelIdentities.ts +12 -0
  30. package/src/models/PatchedNotificationTemplateDetail.ts +3 -2
  31. package/src/models/{Type6d9Enum.ts → TypeCb4Enum.ts} +3 -1
  32. package/src/services/V1AgentsService.ts +2 -2
  33. package/src/services/V1ChannelsService.ts +171 -0
@@ -0,0 +1,15 @@
1
+ /* generated using openapi-typescript-codegen -- do not edit */
2
+ /* istanbul ignore file */
3
+ /* tslint:disable */
4
+ /* eslint-disable */
5
+ import type { ChannelEnum } from './ChannelEnum';
6
+ import type { LinkedViaEnum } from './LinkedViaEnum';
7
+ export type ChannelIdentity = {
8
+ readonly identity_id: number;
9
+ channel: ChannelEnum;
10
+ external_id: string;
11
+ linked_via: LinkedViaEnum;
12
+ readonly created_at: string;
13
+ last_seen_at?: string | null;
14
+ };
15
+
@@ -0,0 +1,17 @@
1
+ /* generated using openapi-typescript-codegen -- do not edit */
2
+ /* istanbul ignore file */
3
+ /* tslint:disable */
4
+ /* eslint-disable */
5
+ /**
6
+ * What redeeming a code would link, for the user to confirm first.
7
+ */
8
+ export type ChannelIdentityPreview = {
9
+ channel: string;
10
+ /**
11
+ * The chat account the code was sent to.
12
+ */
13
+ external_id: string;
14
+ agent_id: string;
15
+ agent_name: string;
16
+ };
17
+
@@ -0,0 +1,11 @@
1
+ /* generated using openapi-typescript-codegen -- do not edit */
2
+ /* istanbul ignore file */
3
+ /* tslint:disable */
4
+ /* eslint-disable */
5
+ export type ChannelIdentityRedeem = {
6
+ /**
7
+ * The pairing code the agent's bot sent to the chat account.
8
+ */
9
+ code: string;
10
+ };
11
+
@@ -0,0 +1,12 @@
1
+ /* generated using openapi-typescript-codegen -- do not edit */
2
+ /* istanbul ignore file */
3
+ /* tslint:disable */
4
+ /* eslint-disable */
5
+ /**
6
+ * * `pairing` - Pairing code
7
+ * * `auto_email` - Email auto-link
8
+ */
9
+ export enum LinkedViaEnum {
10
+ PAIRING = 'pairing',
11
+ AUTO_EMAIL = 'auto_email',
12
+ }
@@ -10,7 +10,7 @@ import type { HumanSupportRecipientModeEnum } from './HumanSupportRecipientModeE
10
10
  import type { NullEnum } from './NullEnum';
11
11
  import type { RecipientsRecipientModeEnum } from './RecipientsRecipientModeEnum';
12
12
  import type { Spa } from './Spa';
13
- import type { Type6d9Enum } from './Type6d9Enum';
13
+ import type { TypeCb4Enum } from './TypeCb4Enum';
14
14
  /**
15
15
  * Serializer for detailed template view and editing
16
16
  */
@@ -26,6 +26,7 @@ export type NotificationTemplateDetail = {
26
26
  * * `ACTIVITY_NEW_CONTENT` - Activity New Content
27
27
  * * `ADMIN_NOTIF_COURSE_ENROLLMENT` - Admin Notif Course Enrollment
28
28
  * * `APP_REGISTRATION` - App Registration
29
+ * * `CHANNEL_ACCOUNT_LINKED` - Channel Account Linked
29
30
  * * `COURSE_INVITATION` - Course Invitation
30
31
  * * `COURSE_LICENSE_ASSIGNMENT` - Course License Assignment
31
32
  * * `COURSE_LICENSE_GROUP_ASSIGNMENT` - Course License Group Assignment
@@ -62,7 +63,7 @@ export type NotificationTemplateDetail = {
62
63
  * * `USER_NOTIF_USER_REGISTRATION` - User Notif User Registration
63
64
  * * `COURSES_PROGRESS_SUMMARY` - User Progress Summary
64
65
  */
65
- readonly type: (Type6d9Enum | NullEnum) | null;
66
+ readonly type: (TypeCb4Enum | NullEnum) | null;
66
67
  /**
67
68
  * Template display name
68
69
  */
@@ -4,7 +4,7 @@
4
4
  /* eslint-disable */
5
5
  import type { BlankEnum } from './BlankEnum';
6
6
  import type { NullEnum } from './NullEnum';
7
- import type { Type6d9Enum } from './Type6d9Enum';
7
+ import type { TypeCb4Enum } from './TypeCb4Enum';
8
8
  /**
9
9
  * Serializer for listing notification templates with inheritance info
10
10
  */
@@ -20,6 +20,7 @@ export type NotificationTemplateList = {
20
20
  * * `ACTIVITY_NEW_CONTENT` - Activity New Content
21
21
  * * `ADMIN_NOTIF_COURSE_ENROLLMENT` - Admin Notif Course Enrollment
22
22
  * * `APP_REGISTRATION` - App Registration
23
+ * * `CHANNEL_ACCOUNT_LINKED` - Channel Account Linked
23
24
  * * `COURSE_INVITATION` - Course Invitation
24
25
  * * `COURSE_LICENSE_ASSIGNMENT` - Course License Assignment
25
26
  * * `COURSE_LICENSE_GROUP_ASSIGNMENT` - Course License Group Assignment
@@ -56,7 +57,7 @@ export type NotificationTemplateList = {
56
57
  * * `USER_NOTIF_USER_REGISTRATION` - User Notif User Registration
57
58
  * * `COURSES_PROGRESS_SUMMARY` - User Progress Summary
58
59
  */
59
- type?: (Type6d9Enum | BlankEnum | NullEnum) | null;
60
+ type?: (TypeCb4Enum | BlankEnum | NullEnum) | null;
60
61
  /**
61
62
  * A friendly name for the notification template.
62
63
  */
@@ -0,0 +1,12 @@
1
+ /* generated using openapi-typescript-codegen -- do not edit */
2
+ /* istanbul ignore file */
3
+ /* tslint:disable */
4
+ /* eslint-disable */
5
+ import type { ChannelIdentity } from './ChannelIdentity';
6
+ export type PaginatedChannelIdentities = {
7
+ results: Array<ChannelIdentity>;
8
+ count: number;
9
+ next_page: number | null;
10
+ previous_page: number | null;
11
+ };
12
+
@@ -10,7 +10,7 @@ import type { HumanSupportRecipientModeEnum } from './HumanSupportRecipientModeE
10
10
  import type { NullEnum } from './NullEnum';
11
11
  import type { RecipientsRecipientModeEnum } from './RecipientsRecipientModeEnum';
12
12
  import type { Spa } from './Spa';
13
- import type { Type6d9Enum } from './Type6d9Enum';
13
+ import type { TypeCb4Enum } from './TypeCb4Enum';
14
14
  /**
15
15
  * Serializer for detailed template view and editing
16
16
  */
@@ -26,6 +26,7 @@ export type PatchedNotificationTemplateDetail = {
26
26
  * * `ACTIVITY_NEW_CONTENT` - Activity New Content
27
27
  * * `ADMIN_NOTIF_COURSE_ENROLLMENT` - Admin Notif Course Enrollment
28
28
  * * `APP_REGISTRATION` - App Registration
29
+ * * `CHANNEL_ACCOUNT_LINKED` - Channel Account Linked
29
30
  * * `COURSE_INVITATION` - Course Invitation
30
31
  * * `COURSE_LICENSE_ASSIGNMENT` - Course License Assignment
31
32
  * * `COURSE_LICENSE_GROUP_ASSIGNMENT` - Course License Group Assignment
@@ -62,7 +63,7 @@ export type PatchedNotificationTemplateDetail = {
62
63
  * * `USER_NOTIF_USER_REGISTRATION` - User Notif User Registration
63
64
  * * `COURSES_PROGRESS_SUMMARY` - User Progress Summary
64
65
  */
65
- readonly type?: (Type6d9Enum | NullEnum) | null;
66
+ readonly type?: (TypeCb4Enum | NullEnum) | null;
66
67
  /**
67
68
  * Template display name
68
69
  */
@@ -7,6 +7,7 @@
7
7
  * * `ACTIVITY_NEW_CONTENT` - Activity New Content
8
8
  * * `ADMIN_NOTIF_COURSE_ENROLLMENT` - Admin Notif Course Enrollment
9
9
  * * `APP_REGISTRATION` - App Registration
10
+ * * `CHANNEL_ACCOUNT_LINKED` - Channel Account Linked
10
11
  * * `COURSE_INVITATION` - Course Invitation
11
12
  * * `COURSE_LICENSE_ASSIGNMENT` - Course License Assignment
12
13
  * * `COURSE_LICENSE_GROUP_ASSIGNMENT` - Course License Group Assignment
@@ -43,11 +44,12 @@
43
44
  * * `USER_NOTIF_USER_REGISTRATION` - User Notif User Registration
44
45
  * * `COURSES_PROGRESS_SUMMARY` - User Progress Summary
45
46
  */
46
- export enum Type6d9Enum {
47
+ export enum TypeCb4Enum {
47
48
  ACTIVITY_COURSE_MILESTONE = 'ACTIVITY_COURSE_MILESTONE',
48
49
  ACTIVITY_NEW_CONTENT = 'ACTIVITY_NEW_CONTENT',
49
50
  ADMIN_NOTIF_COURSE_ENROLLMENT = 'ADMIN_NOTIF_COURSE_ENROLLMENT',
50
51
  APP_REGISTRATION = 'APP_REGISTRATION',
52
+ CHANNEL_ACCOUNT_LINKED = 'CHANNEL_ACCOUNT_LINKED',
51
53
  COURSE_INVITATION = 'COURSE_INVITATION',
52
54
  COURSE_LICENSE_ASSIGNMENT = 'COURSE_LICENSE_ASSIGNMENT',
53
55
  COURSE_LICENSE_GROUP_ASSIGNMENT = 'COURSE_LICENSE_GROUP_ASSIGNMENT',
@@ -263,8 +263,8 @@ export class V1AgentsService {
263
263
  }
264
264
  /**
265
265
  * Allow a sender to reach an agent channel
266
- * The sender id is normalised to the form the channel's connector reads. Allowing a sender doesn't link them to a user: identity and RBAC still apply. Requires Ibl.Mentor/AgentChannelAccess/action.
267
- * @returns ChannelAllowEntry
266
+ * The sender id is normalised to the form the channel's connector reads. Allowing a sender doesn't link them to a user: identity and RBAC still apply. A sender already allowed through pairing or email becomes an admin's entry, which unlinking keeps. Requires Ibl.Mentor/AgentChannelAccess/action.
267
+ * @returns ChannelAllowEntry Already allowed through pairing or email; now an admin's
268
268
  * @throws ApiError
269
269
  */
270
270
  public static v1AgentsChannelsAllowEntriesCreate({
@@ -4,8 +4,12 @@
4
4
  /* eslint-disable */
5
5
  import type { ChannelCredential } from '../models/ChannelCredential';
6
6
  import type { ChannelCredentialCreate } from '../models/ChannelCredentialCreate';
7
+ import type { ChannelIdentity } from '../models/ChannelIdentity';
8
+ import type { ChannelIdentityPreview } from '../models/ChannelIdentityPreview';
9
+ import type { ChannelIdentityRedeem } from '../models/ChannelIdentityRedeem';
7
10
  import type { PaginatedChannelCatalog } from '../models/PaginatedChannelCatalog';
8
11
  import type { PaginatedChannelCredentials } from '../models/PaginatedChannelCredentials';
12
+ import type { PaginatedChannelIdentities } from '../models/PaginatedChannelIdentities';
9
13
  import type { PatchedChannelCredentialUpdate } from '../models/PatchedChannelCredentialUpdate';
10
14
  import type { CancelablePromise } from '../core/CancelablePromise';
11
15
  import { OpenAPI } from '../core/OpenAPI';
@@ -219,4 +223,171 @@ export class V1ChannelsService {
219
223
  },
220
224
  });
221
225
  }
226
+ /**
227
+ * List a user's linked chat accounts
228
+ * The chat accounts linked to the target user on this platform, newest first. Requires Ibl.Mentor/ChannelIdentities/list; a user holds it for their own.
229
+ * @returns PaginatedChannelIdentities
230
+ * @throws ApiError
231
+ */
232
+ public static v1ChannelsIdentitiesRetrieve({
233
+ channel,
234
+ dateFilter,
235
+ endDate,
236
+ iblaiOrg,
237
+ iblaiUser,
238
+ startDate,
239
+ }: {
240
+ /**
241
+ * * `msteams` - Microsoft Teams
242
+ * * `email` - Email
243
+ * * `whatsapp` - WhatsApp
244
+ * * `slack` - Slack
245
+ * * `googlechat` - Google Chat
246
+ * * `twilio` - Twilio SMS
247
+ * * `telegram` - Telegram
248
+ */
249
+ channel?: 'msteams' | 'email' | 'whatsapp' | 'slack' | 'googlechat' | 'twilio' | 'telegram',
250
+ /**
251
+ * * `today` - Today only
252
+ * * `7d` - Last 7 days
253
+ * * `30d` - Last 30 days
254
+ * * `90d` - Last 90 days
255
+ * * `all_time` - All time
256
+ * * `custom` - Custom date range
257
+ */
258
+ dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom',
259
+ endDate?: string,
260
+ /**
261
+ * Platform key. Required for service accounts. Other callers are scoped to their token's platform and get 403 if this names another.
262
+ */
263
+ iblaiOrg?: string,
264
+ /**
265
+ * Username whose linked accounts to act on. Defaults to the caller; required for service accounts.
266
+ */
267
+ iblaiUser?: string,
268
+ startDate?: string,
269
+ }): CancelablePromise<PaginatedChannelIdentities> {
270
+ return __request(OpenAPI, {
271
+ method: 'GET',
272
+ url: '/v1/channels/identities',
273
+ headers: {
274
+ 'iblai-org': iblaiOrg,
275
+ 'iblai-user': iblaiUser,
276
+ },
277
+ query: {
278
+ 'channel': channel,
279
+ 'date_filter': dateFilter,
280
+ 'end_date': endDate,
281
+ 'start_date': startDate,
282
+ },
283
+ errors: {
284
+ 403: `Not allowed; also any unknown user, unless 404 applies`,
285
+ 404: `No such user, for callers who may list any user's linked accounts and for service accounts`,
286
+ },
287
+ });
288
+ }
289
+ /**
290
+ * Link a chat account by redeeming a pairing code
291
+ * Links the chat account the agent's bot sent the code to, and lets it reach that agent. Call the preview first and ask the user to confirm the account is theirs. For the caller only: iblai-user may only name the caller, and service accounts can't redeem. Requires an active membership of the platform and Ibl.Mentor/ChannelIdentities/action, which a user holds for their own. Attempts are limited per hour.
292
+ * @returns ChannelIdentity
293
+ * @throws ApiError
294
+ */
295
+ public static v1ChannelsIdentitiesCreate({
296
+ requestBody,
297
+ iblaiOrg,
298
+ iblaiUser,
299
+ }: {
300
+ requestBody: ChannelIdentityRedeem,
301
+ /**
302
+ * Platform key. Required for service accounts. Other callers are scoped to their token's platform and get 403 if this names another.
303
+ */
304
+ iblaiOrg?: string,
305
+ /**
306
+ * Username whose linked accounts to act on. Defaults to the caller; required for service accounts.
307
+ */
308
+ iblaiUser?: string,
309
+ }): CancelablePromise<ChannelIdentity> {
310
+ return __request(OpenAPI, {
311
+ method: 'POST',
312
+ url: '/v1/channels/identities',
313
+ headers: {
314
+ 'iblai-org': iblaiOrg,
315
+ 'iblai-user': iblaiUser,
316
+ },
317
+ body: requestBody,
318
+ mediaType: 'application/json',
319
+ errors: {
320
+ 400: `The code is invalid or has expired`,
321
+ 403: `Not the caller's own account`,
322
+ 429: `Too many attempts this hour`,
323
+ },
324
+ });
325
+ }
326
+ /**
327
+ * Unlink a chat account
328
+ * The account stops acting as its user and leaves the allowlists it joined by pairing or email auto-link; entries an admin added stay. Requires Ibl.Mentor/ChannelIdentities/delete; a user holds it for their own.
329
+ * @returns void
330
+ * @throws ApiError
331
+ */
332
+ public static v1ChannelsIdentitiesDestroy({
333
+ identityId,
334
+ iblaiOrg,
335
+ }: {
336
+ identityId: number,
337
+ /**
338
+ * Platform key. Required for service accounts. Other callers are scoped to their token's platform and get 403 if this names another.
339
+ */
340
+ iblaiOrg?: string,
341
+ }): CancelablePromise<void> {
342
+ return __request(OpenAPI, {
343
+ method: 'DELETE',
344
+ url: '/v1/channels/identities/{identity_id}',
345
+ path: {
346
+ 'identity_id': identityId,
347
+ },
348
+ headers: {
349
+ 'iblai-org': iblaiOrg,
350
+ },
351
+ errors: {
352
+ 404: `No such linked account, or not visible`,
353
+ },
354
+ });
355
+ }
356
+ /**
357
+ * Preview the chat account a pairing code would link
358
+ * Returns the channel, chat account and agent the code was sent for, changing nothing, so the user can confirm the account is theirs before redeeming. Only phone numbers and email addresses are recognisable; on other channels the page must also say: only enter a code the bot sent to you, never one someone gave you. Same access, refusals and hourly attempt limit as redeeming, which it counts toward. A POST, so the code stays out of URLs and logs.
359
+ * @returns ChannelIdentityPreview
360
+ * @throws ApiError
361
+ */
362
+ public static v1ChannelsIdentitiesPreviewCreate({
363
+ requestBody,
364
+ iblaiOrg,
365
+ iblaiUser,
366
+ }: {
367
+ requestBody: ChannelIdentityRedeem,
368
+ /**
369
+ * Platform key. Required for service accounts. Other callers are scoped to their token's platform and get 403 if this names another.
370
+ */
371
+ iblaiOrg?: string,
372
+ /**
373
+ * Username whose linked accounts to act on. Defaults to the caller; required for service accounts.
374
+ */
375
+ iblaiUser?: string,
376
+ }): CancelablePromise<ChannelIdentityPreview> {
377
+ return __request(OpenAPI, {
378
+ method: 'POST',
379
+ url: '/v1/channels/identities/preview',
380
+ headers: {
381
+ 'iblai-org': iblaiOrg,
382
+ 'iblai-user': iblaiUser,
383
+ },
384
+ body: requestBody,
385
+ mediaType: 'application/json',
386
+ errors: {
387
+ 400: `The code is invalid or has expired`,
388
+ 403: `Not the caller's own account`,
389
+ 429: `Too many attempts this hour`,
390
+ },
391
+ });
392
+ }
222
393
  }