fedipod 1.0.0 → 1.2.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.
Files changed (143) hide show
  1. package/README.md +4 -4
  2. package/bin/fedipod.mjs +45 -2253
  3. package/gateway.md +1 -1
  4. package/lib/{c2s.mjs → client/c2s.mjs} +8 -3
  5. package/lib/{localapi.mjs → client/localapi.mjs} +2 -2
  6. package/lib/client/masto/accounts.mjs +264 -0
  7. package/lib/client/masto/body.mjs +69 -0
  8. package/lib/client/masto/index.mjs +183 -0
  9. package/lib/client/masto/instance.mjs +104 -0
  10. package/lib/client/masto/media.mjs +133 -0
  11. package/lib/client/masto/oauth.mjs +599 -0
  12. package/lib/client/masto/render.mjs +459 -0
  13. package/lib/client/masto/statuses.mjs +331 -0
  14. package/lib/client/masto/timelines.mjs +316 -0
  15. package/lib/{streaming.mjs → client/streaming.mjs} +1 -1
  16. package/lib/{acctfeed.mjs → connections/acctfeed.mjs} +1 -1
  17. package/lib/{atproto.mjs → connections/atproto.mjs} +15 -16
  18. package/lib/{bskygroup.mjs → connections/bskygroup.mjs} +1 -1
  19. package/lib/{fediacct.mjs → connections/fediacct.mjs} +31 -35
  20. package/lib/{import.mjs → connections/import.mjs} +1 -1
  21. package/lib/{tagfeed.mjs → connections/tagfeed.mjs} +3 -3
  22. package/lib/connections/vault.mjs +114 -0
  23. package/lib/core/as2.mjs +124 -0
  24. package/lib/core/contexts/activitystreams.json +379 -0
  25. package/lib/core/contexts/did-v1.json +57 -0
  26. package/lib/core/contexts/fep-5711.json +36 -0
  27. package/lib/core/contexts/gotosocial.json +86 -0
  28. package/lib/core/contexts/identity-v1.json +152 -0
  29. package/lib/core/contexts/index.mjs +45 -0
  30. package/lib/core/contexts/join-lemmy.json +33 -0
  31. package/lib/core/contexts/joinmastodon.json +28 -0
  32. package/lib/core/contexts/map.json +16 -0
  33. package/lib/core/contexts/miscellany.json +19 -0
  34. package/lib/core/contexts/schemaorg.json +8845 -0
  35. package/lib/core/contexts/security-data-integrity-v1.json +78 -0
  36. package/lib/core/contexts/security-data-integrity-v2.json +81 -0
  37. package/lib/core/contexts/security-multikey-v1.json +35 -0
  38. package/lib/core/contexts/security-v1.json +74 -0
  39. package/lib/core/contexts/webfinger.json +10 -0
  40. package/lib/{deliver.mjs → core/deliver.mjs} +2 -2
  41. package/lib/core/intake/activities.mjs +437 -0
  42. package/lib/core/intake/activity.mjs +240 -0
  43. package/lib/core/intake/channel.mjs +144 -0
  44. package/lib/core/intake/group.mjs +222 -0
  45. package/lib/core/intake/index.mjs +629 -0
  46. package/lib/core/intake/notes.mjs +288 -0
  47. package/lib/core/intake/verify.mjs +141 -0
  48. package/lib/{keys.mjs → core/keys.mjs} +1 -1
  49. package/lib/core/publisher/collections.mjs +229 -0
  50. package/lib/core/publisher/index.mjs +421 -0
  51. package/lib/core/publisher/notes.mjs +188 -0
  52. package/lib/core/publisher/questions.mjs +233 -0
  53. package/lib/core/publisher/restore.mjs +196 -0
  54. package/lib/core/shapes/activitystreams.ttl +129 -0
  55. package/lib/core/shapes/index.mjs +107 -0
  56. package/lib/core/shapes/shapes-text.mjs +13 -0
  57. package/lib/{social.mjs → core/social.mjs} +2 -2
  58. package/lib/{store.mjs → core/store.mjs} +4 -0
  59. package/lib/{wire.mjs → core/wire.mjs} +2 -2
  60. package/lib/device/admin/index.mjs +13 -0
  61. package/lib/device/admin/origins.mjs +35 -0
  62. package/lib/device/admin/routes/connections.mjs +144 -0
  63. package/lib/device/admin/routes/gateway.mjs +199 -0
  64. package/lib/device/admin/routes/lifecycle.mjs +191 -0
  65. package/lib/device/admin/routes/owner.mjs +322 -0
  66. package/lib/device/admin/routes/setup.mjs +393 -0
  67. package/lib/device/admin/routes/social.mjs +188 -0
  68. package/lib/device/admin/server.mjs +95 -0
  69. package/lib/device/admin/static.mjs +244 -0
  70. package/lib/device/admin/surface.mjs +274 -0
  71. package/lib/device/cli/commands/account.mjs +586 -0
  72. package/lib/device/cli/commands/run.mjs +278 -0
  73. package/lib/device/cli/commands/service.mjs +221 -0
  74. package/lib/device/cli/commands/setup.mjs +410 -0
  75. package/lib/device/cli/commands/state.mjs +559 -0
  76. package/lib/device/cli/context.mjs +288 -0
  77. package/lib/{migrate.mjs → device/migrate.mjs} +1 -1
  78. package/lib/{remote.mjs → device/remote.mjs} +3 -3
  79. package/lib/{setup.mjs → device/setup.mjs} +3 -3
  80. package/lib/{update.mjs → device/update.mjs} +1 -1
  81. package/lib/{directory.mjs → gateway/directory.mjs} +1 -1
  82. package/lib/{front-core.mjs → gateway/front-core.mjs} +3 -3
  83. package/lib/{gateway-core.mjs → gateway/gateway-core.mjs} +1 -1
  84. package/lib/{httpsig.mjs → gateway/httpsig.mjs} +1 -1
  85. package/lib/{embed.mjs → server/embed.mjs} +131 -22
  86. package/lib/{links.mjs → shared/links.mjs} +1 -1
  87. package/lib/{ua.mjs → shared/ua.mjs} +1 -1
  88. package/package.json +11 -1
  89. package/run-agent.mjs +33 -25
  90. package/scripts/build-app.mjs +4 -0
  91. package/scripts/check-pod-calls.mjs +8 -2
  92. package/scripts/refresh-contexts.mjs +39 -0
  93. package/web/admin/actors.js +145 -0
  94. package/web/admin/common.js +23 -0
  95. package/web/admin/connections.js +112 -0
  96. package/web/admin/gateway.js +111 -0
  97. package/web/admin/group.js +258 -0
  98. package/web/admin/index.html +7 -1
  99. package/web/admin/record.js +378 -0
  100. package/web/admin/setup/index.html +1 -0
  101. package/web/admin/setup/setup.js +2 -13
  102. package/web/admin/upkeep.js +170 -0
  103. package/web/app/README.md +6 -6
  104. package/web/app/admin-facade.mjs +3 -3
  105. package/web/app/agent.mjs +12 -12
  106. package/web/app/atproto-browser.mjs +1 -1
  107. package/web/app/deliver-relay.mjs +1 -1
  108. package/web/app/dist/sw.js +21684 -5415
  109. package/web/app/dist/sw.js.map +4 -4
  110. package/web/app/fediacct-browser.mjs +1 -1
  111. package/web/app/shims/shapes-text.mjs +8 -0
  112. package/web/app/site/admin/actors.js +145 -0
  113. package/web/app/site/admin/common.js +23 -0
  114. package/web/app/site/admin/connections.js +112 -0
  115. package/web/app/site/admin/gateway.js +111 -0
  116. package/web/app/site/admin/group.js +258 -0
  117. package/web/app/site/admin/index.html +7 -1
  118. package/web/app/site/admin/record.js +378 -0
  119. package/web/app/site/admin/setup/index.html +1 -0
  120. package/web/app/site/admin/setup/setup.js +2 -13
  121. package/web/app/site/admin/upkeep.js +170 -0
  122. package/web/app/site/sw.js +21684 -5415
  123. package/web/app/sw-src.mjs +17 -2
  124. package/lib/admin.mjs +0 -1913
  125. package/lib/intake.mjs +0 -1981
  126. package/lib/mastoapi.mjs +0 -2284
  127. package/lib/publisher.mjs +0 -1192
  128. package/web/admin/admin.js +0 -1181
  129. package/web/app/site/admin/admin.js +0 -1181
  130. /package/lib/{oidc-auth.mjs → client/oidc-auth.mjs} +0 -0
  131. /package/lib/{webpush.mjs → client/webpush.mjs} +0 -0
  132. /package/lib/{bskyfeed.mjs → connections/bskyfeed.mjs} +0 -0
  133. /package/lib/{lease.mjs → core/lease.mjs} +0 -0
  134. /package/lib/{polls.mjs → core/polls.mjs} +0 -0
  135. /package/lib/{proof.mjs → core/proof.mjs} +0 -0
  136. /package/lib/{storage.mjs → core/storage.mjs} +0 -0
  137. /package/lib/{account.mjs → device/account.mjs} +0 -0
  138. /package/lib/{certs.mjs → device/certs.mjs} +0 -0
  139. /package/lib/{export-collections.mjs → device/export-collections.mjs} +0 -0
  140. /package/lib/{home.mjs → device/home.mjs} +0 -0
  141. /package/lib/{ports.mjs → device/ports.mjs} +0 -0
  142. /package/lib/{guard.mjs → shared/guard.mjs} +0 -0
  143. /package/lib/{safefetch.mjs → shared/safefetch.mjs} +0 -0
@@ -0,0 +1,78 @@
1
+ {
2
+ "@context": {
3
+ "id": "@id",
4
+ "type": "@type",
5
+ "@protected": true,
6
+ "digestMultibase": {
7
+ "@id": "https://w3id.org/security#digestMultibase",
8
+ "@type": "https://w3id.org/security#multibase"
9
+ },
10
+ "proof": {
11
+ "@id": "https://w3id.org/security#proof",
12
+ "@type": "@id",
13
+ "@container": "@graph"
14
+ },
15
+ "DataIntegrityProof": {
16
+ "@id": "https://w3id.org/security#DataIntegrityProof",
17
+ "@context": {
18
+ "@protected": true,
19
+ "id": "@id",
20
+ "type": "@type",
21
+ "challenge": "https://w3id.org/security#challenge",
22
+ "created": {
23
+ "@id": "http://purl.org/dc/terms/created",
24
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
25
+ },
26
+ "domain": "https://w3id.org/security#domain",
27
+ "expires": {
28
+ "@id": "https://w3id.org/security#expiration",
29
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
30
+ },
31
+ "nonce": "https://w3id.org/security#nonce",
32
+ "proofPurpose": {
33
+ "@id": "https://w3id.org/security#proofPurpose",
34
+ "@type": "@vocab",
35
+ "@context": {
36
+ "@protected": true,
37
+ "id": "@id",
38
+ "type": "@type",
39
+ "assertionMethod": {
40
+ "@id": "https://w3id.org/security#assertionMethod",
41
+ "@type": "@id",
42
+ "@container": "@set"
43
+ },
44
+ "authentication": {
45
+ "@id": "https://w3id.org/security#authenticationMethod",
46
+ "@type": "@id",
47
+ "@container": "@set"
48
+ },
49
+ "capabilityInvocation": {
50
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
51
+ "@type": "@id",
52
+ "@container": "@set"
53
+ },
54
+ "capabilityDelegation": {
55
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
56
+ "@type": "@id",
57
+ "@container": "@set"
58
+ },
59
+ "keyAgreement": {
60
+ "@id": "https://w3id.org/security#keyAgreementMethod",
61
+ "@type": "@id",
62
+ "@container": "@set"
63
+ }
64
+ }
65
+ },
66
+ "cryptosuite": "https://w3id.org/security#cryptosuite",
67
+ "proofValue": {
68
+ "@id": "https://w3id.org/security#proofValue",
69
+ "@type": "https://w3id.org/security#multibase"
70
+ },
71
+ "verificationMethod": {
72
+ "@id": "https://w3id.org/security#verificationMethod",
73
+ "@type": "@id"
74
+ }
75
+ }
76
+ }
77
+ }
78
+ }
@@ -0,0 +1,81 @@
1
+ {
2
+ "@context": {
3
+ "id": "@id",
4
+ "type": "@type",
5
+ "@protected": true,
6
+ "proof": {
7
+ "@id": "https://w3id.org/security#proof",
8
+ "@type": "@id",
9
+ "@container": "@graph"
10
+ },
11
+ "DataIntegrityProof": {
12
+ "@id": "https://w3id.org/security#DataIntegrityProof",
13
+ "@context": {
14
+ "@protected": true,
15
+ "id": "@id",
16
+ "type": "@type",
17
+ "challenge": "https://w3id.org/security#challenge",
18
+ "created": {
19
+ "@id": "http://purl.org/dc/terms/created",
20
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
21
+ },
22
+ "domain": "https://w3id.org/security#domain",
23
+ "expires": {
24
+ "@id": "https://w3id.org/security#expiration",
25
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
26
+ },
27
+ "nonce": "https://w3id.org/security#nonce",
28
+ "previousProof": {
29
+ "@id": "https://w3id.org/security#previousProof",
30
+ "@type": "@id"
31
+ },
32
+ "proofPurpose": {
33
+ "@id": "https://w3id.org/security#proofPurpose",
34
+ "@type": "@vocab",
35
+ "@context": {
36
+ "@protected": true,
37
+ "id": "@id",
38
+ "type": "@type",
39
+ "assertionMethod": {
40
+ "@id": "https://w3id.org/security#assertionMethod",
41
+ "@type": "@id",
42
+ "@container": "@set"
43
+ },
44
+ "authentication": {
45
+ "@id": "https://w3id.org/security#authenticationMethod",
46
+ "@type": "@id",
47
+ "@container": "@set"
48
+ },
49
+ "capabilityInvocation": {
50
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
51
+ "@type": "@id",
52
+ "@container": "@set"
53
+ },
54
+ "capabilityDelegation": {
55
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
56
+ "@type": "@id",
57
+ "@container": "@set"
58
+ },
59
+ "keyAgreement": {
60
+ "@id": "https://w3id.org/security#keyAgreementMethod",
61
+ "@type": "@id",
62
+ "@container": "@set"
63
+ }
64
+ }
65
+ },
66
+ "cryptosuite": {
67
+ "@id": "https://w3id.org/security#cryptosuite",
68
+ "@type": "https://w3id.org/security#cryptosuiteString"
69
+ },
70
+ "proofValue": {
71
+ "@id": "https://w3id.org/security#proofValue",
72
+ "@type": "https://w3id.org/security#multibase"
73
+ },
74
+ "verificationMethod": {
75
+ "@id": "https://w3id.org/security#verificationMethod",
76
+ "@type": "@id"
77
+ }
78
+ }
79
+ }
80
+ }
81
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "@context": {
3
+ "id": "@id",
4
+ "type": "@type",
5
+ "@protected": true,
6
+ "Multikey": {
7
+ "@id": "https://w3id.org/security#Multikey",
8
+ "@context": {
9
+ "@protected": true,
10
+ "id": "@id",
11
+ "type": "@type",
12
+ "controller": {
13
+ "@id": "https://w3id.org/security#controller",
14
+ "@type": "@id"
15
+ },
16
+ "revoked": {
17
+ "@id": "https://w3id.org/security#revoked",
18
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
19
+ },
20
+ "expires": {
21
+ "@id": "https://w3id.org/security#expiration",
22
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
23
+ },
24
+ "publicKeyMultibase": {
25
+ "@id": "https://w3id.org/security#publicKeyMultibase",
26
+ "@type": "https://w3id.org/security#multibase"
27
+ },
28
+ "secretKeyMultibase": {
29
+ "@id": "https://w3id.org/security#secretKeyMultibase",
30
+ "@type": "https://w3id.org/security#multibase"
31
+ }
32
+ }
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,74 @@
1
+ {
2
+ "@context": {
3
+ "id": "@id",
4
+ "type": "@type",
5
+ "dc": "http://purl.org/dc/terms/",
6
+ "sec": "https://w3id.org/security#",
7
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
8
+ "EcdsaKoblitzSignature2016": "sec:EcdsaKoblitzSignature2016",
9
+ "Ed25519Signature2018": "sec:Ed25519Signature2018",
10
+ "EncryptedMessage": "sec:EncryptedMessage",
11
+ "GraphSignature2012": "sec:GraphSignature2012",
12
+ "LinkedDataSignature2015": "sec:LinkedDataSignature2015",
13
+ "LinkedDataSignature2016": "sec:LinkedDataSignature2016",
14
+ "CryptographicKey": "sec:Key",
15
+ "authenticationTag": "sec:authenticationTag",
16
+ "canonicalizationAlgorithm": "sec:canonicalizationAlgorithm",
17
+ "cipherAlgorithm": "sec:cipherAlgorithm",
18
+ "cipherData": "sec:cipherData",
19
+ "cipherKey": "sec:cipherKey",
20
+ "created": {
21
+ "@id": "dc:created",
22
+ "@type": "xsd:dateTime"
23
+ },
24
+ "creator": {
25
+ "@id": "dc:creator",
26
+ "@type": "@id"
27
+ },
28
+ "digestAlgorithm": "sec:digestAlgorithm",
29
+ "digestValue": "sec:digestValue",
30
+ "domain": "sec:domain",
31
+ "encryptionKey": "sec:encryptionKey",
32
+ "expiration": {
33
+ "@id": "sec:expiration",
34
+ "@type": "xsd:dateTime"
35
+ },
36
+ "expires": {
37
+ "@id": "sec:expiration",
38
+ "@type": "xsd:dateTime"
39
+ },
40
+ "initializationVector": "sec:initializationVector",
41
+ "iterationCount": "sec:iterationCount",
42
+ "nonce": "sec:nonce",
43
+ "normalizationAlgorithm": "sec:normalizationAlgorithm",
44
+ "owner": {
45
+ "@id": "sec:owner",
46
+ "@type": "@id"
47
+ },
48
+ "password": "sec:password",
49
+ "privateKey": {
50
+ "@id": "sec:privateKey",
51
+ "@type": "@id"
52
+ },
53
+ "privateKeyPem": "sec:privateKeyPem",
54
+ "publicKey": {
55
+ "@id": "sec:publicKey",
56
+ "@type": "@id"
57
+ },
58
+ "publicKeyBase58": "sec:publicKeyBase58",
59
+ "publicKeyPem": "sec:publicKeyPem",
60
+ "publicKeyWif": "sec:publicKeyWif",
61
+ "publicKeyService": {
62
+ "@id": "sec:publicKeyService",
63
+ "@type": "@id"
64
+ },
65
+ "revoked": {
66
+ "@id": "sec:revoked",
67
+ "@type": "xsd:dateTime"
68
+ },
69
+ "salt": "sec:salt",
70
+ "signature": "sec:signature",
71
+ "signatureAlgorithm": "sec:signingAlgorithm",
72
+ "signatureValue": "sec:signatureValue"
73
+ }
74
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "@context": {
3
+ "wf": "https://purl.archive.org/socialweb/webfinger#",
4
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
5
+ "webfinger": {
6
+ "@id": "wf:webfinger",
7
+ "@type": "xsd:string"
8
+ }
9
+ }
10
+ }
@@ -6,8 +6,8 @@
6
6
  import { signRequest } from '@fedify/fedify/sig';
7
7
  import { webcrypto } from 'node:crypto';
8
8
  import { attachProof } from './proof.mjs';
9
- import { pinnedFor, retryAfterMs, HTTP_TIMEOUT_MS } from './safefetch.mjs';
10
- import { USER_AGENT } from './ua.mjs';
9
+ import { pinnedFor, retryAfterMs, HTTP_TIMEOUT_MS } from '../shared/safefetch.mjs';
10
+ import { USER_AGENT } from '../shared/ua.mjs';
11
11
 
12
12
  const MAX_REDIRECTS = 3;
13
13