@nivaro/sdk 0.2.6 → 0.3.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.
Files changed (4) hide show
  1. package/README.md +286 -195
  2. package/dist/index.d.ts +2079 -208
  3. package/dist/index.js +863 -118
  4. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1878,6 +1878,169 @@ declare function readIntegrationHealth(): Command<{
1878
1878
  };
1879
1879
  }>;
1880
1880
 
1881
+ /**
1882
+ * Agents working with people: ask_human questions (#3220), agent task assignees (#3223) and
1883
+ * agent triggers (#3210, administrators).
1884
+ */
1885
+
1886
+ type AgentQuestionStatus = 'open' | 'answered' | 'expired' | 'cancelled';
1887
+ interface AgentQuestion {
1888
+ id: UUID;
1889
+ status: AgentQuestionStatus;
1890
+ question: string;
1891
+ choices: string[];
1892
+ /** false = the answer must be one of the choices. */
1893
+ allow_text: boolean;
1894
+ collection: string | null;
1895
+ item: string | null;
1896
+ /** The assistant's name (its OAuth app or API key). */
1897
+ asked_by: string;
1898
+ /** The person the assistant acts for. */
1899
+ asked_for: UUID;
1900
+ asked_for_name: string | null;
1901
+ recipient: UUID;
1902
+ recipient_name: string | null;
1903
+ answer: string | null;
1904
+ answer_choice: string | null;
1905
+ answered_at: ISODate | null;
1906
+ expires_at: ISODate;
1907
+ created_at: ISODate;
1908
+ /** Asker only: the connection key it came from and when the answer was collected. */
1909
+ connection?: string;
1910
+ answer_seen_at?: ISODate | null;
1911
+ }
1912
+ /** Ask a person (default: the caller's own person) a question; it lands in their inbox. */
1913
+ declare function askHuman(body: {
1914
+ to?: UUID | 'me';
1915
+ question: string;
1916
+ choices?: string[];
1917
+ allow_text?: boolean;
1918
+ expires_in_minutes?: number;
1919
+ collection?: string;
1920
+ item?: string;
1921
+ }): Command<{
1922
+ data: AgentQuestion;
1923
+ }>;
1924
+ /** Read a question; `wait` (0–25 s) holds the request until it is answered. */
1925
+ declare function readAgentQuestion(id: UUID, wait?: number): Command<{
1926
+ data: AgentQuestion;
1927
+ }>;
1928
+ /** Questions waiting on the caller. `can_answer` is false outside a signed-in browser. */
1929
+ declare function listMyAgentQuestions(): Command<{
1930
+ data: AgentQuestion[];
1931
+ ready: boolean;
1932
+ can_answer?: boolean;
1933
+ }>;
1934
+ /** What the calling connection asked (`unseen` = answered, not collected yet). */
1935
+ declare function listAskedQuestions(query?: {
1936
+ status?: 'open' | 'unseen' | 'answered' | 'expired' | 'cancelled' | 'all';
1937
+ limit?: number;
1938
+ }): Command<{
1939
+ data: AgentQuestion[];
1940
+ }>;
1941
+ /** Answer a question (the person asked, from a signed-in session only). */
1942
+ declare function answerAgentQuestion(id: UUID, body: {
1943
+ choice?: string;
1944
+ answer?: string;
1945
+ }): Command<{
1946
+ data: AgentQuestion;
1947
+ }>;
1948
+ declare function cancelAgentQuestion(id: UUID): Command<{
1949
+ data: AgentQuestion;
1950
+ }>;
1951
+ interface TaskAgent {
1952
+ /** Connection key: o<grant id> (a connected app) or k<api key id>. */
1953
+ conn: string;
1954
+ kind: 'oauth' | 'api_key';
1955
+ name: string;
1956
+ /** The person the agent acts for — the task's assignee. */
1957
+ user_id: UUID;
1958
+ user_name: string | null;
1959
+ }
1960
+ /** Agents the caller may hand a task to (their own; `all` for an administrator). */
1961
+ declare function listTaskAgents(opts?: {
1962
+ all?: boolean;
1963
+ }): Command<{
1964
+ data: TaskAgent[];
1965
+ ready: boolean;
1966
+ me?: string | null;
1967
+ }>;
1968
+ /** Tasks handed to the calling agent connection. */
1969
+ declare function listAgentTasks(status?: string): Command<{
1970
+ data: Array<Record<string, unknown>>;
1971
+ }>;
1972
+ type AgentTriggerEvent = 'create' | 'update' | 'transition';
1973
+ interface AgentTrigger {
1974
+ id: number;
1975
+ name: string;
1976
+ description: string | null;
1977
+ enabled: boolean;
1978
+ collection: string;
1979
+ events: AgentTriggerEvent[];
1980
+ conditions: Array<{
1981
+ field: string;
1982
+ op: string;
1983
+ value: unknown;
1984
+ }>;
1985
+ to_states: string[];
1986
+ fields: string[] | null;
1987
+ instructions: string | null;
1988
+ url: string;
1989
+ /** Masked when set. */
1990
+ signing_secret: string | null;
1991
+ /** Values masked. */
1992
+ headers: Record<string, string>;
1993
+ max_attempts: number;
1994
+ owner: UUID;
1995
+ owner_name: string | null;
1996
+ last_fired_at: ISODate | null;
1997
+ created_at: ISODate;
1998
+ updated_at: ISODate;
1999
+ last_7_days?: {
2000
+ delivered: number;
2001
+ dead: number;
2002
+ retrying: number;
2003
+ skipped: number;
2004
+ };
2005
+ }
2006
+ interface AgentTriggerDelivery {
2007
+ id: number;
2008
+ trigger_id: number;
2009
+ delivery_id: UUID;
2010
+ event: string;
2011
+ collection: string;
2012
+ item: string | null;
2013
+ status: 'sending' | 'retrying' | 'delivered' | 'dead' | 'discarded' | 'skipped';
2014
+ attempts: number;
2015
+ max_attempts: number;
2016
+ next_attempt_at: ISODate | null;
2017
+ last_status_code: number | null;
2018
+ last_error: string | null;
2019
+ latency_ms: number | null;
2020
+ delivered_at: ISODate | null;
2021
+ created_at: ISODate;
2022
+ request_body?: string | null;
2023
+ response_body?: string | null;
2024
+ }
2025
+ declare function listAgentTriggers(): Command<{
2026
+ data: {
2027
+ ready: boolean;
2028
+ triggers: AgentTrigger[];
2029
+ events: AgentTriggerEvent[];
2030
+ ops: string[];
2031
+ max_attempts_cap: number;
2032
+ };
2033
+ }>;
2034
+ declare function listAgentTriggerDeliveries(query?: {
2035
+ trigger?: number;
2036
+ status?: string;
2037
+ limit?: number;
2038
+ before?: number;
2039
+ }): Command<{
2040
+ data: AgentTriggerDelivery[];
2041
+ has_more: boolean;
2042
+ }>;
2043
+
1881
2044
  /**
1882
2045
  * AI commands: field generation, record summarization, natural-language
1883
2046
  * query, CSV column mapping, and semantic (vector) search.
@@ -2114,11 +2277,6 @@ declare function chaosWhatIf(dependency: string): Command<{
2114
2277
  data: ChaosWhatIfAnswer;
2115
2278
  }>;
2116
2279
 
2117
- /**
2118
- * Collaboration commands: tasks, approval chains, item locks, notifications
2119
- * (paginated center), per-user activity, issues.
2120
- */
2121
-
2122
2280
  type TaskStatus = 'open' | 'in_progress' | 'done' | 'cancelled';
2123
2281
  type TaskPriority = 'low' | 'normal' | 'urgent';
2124
2282
  /** One `[{field, op, value}]` rule: the task closes itself when the record
@@ -2156,6 +2314,9 @@ interface Task {
2156
2314
  team_name?: string | null;
2157
2315
  /** The record's human id (TP26-80366). */
2158
2316
  item_label?: string | null;
2317
+ /** #3223 — the agent connection the task is handed to (assignee = the person it acts for). */
2318
+ agent_assignee?: string | null;
2319
+ agent_name?: string | null;
2159
2320
  }
2160
2321
  interface MyTask extends Task {
2161
2322
  item_label: string | null;
@@ -2223,6 +2384,8 @@ declare function createTask(body: {
2223
2384
  due_date?: string | null;
2224
2385
  priority?: TaskPriority;
2225
2386
  done_when?: TaskDoneWhenRule[] | null;
2387
+ /** #3223 — hand it to an agent connection (o<grant id> | k<api key id>) instead of a person. */
2388
+ agent?: string | null;
2226
2389
  }): Command<{
2227
2390
  data: Task & {
2228
2391
  delegated_from: UUID | null;
@@ -2236,6 +2399,8 @@ declare function updateTask(id: number, body: Partial<{
2236
2399
  status: TaskStatus;
2237
2400
  priority: TaskPriority;
2238
2401
  done_when: TaskDoneWhenRule[] | null;
2402
+ /** #3223 — hand to an agent connection; null takes it back. */
2403
+ agent: string | null;
2239
2404
  }>): Command<{
2240
2405
  data: Task;
2241
2406
  }>;
@@ -2407,6 +2572,21 @@ interface NotificationItem {
2407
2572
  category?: string | null;
2408
2573
  /** Per-channel delivery outcome (in-app / push / email / sms). */
2409
2574
  delivery?: Record<string, unknown> | null;
2575
+ archived?: boolean;
2576
+ /** Set when the sender asked for an explicit acknowledgement. */
2577
+ ack?: {
2578
+ required: true;
2579
+ at: ISODate | null;
2580
+ by: string | null;
2581
+ } | null;
2582
+ sender?: UUID | null;
2583
+ sender_name?: string | null;
2584
+ snoozed_until?: ISODate | null;
2585
+ snooze_until_change?: boolean;
2586
+ /** The record's revision current when the notification was written. */
2587
+ revision_id?: number | null;
2588
+ /** Where opening it leads, for the app named by `app` (else the recipient's). */
2589
+ url?: string | null;
2410
2590
  }
2411
2591
  interface NotificationPage {
2412
2592
  data: NotificationItem[];
@@ -2424,6 +2604,8 @@ interface NotificationPage {
2424
2604
  ids: number[];
2425
2605
  rows: NotificationItem[];
2426
2606
  }>;
2607
+ /** Page 1: acknowledgement-required rows, pinned whatever the filter. */
2608
+ pinned?: NotificationItem[];
2427
2609
  total: number;
2428
2610
  page: number;
2429
2611
  limit: number;
@@ -2433,7 +2615,17 @@ interface NotificationPage {
2433
2615
  declare function listNotifications(query?: {
2434
2616
  page?: number;
2435
2617
  limit?: number;
2436
- status?: 'all' | 'inbox' | 'read';
2618
+ /** 'archived' lists only archived rows (they are left out of every other view). */
2619
+ status?: 'all' | 'inbox' | 'read' | 'archived';
2620
+ /** Unread only (same as `status: 'inbox'`). */
2621
+ unread?: boolean;
2622
+ /** Contains-match on subject or message. */
2623
+ search?: string;
2624
+ collection?: string;
2625
+ /** A sender's user id. */
2626
+ sender?: string;
2627
+ /** true = only the snoozed (sleeping) rows. */
2628
+ snoozed?: boolean;
2437
2629
  app?: string;
2438
2630
  /** 'critical' | 'needs_you' | 'fyi' | 'attention' (= critical + needs_you). */
2439
2631
  lane?: string;
@@ -2863,9 +3055,24 @@ declare function updateChatChannel(id: number, body: Partial<{
2863
3055
  }>): Command<{
2864
3056
  data: ChatChannel;
2865
3057
  }>;
2866
- /** Members of a channel (visible to anyone who can see the room). */
2867
- declare function listChatChannelMembers(id: number): Command<{
2868
- data: ChatChannelMember[];
3058
+ /**
3059
+ * Members of a channel (visible to anyone who can see the room). With no
3060
+ * options the full list comes back (old shape). Pass `limit` (default 50, max
3061
+ * 200), `offset` and/or `q` (name, @handle, email local part) to get one page,
3062
+ * online people first, plus `total` and `has_more`.
3063
+ */
3064
+ declare function listChatChannelMembers(id: number, opts?: {
3065
+ limit?: number;
3066
+ offset?: number;
3067
+ q?: string;
3068
+ }): Command<{
3069
+ data: Array<ChatChannelMember & {
3070
+ name?: string;
3071
+ title?: string | null;
3072
+ online?: boolean;
3073
+ }>;
3074
+ total?: number;
3075
+ has_more?: boolean;
2869
3076
  }>;
2870
3077
  /** Add someone to a channel (owner or admin). */
2871
3078
  declare function addChatChannelMember(id: number, userId: string): Command<{
@@ -2955,6 +3162,17 @@ interface MyWorkSummary {
2955
3162
  item: string | null;
2956
3163
  timestamp: ISODate;
2957
3164
  }>;
3165
+ /** #3220 — questions assistants asked the caller (open). */
3166
+ questions?: AgentQuestion[];
3167
+ /** #3223 / #3220 — present only when the caller is an agent connection. */
3168
+ agent?: {
3169
+ connection: string;
3170
+ };
3171
+ agent_tasks?: Array<Task & {
3172
+ item_label?: string | null;
3173
+ }>;
3174
+ /** Answers to this connection's questions it had not collected (now collected). */
3175
+ answers?: AgentQuestion[];
2958
3176
  counts: {
2959
3177
  owned: number;
2960
3178
  owned_breached: number;
@@ -2962,6 +3180,9 @@ interface MyWorkSummary {
2962
3180
  tasks: number;
2963
3181
  approvals: number;
2964
3182
  notifications: number;
3183
+ questions?: number;
3184
+ agent_tasks?: number;
3185
+ answers?: number;
2965
3186
  };
2966
3187
  }
2967
3188
  /** The current user's actionable inbox: owned records (SLA-first), tasks,
@@ -3824,6 +4045,58 @@ declare function readDashboard(id: UUID): Command<{
3824
4045
  declare function readDashboardWidgetData(widgetId: UUID, filters?: DashboardFilter[] | null): Command<{
3825
4046
  data: DashboardWidgetData | null;
3826
4047
  }>;
4048
+ /**
4049
+ * Create a dashboard owned by the caller. A `role_id` shares it with that role (and forces
4050
+ * `is_shared`).
4051
+ */
4052
+ declare function createDashboard(body: {
4053
+ name: string;
4054
+ is_shared?: boolean;
4055
+ role_id?: UUID | null;
4056
+ }): Command<{
4057
+ data: Dashboard;
4058
+ }>;
4059
+ /** Rename, share or set the saved filter bar of a dashboard (its owner or an admin). */
4060
+ declare function updateDashboard(id: UUID, body: {
4061
+ name?: string;
4062
+ is_shared?: boolean;
4063
+ role_id?: UUID | null;
4064
+ /** Up to 20 filters; an empty list clears the bar. */
4065
+ global_filters?: DashboardFilter[] | null;
4066
+ }): Command<{
4067
+ data: Dashboard;
4068
+ }>;
4069
+ /** Delete a dashboard and its widgets (its owner or an admin). */
4070
+ declare function deleteDashboard(id: UUID): Command<void>;
4071
+ /** A widget's settings on create / update. Grid units: `col`/`row` position, `width`/`height`. */
4072
+ interface DashboardWidgetInput {
4073
+ /**
4074
+ * count | sum | avg | latest | bar_chart | line_chart | report_preset | saved_view |
4075
+ * cumulative_flow | ai_query.
4076
+ */
4077
+ type: DashboardWidgetType;
4078
+ title: string;
4079
+ collection?: string | null;
4080
+ /** The summed/averaged field, the `latest` column list, a saved view or preset id. */
4081
+ field?: string | null;
4082
+ filters?: unknown;
4083
+ col?: number;
4084
+ row?: number;
4085
+ width?: number;
4086
+ height?: number;
4087
+ /** Refetch interval in seconds (10–86400); null = the page default. */
4088
+ refresh_seconds?: number | null;
4089
+ }
4090
+ /** Add a widget to a dashboard (its owner or an admin). */
4091
+ declare function createDashboardWidget(dashboardId: UUID, body: DashboardWidgetInput): Command<{
4092
+ data: DashboardWidget;
4093
+ }>;
4094
+ /** Change a widget (its dashboard's owner or an admin). */
4095
+ declare function updateDashboardWidget(widgetId: UUID, body: Partial<DashboardWidgetInput>): Command<{
4096
+ data: DashboardWidget;
4097
+ }>;
4098
+ /** Remove a widget (its dashboard's owner or an admin). */
4099
+ declare function deleteDashboardWidget(widgetId: UUID): Command<void>;
3827
4100
 
3828
4101
  /**
3829
4102
  * Layout editor commands: the bundle + atomic ops save model, the overview and
@@ -4202,7 +4475,7 @@ declare function readPickerExclusion(collection: string, itemId: string | number
4202
4475
  excluded: boolean;
4203
4476
  };
4204
4477
  }>;
4205
- /** Which of these ids are excluded from pickers? */
4478
+ /** Which of these ids are hidden from pickers? */
4206
4479
  declare function readPickerExclusions(collection: string, ids: Array<string | number>): Command<{
4207
4480
  data: {
4208
4481
  excluded: string[];
@@ -4345,6 +4618,27 @@ interface GlobalSearchRecord {
4345
4618
  id: string | number;
4346
4619
  label: string;
4347
4620
  snippet: string;
4621
+ display_name?: string | null;
4622
+ /** The field the match was found in — always one the caller may read. */
4623
+ matched_field?: string;
4624
+ matched_label?: string;
4625
+ /** Its value as the caller read it (≤80 characters). */
4626
+ matched_value?: string;
4627
+ exact?: boolean;
4628
+ score?: number;
4629
+ /** The caller created it, owns it, or opened it from search lately. */
4630
+ mine?: boolean;
4631
+ updated_at?: string;
4632
+ }
4633
+ interface GlobalSearchPerson {
4634
+ id: string;
4635
+ first_name: string | null;
4636
+ last_name: string | null;
4637
+ email: string | null;
4638
+ title: string | null;
4639
+ department: string | null;
4640
+ status?: string | null;
4641
+ account_kind?: string | null;
4348
4642
  }
4349
4643
  interface GlobalSearchResults {
4350
4644
  records: GlobalSearchRecord[];
@@ -4356,9 +4650,38 @@ interface GlobalSearchResults {
4356
4650
  label: string;
4357
4651
  path: string;
4358
4652
  }>;
4653
+ /** People matches (`@name` scopes to people only). */
4654
+ people?: GlobalSearchPerson[];
4655
+ /** Meaning-based matches when semantic search is on. */
4656
+ semantic?: Array<{
4657
+ collection: string;
4658
+ id: unknown;
4659
+ label: string;
4660
+ snippet: string;
4661
+ }>;
4662
+ /** An exact id / friendly-id hit. */
4663
+ exact?: GlobalSearchRecord | null;
4664
+ /** "Did you mean" rewordings. */
4665
+ suggestions?: string[];
4666
+ /** How the query was read: plain text, scope prefix and field filters. */
4667
+ query?: {
4668
+ text: string;
4669
+ scope: string | null;
4670
+ filters: unknown[];
4671
+ };
4672
+ /** Other kinds (comments, files, videos, docs, chat, config) — shape per kind. */
4673
+ extra?: unknown;
4674
+ /** Commands the client may offer (run only through their own routes, after a confirm). */
4675
+ commands?: unknown;
4359
4676
  }
4360
- /** Search records (permission-scoped), admin pages, and quick actions. */
4361
- declare function globalSearch(q: string): Command<{
4677
+ /**
4678
+ * Search records (permission-scoped), people, admin pages and quick actions. Understands
4679
+ * the query language (scope prefixes, field filters, exact ids). `labels: true` matches
4680
+ * only what each record's label shows.
4681
+ */
4682
+ declare function globalSearch(q: string, opts?: {
4683
+ labels?: boolean;
4684
+ }): Command<{
4362
4685
  data: GlobalSearchResults;
4363
4686
  }>;
4364
4687
  interface ApiKeyScope {
@@ -5179,6 +5502,37 @@ declare function updateFileMeta(id: string, data: {
5179
5502
  data: FileRecord;
5180
5503
  }>;
5181
5504
  declare function deleteFile(id: string): Command<void>;
5505
+ /** What POST /files/attach answers (#3212). */
5506
+ interface AttachedFile {
5507
+ collection: string;
5508
+ item: string;
5509
+ field: string;
5510
+ /** The file a single-file field held before (`replace: true`), else null. */
5511
+ replaced: string | null;
5512
+ file: {
5513
+ id: string;
5514
+ filename_download: string;
5515
+ type: string;
5516
+ filesize: number;
5517
+ };
5518
+ }
5519
+ /**
5520
+ * Upload a file as base64 and link it to a record's file field in one call (#3212): the
5521
+ * record is judged as the caller (read gate, update permission, field list, edit lock) and the
5522
+ * link goes through the items service. 10 MB decoded at most. A single-file field that already
5523
+ * holds a file answers 409 FIELD_HAS_FILE unless `replace` is true.
5524
+ */
5525
+ declare function attachFileToRecord(data: {
5526
+ collection: string;
5527
+ item: string | number;
5528
+ field?: string;
5529
+ filename: string;
5530
+ content_base64: string;
5531
+ type?: string;
5532
+ replace?: boolean;
5533
+ }): Command<{
5534
+ data: AttachedFile;
5535
+ }>;
5182
5536
  interface FileUsageEntry {
5183
5537
  table: string;
5184
5538
  column: string;
@@ -5211,6 +5565,181 @@ declare function fileTransformPath(id: string, options?: {
5211
5565
  quality?: number;
5212
5566
  }): string;
5213
5567
 
5568
+ /**
5569
+ * Form and widget drill-down reads for assistants (#3208 #3216 #3217 #3218).
5570
+ * Every one is computed AS THE CALLER — permissions, row filters, User Scopes
5571
+ * and field lists bind; a role preview is for administrators only.
5572
+ */
5573
+
5574
+ type UUID$1 = string;
5575
+ /** The rows behind a dashboard or report widget's number. */
5576
+ interface WidgetDrillRows {
5577
+ /** What the number is: type, collection, metric, filters, date range, segment, query. */
5578
+ definition: Record<string, unknown>;
5579
+ collection: string | null;
5580
+ total: number | null;
5581
+ capped: boolean;
5582
+ columns: string[];
5583
+ rows: Array<Record<string, unknown>>;
5584
+ /** The record filter the rows came from (items filter syntax). */
5585
+ filter?: Record<string, unknown> | null;
5586
+ note?: string;
5587
+ dashboard?: {
5588
+ id: string;
5589
+ name?: string;
5590
+ };
5591
+ report?: {
5592
+ id: string;
5593
+ name?: string;
5594
+ };
5595
+ }
5596
+ interface WidgetDrillBody {
5597
+ /** One part of the figure: a chart bar's value, a series dimension, a day ('date'). */
5598
+ segment?: {
5599
+ field?: string | null;
5600
+ value?: unknown;
5601
+ } | null;
5602
+ /** Columns to return (readable, registered fields only). Default: the widget's own. */
5603
+ fields?: string[];
5604
+ /** Rows (1–100, default 25). */
5605
+ limit?: number;
5606
+ }
5607
+ /** The definition and rows behind a dashboard widget, as the caller. */
5608
+ declare function drillDashboardWidgetRows(widgetId: UUID$1, body?: WidgetDrillBody & {
5609
+ extra_filters?: DashboardFilter[];
5610
+ }): Command<{
5611
+ data: WidgetDrillRows;
5612
+ }>;
5613
+ /** The definition and rows behind a Report Studio widget, as the caller. */
5614
+ declare function drillReportWidgetRows(reportId: UUID$1, widgetId: UUID$1, body?: WidgetDrillBody & {
5615
+ date_range?: {
5616
+ preset: string;
5617
+ start?: string;
5618
+ end?: string;
5619
+ } | null;
5620
+ entity_filters?: Array<{
5621
+ field: string;
5622
+ values: Array<string | number>;
5623
+ }>;
5624
+ }): Command<{
5625
+ data: WidgetDrillRows;
5626
+ }>;
5627
+ interface FormFieldStateRow {
5628
+ field: string;
5629
+ label: string;
5630
+ group_key: string | null;
5631
+ section: string | null;
5632
+ visible: boolean;
5633
+ required: boolean;
5634
+ locked: boolean;
5635
+ missing?: true;
5636
+ hidden_by?: string;
5637
+ locked_by?: string;
5638
+ why?: string;
5639
+ }
5640
+ interface FormStateAnswer {
5641
+ collection: string;
5642
+ record: string | null;
5643
+ as: {
5644
+ role: string | null;
5645
+ admin: boolean;
5646
+ preview: boolean;
5647
+ };
5648
+ layout: {
5649
+ id: number;
5650
+ name: string;
5651
+ why: string | null;
5652
+ } | null;
5653
+ can_update: boolean;
5654
+ derived: Record<string, unknown>;
5655
+ groups: Array<{
5656
+ key: string;
5657
+ label: string;
5658
+ type: string;
5659
+ parent_key: string | null;
5660
+ visible: boolean;
5661
+ locked: boolean;
5662
+ why?: string;
5663
+ }>;
5664
+ fields: FormFieldStateRow[];
5665
+ summary: {
5666
+ visible: number;
5667
+ hidden: number;
5668
+ required: string[];
5669
+ locked: string[];
5670
+ missing: string[];
5671
+ };
5672
+ note?: string;
5673
+ }
5674
+ interface FormStateQuery {
5675
+ collection: string;
5676
+ item?: string | number;
5677
+ layout_id?: number;
5678
+ /** Field values laid over the record (or a new one) before the rules run. */
5679
+ values?: Record<string, unknown>;
5680
+ /** Administrators only: judge as this role (name or id). */
5681
+ role?: string;
5682
+ viewport?: 'phone';
5683
+ }
5684
+ /** Which fields the resolved form shows, requires and locks, and why. */
5685
+ declare function readFormState(query: FormStateQuery): Command<{
5686
+ data: FormStateAnswer;
5687
+ }>;
5688
+ interface FormImageAnswer {
5689
+ mime: 'image/png';
5690
+ base64: string;
5691
+ bytes: number;
5692
+ width: number;
5693
+ collection: string;
5694
+ record: string | null;
5695
+ as: FormStateAnswer['as'];
5696
+ layout: FormStateAnswer['layout'];
5697
+ can_update: boolean;
5698
+ summary: FormStateAnswer['summary'];
5699
+ }
5700
+ /** A PNG of how the form looks (base64), values only where the caller may read them. */
5701
+ declare function renderFormImage(query: FormStateQuery & {
5702
+ theme?: 'light' | 'dark';
5703
+ show_hidden?: boolean;
5704
+ }): Command<{
5705
+ data: FormImageAnswer;
5706
+ }>;
5707
+ interface LayoutLintAnswer {
5708
+ layout: {
5709
+ id: number;
5710
+ name: string;
5711
+ collection: string;
5712
+ };
5713
+ score: number;
5714
+ costs: Array<{
5715
+ label: string;
5716
+ points: number;
5717
+ }>;
5718
+ counts: {
5719
+ error: number;
5720
+ warn: number;
5721
+ info: number;
5722
+ };
5723
+ findings: Array<{
5724
+ id: string;
5725
+ rule: string;
5726
+ severity: 'error' | 'warn' | 'info';
5727
+ where: string;
5728
+ target: Record<string, unknown>;
5729
+ message: string;
5730
+ fix?: {
5731
+ label: string;
5732
+ ops: Array<Record<string, unknown>>;
5733
+ };
5734
+ }>;
5735
+ truncated?: true;
5736
+ total?: number;
5737
+ }
5738
+ /** The layout editor's lint findings and health score for a saved form. Admin only. */
5739
+ declare function readLayoutLint(layoutId: number): Command<{
5740
+ data: LayoutLintAnswer;
5741
+ }>;
5742
+
5214
5743
  /**
5215
5744
  * Help videos: tutorial recordings with edits, versions, where they show,
5216
5745
  * required viewing and progress. Upload parts are raw octet-stream PUTs to
@@ -5700,43 +6229,227 @@ declare const executeImportTemplate: (id: string, payload: {
5700
6229
  }>;
5701
6230
 
5702
6231
  /**
5703
- * Infrastructure commands: workspaces (usage/quotas/templates), sync jobs,
5704
- * ERP submissions, PDF templates, custom pages, two-factor auth, settings.
6232
+ * The caller's inbox beyond the list: snooze, acknowledge, bulk actions, archive, per-record
6233
+ * mutes, what they sent; their reminders; and search helpers (saved searches, per-collection
6234
+ * match counts and pages). Everything here acts on the caller's own rows only.
5705
6235
  */
5706
6236
 
5707
- interface WorkspaceQuotas {
5708
- max_collections?: number;
5709
- max_users?: number;
5710
- max_roles?: number;
5711
- [key: string]: number | undefined;
5712
- }
5713
- interface Workspace {
5714
- id: UUID;
5715
- name: string;
5716
- slug: string;
5717
- icon: string | null;
5718
- color: string | null;
5719
- quotas?: string | WorkspaceQuotas | null;
5720
- created_at: ISODate;
5721
- updated_at: ISODate;
5722
- }
5723
- interface WorkspaceUsage {
5724
- quotas: WorkspaceQuotas;
5725
- usage: Record<string, number>;
5726
- }
5727
- interface WorkspaceTemplate {
5728
- id: number;
5729
- name: string;
5730
- description: string | null;
5731
- source_workspace: UUID;
5732
- created_by: UUID;
5733
- created_at: ISODate;
5734
- }
5735
- declare function listWorkspaces(): Command<{
5736
- data: Workspace[];
6237
+ /**
6238
+ * Snooze a notification until a time (`until`, ISO, in the future), wake it (`until: null`),
6239
+ * or sleep it until the record it names next changes (`untilChange: true`).
6240
+ */
6241
+ declare function snoozeNotification(id: number, opts: {
6242
+ until?: string | null;
6243
+ untilChange?: boolean;
6244
+ }): Command<{
6245
+ data: {
6246
+ snoozed_until: ISODate | string | null;
6247
+ snooze_until_change?: boolean;
6248
+ };
5737
6249
  }>;
5738
- declare function readWorkspace(id: string): Command<{
5739
- data: Workspace;
6250
+ /** Acknowledge a notification whose sender asked for an explicit acknowledgement. */
6251
+ declare function acknowledgeNotification(id: number): Command<{
6252
+ data: {
6253
+ id: number;
6254
+ ack: {
6255
+ required: true;
6256
+ at: ISODate;
6257
+ by: string;
6258
+ };
6259
+ };
6260
+ }>;
6261
+ /** The notification-center filter (the list's own) for "everything matching" actions. */
6262
+ interface NotificationFilter {
6263
+ status?: 'inbox' | 'read' | 'archived';
6264
+ unread?: boolean;
6265
+ search?: string;
6266
+ collection?: string;
6267
+ sender?: string;
6268
+ snoozed?: boolean;
6269
+ lane?: 'critical' | 'needs_you' | 'fyi' | 'attention';
6270
+ category?: string;
6271
+ }
6272
+ /**
6273
+ * One action over several of the caller's notifications: explicit `ids` (up to 1000) or
6274
+ * everything matching `filter` (up to 2000). `snooze` needs a future `until`.
6275
+ */
6276
+ declare function bulkNotificationAction(body: {
6277
+ action: 'read' | 'archive' | 'snooze';
6278
+ ids?: number[];
6279
+ filter?: NotificationFilter;
6280
+ until?: string;
6281
+ }): Command<{
6282
+ data: {
6283
+ updated: number;
6284
+ ids?: number[];
6285
+ };
6286
+ }>;
6287
+ /** Archive every read notification older than `days` (1–3650). */
6288
+ declare function archiveReadNotifications(days: number): Command<{
6289
+ data: {
6290
+ updated: number;
6291
+ };
6292
+ }>;
6293
+ interface SentNotificationGroup {
6294
+ key: string;
6295
+ subject: string;
6296
+ message: string | null;
6297
+ created_at: ISODate;
6298
+ lane: string | null;
6299
+ category: string | null;
6300
+ collection: string | null;
6301
+ item: string | null;
6302
+ recipients: Array<{
6303
+ id: string;
6304
+ name: string;
6305
+ read: boolean;
6306
+ read_at: ISODate | null;
6307
+ ack: 'pending' | 'acked' | null;
6308
+ ack_at: string | null;
6309
+ }>;
6310
+ read_count: number;
6311
+ ack_required: boolean;
6312
+ ack_count: number;
6313
+ total: number;
6314
+ }
6315
+ /**
6316
+ * What the caller sent, grouped per message with each recipient's read / acknowledgement
6317
+ * state. Critical-lane sends only unless `lane: 'all'`.
6318
+ */
6319
+ declare function listSentNotifications(query?: {
6320
+ lane?: 'all';
6321
+ /** Groups (default 50, max 100). */
6322
+ limit?: number;
6323
+ }): Command<{
6324
+ data: SentNotificationGroup[];
6325
+ }>;
6326
+ /** Whether the caller muted notifications about one record. */
6327
+ declare function readRecordMute(collection: string, item: string | number): Command<{
6328
+ data: {
6329
+ muted: boolean;
6330
+ };
6331
+ }>;
6332
+ /** Mute or unmute notifications about one record for the caller; answers the new state. */
6333
+ declare function toggleRecordMute(collection: string, item: string | number): Command<{
6334
+ data: {
6335
+ muted: boolean;
6336
+ };
6337
+ }>;
6338
+ interface Reminder {
6339
+ id: number;
6340
+ user: string;
6341
+ note: string;
6342
+ room: string | null;
6343
+ remind_at: ISODate;
6344
+ sent: boolean | number;
6345
+ }
6346
+ /** The caller's reminders, soonest first; `includeSent` adds delivered ones (max 200). */
6347
+ declare function listReminders(includeSent?: boolean): Command<{
6348
+ data: Reminder[];
6349
+ }>;
6350
+ /** Remind the caller at `remind_at` (ISO, not in the past); delivered in-app. */
6351
+ declare function createReminder(body: {
6352
+ note: string;
6353
+ remind_at: string;
6354
+ }): Command<{
6355
+ data: Reminder;
6356
+ }>;
6357
+ /** Change the note or time of an undelivered reminder. */
6358
+ declare function updateReminder(id: number, body: {
6359
+ note?: string;
6360
+ remind_at?: string;
6361
+ }): Command<{
6362
+ data: Reminder;
6363
+ }>;
6364
+ /** Cancel (or clear a delivered) reminder. */
6365
+ declare function deleteReminder(id: number): Command<void>;
6366
+ interface SavedSearch {
6367
+ id: string;
6368
+ name: string;
6369
+ q: string;
6370
+ scope: string | null;
6371
+ created_at: ISODate;
6372
+ }
6373
+ /** The caller's saved searches. */
6374
+ declare function listSavedSearches(): Command<{
6375
+ data: SavedSearch[];
6376
+ }>;
6377
+ /** Save a search for the caller. */
6378
+ declare function createSavedSearch(body: {
6379
+ name: string;
6380
+ q: string;
6381
+ scope?: string | null;
6382
+ }): Command<{
6383
+ data: SavedSearch;
6384
+ }>;
6385
+ /** Remove one of the caller's saved searches. */
6386
+ declare function deleteSavedSearch(id: string): Command<{
6387
+ data: {
6388
+ ok: true;
6389
+ };
6390
+ }>;
6391
+ /**
6392
+ * How many records match `q` in each listed collection (up to 40), as the caller — the
6393
+ * search page's tabs. Empty when `q` is under 2 characters.
6394
+ */
6395
+ declare function readSearchCounts(q: string, collections: string[], opts?: {
6396
+ labels?: boolean;
6397
+ }): Command<{
6398
+ data: Array<{
6399
+ collection: string;
6400
+ display_name: string | null;
6401
+ count: number;
6402
+ }>;
6403
+ }>;
6404
+ /** One collection's search matches, a page at a time (default 25). */
6405
+ declare function readSearchRecords(q: string, collection: string, opts?: {
6406
+ offset?: number;
6407
+ limit?: number;
6408
+ labels?: boolean;
6409
+ }): Command<{
6410
+ data: GlobalSearchRecord[];
6411
+ total: number | null;
6412
+ query?: unknown;
6413
+ }>;
6414
+
6415
+ /**
6416
+ * Infrastructure commands: workspaces (usage/quotas/templates), sync jobs,
6417
+ * ERP submissions, PDF templates, custom pages, two-factor auth, settings.
6418
+ */
6419
+
6420
+ interface WorkspaceQuotas {
6421
+ max_collections?: number;
6422
+ max_users?: number;
6423
+ max_roles?: number;
6424
+ [key: string]: number | undefined;
6425
+ }
6426
+ interface Workspace {
6427
+ id: UUID;
6428
+ name: string;
6429
+ slug: string;
6430
+ icon: string | null;
6431
+ color: string | null;
6432
+ quotas?: string | WorkspaceQuotas | null;
6433
+ created_at: ISODate;
6434
+ updated_at: ISODate;
6435
+ }
6436
+ interface WorkspaceUsage {
6437
+ quotas: WorkspaceQuotas;
6438
+ usage: Record<string, number>;
6439
+ }
6440
+ interface WorkspaceTemplate {
6441
+ id: number;
6442
+ name: string;
6443
+ description: string | null;
6444
+ source_workspace: UUID;
6445
+ created_by: UUID;
6446
+ created_at: ISODate;
6447
+ }
6448
+ declare function listWorkspaces(): Command<{
6449
+ data: Workspace[];
6450
+ }>;
6451
+ declare function readWorkspace(id: string): Command<{
6452
+ data: Workspace;
5740
6453
  }>;
5741
6454
  /** Usage counters vs configured quota limits. */
5742
6455
  declare function readWorkspaceUsage(id: string): Command<{
@@ -6307,6 +7020,8 @@ interface McpCapabilities {
6307
7020
  admin_tools: boolean;
6308
7021
  /** Chat tools (#2492): none, reading only, or reading and posting. */
6309
7022
  chat: 'none' | 'read' | 'post';
7023
+ /** PATCH /items/:collection/:id?dry_run=1 rehearses an update (#3222); absent on older instances. */
7024
+ update_preview?: boolean;
6310
7025
  }
6311
7026
  /** What the MCP server may offer this credential (GET /api/mcp/capabilities). */
6312
7027
  declare function readMcpCapabilities(): Command<{
@@ -6314,79 +7029,517 @@ declare function readMcpCapabilities(): Command<{
6314
7029
  }>;
6315
7030
 
6316
7031
  /**
6317
- * Operations reads (admin): readiness, detailed health, this process's runtime
6318
- * stats, the instance roster, the DB connection pool, expensive SQL, the
6319
- * Traffic Map snapshot, the background-job registry + run history, and a
6320
- * summarized CPU profile of the replica that answers.
7032
+ * Observability commands: the audit log beyond the list (one entry, the action list, export
7033
+ * reporting), the change feed, background job runs (live log, cancel, what is busy), the
7034
+ * caller's own jobs and background reads, the API request log, per-key usage, the outbound
7035
+ * mail log and the caller's own notification delivery history.
7036
+ *
7037
+ * Admin-only reads say so; everything else is scoped to the caller by the API.
6321
7038
  */
6322
7039
 
6323
- interface ReadyReport {
6324
- ready: boolean;
6325
- checks: Array<{
6326
- id: string;
6327
- ok: boolean;
6328
- summary: string;
6329
- }>;
6330
- }
6331
- /** May traffic be routed here? Public; answers 503 (with the same body) when not ready. */
6332
- declare function readReadiness(): Command<ReadyReport>;
6333
- interface HealthDetailed {
6334
- db: {
6335
- ok: boolean;
6336
- latency_ms: number;
6337
- };
6338
- redis: {
6339
- ok: boolean;
6340
- latency_ms: number;
7040
+ /** One audit-log entry with its user agent and agent badge (admin). */
7041
+ declare function readActivityEntry(id: number): Command<{
7042
+ data: ActivityEntry;
7043
+ }>;
7044
+ /** Every action name the audit log holds, sorted (admin) — for an action filter. */
7045
+ declare function listActivityActions(): Command<{
7046
+ data: string[];
7047
+ }>;
7048
+ /**
7049
+ * Record a client-side export (CSV / xlsx / PDF made in the browser) in the audit log as an
7050
+ * `export` entry for the caller. Any signed-in person may report their own export.
7051
+ */
7052
+ declare function logExport(body: {
7053
+ collection: string;
7054
+ row_count?: number;
7055
+ /** csv | xlsx | pdf … (first 10 characters kept). */
7056
+ format?: string;
7057
+ /** The filters the export ran with (first 300 characters of their JSON kept). */
7058
+ filters?: unknown;
7059
+ }): Command<{
7060
+ data: {
7061
+ logged: true;
6341
7062
  };
6342
- migrations: {
6343
- latest: string | null;
6344
- count: number;
7063
+ }>;
7064
+ /**
7065
+ * Write an audit entry by hand. Administrators only in practice: a non-admin may write only
7066
+ * the actions the server lists as client-writable (none today). `action` is 1–50 of
7067
+ * letters, digits and `- _ : .`.
7068
+ */
7069
+ declare function createActivityEntry(body: {
7070
+ action: string;
7071
+ collection?: string;
7072
+ item?: string | number;
7073
+ comment?: string;
7074
+ }): Command<{
7075
+ ok: true;
7076
+ }>;
7077
+ /** One record change in the feed — ids, actions and field NAMES only, never values. */
7078
+ interface FeedChange {
7079
+ collection: string;
7080
+ id: string;
7081
+ /** A record created and changed within one page reads `create`. */
7082
+ action: 'create' | 'update' | 'delete';
7083
+ /** Updates: the readable fields that changed; absent when unknown. */
7084
+ fields?: string[];
7085
+ at: ISODate;
7086
+ }
7087
+ interface FeedPage {
7088
+ changes: FeedChange[];
7089
+ /** Pass back as `cursor` for the next page. */
7090
+ cursor: string;
7091
+ /** More changes are already waiting: call again at once. */
7092
+ has_more: boolean;
7093
+ /** Named collections the caller cannot read (or that do not exist). */
7094
+ not_readable?: string[];
7095
+ notes?: string[];
7096
+ }
7097
+ /**
7098
+ * The change feed for clients without a live socket (`GET /changes`): records the caller
7099
+ * can see now that were created, changed or deleted since a cursor or a time. Without
7100
+ * `cursor` or `since` the feed starts from now (an empty page with a cursor). Refusals
7101
+ * carry a `code` (e.g. a cursor this feed did not issue).
7102
+ *
7103
+ * let page = (await nivaro.request(readChanges({ since: '2026-10-29T12:00:00Z' }))).data
7104
+ * while (page.has_more) page = (await nivaro.request(readChanges({ cursor: page.cursor }))).data
7105
+ */
7106
+ declare function readChanges(query?: {
7107
+ cursor?: string;
7108
+ /** ISO time to start from (ignored with a cursor). */
7109
+ since?: string;
7110
+ /** Up to 50 collection names; default every collection the caller may read. */
7111
+ collections?: string[];
7112
+ /** Changes per page (default 100, max 500). */
7113
+ limit?: number;
7114
+ }): Command<{
7115
+ data: FeedPage;
7116
+ }>;
7117
+ interface JobLogLine {
7118
+ seq: number;
7119
+ at: ISODate;
7120
+ level: 'info' | 'warn' | 'error' | (string & {});
7121
+ line: string;
7122
+ }
7123
+ /**
7124
+ * A run's live log: the lines written so far (`after` = the last `seq` you already have),
7125
+ * plus its status, progress and first error line (admin).
7126
+ */
7127
+ declare function readJobRunLog(id: number, after?: number): Command<{
7128
+ data: {
7129
+ run: {
7130
+ id: number;
7131
+ status: string;
7132
+ progress: string | null;
7133
+ outcome: string | null;
7134
+ error: string | null;
7135
+ };
7136
+ lines: JobLogLine[];
6345
7137
  };
6346
- sockets: {
6347
- connections: number | null;
7138
+ }>;
7139
+ /**
7140
+ * Ask a running job to stop (admin). Cooperative: cancel-aware loops stop at their next
7141
+ * chunk; the flag is per process, so a run on another replica may finish anyway.
7142
+ */
7143
+ declare function cancelJobRun(id: number): Command<{
7144
+ data: {
7145
+ cancel_requested: true;
6348
7146
  };
6349
- read_gate?: Record<string, unknown>;
6350
- redis_degradation?: {
6351
- redis_ok: boolean;
6352
- consumers: Array<Record<string, unknown>>;
7147
+ }>;
7148
+ interface BusyJob {
7149
+ /** The job run id; -1 for an import in flight. */
7150
+ id: number;
7151
+ kind: string;
7152
+ label: string;
7153
+ started_at: ISODate;
7154
+ elapsed_ms: number;
7155
+ /** Median of the same job's recent runs; null without history. */
7156
+ expected_ms: number | null;
7157
+ remaining_ms: number | null;
7158
+ overrun: boolean;
7159
+ }
7160
+ /** What heavy work is running right now — heavy crons, backfills, exports, imports (admin). */
7161
+ declare function readBusyJobs(): Command<{
7162
+ data: {
7163
+ busy: boolean;
7164
+ items: BusyJob[];
7165
+ heavy_slot: unknown;
6353
7166
  };
6354
- db_posture?: unknown;
6355
- uptime_s: number;
6356
- version: string;
6357
- node_version: string;
6358
- memory_mb: number;
7167
+ }>;
7168
+ /** One entry of the caller's jobs tray (a job run or a staged import they queued). */
7169
+ interface MyJob {
7170
+ key: string;
7171
+ kind: string;
7172
+ label?: string | null;
7173
+ status: 'queued' | 'running' | 'completed' | 'error' | 'canceled';
7174
+ progress?: Record<string, unknown> | null;
7175
+ outcome?: string | null;
7176
+ error?: string | null;
7177
+ /** App path to the details page or the finished file. */
7178
+ href?: string | null;
7179
+ /** A file the job produced. */
7180
+ file_id?: string | null;
7181
+ /** API path (under /api) to POST to cancel the running job. */
7182
+ cancel_path?: string | null;
7183
+ /** Import queue: 1 = next up. */
7184
+ position?: number | null;
7185
+ eta_seconds?: number | null;
7186
+ at: ISODate;
6359
7187
  }
6360
- /** Subsystem diagnostics for the replica that answers (admin). */
6361
- declare function readHealthDetailed(): Command<{
6362
- data: HealthDetailed;
7188
+ /** What the caller started that is running or finished in the last 30 minutes. */
7189
+ declare function listMyJobs(): Command<{
7190
+ data: MyJob[];
6363
7191
  }>;
6364
- interface PoolStats {
6365
- used: number;
6366
- free: number;
6367
- pending_acquires: number;
6368
- pending_creates: number;
6369
- max: number;
7192
+ interface BackgroundRun {
7193
+ id: string;
7194
+ kind: 'custom-query' | 'widget' | 'report-widget' | 'dashboard-widget' | (string & {});
7195
+ subject: string;
7196
+ label: string;
7197
+ href: string | null;
7198
+ method: 'GET' | 'POST';
7199
+ url: string;
7200
+ status: 'running' | 'completed' | 'error';
7201
+ started_at: ISODate;
7202
+ finished_at: ISODate | null;
7203
+ /** Typical duration when the run started (progress = elapsed / expected). */
7204
+ expected_ms: number | null;
7205
+ http_status: number | null;
7206
+ error: string | null;
7207
+ /** False when the answer was too big to keep: ask the route again. */
7208
+ result_kept: boolean;
6370
7209
  }
6371
- interface RuntimeStats {
6372
- uptime_seconds: number;
6373
- rss_mb: number;
6374
- heap_used_mb: number;
6375
- heap_total_mb: number;
6376
- event_loop_lag_ms: {
6377
- current: number;
6378
- max_1m: number;
7210
+ /** How long a replayable read usually takes and whether it counts as slow. */
7211
+ declare function estimateBackgroundRun(method: 'GET' | 'POST', url: string): Command<{
7212
+ data: {
7213
+ typical_ms: number | null;
7214
+ runs: number;
7215
+ slow: boolean;
7216
+ threshold_ms: number;
6379
7217
  };
6380
- pool: PoolStats;
6381
- }
6382
- /** Memory, event-loop lag and pool of the replica that answers (admin). */
6383
- declare function readRuntimeStats(): Command<{
6384
- data: RuntimeStats;
6385
7218
  }>;
6386
- /** Every registered API process, plus which one holds the scheduler lease (admin). */
6387
- declare function readInstanceRoster(): Command<{
6388
- data: Array<Record<string, unknown>>;
6389
- scheduler: Record<string, unknown> | null;
7219
+ /**
7220
+ * Hand a slow read to the server (a custom query execute or a widget read). It is replayed
7221
+ * AS the caller; the same question asked twice joins the first run (`joined: true`).
7222
+ */
7223
+ declare function startBackgroundRun(body: {
7224
+ method: 'GET' | 'POST';
7225
+ /** The API path of the read, e.g. `/api/custom-queries/q/execute`. */
7226
+ url: string;
7227
+ body?: unknown;
7228
+ label?: string;
7229
+ /** App-relative link back to the page. */
7230
+ href?: string;
7231
+ }): Command<{
7232
+ data: BackgroundRun & {
7233
+ joined: boolean;
7234
+ };
7235
+ }>;
7236
+ /** The caller's background reads, newest first. */
7237
+ declare function listBackgroundRuns(): Command<{
7238
+ data: BackgroundRun[];
7239
+ }>;
7240
+ /** One of the caller's background reads (404 for anyone else's). */
7241
+ declare function readBackgroundRun(id: string): Command<{
7242
+ data: BackgroundRun;
7243
+ }>;
7244
+ /**
7245
+ * The finished answer, exactly as the route gave it. 409 BACKGROUND_RUN_RUNNING while it
7246
+ * runs, 422 when it failed, 410 RESULT_GONE once no longer kept.
7247
+ */
7248
+ declare function readBackgroundRunResult<T = unknown>(id: string): Command<T>;
7249
+ interface ApiRequestLogEntry {
7250
+ id: number;
7251
+ method: string;
7252
+ path: string;
7253
+ status: number;
7254
+ latency_ms: number;
7255
+ user: UUID | null;
7256
+ user_name: string | null;
7257
+ user_email: string | null;
7258
+ collection: string | null;
7259
+ api_key_id: number | null;
7260
+ api_key_name: string | null;
7261
+ /** session | token | api_key | masquerade | none */
7262
+ auth: string | null;
7263
+ ip: string | null;
7264
+ user_agent: string | null;
7265
+ error: string | null;
7266
+ request_body: string | null;
7267
+ query: string | null;
7268
+ created_at: ISODate;
7269
+ }
7270
+ interface ApiRequestLogQuery {
7271
+ /** Look-back window (default 24). */
7272
+ hours?: number;
7273
+ /** ISO bounds; `from` beats `hours`. */
7274
+ from?: string;
7275
+ to?: string;
7276
+ /** Contains-match on the path. */
7277
+ path?: string;
7278
+ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
7279
+ /** Exact (`404`) or a class (`4xx`, `5xx`). */
7280
+ status?: string;
7281
+ /** Errors only (status ≥ 400). */
7282
+ errors?: boolean;
7283
+ /** A user id. */
7284
+ user?: UUID;
7285
+ /** A named API key id. */
7286
+ api_key?: number;
7287
+ /** Comma list of session | token | api_key | masquerade | none. */
7288
+ auth?: string;
7289
+ /** Every caller that is not a person's browser session (token + API key). */
7290
+ inbound?: boolean;
7291
+ /** Rank instead of list: the top 20 callers or paths. */
7292
+ group?: 'caller' | 'path';
7293
+ page?: number;
7294
+ /** Rows per page (default 50, max 200). */
7295
+ limit?: number;
7296
+ /** Include development instances' rows. */
7297
+ all_instances?: boolean;
7298
+ }
7299
+ /**
7300
+ * The per-request API log behind the analytics (admin). With `group` the answer ranks
7301
+ * callers or paths in `groups` and `data` is empty.
7302
+ */
7303
+ declare function listApiRequests(query?: ApiRequestLogQuery): Command<{
7304
+ data: ApiRequestLogEntry[];
7305
+ total: number;
7306
+ page?: number;
7307
+ limit?: number;
7308
+ groups?: Array<Record<string, unknown>>;
7309
+ }>;
7310
+ interface ApiKeyTraffic {
7311
+ api_key_id: number;
7312
+ name: string;
7313
+ count: number;
7314
+ avg_latency: number;
7315
+ errors: number;
7316
+ last_seen: ISODate | null;
7317
+ }
7318
+ /** Traffic per named API key over the window (admin; session traffic excluded). */
7319
+ declare function readApiAnalyticsByKey(hours?: number): Command<{
7320
+ data: ApiKeyTraffic[];
7321
+ }>;
7322
+ interface ApiKeyUsage {
7323
+ key: {
7324
+ id: number;
7325
+ name: string;
7326
+ is_active: boolean;
7327
+ };
7328
+ window_days: number;
7329
+ total: number;
7330
+ errors: number;
7331
+ last_seen: ISODate | null;
7332
+ /** One entry per day of the window, gaps as zero. */
7333
+ days: Array<{
7334
+ day: string;
7335
+ count: number;
7336
+ errors: number;
7337
+ }>;
7338
+ top_routes: Array<{
7339
+ method: string;
7340
+ path: string;
7341
+ count: number;
7342
+ avg_latency: number;
7343
+ errors: number;
7344
+ }>;
7345
+ }
7346
+ /** A key's last 30 days: daily calls and errors, top routes (admin). */
7347
+ declare function readApiKeyUsage(id: number): Command<{
7348
+ data: ApiKeyUsage;
7349
+ }>;
7350
+ interface ApiKeyUsageBucket {
7351
+ calls: number;
7352
+ errors: number;
7353
+ rate_limited: number;
7354
+ avg_ms: number | null;
7355
+ }
7356
+ interface ApiKeyMonthlyUsage {
7357
+ key: {
7358
+ id: number;
7359
+ name: string;
7360
+ prefix: string | null;
7361
+ };
7362
+ month: string;
7363
+ window: {
7364
+ start: ISODate;
7365
+ end: ISODate;
7366
+ };
7367
+ retention: {
7368
+ days: number;
7369
+ oldest_log: ISODate | null;
7370
+ partial: boolean;
7371
+ note: string | null;
7372
+ };
7373
+ totals: ApiKeyUsageBucket & {
7374
+ error_rate: number;
7375
+ refused: number;
7376
+ reads_ok: number;
7377
+ writes_ok: number;
7378
+ };
7379
+ by_day: Array<ApiKeyUsageBucket & {
7380
+ day: string;
7381
+ }>;
7382
+ by_family: Array<ApiKeyUsageBucket & {
7383
+ family: string;
7384
+ }>;
7385
+ graphql: Array<{
7386
+ operation: string;
7387
+ kind: string | null;
7388
+ calls: number;
7389
+ errors: number;
7390
+ }>;
7391
+ egress: {
7392
+ reads_ok: number;
7393
+ note: string;
7394
+ };
7395
+ }
7396
+ /**
7397
+ * A key's usage statement for one calendar month (`YYYY-MM`, admin). `format: 'csv'`
7398
+ * answers the statement as CSV text.
7399
+ */
7400
+ declare function readApiKeyMonthlyUsage(id: number, month: string, format?: 'json'): Command<{
7401
+ data: ApiKeyMonthlyUsage;
7402
+ }>;
7403
+ declare function readApiKeyMonthlyUsage(id: number, month: string, format: 'csv'): Command<string>;
7404
+ interface MailLogEntry {
7405
+ id: number;
7406
+ /** Comma list of recipients. */
7407
+ to: string;
7408
+ subject: string | null;
7409
+ template: string | null;
7410
+ status: 'sent' | 'failed' | 'dropped' | 'deferred' | (string & {});
7411
+ error: string | null;
7412
+ created_at: ISODate;
7413
+ }
7414
+ /** Every send attempt with its outcome, newest first, 50 a page (admin). */
7415
+ declare function listMailLog(query?: {
7416
+ status?: 'sent' | 'failed' | 'dropped' | 'deferred';
7417
+ /** A template key; `(untemplated)` = sends without one. */
7418
+ template?: string;
7419
+ /** Contains-match on recipient or subject. */
7420
+ search?: string;
7421
+ page?: number;
7422
+ }): Command<{
7423
+ data: MailLogEntry[];
7424
+ total: number;
7425
+ page: number;
7426
+ }>;
7427
+ /** One send with its stored body (admin). */
7428
+ declare function readMailLogEntry(id: number): Command<{
7429
+ data: MailLogEntry & {
7430
+ body?: string | null;
7431
+ } & Record<string, unknown>;
7432
+ }>;
7433
+ /** Send a logged mail again from its stored body (admin; test mode applies). 502 on failure. */
7434
+ declare function resendMail(id: number): Command<{
7435
+ data: {
7436
+ resent: true;
7437
+ };
7438
+ }>;
7439
+ /** The delivery board: the window rolled up per day, template and recipient (admin). */
7440
+ declare function readMailStats(days?: 7 | 14 | 30): Command<{
7441
+ data: Record<string, unknown>;
7442
+ }>;
7443
+ /**
7444
+ * The mail sent about one record (headers only, never bodies, newest 50) — for anyone who
7445
+ * can read the record.
7446
+ */
7447
+ declare function listRecordMail(collection: string, item: string | number): Command<{
7448
+ data: MailLogEntry[];
7449
+ }>;
7450
+ interface NotificationHistoryEntry {
7451
+ kind: 'notification' | 'metric_alert' | 'record_alert' | 'report_alert' | 'digest_email';
7452
+ at: ISODate;
7453
+ title: string;
7454
+ detail: string | null;
7455
+ collection?: string | null;
7456
+ item?: string | null;
7457
+ status?: string | null;
7458
+ /** How it reached the caller: 'in-app' | 'push' | 'email' | 'digest email'. */
7459
+ channels?: string[];
7460
+ }
7461
+ /**
7462
+ * What actually reached the caller, newest first: in-app notifications, alert firings for
7463
+ * rules they subscribe to, report alerts they created and digest-queued emails.
7464
+ */
7465
+ declare function readNotificationHistory(limit?: number): Command<{
7466
+ data: NotificationHistoryEntry[];
7467
+ }>;
7468
+
7469
+ /**
7470
+ * Operations reads (admin): readiness, detailed health, this process's runtime
7471
+ * stats, the instance roster, the DB connection pool, expensive SQL, the
7472
+ * Traffic Map snapshot, the background-job registry + run history, and a
7473
+ * summarized CPU profile of the replica that answers.
7474
+ */
7475
+
7476
+ interface ReadyReport {
7477
+ ready: boolean;
7478
+ checks: Array<{
7479
+ id: string;
7480
+ ok: boolean;
7481
+ summary: string;
7482
+ }>;
7483
+ }
7484
+ /** May traffic be routed here? Public; answers 503 (with the same body) when not ready. */
7485
+ declare function readReadiness(): Command<ReadyReport>;
7486
+ interface HealthDetailed {
7487
+ db: {
7488
+ ok: boolean;
7489
+ latency_ms: number;
7490
+ };
7491
+ redis: {
7492
+ ok: boolean;
7493
+ latency_ms: number;
7494
+ };
7495
+ migrations: {
7496
+ latest: string | null;
7497
+ count: number;
7498
+ };
7499
+ sockets: {
7500
+ connections: number | null;
7501
+ };
7502
+ read_gate?: Record<string, unknown>;
7503
+ redis_degradation?: {
7504
+ redis_ok: boolean;
7505
+ consumers: Array<Record<string, unknown>>;
7506
+ };
7507
+ db_posture?: unknown;
7508
+ uptime_s: number;
7509
+ version: string;
7510
+ node_version: string;
7511
+ memory_mb: number;
7512
+ }
7513
+ /** Subsystem diagnostics for the replica that answers (admin). */
7514
+ declare function readHealthDetailed(): Command<{
7515
+ data: HealthDetailed;
7516
+ }>;
7517
+ interface PoolStats {
7518
+ used: number;
7519
+ free: number;
7520
+ pending_acquires: number;
7521
+ pending_creates: number;
7522
+ max: number;
7523
+ }
7524
+ interface RuntimeStats {
7525
+ uptime_seconds: number;
7526
+ rss_mb: number;
7527
+ heap_used_mb: number;
7528
+ heap_total_mb: number;
7529
+ event_loop_lag_ms: {
7530
+ current: number;
7531
+ max_1m: number;
7532
+ };
7533
+ pool: PoolStats;
7534
+ }
7535
+ /** Memory, event-loop lag and pool of the replica that answers (admin). */
7536
+ declare function readRuntimeStats(): Command<{
7537
+ data: RuntimeStats;
7538
+ }>;
7539
+ /** Every registered API process, plus which one holds the scheduler lease (admin). */
7540
+ declare function readInstanceRoster(): Command<{
7541
+ data: Array<Record<string, unknown>>;
7542
+ scheduler: Record<string, unknown> | null;
6390
7543
  }>;
6391
7544
  interface CpuProfileSummary {
6392
7545
  /** The saved .cpuprofile, downloadable from /ops-runtime/cpu-profile/:name. */
@@ -6750,114 +7903,587 @@ declare function updateQueue(id: UUID, data: {
6750
7903
  column_aliases?: Record<string, string>;
6751
7904
  display_config?: Partial<QueueDisplayConfig>;
6752
7905
  }): Command<{
6753
- data: QueueDetail;
7906
+ data: QueueDetail;
7907
+ }>;
7908
+ declare function deleteQueue(id: UUID): Command<void>;
7909
+ /** Replace a queue's sources wholesale (max 10). Cache-affecting edits demote
7910
+ * a materialized queue and enqueue a rebuild; display-only edits apply in place. */
7911
+ declare function updateQueueSources(id: UUID, sources: Array<Omit<QueueSource, 'id' | 'sort'> & {
7912
+ id?: number;
7913
+ sort?: number;
7914
+ }>): Command<{
7915
+ data: QueueSource[];
7916
+ }>;
7917
+ /** Force a full materialized-cache rebuild (owner or admin). */
7918
+ declare function rematerializeQueue(id: UUID): Command<{
7919
+ data: {
7920
+ enqueued: boolean;
7921
+ };
7922
+ }>;
7923
+ /** Resolve a queue's items. Omit page/limit for the full set (kanban); pass
7924
+ * them for table pagination (adds `total`). `filters` = per-column contains
7925
+ * filters keyed by column key ('state', 'owners', 'extra.<path>' …). */
7926
+ declare function readQueueItems(id: UUID, options?: {
7927
+ scope?: QueueScope;
7928
+ sort?: string;
7929
+ filters?: Record<string, string>;
7930
+ page?: number;
7931
+ limit?: number;
7932
+ }): Command<QueueItemsResult>;
7933
+ /** Items grouped per owner with each owner's WIP limit — the Workload view. */
7934
+ declare function readQueueWorkload(id: UUID): Command<{
7935
+ data: Array<QueueWorkloadRow & {
7936
+ items: QueueItem[];
7937
+ }>;
7938
+ }>;
7939
+ /** Daily stat-snapshot series for the stat-tile sparklines.
7940
+ * scope 'mine' returns the caller's own series; anything else = queue-wide. */
7941
+ declare function readQueueTrends(id: UUID, options?: {
7942
+ days?: number;
7943
+ scope?: string;
7944
+ }): Command<{
7945
+ data: Record<string, QueueTrendPoint[]>;
7946
+ }>;
7947
+ /** Sample rendered labels for a source's label template (builder preview). */
7948
+ declare function suggestQueueLabels(id: UUID, options?: {
7949
+ collection: string;
7950
+ template?: string;
7951
+ }): Command<{
7952
+ data: string[];
7953
+ }>;
7954
+ /** Pipeline states available for a collection (builder state pickers).
7955
+ * Includes the '__none__' sentinel for stateless items. */
7956
+ declare function readQueueCollectionStates(collection: string): Command<{
7957
+ data: Array<{
7958
+ id: string;
7959
+ key: string;
7960
+ label: string;
7961
+ color: string | null;
7962
+ }>;
7963
+ }>;
7964
+ /** Claim an item in a queue (writes through to pipeline instance owners for
7965
+ * real business records). 403 when the queue has claims disabled. */
7966
+ declare function claimQueueItem(id: UUID, item: {
7967
+ collection: string;
7968
+ item_id: string;
7969
+ }): Command<{
7970
+ data: {
7971
+ claimed: boolean;
7972
+ };
7973
+ }>;
7974
+ /** Release a claim (self-added instance-owner grants are removed too). */
7975
+ declare function releaseQueueItem(id: UUID, item: {
7976
+ collection: string;
7977
+ item_id: string;
7978
+ }): Command<{
7979
+ data: {
7980
+ released: boolean;
7981
+ };
7982
+ }>;
7983
+ /** Saved views visible to the caller (own + shared behind queue visibility). */
7984
+ declare function listQueueViews(id: UUID): Command<{
7985
+ data: QueueView[];
7986
+ }>;
7987
+ declare function createQueueView(id: UUID, data: {
7988
+ name: string;
7989
+ is_shared?: boolean;
7990
+ role?: UUID | null;
7991
+ state: QueueView['state'];
7992
+ }): Command<{
7993
+ data: QueueView;
7994
+ }>;
7995
+ /** Overwrite a view's name/sharing/state in place (owner or admin). */
7996
+ declare function updateQueueView(viewId: number, data: {
7997
+ name?: string;
7998
+ is_shared?: boolean;
7999
+ state?: QueueView['state'];
8000
+ }): Command<{
8001
+ data: QueueView;
8002
+ }>;
8003
+ declare function deleteQueueView(viewId: number): Command<void>;
8004
+ /** The caller's per-queue prefs (default saved view; visible_columns is legacy). */
8005
+ declare function readQueueColumnPrefs(id: UUID): Command<{
8006
+ data: QueueColumnPrefs;
8007
+ }>;
8008
+ /** Star/unstar a saved view as the caller's default for this queue
8009
+ * (null reverts to the queue's general default). */
8010
+ declare function setQueueDefaultView(id: UUID, viewId: number | null): Command<{
8011
+ data: {
8012
+ default_view_id: number | null;
8013
+ };
8014
+ }>;
8015
+
8016
+ /**
8017
+ * Record commands beyond plain CRUD: rehearsed updates, filter checks, slug and distinct
8018
+ * reads, bulk and batch writes, the trash bin, owner history, comment counts and reactions,
8019
+ * the pipeline outline a caller may act on, and the sign-in session (logout, socket token).
8020
+ *
8021
+ * Every write goes through the items service AS THE CALLER — permissions, row filters,
8022
+ * User Scopes, validation, hooks, revisions and edit locks all apply, row by row.
8023
+ */
8024
+
8025
+ /** What an update would do. Nothing is stored. */
8026
+ interface UpdateDryRunReport {
8027
+ dry_run: true;
8028
+ ok: boolean;
8029
+ /** The status the real request would answer. */
8030
+ status: number;
8031
+ would: 'update' | null;
8032
+ id: string | number;
8033
+ /** Stored fields the write would change, as the caller reads them before and after. */
8034
+ changes: Array<{
8035
+ field: string;
8036
+ from: unknown;
8037
+ to: unknown;
8038
+ }>;
8039
+ /** Fields the write names whose value would stay as it is. */
8040
+ unchanged: string[];
8041
+ /** Fields the write would change that the caller may not read: names only. */
8042
+ hidden: string[];
8043
+ /** Changed fields the caller did not send (rules, derived values, audit stamps). */
8044
+ filled: string[];
8045
+ /** Keys of the payload that are stored nowhere. */
8046
+ ignored: string[];
8047
+ links: Record<string, Array<string | number>>;
8048
+ nested: Record<string, Array<Record<string, unknown>>>;
8049
+ notes: string[];
8050
+ change_reason?: string;
8051
+ error?: string;
8052
+ code?: string;
8053
+ /** Someone else holds the record's edit lock. */
8054
+ locked_by_name?: string | null;
8055
+ violations?: unknown;
8056
+ fields?: unknown;
8057
+ conflicts?: unknown;
8058
+ }
8059
+ /**
8060
+ * Rehearse an update (`PATCH ?dry_run=1`): rules, validation, the edit lock and the
8061
+ * database's own checks run, the write is rolled back. The report lists `changes` (field,
8062
+ * from, to) or why it would be refused.
8063
+ */
8064
+ declare function rehearseUpdateItem<T = Record<string, unknown>>(collection: string, id: string | number, data: Partial<T>): Command<UpdateDryRunReport>;
8065
+ interface FilterProblem {
8066
+ path: string;
8067
+ code: string;
8068
+ message: string;
8069
+ fix?: string;
8070
+ }
8071
+ interface FilterCheck {
8072
+ ok: boolean;
8073
+ collection: string;
8074
+ errors: FilterProblem[];
8075
+ warnings: FilterProblem[];
8076
+ /** A corrected filter when the server could suggest one. */
8077
+ suggestion: Record<string, unknown> | null;
8078
+ clauses: number;
8079
+ truncated?: boolean;
8080
+ }
8081
+ /**
8082
+ * Check a filter against the server's own gates (unknown fields, operators, types, fields
8083
+ * the caller may not filter on) without reading a row.
8084
+ */
8085
+ declare function checkItemFilter(collection: string, filter: Record<string, unknown>): Command<{
8086
+ data: FilterCheck;
8087
+ }>;
8088
+ /**
8089
+ * One record by its alias / friendly id or the collection's slug field (404 when none
8090
+ * matches or the caller cannot read it).
8091
+ */
8092
+ declare function readItemBySlug<T = Record<string, unknown>>(collection: string, slug: string, query?: {
8093
+ fields?: string[];
8094
+ }): Command<{
8095
+ data: T;
8096
+ }>;
8097
+ /**
8098
+ * Distinct non-null values of one stored column over the rows the caller may read — for a
8099
+ * filter dropdown. Default 200 values, max 500.
8100
+ */
8101
+ declare function readItemDistinct(collection: string, field: string, limit?: number): Command<{
8102
+ data: unknown[];
8103
+ }>;
8104
+ /**
8105
+ * Set the same values on several records. A record that already holds every value is
8106
+ * `skipped`; one whose form locks a field for the caller is `refused` (`by_form: true` also
8107
+ * refuses fields that are not on the record's form). Per-record failures never fail the call.
8108
+ */
8109
+ declare function bulkUpdateItems(collection: string, ids: Array<string | number>, data: Record<string, unknown>, opts?: {
8110
+ by_form?: boolean;
8111
+ }): Command<{
8112
+ updated: number;
8113
+ skipped: number;
8114
+ refused: number;
8115
+ refused_reason?: string;
8116
+ }>;
8117
+ /** Delete several records; ones the caller may not delete are skipped (not counted). */
8118
+ declare function bulkDeleteItems(collection: string, ids: Array<string | number>): Command<{
8119
+ deleted: number;
8120
+ }>;
8121
+ /**
8122
+ * Run one pipeline transition on several records. `comment` is the note a transition that
8123
+ * requires one asks for, given once for all.
8124
+ */
8125
+ declare function bulkTransitionItems(collection: string, ids: Array<string | number>, transitionId: string, comment?: string): Command<{
8126
+ succeeded: number;
8127
+ failed: number;
8128
+ errors: Array<{
8129
+ item: string;
8130
+ error: string;
8131
+ }>;
8132
+ }>;
8133
+ interface BatchWriteResult {
8134
+ op: 'create' | 'update';
8135
+ index: number;
8136
+ ok: boolean;
8137
+ id?: string | number;
8138
+ data?: Record<string, unknown>;
8139
+ error?: string;
8140
+ /** Written, but hidden from the writer's own read-back (User Scope / row filter). */
8141
+ readable?: false;
8142
+ link_failures?: string[];
8143
+ }
8144
+ /**
8145
+ * Create and update up to 100 records in one call, one result per row. The API answers
8146
+ * 422 (a NivaroError whose `response.data` holds the results) when every row failed.
8147
+ */
8148
+ declare function batchItems(collection: string, body: {
8149
+ create?: Array<Record<string, unknown>>;
8150
+ /** Each row names its `id`. */
8151
+ update?: Array<Record<string, unknown> & {
8152
+ id: string | number;
8153
+ }>;
8154
+ }): Command<{
8155
+ data: {
8156
+ results: BatchWriteResult[];
8157
+ ok: number;
8158
+ failed: number;
8159
+ };
8160
+ }>;
8161
+ interface BulkRowResult {
8162
+ index: number;
8163
+ op: 'create' | 'update';
8164
+ status: number;
8165
+ id?: string | number;
8166
+ data?: Record<string, unknown>;
8167
+ error?: string;
8168
+ code?: string;
8169
+ /** A create the collection's natural key routed to an existing record. */
8170
+ upserted?: boolean;
8171
+ readable?: false;
8172
+ }
8173
+ interface BulkWriteOutcome {
8174
+ results: BulkRowResult[];
8175
+ ok: number;
8176
+ failed: number;
8177
+ rolled_back: boolean;
8178
+ stopped_at: number | null;
8179
+ leftover: Array<string | number>;
8180
+ }
8181
+ /**
8182
+ * Up to 500 rows in one call: a row with an `id` is an update, without one a create
8183
+ * (answers 207 with per-row status). `atomic: true` = creates only, all or nothing (a
8184
+ * refused row → 422 BULK_ATOMIC_REFUSED, nothing kept). `returnIds` answers ids only.
8185
+ */
8186
+ declare function bulkWriteItems(collection: string, rows: Array<Record<string, unknown>>, opts?: {
8187
+ atomic?: boolean;
8188
+ returnIds?: boolean;
8189
+ }): Command<{
8190
+ data: BulkWriteOutcome;
8191
+ }>;
8192
+ /**
8193
+ * Queue a bulk write as a background job (`?async=1`, 202). Read its results with
8194
+ * {@link readBulkRun} — they are kept 24 hours.
8195
+ */
8196
+ declare function queueBulkWriteItems(collection: string, rows: Array<Record<string, unknown>>, opts?: {
8197
+ atomic?: boolean;
8198
+ returnIds?: boolean;
8199
+ }): Command<{
8200
+ data: {
8201
+ run_id: number;
8202
+ total: number;
8203
+ status: 'running';
8204
+ results_url: string;
8205
+ };
8206
+ }>;
8207
+ /** The results of a queued bulk write (its owner or an admin). */
8208
+ declare function readBulkRun(collection: string, runId: number): Command<{
8209
+ data: Partial<BulkWriteOutcome> & {
8210
+ run_id: number;
8211
+ collection: string;
8212
+ job: Record<string, unknown> | null;
8213
+ } & Record<string, unknown>;
8214
+ }>;
8215
+ interface TrashEntry {
8216
+ id: number;
8217
+ collection: string;
8218
+ item_id: string;
8219
+ label: string;
8220
+ deleted_by: UUID | null;
8221
+ deleted_by_name: string | null;
8222
+ deleted_at: ISODate;
8223
+ }
8224
+ /**
8225
+ * Deleted records: administrators see every deletion, everyone else their own. `collections`
8226
+ * lists every collection with entries in the caller's view (for a filter).
8227
+ */
8228
+ declare function listTrash(query?: {
8229
+ collection?: string;
8230
+ /** Contains-match over the snapshot and the item id. */
8231
+ search?: string;
8232
+ /** Only deletions in the last N days. */
8233
+ days?: number;
8234
+ page?: number;
8235
+ /** Default 50, max 100. */
8236
+ limit?: number;
8237
+ }): Command<{
8238
+ data: TrashEntry[];
8239
+ collections: string[];
8240
+ total: number;
8241
+ page: number;
8242
+ limit: number;
6754
8243
  }>;
6755
- declare function deleteQueue(id: UUID): Command<void>;
6756
- /** Replace a queue's sources wholesale (max 10). Cache-affecting edits demote
6757
- * a materialized queue and enqueue a rebuild; display-only edits apply in place. */
6758
- declare function updateQueueSources(id: UUID, sources: Array<Omit<QueueSource, 'id' | 'sort'> & {
6759
- id?: number;
6760
- sort?: number;
6761
- }>): Command<{
6762
- data: QueueSource[];
8244
+ /**
8245
+ * The latest deletion of one record — described only to an unrestricted admin or the person
8246
+ * who deleted it (`data: null` otherwise, the same as "not deleted").
8247
+ */
8248
+ declare function readRecordDeletion(collection: string, item: string | number): Command<{
8249
+ data: {
8250
+ deleted_at: ISODate;
8251
+ deleted_by_name: string | null;
8252
+ can_restore: boolean;
8253
+ trash_id: number | null;
8254
+ } | null;
6763
8255
  }>;
6764
- /** Force a full materialized-cache rebuild (owner or admin). */
6765
- declare function rematerializeQueue(id: UUID): Command<{
8256
+ /** Put a deleted record back with its original id (create permission required; 409 if taken). */
8257
+ declare function restoreTrashItem(trashId: number): Command<{
6766
8258
  data: {
6767
- enqueued: boolean;
8259
+ restored: true;
8260
+ collection: string;
8261
+ item_id: string;
6768
8262
  };
6769
8263
  }>;
6770
- /** Resolve a queue's items. Omit page/limit for the full set (kanban); pass
6771
- * them for table pagination (adds `total`). `filters` = per-column contains
6772
- * filters keyed by column key ('state', 'owners', 'extra.<path>' …). */
6773
- declare function readQueueItems(id: UUID, options?: {
6774
- scope?: QueueScope;
6775
- sort?: string;
6776
- filters?: Record<string, string>;
6777
- page?: number;
6778
- limit?: number;
6779
- }): Command<QueueItemsResult>;
6780
- /** Items grouped per owner with each owner's WIP limit — the Workload view. */
6781
- declare function readQueueWorkload(id: UUID): Command<{
6782
- data: Array<QueueWorkloadRow & {
6783
- items: QueueItem[];
8264
+ /** Restore up to 100 entries, one result each (never all-or-nothing). */
8265
+ declare function bulkRestoreTrash(ids: number[]): Command<{
8266
+ data: {
8267
+ results: Array<{
8268
+ id: number;
8269
+ ok: boolean;
8270
+ collection?: string;
8271
+ item_id?: string;
8272
+ error?: string;
8273
+ }>;
8274
+ restored: number;
8275
+ failed: number;
8276
+ };
8277
+ }>;
8278
+ /** Purge an entry for good (admin or the deleter; 423 while the record is under legal hold). */
8279
+ declare function purgeTrashItem(trashId: number): Command<{
8280
+ data: {
8281
+ purged: true;
8282
+ };
8283
+ }>;
8284
+ interface OwnerHistoryEntry {
8285
+ state_label: string | null;
8286
+ entered_at: ISODate;
8287
+ left_at: ISODate | null;
8288
+ moved_by: string | null;
8289
+ /** The state's resolved owners. */
8290
+ owners: Array<{
8291
+ id: UUID;
8292
+ name: string;
6784
8293
  }>;
8294
+ }
8295
+ /** Who owned a record in each pipeline state it passed through, oldest first. */
8296
+ declare function readOwnerHistory(collection: string, item: string | number): Command<{
8297
+ data: OwnerHistoryEntry[];
6785
8298
  }>;
6786
- /** Daily stat-snapshot series for the stat-tile sparklines.
6787
- * scope 'mine' returns the caller's own series; anything else = queue-wide. */
6788
- declare function readQueueTrends(id: UUID, options?: {
6789
- days?: number;
6790
- scope?: string;
6791
- }): Command<{
6792
- data: Record<string, QueueTrendPoint[]>;
8299
+ /** Comment counts per record id (up to 500 ids; only rows the caller can open are counted). */
8300
+ declare function readCommentCounts(collection: string, ids: Array<string | number>): Command<{
8301
+ data: Record<string, number>;
6793
8302
  }>;
6794
- /** Sample rendered labels for a source's label template (builder preview). */
6795
- declare function suggestQueueLabels(id: UUID, options?: {
8303
+ /** The reactions a comment or recorded note takes. */
8304
+ type CommentReaction = '👍' | '✅' | '👀' | '🎉' | '❤️' | '😂';
8305
+ /** Toggle the caller's reaction on a comment. */
8306
+ declare function toggleCommentReaction(commentId: string, emoji: CommentReaction): Command<{
8307
+ data: {
8308
+ reacted: boolean;
8309
+ };
8310
+ }>;
8311
+ /** Toggle a reaction on a recorded note (transition comment, change reason) by its entry key. */
8312
+ declare function toggleEntryReaction(body: {
6796
8313
  collection: string;
6797
- template?: string;
8314
+ item: string | number;
8315
+ entry_key: string;
8316
+ emoji: CommentReaction;
6798
8317
  }): Command<{
6799
- data: string[];
8318
+ data: {
8319
+ reacted: boolean;
8320
+ };
6800
8321
  }>;
6801
- /** Pipeline states available for a collection (builder state pickers).
6802
- * Includes the '__none__' sentinel for stateless items. */
6803
- declare function readQueueCollectionStates(collection: string): Command<{
6804
- data: Array<{
6805
- id: string;
8322
+ interface PipelineOutline {
8323
+ id: UUID;
8324
+ name: string | null;
8325
+ states: Array<{
8326
+ id: UUID;
6806
8327
  key: string;
6807
8328
  label: string;
6808
8329
  color: string | null;
8330
+ sort: number | null;
8331
+ is_initial: boolean;
8332
+ is_terminal: boolean;
8333
+ }>;
8334
+ /** Manual transitions the caller's role may run (automatic ones are left out). */
8335
+ transitions: Array<{
8336
+ id: UUID;
8337
+ label: string;
8338
+ from_state: UUID | null;
8339
+ to_state: UUID;
8340
+ color: string | null;
8341
+ sort: number | null;
8342
+ group_label: string | null;
8343
+ require_owner: boolean;
8344
+ allow_creator: boolean;
6809
8345
  }>;
8346
+ }
8347
+ /** A pipeline's states and the manual transitions the caller's role may run (any sign-in). */
8348
+ declare function readPipelineOutline(templateId: string): Command<{
8349
+ data: PipelineOutline;
6810
8350
  }>;
6811
- /** Claim an item in a queue (writes through to pipeline instance owners for
6812
- * real business records). 403 when the queue has claims disabled. */
6813
- declare function claimQueueItem(id: UUID, item: {
6814
- collection: string;
6815
- item_id: string;
6816
- }): Command<{
6817
- data: {
6818
- claimed: boolean;
8351
+ interface OwnerSeat {
8352
+ group_id: UUID;
8353
+ group_name: string | null;
8354
+ /** The group's filters, named by dimension label. */
8355
+ filters: unknown;
8356
+ is_default: boolean | number | null;
8357
+ state_label: string;
8358
+ state_key: string;
8359
+ template_id: UUID;
8360
+ template_name: string;
8361
+ }
8362
+ /** The owner-matrix seats the caller holds across every pipeline. */
8363
+ declare function readMyOwnerSeats(): Command<{
8364
+ data: OwnerSeat[];
8365
+ }>;
8366
+ /** End the current session (cookie sign-in; also ends any View-as the person started). */
8367
+ declare function logout(): Command<{
8368
+ ok: true;
8369
+ }>;
8370
+ /** End every session of the caller across apps and tabs. */
8371
+ declare function logoutAll(): Command<{
8372
+ ok: true;
8373
+ destroyed: number;
8374
+ }>;
8375
+ /**
8376
+ * A one-time socket token (2 minutes) for `createRealtime().connect(url, getter)` — the way
8377
+ * a session-cookie, API-key or static-token caller signs a socket in. 403 WS_UNBINDABLE for
8378
+ * a sign-in with nothing to bind the socket to.
8379
+ */
8380
+ declare function readWsToken(): Command<{
8381
+ token: string;
8382
+ }>;
8383
+ interface AuthProviders {
8384
+ oidc: {
8385
+ enabled: boolean;
8386
+ label: string;
8387
+ };
8388
+ static_token: {
8389
+ enabled: boolean;
8390
+ };
8391
+ saml: {
8392
+ enabled: boolean;
8393
+ label: string;
6819
8394
  };
8395
+ password: {
8396
+ enabled: boolean;
8397
+ };
8398
+ sso: Array<{
8399
+ id: number;
8400
+ key: string;
8401
+ label: string;
8402
+ logo_url?: string | null;
8403
+ button_color?: string | null;
8404
+ }>;
8405
+ }
8406
+ /** The sign-in methods this instance offers (public; display data only). */
8407
+ declare function readAuthProviders(): Command<{
8408
+ data: AuthProviders;
6820
8409
  }>;
6821
- /** Release a claim (self-added instance-owner grants are removed too). */
6822
- declare function releaseQueueItem(id: UUID, item: {
8410
+
8411
+ /**
8412
+ * Schema change proposals (#3209): draft a field or collection change for an administrator to
8413
+ * review. Nothing changes until an administrator applies it on the Data Model page.
8414
+ */
8415
+
8416
+ type SchemaFieldType = 'string' | 'text' | 'integer' | 'bigInteger' | 'boolean' | 'decimal' | 'float' | 'date' | 'datetime' | 'uuid';
8417
+ interface SchemaChoice {
8418
+ value: string | number;
8419
+ text?: string;
8420
+ }
8421
+ interface ProposedField {
8422
+ field: string;
8423
+ type?: SchemaFieldType;
8424
+ label?: string;
8425
+ note?: string;
8426
+ choices?: SchemaChoice[];
8427
+ required?: boolean;
8428
+ max_length?: number;
8429
+ }
8430
+ type ProposedSchemaChange = ({
8431
+ kind: 'add_field';
6823
8432
  collection: string;
6824
- item_id: string;
8433
+ } & ProposedField) | {
8434
+ kind: 'update_field';
8435
+ collection: string;
8436
+ field: string;
8437
+ label?: string;
8438
+ note?: string;
8439
+ choices?: SchemaChoice[];
8440
+ required?: boolean;
8441
+ } | {
8442
+ kind: 'add_collection';
8443
+ collection: string;
8444
+ display_name?: string;
8445
+ singular?: string;
8446
+ plural?: string;
8447
+ icon?: string;
8448
+ note?: string;
8449
+ fields?: ProposedField[];
8450
+ };
8451
+ /**
8452
+ * Store a schema proposal (POST /schema-proposals). Answers the plain-words reading of each
8453
+ * change; changes that would not hold (a field that exists, an unknown collection) are refused
8454
+ * with 400 and `change_index`.
8455
+ */
8456
+ declare function proposeSchemaChange(body: {
8457
+ changes: ProposedSchemaChange[];
8458
+ note?: string;
6825
8459
  }): Command<{
6826
8460
  data: {
6827
- released: boolean;
8461
+ id: string;
8462
+ status: 'proposed';
8463
+ changes: string[];
8464
+ note: string;
6828
8465
  };
6829
8466
  }>;
6830
- /** Saved views visible to the caller (own + shared behind queue visibility). */
6831
- declare function listQueueViews(id: UUID): Command<{
6832
- data: QueueView[];
6833
- }>;
6834
- declare function createQueueView(id: UUID, data: {
6835
- name: string;
6836
- is_shared?: boolean;
6837
- role?: UUID | null;
6838
- state: QueueView['state'];
6839
- }): Command<{
6840
- data: QueueView;
6841
- }>;
6842
- /** Overwrite a view's name/sharing/state in place (owner or admin). */
6843
- declare function updateQueueView(viewId: number, data: {
6844
- name?: string;
6845
- is_shared?: boolean;
6846
- state?: QueueView['state'];
6847
- }): Command<{
6848
- data: QueueView;
6849
- }>;
6850
- declare function deleteQueueView(viewId: number): Command<void>;
6851
- /** The caller's per-queue prefs (default saved view; visible_columns is legacy). */
6852
- declare function readQueueColumnPrefs(id: UUID): Command<{
6853
- data: QueueColumnPrefs;
6854
- }>;
6855
- /** Star/unstar a saved view as the caller's default for this queue
6856
- * (null reverts to the queue's general default). */
6857
- declare function setQueueDefaultView(id: UUID, viewId: number | null): Command<{
6858
- data: {
6859
- default_view_id: number | null;
8467
+ interface SchemaProposal {
8468
+ id: string;
8469
+ status: 'proposed' | 'applied' | 'rejected' | 'expired';
8470
+ collections: string[];
8471
+ changes: ProposedSchemaChange[];
8472
+ sentences: string[];
8473
+ note: string | null;
8474
+ proposed_by: {
8475
+ id: string;
8476
+ name: string;
6860
8477
  };
8478
+ via: string;
8479
+ client: string | null;
8480
+ created_at: string;
8481
+ resolved_at: string | null;
8482
+ result: Record<string, unknown> | null;
8483
+ }
8484
+ /** One proposal and its outcome (the proposer or an administrator). */
8485
+ declare function readSchemaProposal(id: string): Command<{
8486
+ data: SchemaProposal;
6861
8487
  }>;
6862
8488
 
6863
8489
  /**
@@ -6996,8 +8622,25 @@ interface PresenceClient {
6996
8622
  declare function createPresence(options: PresenceOptions): PresenceClient;
6997
8623
 
6998
8624
  type RealtimeEvent = 'create' | 'update' | 'delete' | '*';
8625
+ /** One record change as the server announced it. Values never ride the socket. */
8626
+ interface RealtimeChange {
8627
+ collection: string;
8628
+ /** The record id; null when a coalesced burst was too large to list (`many`). */
8629
+ item: string | number | null;
8630
+ action: 'create' | 'update' | 'delete';
8631
+ /** Changed field names (updates), when the server knew them. */
8632
+ changed_fields?: string[];
8633
+ /** `import` when a staged import run made the write. */
8634
+ source?: string;
8635
+ /** Part of a coalesced burst (several writes folded into one message). */
8636
+ coalesced?: boolean;
8637
+ /** A burst too large to list ids: refetch the list instead. */
8638
+ many?: boolean;
8639
+ }
8640
+ /** A token, or a function asked on every (re)connect — ws-tokens are single-use. */
8641
+ type RealtimeToken = string | (() => string | null | undefined | Promise<string | null | undefined>);
6999
8642
  interface NivaroRealtime {
7000
- connect(url: string, token?: string): void;
8643
+ connect(url: string, token?: RealtimeToken): void;
7001
8644
  disconnect(): void;
7002
8645
  subscribe(collection: string, opts: {
7003
8646
  event?: RealtimeEvent;
@@ -7005,10 +8648,73 @@ interface NivaroRealtime {
7005
8648
  }, callback: (data: unknown[]) => void): () => void;
7006
8649
  onConnect(fn: () => void): void;
7007
8650
  onDisconnect(fn: (reason: string) => void): void;
8651
+ /** Called when the server accepted the sign-in (`auth:ok`); rooms are joined then. */
8652
+ onAuthenticated(fn: (userId: string) => void): void;
7008
8653
  connected: boolean;
8654
+ /** True between `auth:ok` and the next disconnect. */
8655
+ authenticated: boolean;
7009
8656
  }
8657
+ /** Pseudo-collection: subscribe to it to hear `notification:new` for the signed-in person. */
8658
+ declare const NOTIFICATIONS_CHANNEL = "cms_notifications";
8659
+ type UpdatePayload = {
8660
+ collection?: string;
8661
+ item?: string | number | null;
8662
+ items?: Array<string | number> | null;
8663
+ many?: boolean;
8664
+ action?: string;
8665
+ changed_fields?: string[];
8666
+ source?: string;
8667
+ coalesced?: boolean;
8668
+ };
8669
+ /** The changes one `collection:update` message names. Exported for tests. */
8670
+ declare function parseRealtimeChanges(payload: UpdatePayload): RealtimeChange[];
7010
8671
  declare function createRealtime(): NivaroRealtime;
7011
8672
 
8673
+ /** Response header the API stamps on every traced /api answer (plugins/request-trace.ts). */
8674
+ declare const REQUEST_ID_HEADER = "x-nivaro-request-id";
8675
+ /** A non-2xx answer from the Nivaro API. */
8676
+ declare class NivaroError extends Error {
8677
+ /** HTTP status of the answer. */
8678
+ readonly status: number;
8679
+ /** The API's machine code (`body.code`, e.g. `QUOTA_EXCEEDED`, `SERVER_BUSY`), else null. */
8680
+ readonly code: string | null;
8681
+ /**
8682
+ * The `x-nivaro-request-id` the server stamped — the id its slow-trace buffer, access
8683
+ * log and API request log carry. Null when the header was absent or unreadable (a
8684
+ * cross-origin browser call only sees it if the API exposes the header through CORS).
8685
+ */
8686
+ readonly requestId: string | null;
8687
+ /** The parsed JSON body (or `{ error: statusText }` when the body was not JSON). */
8688
+ readonly response: unknown;
8689
+ readonly method: string;
8690
+ /** Path under `/api` (no query string). */
8691
+ readonly path: string;
8692
+ /** Milliseconds from a `Retry-After` header (429 / 503), else null. */
8693
+ readonly retryAfterMs: number | null;
8694
+ /** Import parse refusals: the per-row problems the API listed. */
8695
+ readonly issues?: unknown;
8696
+ constructor(init: {
8697
+ message: string;
8698
+ status: number;
8699
+ code?: string | null;
8700
+ requestId?: string | null;
8701
+ response?: unknown;
8702
+ method: string;
8703
+ path: string;
8704
+ retryAfterMs?: number | null;
8705
+ issues?: unknown;
8706
+ });
8707
+ }
8708
+ /** True for a NivaroError (also across bundled copies of the SDK). */
8709
+ declare function isNivaroError(err: unknown): err is NivaroError;
8710
+ /**
8711
+ * The human message of an error body. Route handlers answer `{ error: 'Not found' }`;
8712
+ * Fastify's own errors (validation, the SERVER_BUSY 503) answer
8713
+ * `{ statusCode, error: 'Bad Request', message: '…' }`, where `error` is only the status
8714
+ * phrase and `message` is the reason.
8715
+ */
8716
+ declare function errorBodyMessage(body: unknown): string | null;
8717
+
7012
8718
  /**
7013
8719
  * Nivaro SDK — typed client for the Nivaro CMS API.
7014
8720
  *
@@ -7045,9 +8751,17 @@ declare function createRealtime(): NivaroRealtime;
7045
8751
  * }
7046
8752
  * `)
7047
8753
  *
7048
- * // Realtime (Socket.io)
7049
- * nivaro.realtime.connect('https://nivaro.example.com')
7050
- * const unsub = nivaro.realtime.subscribe('projects', { event: 'update' }, (data) => console.log(data))
8754
+ * // Realtime (Socket.io) — a separate client; sign in with a token or a ws-token getter
8755
+ * const rt = createRealtime()
8756
+ * rt.connect('https://nivaro.example.com', () => nivaro.request(readWsToken()).then((r) => r.token))
8757
+ * const unsub = rt.subscribe('projects', { event: 'update' }, (changes) => console.log(changes))
8758
+ *
8759
+ * // Observability (opt-in): hooks, request ids, retries
8760
+ * const traced = createNivaro(url, {
8761
+ * token,
8762
+ * onResponse: (r) => console.log(r.method, r.path, r.status, r.requestId),
8763
+ * retry: 2
8764
+ * })
7051
8765
  */
7052
8766
 
7053
8767
  type UUID = string;
@@ -7129,14 +8843,23 @@ interface Query<T = Record<string, unknown>> {
7129
8843
  offset?: number;
7130
8844
  page?: number;
7131
8845
  search?: string;
8846
+ /** Limit `search` to these fields (each one the caller may read). */
8847
+ search_fields?: string[];
8848
+ /** Order `search` matches by relevance (exact, then prefix, then contains). */
8849
+ search_rank?: boolean;
7132
8850
  /**
7133
8851
  * Keyset paging for walking a large collection: 'start' for the first page,
7134
8852
  * then the `next_cursor` of the page before. Sort by the record's own fields
7135
8853
  * only; `id` is added as the tie-break. Replaces offset/page.
7136
8854
  */
7137
8855
  after?: string;
7138
- /** false = skip the count query; `total` answers null. */
7139
- count?: boolean;
8856
+ /**
8857
+ * false = skip the count query; `total` answers null. 'approx' = a total up to a few
8858
+ * seconds old may stand in for COUNT(*) (the answer then carries `total_approx: true`).
8859
+ */
8860
+ count?: boolean | 'approx';
8861
+ /** Flatten each to-one relation's display label into the row (one batched read). */
8862
+ labels?: boolean;
7140
8863
  }
7141
8864
  interface ListResponse<T> {
7142
8865
  data: T[];
@@ -7148,6 +8871,13 @@ interface ListResponse<T> {
7148
8871
  next_cursor?: string | null;
7149
8872
  /** To-many aliases whose lists were cut at the per-record limit. */
7150
8873
  truncated_relations?: string[];
8874
+ /** The total came from the list-total cache or the partition row count (`count: 'approx'`). */
8875
+ total_approx?: boolean;
8876
+ /** The count ran out of time: `total` is null, the page itself is complete. */
8877
+ total_timed_out?: boolean;
8878
+ /** The asked `limit` was above the server cap; `applied_limit` is what was used. */
8879
+ limit_capped?: boolean;
8880
+ applied_limit?: number;
7151
8881
  }
7152
8882
  interface WorkflowState {
7153
8883
  id: UUID;
@@ -7271,27 +9001,71 @@ interface InstanceOwner {
7271
9001
  last_name: string | null;
7272
9002
  email: string;
7273
9003
  }
9004
+ /** Common audit actions; the log also carries feature actions (`export`, `trash-purge`, …). */
9005
+ type ActivityAction = 'create' | 'update' | 'delete' | 'login' | 'logout' | 'export' | 'transition' | (string & {});
9006
+ /** One audit-log row (`GET /activity`, admin). */
7274
9007
  interface ActivityEntry {
7275
9008
  id: number;
7276
- action: 'create' | 'update' | 'delete' | 'login';
9009
+ action: ActivityAction;
7277
9010
  collection: string | null;
7278
9011
  item: string | null;
7279
9012
  user: UUID | null;
7280
9013
  timestamp: ISODate;
9014
+ ip?: string | null;
9015
+ comment?: string | null;
9016
+ /** Where the write came from (`ui`, `api`, `import`, `flow`, …) when recorded. */
9017
+ origin?: string | null;
9018
+ first_name?: string | null;
9019
+ last_name?: string | null;
9020
+ user_email?: string | null;
9021
+ /** The badge of a write an agent made through MCP ("via Claude"), else null. */
9022
+ via_agent?: string | null;
9023
+ /** Single-entry reads only (`readActivityEntry`). */
9024
+ user_agent?: string | null;
7281
9025
  }
9026
+ /**
9027
+ * One entry of a record's history. Snapshot rows carry `data`/`delta`; pipeline moves and
9028
+ * O2M child events are folded in without a snapshot (`id` null, `event` set or an `o2m-*`
9029
+ * action).
9030
+ */
7282
9031
  interface Revision {
7283
- id: number;
9032
+ /** Null for a folded entry with no revision row (a transition, an O2M child event). */
9033
+ id: number | null;
7284
9034
  activity: number | null;
7285
9035
  collection: string;
7286
9036
  item: string;
7287
- data: Record<string, unknown>;
9037
+ data: Record<string, unknown> | null;
7288
9038
  delta: Record<string, unknown> | null;
7289
- action: 'create' | 'update' | 'delete';
9039
+ parent?: number | null;
9040
+ action: 'create' | 'update' | 'delete' | (string & {});
7290
9041
  timestamp: ISODate;
7291
- user: UUID | null;
9042
+ /** The person behind the entry (the API names it `user_id`). */
9043
+ user_id?: UUID | null;
9044
+ /** @deprecated never sent by the API — read `user_id`. */
9045
+ user?: UUID | null;
7292
9046
  first_name: string | null;
7293
9047
  last_name: string | null;
7294
9048
  user_email: string | null;
9049
+ comment?: string | null;
9050
+ /** The badge of a write an agent made through MCP ("via Claude"), else absent. */
9051
+ via_agent?: string | null;
9052
+ /** A pipeline event folded into the history (no snapshot). */
9053
+ event?: {
9054
+ kind: 'transition' | 'start';
9055
+ history_id?: number;
9056
+ from_label: string | null;
9057
+ to_label: string | null;
9058
+ transition_label: string | null;
9059
+ source: string | null;
9060
+ addendum?: {
9061
+ id: string;
9062
+ title: string | null;
9063
+ } | null;
9064
+ on_behalf_of?: {
9065
+ id: string;
9066
+ name: string | null;
9067
+ } | null;
9068
+ } | null;
7295
9069
  }
7296
9070
  interface ExternalApi {
7297
9071
  id: number;
@@ -7579,7 +9353,13 @@ declare function aggregateItems(collection: string, query: AggregateQuery): Comm
7579
9353
  limit: number;
7580
9354
  offset: number;
7581
9355
  }>;
7582
- declare function readItem<T = Record<string, unknown>>(collection: string, id: string | number): Command<{
9356
+ /**
9357
+ * One record as the caller may read it (404 when it does not exist or is hidden from them).
9358
+ * `query.fields` projects the answer, dotted paths included (`owner.email`).
9359
+ */
9360
+ declare function readItem<T = Record<string, unknown>>(collection: string, id: string | number, query?: {
9361
+ fields?: string[];
9362
+ }): Command<{
7583
9363
  data: T;
7584
9364
  }>;
7585
9365
  /** One read inside {@link readMany}. Without `id` it is a list read. */
@@ -7722,19 +9502,34 @@ declare function readCollections(): Command<{
7722
9502
  declare function readCollection(collection: string): Command<{
7723
9503
  data: CMSCollection;
7724
9504
  }>;
7725
- /** All revisions for a specific item (newest first). */
7726
- declare function readRevisions(collection: string, item: string | number): Command<ListResponse<Revision>>;
9505
+ /**
9506
+ * A record's history, newest first (up to 100 revisions plus folded pipeline / O2M events).
9507
+ * Same gate as opening the record; snapshots are cut to the fields the caller may read.
9508
+ * The answer is `{ data }` only — there is no total or paging.
9509
+ */
9510
+ declare function readRevisions(collection: string, item: string | number): Command<{
9511
+ data: Revision[];
9512
+ }>;
9513
+ /** The newest revision id of a record (collision baseline), without the history. */
9514
+ declare function readLatestRevisionId(collection: string, item: string | number): Command<{
9515
+ data: {
9516
+ latest: number | null;
9517
+ };
9518
+ }>;
7727
9519
  /** Single revision by ID. */
7728
9520
  declare function readRevision(id: number): Command<{
7729
9521
  data: Revision;
7730
9522
  }>;
7731
9523
  interface ActivityQuery {
7732
9524
  collection?: string;
7733
- action?: 'create' | 'update' | 'delete' | 'login';
9525
+ /** Any recorded action — `listActivityActions()` lists the ones in the log. */
9526
+ action?: ActivityAction;
7734
9527
  user?: string;
9528
+ /** Rows per page (default 25, max 200). */
7735
9529
  limit?: number;
7736
9530
  offset?: number;
7737
9531
  }
9532
+ /** The audit log, newest first (admin). */
7738
9533
  declare function readActivity(query?: ActivityQuery): Command<ListResponse<ActivityEntry>>;
7739
9534
  /**
7740
9535
  * Get workflow instance for an item: current state, available transitions
@@ -8405,7 +10200,55 @@ declare function listActivePresence(): Command<{
8405
10200
  data: PresenceSessionInfo[];
8406
10201
  total: number;
8407
10202
  }>;
10203
+ /** What a request hook sees before the fetch. `headers` may be changed in place. */
10204
+ interface NivaroRequestInfo {
10205
+ method: string;
10206
+ /** Path under `/api` (no query string), e.g. `/items/orders`. */
10207
+ path: string;
10208
+ /** The full URL about to be fetched. */
10209
+ url: string;
10210
+ /** The request's headers — add tracing or app headers here. */
10211
+ headers: Record<string, string>;
10212
+ /** 0 on the first try, 1.. on a retry (see `retry`). */
10213
+ attempt: number;
10214
+ /** `request` (commands), `graphql`, `upload` or `import-parse`. */
10215
+ kind: 'request' | 'graphql' | 'upload' | 'import-parse';
10216
+ }
10217
+ /** What a response hook sees once the status line arrived (the body is not read yet). */
10218
+ interface NivaroResponseInfo {
10219
+ method: string;
10220
+ path: string;
10221
+ url: string;
10222
+ attempt: number;
10223
+ kind: NivaroRequestInfo['kind'];
10224
+ status: number;
10225
+ ok: boolean;
10226
+ /** The `x-nivaro-request-id` the server stamped, else null (see NivaroError.requestId). */
10227
+ requestId: string | null;
10228
+ /** From the fetch call to the status line. */
10229
+ durationMs: number;
10230
+ /** True when the client is about to retry this answer. */
10231
+ willRetry: boolean;
10232
+ }
10233
+ /** Opt-in retries for idempotent reads (off unless `retry` is set). */
10234
+ interface NivaroRetryOptions {
10235
+ /** Further tries after the first (default 2 when `retry` is an object). */
10236
+ retries?: number;
10237
+ /** Methods that may be retried (default `['GET']` — writes are never retried by default). */
10238
+ methods?: Array<Command<unknown>['_method']>;
10239
+ /** Statuses that are retried (default 408, 429, 502, 503, 504). Network errors always are. */
10240
+ statuses?: number[];
10241
+ /** First backoff (default 300 ms), doubled per try with jitter; a Retry-After wins. */
10242
+ baseDelayMs?: number;
10243
+ /** Longest single wait (default 10 000 ms). */
10244
+ maxDelayMs?: number;
10245
+ }
8408
10246
  interface NivaroClientOptions {
10247
+ /**
10248
+ * Bearer credential: a static user token, a named API key (`nvk_…`), a View-as token, or
10249
+ * an MCP OAuth access token (`nvo_…`, accepted on `/api/mcp` and its tool calls only).
10250
+ * Omit it to ride the browser's session cookie (same-origin admin / portal).
10251
+ */
8409
10252
  token?: string;
8410
10253
  fetch?: typeof fetch;
8411
10254
  /**
@@ -8422,6 +10265,34 @@ interface NivaroClientOptions {
8422
10265
  * short.
8423
10266
  */
8424
10267
  timeoutMs?: number;
10268
+ /**
10269
+ * Extra headers on every request (e.g. `x-nivaro-app`, `x-workspace`), or a function read
10270
+ * per request. The client's own `Authorization` / `Content-Type` win over these.
10271
+ */
10272
+ headers?: Record<string, string> | (() => Record<string, string>);
10273
+ /** Called before every fetch (each retry too); may change `info.headers`. A throw fails the request. */
10274
+ onRequest?: (info: NivaroRequestInfo) => void | Promise<void>;
10275
+ /** Called when each answer's status line arrives (each retry too). Never fails the request. */
10276
+ onResponse?: (info: NivaroResponseInfo) => void;
10277
+ /**
10278
+ * Called once when a request finally fails — a NivaroError (non-2xx), a TimeoutError or a
10279
+ * network error. A caller's own abort is not reported. Never fails the request further.
10280
+ */
10281
+ onError?: (error: Error, info: {
10282
+ method: string;
10283
+ path: string;
10284
+ kind: NivaroRequestInfo['kind'];
10285
+ }) => void;
10286
+ /**
10287
+ * Log one line per request: `true` = `console.debug`, or a function of your own.
10288
+ * Lines carry method, path, status, duration and request id — never headers or bodies.
10289
+ */
10290
+ debug?: boolean | ((line: string, details: Record<string, unknown>) => void);
10291
+ /**
10292
+ * Retry idempotent reads on 408 / 429 / 502 / 503 / 504 and network errors, honouring
10293
+ * Retry-After. A number = that many retries with the defaults. Off by default.
10294
+ */
10295
+ retry?: number | NivaroRetryOptions;
8425
10296
  }
8426
10297
  interface FileUploadResult {
8427
10298
  id: string;
@@ -8920,4 +10791,4 @@ declare function submitFormItem(collection: string, values: Record<string, unkno
8920
10791
  data: Record<string, unknown>;
8921
10792
  }>;
8922
10793
 
8923
- export { type AccessAudit, type AccessAuditFinding, type AccessAuditRun, type AccessAuditSubject, type AccessReason, type ActivityEntry, type ActivityQuery, type ActivityReportQuery, type ActivityReportRow, type ActivityReportSummary, type Addendum, type AddendumStatus, type AggregateQuery, type AggregateRow, type AiChatTraceEntry, type AiCollectionSettings, type AiColumnMapping, type AiDuplicateMatch, type AiQueryFilter, type AiQueryResult, type AiReviewFinding, type AiViolation, type AlertDefinition, type AlertLogEntry, type AlertSubscription, type AnomalyDefinition, type AnomalyRule, type ApiAnalyticsBucket, type ApiAnalyticsCollection, type ApiAnalyticsPath, type ApiAnalyticsSummary, type ApiErrorLog, type ApiKey, type ApiKeyScope, type ApprovalBrief, type ApprovalChain, type ApprovalChainStep, type ApprovalDecision, type ApprovalInstance, type ApprovalInstanceDetail, type ApprovalStatus, type ApprovalStepInput, type AtRiskCondition, type AtRiskOp, type AtRiskResult, type AtRiskRule, type AtRiskSummaryEntry, type AttributeDefinition, type AttributeValue, type BatchRead, type BatchReadResult, type BlackoutDate, type BoolFilterOps, type CMSCollection, type CascadeFilterRule, type ChangeOrder, type ChaosWhatIfAnswer, type ChatChannel, type ChatChannelMember, type ChatDirectoryChannel, type ChatMessage, type ChatPin, type ChatReaction, type ChatRoomKind, type ChatRoomSummary, type ChatRoomType, type ChatSearchHit, type CollectionLayout, type CollectionLayoutType, type CollectionPresetSummary, type Command, type Comment, type CommentVersion, type ConfigSnapshot, type ConfigTableClassification, type ContentBundle, type ContentExportFormat, type ContentExportOptions, type CoverageGapItem, type CoverageGapOwner, type CoverageGapReport, type CpuProfileSummary, type CronJob, type CustomQuery, type CustomQueryCatalogEntry, type Dashboard, type DashboardFilter, type DashboardWidget, type DashboardWidgetData, type DashboardWidgetType, type DataQualityRule, type DataQualityRuleResult, type DataQualityRuleType, type DataQualityRun, type DataQualitySeverity, type DeadLetter, type DmvResult, type DraftPublishConfig, type DraftStatus, type DryRunReport, EDITOR_NOTE_MAX, type ErpSubmission, type ErpSubmissionStatus, type ExpensiveStatement, type ExtensionManifest, type ExternalApi, type ExternalApiEndpoint, type ExternalApiSchema, type ExternalApiSlotContext, type ExternalApiSpecImportResult, type ExternalApiTestResult, type FieldChangeEntry, type FieldCondition, type FieldConfig, type FieldDependencyConfig, type FieldFilter, type FieldGroup, type FieldTranslations, type FieldVisibilityRules, type FieldWatch, type FileRecord, type FileUploadResult, type FileUsageEntry, type Filter, type FlowReplayResult, type FlowRun, type FlowTestStep, type FormFieldDescriptor, type FormFieldRelation, type FormGroupDescriptor, type FormLockCondition, type FormSchema, type FormValidationRule, type FormVisibilityRule, GROUP_PATCH_KEYS, type GlobalSearchRecord, type GlobalSearchResults, type GraphQLResponse, type GroupPatch, type GroupRow, type HealthDetailed, type HelpVideo, type HelpVideoClick, type HelpVideoContext, type HelpVideoDownloadUrls, type HelpVideoFinalizedUpload, type HelpVideoProgress, type HelpVideoUploadSession, type HelpVideoVersion, type HelpVideoVisibility, type HelpVideoWalkStep, type HelpVideoWhatsNew, type HierarchyConfigDef, type HierarchyFlatNode, type HierarchyLevelDef, type HierarchyNestedNode, type IDFilterOps, type ISODate, type ImportDefinition, type ImportJob, type ImportParseResponse, type ImportPreview, type ImportPreviewDiff, type ImportTemplateSummary, type InfrastructureSummaryTool, type InstanceOwner, type InstanceToolEntry, type IntegrationApiHealth, type InternalWidget, type Issue, type IssueSeverity, type IssueStatus, type IssueSummary, type ItemLock, type ItemWriteMeta, type JobRegistryCron, type JobRun, LAYOUT_PATCH_KEYS, type LastTouch, type LayoutAssignment, type LayoutBundle, type LayoutDescription, type LayoutFieldExplanation, type LayoutGroup, type LayoutOp, type LayoutOverviewRow, type LayoutPatch, type LayoutPickReason, type LayoutProposal, type LayoutRow, type LayoutVersion, type ListResponse, type ManagedUser, type McpCapabilities, type McpToolsConfig, type MetricAlertRule, type MetricAlertSubscription, type MetricDefinition, type MyTask, type MyWorkOwnedEntry, type MyWorkSla, type MyWorkSummary, type NamedMcpToolConfig, type NivaroClient, type NivaroClientOptions, type NivaroExtensionPlugin, type NivaroRealtime, type NivaroRuntime, type NotificationItem, type NotificationPage, type NotificationSubscription, type NumberFilterOps, type OmniSearchHit, type OnlinePresenceConfig, type OnlinePresenceUser, PLACEMENT_PATCH_KEYS, type Page, type PageLayout, type PageSlotKey, type PageWidget, type PdfTemplate, type PermissionSimulation, type PersistedQuery, type PickerExclusionStatus, type PipelineFlowEdge, type PipelineFlowState, type PipelineImpactResult, type PipelineOwnerGroup, type PipelineOwnerGroupUser, type PipelineSimulation, type PipelineState, type PipelineVersionEntry, type PlacementKey, type PlacementPatch, type PlacementRow, type PluginSlots, type Policy, type PoolStats, type PreflightCheck, type PreflightReport, type PreflightSeverity, type PresenceClient, type PresenceOptions, type PresenceSession, type PresenceSessionInfo, type PresenceViewer, type ProjectedPlacement, type PromotionApplyResult, type PromotionPreview, type Query, type Queue, type QueueColumnPrefs, type QueueCondition, type QueueDetail, type QueueDisplayConfig, type QueueItem, type QueueItemsResult, type QueueOwner, type QueueRowClickMode, type QueueScope, type QueueSource, type QueueSourceType, type QueueStats, type QueueTrendPoint, type QueueView, type QueueViewKind, type QueueWorkloadRow, READ_MANY_MAX, type ReadyReport, type RealtimeEvent, type RecordGraphEdge, type RecordGraphNode, type RecordLink, type RecordLinkType, type RecordTemplate, type RecordViewRecap, type RegisteredAction, type RelatedCommentEntry, type RelationFilter, type RelationOption, type ReportAlert, type ReportAlertCondition, type ReportAlertLogEntry, type ReportAnnotation, type ReportColumnFormat, type ReportDateRange, type ReportDef, type ReportEntityFilter, type ReportFilterPreset, type ReportQueryColumn, type ReportQueryWidgetConfig, type ReportSnapshotEntry, type ReportSubscription, type ReportTemplateEntry, type ReportVersionEntry, type ReportWidget, type ReportWidgetConfig, type ReportWidgetData, type ReportWidgetPreset, type ReportWidgetType, type RequestTrace, type ResolvedOwner, type RetentionPolicy, type RetentionRun, type RetentionRunResult, type Revision, type Role, type Rule, type RuntimeStats, type SavedView, type ScheduledChange, type ScheduledReport, type ScopeDimension, type ScopeDimensionInfo, type SemanticSearchMatch, type SessionRecording, type SessionReplayMasking, type ShareLink, type SlaBatchStatus, type SlaRule, type SlaStatus, type StagedImportRun, type StagedImportStats, type StringFilterOps, type SubRow, type SubRowTemplate, type SupportTicket, type SupportTicketDetail, type SupportTicketStatus, type SyncJob, type Task, type TaskDoneWhenRule, type TaskPriority, type TaskStatus, type TimelineEvent, type TraceSpan, type TrafficSnapshot, type TrafficSnapshotEntity, type TreeFlatNode, type TreeNestedNode, type TreeNodeConfig, type TreePermission, type TreePermissionAction, type UUID, type UserActivityEntry, type UserActivitySummary, type UserScopesInfo, type ViewSubscription, type VirtualCollection, type Webhook, type WebhookDelivery, type WhichLayoutForm, type WidgetFeed, type WorkflowBinding, type WorkflowHistoryEntry, type WorkflowInstance, type WorkflowInstanceData, type WorkflowState, type WorkflowTransition, type Workspace, type WorkspaceQuotas, type WorkspaceTemplate, type WorkspaceUsage, _and, _contains, _ends_with, _eq, _gt, _gte, _in, _lt, _lte, _ncontains, _neq, _nin, _nnull, _none, _null, _or, _some, _starts_with, abandonHelpVideoUpload, acquireItemLock, activateLayout, addChatChannelMember, addInstanceOwner, addSubRow, aggregateItems, aiBrief, aiBuildReport, aiChat, aiCheckDuplicates, aiGenerate, aiMapColumns, aiQuery, aiReportFilters, aiReview, aiSummarize, aiValidate, appendSessionRecordingEvents, applyContentBundle, applyHelpVideoPackageImport, applyRecordTemplate, applySubRowTemplate, approveAddendum, approveAiProposal, archiveHelpVideo, asc, backupExportPath, batchPickerExclusionStatus, bulkPickerExclusion, callExternalApi, callExternalApiEndpoint, callInstanceTool, cancelScheduledChange, cancelStagedImport, captureCpuProfile, cascadeFieldDependencies, chaosWhatIf, checkBlackoutDate, claimQueueItem, claimSupportTicket, claimTask, clearTraces, cloneItem, cloneLayout, cloneReport, compareConfigSnapshot, completeTask, copyReportWidget, createAccessAudit, createAddendum, createAlertDefinition, createAlertSubscription, createAnomalyRule, createApiKey, createApprovalChain, createAtRiskRule, createAttributeDefinition, createBlackoutDate, createChatChannel, createChatRoomType, createCollectionLayout, createComment, createDataQualityRule, createExternalApi, createExternalApiEndpoint, createFieldGroup, createFieldWatch, createGroupDm, createHelpVideo, createHierarchyConfig, createImportDefinition, createImportJob, createImportJobFromUrl, createInternalWidget, createIssue, createItem, createMetricAlertRule, createNivaro, createNotification, createNotificationSubscription, createPage, createPdfTemplate, createPersistedQuery, createPresence, createQueue, createQueueView, createRealtime, createRecordLink, createRecordTemplate, createReport, createReportAlert, createReportAnnotation, createReportFromTemplate, createReportSnapshot, createReportWidgetPreset, createRetentionPolicy, createRole, createRolePolicy, createRule, createSavedView, createScheduledChange, createScheduledReport, createShareLink, createSlaRule, createSubRowTemplate, createSyncJob, createTask, createTreePermission, createUser, createViewSubscription, createVirtualCollection, createWebhook, createWidgetFeed, createWorkspace, createWorkspaceTemplate, decideApproval, deleteAccessAudit, deleteAddendum, deleteAlertDefinition, deleteAlertSubscription, deleteAnomalyRule, deleteApiKey, deleteApprovalChain, deleteAtRiskRule, deleteAttributeDefinition, deleteBlackoutDate, deleteChatMessage, deleteCollectionLayout, deleteComment, deleteDataQualityRule, deleteExternalApi, deleteExternalApiEndpoint, deleteExternalApiSchema, deleteFieldGroup, deleteFieldTranslations, deleteFieldWatch, deleteFile, deleteHierarchyConfig, deleteImportJob, deleteInternalWidget, deleteIssue, deleteItem, deleteMetricAlertRule, deleteNotification, deleteNotificationSubscription, deletePage, deletePdfTemplate, deletePersistedQuery, deleteQueue, deleteQueueView, deleteRecordLink, deleteRecordTemplate, deleteReport, deleteReportAlert, deleteReportAnnotation, deleteReportFilterPreset, deleteReportSnapshot, deleteReportTemplate, deleteReportWidgetPreset, deleteRetentionPolicy, deleteRole, deleteRolePolicy, deleteRule, deleteSavedView, deleteScheduledReport, deleteSessionRecording, deleteSlaRule, deleteSubRow, deleteSubRowTemplate, deleteSyncJob, deleteTask, deleteTreePermission, deleteUser, deleteViewSubscription, deleteVirtualCollection, deleteWebhook, deleteWidgetFeed, deleteWorkspace, deleteWorkspaceTemplate, deployImportProcedure, desc, describeLayoutForm, diffLayoutVersion, disableTwoFactor, discardHelpVideoPackageImport, drillReportRow, editChatMessage, endSessionRecording, evaluateAlerts, evaluateAtRisk, evaluateFieldDefaults, evaluateFieldLock, evaluateFieldRules, evaluateFieldVisibility, excludeFromPicker, excludeFromPickers, executeBulkAction, executeCustomQuery, executeImportTemplate, executeItemAction, executeScheduledChange, explainLayout, explainLayoutField, explainRecordAccess, explainReportTrend, exportBlueprint, exportConfigSnapshot, exportContent, exportContentBundle, exportHelpVideoPackage, exportSchemaSnapshot, fetchFormSchema, fileDownloadPath, fileTransformPath, finalizeHelpVideoUpload, generateToken, generateUserToken, getAlertDefinition, getAttributeValues, getBrunoCollection, getCommentHistory, getExternalApi, getExternalApiEndpoint, getFieldTranslations, getFlowRun, getLocales, getOpenApi, getPickerExclusionStatus, getPostmanCollection, getPresence, getRetentionPolicy, getSlaRule, getSlaStatus, getTranslations, getTypes, getWebhook, globalSearch, heartbeatItemLock, helpVideosFor, importExternalApiSpec, importSchemaSnapshot, includeInPicker, includeInPickers, installBlueprint, installCollectionPreset, invokeInternalWidgetAction, isPageSlot, joinChatRoom, leaveChatRoom, listAccessAuditRuns, listAccessAudits, listActiveAtRiskRules, listActivePresence, listAddendums, listAlertDefinitions, listAlertSubscriptions, listAllNotificationSubscriptions, listAnomalyDefinitions, listAnomalyRules, listApiKeys, listApprovalChains, listApprovalInstances, listAtRiskRules, listAttributeDefinitions, listBlackoutDates, listBulkActions, listChangeOrders, listChatChannelMembers, listChatMessages, listChatPins, listChatRoles, listChatRoomTypes, listChatRooms, listCollectionPresets, listCollectionRecordTemplates, listComments, listCronJobs, listCustomQueries, listCustomQueryCatalog, listDashboards, listDataQualityRules, listDataQualityRuns, listDeadLetters, listExternalApiEndpoints, listExternalApiSchemas, listExternalApis, listFieldGroups, listFieldWatches, listFiles, listFlowRuns, listHelpVideoPages, listHelpVideoVersions, listHelpVideos, listHierarchyConfigs, listImportDefinitionVersions, listImportDefinitions, listImportJobs, listImportTemplates, listInstanceTools, listInternalWidgetPlacements, listInternalWidgets, listIssues, listItemActions, listItemScheduledChanges, listJobRuns, listLayoutVersions, listMetricAlertRules, listMetricAlertSubscriptions, listMetricDefinitions, listMyHelpVideoUploads, listMyTasks, listNotificationSubscriptions, listNotifications, listOrphanFiles, listPages, listPdfTemplates, listPersistedQueries, listPinnedItems, listPipelineVersions, listQueueViews, listQueues, listRecordLinks, listRecordTemplates, listRegisteredExtensions, listRegisteredFlowOperations, listRegisteredFlowTriggers, listRelatedComments, listReportAlerts, listReportAnnotations, listReportFilterPresets, listReportSnapshots, listReportTemplates, listReportVersions, listReportWidgetPresets, listReports, listRequestedTasks, listRetentionPolicies, listRetentionRuns, listRolePolicies, listRoleUsers, listRoles, listRules, listSavedViews, listScheduledChanges, listScheduledReports, listScopeDimensions, listSessionRecordings, listShareLinks, listSlaRules, listStagedImports, listSubRowTemplates, listSubRows, listSupportTickets, listSyncJobs, listTasks, listTeamTasks, listThroughputCollections, listTraces, listTreePermissions, listViewSubscriptions, listVirtualCollections, listWebhookDeliveries, listWebhooks, listWidgetFeeds, listWorkspaceTemplates, listWorkspaces, markAllNotificationsRead, markChatRoomRead, markNotificationRead, markNotificationsRead, moveTreeNode, nudgeTask, omniSearch, openHelpVideoPackageImport, openHelpVideoUpload, presignFileUpload, previewContentBundle, previewHelpVideoPackageImport, previewImportJob, previewReportWidget, projectFieldConfig, proposeLayoutOps, publishHelpVideo, publishItem, queryVirtualCollection, readAccessAuditFindings, readActiveLayout, readActivity, readActivityReportSummary, readAddendum, readAiSettings, readAlertLog, readAllStateOwners, readAnomalyLog, readApiAnalyticsErrors, readApiAnalyticsSummary, readApiAnalyticsTimeseries, readApiAnalyticsTopCollections, readApiAnalyticsTopPaths, readApiKey, readApprovalBrief, readApprovalChain, readAtRiskSummary, readBackupManifest, readChatConfig, readChatDirectory, readChatPeerRead, readCollection, readCollectionLayout, readCollectionLayouts, readCollections, readConfigInventory, readCoverageGaps, readDashboard, readDashboardWidgetData, readDataQualityRun, readDbPool, readDetailLayout, readDistinctValues, readDraftPublishConfig, readErpSubmissionHistory, readExpensiveSql, readFieldChangeHistory, readFieldConfig, readFieldImpact, readFieldWatch, readFileMeta, readFileUsage, readFilesByIds, readHealthDetailed, readHelpVideo, readHelpVideoAnalytics, readHelpVideoDownloadLink, readHelpVideoDraft, readHelpVideoWalk, readHierarchyConfig, readHierarchyNodeAncestors, readHierarchyNodeChildren, readHierarchyNodes, readHierarchyTree, readImportJob, readImportProcedure, readInfrastructureSummary, readInstanceOwners, readInstanceRoster, readIntegrationHealth, readInternalWidget, readIssue, readIssueSummary, readItem, readItemLock, readItemLockConfig, readItems, readJobRegistry, readLastTouch, readLayoutAssignments, readLayoutBundle, readLayoutDrift, readLayoutGroups, readLayoutOverview, readLayoutProposals, readLayoutVersion, readMany, readMcpCapabilities, readMcpToolsConfig, readMe, readMetricAlertLog, readMyScopes, readMyWork, readNotificationCount, readNotificationSubscriptionStats, readOnlinePresence, readOwnerGroups, readPage, readPageWidgetData, readPdfTemplate, readPersistedQuery, readPickerExclusion, readPickerExclusions, readPipelineFlowMap, readPipelineReplay, readPipelineTemplate, readPipelineTemplates, readPipelineVersion, readPreflight, readQueue, readQueueCollectionStates, readQueueColumnPrefs, readQueueItems, readQueueTrends, readQueueWorkload, readReadiness, readRecordGraph, readRelationOptions, readReport, readReportAlertLog, readReportAlertsLog, readReportFilterOptions, readReportFiring, readReportSnapshot, readReportSubscription, readReportUsage, readReportWidgetData, readRequiredHelpVideos, readRevision, readRevisions, readRole, readRuntimeStats, readScopeDimensionCoverage, readSessionRecordingEvents, readSettings, readSingleton, readSlaStatusBatch, readStagedImport, readStagedImportStats, readStateOwnerGroups, readStateOwners, readStateOwnersBatch, readSupportTicket, readSyncJob, readTask, readTaskCounts, readTaskHistory, readThroughputReport, readTimeline, readTrace, readTrafficSnapshot, readTreeAncestors, readTreeChildren, readTreeConfig, readTreeDescendants, readTreeNested, readTreeNodes, readTwoFactorStatus, readUnreadNotificationCount, readUser, readUserActivity, readUserActivitySummary, readUserCard, readUserScopes, readUsers, readWorkflowBindings, readWorkflowInstance, readWorkflowInstances, readWorkspace, readWorkspaceUsage, rebuildTreePaths, recordHelpVideoProgress, registerHelpVideoPage, rehearseCreateItem, reindexSemanticSearch, rejectAddendum, rejectAiProposal, releaseItemLock, releaseQueueItem, rematerializeQueue, removeChatChannelMember, removeInstanceOwner, renderInternalWidget, renderPdfTemplate, reorderFieldGroups, reorderSubRows, reorderTreeSiblings, replaceSubRows, replayActivityEvent, replayFlow, replySupportTicket, reportClientError, requestRecordAccess, requeueStagedImport, rerecordHelpVideo, rerenderHelpVideo, resetReportCache, resolveLayoutProposal, resolveReportAlert, restoreHelpVideoVersion, restoreImportDefinitionVersion, restoreLayoutVersion, restorePipelineVersion, restoreReportVersion, retryDeadLetter, retryErpSubmission, retryWebhookDelivery, revokeApiKey, revokeShareLink, revokeToken, revokeUserToken, rollbackRevision, rotateWidgetFeedToken, runAccessAudit, runActivityReport, runActivityReportCsv, runCronJob, runDataQuality, runRetentionPolicy, runScheduledReport, runSyncJob, saveHelpVideoDraft, saveMcpToolsConfig, saveMyScopeDefaults, saveReportFilterPreset, saveReportTemplate, saveReportWidgets, saveUserScope, searchChatMessages, semanticSearch, sendBulkNotification, sendChatMessage, sendTestMail, sessionRecordingEnabled, setHelpVideoContexts, setHelpVideoRequirements, setMyDelegate, setQueueDefaultView, setReportSubscription, setSupportTicketStatus, setTranslations, setupTwoFactor, simulatePermissions, simulatePipeline, simulatePipelineImpact, startApproval, startMasquerade, startSessionRecording, startWorkflow, stopMasquerade, submitAddendum, submitFormItem, submitItemForReview, submitLayoutOps, submitToErp, subscribeFieldWatch, subscribeMetricAlert, suggestImportValidation, suggestQueueLabels, switchWorkspace, testExternalApi, testFlow, testWebhook, toggleChatPin, toggleChatReaction, togglePinnedItem, toggleReportAlert, touchRecordView, transitionWorkflow, unpublishHelpVideo, unpublishItem, unsubscribeFieldWatch, unsubscribeMetricAlert, updateAccessAudit, updateAddendum, updateAiSettings, updateAlertDefinition, updateAnomalyLogEntry, updateAnomalyRule, updateApiKey, updateApprovalChain, updateAtRiskRule, updateAttributeDefinition, updateAttributeValues, updateChatChannel, updateChatRoom, updateChatRoomType, updateCollectionLayout, updateComment, updateDataQualityRule, updateDraftPublishConfig, updateErpSubmissionStatus, updateExternalApi, updateExternalApiEndpoint, updateFieldConfig, updateFieldGroup, updateFieldWatch, updateFileMeta, updateHelpVideo, updateHierarchyConfig, updateImportDefinition, updateInternalWidget, updateIssue, updateItem, updateItemLockConfig, updateLayoutAssignments, updateLayoutUngroupedSort, updateMe, updateMetricAlertRule, updateMetricAlertSubscription, updateNotificationSubscription, updatePage, updatePdfTemplate, updatePersistedQuery, updateQueue, updateQueueSources, updateQueueView, updateRecordTemplate, updateReport, updateReportAlert, updateReportWidgetPreset, updateRetentionPolicy, updateRole, updateRolePolicy, updateRoleUiPermissions, updateRule, updateSavedView, updateScheduledReport, updateSettings, updateSingleton, updateSlaRule, updateSyncJob, updateTask, updateTreePermission, updateUser, updateVirtualCollection, updateWebhook, updateWidgetFeed, updateWorkflowBinding, updateWorkspace, validateVirtualCollectionSql, verifyTwoFactor, whichLayoutForm, withSignal };
10794
+ export { type AccessAudit, type AccessAuditFinding, type AccessAuditRun, type AccessAuditSubject, type AccessReason, type ActivityAction, type ActivityEntry, type ActivityQuery, type ActivityReportQuery, type ActivityReportRow, type ActivityReportSummary, type Addendum, type AddendumStatus, type AgentQuestion, type AgentQuestionStatus, type AgentTrigger, type AgentTriggerDelivery, type AgentTriggerEvent, type AggregateQuery, type AggregateRow, type AiChatTraceEntry, type AiCollectionSettings, type AiColumnMapping, type AiDuplicateMatch, type AiQueryFilter, type AiQueryResult, type AiReviewFinding, type AiViolation, type AlertDefinition, type AlertLogEntry, type AlertSubscription, type AnomalyDefinition, type AnomalyRule, type ApiAnalyticsBucket, type ApiAnalyticsCollection, type ApiAnalyticsPath, type ApiAnalyticsSummary, type ApiErrorLog, type ApiKey, type ApiKeyMonthlyUsage, type ApiKeyScope, type ApiKeyTraffic, type ApiKeyUsage, type ApiKeyUsageBucket, type ApiRequestLogEntry, type ApiRequestLogQuery, type ApprovalBrief, type ApprovalChain, type ApprovalChainStep, type ApprovalDecision, type ApprovalInstance, type ApprovalInstanceDetail, type ApprovalStatus, type ApprovalStepInput, type AtRiskCondition, type AtRiskOp, type AtRiskResult, type AtRiskRule, type AtRiskSummaryEntry, type AttachedFile, type AttributeDefinition, type AttributeValue, type AuthProviders, type BackgroundRun, type BatchRead, type BatchReadResult, type BatchWriteResult, type BlackoutDate, type BoolFilterOps, type BulkRowResult, type BulkWriteOutcome, type BusyJob, type CMSCollection, type CascadeFilterRule, type ChangeOrder, type ChaosWhatIfAnswer, type ChatChannel, type ChatChannelMember, type ChatDirectoryChannel, type ChatMessage, type ChatPin, type ChatReaction, type ChatRoomKind, type ChatRoomSummary, type ChatRoomType, type ChatSearchHit, type CollectionLayout, type CollectionLayoutType, type CollectionPresetSummary, type Command, type Comment, type CommentReaction, type CommentVersion, type ConfigSnapshot, type ConfigTableClassification, type ContentBundle, type ContentExportFormat, type ContentExportOptions, type CoverageGapItem, type CoverageGapOwner, type CoverageGapReport, type CpuProfileSummary, type CronJob, type CustomQuery, type CustomQueryCatalogEntry, type Dashboard, type DashboardFilter, type DashboardWidget, type DashboardWidgetData, type DashboardWidgetInput, type DashboardWidgetType, type DataQualityRule, type DataQualityRuleResult, type DataQualityRuleType, type DataQualityRun, type DataQualitySeverity, type DeadLetter, type DmvResult, type DraftPublishConfig, type DraftStatus, type DryRunReport, EDITOR_NOTE_MAX, type ErpSubmission, type ErpSubmissionStatus, type ExpensiveStatement, type ExtensionManifest, type ExternalApi, type ExternalApiEndpoint, type ExternalApiSchema, type ExternalApiSlotContext, type ExternalApiSpecImportResult, type ExternalApiTestResult, type FeedChange, type FeedPage, type FieldChangeEntry, type FieldCondition, type FieldConfig, type FieldDependencyConfig, type FieldFilter, type FieldGroup, type FieldTranslations, type FieldVisibilityRules, type FieldWatch, type FileRecord, type FileUploadResult, type FileUsageEntry, type Filter, type FilterCheck, type FilterProblem, type FlowReplayResult, type FlowRun, type FlowTestStep, type FormFieldDescriptor, type FormFieldRelation, type FormFieldStateRow, type FormGroupDescriptor, type FormImageAnswer, type FormLockCondition, type FormSchema, type FormStateAnswer, type FormStateQuery, type FormValidationRule, type FormVisibilityRule, GROUP_PATCH_KEYS, type GlobalSearchPerson, type GlobalSearchRecord, type GlobalSearchResults, type GraphQLResponse, type GroupPatch, type GroupRow, type HealthDetailed, type HelpVideo, type HelpVideoClick, type HelpVideoContext, type HelpVideoDownloadUrls, type HelpVideoFinalizedUpload, type HelpVideoProgress, type HelpVideoUploadSession, type HelpVideoVersion, type HelpVideoVisibility, type HelpVideoWalkStep, type HelpVideoWhatsNew, type HierarchyConfigDef, type HierarchyFlatNode, type HierarchyLevelDef, type HierarchyNestedNode, type IDFilterOps, type ISODate, type ImportDefinition, type ImportJob, type ImportParseResponse, type ImportPreview, type ImportPreviewDiff, type ImportTemplateSummary, type InfrastructureSummaryTool, type InstanceOwner, type InstanceToolEntry, type IntegrationApiHealth, type InternalWidget, type Issue, type IssueSeverity, type IssueStatus, type IssueSummary, type ItemLock, type ItemWriteMeta, type JobLogLine, type JobRegistryCron, type JobRun, LAYOUT_PATCH_KEYS, type LastTouch, type LayoutAssignment, type LayoutBundle, type LayoutDescription, type LayoutFieldExplanation, type LayoutGroup, type LayoutLintAnswer, type LayoutOp, type LayoutOverviewRow, type LayoutPatch, type LayoutPickReason, type LayoutProposal, type LayoutRow, type LayoutVersion, type ListResponse, type MailLogEntry, type ManagedUser, type McpCapabilities, type McpToolsConfig, type MetricAlertRule, type MetricAlertSubscription, type MetricDefinition, type MyJob, type MyTask, type MyWorkOwnedEntry, type MyWorkSla, type MyWorkSummary, NOTIFICATIONS_CHANNEL, type NamedMcpToolConfig, type NivaroClient, type NivaroClientOptions, NivaroError, type NivaroExtensionPlugin, type NivaroRealtime, type NivaroRequestInfo, type NivaroResponseInfo, type NivaroRetryOptions, type NivaroRuntime, type NotificationFilter, type NotificationHistoryEntry, type NotificationItem, type NotificationPage, type NotificationSubscription, type NumberFilterOps, type OmniSearchHit, type OnlinePresenceConfig, type OnlinePresenceUser, type OwnerHistoryEntry, type OwnerSeat, PLACEMENT_PATCH_KEYS, type Page, type PageLayout, type PageSlotKey, type PageWidget, type PdfTemplate, type PermissionSimulation, type PersistedQuery, type PickerExclusionStatus, type PipelineFlowEdge, type PipelineFlowState, type PipelineImpactResult, type PipelineOutline, type PipelineOwnerGroup, type PipelineOwnerGroupUser, type PipelineSimulation, type PipelineState, type PipelineVersionEntry, type PlacementKey, type PlacementPatch, type PlacementRow, type PluginSlots, type Policy, type PoolStats, type PreflightCheck, type PreflightReport, type PreflightSeverity, type PresenceClient, type PresenceOptions, type PresenceSession, type PresenceSessionInfo, type PresenceViewer, type ProjectedPlacement, type PromotionApplyResult, type PromotionPreview, type ProposedField, type ProposedSchemaChange, type Query, type Queue, type QueueColumnPrefs, type QueueCondition, type QueueDetail, type QueueDisplayConfig, type QueueItem, type QueueItemsResult, type QueueOwner, type QueueRowClickMode, type QueueScope, type QueueSource, type QueueSourceType, type QueueStats, type QueueTrendPoint, type QueueView, type QueueViewKind, type QueueWorkloadRow, READ_MANY_MAX, REQUEST_ID_HEADER, type ReadyReport, type RealtimeChange, type RealtimeEvent, type RealtimeToken, type RecordGraphEdge, type RecordGraphNode, type RecordLink, type RecordLinkType, type RecordTemplate, type RecordViewRecap, type RegisteredAction, type RelatedCommentEntry, type RelationFilter, type RelationOption, type Reminder, type ReportAlert, type ReportAlertCondition, type ReportAlertLogEntry, type ReportAnnotation, type ReportColumnFormat, type ReportDateRange, type ReportDef, type ReportEntityFilter, type ReportFilterPreset, type ReportQueryColumn, type ReportQueryWidgetConfig, type ReportSnapshotEntry, type ReportSubscription, type ReportTemplateEntry, type ReportVersionEntry, type ReportWidget, type ReportWidgetConfig, type ReportWidgetData, type ReportWidgetPreset, type ReportWidgetType, type RequestTrace, type ResolvedOwner, type RetentionPolicy, type RetentionRun, type RetentionRunResult, type Revision, type Role, type Rule, type RuntimeStats, type SavedSearch, type SavedView, type ScheduledChange, type ScheduledReport, type SchemaChoice, type SchemaFieldType, type SchemaProposal, type ScopeDimension, type ScopeDimensionInfo, type SemanticSearchMatch, type SentNotificationGroup, type SessionRecording, type SessionReplayMasking, type ShareLink, type SlaBatchStatus, type SlaRule, type SlaStatus, type StagedImportRun, type StagedImportStats, type StringFilterOps, type SubRow, type SubRowTemplate, type SupportTicket, type SupportTicketDetail, type SupportTicketStatus, type SyncJob, type Task, type TaskAgent, type TaskDoneWhenRule, type TaskPriority, type TaskStatus, type TimelineEvent, type TraceSpan, type TrafficSnapshot, type TrafficSnapshotEntity, type TrashEntry, type TreeFlatNode, type TreeNestedNode, type TreeNodeConfig, type TreePermission, type TreePermissionAction, type UUID, type UpdateDryRunReport, type UserActivityEntry, type UserActivitySummary, type UserScopesInfo, type ViewSubscription, type VirtualCollection, type Webhook, type WebhookDelivery, type WhichLayoutForm, type WidgetDrillBody, type WidgetDrillRows, type WidgetFeed, type WorkflowBinding, type WorkflowHistoryEntry, type WorkflowInstance, type WorkflowInstanceData, type WorkflowState, type WorkflowTransition, type Workspace, type WorkspaceQuotas, type WorkspaceTemplate, type WorkspaceUsage, _and, _contains, _ends_with, _eq, _gt, _gte, _in, _lt, _lte, _ncontains, _neq, _nin, _nnull, _none, _null, _or, _some, _starts_with, abandonHelpVideoUpload, acknowledgeNotification, acquireItemLock, activateLayout, addChatChannelMember, addInstanceOwner, addSubRow, aggregateItems, aiBrief, aiBuildReport, aiChat, aiCheckDuplicates, aiGenerate, aiMapColumns, aiQuery, aiReportFilters, aiReview, aiSummarize, aiValidate, answerAgentQuestion, appendSessionRecordingEvents, applyContentBundle, applyHelpVideoPackageImport, applyRecordTemplate, applySubRowTemplate, approveAddendum, approveAiProposal, archiveHelpVideo, archiveReadNotifications, asc, askHuman, attachFileToRecord, backupExportPath, batchItems, batchPickerExclusionStatus, bulkDeleteItems, bulkNotificationAction, bulkPickerExclusion, bulkRestoreTrash, bulkTransitionItems, bulkUpdateItems, bulkWriteItems, callExternalApi, callExternalApiEndpoint, callInstanceTool, cancelAgentQuestion, cancelJobRun, cancelScheduledChange, cancelStagedImport, captureCpuProfile, cascadeFieldDependencies, chaosWhatIf, checkBlackoutDate, checkItemFilter, claimQueueItem, claimSupportTicket, claimTask, clearTraces, cloneItem, cloneLayout, cloneReport, compareConfigSnapshot, completeTask, copyReportWidget, createAccessAudit, createActivityEntry, createAddendum, createAlertDefinition, createAlertSubscription, createAnomalyRule, createApiKey, createApprovalChain, createAtRiskRule, createAttributeDefinition, createBlackoutDate, createChatChannel, createChatRoomType, createCollectionLayout, createComment, createDashboard, createDashboardWidget, createDataQualityRule, createExternalApi, createExternalApiEndpoint, createFieldGroup, createFieldWatch, createGroupDm, createHelpVideo, createHierarchyConfig, createImportDefinition, createImportJob, createImportJobFromUrl, createInternalWidget, createIssue, createItem, createMetricAlertRule, createNivaro, createNotification, createNotificationSubscription, createPage, createPdfTemplate, createPersistedQuery, createPresence, createQueue, createQueueView, createRealtime, createRecordLink, createRecordTemplate, createReminder, createReport, createReportAlert, createReportAnnotation, createReportFromTemplate, createReportSnapshot, createReportWidgetPreset, createRetentionPolicy, createRole, createRolePolicy, createRule, createSavedSearch, createSavedView, createScheduledChange, createScheduledReport, createShareLink, createSlaRule, createSubRowTemplate, createSyncJob, createTask, createTreePermission, createUser, createViewSubscription, createVirtualCollection, createWebhook, createWidgetFeed, createWorkspace, createWorkspaceTemplate, decideApproval, deleteAccessAudit, deleteAddendum, deleteAlertDefinition, deleteAlertSubscription, deleteAnomalyRule, deleteApiKey, deleteApprovalChain, deleteAtRiskRule, deleteAttributeDefinition, deleteBlackoutDate, deleteChatMessage, deleteCollectionLayout, deleteComment, deleteDashboard, deleteDashboardWidget, deleteDataQualityRule, deleteExternalApi, deleteExternalApiEndpoint, deleteExternalApiSchema, deleteFieldGroup, deleteFieldTranslations, deleteFieldWatch, deleteFile, deleteHierarchyConfig, deleteImportJob, deleteInternalWidget, deleteIssue, deleteItem, deleteMetricAlertRule, deleteNotification, deleteNotificationSubscription, deletePage, deletePdfTemplate, deletePersistedQuery, deleteQueue, deleteQueueView, deleteRecordLink, deleteRecordTemplate, deleteReminder, deleteReport, deleteReportAlert, deleteReportAnnotation, deleteReportFilterPreset, deleteReportSnapshot, deleteReportTemplate, deleteReportWidgetPreset, deleteRetentionPolicy, deleteRole, deleteRolePolicy, deleteRule, deleteSavedSearch, deleteSavedView, deleteScheduledReport, deleteSessionRecording, deleteSlaRule, deleteSubRow, deleteSubRowTemplate, deleteSyncJob, deleteTask, deleteTreePermission, deleteUser, deleteViewSubscription, deleteVirtualCollection, deleteWebhook, deleteWidgetFeed, deleteWorkspace, deleteWorkspaceTemplate, deployImportProcedure, desc, describeLayoutForm, diffLayoutVersion, disableTwoFactor, discardHelpVideoPackageImport, drillDashboardWidgetRows, drillReportRow, drillReportWidgetRows, editChatMessage, endSessionRecording, errorBodyMessage, estimateBackgroundRun, evaluateAlerts, evaluateAtRisk, evaluateFieldDefaults, evaluateFieldLock, evaluateFieldRules, evaluateFieldVisibility, excludeFromPicker, excludeFromPickers, executeBulkAction, executeCustomQuery, executeImportTemplate, executeItemAction, executeScheduledChange, explainLayout, explainLayoutField, explainRecordAccess, explainReportTrend, exportBlueprint, exportConfigSnapshot, exportContent, exportContentBundle, exportHelpVideoPackage, exportSchemaSnapshot, fetchFormSchema, fileDownloadPath, fileTransformPath, finalizeHelpVideoUpload, generateToken, generateUserToken, getAlertDefinition, getAttributeValues, getBrunoCollection, getCommentHistory, getExternalApi, getExternalApiEndpoint, getFieldTranslations, getFlowRun, getLocales, getOpenApi, getPickerExclusionStatus, getPostmanCollection, getPresence, getRetentionPolicy, getSlaRule, getSlaStatus, getTranslations, getTypes, getWebhook, globalSearch, heartbeatItemLock, helpVideosFor, importExternalApiSpec, importSchemaSnapshot, includeInPicker, includeInPickers, installBlueprint, installCollectionPreset, invokeInternalWidgetAction, isNivaroError, isPageSlot, joinChatRoom, leaveChatRoom, listAccessAuditRuns, listAccessAudits, listActiveAtRiskRules, listActivePresence, listActivityActions, listAddendums, listAgentTasks, listAgentTriggerDeliveries, listAgentTriggers, listAlertDefinitions, listAlertSubscriptions, listAllNotificationSubscriptions, listAnomalyDefinitions, listAnomalyRules, listApiKeys, listApiRequests, listApprovalChains, listApprovalInstances, listAskedQuestions, listAtRiskRules, listAttributeDefinitions, listBackgroundRuns, listBlackoutDates, listBulkActions, listChangeOrders, listChatChannelMembers, listChatMessages, listChatPins, listChatRoles, listChatRoomTypes, listChatRooms, listCollectionPresets, listCollectionRecordTemplates, listComments, listCronJobs, listCustomQueries, listCustomQueryCatalog, listDashboards, listDataQualityRules, listDataQualityRuns, listDeadLetters, listExternalApiEndpoints, listExternalApiSchemas, listExternalApis, listFieldGroups, listFieldWatches, listFiles, listFlowRuns, listHelpVideoPages, listHelpVideoVersions, listHelpVideos, listHierarchyConfigs, listImportDefinitionVersions, listImportDefinitions, listImportJobs, listImportTemplates, listInstanceTools, listInternalWidgetPlacements, listInternalWidgets, listIssues, listItemActions, listItemScheduledChanges, listJobRuns, listLayoutVersions, listMailLog, listMetricAlertRules, listMetricAlertSubscriptions, listMetricDefinitions, listMyAgentQuestions, listMyHelpVideoUploads, listMyJobs, listMyTasks, listNotificationSubscriptions, listNotifications, listOrphanFiles, listPages, listPdfTemplates, listPersistedQueries, listPinnedItems, listPipelineVersions, listQueueViews, listQueues, listRecordLinks, listRecordMail, listRecordTemplates, listRegisteredExtensions, listRegisteredFlowOperations, listRegisteredFlowTriggers, listRelatedComments, listReminders, listReportAlerts, listReportAnnotations, listReportFilterPresets, listReportSnapshots, listReportTemplates, listReportVersions, listReportWidgetPresets, listReports, listRequestedTasks, listRetentionPolicies, listRetentionRuns, listRolePolicies, listRoleUsers, listRoles, listRules, listSavedSearches, listSavedViews, listScheduledChanges, listScheduledReports, listScopeDimensions, listSentNotifications, listSessionRecordings, listShareLinks, listSlaRules, listStagedImports, listSubRowTemplates, listSubRows, listSupportTickets, listSyncJobs, listTaskAgents, listTasks, listTeamTasks, listThroughputCollections, listTraces, listTrash, listTreePermissions, listViewSubscriptions, listVirtualCollections, listWebhookDeliveries, listWebhooks, listWidgetFeeds, listWorkspaceTemplates, listWorkspaces, logExport, logout, logoutAll, markAllNotificationsRead, markChatRoomRead, markNotificationRead, markNotificationsRead, moveTreeNode, nudgeTask, omniSearch, openHelpVideoPackageImport, openHelpVideoUpload, parseRealtimeChanges, presignFileUpload, previewContentBundle, previewHelpVideoPackageImport, previewImportJob, previewReportWidget, projectFieldConfig, proposeLayoutOps, proposeSchemaChange, publishHelpVideo, publishItem, purgeTrashItem, queryVirtualCollection, queueBulkWriteItems, readAccessAuditFindings, readActiveLayout, readActivity, readActivityEntry, readActivityReportSummary, readAddendum, readAgentQuestion, readAiSettings, readAlertLog, readAllStateOwners, readAnomalyLog, readApiAnalyticsByKey, readApiAnalyticsErrors, readApiAnalyticsSummary, readApiAnalyticsTimeseries, readApiAnalyticsTopCollections, readApiAnalyticsTopPaths, readApiKey, readApiKeyMonthlyUsage, readApiKeyUsage, readApprovalBrief, readApprovalChain, readAtRiskSummary, readAuthProviders, readBackgroundRun, readBackgroundRunResult, readBackupManifest, readBulkRun, readBusyJobs, readChanges, readChatConfig, readChatDirectory, readChatPeerRead, readCollection, readCollectionLayout, readCollectionLayouts, readCollections, readCommentCounts, readConfigInventory, readCoverageGaps, readDashboard, readDashboardWidgetData, readDataQualityRun, readDbPool, readDetailLayout, readDistinctValues, readDraftPublishConfig, readErpSubmissionHistory, readExpensiveSql, readFieldChangeHistory, readFieldConfig, readFieldImpact, readFieldWatch, readFileMeta, readFileUsage, readFilesByIds, readFormState, readHealthDetailed, readHelpVideo, readHelpVideoAnalytics, readHelpVideoDownloadLink, readHelpVideoDraft, readHelpVideoWalk, readHierarchyConfig, readHierarchyNodeAncestors, readHierarchyNodeChildren, readHierarchyNodes, readHierarchyTree, readImportJob, readImportProcedure, readInfrastructureSummary, readInstanceOwners, readInstanceRoster, readIntegrationHealth, readInternalWidget, readIssue, readIssueSummary, readItem, readItemBySlug, readItemDistinct, readItemLock, readItemLockConfig, readItems, readJobRegistry, readJobRunLog, readLastTouch, readLatestRevisionId, readLayoutAssignments, readLayoutBundle, readLayoutDrift, readLayoutGroups, readLayoutLint, readLayoutOverview, readLayoutProposals, readLayoutVersion, readMailLogEntry, readMailStats, readMany, readMcpCapabilities, readMcpToolsConfig, readMe, readMetricAlertLog, readMyOwnerSeats, readMyScopes, readMyWork, readNotificationCount, readNotificationHistory, readNotificationSubscriptionStats, readOnlinePresence, readOwnerGroups, readOwnerHistory, readPage, readPageWidgetData, readPdfTemplate, readPersistedQuery, readPickerExclusion, readPickerExclusions, readPipelineFlowMap, readPipelineOutline, readPipelineReplay, readPipelineTemplate, readPipelineTemplates, readPipelineVersion, readPreflight, readQueue, readQueueCollectionStates, readQueueColumnPrefs, readQueueItems, readQueueTrends, readQueueWorkload, readReadiness, readRecordDeletion, readRecordGraph, readRecordMute, readRelationOptions, readReport, readReportAlertLog, readReportAlertsLog, readReportFilterOptions, readReportFiring, readReportSnapshot, readReportSubscription, readReportUsage, readReportWidgetData, readRequiredHelpVideos, readRevision, readRevisions, readRole, readRuntimeStats, readSchemaProposal, readScopeDimensionCoverage, readSearchCounts, readSearchRecords, readSessionRecordingEvents, readSettings, readSingleton, readSlaStatusBatch, readStagedImport, readStagedImportStats, readStateOwnerGroups, readStateOwners, readStateOwnersBatch, readSupportTicket, readSyncJob, readTask, readTaskCounts, readTaskHistory, readThroughputReport, readTimeline, readTrace, readTrafficSnapshot, readTreeAncestors, readTreeChildren, readTreeConfig, readTreeDescendants, readTreeNested, readTreeNodes, readTwoFactorStatus, readUnreadNotificationCount, readUser, readUserActivity, readUserActivitySummary, readUserCard, readUserScopes, readUsers, readWorkflowBindings, readWorkflowInstance, readWorkflowInstances, readWorkspace, readWorkspaceUsage, readWsToken, rebuildTreePaths, recordHelpVideoProgress, registerHelpVideoPage, rehearseCreateItem, rehearseUpdateItem, reindexSemanticSearch, rejectAddendum, rejectAiProposal, releaseItemLock, releaseQueueItem, rematerializeQueue, removeChatChannelMember, removeInstanceOwner, renderFormImage, renderInternalWidget, renderPdfTemplate, reorderFieldGroups, reorderSubRows, reorderTreeSiblings, replaceSubRows, replayActivityEvent, replayFlow, replySupportTicket, reportClientError, requestRecordAccess, requeueStagedImport, rerecordHelpVideo, rerenderHelpVideo, resendMail, resetReportCache, resolveLayoutProposal, resolveReportAlert, restoreHelpVideoVersion, restoreImportDefinitionVersion, restoreLayoutVersion, restorePipelineVersion, restoreReportVersion, restoreTrashItem, retryDeadLetter, retryErpSubmission, retryWebhookDelivery, revokeApiKey, revokeShareLink, revokeToken, revokeUserToken, rollbackRevision, rotateWidgetFeedToken, runAccessAudit, runActivityReport, runActivityReportCsv, runCronJob, runDataQuality, runRetentionPolicy, runScheduledReport, runSyncJob, saveHelpVideoDraft, saveMcpToolsConfig, saveMyScopeDefaults, saveReportFilterPreset, saveReportTemplate, saveReportWidgets, saveUserScope, searchChatMessages, semanticSearch, sendBulkNotification, sendChatMessage, sendTestMail, sessionRecordingEnabled, setHelpVideoContexts, setHelpVideoRequirements, setMyDelegate, setQueueDefaultView, setReportSubscription, setSupportTicketStatus, setTranslations, setupTwoFactor, simulatePermissions, simulatePipeline, simulatePipelineImpact, snoozeNotification, startApproval, startBackgroundRun, startMasquerade, startSessionRecording, startWorkflow, stopMasquerade, submitAddendum, submitFormItem, submitItemForReview, submitLayoutOps, submitToErp, subscribeFieldWatch, subscribeMetricAlert, suggestImportValidation, suggestQueueLabels, switchWorkspace, testExternalApi, testFlow, testWebhook, toggleChatPin, toggleChatReaction, toggleCommentReaction, toggleEntryReaction, togglePinnedItem, toggleRecordMute, toggleReportAlert, touchRecordView, transitionWorkflow, unpublishHelpVideo, unpublishItem, unsubscribeFieldWatch, unsubscribeMetricAlert, updateAccessAudit, updateAddendum, updateAiSettings, updateAlertDefinition, updateAnomalyLogEntry, updateAnomalyRule, updateApiKey, updateApprovalChain, updateAtRiskRule, updateAttributeDefinition, updateAttributeValues, updateChatChannel, updateChatRoom, updateChatRoomType, updateCollectionLayout, updateComment, updateDashboard, updateDashboardWidget, updateDataQualityRule, updateDraftPublishConfig, updateErpSubmissionStatus, updateExternalApi, updateExternalApiEndpoint, updateFieldConfig, updateFieldGroup, updateFieldWatch, updateFileMeta, updateHelpVideo, updateHierarchyConfig, updateImportDefinition, updateInternalWidget, updateIssue, updateItem, updateItemLockConfig, updateLayoutAssignments, updateLayoutUngroupedSort, updateMe, updateMetricAlertRule, updateMetricAlertSubscription, updateNotificationSubscription, updatePage, updatePdfTemplate, updatePersistedQuery, updateQueue, updateQueueSources, updateQueueView, updateRecordTemplate, updateReminder, updateReport, updateReportAlert, updateReportWidgetPreset, updateRetentionPolicy, updateRole, updateRolePolicy, updateRoleUiPermissions, updateRule, updateSavedView, updateScheduledReport, updateSettings, updateSingleton, updateSlaRule, updateSyncJob, updateTask, updateTreePermission, updateUser, updateVirtualCollection, updateWebhook, updateWidgetFeed, updateWorkflowBinding, updateWorkspace, validateVirtualCollectionSql, verifyTwoFactor, whichLayoutForm, withSignal };