@proteos/sdk 0.47.0 → 0.48.0

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.
@@ -1430,6 +1430,7 @@ declare const LayoutElementType: {
1430
1430
  readonly Text: "text";
1431
1431
  readonly RecordFilter: "record_filter";
1432
1432
  readonly List: "list";
1433
+ readonly WorkflowTrigger: "workflow_trigger";
1433
1434
  };
1434
1435
  type LayoutElementType = (typeof LayoutElementType)[keyof typeof LayoutElementType];
1435
1436
  type RowElement = CommonProps & {
@@ -1471,11 +1472,19 @@ type CardElement = CommonProps & {
1471
1472
  default_collapsed?: boolean;
1472
1473
  content: LayoutElement;
1473
1474
  };
1475
+ /**
1476
+ * One switchable view inside a `tabs` element. `visible_when` hides the tab
1477
+ * when it does not match the record; `default_when` makes it the initially
1478
+ * shown tab when it matches. Both are evaluated live against the record being
1479
+ * viewed or edited. Resolution order: first visible tab (document order) whose
1480
+ * `default_when` matches → `TabsElement.default_tab_id` → first visible tab.
1481
+ */
1474
1482
  type LayoutTab = {
1475
1483
  id: string;
1476
1484
  label: string;
1477
1485
  icon?: string;
1478
1486
  visible_when?: FilterGroup;
1487
+ default_when?: FilterGroup;
1479
1488
  content: LayoutElement;
1480
1489
  };
1481
1490
  type TabsElement = CommonProps & {
@@ -1617,13 +1626,35 @@ type ListElement = CommonProps & {
1617
1626
  type DividerElement = CommonProps & {
1618
1627
  type: 'divider';
1619
1628
  };
1629
+ /**
1630
+ * An always-visible button that starts a manual run of `workflow` (by key) —
1631
+ * the in-layout counterpart of a `kind: workflow` toolbar action. `inputs`
1632
+ * maps the manual trigger's input_schema field names to Liquid templates
1633
+ * rendered against the page scope; `skip_confirmation` fires immediately when
1634
+ * every required input resolves. While the run is in flight the element shows
1635
+ * the step progress inline in place of the button.
1636
+ */
1637
+ type WorkflowTriggerElement = CommonProps & {
1638
+ type: 'workflow_trigger';
1639
+ workflow: string;
1640
+ label: string;
1641
+ icon?: string;
1642
+ inputs?: Record<string, string>;
1643
+ skip_confirmation?: boolean;
1644
+ /**
1645
+ * Optional string attribute on the page's record where the element persists
1646
+ * the id of the execution it starts — and reads it back, so progress
1647
+ * survives reloads and is shared by every viewer. Record pages only.
1648
+ */
1649
+ execution_attribute?: string;
1650
+ };
1620
1651
  type TextVariant = 'heading' | 'subheading' | 'body' | 'caption' | 'callout';
1621
1652
  type TextElement = CommonProps & {
1622
1653
  type: 'text';
1623
1654
  variant: TextVariant;
1624
1655
  content: string;
1625
1656
  };
1626
- type LayoutElement = RowElement | ColumnElement | SectionElement | CardElement | TabsElement | FieldElement | RelatedListElement | RelatedRecordElement | ComponentElement | DividerElement | TextElement | RecordFilterElement | ListElement;
1657
+ type LayoutElement = RowElement | ColumnElement | SectionElement | CardElement | TabsElement | FieldElement | RelatedListElement | RelatedRecordElement | ComponentElement | DividerElement | TextElement | RecordFilterElement | ListElement | WorkflowTriggerElement;
1627
1658
  declare const LayoutElementSchema: z.ZodType<LayoutElement>;
1628
1659
 
1629
1660
  /**
@@ -3188,20 +3219,20 @@ declare const PageActionSchema: z.ZodObject<{
3188
3219
  label: string;
3189
3220
  icon: string;
3190
3221
  params?: Record<string, string> | undefined;
3191
- action?: string | undefined;
3192
3222
  workflow?: string | undefined;
3193
- kind?: "action" | "workflow" | undefined;
3194
3223
  inputs?: Record<string, string> | undefined;
3195
3224
  skip_confirmation?: boolean | undefined;
3225
+ action?: string | undefined;
3226
+ kind?: "workflow" | "action" | undefined;
3196
3227
  }, {
3197
3228
  label: string;
3198
3229
  icon: string;
3199
3230
  params?: Record<string, string> | undefined;
3200
- action?: string | undefined;
3201
3231
  workflow?: string | undefined;
3202
- kind?: "action" | "workflow" | undefined;
3203
3232
  inputs?: Record<string, string> | undefined;
3204
3233
  skip_confirmation?: boolean | undefined;
3234
+ action?: string | undefined;
3235
+ kind?: "workflow" | "action" | undefined;
3205
3236
  }>;
3206
3237
  /**
3207
3238
  * Whether a list's rows can be checked, and whether the checkboxes show from
@@ -3314,20 +3345,20 @@ declare const ListSchema: z.ZodObject<{
3314
3345
  label: string;
3315
3346
  icon: string;
3316
3347
  params?: Record<string, string> | undefined;
3317
- action?: string | undefined;
3318
3348
  workflow?: string | undefined;
3319
- kind?: "action" | "workflow" | undefined;
3320
3349
  inputs?: Record<string, string> | undefined;
3321
3350
  skip_confirmation?: boolean | undefined;
3351
+ action?: string | undefined;
3352
+ kind?: "workflow" | "action" | undefined;
3322
3353
  }, {
3323
3354
  label: string;
3324
3355
  icon: string;
3325
3356
  params?: Record<string, string> | undefined;
3326
- action?: string | undefined;
3327
3357
  workflow?: string | undefined;
3328
- kind?: "action" | "workflow" | undefined;
3329
3358
  inputs?: Record<string, string> | undefined;
3330
3359
  skip_confirmation?: boolean | undefined;
3360
+ action?: string | undefined;
3361
+ kind?: "workflow" | "action" | undefined;
3331
3362
  }>, "many">>;
3332
3363
  selection_mode: z.ZodOptional<z.ZodEnum<["on_demand", "always", "off"]>>;
3333
3364
  default_page_slug: z.ZodOptional<z.ZodString>;
@@ -3371,11 +3402,11 @@ declare const ListSchema: z.ZodObject<{
3371
3402
  label: string;
3372
3403
  icon: string;
3373
3404
  params?: Record<string, string> | undefined;
3374
- action?: string | undefined;
3375
3405
  workflow?: string | undefined;
3376
- kind?: "action" | "workflow" | undefined;
3377
3406
  inputs?: Record<string, string> | undefined;
3378
3407
  skip_confirmation?: boolean | undefined;
3408
+ action?: string | undefined;
3409
+ kind?: "workflow" | "action" | undefined;
3379
3410
  }[] | undefined;
3380
3411
  selection_mode?: "on_demand" | "always" | "off" | undefined;
3381
3412
  default_page_slug?: string | undefined;
@@ -3408,11 +3439,11 @@ declare const ListSchema: z.ZodObject<{
3408
3439
  label: string;
3409
3440
  icon: string;
3410
3441
  params?: Record<string, string> | undefined;
3411
- action?: string | undefined;
3412
3442
  workflow?: string | undefined;
3413
- kind?: "action" | "workflow" | undefined;
3414
3443
  inputs?: Record<string, string> | undefined;
3415
3444
  skip_confirmation?: boolean | undefined;
3445
+ action?: string | undefined;
3446
+ kind?: "workflow" | "action" | undefined;
3416
3447
  }[] | undefined;
3417
3448
  selection_mode?: "on_demand" | "always" | "off" | undefined;
3418
3449
  default_page_slug?: string | undefined;
@@ -3677,20 +3708,20 @@ declare const PageSchema: z.ZodObject<{
3677
3708
  label: string;
3678
3709
  icon: string;
3679
3710
  params?: Record<string, string> | undefined;
3680
- action?: string | undefined;
3681
3711
  workflow?: string | undefined;
3682
- kind?: "action" | "workflow" | undefined;
3683
3712
  inputs?: Record<string, string> | undefined;
3684
3713
  skip_confirmation?: boolean | undefined;
3714
+ action?: string | undefined;
3715
+ kind?: "workflow" | "action" | undefined;
3685
3716
  }, {
3686
3717
  label: string;
3687
3718
  icon: string;
3688
3719
  params?: Record<string, string> | undefined;
3689
- action?: string | undefined;
3690
3720
  workflow?: string | undefined;
3691
- kind?: "action" | "workflow" | undefined;
3692
3721
  inputs?: Record<string, string> | undefined;
3693
3722
  skip_confirmation?: boolean | undefined;
3723
+ action?: string | undefined;
3724
+ kind?: "workflow" | "action" | undefined;
3694
3725
  }>, "many">;
3695
3726
  layout: z.ZodObject<{
3696
3727
  version: z.ZodLiteral<1>;
@@ -3772,11 +3803,11 @@ declare const PageSchema: z.ZodObject<{
3772
3803
  label: string;
3773
3804
  icon: string;
3774
3805
  params?: Record<string, string> | undefined;
3775
- action?: string | undefined;
3776
3806
  workflow?: string | undefined;
3777
- kind?: "action" | "workflow" | undefined;
3778
3807
  inputs?: Record<string, string> | undefined;
3779
3808
  skip_confirmation?: boolean | undefined;
3809
+ action?: string | undefined;
3810
+ kind?: "workflow" | "action" | undefined;
3780
3811
  }[];
3781
3812
  layout: {
3782
3813
  version: 1;
@@ -3813,11 +3844,11 @@ declare const PageSchema: z.ZodObject<{
3813
3844
  label: string;
3814
3845
  icon: string;
3815
3846
  params?: Record<string, string> | undefined;
3816
- action?: string | undefined;
3817
3847
  workflow?: string | undefined;
3818
- kind?: "action" | "workflow" | undefined;
3819
3848
  inputs?: Record<string, string> | undefined;
3820
3849
  skip_confirmation?: boolean | undefined;
3850
+ action?: string | undefined;
3851
+ kind?: "workflow" | "action" | undefined;
3821
3852
  }[];
3822
3853
  layout: {
3823
3854
  version: 1;
@@ -4255,4 +4286,4 @@ declare function isCurrentUserDefault(value: unknown): value is CurrentUserDefau
4255
4286
  /** Only the identity-valued attribute types can carry the sentinel. */
4256
4287
  declare function acceptsCurrentUserDefault(type: AttributeType): boolean;
4257
4288
 
4258
- export { type EntityWithSchema as $, type AuditFields as A, type CreateListViewRequest as B, CURRENT_USER_DEFAULT as C, type CreateMenuConfigurationRequest as D, type CreatePageRequest as E, type FileRef as F, type CreateVariableRequest as G, type CurrencyAttributeMeta as H, CurrencyAttributeMetaSchema as I, type CurrencySymbolSide as J, type CurrencyValue as K, type ListOptions as L, type CurrentUserDefault as M, DEFAULT_OPTIONS as N, DEFAULT_PAGE_SIZE as O, PageIterator as P, DONE as Q, type DeployModuleRequest as R, type DesignReference as S, type DesignReferenceContent as T, type UserRef as U, DesignReferenceSchema as V, type DesignReferenceService as W, type Done as X, type Entity as Y, EntitySchema as Z, type EntityService as _, type Attribute as a, type Timestamps as a$, EntityWithSchemaSchema as a0, type EnumAttributeMeta as a1, type EnumValue as a2, type FileAttributeMeta as a3, FileRefSchema as a4, type FilterElement as a5, FilterElementSchema as a6, type FilterGroup as a7, FilterGroupSchema as a8, type List as a9, ModuleSchema as aA, type ModuleService as aB, type ModuleStatus as aC, type OnDeleteAction as aD, OnDeleteActionSchema as aE, PLATFORM_ATTRIBUTE_NAMES as aF, PLATFORM_USER_ID as aG, type Page as aH, type PageAction as aI, type PageActionKind as aJ, PageActionSchema as aK, type PageLayout as aL, PageLayoutSchema as aM, PageSchema as aN, type PageService as aO, type PageType as aP, type PublicPageComponent as aQ, type PublicPageResponse as aR, type RelationAttributeMeta as aS, RelationAttributeMetaSchema as aT, type RequestOptions as aU, type ResolvedClientOptions as aV, type ResponseMeta as aW, ResponseMetaSchema as aX, type SortConfig as aY, SortConfigSchema as aZ, type SortDirection as a_, type ListAppsOptions as aa, type ListComponentsOptions as ab, type ListDesignReferencesOptions as ac, type ListEntitiesOptions as ad, type ListFn as ae, type ListListViewsOptions as af, type ListListsOptions as ag, type ListMenuConfigurationsOptions as ah, type ListModulesOptions as ai, type ListPagesOptions as aj, ListSchema as ak, type ListService as al, type ListVariablesOptions as am, type ListView as an, ListViewSchema as ao, type ListViewService as ap, type LogicalOperator as aq, type MenuConfiguration as ar, MenuConfigurationSchema as as, type MenuConfigurationService as at, type MenuItem as au, MenuItemSchema as av, MenuItemType as aw, MetaClient as ax, type MetaListOptions as ay, type Module as az, type ListResult as b, type PrincipalAttributeMeta as b$, type TokenProvider as b0, type UpdateAppRequest as b1, type UpdateComponentRequest as b2, type UpdateDesignReferenceRequest as b3, type UpdateEntityRequest as b4, type UpdateListRequest as b5, type UpdateListViewRequest as b6, type UpdateMenuConfigurationRequest as b7, type UpdatePageRequest as b8, type UpdateVariableRequest as b9, type BuiltInControlSlug as bA, type CardElement as bB, type ColumnElement as bC, type CommonProps as bD, type ComponentElement as bE, type ControlBucket as bF, type DatetimeAttributeMeta as bG, type DatetimeFormat as bH, type DividerElement as bI, type FieldElement as bJ, FileAttributeMetaSchema as bK, type LayoutAlign as bL, type LayoutElement as bM, LayoutElementSchema as bN, LayoutElementType as bO, type LayoutGap as bP, type LayoutJustify as bQ, type LayoutTab as bR, type ListElement as bS, type NumberAttributeMeta as bT, type ObjectAttributeMeta as bU, PAGE_BACKGROUND_TOKENS as bV, type PageBackgroundToken as bW, type PageLayoutSidePanel as bX, PageLayoutSidePanelSchema as bY, type PageStyle as bZ, PageStyleSchema as b_, UserRefSchema as ba, type UserType as bb, type Variable as bc, VariableSchema as bd, type VariableService as be, acceptsCurrentUserDefault as bf, allCurrencyCodes as bg, createIterator as bh, createListResultSchema as bi, currencyLabel as bj, currencySymbol as bk, currencySymbolSide as bl, formatAmount as bm, formatMoney as bn, isCurrentUserDefault as bo, isPlatformAttributeName as bp, localeNumberSeparators as bq, parseAmount as br, parseCurrencyMeta as bs, parseFileMeta as bt, parseRelationMeta as bu, platformAttributes as bv, resolveOptions as bw, type AttributeForLookup as bx, type AttributeMeta as by, BUILT_IN_CONTROLS as bz, ProteosClient as c, type PrincipalType as c0, type RecordFilterElement as c1, type RelatedListElement as c2, type RelatedRecordElement as c3, type ResponsiveSizing as c4, type RowElement as c5, type SectionElement as c6, type SizeValue as c7, SizeValueSchema as c8, type SizingProps as c9, type StringAttributeMeta as ca, type StringFormat as cb, type TabsElement as cc, type TextElement as cd, type TextVariant as ce, type UserAttributeMeta as cf, UserAttributeMetaSchema as cg, isBuiltInControl as ch, lookupCompatibleControls as ci, lookupControls as cj, lookupPrimaryControl as ck, parsePrincipalMeta as cl, parseUserMeta as cm, type PrincipalRef as d, type PublicAccessOperation as e, type App as f, AppSchema as g, type AppService as h, type ArrayAttributeMeta as i, type AttributeAccessRule as j, type AttributeRestrictions as k, AttributeSchema as l, type AttributeType as m, AuditFieldsSchema as n, type ClientOptions as o, type Column as p, ColumnSchema as q, type ComparisonOperator as r, type Component as s, ComponentSchema as t, type ComponentService as u, type CreateAppRequest as v, type CreateComponentRequest as w, type CreateDesignReferenceRequest as x, type CreateEntityRequest as y, type CreateListRequest as z };
4289
+ export { type EntityWithSchema as $, type AuditFields as A, type CreateListViewRequest as B, CURRENT_USER_DEFAULT as C, type CreateMenuConfigurationRequest as D, type CreatePageRequest as E, type FileRef as F, type CreateVariableRequest as G, type CurrencyAttributeMeta as H, CurrencyAttributeMetaSchema as I, type CurrencySymbolSide as J, type CurrencyValue as K, type ListOptions as L, type CurrentUserDefault as M, DEFAULT_OPTIONS as N, DEFAULT_PAGE_SIZE as O, PageIterator as P, DONE as Q, type DeployModuleRequest as R, type DesignReference as S, type DesignReferenceContent as T, type UserRef as U, DesignReferenceSchema as V, type DesignReferenceService as W, type Done as X, type Entity as Y, EntitySchema as Z, type EntityService as _, type Attribute as a, type Timestamps as a$, EntityWithSchemaSchema as a0, type EnumAttributeMeta as a1, type EnumValue as a2, type FileAttributeMeta as a3, FileRefSchema as a4, type FilterElement as a5, FilterElementSchema as a6, type FilterGroup as a7, FilterGroupSchema as a8, type List as a9, ModuleSchema as aA, type ModuleService as aB, type ModuleStatus as aC, type OnDeleteAction as aD, OnDeleteActionSchema as aE, PLATFORM_ATTRIBUTE_NAMES as aF, PLATFORM_USER_ID as aG, type Page as aH, type PageAction as aI, type PageActionKind as aJ, PageActionSchema as aK, type PageLayout as aL, PageLayoutSchema as aM, PageSchema as aN, type PageService as aO, type PageType as aP, type PublicPageComponent as aQ, type PublicPageResponse as aR, type RelationAttributeMeta as aS, RelationAttributeMetaSchema as aT, type RequestOptions as aU, type ResolvedClientOptions as aV, type ResponseMeta as aW, ResponseMetaSchema as aX, type SortConfig as aY, SortConfigSchema as aZ, type SortDirection as a_, type ListAppsOptions as aa, type ListComponentsOptions as ab, type ListDesignReferencesOptions as ac, type ListEntitiesOptions as ad, type ListFn as ae, type ListListViewsOptions as af, type ListListsOptions as ag, type ListMenuConfigurationsOptions as ah, type ListModulesOptions as ai, type ListPagesOptions as aj, ListSchema as ak, type ListService as al, type ListVariablesOptions as am, type ListView as an, ListViewSchema as ao, type ListViewService as ap, type LogicalOperator as aq, type MenuConfiguration as ar, MenuConfigurationSchema as as, type MenuConfigurationService as at, type MenuItem as au, MenuItemSchema as av, MenuItemType as aw, MetaClient as ax, type MetaListOptions as ay, type Module as az, type ListResult as b, type PrincipalAttributeMeta as b$, type TokenProvider as b0, type UpdateAppRequest as b1, type UpdateComponentRequest as b2, type UpdateDesignReferenceRequest as b3, type UpdateEntityRequest as b4, type UpdateListRequest as b5, type UpdateListViewRequest as b6, type UpdateMenuConfigurationRequest as b7, type UpdatePageRequest as b8, type UpdateVariableRequest as b9, type BuiltInControlSlug as bA, type CardElement as bB, type ColumnElement as bC, type CommonProps as bD, type ComponentElement as bE, type ControlBucket as bF, type DatetimeAttributeMeta as bG, type DatetimeFormat as bH, type DividerElement as bI, type FieldElement as bJ, FileAttributeMetaSchema as bK, type LayoutAlign as bL, type LayoutElement as bM, LayoutElementSchema as bN, LayoutElementType as bO, type LayoutGap as bP, type LayoutJustify as bQ, type LayoutTab as bR, type ListElement as bS, type NumberAttributeMeta as bT, type ObjectAttributeMeta as bU, PAGE_BACKGROUND_TOKENS as bV, type PageBackgroundToken as bW, type PageLayoutSidePanel as bX, PageLayoutSidePanelSchema as bY, type PageStyle as bZ, PageStyleSchema as b_, UserRefSchema as ba, type UserType as bb, type Variable as bc, VariableSchema as bd, type VariableService as be, acceptsCurrentUserDefault as bf, allCurrencyCodes as bg, createIterator as bh, createListResultSchema as bi, currencyLabel as bj, currencySymbol as bk, currencySymbolSide as bl, formatAmount as bm, formatMoney as bn, isCurrentUserDefault as bo, isPlatformAttributeName as bp, localeNumberSeparators as bq, parseAmount as br, parseCurrencyMeta as bs, parseFileMeta as bt, parseRelationMeta as bu, platformAttributes as bv, resolveOptions as bw, type AttributeForLookup as bx, type AttributeMeta as by, BUILT_IN_CONTROLS as bz, ProteosClient as c, type PrincipalType as c0, type RecordFilterElement as c1, type RelatedListElement as c2, type RelatedRecordElement as c3, type ResponsiveSizing as c4, type RowElement as c5, type SectionElement as c6, type SizeValue as c7, SizeValueSchema as c8, type SizingProps as c9, type StringAttributeMeta as ca, type StringFormat as cb, type TabsElement as cc, type TextElement as cd, type TextVariant as ce, type UserAttributeMeta as cf, UserAttributeMetaSchema as cg, type WorkflowTriggerElement as ch, isBuiltInControl as ci, lookupCompatibleControls as cj, lookupControls as ck, lookupPrimaryControl as cl, parsePrincipalMeta as cm, parseUserMeta as cn, type PrincipalRef as d, type PublicAccessOperation as e, type App as f, AppSchema as g, type AppService as h, type ArrayAttributeMeta as i, type AttributeAccessRule as j, type AttributeRestrictions as k, AttributeSchema as l, type AttributeType as m, AuditFieldsSchema as n, type ClientOptions as o, type Column as p, ColumnSchema as q, type ComparisonOperator as r, type Component as s, ComponentSchema as t, type ComponentService as u, type CreateAppRequest as v, type CreateComponentRequest as w, type CreateDesignReferenceRequest as x, type CreateEntityRequest as y, type CreateListRequest as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proteos/sdk",
3
- "version": "0.47.0",
3
+ "version": "0.48.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "TypeScript SDK for the Proteos platform",
6
6
  "repository": {
@@ -29,6 +29,7 @@ import type {
29
29
  DeleteConnectionQuery,
30
30
  DispatchMeetingBotRequest,
31
31
  GlossaryTerm,
32
+ InstallConnectionRequest,
32
33
  InstallConnectionResponse,
33
34
  ListAgentListenersQuery,
34
35
  ListConnectionsQuery,
@@ -49,7 +50,11 @@ import type {
49
50
  ListToneProfileSetupsQuery,
50
51
  ListToneProfilesQuery,
51
52
  ListTranscriptionsQuery,
53
+ CallTokenResponse,
52
54
  MaterializeTranscriptionRequest,
55
+ MintCallTokenRequest,
56
+ PhoneNumber,
57
+ UpdatePhoneNumberRequest,
53
58
  MergeContactsRequest,
54
59
  Message,
55
60
  MistranscribedTerm,
@@ -112,6 +117,7 @@ export class ConversationClient {
112
117
  readonly meetings: MeetingService
113
118
  /** Realtime speech-to-text (dictation) — moved here from agent-service. */
114
119
  readonly voice: VoiceService
120
+ readonly calls: CallService
115
121
 
116
122
  constructor(client: ProteosClient) {
117
123
  this.connections = new ConnectionServiceImpl(client)
@@ -128,6 +134,7 @@ export class ConversationClient {
128
134
  this.mistranscribedTerms = new MistranscribedTermServiceImpl(client)
129
135
  this.meetings = new MeetingServiceImpl(client)
130
136
  this.voice = new VoiceServiceImpl(client)
137
+ this.calls = new CallServiceImpl(client)
131
138
  }
132
139
  }
133
140
 
@@ -193,8 +200,13 @@ export interface ConnectionService {
193
200
  * clean up at the provider by hand.
194
201
  */
195
202
  delete(id: string, query?: DeleteConnectionQuery): Promise<void>
196
- /** Begin the connector's install flow; open the returned URL in a popup. */
197
- install(id: string): Promise<InstallConnectionResponse>
203
+ /**
204
+ * Begin the connector's install flow. OAuth connectors return an
205
+ * `authorization_url` to open in a popup; direct-install connectors take
206
+ * `{ input }` (user-supplied credentials) and complete server-side,
207
+ * returning `is_completed` plus a one-time `setup` handout.
208
+ */
209
+ install(id: string, request?: InstallConnectionRequest): Promise<InstallConnectionResponse>
198
210
  /**
199
211
  * Trigger a historical backfill ("sync all") on an email connection: the
200
212
  * server fetches provider mail in the chosen range and ingests it through
@@ -247,10 +259,11 @@ class ConnectionServiceImpl implements ConnectionService {
247
259
  )
248
260
  }
249
261
 
250
- install(id: string): Promise<InstallConnectionResponse> {
262
+ install(id: string, request?: InstallConnectionRequest): Promise<InstallConnectionResponse> {
251
263
  return this.client.request(
252
264
  'POST',
253
265
  `${CONVERSATION_BASE_PATH}/connections/${encodeURIComponent(id)}/install`,
266
+ request,
254
267
  )
255
268
  }
256
269
 
@@ -1107,6 +1120,77 @@ class MistranscribedTermServiceImpl implements MistranscribedTermService {
1107
1120
  }
1108
1121
  }
1109
1122
 
1123
+ /**
1124
+ * Softphone calling: the browser Voice token grant. The client identity is
1125
+ * derived server-side from the authenticated user; refresh by minting again
1126
+ * (the Voice SDK's tokenWillExpire event is the cue).
1127
+ */
1128
+ export interface CallService {
1129
+ mintToken(request: MintCallTokenRequest): Promise<CallTokenResponse>
1130
+ /** A phone connection's provider numbers with status + routing. */
1131
+ listPhoneNumbers(connectionId: string): Promise<{ data: PhoneNumber[] }>
1132
+ /** Replace one number's routing (who it rings). Returns the refreshed list. */
1133
+ updatePhoneNumber(
1134
+ connectionId: string,
1135
+ numberExternalId: string,
1136
+ request: UpdatePhoneNumberRequest,
1137
+ ): Promise<{ data: PhoneNumber[] }>
1138
+ /** Point one number at the platform. Returns the refreshed list. */
1139
+ connectPhoneNumber(connectionId: string, numberExternalId: string): Promise<{ data: PhoneNumber[] }>
1140
+ /** Release one number (restores its previous handler). Returns the refreshed list. */
1141
+ disconnectPhoneNumber(
1142
+ connectionId: string,
1143
+ numberExternalId: string,
1144
+ ): Promise<{ data: PhoneNumber[] }>
1145
+ }
1146
+
1147
+ class CallServiceImpl implements CallService {
1148
+ constructor(private readonly client: ProteosClient) {}
1149
+
1150
+ mintToken(request: MintCallTokenRequest): Promise<CallTokenResponse> {
1151
+ return this.client.request('POST', `${CONVERSATION_BASE_PATH}/calls/token`, request)
1152
+ }
1153
+
1154
+ listPhoneNumbers(connectionId: string): Promise<{ data: PhoneNumber[] }> {
1155
+ return this.client.request(
1156
+ 'GET',
1157
+ `${CONVERSATION_BASE_PATH}/connections/${encodeURIComponent(connectionId)}/phone-numbers`,
1158
+ )
1159
+ }
1160
+
1161
+ updatePhoneNumber(
1162
+ connectionId: string,
1163
+ numberExternalId: string,
1164
+ request: UpdatePhoneNumberRequest,
1165
+ ): Promise<{ data: PhoneNumber[] }> {
1166
+ return this.client.request(
1167
+ 'PUT',
1168
+ `${CONVERSATION_BASE_PATH}/connections/${encodeURIComponent(connectionId)}/phone-numbers/${encodeURIComponent(numberExternalId)}`,
1169
+ request,
1170
+ )
1171
+ }
1172
+
1173
+ connectPhoneNumber(
1174
+ connectionId: string,
1175
+ numberExternalId: string,
1176
+ ): Promise<{ data: PhoneNumber[] }> {
1177
+ return this.client.request(
1178
+ 'POST',
1179
+ `${CONVERSATION_BASE_PATH}/connections/${encodeURIComponent(connectionId)}/phone-numbers/${encodeURIComponent(numberExternalId)}/connect`,
1180
+ )
1181
+ }
1182
+
1183
+ disconnectPhoneNumber(
1184
+ connectionId: string,
1185
+ numberExternalId: string,
1186
+ ): Promise<{ data: PhoneNumber[] }> {
1187
+ return this.client.request(
1188
+ 'POST',
1189
+ `${CONVERSATION_BASE_PATH}/connections/${encodeURIComponent(connectionId)}/phone-numbers/${encodeURIComponent(numberExternalId)}/disconnect`,
1190
+ )
1191
+ }
1192
+ }
1193
+
1110
1194
  export type * from './types.js'
1111
1195
  // Re-export voice types (the live dictation stream lives on this service now)
1112
1196
  export type {
@@ -26,6 +26,7 @@ export type Channel =
26
26
  | 'teams-meeting'
27
27
  | 'webex-meeting'
28
28
  | 'adhoc'
29
+ | 'phone'
29
30
  | 'instagram'
30
31
  | 'messenger'
31
32
  | 'x'
@@ -52,6 +53,83 @@ export type ConnectorKey =
52
53
  | 'adhoc-meeting'
53
54
  | 'google-calendar-meeting'
54
55
  | 'microsoft-calendar-meeting'
56
+ | 'twilio-phone'
57
+ | 'aircall'
58
+ | 'webhook-cti'
59
+
60
+ /**
61
+ * Telephony lifecycle of one phone call, carried in the call conversation's
62
+ * `metadata.call_status` (a call is a conversation plus call facts — no
63
+ * dedicated resource). Status callbacks apply through a monotonic guard, so a
64
+ * terminal value never regresses.
65
+ */
66
+ /**
67
+ * Body of POST /conversations/v1/calls/token — the softphone's browser-calling
68
+ * grant for one connection. The client identity is derived server-side from
69
+ * the authenticated user.
70
+ */
71
+ export interface MintCallTokenRequest {
72
+ connection_id: string
73
+ }
74
+
75
+ /**
76
+ * Which system answers a provider phone number: connected to this platform,
77
+ * in use by another integration (connecting takes it over, disconnecting
78
+ * restores it), or configured nowhere (available).
79
+ */
80
+ export type PhoneNumberStatus = 'connected' | 'available' | 'in_use'
81
+
82
+ /** One dispatch target: a platform user (id) or a team (slug). */
83
+ export interface RoutingTarget {
84
+ type: 'user' | 'team'
85
+ id: string
86
+ }
87
+
88
+ /**
89
+ * A connected number's user-level dispatch: who a call rings. v1 rings every
90
+ * expanded target in parallel (teams expand to their direct members at ring
91
+ * time); the object shape leaves room for later strategy options. Empty
92
+ * targets fall back to the connection-wide routing, then busy.
93
+ */
94
+ export interface PhoneNumberRouting {
95
+ targets: RoutingTarget[]
96
+ }
97
+
98
+ /** One provider phone number on a phone connection. */
99
+ export interface PhoneNumber {
100
+ /** Provider-side number identity (vendor vocabulary stays in the adapter). */
101
+ external_id: string
102
+ phone_number: string
103
+ friendly_name: string
104
+ status: PhoneNumberStatus
105
+ /** Display-only description of what an in_use number is used by. */
106
+ used_by?: string
107
+ routing: PhoneNumberRouting
108
+ }
109
+
110
+ /** Routing update for one phone number (connect/disconnect are actions). */
111
+ export interface UpdatePhoneNumberRequest {
112
+ routing?: PhoneNumberRouting
113
+ }
114
+
115
+ /** The minted grant the Voice JS SDK consumes (`new Device(token, { edge })`). */
116
+ export interface CallTokenResponse {
117
+ token: string
118
+ identity: string
119
+ /** Vendor edge to connect through ('dublin' for the EU default). */
120
+ edge?: string
121
+ expires_at: string
122
+ }
123
+
124
+ export type CallStatus =
125
+ | 'queued'
126
+ | 'ringing'
127
+ | 'in_progress'
128
+ | 'completed'
129
+ | 'no_answer'
130
+ | 'busy'
131
+ | 'failed'
132
+ | 'canceled'
55
133
 
56
134
  /**
57
135
  * Who operates the integration mechanics behind a connector: Proteos' own
@@ -486,8 +564,27 @@ export interface UpdateConnectionRequest {
486
564
  settings?: Record<string, unknown>
487
565
  }
488
566
 
567
+ /**
568
+ * Optional body of POST /connections/:id/install. `input` carries
569
+ * user-supplied install credentials for direct-install connectors
570
+ * (twilio-phone, aircall, webhook-cti — connector-documented snake_case
571
+ * keys); omit it for OAuth/hosted connectors.
572
+ */
573
+ export interface InstallConnectionRequest {
574
+ input?: Record<string, string>
575
+ }
576
+
489
577
  export interface InstallConnectionResponse {
490
- authorization_url: string
578
+ /** OAuth/hosted installs: open this in a popup. Absent on direct installs. */
579
+ authorization_url?: string
580
+ /** Direct installs complete server-side in this request. */
581
+ is_completed?: boolean
582
+ /**
583
+ * A direct-install connector's one-time setup handout (callback URLs to
584
+ * paste provider-side; a minted token shown exactly once — only its hash is
585
+ * stored server-side). Never retrievable again.
586
+ */
587
+ setup?: Record<string, string>
491
588
  }
492
589
 
493
590
  export interface SendMessageRequest {
@@ -852,6 +949,11 @@ export interface ListConnectionsQuery extends PaginationQuery {
852
949
  connector_key?: string
853
950
  channel?: string
854
951
  scope?: string
952
+ /**
953
+ * Narrows to the user-scoped connections one person owns. Org-scoped
954
+ * connections have no owner and never match.
955
+ */
956
+ owner_id?: string
855
957
  status?: string
856
958
  }
857
959
 
package/src/data/types.ts CHANGED
@@ -18,6 +18,15 @@ export type RecordData = Record<string, any>
18
18
  * (via bracket syntax) include `[eq]`, `[ne]`, `[gt]`, `[gte]`, `[lt]`,
19
19
  * `[lte]`, `[in]` (pipe-separated), `[not_in]`, `[contains]`, `[starts_with]`,
20
20
  * `[ends_with]`, `[empty]`, `[not_empty]`. Missing operator defaults to `[eq]`.
21
+ * A filter key may reach one hop through a relation attribute with a dotted
22
+ * path (`"company_id.name[contains]": "acme"`).
23
+ *
24
+ * For nested AND/OR trees, pass a filter group (the same wire dialect as
25
+ * `List.filters` / `visible_when`: `{logical_operator, elements: [{field,
26
+ * operator, value}], groups}`, string values, pipe-joined for in/not_in)
27
+ * JSON-encoded under the reserved `_filter` key:
28
+ * `{ _filter: JSON.stringify(group) }`. The server ANDs it with any flat
29
+ * filter params.
21
30
  */
22
31
  export interface ListRecordsOptions {
23
32
  /** Page number (0-indexed). First page is 0. */
package/src/index.ts CHANGED
@@ -227,6 +227,8 @@ export type {
227
227
  AutomatedFilterConfig,
228
228
  AutomatedSignal,
229
229
  BlockContactRequest,
230
+ CallStatus,
231
+ CallTokenResponse,
230
232
  Channel,
231
233
  Connection,
232
234
  ConnectionCredentials,
@@ -310,7 +312,12 @@ export type {
310
312
  MessageRecipient,
311
313
  MessageService,
312
314
  MessageStatus,
315
+ MintCallTokenRequest,
313
316
  MistranscribedTerm,
317
+ PhoneNumber,
318
+ PhoneNumberRouting,
319
+ PhoneNumberStatus,
320
+ RoutingTarget,
314
321
  MistranscribedTermService,
315
322
  MistranscribedTermStatus,
316
323
  MistranscriptionSuggestionSource,
@@ -349,6 +356,7 @@ export type {
349
356
  UpdateConversationTypeRequest,
350
357
  UpdateDraftRequest,
351
358
  UpdateGlossaryTermRequest,
359
+ UpdatePhoneNumberRequest,
352
360
  VoiceService,
353
361
  VoiceTranscriptionStream,
354
362
  } from './conversation/index.js'
@@ -22,6 +22,7 @@ export const LayoutElementType = {
22
22
  Text: 'text',
23
23
  RecordFilter: 'record_filter',
24
24
  List: 'list',
25
+ WorkflowTrigger: 'workflow_trigger',
25
26
  } as const
26
27
  export type LayoutElementType = (typeof LayoutElementType)[keyof typeof LayoutElementType]
27
28
 
@@ -68,11 +69,19 @@ export type CardElement = CommonProps & {
68
69
  content: LayoutElement
69
70
  }
70
71
 
72
+ /**
73
+ * One switchable view inside a `tabs` element. `visible_when` hides the tab
74
+ * when it does not match the record; `default_when` makes it the initially
75
+ * shown tab when it matches. Both are evaluated live against the record being
76
+ * viewed or edited. Resolution order: first visible tab (document order) whose
77
+ * `default_when` matches → `TabsElement.default_tab_id` → first visible tab.
78
+ */
71
79
  export type LayoutTab = {
72
80
  id: string
73
81
  label: string
74
82
  icon?: string
75
83
  visible_when?: FilterGroup
84
+ default_when?: FilterGroup
76
85
  content: LayoutElement
77
86
  }
78
87
 
@@ -223,6 +232,29 @@ export type DividerElement = CommonProps & {
223
232
  type: 'divider'
224
233
  }
225
234
 
235
+ /**
236
+ * An always-visible button that starts a manual run of `workflow` (by key) —
237
+ * the in-layout counterpart of a `kind: workflow` toolbar action. `inputs`
238
+ * maps the manual trigger's input_schema field names to Liquid templates
239
+ * rendered against the page scope; `skip_confirmation` fires immediately when
240
+ * every required input resolves. While the run is in flight the element shows
241
+ * the step progress inline in place of the button.
242
+ */
243
+ export type WorkflowTriggerElement = CommonProps & {
244
+ type: 'workflow_trigger'
245
+ workflow: string
246
+ label: string
247
+ icon?: string
248
+ inputs?: Record<string, string>
249
+ skip_confirmation?: boolean
250
+ /**
251
+ * Optional string attribute on the page's record where the element persists
252
+ * the id of the execution it starts — and reads it back, so progress
253
+ * survives reloads and is shared by every viewer. Record pages only.
254
+ */
255
+ execution_attribute?: string
256
+ }
257
+
226
258
  export type TextVariant = 'heading' | 'subheading' | 'body' | 'caption' | 'callout'
227
259
 
228
260
  export type TextElement = CommonProps & {
@@ -245,6 +277,7 @@ export type LayoutElement =
245
277
  | TextElement
246
278
  | RecordFilterElement
247
279
  | ListElement
280
+ | WorkflowTriggerElement
248
281
 
249
282
  // ──────────────────────────────────────────────────────────── Schemas ──
250
283
 
@@ -294,6 +327,7 @@ export const LayoutElementSchema: z.ZodType<LayoutElement> = z.lazy(() =>
294
327
  label: z.string().min(1),
295
328
  icon: z.string().optional(),
296
329
  visible_when: FilterGroupSchema.optional(),
330
+ default_when: FilterGroupSchema.optional(),
297
331
  content: LayoutElementSchema,
298
332
  }),
299
333
  ),
@@ -355,6 +389,16 @@ export const LayoutElementSchema: z.ZodType<LayoutElement> = z.lazy(() =>
355
389
  type: z.literal('divider'),
356
390
  ...commonPropsShape,
357
391
  }),
392
+ z.object({
393
+ type: z.literal('workflow_trigger'),
394
+ ...commonPropsShape,
395
+ workflow: z.string().min(1),
396
+ label: z.string().min(1),
397
+ icon: z.string().optional(),
398
+ inputs: z.record(z.string()).optional(),
399
+ skip_confirmation: z.boolean().optional(),
400
+ execution_attribute: z.string().min(1).optional(),
401
+ }),
358
402
  z.object({
359
403
  type: z.literal('text'),
360
404
  ...commonPropsShape,
@@ -28,6 +28,7 @@ export {
28
28
  type LayoutTab,
29
29
  type ListElement,
30
30
  type RecordFilterElement,
31
+ type WorkflowTriggerElement,
31
32
  type RelatedListElement,
32
33
  type RelatedRecordElement,
33
34
  type RowElement,