@doist/comms-sdk 0.8.0 → 0.9.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.
|
@@ -420,16 +420,29 @@ exports.UnreadConversationSchema = zod_1.z.object({
|
|
|
420
420
|
directMention: zod_1.z.boolean(),
|
|
421
421
|
});
|
|
422
422
|
// SearchResult entity from API.
|
|
423
|
+
// The API currently only emits 'thread' and 'conversation' results: a match inside a
|
|
424
|
+
// comment is returned as a 'thread' result with `commentId` set, and a match inside a
|
|
425
|
+
// message as a 'conversation' result with `messageId` set.
|
|
423
426
|
exports.SEARCH_RESULT_TYPES = ['thread', 'comment', 'message', 'conversation'];
|
|
424
427
|
exports.SearchResultSchema = zod_1.z.object({
|
|
428
|
+
/**
|
|
429
|
+
* Opaque search-result key in the form `thread_<threadId>` or
|
|
430
|
+
* `conversation_<conversationId>`. Unique per result; not a Comms object id — use
|
|
431
|
+
* `threadId`, `conversationId`, `commentId`, or `messageId` to reference objects.
|
|
432
|
+
*/
|
|
425
433
|
id: zod_1.z.string(),
|
|
426
434
|
type: zod_1.z.enum(exports.SEARCH_RESULT_TYPES),
|
|
427
435
|
snippet: zod_1.z.string(),
|
|
428
436
|
snippetCreatorId: zod_1.z.number(),
|
|
429
437
|
snippetLastUpdated: zod_1.z.date(),
|
|
438
|
+
/** The owning thread id. Set by the API on 'thread' results. */
|
|
430
439
|
threadId: zod_1.z.string().nullable().optional(),
|
|
440
|
+
/** The owning conversation id. Set by the API on 'conversation' results. */
|
|
431
441
|
conversationId: zod_1.z.string().nullable().optional(),
|
|
442
|
+
/** The matched comment id, set on 'thread' results when the match is a comment. */
|
|
432
443
|
commentId: zod_1.z.string().nullable().optional(),
|
|
444
|
+
/** The matched message id, set by the API on 'conversation' results. */
|
|
445
|
+
messageId: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).transform(String).nullable().optional(),
|
|
433
446
|
channelId: zod_1.z.string().nullable().optional(),
|
|
434
447
|
channelName: zod_1.z.string().nullable().optional(),
|
|
435
448
|
channelColor: zod_1.z.number().nullable().optional(),
|
|
@@ -410,16 +410,29 @@ export const UnreadConversationSchema = z.object({
|
|
|
410
410
|
directMention: z.boolean(),
|
|
411
411
|
});
|
|
412
412
|
// SearchResult entity from API.
|
|
413
|
+
// The API currently only emits 'thread' and 'conversation' results: a match inside a
|
|
414
|
+
// comment is returned as a 'thread' result with `commentId` set, and a match inside a
|
|
415
|
+
// message as a 'conversation' result with `messageId` set.
|
|
413
416
|
export const SEARCH_RESULT_TYPES = ['thread', 'comment', 'message', 'conversation'];
|
|
414
417
|
export const SearchResultSchema = z.object({
|
|
418
|
+
/**
|
|
419
|
+
* Opaque search-result key in the form `thread_<threadId>` or
|
|
420
|
+
* `conversation_<conversationId>`. Unique per result; not a Comms object id — use
|
|
421
|
+
* `threadId`, `conversationId`, `commentId`, or `messageId` to reference objects.
|
|
422
|
+
*/
|
|
415
423
|
id: z.string(),
|
|
416
424
|
type: z.enum(SEARCH_RESULT_TYPES),
|
|
417
425
|
snippet: z.string(),
|
|
418
426
|
snippetCreatorId: z.number(),
|
|
419
427
|
snippetLastUpdated: z.date(),
|
|
428
|
+
/** The owning thread id. Set by the API on 'thread' results. */
|
|
420
429
|
threadId: z.string().nullable().optional(),
|
|
430
|
+
/** The owning conversation id. Set by the API on 'conversation' results. */
|
|
421
431
|
conversationId: z.string().nullable().optional(),
|
|
432
|
+
/** The matched comment id, set on 'thread' results when the match is a comment. */
|
|
422
433
|
commentId: z.string().nullable().optional(),
|
|
434
|
+
/** The matched message id, set by the API on 'conversation' results. */
|
|
435
|
+
messageId: z.union([z.string(), z.number()]).transform(String).nullable().optional(),
|
|
423
436
|
channelId: z.string().nullable().optional(),
|
|
424
437
|
channelName: z.string().nullable().optional(),
|
|
425
438
|
channelColor: z.number().nullable().optional(),
|
|
@@ -2818,6 +2818,7 @@ export declare const SearchResultSchema: z.ZodObject<{
|
|
|
2818
2818
|
threadId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2819
2819
|
conversationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2820
2820
|
commentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2821
|
+
messageId: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>>>;
|
|
2821
2822
|
channelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2822
2823
|
channelName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2823
2824
|
channelColor: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|