@matech/thebigpos-sdk 2.43.8 → 2.43.11-ai-bi

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/index.ts CHANGED
@@ -398,6 +398,125 @@ export type AuditChangeType =
398
398
  | "Deactivated"
399
399
  | "Reactivated";
400
400
 
401
+ export type AiUrlSourceScope = "FullDomain" | "SpecificPath";
402
+
403
+ export type AiUrlSourceCategory =
404
+ | "Regulatory"
405
+ | "Guidelines"
406
+ | "MarketData"
407
+ | "Custom";
408
+
409
+ export type AiStructuredDataType =
410
+ | "Table"
411
+ | "DocumentAnalysis"
412
+ | "DocumentList"
413
+ | "GeneratedDocument";
414
+
415
+ export type AiQueryTemplateName =
416
+ | "PipelineSummary"
417
+ | "LoanDetail"
418
+ | "LoansClosing"
419
+ | "StaleLoans"
420
+ | "LoansByType"
421
+ | "LoansByOfficer"
422
+ | "AverageLoanAmount"
423
+ | "LockedVsUnlocked"
424
+ | "LoansByPurpose"
425
+ | "LoansByPropertyState"
426
+ | "LoansByRate"
427
+ | "DtiLtvRisk"
428
+ | "DisclosureTracking"
429
+ | "NewLoans"
430
+ | "ExpiringLocks"
431
+ | "ClosedLoans"
432
+ | "VerificationGaps"
433
+ | "CreditScoreDistribution"
434
+ | "OccupancyMix"
435
+ | "PropertyTypeMix"
436
+ | "FirstTimeHomebuyer"
437
+ | "SelfEmployed"
438
+ | "ReferralSourcePerformance"
439
+ | "AmortizationMix"
440
+ | "TimeToClose"
441
+ | "ConversionFunnel"
442
+ | "MonthlyProduction"
443
+ | "PaymentAffordability"
444
+ | "DownPaymentCashToClose"
445
+ | "ApprovalExpirations"
446
+ | "ApplicationCompleteness"
447
+ | "LosSyncHealth"
448
+ | "DeclarationsRisk"
449
+ | "MilitaryEligibility";
450
+
451
+ export type AiPromptCategory =
452
+ | "DocumentAnalysis"
453
+ | "DataQuery"
454
+ | "General"
455
+ | "Action";
456
+
457
+ export type AiOutputType = "Text" | "Document";
458
+
459
+ export type AiIntent =
460
+ | "Greeting"
461
+ | "Invalid"
462
+ | "Relevant"
463
+ | "LoanSpecific"
464
+ | "DocumentList"
465
+ | "GeneralKnowledge"
466
+ | "Blocked"
467
+ | "Action"
468
+ | "ConversationMeta";
469
+
470
+ export type AiGuardrailCategory =
471
+ | "ContentSafety"
472
+ | "PromptInjection"
473
+ | "Privacy"
474
+ | "Legal";
475
+
476
+ export type AiDisplayHint =
477
+ | "Table"
478
+ | "SummaryCards"
479
+ | "RankedList"
480
+ | "Comparison"
481
+ | "ExecutiveBrief";
482
+
483
+ export type AiConfigEntityType =
484
+ | "Prompt"
485
+ | "Guardrail"
486
+ | "CanonicalField"
487
+ | "UrlSource"
488
+ | "AdminSettings";
489
+
490
+ export type AiConfigChangeAction =
491
+ | "Created"
492
+ | "Updated"
493
+ | "Deleted"
494
+ | "Toggled";
495
+
496
+ export type AiAuditEventType =
497
+ | "Error"
498
+ | "GuardrailBlockedPre"
499
+ | "GuardrailPassedPre"
500
+ | "IntentClassified"
501
+ | "LoanResolvedFromMessage"
502
+ | "DocumentNotFound"
503
+ | "GuardrailBlockedPost"
504
+ | "GuardrailPassedPost"
505
+ | "DocumentAnalyzed"
506
+ | "DocumentList"
507
+ | "DocumentResolutionAmbiguous"
508
+ | "ResponseGenerated"
509
+ | "ParametersExtracted"
510
+ | "QueryExecuted"
511
+ | "LoanContextNotFound"
512
+ | "LoanContextLoaded"
513
+ | "GuardrailBlockedBedrock"
514
+ | "PromptMatched"
515
+ | "QueryCondensed"
516
+ | "IntentParseFailed"
517
+ | "LoanSearchTermDiscarded"
518
+ | "CanonicalFieldsSelected";
519
+
401
520
  export type AddressFamily =
402
521
  | "Unspecified"
403
522
  | "Unix"
@@ -518,12 +637,14 @@ export interface AccountSettings {
518
637
  smsNumber?: string | null;
519
638
  ssoHostOverride?: string | null;
520
639
  isEarlyAdopter: boolean;
640
+ isAIEnabled: boolean;
521
641
  }
522
642
 
523
643
  export interface AccountSettingsRequest {
524
644
  isSmsEnabled: boolean;
525
645
  smsNumber?: string | null;
526
646
  isEarlyAdopter: boolean;
647
+ isAIEnabled: boolean;
527
648
  }
528
649
 
529
650
  export interface Action {
@@ -677,6 +798,386 @@ export interface AffordabilityCalculatorRequest {
677
798
  annualInsurance: number;
678
799
  }
679
800
 
801
+ export interface AiAdminSettings {
802
+ bedrockModelId: string;
803
+ /** @format int32 */
804
+ maxTokens: number;
805
+ /** @format double */
806
+ temperature: number;
807
+ /** @format int32 */
808
+ conversationContextTurns: number;
809
+ /** @format int32 */
810
+ requestTimeoutSeconds: number;
811
+ bedrockRegion: string;
812
+ }
813
+
814
+ export interface AiAdminSettingsRequest {
815
+ bedrockModelId?: string | null;
816
+ /** @format int32 */
817
+ maxTokens?: number | null;
818
+ /** @format double */
819
+ temperature?: number | null;
820
+ /** @format int32 */
821
+ conversationContextTurns?: number | null;
822
+ /** @format int32 */
823
+ requestTimeoutSeconds?: number | null;
824
+ }
825
+
826
+ export interface AiAdminStats {
827
+ /** @format int32 */
828
+ totalRequests: number;
829
+ /** @format int32 */
830
+ blockedRequests: number;
831
+ /** @format double */
832
+ averageResponseTimeMs: number;
833
+ /** @format int32 */
834
+ totalInputTokens: number;
835
+ /** @format int32 */
836
+ totalOutputTokens: number;
837
+ /** @format int32 */
838
+ totalTokens: number;
839
+ intentDistribution: Record<string, number>;
840
+ topQueryTemplates: Record<string, number>;
841
+ period: string;
842
+ }
843
+
844
+ export interface AiAuditLog {
845
+ /** @format uuid */
846
+ id: string;
847
+ /** @format uuid */
848
+ requestId: string;
849
+ /** @format uuid */
850
+ userId: string;
851
+ /** @format uuid */
852
+ conversationId?: string | null;
853
+ /** @format uuid */
854
+ messageId?: string | null;
855
+ eventType:
856
+ | "Error"
857
+ | "GuardrailBlockedPre"
858
+ | "GuardrailPassedPre"
859
+ | "IntentClassified"
860
+ | "LoanResolvedFromMessage"
861
+ | "DocumentNotFound"
862
+ | "GuardrailBlockedPost"
863
+ | "GuardrailPassedPost"
864
+ | "DocumentAnalyzed"
865
+ | "DocumentList"
866
+ | "DocumentResolutionAmbiguous"
867
+ | "ResponseGenerated"
868
+ | "ParametersExtracted"
869
+ | "QueryExecuted"
870
+ | "LoanContextNotFound"
871
+ | "LoanContextLoaded"
872
+ | "GuardrailBlockedBedrock"
873
+ | "PromptMatched"
874
+ | "QueryCondensed"
875
+ | "IntentParseFailed"
876
+ | "LoanSearchTermDiscarded"
877
+ | "CanonicalFieldsSelected";
878
+ modelId?: string | null;
879
+ /** @format int32 */
880
+ inputTokens?: number | null;
881
+ /** @format int32 */
882
+ outputTokens?: number | null;
883
+ /** @format int32 */
884
+ latencyMs?: number | null;
885
+ bedrockRequestId?: string | null;
886
+ guardrailName?: string | null;
887
+ guardrailCategory?: string | null;
888
+ rawRequest?: string | null;
889
+ rawResponse?: string | null;
890
+ details?: any;
891
+ /** @format date-time */
892
+ createdAt: string;
893
+ }
894
+
895
+ export interface AiAuditLogPaginated {
896
+ rows: AiAuditLog[];
897
+ pagination: Pagination;
898
+ /** @format int64 */
899
+ count: number;
900
+ }
901
+
902
+ export interface AiCanonicalField {
903
+ /** @format uuid */
904
+ id: string;
905
+ canonicalName: string;
906
+ displayName: string;
907
+ description: string;
908
+ allowedRoles: string[];
909
+ efPath?: string | null;
910
+ isPii: boolean;
911
+ isActive: boolean;
912
+ dataSource: string;
913
+ isDefault: boolean;
914
+ category?: string | null;
915
+ jsonPropertyName?: string | null;
916
+ textractKey?: string | null;
917
+ textractKeyAliases: string[];
918
+ hasAccountOverride: boolean;
919
+ /** @format date-time */
920
+ createdAt: string;
921
+ /** @format date-time */
922
+ updatedAt?: string | null;
923
+ }
924
+
925
+ export interface AiChat {
926
+ /** @format uuid */
927
+ conversationId: string;
928
+ /** @format uuid */
929
+ messageId: string;
930
+ response: AiChatBody;
931
+ metadata: AiChatMetadata;
932
+ }
933
+
934
+ export interface AiChatBody {
935
+ text: string;
936
+ data?: AiChatStructuredData | null;
937
+ }
938
+
939
+ export interface AiChatMessage {
940
+ /** @format uuid */
941
+ id: string;
942
+ userMessage: string;
943
+ assistantResponse: string;
944
+ intent?: AiIntent | null;
945
+ fieldsAccessed?: string[] | null;
946
+ data?: AiChatStructuredData | null;
947
+ /** @format date-time */
948
+ createdAt: string;
949
+ }
950
+
951
+ export interface AiChatMessagePaginated {
952
+ rows: AiChatMessage[];
953
+ pagination: Pagination;
954
+ /** @format int64 */
955
+ count: number;
956
+ }
957
+
958
+ export interface AiChatMetadata {
959
+ intent:
960
+ | "Greeting"
961
+ | "Invalid"
962
+ | "Relevant"
963
+ | "LoanSpecific"
964
+ | "DocumentList"
965
+ | "GeneralKnowledge"
966
+ | "Blocked"
967
+ | "Action"
968
+ | "ConversationMeta";
969
+ fieldsAccessed: string[];
970
+ /** @format int64 */
971
+ queryTimeMs: number;
972
+ /** @format int64 */
973
+ llmTimeMs: number;
974
+ /** @format int32 */
975
+ inputTokens: number;
976
+ /** @format int32 */
977
+ outputTokens: number;
978
+ modelId?: string | null;
979
+ wasBlocked: boolean;
980
+ blockedReason?: string | null;
981
+ }
982
+
983
+ export interface AiChatRequest {
984
+ message: string;
985
+ /** @format uuid */
986
+ conversationId?: string | null;
987
+ /** @format uuid */
988
+ loanId?: string | null;
989
+ documentIds?: string[] | null;
990
+ /** @format uuid */
991
+ promptId?: string | null;
992
+ }
993
+
994
+ export interface AiChatStructuredData {
995
+ type: "Table" | "DocumentAnalysis" | "DocumentList" | "GeneratedDocument";
996
+ displayHint?: AiDisplayHint | null;
997
+ detectedDocumentType?: string | null;
998
+ columns: string[];
999
+ rows: string[][];
1000
+ /** @format uuid */
1001
+ generatedDocumentId?: string | null;
1002
+ generatedFileName?: string | null;
1003
+ }
1004
+
1005
+ export interface AiConfigChangeLog {
1006
+ /** @format uuid */
1007
+ id: string;
1008
+ /** @format uuid */
1009
+ accountId?: string | null;
1010
+ /** @format uuid */
1011
+ actorUserId: string;
1012
+ entityType:
1013
+ | "Prompt"
1014
+ | "Guardrail"
1015
+ | "CanonicalField"
1016
+ | "UrlSource"
1017
+ | "AdminSettings";
1018
+ /** @format uuid */
1019
+ entityId?: string | null;
1020
+ action: "Created" | "Updated" | "Deleted" | "Toggled";
1021
+ before?: any;
1022
+ after?: any;
1023
+ /** @format date-time */
1024
+ createdAt: string;
1025
+ }
1026
+
1027
+ export interface AiConfigChangeLogPaginated {
1028
+ rows: AiConfigChangeLog[];
1029
+ pagination: Pagination;
1030
+ /** @format int64 */
1031
+ count: number;
1032
+ }
1033
+
1034
+ export interface AiConversationAuditSummary {
1035
+ /** @format uuid */
1036
+ conversationId: string;
1037
+ /** @format uuid */
1038
+ userId: string;
1039
+ userName?: string | null;
1040
+ userRole?: string | null;
1041
+ name?: string | null;
1042
+ /** @format int32 */
1043
+ turnCount: number;
1044
+ /** @format int32 */
1045
+ completedCount: number;
1046
+ /** @format int32 */
1047
+ blockedCount: number;
1048
+ /** @format int32 */
1049
+ errorCount: number;
1050
+ /** @format int32 */
1051
+ totalTokens: number;
1052
+ /** @format date-time */
1053
+ lastActivityAt: string;
1054
+ }
1055
+
1056
+ export interface AiConversationAuditSummaryPaginated {
1057
+ rows: AiConversationAuditSummary[];
1058
+ pagination: Pagination;
1059
+ /** @format int64 */
1060
+ count: number;
1061
+ }
1062
+
1063
+ export interface AiConversationDetail {
1064
+ /** @format uuid */
1065
+ id: string;
1066
+ name?: string | null;
1067
+ isPinned: boolean;
1068
+ /** @format date-time */
1069
+ createdAt: string;
1070
+ /** @format date-time */
1071
+ updatedAt?: string | null;
1072
+ /** @format int32 */
1073
+ messageCount: number;
1074
+ }
1075
+
1076
+ export interface AiConversationListItem {
1077
+ /** @format uuid */
1078
+ id: string;
1079
+ /** @format uuid */
1080
+ userId: string;
1081
+ name?: string | null;
1082
+ preview: string;
1083
+ /** @format int32 */
1084
+ messageCount: number;
1085
+ isPinned: boolean;
1086
+ /** @format date-time */
1087
+ createdAt: string;
1088
+ /** @format date-time */
1089
+ updatedAt?: string | null;
1090
+ }
1091
+
1092
+ export interface AiConversationListItemPaginated {
1093
+ rows: AiConversationListItem[];
1094
+ pagination: Pagination;
1095
+ /** @format int64 */
1096
+ count: number;
1097
+ }
1098
+
1099
+ export interface AiGuardrail {
1100
+ /** @format uuid */
1101
+ id: string;
1102
+ name: string;
1103
+ category: "ContentSafety" | "PromptInjection" | "Privacy" | "Legal";
1104
+ description?: string | null;
1105
+ keywords: string[];
1106
+ responseTemplate: string;
1107
+ isDefault: boolean;
1108
+ isEnabled: boolean;
1109
+ hasAccountOverride: boolean;
1110
+ /** @format date-time */
1111
+ createdAt: string;
1112
+ /** @format date-time */
1113
+ updatedAt?: string | null;
1114
+ }
1115
+
1116
+ export interface AiPrompt {
1117
+ /** @format uuid */
1118
+ id: string;
1119
+ title: string;
1120
+ slug?: string | null;
1121
+ description: string;
1122
+ documentTypes: string[];
1123
+ applicableUrlSourceIds: string[];
1124
+ allowedRoles: string[];
1125
+ systemPrompt: string;
1126
+ /** @format int32 */
1127
+ sortOrder: number;
1128
+ isDefault: boolean;
1129
+ /** @format uuid */
1130
+ accountId?: string | null;
1131
+ isActive: boolean;
1132
+ category?: AiPromptCategory | null;
1133
+ queryTemplateName?: AiQueryTemplateName | null;
1134
+ displayHint?: AiDisplayHint | null;
1135
+ bedrockModelId?: string | null;
1136
+ requiredDataSources?: string[] | null;
1137
+ outputType?: AiOutputType | null;
1138
+ hasAccountOverride: boolean;
1139
+ /** @format date-time */
1140
+ createdAt: string;
1141
+ /** @format date-time */
1142
+ updatedAt?: string | null;
1143
+ }
1144
+
1145
+ export interface AiPromptSummary {
1146
+ /** @format uuid */
1147
+ id: string;
1148
+ title: string;
1149
+ slug?: string | null;
1150
+ description: string;
1151
+ documentTypes: string[];
1152
+ applicableUrlSourceIds: string[];
1153
+ /** @format int32 */
1154
+ sortOrder: number;
1155
+ category?: AiPromptCategory | null;
1156
+ queryTemplateName?: AiQueryTemplateName | null;
1157
+ displayHint?: AiDisplayHint | null;
1158
+ bedrockModelId?: string | null;
1159
+ requiredDataSources?: string[] | null;
1160
+ outputType?: AiOutputType | null;
1161
+ }
1162
+
1163
+ export interface AiUrlSource {
1164
+ /** @format uuid */
1165
+ id: string;
1166
+ slug?: string | null;
1167
+ name: string;
1168
+ url: string;
1169
+ description?: string | null;
1170
+ category: "Regulatory" | "Guidelines" | "MarketData" | "Custom";
1171
+ scope: "FullDomain" | "SpecificPath";
1172
+ isActive: boolean;
1173
+ isDefault: boolean;
1174
+ hasAccountOverride: boolean;
1175
+ /** @format date-time */
1176
+ createdAt: string;
1177
+ /** @format date-time */
1178
+ updatedAt?: string | null;
1179
+ }
1180
+
680
1181
  export interface AllowImpersonationRequest {
681
1182
  email: string;
682
1183
  }
@@ -1166,6 +1667,49 @@ export interface CreateAccountRequest {
1166
1667
  billingSettings: AccountBillingRequest;
1167
1668
  }
1168
1669
 
1670
+ export interface CreateAiCanonicalFieldRequest {
1671
+ displayName: string;
1672
+ description: string;
1673
+ allowedRoles: string[];
1674
+ isPii: boolean;
1675
+ dataSource: string;
1676
+ category?: string | null;
1677
+ }
1678
+
1679
+ export interface CreateAiGuardrailRequest {
1680
+ name: string;
1681
+ category: "ContentSafety" | "PromptInjection" | "Privacy" | "Legal";
1682
+ description?: string | null;
1683
+ keywords: string[];
1684
+ responseTemplate: string;
1685
+ }
1686
+
1687
+ export interface CreateAiPromptRequest {
1688
+ title: string;
1689
+ slug?: string | null;
1690
+ description: string;
1691
+ documentTypes: string[];
1692
+ applicableUrlSourceIds: string[];
1693
+ allowedRoles: string[];
1694
+ systemPrompt: string;
1695
+ /** @format int32 */
1696
+ sortOrder: number;
1697
+ category?: AiPromptCategory | null;
1698
+ queryTemplateName?: AiQueryTemplateName | null;
1699
+ displayHint?: AiDisplayHint | null;
1700
+ bedrockModelId?: string | null;
1701
+ requiredDataSources?: string[] | null;
1702
+ outputType?: AiOutputType | null;
1703
+ }
1704
+
1705
+ export interface CreateAiUrlSourceRequest {
1706
+ name: string;
1707
+ url: string;
1708
+ description?: string | null;
1709
+ category: "Regulatory" | "Guidelines" | "MarketData" | "Custom";
1710
+ scope: "FullDomain" | "SpecificPath";
1711
+ }
1712
+
1169
1713
  export interface CreateBranchRequest {
1170
1714
  name: string;
1171
1715
  /** @format uuid */
@@ -2234,6 +2778,15 @@ export interface GenerateDocumentRequest {
2234
2778
  recipients: string[];
2235
2779
  }
2236
2780
 
2781
+ export interface GenerateSystemPrompt {
2782
+ systemPrompt: string;
2783
+ }
2784
+
2785
+ export interface GenerateSystemPromptRequest {
2786
+ description: string;
2787
+ category: "DocumentAnalysis" | "DataQuery" | "General" | "Action";
2788
+ }
2789
+
2237
2790
  export interface GetApplications {
2238
2791
  applications: ApplicationRowData[];
2239
2792
  }
@@ -4529,6 +5082,10 @@ export interface PendingTasksSummary {
4529
5082
  borrowers: BorrowerCount[];
4530
5083
  }
4531
5084
 
5085
+ export interface PinAiConversationRequest {
5086
+ isPinned: boolean;
5087
+ }
5088
+
4532
5089
  export interface PostLoanComparisonPdfRequest {
4533
5090
  /** @format uuid */
4534
5091
  siteConfigurationID: string;
@@ -4689,6 +5246,10 @@ export interface RegisterUserRequest {
4689
5246
  inviteCode?: string | null;
4690
5247
  }
4691
5248
 
5249
+ export interface RenameAiConversationRequest {
5250
+ name: string;
5251
+ }
5252
+
4692
5253
  export interface RequestImpersonationRequest {
4693
5254
  email: string;
4694
5255
  }
@@ -5468,6 +6029,14 @@ export interface SocialSurveyRecord {
5468
6029
  reviewCompletedTimeStamp?: string | null;
5469
6030
  }
5470
6031
 
6032
+ export interface SupportedModel {
6033
+ modelId: string;
6034
+ displayName: string;
6035
+ provider: string;
6036
+ description?: string | null;
6037
+ isDefault: boolean;
6038
+ }
6039
+
5471
6040
  export interface SurveyEmailRequest {
5472
6041
  loanOfficerEmailAddress: string;
5473
6042
  }
@@ -5729,6 +6298,47 @@ export interface UpdateAccountRequest {
5729
6298
  settings: AccountSettingsRequest;
5730
6299
  }
5731
6300
 
6301
+ export interface UpdateAiCanonicalFieldRequest {
6302
+ displayName: string;
6303
+ description: string;
6304
+ allowedRoles: string[];
6305
+ isPii: boolean;
6306
+ category?: string | null;
6307
+ }
6308
+
6309
+ export interface UpdateAiGuardrailRequest {
6310
+ name: string;
6311
+ category: "ContentSafety" | "PromptInjection" | "Privacy" | "Legal";
6312
+ description?: string | null;
6313
+ keywords: string[];
6314
+ responseTemplate: string;
6315
+ }
6316
+
6317
+ export interface UpdateAiPromptRequest {
6318
+ title: string;
6319
+ description: string;
6320
+ documentTypes: string[];
6321
+ applicableUrlSourceIds: string[];
6322
+ allowedRoles: string[];
6323
+ systemPrompt: string;
6324
+ /** @format int32 */
6325
+ sortOrder: number;
6326
+ category?: AiPromptCategory | null;
6327
+ queryTemplateName?: AiQueryTemplateName | null;
6328
+ displayHint?: AiDisplayHint | null;
6329
+ bedrockModelId?: string | null;
6330
+ requiredDataSources?: string[] | null;
6331
+ outputType?: AiOutputType | null;
6332
+ }
6333
+
6334
+ export interface UpdateAiUrlSourceRequest {
6335
+ name: string;
6336
+ url: string;
6337
+ description?: string | null;
6338
+ category: "Regulatory" | "Guidelines" | "MarketData" | "Custom";
6339
+ scope: "FullDomain" | "SpecificPath";
6340
+ }
6341
+
5732
6342
  export interface UpdateCustomFieldDefinitionRequest {
5733
6343
  isRequired: boolean;
5734
6344
  /** @format int32 */
@@ -6505,7 +7115,7 @@ export class HttpClient<SecurityDataType = unknown> {
6505
7115
 
6506
7116
  /**
6507
7117
  * @title The Big POS API
6508
- * @version v2.43.8
7118
+ * @version v2.43.11
6509
7119
  * @termsOfService https://www.thebigpos.com/terms-of-use/
6510
7120
  * @contact Mortgage Automation Technologies <support@thebigpos.com> (https://www.thebigpos.com/terms-of-use/)
6511
7121
  */
@@ -6804,19 +7414,1246 @@ export class Api<
6804
7414
  /**
6805
7415
  * No description
6806
7416
  *
6807
- * @tags AuditLog
6808
- * @name SearchAuditLogs
6809
- * @summary Search
6810
- * @request POST:/api/audit-logs/search
7417
+ * @tags AiAdmin
7418
+ * @name GetAiAuditLogs
7419
+ * @summary Get paginated audit logs
7420
+ * @request GET:/api/ai/admin/audit-logs
6811
7421
  * @secure
6812
- * @response `200` `AuditLogEntryPaginated` OK
7422
+ * @response `200` `AiAuditLogPaginated` OK
6813
7423
  */
6814
- searchAuditLogs: (
6815
- data: AuditLogSearchCriteria,
7424
+ getAiAuditLogs: (
6816
7425
  query?: {
6817
- /** @format int32 */
6818
- pageSize?: number;
6819
- /** @format int32 */
7426
+ eventType?: AiAuditEventType;
7427
+ /** @format uuid */
7428
+ requestId?: string;
7429
+ /** @format uuid */
7430
+ userId?: string;
7431
+ /** @format uuid */
7432
+ conversationId?: string;
7433
+ blockedOnly?: boolean;
7434
+ /** @format date-time */
7435
+ startDate?: string;
7436
+ /** @format date-time */
7437
+ endDate?: string;
7438
+ /** @format int32 */
7439
+ pageSize?: number;
7440
+ /** @format int32 */
7441
+ pageNumber?: number;
7442
+ sortBy?: string;
7443
+ sortDirection?: string;
7444
+ },
7445
+ params: RequestParams = {},
7446
+ ) =>
7447
+ this.request<AiAuditLogPaginated, any>({
7448
+ path: `/api/ai/admin/audit-logs`,
7449
+ method: "GET",
7450
+ query: query,
7451
+ secure: true,
7452
+ format: "json",
7453
+ ...params,
7454
+ }),
7455
+
7456
+ /**
7457
+ * No description
7458
+ *
7459
+ * @tags AiAdmin
7460
+ * @name GetAiRequestLifecycle
7461
+ * @summary Get the full event lifecycle of a single AI request
7462
+ * @request GET:/api/ai/admin/audit-logs/request/{requestId}
7463
+ * @secure
7464
+ * @response `200` `(AiAuditLog)[]` OK
7465
+ */
7466
+ getAiRequestLifecycle: (requestId: string, params: RequestParams = {}) =>
7467
+ this.request<AiAuditLog[], any>({
7468
+ path: `/api/ai/admin/audit-logs/request/${requestId}`,
7469
+ method: "GET",
7470
+ secure: true,
7471
+ format: "json",
7472
+ ...params,
7473
+ }),
7474
+
7475
+ /**
7476
+ * No description
7477
+ *
7478
+ * @tags AiAdmin
7479
+ * @name GetAiAuditConversations
7480
+ * @summary List conversations with their audit roll-up — origin user, turns, status, tokens
7481
+ * @request GET:/api/ai/admin/audit-conversations
7482
+ * @secure
7483
+ * @response `200` `AiConversationAuditSummaryPaginated` OK
7484
+ */
7485
+ getAiAuditConversations: (
7486
+ query?: {
7487
+ searchText?: string;
7488
+ /** @format date-time */
7489
+ startDate?: string;
7490
+ /** @format date-time */
7491
+ endDate?: string;
7492
+ /** @format int32 */
7493
+ pageSize?: number;
7494
+ /** @format int32 */
7495
+ pageNumber?: number;
7496
+ sortBy?: string;
7497
+ sortDirection?: string;
7498
+ },
7499
+ params: RequestParams = {},
7500
+ ) =>
7501
+ this.request<AiConversationAuditSummaryPaginated, any>({
7502
+ path: `/api/ai/admin/audit-conversations`,
7503
+ method: "GET",
7504
+ query: query,
7505
+ secure: true,
7506
+ format: "json",
7507
+ ...params,
7508
+ }),
7509
+
7510
+ /**
7511
+ * No description
7512
+ *
7513
+ * @tags AiAdmin
7514
+ * @name GetAiAdminStats
7515
+ * @summary Get AI admin dashboard stats
7516
+ * @request GET:/api/ai/admin/stats
7517
+ * @secure
7518
+ * @response `200` `AiAdminStats` OK
7519
+ */
7520
+ getAiAdminStats: (
7521
+ query?: {
7522
+ /** @format date-time */
7523
+ startDate?: string;
7524
+ /** @format date-time */
7525
+ endDate?: string;
7526
+ },
7527
+ params: RequestParams = {},
7528
+ ) =>
7529
+ this.request<AiAdminStats, any>({
7530
+ path: `/api/ai/admin/stats`,
7531
+ method: "GET",
7532
+ query: query,
7533
+ secure: true,
7534
+ format: "json",
7535
+ ...params,
7536
+ }),
7537
+
7538
+ /**
7539
+ * No description
7540
+ *
7541
+ * @tags AiAdmin
7542
+ * @name GetAiConfigChanges
7543
+ * @summary Get the AI configuration change history (who changed prompts, guardrails, fields, sources)
7544
+ * @request GET:/api/ai/admin/config-changes
7545
+ * @secure
7546
+ * @response `200` `AiConfigChangeLogPaginated` OK
7547
+ */
7548
+ getAiConfigChanges: (
7549
+ query?: {
7550
+ entityType?: AiConfigEntityType;
7551
+ /** @format uuid */
7552
+ entityId?: string;
7553
+ /** @format uuid */
7554
+ actorUserId?: string;
7555
+ action?: AiConfigChangeAction;
7556
+ /** @format date-time */
7557
+ startDate?: string;
7558
+ /** @format date-time */
7559
+ endDate?: string;
7560
+ /** @format int32 */
7561
+ pageSize?: number;
7562
+ /** @format int32 */
7563
+ pageNumber?: number;
7564
+ sortBy?: string;
7565
+ sortDirection?: string;
7566
+ },
7567
+ params: RequestParams = {},
7568
+ ) =>
7569
+ this.request<AiConfigChangeLogPaginated, any>({
7570
+ path: `/api/ai/admin/config-changes`,
7571
+ method: "GET",
7572
+ query: query,
7573
+ secure: true,
7574
+ format: "json",
7575
+ ...params,
7576
+ }),
7577
+
7578
+ /**
7579
+ * No description
7580
+ *
7581
+ * @tags AiAdminPrompt
7582
+ * @name GetAiPrompts
7583
+ * @summary Get all prompts
7584
+ * @request GET:/api/ai/admin/prompts
7585
+ * @secure
7586
+ * @response `200` `(AiPrompt)[]` OK
7587
+ */
7588
+ getAiPrompts: (params: RequestParams = {}) =>
7589
+ this.request<AiPrompt[], any>({
7590
+ path: `/api/ai/admin/prompts`,
7591
+ method: "GET",
7592
+ secure: true,
7593
+ format: "json",
7594
+ ...params,
7595
+ }),
7596
+
7597
+ /**
7598
+ * No description
7599
+ *
7600
+ * @tags AiAdminPrompt
7601
+ * @name CreateAiPrompt
7602
+ * @summary Create custom prompt
7603
+ * @request POST:/api/ai/admin/prompts
7604
+ * @secure
7605
+ * @response `201` `AiPrompt` Created
7606
+ * @response `400` `ProblemDetails` Bad Request
7607
+ */
7608
+ createAiPrompt: (data: CreateAiPromptRequest, params: RequestParams = {}) =>
7609
+ this.request<AiPrompt, ProblemDetails>({
7610
+ path: `/api/ai/admin/prompts`,
7611
+ method: "POST",
7612
+ body: data,
7613
+ secure: true,
7614
+ type: ContentType.Json,
7615
+ format: "json",
7616
+ ...params,
7617
+ }),
7618
+
7619
+ /**
7620
+ * No description
7621
+ *
7622
+ * @tags AiAdminPrompt
7623
+ * @name GetAiPrompt
7624
+ * @summary Get prompt by ID
7625
+ * @request GET:/api/ai/admin/prompts/{id}
7626
+ * @secure
7627
+ * @response `200` `AiPrompt` OK
7628
+ * @response `404` `ProblemDetails` Not Found
7629
+ */
7630
+ getAiPrompt: (id: string, params: RequestParams = {}) =>
7631
+ this.request<AiPrompt, ProblemDetails>({
7632
+ path: `/api/ai/admin/prompts/${id}`,
7633
+ method: "GET",
7634
+ secure: true,
7635
+ format: "json",
7636
+ ...params,
7637
+ }),
7638
+
7639
+ /**
7640
+ * No description
7641
+ *
7642
+ * @tags AiAdminPrompt
7643
+ * @name UpdateAiPrompt
7644
+ * @summary Update prompt
7645
+ * @request PUT:/api/ai/admin/prompts/{id}
7646
+ * @secure
7647
+ * @response `200` `AiPrompt` OK
7648
+ * @response `400` `ProblemDetails` Bad Request
7649
+ * @response `404` `ProblemDetails` Not Found
7650
+ */
7651
+ updateAiPrompt: (
7652
+ id: string,
7653
+ data: UpdateAiPromptRequest,
7654
+ params: RequestParams = {},
7655
+ ) =>
7656
+ this.request<AiPrompt, ProblemDetails>({
7657
+ path: `/api/ai/admin/prompts/${id}`,
7658
+ method: "PUT",
7659
+ body: data,
7660
+ secure: true,
7661
+ type: ContentType.Json,
7662
+ format: "json",
7663
+ ...params,
7664
+ }),
7665
+
7666
+ /**
7667
+ * No description
7668
+ *
7669
+ * @tags AiAdminPrompt
7670
+ * @name DeleteAiPrompt
7671
+ * @summary Delete prompt
7672
+ * @request DELETE:/api/ai/admin/prompts/{id}
7673
+ * @secure
7674
+ * @response `204` `void` No Content
7675
+ * @response `400` `ProblemDetails` Bad Request
7676
+ * @response `404` `ProblemDetails` Not Found
7677
+ */
7678
+ deleteAiPrompt: (id: string, params: RequestParams = {}) =>
7679
+ this.request<void, ProblemDetails>({
7680
+ path: `/api/ai/admin/prompts/${id}`,
7681
+ method: "DELETE",
7682
+ secure: true,
7683
+ ...params,
7684
+ }),
7685
+
7686
+ /**
7687
+ * No description
7688
+ *
7689
+ * @tags AiAdminPrompt
7690
+ * @name ToggleAiPrompt
7691
+ * @summary Toggle prompt active/inactive
7692
+ * @request PATCH:/api/ai/admin/prompts/{id}/toggle
7693
+ * @secure
7694
+ * @response `200` `AiPrompt` OK
7695
+ * @response `404` `ProblemDetails` Not Found
7696
+ */
7697
+ toggleAiPrompt: (id: string, params: RequestParams = {}) =>
7698
+ this.request<AiPrompt, ProblemDetails>({
7699
+ path: `/api/ai/admin/prompts/${id}/toggle`,
7700
+ method: "PATCH",
7701
+ secure: true,
7702
+ format: "json",
7703
+ ...params,
7704
+ }),
7705
+
7706
+ /**
7707
+ * No description
7708
+ *
7709
+ * @tags AiAdminPrompt
7710
+ * @name GenerateAiSystemPrompt
7711
+ * @summary Generate a system prompt from description
7712
+ * @request POST:/api/ai/admin/prompts/generate
7713
+ * @secure
7714
+ * @response `200` `GenerateSystemPrompt` OK
7715
+ * @response `400` `ProblemDetails` Bad Request
7716
+ */
7717
+ generateAiSystemPrompt: (
7718
+ data: GenerateSystemPromptRequest,
7719
+ params: RequestParams = {},
7720
+ ) =>
7721
+ this.request<GenerateSystemPrompt, ProblemDetails>({
7722
+ path: `/api/ai/admin/prompts/generate`,
7723
+ method: "POST",
7724
+ body: data,
7725
+ secure: true,
7726
+ type: ContentType.JsonPatch,
7727
+ format: "json",
7728
+ ...params,
7729
+ }),
7730
+
7731
+ /**
7732
+ * No description
7733
+ *
7734
+ * @tags AiAdminPrompt
7735
+ * @name GetSupportedModels
7736
+ * @summary Get supported LLM models
7737
+ * @request GET:/api/ai/admin/prompts/supported-models
7738
+ * @secure
7739
+ * @response `200` `(SupportedModel)[]` OK
7740
+ */
7741
+ getSupportedModels: (params: RequestParams = {}) =>
7742
+ this.request<SupportedModel[], any>({
7743
+ path: `/api/ai/admin/prompts/supported-models`,
7744
+ method: "GET",
7745
+ secure: true,
7746
+ format: "json",
7747
+ ...params,
7748
+ }),
7749
+
7750
+ /**
7751
+ * No description
7752
+ *
7753
+ * @tags AiAdminSettings
7754
+ * @name GetAiAdminSettings
7755
+ * @summary Get global AI settings
7756
+ * @request GET:/api/ai/admin/settings
7757
+ * @secure
7758
+ * @response `200` `AiAdminSettings` OK
7759
+ */
7760
+ getAiAdminSettings: (params: RequestParams = {}) =>
7761
+ this.request<AiAdminSettings, any>({
7762
+ path: `/api/ai/admin/settings`,
7763
+ method: "GET",
7764
+ secure: true,
7765
+ format: "json",
7766
+ ...params,
7767
+ }),
7768
+
7769
+ /**
7770
+ * No description
7771
+ *
7772
+ * @tags AiAdminSettings
7773
+ * @name UpdateAiAdminSettings
7774
+ * @summary Update global AI settings
7775
+ * @request PUT:/api/ai/admin/settings
7776
+ * @secure
7777
+ * @response `200` `AiAdminSettings` OK
7778
+ * @response `400` `ProblemDetails` Bad Request
7779
+ */
7780
+ updateAiAdminSettings: (
7781
+ data: AiAdminSettingsRequest,
7782
+ params: RequestParams = {},
7783
+ ) =>
7784
+ this.request<AiAdminSettings, ProblemDetails>({
7785
+ path: `/api/ai/admin/settings`,
7786
+ method: "PUT",
7787
+ body: data,
7788
+ secure: true,
7789
+ type: ContentType.Json,
7790
+ format: "json",
7791
+ ...params,
7792
+ }),
7793
+
7794
+ /**
7795
+ * No description
7796
+ *
7797
+ * @tags AiCanonicalField
7798
+ * @name GetAiCanonicalFields
7799
+ * @summary Get all canonical fields
7800
+ * @request GET:/api/ai/admin/fields
7801
+ * @secure
7802
+ * @response `200` `(AiCanonicalField)[]` OK
7803
+ */
7804
+ getAiCanonicalFields: (params: RequestParams = {}) =>
7805
+ this.request<AiCanonicalField[], any>({
7806
+ path: `/api/ai/admin/fields`,
7807
+ method: "GET",
7808
+ secure: true,
7809
+ format: "json",
7810
+ ...params,
7811
+ }),
7812
+
7813
+ /**
7814
+ * No description
7815
+ *
7816
+ * @tags AiCanonicalField
7817
+ * @name CreateAiCanonicalField
7818
+ * @summary Create canonical field
7819
+ * @request POST:/api/ai/admin/fields
7820
+ * @secure
7821
+ * @response `201` `AiCanonicalField` Created
7822
+ * @response `400` `ProblemDetails` Bad Request
7823
+ */
7824
+ createAiCanonicalField: (
7825
+ data: CreateAiCanonicalFieldRequest,
7826
+ params: RequestParams = {},
7827
+ ) =>
7828
+ this.request<AiCanonicalField, ProblemDetails>({
7829
+ path: `/api/ai/admin/fields`,
7830
+ method: "POST",
7831
+ body: data,
7832
+ secure: true,
7833
+ type: ContentType.Json,
7834
+ format: "json",
7835
+ ...params,
7836
+ }),
7837
+
7838
+ /**
7839
+ * No description
7840
+ *
7841
+ * @tags AiCanonicalField
7842
+ * @name GetAiCanonicalField
7843
+ * @summary Get canonical field by ID
7844
+ * @request GET:/api/ai/admin/fields/{id}
7845
+ * @secure
7846
+ * @response `200` `AiCanonicalField` OK
7847
+ * @response `404` `ProblemDetails` Not Found
7848
+ */
7849
+ getAiCanonicalField: (id: string, params: RequestParams = {}) =>
7850
+ this.request<AiCanonicalField, ProblemDetails>({
7851
+ path: `/api/ai/admin/fields/${id}`,
7852
+ method: "GET",
7853
+ secure: true,
7854
+ format: "json",
7855
+ ...params,
7856
+ }),
7857
+
7858
+ /**
7859
+ * No description
7860
+ *
7861
+ * @tags AiCanonicalField
7862
+ * @name UpdateAiCanonicalField
7863
+ * @summary Update canonical field
7864
+ * @request PUT:/api/ai/admin/fields/{id}
7865
+ * @secure
7866
+ * @response `200` `AiCanonicalField` OK
7867
+ * @response `400` `ProblemDetails` Bad Request
7868
+ * @response `404` `ProblemDetails` Not Found
7869
+ */
7870
+ updateAiCanonicalField: (
7871
+ id: string,
7872
+ data: UpdateAiCanonicalFieldRequest,
7873
+ params: RequestParams = {},
7874
+ ) =>
7875
+ this.request<AiCanonicalField, ProblemDetails>({
7876
+ path: `/api/ai/admin/fields/${id}`,
7877
+ method: "PUT",
7878
+ body: data,
7879
+ secure: true,
7880
+ type: ContentType.Json,
7881
+ format: "json",
7882
+ ...params,
7883
+ }),
7884
+
7885
+ /**
7886
+ * No description
7887
+ *
7888
+ * @tags AiCanonicalField
7889
+ * @name DeleteAiCanonicalField
7890
+ * @summary Delete canonical field
7891
+ * @request DELETE:/api/ai/admin/fields/{id}
7892
+ * @secure
7893
+ * @response `204` `void` No Content
7894
+ * @response `404` `ProblemDetails` Not Found
7895
+ */
7896
+ deleteAiCanonicalField: (id: string, params: RequestParams = {}) =>
7897
+ this.request<void, ProblemDetails>({
7898
+ path: `/api/ai/admin/fields/${id}`,
7899
+ method: "DELETE",
7900
+ secure: true,
7901
+ ...params,
7902
+ }),
7903
+
7904
+ /**
7905
+ * No description
7906
+ *
7907
+ * @tags AiCanonicalField
7908
+ * @name ToggleAiCanonicalField
7909
+ * @summary Toggle canonical field active/inactive
7910
+ * @request PATCH:/api/ai/admin/fields/{id}/toggle
7911
+ * @secure
7912
+ * @response `200` `AiCanonicalField` OK
7913
+ * @response `404` `ProblemDetails` Not Found
7914
+ */
7915
+ toggleAiCanonicalField: (id: string, params: RequestParams = {}) =>
7916
+ this.request<AiCanonicalField, ProblemDetails>({
7917
+ path: `/api/ai/admin/fields/${id}/toggle`,
7918
+ method: "PATCH",
7919
+ secure: true,
7920
+ format: "json",
7921
+ ...params,
7922
+ }),
7923
+
7924
+ /**
7925
+ * No description
7926
+ *
7927
+ * @tags AiChat
7928
+ * @name AiChat
7929
+ * @summary Send AI chat message
7930
+ * @request POST:/api/ai/chat
7931
+ * @secure
7932
+ * @response `200` `AiChat` OK
7933
+ * @response `400` `ProblemDetails` Bad Request
7934
+ * @response `401` `ProblemDetails` Unauthorized
7935
+ */
7936
+ aiChat: (data: AiChatRequest, params: RequestParams = {}) =>
7937
+ this.request<AiChat, ProblemDetails>({
7938
+ path: `/api/ai/chat`,
7939
+ method: "POST",
7940
+ body: data,
7941
+ secure: true,
7942
+ type: ContentType.JsonPatch,
7943
+ format: "json",
7944
+ ...params,
7945
+ }),
7946
+
7947
+ /**
7948
+ * No description
7949
+ *
7950
+ * @tags AiConversation
7951
+ * @name GetAiConversations
7952
+ * @summary Get user conversations
7953
+ * @request GET:/api/ai/conversations
7954
+ * @secure
7955
+ * @response `200` `AiConversationListItemPaginated` OK
7956
+ */
7957
+ getAiConversations: (
7958
+ query?: {
7959
+ /** @format int32 */
7960
+ pageSize?: number;
7961
+ /** @format int32 */
7962
+ pageNumber?: number;
7963
+ sortBy?: string;
7964
+ sortDirection?: string;
7965
+ },
7966
+ params: RequestParams = {},
7967
+ ) =>
7968
+ this.request<AiConversationListItemPaginated, any>({
7969
+ path: `/api/ai/conversations`,
7970
+ method: "GET",
7971
+ query: query,
7972
+ secure: true,
7973
+ format: "json",
7974
+ ...params,
7975
+ }),
7976
+
7977
+ /**
7978
+ * No description
7979
+ *
7980
+ * @tags AiConversation
7981
+ * @name GetAiConversation
7982
+ * @summary Get conversation metadata
7983
+ * @request GET:/api/ai/conversations/{id}
7984
+ * @secure
7985
+ * @response `200` `AiConversationDetail` OK
7986
+ * @response `403` `ProblemDetails` Forbidden
7987
+ * @response `404` `ProblemDetails` Not Found
7988
+ */
7989
+ getAiConversation: (id: string, params: RequestParams = {}) =>
7990
+ this.request<AiConversationDetail, ProblemDetails>({
7991
+ path: `/api/ai/conversations/${id}`,
7992
+ method: "GET",
7993
+ secure: true,
7994
+ format: "json",
7995
+ ...params,
7996
+ }),
7997
+
7998
+ /**
7999
+ * No description
8000
+ *
8001
+ * @tags AiConversation
8002
+ * @name RenameAiConversation
8003
+ * @summary Rename conversation
8004
+ * @request PATCH:/api/ai/conversations/{id}
8005
+ * @secure
8006
+ * @response `200` `AiConversationDetail` OK
8007
+ * @response `400` `ProblemDetails` Bad Request
8008
+ * @response `403` `ProblemDetails` Forbidden
8009
+ * @response `404` `ProblemDetails` Not Found
8010
+ */
8011
+ renameAiConversation: (
8012
+ id: string,
8013
+ data: JsonPatchDocument,
8014
+ params: RequestParams = {},
8015
+ ) =>
8016
+ this.request<AiConversationDetail, ProblemDetails>({
8017
+ path: `/api/ai/conversations/${id}`,
8018
+ method: "PATCH",
8019
+ body: data,
8020
+ secure: true,
8021
+ type: ContentType.JsonPatch,
8022
+ format: "json",
8023
+ ...params,
8024
+ }),
8025
+
8026
+ /**
8027
+ * No description
8028
+ *
8029
+ * @tags AiConversation
8030
+ * @name DeleteAiConversation
8031
+ * @summary Delete conversation
8032
+ * @request DELETE:/api/ai/conversations/{id}
8033
+ * @secure
8034
+ * @response `204` `void` No Content
8035
+ * @response `403` `ProblemDetails` Forbidden
8036
+ * @response `404` `ProblemDetails` Not Found
8037
+ */
8038
+ deleteAiConversation: (id: string, params: RequestParams = {}) =>
8039
+ this.request<void, ProblemDetails>({
8040
+ path: `/api/ai/conversations/${id}`,
8041
+ method: "DELETE",
8042
+ secure: true,
8043
+ ...params,
8044
+ }),
8045
+
8046
+ /**
8047
+ * No description
8048
+ *
8049
+ * @tags AiConversation
8050
+ * @name GetAiConversationMessages
8051
+ * @summary Get conversation messages
8052
+ * @request GET:/api/ai/conversations/{id}/messages
8053
+ * @secure
8054
+ * @response `200` `AiChatMessagePaginated` OK
8055
+ * @response `403` `ProblemDetails` Forbidden
8056
+ * @response `404` `ProblemDetails` Not Found
8057
+ */
8058
+ getAiConversationMessages: (
8059
+ id: string,
8060
+ query?: {
8061
+ /** @format int32 */
8062
+ pageSize?: number;
8063
+ /** @format int32 */
8064
+ pageNumber?: number;
8065
+ sortBy?: string;
8066
+ sortDirection?: string;
8067
+ },
8068
+ params: RequestParams = {},
8069
+ ) =>
8070
+ this.request<AiChatMessagePaginated, ProblemDetails>({
8071
+ path: `/api/ai/conversations/${id}/messages`,
8072
+ method: "GET",
8073
+ query: query,
8074
+ secure: true,
8075
+ format: "json",
8076
+ ...params,
8077
+ }),
8078
+
8079
+ /**
8080
+ * No description
8081
+ *
8082
+ * @tags AiConversation
8083
+ * @name ClearAiConversationHistory
8084
+ * @summary Clear conversation history
8085
+ * @request DELETE:/api/ai/conversations/{id}/messages
8086
+ * @secure
8087
+ * @response `204` `void` No Content
8088
+ * @response `403` `ProblemDetails` Forbidden
8089
+ * @response `404` `ProblemDetails` Not Found
8090
+ */
8091
+ clearAiConversationHistory: (id: string, params: RequestParams = {}) =>
8092
+ this.request<void, ProblemDetails>({
8093
+ path: `/api/ai/conversations/${id}/messages`,
8094
+ method: "DELETE",
8095
+ secure: true,
8096
+ ...params,
8097
+ }),
8098
+
8099
+ /**
8100
+ * No description
8101
+ *
8102
+ * @tags AiConversation
8103
+ * @name PinAiConversation
8104
+ * @summary Pin or unpin conversation
8105
+ * @request PUT:/api/ai/conversations/{id}/pin
8106
+ * @secure
8107
+ * @response `200` `AiConversationDetail` OK
8108
+ * @response `403` `ProblemDetails` Forbidden
8109
+ * @response `404` `ProblemDetails` Not Found
8110
+ */
8111
+ pinAiConversation: (
8112
+ id: string,
8113
+ data: PinAiConversationRequest,
8114
+ params: RequestParams = {},
8115
+ ) =>
8116
+ this.request<AiConversationDetail, ProblemDetails>({
8117
+ path: `/api/ai/conversations/${id}/pin`,
8118
+ method: "PUT",
8119
+ body: data,
8120
+ secure: true,
8121
+ type: ContentType.Json,
8122
+ format: "json",
8123
+ ...params,
8124
+ }),
8125
+
8126
+ /**
8127
+ * No description
8128
+ *
8129
+ * @tags AiConversationAdmin
8130
+ * @name GetAiAccountConversations
8131
+ * @summary List AI conversations across the account, optionally filtered by user (admin supervision)
8132
+ * @request GET:/api/ai/admin/conversations
8133
+ * @secure
8134
+ * @response `200` `AiConversationListItemPaginated` OK
8135
+ */
8136
+ getAiAccountConversations: (
8137
+ query?: {
8138
+ /** @format uuid */
8139
+ userId?: string;
8140
+ /** @format int32 */
8141
+ pageSize?: number;
8142
+ /** @format int32 */
8143
+ pageNumber?: number;
8144
+ sortBy?: string;
8145
+ sortDirection?: string;
8146
+ },
8147
+ params: RequestParams = {},
8148
+ ) =>
8149
+ this.request<AiConversationListItemPaginated, any>({
8150
+ path: `/api/ai/admin/conversations`,
8151
+ method: "GET",
8152
+ query: query,
8153
+ secure: true,
8154
+ format: "json",
8155
+ ...params,
8156
+ }),
8157
+
8158
+ /**
8159
+ * No description
8160
+ *
8161
+ * @tags AiConversationAdmin
8162
+ * @name GetAiAccountConversation
8163
+ * @summary Get an account conversation's detail (admin supervision)
8164
+ * @request GET:/api/ai/admin/conversations/{id}
8165
+ * @secure
8166
+ * @response `200` `AiConversationDetail` OK
8167
+ * @response `404` `ProblemDetails` Not Found
8168
+ */
8169
+ getAiAccountConversation: (id: string, params: RequestParams = {}) =>
8170
+ this.request<AiConversationDetail, ProblemDetails>({
8171
+ path: `/api/ai/admin/conversations/${id}`,
8172
+ method: "GET",
8173
+ secure: true,
8174
+ format: "json",
8175
+ ...params,
8176
+ }),
8177
+
8178
+ /**
8179
+ * No description
8180
+ *
8181
+ * @tags AiConversationAdmin
8182
+ * @name GetAiAccountConversationMessages
8183
+ * @summary Get an account conversation's messages (admin supervision)
8184
+ * @request GET:/api/ai/admin/conversations/{id}/messages
8185
+ * @secure
8186
+ * @response `200` `AiChatMessagePaginated` OK
8187
+ * @response `404` `ProblemDetails` Not Found
8188
+ */
8189
+ getAiAccountConversationMessages: (
8190
+ id: string,
8191
+ query?: {
8192
+ /** @format int32 */
8193
+ pageSize?: number;
8194
+ /** @format int32 */
8195
+ pageNumber?: number;
8196
+ sortBy?: string;
8197
+ sortDirection?: string;
8198
+ },
8199
+ params: RequestParams = {},
8200
+ ) =>
8201
+ this.request<AiChatMessagePaginated, ProblemDetails>({
8202
+ path: `/api/ai/admin/conversations/${id}/messages`,
8203
+ method: "GET",
8204
+ query: query,
8205
+ secure: true,
8206
+ format: "json",
8207
+ ...params,
8208
+ }),
8209
+
8210
+ /**
8211
+ * No description
8212
+ *
8213
+ * @tags AiGuardrail
8214
+ * @name GetAiGuardrails
8215
+ * @summary Get all guardrails
8216
+ * @request GET:/api/ai/admin/guardrails
8217
+ * @secure
8218
+ * @response `200` `(AiGuardrail)[]` OK
8219
+ */
8220
+ getAiGuardrails: (params: RequestParams = {}) =>
8221
+ this.request<AiGuardrail[], any>({
8222
+ path: `/api/ai/admin/guardrails`,
8223
+ method: "GET",
8224
+ secure: true,
8225
+ format: "json",
8226
+ ...params,
8227
+ }),
8228
+
8229
+ /**
8230
+ * No description
8231
+ *
8232
+ * @tags AiGuardrail
8233
+ * @name CreateAiGuardrail
8234
+ * @summary Create custom guardrail
8235
+ * @request POST:/api/ai/admin/guardrails
8236
+ * @secure
8237
+ * @response `201` `AiGuardrail` Created
8238
+ * @response `400` `ProblemDetails` Bad Request
8239
+ */
8240
+ createAiGuardrail: (
8241
+ data: CreateAiGuardrailRequest,
8242
+ params: RequestParams = {},
8243
+ ) =>
8244
+ this.request<AiGuardrail, ProblemDetails>({
8245
+ path: `/api/ai/admin/guardrails`,
8246
+ method: "POST",
8247
+ body: data,
8248
+ secure: true,
8249
+ type: ContentType.Json,
8250
+ format: "json",
8251
+ ...params,
8252
+ }),
8253
+
8254
+ /**
8255
+ * No description
8256
+ *
8257
+ * @tags AiGuardrail
8258
+ * @name GetAiGuardrail
8259
+ * @summary Get guardrail by ID
8260
+ * @request GET:/api/ai/admin/guardrails/{id}
8261
+ * @secure
8262
+ * @response `200` `AiGuardrail` OK
8263
+ * @response `404` `ProblemDetails` Not Found
8264
+ */
8265
+ getAiGuardrail: (id: string, params: RequestParams = {}) =>
8266
+ this.request<AiGuardrail, ProblemDetails>({
8267
+ path: `/api/ai/admin/guardrails/${id}`,
8268
+ method: "GET",
8269
+ secure: true,
8270
+ format: "json",
8271
+ ...params,
8272
+ }),
8273
+
8274
+ /**
8275
+ * No description
8276
+ *
8277
+ * @tags AiGuardrail
8278
+ * @name UpdateAiGuardrail
8279
+ * @summary Update guardrail
8280
+ * @request PUT:/api/ai/admin/guardrails/{id}
8281
+ * @secure
8282
+ * @response `200` `AiGuardrail` OK
8283
+ * @response `400` `ProblemDetails` Bad Request
8284
+ * @response `404` `ProblemDetails` Not Found
8285
+ */
8286
+ updateAiGuardrail: (
8287
+ id: string,
8288
+ data: UpdateAiGuardrailRequest,
8289
+ params: RequestParams = {},
8290
+ ) =>
8291
+ this.request<AiGuardrail, ProblemDetails>({
8292
+ path: `/api/ai/admin/guardrails/${id}`,
8293
+ method: "PUT",
8294
+ body: data,
8295
+ secure: true,
8296
+ type: ContentType.Json,
8297
+ format: "json",
8298
+ ...params,
8299
+ }),
8300
+
8301
+ /**
8302
+ * No description
8303
+ *
8304
+ * @tags AiGuardrail
8305
+ * @name DeleteAiGuardrail
8306
+ * @summary Delete guardrail
8307
+ * @request DELETE:/api/ai/admin/guardrails/{id}
8308
+ * @secure
8309
+ * @response `204` `void` No Content
8310
+ * @response `400` `ProblemDetails` Bad Request
8311
+ * @response `404` `ProblemDetails` Not Found
8312
+ */
8313
+ deleteAiGuardrail: (id: string, params: RequestParams = {}) =>
8314
+ this.request<void, ProblemDetails>({
8315
+ path: `/api/ai/admin/guardrails/${id}`,
8316
+ method: "DELETE",
8317
+ secure: true,
8318
+ ...params,
8319
+ }),
8320
+
8321
+ /**
8322
+ * No description
8323
+ *
8324
+ * @tags AiGuardrail
8325
+ * @name ToggleAiGuardrail
8326
+ * @summary Toggle guardrail enabled/disabled
8327
+ * @request PATCH:/api/ai/admin/guardrails/{id}/toggle
8328
+ * @secure
8329
+ * @response `200` `AiGuardrail` OK
8330
+ * @response `404` `ProblemDetails` Not Found
8331
+ */
8332
+ toggleAiGuardrail: (id: string, params: RequestParams = {}) =>
8333
+ this.request<AiGuardrail, ProblemDetails>({
8334
+ path: `/api/ai/admin/guardrails/${id}/toggle`,
8335
+ method: "PATCH",
8336
+ secure: true,
8337
+ format: "json",
8338
+ ...params,
8339
+ }),
8340
+
8341
+ /**
8342
+ * No description
8343
+ *
8344
+ * @tags AiPrompt
8345
+ * @name GetAvailablePrompts
8346
+ * @summary Get available prompts for current user
8347
+ * @request GET:/api/ai/prompts
8348
+ * @secure
8349
+ * @response `200` `(AiPromptSummary)[]` OK
8350
+ */
8351
+ getAvailablePrompts: (
8352
+ query?: {
8353
+ documentType?: string;
8354
+ },
8355
+ params: RequestParams = {},
8356
+ ) =>
8357
+ this.request<AiPromptSummary[], any>({
8358
+ path: `/api/ai/prompts`,
8359
+ method: "GET",
8360
+ query: query,
8361
+ secure: true,
8362
+ format: "json",
8363
+ ...params,
8364
+ }),
8365
+
8366
+ /**
8367
+ * No description
8368
+ *
8369
+ * @tags AiSuperAdmin
8370
+ * @name GetAiAuditLogsCrossAccount
8371
+ * @summary Get AI audit logs for a specific account or across all accounts
8372
+ * @request GET:/api/ai/superadmin/audit-logs
8373
+ * @secure
8374
+ * @response `200` `AiAuditLogPaginated` OK
8375
+ */
8376
+ getAiAuditLogsCrossAccount: (
8377
+ query?: {
8378
+ /** @format uuid */
8379
+ accountId?: string;
8380
+ eventType?: AiAuditEventType;
8381
+ /** @format uuid */
8382
+ requestId?: string;
8383
+ /** @format uuid */
8384
+ userId?: string;
8385
+ /** @format uuid */
8386
+ conversationId?: string;
8387
+ blockedOnly?: boolean;
8388
+ /** @format date-time */
8389
+ startDate?: string;
8390
+ /** @format date-time */
8391
+ endDate?: string;
8392
+ /** @format int32 */
8393
+ pageSize?: number;
8394
+ /** @format int32 */
8395
+ pageNumber?: number;
8396
+ sortBy?: string;
8397
+ sortDirection?: string;
8398
+ },
8399
+ params: RequestParams = {},
8400
+ ) =>
8401
+ this.request<AiAuditLogPaginated, any>({
8402
+ path: `/api/ai/superadmin/audit-logs`,
8403
+ method: "GET",
8404
+ query: query,
8405
+ secure: true,
8406
+ format: "json",
8407
+ ...params,
8408
+ }),
8409
+
8410
+ /**
8411
+ * No description
8412
+ *
8413
+ * @tags AiSuperAdmin
8414
+ * @name GetAiRequestLifecycleCrossAccount
8415
+ * @summary Get the full event lifecycle of a single AI request from any account
8416
+ * @request GET:/api/ai/superadmin/audit-logs/request/{requestId}
8417
+ * @secure
8418
+ * @response `200` `(AiAuditLog)[]` OK
8419
+ */
8420
+ getAiRequestLifecycleCrossAccount: (
8421
+ requestId: string,
8422
+ query?: {
8423
+ /** @format uuid */
8424
+ accountId?: string;
8425
+ },
8426
+ params: RequestParams = {},
8427
+ ) =>
8428
+ this.request<AiAuditLog[], any>({
8429
+ path: `/api/ai/superadmin/audit-logs/request/${requestId}`,
8430
+ method: "GET",
8431
+ query: query,
8432
+ secure: true,
8433
+ format: "json",
8434
+ ...params,
8435
+ }),
8436
+
8437
+ /**
8438
+ * No description
8439
+ *
8440
+ * @tags AiSuperAdmin
8441
+ * @name GetAiStatsCrossAccount
8442
+ * @summary Get AI stats for a specific account or platform-wide
8443
+ * @request GET:/api/ai/superadmin/stats
8444
+ * @secure
8445
+ * @response `200` `AiAdminStats` OK
8446
+ */
8447
+ getAiStatsCrossAccount: (
8448
+ query?: {
8449
+ /** @format uuid */
8450
+ accountId?: string;
8451
+ /** @format date-time */
8452
+ startDate?: string;
8453
+ /** @format date-time */
8454
+ endDate?: string;
8455
+ },
8456
+ params: RequestParams = {},
8457
+ ) =>
8458
+ this.request<AiAdminStats, any>({
8459
+ path: `/api/ai/superadmin/stats`,
8460
+ method: "GET",
8461
+ query: query,
8462
+ secure: true,
8463
+ format: "json",
8464
+ ...params,
8465
+ }),
8466
+
8467
+ /**
8468
+ * No description
8469
+ *
8470
+ * @tags AiSuperAdmin
8471
+ * @name GetAiConfigChangesCrossAccount
8472
+ * @summary Get AI configuration change history for a specific account or across all accounts (incl. global defaults)
8473
+ * @request GET:/api/ai/superadmin/config-changes
8474
+ * @secure
8475
+ * @response `200` `AiConfigChangeLogPaginated` OK
8476
+ */
8477
+ getAiConfigChangesCrossAccount: (
8478
+ query?: {
8479
+ /** @format uuid */
8480
+ accountId?: string;
8481
+ entityType?: AiConfigEntityType;
8482
+ /** @format uuid */
8483
+ entityId?: string;
8484
+ /** @format uuid */
8485
+ actorUserId?: string;
8486
+ action?: AiConfigChangeAction;
8487
+ /** @format date-time */
8488
+ startDate?: string;
8489
+ /** @format date-time */
8490
+ endDate?: string;
8491
+ /** @format int32 */
8492
+ pageSize?: number;
8493
+ /** @format int32 */
8494
+ pageNumber?: number;
8495
+ sortBy?: string;
8496
+ sortDirection?: string;
8497
+ },
8498
+ params: RequestParams = {},
8499
+ ) =>
8500
+ this.request<AiConfigChangeLogPaginated, any>({
8501
+ path: `/api/ai/superadmin/config-changes`,
8502
+ method: "GET",
8503
+ query: query,
8504
+ secure: true,
8505
+ format: "json",
8506
+ ...params,
8507
+ }),
8508
+
8509
+ /**
8510
+ * No description
8511
+ *
8512
+ * @tags AiUrlSource
8513
+ * @name GetAiUrlSources
8514
+ * @summary Get all URL sources
8515
+ * @request GET:/api/ai/admin/url-sources
8516
+ * @secure
8517
+ * @response `200` `(AiUrlSource)[]` OK
8518
+ */
8519
+ getAiUrlSources: (params: RequestParams = {}) =>
8520
+ this.request<AiUrlSource[], any>({
8521
+ path: `/api/ai/admin/url-sources`,
8522
+ method: "GET",
8523
+ secure: true,
8524
+ format: "json",
8525
+ ...params,
8526
+ }),
8527
+
8528
+ /**
8529
+ * No description
8530
+ *
8531
+ * @tags AiUrlSource
8532
+ * @name CreateAiUrlSource
8533
+ * @summary Create URL source
8534
+ * @request POST:/api/ai/admin/url-sources
8535
+ * @secure
8536
+ * @response `201` `AiUrlSource` Created
8537
+ * @response `400` `ProblemDetails` Bad Request
8538
+ * @response `409` `ProblemDetails` Conflict
8539
+ */
8540
+ createAiUrlSource: (
8541
+ data: CreateAiUrlSourceRequest,
8542
+ params: RequestParams = {},
8543
+ ) =>
8544
+ this.request<AiUrlSource, ProblemDetails>({
8545
+ path: `/api/ai/admin/url-sources`,
8546
+ method: "POST",
8547
+ body: data,
8548
+ secure: true,
8549
+ type: ContentType.JsonPatch,
8550
+ format: "json",
8551
+ ...params,
8552
+ }),
8553
+
8554
+ /**
8555
+ * No description
8556
+ *
8557
+ * @tags AiUrlSource
8558
+ * @name GetAiUrlSource
8559
+ * @summary Get URL source by ID
8560
+ * @request GET:/api/ai/admin/url-sources/{id}
8561
+ * @secure
8562
+ * @response `200` `AiUrlSource` OK
8563
+ * @response `404` `ProblemDetails` Not Found
8564
+ */
8565
+ getAiUrlSource: (id: string, params: RequestParams = {}) =>
8566
+ this.request<AiUrlSource, ProblemDetails>({
8567
+ path: `/api/ai/admin/url-sources/${id}`,
8568
+ method: "GET",
8569
+ secure: true,
8570
+ format: "json",
8571
+ ...params,
8572
+ }),
8573
+
8574
+ /**
8575
+ * No description
8576
+ *
8577
+ * @tags AiUrlSource
8578
+ * @name UpdateAiUrlSource
8579
+ * @summary Update URL source
8580
+ * @request PUT:/api/ai/admin/url-sources/{id}
8581
+ * @secure
8582
+ * @response `200` `AiUrlSource` OK
8583
+ * @response `400` `ProblemDetails` Bad Request
8584
+ * @response `404` `ProblemDetails` Not Found
8585
+ * @response `409` `ProblemDetails` Conflict
8586
+ */
8587
+ updateAiUrlSource: (
8588
+ id: string,
8589
+ data: UpdateAiUrlSourceRequest,
8590
+ params: RequestParams = {},
8591
+ ) =>
8592
+ this.request<AiUrlSource, ProblemDetails>({
8593
+ path: `/api/ai/admin/url-sources/${id}`,
8594
+ method: "PUT",
8595
+ body: data,
8596
+ secure: true,
8597
+ type: ContentType.Json,
8598
+ format: "json",
8599
+ ...params,
8600
+ }),
8601
+
8602
+ /**
8603
+ * No description
8604
+ *
8605
+ * @tags AiUrlSource
8606
+ * @name DeleteAiUrlSource
8607
+ * @summary Delete URL source
8608
+ * @request DELETE:/api/ai/admin/url-sources/{id}
8609
+ * @secure
8610
+ * @response `204` `void` No Content
8611
+ * @response `404` `ProblemDetails` Not Found
8612
+ */
8613
+ deleteAiUrlSource: (id: string, params: RequestParams = {}) =>
8614
+ this.request<void, ProblemDetails>({
8615
+ path: `/api/ai/admin/url-sources/${id}`,
8616
+ method: "DELETE",
8617
+ secure: true,
8618
+ ...params,
8619
+ }),
8620
+
8621
+ /**
8622
+ * No description
8623
+ *
8624
+ * @tags AiUrlSource
8625
+ * @name ToggleAiUrlSource
8626
+ * @summary Toggle URL source active/inactive
8627
+ * @request PATCH:/api/ai/admin/url-sources/{id}/toggle
8628
+ * @secure
8629
+ * @response `200` `AiUrlSource` OK
8630
+ * @response `404` `ProblemDetails` Not Found
8631
+ */
8632
+ toggleAiUrlSource: (id: string, params: RequestParams = {}) =>
8633
+ this.request<AiUrlSource, ProblemDetails>({
8634
+ path: `/api/ai/admin/url-sources/${id}/toggle`,
8635
+ method: "PATCH",
8636
+ secure: true,
8637
+ format: "json",
8638
+ ...params,
8639
+ }),
8640
+
8641
+ /**
8642
+ * No description
8643
+ *
8644
+ * @tags AuditLog
8645
+ * @name SearchAuditLogs
8646
+ * @summary Search
8647
+ * @request POST:/api/audit-logs/search
8648
+ * @secure
8649
+ * @response `200` `AuditLogEntryPaginated` OK
8650
+ */
8651
+ searchAuditLogs: (
8652
+ data: AuditLogSearchCriteria,
8653
+ query?: {
8654
+ /** @format int32 */
8655
+ pageSize?: number;
8656
+ /** @format int32 */
6820
8657
  pageNumber?: number;
6821
8658
  sortBy?: string;
6822
8659
  sortDirection?: string;
@@ -6829,7 +8666,7 @@ export class Api<
6829
8666
  query: query,
6830
8667
  body: data,
6831
8668
  secure: true,
6832
- type: ContentType.Json,
8669
+ type: ContentType.JsonPatch,
6833
8670
  format: "json",
6834
8671
  ...params,
6835
8672
  }),
@@ -11528,12 +13365,17 @@ export class Api<
11528
13365
  * @response `404` `ProblemDetails` Not Found
11529
13366
  * @response `409` `any` Conflict
11530
13367
  */
11531
- updateLoan: (loanId: string, data: any, params: RequestParams = {}) =>
13368
+ updateLoan: (
13369
+ loanId: string,
13370
+ data: LoanPatchRequestGuidPatchDocument,
13371
+ params: RequestParams = {},
13372
+ ) =>
11532
13373
  this.request<Loan, ProblemDetails>({
11533
13374
  path: `/api/loans/${loanId}`,
11534
13375
  method: "PATCH",
11535
13376
  body: data,
11536
13377
  secure: true,
13378
+ type: ContentType.JsonPatch,
11537
13379
  format: "json",
11538
13380
  ...params,
11539
13381
  }),
@@ -11643,7 +13485,7 @@ export class Api<
11643
13485
  method: "POST",
11644
13486
  body: data,
11645
13487
  secure: true,
11646
- type: ContentType.JsonPatch,
13488
+ type: ContentType.Json,
11647
13489
  format: "json",
11648
13490
  ...params,
11649
13491
  }),