@llun/activities.schema 0.2.4 → 0.2.6

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.
Binary file
@@ -16,9 +16,21 @@ exports.BaseContent = zod_1.z.object({
16
16
  summaryMap: zod_1.z
17
17
  .record(zod_1.z.string(), { description: "Note short summary in each locale" })
18
18
  .optional(),
19
- content: zod_1.z.string({ description: "Note content" }).optional(),
19
+ content: zod_1.z
20
+ .union([
21
+ zod_1.z.string({ description: "Note content" }),
22
+ zod_1.z.string({ description: "Note content in array from Wordpress" }).array(),
23
+ ])
24
+ .optional(),
20
25
  contentMap: zod_1.z
21
- .record(zod_1.z.string(), { description: "Note content in each locale" })
26
+ .union([
27
+ zod_1.z.record(zod_1.z.string(), { description: "Note content in each locale" }),
28
+ zod_1.z
29
+ .string({
30
+ description: "Some activity pub server use content map as array with content in the first element",
31
+ })
32
+ .array(),
33
+ ])
22
34
  .optional(),
23
35
  attachment: zod_1.z.union([attachment_js_1.Attachment, attachment_js_1.Attachment.array()]).optional(),
24
36
  tag: zod_1.z.union([mention_js_1.Mention, emoji_js_1.Emoji]).array(),
@@ -13,9 +13,21 @@ export const BaseContent = z.object({
13
13
  summaryMap: z
14
14
  .record(z.string(), { description: "Note short summary in each locale" })
15
15
  .optional(),
16
- content: z.string({ description: "Note content" }).optional(),
16
+ content: z
17
+ .union([
18
+ z.string({ description: "Note content" }),
19
+ z.string({ description: "Note content in array from Wordpress" }).array(),
20
+ ])
21
+ .optional(),
17
22
  contentMap: z
18
- .record(z.string(), { description: "Note content in each locale" })
23
+ .union([
24
+ z.record(z.string(), { description: "Note content in each locale" }),
25
+ z
26
+ .string({
27
+ description: "Some activity pub server use content map as array with content in the first element",
28
+ })
29
+ .array(),
30
+ ])
19
31
  .optional(),
20
32
  attachment: z.union([Attachment, Attachment.array()]).optional(),
21
33
  tag: z.union([Mention, Emoji]).array(),
@@ -12,8 +12,8 @@ export declare const Like: z.ZodObject<{
12
12
  inReplyTo: z.ZodNullable<z.ZodString>;
13
13
  summary: z.ZodOptional<z.ZodString>;
14
14
  summaryMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
15
- content: z.ZodOptional<z.ZodString>;
16
- contentMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
15
+ content: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
16
+ contentMap: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodString>, z.ZodArray<z.ZodString, "many">]>>;
17
17
  attachment: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
18
18
  type: z.ZodLiteral<"PropertyValue">;
19
19
  name: z.ZodString;
@@ -171,8 +171,8 @@ export declare const Like: z.ZodObject<{
171
171
  updated?: string | undefined;
172
172
  summary?: string | undefined;
173
173
  summaryMap?: Record<string, string> | undefined;
174
- content?: string | undefined;
175
- contentMap?: Record<string, string> | undefined;
174
+ content?: string | string[] | undefined;
175
+ contentMap?: string[] | Record<string, string> | undefined;
176
176
  attachment?: {
177
177
  type: "Document";
178
178
  mediaType: string;
@@ -226,8 +226,8 @@ export declare const Like: z.ZodObject<{
226
226
  updated?: string | undefined;
227
227
  summary?: string | undefined;
228
228
  summaryMap?: Record<string, string> | undefined;
229
- content?: string | undefined;
230
- contentMap?: Record<string, string> | undefined;
229
+ content?: string | string[] | undefined;
230
+ contentMap?: string[] | Record<string, string> | undefined;
231
231
  attachment?: {
232
232
  type: "Document";
233
233
  mediaType: string;
@@ -283,8 +283,8 @@ export declare const Like: z.ZodObject<{
283
283
  updated?: string | undefined;
284
284
  summary?: string | undefined;
285
285
  summaryMap?: Record<string, string> | undefined;
286
- content?: string | undefined;
287
- contentMap?: Record<string, string> | undefined;
286
+ content?: string | string[] | undefined;
287
+ contentMap?: string[] | Record<string, string> | undefined;
288
288
  attachment?: {
289
289
  type: "Document";
290
290
  mediaType: string;
@@ -343,8 +343,8 @@ export declare const Like: z.ZodObject<{
343
343
  updated?: string | undefined;
344
344
  summary?: string | undefined;
345
345
  summaryMap?: Record<string, string> | undefined;
346
- content?: string | undefined;
347
- contentMap?: Record<string, string> | undefined;
346
+ content?: string | string[] | undefined;
347
+ contentMap?: string[] | Record<string, string> | undefined;
348
348
  attachment?: {
349
349
  type: "Document";
350
350
  mediaType: string;
@@ -8,8 +8,8 @@ export declare const BaseContent: z.ZodObject<{
8
8
  inReplyTo: z.ZodNullable<z.ZodString>;
9
9
  summary: z.ZodOptional<z.ZodString>;
10
10
  summaryMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
11
- content: z.ZodOptional<z.ZodString>;
12
- contentMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
11
+ content: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
12
+ contentMap: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodString>, z.ZodArray<z.ZodString, "many">]>>;
13
13
  attachment: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
14
14
  type: z.ZodLiteral<"PropertyValue">;
15
15
  name: z.ZodString;
@@ -164,8 +164,8 @@ export declare const BaseContent: z.ZodObject<{
164
164
  updated?: string | undefined;
165
165
  summary?: string | undefined;
166
166
  summaryMap?: Record<string, string> | undefined;
167
- content?: string | undefined;
168
- contentMap?: Record<string, string> | undefined;
167
+ content?: string | string[] | undefined;
168
+ contentMap?: string[] | Record<string, string> | undefined;
169
169
  attachment?: {
170
170
  type: "Document";
171
171
  mediaType: string;
@@ -218,8 +218,8 @@ export declare const BaseContent: z.ZodObject<{
218
218
  updated?: string | undefined;
219
219
  summary?: string | undefined;
220
220
  summaryMap?: Record<string, string> | undefined;
221
- content?: string | undefined;
222
- contentMap?: Record<string, string> | undefined;
221
+ content?: string | string[] | undefined;
222
+ contentMap?: string[] | Record<string, string> | undefined;
223
223
  attachment?: {
224
224
  type: "Document";
225
225
  mediaType: string;
@@ -8,8 +8,8 @@ export declare const Note: z.ZodObject<z.objectUtil.extendShape<{
8
8
  inReplyTo: z.ZodNullable<z.ZodString>;
9
9
  summary: z.ZodOptional<z.ZodString>;
10
10
  summaryMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
11
- content: z.ZodOptional<z.ZodString>;
12
- contentMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
11
+ content: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
12
+ contentMap: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodString>, z.ZodArray<z.ZodString, "many">]>>;
13
13
  attachment: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
14
14
  type: z.ZodLiteral<"PropertyValue">;
15
15
  name: z.ZodString;
@@ -167,8 +167,8 @@ export declare const Note: z.ZodObject<z.objectUtil.extendShape<{
167
167
  updated?: string | undefined;
168
168
  summary?: string | undefined;
169
169
  summaryMap?: Record<string, string> | undefined;
170
- content?: string | undefined;
171
- contentMap?: Record<string, string> | undefined;
170
+ content?: string | string[] | undefined;
171
+ contentMap?: string[] | Record<string, string> | undefined;
172
172
  attachment?: {
173
173
  type: "Document";
174
174
  mediaType: string;
@@ -222,8 +222,8 @@ export declare const Note: z.ZodObject<z.objectUtil.extendShape<{
222
222
  updated?: string | undefined;
223
223
  summary?: string | undefined;
224
224
  summaryMap?: Record<string, string> | undefined;
225
- content?: string | undefined;
226
- contentMap?: Record<string, string> | undefined;
225
+ content?: string | string[] | undefined;
226
+ contentMap?: string[] | Record<string, string> | undefined;
227
227
  attachment?: {
228
228
  type: "Document";
229
229
  mediaType: string;
@@ -16,8 +16,8 @@ export declare const Undo: z.ZodObject<{
16
16
  inReplyTo: z.ZodNullable<z.ZodString>;
17
17
  summary: z.ZodOptional<z.ZodString>;
18
18
  summaryMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
19
- content: z.ZodOptional<z.ZodString>;
20
- contentMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
19
+ content: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
20
+ contentMap: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodString>, z.ZodArray<z.ZodString, "many">]>>;
21
21
  attachment: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
22
22
  type: z.ZodLiteral<"PropertyValue">;
23
23
  name: z.ZodString;
@@ -175,8 +175,8 @@ export declare const Undo: z.ZodObject<{
175
175
  updated?: string | undefined;
176
176
  summary?: string | undefined;
177
177
  summaryMap?: Record<string, string> | undefined;
178
- content?: string | undefined;
179
- contentMap?: Record<string, string> | undefined;
178
+ content?: string | string[] | undefined;
179
+ contentMap?: string[] | Record<string, string> | undefined;
180
180
  attachment?: {
181
181
  type: "Document";
182
182
  mediaType: string;
@@ -230,8 +230,8 @@ export declare const Undo: z.ZodObject<{
230
230
  updated?: string | undefined;
231
231
  summary?: string | undefined;
232
232
  summaryMap?: Record<string, string> | undefined;
233
- content?: string | undefined;
234
- contentMap?: Record<string, string> | undefined;
233
+ content?: string | string[] | undefined;
234
+ contentMap?: string[] | Record<string, string> | undefined;
235
235
  attachment?: {
236
236
  type: "Document";
237
237
  mediaType: string;
@@ -287,8 +287,8 @@ export declare const Undo: z.ZodObject<{
287
287
  updated?: string | undefined;
288
288
  summary?: string | undefined;
289
289
  summaryMap?: Record<string, string> | undefined;
290
- content?: string | undefined;
291
- contentMap?: Record<string, string> | undefined;
290
+ content?: string | string[] | undefined;
291
+ contentMap?: string[] | Record<string, string> | undefined;
292
292
  attachment?: {
293
293
  type: "Document";
294
294
  mediaType: string;
@@ -347,8 +347,8 @@ export declare const Undo: z.ZodObject<{
347
347
  updated?: string | undefined;
348
348
  summary?: string | undefined;
349
349
  summaryMap?: Record<string, string> | undefined;
350
- content?: string | undefined;
351
- contentMap?: Record<string, string> | undefined;
350
+ content?: string | string[] | undefined;
351
+ contentMap?: string[] | Record<string, string> | undefined;
352
352
  attachment?: {
353
353
  type: "Document";
354
354
  mediaType: string;
@@ -429,8 +429,8 @@ export declare const Undo: z.ZodObject<{
429
429
  updated?: string | undefined;
430
430
  summary?: string | undefined;
431
431
  summaryMap?: Record<string, string> | undefined;
432
- content?: string | undefined;
433
- contentMap?: Record<string, string> | undefined;
432
+ content?: string | string[] | undefined;
433
+ contentMap?: string[] | Record<string, string> | undefined;
434
434
  attachment?: {
435
435
  type: "Document";
436
436
  mediaType: string;
@@ -499,8 +499,8 @@ export declare const Undo: z.ZodObject<{
499
499
  updated?: string | undefined;
500
500
  summary?: string | undefined;
501
501
  summaryMap?: Record<string, string> | undefined;
502
- content?: string | undefined;
503
- contentMap?: Record<string, string> | undefined;
502
+ content?: string | string[] | undefined;
503
+ contentMap?: string[] | Record<string, string> | undefined;
504
504
  attachment?: {
505
505
  type: "Document";
506
506
  mediaType: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llun/activities.schema",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "Validate ActivityPub and Mastodon with Zod",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -18,9 +18,22 @@ export const BaseContent = z.object({
18
18
  .record(z.string(), { description: "Note short summary in each locale" })
19
19
  .optional(),
20
20
 
21
- content: z.string({ description: "Note content" }).optional(),
21
+ content: z
22
+ .union([
23
+ z.string({ description: "Note content" }),
24
+ z.string({ description: "Note content in array from Wordpress" }).array(),
25
+ ])
26
+ .optional(),
22
27
  contentMap: z
23
- .record(z.string(), { description: "Note content in each locale" })
28
+ .union([
29
+ z.record(z.string(), { description: "Note content in each locale" }),
30
+ z
31
+ .string({
32
+ description:
33
+ "Some activity pub server use content map as array with content in the first element",
34
+ })
35
+ .array(),
36
+ ])
24
37
  .optional(),
25
38
 
26
39
  attachment: z.union([Attachment, Attachment.array()]).optional(),