@llun/activities.schema 0.2.5 → 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,12 +16,20 @@ 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
26
  .union([
22
27
  zod_1.z.record(zod_1.z.string(), { description: "Note content in each locale" }),
23
- // Content map can be array when send from Wordpress
24
- zod_1.z.string({ description: "Note content in array from Wordpress" }).array(),
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(),
25
33
  ])
26
34
  .optional(),
27
35
  attachment: zod_1.z.union([attachment_js_1.Attachment, attachment_js_1.Attachment.array()]).optional(),
@@ -13,12 +13,20 @@ 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
23
  .union([
19
24
  z.record(z.string(), { description: "Note content in each locale" }),
20
- // Content map can be array when send from Wordpress
21
- z.string({ description: "Note content in array from Wordpress" }).array(),
25
+ z
26
+ .string({
27
+ description: "Some activity pub server use content map as array with content in the first element",
28
+ })
29
+ .array(),
22
30
  ])
23
31
  .optional(),
24
32
  attachment: z.union([Attachment, Attachment.array()]).optional(),
@@ -12,7 +12,7 @@ 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>;
15
+ content: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
16
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">;
@@ -171,7 +171,7 @@ 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;
174
+ content?: string | string[] | undefined;
175
175
  contentMap?: string[] | Record<string, string> | undefined;
176
176
  attachment?: {
177
177
  type: "Document";
@@ -226,7 +226,7 @@ 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;
229
+ content?: string | string[] | undefined;
230
230
  contentMap?: string[] | Record<string, string> | undefined;
231
231
  attachment?: {
232
232
  type: "Document";
@@ -283,7 +283,7 @@ 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;
286
+ content?: string | string[] | undefined;
287
287
  contentMap?: string[] | Record<string, string> | undefined;
288
288
  attachment?: {
289
289
  type: "Document";
@@ -343,7 +343,7 @@ 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;
346
+ content?: string | string[] | undefined;
347
347
  contentMap?: string[] | Record<string, string> | undefined;
348
348
  attachment?: {
349
349
  type: "Document";
@@ -8,7 +8,7 @@ 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>;
11
+ content: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
12
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">;
@@ -164,7 +164,7 @@ 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;
167
+ content?: string | string[] | undefined;
168
168
  contentMap?: string[] | Record<string, string> | undefined;
169
169
  attachment?: {
170
170
  type: "Document";
@@ -218,7 +218,7 @@ 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;
221
+ content?: string | string[] | undefined;
222
222
  contentMap?: string[] | Record<string, string> | undefined;
223
223
  attachment?: {
224
224
  type: "Document";
@@ -8,7 +8,7 @@ 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>;
11
+ content: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
12
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">;
@@ -167,7 +167,7 @@ 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;
170
+ content?: string | string[] | undefined;
171
171
  contentMap?: string[] | Record<string, string> | undefined;
172
172
  attachment?: {
173
173
  type: "Document";
@@ -222,7 +222,7 @@ 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;
225
+ content?: string | string[] | undefined;
226
226
  contentMap?: string[] | Record<string, string> | undefined;
227
227
  attachment?: {
228
228
  type: "Document";
@@ -16,7 +16,7 @@ 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>;
19
+ content: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
20
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">;
@@ -175,7 +175,7 @@ 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;
178
+ content?: string | string[] | undefined;
179
179
  contentMap?: string[] | Record<string, string> | undefined;
180
180
  attachment?: {
181
181
  type: "Document";
@@ -230,7 +230,7 @@ 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;
233
+ content?: string | string[] | undefined;
234
234
  contentMap?: string[] | Record<string, string> | undefined;
235
235
  attachment?: {
236
236
  type: "Document";
@@ -287,7 +287,7 @@ 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;
290
+ content?: string | string[] | undefined;
291
291
  contentMap?: string[] | Record<string, string> | undefined;
292
292
  attachment?: {
293
293
  type: "Document";
@@ -347,7 +347,7 @@ 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;
350
+ content?: string | string[] | undefined;
351
351
  contentMap?: string[] | Record<string, string> | undefined;
352
352
  attachment?: {
353
353
  type: "Document";
@@ -429,7 +429,7 @@ 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;
432
+ content?: string | string[] | undefined;
433
433
  contentMap?: string[] | Record<string, string> | undefined;
434
434
  attachment?: {
435
435
  type: "Document";
@@ -499,7 +499,7 @@ 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;
502
+ content?: string | string[] | undefined;
503
503
  contentMap?: string[] | Record<string, string> | undefined;
504
504
  attachment?: {
505
505
  type: "Document";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llun/activities.schema",
3
- "version": "0.2.5",
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,12 +18,21 @@ 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
28
  .union([
24
29
  z.record(z.string(), { description: "Note content in each locale" }),
25
- // Content map can be array when send from Wordpress
26
- z.string({ description: "Note content in array from Wordpress" }).array(),
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(),
27
36
  ])
28
37
  .optional(),
29
38