@gemina/sdk 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -40,6 +40,10 @@ __export(index_exports, {
40
40
  BlobApiResponse: () => BlobApiResponse,
41
41
  COLLECTION_FORMATS: () => COLLECTION_FORMATS,
42
42
  ChatApi: () => ChatApi,
43
+ ChatMessageOutDTOFromJSON: () => ChatMessageOutDTOFromJSON,
44
+ ChatMessageOutDTOFromJSONTyped: () => ChatMessageOutDTOFromJSONTyped,
45
+ ChatMessageOutDTOToJSON: () => ChatMessageOutDTOToJSON,
46
+ ChatMessageOutDTOToJSONTyped: () => ChatMessageOutDTOToJSONTyped,
43
47
  ChatQueryInDTOFromJSON: () => ChatQueryInDTOFromJSON,
44
48
  ChatQueryInDTOFromJSONTyped: () => ChatQueryInDTOFromJSONTyped,
45
49
  ChatQueryInDTOToJSON: () => ChatQueryInDTOToJSON,
@@ -48,6 +52,18 @@ __export(index_exports, {
48
52
  ChatQueryOutDTOFromJSONTyped: () => ChatQueryOutDTOFromJSONTyped,
49
53
  ChatQueryOutDTOToJSON: () => ChatQueryOutDTOToJSON,
50
54
  ChatQueryOutDTOToJSONTyped: () => ChatQueryOutDTOToJSONTyped,
55
+ ChatSessionListOutDTOFromJSON: () => ChatSessionListOutDTOFromJSON,
56
+ ChatSessionListOutDTOFromJSONTyped: () => ChatSessionListOutDTOFromJSONTyped,
57
+ ChatSessionListOutDTOToJSON: () => ChatSessionListOutDTOToJSON,
58
+ ChatSessionListOutDTOToJSONTyped: () => ChatSessionListOutDTOToJSONTyped,
59
+ ChatSessionOutDTOFromJSON: () => ChatSessionOutDTOFromJSON,
60
+ ChatSessionOutDTOFromJSONTyped: () => ChatSessionOutDTOFromJSONTyped,
61
+ ChatSessionOutDTOToJSON: () => ChatSessionOutDTOToJSON,
62
+ ChatSessionOutDTOToJSONTyped: () => ChatSessionOutDTOToJSONTyped,
63
+ ChatTranscriptOutDTOFromJSON: () => ChatTranscriptOutDTOFromJSON,
64
+ ChatTranscriptOutDTOFromJSONTyped: () => ChatTranscriptOutDTOFromJSONTyped,
65
+ ChatTranscriptOutDTOToJSON: () => ChatTranscriptOutDTOToJSON,
66
+ ChatTranscriptOutDTOToJSONTyped: () => ChatTranscriptOutDTOToJSONTyped,
51
67
  CheckoutOutDTOFromJSON: () => CheckoutOutDTOFromJSON,
52
68
  CheckoutOutDTOFromJSONTyped: () => CheckoutOutDTOFromJSONTyped,
53
69
  CheckoutOutDTOToJSON: () => CheckoutOutDTOToJSON,
@@ -397,10 +413,10 @@ __export(index_exports, {
397
413
  PlanOutDTOFromJSONTyped: () => PlanOutDTOFromJSONTyped,
398
414
  PlanOutDTOToJSON: () => PlanOutDTOToJSON,
399
415
  PlanOutDTOToJSONTyped: () => PlanOutDTOToJSONTyped,
400
- PurgeDocumentsWithEndUserId422ResponseFromJSON: () => PurgeDocumentsWithEndUserId422ResponseFromJSON,
401
- PurgeDocumentsWithEndUserId422ResponseFromJSONTyped: () => PurgeDocumentsWithEndUserId422ResponseFromJSONTyped,
402
- PurgeDocumentsWithEndUserId422ResponseToJSON: () => PurgeDocumentsWithEndUserId422ResponseToJSON,
403
- PurgeDocumentsWithEndUserId422ResponseToJSONTyped: () => PurgeDocumentsWithEndUserId422ResponseToJSONTyped,
416
+ PurgeChatSession422ResponseFromJSON: () => PurgeChatSession422ResponseFromJSON,
417
+ PurgeChatSession422ResponseFromJSONTyped: () => PurgeChatSession422ResponseFromJSONTyped,
418
+ PurgeChatSession422ResponseToJSON: () => PurgeChatSession422ResponseToJSON,
419
+ PurgeChatSession422ResponseToJSONTyped: () => PurgeChatSession422ResponseToJSONTyped,
404
420
  PurgeReasonModel: () => PurgeReasonModel,
405
421
  PurgeReasonModelFromJSON: () => PurgeReasonModelFromJSON,
406
422
  PurgeReasonModelFromJSONTyped: () => PurgeReasonModelFromJSONTyped,
@@ -484,6 +500,14 @@ __export(index_exports, {
484
500
  SortMethodModelFromJSONTyped: () => SortMethodModelFromJSONTyped,
485
501
  SortMethodModelToJSON: () => SortMethodModelToJSON,
486
502
  SortMethodModelToJSONTyped: () => SortMethodModelToJSONTyped,
503
+ SpendLimitOutDTOFromJSON: () => SpendLimitOutDTOFromJSON,
504
+ SpendLimitOutDTOFromJSONTyped: () => SpendLimitOutDTOFromJSONTyped,
505
+ SpendLimitOutDTOToJSON: () => SpendLimitOutDTOToJSON,
506
+ SpendLimitOutDTOToJSONTyped: () => SpendLimitOutDTOToJSONTyped,
507
+ SpendLimitUpdateInDTOFromJSON: () => SpendLimitUpdateInDTOFromJSON,
508
+ SpendLimitUpdateInDTOFromJSONTyped: () => SpendLimitUpdateInDTOFromJSONTyped,
509
+ SpendLimitUpdateInDTOToJSON: () => SpendLimitUpdateInDTOToJSON,
510
+ SpendLimitUpdateInDTOToJSONTyped: () => SpendLimitUpdateInDTOToJSONTyped,
487
511
  StorageUsageOutDTOFromJSON: () => StorageUsageOutDTOFromJSON,
488
512
  StorageUsageOutDTOFromJSONTyped: () => StorageUsageOutDTOFromJSONTyped,
489
513
  StorageUsageOutDTOToJSON: () => StorageUsageOutDTOToJSON,
@@ -635,8 +659,12 @@ __export(index_exports, {
635
659
  instanceOfAggregateMetaDTO: () => instanceOfAggregateMetaDTO,
636
660
  instanceOfAggregateMetricDTO: () => instanceOfAggregateMetricDTO,
637
661
  instanceOfAggregateRowDTO: () => instanceOfAggregateRowDTO,
662
+ instanceOfChatMessageOutDTO: () => instanceOfChatMessageOutDTO,
638
663
  instanceOfChatQueryInDTO: () => instanceOfChatQueryInDTO,
639
664
  instanceOfChatQueryOutDTO: () => instanceOfChatQueryOutDTO,
665
+ instanceOfChatSessionListOutDTO: () => instanceOfChatSessionListOutDTO,
666
+ instanceOfChatSessionOutDTO: () => instanceOfChatSessionOutDTO,
667
+ instanceOfChatTranscriptOutDTO: () => instanceOfChatTranscriptOutDTO,
640
668
  instanceOfCheckoutOutDTO: () => instanceOfCheckoutOutDTO,
641
669
  instanceOfColumnDefinitionDTO: () => instanceOfColumnDefinitionDTO,
642
670
  instanceOfComparisonSummaryModel: () => instanceOfComparisonSummaryModel,
@@ -733,6 +761,8 @@ __export(index_exports, {
733
761
  instanceOfSessionTokenInDTO: () => instanceOfSessionTokenInDTO,
734
762
  instanceOfSessionTokenOutDTO: () => instanceOfSessionTokenOutDTO,
735
763
  instanceOfSortMethodModel: () => instanceOfSortMethodModel,
764
+ instanceOfSpendLimitOutDTO: () => instanceOfSpendLimitOutDTO,
765
+ instanceOfSpendLimitUpdateInDTO: () => instanceOfSpendLimitUpdateInDTO,
736
766
  instanceOfStorageUsageOutDTO: () => instanceOfStorageUsageOutDTO,
737
767
  instanceOfStructuredFilterDTO: () => instanceOfStructuredFilterDTO,
738
768
  instanceOfSubscribeInDTO: () => instanceOfSubscribeInDTO,
@@ -1078,9 +1108,11 @@ var TextApiResponse = class {
1078
1108
  // src/generated/models/InvoiceStatus.ts
1079
1109
  var InvoiceStatus = {
1080
1110
  Draft: "draft",
1111
+ Preparing: "preparing",
1081
1112
  Issued: "issued",
1082
1113
  Paid: "paid",
1083
- Refunded: "refunded"
1114
+ Refunded: "refunded",
1115
+ Voided: "voided"
1084
1116
  };
1085
1117
  function instanceOfInvoiceStatus(value) {
1086
1118
  for (const key in InvoiceStatus) {
@@ -1511,6 +1543,177 @@ function ChatQueryOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
1511
1543
  };
1512
1544
  }
1513
1545
 
1546
+ // src/generated/models/ChatSessionOutDTO.ts
1547
+ function instanceOfChatSessionOutDTO(value) {
1548
+ if (!("id" in value) || value["id"] === void 0) return false;
1549
+ return true;
1550
+ }
1551
+ function ChatSessionOutDTOFromJSON(json) {
1552
+ return ChatSessionOutDTOFromJSONTyped(json, false);
1553
+ }
1554
+ function ChatSessionOutDTOFromJSONTyped(json, ignoreDiscriminator) {
1555
+ if (json == null) {
1556
+ return json;
1557
+ }
1558
+ return {
1559
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
1560
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
1561
+ "id": json["id"],
1562
+ "lastActivityAt": json["lastActivityAt"] == null ? void 0 : new Date(json["lastActivityAt"]),
1563
+ "purgeAt": json["purgeAt"] == null ? void 0 : new Date(json["purgeAt"]),
1564
+ "purgeReason": json["purgeReason"] == null ? void 0 : json["purgeReason"],
1565
+ "purgedAt": json["purgedAt"] == null ? void 0 : new Date(json["purgedAt"]),
1566
+ "resumable": json["resumable"] == null ? void 0 : json["resumable"],
1567
+ "title": json["title"] == null ? void 0 : json["title"],
1568
+ "turnCount": json["turnCount"] == null ? void 0 : json["turnCount"]
1569
+ };
1570
+ }
1571
+ function ChatSessionOutDTOToJSON(json) {
1572
+ return ChatSessionOutDTOToJSONTyped(json, false);
1573
+ }
1574
+ function ChatSessionOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
1575
+ if (value == null) {
1576
+ return value;
1577
+ }
1578
+ return {
1579
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
1580
+ "createdAtTimestamp": value["createdAtTimestamp"],
1581
+ "id": value["id"],
1582
+ "lastActivityAt": value["lastActivityAt"] == null ? value["lastActivityAt"] : value["lastActivityAt"].toISOString(),
1583
+ "purgeAt": value["purgeAt"] == null ? value["purgeAt"] : value["purgeAt"].toISOString(),
1584
+ "purgeReason": value["purgeReason"],
1585
+ "purgedAt": value["purgedAt"] == null ? value["purgedAt"] : value["purgedAt"].toISOString(),
1586
+ "resumable": value["resumable"],
1587
+ "title": value["title"],
1588
+ "turnCount": value["turnCount"]
1589
+ };
1590
+ }
1591
+
1592
+ // src/generated/models/ChatSessionListOutDTO.ts
1593
+ function instanceOfChatSessionListOutDTO(value) {
1594
+ if (!("count" in value) || value["count"] === void 0) return false;
1595
+ if (!("sessions" in value) || value["sessions"] === void 0) return false;
1596
+ return true;
1597
+ }
1598
+ function ChatSessionListOutDTOFromJSON(json) {
1599
+ return ChatSessionListOutDTOFromJSONTyped(json, false);
1600
+ }
1601
+ function ChatSessionListOutDTOFromJSONTyped(json, ignoreDiscriminator) {
1602
+ if (json == null) {
1603
+ return json;
1604
+ }
1605
+ return {
1606
+ "count": json["count"],
1607
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
1608
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
1609
+ "servedAt": json["servedAt"] == null ? void 0 : new Date(json["servedAt"]),
1610
+ "servedAtTimestamp": json["servedAtTimestamp"] == null ? void 0 : json["servedAtTimestamp"],
1611
+ "sessions": json["sessions"].map(ChatSessionOutDTOFromJSON)
1612
+ };
1613
+ }
1614
+ function ChatSessionListOutDTOToJSON(json) {
1615
+ return ChatSessionListOutDTOToJSONTyped(json, false);
1616
+ }
1617
+ function ChatSessionListOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
1618
+ if (value == null) {
1619
+ return value;
1620
+ }
1621
+ return {
1622
+ "count": value["count"],
1623
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
1624
+ "createdAtTimestamp": value["createdAtTimestamp"],
1625
+ "servedAt": value["servedAt"] == null ? value["servedAt"] : value["servedAt"].toISOString(),
1626
+ "servedAtTimestamp": value["servedAtTimestamp"],
1627
+ "sessions": value["sessions"].map(ChatSessionOutDTOToJSON)
1628
+ };
1629
+ }
1630
+
1631
+ // src/generated/models/ChatMessageOutDTO.ts
1632
+ function instanceOfChatMessageOutDTO(value) {
1633
+ if (!("content" in value) || value["content"] === void 0) return false;
1634
+ if (!("role" in value) || value["role"] === void 0) return false;
1635
+ if (!("turnIndex" in value) || value["turnIndex"] === void 0) return false;
1636
+ return true;
1637
+ }
1638
+ function ChatMessageOutDTOFromJSON(json) {
1639
+ return ChatMessageOutDTOFromJSONTyped(json, false);
1640
+ }
1641
+ function ChatMessageOutDTOFromJSONTyped(json, ignoreDiscriminator) {
1642
+ if (json == null) {
1643
+ return json;
1644
+ }
1645
+ return {
1646
+ "citations": json["citations"] == null ? void 0 : json["citations"],
1647
+ "confident": json["confident"] == null ? void 0 : json["confident"],
1648
+ "content": json["content"],
1649
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
1650
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
1651
+ "intent": json["intent"] == null ? void 0 : json["intent"],
1652
+ "role": json["role"],
1653
+ "turnIndex": json["turnIndex"]
1654
+ };
1655
+ }
1656
+ function ChatMessageOutDTOToJSON(json) {
1657
+ return ChatMessageOutDTOToJSONTyped(json, false);
1658
+ }
1659
+ function ChatMessageOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
1660
+ if (value == null) {
1661
+ return value;
1662
+ }
1663
+ return {
1664
+ "citations": value["citations"],
1665
+ "confident": value["confident"],
1666
+ "content": value["content"],
1667
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
1668
+ "createdAtTimestamp": value["createdAtTimestamp"],
1669
+ "intent": value["intent"],
1670
+ "role": value["role"],
1671
+ "turnIndex": value["turnIndex"]
1672
+ };
1673
+ }
1674
+
1675
+ // src/generated/models/ChatTranscriptOutDTO.ts
1676
+ function instanceOfChatTranscriptOutDTO(value) {
1677
+ if (!("count" in value) || value["count"] === void 0) return false;
1678
+ if (!("messages" in value) || value["messages"] === void 0) return false;
1679
+ if (!("session" in value) || value["session"] === void 0) return false;
1680
+ return true;
1681
+ }
1682
+ function ChatTranscriptOutDTOFromJSON(json) {
1683
+ return ChatTranscriptOutDTOFromJSONTyped(json, false);
1684
+ }
1685
+ function ChatTranscriptOutDTOFromJSONTyped(json, ignoreDiscriminator) {
1686
+ if (json == null) {
1687
+ return json;
1688
+ }
1689
+ return {
1690
+ "count": json["count"],
1691
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
1692
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
1693
+ "messages": json["messages"].map(ChatMessageOutDTOFromJSON),
1694
+ "servedAt": json["servedAt"] == null ? void 0 : new Date(json["servedAt"]),
1695
+ "servedAtTimestamp": json["servedAtTimestamp"] == null ? void 0 : json["servedAtTimestamp"],
1696
+ "session": ChatSessionOutDTOFromJSON(json["session"])
1697
+ };
1698
+ }
1699
+ function ChatTranscriptOutDTOToJSON(json) {
1700
+ return ChatTranscriptOutDTOToJSONTyped(json, false);
1701
+ }
1702
+ function ChatTranscriptOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
1703
+ if (value == null) {
1704
+ return value;
1705
+ }
1706
+ return {
1707
+ "count": value["count"],
1708
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
1709
+ "createdAtTimestamp": value["createdAtTimestamp"],
1710
+ "messages": value["messages"].map(ChatMessageOutDTOToJSON),
1711
+ "servedAt": value["servedAt"] == null ? value["servedAt"] : value["servedAt"].toISOString(),
1712
+ "servedAtTimestamp": value["servedAtTimestamp"],
1713
+ "session": ChatSessionOutDTOToJSON(value["session"])
1714
+ };
1715
+ }
1716
+
1514
1717
  // src/generated/apis/ChatApi.ts
1515
1718
  var ChatApi = class extends BaseAPI {
1516
1719
  /**
@@ -1601,6 +1804,191 @@ var ChatApi = class extends BaseAPI {
1601
1804
  async deleteChatSession(requestParameters, initOverrides) {
1602
1805
  await this.deleteChatSessionRaw(requestParameters, initOverrides);
1603
1806
  }
1807
+ /**
1808
+ * Creates request options for getChatSession without sending the request
1809
+ */
1810
+ async getChatSessionRequestOpts(requestParameters) {
1811
+ if (requestParameters["sessionId"] == null) {
1812
+ throw new RequiredError(
1813
+ "sessionId",
1814
+ 'Required parameter "sessionId" was null or undefined when calling getChatSession().'
1815
+ );
1816
+ }
1817
+ const queryParameters = {};
1818
+ if (requestParameters["skip"] != null) {
1819
+ queryParameters["skip"] = requestParameters["skip"];
1820
+ }
1821
+ if (requestParameters["limit"] != null) {
1822
+ queryParameters["limit"] = requestParameters["limit"];
1823
+ }
1824
+ if (requestParameters["withPurged"] != null) {
1825
+ queryParameters["with_purged"] = requestParameters["withPurged"];
1826
+ }
1827
+ const headerParameters = {};
1828
+ if (this.configuration && this.configuration.apiKey) {
1829
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
1830
+ }
1831
+ if (this.configuration && this.configuration.accessToken) {
1832
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
1833
+ }
1834
+ let urlPath = `/api/v1/chat/sessions/{session_id}`;
1835
+ urlPath = urlPath.replace("{session_id}", encodeURIComponent(String(requestParameters["sessionId"])));
1836
+ return {
1837
+ path: urlPath,
1838
+ method: "GET",
1839
+ headers: headerParameters,
1840
+ query: queryParameters
1841
+ };
1842
+ }
1843
+ /**
1844
+ * Read one conversation\'s transcript. Messages come back in turn order, user before assistant within a turn. 404 for unknown, foreign and purged sessions alike — a purged stub is readable only with ``with_purged``, and then carries no messages.
1845
+ * Get Chat Session
1846
+ */
1847
+ async getChatSessionRaw(requestParameters, initOverrides) {
1848
+ const requestOptions = await this.getChatSessionRequestOpts(requestParameters);
1849
+ const response = await this.request(requestOptions, initOverrides);
1850
+ return new JSONApiResponse(response, (jsonValue) => ChatTranscriptOutDTOFromJSON(jsonValue));
1851
+ }
1852
+ /**
1853
+ * Read one conversation\'s transcript. Messages come back in turn order, user before assistant within a turn. 404 for unknown, foreign and purged sessions alike — a purged stub is readable only with ``with_purged``, and then carries no messages.
1854
+ * Get Chat Session
1855
+ */
1856
+ async getChatSession(requestParameters, initOverrides) {
1857
+ const response = await this.getChatSessionRaw(requestParameters, initOverrides);
1858
+ return await response.value();
1859
+ }
1860
+ /**
1861
+ * Creates request options for listChatSessions without sending the request
1862
+ */
1863
+ async listChatSessionsRequestOpts(requestParameters) {
1864
+ const queryParameters = {};
1865
+ if (requestParameters["skip"] != null) {
1866
+ queryParameters["skip"] = requestParameters["skip"];
1867
+ }
1868
+ if (requestParameters["limit"] != null) {
1869
+ queryParameters["limit"] = requestParameters["limit"];
1870
+ }
1871
+ if (requestParameters["sortField"] != null) {
1872
+ queryParameters["sort_field"] = requestParameters["sortField"];
1873
+ }
1874
+ if (requestParameters["sortMethod"] != null) {
1875
+ queryParameters["sort_method"] = requestParameters["sortMethod"];
1876
+ }
1877
+ if (requestParameters["withPurged"] != null) {
1878
+ queryParameters["with_purged"] = requestParameters["withPurged"];
1879
+ }
1880
+ const headerParameters = {};
1881
+ if (this.configuration && this.configuration.apiKey) {
1882
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
1883
+ }
1884
+ if (this.configuration && this.configuration.accessToken) {
1885
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
1886
+ }
1887
+ let urlPath = `/api/v1/chat/sessions`;
1888
+ return {
1889
+ path: urlPath,
1890
+ method: "GET",
1891
+ headers: headerParameters,
1892
+ query: queryParameters
1893
+ };
1894
+ }
1895
+ /**
1896
+ * List past conversations, newest first. Sessions with no delivered turn yet are omitted. Ended conversations stay listed and come back ``resumable: false``; purged ones are stubs, hidden unless ``with_purged`` is set. A token-pinned caller sees only its own end-user\'s chats.
1897
+ * List Chat Sessions
1898
+ */
1899
+ async listChatSessionsRaw(requestParameters, initOverrides) {
1900
+ const requestOptions = await this.listChatSessionsRequestOpts(requestParameters);
1901
+ const response = await this.request(requestOptions, initOverrides);
1902
+ return new JSONApiResponse(response, (jsonValue) => ChatSessionListOutDTOFromJSON(jsonValue));
1903
+ }
1904
+ /**
1905
+ * List past conversations, newest first. Sessions with no delivered turn yet are omitted. Ended conversations stay listed and come back ``resumable: false``; purged ones are stubs, hidden unless ``with_purged`` is set. A token-pinned caller sees only its own end-user\'s chats.
1906
+ * List Chat Sessions
1907
+ */
1908
+ async listChatSessions(requestParameters = {}, initOverrides) {
1909
+ const response = await this.listChatSessionsRaw(requestParameters, initOverrides);
1910
+ return await response.value();
1911
+ }
1912
+ /**
1913
+ * Creates request options for purgeChatSession without sending the request
1914
+ */
1915
+ async purgeChatSessionRequestOpts(requestParameters) {
1916
+ if (requestParameters["sessionId"] == null) {
1917
+ throw new RequiredError(
1918
+ "sessionId",
1919
+ 'Required parameter "sessionId" was null or undefined when calling purgeChatSession().'
1920
+ );
1921
+ }
1922
+ const queryParameters = {};
1923
+ const headerParameters = {};
1924
+ if (this.configuration && this.configuration.apiKey) {
1925
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
1926
+ }
1927
+ let urlPath = `/api/v1/chat/sessions/{session_id}/purge`;
1928
+ urlPath = urlPath.replace("{session_id}", encodeURIComponent(String(requestParameters["sessionId"])));
1929
+ return {
1930
+ path: urlPath,
1931
+ method: "DELETE",
1932
+ headers: headerParameters,
1933
+ query: queryParameters
1934
+ };
1935
+ }
1936
+ /**
1937
+ * Permanently destroy a conversation\'s stored content. IRREVERSIBLE. Messages are deleted, trace content is scrubbed, and the title is cleared; a stub row survives as the record of the purge. Transient conversational state on the chat backend expires within approximately 24 hours. Deliberately NOT available to retrieval tokens: they carry a single query-only scope minted for embedded widgets, and granting them irreversible deletion would be a least-privilege regression.
1938
+ * Purge Chat Session
1939
+ */
1940
+ async purgeChatSessionRaw(requestParameters, initOverrides) {
1941
+ const requestOptions = await this.purgeChatSessionRequestOpts(requestParameters);
1942
+ const response = await this.request(requestOptions, initOverrides);
1943
+ return new VoidApiResponse(response);
1944
+ }
1945
+ /**
1946
+ * Permanently destroy a conversation\'s stored content. IRREVERSIBLE. Messages are deleted, trace content is scrubbed, and the title is cleared; a stub row survives as the record of the purge. Transient conversational state on the chat backend expires within approximately 24 hours. Deliberately NOT available to retrieval tokens: they carry a single query-only scope minted for embedded widgets, and granting them irreversible deletion would be a least-privilege regression.
1947
+ * Purge Chat Session
1948
+ */
1949
+ async purgeChatSession(requestParameters, initOverrides) {
1950
+ await this.purgeChatSessionRaw(requestParameters, initOverrides);
1951
+ }
1952
+ /**
1953
+ * Creates request options for purgeChatSessionByUser without sending the request
1954
+ */
1955
+ async purgeChatSessionByUserRequestOpts(requestParameters) {
1956
+ if (requestParameters["sessionId"] == null) {
1957
+ throw new RequiredError(
1958
+ "sessionId",
1959
+ 'Required parameter "sessionId" was null or undefined when calling purgeChatSessionByUser().'
1960
+ );
1961
+ }
1962
+ const queryParameters = {};
1963
+ const headerParameters = {};
1964
+ if (this.configuration && this.configuration.accessToken) {
1965
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
1966
+ }
1967
+ let urlPath = `/api/v1/chat/sessions/{session_id}/purge/user`;
1968
+ urlPath = urlPath.replace("{session_id}", encodeURIComponent(String(requestParameters["sessionId"])));
1969
+ return {
1970
+ path: urlPath,
1971
+ method: "DELETE",
1972
+ headers: headerParameters,
1973
+ query: queryParameters
1974
+ };
1975
+ }
1976
+ /**
1977
+ * Console-signed-in equivalent of ``purge_chat_session``. IRREVERSIBLE. Same semantics and the same refusal of retrieval tokens; this variant authenticates with the console JWT instead of an API key, mirroring the documents purge convention.
1978
+ * Purge Chat Session By User
1979
+ */
1980
+ async purgeChatSessionByUserRaw(requestParameters, initOverrides) {
1981
+ const requestOptions = await this.purgeChatSessionByUserRequestOpts(requestParameters);
1982
+ const response = await this.request(requestOptions, initOverrides);
1983
+ return new VoidApiResponse(response);
1984
+ }
1985
+ /**
1986
+ * Console-signed-in equivalent of ``purge_chat_session``. IRREVERSIBLE. Same semantics and the same refusal of retrieval tokens; this variant authenticates with the console JWT instead of an API key, mirroring the documents purge convention.
1987
+ * Purge Chat Session By User
1988
+ */
1989
+ async purgeChatSessionByUser(requestParameters, initOverrides) {
1990
+ await this.purgeChatSessionByUserRaw(requestParameters, initOverrides);
1991
+ }
1604
1992
  };
1605
1993
 
1606
1994
  // src/generated/models/ContactFormInDTO.ts
@@ -5168,6 +5556,7 @@ function ContractOutDTOFromJSONTyped(json, ignoreDiscriminator) {
5168
5556
  "indexPriceCents": json["indexPriceCents"] == null ? void 0 : json["indexPriceCents"],
5169
5557
  "maxMonthlyExtractions": json["maxMonthlyExtractions"] == null ? void 0 : json["maxMonthlyExtractions"],
5170
5558
  "monthlyFiletagCredits": json["monthlyFiletagCredits"] == null ? void 0 : json["monthlyFiletagCredits"],
5559
+ "monthlySpendLimitCents": json["monthlySpendLimitCents"] == null ? void 0 : json["monthlySpendLimitCents"],
5171
5560
  "paddleSubscriptionId": json["paddleSubscriptionId"] == null ? void 0 : json["paddleSubscriptionId"],
5172
5561
  "rateCardTemplateId": json["rateCardTemplateId"] == null ? void 0 : json["rateCardTemplateId"],
5173
5562
  "rateCards": json["rateCards"] == null ? void 0 : json["rateCards"].map(RateCardOutDTOFromJSON),
@@ -5200,6 +5589,7 @@ function ContractOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
5200
5589
  "indexPriceCents": value["indexPriceCents"],
5201
5590
  "maxMonthlyExtractions": value["maxMonthlyExtractions"],
5202
5591
  "monthlyFiletagCredits": value["monthlyFiletagCredits"],
5592
+ "monthlySpendLimitCents": value["monthlySpendLimitCents"],
5203
5593
  "paddleSubscriptionId": value["paddleSubscriptionId"],
5204
5594
  "rateCardTemplateId": value["rateCardTemplateId"],
5205
5595
  "rateCards": value["rateCards"] == null ? void 0 : value["rateCards"].map(RateCardOutDTOToJSON),
@@ -5300,6 +5690,82 @@ function EnterpriseTransactionListOutDTOToJSONTyped(value, ignoreDiscriminator =
5300
5690
  };
5301
5691
  }
5302
5692
 
5693
+ // src/generated/models/SpendLimitOutDTO.ts
5694
+ function instanceOfSpendLimitOutDTO(value) {
5695
+ if (!("cycleEnd" in value) || value["cycleEnd"] === void 0) return false;
5696
+ if (!("cycleStart" in value) || value["cycleStart"] === void 0) return false;
5697
+ return true;
5698
+ }
5699
+ function SpendLimitOutDTOFromJSON(json) {
5700
+ return SpendLimitOutDTOFromJSONTyped(json, false);
5701
+ }
5702
+ function SpendLimitOutDTOFromJSONTyped(json, ignoreDiscriminator) {
5703
+ if (json == null) {
5704
+ return json;
5705
+ }
5706
+ return {
5707
+ "blocked": json["blocked"] == null ? void 0 : json["blocked"],
5708
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
5709
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
5710
+ "cycleEnd": new Date(json["cycleEnd"]),
5711
+ "cycleStart": new Date(json["cycleStart"]),
5712
+ "limitCents": json["limitCents"] == null ? void 0 : json["limitCents"],
5713
+ "mtdSpendCents": json["mtdSpendCents"] == null ? void 0 : json["mtdSpendCents"],
5714
+ "percentUsed": json["percentUsed"] == null ? void 0 : json["percentUsed"],
5715
+ "warning": json["warning"] == null ? void 0 : json["warning"]
5716
+ };
5717
+ }
5718
+ function SpendLimitOutDTOToJSON(json) {
5719
+ return SpendLimitOutDTOToJSONTyped(json, false);
5720
+ }
5721
+ function SpendLimitOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
5722
+ if (value == null) {
5723
+ return value;
5724
+ }
5725
+ return {
5726
+ "blocked": value["blocked"],
5727
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
5728
+ "createdAtTimestamp": value["createdAtTimestamp"],
5729
+ "cycleEnd": value["cycleEnd"].toISOString(),
5730
+ "cycleStart": value["cycleStart"].toISOString(),
5731
+ "limitCents": value["limitCents"],
5732
+ "mtdSpendCents": value["mtdSpendCents"],
5733
+ "percentUsed": value["percentUsed"],
5734
+ "warning": value["warning"]
5735
+ };
5736
+ }
5737
+
5738
+ // src/generated/models/SpendLimitUpdateInDTO.ts
5739
+ function instanceOfSpendLimitUpdateInDTO(value) {
5740
+ return true;
5741
+ }
5742
+ function SpendLimitUpdateInDTOFromJSON(json) {
5743
+ return SpendLimitUpdateInDTOFromJSONTyped(json, false);
5744
+ }
5745
+ function SpendLimitUpdateInDTOFromJSONTyped(json, ignoreDiscriminator) {
5746
+ if (json == null) {
5747
+ return json;
5748
+ }
5749
+ return {
5750
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
5751
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
5752
+ "limitCents": json["limitCents"] == null ? void 0 : json["limitCents"]
5753
+ };
5754
+ }
5755
+ function SpendLimitUpdateInDTOToJSON(json) {
5756
+ return SpendLimitUpdateInDTOToJSONTyped(json, false);
5757
+ }
5758
+ function SpendLimitUpdateInDTOToJSONTyped(value, ignoreDiscriminator = false) {
5759
+ if (value == null) {
5760
+ return value;
5761
+ }
5762
+ return {
5763
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
5764
+ "createdAtTimestamp": value["createdAtTimestamp"],
5765
+ "limitCents": value["limitCents"]
5766
+ };
5767
+ }
5768
+
5303
5769
  // src/generated/models/UsageLineItemOutDTO.ts
5304
5770
  function instanceOfUsageLineItemOutDTO(value) {
5305
5771
  if (!("featureType" in value) || value["featureType"] === void 0) return false;
@@ -5420,6 +5886,38 @@ var EnterpriseApi = class extends BaseAPI {
5420
5886
  const response = await this.getMyContractRaw(initOverrides);
5421
5887
  return await response.value();
5422
5888
  }
5889
+ /**
5890
+ * Creates request options for getMySpendLimit without sending the request
5891
+ */
5892
+ async getMySpendLimitRequestOpts() {
5893
+ const queryParameters = {};
5894
+ const headerParameters = {};
5895
+ if (this.configuration && this.configuration.accessToken) {
5896
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
5897
+ }
5898
+ let urlPath = `/api/v1/enterprise/me/spend-limit`;
5899
+ return {
5900
+ path: urlPath,
5901
+ method: "GET",
5902
+ headers: headerParameters,
5903
+ query: queryParameters
5904
+ };
5905
+ }
5906
+ /**
5907
+ * Get My Spend Limit
5908
+ */
5909
+ async getMySpendLimitRaw(initOverrides) {
5910
+ const requestOptions = await this.getMySpendLimitRequestOpts();
5911
+ const response = await this.request(requestOptions, initOverrides);
5912
+ return new JSONApiResponse(response, (jsonValue) => SpendLimitOutDTOFromJSON(jsonValue));
5913
+ }
5914
+ /**
5915
+ * Get My Spend Limit
5916
+ */
5917
+ async getMySpendLimit(initOverrides) {
5918
+ const response = await this.getMySpendLimitRaw(initOverrides);
5919
+ return await response.value();
5920
+ }
5423
5921
  /**
5424
5922
  * Creates request options for getMyTransactions without sending the request
5425
5923
  */
@@ -5499,6 +5997,46 @@ var EnterpriseApi = class extends BaseAPI {
5499
5997
  const response = await this.getMyUsageRaw(requestParameters, initOverrides);
5500
5998
  return await response.value();
5501
5999
  }
6000
+ /**
6001
+ * Creates request options for setMySpendLimit without sending the request
6002
+ */
6003
+ async setMySpendLimitRequestOpts(requestParameters) {
6004
+ if (requestParameters["spendLimitUpdateInDTO"] == null) {
6005
+ throw new RequiredError(
6006
+ "spendLimitUpdateInDTO",
6007
+ 'Required parameter "spendLimitUpdateInDTO" was null or undefined when calling setMySpendLimit().'
6008
+ );
6009
+ }
6010
+ const queryParameters = {};
6011
+ const headerParameters = {};
6012
+ headerParameters["Content-Type"] = "application/json";
6013
+ if (this.configuration && this.configuration.accessToken) {
6014
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
6015
+ }
6016
+ let urlPath = `/api/v1/enterprise/me/spend-limit`;
6017
+ return {
6018
+ path: urlPath,
6019
+ method: "PUT",
6020
+ headers: headerParameters,
6021
+ query: queryParameters,
6022
+ body: SpendLimitUpdateInDTOToJSON(requestParameters["spendLimitUpdateInDTO"])
6023
+ };
6024
+ }
6025
+ /**
6026
+ * Set My Spend Limit
6027
+ */
6028
+ async setMySpendLimitRaw(requestParameters, initOverrides) {
6029
+ const requestOptions = await this.setMySpendLimitRequestOpts(requestParameters);
6030
+ const response = await this.request(requestOptions, initOverrides);
6031
+ return new JSONApiResponse(response, (jsonValue) => SpendLimitOutDTOFromJSON(jsonValue));
6032
+ }
6033
+ /**
6034
+ * Set My Spend Limit
6035
+ */
6036
+ async setMySpendLimit(requestParameters, initOverrides) {
6037
+ const response = await this.setMySpendLimitRaw(requestParameters, initOverrides);
6038
+ return await response.value();
6039
+ }
5502
6040
  };
5503
6041
 
5504
6042
  // src/generated/models/CreditTransactionType.ts
@@ -10003,11 +10541,11 @@ function PeriodPresetModelToJSONTyped(value, ignoreDiscriminator) {
10003
10541
  return value;
10004
10542
  }
10005
10543
 
10006
- // src/generated/models/PurgeDocumentsWithEndUserId422Response.ts
10007
- function PurgeDocumentsWithEndUserId422ResponseFromJSON(json) {
10008
- return PurgeDocumentsWithEndUserId422ResponseFromJSONTyped(json, false);
10544
+ // src/generated/models/PurgeChatSession422Response.ts
10545
+ function PurgeChatSession422ResponseFromJSON(json) {
10546
+ return PurgeChatSession422ResponseFromJSONTyped(json, false);
10009
10547
  }
10010
- function PurgeDocumentsWithEndUserId422ResponseFromJSONTyped(json, ignoreDiscriminator) {
10548
+ function PurgeChatSession422ResponseFromJSONTyped(json, ignoreDiscriminator) {
10011
10549
  if (json == null) {
10012
10550
  return json;
10013
10551
  }
@@ -10022,10 +10560,10 @@ function PurgeDocumentsWithEndUserId422ResponseFromJSONTyped(json, ignoreDiscrim
10022
10560
  }
10023
10561
  return {};
10024
10562
  }
10025
- function PurgeDocumentsWithEndUserId422ResponseToJSON(json) {
10026
- return PurgeDocumentsWithEndUserId422ResponseToJSONTyped(json, false);
10563
+ function PurgeChatSession422ResponseToJSON(json) {
10564
+ return PurgeChatSession422ResponseToJSONTyped(json, false);
10027
10565
  }
10028
- function PurgeDocumentsWithEndUserId422ResponseToJSONTyped(value, ignoreDiscriminator = false) {
10566
+ function PurgeChatSession422ResponseToJSONTyped(value, ignoreDiscriminator = false) {
10029
10567
  if (value == null) {
10030
10568
  return value;
10031
10569
  }
@@ -10429,7 +10967,7 @@ async function asProcessingErrorIfFailedResult(error) {
10429
10967
  }
10430
10968
 
10431
10969
  // src/version.ts
10432
- var VERSION = "0.4.1";
10970
+ var VERSION = "0.5.0";
10433
10971
  // Annotate the CommonJS export names for ESM import in node:
10434
10972
  0 && (module.exports = {
10435
10973
  AggregateMetaDTOFromJSON,
@@ -10452,6 +10990,10 @@ var VERSION = "0.4.1";
10452
10990
  BlobApiResponse,
10453
10991
  COLLECTION_FORMATS,
10454
10992
  ChatApi,
10993
+ ChatMessageOutDTOFromJSON,
10994
+ ChatMessageOutDTOFromJSONTyped,
10995
+ ChatMessageOutDTOToJSON,
10996
+ ChatMessageOutDTOToJSONTyped,
10455
10997
  ChatQueryInDTOFromJSON,
10456
10998
  ChatQueryInDTOFromJSONTyped,
10457
10999
  ChatQueryInDTOToJSON,
@@ -10460,6 +11002,18 @@ var VERSION = "0.4.1";
10460
11002
  ChatQueryOutDTOFromJSONTyped,
10461
11003
  ChatQueryOutDTOToJSON,
10462
11004
  ChatQueryOutDTOToJSONTyped,
11005
+ ChatSessionListOutDTOFromJSON,
11006
+ ChatSessionListOutDTOFromJSONTyped,
11007
+ ChatSessionListOutDTOToJSON,
11008
+ ChatSessionListOutDTOToJSONTyped,
11009
+ ChatSessionOutDTOFromJSON,
11010
+ ChatSessionOutDTOFromJSONTyped,
11011
+ ChatSessionOutDTOToJSON,
11012
+ ChatSessionOutDTOToJSONTyped,
11013
+ ChatTranscriptOutDTOFromJSON,
11014
+ ChatTranscriptOutDTOFromJSONTyped,
11015
+ ChatTranscriptOutDTOToJSON,
11016
+ ChatTranscriptOutDTOToJSONTyped,
10463
11017
  CheckoutOutDTOFromJSON,
10464
11018
  CheckoutOutDTOFromJSONTyped,
10465
11019
  CheckoutOutDTOToJSON,
@@ -10809,10 +11363,10 @@ var VERSION = "0.4.1";
10809
11363
  PlanOutDTOFromJSONTyped,
10810
11364
  PlanOutDTOToJSON,
10811
11365
  PlanOutDTOToJSONTyped,
10812
- PurgeDocumentsWithEndUserId422ResponseFromJSON,
10813
- PurgeDocumentsWithEndUserId422ResponseFromJSONTyped,
10814
- PurgeDocumentsWithEndUserId422ResponseToJSON,
10815
- PurgeDocumentsWithEndUserId422ResponseToJSONTyped,
11366
+ PurgeChatSession422ResponseFromJSON,
11367
+ PurgeChatSession422ResponseFromJSONTyped,
11368
+ PurgeChatSession422ResponseToJSON,
11369
+ PurgeChatSession422ResponseToJSONTyped,
10816
11370
  PurgeReasonModel,
10817
11371
  PurgeReasonModelFromJSON,
10818
11372
  PurgeReasonModelFromJSONTyped,
@@ -10896,6 +11450,14 @@ var VERSION = "0.4.1";
10896
11450
  SortMethodModelFromJSONTyped,
10897
11451
  SortMethodModelToJSON,
10898
11452
  SortMethodModelToJSONTyped,
11453
+ SpendLimitOutDTOFromJSON,
11454
+ SpendLimitOutDTOFromJSONTyped,
11455
+ SpendLimitOutDTOToJSON,
11456
+ SpendLimitOutDTOToJSONTyped,
11457
+ SpendLimitUpdateInDTOFromJSON,
11458
+ SpendLimitUpdateInDTOFromJSONTyped,
11459
+ SpendLimitUpdateInDTOToJSON,
11460
+ SpendLimitUpdateInDTOToJSONTyped,
10899
11461
  StorageUsageOutDTOFromJSON,
10900
11462
  StorageUsageOutDTOFromJSONTyped,
10901
11463
  StorageUsageOutDTOToJSON,
@@ -11047,8 +11609,12 @@ var VERSION = "0.4.1";
11047
11609
  instanceOfAggregateMetaDTO,
11048
11610
  instanceOfAggregateMetricDTO,
11049
11611
  instanceOfAggregateRowDTO,
11612
+ instanceOfChatMessageOutDTO,
11050
11613
  instanceOfChatQueryInDTO,
11051
11614
  instanceOfChatQueryOutDTO,
11615
+ instanceOfChatSessionListOutDTO,
11616
+ instanceOfChatSessionOutDTO,
11617
+ instanceOfChatTranscriptOutDTO,
11052
11618
  instanceOfCheckoutOutDTO,
11053
11619
  instanceOfColumnDefinitionDTO,
11054
11620
  instanceOfComparisonSummaryModel,
@@ -11145,6 +11711,8 @@ var VERSION = "0.4.1";
11145
11711
  instanceOfSessionTokenInDTO,
11146
11712
  instanceOfSessionTokenOutDTO,
11147
11713
  instanceOfSortMethodModel,
11714
+ instanceOfSpendLimitOutDTO,
11715
+ instanceOfSpendLimitUpdateInDTO,
11148
11716
  instanceOfStorageUsageOutDTO,
11149
11717
  instanceOfStructuredFilterDTO,
11150
11718
  instanceOfSubscribeInDTO,