~james/core

core/web/src/lib/api/descriptors.ts -rw-r--r-- 2.6 KiB
452f17b7 — james chore(import): snapshot james.dad.town/core at f70c71c7696a 15 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import {
	TYPE_COUNT,
	TYPE_MINIDOC,
	TYPE_REACTIONS,
	TYPE_REPO_VIEW,
	TYPE_VIEWER,
	type CountDescriptor,
	type DocDescriptor,
	type ReactionsDescriptor,
	type RepoViewDescriptor,
	type ViewerDescriptor
} from "#lib/api/enrich.ts";

// author docs come back keyed by the author's did
export const REPO_OWNER_DOCS: DocDescriptor = {
	source: "org.tangled.repo.manifest:.repo",
	type: TYPE_MINIDOC
};
export const TICKET_AUTHOR_DOCS: DocDescriptor = {
	source: "org.tangled.track.ticket:.repo",
	type: TYPE_MINIDOC
};
export const COMMENT_AUTHOR_DOCS: DocDescriptor = {
	source: "org.tangled.feed.comment:.repo",
	type: TYPE_MINIDOC
};
export const REACTION_AUTHOR_DOCS: DocDescriptor = {
	source: "org.tangled.feed.reaction:.repo",
	type: TYPE_MINIDOC
};
export const REACTIONS: ReactionsDescriptor = {
	source: "org.tangled.feed.reaction:subject",
	type: TYPE_REACTIONS
};
export const REACTOR_DOCS: DocDescriptor = { source: REACTIONS.source, type: TYPE_MINIDOC };

// without a viewer the view has no star state, so cards can't tell starred from unknown
export const REPO_VIEW: RepoViewDescriptor = {
	source: "org.tangled.repo.manifest:.",
	type: TYPE_REPO_VIEW
};

export const REPO_COUNT: CountDescriptor = {
	source: "org.tangled.repo.manifest:subject",
	type: TYPE_COUNT
};
export const STRING_COUNT: CountDescriptor = {
	source: "org.tangled.snippet.string:subject",
	type: TYPE_COUNT
};
export const VOUCH_COUNT: CountDescriptor = {
	source: "org.tangled.graph.vouch:subject",
	type: TYPE_COUNT
};

export const STAR_COUNT: CountDescriptor = {
	source: "org.tangled.feed.star:subject",
	type: TYPE_COUNT
};
export const STAR_VIEWER: ViewerDescriptor = {
	source: "org.tangled.feed.star:subject",
	type: TYPE_VIEWER
};
export const STAR_SUBJECT_DOCS: DocDescriptor = {
	source: "org.tangled.feed.star:subject",
	type: TYPE_MINIDOC
};
export const STARRED_COUNT: CountDescriptor = {
	source: "org.tangled.feed.star:.repo",
	type: TYPE_COUNT
};

// a follow's author is the follower and its subject is who they follow, so
// these look swapped
export const FOLLOWER_COUNT: CountDescriptor = {
	source: "org.tangled.graph.follow:subject",
	type: TYPE_COUNT
};
export const FOLLOWING_COUNT: CountDescriptor = {
	source: "org.tangled.graph.follow:.repo",
	type: TYPE_COUNT
};
export const FOLLOW_VIEWER: ViewerDescriptor = {
	source: "org.tangled.graph.follow:subject",
	type: TYPE_VIEWER
};
export const FOLLOWER_DOCS: DocDescriptor = {
	source: "org.tangled.graph.follow:.repo",
	type: TYPE_MINIDOC
};
export const FOLLOWING_DOCS: DocDescriptor = {
	source: "org.tangled.graph.follow:subject",
	type: TYPE_MINIDOC
};