@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.cjs CHANGED
@@ -282,6 +282,7 @@ __export(index_exports, {
282
282
  FreeTierConfigOutDTOFromJSONTyped: () => FreeTierConfigOutDTOFromJSONTyped,
283
283
  FreeTierConfigOutDTOToJSON: () => FreeTierConfigOutDTOToJSON,
284
284
  FreeTierConfigOutDTOToJSONTyped: () => FreeTierConfigOutDTOToJSONTyped,
285
+ GeminaChatConversation: () => GeminaChatConversation,
285
286
  GeminaClient: () => GeminaClient,
286
287
  GeminaError: () => GeminaError,
287
288
  GeminaProcessingError: () => GeminaProcessingError,
@@ -322,6 +323,10 @@ __export(index_exports, {
322
323
  LocationInnerFromJSONTyped: () => LocationInnerFromJSONTyped,
323
324
  LocationInnerToJSON: () => LocationInnerToJSON,
324
325
  LocationInnerToJSONTyped: () => LocationInnerToJSONTyped,
326
+ MatchedChunkDTOFromJSON: () => MatchedChunkDTOFromJSON,
327
+ MatchedChunkDTOFromJSONTyped: () => MatchedChunkDTOFromJSONTyped,
328
+ MatchedChunkDTOToJSON: () => MatchedChunkDTOToJSON,
329
+ MatchedChunkDTOToJSONTyped: () => MatchedChunkDTOToJSONTyped,
325
330
  MetaApi: () => MetaApi,
326
331
  ModelType: () => ModelType,
327
332
  ModelTypeFromJSON: () => ModelTypeFromJSON,
@@ -405,6 +410,14 @@ __export(index_exports, {
405
410
  RetrievalAggregateOutDTOToJSON: () => RetrievalAggregateOutDTOToJSON,
406
411
  RetrievalAggregateOutDTOToJSONTyped: () => RetrievalAggregateOutDTOToJSONTyped,
407
412
  RetrievalApi: () => RetrievalApi,
413
+ RetrievalFieldItemDTOFromJSON: () => RetrievalFieldItemDTOFromJSON,
414
+ RetrievalFieldItemDTOFromJSONTyped: () => RetrievalFieldItemDTOFromJSONTyped,
415
+ RetrievalFieldItemDTOToJSON: () => RetrievalFieldItemDTOToJSON,
416
+ RetrievalFieldItemDTOToJSONTyped: () => RetrievalFieldItemDTOToJSONTyped,
417
+ RetrievalFieldsOutDTOFromJSON: () => RetrievalFieldsOutDTOFromJSON,
418
+ RetrievalFieldsOutDTOFromJSONTyped: () => RetrievalFieldsOutDTOFromJSONTyped,
419
+ RetrievalFieldsOutDTOToJSON: () => RetrievalFieldsOutDTOToJSON,
420
+ RetrievalFieldsOutDTOToJSONTyped: () => RetrievalFieldsOutDTOToJSONTyped,
408
421
  RetrievalFiltersDTOFromJSON: () => RetrievalFiltersDTOFromJSON,
409
422
  RetrievalFiltersDTOFromJSONTyped: () => RetrievalFiltersDTOFromJSONTyped,
410
423
  RetrievalFiltersDTOToJSON: () => RetrievalFiltersDTOToJSON,
@@ -438,6 +451,15 @@ __export(index_exports, {
438
451
  SortMethodModelFromJSONTyped: () => SortMethodModelFromJSONTyped,
439
452
  SortMethodModelToJSON: () => SortMethodModelToJSON,
440
453
  SortMethodModelToJSONTyped: () => SortMethodModelToJSONTyped,
454
+ StorageUsageOutDTOFromJSON: () => StorageUsageOutDTOFromJSON,
455
+ StorageUsageOutDTOFromJSONTyped: () => StorageUsageOutDTOFromJSONTyped,
456
+ StorageUsageOutDTOToJSON: () => StorageUsageOutDTOToJSON,
457
+ StorageUsageOutDTOToJSONTyped: () => StorageUsageOutDTOToJSONTyped,
458
+ StructuredFilterDTOFromJSON: () => StructuredFilterDTOFromJSON,
459
+ StructuredFilterDTOFromJSONTyped: () => StructuredFilterDTOFromJSONTyped,
460
+ StructuredFilterDTOOpEnum: () => StructuredFilterDTOOpEnum,
461
+ StructuredFilterDTOToJSON: () => StructuredFilterDTOToJSON,
462
+ StructuredFilterDTOToJSONTyped: () => StructuredFilterDTOToJSONTyped,
441
463
  SubscribeInDTOFromJSON: () => SubscribeInDTOFromJSON,
442
464
  SubscribeInDTOFromJSONTyped: () => SubscribeInDTOFromJSONTyped,
443
465
  SubscribeInDTOToJSON: () => SubscribeInDTOToJSON,
@@ -541,6 +563,10 @@ __export(index_exports, {
541
563
  ValidationSchemaModelFromJSONTyped: () => ValidationSchemaModelFromJSONTyped,
542
564
  ValidationSchemaModelToJSON: () => ValidationSchemaModelToJSON,
543
565
  ValidationSchemaModelToJSONTyped: () => ValidationSchemaModelToJSONTyped,
566
+ ValueFromJSON: () => ValueFromJSON,
567
+ ValueFromJSONTyped: () => ValueFromJSONTyped,
568
+ ValueToJSON: () => ValueToJSON,
569
+ ValueToJSONTyped: () => ValueToJSONTyped,
544
570
  ValuesValueFromJSON: () => ValuesValueFromJSON,
545
571
  ValuesValueFromJSONTyped: () => ValuesValueFromJSONTyped,
546
572
  ValuesValueToJSON: () => ValuesValueToJSON,
@@ -630,6 +656,7 @@ __export(index_exports, {
630
656
  instanceOfInvoiceStatus: () => instanceOfInvoiceStatus,
631
657
  instanceOfInvoiceType: () => instanceOfInvoiceType,
632
658
  instanceOfLocationInner: () => instanceOfLocationInner,
659
+ instanceOfMatchedChunkDTO: () => instanceOfMatchedChunkDTO,
633
660
  instanceOfModelType: () => instanceOfModelType,
634
661
  instanceOfNextActionOutDTO: () => instanceOfNextActionOutDTO,
635
662
  instanceOfNumberOfStoredDocumentsOutDTO: () => instanceOfNumberOfStoredDocumentsOutDTO,
@@ -648,6 +675,8 @@ __export(index_exports, {
648
675
  instanceOfResponseStatus: () => instanceOfResponseStatus,
649
676
  instanceOfRetrievalAggregateInDTO: () => instanceOfRetrievalAggregateInDTO,
650
677
  instanceOfRetrievalAggregateOutDTO: () => instanceOfRetrievalAggregateOutDTO,
678
+ instanceOfRetrievalFieldItemDTO: () => instanceOfRetrievalFieldItemDTO,
679
+ instanceOfRetrievalFieldsOutDTO: () => instanceOfRetrievalFieldsOutDTO,
651
680
  instanceOfRetrievalFiltersDTO: () => instanceOfRetrievalFiltersDTO,
652
681
  instanceOfRetrievalQueryInDTO: () => instanceOfRetrievalQueryInDTO,
653
682
  instanceOfRetrievalQueryOutDTO: () => instanceOfRetrievalQueryOutDTO,
@@ -655,6 +684,8 @@ __export(index_exports, {
655
684
  instanceOfSessionTokenInDTO: () => instanceOfSessionTokenInDTO,
656
685
  instanceOfSessionTokenOutDTO: () => instanceOfSessionTokenOutDTO,
657
686
  instanceOfSortMethodModel: () => instanceOfSortMethodModel,
687
+ instanceOfStorageUsageOutDTO: () => instanceOfStorageUsageOutDTO,
688
+ instanceOfStructuredFilterDTO: () => instanceOfStructuredFilterDTO,
658
689
  instanceOfSubscribeInDTO: () => instanceOfSubscribeInDTO,
659
690
  instanceOfSubscriptionOutDTO: () => instanceOfSubscriptionOutDTO,
660
691
  instanceOfSubscriptionStatus: () => instanceOfSubscriptionStatus,
@@ -679,6 +710,7 @@ __export(index_exports, {
679
710
  instanceOfUsageSummaryOutDTO: () => instanceOfUsageSummaryOutDTO,
680
711
  instanceOfValidationError: () => instanceOfValidationError,
681
712
  instanceOfValidationSchemaModel: () => instanceOfValidationSchemaModel,
713
+ instanceOfValue: () => instanceOfValue,
682
714
  instanceOfValuesValue: () => instanceOfValuesValue,
683
715
  instanceOfViewMetaOutDTO: () => instanceOfViewMetaOutDTO,
684
716
  instanceOfVolumeDiscountTierOutDTO: () => instanceOfVolumeDiscountTierOutDTO,
@@ -1365,7 +1397,8 @@ function ChatQueryInDTOFromJSONTyped(json, ignoreDiscriminator) {
1365
1397
  }
1366
1398
  return {
1367
1399
  "endUserId": json["endUserId"] == null ? void 0 : json["endUserId"],
1368
- "message": json["message"]
1400
+ "message": json["message"],
1401
+ "sessionId": json["sessionId"] == null ? void 0 : json["sessionId"]
1369
1402
  };
1370
1403
  }
1371
1404
  function ChatQueryInDTOToJSON(json) {
@@ -1377,13 +1410,15 @@ function ChatQueryInDTOToJSONTyped(value, ignoreDiscriminator = false) {
1377
1410
  }
1378
1411
  return {
1379
1412
  "endUserId": value["endUserId"],
1380
- "message": value["message"]
1413
+ "message": value["message"],
1414
+ "sessionId": value["sessionId"]
1381
1415
  };
1382
1416
  }
1383
1417
 
1384
1418
  // src/generated/models/ChatQueryOutDTO.ts
1385
1419
  function instanceOfChatQueryOutDTO(value) {
1386
1420
  if (!("answer" in value) || value["answer"] === void 0) return false;
1421
+ if (!("sessionId" in value) || value["sessionId"] === void 0) return false;
1387
1422
  return true;
1388
1423
  }
1389
1424
  function ChatQueryOutDTOFromJSON(json) {
@@ -1401,7 +1436,8 @@ function ChatQueryOutDTOFromJSONTyped(json, ignoreDiscriminator) {
1401
1436
  "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
1402
1437
  "intent": json["intent"] == null ? void 0 : json["intent"],
1403
1438
  "servedAt": json["servedAt"] == null ? void 0 : new Date(json["servedAt"]),
1404
- "servedAtTimestamp": json["servedAtTimestamp"] == null ? void 0 : json["servedAtTimestamp"]
1439
+ "servedAtTimestamp": json["servedAtTimestamp"] == null ? void 0 : json["servedAtTimestamp"],
1440
+ "sessionId": json["sessionId"]
1405
1441
  };
1406
1442
  }
1407
1443
  function ChatQueryOutDTOToJSON(json) {
@@ -1419,7 +1455,8 @@ function ChatQueryOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
1419
1455
  "createdAtTimestamp": value["createdAtTimestamp"],
1420
1456
  "intent": value["intent"],
1421
1457
  "servedAt": value["servedAt"] == null ? value["servedAt"] : value["servedAt"].toISOString(),
1422
- "servedAtTimestamp": value["servedAtTimestamp"]
1458
+ "servedAtTimestamp": value["servedAtTimestamp"],
1459
+ "sessionId": value["sessionId"]
1423
1460
  };
1424
1461
  }
1425
1462
 
@@ -1454,7 +1491,7 @@ var ChatApi = class extends BaseAPI {
1454
1491
  };
1455
1492
  }
1456
1493
  /**
1457
- * 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.
1494
+ * 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.
1458
1495
  * Chat Query
1459
1496
  */
1460
1497
  async chatQueryRaw(requestParameters, initOverrides) {
@@ -1463,13 +1500,56 @@ var ChatApi = class extends BaseAPI {
1463
1500
  return new JSONApiResponse(response, (jsonValue) => ChatQueryOutDTOFromJSON(jsonValue));
1464
1501
  }
1465
1502
  /**
1466
- * 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.
1503
+ * 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.
1467
1504
  * Chat Query
1468
1505
  */
1469
1506
  async chatQuery(requestParameters, initOverrides) {
1470
1507
  const response = await this.chatQueryRaw(requestParameters, initOverrides);
1471
1508
  return await response.value();
1472
1509
  }
1510
+ /**
1511
+ * Creates request options for deleteChatSession without sending the request
1512
+ */
1513
+ async deleteChatSessionRequestOpts(requestParameters) {
1514
+ if (requestParameters["sessionId"] == null) {
1515
+ throw new RequiredError(
1516
+ "sessionId",
1517
+ 'Required parameter "sessionId" was null or undefined when calling deleteChatSession().'
1518
+ );
1519
+ }
1520
+ const queryParameters = {};
1521
+ const headerParameters = {};
1522
+ if (this.configuration && this.configuration.apiKey) {
1523
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
1524
+ }
1525
+ if (this.configuration && this.configuration.accessToken) {
1526
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
1527
+ }
1528
+ let urlPath = `/api/v1/chat/sessions/{session_id}`;
1529
+ urlPath = urlPath.replace("{session_id}", encodeURIComponent(String(requestParameters["sessionId"])));
1530
+ return {
1531
+ path: urlPath,
1532
+ method: "DELETE",
1533
+ headers: headerParameters,
1534
+ query: queryParameters
1535
+ };
1536
+ }
1537
+ /**
1538
+ * End a conversation explicitly (\'new chat\' hygiene). 404 for unknown, expired, or foreign sessions alike — ids can\'t be probed.
1539
+ * Delete Chat Session
1540
+ */
1541
+ async deleteChatSessionRaw(requestParameters, initOverrides) {
1542
+ const requestOptions = await this.deleteChatSessionRequestOpts(requestParameters);
1543
+ const response = await this.request(requestOptions, initOverrides);
1544
+ return new VoidApiResponse(response);
1545
+ }
1546
+ /**
1547
+ * End a conversation explicitly (\'new chat\' hygiene). 404 for unknown, expired, or foreign sessions alike — ids can\'t be probed.
1548
+ * Delete Chat Session
1549
+ */
1550
+ async deleteChatSession(requestParameters, initOverrides) {
1551
+ await this.deleteChatSessionRaw(requestParameters, initOverrides);
1552
+ }
1473
1553
  };
1474
1554
 
1475
1555
  // src/generated/models/ContactFormInDTO.ts
@@ -4694,17 +4774,24 @@ function ContractOutDTOFromJSONTyped(json, ignoreDiscriminator) {
4694
4774
  }
4695
4775
  return {
4696
4776
  "billingCycleDay": json["billingCycleDay"],
4777
+ "chatIncludedPerCycle": json["chatIncludedPerCycle"] == null ? void 0 : json["chatIncludedPerCycle"],
4778
+ "chatPriceCents": json["chatPriceCents"] == null ? void 0 : json["chatPriceCents"],
4697
4779
  "checkoutUrl": json["checkoutUrl"] == null ? void 0 : json["checkoutUrl"],
4698
4780
  "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
4699
4781
  "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
4782
+ "documentIntelligenceEnabled": json["documentIntelligenceEnabled"] == null ? void 0 : json["documentIntelligenceEnabled"],
4700
4783
  "id": json["id"],
4784
+ "indexPriceCents": json["indexPriceCents"] == null ? void 0 : json["indexPriceCents"],
4701
4785
  "maxMonthlyExtractions": json["maxMonthlyExtractions"] == null ? void 0 : json["maxMonthlyExtractions"],
4702
4786
  "monthlyFiletagCredits": json["monthlyFiletagCredits"] == null ? void 0 : json["monthlyFiletagCredits"],
4703
4787
  "paddleSubscriptionId": json["paddleSubscriptionId"] == null ? void 0 : json["paddleSubscriptionId"],
4704
4788
  "rateCardTemplateId": json["rateCardTemplateId"] == null ? void 0 : json["rateCardTemplateId"],
4705
4789
  "rateCards": json["rateCards"] == null ? void 0 : json["rateCards"].map(RateCardOutDTOFromJSON),
4706
4790
  "requiresManualApproval": json["requiresManualApproval"],
4791
+ "retrievalRateLimitPerSecond": json["retrievalRateLimitPerSecond"] == null ? void 0 : json["retrievalRateLimitPerSecond"],
4707
4792
  "status": ContractStatusFromJSON(json["status"]),
4793
+ "storageIncludedGb": json["storageIncludedGb"] == null ? void 0 : json["storageIncludedGb"],
4794
+ "storagePricePerGbMonthCents": json["storagePricePerGbMonthCents"] == null ? void 0 : json["storagePricePerGbMonthCents"],
4708
4795
  "userEmail": json["userEmail"] == null ? void 0 : json["userEmail"],
4709
4796
  "userId": json["userId"],
4710
4797
  "volumeDiscountTiers": json["volumeDiscountTiers"] == null ? void 0 : json["volumeDiscountTiers"].map(VolumeDiscountTierOutDTOFromJSON)
@@ -4719,17 +4806,24 @@ function ContractOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
4719
4806
  }
4720
4807
  return {
4721
4808
  "billingCycleDay": value["billingCycleDay"],
4809
+ "chatIncludedPerCycle": value["chatIncludedPerCycle"],
4810
+ "chatPriceCents": value["chatPriceCents"],
4722
4811
  "checkoutUrl": value["checkoutUrl"],
4723
4812
  "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
4724
4813
  "createdAtTimestamp": value["createdAtTimestamp"],
4814
+ "documentIntelligenceEnabled": value["documentIntelligenceEnabled"],
4725
4815
  "id": value["id"],
4816
+ "indexPriceCents": value["indexPriceCents"],
4726
4817
  "maxMonthlyExtractions": value["maxMonthlyExtractions"],
4727
4818
  "monthlyFiletagCredits": value["monthlyFiletagCredits"],
4728
4819
  "paddleSubscriptionId": value["paddleSubscriptionId"],
4729
4820
  "rateCardTemplateId": value["rateCardTemplateId"],
4730
4821
  "rateCards": value["rateCards"] == null ? void 0 : value["rateCards"].map(RateCardOutDTOToJSON),
4731
4822
  "requiresManualApproval": value["requiresManualApproval"],
4823
+ "retrievalRateLimitPerSecond": value["retrievalRateLimitPerSecond"],
4732
4824
  "status": ContractStatusToJSON(value["status"]),
4825
+ "storageIncludedGb": value["storageIncludedGb"],
4826
+ "storagePricePerGbMonthCents": value["storagePricePerGbMonthCents"],
4733
4827
  "userEmail": value["userEmail"],
4734
4828
  "userId": value["userId"],
4735
4829
  "volumeDiscountTiers": value["volumeDiscountTiers"] == null ? void 0 : value["volumeDiscountTiers"].map(VolumeDiscountTierOutDTOToJSON)
@@ -6351,6 +6445,131 @@ function RetrievalAggregateOutDTOToJSONTyped(value, ignoreDiscriminator = false)
6351
6445
  };
6352
6446
  }
6353
6447
 
6448
+ // src/generated/models/RetrievalFieldItemDTO.ts
6449
+ function instanceOfRetrievalFieldItemDTO(value) {
6450
+ if (!("field" in value) || value["field"] === void 0) return false;
6451
+ return true;
6452
+ }
6453
+ function RetrievalFieldItemDTOFromJSON(json) {
6454
+ return RetrievalFieldItemDTOFromJSONTyped(json, false);
6455
+ }
6456
+ function RetrievalFieldItemDTOFromJSONTyped(json, ignoreDiscriminator) {
6457
+ if (json == null) {
6458
+ return json;
6459
+ }
6460
+ return {
6461
+ "count": json["count"] == null ? void 0 : json["count"],
6462
+ "documentType": json["documentType"] == null ? void 0 : json["documentType"],
6463
+ "field": json["field"]
6464
+ };
6465
+ }
6466
+ function RetrievalFieldItemDTOToJSON(json) {
6467
+ return RetrievalFieldItemDTOToJSONTyped(json, false);
6468
+ }
6469
+ function RetrievalFieldItemDTOToJSONTyped(value, ignoreDiscriminator = false) {
6470
+ if (value == null) {
6471
+ return value;
6472
+ }
6473
+ return {
6474
+ "count": value["count"],
6475
+ "documentType": value["documentType"],
6476
+ "field": value["field"]
6477
+ };
6478
+ }
6479
+
6480
+ // src/generated/models/RetrievalFieldsOutDTO.ts
6481
+ function instanceOfRetrievalFieldsOutDTO(value) {
6482
+ return true;
6483
+ }
6484
+ function RetrievalFieldsOutDTOFromJSON(json) {
6485
+ return RetrievalFieldsOutDTOFromJSONTyped(json, false);
6486
+ }
6487
+ function RetrievalFieldsOutDTOFromJSONTyped(json, ignoreDiscriminator) {
6488
+ if (json == null) {
6489
+ return json;
6490
+ }
6491
+ return {
6492
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
6493
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
6494
+ "fields": json["fields"] == null ? void 0 : json["fields"].map(RetrievalFieldItemDTOFromJSON),
6495
+ "servedAt": json["servedAt"] == null ? void 0 : new Date(json["servedAt"]),
6496
+ "servedAtTimestamp": json["servedAtTimestamp"] == null ? void 0 : json["servedAtTimestamp"]
6497
+ };
6498
+ }
6499
+ function RetrievalFieldsOutDTOToJSON(json) {
6500
+ return RetrievalFieldsOutDTOToJSONTyped(json, false);
6501
+ }
6502
+ function RetrievalFieldsOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
6503
+ if (value == null) {
6504
+ return value;
6505
+ }
6506
+ return {
6507
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
6508
+ "createdAtTimestamp": value["createdAtTimestamp"],
6509
+ "fields": value["fields"] == null ? void 0 : value["fields"].map(RetrievalFieldItemDTOToJSON),
6510
+ "servedAt": value["servedAt"] == null ? value["servedAt"] : value["servedAt"].toISOString(),
6511
+ "servedAtTimestamp": value["servedAtTimestamp"]
6512
+ };
6513
+ }
6514
+
6515
+ // src/generated/models/Value.ts
6516
+ function instanceOfValue(value) {
6517
+ return true;
6518
+ }
6519
+ function ValueFromJSON(json) {
6520
+ return ValueFromJSONTyped(json, false);
6521
+ }
6522
+ function ValueFromJSONTyped(json, ignoreDiscriminator) {
6523
+ return json;
6524
+ }
6525
+ function ValueToJSON(json) {
6526
+ return ValueToJSONTyped(json, false);
6527
+ }
6528
+ function ValueToJSONTyped(value, ignoreDiscriminator = false) {
6529
+ return value;
6530
+ }
6531
+
6532
+ // src/generated/models/StructuredFilterDTO.ts
6533
+ var StructuredFilterDTOOpEnum = {
6534
+ Eq: "eq",
6535
+ Neq: "neq",
6536
+ Gt: "gt",
6537
+ Lt: "lt",
6538
+ Contains: "contains",
6539
+ Exists: "exists"
6540
+ };
6541
+ function instanceOfStructuredFilterDTO(value) {
6542
+ if (!("op" in value) || value["op"] === void 0) return false;
6543
+ if (!("path" in value) || value["path"] === void 0) return false;
6544
+ return true;
6545
+ }
6546
+ function StructuredFilterDTOFromJSON(json) {
6547
+ return StructuredFilterDTOFromJSONTyped(json, false);
6548
+ }
6549
+ function StructuredFilterDTOFromJSONTyped(json, ignoreDiscriminator) {
6550
+ if (json == null) {
6551
+ return json;
6552
+ }
6553
+ return {
6554
+ "op": json["op"],
6555
+ "path": json["path"],
6556
+ "value": json["value"] == null ? void 0 : ValueFromJSON(json["value"])
6557
+ };
6558
+ }
6559
+ function StructuredFilterDTOToJSON(json) {
6560
+ return StructuredFilterDTOToJSONTyped(json, false);
6561
+ }
6562
+ function StructuredFilterDTOToJSONTyped(value, ignoreDiscriminator = false) {
6563
+ if (value == null) {
6564
+ return value;
6565
+ }
6566
+ return {
6567
+ "op": value["op"],
6568
+ "path": value["path"],
6569
+ "value": ValueToJSON(value["value"])
6570
+ };
6571
+ }
6572
+
6354
6573
  // src/generated/models/RetrievalQueryInDTO.ts
6355
6574
  var RetrievalQueryInDTOModeEnum = {
6356
6575
  Structured: "structured",
@@ -6385,6 +6604,7 @@ function RetrievalQueryInDTOFromJSONTyped(json, ignoreDiscriminator) {
6385
6604
  "skip": json["skip"] == null ? void 0 : json["skip"],
6386
6605
  "sortField": json["sortField"] == null ? void 0 : json["sortField"],
6387
6606
  "sortMethod": json["sortMethod"] == null ? void 0 : json["sortMethod"],
6607
+ "structuredFilters": json["structuredFilters"] == null ? void 0 : json["structuredFilters"].map(StructuredFilterDTOFromJSON),
6388
6608
  "text": json["text"] == null ? void 0 : json["text"],
6389
6609
  "topK": json["topK"] == null ? void 0 : json["topK"]
6390
6610
  };
@@ -6403,6 +6623,7 @@ function RetrievalQueryInDTOToJSONTyped(value, ignoreDiscriminator = false) {
6403
6623
  "skip": value["skip"],
6404
6624
  "sortField": value["sortField"],
6405
6625
  "sortMethod": value["sortMethod"],
6626
+ "structuredFilters": value["structuredFilters"] == null ? void 0 : value["structuredFilters"].map(StructuredFilterDTOToJSON),
6406
6627
  "text": value["text"],
6407
6628
  "topK": value["topK"]
6408
6629
  };
@@ -6443,6 +6664,38 @@ function QueryMetaDTOToJSONTyped(value, ignoreDiscriminator = false) {
6443
6664
  };
6444
6665
  }
6445
6666
 
6667
+ // src/generated/models/MatchedChunkDTO.ts
6668
+ function instanceOfMatchedChunkDTO(value) {
6669
+ if (!("text" in value) || value["text"] === void 0) return false;
6670
+ return true;
6671
+ }
6672
+ function MatchedChunkDTOFromJSON(json) {
6673
+ return MatchedChunkDTOFromJSONTyped(json, false);
6674
+ }
6675
+ function MatchedChunkDTOFromJSONTyped(json, ignoreDiscriminator) {
6676
+ if (json == null) {
6677
+ return json;
6678
+ }
6679
+ return {
6680
+ "chunkType": json["chunkType"] == null ? void 0 : json["chunkType"],
6681
+ "score": json["score"] == null ? void 0 : json["score"],
6682
+ "text": json["text"]
6683
+ };
6684
+ }
6685
+ function MatchedChunkDTOToJSON(json) {
6686
+ return MatchedChunkDTOToJSONTyped(json, false);
6687
+ }
6688
+ function MatchedChunkDTOToJSONTyped(value, ignoreDiscriminator = false) {
6689
+ if (value == null) {
6690
+ return value;
6691
+ }
6692
+ return {
6693
+ "chunkType": value["chunkType"],
6694
+ "score": value["score"],
6695
+ "text": value["text"]
6696
+ };
6697
+ }
6698
+
6446
6699
  // src/generated/models/QueryResultItemDTO.ts
6447
6700
  function instanceOfQueryResultItemDTO(value) {
6448
6701
  if (!("documentExtractionId" in value) || value["documentExtractionId"] === void 0) return false;
@@ -6468,6 +6721,7 @@ function QueryResultItemDTOFromJSONTyped(json, ignoreDiscriminator) {
6468
6721
  "expenseType": json["expenseType"] == null ? void 0 : json["expenseType"],
6469
6722
  "externalId": json["externalId"] == null ? void 0 : json["externalId"],
6470
6723
  "issueDate": json["issueDate"] == null ? void 0 : new Date(json["issueDate"]),
6724
+ "matchedChunks": json["matchedChunks"] == null ? void 0 : json["matchedChunks"].map(MatchedChunkDTOFromJSON),
6471
6725
  "netAmount": json["netAmount"] == null ? void 0 : json["netAmount"],
6472
6726
  "paymentMethod": json["paymentMethod"] == null ? void 0 : json["paymentMethod"],
6473
6727
  "score": json["score"] == null ? void 0 : json["score"],
@@ -6497,6 +6751,7 @@ function QueryResultItemDTOToJSONTyped(value, ignoreDiscriminator = false) {
6497
6751
  "expenseType": value["expenseType"],
6498
6752
  "externalId": value["externalId"],
6499
6753
  "issueDate": value["issueDate"] == null ? value["issueDate"] : value["issueDate"].toISOString().substring(0, 10),
6754
+ "matchedChunks": value["matchedChunks"] == null ? void 0 : value["matchedChunks"].map(MatchedChunkDTOToJSON),
6500
6755
  "netAmount": value["netAmount"],
6501
6756
  "paymentMethod": value["paymentMethod"],
6502
6757
  "score": value["score"],
@@ -6628,6 +6883,43 @@ var RetrievalApi = class extends BaseAPI {
6628
6883
  const response = await this.retrievalAggregateRaw(requestParameters, initOverrides);
6629
6884
  return await response.value();
6630
6885
  }
6886
+ /**
6887
+ * Creates request options for retrievalFields without sending the request
6888
+ */
6889
+ async retrievalFieldsRequestOpts() {
6890
+ const queryParameters = {};
6891
+ const headerParameters = {};
6892
+ if (this.configuration && this.configuration.apiKey) {
6893
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
6894
+ }
6895
+ if (this.configuration && this.configuration.accessToken) {
6896
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
6897
+ }
6898
+ let urlPath = `/api/v1/retrieval/fields`;
6899
+ return {
6900
+ path: urlPath,
6901
+ method: "GET",
6902
+ headers: headerParameters,
6903
+ query: queryParameters
6904
+ };
6905
+ }
6906
+ /**
6907
+ * Observed structured field NAMES per document type (self-query catalog). Names only — no values; tenant-scoped like every retrieval path.
6908
+ * Retrieval Fields
6909
+ */
6910
+ async retrievalFieldsRaw(initOverrides) {
6911
+ const requestOptions = await this.retrievalFieldsRequestOpts();
6912
+ const response = await this.request(requestOptions, initOverrides);
6913
+ return new JSONApiResponse(response, (jsonValue) => RetrievalFieldsOutDTOFromJSON(jsonValue));
6914
+ }
6915
+ /**
6916
+ * Observed structured field NAMES per document type (self-query catalog). Names only — no values; tenant-scoped like every retrieval path.
6917
+ * Retrieval Fields
6918
+ */
6919
+ async retrievalFields(initOverrides) {
6920
+ const response = await this.retrievalFieldsRaw(initOverrides);
6921
+ return await response.value();
6922
+ }
6631
6923
  /**
6632
6924
  * Creates request options for retrievalQuery without sending the request
6633
6925
  */
@@ -6682,6 +6974,9 @@ var RetrievalApi = class extends BaseAPI {
6682
6974
  if (this.configuration && this.configuration.apiKey) {
6683
6975
  headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
6684
6976
  }
6977
+ if (this.configuration && this.configuration.accessToken) {
6978
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
6979
+ }
6685
6980
  let urlPath = `/api/v1/retrieval/status`;
6686
6981
  return {
6687
6982
  path: urlPath,
@@ -6691,7 +6986,7 @@ var RetrievalApi = class extends BaseAPI {
6691
6986
  };
6692
6987
  }
6693
6988
  /**
6694
- * How many of the tenant\'s documents are currently indexed.
6989
+ * 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.
6695
6990
  * Retrieval Status
6696
6991
  */
6697
6992
  async retrievalStatusRaw(initOverrides) {
@@ -6700,7 +6995,7 @@ var RetrievalApi = class extends BaseAPI {
6700
6995
  return new JSONApiResponse(response, (jsonValue) => RetrievalStatusOutDTOFromJSON(jsonValue));
6701
6996
  }
6702
6997
  /**
6703
- * How many of the tenant\'s documents are currently indexed.
6998
+ * 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.
6704
6999
  * Retrieval Status
6705
7000
  */
6706
7001
  async retrievalStatus(initOverrides) {
@@ -6826,6 +7121,51 @@ var SessionsApi = class extends BaseAPI {
6826
7121
  const response = await this.mintRetrievalTokenRaw(requestParameters, initOverrides);
6827
7122
  return await response.value();
6828
7123
  }
7124
+ /**
7125
+ * Creates request options for mintRetrievalTokenUser without sending the request
7126
+ */
7127
+ async mintRetrievalTokenUserRequestOpts(requestParameters) {
7128
+ if (requestParameters["sessionTokenInDTO"] == null) {
7129
+ throw new RequiredError(
7130
+ "sessionTokenInDTO",
7131
+ 'Required parameter "sessionTokenInDTO" was null or undefined when calling mintRetrievalTokenUser().'
7132
+ );
7133
+ }
7134
+ const queryParameters = {};
7135
+ const headerParameters = {};
7136
+ headerParameters["Content-Type"] = "application/json";
7137
+ if (this.configuration && this.configuration.apiKey) {
7138
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
7139
+ }
7140
+ if (this.configuration && this.configuration.accessToken) {
7141
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
7142
+ }
7143
+ let urlPath = `/api/v1/sessions/token/user`;
7144
+ return {
7145
+ path: urlPath,
7146
+ method: "POST",
7147
+ headers: headerParameters,
7148
+ query: queryParameters,
7149
+ body: SessionTokenInDTOToJSON(requestParameters["sessionTokenInDTO"])
7150
+ };
7151
+ }
7152
+ /**
7153
+ * 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.
7154
+ * Mint Retrieval Token User
7155
+ */
7156
+ async mintRetrievalTokenUserRaw(requestParameters, initOverrides) {
7157
+ const requestOptions = await this.mintRetrievalTokenUserRequestOpts(requestParameters);
7158
+ const response = await this.request(requestOptions, initOverrides);
7159
+ return new JSONApiResponse(response, (jsonValue) => SessionTokenOutDTOFromJSON(jsonValue));
7160
+ }
7161
+ /**
7162
+ * 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.
7163
+ * Mint Retrieval Token User
7164
+ */
7165
+ async mintRetrievalTokenUser(requestParameters, initOverrides) {
7166
+ const response = await this.mintRetrievalTokenUserRaw(requestParameters, initOverrides);
7167
+ return await response.value();
7168
+ }
6829
7169
  };
6830
7170
 
6831
7171
  // src/generated/models/CheckoutOutDTO.ts
@@ -7003,6 +7343,7 @@ function PlanDetailOutDTOFromJSONTyped(json, ignoreDiscriminator) {
7003
7343
  }
7004
7344
  return {
7005
7345
  "bonusPercentage": json["bonusPercentage"],
7346
+ "chatCreditCost": json["chatCreditCost"] == null ? void 0 : json["chatCreditCost"],
7006
7347
  "chatIncludedPerCycle": json["chatIncludedPerCycle"] == null ? void 0 : json["chatIncludedPerCycle"],
7007
7348
  "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
7008
7349
  "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
@@ -7013,6 +7354,7 @@ function PlanDetailOutDTOFromJSONTyped(json, ignoreDiscriminator) {
7013
7354
  "documentIntelligenceEnabled": json["documentIntelligenceEnabled"] == null ? void 0 : json["documentIntelligenceEnabled"],
7014
7355
  "enhancedPrivacyEnabled": json["enhancedPrivacyEnabled"],
7015
7356
  "id": json["id"],
7357
+ "indexCreditCost": json["indexCreditCost"] == null ? void 0 : json["indexCreditCost"],
7016
7358
  "ipAllowlistEnabled": json["ipAllowlistEnabled"],
7017
7359
  "isActive": json["isActive"],
7018
7360
  "maxDataRetentionPeriod": DataRetentionPeriodModelFromJSON(json["maxDataRetentionPeriod"]),
@@ -7025,6 +7367,7 @@ function PlanDetailOutDTOFromJSONTyped(json, ignoreDiscriminator) {
7025
7367
  "retrievalRateLimitPerSecond": json["retrievalRateLimitPerSecond"] == null ? void 0 : json["retrievalRateLimitPerSecond"],
7026
7368
  "slug": json["slug"],
7027
7369
  "storageCreditCostPerGbMonth": json["storageCreditCostPerGbMonth"] == null ? void 0 : json["storageCreditCostPerGbMonth"],
7370
+ "storageIncludedGb": json["storageIncludedGb"] == null ? void 0 : json["storageIncludedGb"],
7028
7371
  "supportLevel": SupportLevelFromJSON(json["supportLevel"]),
7029
7372
  "webhooksEnabled": json["webhooksEnabled"]
7030
7373
  };
@@ -7038,6 +7381,7 @@ function PlanDetailOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
7038
7381
  }
7039
7382
  return {
7040
7383
  "bonusPercentage": value["bonusPercentage"],
7384
+ "chatCreditCost": value["chatCreditCost"],
7041
7385
  "chatIncludedPerCycle": value["chatIncludedPerCycle"],
7042
7386
  "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
7043
7387
  "createdAtTimestamp": value["createdAtTimestamp"],
@@ -7048,6 +7392,7 @@ function PlanDetailOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
7048
7392
  "documentIntelligenceEnabled": value["documentIntelligenceEnabled"],
7049
7393
  "enhancedPrivacyEnabled": value["enhancedPrivacyEnabled"],
7050
7394
  "id": value["id"],
7395
+ "indexCreditCost": value["indexCreditCost"],
7051
7396
  "ipAllowlistEnabled": value["ipAllowlistEnabled"],
7052
7397
  "isActive": value["isActive"],
7053
7398
  "maxDataRetentionPeriod": DataRetentionPeriodModelToJSON(value["maxDataRetentionPeriod"]),
@@ -7060,6 +7405,7 @@ function PlanDetailOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
7060
7405
  "retrievalRateLimitPerSecond": value["retrievalRateLimitPerSecond"],
7061
7406
  "slug": value["slug"],
7062
7407
  "storageCreditCostPerGbMonth": value["storageCreditCostPerGbMonth"],
7408
+ "storageIncludedGb": value["storageIncludedGb"],
7063
7409
  "supportLevel": SupportLevelToJSON(value["supportLevel"]),
7064
7410
  "webhooksEnabled": value["webhooksEnabled"]
7065
7411
  };
@@ -7093,6 +7439,7 @@ function PlanOutDTOFromJSONTyped(json, ignoreDiscriminator) {
7093
7439
  }
7094
7440
  return {
7095
7441
  "bonusPercentage": json["bonusPercentage"],
7442
+ "chatCreditCost": json["chatCreditCost"] == null ? void 0 : json["chatCreditCost"],
7096
7443
  "chatIncludedPerCycle": json["chatIncludedPerCycle"] == null ? void 0 : json["chatIncludedPerCycle"],
7097
7444
  "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
7098
7445
  "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
@@ -7102,6 +7449,7 @@ function PlanOutDTOFromJSONTyped(json, ignoreDiscriminator) {
7102
7449
  "documentIntelligenceEnabled": json["documentIntelligenceEnabled"] == null ? void 0 : json["documentIntelligenceEnabled"],
7103
7450
  "enhancedPrivacyEnabled": json["enhancedPrivacyEnabled"],
7104
7451
  "id": json["id"],
7452
+ "indexCreditCost": json["indexCreditCost"] == null ? void 0 : json["indexCreditCost"],
7105
7453
  "ipAllowlistEnabled": json["ipAllowlistEnabled"],
7106
7454
  "isActive": json["isActive"],
7107
7455
  "maxDataRetentionPeriod": DataRetentionPeriodModelFromJSON(json["maxDataRetentionPeriod"]),
@@ -7114,6 +7462,7 @@ function PlanOutDTOFromJSONTyped(json, ignoreDiscriminator) {
7114
7462
  "retrievalRateLimitPerSecond": json["retrievalRateLimitPerSecond"] == null ? void 0 : json["retrievalRateLimitPerSecond"],
7115
7463
  "slug": json["slug"],
7116
7464
  "storageCreditCostPerGbMonth": json["storageCreditCostPerGbMonth"] == null ? void 0 : json["storageCreditCostPerGbMonth"],
7465
+ "storageIncludedGb": json["storageIncludedGb"] == null ? void 0 : json["storageIncludedGb"],
7117
7466
  "supportLevel": SupportLevelFromJSON(json["supportLevel"]),
7118
7467
  "webhooksEnabled": json["webhooksEnabled"]
7119
7468
  };
@@ -7127,6 +7476,7 @@ function PlanOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
7127
7476
  }
7128
7477
  return {
7129
7478
  "bonusPercentage": value["bonusPercentage"],
7479
+ "chatCreditCost": value["chatCreditCost"],
7130
7480
  "chatIncludedPerCycle": value["chatIncludedPerCycle"],
7131
7481
  "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
7132
7482
  "createdAtTimestamp": value["createdAtTimestamp"],
@@ -7136,6 +7486,7 @@ function PlanOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
7136
7486
  "documentIntelligenceEnabled": value["documentIntelligenceEnabled"],
7137
7487
  "enhancedPrivacyEnabled": value["enhancedPrivacyEnabled"],
7138
7488
  "id": value["id"],
7489
+ "indexCreditCost": value["indexCreditCost"],
7139
7490
  "ipAllowlistEnabled": value["ipAllowlistEnabled"],
7140
7491
  "isActive": value["isActive"],
7141
7492
  "maxDataRetentionPeriod": DataRetentionPeriodModelToJSON(value["maxDataRetentionPeriod"]),
@@ -7148,6 +7499,7 @@ function PlanOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
7148
7499
  "retrievalRateLimitPerSecond": value["retrievalRateLimitPerSecond"],
7149
7500
  "slug": value["slug"],
7150
7501
  "storageCreditCostPerGbMonth": value["storageCreditCostPerGbMonth"],
7502
+ "storageIncludedGb": value["storageIncludedGb"],
7151
7503
  "supportLevel": SupportLevelToJSON(value["supportLevel"]),
7152
7504
  "webhooksEnabled": value["webhooksEnabled"]
7153
7505
  };
@@ -7257,13 +7609,17 @@ function ResponseChangePlanFromJSONTyped(json, ignoreDiscriminator) {
7257
7609
  "paddleTransactionId": json["paddleTransactionId"] == null ? void 0 : json["paddleTransactionId"],
7258
7610
  "subscriptionId": json["subscriptionId"],
7259
7611
  "cancelScheduledAt": json["cancelScheduledAt"] == null ? void 0 : new Date(json["cancelScheduledAt"]),
7612
+ "chatCreditCost": json["chatCreditCost"] == null ? void 0 : json["chatCreditCost"],
7613
+ "chatIncludedPerCycle": json["chatIncludedPerCycle"] == null ? void 0 : json["chatIncludedPerCycle"],
7260
7614
  "creditsRemaining": json["creditsRemaining"],
7261
7615
  "creditsSnapshot": json["creditsSnapshot"],
7262
7616
  "currentPeriodEnd": json["currentPeriodEnd"] == null ? void 0 : new Date(json["currentPeriodEnd"]),
7263
7617
  "currentPeriodStart": json["currentPeriodStart"] == null ? void 0 : new Date(json["currentPeriodStart"]),
7264
7618
  "dataResidencyEnabled": json["dataResidencyEnabled"],
7619
+ "documentIntelligenceEnabled": json["documentIntelligenceEnabled"] == null ? void 0 : json["documentIntelligenceEnabled"],
7265
7620
  "enhancedPrivacyEnabled": json["enhancedPrivacyEnabled"],
7266
7621
  "id": json["id"],
7622
+ "indexCreditCost": json["indexCreditCost"] == null ? void 0 : json["indexCreditCost"],
7267
7623
  "ipAllowlistEnabled": json["ipAllowlistEnabled"],
7268
7624
  "maxDataRetentionPeriod": DataRetentionPeriodModelFromJSON(json["maxDataRetentionPeriod"]),
7269
7625
  "maxTemplates": json["maxTemplates"],
@@ -7272,7 +7628,10 @@ function ResponseChangePlanFromJSONTyped(json, ignoreDiscriminator) {
7272
7628
  "planId": json["planId"],
7273
7629
  "planName": json["planName"] == null ? void 0 : json["planName"],
7274
7630
  "priceSnapshotCents": json["priceSnapshotCents"],
7631
+ "retrievalRateLimitPerSecond": json["retrievalRateLimitPerSecond"] == null ? void 0 : json["retrievalRateLimitPerSecond"],
7275
7632
  "status": SubscriptionStatusFromJSON(json["status"]),
7633
+ "storageCreditCostPerGbMonth": json["storageCreditCostPerGbMonth"] == null ? void 0 : json["storageCreditCostPerGbMonth"],
7634
+ "storageIncludedGb": json["storageIncludedGb"] == null ? void 0 : json["storageIncludedGb"],
7276
7635
  "supportLevel": SupportLevelFromJSON(json["supportLevel"]),
7277
7636
  "userEmail": json["userEmail"] == null ? void 0 : json["userEmail"],
7278
7637
  "userId": json["userId"],
@@ -7293,13 +7652,17 @@ function ResponseChangePlanToJSONTyped(value, ignoreDiscriminator = false) {
7293
7652
  "paddleTransactionId": value["paddleTransactionId"],
7294
7653
  "subscriptionId": value["subscriptionId"],
7295
7654
  "cancelScheduledAt": value["cancelScheduledAt"] == null ? value["cancelScheduledAt"] : value["cancelScheduledAt"].toISOString(),
7655
+ "chatCreditCost": value["chatCreditCost"],
7656
+ "chatIncludedPerCycle": value["chatIncludedPerCycle"],
7296
7657
  "creditsRemaining": value["creditsRemaining"],
7297
7658
  "creditsSnapshot": value["creditsSnapshot"],
7298
7659
  "currentPeriodEnd": value["currentPeriodEnd"] == null ? value["currentPeriodEnd"] : value["currentPeriodEnd"].toISOString(),
7299
7660
  "currentPeriodStart": value["currentPeriodStart"] == null ? value["currentPeriodStart"] : value["currentPeriodStart"].toISOString(),
7300
7661
  "dataResidencyEnabled": value["dataResidencyEnabled"],
7662
+ "documentIntelligenceEnabled": value["documentIntelligenceEnabled"],
7301
7663
  "enhancedPrivacyEnabled": value["enhancedPrivacyEnabled"],
7302
7664
  "id": value["id"],
7665
+ "indexCreditCost": value["indexCreditCost"],
7303
7666
  "ipAllowlistEnabled": value["ipAllowlistEnabled"],
7304
7667
  "maxDataRetentionPeriod": DataRetentionPeriodModelToJSON(value["maxDataRetentionPeriod"]),
7305
7668
  "maxTemplates": value["maxTemplates"],
@@ -7308,7 +7671,10 @@ function ResponseChangePlanToJSONTyped(value, ignoreDiscriminator = false) {
7308
7671
  "planId": value["planId"],
7309
7672
  "planName": value["planName"],
7310
7673
  "priceSnapshotCents": value["priceSnapshotCents"],
7674
+ "retrievalRateLimitPerSecond": value["retrievalRateLimitPerSecond"],
7311
7675
  "status": SubscriptionStatusToJSON(value["status"]),
7676
+ "storageCreditCostPerGbMonth": value["storageCreditCostPerGbMonth"],
7677
+ "storageIncludedGb": value["storageIncludedGb"],
7312
7678
  "supportLevel": SupportLevelToJSON(value["supportLevel"]),
7313
7679
  "userEmail": value["userEmail"],
7314
7680
  "userId": value["userId"],
@@ -7316,6 +7682,63 @@ function ResponseChangePlanToJSONTyped(value, ignoreDiscriminator = false) {
7316
7682
  };
7317
7683
  }
7318
7684
 
7685
+ // src/generated/models/StorageUsageOutDTO.ts
7686
+ function instanceOfStorageUsageOutDTO(value) {
7687
+ if (!("billableGb" in value) || value["billableGb"] === void 0) return false;
7688
+ if (!("billingMode" in value) || value["billingMode"] === void 0) return false;
7689
+ if (!("includedGb" in value) || value["includedGb"] === void 0) return false;
7690
+ if (!("projectedCharge" in value) || value["projectedCharge"] === void 0) return false;
7691
+ if (!("ratePerGbMonth" in value) || value["ratePerGbMonth"] === void 0) return false;
7692
+ if (!("storedBytes" in value) || value["storedBytes"] === void 0) return false;
7693
+ if (!("storedGb" in value) || value["storedGb"] === void 0) return false;
7694
+ if (!("unit" in value) || value["unit"] === void 0) return false;
7695
+ return true;
7696
+ }
7697
+ function StorageUsageOutDTOFromJSON(json) {
7698
+ return StorageUsageOutDTOFromJSONTyped(json, false);
7699
+ }
7700
+ function StorageUsageOutDTOFromJSONTyped(json, ignoreDiscriminator) {
7701
+ if (json == null) {
7702
+ return json;
7703
+ }
7704
+ return {
7705
+ "billableGb": json["billableGb"],
7706
+ "billingMode": json["billingMode"],
7707
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
7708
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
7709
+ "includedGb": json["includedGb"],
7710
+ "projectedCharge": json["projectedCharge"],
7711
+ "ratePerGbMonth": json["ratePerGbMonth"],
7712
+ "servedAt": json["servedAt"] == null ? void 0 : new Date(json["servedAt"]),
7713
+ "servedAtTimestamp": json["servedAtTimestamp"] == null ? void 0 : json["servedAtTimestamp"],
7714
+ "storedBytes": json["storedBytes"],
7715
+ "storedGb": json["storedGb"],
7716
+ "unit": json["unit"]
7717
+ };
7718
+ }
7719
+ function StorageUsageOutDTOToJSON(json) {
7720
+ return StorageUsageOutDTOToJSONTyped(json, false);
7721
+ }
7722
+ function StorageUsageOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
7723
+ if (value == null) {
7724
+ return value;
7725
+ }
7726
+ return {
7727
+ "billableGb": value["billableGb"],
7728
+ "billingMode": value["billingMode"],
7729
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
7730
+ "createdAtTimestamp": value["createdAtTimestamp"],
7731
+ "includedGb": value["includedGb"],
7732
+ "projectedCharge": value["projectedCharge"],
7733
+ "ratePerGbMonth": value["ratePerGbMonth"],
7734
+ "servedAt": value["servedAt"] == null ? value["servedAt"] : value["servedAt"].toISOString(),
7735
+ "servedAtTimestamp": value["servedAtTimestamp"],
7736
+ "storedBytes": value["storedBytes"],
7737
+ "storedGb": value["storedGb"],
7738
+ "unit": value["unit"]
7739
+ };
7740
+ }
7741
+
7319
7742
  // src/generated/models/SubscribeInDTO.ts
7320
7743
  function instanceOfSubscribeInDTO(value) {
7321
7744
  if (!("planId" in value) || value["planId"] === void 0) return false;
@@ -7372,6 +7795,8 @@ function SubscriptionOutDTOFromJSONTyped(json, ignoreDiscriminator) {
7372
7795
  }
7373
7796
  return {
7374
7797
  "cancelScheduledAt": json["cancelScheduledAt"] == null ? void 0 : new Date(json["cancelScheduledAt"]),
7798
+ "chatCreditCost": json["chatCreditCost"] == null ? void 0 : json["chatCreditCost"],
7799
+ "chatIncludedPerCycle": json["chatIncludedPerCycle"] == null ? void 0 : json["chatIncludedPerCycle"],
7375
7800
  "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
7376
7801
  "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
7377
7802
  "creditsRemaining": json["creditsRemaining"],
@@ -7379,8 +7804,10 @@ function SubscriptionOutDTOFromJSONTyped(json, ignoreDiscriminator) {
7379
7804
  "currentPeriodEnd": json["currentPeriodEnd"] == null ? void 0 : new Date(json["currentPeriodEnd"]),
7380
7805
  "currentPeriodStart": json["currentPeriodStart"] == null ? void 0 : new Date(json["currentPeriodStart"]),
7381
7806
  "dataResidencyEnabled": json["dataResidencyEnabled"],
7807
+ "documentIntelligenceEnabled": json["documentIntelligenceEnabled"] == null ? void 0 : json["documentIntelligenceEnabled"],
7382
7808
  "enhancedPrivacyEnabled": json["enhancedPrivacyEnabled"],
7383
7809
  "id": json["id"],
7810
+ "indexCreditCost": json["indexCreditCost"] == null ? void 0 : json["indexCreditCost"],
7384
7811
  "ipAllowlistEnabled": json["ipAllowlistEnabled"],
7385
7812
  "maxDataRetentionPeriod": DataRetentionPeriodModelFromJSON(json["maxDataRetentionPeriod"]),
7386
7813
  "maxTemplates": json["maxTemplates"],
@@ -7389,7 +7816,10 @@ function SubscriptionOutDTOFromJSONTyped(json, ignoreDiscriminator) {
7389
7816
  "planId": json["planId"],
7390
7817
  "planName": json["planName"] == null ? void 0 : json["planName"],
7391
7818
  "priceSnapshotCents": json["priceSnapshotCents"],
7819
+ "retrievalRateLimitPerSecond": json["retrievalRateLimitPerSecond"] == null ? void 0 : json["retrievalRateLimitPerSecond"],
7392
7820
  "status": SubscriptionStatusFromJSON(json["status"]),
7821
+ "storageCreditCostPerGbMonth": json["storageCreditCostPerGbMonth"] == null ? void 0 : json["storageCreditCostPerGbMonth"],
7822
+ "storageIncludedGb": json["storageIncludedGb"] == null ? void 0 : json["storageIncludedGb"],
7393
7823
  "supportLevel": SupportLevelFromJSON(json["supportLevel"]),
7394
7824
  "userEmail": json["userEmail"] == null ? void 0 : json["userEmail"],
7395
7825
  "userId": json["userId"],
@@ -7405,6 +7835,8 @@ function SubscriptionOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
7405
7835
  }
7406
7836
  return {
7407
7837
  "cancelScheduledAt": value["cancelScheduledAt"] == null ? value["cancelScheduledAt"] : value["cancelScheduledAt"].toISOString(),
7838
+ "chatCreditCost": value["chatCreditCost"],
7839
+ "chatIncludedPerCycle": value["chatIncludedPerCycle"],
7408
7840
  "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
7409
7841
  "createdAtTimestamp": value["createdAtTimestamp"],
7410
7842
  "creditsRemaining": value["creditsRemaining"],
@@ -7412,8 +7844,10 @@ function SubscriptionOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
7412
7844
  "currentPeriodEnd": value["currentPeriodEnd"] == null ? value["currentPeriodEnd"] : value["currentPeriodEnd"].toISOString(),
7413
7845
  "currentPeriodStart": value["currentPeriodStart"] == null ? value["currentPeriodStart"] : value["currentPeriodStart"].toISOString(),
7414
7846
  "dataResidencyEnabled": value["dataResidencyEnabled"],
7847
+ "documentIntelligenceEnabled": value["documentIntelligenceEnabled"],
7415
7848
  "enhancedPrivacyEnabled": value["enhancedPrivacyEnabled"],
7416
7849
  "id": value["id"],
7850
+ "indexCreditCost": value["indexCreditCost"],
7417
7851
  "ipAllowlistEnabled": value["ipAllowlistEnabled"],
7418
7852
  "maxDataRetentionPeriod": DataRetentionPeriodModelToJSON(value["maxDataRetentionPeriod"]),
7419
7853
  "maxTemplates": value["maxTemplates"],
@@ -7422,7 +7856,10 @@ function SubscriptionOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
7422
7856
  "planId": value["planId"],
7423
7857
  "planName": value["planName"],
7424
7858
  "priceSnapshotCents": value["priceSnapshotCents"],
7859
+ "retrievalRateLimitPerSecond": value["retrievalRateLimitPerSecond"],
7425
7860
  "status": SubscriptionStatusToJSON(value["status"]),
7861
+ "storageCreditCostPerGbMonth": value["storageCreditCostPerGbMonth"],
7862
+ "storageIncludedGb": value["storageIncludedGb"],
7426
7863
  "supportLevel": SupportLevelToJSON(value["supportLevel"]),
7427
7864
  "userEmail": value["userEmail"],
7428
7865
  "userId": value["userId"],
@@ -7808,6 +8245,38 @@ var SubscriptionsApi = class extends BaseAPI {
7808
8245
  const response = await this.getCreditUsageRaw(initOverrides);
7809
8246
  return await response.value();
7810
8247
  }
8248
+ /**
8249
+ * Creates request options for getMyStorageUsage without sending the request
8250
+ */
8251
+ async getMyStorageUsageRequestOpts() {
8252
+ const queryParameters = {};
8253
+ const headerParameters = {};
8254
+ if (this.configuration && this.configuration.accessToken) {
8255
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
8256
+ }
8257
+ let urlPath = `/api/v1/subscriptions/me/storage`;
8258
+ return {
8259
+ path: urlPath,
8260
+ method: "GET",
8261
+ headers: headerParameters,
8262
+ query: queryParameters
8263
+ };
8264
+ }
8265
+ /**
8266
+ * Get My Storage Usage
8267
+ */
8268
+ async getMyStorageUsageRaw(initOverrides) {
8269
+ const requestOptions = await this.getMyStorageUsageRequestOpts();
8270
+ const response = await this.request(requestOptions, initOverrides);
8271
+ return new JSONApiResponse(response, (jsonValue) => StorageUsageOutDTOFromJSON(jsonValue));
8272
+ }
8273
+ /**
8274
+ * Get My Storage Usage
8275
+ */
8276
+ async getMyStorageUsage(initOverrides) {
8277
+ const response = await this.getMyStorageUsageRaw(initOverrides);
8278
+ return await response.value();
8279
+ }
7811
8280
  /**
7812
8281
  * Creates request options for getMySubscription without sending the request
7813
8282
  */
@@ -9156,6 +9625,40 @@ function isTerminal(status) {
9156
9625
  function normalizeBaseUrl(baseUrl) {
9157
9626
  return baseUrl.replace(/\/+$/, "");
9158
9627
  }
9628
+ var GeminaChatConversation = class {
9629
+ constructor(chat, endUserId) {
9630
+ this.chat = chat;
9631
+ this.endUserId = endUserId;
9632
+ }
9633
+ /** The current conversation id — `undefined` before the first turn or after a reset. */
9634
+ get sessionId() {
9635
+ return this.currentSessionId;
9636
+ }
9637
+ /** Send one turn; its answer continues this conversation. */
9638
+ async send(message) {
9639
+ const sessionId = this.currentSessionId;
9640
+ const result = await this.chat.chatQuery({
9641
+ chatQueryInDTO: { message, endUserId: this.endUserId, ...sessionId ? { sessionId } : {} }
9642
+ });
9643
+ this.currentSessionId = result.sessionId ?? this.currentSessionId;
9644
+ return result;
9645
+ }
9646
+ /** Forget the conversation locally; the next `send` starts a new one. */
9647
+ reset() {
9648
+ this.currentSessionId = void 0;
9649
+ }
9650
+ /**
9651
+ * End the conversation: delete it server-side (mirrors a "New chat" action)
9652
+ * and forget it locally. No-op if no turn has been sent yet.
9653
+ */
9654
+ async delete() {
9655
+ const sessionId = this.currentSessionId;
9656
+ this.currentSessionId = void 0;
9657
+ if (sessionId !== void 0) {
9658
+ await this.chat.deleteChatSession({ sessionId });
9659
+ }
9660
+ }
9661
+ };
9159
9662
  var GeminaClient = class _GeminaClient {
9160
9663
  /**
9161
9664
  * @param apiKey Gemina API key, sent as the `X-API-Key` header.
@@ -9226,6 +9729,15 @@ var GeminaClient = class _GeminaClient {
9226
9729
  var _a;
9227
9730
  return (_a = this.apiCache).billing ?? (_a.billing = this.apiOverrides.billing ?? new BillingApi(this.configuration));
9228
9731
  }
9732
+ // --- Stateful chat convenience ---
9733
+ /**
9734
+ * Start a stateful chat {@link GeminaChatConversation} that threads the
9735
+ * conversation `sessionId` across turns for you, so follow-up questions keep
9736
+ * context. The full one-shot surface stays on `client.chat`.
9737
+ */
9738
+ conversation(options = {}) {
9739
+ return new GeminaChatConversation(this.chat, options.endUserId);
9740
+ }
9229
9741
  // --- The headline one-call flow ---
9230
9742
  /**
9231
9743
  * Submit a document via the async endpoints, poll with exponential
@@ -9375,7 +9887,7 @@ async function asProcessingErrorIfFailedResult(error) {
9375
9887
  }
9376
9888
 
9377
9889
  // src/version.ts
9378
- var VERSION = "0.1.2";
9890
+ var VERSION = "0.2.1";
9379
9891
  // Annotate the CommonJS export names for ESM import in node:
9380
9892
  0 && (module.exports = {
9381
9893
  AggregateMetaDTOFromJSON,
@@ -9640,6 +10152,7 @@ var VERSION = "0.1.2";
9640
10152
  FreeTierConfigOutDTOFromJSONTyped,
9641
10153
  FreeTierConfigOutDTOToJSON,
9642
10154
  FreeTierConfigOutDTOToJSONTyped,
10155
+ GeminaChatConversation,
9643
10156
  GeminaClient,
9644
10157
  GeminaError,
9645
10158
  GeminaProcessingError,
@@ -9680,6 +10193,10 @@ var VERSION = "0.1.2";
9680
10193
  LocationInnerFromJSONTyped,
9681
10194
  LocationInnerToJSON,
9682
10195
  LocationInnerToJSONTyped,
10196
+ MatchedChunkDTOFromJSON,
10197
+ MatchedChunkDTOFromJSONTyped,
10198
+ MatchedChunkDTOToJSON,
10199
+ MatchedChunkDTOToJSONTyped,
9683
10200
  MetaApi,
9684
10201
  ModelType,
9685
10202
  ModelTypeFromJSON,
@@ -9763,6 +10280,14 @@ var VERSION = "0.1.2";
9763
10280
  RetrievalAggregateOutDTOToJSON,
9764
10281
  RetrievalAggregateOutDTOToJSONTyped,
9765
10282
  RetrievalApi,
10283
+ RetrievalFieldItemDTOFromJSON,
10284
+ RetrievalFieldItemDTOFromJSONTyped,
10285
+ RetrievalFieldItemDTOToJSON,
10286
+ RetrievalFieldItemDTOToJSONTyped,
10287
+ RetrievalFieldsOutDTOFromJSON,
10288
+ RetrievalFieldsOutDTOFromJSONTyped,
10289
+ RetrievalFieldsOutDTOToJSON,
10290
+ RetrievalFieldsOutDTOToJSONTyped,
9766
10291
  RetrievalFiltersDTOFromJSON,
9767
10292
  RetrievalFiltersDTOFromJSONTyped,
9768
10293
  RetrievalFiltersDTOToJSON,
@@ -9796,6 +10321,15 @@ var VERSION = "0.1.2";
9796
10321
  SortMethodModelFromJSONTyped,
9797
10322
  SortMethodModelToJSON,
9798
10323
  SortMethodModelToJSONTyped,
10324
+ StorageUsageOutDTOFromJSON,
10325
+ StorageUsageOutDTOFromJSONTyped,
10326
+ StorageUsageOutDTOToJSON,
10327
+ StorageUsageOutDTOToJSONTyped,
10328
+ StructuredFilterDTOFromJSON,
10329
+ StructuredFilterDTOFromJSONTyped,
10330
+ StructuredFilterDTOOpEnum,
10331
+ StructuredFilterDTOToJSON,
10332
+ StructuredFilterDTOToJSONTyped,
9799
10333
  SubscribeInDTOFromJSON,
9800
10334
  SubscribeInDTOFromJSONTyped,
9801
10335
  SubscribeInDTOToJSON,
@@ -9899,6 +10433,10 @@ var VERSION = "0.1.2";
9899
10433
  ValidationSchemaModelFromJSONTyped,
9900
10434
  ValidationSchemaModelToJSON,
9901
10435
  ValidationSchemaModelToJSONTyped,
10436
+ ValueFromJSON,
10437
+ ValueFromJSONTyped,
10438
+ ValueToJSON,
10439
+ ValueToJSONTyped,
9902
10440
  ValuesValueFromJSON,
9903
10441
  ValuesValueFromJSONTyped,
9904
10442
  ValuesValueToJSON,
@@ -9988,6 +10526,7 @@ var VERSION = "0.1.2";
9988
10526
  instanceOfInvoiceStatus,
9989
10527
  instanceOfInvoiceType,
9990
10528
  instanceOfLocationInner,
10529
+ instanceOfMatchedChunkDTO,
9991
10530
  instanceOfModelType,
9992
10531
  instanceOfNextActionOutDTO,
9993
10532
  instanceOfNumberOfStoredDocumentsOutDTO,
@@ -10006,6 +10545,8 @@ var VERSION = "0.1.2";
10006
10545
  instanceOfResponseStatus,
10007
10546
  instanceOfRetrievalAggregateInDTO,
10008
10547
  instanceOfRetrievalAggregateOutDTO,
10548
+ instanceOfRetrievalFieldItemDTO,
10549
+ instanceOfRetrievalFieldsOutDTO,
10009
10550
  instanceOfRetrievalFiltersDTO,
10010
10551
  instanceOfRetrievalQueryInDTO,
10011
10552
  instanceOfRetrievalQueryOutDTO,
@@ -10013,6 +10554,8 @@ var VERSION = "0.1.2";
10013
10554
  instanceOfSessionTokenInDTO,
10014
10555
  instanceOfSessionTokenOutDTO,
10015
10556
  instanceOfSortMethodModel,
10557
+ instanceOfStorageUsageOutDTO,
10558
+ instanceOfStructuredFilterDTO,
10016
10559
  instanceOfSubscribeInDTO,
10017
10560
  instanceOfSubscriptionOutDTO,
10018
10561
  instanceOfSubscriptionStatus,
@@ -10037,6 +10580,7 @@ var VERSION = "0.1.2";
10037
10580
  instanceOfUsageSummaryOutDTO,
10038
10581
  instanceOfValidationError,
10039
10582
  instanceOfValidationSchemaModel,
10583
+ instanceOfValue,
10040
10584
  instanceOfValuesValue,
10041
10585
  instanceOfViewMetaOutDTO,
10042
10586
  instanceOfVolumeDiscountTierOutDTO,