@gemina/sdk 0.1.2 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -674,7 +674,8 @@ function ChatQueryInDTOFromJSONTyped(json, ignoreDiscriminator) {
674
674
  }
675
675
  return {
676
676
  "endUserId": json["endUserId"] == null ? void 0 : json["endUserId"],
677
- "message": json["message"]
677
+ "message": json["message"],
678
+ "sessionId": json["sessionId"] == null ? void 0 : json["sessionId"]
678
679
  };
679
680
  }
680
681
  function ChatQueryInDTOToJSON(json) {
@@ -686,13 +687,15 @@ function ChatQueryInDTOToJSONTyped(value, ignoreDiscriminator = false) {
686
687
  }
687
688
  return {
688
689
  "endUserId": value["endUserId"],
689
- "message": value["message"]
690
+ "message": value["message"],
691
+ "sessionId": value["sessionId"]
690
692
  };
691
693
  }
692
694
 
693
695
  // src/generated/models/ChatQueryOutDTO.ts
694
696
  function instanceOfChatQueryOutDTO(value) {
695
697
  if (!("answer" in value) || value["answer"] === void 0) return false;
698
+ if (!("sessionId" in value) || value["sessionId"] === void 0) return false;
696
699
  return true;
697
700
  }
698
701
  function ChatQueryOutDTOFromJSON(json) {
@@ -710,7 +713,8 @@ function ChatQueryOutDTOFromJSONTyped(json, ignoreDiscriminator) {
710
713
  "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
711
714
  "intent": json["intent"] == null ? void 0 : json["intent"],
712
715
  "servedAt": json["servedAt"] == null ? void 0 : new Date(json["servedAt"]),
713
- "servedAtTimestamp": json["servedAtTimestamp"] == null ? void 0 : json["servedAtTimestamp"]
716
+ "servedAtTimestamp": json["servedAtTimestamp"] == null ? void 0 : json["servedAtTimestamp"],
717
+ "sessionId": json["sessionId"]
714
718
  };
715
719
  }
716
720
  function ChatQueryOutDTOToJSON(json) {
@@ -728,7 +732,8 @@ function ChatQueryOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
728
732
  "createdAtTimestamp": value["createdAtTimestamp"],
729
733
  "intent": value["intent"],
730
734
  "servedAt": value["servedAt"] == null ? value["servedAt"] : value["servedAt"].toISOString(),
731
- "servedAtTimestamp": value["servedAtTimestamp"]
735
+ "servedAtTimestamp": value["servedAtTimestamp"],
736
+ "sessionId": value["sessionId"]
732
737
  };
733
738
  }
734
739
 
@@ -763,7 +768,7 @@ var ChatApi = class extends BaseAPI {
763
768
  };
764
769
  }
765
770
  /**
766
- * Ask a natural-language question about the tenant\'s indexed documents. Returns a grounded answer with documentId citations; ``confident=false`` means the underlying data could not support a reliable answer.
771
+ * Ask a natural-language question about the tenant\'s indexed documents. Returns a grounded answer with documentId citations; ``confident=false`` means the underlying data could not support a reliable answer. Send back the returned ``sessionId`` to continue the conversation; omit it to start a new one.
767
772
  * Chat Query
768
773
  */
769
774
  async chatQueryRaw(requestParameters, initOverrides) {
@@ -772,13 +777,56 @@ var ChatApi = class extends BaseAPI {
772
777
  return new JSONApiResponse(response, (jsonValue) => ChatQueryOutDTOFromJSON(jsonValue));
773
778
  }
774
779
  /**
775
- * Ask a natural-language question about the tenant\'s indexed documents. Returns a grounded answer with documentId citations; ``confident=false`` means the underlying data could not support a reliable answer.
780
+ * Ask a natural-language question about the tenant\'s indexed documents. Returns a grounded answer with documentId citations; ``confident=false`` means the underlying data could not support a reliable answer. Send back the returned ``sessionId`` to continue the conversation; omit it to start a new one.
776
781
  * Chat Query
777
782
  */
778
783
  async chatQuery(requestParameters, initOverrides) {
779
784
  const response = await this.chatQueryRaw(requestParameters, initOverrides);
780
785
  return await response.value();
781
786
  }
787
+ /**
788
+ * Creates request options for deleteChatSession without sending the request
789
+ */
790
+ async deleteChatSessionRequestOpts(requestParameters) {
791
+ if (requestParameters["sessionId"] == null) {
792
+ throw new RequiredError(
793
+ "sessionId",
794
+ 'Required parameter "sessionId" was null or undefined when calling deleteChatSession().'
795
+ );
796
+ }
797
+ const queryParameters = {};
798
+ const headerParameters = {};
799
+ if (this.configuration && this.configuration.apiKey) {
800
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
801
+ }
802
+ if (this.configuration && this.configuration.accessToken) {
803
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
804
+ }
805
+ let urlPath = `/api/v1/chat/sessions/{session_id}`;
806
+ urlPath = urlPath.replace("{session_id}", encodeURIComponent(String(requestParameters["sessionId"])));
807
+ return {
808
+ path: urlPath,
809
+ method: "DELETE",
810
+ headers: headerParameters,
811
+ query: queryParameters
812
+ };
813
+ }
814
+ /**
815
+ * End a conversation explicitly (\'new chat\' hygiene). 404 for unknown, expired, or foreign sessions alike — ids can\'t be probed.
816
+ * Delete Chat Session
817
+ */
818
+ async deleteChatSessionRaw(requestParameters, initOverrides) {
819
+ const requestOptions = await this.deleteChatSessionRequestOpts(requestParameters);
820
+ const response = await this.request(requestOptions, initOverrides);
821
+ return new VoidApiResponse(response);
822
+ }
823
+ /**
824
+ * End a conversation explicitly (\'new chat\' hygiene). 404 for unknown, expired, or foreign sessions alike — ids can\'t be probed.
825
+ * Delete Chat Session
826
+ */
827
+ async deleteChatSession(requestParameters, initOverrides) {
828
+ await this.deleteChatSessionRaw(requestParameters, initOverrides);
829
+ }
782
830
  };
783
831
 
784
832
  // src/generated/models/ContactFormInDTO.ts
@@ -4003,17 +4051,24 @@ function ContractOutDTOFromJSONTyped(json, ignoreDiscriminator) {
4003
4051
  }
4004
4052
  return {
4005
4053
  "billingCycleDay": json["billingCycleDay"],
4054
+ "chatIncludedPerCycle": json["chatIncludedPerCycle"] == null ? void 0 : json["chatIncludedPerCycle"],
4055
+ "chatPriceCents": json["chatPriceCents"] == null ? void 0 : json["chatPriceCents"],
4006
4056
  "checkoutUrl": json["checkoutUrl"] == null ? void 0 : json["checkoutUrl"],
4007
4057
  "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
4008
4058
  "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
4059
+ "documentIntelligenceEnabled": json["documentIntelligenceEnabled"] == null ? void 0 : json["documentIntelligenceEnabled"],
4009
4060
  "id": json["id"],
4061
+ "indexPriceCents": json["indexPriceCents"] == null ? void 0 : json["indexPriceCents"],
4010
4062
  "maxMonthlyExtractions": json["maxMonthlyExtractions"] == null ? void 0 : json["maxMonthlyExtractions"],
4011
4063
  "monthlyFiletagCredits": json["monthlyFiletagCredits"] == null ? void 0 : json["monthlyFiletagCredits"],
4012
4064
  "paddleSubscriptionId": json["paddleSubscriptionId"] == null ? void 0 : json["paddleSubscriptionId"],
4013
4065
  "rateCardTemplateId": json["rateCardTemplateId"] == null ? void 0 : json["rateCardTemplateId"],
4014
4066
  "rateCards": json["rateCards"] == null ? void 0 : json["rateCards"].map(RateCardOutDTOFromJSON),
4015
4067
  "requiresManualApproval": json["requiresManualApproval"],
4068
+ "retrievalRateLimitPerSecond": json["retrievalRateLimitPerSecond"] == null ? void 0 : json["retrievalRateLimitPerSecond"],
4016
4069
  "status": ContractStatusFromJSON(json["status"]),
4070
+ "storageIncludedGb": json["storageIncludedGb"] == null ? void 0 : json["storageIncludedGb"],
4071
+ "storagePricePerGbMonthCents": json["storagePricePerGbMonthCents"] == null ? void 0 : json["storagePricePerGbMonthCents"],
4017
4072
  "userEmail": json["userEmail"] == null ? void 0 : json["userEmail"],
4018
4073
  "userId": json["userId"],
4019
4074
  "volumeDiscountTiers": json["volumeDiscountTiers"] == null ? void 0 : json["volumeDiscountTiers"].map(VolumeDiscountTierOutDTOFromJSON)
@@ -4028,17 +4083,24 @@ function ContractOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
4028
4083
  }
4029
4084
  return {
4030
4085
  "billingCycleDay": value["billingCycleDay"],
4086
+ "chatIncludedPerCycle": value["chatIncludedPerCycle"],
4087
+ "chatPriceCents": value["chatPriceCents"],
4031
4088
  "checkoutUrl": value["checkoutUrl"],
4032
4089
  "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
4033
4090
  "createdAtTimestamp": value["createdAtTimestamp"],
4091
+ "documentIntelligenceEnabled": value["documentIntelligenceEnabled"],
4034
4092
  "id": value["id"],
4093
+ "indexPriceCents": value["indexPriceCents"],
4035
4094
  "maxMonthlyExtractions": value["maxMonthlyExtractions"],
4036
4095
  "monthlyFiletagCredits": value["monthlyFiletagCredits"],
4037
4096
  "paddleSubscriptionId": value["paddleSubscriptionId"],
4038
4097
  "rateCardTemplateId": value["rateCardTemplateId"],
4039
4098
  "rateCards": value["rateCards"] == null ? void 0 : value["rateCards"].map(RateCardOutDTOToJSON),
4040
4099
  "requiresManualApproval": value["requiresManualApproval"],
4100
+ "retrievalRateLimitPerSecond": value["retrievalRateLimitPerSecond"],
4041
4101
  "status": ContractStatusToJSON(value["status"]),
4102
+ "storageIncludedGb": value["storageIncludedGb"],
4103
+ "storagePricePerGbMonthCents": value["storagePricePerGbMonthCents"],
4042
4104
  "userEmail": value["userEmail"],
4043
4105
  "userId": value["userId"],
4044
4106
  "volumeDiscountTiers": value["volumeDiscountTiers"] == null ? void 0 : value["volumeDiscountTiers"].map(VolumeDiscountTierOutDTOToJSON)
@@ -5660,6 +5722,131 @@ function RetrievalAggregateOutDTOToJSONTyped(value, ignoreDiscriminator = false)
5660
5722
  };
5661
5723
  }
5662
5724
 
5725
+ // src/generated/models/RetrievalFieldItemDTO.ts
5726
+ function instanceOfRetrievalFieldItemDTO(value) {
5727
+ if (!("field" in value) || value["field"] === void 0) return false;
5728
+ return true;
5729
+ }
5730
+ function RetrievalFieldItemDTOFromJSON(json) {
5731
+ return RetrievalFieldItemDTOFromJSONTyped(json, false);
5732
+ }
5733
+ function RetrievalFieldItemDTOFromJSONTyped(json, ignoreDiscriminator) {
5734
+ if (json == null) {
5735
+ return json;
5736
+ }
5737
+ return {
5738
+ "count": json["count"] == null ? void 0 : json["count"],
5739
+ "documentType": json["documentType"] == null ? void 0 : json["documentType"],
5740
+ "field": json["field"]
5741
+ };
5742
+ }
5743
+ function RetrievalFieldItemDTOToJSON(json) {
5744
+ return RetrievalFieldItemDTOToJSONTyped(json, false);
5745
+ }
5746
+ function RetrievalFieldItemDTOToJSONTyped(value, ignoreDiscriminator = false) {
5747
+ if (value == null) {
5748
+ return value;
5749
+ }
5750
+ return {
5751
+ "count": value["count"],
5752
+ "documentType": value["documentType"],
5753
+ "field": value["field"]
5754
+ };
5755
+ }
5756
+
5757
+ // src/generated/models/RetrievalFieldsOutDTO.ts
5758
+ function instanceOfRetrievalFieldsOutDTO(value) {
5759
+ return true;
5760
+ }
5761
+ function RetrievalFieldsOutDTOFromJSON(json) {
5762
+ return RetrievalFieldsOutDTOFromJSONTyped(json, false);
5763
+ }
5764
+ function RetrievalFieldsOutDTOFromJSONTyped(json, ignoreDiscriminator) {
5765
+ if (json == null) {
5766
+ return json;
5767
+ }
5768
+ return {
5769
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
5770
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
5771
+ "fields": json["fields"] == null ? void 0 : json["fields"].map(RetrievalFieldItemDTOFromJSON),
5772
+ "servedAt": json["servedAt"] == null ? void 0 : new Date(json["servedAt"]),
5773
+ "servedAtTimestamp": json["servedAtTimestamp"] == null ? void 0 : json["servedAtTimestamp"]
5774
+ };
5775
+ }
5776
+ function RetrievalFieldsOutDTOToJSON(json) {
5777
+ return RetrievalFieldsOutDTOToJSONTyped(json, false);
5778
+ }
5779
+ function RetrievalFieldsOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
5780
+ if (value == null) {
5781
+ return value;
5782
+ }
5783
+ return {
5784
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
5785
+ "createdAtTimestamp": value["createdAtTimestamp"],
5786
+ "fields": value["fields"] == null ? void 0 : value["fields"].map(RetrievalFieldItemDTOToJSON),
5787
+ "servedAt": value["servedAt"] == null ? value["servedAt"] : value["servedAt"].toISOString(),
5788
+ "servedAtTimestamp": value["servedAtTimestamp"]
5789
+ };
5790
+ }
5791
+
5792
+ // src/generated/models/Value.ts
5793
+ function instanceOfValue(value) {
5794
+ return true;
5795
+ }
5796
+ function ValueFromJSON(json) {
5797
+ return ValueFromJSONTyped(json, false);
5798
+ }
5799
+ function ValueFromJSONTyped(json, ignoreDiscriminator) {
5800
+ return json;
5801
+ }
5802
+ function ValueToJSON(json) {
5803
+ return ValueToJSONTyped(json, false);
5804
+ }
5805
+ function ValueToJSONTyped(value, ignoreDiscriminator = false) {
5806
+ return value;
5807
+ }
5808
+
5809
+ // src/generated/models/StructuredFilterDTO.ts
5810
+ var StructuredFilterDTOOpEnum = {
5811
+ Eq: "eq",
5812
+ Neq: "neq",
5813
+ Gt: "gt",
5814
+ Lt: "lt",
5815
+ Contains: "contains",
5816
+ Exists: "exists"
5817
+ };
5818
+ function instanceOfStructuredFilterDTO(value) {
5819
+ if (!("op" in value) || value["op"] === void 0) return false;
5820
+ if (!("path" in value) || value["path"] === void 0) return false;
5821
+ return true;
5822
+ }
5823
+ function StructuredFilterDTOFromJSON(json) {
5824
+ return StructuredFilterDTOFromJSONTyped(json, false);
5825
+ }
5826
+ function StructuredFilterDTOFromJSONTyped(json, ignoreDiscriminator) {
5827
+ if (json == null) {
5828
+ return json;
5829
+ }
5830
+ return {
5831
+ "op": json["op"],
5832
+ "path": json["path"],
5833
+ "value": json["value"] == null ? void 0 : ValueFromJSON(json["value"])
5834
+ };
5835
+ }
5836
+ function StructuredFilterDTOToJSON(json) {
5837
+ return StructuredFilterDTOToJSONTyped(json, false);
5838
+ }
5839
+ function StructuredFilterDTOToJSONTyped(value, ignoreDiscriminator = false) {
5840
+ if (value == null) {
5841
+ return value;
5842
+ }
5843
+ return {
5844
+ "op": value["op"],
5845
+ "path": value["path"],
5846
+ "value": ValueToJSON(value["value"])
5847
+ };
5848
+ }
5849
+
5663
5850
  // src/generated/models/RetrievalQueryInDTO.ts
5664
5851
  var RetrievalQueryInDTOModeEnum = {
5665
5852
  Structured: "structured",
@@ -5694,6 +5881,7 @@ function RetrievalQueryInDTOFromJSONTyped(json, ignoreDiscriminator) {
5694
5881
  "skip": json["skip"] == null ? void 0 : json["skip"],
5695
5882
  "sortField": json["sortField"] == null ? void 0 : json["sortField"],
5696
5883
  "sortMethod": json["sortMethod"] == null ? void 0 : json["sortMethod"],
5884
+ "structuredFilters": json["structuredFilters"] == null ? void 0 : json["structuredFilters"].map(StructuredFilterDTOFromJSON),
5697
5885
  "text": json["text"] == null ? void 0 : json["text"],
5698
5886
  "topK": json["topK"] == null ? void 0 : json["topK"]
5699
5887
  };
@@ -5712,6 +5900,7 @@ function RetrievalQueryInDTOToJSONTyped(value, ignoreDiscriminator = false) {
5712
5900
  "skip": value["skip"],
5713
5901
  "sortField": value["sortField"],
5714
5902
  "sortMethod": value["sortMethod"],
5903
+ "structuredFilters": value["structuredFilters"] == null ? void 0 : value["structuredFilters"].map(StructuredFilterDTOToJSON),
5715
5904
  "text": value["text"],
5716
5905
  "topK": value["topK"]
5717
5906
  };
@@ -5752,6 +5941,38 @@ function QueryMetaDTOToJSONTyped(value, ignoreDiscriminator = false) {
5752
5941
  };
5753
5942
  }
5754
5943
 
5944
+ // src/generated/models/MatchedChunkDTO.ts
5945
+ function instanceOfMatchedChunkDTO(value) {
5946
+ if (!("text" in value) || value["text"] === void 0) return false;
5947
+ return true;
5948
+ }
5949
+ function MatchedChunkDTOFromJSON(json) {
5950
+ return MatchedChunkDTOFromJSONTyped(json, false);
5951
+ }
5952
+ function MatchedChunkDTOFromJSONTyped(json, ignoreDiscriminator) {
5953
+ if (json == null) {
5954
+ return json;
5955
+ }
5956
+ return {
5957
+ "chunkType": json["chunkType"] == null ? void 0 : json["chunkType"],
5958
+ "score": json["score"] == null ? void 0 : json["score"],
5959
+ "text": json["text"]
5960
+ };
5961
+ }
5962
+ function MatchedChunkDTOToJSON(json) {
5963
+ return MatchedChunkDTOToJSONTyped(json, false);
5964
+ }
5965
+ function MatchedChunkDTOToJSONTyped(value, ignoreDiscriminator = false) {
5966
+ if (value == null) {
5967
+ return value;
5968
+ }
5969
+ return {
5970
+ "chunkType": value["chunkType"],
5971
+ "score": value["score"],
5972
+ "text": value["text"]
5973
+ };
5974
+ }
5975
+
5755
5976
  // src/generated/models/QueryResultItemDTO.ts
5756
5977
  function instanceOfQueryResultItemDTO(value) {
5757
5978
  if (!("documentExtractionId" in value) || value["documentExtractionId"] === void 0) return false;
@@ -5777,6 +5998,7 @@ function QueryResultItemDTOFromJSONTyped(json, ignoreDiscriminator) {
5777
5998
  "expenseType": json["expenseType"] == null ? void 0 : json["expenseType"],
5778
5999
  "externalId": json["externalId"] == null ? void 0 : json["externalId"],
5779
6000
  "issueDate": json["issueDate"] == null ? void 0 : new Date(json["issueDate"]),
6001
+ "matchedChunks": json["matchedChunks"] == null ? void 0 : json["matchedChunks"].map(MatchedChunkDTOFromJSON),
5780
6002
  "netAmount": json["netAmount"] == null ? void 0 : json["netAmount"],
5781
6003
  "paymentMethod": json["paymentMethod"] == null ? void 0 : json["paymentMethod"],
5782
6004
  "score": json["score"] == null ? void 0 : json["score"],
@@ -5806,6 +6028,7 @@ function QueryResultItemDTOToJSONTyped(value, ignoreDiscriminator = false) {
5806
6028
  "expenseType": value["expenseType"],
5807
6029
  "externalId": value["externalId"],
5808
6030
  "issueDate": value["issueDate"] == null ? value["issueDate"] : value["issueDate"].toISOString().substring(0, 10),
6031
+ "matchedChunks": value["matchedChunks"] == null ? void 0 : value["matchedChunks"].map(MatchedChunkDTOToJSON),
5809
6032
  "netAmount": value["netAmount"],
5810
6033
  "paymentMethod": value["paymentMethod"],
5811
6034
  "score": value["score"],
@@ -5937,6 +6160,43 @@ var RetrievalApi = class extends BaseAPI {
5937
6160
  const response = await this.retrievalAggregateRaw(requestParameters, initOverrides);
5938
6161
  return await response.value();
5939
6162
  }
6163
+ /**
6164
+ * Creates request options for retrievalFields without sending the request
6165
+ */
6166
+ async retrievalFieldsRequestOpts() {
6167
+ const queryParameters = {};
6168
+ const headerParameters = {};
6169
+ if (this.configuration && this.configuration.apiKey) {
6170
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
6171
+ }
6172
+ if (this.configuration && this.configuration.accessToken) {
6173
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
6174
+ }
6175
+ let urlPath = `/api/v1/retrieval/fields`;
6176
+ return {
6177
+ path: urlPath,
6178
+ method: "GET",
6179
+ headers: headerParameters,
6180
+ query: queryParameters
6181
+ };
6182
+ }
6183
+ /**
6184
+ * Observed structured field NAMES per document type (self-query catalog). Names only — no values; tenant-scoped like every retrieval path.
6185
+ * Retrieval Fields
6186
+ */
6187
+ async retrievalFieldsRaw(initOverrides) {
6188
+ const requestOptions = await this.retrievalFieldsRequestOpts();
6189
+ const response = await this.request(requestOptions, initOverrides);
6190
+ return new JSONApiResponse(response, (jsonValue) => RetrievalFieldsOutDTOFromJSON(jsonValue));
6191
+ }
6192
+ /**
6193
+ * Observed structured field NAMES per document type (self-query catalog). Names only — no values; tenant-scoped like every retrieval path.
6194
+ * Retrieval Fields
6195
+ */
6196
+ async retrievalFields(initOverrides) {
6197
+ const response = await this.retrievalFieldsRaw(initOverrides);
6198
+ return await response.value();
6199
+ }
5940
6200
  /**
5941
6201
  * Creates request options for retrievalQuery without sending the request
5942
6202
  */
@@ -5991,6 +6251,9 @@ var RetrievalApi = class extends BaseAPI {
5991
6251
  if (this.configuration && this.configuration.apiKey) {
5992
6252
  headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
5993
6253
  }
6254
+ if (this.configuration && this.configuration.accessToken) {
6255
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
6256
+ }
5994
6257
  let urlPath = `/api/v1/retrieval/status`;
5995
6258
  return {
5996
6259
  path: urlPath,
@@ -6000,7 +6263,7 @@ var RetrievalApi = class extends BaseAPI {
6000
6263
  };
6001
6264
  }
6002
6265
  /**
6003
- * How many of the tenant\'s documents are currently indexed.
6266
+ * How many of the tenant\'s documents are currently indexed. Same dual auth as /query: X-API-Key OR a Bearer retrieval token — but only an *unpinned* (whole-account) token is accepted. An end-user-pinned token gets 403: the account-wide index size must not leak into a single end-user\'s browser session.
6004
6267
  * Retrieval Status
6005
6268
  */
6006
6269
  async retrievalStatusRaw(initOverrides) {
@@ -6009,7 +6272,7 @@ var RetrievalApi = class extends BaseAPI {
6009
6272
  return new JSONApiResponse(response, (jsonValue) => RetrievalStatusOutDTOFromJSON(jsonValue));
6010
6273
  }
6011
6274
  /**
6012
- * How many of the tenant\'s documents are currently indexed.
6275
+ * How many of the tenant\'s documents are currently indexed. Same dual auth as /query: X-API-Key OR a Bearer retrieval token — but only an *unpinned* (whole-account) token is accepted. An end-user-pinned token gets 403: the account-wide index size must not leak into a single end-user\'s browser session.
6013
6276
  * Retrieval Status
6014
6277
  */
6015
6278
  async retrievalStatus(initOverrides) {
@@ -6135,6 +6398,51 @@ var SessionsApi = class extends BaseAPI {
6135
6398
  const response = await this.mintRetrievalTokenRaw(requestParameters, initOverrides);
6136
6399
  return await response.value();
6137
6400
  }
6401
+ /**
6402
+ * Creates request options for mintRetrievalTokenUser without sending the request
6403
+ */
6404
+ async mintRetrievalTokenUserRequestOpts(requestParameters) {
6405
+ if (requestParameters["sessionTokenInDTO"] == null) {
6406
+ throw new RequiredError(
6407
+ "sessionTokenInDTO",
6408
+ 'Required parameter "sessionTokenInDTO" was null or undefined when calling mintRetrievalTokenUser().'
6409
+ );
6410
+ }
6411
+ const queryParameters = {};
6412
+ const headerParameters = {};
6413
+ headerParameters["Content-Type"] = "application/json";
6414
+ if (this.configuration && this.configuration.apiKey) {
6415
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
6416
+ }
6417
+ if (this.configuration && this.configuration.accessToken) {
6418
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
6419
+ }
6420
+ let urlPath = `/api/v1/sessions/token/user`;
6421
+ return {
6422
+ path: urlPath,
6423
+ method: "POST",
6424
+ headers: headerParameters,
6425
+ query: queryParameters,
6426
+ body: SessionTokenInDTOToJSON(requestParameters["sessionTokenInDTO"])
6427
+ };
6428
+ }
6429
+ /**
6430
+ * Browser-safe variant of ``POST /v1/sessions/token`` for logged-in users. Authenticates with the caller\'s JWT (``Authorization: Bearer <jwt>``) and treats the ``X-API-Key`` header as the *UUID id* of one of the user\'s API keys — NOT the raw secret. Ownership is verified server-side (``APIKeyModel.id == header AND user_id == jwt``), so the raw secret never leaves the server. Mirrors ``POST /v1/filetag/user``. Deliberately, the key\'s IP allowlist is NOT enforced on this path: the console runs from arbitrary user IPs, and JWT auth + server-side ownership is the control — the same accepted convention as ``/v1/filetag/user``. The minted token is identical to the server-to-server variant: signed, query-only, TTL-clamped, tenant pinned from the key.
6431
+ * Mint Retrieval Token User
6432
+ */
6433
+ async mintRetrievalTokenUserRaw(requestParameters, initOverrides) {
6434
+ const requestOptions = await this.mintRetrievalTokenUserRequestOpts(requestParameters);
6435
+ const response = await this.request(requestOptions, initOverrides);
6436
+ return new JSONApiResponse(response, (jsonValue) => SessionTokenOutDTOFromJSON(jsonValue));
6437
+ }
6438
+ /**
6439
+ * Browser-safe variant of ``POST /v1/sessions/token`` for logged-in users. Authenticates with the caller\'s JWT (``Authorization: Bearer <jwt>``) and treats the ``X-API-Key`` header as the *UUID id* of one of the user\'s API keys — NOT the raw secret. Ownership is verified server-side (``APIKeyModel.id == header AND user_id == jwt``), so the raw secret never leaves the server. Mirrors ``POST /v1/filetag/user``. Deliberately, the key\'s IP allowlist is NOT enforced on this path: the console runs from arbitrary user IPs, and JWT auth + server-side ownership is the control — the same accepted convention as ``/v1/filetag/user``. The minted token is identical to the server-to-server variant: signed, query-only, TTL-clamped, tenant pinned from the key.
6440
+ * Mint Retrieval Token User
6441
+ */
6442
+ async mintRetrievalTokenUser(requestParameters, initOverrides) {
6443
+ const response = await this.mintRetrievalTokenUserRaw(requestParameters, initOverrides);
6444
+ return await response.value();
6445
+ }
6138
6446
  };
6139
6447
 
6140
6448
  // src/generated/models/CheckoutOutDTO.ts
@@ -6312,6 +6620,7 @@ function PlanDetailOutDTOFromJSONTyped(json, ignoreDiscriminator) {
6312
6620
  }
6313
6621
  return {
6314
6622
  "bonusPercentage": json["bonusPercentage"],
6623
+ "chatCreditCost": json["chatCreditCost"] == null ? void 0 : json["chatCreditCost"],
6315
6624
  "chatIncludedPerCycle": json["chatIncludedPerCycle"] == null ? void 0 : json["chatIncludedPerCycle"],
6316
6625
  "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
6317
6626
  "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
@@ -6322,6 +6631,7 @@ function PlanDetailOutDTOFromJSONTyped(json, ignoreDiscriminator) {
6322
6631
  "documentIntelligenceEnabled": json["documentIntelligenceEnabled"] == null ? void 0 : json["documentIntelligenceEnabled"],
6323
6632
  "enhancedPrivacyEnabled": json["enhancedPrivacyEnabled"],
6324
6633
  "id": json["id"],
6634
+ "indexCreditCost": json["indexCreditCost"] == null ? void 0 : json["indexCreditCost"],
6325
6635
  "ipAllowlistEnabled": json["ipAllowlistEnabled"],
6326
6636
  "isActive": json["isActive"],
6327
6637
  "maxDataRetentionPeriod": DataRetentionPeriodModelFromJSON(json["maxDataRetentionPeriod"]),
@@ -6334,6 +6644,7 @@ function PlanDetailOutDTOFromJSONTyped(json, ignoreDiscriminator) {
6334
6644
  "retrievalRateLimitPerSecond": json["retrievalRateLimitPerSecond"] == null ? void 0 : json["retrievalRateLimitPerSecond"],
6335
6645
  "slug": json["slug"],
6336
6646
  "storageCreditCostPerGbMonth": json["storageCreditCostPerGbMonth"] == null ? void 0 : json["storageCreditCostPerGbMonth"],
6647
+ "storageIncludedGb": json["storageIncludedGb"] == null ? void 0 : json["storageIncludedGb"],
6337
6648
  "supportLevel": SupportLevelFromJSON(json["supportLevel"]),
6338
6649
  "webhooksEnabled": json["webhooksEnabled"]
6339
6650
  };
@@ -6347,6 +6658,7 @@ function PlanDetailOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
6347
6658
  }
6348
6659
  return {
6349
6660
  "bonusPercentage": value["bonusPercentage"],
6661
+ "chatCreditCost": value["chatCreditCost"],
6350
6662
  "chatIncludedPerCycle": value["chatIncludedPerCycle"],
6351
6663
  "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
6352
6664
  "createdAtTimestamp": value["createdAtTimestamp"],
@@ -6357,6 +6669,7 @@ function PlanDetailOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
6357
6669
  "documentIntelligenceEnabled": value["documentIntelligenceEnabled"],
6358
6670
  "enhancedPrivacyEnabled": value["enhancedPrivacyEnabled"],
6359
6671
  "id": value["id"],
6672
+ "indexCreditCost": value["indexCreditCost"],
6360
6673
  "ipAllowlistEnabled": value["ipAllowlistEnabled"],
6361
6674
  "isActive": value["isActive"],
6362
6675
  "maxDataRetentionPeriod": DataRetentionPeriodModelToJSON(value["maxDataRetentionPeriod"]),
@@ -6369,6 +6682,7 @@ function PlanDetailOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
6369
6682
  "retrievalRateLimitPerSecond": value["retrievalRateLimitPerSecond"],
6370
6683
  "slug": value["slug"],
6371
6684
  "storageCreditCostPerGbMonth": value["storageCreditCostPerGbMonth"],
6685
+ "storageIncludedGb": value["storageIncludedGb"],
6372
6686
  "supportLevel": SupportLevelToJSON(value["supportLevel"]),
6373
6687
  "webhooksEnabled": value["webhooksEnabled"]
6374
6688
  };
@@ -6402,6 +6716,7 @@ function PlanOutDTOFromJSONTyped(json, ignoreDiscriminator) {
6402
6716
  }
6403
6717
  return {
6404
6718
  "bonusPercentage": json["bonusPercentage"],
6719
+ "chatCreditCost": json["chatCreditCost"] == null ? void 0 : json["chatCreditCost"],
6405
6720
  "chatIncludedPerCycle": json["chatIncludedPerCycle"] == null ? void 0 : json["chatIncludedPerCycle"],
6406
6721
  "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
6407
6722
  "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
@@ -6411,6 +6726,7 @@ function PlanOutDTOFromJSONTyped(json, ignoreDiscriminator) {
6411
6726
  "documentIntelligenceEnabled": json["documentIntelligenceEnabled"] == null ? void 0 : json["documentIntelligenceEnabled"],
6412
6727
  "enhancedPrivacyEnabled": json["enhancedPrivacyEnabled"],
6413
6728
  "id": json["id"],
6729
+ "indexCreditCost": json["indexCreditCost"] == null ? void 0 : json["indexCreditCost"],
6414
6730
  "ipAllowlistEnabled": json["ipAllowlistEnabled"],
6415
6731
  "isActive": json["isActive"],
6416
6732
  "maxDataRetentionPeriod": DataRetentionPeriodModelFromJSON(json["maxDataRetentionPeriod"]),
@@ -6423,6 +6739,7 @@ function PlanOutDTOFromJSONTyped(json, ignoreDiscriminator) {
6423
6739
  "retrievalRateLimitPerSecond": json["retrievalRateLimitPerSecond"] == null ? void 0 : json["retrievalRateLimitPerSecond"],
6424
6740
  "slug": json["slug"],
6425
6741
  "storageCreditCostPerGbMonth": json["storageCreditCostPerGbMonth"] == null ? void 0 : json["storageCreditCostPerGbMonth"],
6742
+ "storageIncludedGb": json["storageIncludedGb"] == null ? void 0 : json["storageIncludedGb"],
6426
6743
  "supportLevel": SupportLevelFromJSON(json["supportLevel"]),
6427
6744
  "webhooksEnabled": json["webhooksEnabled"]
6428
6745
  };
@@ -6436,6 +6753,7 @@ function PlanOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
6436
6753
  }
6437
6754
  return {
6438
6755
  "bonusPercentage": value["bonusPercentage"],
6756
+ "chatCreditCost": value["chatCreditCost"],
6439
6757
  "chatIncludedPerCycle": value["chatIncludedPerCycle"],
6440
6758
  "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
6441
6759
  "createdAtTimestamp": value["createdAtTimestamp"],
@@ -6445,6 +6763,7 @@ function PlanOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
6445
6763
  "documentIntelligenceEnabled": value["documentIntelligenceEnabled"],
6446
6764
  "enhancedPrivacyEnabled": value["enhancedPrivacyEnabled"],
6447
6765
  "id": value["id"],
6766
+ "indexCreditCost": value["indexCreditCost"],
6448
6767
  "ipAllowlistEnabled": value["ipAllowlistEnabled"],
6449
6768
  "isActive": value["isActive"],
6450
6769
  "maxDataRetentionPeriod": DataRetentionPeriodModelToJSON(value["maxDataRetentionPeriod"]),
@@ -6457,6 +6776,7 @@ function PlanOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
6457
6776
  "retrievalRateLimitPerSecond": value["retrievalRateLimitPerSecond"],
6458
6777
  "slug": value["slug"],
6459
6778
  "storageCreditCostPerGbMonth": value["storageCreditCostPerGbMonth"],
6779
+ "storageIncludedGb": value["storageIncludedGb"],
6460
6780
  "supportLevel": SupportLevelToJSON(value["supportLevel"]),
6461
6781
  "webhooksEnabled": value["webhooksEnabled"]
6462
6782
  };
@@ -6566,13 +6886,17 @@ function ResponseChangePlanFromJSONTyped(json, ignoreDiscriminator) {
6566
6886
  "paddleTransactionId": json["paddleTransactionId"] == null ? void 0 : json["paddleTransactionId"],
6567
6887
  "subscriptionId": json["subscriptionId"],
6568
6888
  "cancelScheduledAt": json["cancelScheduledAt"] == null ? void 0 : new Date(json["cancelScheduledAt"]),
6889
+ "chatCreditCost": json["chatCreditCost"] == null ? void 0 : json["chatCreditCost"],
6890
+ "chatIncludedPerCycle": json["chatIncludedPerCycle"] == null ? void 0 : json["chatIncludedPerCycle"],
6569
6891
  "creditsRemaining": json["creditsRemaining"],
6570
6892
  "creditsSnapshot": json["creditsSnapshot"],
6571
6893
  "currentPeriodEnd": json["currentPeriodEnd"] == null ? void 0 : new Date(json["currentPeriodEnd"]),
6572
6894
  "currentPeriodStart": json["currentPeriodStart"] == null ? void 0 : new Date(json["currentPeriodStart"]),
6573
6895
  "dataResidencyEnabled": json["dataResidencyEnabled"],
6896
+ "documentIntelligenceEnabled": json["documentIntelligenceEnabled"] == null ? void 0 : json["documentIntelligenceEnabled"],
6574
6897
  "enhancedPrivacyEnabled": json["enhancedPrivacyEnabled"],
6575
6898
  "id": json["id"],
6899
+ "indexCreditCost": json["indexCreditCost"] == null ? void 0 : json["indexCreditCost"],
6576
6900
  "ipAllowlistEnabled": json["ipAllowlistEnabled"],
6577
6901
  "maxDataRetentionPeriod": DataRetentionPeriodModelFromJSON(json["maxDataRetentionPeriod"]),
6578
6902
  "maxTemplates": json["maxTemplates"],
@@ -6581,7 +6905,10 @@ function ResponseChangePlanFromJSONTyped(json, ignoreDiscriminator) {
6581
6905
  "planId": json["planId"],
6582
6906
  "planName": json["planName"] == null ? void 0 : json["planName"],
6583
6907
  "priceSnapshotCents": json["priceSnapshotCents"],
6908
+ "retrievalRateLimitPerSecond": json["retrievalRateLimitPerSecond"] == null ? void 0 : json["retrievalRateLimitPerSecond"],
6584
6909
  "status": SubscriptionStatusFromJSON(json["status"]),
6910
+ "storageCreditCostPerGbMonth": json["storageCreditCostPerGbMonth"] == null ? void 0 : json["storageCreditCostPerGbMonth"],
6911
+ "storageIncludedGb": json["storageIncludedGb"] == null ? void 0 : json["storageIncludedGb"],
6585
6912
  "supportLevel": SupportLevelFromJSON(json["supportLevel"]),
6586
6913
  "userEmail": json["userEmail"] == null ? void 0 : json["userEmail"],
6587
6914
  "userId": json["userId"],
@@ -6602,13 +6929,17 @@ function ResponseChangePlanToJSONTyped(value, ignoreDiscriminator = false) {
6602
6929
  "paddleTransactionId": value["paddleTransactionId"],
6603
6930
  "subscriptionId": value["subscriptionId"],
6604
6931
  "cancelScheduledAt": value["cancelScheduledAt"] == null ? value["cancelScheduledAt"] : value["cancelScheduledAt"].toISOString(),
6932
+ "chatCreditCost": value["chatCreditCost"],
6933
+ "chatIncludedPerCycle": value["chatIncludedPerCycle"],
6605
6934
  "creditsRemaining": value["creditsRemaining"],
6606
6935
  "creditsSnapshot": value["creditsSnapshot"],
6607
6936
  "currentPeriodEnd": value["currentPeriodEnd"] == null ? value["currentPeriodEnd"] : value["currentPeriodEnd"].toISOString(),
6608
6937
  "currentPeriodStart": value["currentPeriodStart"] == null ? value["currentPeriodStart"] : value["currentPeriodStart"].toISOString(),
6609
6938
  "dataResidencyEnabled": value["dataResidencyEnabled"],
6939
+ "documentIntelligenceEnabled": value["documentIntelligenceEnabled"],
6610
6940
  "enhancedPrivacyEnabled": value["enhancedPrivacyEnabled"],
6611
6941
  "id": value["id"],
6942
+ "indexCreditCost": value["indexCreditCost"],
6612
6943
  "ipAllowlistEnabled": value["ipAllowlistEnabled"],
6613
6944
  "maxDataRetentionPeriod": DataRetentionPeriodModelToJSON(value["maxDataRetentionPeriod"]),
6614
6945
  "maxTemplates": value["maxTemplates"],
@@ -6617,7 +6948,10 @@ function ResponseChangePlanToJSONTyped(value, ignoreDiscriminator = false) {
6617
6948
  "planId": value["planId"],
6618
6949
  "planName": value["planName"],
6619
6950
  "priceSnapshotCents": value["priceSnapshotCents"],
6951
+ "retrievalRateLimitPerSecond": value["retrievalRateLimitPerSecond"],
6620
6952
  "status": SubscriptionStatusToJSON(value["status"]),
6953
+ "storageCreditCostPerGbMonth": value["storageCreditCostPerGbMonth"],
6954
+ "storageIncludedGb": value["storageIncludedGb"],
6621
6955
  "supportLevel": SupportLevelToJSON(value["supportLevel"]),
6622
6956
  "userEmail": value["userEmail"],
6623
6957
  "userId": value["userId"],
@@ -6625,6 +6959,63 @@ function ResponseChangePlanToJSONTyped(value, ignoreDiscriminator = false) {
6625
6959
  };
6626
6960
  }
6627
6961
 
6962
+ // src/generated/models/StorageUsageOutDTO.ts
6963
+ function instanceOfStorageUsageOutDTO(value) {
6964
+ if (!("billableGb" in value) || value["billableGb"] === void 0) return false;
6965
+ if (!("billingMode" in value) || value["billingMode"] === void 0) return false;
6966
+ if (!("includedGb" in value) || value["includedGb"] === void 0) return false;
6967
+ if (!("projectedCharge" in value) || value["projectedCharge"] === void 0) return false;
6968
+ if (!("ratePerGbMonth" in value) || value["ratePerGbMonth"] === void 0) return false;
6969
+ if (!("storedBytes" in value) || value["storedBytes"] === void 0) return false;
6970
+ if (!("storedGb" in value) || value["storedGb"] === void 0) return false;
6971
+ if (!("unit" in value) || value["unit"] === void 0) return false;
6972
+ return true;
6973
+ }
6974
+ function StorageUsageOutDTOFromJSON(json) {
6975
+ return StorageUsageOutDTOFromJSONTyped(json, false);
6976
+ }
6977
+ function StorageUsageOutDTOFromJSONTyped(json, ignoreDiscriminator) {
6978
+ if (json == null) {
6979
+ return json;
6980
+ }
6981
+ return {
6982
+ "billableGb": json["billableGb"],
6983
+ "billingMode": json["billingMode"],
6984
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
6985
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
6986
+ "includedGb": json["includedGb"],
6987
+ "projectedCharge": json["projectedCharge"],
6988
+ "ratePerGbMonth": json["ratePerGbMonth"],
6989
+ "servedAt": json["servedAt"] == null ? void 0 : new Date(json["servedAt"]),
6990
+ "servedAtTimestamp": json["servedAtTimestamp"] == null ? void 0 : json["servedAtTimestamp"],
6991
+ "storedBytes": json["storedBytes"],
6992
+ "storedGb": json["storedGb"],
6993
+ "unit": json["unit"]
6994
+ };
6995
+ }
6996
+ function StorageUsageOutDTOToJSON(json) {
6997
+ return StorageUsageOutDTOToJSONTyped(json, false);
6998
+ }
6999
+ function StorageUsageOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
7000
+ if (value == null) {
7001
+ return value;
7002
+ }
7003
+ return {
7004
+ "billableGb": value["billableGb"],
7005
+ "billingMode": value["billingMode"],
7006
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
7007
+ "createdAtTimestamp": value["createdAtTimestamp"],
7008
+ "includedGb": value["includedGb"],
7009
+ "projectedCharge": value["projectedCharge"],
7010
+ "ratePerGbMonth": value["ratePerGbMonth"],
7011
+ "servedAt": value["servedAt"] == null ? value["servedAt"] : value["servedAt"].toISOString(),
7012
+ "servedAtTimestamp": value["servedAtTimestamp"],
7013
+ "storedBytes": value["storedBytes"],
7014
+ "storedGb": value["storedGb"],
7015
+ "unit": value["unit"]
7016
+ };
7017
+ }
7018
+
6628
7019
  // src/generated/models/SubscribeInDTO.ts
6629
7020
  function instanceOfSubscribeInDTO(value) {
6630
7021
  if (!("planId" in value) || value["planId"] === void 0) return false;
@@ -6681,6 +7072,8 @@ function SubscriptionOutDTOFromJSONTyped(json, ignoreDiscriminator) {
6681
7072
  }
6682
7073
  return {
6683
7074
  "cancelScheduledAt": json["cancelScheduledAt"] == null ? void 0 : new Date(json["cancelScheduledAt"]),
7075
+ "chatCreditCost": json["chatCreditCost"] == null ? void 0 : json["chatCreditCost"],
7076
+ "chatIncludedPerCycle": json["chatIncludedPerCycle"] == null ? void 0 : json["chatIncludedPerCycle"],
6684
7077
  "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
6685
7078
  "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
6686
7079
  "creditsRemaining": json["creditsRemaining"],
@@ -6688,8 +7081,10 @@ function SubscriptionOutDTOFromJSONTyped(json, ignoreDiscriminator) {
6688
7081
  "currentPeriodEnd": json["currentPeriodEnd"] == null ? void 0 : new Date(json["currentPeriodEnd"]),
6689
7082
  "currentPeriodStart": json["currentPeriodStart"] == null ? void 0 : new Date(json["currentPeriodStart"]),
6690
7083
  "dataResidencyEnabled": json["dataResidencyEnabled"],
7084
+ "documentIntelligenceEnabled": json["documentIntelligenceEnabled"] == null ? void 0 : json["documentIntelligenceEnabled"],
6691
7085
  "enhancedPrivacyEnabled": json["enhancedPrivacyEnabled"],
6692
7086
  "id": json["id"],
7087
+ "indexCreditCost": json["indexCreditCost"] == null ? void 0 : json["indexCreditCost"],
6693
7088
  "ipAllowlistEnabled": json["ipAllowlistEnabled"],
6694
7089
  "maxDataRetentionPeriod": DataRetentionPeriodModelFromJSON(json["maxDataRetentionPeriod"]),
6695
7090
  "maxTemplates": json["maxTemplates"],
@@ -6698,7 +7093,10 @@ function SubscriptionOutDTOFromJSONTyped(json, ignoreDiscriminator) {
6698
7093
  "planId": json["planId"],
6699
7094
  "planName": json["planName"] == null ? void 0 : json["planName"],
6700
7095
  "priceSnapshotCents": json["priceSnapshotCents"],
7096
+ "retrievalRateLimitPerSecond": json["retrievalRateLimitPerSecond"] == null ? void 0 : json["retrievalRateLimitPerSecond"],
6701
7097
  "status": SubscriptionStatusFromJSON(json["status"]),
7098
+ "storageCreditCostPerGbMonth": json["storageCreditCostPerGbMonth"] == null ? void 0 : json["storageCreditCostPerGbMonth"],
7099
+ "storageIncludedGb": json["storageIncludedGb"] == null ? void 0 : json["storageIncludedGb"],
6702
7100
  "supportLevel": SupportLevelFromJSON(json["supportLevel"]),
6703
7101
  "userEmail": json["userEmail"] == null ? void 0 : json["userEmail"],
6704
7102
  "userId": json["userId"],
@@ -6714,6 +7112,8 @@ function SubscriptionOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
6714
7112
  }
6715
7113
  return {
6716
7114
  "cancelScheduledAt": value["cancelScheduledAt"] == null ? value["cancelScheduledAt"] : value["cancelScheduledAt"].toISOString(),
7115
+ "chatCreditCost": value["chatCreditCost"],
7116
+ "chatIncludedPerCycle": value["chatIncludedPerCycle"],
6717
7117
  "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
6718
7118
  "createdAtTimestamp": value["createdAtTimestamp"],
6719
7119
  "creditsRemaining": value["creditsRemaining"],
@@ -6721,8 +7121,10 @@ function SubscriptionOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
6721
7121
  "currentPeriodEnd": value["currentPeriodEnd"] == null ? value["currentPeriodEnd"] : value["currentPeriodEnd"].toISOString(),
6722
7122
  "currentPeriodStart": value["currentPeriodStart"] == null ? value["currentPeriodStart"] : value["currentPeriodStart"].toISOString(),
6723
7123
  "dataResidencyEnabled": value["dataResidencyEnabled"],
7124
+ "documentIntelligenceEnabled": value["documentIntelligenceEnabled"],
6724
7125
  "enhancedPrivacyEnabled": value["enhancedPrivacyEnabled"],
6725
7126
  "id": value["id"],
7127
+ "indexCreditCost": value["indexCreditCost"],
6726
7128
  "ipAllowlistEnabled": value["ipAllowlistEnabled"],
6727
7129
  "maxDataRetentionPeriod": DataRetentionPeriodModelToJSON(value["maxDataRetentionPeriod"]),
6728
7130
  "maxTemplates": value["maxTemplates"],
@@ -6731,7 +7133,10 @@ function SubscriptionOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
6731
7133
  "planId": value["planId"],
6732
7134
  "planName": value["planName"],
6733
7135
  "priceSnapshotCents": value["priceSnapshotCents"],
7136
+ "retrievalRateLimitPerSecond": value["retrievalRateLimitPerSecond"],
6734
7137
  "status": SubscriptionStatusToJSON(value["status"]),
7138
+ "storageCreditCostPerGbMonth": value["storageCreditCostPerGbMonth"],
7139
+ "storageIncludedGb": value["storageIncludedGb"],
6735
7140
  "supportLevel": SupportLevelToJSON(value["supportLevel"]),
6736
7141
  "userEmail": value["userEmail"],
6737
7142
  "userId": value["userId"],
@@ -7117,6 +7522,38 @@ var SubscriptionsApi = class extends BaseAPI {
7117
7522
  const response = await this.getCreditUsageRaw(initOverrides);
7118
7523
  return await response.value();
7119
7524
  }
7525
+ /**
7526
+ * Creates request options for getMyStorageUsage without sending the request
7527
+ */
7528
+ async getMyStorageUsageRequestOpts() {
7529
+ const queryParameters = {};
7530
+ const headerParameters = {};
7531
+ if (this.configuration && this.configuration.accessToken) {
7532
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
7533
+ }
7534
+ let urlPath = `/api/v1/subscriptions/me/storage`;
7535
+ return {
7536
+ path: urlPath,
7537
+ method: "GET",
7538
+ headers: headerParameters,
7539
+ query: queryParameters
7540
+ };
7541
+ }
7542
+ /**
7543
+ * Get My Storage Usage
7544
+ */
7545
+ async getMyStorageUsageRaw(initOverrides) {
7546
+ const requestOptions = await this.getMyStorageUsageRequestOpts();
7547
+ const response = await this.request(requestOptions, initOverrides);
7548
+ return new JSONApiResponse(response, (jsonValue) => StorageUsageOutDTOFromJSON(jsonValue));
7549
+ }
7550
+ /**
7551
+ * Get My Storage Usage
7552
+ */
7553
+ async getMyStorageUsage(initOverrides) {
7554
+ const response = await this.getMyStorageUsageRaw(initOverrides);
7555
+ return await response.value();
7556
+ }
7120
7557
  /**
7121
7558
  * Creates request options for getMySubscription without sending the request
7122
7559
  */
@@ -8465,6 +8902,40 @@ function isTerminal(status) {
8465
8902
  function normalizeBaseUrl(baseUrl) {
8466
8903
  return baseUrl.replace(/\/+$/, "");
8467
8904
  }
8905
+ var GeminaChatConversation = class {
8906
+ constructor(chat, endUserId) {
8907
+ this.chat = chat;
8908
+ this.endUserId = endUserId;
8909
+ }
8910
+ /** The current conversation id — `undefined` before the first turn or after a reset. */
8911
+ get sessionId() {
8912
+ return this.currentSessionId;
8913
+ }
8914
+ /** Send one turn; its answer continues this conversation. */
8915
+ async send(message) {
8916
+ const sessionId = this.currentSessionId;
8917
+ const result = await this.chat.chatQuery({
8918
+ chatQueryInDTO: { message, endUserId: this.endUserId, ...sessionId ? { sessionId } : {} }
8919
+ });
8920
+ this.currentSessionId = result.sessionId ?? this.currentSessionId;
8921
+ return result;
8922
+ }
8923
+ /** Forget the conversation locally; the next `send` starts a new one. */
8924
+ reset() {
8925
+ this.currentSessionId = void 0;
8926
+ }
8927
+ /**
8928
+ * End the conversation: delete it server-side (mirrors a "New chat" action)
8929
+ * and forget it locally. No-op if no turn has been sent yet.
8930
+ */
8931
+ async delete() {
8932
+ const sessionId = this.currentSessionId;
8933
+ this.currentSessionId = void 0;
8934
+ if (sessionId !== void 0) {
8935
+ await this.chat.deleteChatSession({ sessionId });
8936
+ }
8937
+ }
8938
+ };
8468
8939
  var GeminaClient = class _GeminaClient {
8469
8940
  /**
8470
8941
  * @param apiKey Gemina API key, sent as the `X-API-Key` header.
@@ -8535,6 +9006,15 @@ var GeminaClient = class _GeminaClient {
8535
9006
  var _a;
8536
9007
  return (_a = this.apiCache).billing ?? (_a.billing = this.apiOverrides.billing ?? new BillingApi(this.configuration));
8537
9008
  }
9009
+ // --- Stateful chat convenience ---
9010
+ /**
9011
+ * Start a stateful chat {@link GeminaChatConversation} that threads the
9012
+ * conversation `sessionId` across turns for you, so follow-up questions keep
9013
+ * context. The full one-shot surface stays on `client.chat`.
9014
+ */
9015
+ conversation(options = {}) {
9016
+ return new GeminaChatConversation(this.chat, options.endUserId);
9017
+ }
8538
9018
  // --- The headline one-call flow ---
8539
9019
  /**
8540
9020
  * Submit a document via the async endpoints, poll with exponential
@@ -8684,7 +9164,7 @@ async function asProcessingErrorIfFailedResult(error) {
8684
9164
  }
8685
9165
 
8686
9166
  // src/version.ts
8687
- var VERSION = "0.1.2";
9167
+ var VERSION = "0.2.1";
8688
9168
  export {
8689
9169
  AggregateMetaDTOFromJSON,
8690
9170
  AggregateMetaDTOFromJSONTyped,
@@ -8948,6 +9428,7 @@ export {
8948
9428
  FreeTierConfigOutDTOFromJSONTyped,
8949
9429
  FreeTierConfigOutDTOToJSON,
8950
9430
  FreeTierConfigOutDTOToJSONTyped,
9431
+ GeminaChatConversation,
8951
9432
  GeminaClient,
8952
9433
  GeminaError,
8953
9434
  GeminaProcessingError,
@@ -8988,6 +9469,10 @@ export {
8988
9469
  LocationInnerFromJSONTyped,
8989
9470
  LocationInnerToJSON,
8990
9471
  LocationInnerToJSONTyped,
9472
+ MatchedChunkDTOFromJSON,
9473
+ MatchedChunkDTOFromJSONTyped,
9474
+ MatchedChunkDTOToJSON,
9475
+ MatchedChunkDTOToJSONTyped,
8991
9476
  MetaApi,
8992
9477
  ModelType,
8993
9478
  ModelTypeFromJSON,
@@ -9071,6 +9556,14 @@ export {
9071
9556
  RetrievalAggregateOutDTOToJSON,
9072
9557
  RetrievalAggregateOutDTOToJSONTyped,
9073
9558
  RetrievalApi,
9559
+ RetrievalFieldItemDTOFromJSON,
9560
+ RetrievalFieldItemDTOFromJSONTyped,
9561
+ RetrievalFieldItemDTOToJSON,
9562
+ RetrievalFieldItemDTOToJSONTyped,
9563
+ RetrievalFieldsOutDTOFromJSON,
9564
+ RetrievalFieldsOutDTOFromJSONTyped,
9565
+ RetrievalFieldsOutDTOToJSON,
9566
+ RetrievalFieldsOutDTOToJSONTyped,
9074
9567
  RetrievalFiltersDTOFromJSON,
9075
9568
  RetrievalFiltersDTOFromJSONTyped,
9076
9569
  RetrievalFiltersDTOToJSON,
@@ -9104,6 +9597,15 @@ export {
9104
9597
  SortMethodModelFromJSONTyped,
9105
9598
  SortMethodModelToJSON,
9106
9599
  SortMethodModelToJSONTyped,
9600
+ StorageUsageOutDTOFromJSON,
9601
+ StorageUsageOutDTOFromJSONTyped,
9602
+ StorageUsageOutDTOToJSON,
9603
+ StorageUsageOutDTOToJSONTyped,
9604
+ StructuredFilterDTOFromJSON,
9605
+ StructuredFilterDTOFromJSONTyped,
9606
+ StructuredFilterDTOOpEnum,
9607
+ StructuredFilterDTOToJSON,
9608
+ StructuredFilterDTOToJSONTyped,
9107
9609
  SubscribeInDTOFromJSON,
9108
9610
  SubscribeInDTOFromJSONTyped,
9109
9611
  SubscribeInDTOToJSON,
@@ -9207,6 +9709,10 @@ export {
9207
9709
  ValidationSchemaModelFromJSONTyped,
9208
9710
  ValidationSchemaModelToJSON,
9209
9711
  ValidationSchemaModelToJSONTyped,
9712
+ ValueFromJSON,
9713
+ ValueFromJSONTyped,
9714
+ ValueToJSON,
9715
+ ValueToJSONTyped,
9210
9716
  ValuesValueFromJSON,
9211
9717
  ValuesValueFromJSONTyped,
9212
9718
  ValuesValueToJSON,
@@ -9296,6 +9802,7 @@ export {
9296
9802
  instanceOfInvoiceStatus,
9297
9803
  instanceOfInvoiceType,
9298
9804
  instanceOfLocationInner,
9805
+ instanceOfMatchedChunkDTO,
9299
9806
  instanceOfModelType,
9300
9807
  instanceOfNextActionOutDTO,
9301
9808
  instanceOfNumberOfStoredDocumentsOutDTO,
@@ -9314,6 +9821,8 @@ export {
9314
9821
  instanceOfResponseStatus,
9315
9822
  instanceOfRetrievalAggregateInDTO,
9316
9823
  instanceOfRetrievalAggregateOutDTO,
9824
+ instanceOfRetrievalFieldItemDTO,
9825
+ instanceOfRetrievalFieldsOutDTO,
9317
9826
  instanceOfRetrievalFiltersDTO,
9318
9827
  instanceOfRetrievalQueryInDTO,
9319
9828
  instanceOfRetrievalQueryOutDTO,
@@ -9321,6 +9830,8 @@ export {
9321
9830
  instanceOfSessionTokenInDTO,
9322
9831
  instanceOfSessionTokenOutDTO,
9323
9832
  instanceOfSortMethodModel,
9833
+ instanceOfStorageUsageOutDTO,
9834
+ instanceOfStructuredFilterDTO,
9324
9835
  instanceOfSubscribeInDTO,
9325
9836
  instanceOfSubscriptionOutDTO,
9326
9837
  instanceOfSubscriptionStatus,
@@ -9345,6 +9856,7 @@ export {
9345
9856
  instanceOfUsageSummaryOutDTO,
9346
9857
  instanceOfValidationError,
9347
9858
  instanceOfValidationSchemaModel,
9859
+ instanceOfValue,
9348
9860
  instanceOfValuesValue,
9349
9861
  instanceOfViewMetaOutDTO,
9350
9862
  instanceOfVolumeDiscountTierOutDTO,