@appconda/sdk 1.0.681 → 1.0.685

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.
@@ -203,8 +203,19 @@ export type TKnowledgeTreeImportResult = {
203
203
  export type TAgentFlow = {
204
204
  id: string;
205
205
  name: string;
206
- description: string;
207
- folderId: string;
206
+ description: string | null;
207
+ folderId: string | null;
208
+ };
209
+ export type TDataModelAgentFlow = {
210
+ id: string;
211
+ dataModelId: string;
212
+ name: string;
213
+ description: string | null;
214
+ updatedAt: string;
215
+ };
216
+ export type TDataModelAgentFlowPage = {
217
+ items: TDataModelAgentFlow[];
218
+ total: number;
208
219
  };
209
220
  export type TDeleteAgentFlowResult = {
210
221
  deleted: boolean;
@@ -621,14 +632,60 @@ export type TCollection = {
621
632
  id: string;
622
633
  name: string;
623
634
  displayName: string;
624
- description: string;
625
- stats: {
635
+ description?: string | null;
636
+ stats?: {
626
637
  totalFields: number;
627
638
  activeFields: number;
628
639
  deletedFields: number;
629
640
  data: string;
630
641
  storage: string;
631
642
  };
643
+ fields?: TCollectionField[];
644
+ archived?: boolean;
645
+ ignoredFields?: string[];
646
+ };
647
+ export type TCollectionChecklistItem = {
648
+ id: string;
649
+ text: string;
650
+ checked: boolean;
651
+ };
652
+ export type TCollectionSignatureValue = {
653
+ kind: "typed" | "drawn";
654
+ value: string;
655
+ signedAt: string;
656
+ signedBy: string;
657
+ };
658
+ /** Client write shape; provenance is always attached by the collection service. */
659
+ export type TCollectionSignatureInput = Pick<TCollectionSignatureValue, "kind" | "value">;
660
+ export type TCollectionUserReference = string | {
661
+ id: string;
662
+ name?: string;
663
+ email?: string;
664
+ };
665
+ export type TCollectionDerivedCondition = {
666
+ fieldId: string;
667
+ fieldName?: string;
668
+ operator: "eq" | "neq" | "contains" | "not-contains" | "gt" | "gte" | "lt" | "lte" | "is-empty" | "is-not-empty";
669
+ value?: unknown;
670
+ };
671
+ export type TCollectionFieldConfig = {
672
+ [key: string]: any;
673
+ relationFieldId?: string;
674
+ relationFieldName?: string;
675
+ relationId?: string;
676
+ targetCollectionId?: string;
677
+ targetFieldId?: string;
678
+ targetFieldName?: string;
679
+ resultMode?: "first" | "list";
680
+ operation?: "count" | "count-values" | "count-unique" | "sum" | "average" | "min" | "max";
681
+ condition?: TCollectionDerivedCondition;
682
+ maxItems?: number;
683
+ min?: number;
684
+ max?: number;
685
+ precision?: number;
686
+ mode?: "typed" | "drawn" | "both";
687
+ source?: "organization" | "users" | "employees" | "both";
688
+ includeInactive?: boolean;
632
689
  };
633
690
  export type TCollectionField = {
634
691
  id: string;
@@ -638,11 +695,536 @@ export type TCollectionField = {
638
695
  displayName: string;
639
696
  type: string;
640
697
  required: boolean;
641
- config?: any;
698
+ config?: TCollectionFieldConfig;
642
699
  order?: number;
643
700
  deletedAt?: string;
644
701
  deletedBy?: string;
645
702
  };
703
+ export type TCsvImportInvalidRowPolicy = "reject" | "skip-row" | "set-null";
704
+ export type TCsvImportRowRepair = {
705
+ rowIndex: number;
706
+ fieldId: string;
707
+ value: unknown;
708
+ };
709
+ export type TCsvImportRowIssue = {
710
+ rowIndex: number;
711
+ fieldId: string;
712
+ fieldName: string;
713
+ code: "required" | "type" | "option" | "relation_config" | "relation_cardinality";
714
+ message: string;
715
+ rawValue: unknown;
716
+ };
717
+ export type TCsvImportRowPreview = {
718
+ totalRows: number;
719
+ validRows: number;
720
+ invalidRows: number;
721
+ acceptedRows: number;
722
+ skippedRows: number;
723
+ blockingIssueCount: number;
724
+ issues: TCsvImportRowIssue[];
725
+ truncatedIssueCount: number;
726
+ invalidRowPolicy: TCsvImportInvalidRowPolicy;
727
+ };
728
+ export type TCollectionRecord = {
729
+ id: string;
730
+ data: Record<string, any>;
731
+ meta?: Record<string, any>;
732
+ };
733
+ export type TCollectionRecordPage = {
734
+ query?: string;
735
+ total: number;
736
+ limit: number;
737
+ offset: number;
738
+ items: TCollectionRecord[];
739
+ /** Compatibility alias returned for older consumers. */
740
+ records?: TCollectionRecord[];
741
+ };
742
+ export type TBulkUpdateRecordsResult = {
743
+ matchedCount: number;
744
+ modifiedCount: number;
745
+ };
746
+ export type TCollectionFieldOrder = {
747
+ fieldId: string;
748
+ order: number;
749
+ };
750
+ export type TReorderCollectionFieldsResult = {
751
+ collectionId: string;
752
+ reorderedCount: number;
753
+ orderStep: number;
754
+ fields: TCollectionFieldOrder[];
755
+ };
756
+ export type TRecordPermission = {
757
+ id: string;
758
+ recordId: string;
759
+ subjectType: string;
760
+ subjectId: string;
761
+ actor: string;
762
+ action: string;
763
+ effect: "allow" | "deny";
764
+ createdBy?: string;
765
+ createdAt?: string | Date;
766
+ };
767
+ export type TCollectionAccessPolicyScopeType = "app" | "list" | "field";
768
+ export type TCollectionAccessPolicySubjectType = "user" | "role" | "team" | "service";
769
+ export type TCollectionAccessPolicyEffect = "allow" | "deny";
770
+ export type TCollectionAccessPolicyAction = "read" | "create" | "update" | "delete" | "comment" | "assign";
771
+ export type TCollectionAccessPolicyRowOperator = "me" | "user" | "team" | "linked-record";
772
+ export type TCollectionAccessPolicyRowFilter = {
773
+ match: "all" | "any";
774
+ conditions: Array<{
775
+ fieldId: string;
776
+ operator: TCollectionAccessPolicyRowOperator;
777
+ value?: string;
778
+ }>;
779
+ };
780
+ export type TCollectionAccessPolicy = {
781
+ id: string;
782
+ tenantId: string;
783
+ dataModelId: string;
784
+ collectionId: string | null;
785
+ fieldId: string | null;
786
+ name: string;
787
+ scopeType: TCollectionAccessPolicyScopeType;
788
+ subjectType: TCollectionAccessPolicySubjectType;
789
+ subjectId: string;
790
+ effect: TCollectionAccessPolicyEffect;
791
+ actions: TCollectionAccessPolicyAction[];
792
+ rowFilter: TCollectionAccessPolicyRowFilter | null;
793
+ enabled: boolean;
794
+ createdAt?: string | Date;
795
+ updatedAt?: string | Date;
796
+ createdBy?: string;
797
+ updatedBy?: string;
798
+ };
799
+ export type TCollectionAccessPolicyPreview = {
800
+ valid: true;
801
+ policy: Omit<TCollectionAccessPolicy, "id" | "tenantId"> & {
802
+ id?: string;
803
+ };
804
+ currentActorMatches: boolean;
805
+ preview: {
806
+ allowed: boolean;
807
+ reason: string;
808
+ } | null;
809
+ };
810
+ export type TCollectionAccessTeamMember = {
811
+ id: string;
812
+ teamId: string;
813
+ userId: string;
814
+ createdAt: string | Date;
815
+ createdBy: string;
816
+ };
817
+ export type TSetCollectionAccessTeamMembersResult = {
818
+ teamId: string;
819
+ userIds: string[];
820
+ memberCount: number;
821
+ updatedBy: string;
822
+ };
823
+ export type TCollectionFormLayoutField = {
824
+ fieldId: string;
825
+ label?: string;
826
+ helpText?: string;
827
+ placeholder?: string;
828
+ required?: boolean;
829
+ width?: "full" | "half";
830
+ };
831
+ export type TCollectionFormLayoutSection = {
832
+ id: string;
833
+ title?: string;
834
+ description?: string;
835
+ fields: TCollectionFormLayoutField[];
836
+ };
837
+ export type TCollectionFormLayout = {
838
+ sections: TCollectionFormLayoutSection[];
839
+ };
840
+ export type TCollectionFormStatus = "draft" | "published" | "archived";
841
+ export type TCollectionForm = {
842
+ id: string;
843
+ tenantId: string;
844
+ dataModelId: string;
845
+ collectionId: string;
846
+ name: string;
847
+ description: string;
848
+ layout: TCollectionFormLayout;
849
+ submitLabel: string;
850
+ successMessage: string;
851
+ enabled: boolean;
852
+ status: TCollectionFormStatus;
853
+ serviceSubjectId: string;
854
+ tokenHint: string | null;
855
+ publishedAt: string | null;
856
+ expiresAt: string | null;
857
+ revokedAt: string | null;
858
+ rateLimitPerMinute: number;
859
+ maxSubmissions: number | null;
860
+ submissionCount: number;
861
+ createdAt: string | null;
862
+ updatedAt: string | null;
863
+ createdBy: string;
864
+ updatedBy: string;
865
+ };
866
+ export type TResolvedCollectionFormField = {
867
+ id: string;
868
+ type: string;
869
+ label: string;
870
+ helpText?: string;
871
+ placeholder?: string;
872
+ required: boolean;
873
+ width?: "full" | "half";
874
+ config?: Record<string, unknown>;
875
+ };
876
+ export type TResolvedCollectionFormSection = {
877
+ id: string;
878
+ title?: string;
879
+ description?: string;
880
+ fields: TResolvedCollectionFormField[];
881
+ };
882
+ export type TResolvedCollectionForm = {
883
+ name: string;
884
+ description?: string;
885
+ submitLabel: string;
886
+ successMessage: string;
887
+ expiresAt?: string | null;
888
+ sections: TResolvedCollectionFormSection[];
889
+ };
890
+ export type TResolvedInternalCollectionForm = TCollectionForm & {
891
+ sections: TResolvedCollectionFormSection[];
892
+ };
893
+ export type TCollectionFormPublishResult = {
894
+ form: TCollectionForm;
895
+ token: string;
896
+ };
897
+ export type TCollectionFormSubmissionResult = {
898
+ submissionId: string;
899
+ successMessage: string;
900
+ idempotent: boolean;
901
+ recordId?: string | null;
902
+ };
903
+ export type TCollectionAppGenerationField = {
904
+ name: string;
905
+ displayName: string;
906
+ type: string;
907
+ required: boolean;
908
+ config: Record<string, unknown>;
909
+ };
910
+ export type TCollectionAppGenerationView = {
911
+ name: string;
912
+ type: "grid" | "board" | "calendar";
913
+ config: Record<string, unknown>;
914
+ };
915
+ export type TCollectionAppGenerationProposal = {
916
+ version: 1;
917
+ app: {
918
+ name: string;
919
+ displayName: string;
920
+ };
921
+ collections: Array<{
922
+ name: string;
923
+ displayName: string;
924
+ fields: TCollectionAppGenerationField[];
925
+ views: TCollectionAppGenerationView[];
926
+ }>;
927
+ };
928
+ export type TCollectionAppGenerationDiff = {
929
+ version: 1;
930
+ destructive: false;
931
+ summary: {
932
+ creates: number;
933
+ updates: number;
934
+ deletes: number;
935
+ };
936
+ operations: Array<{
937
+ operation: "create";
938
+ kind: "dataModel" | "collection" | "field" | "view";
939
+ path: string;
940
+ displayName?: string;
941
+ fieldType?: string;
942
+ viewType?: string;
943
+ required?: boolean;
944
+ }>;
945
+ };
946
+ export type TCollectionAppGenerationResources = {
947
+ dataModel: {
948
+ id: string;
949
+ name: string;
950
+ };
951
+ collections: Array<{
952
+ id: string;
953
+ name: string;
954
+ }>;
955
+ };
956
+ export type TCollectionAppGenerationRun = {
957
+ id: string;
958
+ planId: string;
959
+ tenantId: string;
960
+ status: string;
961
+ createdResources: TCollectionAppGenerationResources | null;
962
+ errorCode: string | null;
963
+ errorMessage: string | null;
964
+ applyActorId: string;
965
+ rollbackActorId: string | null;
966
+ appliedAt: string | Date | null;
967
+ rolledBackAt: string | Date | null;
968
+ rollbackMetadataDeletedAt: string | Date | null;
969
+ createdAt: string | Date;
970
+ updatedAt: string | Date;
971
+ };
972
+ export type TCollectionAppGenerationPlan = {
973
+ id: string;
974
+ tenantId: string;
975
+ prompt: string;
976
+ promptHash: string;
977
+ proposal: TCollectionAppGenerationProposal;
978
+ proposalHash: string;
979
+ diff: TCollectionAppGenerationDiff;
980
+ status: string;
981
+ activeRunId: string | null;
982
+ createdBy: string;
983
+ createdAt: string | Date;
984
+ updatedAt: string | Date;
985
+ runs: TCollectionAppGenerationRun[];
986
+ };
987
+ export type TCollectionAppGenerationPlanPage = {
988
+ items: TCollectionAppGenerationPlan[];
989
+ nextOffset: number | null;
990
+ };
991
+ export type TCollectionAppGenerationRunPage = {
992
+ items: TCollectionAppGenerationRun[];
993
+ nextOffset: number | null;
994
+ };
995
+ export type TCollectionReportType = "table" | "metric" | "chart";
996
+ export type TCollectionReportVisibility = "personal" | "shared";
997
+ export type TCollectionReportTableConfig = {
998
+ filter?: Record<string, unknown>;
999
+ fields: string[];
1000
+ sort?: Record<string, "asc" | "desc">;
1001
+ limit?: number;
1002
+ };
1003
+ export type TCollectionReportAggregateConfig = {
1004
+ filter?: Record<string, unknown>;
1005
+ aggregate: "count" | "sum" | "avg" | "min" | "max";
1006
+ valueField?: string;
1007
+ groupBy?: string;
1008
+ limit?: number;
1009
+ };
1010
+ export type TCollectionReport = {
1011
+ id: string;
1012
+ tenantId: string;
1013
+ dataModelId: string;
1014
+ collectionId: string;
1015
+ name: string;
1016
+ description: string | null;
1017
+ type: TCollectionReportType;
1018
+ visibility: TCollectionReportVisibility;
1019
+ ownerId: string;
1020
+ config: TCollectionReportTableConfig | TCollectionReportAggregateConfig | null;
1021
+ available: boolean;
1022
+ unavailableReason?: string;
1023
+ canEdit: boolean;
1024
+ createdAt: string | Date;
1025
+ updatedAt: string | Date;
1026
+ createdBy: string;
1027
+ updatedBy: string;
1028
+ };
1029
+ export type TCollectionReportPage = {
1030
+ total: number;
1031
+ limit: number;
1032
+ offset: number;
1033
+ items: TCollectionReport[];
1034
+ };
1035
+ export type TCollectionReportTableResult = {
1036
+ type: "table";
1037
+ fields: Array<{
1038
+ name: string;
1039
+ displayName: string;
1040
+ type: string;
1041
+ }>;
1042
+ items: Array<{
1043
+ id: string;
1044
+ data: Record<string, unknown>;
1045
+ }>;
1046
+ count: number;
1047
+ truncated: boolean;
1048
+ };
1049
+ export type TCollectionReportMetricResult = {
1050
+ type: "metric";
1051
+ value: number;
1052
+ };
1053
+ export type TCollectionReportChartResult = {
1054
+ type: "chart";
1055
+ points: Array<{
1056
+ label: string | number | boolean | null;
1057
+ value: number;
1058
+ }>;
1059
+ truncated: boolean;
1060
+ };
1061
+ export type TCollectionReportResult = TCollectionReportTableResult | TCollectionReportMetricResult | TCollectionReportChartResult;
1062
+ export type TCollectionReportEvaluation = {
1063
+ report: TCollectionReport;
1064
+ result: TCollectionReportResult;
1065
+ evaluatedAt: string | Date;
1066
+ };
1067
+ export type TCollectionDashboardWidget = {
1068
+ id: string;
1069
+ title: string;
1070
+ type: TCollectionReportType;
1071
+ order: number;
1072
+ reportId: string | null;
1073
+ reportName?: string;
1074
+ config: Record<string, unknown> | null;
1075
+ available: boolean;
1076
+ unavailableReason?: string;
1077
+ createdAt: string | Date;
1078
+ updatedAt: string | Date;
1079
+ };
1080
+ export type TCollectionDashboard = {
1081
+ id: string;
1082
+ tenantId: string;
1083
+ dataModelId: string;
1084
+ collectionId: string;
1085
+ name: string;
1086
+ description: string | null;
1087
+ visibility: TCollectionReportVisibility;
1088
+ ownerId: string;
1089
+ settings: {
1090
+ columns: number;
1091
+ compact: boolean;
1092
+ };
1093
+ widgets: TCollectionDashboardWidget[];
1094
+ canEdit: boolean;
1095
+ createdAt: string | Date;
1096
+ updatedAt: string | Date;
1097
+ createdBy: string;
1098
+ updatedBy: string;
1099
+ };
1100
+ export type TCollectionDashboardPage = {
1101
+ total: number;
1102
+ limit: number;
1103
+ offset: number;
1104
+ items: TCollectionDashboard[];
1105
+ };
1106
+ export type TCollectionDashboardEvaluation = {
1107
+ dashboard: TCollectionDashboard;
1108
+ widgets: Array<{
1109
+ widgetId: string;
1110
+ status: "ready" | "unavailable";
1111
+ result?: TCollectionReportResult;
1112
+ error?: string;
1113
+ }>;
1114
+ evaluatedAt: string | Date;
1115
+ };
1116
+ export type TCollectionComment = {
1117
+ id: string;
1118
+ parentId: string | null;
1119
+ authorId: string;
1120
+ body: string | null;
1121
+ mentionUserIds: string[];
1122
+ createdAt: string | Date;
1123
+ updatedAt: string | Date;
1124
+ editedAt?: string | Date | null;
1125
+ deletedAt?: string | Date | null;
1126
+ canEdit?: boolean;
1127
+ canDelete?: boolean;
1128
+ };
1129
+ export type TCollectionCommentPage = {
1130
+ comments: TCollectionComment[];
1131
+ total: number;
1132
+ limit: number;
1133
+ offset: number;
1134
+ hasMore: boolean;
1135
+ };
1136
+ export type TCollectionRecordActivity = {
1137
+ id: string;
1138
+ type: string;
1139
+ actorId: string;
1140
+ resourceType?: string | null;
1141
+ resourceId?: string | null;
1142
+ payload?: Record<string, string | number | boolean | null> | null;
1143
+ createdAt: string | Date;
1144
+ };
1145
+ export type TCollectionRecordEvent = {
1146
+ id: string;
1147
+ type: string;
1148
+ actorId: string;
1149
+ source?: string | null;
1150
+ createdAt: string | Date;
1151
+ };
1152
+ export type TCollectionRecordActivityPage = {
1153
+ activity: TCollectionRecordActivity[];
1154
+ total: number;
1155
+ recordEvents: TCollectionRecordEvent[];
1156
+ recordEventTotal: number;
1157
+ limit: number;
1158
+ offset: number;
1159
+ hasMore: boolean;
1160
+ recordEventsHasMore: boolean;
1161
+ };
1162
+ export type TCollectionRecordCollaborator = {
1163
+ id: string;
1164
+ userId: string;
1165
+ kind: "assignee" | "watcher";
1166
+ createdAt: string | Date;
1167
+ createdBy: string;
1168
+ };
1169
+ export type TCollectionRecordCollaborators = {
1170
+ assigneeIds: string[];
1171
+ watcherIds: string[];
1172
+ collaborators: TCollectionRecordCollaborator[];
1173
+ updatedBy?: string;
1174
+ };
1175
+ export type TCollectionNotification = {
1176
+ id: string;
1177
+ type: string;
1178
+ actorId: string;
1179
+ collectionId?: string | null;
1180
+ recordId?: string | null;
1181
+ resourceType?: string | null;
1182
+ resourceId?: string | null;
1183
+ payload?: Record<string, string | number | boolean | null> | null;
1184
+ readAt?: string | Date | null;
1185
+ createdAt: string | Date;
1186
+ };
1187
+ export type TCollectionNotificationPage = {
1188
+ notifications: TCollectionNotification[];
1189
+ unreadCount: number;
1190
+ limit: number;
1191
+ offset: number;
1192
+ nextOffset: number;
1193
+ hasMore: boolean;
1194
+ };
1195
+ export type TRecordPermissionDecision = {
1196
+ action: string;
1197
+ allowed: boolean;
1198
+ reason?: string;
1199
+ };
1200
+ export type TRecordPermissionListResult = {
1201
+ recordId: string;
1202
+ actor?: string;
1203
+ reason?: string;
1204
+ permissions: Array<TRecordPermission | TRecordPermissionDecision>;
1205
+ };
1206
+ export type TGrantRecordPermissionResult = {
1207
+ recordId: string;
1208
+ subjectType: string;
1209
+ subjectId: string;
1210
+ actor: string;
1211
+ actions: string[];
1212
+ action?: string;
1213
+ effect: "allow" | "deny";
1214
+ id?: string;
1215
+ permissions: TRecordPermission[];
1216
+ };
1217
+ export type TRevokeRecordPermissionResult = {
1218
+ recordId: string;
1219
+ subjectType: string;
1220
+ subjectId: string;
1221
+ actor: string;
1222
+ actions: string[];
1223
+ action?: string;
1224
+ revoked: boolean;
1225
+ revokedCount: number;
1226
+ revokedBy: string;
1227
+ };
646
1228
  export type TCollectionRelation = {
647
1229
  id: string;
648
1230
  fieldId: string;
@@ -665,6 +1247,9 @@ export type TAutomationRuleTriggerType = "created" | "updated" | "linked" | "unl
665
1247
  export type TCollectionAutomationRuleConditionOperator = "is" | "is-not" | "contains" | "is-empty" | "is-not-empty";
666
1248
  export type TCollectionAutomationRuleTriggerConfig = {
667
1249
  updatedFieldId?: string | null;
1250
+ cron?: string | null;
1251
+ timezone?: string | null;
1252
+ maxRecords?: number;
668
1253
  };
669
1254
  export type TCollectionAutomationRuleCondition = {
670
1255
  id: string;
@@ -672,7 +1257,7 @@ export type TCollectionAutomationRuleCondition = {
672
1257
  operator: TCollectionAutomationRuleConditionOperator;
673
1258
  value?: string | string[] | boolean | null;
674
1259
  };
675
- export type TAutomationRuleActionType = "create" | "update" | "delete" | "append-description" | "script";
1260
+ export type TAutomationRuleActionType = "create" | "update" | "delete" | "append-description" | "script" | "conditional-branch" | "find-records" | "for-each" | "copy-record" | "move-record" | "webhook" | "approval";
676
1261
  export type TAutomationRuleAction = {
677
1262
  id: string;
678
1263
  type: TAutomationRuleActionType | null;
@@ -682,6 +1267,25 @@ export type TAutomationRuleAction = {
682
1267
  formula?: string;
683
1268
  template?: string;
684
1269
  script?: string;
1270
+ condition?: TCollectionAutomationRuleCondition | null;
1271
+ thenActions?: TAutomationRuleAction[];
1272
+ elseActions?: TAutomationRuleAction[];
1273
+ collectionId?: string | null;
1274
+ filters?: TCollectionAutomationRuleCondition[];
1275
+ limit?: number;
1276
+ resultKey?: string;
1277
+ sourceKey?: string;
1278
+ maxIterations?: number;
1279
+ actions?: TAutomationRuleAction[];
1280
+ targetCollectionId?: string | null;
1281
+ fieldMap?: Record<string, string>;
1282
+ url?: string;
1283
+ method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
1284
+ headers?: Record<string, string>;
1285
+ body?: unknown;
1286
+ timeoutMs?: number;
1287
+ approverIds?: string[];
1288
+ approvalMessage?: string;
685
1289
  };
686
1290
  export type TAutomationRuleActivityItem = {
687
1291
  id: string;
@@ -701,9 +1305,63 @@ export type TCollectionAutomationRule = {
701
1305
  conditions?: TCollectionAutomationRuleCondition[];
702
1306
  actions: TAutomationRuleAction[];
703
1307
  activity: TAutomationRuleActivityItem[];
1308
+ createdBy?: string | null;
1309
+ updatedBy?: string | null;
704
1310
  createdAt: string;
705
1311
  updatedAt: string;
706
1312
  };
1313
+ export type TCollectionAutomationExecutionStatus = "queued" | "running" | "waiting_approval" | "succeeded" | "failed" | "skipped" | "cancelled";
1314
+ export type TCollectionAutomationStepExecution = {
1315
+ id: string;
1316
+ actionId: string;
1317
+ actionType: string;
1318
+ sequence: number;
1319
+ status: string;
1320
+ output?: Record<string, unknown> | null;
1321
+ error?: string | null;
1322
+ startedAt: string;
1323
+ finishedAt?: string | null;
1324
+ };
1325
+ export type TCollectionAutomationApproval = {
1326
+ id: string;
1327
+ actionId: string;
1328
+ status: "pending" | "approved" | "rejected";
1329
+ approverIds: string[];
1330
+ message: string;
1331
+ requestedBy: string;
1332
+ decidedBy?: string | null;
1333
+ decisionNote?: string;
1334
+ decidedAt?: string | null;
1335
+ createdAt: string;
1336
+ };
1337
+ export type TCollectionAutomationExecution = {
1338
+ id: string;
1339
+ tenantId: string;
1340
+ dataModelId: string;
1341
+ collectionId: string;
1342
+ ruleId?: string | null;
1343
+ ruleName?: string | null;
1344
+ recordId?: string | null;
1345
+ trigger: TAutomationRuleTriggerType;
1346
+ status: TCollectionAutomationExecutionStatus;
1347
+ attempt: number;
1348
+ maxAttempts: number;
1349
+ principalType: "user" | "service";
1350
+ principalId: string;
1351
+ output?: Record<string, unknown> | null;
1352
+ error?: string | null;
1353
+ nextAttemptAt?: string | null;
1354
+ startedAt?: string | null;
1355
+ finishedAt?: string | null;
1356
+ createdAt: string;
1357
+ updatedAt: string;
1358
+ steps: TCollectionAutomationStepExecution[];
1359
+ approvals: TCollectionAutomationApproval[];
1360
+ };
1361
+ export type TCollectionAutomationExecutionPage = {
1362
+ items: TCollectionAutomationExecution[];
1363
+ nextCursor?: string | null;
1364
+ };
707
1365
  export type TCollectionViewColumn = {
708
1366
  fieldName: string;
709
1367
  visible: boolean;
@@ -748,18 +1406,79 @@ export type TCollectionBoardViewConfig = {
748
1406
  colorMode: TCollectionBoardColorMode;
749
1407
  groupVisibleFieldOverrides: TCollectionBoardGroupVisibleFieldOverride[];
750
1408
  };
751
- export type TCollectionViewConfig = TCollectionGridViewConfig | TCollectionBoardViewConfig;
1409
+ export type TCollectionCalendarDefaultMode = "month" | "week" | "agenda";
1410
+ export type TCollectionCalendarViewConfig = {
1411
+ version: 1;
1412
+ columns: TCollectionViewColumn[];
1413
+ titleFieldName: string;
1414
+ startDateFieldName: string;
1415
+ endDateFieldName: string;
1416
+ colorFieldName: string;
1417
+ defaultMode: TCollectionCalendarDefaultMode;
1418
+ filters: TCollectionBoardFilterRule[];
1419
+ sorts: TCollectionBoardSortRule[];
1420
+ };
1421
+ export type TCollectionPresentationViewConfigBase = {
1422
+ version: 1;
1423
+ columns: TCollectionViewColumn[];
1424
+ filters: TCollectionBoardFilterRule[];
1425
+ sorts: TCollectionBoardSortRule[];
1426
+ };
1427
+ export type TCollectionTimelineViewConfig = TCollectionPresentationViewConfigBase & {
1428
+ titleFieldName: string;
1429
+ startDateFieldName: string;
1430
+ endDateFieldName: string;
1431
+ groupByFieldName: string;
1432
+ };
1433
+ export type TCollectionTreeViewConfig = TCollectionPresentationViewConfigBase & {
1434
+ labelFieldName: string;
1435
+ parentRelationFieldName: string;
1436
+ };
1437
+ export type TCollectionGalleryViewConfig = TCollectionPresentationViewConfigBase & {
1438
+ imageFieldName: string;
1439
+ titleFieldName: string;
1440
+ summaryFieldName: string;
1441
+ };
1442
+ export type TCollectionMapViewConfig = TCollectionPresentationViewConfigBase & {
1443
+ titleFieldName: string;
1444
+ locationFieldName: string;
1445
+ latitudeFieldName: string;
1446
+ longitudeFieldName: string;
1447
+ };
1448
+ export type TCollectionDocumentViewConfig = TCollectionPresentationViewConfigBase & {
1449
+ titleFieldName: string;
1450
+ bodyFieldName: string;
1451
+ metadataFieldNames: string[];
1452
+ };
1453
+ export type TCollectionViewConfig = TCollectionGridViewConfig | TCollectionBoardViewConfig | TCollectionCalendarViewConfig | TCollectionTimelineViewConfig | TCollectionTreeViewConfig | TCollectionGalleryViewConfig | TCollectionMapViewConfig | TCollectionDocumentViewConfig;
1454
+ export type TCollectionViewType = "grid" | "board" | "calendar" | "timeline" | "tree" | "gallery" | "map" | "document";
1455
+ export type TCollectionViewVisibility = "shared" | "personal";
1456
+ export type TCollectionViewPreference = {
1457
+ columns: TCollectionViewColumn[];
1458
+ updatedAt?: string;
1459
+ };
752
1460
  export type TCollectionView = {
753
1461
  id: string;
754
1462
  tenantId: string;
755
1463
  dataModelId: string;
756
1464
  collectionId: string;
757
1465
  name: string;
758
- type: string;
1466
+ type: TCollectionViewType;
759
1467
  config: TCollectionViewConfig;
1468
+ visibility?: TCollectionViewVisibility;
1469
+ ownerId?: string | null;
1470
+ isOwner?: boolean;
1471
+ canEdit?: boolean;
1472
+ preference?: TCollectionViewPreference | null;
760
1473
  createdAt: string;
761
1474
  updatedAt: string;
762
1475
  };
1476
+ export type TCollectionViewPreferenceResult = {
1477
+ viewId: string;
1478
+ userId: string;
1479
+ columns: TCollectionViewColumn[];
1480
+ updatedAt: string;
1481
+ };
763
1482
  export type TCollectionButtonAction = TAutomationRuleAction;
764
1483
  export type TCollectionButtonActivityItem = TAutomationRuleActivityItem;
765
1484
  export type TCollectionButton = {