@tungoai/sdk 0.3.0 → 1.0.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/CHANGELOG.md CHANGED
@@ -9,6 +9,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [1.0.0] - 2026-11-27
13
+
14
+ First stable release, generated from the platform contract of backend 230d6b82 (the API in production). From 1.0.0 on, minor and patch releases are backwards compatible: the API and the SDKs grow only by additions, a field or method that is to go away is first marked deprecated and kept for at least six months, and breaking changes come only in a new major version. The breaking changes against 0.3 are listed below, each with what to change; most code that only calls methods and reads results needs no change.
15
+
16
+ ### Breaking
17
+
18
+ - `ChatAttachment` (the `attachments` of `chat.create`, `chat.answer` and `chat.count_tokens`) is now a union of two shapes: `ChatAttachmentData` (a file in base64: `name`, `data`, optional `media_type`, the 0.3 shape) and `ChatAttachmentUpload` (`upload_id` of an archive uploaded in parts with `chat.create_upload` and `chat.put_upload_part`). The JSON sent for a base64 file is unchanged; only the type used to build it changed (see Migration).
19
+ - `AutomationTriggerHook.hook_id` can be null: the hook of the scenario was deleted, and the scenario is not started by events until it gets another hook (`automations.put_scenario`). The API already answered null in this case; the field is now nullable in every SDK.
20
+ - Models that no SDK method sends or returns are no longer generated: the cabinet's API key management models (`ApiKeyCreate`, `ApiKeyCreated`, `ApiKeyDetails`, `ApiKeyPatch`, `ApiKeyPerson`, `ApiKeyRoll`, `ApiKeyRolled`, `ApiKeyTransfer`, `ApiKeyUpdated`, `ApiKeyWarning` and their enums) and billing models (`CardSession`, `CardSessionState`, `PayForm`, `PaymentMethod`, `PlatformPurchase`, `PlatformPurchaseInput`, `PlatformSettingsInput`, `EpayReturnLinks` and their enums). They describe operations that need a cabinet session, which an API key cannot call; they changed with the cabinet (`CardSession` and `PayForm` gained a redirect form with nullable `script_url` and `payment_object` in this contract) and would have broken the SDKs for nothing. The key in use is described by `api_keys.get_current` (`ApiKey`), as before.
21
+ - New union variants: `ChatEvent` gains `file` (`ChatEventFile`) and `memory` (`ChatEventMemory`); `ChatHistoryBlock` gains `file` (`ChatHistoryFile`) and `memory` (`ChatHistoryMemory`). An exhaustive `switch`/`when`/`match` over these unions needs the new cases (or a default branch).
22
+ - Response models gained required fields: `ChatTurnResult.files`, `ChatAssistantMessage.thinking_parts`, `ChatDialog.memory` and `ChatDialogSummary.memory`, `PlatformAutoReload.monthly_count_max`, the archive limits of `PlatformLimits.files` (`archive_bytes`, `archive_files`, `archives_per_message`, `upload_part_bytes`), `UsageRate.long_context` and `UsageRate.web_search_per_1k_tiyn`. Decoding is unaffected; code that constructs these models itself (test fakes) must pass the new fields.
23
+
24
+ ### Migration
25
+
26
+ - Attachments: object literals `{ name, data }` still type-check. Code that reads an attachment narrows it first: `'upload_id' in a ? a.upload_id : a.name`. `trigger.hook_id` is `string | null`.
27
+ - `hook_id` of a hook trigger: handle null (no hook) where the scenario's trigger is read.
28
+ - Removed cabinet models: delete the imports; there is nothing to replace them with in an SDK, because their operations need a cabinet session.
29
+ - Exhaustive matches over `ChatEvent` and `ChatHistoryBlock`: add `file` and `memory`, or a default branch. A default branch also keeps code compiling when later minor releases add variants, which they may do.
30
+
31
+ ### Added
32
+
33
+ - Chat archives: `chat.create_upload` (`POST /v1/companies/{co}/chat/uploads`, `ChatUploadCreate`), `chat.put_upload_part` (`PUT …/chat/uploads/{upload}/parts/{n}`, raw bytes) and `chat.delete_upload` upload a .zip, .rar or .7z in parts (`ChatUpload`, `ChatUploadPart`); the finished upload goes into a question as `ChatAttachmentUpload`. Limits: `PlatformLimits.files.archive_bytes`, `archive_files`, `archives_per_message`, `upload_part_bytes`.
34
+ - Chat files made by the AI (Excel, Word, PDF, CSV): `chat.list_files` (`GET /v1/companies/{co}/chat/files`, `ChatFileList`, `ChatFileItem`), `ChatTurnResult.files` (`ChatTurnFile`), the `file` stream event (`ChatEventFile`) and the `file` history block (`ChatHistoryFile`).
35
+ - Chat memory: `memory` on `ChatMessageRequest` (false: a conversation without memory), `ChatDialog` and `ChatDialogSummary`; the `memory` stream event (`ChatEventMemory`) and history block (`ChatHistoryMemory`).
36
+ - Chat thinking: `chat.translate_thinking` (`POST …/chat/{id}/thinking/{tid}/translate`, `ChatThinkingTranslation`); `ChatEventThinking.original` and `translate_id`; `ChatAssistantMessage.thinking_parts` (`ChatThinkingPart`). `ChatEventStatus` gains `chars` and the codes `checking_norm` and `writing`.
37
+ - Chat: `ChatUserMessage.onec_object` (`ChatOnecObject`), the 1C object a question was asked from.
38
+ - `verification` (public, no API key): `verification.get` (`GET /v1/public/verify/{code}`, `PublicVerification`), `verification.check` (`POST /v1/public/verify/{code}/check`, compares a file's SHA-256 with the signed document, `VerifyCheck`), `verification.verify_qr` (`POST /v1/public/verify/qr`, `VerifyQrResult`) and `verification.list_keys` (`GET /v1/public/verify-keys`, the JWKS of the QR signature, `VerifyKeys`).
39
+ - `releases.list` (public, `GET /v1/public/downloads`, `Downloads`): the current releases of the 1C extension and Tungo Connector to download. (The resource is named `releases`, not `downloads`, so that it never clashes with the `Downloads` model.)
40
+ - Platform: `PlatformAutoReload.monthly_count_max`; `UsageRate.long_context` (`UsageRateLongContext`) and `UsageRate.web_search_per_1k_tiyn`; new audit actions; `OneCGateway` value `module`.
41
+
42
+ ### Known limitations
43
+
44
+ - Downloads of files (`GET …/chat/{id}/files/{file}`, the batch and proposal exports, and the redirects `GET /v1/public/downloads/connector` and `GET /v1/public/downloads/onec-extension`) are not in this release: the SDKs cannot return a file body yet.
45
+ - A chat turn replayed by `Idempotency-Key` as a stream does not rebuild `file` events; the files of the turn are in `ChatTurnResult.files` of the non-streaming answer and in `chat.list_files`.
46
+
12
47
  ## [0.3.0] - 2026-11-13
13
48
 
14
49
  Generated from the platform contract of backend 44066d62. It contains breaking type changes compared with 0.2.0.
@@ -87,7 +122,8 @@ First production-ready release. It contains breaking changes compared with 0.1.0
87
122
 
88
123
  Initial preview. Not suitable for production use.
89
124
 
90
- [Unreleased]: https://github.com/TungoAI/tungo-sdk-typescript/compare/v0.3.0...HEAD
125
+ [Unreleased]: https://github.com/TungoAI/tungo-sdk-typescript/compare/v1.0.0...HEAD
126
+ [1.0.0]: https://github.com/TungoAI/tungo-sdk-typescript/compare/v0.3.0...v1.0.0
91
127
  [0.3.0]: https://github.com/TungoAI/tungo-sdk-typescript/compare/v0.2.0...v0.3.0
92
128
  [0.2.0]: https://github.com/TungoAI/tungo-sdk-typescript/compare/v0.1.0...v0.2.0
93
129
  [0.1.0]: https://github.com/TungoAI/tungo-sdk-typescript/releases/tag/v0.1.0
package/README.kk.md CHANGED
@@ -281,7 +281,7 @@ console.log(isValidBinIin('990140000017')); // true
281
281
 
282
282
  ## API анықтамалығы
283
283
 
284
- Tungo платформасы API-інің келісімшартынан жасалған: **ресурстар — 13, әдістер — 90, вебхук оқиғаларының түрлері — 22**.
284
+ Tungo платформасы API-інің келісімшартынан жасалған: **ресурстар — 15, әдістер — 100, вебхук оқиғаларының түрлері — 22**.
285
285
 
286
286
  | Ресурс | Сипаттама | Әдістер |
287
287
  | --- | --- | --- |
@@ -290,7 +290,7 @@ Tungo платформасы API-інің келісімшартынан жас
290
290
  | `platform` | Платформа балансы, қозғалыстар кітабы, шығын есептері, лимиттер, аудит және модельдер тарифтері | `listUsageRates` · `getAccount` · `getAudit` · `getAuditAll` · `getLedger` · `getLedgerAll` · `listLimits` · `listRequests` · `listRequestsAll` · `getUsage` |
291
291
  | `apiKeys` | Ағымдағы API кілті туралы мәлімет және оның шығын статистикасы | `getCurrent` · `getCurrentUsage` · `getUsage` |
292
292
  | `webhooks` | Ұйымның шығыс вебхуктары (Svix): мекенжайлар, оқиғалар каталогы, жеткізулер және қолтаңбаны тексеру | `listEndpoints` · `listEndpointsAll` · `createEndpoint` · `getEndpoint` · `updateEndpoint` · `deleteEndpoint` · `listEndpointAttempts` · `listEndpointAttemptsAll` · `rotateEndpointSecret` · `testEndpoint` · `listEventTypes` · `listMessages` · `listMessagesAll` · `listMessageAttempts` · `listMessageAttemptsAll` · `resendMessage` · `getUsage` |
293
- | `chat` | ЖИ-бухгалтермен диалогтар: сұрақтар, ағынды чат (SSE), токендерді санау және тарих | `list` · `listAll` · `create` · `stream` · `countTokens` · `listMentions` · `getRatingOptions` · `listSuggestions` · `get` · `update` · `delete` · `answer` · `answerStream` · `listEvents` · `rateMessage` · `deleteMessageRating` · `rate` · `dismissRating` · `stop` |
293
+ | `chat` | ЖИ-бухгалтермен диалогтар: сұрақтар, ағынды чат (SSE), токендерді санау және тарих | `list` · `listAll` · `create` · `stream` · `countTokens` · `listFiles` · `listFilesAll` · `listMentions` · `getRatingOptions` · `listSuggestions` · `createUpload` · `deleteUpload` · `putUploadPart` · `get` · `update` · `delete` · `answer` · `answerStream` · `listEvents` · `rateMessage` · `deleteMessageRating` · `rate` · `dismissRating` · `stop` · `translateThinking` |
294
294
  | `proposals` | ЖИ-бухгалтер ұсынған құжаттар: қарау, 1С-ке жазуды мақұлдау және қабылдамау | `list` · `listAll` · `approveBatch` · `get` · `approve` · `reject` · `requestApproval` |
295
295
  | `feed` | Компанияның оқиғалар мен ұсыныстар таспасы (беттер және тікелей SSE ағыны) | `get` · `getAll` · `listEvents` |
296
296
  | `batches` | Банк үзінді көшірмелерін, кіріс ЭШФ-ларды және DirectBank-ті өңдеу бумалары | `list` · `listAll` · `createBankStatement` · `createEsfPurchases` · `get` · `listEvents` · `stop` · `getSummary` · `listStatements` · `listStatementsAll` · `pollDirectbank` |
@@ -298,6 +298,8 @@ Tungo платформасы API-інің келісімшартынан жас
298
298
  | `forms` | Салық нысандары (СЕН 100.00 және басқалары): құрастыру, ИСНА тексеруі және деректердегі алшақтықтар | `list` · `build` · `listDataGaps` · `getIsna` · `listNotes` |
299
299
  | `onec` | Компанияның 1С базасына қосылу күйі | `getStatus` |
300
300
  | `automations` | Компания автоматтандырулары: кіріс хуктар, сценарийлер, қадамдар тізбегі, іске қосулар және ЖИ дербестігінің деңгейі | `postHook` · `listHooks` · `createHook` · `getHook` · `updateHook` · `deleteHook` · `rotateHook` · `testHook` · `listRuns` · `listRunsAll` · `getRun` · `cancelRun` · `retryRun` · `listScenarios` · `createScenario` · `getScenario` · `putScenario` · `updateScenario` · `deleteScenario` · `runScenario` · `getState` · `putState` · `getAutonomy` · `putAutonomy` |
301
+ | `verification` | Tungo құжаттарының электрондық қолтаңбасын ашық тексеру: код, файл, QR блогы бойынша және қолтаңба кілттері (API кілтісіз) | `listKeys` · `verifyQr` · `get` · `check` |
302
+ | `releases` | Ашық жүктеулер тізімі: 1С кеңейтімі және Tungo Connector (API кілтісіз) | `list` |
301
303
 
302
304
  ## Басқа SDK-лар
303
305
 
@@ -318,7 +320,7 @@ Tungo платформасы API-інің келісімшартынан жас
318
320
 
319
321
  ## Нұсқалар және қолдау
320
322
 
321
- Кітапхана [семантикалық нұсқалауды](https://semver.org/) ұстанады. Жоғарғы нұсқа 0 болып тұрғанда аралық шығарылымда үйлесімсіз өзгерістер болуы мүмкін; олар әрдайым [өзгерістер тарихында](https://github.com/TungoAI/tungo-sdk-typescript/blob/main/CHANGELOG.md) келтіріледі. Бұл README 0.3.0 нұсқасын сипаттайды.
323
+ Кітапхана [семантикалық нұсқалауды](https://semver.org/) ұстанады. Аралық және түзету шығарылымдары үйлесімді: API толықтыру арқылы өседі, ал алынатын өріс не әдіс алдымен ескірген деп белгіленіп, кемінде алты ай сақталады. Үйлесімсіз өзгерістер тек жаңа жоғарғы нұсқада болады және ауысу нұсқауларымен бірге [өзгерістер тарихында](https://github.com/TungoAI/tungo-sdk-typescript/blob/main/CHANGELOG.md) келтіріледі. Бұл README 1.0.0 нұсқасын сипаттайды.
322
324
 
323
325
  Код генератормен жасалады: мәселелер мен ұсыныстар туралы жасалған файлдарға түзету жібермей, [өтініштерге](https://github.com/TungoAI/tungo-sdk-typescript/issues) жазыңыз. Осалдық туралы [қауіпсіздік саясаты](https://github.com/TungoAI/tungo-sdk-typescript/blob/main/SECURITY.md) бойынша хабарлаңыз.
324
326
 
package/README.md CHANGED
@@ -301,7 +301,7 @@ The package has two builds selected by the `exports` map: ES modules for `import
301
301
 
302
302
  ## API reference
303
303
 
304
- Generated from the Tungo Platform API contract: **13 resources, 90 methods, 22 webhook event types**.
304
+ Generated from the Tungo Platform API contract: **15 resources, 100 methods, 22 webhook event types**.
305
305
 
306
306
  | Resource | Description | Methods |
307
307
  | --- | --- | --- |
@@ -310,7 +310,7 @@ Generated from the Tungo Platform API contract: **13 resources, 90 methods, 22 w
310
310
  | `platform` | Platform balance, ledger, usage reports, limits, audit log and model rates | `listUsageRates` · `getAccount` · `getAudit` · `getAuditAll` · `getLedger` · `getLedgerAll` · `listLimits` · `listRequests` · `listRequestsAll` · `getUsage` |
311
311
  | `apiKeys` | The current API key and its usage statistics | `getCurrent` · `getCurrentUsage` · `getUsage` |
312
312
  | `webhooks` | Outgoing webhooks of an organisation (Svix): endpoints, event catalogue, deliveries and signature check | `listEndpoints` · `listEndpointsAll` · `createEndpoint` · `getEndpoint` · `updateEndpoint` · `deleteEndpoint` · `listEndpointAttempts` · `listEndpointAttemptsAll` · `rotateEndpointSecret` · `testEndpoint` · `listEventTypes` · `listMessages` · `listMessagesAll` · `listMessageAttempts` · `listMessageAttemptsAll` · `resendMessage` · `getUsage` |
313
- | `chat` | Conversations with the AI accountant: questions, streaming chat (SSE), token counting and history | `list` · `listAll` · `create` · `stream` · `countTokens` · `listMentions` · `getRatingOptions` · `listSuggestions` · `get` · `update` · `delete` · `answer` · `answerStream` · `listEvents` · `rateMessage` · `deleteMessageRating` · `rate` · `dismissRating` · `stop` |
313
+ | `chat` | Conversations with the AI accountant: questions, streaming chat (SSE), token counting and history | `list` · `listAll` · `create` · `stream` · `countTokens` · `listFiles` · `listFilesAll` · `listMentions` · `getRatingOptions` · `listSuggestions` · `createUpload` · `deleteUpload` · `putUploadPart` · `get` · `update` · `delete` · `answer` · `answerStream` · `listEvents` · `rateMessage` · `deleteMessageRating` · `rate` · `dismissRating` · `stop` · `translateThinking` |
314
314
  | `proposals` | Documents proposed by the AI accountant: review, approval for posting to 1C, and rejection | `list` · `listAll` · `approveBatch` · `get` · `approve` · `reject` · `requestApproval` |
315
315
  | `feed` | The company's feed of events and proposals (pages and a live SSE stream) | `get` · `getAll` · `listEvents` |
316
316
  | `batches` | Processing batches for bank statements, incoming e-invoices and DirectBank | `list` · `listAll` · `createBankStatement` · `createEsfPurchases` · `get` · `listEvents` · `stop` · `getSummary` · `listStatements` · `listStatementsAll` · `pollDirectbank` |
@@ -318,6 +318,8 @@ Generated from the Tungo Platform API contract: **13 resources, 90 methods, 22 w
318
318
  | `forms` | Tax forms (FNO 100.00 and others): building, ISNA checks and data gaps | `list` · `build` · `listDataGaps` · `getIsna` · `listNotes` |
319
319
  | `onec` | Status of the company's connection to its 1C database | `getStatus` |
320
320
  | `automations` | Company automations: incoming hooks, scenarios, step chains, runs and the AI autonomy level | `postHook` · `listHooks` · `createHook` · `getHook` · `updateHook` · `deleteHook` · `rotateHook` · `testHook` · `listRuns` · `listRunsAll` · `getRun` · `cancelRun` · `retryRun` · `listScenarios` · `createScenario` · `getScenario` · `putScenario` · `updateScenario` · `deleteScenario` · `runScenario` · `getState` · `putState` · `getAutonomy` · `putAutonomy` |
321
+ | `verification` | Public verification of the electronic signature of Tungo documents: by code, by file, by QR block, and the signing keys (no API key needed) | `listKeys` · `verifyQr` · `get` · `check` |
322
+ | `releases` | Public list of downloads: the 1C extension and Tungo Connector (no API key needed) | `list` |
321
323
 
322
324
  ## Other SDKs
323
325
 
@@ -338,7 +340,7 @@ The same API is available in ten languages. All SDKs are generated from one cont
338
340
 
339
341
  ## Versioning and support
340
342
 
341
- This library follows [Semantic Versioning](https://semver.org/). While the major version is 0, a minor release may contain breaking changes; they are always listed in the [changelog](https://github.com/TungoAI/tungo-sdk-typescript/blob/main/CHANGELOG.md). This README describes version 0.3.0.
343
+ This library follows [Semantic Versioning](https://semver.org/). Minor and patch releases are backwards compatible: the API grows by additions, and a field or method that is to go away is first marked deprecated and kept for at least six months. Breaking changes come only in a new major version and are listed, with migration notes, in the [changelog](https://github.com/TungoAI/tungo-sdk-typescript/blob/main/CHANGELOG.md). This README describes version 1.0.0.
342
344
 
343
345
  The code is generated: please report problems and ideas in the [issue tracker](https://github.com/TungoAI/tungo-sdk-typescript/issues) rather than opening pull requests against generated files. To report a vulnerability, follow the [security policy](https://github.com/TungoAI/tungo-sdk-typescript/blob/main/SECURITY.md).
344
346
 
package/README.ru.md CHANGED
@@ -281,7 +281,7 @@ console.log(isValidBinIin('990140000017')); // true
281
281
 
282
282
  ## Справочник API
283
283
 
284
- Создано из контракта API платформы Tungo: **ресурсов — 13, методов — 90, типов событий вебхуков — 22**.
284
+ Создано из контракта API платформы Tungo: **ресурсов — 15, методов — 100, типов событий вебхуков — 22**.
285
285
 
286
286
  | Ресурс | Описание | Методы |
287
287
  | --- | --- | --- |
@@ -290,7 +290,7 @@ console.log(isValidBinIin('990140000017')); // true
290
290
  | `platform` | Баланс платформы, книга движений, отчёты о расходе, лимиты, аудит и тарифы моделей | `listUsageRates` · `getAccount` · `getAudit` · `getAuditAll` · `getLedger` · `getLedgerAll` · `listLimits` · `listRequests` · `listRequestsAll` · `getUsage` |
291
291
  | `apiKeys` | Сведения о текущем ключе API и статистика его расхода | `getCurrent` · `getCurrentUsage` · `getUsage` |
292
292
  | `webhooks` | Исходящие вебхуки организации (Svix): адреса, каталог событий, доставки и проверка подписи | `listEndpoints` · `listEndpointsAll` · `createEndpoint` · `getEndpoint` · `updateEndpoint` · `deleteEndpoint` · `listEndpointAttempts` · `listEndpointAttemptsAll` · `rotateEndpointSecret` · `testEndpoint` · `listEventTypes` · `listMessages` · `listMessagesAll` · `listMessageAttempts` · `listMessageAttemptsAll` · `resendMessage` · `getUsage` |
293
- | `chat` | Диалоги с ИИ-бухгалтером: вопросы, потоковый чат (SSE), подсчёт токенов и история | `list` · `listAll` · `create` · `stream` · `countTokens` · `listMentions` · `getRatingOptions` · `listSuggestions` · `get` · `update` · `delete` · `answer` · `answerStream` · `listEvents` · `rateMessage` · `deleteMessageRating` · `rate` · `dismissRating` · `stop` |
293
+ | `chat` | Диалоги с ИИ-бухгалтером: вопросы, потоковый чат (SSE), подсчёт токенов и история | `list` · `listAll` · `create` · `stream` · `countTokens` · `listFiles` · `listFilesAll` · `listMentions` · `getRatingOptions` · `listSuggestions` · `createUpload` · `deleteUpload` · `putUploadPart` · `get` · `update` · `delete` · `answer` · `answerStream` · `listEvents` · `rateMessage` · `deleteMessageRating` · `rate` · `dismissRating` · `stop` · `translateThinking` |
294
294
  | `proposals` | Предложения документов ИИ-бухгалтера: просмотр, одобрение записи в 1С и отклонение | `list` · `listAll` · `approveBatch` · `get` · `approve` · `reject` · `requestApproval` |
295
295
  | `feed` | Лента событий и предложений компании (страницы и живой поток SSE) | `get` · `getAll` · `listEvents` |
296
296
  | `batches` | Пачки обработки банковских выписок, входящих ЭСФ и DirectBank | `list` · `listAll` · `createBankStatement` · `createEsfPurchases` · `get` · `listEvents` · `stop` · `getSummary` · `listStatements` · `listStatementsAll` · `pollDirectbank` |
@@ -298,6 +298,8 @@ console.log(isValidBinIin('990140000017')); // true
298
298
  | `forms` | Налоговые формы (ФНО 100.00 и др.): сборка, проверка ИСНА и разрывы данных | `list` · `build` · `listDataGaps` · `getIsna` · `listNotes` |
299
299
  | `onec` | Состояние подключения компании к базе 1С | `getStatus` |
300
300
  | `automations` | Автоматизации компании: входящие хуки, сценарии, цепочки шагов, запуски и уровень автономности ИИ | `postHook` · `listHooks` · `createHook` · `getHook` · `updateHook` · `deleteHook` · `rotateHook` · `testHook` · `listRuns` · `listRunsAll` · `getRun` · `cancelRun` · `retryRun` · `listScenarios` · `createScenario` · `getScenario` · `putScenario` · `updateScenario` · `deleteScenario` · `runScenario` · `getState` · `putState` · `getAutonomy` · `putAutonomy` |
301
+ | `verification` | Публичная проверка электронной подписи документов Tungo: по коду, по файлу, по блоку QR и ключи подписи (без ключа API) | `listKeys` · `verifyQr` · `get` · `check` |
302
+ | `releases` | Публичный список загрузок: расширение 1С и Tungo Connector (без ключа API) | `list` |
301
303
 
302
304
  ## Другие SDK
303
305
 
@@ -318,7 +320,7 @@ console.log(isValidBinIin('990140000017')); // true
318
320
 
319
321
  ## Версии и поддержка
320
322
 
321
- Библиотека следует [семантическому версионированию](https://semver.org/lang/ru/). Пока старшая версия равна 0, промежуточный выпуск может содержать несовместимые изменения; они всегда перечислены в [истории изменений](https://github.com/TungoAI/tungo-sdk-typescript/blob/main/CHANGELOG.md). Этот README описывает версию 0.3.0.
323
+ Библиотека следует [семантическому версионированию](https://semver.org/lang/ru/). Промежуточные и исправляющие выпуски совместимы: API растёт добавлениями, а поле или метод, которые уйдут, сначала помечаются устаревшими и живут не меньше шести месяцев. Несовместимые изменения бывают только в новой старшей версии и перечислены, с указаниями по переходу, в [истории изменений](https://github.com/TungoAI/tungo-sdk-typescript/blob/main/CHANGELOG.md). Этот README описывает версию 1.0.0.
322
324
 
323
325
  Код создаётся генератором: пишите о проблемах и идеях в [обращения](https://github.com/TungoAI/tungo-sdk-typescript/issues), а не присылайте правки к созданным файлам. Об уязвимости сообщайте по [политике безопасности](https://github.com/TungoAI/tungo-sdk-typescript/blob/main/SECURITY.md).
324
326
 
@@ -54,6 +54,10 @@ export declare class Tungo {
54
54
  readonly onec: R.OnecResource;
55
55
  /** Автоматизации компании: входящие хуки, сценарии, цепочки шагов, запуски и уровень автономности ИИ */
56
56
  readonly automations: R.AutomationsResource;
57
+ /** Публичная проверка электронной подписи документов Tungo: по коду, по файлу, по блоку QR и ключи подписи (без ключа API) */
58
+ readonly verification: R.VerificationResource;
59
+ /** Публичный список загрузок: расширение 1С и Tungo Connector (без ключа API) */
60
+ readonly releases: R.ReleasesResource;
57
61
  constructor(options?: ClientOptions);
58
62
  /** Base URL the client talks to. */
59
63
  get baseUrl(): string;
@@ -46,6 +46,10 @@ class Tungo {
46
46
  onec;
47
47
  /** Автоматизации компании: входящие хуки, сценарии, цепочки шагов, запуски и уровень автономности ИИ */
48
48
  automations;
49
+ /** Публичная проверка электронной подписи документов Tungo: по коду, по файлу, по блоку QR и ключи подписи (без ключа API) */
50
+ verification;
51
+ /** Публичный список загрузок: расширение 1С и Tungo Connector (без ключа API) */
52
+ releases;
49
53
  #client;
50
54
  constructor(options = {}) {
51
55
  const client = new core_js_1.APIClient(options);
@@ -63,6 +67,8 @@ class Tungo {
63
67
  this.forms = new R.FormsResource(client);
64
68
  this.onec = new R.OnecResource(client);
65
69
  this.automations = new R.AutomationsResource(client);
70
+ this.verification = new R.VerificationResource(client);
71
+ this.releases = new R.ReleasesResource(client);
66
72
  }
67
73
  /** Base URL the client talks to. */
68
74
  get baseUrl() {
@@ -117,6 +117,19 @@ export interface ChatListParams {
117
117
  /** Сколько на странице: 1–100, по умолчанию 50 */
118
118
  limit?: number | undefined;
119
119
  }
120
+ /** Query parameters of `chat.listFiles`. */
121
+ export interface ChatListFilesParams {
122
+ /** next_cursor прошлой страницы; без него — самые новые файлы. Фильтры — те же, что у первой страницы */
123
+ cursor?: string | undefined;
124
+ /** Только из этого разговора */
125
+ dialog_id?: string | undefined;
126
+ /** Только этого формата: xlsx, docx, pdf или csv */
127
+ format?: T.ListCompanyChatFilesFormat | undefined;
128
+ /** Сколько на странице: 1–200, по умолчанию 50 */
129
+ limit?: number | undefined;
130
+ /** Подстрока имени файла, без учёта регистра */
131
+ q?: string | undefined;
132
+ }
120
133
  /** Query parameters of `chat.listMentions`. */
121
134
  export interface ChatListMentionsParams {
122
135
  /** Сколько на каждый вид: 1–20, по умолчанию 8 */
@@ -561,6 +574,20 @@ export declare class ChatResource {
561
574
  * Required permission: `chat.use`.
562
575
  */
563
576
  countTokens(co: string, body: T.ChatTokenCountRequest, options?: RequestOptions): APIPromise<T.ChatTokenCount>;
577
+ /**
578
+ * Файлы от ИИ в своих разговорах, новые сверху
579
+ *
580
+ * Returns one page; iterate the result with `for await` to walk every item of every page.
581
+ *
582
+ * `GET /v1/companies/{co}/chat/files`
583
+ *
584
+ * Required permission: `chat.use`.
585
+ */
586
+ listFiles(co: string, query?: ChatListFilesParams, options?: RequestOptions): PagePromise<T.ChatFileItem, T.ChatFileList>;
587
+ /**
588
+ * Every item of `listFiles`, across all pages. Pages are fetched lazily; leaving the loop stops fetching.
589
+ */
590
+ listFilesAll(co: string, query?: ChatListFilesParams, options?: RequestOptions): AsyncGenerator<T.ChatFileItem, void, undefined>;
564
591
  /**
565
592
  * Что можно упомянуть через «@»
566
593
  *
@@ -585,6 +612,30 @@ export declare class ChatResource {
585
612
  * Required permission: `chat.use`.
586
613
  */
587
614
  listSuggestions(co: string, query?: ChatListSuggestionsParams, options?: RequestOptions): APIPromise<T.ChatSuggestions>;
615
+ /**
616
+ * Начать загрузку архива к сообщению
617
+ *
618
+ * `POST /v1/companies/{co}/chat/uploads`
619
+ *
620
+ * Required permission: `chat.use`.
621
+ */
622
+ createUpload(co: string, body: T.ChatUploadCreate, options?: RequestOptions): APIPromise<T.ChatUpload>;
623
+ /**
624
+ * Отменить загрузку архива
625
+ *
626
+ * `DELETE /v1/companies/{co}/chat/uploads/{upload}`
627
+ *
628
+ * Required permission: `chat.use`.
629
+ */
630
+ deleteUpload(co: string, upload: string, options?: RequestOptions): APIPromise<void>;
631
+ /**
632
+ * Часть архива
633
+ *
634
+ * `PUT /v1/companies/{co}/chat/uploads/{upload}/parts/{n}`
635
+ *
636
+ * Required permission: `chat.use`.
637
+ */
638
+ putUploadPart(co: string, upload: string, n: string, options?: RequestOptions): APIPromise<T.ChatUploadPart>;
588
639
  /**
589
640
  * Разговор целиком
590
641
  *
@@ -679,6 +730,14 @@ export declare class ChatResource {
679
730
  * Required permission: `chat.use`.
680
731
  */
681
732
  stop(co: string, id: string, options?: RequestOptions): APIPromise<T.ChatStopResult>;
733
+ /**
734
+ * Перевести размышление на русский
735
+ *
736
+ * `POST /v1/companies/{co}/chat/{id}/thinking/{tid}/translate`
737
+ *
738
+ * Required permission: `chat.use`.
739
+ */
740
+ translateThinking(co: string, id: string, tid: string, options?: RequestOptions): APIPromise<T.ChatThinkingTranslation>;
682
741
  }
683
742
  /** Предложения документов ИИ-бухгалтера: просмотр, одобрение записи в 1С и отклонение */
684
743
  export declare class ProposalsResource {
@@ -1147,3 +1206,43 @@ export declare class AutomationsResource {
1147
1206
  */
1148
1207
  putAutonomy(co: string, body: T.CompanyAutonomyInput, options?: RequestOptions): APIPromise<T.CompanyAutonomy>;
1149
1208
  }
1209
+ /** Публичная проверка электронной подписи документов Tungo: по коду, по файлу, по блоку QR и ключи подписи (без ключа API) */
1210
+ export declare class VerificationResource {
1211
+ #private;
1212
+ constructor(client: APIClient);
1213
+ /**
1214
+ * Ключи подписи QR (JWKS)
1215
+ *
1216
+ * `GET /v1/public/verify-keys`
1217
+ */
1218
+ listKeys(options?: RequestOptions): APIPromise<T.VerifyKeys>;
1219
+ /**
1220
+ * Проверить подписанный блок QR
1221
+ *
1222
+ * `POST /v1/public/verify/qr`
1223
+ */
1224
+ verifyQr(body: T.VerifyQrInput, options?: RequestOptions): APIPromise<T.VerifyQrResult>;
1225
+ /**
1226
+ * Проверка подписи документа по коду
1227
+ *
1228
+ * `GET /v1/public/verify/{code}`
1229
+ */
1230
+ get(code: string, options?: RequestOptions): APIPromise<T.PublicVerification>;
1231
+ /**
1232
+ * Сверить файл с подписанным
1233
+ *
1234
+ * `POST /v1/public/verify/{code}/check`
1235
+ */
1236
+ check(code: string, body: T.VerifyCheckInput, options?: RequestOptions): APIPromise<T.VerifyCheck>;
1237
+ }
1238
+ /** Публичный список загрузок: расширение 1С и Tungo Connector (без ключа API) */
1239
+ export declare class ReleasesResource {
1240
+ #private;
1241
+ constructor(client: APIClient);
1242
+ /**
1243
+ * Что скачать
1244
+ *
1245
+ * `GET /v1/public/downloads`
1246
+ */
1247
+ list(options?: RequestOptions): APIPromise<T.Downloads>;
1248
+ }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by tungo-sdkgen. DO NOT EDIT.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.AutomationsResource = exports.OnecResource = exports.FormsResource = exports.EsfResource = exports.BatchesResource = exports.FeedResource = exports.ProposalsResource = exports.ChatResource = exports.WebhooksResource = exports.ApiKeysResource = exports.PlatformResource = exports.CompaniesResource = exports.WorkspacesResource = void 0;
4
+ exports.ReleasesResource = exports.VerificationResource = exports.AutomationsResource = exports.OnecResource = exports.FormsResource = exports.EsfResource = exports.BatchesResource = exports.FeedResource = exports.ProposalsResource = exports.ChatResource = exports.WebhooksResource = exports.ApiKeysResource = exports.PlatformResource = exports.CompaniesResource = exports.WorkspacesResource = void 0;
5
5
  const chat_js_1 = require("../chat.js");
6
6
  const core_js_1 = require("../core.js");
7
7
  const pagination_js_1 = require("../pagination.js");
@@ -397,6 +397,24 @@ class ChatResource {
397
397
  countTokens(co, body, options) {
398
398
  return this.#client.request({ method: 'POST', path: '/v1/companies/{co}/chat/count-tokens', pathParams: { co }, body, options });
399
399
  }
400
+ /**
401
+ * Файлы от ИИ в своих разговорах, новые сверху
402
+ *
403
+ * Returns one page; iterate the result with `for await` to walk every item of every page.
404
+ *
405
+ * `GET /v1/companies/{co}/chat/files`
406
+ *
407
+ * Required permission: `chat.use`.
408
+ */
409
+ listFiles(co, query, options) {
410
+ return (0, pagination_js_1.requestPage)(this.#client, { method: 'GET', path: '/v1/companies/{co}/chat/files', pathParams: { co }, query, options });
411
+ }
412
+ /**
413
+ * Every item of `listFiles`, across all pages. Pages are fetched lazily; leaving the loop stops fetching.
414
+ */
415
+ listFilesAll(co, query, options) {
416
+ return this.listFiles(co, query, options)[Symbol.asyncIterator]();
417
+ }
400
418
  /**
401
419
  * Что можно упомянуть через «@»
402
420
  *
@@ -427,6 +445,36 @@ class ChatResource {
427
445
  listSuggestions(co, query, options) {
428
446
  return this.#client.request({ method: 'GET', path: '/v1/companies/{co}/chat/suggestions', pathParams: { co }, query, options });
429
447
  }
448
+ /**
449
+ * Начать загрузку архива к сообщению
450
+ *
451
+ * `POST /v1/companies/{co}/chat/uploads`
452
+ *
453
+ * Required permission: `chat.use`.
454
+ */
455
+ createUpload(co, body, options) {
456
+ return this.#client.request({ method: 'POST', path: '/v1/companies/{co}/chat/uploads', pathParams: { co }, body, options });
457
+ }
458
+ /**
459
+ * Отменить загрузку архива
460
+ *
461
+ * `DELETE /v1/companies/{co}/chat/uploads/{upload}`
462
+ *
463
+ * Required permission: `chat.use`.
464
+ */
465
+ deleteUpload(co, upload, options) {
466
+ return this.#client.request({ method: 'DELETE', path: '/v1/companies/{co}/chat/uploads/{upload}', pathParams: { co, upload }, emptyResult: true, options });
467
+ }
468
+ /**
469
+ * Часть архива
470
+ *
471
+ * `PUT /v1/companies/{co}/chat/uploads/{upload}/parts/{n}`
472
+ *
473
+ * Required permission: `chat.use`.
474
+ */
475
+ putUploadPart(co, upload, n, options) {
476
+ return this.#client.request({ method: 'PUT', path: '/v1/companies/{co}/chat/uploads/{upload}/parts/{n}', pathParams: { co, upload, n }, options });
477
+ }
430
478
  /**
431
479
  * Разговор целиком
432
480
  *
@@ -543,6 +591,16 @@ class ChatResource {
543
591
  stop(co, id, options) {
544
592
  return this.#client.request({ method: 'POST', path: '/v1/companies/{co}/chat/{id}/stop', pathParams: { co, id }, options });
545
593
  }
594
+ /**
595
+ * Перевести размышление на русский
596
+ *
597
+ * `POST /v1/companies/{co}/chat/{id}/thinking/{tid}/translate`
598
+ *
599
+ * Required permission: `chat.use`.
600
+ */
601
+ translateThinking(co, id, tid, options) {
602
+ return this.#client.request({ method: 'POST', path: '/v1/companies/{co}/chat/{id}/thinking/{tid}/translate', pathParams: { co, id, tid }, options });
603
+ }
546
604
  }
547
605
  exports.ChatResource = ChatResource;
548
606
  /** Предложения документов ИИ-бухгалтера: просмотр, одобрение записи в 1С и отклонение */
@@ -1143,3 +1201,59 @@ class AutomationsResource {
1143
1201
  }
1144
1202
  }
1145
1203
  exports.AutomationsResource = AutomationsResource;
1204
+ /** Публичная проверка электронной подписи документов Tungo: по коду, по файлу, по блоку QR и ключи подписи (без ключа API) */
1205
+ class VerificationResource {
1206
+ #client;
1207
+ constructor(client) {
1208
+ this.#client = client;
1209
+ }
1210
+ /**
1211
+ * Ключи подписи QR (JWKS)
1212
+ *
1213
+ * `GET /v1/public/verify-keys`
1214
+ */
1215
+ listKeys(options) {
1216
+ return this.#client.request({ method: 'GET', path: '/v1/public/verify-keys', auth: 'public', options });
1217
+ }
1218
+ /**
1219
+ * Проверить подписанный блок QR
1220
+ *
1221
+ * `POST /v1/public/verify/qr`
1222
+ */
1223
+ verifyQr(body, options) {
1224
+ return this.#client.request({ method: 'POST', path: '/v1/public/verify/qr', body, auth: 'public', options });
1225
+ }
1226
+ /**
1227
+ * Проверка подписи документа по коду
1228
+ *
1229
+ * `GET /v1/public/verify/{code}`
1230
+ */
1231
+ get(code, options) {
1232
+ return this.#client.request({ method: 'GET', path: '/v1/public/verify/{code}', pathParams: { code }, auth: 'public', options });
1233
+ }
1234
+ /**
1235
+ * Сверить файл с подписанным
1236
+ *
1237
+ * `POST /v1/public/verify/{code}/check`
1238
+ */
1239
+ check(code, body, options) {
1240
+ return this.#client.request({ method: 'POST', path: '/v1/public/verify/{code}/check', pathParams: { code }, body, auth: 'public', options });
1241
+ }
1242
+ }
1243
+ exports.VerificationResource = VerificationResource;
1244
+ /** Публичный список загрузок: расширение 1С и Tungo Connector (без ключа API) */
1245
+ class ReleasesResource {
1246
+ #client;
1247
+ constructor(client) {
1248
+ this.#client = client;
1249
+ }
1250
+ /**
1251
+ * Что скачать
1252
+ *
1253
+ * `GET /v1/public/downloads`
1254
+ */
1255
+ list(options) {
1256
+ return this.#client.request({ method: 'GET', path: '/v1/public/downloads', auth: 'public', options });
1257
+ }
1258
+ }
1259
+ exports.ReleasesResource = ReleasesResource;