@llun/activities.schema 0.2.20 → 0.2.21

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.
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AccountField = void 0;
3
+ exports.Field = void 0;
4
4
  // This schema is base on https://docs.joinmastodon.org/entities/Account/#Field
5
5
  const zod_1 = require("zod");
6
- exports.AccountField = zod_1.z.object({
6
+ exports.Field = zod_1.z.object({
7
7
  name: zod_1.z.string({
8
8
  description: "The key of a given field’s key-value pair",
9
9
  }),
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Source = void 0;
4
+ // This schema is base on https://docs.joinmastodon.org/entities/Account/#source
5
+ const zod_1 = require("zod");
6
+ const field_js_1 = require("./field.js");
7
+ exports.Source = zod_1.z.object({
8
+ note: zod_1.z.string({
9
+ description: "Profile bio, in plain-text instead of in HTML",
10
+ }),
11
+ fields: field_js_1.Field.array().describe("Metadata about the account"),
12
+ privacy: zod_1.z
13
+ .union([
14
+ zod_1.z.literal("public").describe("Public post"),
15
+ zod_1.z.literal("unlisted").describe("Unlisted post"),
16
+ zod_1.z.literal("private").describe("Followers-only post"),
17
+ zod_1.z.literal("direct").describe("Direct post"),
18
+ ])
19
+ .describe("The default post privacy to be used for new statuses."),
20
+ sensitive: zod_1.z.boolean({
21
+ description: "Whether new statuses should be marked sensitive by default",
22
+ }),
23
+ language: zod_1.z.string({
24
+ description: "The default posting language for new statuses",
25
+ }),
26
+ follow_requests_count: zod_1.z.number({
27
+ description: "The number of pending follow requests",
28
+ }),
29
+ });
@@ -3,8 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Account = void 0;
4
4
  // This schema is base on https://docs.joinmastodon.org/entities/Account/
5
5
  const zod_1 = require("zod");
6
- const accountField_js_1 = require("./accountField.js");
6
+ const field_js_1 = require("./account/field.js");
7
7
  const customEmoji_js_1 = require("./customEmoji.js");
8
+ const source_js_1 = require("./account/source.js");
8
9
  const BaseAccount = zod_1.z.object({
9
10
  id: zod_1.z.string({
10
11
  description: "This is actor id, for Mastodon, it is a string that case from number but in Activities.next, this is URI",
@@ -18,6 +19,9 @@ const BaseAccount = zod_1.z.object({
18
19
  url: zod_1.z.string({
19
20
  description: "The location of the user's profile page",
20
21
  }),
22
+ uri: zod_1.z.string({
23
+ description: "The location of the actor's profile page",
24
+ }),
21
25
  display_name: zod_1.z.string({
22
26
  description: "The profile's display name",
23
27
  }),
@@ -39,7 +43,8 @@ const BaseAccount = zod_1.z.object({
39
43
  locked: zod_1.z.boolean({
40
44
  description: "Whether the actor manually approves follow requests",
41
45
  }),
42
- fields: accountField_js_1.AccountField.array().describe("Additional metadata attached to a profile as name-value pairs"),
46
+ source: source_js_1.Source.describe("An extra attribute that contains source values to be used with API methods that verify credentials and update credentials"),
47
+ fields: field_js_1.Field.array().describe("Additional metadata attached to a profile as name-value pairs"),
43
48
  emojis: customEmoji_js_1.CustomEmoji.array().describe("Custom emoji entities to be used when rendering the profile"),
44
49
  bot: zod_1.z.boolean({
45
50
  description: "Indicates that the actor may perform automated actions, may not be monitored, or identifies as a robot",
@@ -15,7 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./account.js"), exports);
18
- __exportStar(require("./accountField.js"), exports);
18
+ __exportStar(require("./account/field.js"), exports);
19
+ __exportStar(require("./account/source.js"), exports);
19
20
  __exportStar(require("./customEmoji.js"), exports);
20
21
  __exportStar(require("./filterResult.js"), exports);
21
22
  __exportStar(require("./previewCard.js"), exports);
@@ -1,6 +1,6 @@
1
1
  // This schema is base on https://docs.joinmastodon.org/entities/Account/#Field
2
2
  import { z } from "zod";
3
- export const AccountField = z.object({
3
+ export const Field = z.object({
4
4
  name: z.string({
5
5
  description: "The key of a given field’s key-value pair",
6
6
  }),
@@ -0,0 +1,26 @@
1
+ // This schema is base on https://docs.joinmastodon.org/entities/Account/#source
2
+ import { z } from "zod";
3
+ import { Field } from "./field.js";
4
+ export const Source = z.object({
5
+ note: z.string({
6
+ description: "Profile bio, in plain-text instead of in HTML",
7
+ }),
8
+ fields: Field.array().describe("Metadata about the account"),
9
+ privacy: z
10
+ .union([
11
+ z.literal("public").describe("Public post"),
12
+ z.literal("unlisted").describe("Unlisted post"),
13
+ z.literal("private").describe("Followers-only post"),
14
+ z.literal("direct").describe("Direct post"),
15
+ ])
16
+ .describe("The default post privacy to be used for new statuses."),
17
+ sensitive: z.boolean({
18
+ description: "Whether new statuses should be marked sensitive by default",
19
+ }),
20
+ language: z.string({
21
+ description: "The default posting language for new statuses",
22
+ }),
23
+ follow_requests_count: z.number({
24
+ description: "The number of pending follow requests",
25
+ }),
26
+ });
@@ -1,7 +1,8 @@
1
1
  // This schema is base on https://docs.joinmastodon.org/entities/Account/
2
2
  import { z } from "zod";
3
- import { AccountField } from "./accountField.js";
3
+ import { Field } from "./account/field.js";
4
4
  import { CustomEmoji } from "./customEmoji.js";
5
+ import { Source } from "./account/source.js";
5
6
  const BaseAccount = z.object({
6
7
  id: z.string({
7
8
  description: "This is actor id, for Mastodon, it is a string that case from number but in Activities.next, this is URI",
@@ -15,6 +16,9 @@ const BaseAccount = z.object({
15
16
  url: z.string({
16
17
  description: "The location of the user's profile page",
17
18
  }),
19
+ uri: z.string({
20
+ description: "The location of the actor's profile page",
21
+ }),
18
22
  display_name: z.string({
19
23
  description: "The profile's display name",
20
24
  }),
@@ -36,7 +40,8 @@ const BaseAccount = z.object({
36
40
  locked: z.boolean({
37
41
  description: "Whether the actor manually approves follow requests",
38
42
  }),
39
- fields: AccountField.array().describe("Additional metadata attached to a profile as name-value pairs"),
43
+ source: Source.describe("An extra attribute that contains source values to be used with API methods that verify credentials and update credentials"),
44
+ fields: Field.array().describe("Additional metadata attached to a profile as name-value pairs"),
40
45
  emojis: CustomEmoji.array().describe("Custom emoji entities to be used when rendering the profile"),
41
46
  bot: z.boolean({
42
47
  description: "Indicates that the actor may perform automated actions, may not be monitored, or identifies as a robot",
@@ -1,5 +1,6 @@
1
1
  export * from "./account.js";
2
- export * from "./accountField.js";
2
+ export * from "./account/field.js";
3
+ export * from "./account/source.js";
3
4
  export * from "./customEmoji.js";
4
5
  export * from "./filterResult.js";
5
6
  export * from "./previewCard.js";
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- export declare const AccountField: z.ZodObject<{
2
+ export declare const Field: z.ZodObject<{
3
3
  name: z.ZodString;
4
4
  value: z.ZodString;
5
5
  verified_at: z.ZodNullable<z.ZodString>;
@@ -12,4 +12,4 @@ export declare const AccountField: z.ZodObject<{
12
12
  name: string;
13
13
  verified_at: string | null;
14
14
  }>;
15
- export type AccountField = z.infer<typeof AccountField>;
15
+ export type Field = z.infer<typeof Field>;
@@ -0,0 +1,44 @@
1
+ import { z } from "zod";
2
+ export declare const Source: z.ZodObject<{
3
+ note: z.ZodString;
4
+ fields: z.ZodArray<z.ZodObject<{
5
+ name: z.ZodString;
6
+ value: z.ZodString;
7
+ verified_at: z.ZodNullable<z.ZodString>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ value: string;
10
+ name: string;
11
+ verified_at: string | null;
12
+ }, {
13
+ value: string;
14
+ name: string;
15
+ verified_at: string | null;
16
+ }>, "many">;
17
+ privacy: z.ZodUnion<[z.ZodLiteral<"public">, z.ZodLiteral<"unlisted">, z.ZodLiteral<"private">, z.ZodLiteral<"direct">]>;
18
+ sensitive: z.ZodBoolean;
19
+ language: z.ZodString;
20
+ follow_requests_count: z.ZodNumber;
21
+ }, "strip", z.ZodTypeAny, {
22
+ note: string;
23
+ fields: {
24
+ value: string;
25
+ name: string;
26
+ verified_at: string | null;
27
+ }[];
28
+ privacy: "public" | "unlisted" | "private" | "direct";
29
+ sensitive: boolean;
30
+ language: string;
31
+ follow_requests_count: number;
32
+ }, {
33
+ note: string;
34
+ fields: {
35
+ value: string;
36
+ name: string;
37
+ verified_at: string | null;
38
+ }[];
39
+ privacy: "public" | "unlisted" | "private" | "direct";
40
+ sensitive: boolean;
41
+ language: string;
42
+ follow_requests_count: number;
43
+ }>;
44
+ export type Source = z.infer<typeof Source>;
@@ -4,6 +4,7 @@ export declare const Account: z.ZodObject<z.objectUtil.extendShape<{
4
4
  username: z.ZodString;
5
5
  acct: z.ZodString;
6
6
  url: z.ZodString;
7
+ uri: z.ZodString;
7
8
  display_name: z.ZodString;
8
9
  note: z.ZodString;
9
10
  avatar: z.ZodString;
@@ -11,6 +12,48 @@ export declare const Account: z.ZodObject<z.objectUtil.extendShape<{
11
12
  header: z.ZodString;
12
13
  header_static: z.ZodString;
13
14
  locked: z.ZodBoolean;
15
+ source: z.ZodObject<{
16
+ note: z.ZodString;
17
+ fields: z.ZodArray<z.ZodObject<{
18
+ name: z.ZodString;
19
+ value: z.ZodString;
20
+ verified_at: z.ZodNullable<z.ZodString>;
21
+ }, "strip", z.ZodTypeAny, {
22
+ value: string;
23
+ name: string;
24
+ verified_at: string | null;
25
+ }, {
26
+ value: string;
27
+ name: string;
28
+ verified_at: string | null;
29
+ }>, "many">;
30
+ privacy: z.ZodUnion<[z.ZodLiteral<"public">, z.ZodLiteral<"unlisted">, z.ZodLiteral<"private">, z.ZodLiteral<"direct">]>;
31
+ sensitive: z.ZodBoolean;
32
+ language: z.ZodString;
33
+ follow_requests_count: z.ZodNumber;
34
+ }, "strip", z.ZodTypeAny, {
35
+ note: string;
36
+ fields: {
37
+ value: string;
38
+ name: string;
39
+ verified_at: string | null;
40
+ }[];
41
+ privacy: "public" | "unlisted" | "private" | "direct";
42
+ sensitive: boolean;
43
+ language: string;
44
+ follow_requests_count: number;
45
+ }, {
46
+ note: string;
47
+ fields: {
48
+ value: string;
49
+ name: string;
50
+ verified_at: string | null;
51
+ }[];
52
+ privacy: "public" | "unlisted" | "private" | "direct";
53
+ sensitive: boolean;
54
+ language: string;
55
+ follow_requests_count: number;
56
+ }>;
14
57
  fields: z.ZodArray<z.ZodObject<{
15
58
  name: z.ZodString;
16
59
  value: z.ZodString;
@@ -60,6 +103,7 @@ export declare const Account: z.ZodObject<z.objectUtil.extendShape<{
60
103
  username: z.ZodString;
61
104
  acct: z.ZodString;
62
105
  url: z.ZodString;
106
+ uri: z.ZodString;
63
107
  display_name: z.ZodString;
64
108
  note: z.ZodString;
65
109
  avatar: z.ZodString;
@@ -67,6 +111,48 @@ export declare const Account: z.ZodObject<z.objectUtil.extendShape<{
67
111
  header: z.ZodString;
68
112
  header_static: z.ZodString;
69
113
  locked: z.ZodBoolean;
114
+ source: z.ZodObject<{
115
+ note: z.ZodString;
116
+ fields: z.ZodArray<z.ZodObject<{
117
+ name: z.ZodString;
118
+ value: z.ZodString;
119
+ verified_at: z.ZodNullable<z.ZodString>;
120
+ }, "strip", z.ZodTypeAny, {
121
+ value: string;
122
+ name: string;
123
+ verified_at: string | null;
124
+ }, {
125
+ value: string;
126
+ name: string;
127
+ verified_at: string | null;
128
+ }>, "many">;
129
+ privacy: z.ZodUnion<[z.ZodLiteral<"public">, z.ZodLiteral<"unlisted">, z.ZodLiteral<"private">, z.ZodLiteral<"direct">]>;
130
+ sensitive: z.ZodBoolean;
131
+ language: z.ZodString;
132
+ follow_requests_count: z.ZodNumber;
133
+ }, "strip", z.ZodTypeAny, {
134
+ note: string;
135
+ fields: {
136
+ value: string;
137
+ name: string;
138
+ verified_at: string | null;
139
+ }[];
140
+ privacy: "public" | "unlisted" | "private" | "direct";
141
+ sensitive: boolean;
142
+ language: string;
143
+ follow_requests_count: number;
144
+ }, {
145
+ note: string;
146
+ fields: {
147
+ value: string;
148
+ name: string;
149
+ verified_at: string | null;
150
+ }[];
151
+ privacy: "public" | "unlisted" | "private" | "direct";
152
+ sensitive: boolean;
153
+ language: string;
154
+ follow_requests_count: number;
155
+ }>;
70
156
  fields: z.ZodArray<z.ZodObject<{
71
157
  name: z.ZodString;
72
158
  value: z.ZodString;
@@ -113,20 +199,33 @@ export declare const Account: z.ZodObject<z.objectUtil.extendShape<{
113
199
  }, "strip", z.ZodTypeAny, {
114
200
  id: string;
115
201
  url: string;
202
+ note: string;
203
+ fields: {
204
+ value: string;
205
+ name: string;
206
+ verified_at: string | null;
207
+ }[];
116
208
  username: string;
117
209
  acct: string;
210
+ uri: string;
118
211
  display_name: string;
119
- note: string;
120
212
  avatar: string;
121
213
  avatar_static: string;
122
214
  header: string;
123
215
  header_static: string;
124
216
  locked: boolean;
125
- fields: {
126
- value: string;
127
- name: string;
128
- verified_at: string | null;
129
- }[];
217
+ source: {
218
+ note: string;
219
+ fields: {
220
+ value: string;
221
+ name: string;
222
+ verified_at: string | null;
223
+ }[];
224
+ privacy: "public" | "unlisted" | "private" | "direct";
225
+ sensitive: boolean;
226
+ language: string;
227
+ follow_requests_count: number;
228
+ };
130
229
  emojis: {
131
230
  url: string;
132
231
  shortcode: string;
@@ -148,20 +247,33 @@ export declare const Account: z.ZodObject<z.objectUtil.extendShape<{
148
247
  }, {
149
248
  id: string;
150
249
  url: string;
250
+ note: string;
251
+ fields: {
252
+ value: string;
253
+ name: string;
254
+ verified_at: string | null;
255
+ }[];
151
256
  username: string;
152
257
  acct: string;
258
+ uri: string;
153
259
  display_name: string;
154
- note: string;
155
260
  avatar: string;
156
261
  avatar_static: string;
157
262
  header: string;
158
263
  header_static: string;
159
264
  locked: boolean;
160
- fields: {
161
- value: string;
162
- name: string;
163
- verified_at: string | null;
164
- }[];
265
+ source: {
266
+ note: string;
267
+ fields: {
268
+ value: string;
269
+ name: string;
270
+ verified_at: string | null;
271
+ }[];
272
+ privacy: "public" | "unlisted" | "private" | "direct";
273
+ sensitive: boolean;
274
+ language: string;
275
+ follow_requests_count: number;
276
+ };
165
277
  emojis: {
166
278
  url: string;
167
279
  shortcode: string;
@@ -184,20 +296,33 @@ export declare const Account: z.ZodObject<z.objectUtil.extendShape<{
184
296
  }>, "strip", z.ZodTypeAny, {
185
297
  id: string;
186
298
  url: string;
299
+ note: string;
300
+ fields: {
301
+ value: string;
302
+ name: string;
303
+ verified_at: string | null;
304
+ }[];
187
305
  username: string;
188
306
  acct: string;
307
+ uri: string;
189
308
  display_name: string;
190
- note: string;
191
309
  avatar: string;
192
310
  avatar_static: string;
193
311
  header: string;
194
312
  header_static: string;
195
313
  locked: boolean;
196
- fields: {
197
- value: string;
198
- name: string;
199
- verified_at: string | null;
200
- }[];
314
+ source: {
315
+ note: string;
316
+ fields: {
317
+ value: string;
318
+ name: string;
319
+ verified_at: string | null;
320
+ }[];
321
+ privacy: "public" | "unlisted" | "private" | "direct";
322
+ sensitive: boolean;
323
+ language: string;
324
+ follow_requests_count: number;
325
+ };
201
326
  emojis: {
202
327
  url: string;
203
328
  shortcode: string;
@@ -219,20 +344,33 @@ export declare const Account: z.ZodObject<z.objectUtil.extendShape<{
219
344
  moved?: {
220
345
  id: string;
221
346
  url: string;
347
+ note: string;
348
+ fields: {
349
+ value: string;
350
+ name: string;
351
+ verified_at: string | null;
352
+ }[];
222
353
  username: string;
223
354
  acct: string;
355
+ uri: string;
224
356
  display_name: string;
225
- note: string;
226
357
  avatar: string;
227
358
  avatar_static: string;
228
359
  header: string;
229
360
  header_static: string;
230
361
  locked: boolean;
231
- fields: {
232
- value: string;
233
- name: string;
234
- verified_at: string | null;
235
- }[];
362
+ source: {
363
+ note: string;
364
+ fields: {
365
+ value: string;
366
+ name: string;
367
+ verified_at: string | null;
368
+ }[];
369
+ privacy: "public" | "unlisted" | "private" | "direct";
370
+ sensitive: boolean;
371
+ language: string;
372
+ follow_requests_count: number;
373
+ };
236
374
  emojis: {
237
375
  url: string;
238
376
  shortcode: string;
@@ -255,20 +393,33 @@ export declare const Account: z.ZodObject<z.objectUtil.extendShape<{
255
393
  }, {
256
394
  id: string;
257
395
  url: string;
396
+ note: string;
397
+ fields: {
398
+ value: string;
399
+ name: string;
400
+ verified_at: string | null;
401
+ }[];
258
402
  username: string;
259
403
  acct: string;
404
+ uri: string;
260
405
  display_name: string;
261
- note: string;
262
406
  avatar: string;
263
407
  avatar_static: string;
264
408
  header: string;
265
409
  header_static: string;
266
410
  locked: boolean;
267
- fields: {
268
- value: string;
269
- name: string;
270
- verified_at: string | null;
271
- }[];
411
+ source: {
412
+ note: string;
413
+ fields: {
414
+ value: string;
415
+ name: string;
416
+ verified_at: string | null;
417
+ }[];
418
+ privacy: "public" | "unlisted" | "private" | "direct";
419
+ sensitive: boolean;
420
+ language: string;
421
+ follow_requests_count: number;
422
+ };
272
423
  emojis: {
273
424
  url: string;
274
425
  shortcode: string;
@@ -290,20 +441,33 @@ export declare const Account: z.ZodObject<z.objectUtil.extendShape<{
290
441
  moved?: {
291
442
  id: string;
292
443
  url: string;
444
+ note: string;
445
+ fields: {
446
+ value: string;
447
+ name: string;
448
+ verified_at: string | null;
449
+ }[];
293
450
  username: string;
294
451
  acct: string;
452
+ uri: string;
295
453
  display_name: string;
296
- note: string;
297
454
  avatar: string;
298
455
  avatar_static: string;
299
456
  header: string;
300
457
  header_static: string;
301
458
  locked: boolean;
302
- fields: {
303
- value: string;
304
- name: string;
305
- verified_at: string | null;
306
- }[];
459
+ source: {
460
+ note: string;
461
+ fields: {
462
+ value: string;
463
+ name: string;
464
+ verified_at: string | null;
465
+ }[];
466
+ privacy: "public" | "unlisted" | "private" | "direct";
467
+ sensitive: boolean;
468
+ language: string;
469
+ follow_requests_count: number;
470
+ };
307
471
  emojis: {
308
472
  url: string;
309
473
  shortcode: string;
@@ -31,7 +31,7 @@ export declare const Filter: z.ZodObject<{
31
31
  }, "strip", z.ZodTypeAny, {
32
32
  id: string;
33
33
  title: string;
34
- context: ("home" | "notifications" | "public" | "thread" | "account")[];
34
+ context: ("public" | "home" | "notifications" | "thread" | "account")[];
35
35
  expires_at: string | null;
36
36
  filter_action: "warn" | "hide";
37
37
  keywords: {
@@ -46,7 +46,7 @@ export declare const Filter: z.ZodObject<{
46
46
  }, {
47
47
  id: string;
48
48
  title: string;
49
- context: ("home" | "notifications" | "public" | "thread" | "account")[];
49
+ context: ("public" | "home" | "notifications" | "thread" | "account")[];
50
50
  expires_at: string | null;
51
51
  filter_action: "warn" | "hide";
52
52
  keywords: {
@@ -32,7 +32,7 @@ export declare const FilterResult: z.ZodObject<{
32
32
  }, "strip", z.ZodTypeAny, {
33
33
  id: string;
34
34
  title: string;
35
- context: ("home" | "notifications" | "public" | "thread" | "account")[];
35
+ context: ("public" | "home" | "notifications" | "thread" | "account")[];
36
36
  expires_at: string | null;
37
37
  filter_action: "warn" | "hide";
38
38
  keywords: {
@@ -47,7 +47,7 @@ export declare const FilterResult: z.ZodObject<{
47
47
  }, {
48
48
  id: string;
49
49
  title: string;
50
- context: ("home" | "notifications" | "public" | "thread" | "account")[];
50
+ context: ("public" | "home" | "notifications" | "thread" | "account")[];
51
51
  expires_at: string | null;
52
52
  filter_action: "warn" | "hide";
53
53
  keywords: {
@@ -66,7 +66,7 @@ export declare const FilterResult: z.ZodObject<{
66
66
  filter: {
67
67
  id: string;
68
68
  title: string;
69
- context: ("home" | "notifications" | "public" | "thread" | "account")[];
69
+ context: ("public" | "home" | "notifications" | "thread" | "account")[];
70
70
  expires_at: string | null;
71
71
  filter_action: "warn" | "hide";
72
72
  keywords: {
@@ -85,7 +85,7 @@ export declare const FilterResult: z.ZodObject<{
85
85
  filter: {
86
86
  id: string;
87
87
  title: string;
88
- context: ("home" | "notifications" | "public" | "thread" | "account")[];
88
+ context: ("public" | "home" | "notifications" | "thread" | "account")[];
89
89
  expires_at: string | null;
90
90
  filter_action: "warn" | "hide";
91
91
  keywords: {
@@ -1,5 +1,6 @@
1
1
  export * from "./account.js";
2
- export * from "./accountField.js";
2
+ export * from "./account/field.js";
3
+ export * from "./account/source.js";
3
4
  export * from "./customEmoji.js";
4
5
  export * from "./filterResult.js";
5
6
  export * from "./previewCard.js";