@doist/twist-sdk 2.5.1 → 2.6.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/cjs/clients/add-comment-helper.js +43 -1
- package/dist/cjs/types/enums.js +15 -1
- package/dist/cjs/types/requests.js +4 -0
- package/dist/esm/clients/add-comment-helper.js +43 -1
- package/dist/esm/types/enums.js +14 -0
- package/dist/esm/types/requests.js +4 -0
- package/dist/types/clients/add-comment-helper.d.ts +2 -2
- package/dist/types/clients/comments-client.d.ts +11 -2
- package/dist/types/clients/threads-client.d.ts +14 -2
- package/dist/types/types/enums.d.ts +19 -0
- package/dist/types/types/requests.d.ts +14 -14
- package/package.json +1 -1
|
@@ -10,16 +10,58 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
25
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
26
|
+
if (ar || !(i in from)) {
|
|
27
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
28
|
+
ar[i] = from[i];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
32
|
+
};
|
|
13
33
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
34
|
exports.addCommentRequest = addCommentRequest;
|
|
15
35
|
var endpoints_1 = require("../consts/endpoints");
|
|
16
36
|
var http_client_1 = require("../transport/http-client");
|
|
17
37
|
var entities_1 = require("../types/entities");
|
|
38
|
+
var enums_1 = require("../types/enums");
|
|
39
|
+
var SENTINEL_GROUP_IDS = new Set(Object.values(enums_1.NOTIFY_AUDIENCE_GROUP_IDS));
|
|
40
|
+
function isNotifyAudience(value) {
|
|
41
|
+
return typeof value === 'string' && enums_1.NOTIFY_AUDIENCES.includes(value);
|
|
42
|
+
}
|
|
43
|
+
function applyNotifyAudience(params) {
|
|
44
|
+
if (params.groups) {
|
|
45
|
+
var offending = params.groups.filter(function (id) { return SENTINEL_GROUP_IDS.has(id); });
|
|
46
|
+
if (offending.length > 0) {
|
|
47
|
+
throw new Error("`groups` must not contain reserved sentinel IDs (".concat(offending.join(', '), "). Use `notifyAudience` instead."));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (params.notifyAudience == null)
|
|
51
|
+
return params;
|
|
52
|
+
if (!isNotifyAudience(params.notifyAudience)) {
|
|
53
|
+
throw new Error("Invalid `notifyAudience` value \"".concat(String(params.notifyAudience), "\". Expected one of: ").concat(enums_1.NOTIFY_AUDIENCES.join(', '), "."));
|
|
54
|
+
}
|
|
55
|
+
var sentinel = enums_1.NOTIFY_AUDIENCE_GROUP_IDS[params.notifyAudience];
|
|
56
|
+
var _stripped = params.notifyAudience, groups = params.groups, rest = __rest(params, ["notifyAudience", "groups"]);
|
|
57
|
+
return __assign(__assign({}, rest), { groups: __spreadArray(__spreadArray([], (groups !== null && groups !== void 0 ? groups : []), true), [sentinel], false) });
|
|
58
|
+
}
|
|
18
59
|
function addCommentRequest(context, params, options) {
|
|
19
60
|
var method = 'POST';
|
|
20
61
|
var url = "".concat(endpoints_1.ENDPOINT_COMMENTS, "/add");
|
|
62
|
+
var normalized = applyNotifyAudience(params);
|
|
21
63
|
var payload = (options === null || options === void 0 ? void 0 : options.threadAction)
|
|
22
|
-
? __assign(__assign({},
|
|
64
|
+
? __assign(__assign({}, normalized), { threadAction: options.threadAction }) : normalized;
|
|
23
65
|
var schema = entities_1.CommentSchema;
|
|
24
66
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
25
67
|
return { method: method, url: url, params: payload, schema: schema };
|
package/dist/cjs/types/enums.js
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WORKSPACE_PLANS = exports.USER_TYPES = void 0;
|
|
3
|
+
exports.NOTIFY_AUDIENCE_GROUP_IDS = exports.NOTIFY_AUDIENCES = exports.WORKSPACE_PLANS = exports.USER_TYPES = void 0;
|
|
4
4
|
// User types for workspace users
|
|
5
5
|
exports.USER_TYPES = ['USER', 'GUEST', 'ADMIN'];
|
|
6
6
|
// Workspace plans
|
|
7
7
|
exports.WORKSPACE_PLANS = ['free', 'unlimited'];
|
|
8
|
+
// Audiences that comment-creating endpoints can target alongside (or instead
|
|
9
|
+
// of) individual `recipients` / custom `groups`.
|
|
10
|
+
exports.NOTIFY_AUDIENCES = ['channel', 'thread'];
|
|
11
|
+
/**
|
|
12
|
+
* Internal mapping from {@link NotifyAudience} to the magic group IDs that
|
|
13
|
+
* Twist's `comments/add` endpoint uses on the wire. Exposed here so the
|
|
14
|
+
* audience constants and their encoding stay in a single source of truth;
|
|
15
|
+
* SDK consumers should use {@link NotifyAudience} via `notifyAudience` on the
|
|
16
|
+
* request args rather than passing these IDs directly.
|
|
17
|
+
*/
|
|
18
|
+
exports.NOTIFY_AUDIENCE_GROUP_IDS = {
|
|
19
|
+
channel: 1,
|
|
20
|
+
thread: 2,
|
|
21
|
+
};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.THREAD_ACTIONS = exports.ARCHIVE_FILTER_VALUES = exports.AWAY_MODE_TYPES = exports.GetOrCreateConversationArgsSchema = exports.GetConversationsArgsSchema = exports.GetCommentsArgsSchema = exports.GetThreadsArgsSchema = exports.GetChannelsArgsSchema = exports.CreateMessageArgsSchema = exports.CreateConversationArgsSchema = exports.UpdateCommentArgsSchema = exports.CreateCommentArgsSchema = exports.UpdateThreadArgsSchema = exports.CreateThreadArgsSchema = exports.UpdateChannelArgsSchema = exports.CreateChannelArgsSchema = void 0;
|
|
4
4
|
var zod_1 = require("zod");
|
|
5
|
+
var enums_1 = require("./enums");
|
|
5
6
|
exports.CreateChannelArgsSchema = zod_1.z.object({
|
|
6
7
|
workspaceId: zod_1.z.number(),
|
|
7
8
|
name: zod_1.z.string(),
|
|
@@ -46,6 +47,9 @@ exports.CreateCommentArgsSchema = zod_1.z.object({
|
|
|
46
47
|
attachments: zod_1.z.unknown().nullable().optional(),
|
|
47
48
|
actions: zod_1.z.unknown().nullable().optional(),
|
|
48
49
|
recipients: zod_1.z.array(zod_1.z.number()).nullable().optional(),
|
|
50
|
+
groups: zod_1.z.array(zod_1.z.number()).nullable().optional(),
|
|
51
|
+
directMentions: zod_1.z.array(zod_1.z.number()).nullable().optional(),
|
|
52
|
+
notifyAudience: zod_1.z.enum(enums_1.NOTIFY_AUDIENCES).nullable().optional(),
|
|
49
53
|
});
|
|
50
54
|
exports.UpdateCommentArgsSchema = zod_1.z.object({
|
|
51
55
|
id: zod_1.z.number(),
|
|
@@ -9,14 +9,56 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
24
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
25
|
+
if (ar || !(i in from)) {
|
|
26
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
27
|
+
ar[i] = from[i];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
31
|
+
};
|
|
12
32
|
import { ENDPOINT_COMMENTS } from '../consts/endpoints.js';
|
|
13
33
|
import { request } from '../transport/http-client.js';
|
|
14
34
|
import { CommentSchema } from '../types/entities.js';
|
|
35
|
+
import { NOTIFY_AUDIENCE_GROUP_IDS, NOTIFY_AUDIENCES } from '../types/enums.js';
|
|
36
|
+
var SENTINEL_GROUP_IDS = new Set(Object.values(NOTIFY_AUDIENCE_GROUP_IDS));
|
|
37
|
+
function isNotifyAudience(value) {
|
|
38
|
+
return typeof value === 'string' && NOTIFY_AUDIENCES.includes(value);
|
|
39
|
+
}
|
|
40
|
+
function applyNotifyAudience(params) {
|
|
41
|
+
if (params.groups) {
|
|
42
|
+
var offending = params.groups.filter(function (id) { return SENTINEL_GROUP_IDS.has(id); });
|
|
43
|
+
if (offending.length > 0) {
|
|
44
|
+
throw new Error("`groups` must not contain reserved sentinel IDs (".concat(offending.join(', '), "). Use `notifyAudience` instead."));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (params.notifyAudience == null)
|
|
48
|
+
return params;
|
|
49
|
+
if (!isNotifyAudience(params.notifyAudience)) {
|
|
50
|
+
throw new Error("Invalid `notifyAudience` value \"".concat(String(params.notifyAudience), "\". Expected one of: ").concat(NOTIFY_AUDIENCES.join(', '), "."));
|
|
51
|
+
}
|
|
52
|
+
var sentinel = NOTIFY_AUDIENCE_GROUP_IDS[params.notifyAudience];
|
|
53
|
+
var _stripped = params.notifyAudience, groups = params.groups, rest = __rest(params, ["notifyAudience", "groups"]);
|
|
54
|
+
return __assign(__assign({}, rest), { groups: __spreadArray(__spreadArray([], (groups !== null && groups !== void 0 ? groups : []), true), [sentinel], false) });
|
|
55
|
+
}
|
|
15
56
|
export function addCommentRequest(context, params, options) {
|
|
16
57
|
var method = 'POST';
|
|
17
58
|
var url = "".concat(ENDPOINT_COMMENTS, "/add");
|
|
59
|
+
var normalized = applyNotifyAudience(params);
|
|
18
60
|
var payload = (options === null || options === void 0 ? void 0 : options.threadAction)
|
|
19
|
-
? __assign(__assign({},
|
|
61
|
+
? __assign(__assign({}, normalized), { threadAction: options.threadAction }) : normalized;
|
|
20
62
|
var schema = CommentSchema;
|
|
21
63
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
22
64
|
return { method: method, url: url, params: payload, schema: schema };
|
package/dist/esm/types/enums.js
CHANGED
|
@@ -2,3 +2,17 @@
|
|
|
2
2
|
export var USER_TYPES = ['USER', 'GUEST', 'ADMIN'];
|
|
3
3
|
// Workspace plans
|
|
4
4
|
export var WORKSPACE_PLANS = ['free', 'unlimited'];
|
|
5
|
+
// Audiences that comment-creating endpoints can target alongside (or instead
|
|
6
|
+
// of) individual `recipients` / custom `groups`.
|
|
7
|
+
export var NOTIFY_AUDIENCES = ['channel', 'thread'];
|
|
8
|
+
/**
|
|
9
|
+
* Internal mapping from {@link NotifyAudience} to the magic group IDs that
|
|
10
|
+
* Twist's `comments/add` endpoint uses on the wire. Exposed here so the
|
|
11
|
+
* audience constants and their encoding stay in a single source of truth;
|
|
12
|
+
* SDK consumers should use {@link NotifyAudience} via `notifyAudience` on the
|
|
13
|
+
* request args rather than passing these IDs directly.
|
|
14
|
+
*/
|
|
15
|
+
export var NOTIFY_AUDIENCE_GROUP_IDS = {
|
|
16
|
+
channel: 1,
|
|
17
|
+
thread: 2,
|
|
18
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { NOTIFY_AUDIENCES } from './enums.js';
|
|
2
3
|
export var CreateChannelArgsSchema = z.object({
|
|
3
4
|
workspaceId: z.number(),
|
|
4
5
|
name: z.string(),
|
|
@@ -43,6 +44,9 @@ export var CreateCommentArgsSchema = z.object({
|
|
|
43
44
|
attachments: z.unknown().nullable().optional(),
|
|
44
45
|
actions: z.unknown().nullable().optional(),
|
|
45
46
|
recipients: z.array(z.number()).nullable().optional(),
|
|
47
|
+
groups: z.array(z.number()).nullable().optional(),
|
|
48
|
+
directMentions: z.array(z.number()).nullable().optional(),
|
|
49
|
+
notifyAudience: z.enum(NOTIFY_AUDIENCES).nullable().optional(),
|
|
46
50
|
});
|
|
47
51
|
export var UpdateCommentArgsSchema = z.object({
|
|
48
52
|
id: z.number(),
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { BatchRequestDescriptor } from '../types/batch.js';
|
|
2
2
|
import { type Comment } from '../types/entities.js';
|
|
3
3
|
import type { CustomFetch } from '../types/http.js';
|
|
4
|
-
import type { ThreadAction } from '../types/requests.js';
|
|
4
|
+
import type { CreateCommentArgs, ThreadAction } from '../types/requests.js';
|
|
5
5
|
type ClientContext = {
|
|
6
6
|
baseUri: string;
|
|
7
7
|
apiToken: string;
|
|
8
8
|
customFetch?: CustomFetch;
|
|
9
9
|
};
|
|
10
|
-
export declare function addCommentRequest(context: ClientContext, params:
|
|
10
|
+
export declare function addCommentRequest(context: ClientContext, params: CreateCommentArgs, options?: {
|
|
11
11
|
batch?: boolean;
|
|
12
12
|
threadAction?: ThreadAction;
|
|
13
13
|
}): Promise<Comment> | BatchRequestDescriptor<Comment>;
|
|
@@ -52,7 +52,13 @@ export declare class CommentsClient extends BaseClient {
|
|
|
52
52
|
* @param args - The arguments for creating a comment.
|
|
53
53
|
* @param args.threadId - The thread ID.
|
|
54
54
|
* @param args.content - The comment content.
|
|
55
|
-
* @param args.recipients - Optional array of user IDs to notify.
|
|
55
|
+
* @param args.recipients - Optional array of user IDs to notify directly.
|
|
56
|
+
* @param args.groups - Optional array of custom group IDs to notify.
|
|
57
|
+
* @param args.directMentions - Optional array of user IDs that were @-mentioned in
|
|
58
|
+
* `content`.
|
|
59
|
+
* @param args.notifyAudience - Optional broader audience to notify in addition to
|
|
60
|
+
* `recipients` and `groups`. `'channel'` notifies everyone in the channel;
|
|
61
|
+
* `'thread'` notifies everyone who has interacted with the thread.
|
|
56
62
|
* @param args.attachments - Optional array of attachment objects.
|
|
57
63
|
* @param args.sendAsIntegration - Optional flag to send as integration.
|
|
58
64
|
* @param options - Optional configuration. Set `batch: true` to return a descriptor for batch requests.
|
|
@@ -60,9 +66,12 @@ export declare class CommentsClient extends BaseClient {
|
|
|
60
66
|
*
|
|
61
67
|
* @example
|
|
62
68
|
* ```typescript
|
|
69
|
+
* // Notify everyone who has interacted with the thread, plus two extra users.
|
|
63
70
|
* const comment = await api.comments.createComment({
|
|
64
71
|
* threadId: 789,
|
|
65
|
-
* content: 'Great idea! Let\'s proceed
|
|
72
|
+
* content: 'Great idea! Let\'s proceed.',
|
|
73
|
+
* notifyAudience: 'thread',
|
|
74
|
+
* recipients: [12345, 67890],
|
|
66
75
|
* })
|
|
67
76
|
* ```
|
|
68
77
|
*/
|
|
@@ -330,7 +330,13 @@ export declare class ThreadsClient extends BaseClient {
|
|
|
330
330
|
* @param args.tempId - Optional temporary identifier.
|
|
331
331
|
* @param args.attachments - Optional array of attachment objects.
|
|
332
332
|
* @param args.actions - Optional array of action objects.
|
|
333
|
-
* @param args.recipients - Optional array of user IDs to notify.
|
|
333
|
+
* @param args.recipients - Optional array of user IDs to notify directly.
|
|
334
|
+
* @param args.groups - Optional array of custom group IDs to notify.
|
|
335
|
+
* @param args.directMentions - Optional array of user IDs that were @-mentioned in
|
|
336
|
+
* `content`.
|
|
337
|
+
* @param args.notifyAudience - Optional broader audience to notify in addition to
|
|
338
|
+
* `recipients` and `groups`. `'channel'` notifies everyone in the channel;
|
|
339
|
+
* `'thread'` notifies everyone who has interacted with the thread.
|
|
334
340
|
* @param options - Optional configuration. Set `batch: true` to return a descriptor for batch requests.
|
|
335
341
|
* @returns The created comment object.
|
|
336
342
|
*
|
|
@@ -357,7 +363,13 @@ export declare class ThreadsClient extends BaseClient {
|
|
|
357
363
|
* @param args.tempId - Optional temporary identifier.
|
|
358
364
|
* @param args.attachments - Optional array of attachment objects.
|
|
359
365
|
* @param args.actions - Optional array of action objects.
|
|
360
|
-
* @param args.recipients - Optional array of user IDs to notify.
|
|
366
|
+
* @param args.recipients - Optional array of user IDs to notify directly.
|
|
367
|
+
* @param args.groups - Optional array of custom group IDs to notify.
|
|
368
|
+
* @param args.directMentions - Optional array of user IDs that were @-mentioned in
|
|
369
|
+
* `content`.
|
|
370
|
+
* @param args.notifyAudience - Optional broader audience to notify in addition to
|
|
371
|
+
* `recipients` and `groups`. `'channel'` notifies everyone in the channel;
|
|
372
|
+
* `'thread'` notifies everyone who has interacted with the thread.
|
|
361
373
|
* @param options - Optional configuration. Set `batch: true` to return a descriptor for batch requests.
|
|
362
374
|
* @returns The created comment object.
|
|
363
375
|
*
|
|
@@ -19,3 +19,22 @@ export declare const WORKSPACE_PLANS: readonly ["free", "unlimited"];
|
|
|
19
19
|
* - `'unlimited'` - Unlimited plan
|
|
20
20
|
*/
|
|
21
21
|
export type WorkspacePlan = (typeof WORKSPACE_PLANS)[number];
|
|
22
|
+
export declare const NOTIFY_AUDIENCES: readonly ["channel", "thread"];
|
|
23
|
+
/**
|
|
24
|
+
* The audience to notify when posting a comment, in addition to any
|
|
25
|
+
* individual `recipients` or custom `groups`.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* Possible values:
|
|
29
|
+
* - `'channel'` - Notify everyone in the channel.
|
|
30
|
+
* - `'thread'` - Notify everyone who has interacted with the thread.
|
|
31
|
+
*/
|
|
32
|
+
export type NotifyAudience = (typeof NOTIFY_AUDIENCES)[number];
|
|
33
|
+
/**
|
|
34
|
+
* Internal mapping from {@link NotifyAudience} to the magic group IDs that
|
|
35
|
+
* Twist's `comments/add` endpoint uses on the wire. Exposed here so the
|
|
36
|
+
* audience constants and their encoding stay in a single source of truth;
|
|
37
|
+
* SDK consumers should use {@link NotifyAudience} via `notifyAudience` on the
|
|
38
|
+
* request args rather than passing these IDs directly.
|
|
39
|
+
*/
|
|
40
|
+
export declare const NOTIFY_AUDIENCE_GROUP_IDS: Readonly<Record<NotifyAudience, number>>;
|
|
@@ -47,6 +47,12 @@ export declare const CreateCommentArgsSchema: z.ZodObject<{
|
|
|
47
47
|
attachments: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
48
48
|
actions: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
49
49
|
recipients: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
|
|
50
|
+
groups: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
|
|
51
|
+
directMentions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
|
|
52
|
+
notifyAudience: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
53
|
+
channel: "channel";
|
|
54
|
+
thread: "thread";
|
|
55
|
+
}>>>;
|
|
50
56
|
}, z.core.$strip>;
|
|
51
57
|
export type CreateCommentArgs = z.infer<typeof CreateCommentArgsSchema>;
|
|
52
58
|
export declare const UpdateCommentArgsSchema: z.ZodObject<{
|
|
@@ -234,22 +240,16 @@ export type RemoveChannelUsersArgs = {
|
|
|
234
240
|
};
|
|
235
241
|
export declare const THREAD_ACTIONS: readonly ["close", "reopen"];
|
|
236
242
|
export type ThreadAction = (typeof THREAD_ACTIONS)[number];
|
|
237
|
-
|
|
243
|
+
/**
|
|
244
|
+
* Shared shape for endpoints that post a comment as part of a thread action
|
|
245
|
+
* (close, reopen). Identical to {@link CreateCommentArgs} except the target
|
|
246
|
+
* is identified by `id` (the thread ID) instead of `threadId`.
|
|
247
|
+
*/
|
|
248
|
+
type ThreadActionCommentArgs = Omit<CreateCommentArgs, 'threadId'> & {
|
|
238
249
|
id: number;
|
|
239
|
-
content: string;
|
|
240
|
-
tempId?: number | null;
|
|
241
|
-
attachments?: unknown | null;
|
|
242
|
-
actions?: unknown | null;
|
|
243
|
-
recipients?: number[] | null;
|
|
244
|
-
};
|
|
245
|
-
export type ReopenThreadArgs = {
|
|
246
|
-
id: number;
|
|
247
|
-
content: string;
|
|
248
|
-
tempId?: number | null;
|
|
249
|
-
attachments?: unknown | null;
|
|
250
|
-
actions?: unknown | null;
|
|
251
|
-
recipients?: number[] | null;
|
|
252
250
|
};
|
|
251
|
+
export type CloseThreadArgs = ThreadActionCommentArgs;
|
|
252
|
+
export type ReopenThreadArgs = ThreadActionCommentArgs;
|
|
253
253
|
export type MoveThreadToChannelArgs = {
|
|
254
254
|
id: number;
|
|
255
255
|
toChannel: number;
|