@proteos/sdk 0.49.0 → 0.51.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/src/meta/types.ts CHANGED
@@ -994,7 +994,6 @@ export interface List extends AuditFields {
994
994
  /** Row-selection affordance; absent normalizes to `on_demand`. */
995
995
  selection_mode?: SelectionMode
996
996
  /** Record page to open from this list; empty/absent = org default for the entity. */
997
- default_page_slug?: string
998
997
  sorting: SortConfig[]
999
998
  filters: FilterGroup[]
1000
999
  }
@@ -1018,7 +1017,6 @@ export const ListSchema = AuditFieldsSchema.extend({
1018
1017
  columns: z.array(ColumnSchema),
1019
1018
  actions: z.array(PageActionSchema).optional(),
1020
1019
  selection_mode: SelectionModeSchema.optional(),
1021
- default_page_slug: z.string().optional(),
1022
1020
  sorting: z.array(SortConfigSchema),
1023
1021
  filters: z.array(FilterGroupSchema),
1024
1022
  })
@@ -1044,7 +1042,6 @@ export interface CreateListRequest {
1044
1042
  columns: Column[]
1045
1043
  actions?: PageAction[]
1046
1044
  selection_mode?: SelectionMode
1047
- default_page_slug?: string
1048
1045
  sorting: SortConfig[]
1049
1046
  filters: FilterGroup[]
1050
1047
  }
@@ -1059,7 +1056,6 @@ export interface UpdateListRequest {
1059
1056
  actions?: PageAction[]
1060
1057
  selection_mode?: SelectionMode
1061
1058
  /** Set to '' to clear back to the org default. */
1062
- default_page_slug?: string
1063
1059
  sorting?: SortConfig[]
1064
1060
  filters?: FilterGroup[]
1065
1061
  }
@@ -1329,6 +1325,100 @@ export interface UpdateMenuConfigurationRequest {
1329
1325
  is_default?: boolean
1330
1326
  }
1331
1327
 
1328
+ // ============================================================================
1329
+ // AppConfiguration Types
1330
+ // ============================================================================
1331
+
1332
+ /** What an app opens on: a list (records table) or a platform page. */
1333
+ export type AppHomeType = 'list' | 'page'
1334
+
1335
+ export interface AppHome {
1336
+ type: AppHomeType
1337
+ reference: string
1338
+ }
1339
+
1340
+ export const AppHomeSchema = z.object({
1341
+ type: z.enum(['list', 'page']),
1342
+ reference: z.string(),
1343
+ })
1344
+
1345
+ /**
1346
+ * AppConfiguration — a TYPED binding row: "how app X presents itself" to
1347
+ * everyone (`profile_slug: ''` = the app's default configuration) or to one
1348
+ * profile (an override). One row per (app, profile). The web merges
1349
+ * override ⊕ default field-wise and falls through to structural defaults (menu
1350
+ * `is_default`, first menu leaf, org-default agent, first page) for anything
1351
+ * still unset.
1352
+ */
1353
+ export interface AppConfiguration extends AuditFields {
1354
+ slug: string
1355
+ org_id: string
1356
+ module_slug: string
1357
+ app_slug: string
1358
+ /** Bound profile; `''` = the default configuration for everyone. */
1359
+ profile_slug: string
1360
+ /** Home; absent = the first list/page leaf of the resolved menu. */
1361
+ home?: AppHome | null
1362
+ /** Menu to show; `''` = the app's `is_default` menu. */
1363
+ menu_slug?: string
1364
+ /** Agent Ask Proteos preselects in this app; `''` = the org default. */
1365
+ default_agent_key?: string
1366
+ /** Agents offered in this app; empty = every org agent. */
1367
+ agent_keys?: string[]
1368
+ /** entity_slug → record page slug opened from this app. */
1369
+ record_pages?: Record<string, string>
1370
+ }
1371
+
1372
+ export const AppConfigurationSchema = AuditFieldsSchema.extend({
1373
+ slug: z.string(),
1374
+ org_id: z.string(),
1375
+ module_slug: z.string(),
1376
+ app_slug: z.string(),
1377
+ profile_slug: z.string(),
1378
+ home: AppHomeSchema.nullable().optional(),
1379
+ menu_slug: z.string().optional(),
1380
+ default_agent_key: z.string().optional(),
1381
+ agent_keys: z.array(z.string()).optional(),
1382
+ record_pages: z.record(z.string()).optional(),
1383
+ })
1384
+
1385
+ export interface ListAppConfigurationsOptions extends MetaListOptions {
1386
+ slug?: string
1387
+ module_slug?: string
1388
+ app_slug?: string
1389
+ profile_slug?: string
1390
+ /** `true` = only default rows (no profile), `false` = only profile overrides.
1391
+ * An empty `profile_slug` is never sent, so this is how default rows are
1392
+ * selected. */
1393
+ is_default?: boolean
1394
+ menu_slug?: string
1395
+ }
1396
+
1397
+ export interface CreateAppConfigurationRequest {
1398
+ slug: string
1399
+ module_slug?: string
1400
+ app_slug: string
1401
+ profile_slug?: string
1402
+ home?: AppHome | null
1403
+ menu_slug?: string
1404
+ default_agent_key?: string
1405
+ agent_keys?: string[]
1406
+ record_pages?: Record<string, string>
1407
+ }
1408
+
1409
+ /**
1410
+ * Partial update. `home` is tri-state: absent = unchanged, `null` = clear,
1411
+ * object = set. The (app_slug, profile_slug) binding is immutable.
1412
+ */
1413
+ export interface UpdateAppConfigurationRequest {
1414
+ module_slug?: string
1415
+ home?: AppHome | null
1416
+ menu_slug?: string
1417
+ default_agent_key?: string
1418
+ agent_keys?: string[]
1419
+ record_pages?: Record<string, string>
1420
+ }
1421
+
1332
1422
  // ============================================================================
1333
1423
  // App Types
1334
1424
  // ============================================================================
@@ -456,6 +456,8 @@ export interface Workflow extends AuditFields {
456
456
  key: string
457
457
  name: string
458
458
  description: string
459
+ /** Slug of the module that deployed this workflow; empty when it is org-owned. */
460
+ module_slug: string
459
461
  status: WorkflowStatus
460
462
  graph: WorkflowGraph
461
463
  version: number
@@ -533,6 +535,15 @@ export interface ListWorkflowsOptions extends ListOptions {
533
535
  name?: string
534
536
  'name[contains]'?: string
535
537
  status?: WorkflowStatus
538
+ /**
539
+ * Restrict to one module's workflows. The empty string is meaningful: it
540
+ * matches only the org-owned workflows no module deployed.
541
+ *
542
+ * `sort_by` additionally accepts a comma-separated list of sortable fields
543
+ * (`module_slug,name`) so a grouped list can order by its grouping column
544
+ * first; `sort_direction` applies to all of them.
545
+ */
546
+ module_slug?: string
536
547
  }
537
548
 
538
549
  // ---------------------------------------------------------------------------
@@ -630,6 +641,8 @@ export interface ExecutionTriggerContext {
630
641
  export interface ExecutionError {
631
642
  code: string
632
643
  message: string
644
+ /** Machine-readable payload of the node error (a held send's earliest_allowed_at / rule_id, http_status …). */
645
+ details?: Record<string, unknown>
633
646
  /** Marks business failures the user can fix, vs infrastructure faults. */
634
647
  is_user_error?: boolean
635
648
  }