@graph8/sdk 0.303.0 → 0.308.1

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.
@@ -1,7 +1,7 @@
1
1
  /* Generated by sdk/js/scripts/generate-agent-docs.ts from developer-contract/openapi.json. Regenerated on every build. */
2
2
 
3
3
  /**
4
- * Types for `g8.api.objects` (Objects): 24 operations.
4
+ * Types for `g8.api.objects` (Objects): 41 operations.
5
5
  *
6
6
  * For reading. In code, import from the package instead:
7
7
  * import type { ApiInput, ApiOutput, G8Contract } from "@graph8/sdk";
@@ -17,25 +17,42 @@ export interface ObjectsMembers {
17
17
  archiveObject: "archive_object_objects__object_slug__delete";
18
18
  archiveObjectRecord: "archive_object_record_objects__object_slug__records__record_id__delete";
19
19
  bulkUpdateObjectRecords: "bulk_update_object_records_objects__object_slug__records_bulk_patch";
20
+ commitObjectCsvImport: "commit_object_csv_import_objects__object_slug__imports_csv_drafts__draft_id__commit_post";
20
21
  createAttribute: "create_attribute_objects__object_slug__attributes_post";
21
22
  createObject: "create_object_objects_post";
23
+ createObjectCsvImport: "create_object_csv_import_objects__object_slug__imports_csv_drafts_post";
22
24
  createObjectRecord: "create_object_record_objects__object_slug__records_post";
23
25
  createObjectRelationship: "create_object_relationship_objects__object_slug__records__record_id__relationships_post";
26
+ createObjectView: "create_object_view_objects__object_slug__views_post";
27
+ deleteObjectCsvImport: "delete_object_csv_import_objects__object_slug__imports_csv_drafts__draft_id__delete";
24
28
  deleteObjectRelationship: "delete_object_relationship_objects__object_slug__records__record_id__relationships__relationship_id__delete";
29
+ deleteObjectView: "delete_object_view_objects__object_slug__views__view_id__delete";
30
+ downloadObjectCsvImportErrors: "download_object_csv_import_errors_objects__object_slug__imports_csv_drafts__draft_id__errors_get";
31
+ exportObjectRecords: "export_object_records_objects__object_slug__exports_post";
25
32
  getObject: "get_object_objects__object_slug__get";
33
+ getObjectCsvImport: "get_object_csv_import_objects__object_slug__imports_csv_drafts__draft_id__get";
26
34
  getObjectRecord: "get_object_record_objects__object_slug__records__record_id__get";
27
35
  getObjectRecordChanges: "get_object_record_changes_objects__object_slug__records__record_id__changes_get";
28
36
  getObjectRecordHistory: "get_object_record_history_objects__object_slug__records__record_id__history_get";
29
37
  getObjectRelationshipDefinitions: "get_object_relationship_definitions_objects__object_slug__relationships_get";
30
38
  getObjectRelationships: "get_object_relationships_objects__object_slug__records__record_id__relationships_get";
39
+ inspectObjectCsvImport: "inspect_object_csv_import_objects__object_slug__imports_csv_inspect_post";
31
40
  listObjectAttributes: "list_object_attributes_objects__object_slug__attributes_get";
41
+ listObjectCsvImports: "list_object_csv_imports_objects__object_slug__imports_csv_drafts_get";
32
42
  listObjectRecords: "list_object_records_objects__object_slug__records_get";
43
+ listObjectViews: "list_object_views_objects__object_slug__views_get";
33
44
  listObjects: "list_objects_objects_get";
34
45
  mergeObjectRecords: "merge_object_records_objects__object_slug__records_merge_post";
46
+ previewObjectCsvImport: "preview_object_csv_import_objects__object_slug__imports_csv_drafts__draft_id__preview_post";
47
+ queryObjectBoardGroups: "query_object_board_groups_objects__object_slug__views_board_groups_post";
48
+ queryObjectBoardRecords: "query_object_board_records_objects__object_slug__views_board_records_post";
35
49
  restoreObjectRecord: "restore_object_record_objects__object_slug__records__record_id__restore_post";
50
+ setDefaultObjectView: "set_default_object_view_objects__object_slug__views_default_put";
36
51
  updateAttribute: "update_attribute_objects__object_slug__attributes__attr_slug__patch";
37
52
  updateObject: "update_object_objects__object_slug__patch";
53
+ updateObjectCsvImport: "update_object_csv_import_objects__object_slug__imports_csv_drafts__draft_id__put";
38
54
  updateObjectRecord: "update_object_record_objects__object_slug__records__record_id__patch";
55
+ updateObjectView: "update_object_view_objects__object_slug__views__view_id__put";
39
56
  upsertObjectRecord: "upsert_object_record_objects__object_slug__records_upsert_post";
40
57
  }
41
58
 
@@ -108,6 +125,24 @@ export interface ObjectsOperations {
108
125
  };
109
126
  output: ApiResponse_RecordBulkUpdateResponse_;
110
127
  };
128
+ /**
129
+ * POST /objects/{object_slug}/imports/csv/drafts/{draft_id}/commit
130
+ * Commit Object Csv Import
131
+ * tier: write · scope: objects:write
132
+ */
133
+ commit_object_csv_import_objects__object_slug__imports_csv_drafts__draft_id__commit_post: {
134
+ input: {
135
+ path: {
136
+ object_slug: string;
137
+ draft_id: string;
138
+ };
139
+ headers?: {
140
+ "X-Target-Org-Id"?: string | null;
141
+ };
142
+ body: ObjectImportCommit;
143
+ };
144
+ output: ApiResponse_ObjectCsvReceipt_;
145
+ };
111
146
  /**
112
147
  * POST /objects/{object_slug}/attributes
113
148
  * Create Attribute
@@ -139,6 +174,23 @@ export interface ObjectsOperations {
139
174
  };
140
175
  output: ApiResponse_ObjectDefinitionResponse_;
141
176
  };
177
+ /**
178
+ * POST /objects/{object_slug}/imports/csv/drafts
179
+ * Create Object Csv Import
180
+ * tier: write · scope: objects:write
181
+ */
182
+ create_object_csv_import_objects__object_slug__imports_csv_drafts_post: {
183
+ input: {
184
+ path: {
185
+ object_slug: string;
186
+ };
187
+ headers?: {
188
+ "X-Target-Org-Id"?: string | null;
189
+ };
190
+ body: ObjectImportCreate;
191
+ };
192
+ output: ApiResponse_ObjectImportDetail_;
193
+ };
142
194
  /**
143
195
  * POST /objects/{object_slug}/records
144
196
  * Create Object Record
@@ -174,6 +226,43 @@ export interface ObjectsOperations {
174
226
  };
175
227
  output: ApiResponse_RelationshipResponse_;
176
228
  };
229
+ /**
230
+ * POST /objects/{object_slug}/views
231
+ * Create Object View
232
+ * tier: write · scope: objects:write
233
+ */
234
+ create_object_view_objects__object_slug__views_post: {
235
+ input: {
236
+ path: {
237
+ object_slug: string;
238
+ };
239
+ headers?: {
240
+ "X-Target-Org-Id"?: string | null;
241
+ };
242
+ body: ObjectViewCreate;
243
+ };
244
+ output: ApiResponse_SavedViewResponse_;
245
+ };
246
+ /**
247
+ * DELETE /objects/{object_slug}/imports/csv/drafts/{draft_id}
248
+ * Delete Object Csv Import
249
+ * tier: destructive · scope: objects:write
250
+ */
251
+ delete_object_csv_import_objects__object_slug__imports_csv_drafts__draft_id__delete: {
252
+ input: {
253
+ path: {
254
+ object_slug: string;
255
+ draft_id: string;
256
+ };
257
+ query: {
258
+ revision: number;
259
+ };
260
+ headers?: {
261
+ "X-Target-Org-Id"?: string | null;
262
+ };
263
+ };
264
+ output: ApiResponse_dict_;
265
+ };
177
266
  /**
178
267
  * DELETE /objects/{object_slug}/records/{record_id}/relationships/{relationship_id}
179
268
  * Delete Object Relationship
@@ -193,6 +282,57 @@ export interface ObjectsOperations {
193
282
  };
194
283
  output: ApiResponse_RelationshipResponse_;
195
284
  };
285
+ /**
286
+ * DELETE /objects/{object_slug}/views/{view_id}
287
+ * Delete Object View
288
+ * tier: destructive · scope: objects:delete
289
+ */
290
+ delete_object_view_objects__object_slug__views__view_id__delete: {
291
+ input: {
292
+ path: {
293
+ object_slug: string;
294
+ view_id: string;
295
+ };
296
+ headers?: {
297
+ "X-Target-Org-Id"?: string | null;
298
+ };
299
+ };
300
+ output: ApiResponse_NoneType_;
301
+ };
302
+ /**
303
+ * GET /objects/{object_slug}/imports/csv/drafts/{draft_id}/errors
304
+ * Download Object Csv Import Errors
305
+ * tier: read · scope: objects:write
306
+ */
307
+ download_object_csv_import_errors_objects__object_slug__imports_csv_drafts__draft_id__errors_get: {
308
+ input: {
309
+ path: {
310
+ object_slug: string;
311
+ draft_id: string;
312
+ };
313
+ headers?: {
314
+ "X-Target-Org-Id"?: string | null;
315
+ };
316
+ };
317
+ output: unknown;
318
+ };
319
+ /**
320
+ * POST /objects/{object_slug}/exports
321
+ * Export Object Records
322
+ * tier: write · scope: objects:export
323
+ */
324
+ export_object_records_objects__object_slug__exports_post: {
325
+ input: {
326
+ path: {
327
+ object_slug: string;
328
+ };
329
+ headers?: {
330
+ "X-Target-Org-Id"?: string | null;
331
+ };
332
+ body: ObjectExportRequest;
333
+ };
334
+ output: string;
335
+ };
196
336
  /**
197
337
  * GET /objects/{object_slug}
198
338
  * Get Object
@@ -209,6 +349,23 @@ export interface ObjectsOperations {
209
349
  };
210
350
  output: ApiResponse_ObjectDefinitionResponse_;
211
351
  };
352
+ /**
353
+ * GET /objects/{object_slug}/imports/csv/drafts/{draft_id}
354
+ * Get Object Csv Import
355
+ * tier: read · scope: objects:write
356
+ */
357
+ get_object_csv_import_objects__object_slug__imports_csv_drafts__draft_id__get: {
358
+ input: {
359
+ path: {
360
+ object_slug: string;
361
+ draft_id: string;
362
+ };
363
+ headers?: {
364
+ "X-Target-Org-Id"?: string | null;
365
+ };
366
+ };
367
+ output: ApiResponse_ObjectImportDetail_;
368
+ };
212
369
  /**
213
370
  * GET /objects/{object_slug}/records/{record_id}
214
371
  * Get Object Record
@@ -309,6 +466,23 @@ export interface ObjectsOperations {
309
466
  };
310
467
  output: ApiResponse_RecordRelationshipsResponse_;
311
468
  };
469
+ /**
470
+ * POST /objects/{object_slug}/imports/csv/inspect
471
+ * Inspect Object Csv Import
472
+ * tier: write · scope: objects:write
473
+ */
474
+ inspect_object_csv_import_objects__object_slug__imports_csv_inspect_post: {
475
+ input: {
476
+ path: {
477
+ object_slug: string;
478
+ };
479
+ headers?: {
480
+ "X-Target-Org-Id"?: string | null;
481
+ };
482
+ body: ObjectCsvInspect;
483
+ };
484
+ output: ApiResponse_ObjectCsvInspection_;
485
+ };
312
486
  /**
313
487
  * GET /objects/{object_slug}/attributes
314
488
  * List Object Attributes
@@ -328,6 +502,26 @@ export interface ObjectsOperations {
328
502
  };
329
503
  output: ApiResponse_list_AttributeDefinitionResponse__;
330
504
  };
505
+ /**
506
+ * GET /objects/{object_slug}/imports/csv/drafts
507
+ * List Object Csv Imports
508
+ * tier: read · scope: objects:write
509
+ */
510
+ list_object_csv_imports_objects__object_slug__imports_csv_drafts_get: {
511
+ input: {
512
+ path: {
513
+ object_slug: string;
514
+ };
515
+ query?: {
516
+ limit?: number;
517
+ offset?: number;
518
+ };
519
+ headers?: {
520
+ "X-Target-Org-Id"?: string | null;
521
+ };
522
+ };
523
+ output: ApiResponse_list_ObjectImportSummary__;
524
+ };
331
525
  /**
332
526
  * GET /objects/{object_slug}/records
333
527
  * List Object Records
@@ -352,6 +546,22 @@ export interface ObjectsOperations {
352
546
  };
353
547
  output: ApiResponse_list_ObjectRecordResponse__;
354
548
  };
549
+ /**
550
+ * GET /objects/{object_slug}/views
551
+ * List Object Views
552
+ * tier: read · scope: objects:read
553
+ */
554
+ list_object_views_objects__object_slug__views_get: {
555
+ input: {
556
+ path: {
557
+ object_slug: string;
558
+ };
559
+ headers?: {
560
+ "X-Target-Org-Id"?: string | null;
561
+ };
562
+ };
563
+ output: ApiResponse_list_SavedViewResponse__;
564
+ };
355
565
  /**
356
566
  * GET /objects
357
567
  * List Objects
@@ -385,6 +595,58 @@ export interface ObjectsOperations {
385
595
  };
386
596
  output: ApiResponse_RecordMergeResponse_;
387
597
  };
598
+ /**
599
+ * POST /objects/{object_slug}/imports/csv/drafts/{draft_id}/preview
600
+ * Preview Object Csv Import
601
+ * tier: write · scope: objects:write
602
+ */
603
+ preview_object_csv_import_objects__object_slug__imports_csv_drafts__draft_id__preview_post: {
604
+ input: {
605
+ path: {
606
+ object_slug: string;
607
+ draft_id: string;
608
+ };
609
+ headers?: {
610
+ "X-Target-Org-Id"?: string | null;
611
+ };
612
+ body: ImportPage;
613
+ };
614
+ output: ApiResponse_ObjectCsvPreview_;
615
+ };
616
+ /**
617
+ * POST /objects/{object_slug}/views/board/groups
618
+ * Query Object Board Groups
619
+ * tier: write · scope: objects:read
620
+ */
621
+ query_object_board_groups_objects__object_slug__views_board_groups_post: {
622
+ input: {
623
+ path: {
624
+ object_slug: string;
625
+ };
626
+ headers?: {
627
+ "X-Target-Org-Id"?: string | null;
628
+ };
629
+ body: ObjectViewState;
630
+ };
631
+ output: ApiResponse_list_ObjectBoardGroup__;
632
+ };
633
+ /**
634
+ * POST /objects/{object_slug}/views/board/records
635
+ * Query Object Board Records
636
+ * tier: write · scope: objects:read
637
+ */
638
+ query_object_board_records_objects__object_slug__views_board_records_post: {
639
+ input: {
640
+ path: {
641
+ object_slug: string;
642
+ };
643
+ headers?: {
644
+ "X-Target-Org-Id"?: string | null;
645
+ };
646
+ body: ObjectBoardPage;
647
+ };
648
+ output: ApiResponse_RecordListResponse_;
649
+ };
388
650
  /**
389
651
  * POST /objects/{object_slug}/records/{record_id}/restore
390
652
  * Restore Object Record
@@ -402,6 +664,23 @@ export interface ObjectsOperations {
402
664
  };
403
665
  output: ApiResponse_ObjectRecordResponse_;
404
666
  };
667
+ /**
668
+ * PUT /objects/{object_slug}/views/default
669
+ * Set Default Object View
670
+ * tier: write · scope: objects:write
671
+ */
672
+ set_default_object_view_objects__object_slug__views_default_put: {
673
+ input: {
674
+ path: {
675
+ object_slug: string;
676
+ };
677
+ headers?: {
678
+ "X-Target-Org-Id"?: string | null;
679
+ };
680
+ body: ObjectViewDefault;
681
+ };
682
+ output: ApiResponse_Union_SavedViewResponse__NoneType__;
683
+ };
405
684
  /**
406
685
  * PATCH /objects/{object_slug}/attributes/{attr_slug}
407
686
  * Update Attribute
@@ -437,6 +716,27 @@ export interface ObjectsOperations {
437
716
  };
438
717
  output: ApiResponse_ObjectDefinitionResponse_;
439
718
  };
719
+ /**
720
+ * PUT /objects/{object_slug}/imports/csv/drafts/{draft_id}
721
+ * Update Object Csv Import
722
+ * tier: write · scope: objects:write
723
+ */
724
+ update_object_csv_import_objects__object_slug__imports_csv_drafts__draft_id__put: {
725
+ input: {
726
+ path: {
727
+ object_slug: string;
728
+ draft_id: string;
729
+ };
730
+ query: {
731
+ revision: number;
732
+ };
733
+ headers?: {
734
+ "X-Target-Org-Id"?: string | null;
735
+ };
736
+ body: ObjectImportUpdate;
737
+ };
738
+ output: ApiResponse_ObjectImportDetail_;
739
+ };
440
740
  /**
441
741
  * PATCH /objects/{object_slug}/records/{record_id}
442
742
  * Update Object Record
@@ -455,6 +755,24 @@ export interface ObjectsOperations {
455
755
  };
456
756
  output: ApiResponse_ObjectRecordResponse_;
457
757
  };
758
+ /**
759
+ * PUT /objects/{object_slug}/views/{view_id}
760
+ * Update Object View
761
+ * tier: write · scope: objects:write
762
+ */
763
+ update_object_view_objects__object_slug__views__view_id__put: {
764
+ input: {
765
+ path: {
766
+ object_slug: string;
767
+ view_id: string;
768
+ };
769
+ headers?: {
770
+ "X-Target-Org-Id"?: string | null;
771
+ };
772
+ body: ObjectViewUpdate;
773
+ };
774
+ output: ApiResponse_SavedViewResponse_;
775
+ };
458
776
  /**
459
777
  * POST /objects/{object_slug}/records/upsert
460
778
  * Upsert Object Record
@@ -474,18 +792,43 @@ export interface ObjectsOperations {
474
792
  };
475
793
  }
476
794
 
477
- // 46 schemas referenced above (the same as G8Contract.<Name>).
795
+ // 84 schemas referenced above (the same as G8Contract.<Name>).
478
796
 
479
797
  export interface ApiResponse_AttributeDefinitionResponse_ {
480
798
  data: AttributeDefinitionResponse;
481
799
  pagination?: PaginationMeta | null;
482
800
  }
483
801
 
802
+ export interface ApiResponse_NoneType_ {
803
+ data: null;
804
+ pagination?: PaginationMeta | null;
805
+ }
806
+
807
+ export interface ApiResponse_ObjectCsvInspection_ {
808
+ data: ObjectCsvInspection;
809
+ pagination?: PaginationMeta | null;
810
+ }
811
+
812
+ export interface ApiResponse_ObjectCsvPreview_ {
813
+ data: ObjectCsvPreview;
814
+ pagination?: PaginationMeta | null;
815
+ }
816
+
817
+ export interface ApiResponse_ObjectCsvReceipt_ {
818
+ data: ObjectCsvReceipt;
819
+ pagination?: PaginationMeta | null;
820
+ }
821
+
484
822
  export interface ApiResponse_ObjectDefinitionResponse_ {
485
823
  data: ObjectDefinitionResponse;
486
824
  pagination?: PaginationMeta | null;
487
825
  }
488
826
 
827
+ export interface ApiResponse_ObjectImportDetail_ {
828
+ data: ObjectImportDetail;
829
+ pagination?: PaginationMeta | null;
830
+ }
831
+
489
832
  export interface ApiResponse_ObjectRecordResponse_ {
490
833
  data: ObjectRecordResponse;
491
834
  pagination?: PaginationMeta | null;
@@ -501,6 +844,11 @@ export interface ApiResponse_RecordHistoryResponse_ {
501
844
  pagination?: PaginationMeta | null;
502
845
  }
503
846
 
847
+ export interface ApiResponse_RecordListResponse_ {
848
+ data: RecordListResponse;
849
+ pagination?: PaginationMeta | null;
850
+ }
851
+
504
852
  export interface ApiResponse_RecordMergeResponse_ {
505
853
  data: RecordMergeResponse;
506
854
  pagination?: PaginationMeta | null;
@@ -526,21 +874,51 @@ export interface ApiResponse_RelationshipResponse_ {
526
874
  pagination?: PaginationMeta | null;
527
875
  }
528
876
 
877
+ export interface ApiResponse_SavedViewResponse_ {
878
+ data: SavedViewResponse;
879
+ pagination?: PaginationMeta | null;
880
+ }
881
+
882
+ export interface ApiResponse_Union_SavedViewResponse__NoneType__ {
883
+ data: SavedViewResponse | null;
884
+ pagination?: PaginationMeta | null;
885
+ }
886
+
887
+ export interface ApiResponse_dict_ {
888
+ data: Record<string, unknown>;
889
+ pagination?: PaginationMeta | null;
890
+ }
891
+
529
892
  export interface ApiResponse_list_AttributeDefinitionResponse__ {
530
893
  data: Array<AttributeDefinitionResponse>;
531
894
  pagination?: PaginationMeta | null;
532
895
  }
533
896
 
897
+ export interface ApiResponse_list_ObjectBoardGroup__ {
898
+ data: Array<ObjectBoardGroup>;
899
+ pagination?: PaginationMeta | null;
900
+ }
901
+
534
902
  export interface ApiResponse_list_ObjectDefinitionResponse__ {
535
903
  data: Array<ObjectDefinitionResponse>;
536
904
  pagination?: PaginationMeta | null;
537
905
  }
538
906
 
907
+ export interface ApiResponse_list_ObjectImportSummary__ {
908
+ data: Array<ObjectImportSummary>;
909
+ pagination?: PaginationMeta | null;
910
+ }
911
+
539
912
  export interface ApiResponse_list_ObjectRecordResponse__ {
540
913
  data: Array<ObjectRecordResponse>;
541
914
  pagination?: PaginationMeta | null;
542
915
  }
543
916
 
917
+ export interface ApiResponse_list_SavedViewResponse__ {
918
+ data: Array<SavedViewResponse>;
919
+ pagination?: PaginationMeta | null;
920
+ }
921
+
544
922
  /** Configuration for specific attribute types. */
545
923
  export interface AttributeConfig {
546
924
  currency_code?: string | null;
@@ -592,6 +970,8 @@ export interface AttributeDefinitionResponse {
592
970
  sort_order?: number;
593
971
  /** Customer-facing field label, distinct from its stable API slug. */
594
972
  title: string;
973
+ /** Role ids that may see this field; null means every role. Owners and admins always see every field. A field hidden from the caller is absent from every response. Set it with PATCH on this attribute. */
974
+ visible_to_role_ids?: Array<string> | null;
595
975
  }
596
976
 
597
977
  /** Valid attribute types for the Custom Objects type system. */
@@ -608,6 +988,83 @@ export interface AttributeUpdateRequest {
608
988
  is_unique?: boolean | null;
609
989
  sort_order?: number | null;
610
990
  title?: string | null;
991
+ visible_to_role_ids?: Array<string> | null;
992
+ }
993
+
994
+ /**
995
+ * Which CRM grid the saved view applies to. Free-form string at the DB
996
+ * level (cb_saved_views.entity_type is VARCHAR(50)) to avoid a schema
997
+ * migration when we add deals/tasks/leads — but enforced as an enum at the
998
+ * API boundary so we don't accept typos.
999
+ *
1000
+ * NEITHER A SUBSET NOR A SUPERSET OF ``FilterEntityType`` — see the invariant
1001
+ * on that class, and the sibling docstring below, which states the same
1002
+ * relationship from the other side. The two enums overlap on the four GRID
1003
+ * values (``contacts``, ``companies``, ``deals``, ``leads``);
1004
+ * ``FilterEntityType`` is a superset of THOSE and adds ``report``, while the
1005
+ * nine list/view/search/workbench members here have no counterpart there.
1006
+ * Custom objects additionally use an object-bound view context.
1007
+ *
1008
+ * (This paragraph previously read "DELIBERATELY NARROWER THAN
1009
+ * ``FilterEntityType``", which inverted the relationship: this is the LARGER
1010
+ * enum. The narrowness that matters is real but specific — ``report`` is
1011
+ * excluded, and only ``report`` — so stating it as a general containment
1012
+ * invited exactly the wrong conclusion about the other nine.)
1013
+ *
1014
+ * Native grid members can be saved with ``context_key = NULL`` for reuse
1015
+ * across that entity type. CUSTOM_OBJECTS is the exception: it requires an
1016
+ * immutable object context and the object-authorized endpoints. It must never
1017
+ * enter the native grids' reusable saved-filter menus.
1018
+ */
1019
+ export type EntityType = "custom_objects" | "contacts" | "companies" | "deals" | "leads" | "lists" | "contacts_view" | "companies_view" | "list_contacts" | "list_companies" | "search_people" | "search_companies" | "abm_companies" | "enrichment_workbench" | "enrichment_workbenches";
1020
+
1021
+ export interface ImportPage {
1022
+ limit?: number;
1023
+ offset?: number;
1024
+ /** The draft revision this page was planned against */
1025
+ revision: number;
1026
+ }
1027
+
1028
+ export interface ImportPreviewRow {
1029
+ already_imported?: boolean;
1030
+ errors?: Array<Record<string, unknown>>;
1031
+ record_id?: string | null;
1032
+ revision?: number | null;
1033
+ row_number: number;
1034
+ values?: Record<string, unknown>;
1035
+ }
1036
+
1037
+ export interface ImportReceiptRow {
1038
+ action: "created" | "updated";
1039
+ record_id: string;
1040
+ replayed?: boolean;
1041
+ revision: number;
1042
+ row_number: number;
1043
+ }
1044
+
1045
+ export interface ImportRowExpectation {
1046
+ record_id?: string | null;
1047
+ revision?: number | null;
1048
+ row_number: number;
1049
+ }
1050
+
1051
+ /** A row this commit did not import; its errors are kept for the error file. */
1052
+ export interface ImportSkippedRow {
1053
+ errors: Array<Record<string, unknown>>;
1054
+ row_number: number;
1055
+ }
1056
+
1057
+ export interface ObjectBoardGroup {
1058
+ label: string;
1059
+ total: number;
1060
+ value: string | null;
1061
+ }
1062
+
1063
+ export interface ObjectBoardPage {
1064
+ group_value?: string | null;
1065
+ limit?: number;
1066
+ offset?: number;
1067
+ state: ObjectViewState;
611
1068
  }
612
1069
 
613
1070
  export interface ObjectCreateRequest {
@@ -618,6 +1075,44 @@ export interface ObjectCreateRequest {
618
1075
  slug: string;
619
1076
  }
620
1077
 
1078
+ export interface ObjectCsvInspect {
1079
+ csv: string;
1080
+ }
1081
+
1082
+ export interface ObjectCsvInspection {
1083
+ headers: Array<string>;
1084
+ sample: Array<Array<string>>;
1085
+ total: number;
1086
+ }
1087
+
1088
+ export interface ObjectCsvPreview {
1089
+ completed: number;
1090
+ next_offset: number | null;
1091
+ rows: Array<ImportPreviewRow>;
1092
+ schema_fingerprint: string;
1093
+ total: number;
1094
+ }
1095
+
1096
+ /**
1097
+ * Outcome of one committed page. ``created`` / ``updated`` / ``skipped`` count
1098
+ * this request only; rows an earlier attempt already imported are
1099
+ * ``already_imported``. ``completed`` and ``error_rows`` are the import's totals.
1100
+ */
1101
+ export interface ObjectCsvReceipt {
1102
+ already_imported: number;
1103
+ completed: number;
1104
+ created: number;
1105
+ error_file_available: boolean;
1106
+ error_rows: number;
1107
+ replayed?: boolean;
1108
+ rows: Array<ImportReceiptRow>;
1109
+ skipped: number;
1110
+ skipped_rows?: Array<ImportSkippedRow>;
1111
+ status: "draft" | "partial" | "completed" | "expired";
1112
+ total: number;
1113
+ updated: number;
1114
+ }
1115
+
621
1116
  /** One custom object type in the caller's workspace. */
622
1117
  export interface ObjectDefinitionResponse {
623
1118
  /** Customer-configured object description. */
@@ -638,6 +1133,82 @@ export interface ObjectDefinitionResponse {
638
1133
  slug: string;
639
1134
  }
640
1135
 
1136
+ export interface ObjectExportRequest {
1137
+ format?: "csv" | "json";
1138
+ state?: ObjectViewState;
1139
+ }
1140
+
1141
+ export interface ObjectImportCommit {
1142
+ expected: Array<ImportRowExpectation>;
1143
+ limit?: number;
1144
+ offset?: number;
1145
+ /** The draft revision this page was planned against */
1146
+ revision: number;
1147
+ schema_fingerprint: string;
1148
+ }
1149
+
1150
+ export interface ObjectImportCreate {
1151
+ csv: string;
1152
+ filename: string;
1153
+ mapping?: Record<string, string>;
1154
+ matching_attribute?: string | null;
1155
+ mode?: "create" | "upsert";
1156
+ }
1157
+
1158
+ export interface ObjectImportDetail {
1159
+ completed: number;
1160
+ created_at: string;
1161
+ error_rows: number;
1162
+ expires_at: string;
1163
+ filename: string;
1164
+ headers: Array<string>;
1165
+ id: string;
1166
+ owner_id: string;
1167
+ owner_type: "user" | "api";
1168
+ revision: number;
1169
+ /** First rows of the file while it is still stored */
1170
+ sample?: Array<Array<string>>;
1171
+ setup: ObjectImportSetup;
1172
+ source_available: boolean;
1173
+ status: "draft" | "partial" | "completed" | "expired";
1174
+ total: number;
1175
+ updated_at: string;
1176
+ }
1177
+
1178
+ /**
1179
+ * Column mapping (CSV header -> field slug) and match mode. May be
1180
+ * incomplete while saved; preview and commit need an executable setup.
1181
+ */
1182
+ export interface ObjectImportSetup {
1183
+ mapping?: Record<string, string>;
1184
+ matching_attribute?: string | null;
1185
+ mode?: "create" | "upsert";
1186
+ }
1187
+
1188
+ /** History metadata: never cell values. */
1189
+ export interface ObjectImportSummary {
1190
+ completed: number;
1191
+ created_at: string;
1192
+ error_rows: number;
1193
+ expires_at: string;
1194
+ filename: string;
1195
+ id: string;
1196
+ owner_id: string;
1197
+ owner_type: "user" | "api";
1198
+ revision: number;
1199
+ source_available: boolean;
1200
+ status: "draft" | "partial" | "completed" | "expired";
1201
+ total: number;
1202
+ updated_at: string;
1203
+ }
1204
+
1205
+ export interface ObjectImportUpdate {
1206
+ filename: string;
1207
+ mapping?: Record<string, string>;
1208
+ matching_attribute?: string | null;
1209
+ mode?: "create" | "upsert";
1210
+ }
1211
+
641
1212
  /** One record, with its currently active attribute values. */
642
1213
  export interface ObjectRecordResponse {
643
1214
  created_at?: string | null;
@@ -663,6 +1234,33 @@ export interface ObjectUpdateRequest {
663
1234
  singular_noun?: string | null;
664
1235
  }
665
1236
 
1237
+ export interface ObjectViewCreate {
1238
+ state?: ObjectViewState;
1239
+ title: string;
1240
+ visibility?: Visibility;
1241
+ }
1242
+
1243
+ export interface ObjectViewDefault {
1244
+ view_id?: string | null;
1245
+ }
1246
+
1247
+ export interface ObjectViewState {
1248
+ columns?: Array<string> | null;
1249
+ filters?: Array<RecordFilter>;
1250
+ groupBy?: string | null;
1251
+ includeArchived?: boolean;
1252
+ layout?: "table" | "board";
1253
+ search?: string;
1254
+ sortBy?: string | null;
1255
+ sortOrder?: "asc" | "desc";
1256
+ version?: 1;
1257
+ }
1258
+
1259
+ export interface ObjectViewUpdate {
1260
+ state?: ObjectViewState | null;
1261
+ title?: string | null;
1262
+ }
1263
+
666
1264
  export interface PaginationMeta {
667
1265
  /** Whether there are more pages */
668
1266
  has_next: boolean;
@@ -699,7 +1297,16 @@ export interface RecordBulkUpdate {
699
1297
  values?: Record<string, unknown>;
700
1298
  }
701
1299
 
1300
+ /**
1301
+ * One record a bulk update did not change. ``error`` is the human message
1302
+ * (kept for existing clients); ``code`` is stable for UIs to branch on:
1303
+ * locked, archived, not_found, scope_changed, unique_conflict, invalid_value,
1304
+ * constraint_violation or rejected; ``attribute_slug`` names the field when
1305
+ * one field caused it.
1306
+ */
702
1307
  export interface RecordBulkUpdateFailure {
1308
+ attribute_slug?: string | null;
1309
+ code?: string;
703
1310
  error: string;
704
1311
  id: string;
705
1312
  }
@@ -745,6 +1352,12 @@ export interface RecordHistoryResponse {
745
1352
  record_id: string;
746
1353
  }
747
1354
 
1355
+ /** Response for listing records. */
1356
+ export interface RecordListResponse {
1357
+ records: Array<RecordResponse>;
1358
+ total: number;
1359
+ }
1360
+
748
1361
  export interface RecordMergeCascade {
749
1362
  associations_deleted: number;
750
1363
  associations_repointed: number;
@@ -911,3 +1524,23 @@ export interface RelationshipResponse {
911
1524
  target_record_id: string;
912
1525
  target_revision: number;
913
1526
  }
1527
+
1528
+ /** Response shape — flat shape with state at top level for convenience. */
1529
+ export interface SavedViewResponse {
1530
+ context_key: string | null;
1531
+ created_at: string | null;
1532
+ created_by: string;
1533
+ description: string | null;
1534
+ entity_type: EntityType;
1535
+ id: string;
1536
+ is_default: boolean;
1537
+ is_owner: boolean;
1538
+ is_reusable: boolean;
1539
+ state: Record<string, unknown>;
1540
+ title: string;
1541
+ updated_at: string | null;
1542
+ visibility: Visibility;
1543
+ }
1544
+
1545
+ /** Who can apply a view. Only the creator can update or delete it. */
1546
+ export type Visibility = "private" | "org";