@tungoai/sdk 0.2.0 → 0.3.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 +54 -1
- package/README.kk.md +5 -5
- package/README.md +7 -7
- package/README.ru.md +5 -5
- package/dist/cjs/chat.js +3 -2
- package/dist/cjs/client.d.ts +2 -1
- package/dist/cjs/client.js +5 -3
- package/dist/cjs/core.d.ts +9 -2
- package/dist/cjs/core.js +191 -17
- package/dist/cjs/errors.d.ts +25 -0
- package/dist/cjs/errors.js +39 -3
- package/dist/cjs/generated/resources.d.ts +92 -2
- package/dist/cjs/generated/resources.js +82 -1
- package/dist/cjs/generated/types.d.ts +562 -54
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +3 -2
- package/dist/cjs/json.d.ts +6 -0
- package/dist/cjs/json.js +17 -0
- package/dist/cjs/pagination.js +2 -1
- package/dist/cjs/streaming.d.ts +4 -2
- package/dist/cjs/streaming.js +40 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/webhooks.d.ts +5 -0
- package/dist/cjs/webhooks.js +17 -3
- package/dist/esm/chat.js +3 -2
- package/dist/esm/client.d.ts +2 -1
- package/dist/esm/client.js +5 -3
- package/dist/esm/core.d.ts +9 -2
- package/dist/esm/core.js +191 -17
- package/dist/esm/errors.d.ts +25 -0
- package/dist/esm/errors.js +36 -1
- package/dist/esm/generated/resources.d.ts +92 -2
- package/dist/esm/generated/resources.js +82 -1
- package/dist/esm/generated/types.d.ts +562 -54
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/json.d.ts +6 -0
- package/dist/esm/json.js +16 -0
- package/dist/esm/pagination.js +2 -1
- package/dist/esm/streaming.d.ts +4 -2
- package/dist/esm/streaming.js +41 -3
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/webhooks.d.ts +5 -0
- package/dist/esm/webhooks.js +17 -3
- package/package.json +1 -1
package/dist/cjs/errors.d.ts
CHANGED
|
@@ -79,6 +79,31 @@ export declare class DecodeError extends TungoError {
|
|
|
79
79
|
cause?: unknown;
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* A stream of items (not chat events; for example `feed.listEvents`) carried an `error` event: the
|
|
84
|
+
* server could not go on and ended the stream. It is thrown by the `for await` loop after the
|
|
85
|
+
* items that came before it. The stream did not finish: reconnect (from the cursor of the last
|
|
86
|
+
* item) to resume it.
|
|
87
|
+
*/
|
|
88
|
+
export declare class StreamError extends TungoError {
|
|
89
|
+
/** The machine-readable reason, for example `feed_failed`; null when the event had none. */
|
|
90
|
+
readonly code: string | null;
|
|
91
|
+
/** The text for people. */
|
|
92
|
+
readonly detail: string;
|
|
93
|
+
/** Request id: `request_id` of the event, else the `x-request-id` header. Quote it to support. */
|
|
94
|
+
readonly requestId: string | null;
|
|
95
|
+
/** Every other property of the event data. */
|
|
96
|
+
readonly extra: Record<string, unknown>;
|
|
97
|
+
/** The data of the event as received (possibly truncated to 2000 characters). */
|
|
98
|
+
readonly body: string;
|
|
99
|
+
constructor(init: {
|
|
100
|
+
code: string | null;
|
|
101
|
+
detail: string;
|
|
102
|
+
requestId: string | null;
|
|
103
|
+
extra: Record<string, unknown>;
|
|
104
|
+
body: string;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
82
107
|
/** Why a webhook was rejected. */
|
|
83
108
|
export type WebhookVerificationReason = 'invalid_tolerance' | 'invalid_secret' | 'missing_header' | 'malformed_timestamp' | 'timestamp_too_old' | 'timestamp_too_new' | 'signature_mismatch' | 'invalid_payload';
|
|
84
109
|
/** A webhook failed verification. Never trust the payload when this is thrown. */
|
package/dist/cjs/errors.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Code generated by tungo-sdkgen. DO NOT EDIT.
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.UnavailableError = exports.InternalServerError = exports.LimitError = exports.GoneError = exports.ConflictError = exports.NotFoundError = exports.PermissionError = exports.PaymentRequiredError = exports.AuthenticationError = exports.InvalidRequestError = exports.APIError = exports.MoneyError = exports.WebhookVerificationError = exports.DecodeError = exports.AbortError = exports.TimeoutError = exports.ConnectionError = exports.ValidationError = exports.ConfigError = exports.TungoError = void 0;
|
|
3
|
+
exports.UnavailableError = exports.InternalServerError = exports.LimitError = exports.GoneError = exports.ConflictError = exports.NotFoundError = exports.PermissionError = exports.PaymentRequiredError = exports.AuthenticationError = exports.InvalidRequestError = exports.APIError = exports.MoneyError = exports.WebhookVerificationError = exports.StreamError = exports.DecodeError = exports.AbortError = exports.TimeoutError = exports.ConnectionError = exports.ValidationError = exports.ConfigError = exports.TungoError = void 0;
|
|
5
4
|
exports.parseRetryAfter = parseRetryAfter;
|
|
6
5
|
exports.parseRateLimit = parseRateLimit;
|
|
7
6
|
exports.errorTypeForStatus = errorTypeForStatus;
|
|
8
7
|
exports.parseErrorDetail = parseErrorDetail;
|
|
9
8
|
exports.makeAPIError = makeAPIError;
|
|
10
9
|
exports.apiErrorFromResponse = apiErrorFromResponse;
|
|
10
|
+
// Code generated by tungo-sdkgen. DO NOT EDIT.
|
|
11
|
+
const json_js_1 = require("./json.js");
|
|
11
12
|
/** Base class of every error thrown by the SDK. */
|
|
12
13
|
class TungoError extends Error {
|
|
13
14
|
constructor(message, options) {
|
|
@@ -85,6 +86,40 @@ class DecodeError extends TungoError {
|
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
88
|
exports.DecodeError = DecodeError;
|
|
89
|
+
/**
|
|
90
|
+
* A stream of items (not chat events; for example `feed.listEvents`) carried an `error` event: the
|
|
91
|
+
* server could not go on and ended the stream. It is thrown by the `for await` loop after the
|
|
92
|
+
* items that came before it. The stream did not finish: reconnect (from the cursor of the last
|
|
93
|
+
* item) to resume it.
|
|
94
|
+
*/
|
|
95
|
+
class StreamError extends TungoError {
|
|
96
|
+
/** The machine-readable reason, for example `feed_failed`; null when the event had none. */
|
|
97
|
+
code;
|
|
98
|
+
/** The text for people. */
|
|
99
|
+
detail;
|
|
100
|
+
/** Request id: `request_id` of the event, else the `x-request-id` header. Quote it to support. */
|
|
101
|
+
requestId;
|
|
102
|
+
/** Every other property of the event data. */
|
|
103
|
+
extra;
|
|
104
|
+
/** The data of the event as received (possibly truncated to 2000 characters). */
|
|
105
|
+
body;
|
|
106
|
+
constructor(init) {
|
|
107
|
+
let text = 'Tungo stream error';
|
|
108
|
+
if (init.code !== null)
|
|
109
|
+
text += ' (' + init.code + ')';
|
|
110
|
+
text += ': ' + init.detail;
|
|
111
|
+
if (init.requestId !== null)
|
|
112
|
+
text += ' [request id ' + init.requestId + ']';
|
|
113
|
+
super(text);
|
|
114
|
+
this.name = 'StreamError';
|
|
115
|
+
this.code = init.code;
|
|
116
|
+
this.detail = init.detail;
|
|
117
|
+
this.requestId = init.requestId;
|
|
118
|
+
this.extra = init.extra;
|
|
119
|
+
this.body = init.body.length > 2000 ? init.body.slice(0, 2000) : init.body;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
exports.StreamError = StreamError;
|
|
88
123
|
/** A webhook failed verification. Never trust the payload when this is thrown. */
|
|
89
124
|
class WebhookVerificationError extends TungoError {
|
|
90
125
|
reason;
|
|
@@ -387,7 +422,8 @@ function apiErrorFromResponse(status, headers, body, nowMs = Date.now()) {
|
|
|
387
422
|
};
|
|
388
423
|
let parsed;
|
|
389
424
|
try {
|
|
390
|
-
|
|
425
|
+
// parseJSON keeps an integer beyond 2^53 (a 64-bit amount in `extra`) exact, as a bigint.
|
|
426
|
+
parsed = (0, json_js_1.parseJSON)(body);
|
|
391
427
|
}
|
|
392
428
|
catch {
|
|
393
429
|
parsed = undefined;
|
|
@@ -117,6 +117,25 @@ export interface ChatListParams {
|
|
|
117
117
|
/** Сколько на странице: 1–100, по умолчанию 50 */
|
|
118
118
|
limit?: number | undefined;
|
|
119
119
|
}
|
|
120
|
+
/** Query parameters of `chat.listMentions`. */
|
|
121
|
+
export interface ChatListMentionsParams {
|
|
122
|
+
/** Сколько на каждый вид: 1–20, по умолчанию 8 */
|
|
123
|
+
limit?: number | undefined;
|
|
124
|
+
/** Что ищем: часть номера, названия, имени; у контрагента — от 2 знаков (или БИН цифрами). Пусто — свежие предложения и задания */
|
|
125
|
+
q?: string | undefined;
|
|
126
|
+
/** Виды через запятую; по умолчанию все. `proposal` — предложение (документ для 1С), id — его номер P-000123; `counterparty` — контрагент из 1С компании, id — его ссылка из поиска; `batch` — задание пачки (разбор выписки, в… */
|
|
127
|
+
types?: string | undefined;
|
|
128
|
+
}
|
|
129
|
+
/** Query parameters of `chat.getRatingOptions`. */
|
|
130
|
+
export interface ChatGetRatingOptionsParams {
|
|
131
|
+
/** Язык названий причин; по умолчанию ru */
|
|
132
|
+
lang?: T.ListCompanyChatRatingOptionsLang | undefined;
|
|
133
|
+
}
|
|
134
|
+
/** Query parameters of `chat.listSuggestions`. */
|
|
135
|
+
export interface ChatListSuggestionsParams {
|
|
136
|
+
/** Язык текстов — язык интерфейса кабинета. Не передан — язык ответов ИИ из профиля (`kk` — по-казахски, иначе по-русски) */
|
|
137
|
+
lang?: T.ListCompanyChatSuggestionsLang | undefined;
|
|
138
|
+
}
|
|
120
139
|
/** Query parameters of `chat.listEvents`. */
|
|
121
140
|
export interface ChatListEventsParams {
|
|
122
141
|
/** Номер хода (X-Turn-No), к которому переподключиться; без него — к текущему */
|
|
@@ -124,6 +143,10 @@ export interface ChatListEventsParams {
|
|
|
124
143
|
}
|
|
125
144
|
/** Query parameters of `proposals.list`. */
|
|
126
145
|
export interface ProposalsListParams {
|
|
146
|
+
/** true — только отправленные на одобрение и ещё не решённые; false — только остальные */
|
|
147
|
+
approval_requested?: T.ListCompanyProposalsApprovalRequested | undefined;
|
|
148
|
+
/** Только документы одного задания пачки (bat_…) — тот же состав, что в сводке задания и у «Одобрить и отправить в 1С». Не id задания — 400; задания нет — пустой список */
|
|
149
|
+
batch_id?: string | undefined;
|
|
127
150
|
/** next_cursor из ответа прошлой страницы; без него — первая (самая свежая) страница. Остальные фильтры — те же, что у первой страницы. */
|
|
128
151
|
cursor?: string | undefined;
|
|
129
152
|
/** Созданные не раньше этого дня (ГГГГ-ММ-ДД, день по Алматы) */
|
|
@@ -134,8 +157,10 @@ export interface ProposalsListParams {
|
|
|
134
157
|
kind?: string | undefined;
|
|
135
158
|
/** Сколько на странице: 1–100, по умолчанию 20 */
|
|
136
159
|
limit?: number | undefined;
|
|
137
|
-
/** Поиск без учёта регистра: номер предложения (P-…), номер документа 1С, контрагент (имя из превью),
|
|
160
|
+
/** Поиск без учёта регистра: номер предложения (P-…), номер документа 1С, контрагент (имя из превью), БИН/ИИН, сумма (как пишут: «150 000,50» или 150000.5) и другие реквизиты документа */
|
|
138
161
|
q?: string | undefined;
|
|
162
|
+
/** Только из этих источников (origin.source): один или несколько через запятую (chat, statement, esf, automation). Неизвестный — 400 */
|
|
163
|
+
source?: string | undefined;
|
|
139
164
|
/** Только в этих статусах: один или несколько через запятую (previewed, approved, rejected, committed, posted, verified, mismatch, failed); без него — все. Неизвестный — 400 */
|
|
140
165
|
status?: string | undefined;
|
|
141
166
|
}
|
|
@@ -536,6 +561,30 @@ export declare class ChatResource {
|
|
|
536
561
|
* Required permission: `chat.use`.
|
|
537
562
|
*/
|
|
538
563
|
countTokens(co: string, body: T.ChatTokenCountRequest, options?: RequestOptions): APIPromise<T.ChatTokenCount>;
|
|
564
|
+
/**
|
|
565
|
+
* Что можно упомянуть через «@»
|
|
566
|
+
*
|
|
567
|
+
* `GET /v1/companies/{co}/chat/mentions`
|
|
568
|
+
*
|
|
569
|
+
* Required permission: `chat.use`.
|
|
570
|
+
*/
|
|
571
|
+
listMentions(co: string, query?: ChatListMentionsParams, options?: RequestOptions): APIPromise<T.ChatMentionSearch>;
|
|
572
|
+
/**
|
|
573
|
+
* Что нужно форме оценки: причины «вниз» и предел комментария
|
|
574
|
+
*
|
|
575
|
+
* `GET /v1/companies/{co}/chat/rating-options`
|
|
576
|
+
*
|
|
577
|
+
* Required permission: `chat.use`.
|
|
578
|
+
*/
|
|
579
|
+
getRatingOptions(co: string, query?: ChatGetRatingOptionsParams, options?: RequestOptions): APIPromise<T.ChatRatingOptions>;
|
|
580
|
+
/**
|
|
581
|
+
* Подсказки пустого чата
|
|
582
|
+
*
|
|
583
|
+
* `GET /v1/companies/{co}/chat/suggestions`
|
|
584
|
+
*
|
|
585
|
+
* Required permission: `chat.use`.
|
|
586
|
+
*/
|
|
587
|
+
listSuggestions(co: string, query?: ChatListSuggestionsParams, options?: RequestOptions): APIPromise<T.ChatSuggestions>;
|
|
539
588
|
/**
|
|
540
589
|
* Разговор целиком
|
|
541
590
|
*
|
|
@@ -590,6 +639,38 @@ export declare class ChatResource {
|
|
|
590
639
|
* Required permission: `chat.use`.
|
|
591
640
|
*/
|
|
592
641
|
listEvents(co: string, id: string, query?: ChatListEventsParams, options?: RequestOptions): ChatStreamPromise;
|
|
642
|
+
/**
|
|
643
|
+
* Оценить ответ ИИ: палец вверх или вниз
|
|
644
|
+
*
|
|
645
|
+
* `PUT /v1/companies/{co}/chat/{id}/messages/{turn}/rating`
|
|
646
|
+
*
|
|
647
|
+
* Required permission: `chat.use`.
|
|
648
|
+
*/
|
|
649
|
+
rateMessage(co: string, id: string, turn: string, body: T.ChatMessageRatingBody, options?: RequestOptions): APIPromise<T.ChatMessageRated>;
|
|
650
|
+
/**
|
|
651
|
+
* Снять свою оценку ответа
|
|
652
|
+
*
|
|
653
|
+
* `DELETE /v1/companies/{co}/chat/{id}/messages/{turn}/rating`
|
|
654
|
+
*
|
|
655
|
+
* Required permission: `chat.use`.
|
|
656
|
+
*/
|
|
657
|
+
deleteMessageRating(co: string, id: string, turn: string, options?: RequestOptions): APIPromise<T.ChatMessageRated>;
|
|
658
|
+
/**
|
|
659
|
+
* Оценить разговор целиком: от 1 до 5
|
|
660
|
+
*
|
|
661
|
+
* `PUT /v1/companies/{co}/chat/{id}/rating`
|
|
662
|
+
*
|
|
663
|
+
* Required permission: `chat.use`.
|
|
664
|
+
*/
|
|
665
|
+
rate(co: string, id: string, body: T.ChatDialogRatingBody, options?: RequestOptions): APIPromise<T.ChatDialogRated>;
|
|
666
|
+
/**
|
|
667
|
+
* Не сейчас: закрыть предложение оценить разговор
|
|
668
|
+
*
|
|
669
|
+
* `POST /v1/companies/{co}/chat/{id}/rating/dismiss`
|
|
670
|
+
*
|
|
671
|
+
* Required permission: `chat.use`.
|
|
672
|
+
*/
|
|
673
|
+
dismissRating(co: string, id: string, options?: RequestOptions): APIPromise<T.ChatRatingDismissed>;
|
|
593
674
|
/**
|
|
594
675
|
* Остановить ход или закрыть открытый вопрос
|
|
595
676
|
*
|
|
@@ -649,6 +730,14 @@ export declare class ProposalsResource {
|
|
|
649
730
|
* Required permission: `proposals.approve`.
|
|
650
731
|
*/
|
|
651
732
|
reject(co: string, id: string, body: T.RejectRequest, options?: RequestOptions): APIPromise<T.ProposalDecision>;
|
|
733
|
+
/**
|
|
734
|
+
* Отправить на одобрение
|
|
735
|
+
*
|
|
736
|
+
* `POST /v1/companies/{co}/proposals/{id}/request-approval`
|
|
737
|
+
*
|
|
738
|
+
* Required permission: `proposals.create`.
|
|
739
|
+
*/
|
|
740
|
+
requestApproval(co: string, id: string, body?: T.ProposalApprovalRequestBody, options?: RequestOptions): APIPromise<T.ProposalApprovalRequestResult>;
|
|
652
741
|
}
|
|
653
742
|
/** Лента событий и предложений компании (страницы и живой поток SSE) */
|
|
654
743
|
export declare class FeedResource {
|
|
@@ -869,7 +958,8 @@ export declare class AutomationsResource {
|
|
|
869
958
|
* Принять событие по адресу хука
|
|
870
959
|
*
|
|
871
960
|
* The body is sent as it is (text or bytes) or serialised as JSON. With `options.secret` the exact bytes
|
|
872
|
-
* are signed in the `X-Signature: sha256=<hex>` header
|
|
961
|
+
* are signed in the `X-Signature: sha256=<hex>` header, or in `options.signatureHeader` for a hook created with
|
|
962
|
+
* its own `signature_header`. The API key is never sent to this endpoint.
|
|
873
963
|
*
|
|
874
964
|
* `POST /hooks/{token}`
|
|
875
965
|
*/
|
|
@@ -397,6 +397,36 @@ 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
|
+
* `GET /v1/companies/{co}/chat/mentions`
|
|
404
|
+
*
|
|
405
|
+
* Required permission: `chat.use`.
|
|
406
|
+
*/
|
|
407
|
+
listMentions(co, query, options) {
|
|
408
|
+
return this.#client.request({ method: 'GET', path: '/v1/companies/{co}/chat/mentions', pathParams: { co }, query, options });
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Что нужно форме оценки: причины «вниз» и предел комментария
|
|
412
|
+
*
|
|
413
|
+
* `GET /v1/companies/{co}/chat/rating-options`
|
|
414
|
+
*
|
|
415
|
+
* Required permission: `chat.use`.
|
|
416
|
+
*/
|
|
417
|
+
getRatingOptions(co, query, options) {
|
|
418
|
+
return this.#client.request({ method: 'GET', path: '/v1/companies/{co}/chat/rating-options', pathParams: { co }, query, options });
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Подсказки пустого чата
|
|
422
|
+
*
|
|
423
|
+
* `GET /v1/companies/{co}/chat/suggestions`
|
|
424
|
+
*
|
|
425
|
+
* Required permission: `chat.use`.
|
|
426
|
+
*/
|
|
427
|
+
listSuggestions(co, query, options) {
|
|
428
|
+
return this.#client.request({ method: 'GET', path: '/v1/companies/{co}/chat/suggestions', pathParams: { co }, query, options });
|
|
429
|
+
}
|
|
400
430
|
/**
|
|
401
431
|
* Разговор целиком
|
|
402
432
|
*
|
|
@@ -463,6 +493,46 @@ class ChatResource {
|
|
|
463
493
|
listEvents(co, id, query, options) {
|
|
464
494
|
return new chat_js_1.ChatStreamPromise(this.#client.openStream({ method: 'GET', path: '/v1/companies/{co}/chat/{id}/events', pathParams: { co, id }, query, options }, (init) => new chat_js_1.ChatStream(init)));
|
|
465
495
|
}
|
|
496
|
+
/**
|
|
497
|
+
* Оценить ответ ИИ: палец вверх или вниз
|
|
498
|
+
*
|
|
499
|
+
* `PUT /v1/companies/{co}/chat/{id}/messages/{turn}/rating`
|
|
500
|
+
*
|
|
501
|
+
* Required permission: `chat.use`.
|
|
502
|
+
*/
|
|
503
|
+
rateMessage(co, id, turn, body, options) {
|
|
504
|
+
return this.#client.request({ method: 'PUT', path: '/v1/companies/{co}/chat/{id}/messages/{turn}/rating', pathParams: { co, id, turn }, body, options });
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* Снять свою оценку ответа
|
|
508
|
+
*
|
|
509
|
+
* `DELETE /v1/companies/{co}/chat/{id}/messages/{turn}/rating`
|
|
510
|
+
*
|
|
511
|
+
* Required permission: `chat.use`.
|
|
512
|
+
*/
|
|
513
|
+
deleteMessageRating(co, id, turn, options) {
|
|
514
|
+
return this.#client.request({ method: 'DELETE', path: '/v1/companies/{co}/chat/{id}/messages/{turn}/rating', pathParams: { co, id, turn }, options });
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Оценить разговор целиком: от 1 до 5
|
|
518
|
+
*
|
|
519
|
+
* `PUT /v1/companies/{co}/chat/{id}/rating`
|
|
520
|
+
*
|
|
521
|
+
* Required permission: `chat.use`.
|
|
522
|
+
*/
|
|
523
|
+
rate(co, id, body, options) {
|
|
524
|
+
return this.#client.request({ method: 'PUT', path: '/v1/companies/{co}/chat/{id}/rating', pathParams: { co, id }, body, options });
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* Не сейчас: закрыть предложение оценить разговор
|
|
528
|
+
*
|
|
529
|
+
* `POST /v1/companies/{co}/chat/{id}/rating/dismiss`
|
|
530
|
+
*
|
|
531
|
+
* Required permission: `chat.use`.
|
|
532
|
+
*/
|
|
533
|
+
dismissRating(co, id, options) {
|
|
534
|
+
return this.#client.request({ method: 'POST', path: '/v1/companies/{co}/chat/{id}/rating/dismiss', pathParams: { co, id }, options });
|
|
535
|
+
}
|
|
466
536
|
/**
|
|
467
537
|
* Остановить ход или закрыть открытый вопрос
|
|
468
538
|
*
|
|
@@ -539,6 +609,16 @@ class ProposalsResource {
|
|
|
539
609
|
reject(co, id, body, options) {
|
|
540
610
|
return this.#client.request({ method: 'POST', path: '/v1/companies/{co}/proposals/{id}/reject', pathParams: { co, id }, body, options });
|
|
541
611
|
}
|
|
612
|
+
/**
|
|
613
|
+
* Отправить на одобрение
|
|
614
|
+
*
|
|
615
|
+
* `POST /v1/companies/{co}/proposals/{id}/request-approval`
|
|
616
|
+
*
|
|
617
|
+
* Required permission: `proposals.create`.
|
|
618
|
+
*/
|
|
619
|
+
requestApproval(co, id, body, options) {
|
|
620
|
+
return this.#client.request({ method: 'POST', path: '/v1/companies/{co}/proposals/{id}/request-approval', pathParams: { co, id }, body, options });
|
|
621
|
+
}
|
|
542
622
|
}
|
|
543
623
|
exports.ProposalsResource = ProposalsResource;
|
|
544
624
|
/** Лента событий и предложений компании (страницы и живой поток SSE) */
|
|
@@ -825,7 +905,8 @@ class AutomationsResource {
|
|
|
825
905
|
* Принять событие по адресу хука
|
|
826
906
|
*
|
|
827
907
|
* The body is sent as it is (text or bytes) or serialised as JSON. With `options.secret` the exact bytes
|
|
828
|
-
* are signed in the `X-Signature: sha256=<hex>` header
|
|
908
|
+
* are signed in the `X-Signature: sha256=<hex>` header, or in `options.signatureHeader` for a hook created with
|
|
909
|
+
* its own `signature_header`. The API key is never sent to this endpoint.
|
|
829
910
|
*
|
|
830
911
|
* `POST /hooks/{token}`
|
|
831
912
|
*/
|