@doist/twist-sdk 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/clients/comments-client.js +6 -2
- package/dist/cjs/types/requests.js +2 -0
- package/dist/esm/clients/comments-client.js +6 -2
- package/dist/esm/types/requests.js +2 -0
- package/dist/types/clients/comments-client.d.ts +4 -2
- package/dist/types/types/requests.d.ts +6 -1
- package/package.json +1 -1
|
@@ -31,11 +31,15 @@ var CommentsClient = /** @class */ (function (_super) {
|
|
|
31
31
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
32
32
|
}
|
|
33
33
|
CommentsClient.prototype.getComments = function (args, options) {
|
|
34
|
+
var _a;
|
|
34
35
|
var params = {
|
|
35
36
|
thread_id: args.threadId,
|
|
36
37
|
};
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
var newerThan = (_a = args.newerThan) !== null && _a !== void 0 ? _a : args.from;
|
|
39
|
+
if (newerThan)
|
|
40
|
+
params.newer_than_ts = Math.floor(newerThan.getTime() / 1000);
|
|
41
|
+
if (args.olderThan)
|
|
42
|
+
params.older_than_ts = Math.floor(args.olderThan.getTime() / 1000);
|
|
39
43
|
if (args.limit)
|
|
40
44
|
params.limit = args.limit;
|
|
41
45
|
var method = 'GET';
|
|
@@ -80,6 +80,8 @@ exports.GetThreadsArgsSchema = zod_1.z.object({
|
|
|
80
80
|
exports.GetCommentsArgsSchema = zod_1.z.object({
|
|
81
81
|
threadId: zod_1.z.number(),
|
|
82
82
|
from: zod_1.z.date().nullable().optional(),
|
|
83
|
+
newerThan: zod_1.z.date().nullable().optional(),
|
|
84
|
+
olderThan: zod_1.z.date().nullable().optional(),
|
|
83
85
|
limit: zod_1.z.number().nullable().optional(),
|
|
84
86
|
});
|
|
85
87
|
exports.GetConversationsArgsSchema = zod_1.z.object({
|
|
@@ -28,11 +28,15 @@ var CommentsClient = /** @class */ (function (_super) {
|
|
|
28
28
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
29
29
|
}
|
|
30
30
|
CommentsClient.prototype.getComments = function (args, options) {
|
|
31
|
+
var _a;
|
|
31
32
|
var params = {
|
|
32
33
|
thread_id: args.threadId,
|
|
33
34
|
};
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
var newerThan = (_a = args.newerThan) !== null && _a !== void 0 ? _a : args.from;
|
|
36
|
+
if (newerThan)
|
|
37
|
+
params.newer_than_ts = Math.floor(newerThan.getTime() / 1000);
|
|
38
|
+
if (args.olderThan)
|
|
39
|
+
params.older_than_ts = Math.floor(args.olderThan.getTime() / 1000);
|
|
36
40
|
if (args.limit)
|
|
37
41
|
params.limit = args.limit;
|
|
38
42
|
var method = 'GET';
|
|
@@ -77,6 +77,8 @@ export var GetThreadsArgsSchema = z.object({
|
|
|
77
77
|
export var GetCommentsArgsSchema = z.object({
|
|
78
78
|
threadId: z.number(),
|
|
79
79
|
from: z.date().nullable().optional(),
|
|
80
|
+
newerThan: z.date().nullable().optional(),
|
|
81
|
+
olderThan: z.date().nullable().optional(),
|
|
80
82
|
limit: z.number().nullable().optional(),
|
|
81
83
|
});
|
|
82
84
|
export var GetConversationsArgsSchema = z.object({
|
|
@@ -11,7 +11,9 @@ export declare class CommentsClient extends BaseClient {
|
|
|
11
11
|
*
|
|
12
12
|
* @param args - The arguments for getting comments.
|
|
13
13
|
* @param args.threadId - The thread ID.
|
|
14
|
-
* @param args.from -
|
|
14
|
+
* @param args.from - @deprecated Use `newerThan` instead.
|
|
15
|
+
* @param args.newerThan - Optional date to get comments newer than.
|
|
16
|
+
* @param args.olderThan - Optional date to get comments older than.
|
|
15
17
|
* @param args.limit - Optional limit on number of comments returned.
|
|
16
18
|
* @param options - Optional configuration. Set `batch: true` to return a descriptor for batch requests.
|
|
17
19
|
* @returns An array of comment objects.
|
|
@@ -20,7 +22,7 @@ export declare class CommentsClient extends BaseClient {
|
|
|
20
22
|
* ```typescript
|
|
21
23
|
* const comments = await api.comments.getComments({
|
|
22
24
|
* threadId: 789,
|
|
23
|
-
*
|
|
25
|
+
* newerThan: new Date('2024-01-01')
|
|
24
26
|
* })
|
|
25
27
|
* comments.forEach(c => console.log(c.content))
|
|
26
28
|
* ```
|
|
@@ -81,9 +81,14 @@ export type GetThreadsArgs = z.infer<typeof GetThreadsArgsSchema>;
|
|
|
81
81
|
export declare const GetCommentsArgsSchema: z.ZodObject<{
|
|
82
82
|
threadId: z.ZodNumber;
|
|
83
83
|
from: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
84
|
+
newerThan: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
85
|
+
olderThan: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
84
86
|
limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
85
87
|
}, z.core.$strip>;
|
|
86
|
-
export type GetCommentsArgs = z.infer<typeof GetCommentsArgsSchema
|
|
88
|
+
export type GetCommentsArgs = Omit<z.infer<typeof GetCommentsArgsSchema>, 'from'> & {
|
|
89
|
+
/** @deprecated Use `newerThan` instead. */
|
|
90
|
+
from?: Date | null;
|
|
91
|
+
};
|
|
87
92
|
export declare const GetConversationsArgsSchema: z.ZodObject<{
|
|
88
93
|
workspaceId: z.ZodNumber;
|
|
89
94
|
archived: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|