aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models/nodeinfo/nodeinfo.model.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-07-31 14:34:36 +0200
committerChocobozzz <me@florianbigard.com>2023-08-11 15:02:33 +0200
commit3a4992633ee62d5edfbb484d9c6bcb3cf158489d (patch)
treee4510b39bdac9c318fdb4b47018d08f15368b8f0 /shared/models/nodeinfo/nodeinfo.model.ts
parent04d1da5621d25d59bd5fa1543b725c497bf5d9a8 (diff)
downloadPeerTube-3a4992633ee62d5edfbb484d9c6bcb3cf158489d.tar.gz
PeerTube-3a4992633ee62d5edfbb484d9c6bcb3cf158489d.tar.zst
PeerTube-3a4992633ee62d5edfbb484d9c6bcb3cf158489d.zip
Migrate server to ESM
Sorry for the very big commit that may lead to git log issues and merge conflicts, but it's a major step forward: * Server can be faster at startup because imports() are async and we can easily lazy import big modules * Angular doesn't seem to support ES import (with .js extension), so we had to correctly organize peertube into a monorepo: * Use yarn workspace feature * Use typescript reference projects for dependencies * Shared projects have been moved into "packages", each one is now a node module (with a dedicated package.json/tsconfig.json) * server/tools have been moved into apps/ and is now a dedicated app bundled and published on NPM so users don't have to build peertube cli tools manually * server/tests have been moved into packages/ so we don't compile them every time we want to run the server * Use isolatedModule option: * Had to move from const enum to const (https://www.typescriptlang.org/docs/handbook/enums.html#objects-vs-enums) * Had to explictely specify "type" imports when used in decorators * Prefer tsx (that uses esbuild under the hood) instead of ts-node to load typescript files (tests with mocha or scripts): * To reduce test complexity as esbuild doesn't support decorator metadata, we only test server files that do not import server models * We still build tests files into js files for a faster CI * Remove unmaintained peertube CLI import script * Removed some barrels to speed up execution (less imports)
Diffstat (limited to 'shared/models/nodeinfo/nodeinfo.model.ts')
-rw-r--r--shared/models/nodeinfo/nodeinfo.model.ts117
1 files changed, 0 insertions, 117 deletions
diff --git a/shared/models/nodeinfo/nodeinfo.model.ts b/shared/models/nodeinfo/nodeinfo.model.ts
deleted file mode 100644
index 336cb66d2..000000000
--- a/shared/models/nodeinfo/nodeinfo.model.ts
+++ /dev/null
@@ -1,117 +0,0 @@
1/**
2 * NodeInfo schema version 2.0.
3 */
4export interface HttpNodeinfoDiasporaSoftwareNsSchema20 {
5 /**
6 * The schema version, must be 2.0.
7 */
8 version: '2.0'
9 /**
10 * Metadata about server software in use.
11 */
12 software: {
13 /**
14 * The canonical name of this server software.
15 */
16 name: string
17 /**
18 * The version of this server software.
19 */
20 version: string
21 }
22 /**
23 * The protocols supported on this server.
24 */
25 protocols: (
26 | 'activitypub'
27 | 'buddycloud'
28 | 'dfrn'
29 | 'diaspora'
30 | 'libertree'
31 | 'ostatus'
32 | 'pumpio'
33 | 'tent'
34 | 'xmpp'
35 | 'zot')[]
36 /**
37 * The third party sites this server can connect to via their application API.
38 */
39 services: {
40 /**
41 * The third party sites this server can retrieve messages from for combined display with regular traffic.
42 */
43 inbound: ('atom1.0' | 'gnusocial' | 'imap' | 'pnut' | 'pop3' | 'pumpio' | 'rss2.0' | 'twitter')[]
44 /**
45 * The third party sites this server can publish messages to on the behalf of a user.
46 */
47 outbound: (
48 | 'atom1.0'
49 | 'blogger'
50 | 'buddycloud'
51 | 'diaspora'
52 | 'dreamwidth'
53 | 'drupal'
54 | 'facebook'
55 | 'friendica'
56 | 'gnusocial'
57 | 'google'
58 | 'insanejournal'
59 | 'libertree'
60 | 'linkedin'
61 | 'livejournal'
62 | 'mediagoblin'
63 | 'myspace'
64 | 'pinterest'
65 | 'pnut'
66 | 'posterous'
67 | 'pumpio'
68 | 'redmatrix'
69 | 'rss2.0'
70 | 'smtp'
71 | 'tent'
72 | 'tumblr'
73 | 'twitter'
74 | 'wordpress'
75 | 'xmpp')[]
76 }
77 /**
78 * Whether this server allows open self-registration.
79 */
80 openRegistrations: boolean
81 /**
82 * Usage statistics for this server.
83 */
84 usage: {
85 /**
86 * statistics about the users of this server.
87 */
88 users: {
89 /**
90 * The total amount of on this server registered users.
91 */
92 total?: number
93 /**
94 * The amount of users that signed in at least once in the last 180 days.
95 */
96 activeHalfyear?: number
97 /**
98 * The amount of users that signed in at least once in the last 30 days.
99 */
100 activeMonth?: number
101 }
102 /**
103 * The amount of posts that were made by users that are registered on this server.
104 */
105 localPosts?: number
106 /**
107 * The amount of comments that were made by users that are registered on this server.
108 */
109 localComments?: number
110 }
111 /**
112 * Free form key value pairs for software specific values. Clients should not rely on any specific key present.
113 */
114 metadata: {
115 [k: string]: any
116 }
117}