@llun/activities.schema 0.0.5 → 0.0.7

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.
@@ -0,0 +1,15 @@
1
+ import { z } from "zod";
2
+ export declare const PropertyValue: z.ZodObject<{
3
+ type: z.ZodLiteral<"PropertyValue">;
4
+ name: z.ZodString;
5
+ value: z.ZodString;
6
+ }, "strip", z.ZodTypeAny, {
7
+ type: "PropertyValue";
8
+ value: string;
9
+ name: string;
10
+ }, {
11
+ type: "PropertyValue";
12
+ value: string;
13
+ name: string;
14
+ }>;
15
+ export type PropertyValue = z.infer<typeof PropertyValue>;
@@ -0,0 +1,6 @@
1
+ import { z } from "zod";
2
+ export const PropertyValue = z.object({
3
+ type: z.literal("PropertyValue"),
4
+ name: z.string(),
5
+ value: z.string(),
6
+ });
package/dist/note.d.ts CHANGED
@@ -2,16 +2,143 @@ import { z } from "zod";
2
2
  export declare const Note: z.ZodObject<{
3
3
  id: z.ZodString;
4
4
  url: z.ZodString;
5
+ updated: z.ZodOptional<z.ZodString>;
5
6
  attributedTo: z.ZodString;
6
7
  to: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
7
8
  cc: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
8
- inReplyTo: z.ZodOptional<z.ZodString>;
9
+ inReplyTo: z.ZodNullable<z.ZodString>;
9
10
  summary: z.ZodOptional<z.ZodString>;
10
11
  summaryMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
11
12
  content: z.ZodOptional<z.ZodString>;
12
13
  contentMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
14
+ attachment: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
15
+ type: z.ZodLiteral<"PropertyValue">;
16
+ name: z.ZodString;
17
+ value: z.ZodString;
18
+ }, "strip", z.ZodTypeAny, {
19
+ type: "PropertyValue";
20
+ value: string;
21
+ name: string;
22
+ }, {
23
+ type: "PropertyValue";
24
+ value: string;
25
+ name: string;
26
+ }>, z.ZodObject<{
27
+ type: z.ZodLiteral<"Document">;
28
+ mediaType: z.ZodString;
29
+ url: z.ZodString;
30
+ blurhash: z.ZodOptional<z.ZodString>;
31
+ width: z.ZodOptional<z.ZodNumber>;
32
+ height: z.ZodOptional<z.ZodNumber>;
33
+ name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
34
+ focalPoint: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
35
+ }, "strip", z.ZodTypeAny, {
36
+ type: "Document";
37
+ mediaType: string;
38
+ url: string;
39
+ blurhash?: string | undefined;
40
+ width?: number | undefined;
41
+ height?: number | undefined;
42
+ name?: string | null | undefined;
43
+ focalPoint?: [number, number] | undefined;
44
+ }, {
45
+ type: "Document";
46
+ mediaType: string;
47
+ url: string;
48
+ blurhash?: string | undefined;
49
+ width?: number | undefined;
50
+ height?: number | undefined;
51
+ name?: string | null | undefined;
52
+ focalPoint?: [number, number] | undefined;
53
+ }>]>, z.ZodArray<z.ZodUnion<[z.ZodObject<{
54
+ type: z.ZodLiteral<"PropertyValue">;
55
+ name: z.ZodString;
56
+ value: z.ZodString;
57
+ }, "strip", z.ZodTypeAny, {
58
+ type: "PropertyValue";
59
+ value: string;
60
+ name: string;
61
+ }, {
62
+ type: "PropertyValue";
63
+ value: string;
64
+ name: string;
65
+ }>, z.ZodObject<{
66
+ type: z.ZodLiteral<"Document">;
67
+ mediaType: z.ZodString;
68
+ url: z.ZodString;
69
+ blurhash: z.ZodOptional<z.ZodString>;
70
+ width: z.ZodOptional<z.ZodNumber>;
71
+ height: z.ZodOptional<z.ZodNumber>;
72
+ name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
73
+ focalPoint: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
74
+ }, "strip", z.ZodTypeAny, {
75
+ type: "Document";
76
+ mediaType: string;
77
+ url: string;
78
+ blurhash?: string | undefined;
79
+ width?: number | undefined;
80
+ height?: number | undefined;
81
+ name?: string | null | undefined;
82
+ focalPoint?: [number, number] | undefined;
83
+ }, {
84
+ type: "Document";
85
+ mediaType: string;
86
+ url: string;
87
+ blurhash?: string | undefined;
88
+ width?: number | undefined;
89
+ height?: number | undefined;
90
+ name?: string | null | undefined;
91
+ focalPoint?: [number, number] | undefined;
92
+ }>]>, "many">]>>;
93
+ tag: z.ZodArray<z.ZodUnion<[z.ZodObject<{
94
+ type: z.ZodLiteral<"Mention">;
95
+ href: z.ZodString;
96
+ name: z.ZodString;
97
+ }, "strip", z.ZodTypeAny, {
98
+ type: "Mention";
99
+ name: string;
100
+ href: string;
101
+ }, {
102
+ type: "Mention";
103
+ name: string;
104
+ href: string;
105
+ }>, z.ZodObject<{
106
+ type: z.ZodLiteral<"Emoji">;
107
+ name: z.ZodString;
108
+ updated: z.ZodString;
109
+ icon: z.ZodObject<{
110
+ type: z.ZodLiteral<"Image">;
111
+ mediaType: z.ZodString;
112
+ url: z.ZodString;
113
+ }, "strip", z.ZodTypeAny, {
114
+ type: "Image";
115
+ mediaType: string;
116
+ url: string;
117
+ }, {
118
+ type: "Image";
119
+ mediaType: string;
120
+ url: string;
121
+ }>;
122
+ }, "strip", z.ZodTypeAny, {
123
+ type: "Emoji";
124
+ name: string;
125
+ updated: string;
126
+ icon: {
127
+ type: "Image";
128
+ mediaType: string;
129
+ url: string;
130
+ };
131
+ }, {
132
+ type: "Emoji";
133
+ name: string;
134
+ updated: string;
135
+ icon: {
136
+ type: "Image";
137
+ mediaType: string;
138
+ url: string;
139
+ };
140
+ }>]>, "many">;
13
141
  published: z.ZodString;
14
- updated: z.ZodOptional<z.ZodString>;
15
142
  type: z.ZodLiteral<"Note">;
16
143
  }, "strip", z.ZodTypeAny, {
17
144
  id: string;
@@ -20,13 +147,54 @@ export declare const Note: z.ZodObject<{
20
147
  attributedTo: string;
21
148
  to: (string | string[]) & (string | string[] | undefined);
22
149
  cc: (string | string[]) & (string | string[] | undefined);
150
+ inReplyTo: string | null;
151
+ tag: ({
152
+ type: "Emoji";
153
+ name: string;
154
+ updated: string;
155
+ icon: {
156
+ type: "Image";
157
+ mediaType: string;
158
+ url: string;
159
+ };
160
+ } | {
161
+ type: "Mention";
162
+ name: string;
163
+ href: string;
164
+ })[];
23
165
  published: string;
24
- inReplyTo?: string | undefined;
166
+ updated?: string | undefined;
25
167
  summary?: string | undefined;
26
168
  summaryMap?: Record<string, string> | undefined;
27
169
  content?: string | undefined;
28
170
  contentMap?: Record<string, string> | undefined;
29
- updated?: string | undefined;
171
+ attachment?: {
172
+ type: "Document";
173
+ mediaType: string;
174
+ url: string;
175
+ blurhash?: string | undefined;
176
+ width?: number | undefined;
177
+ height?: number | undefined;
178
+ name?: string | null | undefined;
179
+ focalPoint?: [number, number] | undefined;
180
+ } | {
181
+ type: "PropertyValue";
182
+ value: string;
183
+ name: string;
184
+ } | ({
185
+ type: "Document";
186
+ mediaType: string;
187
+ url: string;
188
+ blurhash?: string | undefined;
189
+ width?: number | undefined;
190
+ height?: number | undefined;
191
+ name?: string | null | undefined;
192
+ focalPoint?: [number, number] | undefined;
193
+ } | {
194
+ type: "PropertyValue";
195
+ value: string;
196
+ name: string;
197
+ })[] | undefined;
30
198
  }, {
31
199
  id: string;
32
200
  type: "Note";
@@ -34,12 +202,53 @@ export declare const Note: z.ZodObject<{
34
202
  attributedTo: string;
35
203
  to: (string | string[]) & (string | string[] | undefined);
36
204
  cc: (string | string[]) & (string | string[] | undefined);
205
+ inReplyTo: string | null;
206
+ tag: ({
207
+ type: "Emoji";
208
+ name: string;
209
+ updated: string;
210
+ icon: {
211
+ type: "Image";
212
+ mediaType: string;
213
+ url: string;
214
+ };
215
+ } | {
216
+ type: "Mention";
217
+ name: string;
218
+ href: string;
219
+ })[];
37
220
  published: string;
38
- inReplyTo?: string | undefined;
221
+ updated?: string | undefined;
39
222
  summary?: string | undefined;
40
223
  summaryMap?: Record<string, string> | undefined;
41
224
  content?: string | undefined;
42
225
  contentMap?: Record<string, string> | undefined;
43
- updated?: string | undefined;
226
+ attachment?: {
227
+ type: "Document";
228
+ mediaType: string;
229
+ url: string;
230
+ blurhash?: string | undefined;
231
+ width?: number | undefined;
232
+ height?: number | undefined;
233
+ name?: string | null | undefined;
234
+ focalPoint?: [number, number] | undefined;
235
+ } | {
236
+ type: "PropertyValue";
237
+ value: string;
238
+ name: string;
239
+ } | ({
240
+ type: "Document";
241
+ mediaType: string;
242
+ url: string;
243
+ blurhash?: string | undefined;
244
+ width?: number | undefined;
245
+ height?: number | undefined;
246
+ name?: string | null | undefined;
247
+ focalPoint?: [number, number] | undefined;
248
+ } | {
249
+ type: "PropertyValue";
250
+ value: string;
251
+ name: string;
252
+ })[] | undefined;
44
253
  }>;
45
254
  export type Note = z.infer<typeof Note>;
package/dist/note.js CHANGED
@@ -1,11 +1,14 @@
1
1
  import { z } from "zod";
2
+ import { Attachment } from "./note/attachment.js";
3
+ import { Emoji } from "./note/emoji.js";
4
+ import { Mention } from "./note/mention.js";
2
5
  const BaseContent = z.object({
3
6
  id: z.string(),
4
7
  url: z.string({ description: "Note URL" }),
5
8
  attributedTo: z.string({ description: "Note publisher" }),
6
9
  to: z.union([z.string(), z.string().array()]),
7
10
  cc: z.union([z.string(), z.string().array()]),
8
- inReplyTo: z.string().optional(),
11
+ inReplyTo: z.string().nullable(),
9
12
  summary: z.string({ description: "Note short summary" }).optional(),
10
13
  summaryMap: z
11
14
  .record(z.string(), { description: "Note short summary in each locale" })
@@ -14,6 +17,8 @@ const BaseContent = z.object({
14
17
  contentMap: z
15
18
  .record(z.string(), { description: "Note content in each locale" })
16
19
  .optional(),
20
+ attachment: z.union([Attachment, Attachment.array()]).optional(),
21
+ tag: z.union([Mention, Emoji]).array(),
17
22
  published: z.string({ description: "Object published datetime" }),
18
23
  updated: z.string({ description: "Object updated datetime" }).optional(),
19
24
  });