@proteos/sdk 0.61.0 → 0.75.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-OOOTPEJK.js → chunk-3VQQEJV6.js} +71 -11
- package/dist/chunk-3VQQEJV6.js.map +1 -0
- package/dist/{chunk-25PD6TYH.cjs → chunk-C4CH6CEY.cjs} +75 -10
- package/dist/chunk-C4CH6CEY.cjs.map +1 -0
- package/dist/index.cjs +379 -130
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +813 -81
- package/dist/index.d.ts +813 -81
- package/dist/index.js +250 -13
- package/dist/index.js.map +1 -1
- package/dist/meta/index.cjs +109 -89
- 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-DQmqR_G8.d.cts → types-Dp-AB2QZ.d.cts} +561 -48
- package/dist/{types-DQmqR_G8.d.ts → types-Dp-AB2QZ.d.ts} +561 -48
- package/package.json +3 -3
- package/src/agent/session-types.ts +8 -1
- package/src/agent/sessions.ts +6 -4
- package/src/agent/types.ts +9 -0
- package/src/auth/platform-entities.ts +6 -0
- package/src/client.ts +28 -4
- package/src/conversation/index.ts +327 -15
- package/src/conversation/types.ts +594 -5
- package/src/data/entity-indexes.ts +54 -0
- package/src/data/index.ts +12 -0
- package/src/data/types.ts +66 -0
- package/src/errors.ts +5 -0
- package/src/index.ts +57 -0
- package/src/meta/components.ts +23 -3
- package/src/meta/index.ts +8 -0
- package/src/meta/layout/common-props.ts +9 -0
- package/src/meta/layout/elements.ts +57 -0
- package/src/meta/layout/index.ts +5 -0
- package/src/meta/layout/page-layout.ts +15 -3
- package/src/meta/types.ts +206 -21
- package/src/scheduling/types.ts +5 -1
- package/src/workflow/types.ts +10 -2
- package/dist/chunk-25PD6TYH.cjs.map +0 -1
- package/dist/chunk-OOOTPEJK.js.map +0 -1
|
@@ -181,6 +181,12 @@ var AppServiceImpl = class {
|
|
|
181
181
|
|
|
182
182
|
// src/meta/components.ts
|
|
183
183
|
var COMPONENTS_BASE_PATH = "/meta/v1/components";
|
|
184
|
+
function bundleVersionOf(bundleChecksum) {
|
|
185
|
+
if (!bundleChecksum) return void 0;
|
|
186
|
+
const separator = bundleChecksum.indexOf(":");
|
|
187
|
+
const hex = separator === -1 ? bundleChecksum : bundleChecksum.slice(separator + 1);
|
|
188
|
+
return /^[0-9a-f]{16,}$/i.test(hex) ? hex.toLowerCase() : void 0;
|
|
189
|
+
}
|
|
184
190
|
var ComponentServiceImpl = class {
|
|
185
191
|
constructor(client) {
|
|
186
192
|
this.client = client;
|
|
@@ -207,8 +213,16 @@ var ComponentServiceImpl = class {
|
|
|
207
213
|
async delete(id) {
|
|
208
214
|
await this.client.request("DELETE", `${COMPONENTS_BASE_PATH}/${id}`);
|
|
209
215
|
}
|
|
210
|
-
|
|
211
|
-
|
|
216
|
+
/**
|
|
217
|
+
* Path of the component's compiled bundle. With the component's
|
|
218
|
+
* `bundle_checksum` the URL is content-addressed (`?v=<hex>`), which the
|
|
219
|
+
* server answers with an immutable cache policy; without it the bundle
|
|
220
|
+
* revalidates on every load.
|
|
221
|
+
*/
|
|
222
|
+
bundleUrl(slug, bundleChecksum) {
|
|
223
|
+
const version = bundleVersionOf(bundleChecksum);
|
|
224
|
+
const base = `${COMPONENTS_BASE_PATH}/${slug}/bundle`;
|
|
225
|
+
return version ? `${base}?v=${encodeURIComponent(version)}` : base;
|
|
212
226
|
}
|
|
213
227
|
};
|
|
214
228
|
|
|
@@ -1118,6 +1132,7 @@ var SizingPropsSchema = z.object({
|
|
|
1118
1132
|
width: SizeValueSchema.optional(),
|
|
1119
1133
|
height: SizeValueSchema.optional(),
|
|
1120
1134
|
min_height: LengthValueSchema.optional(),
|
|
1135
|
+
max_height: LengthValueSchema.optional(),
|
|
1121
1136
|
grow: z.number().optional(),
|
|
1122
1137
|
shrink: z.number().optional(),
|
|
1123
1138
|
align: AlignSchema.optional()
|
|
@@ -1135,6 +1150,7 @@ var commonPropsShape = {
|
|
|
1135
1150
|
width: SizeValueSchema.optional(),
|
|
1136
1151
|
height: SizeValueSchema.optional(),
|
|
1137
1152
|
min_height: LengthValueSchema.optional(),
|
|
1153
|
+
max_height: LengthValueSchema.optional(),
|
|
1138
1154
|
grow: z.number().optional(),
|
|
1139
1155
|
shrink: z.number().optional(),
|
|
1140
1156
|
align: AlignSchema.optional(),
|
|
@@ -1161,7 +1177,8 @@ var LayoutElementType = {
|
|
|
1161
1177
|
List: "list",
|
|
1162
1178
|
WorkflowTrigger: "workflow_trigger",
|
|
1163
1179
|
SchedulingPicker: "scheduling_picker",
|
|
1164
|
-
Calendar: "calendar"
|
|
1180
|
+
Calendar: "calendar",
|
|
1181
|
+
Stepper: "stepper"
|
|
1165
1182
|
};
|
|
1166
1183
|
var CALENDAR_VIEW_KINDS = ["day", "week", "month", "agenda"];
|
|
1167
1184
|
var CALENDAR_MAX_OVERLAY_USERS = 8;
|
|
@@ -1176,6 +1193,17 @@ var LayoutTabSchema = z.lazy(
|
|
|
1176
1193
|
content: LayoutElementSchema
|
|
1177
1194
|
})
|
|
1178
1195
|
);
|
|
1196
|
+
var LayoutStepSchema = z.lazy(
|
|
1197
|
+
() => z.object({
|
|
1198
|
+
id: z.string().min(1),
|
|
1199
|
+
value: z.string().min(1),
|
|
1200
|
+
label: z.string().min(1),
|
|
1201
|
+
icon: z.string().optional(),
|
|
1202
|
+
continue_label: z.string().optional(),
|
|
1203
|
+
visible_when: FilterGroupSchema.optional(),
|
|
1204
|
+
content: LayoutElementSchema
|
|
1205
|
+
})
|
|
1206
|
+
);
|
|
1179
1207
|
var LayoutElementSchema = z.lazy(
|
|
1180
1208
|
() => z.discriminatedUnion("type", [
|
|
1181
1209
|
z.object({
|
|
@@ -1219,6 +1247,14 @@ var LayoutElementSchema = z.lazy(
|
|
|
1219
1247
|
tabs: z.array(LayoutTabSchema),
|
|
1220
1248
|
default_tab_id: z.string().optional()
|
|
1221
1249
|
}),
|
|
1250
|
+
z.object({
|
|
1251
|
+
type: z.literal("stepper"),
|
|
1252
|
+
...commonPropsShape,
|
|
1253
|
+
attribute: z.string().min(1),
|
|
1254
|
+
continue_label: z.string().optional(),
|
|
1255
|
+
back_label: z.string().optional(),
|
|
1256
|
+
steps: z.array(LayoutStepSchema).min(1)
|
|
1257
|
+
}),
|
|
1222
1258
|
z.object({
|
|
1223
1259
|
type: z.literal("field"),
|
|
1224
1260
|
...commonPropsShape,
|
|
@@ -1336,6 +1372,7 @@ var PAGE_BACKGROUND_TOKENS = [
|
|
|
1336
1372
|
"danger",
|
|
1337
1373
|
"info"
|
|
1338
1374
|
];
|
|
1375
|
+
var PAGE_HEADERS = ["full", "condensed"];
|
|
1339
1376
|
var PAGE_BACKGROUND_COLOR_RE = /^(#[0-9a-fA-F]{3,8}|(rgb|rgba|hsl|hsla|oklch|oklab)\([0-9a-zA-Z.,%/ +-]+\))$/;
|
|
1340
1377
|
function isPageBackground(text) {
|
|
1341
1378
|
const value = text.trim();
|
|
@@ -1346,7 +1383,8 @@ var PageStyleSchema = z.object({
|
|
|
1346
1383
|
background: z.string().refine(isPageBackground, "must be a design token or a hex / rgb / hsl / oklch / oklab color").optional(),
|
|
1347
1384
|
max_width: StyleSizeValueSchema.optional(),
|
|
1348
1385
|
padding_x: StyleSizeValueSchema.optional(),
|
|
1349
|
-
padding_y: StyleSizeValueSchema.optional()
|
|
1386
|
+
padding_y: StyleSizeValueSchema.optional(),
|
|
1387
|
+
header: z.enum(PAGE_HEADERS).optional()
|
|
1350
1388
|
});
|
|
1351
1389
|
var PageLayoutSchema = z.object({
|
|
1352
1390
|
version: z.literal(1),
|
|
@@ -1576,6 +1614,10 @@ var PublicAccessOperationSchema = z.enum(["read", "write", "delete"]);
|
|
|
1576
1614
|
var EntityContactBindingSchema = z.object({
|
|
1577
1615
|
duplicate_policy: z.enum(["reject", "flag"])
|
|
1578
1616
|
});
|
|
1617
|
+
var UniqueConstraintSchema = z.object({
|
|
1618
|
+
name: z.string(),
|
|
1619
|
+
attributes: z.array(z.string())
|
|
1620
|
+
});
|
|
1579
1621
|
var EntitySchema = AuditFieldsSchema.extend({
|
|
1580
1622
|
slug: z.string(),
|
|
1581
1623
|
name: z.string(),
|
|
@@ -1590,7 +1632,8 @@ var EntitySchema = AuditFieldsSchema.extend({
|
|
|
1590
1632
|
// cleanly — the field is non-optional in the TS surface but tolerant on
|
|
1591
1633
|
// the wire.
|
|
1592
1634
|
title_template: z.string().default(""),
|
|
1593
|
-
attributes: z.array(AttributeSchema)
|
|
1635
|
+
attributes: z.array(AttributeSchema),
|
|
1636
|
+
unique_constraints: z.array(UniqueConstraintSchema).optional()
|
|
1594
1637
|
});
|
|
1595
1638
|
var EntityWithSchemaSchema = EntitySchema.extend({
|
|
1596
1639
|
schema: z.record(z.unknown())
|
|
@@ -1619,19 +1662,30 @@ var ComponentSchema = AuditFieldsSchema.extend({
|
|
|
1619
1662
|
module_slug: z.string(),
|
|
1620
1663
|
bundle_file_id: z.string(),
|
|
1621
1664
|
source_file_id: z.string(),
|
|
1665
|
+
bundle_checksum: z.string().optional(),
|
|
1666
|
+
reserved_height: z.number().int().nonnegative().optional(),
|
|
1622
1667
|
// default(false): rows serialized before the flag existed lack the field.
|
|
1623
1668
|
props_schema: z.record(z.unknown()).nullable(),
|
|
1624
1669
|
is_public: z.boolean().default(false)
|
|
1625
1670
|
});
|
|
1671
|
+
var PageActionKindSchema = z.enum(["action", "workflow", "agent", "intent", "link"]);
|
|
1626
1672
|
var PageActionSchema = z.object({
|
|
1627
1673
|
label: z.string(),
|
|
1628
1674
|
icon: z.string(),
|
|
1629
|
-
kind:
|
|
1675
|
+
kind: PageActionKindSchema.optional(),
|
|
1630
1676
|
action: z.string().optional(),
|
|
1631
1677
|
workflow: z.string().optional(),
|
|
1678
|
+
agent: z.string().optional(),
|
|
1679
|
+
intent: z.enum(["create_record", "update_record"]).optional(),
|
|
1680
|
+
entity: z.string().optional(),
|
|
1681
|
+
record: z.string().optional(),
|
|
1682
|
+
url: z.string().optional(),
|
|
1632
1683
|
params: z.record(z.string()).optional(),
|
|
1633
1684
|
inputs: z.record(z.string()).optional(),
|
|
1685
|
+
prompt: z.string().optional(),
|
|
1686
|
+
context: z.string().optional(),
|
|
1634
1687
|
skip_confirmation: z.boolean().optional(),
|
|
1688
|
+
visible_when: FilterGroupSchema.optional(),
|
|
1635
1689
|
extension_key: z.string().optional()
|
|
1636
1690
|
});
|
|
1637
1691
|
var SelectionModeSchema = z.enum(["on_demand", "always", "off"]);
|
|
@@ -1665,13 +1719,15 @@ var ListViewSchema = AuditFieldsSchema.extend({
|
|
|
1665
1719
|
sorting: z.array(SortConfigSchema),
|
|
1666
1720
|
filters: z.array(FilterGroupSchema)
|
|
1667
1721
|
});
|
|
1668
|
-
var PageTypeSchema = z.enum(["record", "platform", "kiosk", "public"]);
|
|
1722
|
+
var PageTypeSchema = z.enum(["record", "platform", "kiosk", "public", "trigger"]);
|
|
1669
1723
|
var PageSchema = AuditFieldsSchema.extend({
|
|
1670
1724
|
slug: z.string(),
|
|
1671
1725
|
name: z.string(),
|
|
1672
1726
|
module_slug: z.string(),
|
|
1673
1727
|
type: PageTypeSchema,
|
|
1674
1728
|
entity_slug: z.string().optional(),
|
|
1729
|
+
kind: PageActionKindSchema.optional(),
|
|
1730
|
+
reference: z.string().optional(),
|
|
1675
1731
|
actions: z.array(PageActionSchema),
|
|
1676
1732
|
layout: PageLayoutSchema
|
|
1677
1733
|
});
|
|
@@ -1773,6 +1829,8 @@ var AppHomeSchema = z.object({
|
|
|
1773
1829
|
type: z.enum(["list", "page"]),
|
|
1774
1830
|
reference: z.string()
|
|
1775
1831
|
});
|
|
1832
|
+
var RecordPageBindingSchema = z.object({ view: z.string().optional(), create: z.string().optional(), edit: z.string().optional() }).strict();
|
|
1833
|
+
var TriggerPageBindingSchema = z.object({ input: z.string().optional(), running: z.string().optional(), result: z.string().optional() }).strict();
|
|
1776
1834
|
var AppConfigurationSchema = AuditFieldsSchema.extend({
|
|
1777
1835
|
slug: z.string(),
|
|
1778
1836
|
org_id: z.string(),
|
|
@@ -1783,7 +1841,9 @@ var AppConfigurationSchema = AuditFieldsSchema.extend({
|
|
|
1783
1841
|
menu_slug: z.string().optional(),
|
|
1784
1842
|
default_agent_key: z.string().optional(),
|
|
1785
1843
|
agent_keys: z.array(z.string()).optional(),
|
|
1786
|
-
record_pages: z.record(
|
|
1844
|
+
record_pages: z.record(RecordPageBindingSchema).optional(),
|
|
1845
|
+
action_pages: z.record(TriggerPageBindingSchema).optional(),
|
|
1846
|
+
workflow_pages: z.record(TriggerPageBindingSchema).optional(),
|
|
1787
1847
|
searchable_entities: z.array(z.string()).optional()
|
|
1788
1848
|
});
|
|
1789
1849
|
var AppSchema = AuditFieldsSchema.extend({
|
|
@@ -1906,6 +1966,6 @@ var MetaClient = class {
|
|
|
1906
1966
|
}
|
|
1907
1967
|
};
|
|
1908
1968
|
|
|
1909
|
-
export { AppConfigurationSchema, AppHomeSchema, AppSchema, AttributeSchema, AuditFieldsSchema, BUILT_IN_CONTROLS, CALENDAR_MAX_OVERLAY_USERS, CALENDAR_VIEW_KINDS, CURRENT_USER, CURRENT_USER_DEFAULT, ColumnSchema, ComponentSchema, ContactAddressAttributeMetaSchema, CurrencyAttributeMetaSchema, DEFAULT_PAGE_SIZE, DONE, DesignReferenceSchema, EntityContactBindingSchema, EntityExtensionSchema, EntitySchema, EntityWithSchemaSchema, ExtensionPositionSchema, FileAttributeMetaSchema, FileRefSchema, FilterElementSchema, FilterGroupSchema, LayoutElementSchema, LayoutElementType, LayoutTabSchema, LengthValueSchema, ListExtensionColumnPlacementSchema, ListExtensionSchema, ListSchema, ListViewSchema, MENU_CONFIGURATION_EXTENSION_ANCHOR_ITEMS, MenuConfigurationExtensionPlacementSchema, MenuConfigurationExtensionPositionSchema, MenuConfigurationExtensionSchema, MenuConfigurationSchema, MenuItemSchema, MenuItemType, MetaClient, ModuleSchema, OnDeleteActionSchema, PAGE_BACKGROUND_COLOR_RE, PAGE_BACKGROUND_TOKENS, PAGE_EXTENSION_ANCHOR_MAIN, PAGE_EXTENSION_ANCHOR_SIDE_PANEL, PLATFORM_ATTRIBUTE_NAMES, PLATFORM_USER_ID, PageActionSchema, PageExtensionPlacementSchema, PageExtensionSchema, PageIterator, PageLayoutSchema, PageLayoutSidePanelSchema, PageSchema, PageStyleSchema, PrincipalRefSchema, RECORD_TITLE_FIELD, RelationAttributeMetaSchema, ResponseMetaSchema, SizeValueSchema, SortConfigSchema, StyleSizeValueSchema, UserAttributeMetaSchema, UserRefSchema, VariableSchema, acceptsCurrentUserDefault, allCurrencyCodes, createIterator, createListResultSchema, currencyLabel, currencySymbol, currencySymbolSide, formatAmount, formatMoney, isBuiltInControl, isCurrentUser, isCurrentUserDefault, isLengthValue, isPageBackground, isPlatformAttributeName, isReservedAttributeName, isStyleSizeValue, isTitleQueryable, localeNumberSeparators, lookupCompatibleControls, lookupControls, lookupPrimaryControl, parseAmount, parseContactAddressMeta, parseCurrencyMeta, parseFileMeta, parsePrincipalMeta, parseRelationMeta, parseUserMeta, platformAttributes, titleTemplateVariables };
|
|
1910
|
-
//# sourceMappingURL=chunk-
|
|
1911
|
-
//# sourceMappingURL=chunk-
|
|
1969
|
+
export { AppConfigurationSchema, AppHomeSchema, AppSchema, AttributeSchema, AuditFieldsSchema, BUILT_IN_CONTROLS, CALENDAR_MAX_OVERLAY_USERS, CALENDAR_VIEW_KINDS, CURRENT_USER, CURRENT_USER_DEFAULT, ColumnSchema, ComponentSchema, ContactAddressAttributeMetaSchema, CurrencyAttributeMetaSchema, DEFAULT_PAGE_SIZE, DONE, DesignReferenceSchema, EntityContactBindingSchema, EntityExtensionSchema, EntitySchema, EntityWithSchemaSchema, ExtensionPositionSchema, FileAttributeMetaSchema, FileRefSchema, FilterElementSchema, FilterGroupSchema, LayoutElementSchema, LayoutElementType, LayoutStepSchema, LayoutTabSchema, LengthValueSchema, ListExtensionColumnPlacementSchema, ListExtensionSchema, ListSchema, ListViewSchema, MENU_CONFIGURATION_EXTENSION_ANCHOR_ITEMS, MenuConfigurationExtensionPlacementSchema, MenuConfigurationExtensionPositionSchema, MenuConfigurationExtensionSchema, MenuConfigurationSchema, MenuItemSchema, MenuItemType, MetaClient, ModuleSchema, OnDeleteActionSchema, PAGE_BACKGROUND_COLOR_RE, PAGE_BACKGROUND_TOKENS, PAGE_EXTENSION_ANCHOR_MAIN, PAGE_EXTENSION_ANCHOR_SIDE_PANEL, PAGE_HEADERS, PLATFORM_ATTRIBUTE_NAMES, PLATFORM_USER_ID, PageActionSchema, PageExtensionPlacementSchema, PageExtensionSchema, PageIterator, PageLayoutSchema, PageLayoutSidePanelSchema, PageSchema, PageStyleSchema, PrincipalRefSchema, RECORD_TITLE_FIELD, RecordPageBindingSchema, RelationAttributeMetaSchema, ResponseMetaSchema, SizeValueSchema, SortConfigSchema, StyleSizeValueSchema, TriggerPageBindingSchema, UserAttributeMetaSchema, UserRefSchema, VariableSchema, acceptsCurrentUserDefault, allCurrencyCodes, bundleVersionOf, createIterator, createListResultSchema, currencyLabel, currencySymbol, currencySymbolSide, formatAmount, formatMoney, isBuiltInControl, isCurrentUser, isCurrentUserDefault, isLengthValue, isPageBackground, isPlatformAttributeName, isReservedAttributeName, isStyleSizeValue, isTitleQueryable, localeNumberSeparators, lookupCompatibleControls, lookupControls, lookupPrimaryControl, parseAmount, parseContactAddressMeta, parseCurrencyMeta, parseFileMeta, parsePrincipalMeta, parseRelationMeta, parseUserMeta, platformAttributes, titleTemplateVariables };
|
|
1970
|
+
//# sourceMappingURL=chunk-3VQQEJV6.js.map
|
|
1971
|
+
//# sourceMappingURL=chunk-3VQQEJV6.js.map
|