@fedify/vocab 2.4.0-dev.1567 → 2.4.0-dev.1570
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/deno.json +1 -1
- package/dist/mod.cjs +9909 -13825
- package/dist/mod.d.cts +676 -1629
- package/dist/mod.d.ts +676 -1629
- package/dist/mod.js +9911 -13823
- package/dist-tests/{actor-CrOFIIiE.mjs → actor-BTMC-aMT.mjs} +2 -2
- package/dist-tests/actor.test.mjs +2 -2
- package/dist-tests/application.yaml +0 -13
- package/dist-tests/group.yaml +0 -13
- package/dist-tests/interactionpolicy.yaml +1 -16
- package/dist-tests/lookup.test.mjs +5 -7
- package/dist-tests/organization.yaml +0 -13
- package/dist-tests/person.yaml +0 -13
- package/dist-tests/service.yaml +0 -13
- package/dist-tests/type.test.mjs +1 -1
- package/dist-tests/{vocab-DOHLQ4UQ.mjs → vocab-XnSGFOqq.mjs} +9908 -13822
- package/dist-tests/vocab.test.mjs +1 -986
- package/package.json +4 -4
- package/src/__snapshots__/vocab.test.ts.snap +0 -609
- package/src/application.yaml +0 -13
- package/src/group.yaml +0 -13
- package/src/interactionpolicy.yaml +1 -16
- package/src/lookup.ts +2 -6
- package/src/organization.yaml +0 -13
- package/src/person.yaml +0 -13
- package/src/service.yaml +0 -13
- package/src/vocab.test.ts +121 -1539
- package/dist-tests/featureauthorization.yaml +0 -33
- package/dist-tests/featuredcollection.yaml +0 -41
- package/dist-tests/featureditem.yaml +0 -34
- package/dist-tests/featurerequest.yaml +0 -21
- package/src/featureauthorization.yaml +0 -33
- package/src/featuredcollection.yaml +0 -41
- package/src/featureditem.yaml +0 -34
- package/src/featurerequest.yaml +0 -21
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
globalThis.addEventListener = () => {};
|
|
3
|
-
import {
|
|
3
|
+
import { E as Person, N as Service, T as Organization, V as __toESM, a as Application, m as Group, z as __commonJSMin } from "./vocab-XnSGFOqq.mjs";
|
|
4
4
|
import { t as getTypeId } from "./type-Cf-vxmre.mjs";
|
|
5
5
|
import { lookupWebFinger } from "@fedify/webfinger";
|
|
6
6
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -1206,7 +1206,7 @@ var esm_default = new class FetchMock {
|
|
|
1206
1206
|
//#endregion
|
|
1207
1207
|
//#region deno.json
|
|
1208
1208
|
var name = "@fedify/vocab";
|
|
1209
|
-
var version = "2.4.0-dev.
|
|
1209
|
+
var version = "2.4.0-dev.1570+f1b6aaa3";
|
|
1210
1210
|
//#endregion
|
|
1211
1211
|
//#region src/actor.ts
|
|
1212
1212
|
const ACTOR_DISCOVERY_HISTOGRAM_BUCKETS = [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
globalThis.addEventListener = () => {};
|
|
3
|
-
import {
|
|
4
|
-
import { a as normalizeActorHandle, c as esm_default, i as isActor, n as getActorHandle, r as getActorTypeName, t as getActorClassByTypeName } from "./actor-
|
|
3
|
+
import { B as __exportAll, E as Person, N as Service, T as Organization, a as Application, m as Group } from "./vocab-XnSGFOqq.mjs";
|
|
4
|
+
import { a as normalizeActorHandle, c as esm_default, i as isActor, n as getActorHandle, r as getActorTypeName, t as getActorClassByTypeName } from "./actor-BTMC-aMT.mjs";
|
|
5
5
|
import { createTestMeterProvider, test } from "@fedify/fixture";
|
|
6
6
|
import { deepStrictEqual, ok, rejects, strictEqual, throws } from "node:assert/strict";
|
|
7
7
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/precondition/PreconditionFailure.js
|
|
@@ -12,13 +12,9 @@ defaultContext:
|
|
|
12
12
|
- "https://www.w3.org/ns/did/v1"
|
|
13
13
|
- "https://w3id.org/security/multikey/v1"
|
|
14
14
|
- "https://gotosocial.org/ns"
|
|
15
|
-
- "https://w3id.org/fep/7aa9"
|
|
16
15
|
- alsoKnownAs:
|
|
17
16
|
"@id": "as:alsoKnownAs"
|
|
18
17
|
"@type": "@id"
|
|
19
|
-
featuredCollections:
|
|
20
|
-
"@id": "https://w3id.org/fep/7aa9#featuredCollections"
|
|
21
|
-
"@type": "@id"
|
|
22
18
|
manuallyApprovesFollowers: "as:manuallyApprovesFollowers"
|
|
23
19
|
movedTo:
|
|
24
20
|
"@id": "as:movedTo"
|
|
@@ -200,15 +196,6 @@ properties:
|
|
|
200
196
|
range:
|
|
201
197
|
- "https://www.w3.org/ns/activitystreams#Collection"
|
|
202
198
|
|
|
203
|
-
- singularName: featuredCollections
|
|
204
|
-
functional: true
|
|
205
|
-
compactName: featuredCollections
|
|
206
|
-
uri: "https://w3id.org/fep/7aa9#featuredCollections"
|
|
207
|
-
description: |
|
|
208
|
-
A collection of {@link FeaturedCollection}s created by this actor.
|
|
209
|
-
range:
|
|
210
|
-
- "https://www.w3.org/ns/activitystreams#Collection"
|
|
211
|
-
|
|
212
199
|
- pluralName: streams
|
|
213
200
|
singularName: stream
|
|
214
201
|
singularAccessor: false
|
package/dist-tests/group.yaml
CHANGED
|
@@ -12,13 +12,9 @@ defaultContext:
|
|
|
12
12
|
- "https://www.w3.org/ns/did/v1"
|
|
13
13
|
- "https://w3id.org/security/multikey/v1"
|
|
14
14
|
- "https://gotosocial.org/ns"
|
|
15
|
-
- "https://w3id.org/fep/7aa9"
|
|
16
15
|
- alsoKnownAs:
|
|
17
16
|
"@id": "as:alsoKnownAs"
|
|
18
17
|
"@type": "@id"
|
|
19
|
-
featuredCollections:
|
|
20
|
-
"@id": "https://w3id.org/fep/7aa9#featuredCollections"
|
|
21
|
-
"@type": "@id"
|
|
22
18
|
manuallyApprovesFollowers: "as:manuallyApprovesFollowers"
|
|
23
19
|
movedTo:
|
|
24
20
|
"@id": "as:movedTo"
|
|
@@ -200,15 +196,6 @@ properties:
|
|
|
200
196
|
range:
|
|
201
197
|
- "https://www.w3.org/ns/activitystreams#Collection"
|
|
202
198
|
|
|
203
|
-
- singularName: featuredCollections
|
|
204
|
-
functional: true
|
|
205
|
-
compactName: featuredCollections
|
|
206
|
-
uri: "https://w3id.org/fep/7aa9#featuredCollections"
|
|
207
|
-
description: |
|
|
208
|
-
A collection of {@link FeaturedCollection}s created by this actor.
|
|
209
|
-
range:
|
|
210
|
-
- "https://www.w3.org/ns/activitystreams#Collection"
|
|
211
|
-
|
|
212
199
|
- pluralName: streams
|
|
213
200
|
singularName: stream
|
|
214
201
|
singularAccessor: false
|
|
@@ -12,24 +12,9 @@ description: |
|
|
|
12
12
|
|
|
13
13
|
See [GoToSocial interaction controls](https://docs.gotosocial.org/en/latest/federation/interaction_controls/)
|
|
14
14
|
for details.
|
|
15
|
-
defaultContext:
|
|
16
|
-
- "https://gotosocial.org/ns"
|
|
17
|
-
- "https://w3id.org/fep/7aa9"
|
|
15
|
+
defaultContext: "https://gotosocial.org/ns"
|
|
18
16
|
|
|
19
17
|
properties:
|
|
20
|
-
- singularName: canFeature
|
|
21
|
-
functional: true
|
|
22
|
-
compactName: canFeature
|
|
23
|
-
uri: "https://w3id.org/fep/7aa9#canFeature"
|
|
24
|
-
untyped: true
|
|
25
|
-
description: |
|
|
26
|
-
The sub-policy specifying who can feature the actor in a
|
|
27
|
-
{@link FeaturedCollection}.
|
|
28
|
-
|
|
29
|
-
See [FEP-7aa9](https://w3id.org/fep/7aa9) for details.
|
|
30
|
-
range:
|
|
31
|
-
- "https://gotosocial.org/ns#InteractionRule"
|
|
32
|
-
|
|
33
18
|
- singularName: canLike
|
|
34
19
|
functional: true
|
|
35
20
|
compactName: canLike
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
globalThis.addEventListener = () => {};
|
|
3
|
-
import {
|
|
4
|
-
import { c as esm_default, i as isActor, o as name, s as version } from "./actor-
|
|
3
|
+
import { E as Person, S as Object$1, o as Collection, x as Note } from "./vocab-XnSGFOqq.mjs";
|
|
4
|
+
import { c as esm_default, i as isActor, o as name, s as version } from "./actor-BTMC-aMT.mjs";
|
|
5
5
|
import { t as getTypeId } from "./type-Cf-vxmre.mjs";
|
|
6
6
|
import { t as assertInstanceOf } from "./utils-CE8Dk5hm.mjs";
|
|
7
7
|
import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
@@ -9,7 +9,7 @@ import { deepStrictEqual, equal, ok, rejects } from "node:assert/strict";
|
|
|
9
9
|
import { lookupWebFinger } from "@fedify/webfinger";
|
|
10
10
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
11
11
|
import { getLogger } from "@logtape/logtape";
|
|
12
|
-
import { getDocumentLoader
|
|
12
|
+
import { getDocumentLoader } from "@fedify/vocab-runtime";
|
|
13
13
|
import { delay } from "es-toolkit";
|
|
14
14
|
//#region src/handle.ts
|
|
15
15
|
/**
|
|
@@ -204,14 +204,12 @@ async function lookupObjectInternal(identifier, options = {}) {
|
|
|
204
204
|
}
|
|
205
205
|
if (remoteDoc == null) return null;
|
|
206
206
|
let object;
|
|
207
|
-
let documentUrl;
|
|
208
207
|
try {
|
|
209
|
-
documentUrl = parseIri(remoteDoc.documentUrl);
|
|
210
208
|
object = await Object$1.fromJsonLd(remoteDoc.document, {
|
|
211
209
|
documentLoader,
|
|
212
210
|
contextLoader: options.contextLoader,
|
|
213
211
|
tracerProvider: options.tracerProvider,
|
|
214
|
-
baseUrl: documentUrl
|
|
212
|
+
baseUrl: new URL(remoteDoc.documentUrl)
|
|
215
213
|
});
|
|
216
214
|
} catch (error) {
|
|
217
215
|
if (error instanceof TypeError) {
|
|
@@ -223,7 +221,7 @@ async function lookupObjectInternal(identifier, options = {}) {
|
|
|
223
221
|
}
|
|
224
222
|
throw error;
|
|
225
223
|
}
|
|
226
|
-
if (options.crossOrigin !== "trust" && object.id != null &&
|
|
224
|
+
if (options.crossOrigin !== "trust" && object.id != null && object.id.origin !== new URL(remoteDoc.documentUrl).origin) {
|
|
227
225
|
if (options.crossOrigin === "throw") throw new Error(`The object's @id (${object.id.href}) has a different origin than the document URL (${remoteDoc.documentUrl}); refusing to return the object. If you want to bypass this check and are aware of the security implications, set the crossOrigin option to "trust".`);
|
|
228
226
|
logger.warn("The object's @id ({objectId}) has a different origin than the document URL ({documentUrl}); refusing to return the object. If you want to bypass this check and are aware of the security implications, set the crossOrigin option to \"trust\".", {
|
|
229
227
|
...remoteDoc,
|
|
@@ -12,13 +12,9 @@ defaultContext:
|
|
|
12
12
|
- "https://www.w3.org/ns/did/v1"
|
|
13
13
|
- "https://w3id.org/security/multikey/v1"
|
|
14
14
|
- "https://gotosocial.org/ns"
|
|
15
|
-
- "https://w3id.org/fep/7aa9"
|
|
16
15
|
- alsoKnownAs:
|
|
17
16
|
"@id": "as:alsoKnownAs"
|
|
18
17
|
"@type": "@id"
|
|
19
|
-
featuredCollections:
|
|
20
|
-
"@id": "https://w3id.org/fep/7aa9#featuredCollections"
|
|
21
|
-
"@type": "@id"
|
|
22
18
|
manuallyApprovesFollowers: "as:manuallyApprovesFollowers"
|
|
23
19
|
movedTo:
|
|
24
20
|
"@id": "as:movedTo"
|
|
@@ -200,15 +196,6 @@ properties:
|
|
|
200
196
|
range:
|
|
201
197
|
- "https://www.w3.org/ns/activitystreams#Collection"
|
|
202
198
|
|
|
203
|
-
- singularName: featuredCollections
|
|
204
|
-
functional: true
|
|
205
|
-
compactName: featuredCollections
|
|
206
|
-
uri: "https://w3id.org/fep/7aa9#featuredCollections"
|
|
207
|
-
description: |
|
|
208
|
-
A collection of {@link FeaturedCollection}s created by this actor.
|
|
209
|
-
range:
|
|
210
|
-
- "https://www.w3.org/ns/activitystreams#Collection"
|
|
211
|
-
|
|
212
199
|
- pluralName: streams
|
|
213
200
|
singularName: stream
|
|
214
201
|
singularAccessor: false
|
package/dist-tests/person.yaml
CHANGED
|
@@ -12,13 +12,9 @@ defaultContext:
|
|
|
12
12
|
- "https://www.w3.org/ns/did/v1"
|
|
13
13
|
- "https://w3id.org/security/multikey/v1"
|
|
14
14
|
- "https://gotosocial.org/ns"
|
|
15
|
-
- "https://w3id.org/fep/7aa9"
|
|
16
15
|
- alsoKnownAs:
|
|
17
16
|
"@id": "as:alsoKnownAs"
|
|
18
17
|
"@type": "@id"
|
|
19
|
-
featuredCollections:
|
|
20
|
-
"@id": "https://w3id.org/fep/7aa9#featuredCollections"
|
|
21
|
-
"@type": "@id"
|
|
22
18
|
manuallyApprovesFollowers: "as:manuallyApprovesFollowers"
|
|
23
19
|
movedTo:
|
|
24
20
|
"@id": "as:movedTo"
|
|
@@ -200,15 +196,6 @@ properties:
|
|
|
200
196
|
range:
|
|
201
197
|
- "https://www.w3.org/ns/activitystreams#Collection"
|
|
202
198
|
|
|
203
|
-
- singularName: featuredCollections
|
|
204
|
-
functional: true
|
|
205
|
-
compactName: featuredCollections
|
|
206
|
-
uri: "https://w3id.org/fep/7aa9#featuredCollections"
|
|
207
|
-
description: |
|
|
208
|
-
A collection of {@link FeaturedCollection}s created by this actor.
|
|
209
|
-
range:
|
|
210
|
-
- "https://www.w3.org/ns/activitystreams#Collection"
|
|
211
|
-
|
|
212
199
|
- pluralName: streams
|
|
213
200
|
singularName: stream
|
|
214
201
|
singularAccessor: false
|
package/dist-tests/service.yaml
CHANGED
|
@@ -12,13 +12,9 @@ defaultContext:
|
|
|
12
12
|
- "https://www.w3.org/ns/did/v1"
|
|
13
13
|
- "https://w3id.org/security/multikey/v1"
|
|
14
14
|
- "https://gotosocial.org/ns"
|
|
15
|
-
- "https://w3id.org/fep/7aa9"
|
|
16
15
|
- alsoKnownAs:
|
|
17
16
|
"@id": "as:alsoKnownAs"
|
|
18
17
|
"@type": "@id"
|
|
19
|
-
featuredCollections:
|
|
20
|
-
"@id": "https://w3id.org/fep/7aa9#featuredCollections"
|
|
21
|
-
"@type": "@id"
|
|
22
18
|
manuallyApprovesFollowers: "as:manuallyApprovesFollowers"
|
|
23
19
|
movedTo:
|
|
24
20
|
"@id": "as:movedTo"
|
|
@@ -200,15 +196,6 @@ properties:
|
|
|
200
196
|
range:
|
|
201
197
|
- "https://www.w3.org/ns/activitystreams#Collection"
|
|
202
198
|
|
|
203
|
-
- singularName: featuredCollections
|
|
204
|
-
functional: true
|
|
205
|
-
compactName: featuredCollections
|
|
206
|
-
uri: "https://w3id.org/fep/7aa9#featuredCollections"
|
|
207
|
-
description: |
|
|
208
|
-
A collection of {@link FeaturedCollection}s created by this actor.
|
|
209
|
-
range:
|
|
210
|
-
- "https://www.w3.org/ns/activitystreams#Collection"
|
|
211
|
-
|
|
212
199
|
- pluralName: streams
|
|
213
200
|
singularName: stream
|
|
214
201
|
singularAccessor: false
|
package/dist-tests/type.test.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
globalThis.addEventListener = () => {};
|
|
3
|
-
import {
|
|
3
|
+
import { E as Person, I as getEntityTypeById, L as isEntityType, y as Link } from "./vocab-XnSGFOqq.mjs";
|
|
4
4
|
import { t as getTypeId } from "./type-Cf-vxmre.mjs";
|
|
5
5
|
import { test } from "@fedify/fixture";
|
|
6
6
|
import { deepStrictEqual } from "node:assert/strict";
|