@relaycast/types 0.2.4 → 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.
Files changed (65) hide show
  1. package/dist/agent.d.ts +139 -35
  2. package/dist/agent.d.ts.map +1 -1
  3. package/dist/agent.js +73 -1
  4. package/dist/agent.js.map +1 -1
  5. package/dist/api.d.ts +50 -19
  6. package/dist/api.d.ts.map +1 -1
  7. package/dist/api.js +22 -1
  8. package/dist/api.js.map +1 -1
  9. package/dist/billing.d.ts +73 -43
  10. package/dist/billing.d.ts.map +1 -1
  11. package/dist/billing.js +44 -1
  12. package/dist/billing.js.map +1 -1
  13. package/dist/channel.d.ts +47 -33
  14. package/dist/channel.d.ts.map +1 -1
  15. package/dist/channel.js +35 -1
  16. package/dist/channel.js.map +1 -1
  17. package/dist/command.d.ts +84 -46
  18. package/dist/command.d.ts.map +1 -1
  19. package/dist/command.js +47 -1
  20. package/dist/command.js.map +1 -1
  21. package/dist/dm.d.ts +48 -32
  22. package/dist/dm.d.ts.map +1 -1
  23. package/dist/dm.js +33 -1
  24. package/dist/dm.js.map +1 -1
  25. package/dist/events.d.ts +509 -153
  26. package/dist/events.d.ts.map +1 -1
  27. package/dist/events.js +206 -1
  28. package/dist/events.js.map +1 -1
  29. package/dist/file.d.ts +52 -37
  30. package/dist/file.d.ts.map +1 -1
  31. package/dist/file.js +38 -1
  32. package/dist/file.js.map +1 -1
  33. package/dist/index.d.ts +0 -1
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +0 -1
  36. package/dist/index.js.map +1 -1
  37. package/dist/message.d.ts +232 -70
  38. package/dist/message.d.ts.map +1 -1
  39. package/dist/message.js +75 -1
  40. package/dist/message.js.map +1 -1
  41. package/dist/reaction.d.ts +19 -15
  42. package/dist/reaction.d.ts.map +1 -1
  43. package/dist/reaction.js +16 -1
  44. package/dist/reaction.js.map +1 -1
  45. package/dist/receipt.d.ts +19 -15
  46. package/dist/receipt.d.ts.map +1 -1
  47. package/dist/receipt.js +16 -1
  48. package/dist/receipt.js.map +1 -1
  49. package/dist/subscription.d.ts +120 -29
  50. package/dist/subscription.d.ts.map +1 -1
  51. package/dist/subscription.js +49 -1
  52. package/dist/subscription.js.map +1 -1
  53. package/dist/webhook.d.ts +40 -34
  54. package/dist/webhook.d.ts.map +1 -1
  55. package/dist/webhook.js +35 -1
  56. package/dist/webhook.js.map +1 -1
  57. package/dist/workspace.d.ts +72 -23
  58. package/dist/workspace.d.ts.map +1 -1
  59. package/dist/workspace.js +57 -1
  60. package/dist/workspace.js.map +1 -1
  61. package/package.json +4 -1
  62. package/dist/dashboard.d.ts +0 -47
  63. package/dist/dashboard.d.ts.map +0 -1
  64. package/dist/dashboard.js +0 -2
  65. package/dist/dashboard.js.map +0 -1
package/dist/message.d.ts CHANGED
@@ -1,71 +1,233 @@
1
- import type { FileAttachment } from './file.js';
2
- import type { ReactionGroup } from './reaction.js';
3
- export interface HeaderBlock {
4
- type: 'header';
5
- text: string;
6
- }
7
- export interface FieldsBlock {
8
- type: 'fields';
9
- fields: Array<{
10
- label: string;
11
- value: string;
12
- }>;
13
- }
14
- export interface ActionButton {
15
- type: 'button';
16
- text: string;
17
- action_id: string;
18
- value?: string;
19
- style?: 'primary' | 'danger';
20
- }
21
- export interface ActionsBlock {
22
- type: 'actions';
23
- elements: ActionButton[];
24
- }
25
- export interface TextBlock {
26
- type: 'text';
27
- text: string;
28
- }
29
- export interface DividerBlock {
30
- type: 'divider';
31
- }
32
- export type MessageBlock = HeaderBlock | FieldsBlock | ActionsBlock | TextBlock | DividerBlock;
33
- export interface Message {
34
- id: string;
35
- workspace_id: string;
36
- channel_id: string;
37
- agent_id: string;
38
- thread_id: string | null;
39
- body: string;
40
- blocks: MessageBlock[] | null;
41
- has_attachments: boolean;
42
- created_at: string;
43
- updated_at: string | null;
44
- }
45
- export interface MessageWithMeta {
46
- id: string;
47
- agent_name: string;
48
- agent_id: string;
49
- text: string;
50
- blocks: MessageBlock[] | null;
51
- attachments: FileAttachment[];
52
- created_at: string;
53
- reply_count: number;
54
- reactions: ReactionGroup[];
55
- read_by_count: number;
56
- }
57
- export interface PostMessageRequest {
58
- text: string;
59
- blocks?: MessageBlock[];
60
- attachments?: string[];
61
- }
62
- export interface MessageListQuery {
63
- limit?: number;
64
- before?: string;
65
- after?: string;
66
- }
67
- export interface ThreadReplyRequest {
68
- text: string;
69
- blocks?: MessageBlock[];
70
- }
1
+ import { z } from 'zod';
2
+ export declare const HeaderBlockSchema: z.ZodObject<{
3
+ type: z.ZodLiteral<"header">;
4
+ text: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export type HeaderBlock = z.infer<typeof HeaderBlockSchema>;
7
+ export declare const FieldsBlockSchema: z.ZodObject<{
8
+ type: z.ZodLiteral<"fields">;
9
+ fields: z.ZodArray<z.ZodObject<{
10
+ label: z.ZodString;
11
+ value: z.ZodString;
12
+ }, z.core.$strip>>;
13
+ }, z.core.$strip>;
14
+ export type FieldsBlock = z.infer<typeof FieldsBlockSchema>;
15
+ export declare const ActionButtonSchema: z.ZodObject<{
16
+ type: z.ZodLiteral<"button">;
17
+ text: z.ZodString;
18
+ action_id: z.ZodString;
19
+ value: z.ZodOptional<z.ZodString>;
20
+ style: z.ZodOptional<z.ZodEnum<{
21
+ primary: "primary";
22
+ danger: "danger";
23
+ }>>;
24
+ }, z.core.$strip>;
25
+ export type ActionButton = z.infer<typeof ActionButtonSchema>;
26
+ export declare const ActionsBlockSchema: z.ZodObject<{
27
+ type: z.ZodLiteral<"actions">;
28
+ elements: z.ZodArray<z.ZodObject<{
29
+ type: z.ZodLiteral<"button">;
30
+ text: z.ZodString;
31
+ action_id: z.ZodString;
32
+ value: z.ZodOptional<z.ZodString>;
33
+ style: z.ZodOptional<z.ZodEnum<{
34
+ primary: "primary";
35
+ danger: "danger";
36
+ }>>;
37
+ }, z.core.$strip>>;
38
+ }, z.core.$strip>;
39
+ export type ActionsBlock = z.infer<typeof ActionsBlockSchema>;
40
+ export declare const TextBlockSchema: z.ZodObject<{
41
+ type: z.ZodLiteral<"text">;
42
+ text: z.ZodString;
43
+ }, z.core.$strip>;
44
+ export type TextBlock = z.infer<typeof TextBlockSchema>;
45
+ export declare const DividerBlockSchema: z.ZodObject<{
46
+ type: z.ZodLiteral<"divider">;
47
+ }, z.core.$strip>;
48
+ export type DividerBlock = z.infer<typeof DividerBlockSchema>;
49
+ export declare const MessageBlockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
50
+ type: z.ZodLiteral<"header">;
51
+ text: z.ZodString;
52
+ }, z.core.$strip>, z.ZodObject<{
53
+ type: z.ZodLiteral<"fields">;
54
+ fields: z.ZodArray<z.ZodObject<{
55
+ label: z.ZodString;
56
+ value: z.ZodString;
57
+ }, z.core.$strip>>;
58
+ }, z.core.$strip>, z.ZodObject<{
59
+ type: z.ZodLiteral<"actions">;
60
+ elements: z.ZodArray<z.ZodObject<{
61
+ type: z.ZodLiteral<"button">;
62
+ text: z.ZodString;
63
+ action_id: z.ZodString;
64
+ value: z.ZodOptional<z.ZodString>;
65
+ style: z.ZodOptional<z.ZodEnum<{
66
+ primary: "primary";
67
+ danger: "danger";
68
+ }>>;
69
+ }, z.core.$strip>>;
70
+ }, z.core.$strip>, z.ZodObject<{
71
+ type: z.ZodLiteral<"text">;
72
+ text: z.ZodString;
73
+ }, z.core.$strip>, z.ZodObject<{
74
+ type: z.ZodLiteral<"divider">;
75
+ }, z.core.$strip>], "type">;
76
+ export type MessageBlock = z.infer<typeof MessageBlockSchema>;
77
+ export declare const MessageSchema: z.ZodObject<{
78
+ id: z.ZodString;
79
+ workspace_id: z.ZodString;
80
+ channel_id: z.ZodString;
81
+ agent_id: z.ZodString;
82
+ thread_id: z.ZodNullable<z.ZodString>;
83
+ body: z.ZodString;
84
+ blocks: z.ZodNullable<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
85
+ type: z.ZodLiteral<"header">;
86
+ text: z.ZodString;
87
+ }, z.core.$strip>, z.ZodObject<{
88
+ type: z.ZodLiteral<"fields">;
89
+ fields: z.ZodArray<z.ZodObject<{
90
+ label: z.ZodString;
91
+ value: z.ZodString;
92
+ }, z.core.$strip>>;
93
+ }, z.core.$strip>, z.ZodObject<{
94
+ type: z.ZodLiteral<"actions">;
95
+ elements: z.ZodArray<z.ZodObject<{
96
+ type: z.ZodLiteral<"button">;
97
+ text: z.ZodString;
98
+ action_id: z.ZodString;
99
+ value: z.ZodOptional<z.ZodString>;
100
+ style: z.ZodOptional<z.ZodEnum<{
101
+ primary: "primary";
102
+ danger: "danger";
103
+ }>>;
104
+ }, z.core.$strip>>;
105
+ }, z.core.$strip>, z.ZodObject<{
106
+ type: z.ZodLiteral<"text">;
107
+ text: z.ZodString;
108
+ }, z.core.$strip>, z.ZodObject<{
109
+ type: z.ZodLiteral<"divider">;
110
+ }, z.core.$strip>], "type">>>;
111
+ has_attachments: z.ZodBoolean;
112
+ created_at: z.ZodString;
113
+ updated_at: z.ZodNullable<z.ZodString>;
114
+ }, z.core.$strip>;
115
+ export type Message = z.infer<typeof MessageSchema>;
116
+ export declare const MessageWithMetaSchema: z.ZodObject<{
117
+ id: z.ZodString;
118
+ agent_name: z.ZodString;
119
+ agent_id: z.ZodString;
120
+ text: z.ZodString;
121
+ blocks: z.ZodNullable<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
122
+ type: z.ZodLiteral<"header">;
123
+ text: z.ZodString;
124
+ }, z.core.$strip>, z.ZodObject<{
125
+ type: z.ZodLiteral<"fields">;
126
+ fields: z.ZodArray<z.ZodObject<{
127
+ label: z.ZodString;
128
+ value: z.ZodString;
129
+ }, z.core.$strip>>;
130
+ }, z.core.$strip>, z.ZodObject<{
131
+ type: z.ZodLiteral<"actions">;
132
+ elements: z.ZodArray<z.ZodObject<{
133
+ type: z.ZodLiteral<"button">;
134
+ text: z.ZodString;
135
+ action_id: z.ZodString;
136
+ value: z.ZodOptional<z.ZodString>;
137
+ style: z.ZodOptional<z.ZodEnum<{
138
+ primary: "primary";
139
+ danger: "danger";
140
+ }>>;
141
+ }, z.core.$strip>>;
142
+ }, z.core.$strip>, z.ZodObject<{
143
+ type: z.ZodLiteral<"text">;
144
+ text: z.ZodString;
145
+ }, z.core.$strip>, z.ZodObject<{
146
+ type: z.ZodLiteral<"divider">;
147
+ }, z.core.$strip>], "type">>>;
148
+ attachments: z.ZodArray<z.ZodObject<{
149
+ file_id: z.ZodString;
150
+ filename: z.ZodString;
151
+ url: z.ZodString;
152
+ size: z.ZodNumber;
153
+ }, z.core.$strip>>;
154
+ created_at: z.ZodString;
155
+ reply_count: z.ZodNumber;
156
+ reactions: z.ZodArray<z.ZodObject<{
157
+ emoji: z.ZodString;
158
+ count: z.ZodNumber;
159
+ agents: z.ZodArray<z.ZodString>;
160
+ }, z.core.$strip>>;
161
+ read_by_count: z.ZodNumber;
162
+ }, z.core.$strip>;
163
+ export type MessageWithMeta = z.infer<typeof MessageWithMetaSchema>;
164
+ export declare const PostMessageRequestSchema: z.ZodObject<{
165
+ text: z.ZodString;
166
+ blocks: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
167
+ type: z.ZodLiteral<"header">;
168
+ text: z.ZodString;
169
+ }, z.core.$strip>, z.ZodObject<{
170
+ type: z.ZodLiteral<"fields">;
171
+ fields: z.ZodArray<z.ZodObject<{
172
+ label: z.ZodString;
173
+ value: z.ZodString;
174
+ }, z.core.$strip>>;
175
+ }, z.core.$strip>, z.ZodObject<{
176
+ type: z.ZodLiteral<"actions">;
177
+ elements: z.ZodArray<z.ZodObject<{
178
+ type: z.ZodLiteral<"button">;
179
+ text: z.ZodString;
180
+ action_id: z.ZodString;
181
+ value: z.ZodOptional<z.ZodString>;
182
+ style: z.ZodOptional<z.ZodEnum<{
183
+ primary: "primary";
184
+ danger: "danger";
185
+ }>>;
186
+ }, z.core.$strip>>;
187
+ }, z.core.$strip>, z.ZodObject<{
188
+ type: z.ZodLiteral<"text">;
189
+ text: z.ZodString;
190
+ }, z.core.$strip>, z.ZodObject<{
191
+ type: z.ZodLiteral<"divider">;
192
+ }, z.core.$strip>], "type">>>;
193
+ attachments: z.ZodOptional<z.ZodArray<z.ZodString>>;
194
+ }, z.core.$strip>;
195
+ export type PostMessageRequest = z.infer<typeof PostMessageRequestSchema>;
196
+ export declare const MessageListQuerySchema: z.ZodObject<{
197
+ limit: z.ZodOptional<z.ZodNumber>;
198
+ before: z.ZodOptional<z.ZodString>;
199
+ after: z.ZodOptional<z.ZodString>;
200
+ }, z.core.$strip>;
201
+ export type MessageListQuery = z.infer<typeof MessageListQuerySchema>;
202
+ export declare const ThreadReplyRequestSchema: z.ZodObject<{
203
+ text: z.ZodString;
204
+ blocks: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
205
+ type: z.ZodLiteral<"header">;
206
+ text: z.ZodString;
207
+ }, z.core.$strip>, z.ZodObject<{
208
+ type: z.ZodLiteral<"fields">;
209
+ fields: z.ZodArray<z.ZodObject<{
210
+ label: z.ZodString;
211
+ value: z.ZodString;
212
+ }, z.core.$strip>>;
213
+ }, z.core.$strip>, z.ZodObject<{
214
+ type: z.ZodLiteral<"actions">;
215
+ elements: z.ZodArray<z.ZodObject<{
216
+ type: z.ZodLiteral<"button">;
217
+ text: z.ZodString;
218
+ action_id: z.ZodString;
219
+ value: z.ZodOptional<z.ZodString>;
220
+ style: z.ZodOptional<z.ZodEnum<{
221
+ primary: "primary";
222
+ danger: "danger";
223
+ }>>;
224
+ }, z.core.$strip>>;
225
+ }, z.core.$strip>, z.ZodObject<{
226
+ type: z.ZodLiteral<"text">;
227
+ text: z.ZodString;
228
+ }, z.core.$strip>, z.ZodObject<{
229
+ type: z.ZodLiteral<"divider">;
230
+ }, z.core.$strip>], "type">>>;
231
+ }, z.core.$strip>;
232
+ export type ThreadReplyRequest = z.infer<typeof ThreadReplyRequestSchema>;
71
233
  //# sourceMappingURL=message.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"message.d.ts","s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sB,CAAC,CAAC;AAEtE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
package/dist/message.js CHANGED
@@ -1,2 +1,76 @@
1
- export {};
1
+ import { z } from 'zod';
2
+ import { FileAttachmentSchema } from './file.js';
3
+ import { ReactionGroupSchema } from './reaction.js';
4
+ // Rich Message Blocks
5
+ export const HeaderBlockSchema = z.object({
6
+ type: z.literal('header'),
7
+ text: z.string(),
8
+ });
9
+ export const FieldsBlockSchema = z.object({
10
+ type: z.literal('fields'),
11
+ fields: z.array(z.object({ label: z.string(), value: z.string() })),
12
+ });
13
+ export const ActionButtonSchema = z.object({
14
+ type: z.literal('button'),
15
+ text: z.string(),
16
+ action_id: z.string(),
17
+ value: z.string().optional(),
18
+ style: z.enum(['primary', 'danger']).optional(),
19
+ });
20
+ export const ActionsBlockSchema = z.object({
21
+ type: z.literal('actions'),
22
+ elements: z.array(ActionButtonSchema),
23
+ });
24
+ export const TextBlockSchema = z.object({
25
+ type: z.literal('text'),
26
+ text: z.string(),
27
+ });
28
+ export const DividerBlockSchema = z.object({
29
+ type: z.literal('divider'),
30
+ });
31
+ export const MessageBlockSchema = z.discriminatedUnion('type', [
32
+ HeaderBlockSchema,
33
+ FieldsBlockSchema,
34
+ ActionsBlockSchema,
35
+ TextBlockSchema,
36
+ DividerBlockSchema,
37
+ ]);
38
+ export const MessageSchema = z.object({
39
+ id: z.string(),
40
+ workspace_id: z.string(),
41
+ channel_id: z.string(),
42
+ agent_id: z.string(),
43
+ thread_id: z.string().nullable(),
44
+ body: z.string(),
45
+ blocks: z.array(MessageBlockSchema).nullable(),
46
+ has_attachments: z.boolean(),
47
+ created_at: z.string(),
48
+ updated_at: z.string().nullable(),
49
+ });
50
+ export const MessageWithMetaSchema = z.object({
51
+ id: z.string(),
52
+ agent_name: z.string(),
53
+ agent_id: z.string(),
54
+ text: z.string(),
55
+ blocks: z.array(MessageBlockSchema).nullable(),
56
+ attachments: z.array(FileAttachmentSchema),
57
+ created_at: z.string(),
58
+ reply_count: z.number(),
59
+ reactions: z.array(ReactionGroupSchema),
60
+ read_by_count: z.number(),
61
+ });
62
+ export const PostMessageRequestSchema = z.object({
63
+ text: z.string(),
64
+ blocks: z.array(MessageBlockSchema).optional(),
65
+ attachments: z.array(z.string()).optional(),
66
+ });
67
+ export const MessageListQuerySchema = z.object({
68
+ limit: z.number().optional(),
69
+ before: z.string().optional(),
70
+ after: z.string().optional(),
71
+ });
72
+ export const ThreadReplyRequestSchema = z.object({
73
+ text: z.string(),
74
+ blocks: z.array(MessageBlockSchema).optional(),
75
+ });
2
76
  //# sourceMappingURL=message.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"message.js","sourceRoot":"","sources":["../src/message.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"message.js","sourceRoot":"","sources":["../src/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,sBAAsB;AAEtB,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IACzB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IACzB,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,M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,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC5C,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,QAAQ,EAAE;CAC/C,CAAC,CAAC"}
@@ -1,16 +1,20 @@
1
- export interface Reaction {
2
- id: string;
3
- message_id: string;
4
- agent_id: string;
5
- emoji: string;
6
- created_at: string;
7
- }
8
- export interface AddReactionRequest {
9
- emoji: string;
10
- }
11
- export interface ReactionGroup {
12
- emoji: string;
13
- count: number;
14
- agents: string[];
15
- }
1
+ import { z } from 'zod';
2
+ export declare const ReactionSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ message_id: z.ZodString;
5
+ agent_id: z.ZodString;
6
+ emoji: z.ZodString;
7
+ created_at: z.ZodString;
8
+ }, z.core.$strip>;
9
+ export type Reaction = z.infer<typeof ReactionSchema>;
10
+ export declare const AddReactionRequestSchema: z.ZodObject<{
11
+ emoji: z.ZodString;
12
+ }, z.core.$strip>;
13
+ export type AddReactionRequest = z.infer<typeof AddReactionRequestSchema>;
14
+ export declare const ReactionGroupSchema: z.ZodObject<{
15
+ emoji: z.ZodString;
16
+ count: z.ZodNumber;
17
+ agents: z.ZodArray<z.ZodString>;
18
+ }, z.core.$strip>;
19
+ export type ReactionGroup = z.infer<typeof ReactionGroupSchema>;
16
20
  //# sourceMappingURL=reaction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reaction.d.ts","sourceRoot":"","sources":["../src/reaction.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB"}
1
+ {"version":3,"file":"reaction.d.ts","sourceRoot":"","sources":["../src/reaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc;;;;;;iBAMzB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,eAAO,MAAM,wBAAwB;;iBAEnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,mBAAmB;;;;iBAI9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
package/dist/reaction.js CHANGED
@@ -1,2 +1,17 @@
1
- export {};
1
+ import { z } from 'zod';
2
+ export const ReactionSchema = z.object({
3
+ id: z.string(),
4
+ message_id: z.string(),
5
+ agent_id: z.string(),
6
+ emoji: z.string(),
7
+ created_at: z.string(),
8
+ });
9
+ export const AddReactionRequestSchema = z.object({
10
+ emoji: z.string(),
11
+ });
12
+ export const ReactionGroupSchema = z.object({
13
+ emoji: z.string(),
14
+ count: z.number(),
15
+ agents: z.array(z.string()),
16
+ });
2
17
  //# sourceMappingURL=reaction.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reaction.js","sourceRoot":"","sources":["../src/reaction.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"reaction.js","sourceRoot":"","sources":["../src/reaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC5B,CAAC,CAAC"}
package/dist/receipt.d.ts CHANGED
@@ -1,16 +1,20 @@
1
- export interface ReadReceipt {
2
- message_id: string;
3
- agent_id: string;
4
- read_at: string;
5
- }
6
- export interface ReaderInfo {
7
- agent_name: string;
8
- agent_id: string;
9
- read_at: string;
10
- }
11
- export interface ChannelReadStatus {
12
- agent_name: string;
13
- last_read_id: string | null;
14
- last_read_at: string | null;
15
- }
1
+ import { z } from 'zod';
2
+ export declare const ReadReceiptSchema: z.ZodObject<{
3
+ message_id: z.ZodString;
4
+ agent_id: z.ZodString;
5
+ read_at: z.ZodString;
6
+ }, z.core.$strip>;
7
+ export type ReadReceipt = z.infer<typeof ReadReceiptSchema>;
8
+ export declare const ReaderInfoSchema: z.ZodObject<{
9
+ agent_name: z.ZodString;
10
+ agent_id: z.ZodString;
11
+ read_at: z.ZodString;
12
+ }, z.core.$strip>;
13
+ export type ReaderInfo = z.infer<typeof ReaderInfoSchema>;
14
+ export declare const ChannelReadStatusSchema: z.ZodObject<{
15
+ agent_name: z.ZodString;
16
+ last_read_id: z.ZodNullable<z.ZodString>;
17
+ last_read_at: z.ZodNullable<z.ZodString>;
18
+ }, z.core.$strip>;
19
+ export type ChannelReadStatus = z.infer<typeof ChannelReadStatusSchema>;
16
20
  //# sourceMappingURL=receipt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"receipt.d.ts","sourceRoot":"","sources":["../src/receipt.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B"}
1
+ {"version":3,"file":"receipt.d.ts","sourceRoot":"","sources":["../src/receipt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,iBAAiB;;;;iBAI5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,gBAAgB;;;;iBAI3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,uBAAuB;;;;iBAIlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
package/dist/receipt.js CHANGED
@@ -1,2 +1,17 @@
1
- export {};
1
+ import { z } from 'zod';
2
+ export const ReadReceiptSchema = z.object({
3
+ message_id: z.string(),
4
+ agent_id: z.string(),
5
+ read_at: z.string(),
6
+ });
7
+ export const ReaderInfoSchema = z.object({
8
+ agent_name: z.string(),
9
+ agent_id: z.string(),
10
+ read_at: z.string(),
11
+ });
12
+ export const ChannelReadStatusSchema = z.object({
13
+ agent_name: z.string(),
14
+ last_read_id: z.string().nullable(),
15
+ last_read_at: z.string().nullable(),
16
+ });
2
17
  //# sourceMappingURL=receipt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"receipt.js","sourceRoot":"","sources":["../src/receipt.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"receipt.js","sourceRoot":"","sources":["../src/receipt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACpC,CAAC,CAAC"}