@proteos/sdk 0.46.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.
- package/dist/{chunk-F5DHWOGW.cjs → chunk-OD7GPJAW.cjs} +50 -15
- package/dist/chunk-OD7GPJAW.cjs.map +1 -0
- package/dist/{chunk-Y4CEHIRX.js → chunk-TDG5QFZ5.js} +50 -15
- package/dist/chunk-TDG5QFZ5.js.map +1 -0
- package/dist/index.cjs +144 -99
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +144 -15
- package/dist/index.d.ts +144 -15
- package/dist/index.js +50 -5
- package/dist/index.js.map +1 -1
- package/dist/meta/index.cjs +57 -57
- package/dist/meta/index.d.cts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/dist/meta/index.js +1 -1
- package/dist/{types-D1PRIsSO.d.cts → types-COxVBT4w.d.cts} +249 -64
- package/dist/{types-D1PRIsSO.d.ts → types-COxVBT4w.d.ts} +249 -64
- package/package.json +1 -1
- package/src/conversation/index.ts +87 -3
- package/src/conversation/types.ts +103 -1
- package/src/data/types.ts +9 -0
- package/src/functions/actions.ts +29 -0
- package/src/functions/types.ts +6 -4
- package/src/index.ts +8 -0
- package/src/meta/layout/control-registry.json +4 -2
- package/src/meta/layout/elements.ts +130 -0
- package/src/meta/layout/index.ts +3 -0
- package/src/meta/types.ts +85 -39
- package/dist/chunk-F5DHWOGW.cjs.map +0 -1
- package/dist/chunk-Y4CEHIRX.js.map +0 -1
|
@@ -1428,6 +1428,9 @@ declare const LayoutElementType: {
|
|
|
1428
1428
|
readonly Component: "component";
|
|
1429
1429
|
readonly Divider: "divider";
|
|
1430
1430
|
readonly Text: "text";
|
|
1431
|
+
readonly RecordFilter: "record_filter";
|
|
1432
|
+
readonly List: "list";
|
|
1433
|
+
readonly WorkflowTrigger: "workflow_trigger";
|
|
1431
1434
|
};
|
|
1432
1435
|
type LayoutElementType = (typeof LayoutElementType)[keyof typeof LayoutElementType];
|
|
1433
1436
|
type RowElement = CommonProps & {
|
|
@@ -1469,11 +1472,19 @@ type CardElement = CommonProps & {
|
|
|
1469
1472
|
default_collapsed?: boolean;
|
|
1470
1473
|
content: LayoutElement;
|
|
1471
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
|
+
*/
|
|
1472
1482
|
type LayoutTab = {
|
|
1473
1483
|
id: string;
|
|
1474
1484
|
label: string;
|
|
1475
1485
|
icon?: string;
|
|
1476
1486
|
visible_when?: FilterGroup;
|
|
1487
|
+
default_when?: FilterGroup;
|
|
1477
1488
|
content: LayoutElement;
|
|
1478
1489
|
};
|
|
1479
1490
|
type TabsElement = CommonProps & {
|
|
@@ -1548,16 +1559,102 @@ type ComponentElement = CommonProps & {
|
|
|
1548
1559
|
* to the host's 80px fallback when unset. */
|
|
1549
1560
|
reserved_height?: number;
|
|
1550
1561
|
};
|
|
1562
|
+
/**
|
|
1563
|
+
* A filter builder placed directly on a page. It owns no data of its own: it
|
|
1564
|
+
* publishes the filter (and the chosen subject entity) under its element id,
|
|
1565
|
+
* and every `list` element naming that id in `filter_element_id` renders the
|
|
1566
|
+
* filtered rows.
|
|
1567
|
+
*
|
|
1568
|
+
* `subject_entity` pins which entity the filter is authored against. When it is
|
|
1569
|
+
* absent the element renders a subject picker over the entities its bound lists
|
|
1570
|
+
* offer — one entry per bound list, since a list carries exactly one entity.
|
|
1571
|
+
*
|
|
1572
|
+
* The filter is in-memory: it resets on reload rather than persisting per user.
|
|
1573
|
+
*/
|
|
1574
|
+
type RecordFilterElement = CommonProps & {
|
|
1575
|
+
type: 'record_filter';
|
|
1576
|
+
subject_entity?: string;
|
|
1577
|
+
/** `toolbar` (default) is the Filter button + active chips, matching every
|
|
1578
|
+
* list view. `panel` is the always-open AND/OR editor, for a page whose
|
|
1579
|
+
* point IS the filter. */
|
|
1580
|
+
variant?: 'toolbar' | 'panel';
|
|
1581
|
+
/** Nested AND/OR groups. Defaults to true — the records query carries the
|
|
1582
|
+
* whole tree, so there is no reason to hide the affordance. */
|
|
1583
|
+
is_complex_enabled?: boolean;
|
|
1584
|
+
};
|
|
1585
|
+
/**
|
|
1586
|
+
* Renders records of a configured List — the record-agnostic sibling of
|
|
1587
|
+
* `related_list`, and the only way to show records on a page that has no
|
|
1588
|
+
* record of its own.
|
|
1589
|
+
*
|
|
1590
|
+
* The List supplies everything about presentation and behaviour: columns,
|
|
1591
|
+
* sorting, base filters, toolbar actions, selection mode, and which page a row
|
|
1592
|
+
* opens. Naming more than one list makes the element switchable; the active one
|
|
1593
|
+
* is chosen by the bound filter's subject picker, or by the element's own
|
|
1594
|
+
* switcher when it is unbound.
|
|
1595
|
+
*
|
|
1596
|
+
* `filter_element_id` binds the element to a `record_filter` on the same page.
|
|
1597
|
+
* The bound filter is ANDed with the list's own saved filters — it narrows the
|
|
1598
|
+
* list, it never replaces what the list declared.
|
|
1599
|
+
*/
|
|
1600
|
+
type ListElement = CommonProps & {
|
|
1601
|
+
type: 'list';
|
|
1602
|
+
/** Slugs of the lists this element can render. At least one. */
|
|
1603
|
+
list_slugs: string[];
|
|
1604
|
+
/** Element id of the `record_filter` driving this list. Unbound renders the
|
|
1605
|
+
* list with its own filters only. */
|
|
1606
|
+
filter_element_id?: string;
|
|
1607
|
+
/**
|
|
1608
|
+
* Record-page alternative to `filter_element_id`: the attribute on THIS
|
|
1609
|
+
* page's record holding a saved filter (as written by the `record-filter`
|
|
1610
|
+
* control). The list then renders what the record's own filter selects —
|
|
1611
|
+
* a saved-segment record showing its matches.
|
|
1612
|
+
*
|
|
1613
|
+
* Mutually exclusive with `filter_element_id`: two filters driving one list
|
|
1614
|
+
* has no defined precedence, so the layout validator rejects both at once.
|
|
1615
|
+
* Record pages only — a standalone page has no record to read.
|
|
1616
|
+
*/
|
|
1617
|
+
filter_attribute?: string;
|
|
1618
|
+
/**
|
|
1619
|
+
* Attribute on this page's record naming the subject entity slug. The
|
|
1620
|
+
* element renders whichever of `list_slugs` targets that entity. Without
|
|
1621
|
+
* it the first configured list wins. Pairs with `filter_attribute`.
|
|
1622
|
+
*/
|
|
1623
|
+
subject_entity_attribute?: string;
|
|
1624
|
+
page_size?: number;
|
|
1625
|
+
};
|
|
1551
1626
|
type DividerElement = CommonProps & {
|
|
1552
1627
|
type: 'divider';
|
|
1553
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
|
+
};
|
|
1554
1651
|
type TextVariant = 'heading' | 'subheading' | 'body' | 'caption' | 'callout';
|
|
1555
1652
|
type TextElement = CommonProps & {
|
|
1556
1653
|
type: 'text';
|
|
1557
1654
|
variant: TextVariant;
|
|
1558
1655
|
content: string;
|
|
1559
1656
|
};
|
|
1560
|
-
type LayoutElement = RowElement | ColumnElement | SectionElement | CardElement | TabsElement | FieldElement | RelatedListElement | RelatedRecordElement | ComponentElement | DividerElement | TextElement;
|
|
1657
|
+
type LayoutElement = RowElement | ColumnElement | SectionElement | CardElement | TabsElement | FieldElement | RelatedListElement | RelatedRecordElement | ComponentElement | DividerElement | TextElement | RecordFilterElement | ListElement | WorkflowTriggerElement;
|
|
1561
1658
|
declare const LayoutElementSchema: z.ZodType<LayoutElement>;
|
|
1562
1659
|
|
|
1563
1660
|
/**
|
|
@@ -3051,6 +3148,19 @@ interface UpdateComponentRequest {
|
|
|
3051
3148
|
}
|
|
3052
3149
|
/**
|
|
3053
3150
|
* List column definition.
|
|
3151
|
+
*
|
|
3152
|
+
* `attribute` is an attribute name or a dot path, told apart by the type of
|
|
3153
|
+
* the first segment:
|
|
3154
|
+
*
|
|
3155
|
+
* - `name` — an attribute on the list's own entity.
|
|
3156
|
+
* - `address.city` — a leaf inside one of its `object` attributes.
|
|
3157
|
+
* - `company_id.name` — a field of the RELATED record, reached through a
|
|
3158
|
+
* relation attribute (the first segment is the FK).
|
|
3159
|
+
*
|
|
3160
|
+
* A bare `object` attribute is not a valid column — it carries no value of
|
|
3161
|
+
* its own, only leaves. Sorting follows the same grammar minus the relation
|
|
3162
|
+
* hop: an attribute or an object path can be ordered by, a related field
|
|
3163
|
+
* cannot (it would need a join).
|
|
3054
3164
|
*/
|
|
3055
3165
|
interface Column {
|
|
3056
3166
|
attribute: string;
|
|
@@ -3062,13 +3172,77 @@ interface Column {
|
|
|
3062
3172
|
*/
|
|
3063
3173
|
type SortDirection = 'asc' | 'desc';
|
|
3064
3174
|
/**
|
|
3065
|
-
* Sort configuration.
|
|
3175
|
+
* Sort configuration. `attribute` is an attribute name or an object path
|
|
3176
|
+
* (`address.city`); relation paths are not sortable — ordering by a related
|
|
3177
|
+
* field would need a join the records query doesn't do.
|
|
3066
3178
|
*/
|
|
3067
3179
|
interface SortConfig {
|
|
3068
3180
|
attribute: string;
|
|
3069
3181
|
direction: SortDirection;
|
|
3070
3182
|
}
|
|
3071
3183
|
|
|
3184
|
+
/**
|
|
3185
|
+
* What a page toolbar button invokes. Absent normalizes to `action` (pages
|
|
3186
|
+
* persisted before `kind` existed).
|
|
3187
|
+
*/
|
|
3188
|
+
type PageActionKind = 'action' | 'workflow';
|
|
3189
|
+
/**
|
|
3190
|
+
* Page action definition — one toolbar button. `kind: action` invokes a
|
|
3191
|
+
* function-service Action by slug (`action`) and may prefill its params;
|
|
3192
|
+
* `kind: workflow` starts a manual run of a workflow by key (`workflow`) and
|
|
3193
|
+
* may prefill its manual-trigger inputs. `params` / `inputs` map target field
|
|
3194
|
+
* names to Liquid templates rendered against the page scope
|
|
3195
|
+
* `{ record, entity, params, user }`; a resolved field is locked in the invoke
|
|
3196
|
+
* dialog. `skip_confirmation` fires the target immediately when every required
|
|
3197
|
+
* field resolved from the templates.
|
|
3198
|
+
*/
|
|
3199
|
+
interface PageAction {
|
|
3200
|
+
label: string;
|
|
3201
|
+
icon: string;
|
|
3202
|
+
kind?: PageActionKind;
|
|
3203
|
+
action?: string;
|
|
3204
|
+
workflow?: string;
|
|
3205
|
+
params?: Record<string, string>;
|
|
3206
|
+
inputs?: Record<string, string>;
|
|
3207
|
+
skip_confirmation?: boolean;
|
|
3208
|
+
}
|
|
3209
|
+
declare const PageActionSchema: z.ZodObject<{
|
|
3210
|
+
label: z.ZodString;
|
|
3211
|
+
icon: z.ZodString;
|
|
3212
|
+
kind: z.ZodOptional<z.ZodEnum<["action", "workflow"]>>;
|
|
3213
|
+
action: z.ZodOptional<z.ZodString>;
|
|
3214
|
+
workflow: z.ZodOptional<z.ZodString>;
|
|
3215
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
3216
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
3217
|
+
skip_confirmation: z.ZodOptional<z.ZodBoolean>;
|
|
3218
|
+
}, "strip", z.ZodTypeAny, {
|
|
3219
|
+
label: string;
|
|
3220
|
+
icon: string;
|
|
3221
|
+
params?: Record<string, string> | undefined;
|
|
3222
|
+
workflow?: string | undefined;
|
|
3223
|
+
inputs?: Record<string, string> | undefined;
|
|
3224
|
+
skip_confirmation?: boolean | undefined;
|
|
3225
|
+
action?: string | undefined;
|
|
3226
|
+
kind?: "workflow" | "action" | undefined;
|
|
3227
|
+
}, {
|
|
3228
|
+
label: string;
|
|
3229
|
+
icon: string;
|
|
3230
|
+
params?: Record<string, string> | undefined;
|
|
3231
|
+
workflow?: string | undefined;
|
|
3232
|
+
inputs?: Record<string, string> | undefined;
|
|
3233
|
+
skip_confirmation?: boolean | undefined;
|
|
3234
|
+
action?: string | undefined;
|
|
3235
|
+
kind?: "workflow" | "action" | undefined;
|
|
3236
|
+
}>;
|
|
3237
|
+
/**
|
|
3238
|
+
* Whether a list's rows can be checked, and whether the checkboxes show from
|
|
3239
|
+
* the start:
|
|
3240
|
+
*
|
|
3241
|
+
* - `on_demand` (default) — a Select toggle in the toolbar reveals them.
|
|
3242
|
+
* - `always` — checkboxes are showing from the start.
|
|
3243
|
+
* - `off` — rows can never be checked, even when the list carries actions.
|
|
3244
|
+
*/
|
|
3245
|
+
type SelectionMode = 'on_demand' | 'always' | 'off';
|
|
3072
3246
|
/**
|
|
3073
3247
|
* List configuration.
|
|
3074
3248
|
* Note: List uses `slug` as its primary identifier, not `id`.
|
|
@@ -3080,6 +3254,15 @@ interface List extends AuditFields {
|
|
|
3080
3254
|
name: string;
|
|
3081
3255
|
entity_slug: string;
|
|
3082
3256
|
columns: Column[];
|
|
3257
|
+
/**
|
|
3258
|
+
* Toolbar buttons on the list, same shape a page carries. They act on the
|
|
3259
|
+
* rows SELECTED in the list, so an `action` button names an `entity_batch`
|
|
3260
|
+
* action (invoked once with every selected record id) and prefill templates
|
|
3261
|
+
* resolve against the list scope `{ selection, entity, user }`.
|
|
3262
|
+
*/
|
|
3263
|
+
actions?: PageAction[];
|
|
3264
|
+
/** Row-selection affordance; absent normalizes to `on_demand`. */
|
|
3265
|
+
selection_mode?: SelectionMode;
|
|
3083
3266
|
/** Record page to open from this list; empty/absent = org default for the entity. */
|
|
3084
3267
|
default_page_slug?: string;
|
|
3085
3268
|
sorting: SortConfig[];
|
|
@@ -3149,6 +3332,35 @@ declare const ListSchema: z.ZodObject<{
|
|
|
3149
3332
|
label: string;
|
|
3150
3333
|
attribute: string;
|
|
3151
3334
|
}>, "many">;
|
|
3335
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3336
|
+
label: z.ZodString;
|
|
3337
|
+
icon: z.ZodString;
|
|
3338
|
+
kind: z.ZodOptional<z.ZodEnum<["action", "workflow"]>>;
|
|
3339
|
+
action: z.ZodOptional<z.ZodString>;
|
|
3340
|
+
workflow: z.ZodOptional<z.ZodString>;
|
|
3341
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
3342
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
3343
|
+
skip_confirmation: z.ZodOptional<z.ZodBoolean>;
|
|
3344
|
+
}, "strip", z.ZodTypeAny, {
|
|
3345
|
+
label: string;
|
|
3346
|
+
icon: string;
|
|
3347
|
+
params?: Record<string, string> | undefined;
|
|
3348
|
+
workflow?: string | undefined;
|
|
3349
|
+
inputs?: Record<string, string> | undefined;
|
|
3350
|
+
skip_confirmation?: boolean | undefined;
|
|
3351
|
+
action?: string | undefined;
|
|
3352
|
+
kind?: "workflow" | "action" | undefined;
|
|
3353
|
+
}, {
|
|
3354
|
+
label: string;
|
|
3355
|
+
icon: string;
|
|
3356
|
+
params?: Record<string, string> | undefined;
|
|
3357
|
+
workflow?: string | undefined;
|
|
3358
|
+
inputs?: Record<string, string> | undefined;
|
|
3359
|
+
skip_confirmation?: boolean | undefined;
|
|
3360
|
+
action?: string | undefined;
|
|
3361
|
+
kind?: "workflow" | "action" | undefined;
|
|
3362
|
+
}>, "many">>;
|
|
3363
|
+
selection_mode: z.ZodOptional<z.ZodEnum<["on_demand", "always", "off"]>>;
|
|
3152
3364
|
default_page_slug: z.ZodOptional<z.ZodString>;
|
|
3153
3365
|
sorting: z.ZodArray<z.ZodObject<{
|
|
3154
3366
|
attribute: z.ZodString;
|
|
@@ -3186,6 +3398,17 @@ declare const ListSchema: z.ZodObject<{
|
|
|
3186
3398
|
direction: "asc" | "desc";
|
|
3187
3399
|
}[];
|
|
3188
3400
|
filters: FilterGroup[];
|
|
3401
|
+
actions?: {
|
|
3402
|
+
label: string;
|
|
3403
|
+
icon: string;
|
|
3404
|
+
params?: Record<string, string> | undefined;
|
|
3405
|
+
workflow?: string | undefined;
|
|
3406
|
+
inputs?: Record<string, string> | undefined;
|
|
3407
|
+
skip_confirmation?: boolean | undefined;
|
|
3408
|
+
action?: string | undefined;
|
|
3409
|
+
kind?: "workflow" | "action" | undefined;
|
|
3410
|
+
}[] | undefined;
|
|
3411
|
+
selection_mode?: "on_demand" | "always" | "off" | undefined;
|
|
3189
3412
|
default_page_slug?: string | undefined;
|
|
3190
3413
|
}, {
|
|
3191
3414
|
name: string;
|
|
@@ -3212,6 +3435,17 @@ declare const ListSchema: z.ZodObject<{
|
|
|
3212
3435
|
direction: "asc" | "desc";
|
|
3213
3436
|
}[];
|
|
3214
3437
|
filters: FilterGroup[];
|
|
3438
|
+
actions?: {
|
|
3439
|
+
label: string;
|
|
3440
|
+
icon: string;
|
|
3441
|
+
params?: Record<string, string> | undefined;
|
|
3442
|
+
workflow?: string | undefined;
|
|
3443
|
+
inputs?: Record<string, string> | undefined;
|
|
3444
|
+
skip_confirmation?: boolean | undefined;
|
|
3445
|
+
action?: string | undefined;
|
|
3446
|
+
kind?: "workflow" | "action" | undefined;
|
|
3447
|
+
}[] | undefined;
|
|
3448
|
+
selection_mode?: "on_demand" | "always" | "off" | undefined;
|
|
3215
3449
|
default_page_slug?: string | undefined;
|
|
3216
3450
|
}>;
|
|
3217
3451
|
/**
|
|
@@ -3232,6 +3466,8 @@ interface CreateListRequest {
|
|
|
3232
3466
|
entity_slug: string;
|
|
3233
3467
|
name: string;
|
|
3234
3468
|
columns: Column[];
|
|
3469
|
+
actions?: PageAction[];
|
|
3470
|
+
selection_mode?: SelectionMode;
|
|
3235
3471
|
default_page_slug?: string;
|
|
3236
3472
|
sorting: SortConfig[];
|
|
3237
3473
|
filters: FilterGroup[];
|
|
@@ -3243,6 +3479,8 @@ interface UpdateListRequest {
|
|
|
3243
3479
|
name?: string;
|
|
3244
3480
|
module_slug?: string;
|
|
3245
3481
|
columns?: Column[];
|
|
3482
|
+
actions?: PageAction[];
|
|
3483
|
+
selection_mode?: SelectionMode;
|
|
3246
3484
|
/** Set to '' to clear back to the org default. */
|
|
3247
3485
|
default_page_slug?: string;
|
|
3248
3486
|
sorting?: SortConfig[];
|
|
@@ -3396,59 +3634,6 @@ interface UpdateListViewRequest {
|
|
|
3396
3634
|
sorting?: SortConfig[];
|
|
3397
3635
|
filters?: FilterGroup[];
|
|
3398
3636
|
}
|
|
3399
|
-
/**
|
|
3400
|
-
* What a page toolbar button invokes. Absent normalizes to `action` (pages
|
|
3401
|
-
* persisted before `kind` existed).
|
|
3402
|
-
*/
|
|
3403
|
-
type PageActionKind = 'action' | 'workflow';
|
|
3404
|
-
/**
|
|
3405
|
-
* Page action definition — one toolbar button. `kind: action` invokes a
|
|
3406
|
-
* function-service Action by slug (`action`) and may prefill its params;
|
|
3407
|
-
* `kind: workflow` starts a manual run of a workflow by key (`workflow`) and
|
|
3408
|
-
* may prefill its manual-trigger inputs. `params` / `inputs` map target field
|
|
3409
|
-
* names to Liquid templates rendered against the page scope
|
|
3410
|
-
* `{ record, entity, params, user }`; a resolved field is locked in the invoke
|
|
3411
|
-
* dialog. `skip_confirmation` fires the target immediately when every required
|
|
3412
|
-
* field resolved from the templates.
|
|
3413
|
-
*/
|
|
3414
|
-
interface PageAction {
|
|
3415
|
-
label: string;
|
|
3416
|
-
icon: string;
|
|
3417
|
-
kind?: PageActionKind;
|
|
3418
|
-
action?: string;
|
|
3419
|
-
workflow?: string;
|
|
3420
|
-
params?: Record<string, string>;
|
|
3421
|
-
inputs?: Record<string, string>;
|
|
3422
|
-
skip_confirmation?: boolean;
|
|
3423
|
-
}
|
|
3424
|
-
declare const PageActionSchema: z.ZodObject<{
|
|
3425
|
-
label: z.ZodString;
|
|
3426
|
-
icon: z.ZodString;
|
|
3427
|
-
kind: z.ZodOptional<z.ZodEnum<["action", "workflow"]>>;
|
|
3428
|
-
action: z.ZodOptional<z.ZodString>;
|
|
3429
|
-
workflow: z.ZodOptional<z.ZodString>;
|
|
3430
|
-
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
3431
|
-
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
3432
|
-
skip_confirmation: z.ZodOptional<z.ZodBoolean>;
|
|
3433
|
-
}, "strip", z.ZodTypeAny, {
|
|
3434
|
-
label: string;
|
|
3435
|
-
icon: string;
|
|
3436
|
-
params?: Record<string, string> | undefined;
|
|
3437
|
-
action?: string | undefined;
|
|
3438
|
-
workflow?: string | undefined;
|
|
3439
|
-
kind?: "action" | "workflow" | undefined;
|
|
3440
|
-
inputs?: Record<string, string> | undefined;
|
|
3441
|
-
skip_confirmation?: boolean | undefined;
|
|
3442
|
-
}, {
|
|
3443
|
-
label: string;
|
|
3444
|
-
icon: string;
|
|
3445
|
-
params?: Record<string, string> | undefined;
|
|
3446
|
-
action?: string | undefined;
|
|
3447
|
-
workflow?: string | undefined;
|
|
3448
|
-
kind?: "action" | "workflow" | undefined;
|
|
3449
|
-
inputs?: Record<string, string> | undefined;
|
|
3450
|
-
skip_confirmation?: boolean | undefined;
|
|
3451
|
-
}>;
|
|
3452
3637
|
/**
|
|
3453
3638
|
* Page type — encodes what the page binds to and how it is served (chrome +
|
|
3454
3639
|
* auth posture both follow from it):
|
|
@@ -3523,20 +3708,20 @@ declare const PageSchema: z.ZodObject<{
|
|
|
3523
3708
|
label: string;
|
|
3524
3709
|
icon: string;
|
|
3525
3710
|
params?: Record<string, string> | undefined;
|
|
3526
|
-
action?: string | undefined;
|
|
3527
3711
|
workflow?: string | undefined;
|
|
3528
|
-
kind?: "action" | "workflow" | undefined;
|
|
3529
3712
|
inputs?: Record<string, string> | undefined;
|
|
3530
3713
|
skip_confirmation?: boolean | undefined;
|
|
3714
|
+
action?: string | undefined;
|
|
3715
|
+
kind?: "workflow" | "action" | undefined;
|
|
3531
3716
|
}, {
|
|
3532
3717
|
label: string;
|
|
3533
3718
|
icon: string;
|
|
3534
3719
|
params?: Record<string, string> | undefined;
|
|
3535
|
-
action?: string | undefined;
|
|
3536
3720
|
workflow?: string | undefined;
|
|
3537
|
-
kind?: "action" | "workflow" | undefined;
|
|
3538
3721
|
inputs?: Record<string, string> | undefined;
|
|
3539
3722
|
skip_confirmation?: boolean | undefined;
|
|
3723
|
+
action?: string | undefined;
|
|
3724
|
+
kind?: "workflow" | "action" | undefined;
|
|
3540
3725
|
}>, "many">;
|
|
3541
3726
|
layout: z.ZodObject<{
|
|
3542
3727
|
version: z.ZodLiteral<1>;
|
|
@@ -3618,11 +3803,11 @@ declare const PageSchema: z.ZodObject<{
|
|
|
3618
3803
|
label: string;
|
|
3619
3804
|
icon: string;
|
|
3620
3805
|
params?: Record<string, string> | undefined;
|
|
3621
|
-
action?: string | undefined;
|
|
3622
3806
|
workflow?: string | undefined;
|
|
3623
|
-
kind?: "action" | "workflow" | undefined;
|
|
3624
3807
|
inputs?: Record<string, string> | undefined;
|
|
3625
3808
|
skip_confirmation?: boolean | undefined;
|
|
3809
|
+
action?: string | undefined;
|
|
3810
|
+
kind?: "workflow" | "action" | undefined;
|
|
3626
3811
|
}[];
|
|
3627
3812
|
layout: {
|
|
3628
3813
|
version: 1;
|
|
@@ -3659,11 +3844,11 @@ declare const PageSchema: z.ZodObject<{
|
|
|
3659
3844
|
label: string;
|
|
3660
3845
|
icon: string;
|
|
3661
3846
|
params?: Record<string, string> | undefined;
|
|
3662
|
-
action?: string | undefined;
|
|
3663
3847
|
workflow?: string | undefined;
|
|
3664
|
-
kind?: "action" | "workflow" | undefined;
|
|
3665
3848
|
inputs?: Record<string, string> | undefined;
|
|
3666
3849
|
skip_confirmation?: boolean | undefined;
|
|
3850
|
+
action?: string | undefined;
|
|
3851
|
+
kind?: "workflow" | "action" | undefined;
|
|
3667
3852
|
}[];
|
|
3668
3853
|
layout: {
|
|
3669
3854
|
version: 1;
|
|
@@ -4101,4 +4286,4 @@ declare function isCurrentUserDefault(value: unknown): value is CurrentUserDefau
|
|
|
4101
4286
|
/** Only the identity-valued attribute types can carry the sentinel. */
|
|
4102
4287
|
declare function acceptsCurrentUserDefault(type: AttributeType): boolean;
|
|
4103
4288
|
|
|
4104
|
-
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
|
|
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
|
@@ -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
|
-
/**
|
|
197
|
-
|
|
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 {
|