@fedify/vocab 2.0.0-dev.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.
- package/LICENSE +20 -0
- package/deno.json +31 -0
- package/dist/accept.yaml +15 -0
- package/dist/activity.yaml +98 -0
- package/dist/actor.test.d.ts +2 -0
- package/dist/actor.test.js +6095 -0
- package/dist/add.yaml +16 -0
- package/dist/announce.yaml +30 -0
- package/dist/application.yaml +324 -0
- package/dist/arrive.yaml +15 -0
- package/dist/article.yaml +46 -0
- package/dist/audio.yaml +11 -0
- package/dist/block.yaml +16 -0
- package/dist/chatmessage.yaml +50 -0
- package/dist/collection.yaml +154 -0
- package/dist/collectionpage.yaml +55 -0
- package/dist/create.yaml +28 -0
- package/dist/dataintegrityproof.yaml +56 -0
- package/dist/delete.yaml +27 -0
- package/dist/deno-B-ypIMwF.js +1282 -0
- package/dist/didservice.yaml +22 -0
- package/dist/dislike.yaml +14 -0
- package/dist/document.yaml +31 -0
- package/dist/emoji.yaml +12 -0
- package/dist/emojireact.yaml +17 -0
- package/dist/endpoints.yaml +85 -0
- package/dist/event.yaml +11 -0
- package/dist/export.yaml +9 -0
- package/dist/flag.yaml +15 -0
- package/dist/follow.yaml +19 -0
- package/dist/group.yaml +324 -0
- package/dist/hashtag.yaml +14 -0
- package/dist/ignore.yaml +14 -0
- package/dist/image.yaml +9 -0
- package/dist/intransitiveactivity.yaml +15 -0
- package/dist/invite.yaml +14 -0
- package/dist/join.yaml +14 -0
- package/dist/key.yaml +28 -0
- package/dist/leave.yaml +14 -0
- package/dist/like.yaml +16 -0
- package/dist/link.yaml +101 -0
- package/dist/listen.yaml +12 -0
- package/dist/lookup.test.d.ts +2 -0
- package/dist/lookup.test.js +690 -0
- package/dist/mention.yaml +9 -0
- package/dist/mod.cjs +42036 -0
- package/dist/mod.d.cts +15329 -0
- package/dist/mod.d.ts +15330 -0
- package/dist/mod.js +41936 -0
- package/dist/move.yaml +15 -0
- package/dist/multikey.yaml +36 -0
- package/dist/note.yaml +48 -0
- package/dist/object.yaml +404 -0
- package/dist/offer.yaml +15 -0
- package/dist/orderedcollection.yaml +39 -0
- package/dist/orderedcollectionpage.yaml +50 -0
- package/dist/organization.yaml +324 -0
- package/dist/page.yaml +11 -0
- package/dist/person.yaml +324 -0
- package/dist/place.yaml +75 -0
- package/dist/profile.yaml +26 -0
- package/dist/propertyvalue.yaml +32 -0
- package/dist/question.yaml +103 -0
- package/dist/read.yaml +13 -0
- package/dist/reject.yaml +14 -0
- package/dist/relationship.yaml +52 -0
- package/dist/remove.yaml +14 -0
- package/dist/service.yaml +324 -0
- package/dist/source.yaml +26 -0
- package/dist/tentativeaccept.yaml +14 -0
- package/dist/tentativereject.yaml +14 -0
- package/dist/tombstone.yaml +24 -0
- package/dist/travel.yaml +16 -0
- package/dist/type-CNuABalk.js +13 -0
- package/dist/type.test.d.ts +2 -0
- package/dist/type.test.js +24 -0
- package/dist/undo.yaml +26 -0
- package/dist/update.yaml +58 -0
- package/dist/utils-BSWXlrig.js +13 -0
- package/dist/video.yaml +11 -0
- package/dist/view.yaml +13 -0
- package/dist/vocab-DBispxj5.js +41603 -0
- package/dist/vocab.test.d.ts +2 -0
- package/dist/vocab.test.js +1304 -0
- package/package.json +79 -0
- package/scripts/codegen.ts +20 -0
- package/src/__snapshots__/vocab.test.ts.snap +7903 -0
- package/src/accept.yaml +15 -0
- package/src/activity.yaml +98 -0
- package/src/actor.test.ts +263 -0
- package/src/actor.ts +293 -0
- package/src/add.yaml +16 -0
- package/src/announce.yaml +30 -0
- package/src/application.yaml +324 -0
- package/src/arrive.yaml +15 -0
- package/src/article.yaml +46 -0
- package/src/audio.yaml +11 -0
- package/src/block.yaml +16 -0
- package/src/chatmessage.yaml +50 -0
- package/src/collection.yaml +154 -0
- package/src/collectionpage.yaml +55 -0
- package/src/constants.ts +11 -0
- package/src/create.yaml +28 -0
- package/src/dataintegrityproof.yaml +56 -0
- package/src/delete.yaml +27 -0
- package/src/didservice.yaml +22 -0
- package/src/dislike.yaml +14 -0
- package/src/document.yaml +31 -0
- package/src/emoji.yaml +12 -0
- package/src/emojireact.yaml +17 -0
- package/src/endpoints.yaml +85 -0
- package/src/event.yaml +11 -0
- package/src/export.yaml +9 -0
- package/src/flag.yaml +15 -0
- package/src/follow.yaml +19 -0
- package/src/group.yaml +324 -0
- package/src/handle.ts +104 -0
- package/src/hashtag.yaml +14 -0
- package/src/ignore.yaml +14 -0
- package/src/image.yaml +9 -0
- package/src/intransitiveactivity.yaml +15 -0
- package/src/invite.yaml +14 -0
- package/src/join.yaml +14 -0
- package/src/key.yaml +28 -0
- package/src/keys.ts +50 -0
- package/src/leave.yaml +14 -0
- package/src/like.yaml +16 -0
- package/src/link.yaml +101 -0
- package/src/listen.yaml +12 -0
- package/src/lookup.test.ts +681 -0
- package/src/lookup.ts +318 -0
- package/src/mention.yaml +9 -0
- package/src/mod.ts +57 -0
- package/src/move.yaml +15 -0
- package/src/multikey.yaml +36 -0
- package/src/note.yaml +48 -0
- package/src/object.yaml +404 -0
- package/src/offer.yaml +15 -0
- package/src/orderedcollection.yaml +39 -0
- package/src/orderedcollectionpage.yaml +50 -0
- package/src/organization.yaml +324 -0
- package/src/page.yaml +11 -0
- package/src/person.yaml +324 -0
- package/src/place.yaml +75 -0
- package/src/profile.yaml +26 -0
- package/src/propertyvalue.yaml +32 -0
- package/src/question.yaml +103 -0
- package/src/read.yaml +13 -0
- package/src/reject.yaml +14 -0
- package/src/relationship.yaml +52 -0
- package/src/remove.yaml +14 -0
- package/src/service.yaml +324 -0
- package/src/source.yaml +26 -0
- package/src/tentativeaccept.yaml +14 -0
- package/src/tentativereject.yaml +14 -0
- package/src/tombstone.yaml +24 -0
- package/src/travel.yaml +16 -0
- package/src/type.test.ts +20 -0
- package/src/type.ts +102 -0
- package/src/undo.yaml +26 -0
- package/src/update.yaml +58 -0
- package/src/utils.ts +9 -0
- package/src/video.yaml +11 -0
- package/src/view.yaml +13 -0
- package/src/vocab.bench.ts +204 -0
- package/src/vocab.test.ts +2014 -0
- package/tsdown.config.ts +65 -0
package/src/source.yaml
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
$schema: ../../vocab-tools/schema.yaml
|
|
2
|
+
name: Source
|
|
3
|
+
compactName: as:Source
|
|
4
|
+
uri: "https://www.w3.org/ns/activitystreams#Source"
|
|
5
|
+
entity: false
|
|
6
|
+
description: Contents of {@link Object}'s `source`.
|
|
7
|
+
defaultContext: "https://www.w3.org/ns/activitystreams"
|
|
8
|
+
|
|
9
|
+
properties:
|
|
10
|
+
- pluralName: contents
|
|
11
|
+
singularName: content
|
|
12
|
+
singularAccessor: true
|
|
13
|
+
compactName: content
|
|
14
|
+
uri: "https://www.w3.org/ns/activitystreams#content"
|
|
15
|
+
description: The source content.
|
|
16
|
+
range:
|
|
17
|
+
- "http://www.w3.org/2001/XMLSchema#string"
|
|
18
|
+
- "http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"
|
|
19
|
+
|
|
20
|
+
- singularName: mediaType
|
|
21
|
+
functional: true
|
|
22
|
+
compactName: mediaType
|
|
23
|
+
uri: "https://www.w3.org/ns/activitystreams#mediaType"
|
|
24
|
+
description: The MIME media type of the source content.
|
|
25
|
+
range:
|
|
26
|
+
- "http://www.w3.org/2001/XMLSchema#string"
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
$schema: ../../vocab-tools/schema.yaml
|
|
2
|
+
name: TentativeAccept
|
|
3
|
+
compactName: TentativeAccept
|
|
4
|
+
uri: "https://www.w3.org/ns/activitystreams#TentativeAccept"
|
|
5
|
+
extends: "https://www.w3.org/ns/activitystreams#Accept"
|
|
6
|
+
entity: true
|
|
7
|
+
description: |
|
|
8
|
+
A specialization of {@link Accept} indicating that
|
|
9
|
+
the acceptance is tentative.
|
|
10
|
+
defaultContext:
|
|
11
|
+
- "https://w3id.org/identity/v1"
|
|
12
|
+
- "https://www.w3.org/ns/activitystreams"
|
|
13
|
+
- "https://w3id.org/security/data-integrity/v1"
|
|
14
|
+
properties: []
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
$schema: ../../vocab-tools/schema.yaml
|
|
2
|
+
name: TentativeReject
|
|
3
|
+
compactName: TentativeReject
|
|
4
|
+
uri: "https://www.w3.org/ns/activitystreams#TentativeReject"
|
|
5
|
+
extends: "https://www.w3.org/ns/activitystreams#Reject"
|
|
6
|
+
entity: true
|
|
7
|
+
description: |
|
|
8
|
+
A specialization of {@link Reject} in which
|
|
9
|
+
the rejection is considered tentative.
|
|
10
|
+
defaultContext:
|
|
11
|
+
- "https://w3id.org/identity/v1"
|
|
12
|
+
- "https://www.w3.org/ns/activitystreams"
|
|
13
|
+
- "https://w3id.org/security/data-integrity/v1"
|
|
14
|
+
properties: []
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
$schema: ../../vocab-tools/schema.yaml
|
|
2
|
+
name: Tombstone
|
|
3
|
+
compactName: Tombstone
|
|
4
|
+
uri: "https://www.w3.org/ns/activitystreams#Tombstone"
|
|
5
|
+
extends: "https://www.w3.org/ns/activitystreams#Object"
|
|
6
|
+
entity: true
|
|
7
|
+
description: |
|
|
8
|
+
A `Tombstone` represents a content object that has been deleted.
|
|
9
|
+
It can be used in {@link Collection}s to signify that there used to be
|
|
10
|
+
an object at this position, but it has been deleted.
|
|
11
|
+
defaultContext:
|
|
12
|
+
- "https://www.w3.org/ns/activitystreams"
|
|
13
|
+
- "https://w3id.org/security/data-integrity/v1"
|
|
14
|
+
|
|
15
|
+
properties:
|
|
16
|
+
- singularName: deleted
|
|
17
|
+
functional: true
|
|
18
|
+
compactName: deleted
|
|
19
|
+
uri: "https://www.w3.org/ns/activitystreams#deleted"
|
|
20
|
+
description: |
|
|
21
|
+
On a `Tombstone` object, the `deleted` property is a timestamp for when
|
|
22
|
+
the object was deleted.
|
|
23
|
+
range:
|
|
24
|
+
- "http://www.w3.org/2001/XMLSchema#dateTime"
|
package/src/travel.yaml
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
$schema: ../../vocab-tools/schema.yaml
|
|
2
|
+
name: Travel
|
|
3
|
+
compactName: Travel
|
|
4
|
+
uri: "https://www.w3.org/ns/activitystreams#Travel"
|
|
5
|
+
extends: "https://www.w3.org/ns/activitystreams#IntransitiveActivity"
|
|
6
|
+
entity: true
|
|
7
|
+
description: |
|
|
8
|
+
Indicates that the `actor` is traveling to `target` from `origin`.
|
|
9
|
+
`Travel` is an `IntransitiveObject` whose `actor` specifies the direct object.
|
|
10
|
+
If the `target` or `origin` are not specified,
|
|
11
|
+
either can be determined by context.
|
|
12
|
+
defaultContext:
|
|
13
|
+
- "https://w3id.org/identity/v1"
|
|
14
|
+
- "https://www.w3.org/ns/activitystreams"
|
|
15
|
+
- "https://w3id.org/security/data-integrity/v1"
|
|
16
|
+
properties: []
|
package/src/type.test.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { test } from "@fedify/fixture";
|
|
2
|
+
import { deepStrictEqual } from "node:assert/strict";
|
|
3
|
+
import { getTypeId } from "./type.ts";
|
|
4
|
+
import { Person } from "./vocab.ts";
|
|
5
|
+
|
|
6
|
+
test("getTypeId()", () => {
|
|
7
|
+
const obj = new Person({});
|
|
8
|
+
deepStrictEqual(
|
|
9
|
+
getTypeId(obj),
|
|
10
|
+
new URL("https://www.w3.org/ns/activitystreams#Person"),
|
|
11
|
+
);
|
|
12
|
+
const obj2: Person | null = null;
|
|
13
|
+
deepStrictEqual(getTypeId(obj2), null);
|
|
14
|
+
const obj3: Person | undefined = undefined;
|
|
15
|
+
deepStrictEqual(getTypeId(obj3), undefined);
|
|
16
|
+
const obj4: Person | null | undefined = null;
|
|
17
|
+
deepStrictEqual(getTypeId(obj4), null);
|
|
18
|
+
const obj5: Person | null | undefined = undefined;
|
|
19
|
+
deepStrictEqual(getTypeId(obj5), undefined);
|
|
20
|
+
});
|
package/src/type.ts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { Link, Object } from "./vocab.ts";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Returns the type URI of the given object.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ``` typescript
|
|
8
|
+
* import { getTypeId, Person } from "@fedify/fedify";
|
|
9
|
+
*
|
|
10
|
+
* const obj = new Person({});
|
|
11
|
+
* console.log(getTypeId(obj));
|
|
12
|
+
* // => new URL("https://www.w3.org/ns/activitystreams#Person")
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @param object The Activity Vocabulary object.
|
|
16
|
+
* @returns The type URI of the object, e.g.,
|
|
17
|
+
* `new URL("https://www.w3.org/ns/activitystreams#Person")`.
|
|
18
|
+
* If the given `object` is `null` or `undefined`, returns `null` or
|
|
19
|
+
* `undefined`, respectively.
|
|
20
|
+
* @since 1.3.0
|
|
21
|
+
*/
|
|
22
|
+
export function getTypeId(object: Object | Link): URL;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Returns the type URI of the given object.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ``` typescript
|
|
29
|
+
* import { getTypeId, Person } from "@fedify/fedify";
|
|
30
|
+
*
|
|
31
|
+
* const obj = new Person({});
|
|
32
|
+
* console.log(getTypeId(obj));
|
|
33
|
+
* // => new URL("https://www.w3.org/ns/activitystreams#Person")
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @param object The Activity Vocabulary object.
|
|
37
|
+
* @returns The type URI of the object, e.g.,
|
|
38
|
+
* `new URL("https://www.w3.org/ns/activitystreams#Person")`.
|
|
39
|
+
* If the given `object` is `null` or `undefined`, returns `null` or
|
|
40
|
+
* `undefined`, respectively.
|
|
41
|
+
* @since 1.3.0
|
|
42
|
+
*/
|
|
43
|
+
export function getTypeId(object: Object | Link | undefined): URL | undefined;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Returns the type URI of the given object.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ``` typescript
|
|
50
|
+
* import { getTypeId, Person } from "@fedify/fedify";
|
|
51
|
+
*
|
|
52
|
+
* const obj = new Person({});
|
|
53
|
+
* console.log(getTypeId(obj));
|
|
54
|
+
* // => new URL("https://www.w3.org/ns/activitystreams#Person")
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @param object The Activity Vocabulary object.
|
|
58
|
+
* @returns The type URI of the object, e.g.,
|
|
59
|
+
* `new URL("https://www.w3.org/ns/activitystreams#Person")`.
|
|
60
|
+
* If the given `object` is `null` or `undefined`, returns `null` or
|
|
61
|
+
* `undefined`, respectively.
|
|
62
|
+
* @since 1.3.0
|
|
63
|
+
*/
|
|
64
|
+
export function getTypeId(object: Object | Link | null): URL | null;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Returns the type URI of the given object.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ``` typescript
|
|
71
|
+
* import { getTypeId, Person } from "@fedify/fedify";
|
|
72
|
+
*
|
|
73
|
+
* const obj = new Person({});
|
|
74
|
+
* console.log(getTypeId(obj));
|
|
75
|
+
* // => new URL("https://www.w3.org/ns/activitystreams#Person")
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* @param object The Activity Vocabulary object.
|
|
79
|
+
* @returns The type URI of the object, e.g.,
|
|
80
|
+
* `new URL("https://www.w3.org/ns/activitystreams#Person")`.
|
|
81
|
+
* If the given `object` is `null` or `undefined`, returns `null` or
|
|
82
|
+
* `undefined`, respectively.
|
|
83
|
+
* @since 1.3.0
|
|
84
|
+
*/
|
|
85
|
+
export function getTypeId(
|
|
86
|
+
object: Object | Link | null | undefined,
|
|
87
|
+
): URL | null | undefined;
|
|
88
|
+
|
|
89
|
+
export function getTypeId(
|
|
90
|
+
object: Object | Link | undefined | null,
|
|
91
|
+
): URL | undefined | null {
|
|
92
|
+
// TODO: Deno 2.4.2's TypeScript doesn't properly narrow the type with `object == null` check,
|
|
93
|
+
// so we need an explicit type assertion here. This should be revisited when upgrading
|
|
94
|
+
// to newer versions that might fix this type narrowing issue.
|
|
95
|
+
if (object == null) return object as undefined | null;
|
|
96
|
+
const cls = object.constructor as
|
|
97
|
+
& (new (...args: unknown[]) => Object | Link)
|
|
98
|
+
& {
|
|
99
|
+
typeId: URL;
|
|
100
|
+
};
|
|
101
|
+
return cls.typeId;
|
|
102
|
+
}
|
package/src/undo.yaml
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
$schema: ../../vocab-tools/schema.yaml
|
|
2
|
+
name: Undo
|
|
3
|
+
compactName: Undo
|
|
4
|
+
uri: "https://www.w3.org/ns/activitystreams#Undo"
|
|
5
|
+
extends: "https://www.w3.org/ns/activitystreams#Activity"
|
|
6
|
+
entity: true
|
|
7
|
+
description: |
|
|
8
|
+
Indicates that the `actor` is undoing the `object`. In most cases,
|
|
9
|
+
the `object` will be an {@link Activity} describing some previously performed
|
|
10
|
+
action (for instance, a person may have previously "liked" an article but,
|
|
11
|
+
for whatever reason, might choose to undo that like at some later point in
|
|
12
|
+
time).
|
|
13
|
+
|
|
14
|
+
The `target` and `origin` typically have no defined meaning.
|
|
15
|
+
defaultContext:
|
|
16
|
+
- "https://w3id.org/identity/v1"
|
|
17
|
+
- "https://www.w3.org/ns/activitystreams"
|
|
18
|
+
- "https://w3id.org/security/v1"
|
|
19
|
+
- "https://w3id.org/security/data-integrity/v1"
|
|
20
|
+
- "https://www.w3.org/ns/did/v1"
|
|
21
|
+
- "https://w3id.org/security/multikey/v1"
|
|
22
|
+
- litepub: "http://litepub.social/ns#"
|
|
23
|
+
toot: "http://joinmastodon.org/ns#"
|
|
24
|
+
EmojiReact: "litepub:EmojiReact"
|
|
25
|
+
Emoji: "toot:Emoji"
|
|
26
|
+
properties: []
|
package/src/update.yaml
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
$schema: ../../vocab-tools/schema.yaml
|
|
2
|
+
name: Update
|
|
3
|
+
compactName: Update
|
|
4
|
+
uri: "https://www.w3.org/ns/activitystreams#Update"
|
|
5
|
+
extends: "https://www.w3.org/ns/activitystreams#Activity"
|
|
6
|
+
entity: true
|
|
7
|
+
description: |
|
|
8
|
+
Indicates that the `actor` has updated the `object`. Note, however,
|
|
9
|
+
that this vocabulary does not define a mechanism for describing the actual
|
|
10
|
+
set of modifications made to `object`.
|
|
11
|
+
|
|
12
|
+
The `target` and `origin` typically have no defined meaning.
|
|
13
|
+
defaultContext:
|
|
14
|
+
- "https://w3id.org/identity/v1"
|
|
15
|
+
- "https://www.w3.org/ns/activitystreams"
|
|
16
|
+
- "https://w3id.org/security/v1"
|
|
17
|
+
- "https://w3id.org/security/data-integrity/v1"
|
|
18
|
+
- "https://www.w3.org/ns/did/v1"
|
|
19
|
+
- "https://w3id.org/security/multikey/v1"
|
|
20
|
+
- alsoKnownAs:
|
|
21
|
+
"@id": "as:alsoKnownAs"
|
|
22
|
+
"@type": "@id"
|
|
23
|
+
manuallyApprovesFollowers: "as:manuallyApprovesFollowers"
|
|
24
|
+
sensitive: "as:sensitive"
|
|
25
|
+
movedTo:
|
|
26
|
+
"@id": "as:movedTo"
|
|
27
|
+
"@type": "@id"
|
|
28
|
+
quoteUrl: "as:quoteUrl"
|
|
29
|
+
toot: "http://joinmastodon.org/ns#"
|
|
30
|
+
featured:
|
|
31
|
+
"@id": "toot:featured"
|
|
32
|
+
"@type": "@id"
|
|
33
|
+
featuredTags:
|
|
34
|
+
"@id": "toot:featuredTags"
|
|
35
|
+
"@type": "@id"
|
|
36
|
+
discoverable: "toot:discoverable"
|
|
37
|
+
suspended: "toot:suspended"
|
|
38
|
+
memorial: "toot:memorial"
|
|
39
|
+
indexable: "toot:indexable"
|
|
40
|
+
votersCount:
|
|
41
|
+
"@id": "toot:votersCount"
|
|
42
|
+
"@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger"
|
|
43
|
+
Emoji: "toot:Emoji"
|
|
44
|
+
Hashtag: "as:Hashtag"
|
|
45
|
+
schema: "http://schema.org#"
|
|
46
|
+
PropertyValue: "schema:PropertyValue"
|
|
47
|
+
value: "schema:value"
|
|
48
|
+
ChatMessage: "http://litepub.social/ns#ChatMessage"
|
|
49
|
+
fedibird: "http://fedibird.com/ns#"
|
|
50
|
+
quoteUri: "fedibird:quoteUri"
|
|
51
|
+
misskey: "https://misskey-hub.net/ns#"
|
|
52
|
+
_misskey_quote: "misskey:_misskey_quote"
|
|
53
|
+
_misskey_followedMessage: "misskey:_misskey_followedMessage"
|
|
54
|
+
isCat: "misskey:isCat"
|
|
55
|
+
emojiReactions:
|
|
56
|
+
"@id": "fedibird:emojiReactions"
|
|
57
|
+
"@type": "@id"
|
|
58
|
+
properties: []
|
package/src/utils.ts
ADDED
package/src/video.yaml
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
$schema: ../../vocab-tools/schema.yaml
|
|
2
|
+
name: Video
|
|
3
|
+
compactName: Video
|
|
4
|
+
uri: "https://www.w3.org/ns/activitystreams#Video"
|
|
5
|
+
extends: "https://www.w3.org/ns/activitystreams#Document"
|
|
6
|
+
entity: true
|
|
7
|
+
description: Represents a video document of any kind.
|
|
8
|
+
defaultContext:
|
|
9
|
+
- "https://www.w3.org/ns/activitystreams"
|
|
10
|
+
- "https://w3id.org/security/data-integrity/v1"
|
|
11
|
+
properties: []
|
package/src/view.yaml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
$schema: ../../vocab-tools/schema.yaml
|
|
2
|
+
name: View
|
|
3
|
+
compactName: View
|
|
4
|
+
uri: "https://www.w3.org/ns/activitystreams#View"
|
|
5
|
+
extends: "https://www.w3.org/ns/activitystreams#Activity"
|
|
6
|
+
entity: true
|
|
7
|
+
description: |
|
|
8
|
+
Indicates that the `actor` has viewed the object.
|
|
9
|
+
defaultContext:
|
|
10
|
+
- "https://w3id.org/identity/v1"
|
|
11
|
+
- "https://www.w3.org/ns/activitystreams"
|
|
12
|
+
- "https://w3id.org/security/data-integrity/v1"
|
|
13
|
+
properties: []
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { Collection, Object } from "./vocab.ts";
|
|
2
|
+
|
|
3
|
+
const jsonLd = {
|
|
4
|
+
"@context": [
|
|
5
|
+
"https://www.w3.org/ns/activitystreams",
|
|
6
|
+
"https://w3id.org/security/v1",
|
|
7
|
+
{
|
|
8
|
+
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
|
|
9
|
+
"toot": "http://joinmastodon.org/ns#",
|
|
10
|
+
"featured": {
|
|
11
|
+
"@id": "toot:featured",
|
|
12
|
+
"@type": "@id",
|
|
13
|
+
},
|
|
14
|
+
"featuredTags": {
|
|
15
|
+
"@id": "toot:featuredTags",
|
|
16
|
+
"@type": "@id",
|
|
17
|
+
},
|
|
18
|
+
"alsoKnownAs": {
|
|
19
|
+
"@id": "as:alsoKnownAs",
|
|
20
|
+
"@type": "@id",
|
|
21
|
+
},
|
|
22
|
+
"movedTo": {
|
|
23
|
+
"@id": "as:movedTo",
|
|
24
|
+
"@type": "@id",
|
|
25
|
+
},
|
|
26
|
+
"schema": "http://schema.org#",
|
|
27
|
+
"PropertyValue": "schema:PropertyValue",
|
|
28
|
+
"value": "schema:value",
|
|
29
|
+
"discoverable": "toot:discoverable",
|
|
30
|
+
"Device": "toot:Device",
|
|
31
|
+
"Ed25519Signature": "toot:Ed25519Signature",
|
|
32
|
+
"Ed25519Key": "toot:Ed25519Key",
|
|
33
|
+
"Curve25519Key": "toot:Curve25519Key",
|
|
34
|
+
"EncryptedMessage": "toot:EncryptedMessage",
|
|
35
|
+
"publicKeyBase64": "toot:publicKeyBase64",
|
|
36
|
+
"deviceId": "toot:deviceId",
|
|
37
|
+
"claim": {
|
|
38
|
+
"@type": "@id",
|
|
39
|
+
"@id": "toot:claim",
|
|
40
|
+
},
|
|
41
|
+
"fingerprintKey": {
|
|
42
|
+
"@type": "@id",
|
|
43
|
+
"@id": "toot:fingerprintKey",
|
|
44
|
+
},
|
|
45
|
+
"identityKey": {
|
|
46
|
+
"@type": "@id",
|
|
47
|
+
"@id": "toot:identityKey",
|
|
48
|
+
},
|
|
49
|
+
"devices": {
|
|
50
|
+
"@type": "@id",
|
|
51
|
+
"@id": "toot:devices",
|
|
52
|
+
},
|
|
53
|
+
"messageFranking": "toot:messageFranking",
|
|
54
|
+
"messageType": "toot:messageType",
|
|
55
|
+
"cipherText": "toot:cipherText",
|
|
56
|
+
"suspended": "toot:suspended",
|
|
57
|
+
"memorial": "toot:memorial",
|
|
58
|
+
"indexable": "toot:indexable",
|
|
59
|
+
"Hashtag": "as:Hashtag",
|
|
60
|
+
"focalPoint": {
|
|
61
|
+
"@container": "@list",
|
|
62
|
+
"@id": "toot:focalPoint",
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
"id": "https://fosstodon.org/users/hongminhee",
|
|
67
|
+
"type": "Person",
|
|
68
|
+
"following": "https://fosstodon.org/users/hongminhee/following",
|
|
69
|
+
"followers": "https://fosstodon.org/users/hongminhee/followers",
|
|
70
|
+
"inbox": "https://fosstodon.org/users/hongminhee/inbox",
|
|
71
|
+
"outbox": "https://fosstodon.org/users/hongminhee/outbox",
|
|
72
|
+
"featured": "https://fosstodon.org/users/hongminhee/collections/featured",
|
|
73
|
+
"featuredTags": "https://fosstodon.org/users/hongminhee/collections/tags",
|
|
74
|
+
"preferredUsername": "hongminhee",
|
|
75
|
+
"name": "洪 民憙 (Hong Minhee)",
|
|
76
|
+
"summary":
|
|
77
|
+
'<p>An intersectionalist, feminist, and socialist guy living in Seoul (UTC+09:00). Who's behind <span class="h-card" translate="no"><a href="https://hollo.social/@fedify" class="u-url mention">@<span>fedify</span></a></span> and <span class="h-card" translate="no"><a href="https://hollo.social/@hollo" class="u-url mention">@<span>hollo</span></a></span>. Write some free software in <a href="https://fosstodon.org/tags/Haskell" class="mention hashtag" rel="tag">#<span>Haskell</span></a>, <a href="https://fosstodon.org/tags/Rust" class="mention hashtag" rel="tag">#<span>Rust</span></a>, <a href="https://fosstodon.org/tags/TypeScript" class="mention hashtag" rel="tag">#<span>TypeScript</span></a>, & <a href="https://fosstodon.org/tags/Python" class="mention hashtag" rel="tag">#<span>Python</span></a>. They/them.</p><p><a href="https://fosstodon.org/tags/%E5%9C%8B%E6%BC%A2%E6%96%87%E6%B7%B7%E7%94%A8" class="mention hashtag" rel="tag">#<span>國漢文混用</span></a> <a href="https://fosstodon.org/tags/%ED%95%9C%EA%B5%AD%EC%96%B4" class="mention hashtag" rel="tag">#<span>한국어</span></a> (<a href="https://fosstodon.org/tags/%E6%9C%9D%E9%AE%AE%E8%AA%9E" class="mention hashtag" rel="tag">#<span>朝鮮語</span></a>) <a href="https://fosstodon.org/tags/English" class="mention hashtag" rel="tag">#<span>English</span></a> <a href="https://fosstodon.org/tags/%E6%97%A5%E6%9C%AC%E8%AA%9E" class="mention hashtag" rel="tag">#<span>日本語</span></a></p>',
|
|
78
|
+
"url": "https://fosstodon.org/@hongminhee",
|
|
79
|
+
"manuallyApprovesFollowers": false,
|
|
80
|
+
"discoverable": true,
|
|
81
|
+
"indexable": true,
|
|
82
|
+
"published": "2024-06-19T00:00:00Z",
|
|
83
|
+
"memorial": false,
|
|
84
|
+
"devices": "https://fosstodon.org/users/hongminhee/collections/devices",
|
|
85
|
+
"alsoKnownAs": [
|
|
86
|
+
"https://todon.eu/users/hongminhee",
|
|
87
|
+
"https://mastodon.social/users/hongminhee",
|
|
88
|
+
],
|
|
89
|
+
"publicKey": {
|
|
90
|
+
"id": "https://fosstodon.org/users/hongminhee#main-key",
|
|
91
|
+
"owner": "https://fosstodon.org/users/hongminhee",
|
|
92
|
+
"publicKeyPem":
|
|
93
|
+
"-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArvxgF3bUeGeoat8MMKH2\nRsWrQGuaZ1VyZ5Eo55urrcii96TX47Xqznv7YHXSYf/W0b647wYWzkh1vb0jzfS+\nJ9sh1MmniiBSqb46FII6Ou7R/QJaBbSFKStdHlrlbTQZNzmUqE0y29mxxlP7Sqdd\nJjiPKrcQEMkG5TRNxwkR4pPSP0oj/4++aEApcM+qqk56bs5c3sHaQKMdh0qFtMAb\npcTpD9CooEDzeQoaxlsvNuWFu7WjDuLAdARFingfDfUy42d0OSW5yy9PhSmWdfYX\nrTzfB2aekQIAczbrxZ82PrSzB3pR0LDR4ZRu22nWsU57jyHjNdbwwTGRNrhRdBzK\nOwIDAQAB\n-----END PUBLIC KEY-----\n",
|
|
94
|
+
},
|
|
95
|
+
"tag": [
|
|
96
|
+
{
|
|
97
|
+
"type": "Hashtag",
|
|
98
|
+
"href": "https://fosstodon.org/tags/haskell",
|
|
99
|
+
"name": "#haskell",
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"type": "Hashtag",
|
|
103
|
+
"href": "https://fosstodon.org/tags/python",
|
|
104
|
+
"name": "#python",
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"type": "Hashtag",
|
|
108
|
+
"href": "https://fosstodon.org/tags/rust",
|
|
109
|
+
"name": "#rust",
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"type": "Hashtag",
|
|
113
|
+
"href": "https://fosstodon.org/tags/english",
|
|
114
|
+
"name": "#english",
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"type": "Hashtag",
|
|
118
|
+
"href": "https://fosstodon.org/tags/%E6%97%A5%E6%9C%AC%E8%AA%9E",
|
|
119
|
+
"name": "#日本語",
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"type": "Hashtag",
|
|
123
|
+
"href": "https://fosstodon.org/tags/typescript",
|
|
124
|
+
"name": "#typescript",
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"type": "Hashtag",
|
|
128
|
+
"href": "https://fosstodon.org/tags/%ED%95%9C%EA%B5%AD%EC%96%B4",
|
|
129
|
+
"name": "#한국어",
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"type": "Hashtag",
|
|
133
|
+
"href":
|
|
134
|
+
"https://fosstodon.org/tags/%E5%9C%8B%E6%BC%A2%E6%96%87%E6%B7%B7%E7%94%A8",
|
|
135
|
+
"name": "#國漢文混用",
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"type": "Hashtag",
|
|
139
|
+
"href": "https://fosstodon.org/tags/%E6%9C%9D%E9%AE%AE%E8%AA%9E",
|
|
140
|
+
"name": "#朝鮮語",
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
"attachment": [
|
|
144
|
+
{
|
|
145
|
+
"type": "PropertyValue",
|
|
146
|
+
"name": "Website",
|
|
147
|
+
"value":
|
|
148
|
+
'<a href="https://hongminhee.org/" target="_blank" rel="nofollow noopener noreferrer me" translate="no"><span class="invisible">https://</span><span class="">hongminhee.org/</span><span class="invisible"></span></a>',
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"type": "PropertyValue",
|
|
152
|
+
"name": "GitHub",
|
|
153
|
+
"value":
|
|
154
|
+
'<a href="https://github.com/dahlia" target="_blank" rel="nofollow noopener noreferrer me" translate="no"><span class="invisible">https://</span><span class="">github.com/dahlia</span><span class="invisible"></span></a>',
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"type": "PropertyValue",
|
|
158
|
+
"name": "Keyoxide",
|
|
159
|
+
"value":
|
|
160
|
+
'<a href="https://keyoxide.org/374B15AF323796A62AB1BCE3C429ECD57EED6CCA" target="_blank" rel="nofollow noopener noreferrer me" translate="no"><span class="invisible">https://</span><span class="ellipsis">keyoxide.org/374B15AF323796A62</span><span class="invisible">AB1BCE3C429ECD57EED6CCA</span></a>',
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"type": "PropertyValue",
|
|
164
|
+
"name": "Matrix",
|
|
165
|
+
"value":
|
|
166
|
+
'<span class="h-card" translate="no"><a href="https://fosstodon.org/@hongminhee" class="u-url mention">@<span>hongminhee</span></a></span>:matrix.org',
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
"endpoints": {
|
|
170
|
+
"sharedInbox": "https://fosstodon.org/inbox",
|
|
171
|
+
},
|
|
172
|
+
"icon": {
|
|
173
|
+
"type": "Image",
|
|
174
|
+
"mediaType": "image/jpeg",
|
|
175
|
+
"url":
|
|
176
|
+
"https://cdn.fosstodon.org/accounts/avatars/112/643/523/844/583/361/original/de4e086cad8412c6.jpg",
|
|
177
|
+
},
|
|
178
|
+
"image": {
|
|
179
|
+
"type": "Image",
|
|
180
|
+
"mediaType": "image/jpeg",
|
|
181
|
+
"url":
|
|
182
|
+
"https://cdn.fosstodon.org/accounts/headers/112/643/523/844/583/361/original/d7fd4c4f9e73502f.jpg",
|
|
183
|
+
},
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
Deno.bench("Object.toJsonLd()", async (b) => {
|
|
187
|
+
const object = await Object.fromJsonLd(jsonLd);
|
|
188
|
+
|
|
189
|
+
b.start();
|
|
190
|
+
await object.toJsonLd();
|
|
191
|
+
b.end();
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
const person = await Object.fromJsonLd(jsonLd);
|
|
195
|
+
const people: Object[] = [];
|
|
196
|
+
for (let i = 0; i < 2500; i++) people.push(person);
|
|
197
|
+
|
|
198
|
+
Deno.bench("Collection.toJsonLd()", async (b) => {
|
|
199
|
+
const collection = new Collection({ items: people });
|
|
200
|
+
|
|
201
|
+
b.start();
|
|
202
|
+
await collection.toJsonLd();
|
|
203
|
+
b.end();
|
|
204
|
+
});
|