@proteos/sdk 0.46.0 → 0.47.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
@@ -864,6 +864,19 @@ export interface UpdateComponentRequest {
864
864
 
865
865
  /**
866
866
  * List column definition.
867
+ *
868
+ * `attribute` is an attribute name or a dot path, told apart by the type of
869
+ * the first segment:
870
+ *
871
+ * - `name` — an attribute on the list's own entity.
872
+ * - `address.city` — a leaf inside one of its `object` attributes.
873
+ * - `company_id.name` — a field of the RELATED record, reached through a
874
+ * relation attribute (the first segment is the FK).
875
+ *
876
+ * A bare `object` attribute is not a valid column — it carries no value of
877
+ * its own, only leaves. Sorting follows the same grammar minus the relation
878
+ * hop: an attribute or an object path can be ordered by, a related field
879
+ * cannot (it would need a join).
867
880
  */
868
881
  export interface Column {
869
882
  attribute: string
@@ -877,7 +890,9 @@ export interface Column {
877
890
  export type SortDirection = 'asc' | 'desc'
878
891
 
879
892
  /**
880
- * Sort configuration.
893
+ * Sort configuration. `attribute` is an attribute name or an object path
894
+ * (`address.city`); relation paths are not sortable — ordering by a related
895
+ * field would need a join the records query doesn't do.
881
896
  */
882
897
  export interface SortConfig {
883
898
  attribute: string
@@ -904,6 +919,60 @@ export {
904
919
  type LogicalOperator,
905
920
  }
906
921
 
922
+ // ============================================================================
923
+ // Toolbar action buttons (shared by pages and lists)
924
+ // ============================================================================
925
+
926
+ /**
927
+ * What a page toolbar button invokes. Absent normalizes to `action` (pages
928
+ * persisted before `kind` existed).
929
+ */
930
+ export type PageActionKind = 'action' | 'workflow'
931
+
932
+ /**
933
+ * Page action definition — one toolbar button. `kind: action` invokes a
934
+ * function-service Action by slug (`action`) and may prefill its params;
935
+ * `kind: workflow` starts a manual run of a workflow by key (`workflow`) and
936
+ * may prefill its manual-trigger inputs. `params` / `inputs` map target field
937
+ * names to Liquid templates rendered against the page scope
938
+ * `{ record, entity, params, user }`; a resolved field is locked in the invoke
939
+ * dialog. `skip_confirmation` fires the target immediately when every required
940
+ * field resolved from the templates.
941
+ */
942
+ export interface PageAction {
943
+ label: string
944
+ icon: string
945
+ kind?: PageActionKind
946
+ action?: string
947
+ workflow?: string
948
+ params?: Record<string, string>
949
+ inputs?: Record<string, string>
950
+ skip_confirmation?: boolean
951
+ }
952
+
953
+ export const PageActionSchema = z.object({
954
+ label: z.string(),
955
+ icon: z.string(),
956
+ kind: z.enum(['action', 'workflow']).optional(),
957
+ action: z.string().optional(),
958
+ workflow: z.string().optional(),
959
+ params: z.record(z.string()).optional(),
960
+ inputs: z.record(z.string()).optional(),
961
+ skip_confirmation: z.boolean().optional(),
962
+ })
963
+
964
+ /**
965
+ * Whether a list's rows can be checked, and whether the checkboxes show from
966
+ * the start:
967
+ *
968
+ * - `on_demand` (default) — a Select toggle in the toolbar reveals them.
969
+ * - `always` — checkboxes are showing from the start.
970
+ * - `off` — rows can never be checked, even when the list carries actions.
971
+ */
972
+ export type SelectionMode = 'on_demand' | 'always' | 'off'
973
+
974
+ export const SelectionModeSchema = z.enum(['on_demand', 'always', 'off'])
975
+
907
976
  /**
908
977
  * List configuration.
909
978
  * Note: List uses `slug` as its primary identifier, not `id`.
@@ -915,6 +984,15 @@ export interface List extends AuditFields {
915
984
  name: string
916
985
  entity_slug: string
917
986
  columns: Column[]
987
+ /**
988
+ * Toolbar buttons on the list, same shape a page carries. They act on the
989
+ * rows SELECTED in the list, so an `action` button names an `entity_batch`
990
+ * action (invoked once with every selected record id) and prefill templates
991
+ * resolve against the list scope `{ selection, entity, user }`.
992
+ */
993
+ actions?: PageAction[]
994
+ /** Row-selection affordance; absent normalizes to `on_demand`. */
995
+ selection_mode?: SelectionMode
918
996
  /** Record page to open from this list; empty/absent = org default for the entity. */
919
997
  default_page_slug?: string
920
998
  sorting: SortConfig[]
@@ -938,6 +1016,8 @@ export const ListSchema = AuditFieldsSchema.extend({
938
1016
  name: z.string(),
939
1017
  entity_slug: z.string(),
940
1018
  columns: z.array(ColumnSchema),
1019
+ actions: z.array(PageActionSchema).optional(),
1020
+ selection_mode: SelectionModeSchema.optional(),
941
1021
  default_page_slug: z.string().optional(),
942
1022
  sorting: z.array(SortConfigSchema),
943
1023
  filters: z.array(FilterGroupSchema),
@@ -962,6 +1042,8 @@ export interface CreateListRequest {
962
1042
  entity_slug: string
963
1043
  name: string
964
1044
  columns: Column[]
1045
+ actions?: PageAction[]
1046
+ selection_mode?: SelectionMode
965
1047
  default_page_slug?: string
966
1048
  sorting: SortConfig[]
967
1049
  filters: FilterGroup[]
@@ -974,6 +1056,8 @@ export interface UpdateListRequest {
974
1056
  name?: string
975
1057
  module_slug?: string
976
1058
  columns?: Column[]
1059
+ actions?: PageAction[]
1060
+ selection_mode?: SelectionMode
977
1061
  /** Set to '' to clear back to the org default. */
978
1062
  default_page_slug?: string
979
1063
  sorting?: SortConfig[]
@@ -1047,44 +1131,6 @@ export interface UpdateListViewRequest {
1047
1131
  // Page Types
1048
1132
  // ============================================================================
1049
1133
 
1050
- /**
1051
- * What a page toolbar button invokes. Absent normalizes to `action` (pages
1052
- * persisted before `kind` existed).
1053
- */
1054
- export type PageActionKind = 'action' | 'workflow'
1055
-
1056
- /**
1057
- * Page action definition — one toolbar button. `kind: action` invokes a
1058
- * function-service Action by slug (`action`) and may prefill its params;
1059
- * `kind: workflow` starts a manual run of a workflow by key (`workflow`) and
1060
- * may prefill its manual-trigger inputs. `params` / `inputs` map target field
1061
- * names to Liquid templates rendered against the page scope
1062
- * `{ record, entity, params, user }`; a resolved field is locked in the invoke
1063
- * dialog. `skip_confirmation` fires the target immediately when every required
1064
- * field resolved from the templates.
1065
- */
1066
- export interface PageAction {
1067
- label: string
1068
- icon: string
1069
- kind?: PageActionKind
1070
- action?: string
1071
- workflow?: string
1072
- params?: Record<string, string>
1073
- inputs?: Record<string, string>
1074
- skip_confirmation?: boolean
1075
- }
1076
-
1077
- export const PageActionSchema = z.object({
1078
- label: z.string(),
1079
- icon: z.string(),
1080
- kind: z.enum(['action', 'workflow']).optional(),
1081
- action: z.string().optional(),
1082
- workflow: z.string().optional(),
1083
- params: z.record(z.string()).optional(),
1084
- inputs: z.record(z.string()).optional(),
1085
- skip_confirmation: z.boolean().optional(),
1086
- })
1087
-
1088
1134
  /**
1089
1135
  * Page type — encodes what the page binds to and how it is served (chrome +
1090
1136
  * auth posture both follow from it):