@gemina/sdk 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -304,9 +304,11 @@ var TextApiResponse = class {
304
304
  // src/generated/models/InvoiceStatus.ts
305
305
  var InvoiceStatus = {
306
306
  Draft: "draft",
307
+ Preparing: "preparing",
307
308
  Issued: "issued",
308
309
  Paid: "paid",
309
- Refunded: "refunded"
310
+ Refunded: "refunded",
311
+ Voided: "voided"
310
312
  };
311
313
  function instanceOfInvoiceStatus(value) {
312
314
  for (const key in InvoiceStatus) {
@@ -737,6 +739,177 @@ function ChatQueryOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
737
739
  };
738
740
  }
739
741
 
742
+ // src/generated/models/ChatSessionOutDTO.ts
743
+ function instanceOfChatSessionOutDTO(value) {
744
+ if (!("id" in value) || value["id"] === void 0) return false;
745
+ return true;
746
+ }
747
+ function ChatSessionOutDTOFromJSON(json) {
748
+ return ChatSessionOutDTOFromJSONTyped(json, false);
749
+ }
750
+ function ChatSessionOutDTOFromJSONTyped(json, ignoreDiscriminator) {
751
+ if (json == null) {
752
+ return json;
753
+ }
754
+ return {
755
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
756
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
757
+ "id": json["id"],
758
+ "lastActivityAt": json["lastActivityAt"] == null ? void 0 : new Date(json["lastActivityAt"]),
759
+ "purgeAt": json["purgeAt"] == null ? void 0 : new Date(json["purgeAt"]),
760
+ "purgeReason": json["purgeReason"] == null ? void 0 : json["purgeReason"],
761
+ "purgedAt": json["purgedAt"] == null ? void 0 : new Date(json["purgedAt"]),
762
+ "resumable": json["resumable"] == null ? void 0 : json["resumable"],
763
+ "title": json["title"] == null ? void 0 : json["title"],
764
+ "turnCount": json["turnCount"] == null ? void 0 : json["turnCount"]
765
+ };
766
+ }
767
+ function ChatSessionOutDTOToJSON(json) {
768
+ return ChatSessionOutDTOToJSONTyped(json, false);
769
+ }
770
+ function ChatSessionOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
771
+ if (value == null) {
772
+ return value;
773
+ }
774
+ return {
775
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
776
+ "createdAtTimestamp": value["createdAtTimestamp"],
777
+ "id": value["id"],
778
+ "lastActivityAt": value["lastActivityAt"] == null ? value["lastActivityAt"] : value["lastActivityAt"].toISOString(),
779
+ "purgeAt": value["purgeAt"] == null ? value["purgeAt"] : value["purgeAt"].toISOString(),
780
+ "purgeReason": value["purgeReason"],
781
+ "purgedAt": value["purgedAt"] == null ? value["purgedAt"] : value["purgedAt"].toISOString(),
782
+ "resumable": value["resumable"],
783
+ "title": value["title"],
784
+ "turnCount": value["turnCount"]
785
+ };
786
+ }
787
+
788
+ // src/generated/models/ChatSessionListOutDTO.ts
789
+ function instanceOfChatSessionListOutDTO(value) {
790
+ if (!("count" in value) || value["count"] === void 0) return false;
791
+ if (!("sessions" in value) || value["sessions"] === void 0) return false;
792
+ return true;
793
+ }
794
+ function ChatSessionListOutDTOFromJSON(json) {
795
+ return ChatSessionListOutDTOFromJSONTyped(json, false);
796
+ }
797
+ function ChatSessionListOutDTOFromJSONTyped(json, ignoreDiscriminator) {
798
+ if (json == null) {
799
+ return json;
800
+ }
801
+ return {
802
+ "count": json["count"],
803
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
804
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
805
+ "servedAt": json["servedAt"] == null ? void 0 : new Date(json["servedAt"]),
806
+ "servedAtTimestamp": json["servedAtTimestamp"] == null ? void 0 : json["servedAtTimestamp"],
807
+ "sessions": json["sessions"].map(ChatSessionOutDTOFromJSON)
808
+ };
809
+ }
810
+ function ChatSessionListOutDTOToJSON(json) {
811
+ return ChatSessionListOutDTOToJSONTyped(json, false);
812
+ }
813
+ function ChatSessionListOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
814
+ if (value == null) {
815
+ return value;
816
+ }
817
+ return {
818
+ "count": value["count"],
819
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
820
+ "createdAtTimestamp": value["createdAtTimestamp"],
821
+ "servedAt": value["servedAt"] == null ? value["servedAt"] : value["servedAt"].toISOString(),
822
+ "servedAtTimestamp": value["servedAtTimestamp"],
823
+ "sessions": value["sessions"].map(ChatSessionOutDTOToJSON)
824
+ };
825
+ }
826
+
827
+ // src/generated/models/ChatMessageOutDTO.ts
828
+ function instanceOfChatMessageOutDTO(value) {
829
+ if (!("content" in value) || value["content"] === void 0) return false;
830
+ if (!("role" in value) || value["role"] === void 0) return false;
831
+ if (!("turnIndex" in value) || value["turnIndex"] === void 0) return false;
832
+ return true;
833
+ }
834
+ function ChatMessageOutDTOFromJSON(json) {
835
+ return ChatMessageOutDTOFromJSONTyped(json, false);
836
+ }
837
+ function ChatMessageOutDTOFromJSONTyped(json, ignoreDiscriminator) {
838
+ if (json == null) {
839
+ return json;
840
+ }
841
+ return {
842
+ "citations": json["citations"] == null ? void 0 : json["citations"],
843
+ "confident": json["confident"] == null ? void 0 : json["confident"],
844
+ "content": json["content"],
845
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
846
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
847
+ "intent": json["intent"] == null ? void 0 : json["intent"],
848
+ "role": json["role"],
849
+ "turnIndex": json["turnIndex"]
850
+ };
851
+ }
852
+ function ChatMessageOutDTOToJSON(json) {
853
+ return ChatMessageOutDTOToJSONTyped(json, false);
854
+ }
855
+ function ChatMessageOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
856
+ if (value == null) {
857
+ return value;
858
+ }
859
+ return {
860
+ "citations": value["citations"],
861
+ "confident": value["confident"],
862
+ "content": value["content"],
863
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
864
+ "createdAtTimestamp": value["createdAtTimestamp"],
865
+ "intent": value["intent"],
866
+ "role": value["role"],
867
+ "turnIndex": value["turnIndex"]
868
+ };
869
+ }
870
+
871
+ // src/generated/models/ChatTranscriptOutDTO.ts
872
+ function instanceOfChatTranscriptOutDTO(value) {
873
+ if (!("count" in value) || value["count"] === void 0) return false;
874
+ if (!("messages" in value) || value["messages"] === void 0) return false;
875
+ if (!("session" in value) || value["session"] === void 0) return false;
876
+ return true;
877
+ }
878
+ function ChatTranscriptOutDTOFromJSON(json) {
879
+ return ChatTranscriptOutDTOFromJSONTyped(json, false);
880
+ }
881
+ function ChatTranscriptOutDTOFromJSONTyped(json, ignoreDiscriminator) {
882
+ if (json == null) {
883
+ return json;
884
+ }
885
+ return {
886
+ "count": json["count"],
887
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
888
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
889
+ "messages": json["messages"].map(ChatMessageOutDTOFromJSON),
890
+ "servedAt": json["servedAt"] == null ? void 0 : new Date(json["servedAt"]),
891
+ "servedAtTimestamp": json["servedAtTimestamp"] == null ? void 0 : json["servedAtTimestamp"],
892
+ "session": ChatSessionOutDTOFromJSON(json["session"])
893
+ };
894
+ }
895
+ function ChatTranscriptOutDTOToJSON(json) {
896
+ return ChatTranscriptOutDTOToJSONTyped(json, false);
897
+ }
898
+ function ChatTranscriptOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
899
+ if (value == null) {
900
+ return value;
901
+ }
902
+ return {
903
+ "count": value["count"],
904
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
905
+ "createdAtTimestamp": value["createdAtTimestamp"],
906
+ "messages": value["messages"].map(ChatMessageOutDTOToJSON),
907
+ "servedAt": value["servedAt"] == null ? value["servedAt"] : value["servedAt"].toISOString(),
908
+ "servedAtTimestamp": value["servedAtTimestamp"],
909
+ "session": ChatSessionOutDTOToJSON(value["session"])
910
+ };
911
+ }
912
+
740
913
  // src/generated/apis/ChatApi.ts
741
914
  var ChatApi = class extends BaseAPI {
742
915
  /**
@@ -827,6 +1000,191 @@ var ChatApi = class extends BaseAPI {
827
1000
  async deleteChatSession(requestParameters, initOverrides) {
828
1001
  await this.deleteChatSessionRaw(requestParameters, initOverrides);
829
1002
  }
1003
+ /**
1004
+ * Creates request options for getChatSession without sending the request
1005
+ */
1006
+ async getChatSessionRequestOpts(requestParameters) {
1007
+ if (requestParameters["sessionId"] == null) {
1008
+ throw new RequiredError(
1009
+ "sessionId",
1010
+ 'Required parameter "sessionId" was null or undefined when calling getChatSession().'
1011
+ );
1012
+ }
1013
+ const queryParameters = {};
1014
+ if (requestParameters["skip"] != null) {
1015
+ queryParameters["skip"] = requestParameters["skip"];
1016
+ }
1017
+ if (requestParameters["limit"] != null) {
1018
+ queryParameters["limit"] = requestParameters["limit"];
1019
+ }
1020
+ if (requestParameters["withPurged"] != null) {
1021
+ queryParameters["with_purged"] = requestParameters["withPurged"];
1022
+ }
1023
+ const headerParameters = {};
1024
+ if (this.configuration && this.configuration.apiKey) {
1025
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
1026
+ }
1027
+ if (this.configuration && this.configuration.accessToken) {
1028
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
1029
+ }
1030
+ let urlPath = `/api/v1/chat/sessions/{session_id}`;
1031
+ urlPath = urlPath.replace("{session_id}", encodeURIComponent(String(requestParameters["sessionId"])));
1032
+ return {
1033
+ path: urlPath,
1034
+ method: "GET",
1035
+ headers: headerParameters,
1036
+ query: queryParameters
1037
+ };
1038
+ }
1039
+ /**
1040
+ * Read one conversation\'s transcript. Messages come back in turn order, user before assistant within a turn. 404 for unknown, foreign and purged sessions alike — a purged stub is readable only with ``with_purged``, and then carries no messages.
1041
+ * Get Chat Session
1042
+ */
1043
+ async getChatSessionRaw(requestParameters, initOverrides) {
1044
+ const requestOptions = await this.getChatSessionRequestOpts(requestParameters);
1045
+ const response = await this.request(requestOptions, initOverrides);
1046
+ return new JSONApiResponse(response, (jsonValue) => ChatTranscriptOutDTOFromJSON(jsonValue));
1047
+ }
1048
+ /**
1049
+ * Read one conversation\'s transcript. Messages come back in turn order, user before assistant within a turn. 404 for unknown, foreign and purged sessions alike — a purged stub is readable only with ``with_purged``, and then carries no messages.
1050
+ * Get Chat Session
1051
+ */
1052
+ async getChatSession(requestParameters, initOverrides) {
1053
+ const response = await this.getChatSessionRaw(requestParameters, initOverrides);
1054
+ return await response.value();
1055
+ }
1056
+ /**
1057
+ * Creates request options for listChatSessions without sending the request
1058
+ */
1059
+ async listChatSessionsRequestOpts(requestParameters) {
1060
+ const queryParameters = {};
1061
+ if (requestParameters["skip"] != null) {
1062
+ queryParameters["skip"] = requestParameters["skip"];
1063
+ }
1064
+ if (requestParameters["limit"] != null) {
1065
+ queryParameters["limit"] = requestParameters["limit"];
1066
+ }
1067
+ if (requestParameters["sortField"] != null) {
1068
+ queryParameters["sort_field"] = requestParameters["sortField"];
1069
+ }
1070
+ if (requestParameters["sortMethod"] != null) {
1071
+ queryParameters["sort_method"] = requestParameters["sortMethod"];
1072
+ }
1073
+ if (requestParameters["withPurged"] != null) {
1074
+ queryParameters["with_purged"] = requestParameters["withPurged"];
1075
+ }
1076
+ const headerParameters = {};
1077
+ if (this.configuration && this.configuration.apiKey) {
1078
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
1079
+ }
1080
+ if (this.configuration && this.configuration.accessToken) {
1081
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
1082
+ }
1083
+ let urlPath = `/api/v1/chat/sessions`;
1084
+ return {
1085
+ path: urlPath,
1086
+ method: "GET",
1087
+ headers: headerParameters,
1088
+ query: queryParameters
1089
+ };
1090
+ }
1091
+ /**
1092
+ * List past conversations, newest first. Sessions with no delivered turn yet are omitted. Ended conversations stay listed and come back ``resumable: false``; purged ones are stubs, hidden unless ``with_purged`` is set. A token-pinned caller sees only its own end-user\'s chats.
1093
+ * List Chat Sessions
1094
+ */
1095
+ async listChatSessionsRaw(requestParameters, initOverrides) {
1096
+ const requestOptions = await this.listChatSessionsRequestOpts(requestParameters);
1097
+ const response = await this.request(requestOptions, initOverrides);
1098
+ return new JSONApiResponse(response, (jsonValue) => ChatSessionListOutDTOFromJSON(jsonValue));
1099
+ }
1100
+ /**
1101
+ * List past conversations, newest first. Sessions with no delivered turn yet are omitted. Ended conversations stay listed and come back ``resumable: false``; purged ones are stubs, hidden unless ``with_purged`` is set. A token-pinned caller sees only its own end-user\'s chats.
1102
+ * List Chat Sessions
1103
+ */
1104
+ async listChatSessions(requestParameters = {}, initOverrides) {
1105
+ const response = await this.listChatSessionsRaw(requestParameters, initOverrides);
1106
+ return await response.value();
1107
+ }
1108
+ /**
1109
+ * Creates request options for purgeChatSession without sending the request
1110
+ */
1111
+ async purgeChatSessionRequestOpts(requestParameters) {
1112
+ if (requestParameters["sessionId"] == null) {
1113
+ throw new RequiredError(
1114
+ "sessionId",
1115
+ 'Required parameter "sessionId" was null or undefined when calling purgeChatSession().'
1116
+ );
1117
+ }
1118
+ const queryParameters = {};
1119
+ const headerParameters = {};
1120
+ if (this.configuration && this.configuration.apiKey) {
1121
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
1122
+ }
1123
+ let urlPath = `/api/v1/chat/sessions/{session_id}/purge`;
1124
+ urlPath = urlPath.replace("{session_id}", encodeURIComponent(String(requestParameters["sessionId"])));
1125
+ return {
1126
+ path: urlPath,
1127
+ method: "DELETE",
1128
+ headers: headerParameters,
1129
+ query: queryParameters
1130
+ };
1131
+ }
1132
+ /**
1133
+ * Permanently destroy a conversation\'s stored content. IRREVERSIBLE. Messages are deleted, trace content is scrubbed, and the title is cleared; a stub row survives as the record of the purge. Transient conversational state on the chat backend expires within approximately 24 hours. Deliberately NOT available to retrieval tokens: they carry a single query-only scope minted for embedded widgets, and granting them irreversible deletion would be a least-privilege regression.
1134
+ * Purge Chat Session
1135
+ */
1136
+ async purgeChatSessionRaw(requestParameters, initOverrides) {
1137
+ const requestOptions = await this.purgeChatSessionRequestOpts(requestParameters);
1138
+ const response = await this.request(requestOptions, initOverrides);
1139
+ return new VoidApiResponse(response);
1140
+ }
1141
+ /**
1142
+ * Permanently destroy a conversation\'s stored content. IRREVERSIBLE. Messages are deleted, trace content is scrubbed, and the title is cleared; a stub row survives as the record of the purge. Transient conversational state on the chat backend expires within approximately 24 hours. Deliberately NOT available to retrieval tokens: they carry a single query-only scope minted for embedded widgets, and granting them irreversible deletion would be a least-privilege regression.
1143
+ * Purge Chat Session
1144
+ */
1145
+ async purgeChatSession(requestParameters, initOverrides) {
1146
+ await this.purgeChatSessionRaw(requestParameters, initOverrides);
1147
+ }
1148
+ /**
1149
+ * Creates request options for purgeChatSessionByUser without sending the request
1150
+ */
1151
+ async purgeChatSessionByUserRequestOpts(requestParameters) {
1152
+ if (requestParameters["sessionId"] == null) {
1153
+ throw new RequiredError(
1154
+ "sessionId",
1155
+ 'Required parameter "sessionId" was null or undefined when calling purgeChatSessionByUser().'
1156
+ );
1157
+ }
1158
+ const queryParameters = {};
1159
+ const headerParameters = {};
1160
+ if (this.configuration && this.configuration.accessToken) {
1161
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
1162
+ }
1163
+ let urlPath = `/api/v1/chat/sessions/{session_id}/purge/user`;
1164
+ urlPath = urlPath.replace("{session_id}", encodeURIComponent(String(requestParameters["sessionId"])));
1165
+ return {
1166
+ path: urlPath,
1167
+ method: "DELETE",
1168
+ headers: headerParameters,
1169
+ query: queryParameters
1170
+ };
1171
+ }
1172
+ /**
1173
+ * Console-signed-in equivalent of ``purge_chat_session``. IRREVERSIBLE. Same semantics and the same refusal of retrieval tokens; this variant authenticates with the console JWT instead of an API key, mirroring the documents purge convention.
1174
+ * Purge Chat Session By User
1175
+ */
1176
+ async purgeChatSessionByUserRaw(requestParameters, initOverrides) {
1177
+ const requestOptions = await this.purgeChatSessionByUserRequestOpts(requestParameters);
1178
+ const response = await this.request(requestOptions, initOverrides);
1179
+ return new VoidApiResponse(response);
1180
+ }
1181
+ /**
1182
+ * Console-signed-in equivalent of ``purge_chat_session``. IRREVERSIBLE. Same semantics and the same refusal of retrieval tokens; this variant authenticates with the console JWT instead of an API key, mirroring the documents purge convention.
1183
+ * Purge Chat Session By User
1184
+ */
1185
+ async purgeChatSessionByUser(requestParameters, initOverrides) {
1186
+ await this.purgeChatSessionByUserRaw(requestParameters, initOverrides);
1187
+ }
830
1188
  };
831
1189
 
832
1190
  // src/generated/models/ContactFormInDTO.ts
@@ -4394,6 +4752,7 @@ function ContractOutDTOFromJSONTyped(json, ignoreDiscriminator) {
4394
4752
  "indexPriceCents": json["indexPriceCents"] == null ? void 0 : json["indexPriceCents"],
4395
4753
  "maxMonthlyExtractions": json["maxMonthlyExtractions"] == null ? void 0 : json["maxMonthlyExtractions"],
4396
4754
  "monthlyFiletagCredits": json["monthlyFiletagCredits"] == null ? void 0 : json["monthlyFiletagCredits"],
4755
+ "monthlySpendLimitCents": json["monthlySpendLimitCents"] == null ? void 0 : json["monthlySpendLimitCents"],
4397
4756
  "paddleSubscriptionId": json["paddleSubscriptionId"] == null ? void 0 : json["paddleSubscriptionId"],
4398
4757
  "rateCardTemplateId": json["rateCardTemplateId"] == null ? void 0 : json["rateCardTemplateId"],
4399
4758
  "rateCards": json["rateCards"] == null ? void 0 : json["rateCards"].map(RateCardOutDTOFromJSON),
@@ -4426,6 +4785,7 @@ function ContractOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
4426
4785
  "indexPriceCents": value["indexPriceCents"],
4427
4786
  "maxMonthlyExtractions": value["maxMonthlyExtractions"],
4428
4787
  "monthlyFiletagCredits": value["monthlyFiletagCredits"],
4788
+ "monthlySpendLimitCents": value["monthlySpendLimitCents"],
4429
4789
  "paddleSubscriptionId": value["paddleSubscriptionId"],
4430
4790
  "rateCardTemplateId": value["rateCardTemplateId"],
4431
4791
  "rateCards": value["rateCards"] == null ? void 0 : value["rateCards"].map(RateCardOutDTOToJSON),
@@ -4526,6 +4886,82 @@ function EnterpriseTransactionListOutDTOToJSONTyped(value, ignoreDiscriminator =
4526
4886
  };
4527
4887
  }
4528
4888
 
4889
+ // src/generated/models/SpendLimitOutDTO.ts
4890
+ function instanceOfSpendLimitOutDTO(value) {
4891
+ if (!("cycleEnd" in value) || value["cycleEnd"] === void 0) return false;
4892
+ if (!("cycleStart" in value) || value["cycleStart"] === void 0) return false;
4893
+ return true;
4894
+ }
4895
+ function SpendLimitOutDTOFromJSON(json) {
4896
+ return SpendLimitOutDTOFromJSONTyped(json, false);
4897
+ }
4898
+ function SpendLimitOutDTOFromJSONTyped(json, ignoreDiscriminator) {
4899
+ if (json == null) {
4900
+ return json;
4901
+ }
4902
+ return {
4903
+ "blocked": json["blocked"] == null ? void 0 : json["blocked"],
4904
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
4905
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
4906
+ "cycleEnd": new Date(json["cycleEnd"]),
4907
+ "cycleStart": new Date(json["cycleStart"]),
4908
+ "limitCents": json["limitCents"] == null ? void 0 : json["limitCents"],
4909
+ "mtdSpendCents": json["mtdSpendCents"] == null ? void 0 : json["mtdSpendCents"],
4910
+ "percentUsed": json["percentUsed"] == null ? void 0 : json["percentUsed"],
4911
+ "warning": json["warning"] == null ? void 0 : json["warning"]
4912
+ };
4913
+ }
4914
+ function SpendLimitOutDTOToJSON(json) {
4915
+ return SpendLimitOutDTOToJSONTyped(json, false);
4916
+ }
4917
+ function SpendLimitOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
4918
+ if (value == null) {
4919
+ return value;
4920
+ }
4921
+ return {
4922
+ "blocked": value["blocked"],
4923
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
4924
+ "createdAtTimestamp": value["createdAtTimestamp"],
4925
+ "cycleEnd": value["cycleEnd"].toISOString(),
4926
+ "cycleStart": value["cycleStart"].toISOString(),
4927
+ "limitCents": value["limitCents"],
4928
+ "mtdSpendCents": value["mtdSpendCents"],
4929
+ "percentUsed": value["percentUsed"],
4930
+ "warning": value["warning"]
4931
+ };
4932
+ }
4933
+
4934
+ // src/generated/models/SpendLimitUpdateInDTO.ts
4935
+ function instanceOfSpendLimitUpdateInDTO(value) {
4936
+ return true;
4937
+ }
4938
+ function SpendLimitUpdateInDTOFromJSON(json) {
4939
+ return SpendLimitUpdateInDTOFromJSONTyped(json, false);
4940
+ }
4941
+ function SpendLimitUpdateInDTOFromJSONTyped(json, ignoreDiscriminator) {
4942
+ if (json == null) {
4943
+ return json;
4944
+ }
4945
+ return {
4946
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
4947
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
4948
+ "limitCents": json["limitCents"] == null ? void 0 : json["limitCents"]
4949
+ };
4950
+ }
4951
+ function SpendLimitUpdateInDTOToJSON(json) {
4952
+ return SpendLimitUpdateInDTOToJSONTyped(json, false);
4953
+ }
4954
+ function SpendLimitUpdateInDTOToJSONTyped(value, ignoreDiscriminator = false) {
4955
+ if (value == null) {
4956
+ return value;
4957
+ }
4958
+ return {
4959
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
4960
+ "createdAtTimestamp": value["createdAtTimestamp"],
4961
+ "limitCents": value["limitCents"]
4962
+ };
4963
+ }
4964
+
4529
4965
  // src/generated/models/UsageLineItemOutDTO.ts
4530
4966
  function instanceOfUsageLineItemOutDTO(value) {
4531
4967
  if (!("featureType" in value) || value["featureType"] === void 0) return false;
@@ -4646,6 +5082,38 @@ var EnterpriseApi = class extends BaseAPI {
4646
5082
  const response = await this.getMyContractRaw(initOverrides);
4647
5083
  return await response.value();
4648
5084
  }
5085
+ /**
5086
+ * Creates request options for getMySpendLimit without sending the request
5087
+ */
5088
+ async getMySpendLimitRequestOpts() {
5089
+ const queryParameters = {};
5090
+ const headerParameters = {};
5091
+ if (this.configuration && this.configuration.accessToken) {
5092
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
5093
+ }
5094
+ let urlPath = `/api/v1/enterprise/me/spend-limit`;
5095
+ return {
5096
+ path: urlPath,
5097
+ method: "GET",
5098
+ headers: headerParameters,
5099
+ query: queryParameters
5100
+ };
5101
+ }
5102
+ /**
5103
+ * Get My Spend Limit
5104
+ */
5105
+ async getMySpendLimitRaw(initOverrides) {
5106
+ const requestOptions = await this.getMySpendLimitRequestOpts();
5107
+ const response = await this.request(requestOptions, initOverrides);
5108
+ return new JSONApiResponse(response, (jsonValue) => SpendLimitOutDTOFromJSON(jsonValue));
5109
+ }
5110
+ /**
5111
+ * Get My Spend Limit
5112
+ */
5113
+ async getMySpendLimit(initOverrides) {
5114
+ const response = await this.getMySpendLimitRaw(initOverrides);
5115
+ return await response.value();
5116
+ }
4649
5117
  /**
4650
5118
  * Creates request options for getMyTransactions without sending the request
4651
5119
  */
@@ -4725,6 +5193,46 @@ var EnterpriseApi = class extends BaseAPI {
4725
5193
  const response = await this.getMyUsageRaw(requestParameters, initOverrides);
4726
5194
  return await response.value();
4727
5195
  }
5196
+ /**
5197
+ * Creates request options for setMySpendLimit without sending the request
5198
+ */
5199
+ async setMySpendLimitRequestOpts(requestParameters) {
5200
+ if (requestParameters["spendLimitUpdateInDTO"] == null) {
5201
+ throw new RequiredError(
5202
+ "spendLimitUpdateInDTO",
5203
+ 'Required parameter "spendLimitUpdateInDTO" was null or undefined when calling setMySpendLimit().'
5204
+ );
5205
+ }
5206
+ const queryParameters = {};
5207
+ const headerParameters = {};
5208
+ headerParameters["Content-Type"] = "application/json";
5209
+ if (this.configuration && this.configuration.accessToken) {
5210
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
5211
+ }
5212
+ let urlPath = `/api/v1/enterprise/me/spend-limit`;
5213
+ return {
5214
+ path: urlPath,
5215
+ method: "PUT",
5216
+ headers: headerParameters,
5217
+ query: queryParameters,
5218
+ body: SpendLimitUpdateInDTOToJSON(requestParameters["spendLimitUpdateInDTO"])
5219
+ };
5220
+ }
5221
+ /**
5222
+ * Set My Spend Limit
5223
+ */
5224
+ async setMySpendLimitRaw(requestParameters, initOverrides) {
5225
+ const requestOptions = await this.setMySpendLimitRequestOpts(requestParameters);
5226
+ const response = await this.request(requestOptions, initOverrides);
5227
+ return new JSONApiResponse(response, (jsonValue) => SpendLimitOutDTOFromJSON(jsonValue));
5228
+ }
5229
+ /**
5230
+ * Set My Spend Limit
5231
+ */
5232
+ async setMySpendLimit(requestParameters, initOverrides) {
5233
+ const response = await this.setMySpendLimitRaw(requestParameters, initOverrides);
5234
+ return await response.value();
5235
+ }
4728
5236
  };
4729
5237
 
4730
5238
  // src/generated/models/CreditTransactionType.ts
@@ -5878,7 +6386,8 @@ var StructuredFilterDTOOpEnum = {
5878
6386
  Gt: "gt",
5879
6387
  Lt: "lt",
5880
6388
  Contains: "contains",
5881
- Exists: "exists"
6389
+ Exists: "exists",
6390
+ In: "in"
5882
6391
  };
5883
6392
  function instanceOfStructuredFilterDTO(value) {
5884
6393
  if (!("op" in value) || value["op"] === void 0) return false;
@@ -5967,7 +6476,8 @@ var RetrievalAggregateInDTOGroupByEnum = {
5967
6476
  EndUserId: "end_user_id",
5968
6477
  Month: "month",
5969
6478
  Year: "year",
5970
- MeasurableUom: "measurable_uom"
6479
+ MeasurableUom: "measurable_uom",
6480
+ Description: "description"
5971
6481
  };
5972
6482
  function instanceOfRetrievalAggregateInDTO(value) {
5973
6483
  if (!("metrics" in value) || value["metrics"] === void 0) return false;
@@ -9227,11 +9737,11 @@ function PeriodPresetModelToJSONTyped(value, ignoreDiscriminator) {
9227
9737
  return value;
9228
9738
  }
9229
9739
 
9230
- // src/generated/models/PurgeDocumentsWithEndUserId422Response.ts
9231
- function PurgeDocumentsWithEndUserId422ResponseFromJSON(json) {
9232
- return PurgeDocumentsWithEndUserId422ResponseFromJSONTyped(json, false);
9740
+ // src/generated/models/PurgeChatSession422Response.ts
9741
+ function PurgeChatSession422ResponseFromJSON(json) {
9742
+ return PurgeChatSession422ResponseFromJSONTyped(json, false);
9233
9743
  }
9234
- function PurgeDocumentsWithEndUserId422ResponseFromJSONTyped(json, ignoreDiscriminator) {
9744
+ function PurgeChatSession422ResponseFromJSONTyped(json, ignoreDiscriminator) {
9235
9745
  if (json == null) {
9236
9746
  return json;
9237
9747
  }
@@ -9246,10 +9756,10 @@ function PurgeDocumentsWithEndUserId422ResponseFromJSONTyped(json, ignoreDiscrim
9246
9756
  }
9247
9757
  return {};
9248
9758
  }
9249
- function PurgeDocumentsWithEndUserId422ResponseToJSON(json) {
9250
- return PurgeDocumentsWithEndUserId422ResponseToJSONTyped(json, false);
9759
+ function PurgeChatSession422ResponseToJSON(json) {
9760
+ return PurgeChatSession422ResponseToJSONTyped(json, false);
9251
9761
  }
9252
- function PurgeDocumentsWithEndUserId422ResponseToJSONTyped(value, ignoreDiscriminator = false) {
9762
+ function PurgeChatSession422ResponseToJSONTyped(value, ignoreDiscriminator = false) {
9253
9763
  if (value == null) {
9254
9764
  return value;
9255
9765
  }
@@ -9265,6 +9775,23 @@ function PurgeDocumentsWithEndUserId422ResponseToJSONTyped(value, ignoreDiscrimi
9265
9775
  return {};
9266
9776
  }
9267
9777
 
9778
+ // src/generated/models/ValueAnyOfInner.ts
9779
+ function instanceOfValueAnyOfInner(value) {
9780
+ return true;
9781
+ }
9782
+ function ValueAnyOfInnerFromJSON(json) {
9783
+ return ValueAnyOfInnerFromJSONTyped(json, false);
9784
+ }
9785
+ function ValueAnyOfInnerFromJSONTyped(json, ignoreDiscriminator) {
9786
+ return json;
9787
+ }
9788
+ function ValueAnyOfInnerToJSON(json) {
9789
+ return ValueAnyOfInnerToJSONTyped(json, false);
9790
+ }
9791
+ function ValueAnyOfInnerToJSONTyped(value, ignoreDiscriminator = false) {
9792
+ return value;
9793
+ }
9794
+
9268
9795
  // src/errors.ts
9269
9796
  var GeminaError = class extends Error {
9270
9797
  constructor(message) {
@@ -9636,7 +10163,7 @@ async function asProcessingErrorIfFailedResult(error) {
9636
10163
  }
9637
10164
 
9638
10165
  // src/version.ts
9639
- var VERSION = "0.4.0";
10166
+ var VERSION = "0.5.0";
9640
10167
  export {
9641
10168
  AggregateMetaDTOFromJSON,
9642
10169
  AggregateMetaDTOFromJSONTyped,
@@ -9658,6 +10185,10 @@ export {
9658
10185
  BlobApiResponse,
9659
10186
  COLLECTION_FORMATS,
9660
10187
  ChatApi,
10188
+ ChatMessageOutDTOFromJSON,
10189
+ ChatMessageOutDTOFromJSONTyped,
10190
+ ChatMessageOutDTOToJSON,
10191
+ ChatMessageOutDTOToJSONTyped,
9661
10192
  ChatQueryInDTOFromJSON,
9662
10193
  ChatQueryInDTOFromJSONTyped,
9663
10194
  ChatQueryInDTOToJSON,
@@ -9666,6 +10197,18 @@ export {
9666
10197
  ChatQueryOutDTOFromJSONTyped,
9667
10198
  ChatQueryOutDTOToJSON,
9668
10199
  ChatQueryOutDTOToJSONTyped,
10200
+ ChatSessionListOutDTOFromJSON,
10201
+ ChatSessionListOutDTOFromJSONTyped,
10202
+ ChatSessionListOutDTOToJSON,
10203
+ ChatSessionListOutDTOToJSONTyped,
10204
+ ChatSessionOutDTOFromJSON,
10205
+ ChatSessionOutDTOFromJSONTyped,
10206
+ ChatSessionOutDTOToJSON,
10207
+ ChatSessionOutDTOToJSONTyped,
10208
+ ChatTranscriptOutDTOFromJSON,
10209
+ ChatTranscriptOutDTOFromJSONTyped,
10210
+ ChatTranscriptOutDTOToJSON,
10211
+ ChatTranscriptOutDTOToJSONTyped,
9669
10212
  CheckoutOutDTOFromJSON,
9670
10213
  CheckoutOutDTOFromJSONTyped,
9671
10214
  CheckoutOutDTOToJSON,
@@ -10015,10 +10558,10 @@ export {
10015
10558
  PlanOutDTOFromJSONTyped,
10016
10559
  PlanOutDTOToJSON,
10017
10560
  PlanOutDTOToJSONTyped,
10018
- PurgeDocumentsWithEndUserId422ResponseFromJSON,
10019
- PurgeDocumentsWithEndUserId422ResponseFromJSONTyped,
10020
- PurgeDocumentsWithEndUserId422ResponseToJSON,
10021
- PurgeDocumentsWithEndUserId422ResponseToJSONTyped,
10561
+ PurgeChatSession422ResponseFromJSON,
10562
+ PurgeChatSession422ResponseFromJSONTyped,
10563
+ PurgeChatSession422ResponseToJSON,
10564
+ PurgeChatSession422ResponseToJSONTyped,
10022
10565
  PurgeReasonModel,
10023
10566
  PurgeReasonModelFromJSON,
10024
10567
  PurgeReasonModelFromJSONTyped,
@@ -10102,6 +10645,14 @@ export {
10102
10645
  SortMethodModelFromJSONTyped,
10103
10646
  SortMethodModelToJSON,
10104
10647
  SortMethodModelToJSONTyped,
10648
+ SpendLimitOutDTOFromJSON,
10649
+ SpendLimitOutDTOFromJSONTyped,
10650
+ SpendLimitOutDTOToJSON,
10651
+ SpendLimitOutDTOToJSONTyped,
10652
+ SpendLimitUpdateInDTOFromJSON,
10653
+ SpendLimitUpdateInDTOFromJSONTyped,
10654
+ SpendLimitUpdateInDTOToJSON,
10655
+ SpendLimitUpdateInDTOToJSONTyped,
10105
10656
  StorageUsageOutDTOFromJSON,
10106
10657
  StorageUsageOutDTOFromJSONTyped,
10107
10658
  StorageUsageOutDTOToJSON,
@@ -10219,6 +10770,10 @@ export {
10219
10770
  ValidationSchemaModelFromJSONTyped,
10220
10771
  ValidationSchemaModelToJSON,
10221
10772
  ValidationSchemaModelToJSONTyped,
10773
+ ValueAnyOfInnerFromJSON,
10774
+ ValueAnyOfInnerFromJSONTyped,
10775
+ ValueAnyOfInnerToJSON,
10776
+ ValueAnyOfInnerToJSONTyped,
10222
10777
  ValueFromJSON,
10223
10778
  ValueFromJSONTyped,
10224
10779
  ValueToJSON,
@@ -10249,8 +10804,12 @@ export {
10249
10804
  instanceOfAggregateMetaDTO,
10250
10805
  instanceOfAggregateMetricDTO,
10251
10806
  instanceOfAggregateRowDTO,
10807
+ instanceOfChatMessageOutDTO,
10252
10808
  instanceOfChatQueryInDTO,
10253
10809
  instanceOfChatQueryOutDTO,
10810
+ instanceOfChatSessionListOutDTO,
10811
+ instanceOfChatSessionOutDTO,
10812
+ instanceOfChatTranscriptOutDTO,
10254
10813
  instanceOfCheckoutOutDTO,
10255
10814
  instanceOfColumnDefinitionDTO,
10256
10815
  instanceOfComparisonSummaryModel,
@@ -10347,6 +10906,8 @@ export {
10347
10906
  instanceOfSessionTokenInDTO,
10348
10907
  instanceOfSessionTokenOutDTO,
10349
10908
  instanceOfSortMethodModel,
10909
+ instanceOfSpendLimitOutDTO,
10910
+ instanceOfSpendLimitUpdateInDTO,
10350
10911
  instanceOfStorageUsageOutDTO,
10351
10912
  instanceOfStructuredFilterDTO,
10352
10913
  instanceOfSubscribeInDTO,
@@ -10375,6 +10936,7 @@ export {
10375
10936
  instanceOfValidationError,
10376
10937
  instanceOfValidationSchemaModel,
10377
10938
  instanceOfValue,
10939
+ instanceOfValueAnyOfInner,
10378
10940
  instanceOfValuesValue,
10379
10941
  instanceOfViewMetaOutDTO,
10380
10942
  instanceOfVolumeDiscountTierOutDTO,