diff --git a/CHANGES.md b/CHANGES.md index 3f645da51..fbe1790f4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -88,6 +88,11 @@ To be released. ### @fedify/vocab + - Added [FEP-ef61] vocabulary terms for portable ActivityPub objects. + Actor classes now expose ordered `gateways` lists, and `Link` plus + document/media classes expose `digestMultibase` for external resource + integrity metadata. [[#830], [#928]] + - Updated [FEP-fe34] cross-origin checks to understand cryptographic origins for [FEP-ef61] portable ActivityPub IDs and DID URLs. Generated property accessors and `lookupObject()` now treat `ap:`/`ap+ef61:` IDs and matching @@ -113,11 +118,17 @@ To be released. [FEP-7aa9]: https://w3id.org/fep/7aa9 [#810]: https://github.com/fedify-dev/fedify/issues/810 [#826]: https://github.com/fedify-dev/fedify/issues/826 +[#830]: https://github.com/fedify-dev/fedify/issues/830 [#850]: https://github.com/fedify-dev/fedify/pull/850 [#914]: https://github.com/fedify-dev/fedify/pull/914 +[#928]: https://github.com/fedify-dev/fedify/pull/928 ### @fedify/vocab-runtime + - Added the [FEP-ef61] JSON-LD context to the preloaded context registry so + portable actor and media documents can compact and expand `gateways` and + `digestMultibase` without fetching the context remotely. [[#830], [#928]] + - Added `getFe34Origin()` and `haveSameFe34Origin()` for comparing ordinary web origins and [FEP-ef61] cryptographic origins with one shared [FEP-fe34] helper. HTTP(S) URLs keep web-origin semantics, while diff --git a/docs/manual/vocab.md b/docs/manual/vocab.md index 8a945d7e1..e8044eda3 100644 --- a/docs/manual/vocab.md +++ b/docs/manual/vocab.md @@ -108,25 +108,12 @@ const create = new Create({ Note that every URI is represented as a [`URL`] object. This is for distinguishing the URIs from the other strings. -Fedify also accepts [FEP-ef61] portable ActivityPub IRIs in JSON-LD input. -Both the `ap:` and `ap+ef61:` schemes are accepted, whether the DID authority -is decoded (e.g., `ap+ef61://did:key:.../actor`) or percent-encoded. Fedify -stores these IRIs as `URL` objects with a URL-safe authority internally, and -serializes them as canonical `ap+ef61:` IRIs with the decoded DID authority. -When comparing portable object IDs, use `canonicalizePortableUri()` or -`arePortableUrisEqual()` from `@fedify/vocab-runtime`; these helpers remove -query hints such as `gateways` according to [FEP-ef61]. Pass raw URI strings -to these comparison helpers, because JavaScript `URL` objects normalize opaque -path segments before Fedify can compare them. Serialization keeps those query -hints intact. - > [!TIP] > You can instantiate an object from a JSON-LD document by calling the > `fromJsonLd()` method of the object. See the [*JSON-LD* section](#json-ld) > for details. [`URL`]: https://developer.mozilla.org/en-US/docs/Web/API/URL -[FEP-ef61]: https://w3id.org/fep/ef61 Properties @@ -217,6 +204,67 @@ property. [FEP-044f]: https://w3id.org/fep/044f +FEP-ef61 portable objects +------------------------- + +*This section is applicable since Fedify 2.4.0.* + +Fedify accepts [FEP-ef61] portable ActivityPub IRIs in JSON-LD input. Both +the `ap:` and `ap+ef61:` schemes are accepted. DID delimiters in the authority +can be percent-encoded for URL-safe input, as in +`ap+ef61://did%3Akey%3A.../actor`. Fedify stores these IRIs as `URL` objects +with a URL-safe authority internally, and serializes them as canonical +`ap+ef61:` IRIs with the decoded DID authority. + +When comparing portable object IDs, use `canonicalizePortableUri()` or +`arePortableUrisEqual()` from `@fedify/vocab-runtime`; these helpers remove +query hints such as `gateways` according to FEP-ef61. Pass raw URI strings to +these comparison helpers, because JavaScript `URL` objects normalize opaque +path segments before Fedify can compare them. Serialization keeps those query +hints intact. + +Portable IDs also participate in Fedify's origin-based security model. An +`ap:` or `ap+ef61:` URI is owned by the DID in its authority component, and a +DID URL such as `did:key:z...#z...` is owned by its DID component. See the +[*Origin-based security model* section](#origin-based-security-model) for how +this affects property access. + +Actor classes expose the FEP-ef61 `gateways` term as an ordered list: + +~~~~ typescript twoslash +import { Person } from "@fedify/vocab"; + +const actor = new Person({ + id: new URL("ap+ef61://did%3Akey%3Az6Mkabc/actor"), + gateways: [ + new URL("https://server1.example/"), + new URL("https://server2.example/"), + ], +}); +~~~~ + +Each gateway must be an HTTP(S) base URI with no path, query, or fragment. + +Links and media/document objects expose `digestMultibase` for the integrity +digest required when portable objects reference external resources: + +~~~~ typescript twoslash +import { Image } from "@fedify/vocab"; + +const image = new Image({ + url: new URL("hl:zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n"), + mediaType: "image/png", + digestMultibase: "zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n", +}); +~~~~ + +The vocabulary layer stores and serializes the `digestMultibase` value exactly +as provided. Computing SHA-256 digests, parsing hashlinks, and verifying media +bytes are handled by separate helper APIs. + +[FEP-ef61]: https://w3id.org/fep/ef61 + + Object IDs and remote objects ----------------------------- @@ -602,10 +650,8 @@ boundaries, preventing malicious actors from impersonating content from other servers. For ordinary HTTP(S) object IDs, the origin is the web origin: scheme, host, -and port. For [FEP-ef61] portable IDs, Fedify uses the cryptographic origin -defined by the portable identifier. An `ap:` or `ap+ef61:` URI is owned by the -DID in its authority component, and a DID URL such as `did:key:z...#z...` is -owned by its DID component. +and port. For FEP-ef61 portable IDs, Fedify uses the cryptographic origin +defined by the portable identifier. [FEP-fe34]: https://w3id.org/fep/fe34 diff --git a/packages/fedify/src/federation/handler.test.ts b/packages/fedify/src/federation/handler.test.ts index dfe50c38b..35a55e96e 100644 --- a/packages/fedify/src/federation/handler.test.ts +++ b/packages/fedify/src/federation/handler.test.ts @@ -170,6 +170,7 @@ test("handleActor()", async () => { assertEquals(await response.json(), { "@context": [ "https://www.w3.org/ns/activitystreams", + "https://w3id.org/fep/ef61", "https://w3id.org/security/v1", "https://w3id.org/security/data-integrity/v1", "https://www.w3.org/ns/did/v1", @@ -278,6 +279,7 @@ test("handleActor()", async () => { assertEquals(await response.json(), { "@context": [ "https://www.w3.org/ns/activitystreams", + "https://w3id.org/fep/ef61", "https://w3id.org/security/v1", "https://w3id.org/security/data-integrity/v1", "https://www.w3.org/ns/did/v1", diff --git a/packages/fixture/src/fixtures/w3id.org/fep/ef61.json b/packages/fixture/src/fixtures/w3id.org/fep/ef61.json new file mode 100644 index 000000000..69963142d --- /dev/null +++ b/packages/fixture/src/fixtures/w3id.org/fep/ef61.json @@ -0,0 +1,10 @@ +{ + "@context": { + "gateways": { + "@id": "https://w3id.org/fep/ef61/gateways", + "@type": "@id", + "@container": "@list" + }, + "digestMultibase": "https://www.w3.org/ns/credentials/v2#digestMultibase" + } +} diff --git a/packages/fixture/src/fixtures/w3id.org/security/data-integrity/v2.json b/packages/fixture/src/fixtures/w3id.org/security/data-integrity/v2.json new file mode 100644 index 000000000..dfd8f35fc --- /dev/null +++ b/packages/fixture/src/fixtures/w3id.org/security/data-integrity/v2.json @@ -0,0 +1,81 @@ +{ + "@context": { + "id": "@id", + "type": "@type", + "@protected": true, + "proof": { + "@id": "https://w3id.org/security#proof", + "@type": "@id", + "@container": "@graph" + }, + "DataIntegrityProof": { + "@id": "https://w3id.org/security#DataIntegrityProof", + "@context": { + "@protected": true, + "id": "@id", + "type": "@type", + "challenge": "https://w3id.org/security#challenge", + "created": { + "@id": "http://purl.org/dc/terms/created", + "@type": "http://www.w3.org/2001/XMLSchema#dateTime" + }, + "domain": "https://w3id.org/security#domain", + "expires": { + "@id": "https://w3id.org/security#expiration", + "@type": "http://www.w3.org/2001/XMLSchema#dateTime" + }, + "nonce": "https://w3id.org/security#nonce", + "previousProof": { + "@id": "https://w3id.org/security#previousProof", + "@type": "@id" + }, + "proofPurpose": { + "@id": "https://w3id.org/security#proofPurpose", + "@type": "@vocab", + "@context": { + "@protected": true, + "id": "@id", + "type": "@type", + "assertionMethod": { + "@id": "https://w3id.org/security#assertionMethod", + "@type": "@id", + "@container": "@set" + }, + "authentication": { + "@id": "https://w3id.org/security#authenticationMethod", + "@type": "@id", + "@container": "@set" + }, + "capabilityInvocation": { + "@id": "https://w3id.org/security#capabilityInvocationMethod", + "@type": "@id", + "@container": "@set" + }, + "capabilityDelegation": { + "@id": "https://w3id.org/security#capabilityDelegationMethod", + "@type": "@id", + "@container": "@set" + }, + "keyAgreement": { + "@id": "https://w3id.org/security#keyAgreementMethod", + "@type": "@id", + "@container": "@set" + } + } + }, + "cryptosuite": { + "@id": "https://w3id.org/security#cryptosuite", + "@type": "https://w3id.org/security#cryptosuiteString" + }, + "proofValue": { + "@id": "https://w3id.org/security#proofValue", + "@type": "https://w3id.org/security#multibase" + }, + "verificationMethod": { + "@id": "https://w3id.org/security#verificationMethod", + "@type": "@id" + } + } + } + } +} diff --git a/packages/vocab-runtime/src/contexts.ts b/packages/vocab-runtime/src/contexts.ts index 60c3ffeeb..9bc0f1318 100644 --- a/packages/vocab-runtime/src/contexts.ts +++ b/packages/vocab-runtime/src/contexts.ts @@ -8,6 +8,7 @@ import activitystreams from "./contexts/activitystreams.json" with { import didV1 from "./contexts/did-v1.json" with { type: "json" }; import fep5711 from "./contexts/fep-5711.json" with { type: "json" }; import fep7aa9 from "./contexts/fep-7aa9.json" with { type: "json" }; +import fepEf61 from "./contexts/fep-ef61.json" with { type: "json" }; import gotosocial from "./contexts/gotosocial.json" with { type: "json" }; import identityV1 from "./contexts/identity-v1.json" with { type: "json" }; import joinLemmyContext from "./contexts/join-lemmy.json" with { type: "json" }; @@ -37,6 +38,7 @@ const preloadedContexts: Record = { "https://gotosocial.org/ns": gotosocial, "https://w3id.org/fep/5711": fep5711, "https://w3id.org/fep/7aa9": fep7aa9, + "https://w3id.org/fep/ef61": fepEf61, // Lemmy's context document is served as application/json without the JSON-LD // context Link header. The default document loader treats that as a regular diff --git a/packages/vocab-runtime/src/contexts/fep-ef61.json b/packages/vocab-runtime/src/contexts/fep-ef61.json new file mode 100644 index 000000000..69963142d --- /dev/null +++ b/packages/vocab-runtime/src/contexts/fep-ef61.json @@ -0,0 +1,10 @@ +{ + "@context": { + "gateways": { + "@id": "https://w3id.org/fep/ef61/gateways", + "@type": "@id", + "@container": "@list" + }, + "digestMultibase": "https://www.w3.org/ns/credentials/v2#digestMultibase" + } +} diff --git a/packages/vocab-runtime/src/contexts/security-data-integrity-v1.json b/packages/vocab-runtime/src/contexts/security-data-integrity-v1.json index 89ae23eda..127ff0629 100644 --- a/packages/vocab-runtime/src/contexts/security-data-integrity-v1.json +++ b/packages/vocab-runtime/src/contexts/security-data-integrity-v1.json @@ -3,10 +3,6 @@ "id": "@id", "type": "@type", "@protected": true, - "digestMultibase": { - "@id": "https://w3id.org/security#digestMultibase", - "@type": "https://w3id.org/security#multibase" - }, "proof": { "@id": "https://w3id.org/security#proof", "@type": "@id", diff --git a/packages/vocab-runtime/src/docloader.ts b/packages/vocab-runtime/src/docloader.ts index f8a6966d1..a1f010c5d 100644 --- a/packages/vocab-runtime/src/docloader.ts +++ b/packages/vocab-runtime/src/docloader.ts @@ -351,8 +351,10 @@ export interface GetDocumentLoaderOptions extends DocumentLoaderFactoryOptions { * - * - * - + * - * - * - + * - * - * - * @param options Options for the document loader. diff --git a/packages/vocab-runtime/src/mod.ts b/packages/vocab-runtime/src/mod.ts index 45ce7b94d..a283970c7 100644 --- a/packages/vocab-runtime/src/mod.ts +++ b/packages/vocab-runtime/src/mod.ts @@ -61,8 +61,10 @@ export { getFe34Origin, haveSameFe34Origin, haveSameIriOrigin, + isGatewayUrl, isValidPublicIPv4Address, isValidPublicIPv6Address, + parseGatewayUrl, parseIri, parseJsonLdId, UrlError, diff --git a/packages/vocab-runtime/src/url.test.ts b/packages/vocab-runtime/src/url.test.ts index 255ae9f03..c31d0b88f 100644 --- a/packages/vocab-runtime/src/url.test.ts +++ b/packages/vocab-runtime/src/url.test.ts @@ -8,8 +8,10 @@ import { getFe34Origin, haveSameFe34Origin, haveSameIriOrigin, + isGatewayUrl, isValidPublicIPv4Address, isValidPublicIPv6Address, + parseGatewayUrl, parseIri, parseJsonLdId, UrlError, @@ -638,6 +640,27 @@ test("parseIri() preserves encoded percent signs while decoding delimiters", () ); }); +test("parseGatewayUrl() accepts only HTTP(S) base URIs", () => { + for (const url of ["https://server.example/", "http://server.example/"]) { + deepStrictEqual(parseGatewayUrl(url), new URL(url)); + ok(isGatewayUrl(new URL(url))); + } + + for ( + const url of [ + "ftp://server.example/", + "https://user:pass@server.example/", + "https://user@server.example/", + "https://server.example/path", + "https://server.example/?x=1", + "https://server.example/#fragment", + ] + ) { + throws(() => parseGatewayUrl(url), TypeError); + ok(!isGatewayUrl(new URL(url))); + } +}); + test("validatePublicUrl()", async () => { await rejects(() => validatePublicUrl("ftp://localhost"), UrlError); await rejects( diff --git a/packages/vocab-runtime/src/url.ts b/packages/vocab-runtime/src/url.ts index b02afc3ca..33140aedf 100644 --- a/packages/vocab-runtime/src/url.ts +++ b/packages/vocab-runtime/src/url.ts @@ -323,6 +323,29 @@ function parseAtUri(uri: string): URL { return new URL("at://" + encodeURIComponent(authority) + path); } +/** + * Checks whether the URL is an FEP-ef61 gateway base URI. + */ +export function isGatewayUrl(url: URL): boolean { + return (url.protocol === "http:" || url.protocol === "https:") && + url.username === "" && url.password === "" && + url.pathname === "/" && url.search === "" && url.hash === ""; +} + +/** + * Parses and validates an FEP-ef61 gateway base URI. + */ +export function parseGatewayUrl(url: string): URL { + const parsed = parseIri(url); + if (!isGatewayUrl(parsed)) { + throw new TypeError( + "FEP-ef61 gateways must be HTTP(S) base URIs with no credentials, " + + "path, query, or fragment.", + ); + } + return parsed; +} + /** * Validates a URL to prevent SSRF attacks. */ diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 7240186a4..a48d6fde1 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -19,8 +19,10 @@ import { importMultibaseKey, importPem, isDecimal, + isGatewayUrl, LanguageString, parseDecimal, + parseGatewayUrl, parseIri, parseJsonLdId, type RemoteDocument @@ -43296,7 +43298,8 @@ export class Application extends Object { #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); - #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; + #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; +#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); @@ -43369,7 +43372,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} , @@ -43496,6 +43500,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | } } + if (\\"gateway\\" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + \\"The gateway must be of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + + if (\\"gateways\\" in values && values.gateways != null) { + + if (\\"gateway\\" in values && + values.gateway != null) { + throw new TypeError( + \\"Cannot initialize both gateway and \\" + + \\"gateways at the same time.\\", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + \\"The gateways must be an array of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -43846,7 +43886,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} @@ -43982,6 +44023,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + if (\\"gateway\\" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + \\"The gateway must be of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + + if (\\"gateways\\" in values && values.gateways != null) { + + if (\\"gateway\\" in values && + values.gateway != null) { + throw new TypeError( + \\"Cannot update both gateway and \\" + + \\"gateways at the same time.\\", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + \\"The gateways must be an array of type \\" + + \\"URL\\" + \\".\\", + ); + } + } clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { @@ -45004,6 +45081,33 @@ get preferredUsernames(): ((string | LanguageString))[] { } } +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ + get gateway(): (URL | null) { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if (this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < 1) return null; + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ +get gateways(): (URL)[] { + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + } + /** When \`true\`, conveys that for this actor, follow requests are not usually * automatically approved, but instead are examined by a person who may accept * or reject the request, at some time in the future. Setting of \`false\` @@ -48312,6 +48416,19 @@ get preferredUsernames(): ((string | LanguageString))[] { } + compactItems = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const item = ( + formatIri(v) + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result[\\"gateways\\"] = compactItems; + + } + compactItems = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const item = ( @@ -48726,7 +48843,7 @@ get preferredUsernames(): ((string | LanguageString))[] { result[\\"type\\"] = \\"Application\\"; if (this.id != null) result[\\"id\\"] = formatIri(this.id); - result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; + result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/fep/ef61\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; return result; } @@ -48791,6 +48908,21 @@ get preferredUsernames(): ((string | LanguageString))[] { } + array = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const element = ( + { \\"@id\\": formatIri(v) } + ); + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + { \\"@list\\": array } + ); + values[\\"https://w3id.org/fep/ef61/gateways\\"] = propValue; + + } + array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const element = ( @@ -49100,7 +49232,7 @@ get preferredUsernames(): ((string | LanguageString))[] { ); } const docContext = options.context ?? - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/fep/ef61\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; const compacted = await jsonld.compact( values, docContext, @@ -49342,6 +49474,24 @@ get preferredUsernames(): ((string | LanguageString))[] { _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); } instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const _hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; + + let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values[\\"https://w3id.org/fep/ef61/gateways\\"]; + + for ( + const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null + ? [] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && \\"@list\\" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] + ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0][\\"@list\\"] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array + ) { + if (v == null) continue; + + const decoded = parseGatewayUrl(typeof v[\\"@id\\"] === \\"string\\" ? v[\\"@id\\"] : v[\\"@value\\"]); + if (typeof decoded === \\"undefined\\") continue; + _hQiaHhZP8hqxckxTBrpsGNs57E3.push(decoded); + } + instance.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = _hQiaHhZP8hqxckxTBrpsGNs57E3; const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; let _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers__array = values[\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\"]; @@ -50013,6 +50163,32 @@ get preferredUsernames(): ((string | LanguageString))[] { proxy.assertionMethods = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; } + const _hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for(\\"Deno.customInspect\\")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => \\"URL \\" + inspect(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length == 1) { + proxy.gateway = _hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length > 1 + || !(\\"gateway\\" in proxy) + && _hQiaHhZP8hqxckxTBrpsGNs57E3.length > 0) { + proxy.gateways = _hQiaHhZP8hqxckxTBrpsGNs57E3; + } + const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL @@ -52389,6 +52565,7 @@ export class Document extends Object { } #_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width: (number)[] = []; #_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height: (number)[] = []; +#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase: (string)[] = []; /** * Constructs a new instance of Document with the given values. @@ -52415,7 +52592,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} , options: { documentLoader?: DocumentLoader, @@ -52449,6 +52626,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } + + if (\\"digestMultibase\\" in values && values.digestMultibase != null) { + if (typeof values.digestMultibase === \\"string\\") { + // @ts-ignore: type is checked above. + this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = [values.digestMultibase]; + + } else { + throw new TypeError( + \\"The digestMultibase must be of type \\" + + \\"string\\" + \\".\\", + ); + } + } } /** @@ -52477,7 +52667,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} = {}, options: { @@ -52519,6 +52709,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } + clone.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; + if (\\"digestMultibase\\" in values && values.digestMultibase != null) { + if (typeof values.digestMultibase === \\"string\\") { + // @ts-ignore: type is checked above. + clone.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = [values.digestMultibase]; + + } else { + throw new TypeError( + \\"The digestMultibase must be of type \\" + + \\"string\\" + \\".\\", + ); + } + } return clone; } @@ -52553,6 +52756,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height[0]; } +/** The multibase-encoded integrity digest of an external resource represented + * by this document. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ + get digestMultibase(): (string | null) { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if (this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.length < 1) return null; + return this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase[0]; + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -52625,9 +52845,25 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } + compactItems = []; + for (const v of this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase) { + const item = ( + v + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result[\\"digestMultibase\\"] + = compactItems.length > 1 + ? compactItems + : compactItems[0]; + + } + result[\\"type\\"] = \\"Document\\"; if (this.id != null) result[\\"id\\"] = formatIri(this.id); - result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v2\\",{\\"digestMultibase\\":\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"},\\"https://gotosocial.org/ns\\"]; return result; } @@ -52680,6 +52916,21 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } + array = []; + for (const v of this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase) { + const element = ( + { \\"@value\\": v } + ); + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + array + ); + values[\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"] = propValue; + + } + values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Document\\"]; if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { @@ -52689,7 +52940,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } const docContext = options.context ?? - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v2\\",{\\"digestMultibase\\":\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"},\\"https://gotosocial.org/ns\\"]; const compacted = await jsonld.compact( values, docContext, @@ -52889,6 +53140,24 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu _2cGKFeFJMmiNpGZFEF75mCwFQsKb_height.push(decoded); } instance.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height = _2cGKFeFJMmiNpGZFEF75mCwFQsKb_height; + const _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase: (string)[] = []; + + let _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array = values[\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"]; + + for ( + const v of _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array == null + ? [] + : _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array.length === 1 && \\"@list\\" in _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array[0] + ? _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array[0][\\"@list\\"] + : _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array + ) { + if (v == null) continue; + + const decoded = v[\\"@value\\"]; + if (typeof decoded === \\"undefined\\") continue; + _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.push(decoded); + } + instance.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { @@ -52957,6 +53226,26 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu proxy.height = _2cGKFeFJMmiNpGZFEF75mCwFQsKb_height[0]; } + const _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for(\\"Deno.customInspect\\")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => \\"URL \\" + inspect(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.length == 1) { + proxy.digestMultibase = _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase[0]; + } + return proxy; } } @@ -53020,7 +53309,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} , options: { documentLoader?: DocumentLoader, @@ -53056,7 +53345,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} = {}, options: { @@ -53118,7 +53407,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu result[\\"type\\"] = \\"Audio\\"; if (this.id != null) result[\\"id\\"] = formatIri(this.id); - result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v2\\",{\\"digestMultibase\\":\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"},\\"https://gotosocial.org/ns\\"]; return result; } @@ -53144,7 +53433,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } const docContext = options.context ?? - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v2\\",{\\"digestMultibase\\":\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"},\\"https://gotosocial.org/ns\\"]; const compacted = await jsonld.compact( values, docContext, @@ -58712,7 +59001,8 @@ export class Group extends Object { #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); - #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; + #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; +#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); @@ -58785,7 +59075,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} , @@ -58912,6 +59203,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | } } + if (\\"gateway\\" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + \\"The gateway must be of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + + if (\\"gateways\\" in values && values.gateways != null) { + + if (\\"gateway\\" in values && + values.gateway != null) { + throw new TypeError( + \\"Cannot initialize both gateway and \\" + + \\"gateways at the same time.\\", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + \\"The gateways must be an array of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -59262,7 +59589,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} @@ -59398,6 +59726,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + if (\\"gateway\\" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + \\"The gateway must be of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + + if (\\"gateways\\" in values && values.gateways != null) { + + if (\\"gateway\\" in values && + values.gateway != null) { + throw new TypeError( + \\"Cannot update both gateway and \\" + + \\"gateways at the same time.\\", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + \\"The gateways must be an array of type \\" + + \\"URL\\" + \\".\\", + ); + } + } clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { @@ -60420,6 +60784,33 @@ get preferredUsernames(): ((string | LanguageString))[] { } } +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ + get gateway(): (URL | null) { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if (this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < 1) return null; + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ +get gateways(): (URL)[] { + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + } + /** When \`true\`, conveys that for this actor, follow requests are not usually * automatically approved, but instead are examined by a person who may accept * or reject the request, at some time in the future. Setting of \`false\` @@ -63728,6 +64119,19 @@ get preferredUsernames(): ((string | LanguageString))[] { } + compactItems = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const item = ( + formatIri(v) + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result[\\"gateways\\"] = compactItems; + + } + compactItems = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const item = ( @@ -64142,7 +64546,7 @@ get preferredUsernames(): ((string | LanguageString))[] { result[\\"type\\"] = \\"Group\\"; if (this.id != null) result[\\"id\\"] = formatIri(this.id); - result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; + result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/fep/ef61\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; return result; } @@ -64207,6 +64611,21 @@ get preferredUsernames(): ((string | LanguageString))[] { } + array = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const element = ( + { \\"@id\\": formatIri(v) } + ); + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + { \\"@list\\": array } + ); + values[\\"https://w3id.org/fep/ef61/gateways\\"] = propValue; + + } + array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const element = ( @@ -64516,7 +64935,7 @@ get preferredUsernames(): ((string | LanguageString))[] { ); } const docContext = options.context ?? - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/fep/ef61\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; const compacted = await jsonld.compact( values, docContext, @@ -64758,6 +65177,24 @@ get preferredUsernames(): ((string | LanguageString))[] { _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); } instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const _hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; + + let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values[\\"https://w3id.org/fep/ef61/gateways\\"]; + + for ( + const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null + ? [] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && \\"@list\\" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] + ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0][\\"@list\\"] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array + ) { + if (v == null) continue; + + const decoded = parseGatewayUrl(typeof v[\\"@id\\"] === \\"string\\" ? v[\\"@id\\"] : v[\\"@value\\"]); + if (typeof decoded === \\"undefined\\") continue; + _hQiaHhZP8hqxckxTBrpsGNs57E3.push(decoded); + } + instance.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = _hQiaHhZP8hqxckxTBrpsGNs57E3; const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; let _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers__array = values[\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\"]; @@ -65429,6 +65866,32 @@ get preferredUsernames(): ((string | LanguageString))[] { proxy.assertionMethods = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; } + const _hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for(\\"Deno.customInspect\\")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => \\"URL \\" + inspect(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length == 1) { + proxy.gateway = _hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length > 1 + || !(\\"gateway\\" in proxy) + && _hQiaHhZP8hqxckxTBrpsGNs57E3.length > 0) { + proxy.gateways = _hQiaHhZP8hqxckxTBrpsGNs57E3; + } + const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL @@ -65935,6 +66398,7 @@ export class Link { #_pVjLsybKQdmkjuU7MHjiVmNnuj7_href: (URL)[] = []; #_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel: (string)[] = []; #_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType: (string)[] = []; +#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase: (string)[] = []; #_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name: ((string | LanguageString))[] = []; #_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang: (Intl.Locale)[] = []; #_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height: (number)[] = []; @@ -65953,7 +66417,7 @@ export class Link { { id?: URL | null; href?: URL | null;rel?: string | null; -rels?: (string)[];mediaType?: string | null;name?: string | LanguageString | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];} , options: { @@ -66043,6 +66507,19 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num } } + if (\\"digestMultibase\\" in values && values.digestMultibase != null) { + if (typeof values.digestMultibase === \\"string\\") { + // @ts-ignore: type is checked above. + this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = [values.digestMultibase]; + + } else { + throw new TypeError( + \\"The digestMultibase must be of type \\" + + \\"string\\" + \\".\\", + ); + } + } + if (\\"name\\" in values && values.name != null) { if (typeof values.name === \\"string\\" || values.name instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -66149,7 +66626,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num { id?: URL | null; href?: URL | null;rel?: string | null; -rels?: (string)[];mediaType?: string | null;name?: string | LanguageString | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];} = {}, @@ -66234,6 +66711,19 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } + clone.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; + if (\\"digestMultibase\\" in values && values.digestMultibase != null) { + if (typeof values.digestMultibase === \\"string\\") { + // @ts-ignore: type is checked above. + clone.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = [values.digestMultibase]; + + } else { + throw new TypeError( + \\"The digestMultibase must be of type \\" + + \\"string\\" + \\".\\", + ); + } + } clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name; if (\\"name\\" in values && values.name != null) { if (typeof values.name === \\"string\\" || values.name instanceof LanguageString) { @@ -66392,6 +66882,22 @@ get rels(): (string)[] { return this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType[0]; } +/** The multibase-encoded integrity digest of the linked resource. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ + get digestMultibase(): (string | null) { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if (this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.length < 1) return null; + return this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase[0]; + } + /** A simple, human-readable, plain-text name for the object. HTML markup MUST * NOT be included. The name MAY be expressed using multiple language-tagged * values. @@ -66781,6 +67287,22 @@ get names(): ((string | LanguageString))[] { } + compactItems = []; + for (const v of this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase) { + const item = ( + v + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result[\\"digestMultibase\\"] + = compactItems.length > 1 + ? compactItems + : compactItems[0]; + + } + compactItems = []; for (const v of this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name) { const item = ( @@ -66874,7 +67396,7 @@ get names(): ((string | LanguageString))[] { result[\\"type\\"] = \\"Link\\"; if (this.id != null) result[\\"id\\"] = formatIri(this.id); - result[\\"@context\\"] = \\"https://www.w3.org/ns/activitystreams\\"; + result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/fep/ef61\\"]; return result; } @@ -66926,6 +67448,21 @@ get names(): ((string | LanguageString))[] { } + array = []; + for (const v of this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase) { + const element = ( + { \\"@value\\": v } + ); + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + array + ); + values[\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"] = propValue; + + } + array = []; for (const v of this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name) { const element = ( @@ -67019,7 +67556,7 @@ get names(): ((string | LanguageString))[] { ); } const docContext = options.context ?? - \\"https://www.w3.org/ns/activitystreams\\"; + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/fep/ef61\\"]; const compacted = await jsonld.compact( values, docContext, @@ -67220,6 +67757,24 @@ get names(): ((string | LanguageString))[] { _3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.push(decoded); } instance.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = _3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType; + const _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase: (string)[] = []; + + let _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array = values[\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"]; + + for ( + const v of _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array == null + ? [] + : _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array.length === 1 && \\"@list\\" in _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array[0] + ? _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array[0][\\"@list\\"] + : _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array + ) { + if (v == null) continue; + + const decoded = v[\\"@value\\"]; + if (typeof decoded === \\"undefined\\") continue; + _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.push(decoded); + } + instance.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; const _4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name: ((string | LanguageString))[] = []; let _4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name__array = values[\\"https://www.w3.org/ns/activitystreams#name\\"]; @@ -67447,6 +68002,26 @@ get names(): ((string | LanguageString))[] { proxy.mediaType = _3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType[0]; } + const _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for(\\"Deno.customInspect\\")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => \\"URL \\" + inspect(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.length == 1) { + proxy.digestMultibase = _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase[0]; + } + const _4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL @@ -67606,7 +68181,7 @@ export class Hashtag extends Link { { id?: URL | null; href?: URL | null;rel?: string | null; -rels?: (string)[];mediaType?: string | null;name?: string | LanguageString | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];} , options: { @@ -67628,7 +68203,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num { id?: URL | null; href?: URL | null;rel?: string | null; -rels?: (string)[];mediaType?: string | null;name?: string | LanguageString | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];} = {}, @@ -67945,7 +68520,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} , options: { documentLoader?: DocumentLoader, @@ -67981,7 +68556,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} = {}, options: { @@ -68043,7 +68618,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu result[\\"type\\"] = \\"Image\\"; if (this.id != null) result[\\"id\\"] = formatIri(this.id); - result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v2\\",{\\"digestMultibase\\":\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"},\\"https://gotosocial.org/ns\\"]; return result; } @@ -68069,7 +68644,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } const docContext = options.context ?? - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v2\\",{\\"digestMultibase\\":\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"},\\"https://gotosocial.org/ns\\"]; const compacted = await jsonld.compact( values, docContext, @@ -70456,7 +71031,7 @@ export class Mention extends Link { { id?: URL | null; href?: URL | null;rel?: string | null; -rels?: (string)[];mediaType?: string | null;name?: string | LanguageString | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];} , options: { @@ -70478,7 +71053,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num { id?: URL | null; href?: URL | null;rel?: string | null; -rels?: (string)[];mediaType?: string | null;name?: string | LanguageString | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];} = {}, @@ -73187,7 +73762,8 @@ export class Organization extends Object { #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); - #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; + #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; +#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); @@ -73260,7 +73836,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} , @@ -73387,6 +73964,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | } } + if (\\"gateway\\" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + \\"The gateway must be of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + + if (\\"gateways\\" in values && values.gateways != null) { + + if (\\"gateway\\" in values && + values.gateway != null) { + throw new TypeError( + \\"Cannot initialize both gateway and \\" + + \\"gateways at the same time.\\", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + \\"The gateways must be an array of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -73737,7 +74350,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} @@ -73873,6 +74487,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + if (\\"gateway\\" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + \\"The gateway must be of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + + if (\\"gateways\\" in values && values.gateways != null) { + + if (\\"gateway\\" in values && + values.gateway != null) { + throw new TypeError( + \\"Cannot update both gateway and \\" + + \\"gateways at the same time.\\", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + \\"The gateways must be an array of type \\" + + \\"URL\\" + \\".\\", + ); + } + } clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { @@ -74895,6 +75545,33 @@ get preferredUsernames(): ((string | LanguageString))[] { } } +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ + get gateway(): (URL | null) { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if (this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < 1) return null; + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ +get gateways(): (URL)[] { + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + } + /** When \`true\`, conveys that for this actor, follow requests are not usually * automatically approved, but instead are examined by a person who may accept * or reject the request, at some time in the future. Setting of \`false\` @@ -78203,6 +78880,19 @@ get preferredUsernames(): ((string | LanguageString))[] { } + compactItems = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const item = ( + formatIri(v) + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result[\\"gateways\\"] = compactItems; + + } + compactItems = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const item = ( @@ -78617,7 +79307,7 @@ get preferredUsernames(): ((string | LanguageString))[] { result[\\"type\\"] = \\"Organization\\"; if (this.id != null) result[\\"id\\"] = formatIri(this.id); - result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; + result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/fep/ef61\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; return result; } @@ -78682,6 +79372,21 @@ get preferredUsernames(): ((string | LanguageString))[] { } + array = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const element = ( + { \\"@id\\": formatIri(v) } + ); + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + { \\"@list\\": array } + ); + values[\\"https://w3id.org/fep/ef61/gateways\\"] = propValue; + + } + array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const element = ( @@ -78991,7 +79696,7 @@ get preferredUsernames(): ((string | LanguageString))[] { ); } const docContext = options.context ?? - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/fep/ef61\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; const compacted = await jsonld.compact( values, docContext, @@ -79233,6 +79938,24 @@ get preferredUsernames(): ((string | LanguageString))[] { _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); } instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const _hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; + + let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values[\\"https://w3id.org/fep/ef61/gateways\\"]; + + for ( + const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null + ? [] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && \\"@list\\" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] + ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0][\\"@list\\"] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array + ) { + if (v == null) continue; + + const decoded = parseGatewayUrl(typeof v[\\"@id\\"] === \\"string\\" ? v[\\"@id\\"] : v[\\"@value\\"]); + if (typeof decoded === \\"undefined\\") continue; + _hQiaHhZP8hqxckxTBrpsGNs57E3.push(decoded); + } + instance.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = _hQiaHhZP8hqxckxTBrpsGNs57E3; const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; let _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers__array = values[\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\"]; @@ -79904,6 +80627,32 @@ get preferredUsernames(): ((string | LanguageString))[] { proxy.assertionMethods = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; } + const _hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for(\\"Deno.customInspect\\")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => \\"URL \\" + inspect(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length == 1) { + proxy.gateway = _hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length > 1 + || !(\\"gateway\\" in proxy) + && _hQiaHhZP8hqxckxTBrpsGNs57E3.length > 0) { + proxy.gateways = _hQiaHhZP8hqxckxTBrpsGNs57E3; + } + const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL @@ -80381,7 +81130,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} , options: { documentLoader?: DocumentLoader, @@ -80417,7 +81166,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} = {}, options: { @@ -80479,7 +81228,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu result[\\"type\\"] = \\"Page\\"; if (this.id != null) result[\\"id\\"] = formatIri(this.id); - result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v2\\",{\\"digestMultibase\\":\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"},\\"https://gotosocial.org/ns\\"]; return result; } @@ -80505,7 +81254,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } const docContext = options.context ?? - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v2\\",{\\"digestMultibase\\":\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"},\\"https://gotosocial.org/ns\\"]; const compacted = await jsonld.compact( values, docContext, @@ -80725,7 +81474,8 @@ export class Person extends Object { #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); - #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; + #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; +#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); @@ -80798,7 +81548,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} , @@ -80925,6 +81676,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | } } + if (\\"gateway\\" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + \\"The gateway must be of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + + if (\\"gateways\\" in values && values.gateways != null) { + + if (\\"gateway\\" in values && + values.gateway != null) { + throw new TypeError( + \\"Cannot initialize both gateway and \\" + + \\"gateways at the same time.\\", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + \\"The gateways must be an array of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -81275,7 +82062,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} @@ -81411,6 +82199,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + if (\\"gateway\\" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + \\"The gateway must be of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + + if (\\"gateways\\" in values && values.gateways != null) { + + if (\\"gateway\\" in values && + values.gateway != null) { + throw new TypeError( + \\"Cannot update both gateway and \\" + + \\"gateways at the same time.\\", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + \\"The gateways must be an array of type \\" + + \\"URL\\" + \\".\\", + ); + } + } clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { @@ -82433,6 +83257,33 @@ get preferredUsernames(): ((string | LanguageString))[] { } } +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ + get gateway(): (URL | null) { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if (this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < 1) return null; + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ +get gateways(): (URL)[] { + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + } + /** When \`true\`, conveys that for this actor, follow requests are not usually * automatically approved, but instead are examined by a person who may accept * or reject the request, at some time in the future. Setting of \`false\` @@ -85741,6 +86592,19 @@ get preferredUsernames(): ((string | LanguageString))[] { } + compactItems = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const item = ( + formatIri(v) + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result[\\"gateways\\"] = compactItems; + + } + compactItems = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const item = ( @@ -86155,7 +87019,7 @@ get preferredUsernames(): ((string | LanguageString))[] { result[\\"type\\"] = \\"Person\\"; if (this.id != null) result[\\"id\\"] = formatIri(this.id); - result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; + result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/fep/ef61\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; return result; } @@ -86220,6 +87084,21 @@ get preferredUsernames(): ((string | LanguageString))[] { } + array = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const element = ( + { \\"@id\\": formatIri(v) } + ); + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + { \\"@list\\": array } + ); + values[\\"https://w3id.org/fep/ef61/gateways\\"] = propValue; + + } + array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const element = ( @@ -86529,7 +87408,7 @@ get preferredUsernames(): ((string | LanguageString))[] { ); } const docContext = options.context ?? - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/fep/ef61\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; const compacted = await jsonld.compact( values, docContext, @@ -86771,6 +87650,24 @@ get preferredUsernames(): ((string | LanguageString))[] { _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); } instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const _hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; + + let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values[\\"https://w3id.org/fep/ef61/gateways\\"]; + + for ( + const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null + ? [] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && \\"@list\\" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] + ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0][\\"@list\\"] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array + ) { + if (v == null) continue; + + const decoded = parseGatewayUrl(typeof v[\\"@id\\"] === \\"string\\" ? v[\\"@id\\"] : v[\\"@value\\"]); + if (typeof decoded === \\"undefined\\") continue; + _hQiaHhZP8hqxckxTBrpsGNs57E3.push(decoded); + } + instance.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = _hQiaHhZP8hqxckxTBrpsGNs57E3; const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; let _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers__array = values[\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\"]; @@ -87442,6 +88339,32 @@ get preferredUsernames(): ((string | LanguageString))[] { proxy.assertionMethods = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; } + const _hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for(\\"Deno.customInspect\\")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => \\"URL \\" + inspect(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length == 1) { + proxy.gateway = _hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length > 1 + || !(\\"gateway\\" in proxy) + && _hQiaHhZP8hqxckxTBrpsGNs57E3.length > 0) { + proxy.gateways = _hQiaHhZP8hqxckxTBrpsGNs57E3; + } + const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL @@ -94501,7 +95424,8 @@ export class Service extends Object { #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); - #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; + #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; +#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); @@ -94574,7 +95498,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} , @@ -94701,6 +95626,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | } } + if (\\"gateway\\" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + \\"The gateway must be of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + + if (\\"gateways\\" in values && values.gateways != null) { + + if (\\"gateway\\" in values && + values.gateway != null) { + throw new TypeError( + \\"Cannot initialize both gateway and \\" + + \\"gateways at the same time.\\", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + \\"The gateways must be an array of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -95051,7 +96012,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} @@ -95187,6 +96149,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + if (\\"gateway\\" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + \\"The gateway must be of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + + if (\\"gateways\\" in values && values.gateways != null) { + + if (\\"gateway\\" in values && + values.gateway != null) { + throw new TypeError( + \\"Cannot update both gateway and \\" + + \\"gateways at the same time.\\", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + \\"The gateways must be an array of type \\" + + \\"URL\\" + \\".\\", + ); + } + } clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { @@ -96209,6 +97207,33 @@ get preferredUsernames(): ((string | LanguageString))[] { } } +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ + get gateway(): (URL | null) { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if (this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < 1) return null; + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ +get gateways(): (URL)[] { + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + } + /** When \`true\`, conveys that for this actor, follow requests are not usually * automatically approved, but instead are examined by a person who may accept * or reject the request, at some time in the future. Setting of \`false\` @@ -99517,6 +100542,19 @@ get preferredUsernames(): ((string | LanguageString))[] { } + compactItems = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const item = ( + formatIri(v) + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result[\\"gateways\\"] = compactItems; + + } + compactItems = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const item = ( @@ -99931,7 +100969,7 @@ get preferredUsernames(): ((string | LanguageString))[] { result[\\"type\\"] = \\"Service\\"; if (this.id != null) result[\\"id\\"] = formatIri(this.id); - result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; + result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/fep/ef61\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; return result; } @@ -99996,6 +101034,21 @@ get preferredUsernames(): ((string | LanguageString))[] { } + array = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const element = ( + { \\"@id\\": formatIri(v) } + ); + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + { \\"@list\\": array } + ); + values[\\"https://w3id.org/fep/ef61/gateways\\"] = propValue; + + } + array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const element = ( @@ -100305,7 +101358,7 @@ get preferredUsernames(): ((string | LanguageString))[] { ); } const docContext = options.context ?? - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/fep/ef61\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; const compacted = await jsonld.compact( values, docContext, @@ -100547,6 +101600,24 @@ get preferredUsernames(): ((string | LanguageString))[] { _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); } instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const _hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; + + let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values[\\"https://w3id.org/fep/ef61/gateways\\"]; + + for ( + const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null + ? [] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && \\"@list\\" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] + ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0][\\"@list\\"] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array + ) { + if (v == null) continue; + + const decoded = parseGatewayUrl(typeof v[\\"@id\\"] === \\"string\\" ? v[\\"@id\\"] : v[\\"@value\\"]); + if (typeof decoded === \\"undefined\\") continue; + _hQiaHhZP8hqxckxTBrpsGNs57E3.push(decoded); + } + instance.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = _hQiaHhZP8hqxckxTBrpsGNs57E3; const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; let _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers__array = values[\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\"]; @@ -101218,6 +102289,32 @@ get preferredUsernames(): ((string | LanguageString))[] { proxy.assertionMethods = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; } + const _hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for(\\"Deno.customInspect\\")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => \\"URL \\" + inspect(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length == 1) { + proxy.gateway = _hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length > 1 + || !(\\"gateway\\" in proxy) + && _hQiaHhZP8hqxckxTBrpsGNs57E3.length > 0) { + proxy.gateways = _hQiaHhZP8hqxckxTBrpsGNs57E3; + } + const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL @@ -104859,7 +105956,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} , options: { documentLoader?: DocumentLoader, @@ -104895,7 +105992,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} = {}, options: { @@ -104957,7 +106054,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu result[\\"type\\"] = \\"Video\\"; if (this.id != null) result[\\"id\\"] = formatIri(this.id); - result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v2\\",{\\"digestMultibase\\":\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"},\\"https://gotosocial.org/ns\\"]; return result; } @@ -104983,7 +106080,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } const docContext = options.context ?? - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v2\\",{\\"digestMultibase\\":\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"},\\"https://gotosocial.org/ns\\"]; const compacted = await jsonld.compact( values, docContext, diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index f6e08b5b6..09a7629f3 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -17,8 +17,10 @@ import { importMultibaseKey, importPem, isDecimal, + isGatewayUrl, LanguageString, parseDecimal, + parseGatewayUrl, parseIri, parseJsonLdId, type RemoteDocument @@ -43294,7 +43296,8 @@ export class Application extends Object { #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); - #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; + #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; +#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); @@ -43367,7 +43370,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} , @@ -43494,6 +43498,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | } } + if (\\"gateway\\" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + \\"The gateway must be of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + + if (\\"gateways\\" in values && values.gateways != null) { + + if (\\"gateway\\" in values && + values.gateway != null) { + throw new TypeError( + \\"Cannot initialize both gateway and \\" + + \\"gateways at the same time.\\", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + \\"The gateways must be an array of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -43844,7 +43884,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} @@ -43980,6 +44021,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + if (\\"gateway\\" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + \\"The gateway must be of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + + if (\\"gateways\\" in values && values.gateways != null) { + + if (\\"gateway\\" in values && + values.gateway != null) { + throw new TypeError( + \\"Cannot update both gateway and \\" + + \\"gateways at the same time.\\", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + \\"The gateways must be an array of type \\" + + \\"URL\\" + \\".\\", + ); + } + } clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { @@ -45002,6 +45079,33 @@ get preferredUsernames(): ((string | LanguageString))[] { } } +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ + get gateway(): (URL | null) { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if (this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < 1) return null; + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ +get gateways(): (URL)[] { + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + } + /** When \`true\`, conveys that for this actor, follow requests are not usually * automatically approved, but instead are examined by a person who may accept * or reject the request, at some time in the future. Setting of \`false\` @@ -48310,6 +48414,19 @@ get preferredUsernames(): ((string | LanguageString))[] { } + compactItems = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const item = ( + formatIri(v) + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result[\\"gateways\\"] = compactItems; + + } + compactItems = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const item = ( @@ -48724,7 +48841,7 @@ get preferredUsernames(): ((string | LanguageString))[] { result[\\"type\\"] = \\"Application\\"; if (this.id != null) result[\\"id\\"] = formatIri(this.id); - result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; + result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/fep/ef61\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; return result; } @@ -48789,6 +48906,21 @@ get preferredUsernames(): ((string | LanguageString))[] { } + array = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const element = ( + { \\"@id\\": formatIri(v) } + ); + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + { \\"@list\\": array } + ); + values[\\"https://w3id.org/fep/ef61/gateways\\"] = propValue; + + } + array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const element = ( @@ -49098,7 +49230,7 @@ get preferredUsernames(): ((string | LanguageString))[] { ); } const docContext = options.context ?? - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/fep/ef61\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; const compacted = await jsonld.compact( values, docContext, @@ -49340,6 +49472,24 @@ get preferredUsernames(): ((string | LanguageString))[] { _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); } instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const _hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; + + let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values[\\"https://w3id.org/fep/ef61/gateways\\"]; + + for ( + const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null + ? [] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && \\"@list\\" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] + ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0][\\"@list\\"] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array + ) { + if (v == null) continue; + + const decoded = parseGatewayUrl(typeof v[\\"@id\\"] === \\"string\\" ? v[\\"@id\\"] : v[\\"@value\\"]); + if (typeof decoded === \\"undefined\\") continue; + _hQiaHhZP8hqxckxTBrpsGNs57E3.push(decoded); + } + instance.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = _hQiaHhZP8hqxckxTBrpsGNs57E3; const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; let _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers__array = values[\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\"]; @@ -50011,6 +50161,32 @@ get preferredUsernames(): ((string | LanguageString))[] { proxy.assertionMethods = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; } + const _hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for(\\"Deno.customInspect\\")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => \\"URL \\" + inspect(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length == 1) { + proxy.gateway = _hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length > 1 + || !(\\"gateway\\" in proxy) + && _hQiaHhZP8hqxckxTBrpsGNs57E3.length > 0) { + proxy.gateways = _hQiaHhZP8hqxckxTBrpsGNs57E3; + } + const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL @@ -52387,6 +52563,7 @@ export class Document extends Object { } #_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width: (number)[] = []; #_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height: (number)[] = []; +#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase: (string)[] = []; /** * Constructs a new instance of Document with the given values. @@ -52413,7 +52590,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} , options: { documentLoader?: DocumentLoader, @@ -52447,6 +52624,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } + + if (\\"digestMultibase\\" in values && values.digestMultibase != null) { + if (typeof values.digestMultibase === \\"string\\") { + // @ts-ignore: type is checked above. + this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = [values.digestMultibase]; + + } else { + throw new TypeError( + \\"The digestMultibase must be of type \\" + + \\"string\\" + \\".\\", + ); + } + } } /** @@ -52475,7 +52665,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} = {}, options: { @@ -52517,6 +52707,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } + clone.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; + if (\\"digestMultibase\\" in values && values.digestMultibase != null) { + if (typeof values.digestMultibase === \\"string\\") { + // @ts-ignore: type is checked above. + clone.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = [values.digestMultibase]; + + } else { + throw new TypeError( + \\"The digestMultibase must be of type \\" + + \\"string\\" + \\".\\", + ); + } + } return clone; } @@ -52551,6 +52754,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height[0]; } +/** The multibase-encoded integrity digest of an external resource represented + * by this document. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ + get digestMultibase(): (string | null) { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if (this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.length < 1) return null; + return this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase[0]; + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -52623,9 +52843,25 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } + compactItems = []; + for (const v of this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase) { + const item = ( + v + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result[\\"digestMultibase\\"] + = compactItems.length > 1 + ? compactItems + : compactItems[0]; + + } + result[\\"type\\"] = \\"Document\\"; if (this.id != null) result[\\"id\\"] = formatIri(this.id); - result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v2\\",{\\"digestMultibase\\":\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"},\\"https://gotosocial.org/ns\\"]; return result; } @@ -52678,6 +52914,21 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } + array = []; + for (const v of this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase) { + const element = ( + { \\"@value\\": v } + ); + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + array + ); + values[\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"] = propValue; + + } + values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Document\\"]; if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { @@ -52687,7 +52938,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } const docContext = options.context ?? - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v2\\",{\\"digestMultibase\\":\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"},\\"https://gotosocial.org/ns\\"]; const compacted = await jsonld.compact( values, docContext, @@ -52887,6 +53138,24 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu _2cGKFeFJMmiNpGZFEF75mCwFQsKb_height.push(decoded); } instance.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height = _2cGKFeFJMmiNpGZFEF75mCwFQsKb_height; + const _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase: (string)[] = []; + + let _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array = values[\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"]; + + for ( + const v of _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array == null + ? [] + : _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array.length === 1 && \\"@list\\" in _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array[0] + ? _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array[0][\\"@list\\"] + : _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array + ) { + if (v == null) continue; + + const decoded = v[\\"@value\\"]; + if (typeof decoded === \\"undefined\\") continue; + _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.push(decoded); + } + instance.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { @@ -52955,6 +53224,26 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu proxy.height = _2cGKFeFJMmiNpGZFEF75mCwFQsKb_height[0]; } + const _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for(\\"Deno.customInspect\\")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => \\"URL \\" + inspect(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.length == 1) { + proxy.digestMultibase = _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase[0]; + } + return proxy; } } @@ -53018,7 +53307,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} , options: { documentLoader?: DocumentLoader, @@ -53054,7 +53343,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} = {}, options: { @@ -53116,7 +53405,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu result[\\"type\\"] = \\"Audio\\"; if (this.id != null) result[\\"id\\"] = formatIri(this.id); - result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v2\\",{\\"digestMultibase\\":\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"},\\"https://gotosocial.org/ns\\"]; return result; } @@ -53142,7 +53431,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } const docContext = options.context ?? - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v2\\",{\\"digestMultibase\\":\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"},\\"https://gotosocial.org/ns\\"]; const compacted = await jsonld.compact( values, docContext, @@ -58710,7 +58999,8 @@ export class Group extends Object { #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); - #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; + #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; +#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); @@ -58783,7 +59073,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} , @@ -58910,6 +59201,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | } } + if (\\"gateway\\" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + \\"The gateway must be of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + + if (\\"gateways\\" in values && values.gateways != null) { + + if (\\"gateway\\" in values && + values.gateway != null) { + throw new TypeError( + \\"Cannot initialize both gateway and \\" + + \\"gateways at the same time.\\", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + \\"The gateways must be an array of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -59260,7 +59587,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} @@ -59396,6 +59724,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + if (\\"gateway\\" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + \\"The gateway must be of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + + if (\\"gateways\\" in values && values.gateways != null) { + + if (\\"gateway\\" in values && + values.gateway != null) { + throw new TypeError( + \\"Cannot update both gateway and \\" + + \\"gateways at the same time.\\", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + \\"The gateways must be an array of type \\" + + \\"URL\\" + \\".\\", + ); + } + } clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { @@ -60418,6 +60782,33 @@ get preferredUsernames(): ((string | LanguageString))[] { } } +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ + get gateway(): (URL | null) { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if (this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < 1) return null; + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ +get gateways(): (URL)[] { + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + } + /** When \`true\`, conveys that for this actor, follow requests are not usually * automatically approved, but instead are examined by a person who may accept * or reject the request, at some time in the future. Setting of \`false\` @@ -63726,6 +64117,19 @@ get preferredUsernames(): ((string | LanguageString))[] { } + compactItems = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const item = ( + formatIri(v) + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result[\\"gateways\\"] = compactItems; + + } + compactItems = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const item = ( @@ -64140,7 +64544,7 @@ get preferredUsernames(): ((string | LanguageString))[] { result[\\"type\\"] = \\"Group\\"; if (this.id != null) result[\\"id\\"] = formatIri(this.id); - result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; + result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/fep/ef61\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; return result; } @@ -64205,6 +64609,21 @@ get preferredUsernames(): ((string | LanguageString))[] { } + array = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const element = ( + { \\"@id\\": formatIri(v) } + ); + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + { \\"@list\\": array } + ); + values[\\"https://w3id.org/fep/ef61/gateways\\"] = propValue; + + } + array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const element = ( @@ -64514,7 +64933,7 @@ get preferredUsernames(): ((string | LanguageString))[] { ); } const docContext = options.context ?? - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/fep/ef61\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; const compacted = await jsonld.compact( values, docContext, @@ -64756,6 +65175,24 @@ get preferredUsernames(): ((string | LanguageString))[] { _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); } instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const _hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; + + let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values[\\"https://w3id.org/fep/ef61/gateways\\"]; + + for ( + const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null + ? [] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && \\"@list\\" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] + ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0][\\"@list\\"] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array + ) { + if (v == null) continue; + + const decoded = parseGatewayUrl(typeof v[\\"@id\\"] === \\"string\\" ? v[\\"@id\\"] : v[\\"@value\\"]); + if (typeof decoded === \\"undefined\\") continue; + _hQiaHhZP8hqxckxTBrpsGNs57E3.push(decoded); + } + instance.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = _hQiaHhZP8hqxckxTBrpsGNs57E3; const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; let _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers__array = values[\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\"]; @@ -65427,6 +65864,32 @@ get preferredUsernames(): ((string | LanguageString))[] { proxy.assertionMethods = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; } + const _hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for(\\"Deno.customInspect\\")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => \\"URL \\" + inspect(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length == 1) { + proxy.gateway = _hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length > 1 + || !(\\"gateway\\" in proxy) + && _hQiaHhZP8hqxckxTBrpsGNs57E3.length > 0) { + proxy.gateways = _hQiaHhZP8hqxckxTBrpsGNs57E3; + } + const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL @@ -65933,6 +66396,7 @@ export class Link { #_pVjLsybKQdmkjuU7MHjiVmNnuj7_href: (URL)[] = []; #_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel: (string)[] = []; #_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType: (string)[] = []; +#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase: (string)[] = []; #_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name: ((string | LanguageString))[] = []; #_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang: (Intl.Locale)[] = []; #_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height: (number)[] = []; @@ -65951,7 +66415,7 @@ export class Link { { id?: URL | null; href?: URL | null;rel?: string | null; -rels?: (string)[];mediaType?: string | null;name?: string | LanguageString | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];} , options: { @@ -66041,6 +66505,19 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num } } + if (\\"digestMultibase\\" in values && values.digestMultibase != null) { + if (typeof values.digestMultibase === \\"string\\") { + // @ts-ignore: type is checked above. + this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = [values.digestMultibase]; + + } else { + throw new TypeError( + \\"The digestMultibase must be of type \\" + + \\"string\\" + \\".\\", + ); + } + } + if (\\"name\\" in values && values.name != null) { if (typeof values.name === \\"string\\" || values.name instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -66147,7 +66624,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num { id?: URL | null; href?: URL | null;rel?: string | null; -rels?: (string)[];mediaType?: string | null;name?: string | LanguageString | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];} = {}, @@ -66232,6 +66709,19 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } + clone.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; + if (\\"digestMultibase\\" in values && values.digestMultibase != null) { + if (typeof values.digestMultibase === \\"string\\") { + // @ts-ignore: type is checked above. + clone.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = [values.digestMultibase]; + + } else { + throw new TypeError( + \\"The digestMultibase must be of type \\" + + \\"string\\" + \\".\\", + ); + } + } clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name; if (\\"name\\" in values && values.name != null) { if (typeof values.name === \\"string\\" || values.name instanceof LanguageString) { @@ -66390,6 +66880,22 @@ get rels(): (string)[] { return this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType[0]; } +/** The multibase-encoded integrity digest of the linked resource. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ + get digestMultibase(): (string | null) { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if (this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.length < 1) return null; + return this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase[0]; + } + /** A simple, human-readable, plain-text name for the object. HTML markup MUST * NOT be included. The name MAY be expressed using multiple language-tagged * values. @@ -66779,6 +67285,22 @@ get names(): ((string | LanguageString))[] { } + compactItems = []; + for (const v of this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase) { + const item = ( + v + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result[\\"digestMultibase\\"] + = compactItems.length > 1 + ? compactItems + : compactItems[0]; + + } + compactItems = []; for (const v of this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name) { const item = ( @@ -66872,7 +67394,7 @@ get names(): ((string | LanguageString))[] { result[\\"type\\"] = \\"Link\\"; if (this.id != null) result[\\"id\\"] = formatIri(this.id); - result[\\"@context\\"] = \\"https://www.w3.org/ns/activitystreams\\"; + result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/fep/ef61\\"]; return result; } @@ -66924,6 +67446,21 @@ get names(): ((string | LanguageString))[] { } + array = []; + for (const v of this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase) { + const element = ( + { \\"@value\\": v } + ); + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + array + ); + values[\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"] = propValue; + + } + array = []; for (const v of this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name) { const element = ( @@ -67017,7 +67554,7 @@ get names(): ((string | LanguageString))[] { ); } const docContext = options.context ?? - \\"https://www.w3.org/ns/activitystreams\\"; + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/fep/ef61\\"]; const compacted = await jsonld.compact( values, docContext, @@ -67218,6 +67755,24 @@ get names(): ((string | LanguageString))[] { _3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.push(decoded); } instance.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = _3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType; + const _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase: (string)[] = []; + + let _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array = values[\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"]; + + for ( + const v of _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array == null + ? [] + : _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array.length === 1 && \\"@list\\" in _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array[0] + ? _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array[0][\\"@list\\"] + : _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array + ) { + if (v == null) continue; + + const decoded = v[\\"@value\\"]; + if (typeof decoded === \\"undefined\\") continue; + _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.push(decoded); + } + instance.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; const _4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name: ((string | LanguageString))[] = []; let _4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name__array = values[\\"https://www.w3.org/ns/activitystreams#name\\"]; @@ -67445,6 +68000,26 @@ get names(): ((string | LanguageString))[] { proxy.mediaType = _3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType[0]; } + const _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for(\\"Deno.customInspect\\")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => \\"URL \\" + inspect(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.length == 1) { + proxy.digestMultibase = _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase[0]; + } + const _4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL @@ -67604,7 +68179,7 @@ export class Hashtag extends Link { { id?: URL | null; href?: URL | null;rel?: string | null; -rels?: (string)[];mediaType?: string | null;name?: string | LanguageString | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];} , options: { @@ -67626,7 +68201,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num { id?: URL | null; href?: URL | null;rel?: string | null; -rels?: (string)[];mediaType?: string | null;name?: string | LanguageString | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];} = {}, @@ -67943,7 +68518,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} , options: { documentLoader?: DocumentLoader, @@ -67979,7 +68554,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} = {}, options: { @@ -68041,7 +68616,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu result[\\"type\\"] = \\"Image\\"; if (this.id != null) result[\\"id\\"] = formatIri(this.id); - result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v2\\",{\\"digestMultibase\\":\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"},\\"https://gotosocial.org/ns\\"]; return result; } @@ -68067,7 +68642,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } const docContext = options.context ?? - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v2\\",{\\"digestMultibase\\":\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"},\\"https://gotosocial.org/ns\\"]; const compacted = await jsonld.compact( values, docContext, @@ -70454,7 +71029,7 @@ export class Mention extends Link { { id?: URL | null; href?: URL | null;rel?: string | null; -rels?: (string)[];mediaType?: string | null;name?: string | LanguageString | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];} , options: { @@ -70476,7 +71051,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num { id?: URL | null; href?: URL | null;rel?: string | null; -rels?: (string)[];mediaType?: string | null;name?: string | LanguageString | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];} = {}, @@ -73185,7 +73760,8 @@ export class Organization extends Object { #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); - #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; + #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; +#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); @@ -73258,7 +73834,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} , @@ -73385,6 +73962,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | } } + if (\\"gateway\\" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + \\"The gateway must be of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + + if (\\"gateways\\" in values && values.gateways != null) { + + if (\\"gateway\\" in values && + values.gateway != null) { + throw new TypeError( + \\"Cannot initialize both gateway and \\" + + \\"gateways at the same time.\\", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + \\"The gateways must be an array of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -73735,7 +74348,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} @@ -73871,6 +74485,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + if (\\"gateway\\" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + \\"The gateway must be of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + + if (\\"gateways\\" in values && values.gateways != null) { + + if (\\"gateway\\" in values && + values.gateway != null) { + throw new TypeError( + \\"Cannot update both gateway and \\" + + \\"gateways at the same time.\\", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + \\"The gateways must be an array of type \\" + + \\"URL\\" + \\".\\", + ); + } + } clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { @@ -74893,6 +75543,33 @@ get preferredUsernames(): ((string | LanguageString))[] { } } +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ + get gateway(): (URL | null) { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if (this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < 1) return null; + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ +get gateways(): (URL)[] { + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + } + /** When \`true\`, conveys that for this actor, follow requests are not usually * automatically approved, but instead are examined by a person who may accept * or reject the request, at some time in the future. Setting of \`false\` @@ -78201,6 +78878,19 @@ get preferredUsernames(): ((string | LanguageString))[] { } + compactItems = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const item = ( + formatIri(v) + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result[\\"gateways\\"] = compactItems; + + } + compactItems = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const item = ( @@ -78615,7 +79305,7 @@ get preferredUsernames(): ((string | LanguageString))[] { result[\\"type\\"] = \\"Organization\\"; if (this.id != null) result[\\"id\\"] = formatIri(this.id); - result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; + result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/fep/ef61\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; return result; } @@ -78680,6 +79370,21 @@ get preferredUsernames(): ((string | LanguageString))[] { } + array = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const element = ( + { \\"@id\\": formatIri(v) } + ); + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + { \\"@list\\": array } + ); + values[\\"https://w3id.org/fep/ef61/gateways\\"] = propValue; + + } + array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const element = ( @@ -78989,7 +79694,7 @@ get preferredUsernames(): ((string | LanguageString))[] { ); } const docContext = options.context ?? - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/fep/ef61\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; const compacted = await jsonld.compact( values, docContext, @@ -79231,6 +79936,24 @@ get preferredUsernames(): ((string | LanguageString))[] { _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); } instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const _hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; + + let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values[\\"https://w3id.org/fep/ef61/gateways\\"]; + + for ( + const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null + ? [] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && \\"@list\\" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] + ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0][\\"@list\\"] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array + ) { + if (v == null) continue; + + const decoded = parseGatewayUrl(typeof v[\\"@id\\"] === \\"string\\" ? v[\\"@id\\"] : v[\\"@value\\"]); + if (typeof decoded === \\"undefined\\") continue; + _hQiaHhZP8hqxckxTBrpsGNs57E3.push(decoded); + } + instance.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = _hQiaHhZP8hqxckxTBrpsGNs57E3; const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; let _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers__array = values[\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\"]; @@ -79902,6 +80625,32 @@ get preferredUsernames(): ((string | LanguageString))[] { proxy.assertionMethods = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; } + const _hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for(\\"Deno.customInspect\\")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => \\"URL \\" + inspect(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length == 1) { + proxy.gateway = _hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length > 1 + || !(\\"gateway\\" in proxy) + && _hQiaHhZP8hqxckxTBrpsGNs57E3.length > 0) { + proxy.gateways = _hQiaHhZP8hqxckxTBrpsGNs57E3; + } + const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL @@ -80379,7 +81128,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} , options: { documentLoader?: DocumentLoader, @@ -80415,7 +81164,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} = {}, options: { @@ -80477,7 +81226,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu result[\\"type\\"] = \\"Page\\"; if (this.id != null) result[\\"id\\"] = formatIri(this.id); - result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v2\\",{\\"digestMultibase\\":\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"},\\"https://gotosocial.org/ns\\"]; return result; } @@ -80503,7 +81252,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } const docContext = options.context ?? - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v2\\",{\\"digestMultibase\\":\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"},\\"https://gotosocial.org/ns\\"]; const compacted = await jsonld.compact( values, docContext, @@ -80723,7 +81472,8 @@ export class Person extends Object { #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); - #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; + #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; +#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); @@ -80796,7 +81546,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} , @@ -80923,6 +81674,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | } } + if (\\"gateway\\" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + \\"The gateway must be of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + + if (\\"gateways\\" in values && values.gateways != null) { + + if (\\"gateway\\" in values && + values.gateway != null) { + throw new TypeError( + \\"Cannot initialize both gateway and \\" + + \\"gateways at the same time.\\", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + \\"The gateways must be an array of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -81273,7 +82060,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} @@ -81409,6 +82197,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + if (\\"gateway\\" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + \\"The gateway must be of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + + if (\\"gateways\\" in values && values.gateways != null) { + + if (\\"gateway\\" in values && + values.gateway != null) { + throw new TypeError( + \\"Cannot update both gateway and \\" + + \\"gateways at the same time.\\", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + \\"The gateways must be an array of type \\" + + \\"URL\\" + \\".\\", + ); + } + } clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { @@ -82431,6 +83255,33 @@ get preferredUsernames(): ((string | LanguageString))[] { } } +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ + get gateway(): (URL | null) { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if (this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < 1) return null; + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ +get gateways(): (URL)[] { + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + } + /** When \`true\`, conveys that for this actor, follow requests are not usually * automatically approved, but instead are examined by a person who may accept * or reject the request, at some time in the future. Setting of \`false\` @@ -85739,6 +86590,19 @@ get preferredUsernames(): ((string | LanguageString))[] { } + compactItems = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const item = ( + formatIri(v) + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result[\\"gateways\\"] = compactItems; + + } + compactItems = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const item = ( @@ -86153,7 +87017,7 @@ get preferredUsernames(): ((string | LanguageString))[] { result[\\"type\\"] = \\"Person\\"; if (this.id != null) result[\\"id\\"] = formatIri(this.id); - result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; + result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/fep/ef61\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; return result; } @@ -86218,6 +87082,21 @@ get preferredUsernames(): ((string | LanguageString))[] { } + array = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const element = ( + { \\"@id\\": formatIri(v) } + ); + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + { \\"@list\\": array } + ); + values[\\"https://w3id.org/fep/ef61/gateways\\"] = propValue; + + } + array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const element = ( @@ -86527,7 +87406,7 @@ get preferredUsernames(): ((string | LanguageString))[] { ); } const docContext = options.context ?? - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/fep/ef61\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; const compacted = await jsonld.compact( values, docContext, @@ -86769,6 +87648,24 @@ get preferredUsernames(): ((string | LanguageString))[] { _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); } instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const _hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; + + let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values[\\"https://w3id.org/fep/ef61/gateways\\"]; + + for ( + const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null + ? [] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && \\"@list\\" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] + ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0][\\"@list\\"] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array + ) { + if (v == null) continue; + + const decoded = parseGatewayUrl(typeof v[\\"@id\\"] === \\"string\\" ? v[\\"@id\\"] : v[\\"@value\\"]); + if (typeof decoded === \\"undefined\\") continue; + _hQiaHhZP8hqxckxTBrpsGNs57E3.push(decoded); + } + instance.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = _hQiaHhZP8hqxckxTBrpsGNs57E3; const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; let _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers__array = values[\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\"]; @@ -87440,6 +88337,32 @@ get preferredUsernames(): ((string | LanguageString))[] { proxy.assertionMethods = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; } + const _hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for(\\"Deno.customInspect\\")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => \\"URL \\" + inspect(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length == 1) { + proxy.gateway = _hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length > 1 + || !(\\"gateway\\" in proxy) + && _hQiaHhZP8hqxckxTBrpsGNs57E3.length > 0) { + proxy.gateways = _hQiaHhZP8hqxckxTBrpsGNs57E3; + } + const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL @@ -94499,7 +95422,8 @@ export class Service extends Object { #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); - #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; + #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; +#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); @@ -94572,7 +95496,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} , @@ -94699,6 +95624,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | } } + if (\\"gateway\\" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + \\"The gateway must be of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + + if (\\"gateways\\" in values && values.gateways != null) { + + if (\\"gateway\\" in values && + values.gateway != null) { + throw new TypeError( + \\"Cannot initialize both gateway and \\" + + \\"gateways at the same time.\\", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + \\"The gateways must be an array of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -95049,7 +96010,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} @@ -95185,6 +96147,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + if (\\"gateway\\" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + \\"The gateway must be of type \\" + + \\"URL\\" + \\".\\", + ); + } + } + + if (\\"gateways\\" in values && values.gateways != null) { + + if (\\"gateway\\" in values && + values.gateway != null) { + throw new TypeError( + \\"Cannot update both gateway and \\" + + \\"gateways at the same time.\\", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + \\"The gateways must be an array of type \\" + + \\"URL\\" + \\".\\", + ); + } + } clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { @@ -96207,6 +97205,33 @@ get preferredUsernames(): ((string | LanguageString))[] { } } +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ + get gateway(): (URL | null) { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if (this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < 1) return null; + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ +get gateways(): (URL)[] { + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + } + /** When \`true\`, conveys that for this actor, follow requests are not usually * automatically approved, but instead are examined by a person who may accept * or reject the request, at some time in the future. Setting of \`false\` @@ -99515,6 +100540,19 @@ get preferredUsernames(): ((string | LanguageString))[] { } + compactItems = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const item = ( + formatIri(v) + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result[\\"gateways\\"] = compactItems; + + } + compactItems = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const item = ( @@ -99929,7 +100967,7 @@ get preferredUsernames(): ((string | LanguageString))[] { result[\\"type\\"] = \\"Service\\"; if (this.id != null) result[\\"id\\"] = formatIri(this.id); - result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; + result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/fep/ef61\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; return result; } @@ -99994,6 +101032,21 @@ get preferredUsernames(): ((string | LanguageString))[] { } + array = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const element = ( + { \\"@id\\": formatIri(v) } + ); + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + { \\"@list\\": array } + ); + values[\\"https://w3id.org/fep/ef61/gateways\\"] = propValue; + + } + array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const element = ( @@ -100303,7 +101356,7 @@ get preferredUsernames(): ((string | LanguageString))[] { ); } const docContext = options.context ?? - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/fep/ef61\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",\\"https://w3id.org/fep/7aa9\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"featuredCollections\\":{\\"@id\\":\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; const compacted = await jsonld.compact( values, docContext, @@ -100545,6 +101598,24 @@ get preferredUsernames(): ((string | LanguageString))[] { _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); } instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const _hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; + + let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values[\\"https://w3id.org/fep/ef61/gateways\\"]; + + for ( + const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null + ? [] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && \\"@list\\" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] + ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0][\\"@list\\"] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array + ) { + if (v == null) continue; + + const decoded = parseGatewayUrl(typeof v[\\"@id\\"] === \\"string\\" ? v[\\"@id\\"] : v[\\"@value\\"]); + if (typeof decoded === \\"undefined\\") continue; + _hQiaHhZP8hqxckxTBrpsGNs57E3.push(decoded); + } + instance.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = _hQiaHhZP8hqxckxTBrpsGNs57E3; const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; let _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers__array = values[\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\"]; @@ -101216,6 +102287,32 @@ get preferredUsernames(): ((string | LanguageString))[] { proxy.assertionMethods = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; } + const _hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for(\\"Deno.customInspect\\")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => \\"URL \\" + inspect(v.href, options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(v.href, options), + } + : v); + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length == 1) { + proxy.gateway = _hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length > 1 + || !(\\"gateway\\" in proxy) + && _hQiaHhZP8hqxckxTBrpsGNs57E3.length > 0) { + proxy.gateways = _hQiaHhZP8hqxckxTBrpsGNs57E3; + } + const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL @@ -104857,7 +105954,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} , options: { documentLoader?: DocumentLoader, @@ -104893,7 +105990,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} = {}, options: { @@ -104955,7 +106052,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu result[\\"type\\"] = \\"Video\\"; if (this.id != null) result[\\"id\\"] = formatIri(this.id); - result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v2\\",{\\"digestMultibase\\":\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"},\\"https://gotosocial.org/ns\\"]; return result; } @@ -104981,7 +106078,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } const docContext = options.context ?? - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v2\\",{\\"digestMultibase\\":\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"},\\"https://gotosocial.org/ns\\"]; const compacted = await jsonld.compact( values, docContext, diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index a2ce1eaba..f38a3252b 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -19,8 +19,10 @@ import { importMultibaseKey, importPem, isDecimal, + isGatewayUrl, LanguageString, parseDecimal, + parseGatewayUrl, parseIri, parseJsonLdId, type RemoteDocument @@ -43296,7 +43298,8 @@ export class Application extends Object { #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); - #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; + #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; +#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); @@ -43369,7 +43372,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} , @@ -43496,6 +43500,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | } } + if ("gateway" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + "The gateway must be of type " + + "URL" + ".", + ); + } + } + + if ("gateways" in values && values.gateways != null) { + + if ("gateway" in values && + values.gateway != null) { + throw new TypeError( + "Cannot initialize both gateway and " + + "gateways at the same time.", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + "The gateways must be an array of type " + + "URL" + ".", + ); + } + } + if ("manuallyApprovesFollowers" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === "boolean") { // @ts-ignore: type is checked above. @@ -43846,7 +43886,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} @@ -43982,6 +44023,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + if ("gateway" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + "The gateway must be of type " + + "URL" + ".", + ); + } + } + + if ("gateways" in values && values.gateways != null) { + + if ("gateway" in values && + values.gateway != null) { + throw new TypeError( + "Cannot update both gateway and " + + "gateways at the same time.", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + "The gateways must be an array of type " + + "URL" + ".", + ); + } + } clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; if ("manuallyApprovesFollowers" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === "boolean") { @@ -45004,6 +45081,33 @@ get preferredUsernames(): ((string | LanguageString))[] { } } +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ + get gateway(): (URL | null) { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if (this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < 1) return null; + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ +get gateways(): (URL)[] { + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + } + /** When \`true\`, conveys that for this actor, follow requests are not usually * automatically approved, but instead are examined by a person who may accept * or reject the request, at some time in the future. Setting of \`false\` @@ -48312,6 +48416,19 @@ get preferredUsernames(): ((string | LanguageString))[] { } + compactItems = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const item = ( + formatIri(v) + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result["gateways"] = compactItems; + + } + compactItems = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const item = ( @@ -48726,7 +48843,7 @@ get preferredUsernames(): ((string | LanguageString))[] { result["type"] = "Application"; if (this.id != null) result["id"] = formatIri(this.id); - result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns","https://w3id.org/fep/7aa9",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"featuredCollections":{"@id":"https://w3id.org/fep/7aa9#featuredCollections","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","movedTo":{"@id":"as:movedTo","@type":"@id"},"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey-hub.net/ns#","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat"}]; + result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/fep/ef61","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns","https://w3id.org/fep/7aa9",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"featuredCollections":{"@id":"https://w3id.org/fep/7aa9#featuredCollections","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","movedTo":{"@id":"as:movedTo","@type":"@id"},"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey-hub.net/ns#","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat"}]; return result; } @@ -48791,6 +48908,21 @@ get preferredUsernames(): ((string | LanguageString))[] { } + array = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const element = ( + { "@id": formatIri(v) } + ); + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + { "@list": array } + ); + values["https://w3id.org/fep/ef61/gateways"] = propValue; + + } + array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const element = ( @@ -49100,7 +49232,7 @@ get preferredUsernames(): ((string | LanguageString))[] { ); } const docContext = options.context ?? - ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns","https://w3id.org/fep/7aa9",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"featuredCollections":{"@id":"https://w3id.org/fep/7aa9#featuredCollections","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","movedTo":{"@id":"as:movedTo","@type":"@id"},"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey-hub.net/ns#","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat"}]; + ["https://www.w3.org/ns/activitystreams","https://w3id.org/fep/ef61","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns","https://w3id.org/fep/7aa9",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"featuredCollections":{"@id":"https://w3id.org/fep/7aa9#featuredCollections","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","movedTo":{"@id":"as:movedTo","@type":"@id"},"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey-hub.net/ns#","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat"}]; const compacted = await jsonld.compact( values, docContext, @@ -49342,6 +49474,24 @@ get preferredUsernames(): ((string | LanguageString))[] { _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); } instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const _hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; + + let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values["https://w3id.org/fep/ef61/gateways"]; + + for ( + const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null + ? [] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && "@list" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] + ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0]["@list"] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array + ) { + if (v == null) continue; + + const decoded = parseGatewayUrl(typeof v["@id"] === "string" ? v["@id"] : v["@value"]); + if (typeof decoded === "undefined") continue; + _hQiaHhZP8hqxckxTBrpsGNs57E3.push(decoded); + } + instance.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = _hQiaHhZP8hqxckxTBrpsGNs57E3; const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; let _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers__array = values["https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers"]; @@ -50013,6 +50163,32 @@ get preferredUsernames(): ((string | LanguageString))[] { proxy.assertionMethods = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; } + const _hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for("Deno.customInspect")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => "URL " + inspect(v.href, options), + [Symbol.for("nodejs.util.inspect.custom")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => "URL " + inspect(v.href, options), + } + : v); + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length == 1) { + proxy.gateway = _hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length > 1 + || !("gateway" in proxy) + && _hQiaHhZP8hqxckxTBrpsGNs57E3.length > 0) { + proxy.gateways = _hQiaHhZP8hqxckxTBrpsGNs57E3; + } + const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL @@ -52389,6 +52565,7 @@ export class Document extends Object { } #_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width: (number)[] = []; #_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height: (number)[] = []; +#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase: (string)[] = []; /** * Constructs a new instance of Document with the given values. @@ -52415,7 +52592,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} , options: { documentLoader?: DocumentLoader, @@ -52449,6 +52626,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } + + if ("digestMultibase" in values && values.digestMultibase != null) { + if (typeof values.digestMultibase === "string") { + // @ts-ignore: type is checked above. + this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = [values.digestMultibase]; + + } else { + throw new TypeError( + "The digestMultibase must be of type " + + "string" + ".", + ); + } + } } /** @@ -52477,7 +52667,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} = {}, options: { @@ -52519,6 +52709,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } + clone.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; + if ("digestMultibase" in values && values.digestMultibase != null) { + if (typeof values.digestMultibase === "string") { + // @ts-ignore: type is checked above. + clone.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = [values.digestMultibase]; + + } else { + throw new TypeError( + "The digestMultibase must be of type " + + "string" + ".", + ); + } + } return clone; } @@ -52553,6 +52756,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height[0]; } +/** The multibase-encoded integrity digest of an external resource represented + * by this document. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ + get digestMultibase(): (string | null) { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if (this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.length < 1) return null; + return this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase[0]; + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -52625,9 +52845,25 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } + compactItems = []; + for (const v of this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase) { + const item = ( + v + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result["digestMultibase"] + = compactItems.length > 1 + ? compactItems + : compactItems[0]; + + } + result["type"] = "Document"; if (this.id != null) result["id"] = formatIri(this.id); - result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; + result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v2",{"digestMultibase":"https://www.w3.org/ns/credentials/v2#digestMultibase"},"https://gotosocial.org/ns"]; return result; } @@ -52680,6 +52916,21 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } + array = []; + for (const v of this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase) { + const element = ( + { "@value": v } + ); + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + array + ); + values["https://www.w3.org/ns/credentials/v2#digestMultibase"] = propValue; + + } + values["@type"] = ["https://www.w3.org/ns/activitystreams#Document"]; if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { @@ -52689,7 +52940,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } const docContext = options.context ?? - ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; + ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v2",{"digestMultibase":"https://www.w3.org/ns/credentials/v2#digestMultibase"},"https://gotosocial.org/ns"]; const compacted = await jsonld.compact( values, docContext, @@ -52889,6 +53140,24 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu _2cGKFeFJMmiNpGZFEF75mCwFQsKb_height.push(decoded); } instance.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height = _2cGKFeFJMmiNpGZFEF75mCwFQsKb_height; + const _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase: (string)[] = []; + + let _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array = values["https://www.w3.org/ns/credentials/v2#digestMultibase"]; + + for ( + const v of _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array == null + ? [] + : _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array.length === 1 && "@list" in _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array[0] + ? _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array[0]["@list"] + : _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array + ) { + if (v == null) continue; + + const decoded = v["@value"]; + if (typeof decoded === "undefined") continue; + _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.push(decoded); + } + instance.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; if (!("_fromSubclass" in options) || !options._fromSubclass) { try { @@ -52957,6 +53226,26 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu proxy.height = _2cGKFeFJMmiNpGZFEF75mCwFQsKb_height[0]; } + const _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for("Deno.customInspect")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => "URL " + inspect(v.href, options), + [Symbol.for("nodejs.util.inspect.custom")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => "URL " + inspect(v.href, options), + } + : v); + + if (_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.length == 1) { + proxy.digestMultibase = _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase[0]; + } + return proxy; } } @@ -53020,7 +53309,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} , options: { documentLoader?: DocumentLoader, @@ -53056,7 +53345,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} = {}, options: { @@ -53118,7 +53407,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu result["type"] = "Audio"; if (this.id != null) result["id"] = formatIri(this.id); - result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; + result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v2",{"digestMultibase":"https://www.w3.org/ns/credentials/v2#digestMultibase"},"https://gotosocial.org/ns"]; return result; } @@ -53144,7 +53433,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } const docContext = options.context ?? - ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; + ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v2",{"digestMultibase":"https://www.w3.org/ns/credentials/v2#digestMultibase"},"https://gotosocial.org/ns"]; const compacted = await jsonld.compact( values, docContext, @@ -58712,7 +59001,8 @@ export class Group extends Object { #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); - #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; + #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; +#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); @@ -58785,7 +59075,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} , @@ -58912,6 +59203,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | } } + if ("gateway" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + "The gateway must be of type " + + "URL" + ".", + ); + } + } + + if ("gateways" in values && values.gateways != null) { + + if ("gateway" in values && + values.gateway != null) { + throw new TypeError( + "Cannot initialize both gateway and " + + "gateways at the same time.", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + "The gateways must be an array of type " + + "URL" + ".", + ); + } + } + if ("manuallyApprovesFollowers" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === "boolean") { // @ts-ignore: type is checked above. @@ -59262,7 +59589,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} @@ -59398,6 +59726,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + if ("gateway" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + "The gateway must be of type " + + "URL" + ".", + ); + } + } + + if ("gateways" in values && values.gateways != null) { + + if ("gateway" in values && + values.gateway != null) { + throw new TypeError( + "Cannot update both gateway and " + + "gateways at the same time.", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + "The gateways must be an array of type " + + "URL" + ".", + ); + } + } clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; if ("manuallyApprovesFollowers" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === "boolean") { @@ -60420,6 +60784,33 @@ get preferredUsernames(): ((string | LanguageString))[] { } } +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ + get gateway(): (URL | null) { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if (this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < 1) return null; + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ +get gateways(): (URL)[] { + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + } + /** When \`true\`, conveys that for this actor, follow requests are not usually * automatically approved, but instead are examined by a person who may accept * or reject the request, at some time in the future. Setting of \`false\` @@ -63728,6 +64119,19 @@ get preferredUsernames(): ((string | LanguageString))[] { } + compactItems = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const item = ( + formatIri(v) + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result["gateways"] = compactItems; + + } + compactItems = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const item = ( @@ -64142,7 +64546,7 @@ get preferredUsernames(): ((string | LanguageString))[] { result["type"] = "Group"; if (this.id != null) result["id"] = formatIri(this.id); - result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns","https://w3id.org/fep/7aa9",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"featuredCollections":{"@id":"https://w3id.org/fep/7aa9#featuredCollections","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","movedTo":{"@id":"as:movedTo","@type":"@id"},"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey-hub.net/ns#","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat"}]; + result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/fep/ef61","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns","https://w3id.org/fep/7aa9",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"featuredCollections":{"@id":"https://w3id.org/fep/7aa9#featuredCollections","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","movedTo":{"@id":"as:movedTo","@type":"@id"},"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey-hub.net/ns#","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat"}]; return result; } @@ -64207,6 +64611,21 @@ get preferredUsernames(): ((string | LanguageString))[] { } + array = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const element = ( + { "@id": formatIri(v) } + ); + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + { "@list": array } + ); + values["https://w3id.org/fep/ef61/gateways"] = propValue; + + } + array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const element = ( @@ -64516,7 +64935,7 @@ get preferredUsernames(): ((string | LanguageString))[] { ); } const docContext = options.context ?? - ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns","https://w3id.org/fep/7aa9",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"featuredCollections":{"@id":"https://w3id.org/fep/7aa9#featuredCollections","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","movedTo":{"@id":"as:movedTo","@type":"@id"},"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey-hub.net/ns#","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat"}]; + ["https://www.w3.org/ns/activitystreams","https://w3id.org/fep/ef61","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns","https://w3id.org/fep/7aa9",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"featuredCollections":{"@id":"https://w3id.org/fep/7aa9#featuredCollections","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","movedTo":{"@id":"as:movedTo","@type":"@id"},"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey-hub.net/ns#","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat"}]; const compacted = await jsonld.compact( values, docContext, @@ -64758,6 +65177,24 @@ get preferredUsernames(): ((string | LanguageString))[] { _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); } instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const _hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; + + let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values["https://w3id.org/fep/ef61/gateways"]; + + for ( + const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null + ? [] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && "@list" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] + ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0]["@list"] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array + ) { + if (v == null) continue; + + const decoded = parseGatewayUrl(typeof v["@id"] === "string" ? v["@id"] : v["@value"]); + if (typeof decoded === "undefined") continue; + _hQiaHhZP8hqxckxTBrpsGNs57E3.push(decoded); + } + instance.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = _hQiaHhZP8hqxckxTBrpsGNs57E3; const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; let _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers__array = values["https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers"]; @@ -65429,6 +65866,32 @@ get preferredUsernames(): ((string | LanguageString))[] { proxy.assertionMethods = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; } + const _hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for("Deno.customInspect")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => "URL " + inspect(v.href, options), + [Symbol.for("nodejs.util.inspect.custom")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => "URL " + inspect(v.href, options), + } + : v); + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length == 1) { + proxy.gateway = _hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length > 1 + || !("gateway" in proxy) + && _hQiaHhZP8hqxckxTBrpsGNs57E3.length > 0) { + proxy.gateways = _hQiaHhZP8hqxckxTBrpsGNs57E3; + } + const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL @@ -65935,6 +66398,7 @@ export class Link { #_pVjLsybKQdmkjuU7MHjiVmNnuj7_href: (URL)[] = []; #_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel: (string)[] = []; #_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType: (string)[] = []; +#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase: (string)[] = []; #_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name: ((string | LanguageString))[] = []; #_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang: (Intl.Locale)[] = []; #_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height: (number)[] = []; @@ -65953,7 +66417,7 @@ export class Link { { id?: URL | null; href?: URL | null;rel?: string | null; -rels?: (string)[];mediaType?: string | null;name?: string | LanguageString | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];} , options: { @@ -66043,6 +66507,19 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num } } + if ("digestMultibase" in values && values.digestMultibase != null) { + if (typeof values.digestMultibase === "string") { + // @ts-ignore: type is checked above. + this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = [values.digestMultibase]; + + } else { + throw new TypeError( + "The digestMultibase must be of type " + + "string" + ".", + ); + } + } + if ("name" in values && values.name != null) { if (typeof values.name === "string" || values.name instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -66149,7 +66626,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num { id?: URL | null; href?: URL | null;rel?: string | null; -rels?: (string)[];mediaType?: string | null;name?: string | LanguageString | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];} = {}, @@ -66234,6 +66711,19 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } + clone.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; + if ("digestMultibase" in values && values.digestMultibase != null) { + if (typeof values.digestMultibase === "string") { + // @ts-ignore: type is checked above. + clone.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = [values.digestMultibase]; + + } else { + throw new TypeError( + "The digestMultibase must be of type " + + "string" + ".", + ); + } + } clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name; if ("name" in values && values.name != null) { if (typeof values.name === "string" || values.name instanceof LanguageString) { @@ -66392,6 +66882,22 @@ get rels(): (string)[] { return this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType[0]; } +/** The multibase-encoded integrity digest of the linked resource. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ + get digestMultibase(): (string | null) { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if (this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.length < 1) return null; + return this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase[0]; + } + /** A simple, human-readable, plain-text name for the object. HTML markup MUST * NOT be included. The name MAY be expressed using multiple language-tagged * values. @@ -66781,6 +67287,22 @@ get names(): ((string | LanguageString))[] { } + compactItems = []; + for (const v of this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase) { + const item = ( + v + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result["digestMultibase"] + = compactItems.length > 1 + ? compactItems + : compactItems[0]; + + } + compactItems = []; for (const v of this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name) { const item = ( @@ -66874,7 +67396,7 @@ get names(): ((string | LanguageString))[] { result["type"] = "Link"; if (this.id != null) result["id"] = formatIri(this.id); - result["@context"] = "https://www.w3.org/ns/activitystreams"; + result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/fep/ef61"]; return result; } @@ -66926,6 +67448,21 @@ get names(): ((string | LanguageString))[] { } + array = []; + for (const v of this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase) { + const element = ( + { "@value": v } + ); + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + array + ); + values["https://www.w3.org/ns/credentials/v2#digestMultibase"] = propValue; + + } + array = []; for (const v of this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name) { const element = ( @@ -67019,7 +67556,7 @@ get names(): ((string | LanguageString))[] { ); } const docContext = options.context ?? - "https://www.w3.org/ns/activitystreams"; + ["https://www.w3.org/ns/activitystreams","https://w3id.org/fep/ef61"]; const compacted = await jsonld.compact( values, docContext, @@ -67220,6 +67757,24 @@ get names(): ((string | LanguageString))[] { _3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.push(decoded); } instance.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = _3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType; + const _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase: (string)[] = []; + + let _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array = values["https://www.w3.org/ns/credentials/v2#digestMultibase"]; + + for ( + const v of _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array == null + ? [] + : _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array.length === 1 && "@list" in _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array[0] + ? _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array[0]["@list"] + : _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase__array + ) { + if (v == null) continue; + + const decoded = v["@value"]; + if (typeof decoded === "undefined") continue; + _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.push(decoded); + } + instance.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; const _4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name: ((string | LanguageString))[] = []; let _4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name__array = values["https://www.w3.org/ns/activitystreams#name"]; @@ -67447,6 +68002,26 @@ get names(): ((string | LanguageString))[] { proxy.mediaType = _3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType[0]; } + const _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for("Deno.customInspect")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => "URL " + inspect(v.href, options), + [Symbol.for("nodejs.util.inspect.custom")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => "URL " + inspect(v.href, options), + } + : v); + + if (_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.length == 1) { + proxy.digestMultibase = _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase[0]; + } + const _4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL @@ -67606,7 +68181,7 @@ export class Hashtag extends Link { { id?: URL | null; href?: URL | null;rel?: string | null; -rels?: (string)[];mediaType?: string | null;name?: string | LanguageString | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];} , options: { @@ -67628,7 +68203,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num { id?: URL | null; href?: URL | null;rel?: string | null; -rels?: (string)[];mediaType?: string | null;name?: string | LanguageString | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];} = {}, @@ -67945,7 +68520,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} , options: { documentLoader?: DocumentLoader, @@ -67981,7 +68556,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} = {}, options: { @@ -68043,7 +68618,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu result["type"] = "Image"; if (this.id != null) result["id"] = formatIri(this.id); - result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; + result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v2",{"digestMultibase":"https://www.w3.org/ns/credentials/v2#digestMultibase"},"https://gotosocial.org/ns"]; return result; } @@ -68069,7 +68644,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } const docContext = options.context ?? - ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; + ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v2",{"digestMultibase":"https://www.w3.org/ns/credentials/v2#digestMultibase"},"https://gotosocial.org/ns"]; const compacted = await jsonld.compact( values, docContext, @@ -70456,7 +71031,7 @@ export class Mention extends Link { { id?: URL | null; href?: URL | null;rel?: string | null; -rels?: (string)[];mediaType?: string | null;name?: string | LanguageString | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];} , options: { @@ -70478,7 +71053,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num { id?: URL | null; href?: URL | null;rel?: string | null; -rels?: (string)[];mediaType?: string | null;name?: string | LanguageString | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];} = {}, @@ -73187,7 +73762,8 @@ export class Organization extends Object { #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); - #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; + #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; +#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); @@ -73260,7 +73836,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} , @@ -73387,6 +73964,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | } } + if ("gateway" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + "The gateway must be of type " + + "URL" + ".", + ); + } + } + + if ("gateways" in values && values.gateways != null) { + + if ("gateway" in values && + values.gateway != null) { + throw new TypeError( + "Cannot initialize both gateway and " + + "gateways at the same time.", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + "The gateways must be an array of type " + + "URL" + ".", + ); + } + } + if ("manuallyApprovesFollowers" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === "boolean") { // @ts-ignore: type is checked above. @@ -73737,7 +74350,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} @@ -73873,6 +74487,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + if ("gateway" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + "The gateway must be of type " + + "URL" + ".", + ); + } + } + + if ("gateways" in values && values.gateways != null) { + + if ("gateway" in values && + values.gateway != null) { + throw new TypeError( + "Cannot update both gateway and " + + "gateways at the same time.", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + "The gateways must be an array of type " + + "URL" + ".", + ); + } + } clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; if ("manuallyApprovesFollowers" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === "boolean") { @@ -74895,6 +75545,33 @@ get preferredUsernames(): ((string | LanguageString))[] { } } +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ + get gateway(): (URL | null) { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if (this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < 1) return null; + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ +get gateways(): (URL)[] { + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + } + /** When \`true\`, conveys that for this actor, follow requests are not usually * automatically approved, but instead are examined by a person who may accept * or reject the request, at some time in the future. Setting of \`false\` @@ -78203,6 +78880,19 @@ get preferredUsernames(): ((string | LanguageString))[] { } + compactItems = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const item = ( + formatIri(v) + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result["gateways"] = compactItems; + + } + compactItems = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const item = ( @@ -78617,7 +79307,7 @@ get preferredUsernames(): ((string | LanguageString))[] { result["type"] = "Organization"; if (this.id != null) result["id"] = formatIri(this.id); - result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns","https://w3id.org/fep/7aa9",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"featuredCollections":{"@id":"https://w3id.org/fep/7aa9#featuredCollections","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","movedTo":{"@id":"as:movedTo","@type":"@id"},"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey-hub.net/ns#","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat"}]; + result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/fep/ef61","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns","https://w3id.org/fep/7aa9",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"featuredCollections":{"@id":"https://w3id.org/fep/7aa9#featuredCollections","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","movedTo":{"@id":"as:movedTo","@type":"@id"},"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey-hub.net/ns#","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat"}]; return result; } @@ -78682,6 +79372,21 @@ get preferredUsernames(): ((string | LanguageString))[] { } + array = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const element = ( + { "@id": formatIri(v) } + ); + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + { "@list": array } + ); + values["https://w3id.org/fep/ef61/gateways"] = propValue; + + } + array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const element = ( @@ -78991,7 +79696,7 @@ get preferredUsernames(): ((string | LanguageString))[] { ); } const docContext = options.context ?? - ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns","https://w3id.org/fep/7aa9",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"featuredCollections":{"@id":"https://w3id.org/fep/7aa9#featuredCollections","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","movedTo":{"@id":"as:movedTo","@type":"@id"},"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey-hub.net/ns#","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat"}]; + ["https://www.w3.org/ns/activitystreams","https://w3id.org/fep/ef61","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns","https://w3id.org/fep/7aa9",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"featuredCollections":{"@id":"https://w3id.org/fep/7aa9#featuredCollections","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","movedTo":{"@id":"as:movedTo","@type":"@id"},"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey-hub.net/ns#","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat"}]; const compacted = await jsonld.compact( values, docContext, @@ -79233,6 +79938,24 @@ get preferredUsernames(): ((string | LanguageString))[] { _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); } instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const _hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; + + let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values["https://w3id.org/fep/ef61/gateways"]; + + for ( + const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null + ? [] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && "@list" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] + ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0]["@list"] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array + ) { + if (v == null) continue; + + const decoded = parseGatewayUrl(typeof v["@id"] === "string" ? v["@id"] : v["@value"]); + if (typeof decoded === "undefined") continue; + _hQiaHhZP8hqxckxTBrpsGNs57E3.push(decoded); + } + instance.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = _hQiaHhZP8hqxckxTBrpsGNs57E3; const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; let _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers__array = values["https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers"]; @@ -79904,6 +80627,32 @@ get preferredUsernames(): ((string | LanguageString))[] { proxy.assertionMethods = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; } + const _hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for("Deno.customInspect")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => "URL " + inspect(v.href, options), + [Symbol.for("nodejs.util.inspect.custom")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => "URL " + inspect(v.href, options), + } + : v); + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length == 1) { + proxy.gateway = _hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length > 1 + || !("gateway" in proxy) + && _hQiaHhZP8hqxckxTBrpsGNs57E3.length > 0) { + proxy.gateways = _hQiaHhZP8hqxckxTBrpsGNs57E3; + } + const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL @@ -80381,7 +81130,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} , options: { documentLoader?: DocumentLoader, @@ -80417,7 +81166,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} = {}, options: { @@ -80479,7 +81228,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu result["type"] = "Page"; if (this.id != null) result["id"] = formatIri(this.id); - result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; + result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v2",{"digestMultibase":"https://www.w3.org/ns/credentials/v2#digestMultibase"},"https://gotosocial.org/ns"]; return result; } @@ -80505,7 +81254,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } const docContext = options.context ?? - ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; + ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v2",{"digestMultibase":"https://www.w3.org/ns/credentials/v2#digestMultibase"},"https://gotosocial.org/ns"]; const compacted = await jsonld.compact( values, docContext, @@ -80725,7 +81474,8 @@ export class Person extends Object { #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); - #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; + #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; +#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); @@ -80798,7 +81548,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} , @@ -80925,6 +81676,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | } } + if ("gateway" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + "The gateway must be of type " + + "URL" + ".", + ); + } + } + + if ("gateways" in values && values.gateways != null) { + + if ("gateway" in values && + values.gateway != null) { + throw new TypeError( + "Cannot initialize both gateway and " + + "gateways at the same time.", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + "The gateways must be an array of type " + + "URL" + ".", + ); + } + } + if ("manuallyApprovesFollowers" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === "boolean") { // @ts-ignore: type is checked above. @@ -81275,7 +82062,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} @@ -81411,6 +82199,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + if ("gateway" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + "The gateway must be of type " + + "URL" + ".", + ); + } + } + + if ("gateways" in values && values.gateways != null) { + + if ("gateway" in values && + values.gateway != null) { + throw new TypeError( + "Cannot update both gateway and " + + "gateways at the same time.", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + "The gateways must be an array of type " + + "URL" + ".", + ); + } + } clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; if ("manuallyApprovesFollowers" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === "boolean") { @@ -82433,6 +83257,33 @@ get preferredUsernames(): ((string | LanguageString))[] { } } +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ + get gateway(): (URL | null) { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if (this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < 1) return null; + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ +get gateways(): (URL)[] { + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + } + /** When \`true\`, conveys that for this actor, follow requests are not usually * automatically approved, but instead are examined by a person who may accept * or reject the request, at some time in the future. Setting of \`false\` @@ -85741,6 +86592,19 @@ get preferredUsernames(): ((string | LanguageString))[] { } + compactItems = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const item = ( + formatIri(v) + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result["gateways"] = compactItems; + + } + compactItems = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const item = ( @@ -86155,7 +87019,7 @@ get preferredUsernames(): ((string | LanguageString))[] { result["type"] = "Person"; if (this.id != null) result["id"] = formatIri(this.id); - result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns","https://w3id.org/fep/7aa9",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"featuredCollections":{"@id":"https://w3id.org/fep/7aa9#featuredCollections","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","movedTo":{"@id":"as:movedTo","@type":"@id"},"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey-hub.net/ns#","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat"}]; + result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/fep/ef61","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns","https://w3id.org/fep/7aa9",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"featuredCollections":{"@id":"https://w3id.org/fep/7aa9#featuredCollections","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","movedTo":{"@id":"as:movedTo","@type":"@id"},"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey-hub.net/ns#","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat"}]; return result; } @@ -86220,6 +87084,21 @@ get preferredUsernames(): ((string | LanguageString))[] { } + array = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const element = ( + { "@id": formatIri(v) } + ); + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + { "@list": array } + ); + values["https://w3id.org/fep/ef61/gateways"] = propValue; + + } + array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const element = ( @@ -86529,7 +87408,7 @@ get preferredUsernames(): ((string | LanguageString))[] { ); } const docContext = options.context ?? - ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns","https://w3id.org/fep/7aa9",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"featuredCollections":{"@id":"https://w3id.org/fep/7aa9#featuredCollections","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","movedTo":{"@id":"as:movedTo","@type":"@id"},"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey-hub.net/ns#","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat"}]; + ["https://www.w3.org/ns/activitystreams","https://w3id.org/fep/ef61","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns","https://w3id.org/fep/7aa9",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"featuredCollections":{"@id":"https://w3id.org/fep/7aa9#featuredCollections","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","movedTo":{"@id":"as:movedTo","@type":"@id"},"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey-hub.net/ns#","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat"}]; const compacted = await jsonld.compact( values, docContext, @@ -86771,6 +87650,24 @@ get preferredUsernames(): ((string | LanguageString))[] { _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); } instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const _hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; + + let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values["https://w3id.org/fep/ef61/gateways"]; + + for ( + const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null + ? [] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && "@list" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] + ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0]["@list"] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array + ) { + if (v == null) continue; + + const decoded = parseGatewayUrl(typeof v["@id"] === "string" ? v["@id"] : v["@value"]); + if (typeof decoded === "undefined") continue; + _hQiaHhZP8hqxckxTBrpsGNs57E3.push(decoded); + } + instance.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = _hQiaHhZP8hqxckxTBrpsGNs57E3; const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; let _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers__array = values["https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers"]; @@ -87442,6 +88339,32 @@ get preferredUsernames(): ((string | LanguageString))[] { proxy.assertionMethods = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; } + const _hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for("Deno.customInspect")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => "URL " + inspect(v.href, options), + [Symbol.for("nodejs.util.inspect.custom")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => "URL " + inspect(v.href, options), + } + : v); + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length == 1) { + proxy.gateway = _hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length > 1 + || !("gateway" in proxy) + && _hQiaHhZP8hqxckxTBrpsGNs57E3.length > 0) { + proxy.gateways = _hQiaHhZP8hqxckxTBrpsGNs57E3; + } + const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL @@ -94501,7 +95424,8 @@ export class Service extends Object { #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); - #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; + #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; +#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); @@ -94574,7 +95498,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} , @@ -94701,6 +95626,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | } } + if ("gateway" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + "The gateway must be of type " + + "URL" + ".", + ); + } + } + + if ("gateways" in values && values.gateways != null) { + + if ("gateway" in values && + values.gateway != null) { + throw new TypeError( + "Cannot initialize both gateway and " + + "gateways at the same time.", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + "The gateways must be an array of type " + + "URL" + ".", + ); + } + } + if ("manuallyApprovesFollowers" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === "boolean") { // @ts-ignore: type is checked above. @@ -95051,7 +96012,8 @@ bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; -assertionMethods?: (Multikey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;} @@ -95187,6 +96149,42 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + if ("gateway" in values && values.gateway != null) { + if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = [values.gateway]; + + } else { + throw new TypeError( + "The gateway must be of type " + + "URL" + ".", + ); + } + } + + if ("gateways" in values && values.gateways != null) { + + if ("gateway" in values && + values.gateway != null) { + throw new TypeError( + "Cannot update both gateway and " + + "gateways at the same time.", + ); + } + + if (Array.isArray(values.gateways) && + values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + // @ts-ignore: type is checked above. + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways; + + } else { + throw new TypeError( + "The gateways must be an array of type " + + "URL" + ".", + ); + } + } clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; if ("manuallyApprovesFollowers" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === "boolean") { @@ -96209,6 +97207,33 @@ get preferredUsernames(): ((string | LanguageString))[] { } } +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ + get gateway(): (URL | null) { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if (this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < 1) return null; + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + +/** Gateways where the latest version of this portable actor object can be + * retrieved. + * + * See [FEP-ef61](https://w3id.org/fep/ef61) for details. + * + */ +get gateways(): (URL)[] { + return this.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + } + /** When \`true\`, conveys that for this actor, follow requests are not usually * automatically approved, but instead are examined by a person who may accept * or reject the request, at some time in the future. Setting of \`false\` @@ -99517,6 +100542,19 @@ get preferredUsernames(): ((string | LanguageString))[] { } + compactItems = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const item = ( + formatIri(v) + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result["gateways"] = compactItems; + + } + compactItems = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const item = ( @@ -99931,7 +100969,7 @@ get preferredUsernames(): ((string | LanguageString))[] { result["type"] = "Service"; if (this.id != null) result["id"] = formatIri(this.id); - result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns","https://w3id.org/fep/7aa9",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"featuredCollections":{"@id":"https://w3id.org/fep/7aa9#featuredCollections","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","movedTo":{"@id":"as:movedTo","@type":"@id"},"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey-hub.net/ns#","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat"}]; + result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/fep/ef61","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns","https://w3id.org/fep/7aa9",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"featuredCollections":{"@id":"https://w3id.org/fep/7aa9#featuredCollections","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","movedTo":{"@id":"as:movedTo","@type":"@id"},"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey-hub.net/ns#","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat"}]; return result; } @@ -99996,6 +101034,21 @@ get preferredUsernames(): ((string | LanguageString))[] { } + array = []; + for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + const element = ( + { "@id": formatIri(v) } + ); + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + { "@list": array } + ); + values["https://w3id.org/fep/ef61/gateways"] = propValue; + + } + array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { const element = ( @@ -100305,7 +101358,7 @@ get preferredUsernames(): ((string | LanguageString))[] { ); } const docContext = options.context ?? - ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns","https://w3id.org/fep/7aa9",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"featuredCollections":{"@id":"https://w3id.org/fep/7aa9#featuredCollections","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","movedTo":{"@id":"as:movedTo","@type":"@id"},"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey-hub.net/ns#","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat"}]; + ["https://www.w3.org/ns/activitystreams","https://w3id.org/fep/ef61","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns","https://w3id.org/fep/7aa9",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"featuredCollections":{"@id":"https://w3id.org/fep/7aa9#featuredCollections","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","movedTo":{"@id":"as:movedTo","@type":"@id"},"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey-hub.net/ns#","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat"}]; const compacted = await jsonld.compact( values, docContext, @@ -100547,6 +101600,24 @@ get preferredUsernames(): ((string | LanguageString))[] { _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); } instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const _hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; + + let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values["https://w3id.org/fep/ef61/gateways"]; + + for ( + const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null + ? [] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && "@list" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] + ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0]["@list"] + : _hQiaHhZP8hqxckxTBrpsGNs57E3__array + ) { + if (v == null) continue; + + const decoded = parseGatewayUrl(typeof v["@id"] === "string" ? v["@id"] : v["@value"]); + if (typeof decoded === "undefined") continue; + _hQiaHhZP8hqxckxTBrpsGNs57E3.push(decoded); + } + instance.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = _hQiaHhZP8hqxckxTBrpsGNs57E3; const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; let _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers__array = values["https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers"]; @@ -101218,6 +102289,32 @@ get preferredUsernames(): ((string | LanguageString))[] { proxy.assertionMethods = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; } + const _hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for("Deno.customInspect")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => "URL " + inspect(v.href, options), + [Symbol.for("nodejs.util.inspect.custom")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => "URL " + inspect(v.href, options), + } + : v); + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length == 1) { + proxy.gateway = _hQiaHhZP8hqxckxTBrpsGNs57E3[0]; + } + + if (_hQiaHhZP8hqxckxTBrpsGNs57E3.length > 1 + || !("gateway" in proxy) + && _hQiaHhZP8hqxckxTBrpsGNs57E3.length > 0) { + proxy.gateways = _hQiaHhZP8hqxckxTBrpsGNs57E3; + } + const _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers // deno-lint-ignore no-explicit-any .map((v: any) => v instanceof URL @@ -104859,7 +105956,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} , options: { documentLoader?: DocumentLoader, @@ -104895,7 +105992,7 @@ tos?: (Object | URL)[];bto?: Object | URL | null; btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;} +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;width?: number | null;height?: number | null;digestMultibase?: string | null;} = {}, options: { @@ -104957,7 +106054,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu result["type"] = "Video"; if (this.id != null) result["id"] = formatIri(this.id); - result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; + result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v2",{"digestMultibase":"https://www.w3.org/ns/credentials/v2#digestMultibase"},"https://gotosocial.org/ns"]; return result; } @@ -104983,7 +106080,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } const docContext = options.context ?? - ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; + ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v2",{"digestMultibase":"https://www.w3.org/ns/credentials/v2#digestMultibase"},"https://gotosocial.org/ns"]; const compacted = await jsonld.compact( values, docContext, diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index e8ae007dc..7c34fd25f 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -31,8 +31,10 @@ const RUNTIME_IMPORTS = [ "importMultibaseKey", "importPem", "isDecimal", + "isGatewayUrl", "LanguageString", "parseDecimal", + "parseGatewayUrl", "parseIri", "parseJsonLdId", "type RemoteDocument", diff --git a/packages/vocab-tools/src/type.ts b/packages/vocab-tools/src/type.ts index 086d75be1..fd7566473 100644 --- a/packages/vocab-tools/src/type.ts +++ b/packages/vocab-tools/src/type.ts @@ -6,8 +6,10 @@ const HEURISTICS_CONTEXTS: string[] = [ "https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1", "https://w3id.org/security/data-integrity/v1", + "https://w3id.org/security/data-integrity/v2", "https://www.w3.org/ns/did/v1", "https://w3id.org/security/multikey/v1", + "https://w3id.org/fep/ef61", ]; interface ScalarType { @@ -324,6 +326,28 @@ const scalarTypes: Record = { return `parseIri(${v}["@value"])`; }, }, + "fedify:gatewayUrl": { + name: "URL", + typeGuard(v) { + return `${v} instanceof URL && isGatewayUrl(${v})`; + }, + encoder(v) { + return `{ "@id": formatIri(${v}) }`; + }, + compactEncoder(v) { + return `formatIri(${v})`; + }, + dataCheck(v) { + return `${v} != null && typeof ${v} === "object" && + (("@id" in ${v} && typeof ${v}["@id"] === "string" && + ${v}["@id"] !== "" && ${v}["@id"] !== "/") || + ("@value" in ${v} && typeof ${v}["@value"] === "string" && + ${v}["@value"] !== "" && ${v}["@value"] !== "/"))`; + }, + decoder(v) { + return `parseGatewayUrl(typeof ${v}["@id"] === "string" ? ${v}["@id"] : ${v}["@value"])`; + }, + }, "fedify:publicKey": { name: "CryptoKey", typeGuard(v) { diff --git a/packages/vocab/src/__snapshots__/vocab.test.ts.snap b/packages/vocab/src/__snapshots__/vocab.test.ts.snap index 4e9776f6a..570936df1 100644 --- a/packages/vocab/src/__snapshots__/vocab.test.ts.snap +++ b/packages/vocab/src/__snapshots__/vocab.test.ts.snap @@ -3352,6 +3352,7 @@ snapshot[`Deno.inspect(Application) [auto] 1`] = ` preferredUsernames: [ "hello", "hello" ], publicKey: CryptographicKey {}, assertionMethod: Multikey {}, + gateway: URL "https://gateway.example/", manuallyApprovesFollowers: true, inbox: OrderedCollection {}, outbox: OrderedCollection {}, @@ -3418,6 +3419,7 @@ snapshot[`Deno.inspect(Application) [auto] 2`] = ` preferredUsernames: [ "hello", "hello" ], publicKey: URL "https://example.com/", assertionMethod: URL "https://example.com/", + gateway: URL "https://gateway.example/", manuallyApprovesFollowers: true, inbox: URL "https://example.com/", outbox: URL "https://example.com/", @@ -3484,6 +3486,7 @@ snapshot[`Deno.inspect(Application) [auto] 3`] = ` preferredUsernames: [ "hello", "hello" ], publicKeys: [ CryptographicKey {}, CryptographicKey {} ], assertionMethods: [ Multikey {}, Multikey {} ], + gateways: [ URL "https://gateway.example/", URL "https://gateway.example/" ], manuallyApprovesFollowers: true, inbox: OrderedCollection {}, outbox: OrderedCollection {}, @@ -3833,7 +3836,8 @@ snapshot[`Deno.inspect(Audio) [auto] 1`] = ` replyAuthorization: ReplyAuthorization {}, announceAuthorization: AnnounceAuthorization {}, width: 123, - height: 123 + height: 123, + digestMultibase: "hello" }' `; @@ -3878,7 +3882,8 @@ snapshot[`Deno.inspect(Audio) [auto] 2`] = ` replyAuthorization: URL "https://example.com/", announceAuthorization: URL "https://example.com/", width: 123, - height: 123 + height: 123, + digestMultibase: "hello" }' `; @@ -3923,7 +3928,8 @@ snapshot[`Deno.inspect(Audio) [auto] 3`] = ` replyAuthorization: ReplyAuthorization {}, announceAuthorization: AnnounceAuthorization {}, width: 123, - height: 123 + height: 123, + digestMultibase: "hello" }' `; @@ -4901,7 +4907,8 @@ snapshot[`Deno.inspect(Document) [auto] 1`] = ` replyAuthorization: ReplyAuthorization {}, announceAuthorization: AnnounceAuthorization {}, width: 123, - height: 123 + height: 123, + digestMultibase: "hello" }' `; @@ -4946,7 +4953,8 @@ snapshot[`Deno.inspect(Document) [auto] 2`] = ` replyAuthorization: URL "https://example.com/", announceAuthorization: URL "https://example.com/", width: 123, - height: 123 + height: 123, + digestMultibase: "hello" }' `; @@ -4991,7 +4999,8 @@ snapshot[`Deno.inspect(Document) [auto] 3`] = ` replyAuthorization: ReplyAuthorization {}, announceAuthorization: AnnounceAuthorization {}, width: 123, - height: 123 + height: 123, + digestMultibase: "hello" }' `; @@ -5497,6 +5506,7 @@ snapshot[`Deno.inspect(Group) [auto] 1`] = ` preferredUsernames: [ "hello", "hello" ], publicKey: CryptographicKey {}, assertionMethod: Multikey {}, + gateway: URL "https://gateway.example/", manuallyApprovesFollowers: true, inbox: OrderedCollection {}, outbox: OrderedCollection {}, @@ -5563,6 +5573,7 @@ snapshot[`Deno.inspect(Group) [auto] 2`] = ` preferredUsernames: [ "hello", "hello" ], publicKey: URL "https://example.com/", assertionMethod: URL "https://example.com/", + gateway: URL "https://gateway.example/", manuallyApprovesFollowers: true, inbox: URL "https://example.com/", outbox: URL "https://example.com/", @@ -5629,6 +5640,7 @@ snapshot[`Deno.inspect(Group) [auto] 3`] = ` preferredUsernames: [ "hello", "hello" ], publicKeys: [ CryptographicKey {}, CryptographicKey {} ], assertionMethods: [ Multikey {}, Multikey {} ], + gateways: [ URL "https://gateway.example/", URL "https://gateway.example/" ], manuallyApprovesFollowers: true, inbox: OrderedCollection {}, outbox: OrderedCollection {}, @@ -5658,6 +5670,7 @@ snapshot[`Deno.inspect(Hashtag) [auto] 1`] = ` href: URL "https://example.com/", rel: "hello", mediaType: "hello", + digestMultibase: "hello", names: [ "hello", "hello" ], language: Locale [Intl.Locale] { baseName: "en-Latn-US", @@ -5683,6 +5696,7 @@ snapshot[`Deno.inspect(Hashtag) [auto] 2`] = ` href: URL "https://example.com/", rel: "hello", mediaType: "hello", + digestMultibase: "hello", names: [ "hello", "hello" ], language: Locale [Intl.Locale] { baseName: "en-Latn-US", @@ -5708,6 +5722,7 @@ snapshot[`Deno.inspect(Hashtag) [auto] 3`] = ` href: URL "https://example.com/", rels: [ "hello", "hello" ], mediaType: "hello", + digestMultibase: "hello", names: [ "hello", "hello" ], language: Locale [Intl.Locale] { baseName: "en-Latn-US", @@ -5915,7 +5930,8 @@ snapshot[`Deno.inspect(Image) [auto] 1`] = ` replyAuthorization: ReplyAuthorization {}, announceAuthorization: AnnounceAuthorization {}, width: 123, - height: 123 + height: 123, + digestMultibase: "hello" }' `; @@ -5960,7 +5976,8 @@ snapshot[`Deno.inspect(Image) [auto] 2`] = ` replyAuthorization: URL "https://example.com/", announceAuthorization: URL "https://example.com/", width: 123, - height: 123 + height: 123, + digestMultibase: "hello" }' `; @@ -6005,7 +6022,8 @@ snapshot[`Deno.inspect(Image) [auto] 3`] = ` replyAuthorization: ReplyAuthorization {}, announceAuthorization: AnnounceAuthorization {}, width: 123, - height: 123 + height: 123, + digestMultibase: "hello" }' `; @@ -6750,6 +6768,7 @@ snapshot[`Deno.inspect(Link) [auto] 1`] = ` href: URL "https://example.com/", rel: "hello", mediaType: "hello", + digestMultibase: "hello", names: [ "hello", "hello" ], language: Locale [Intl.Locale] { baseName: "en-Latn-US", @@ -6775,6 +6794,7 @@ snapshot[`Deno.inspect(Link) [auto] 2`] = ` href: URL "https://example.com/", rel: "hello", mediaType: "hello", + digestMultibase: "hello", names: [ "hello", "hello" ], language: Locale [Intl.Locale] { baseName: "en-Latn-US", @@ -6800,6 +6820,7 @@ snapshot[`Deno.inspect(Link) [auto] 3`] = ` href: URL "https://example.com/", rels: [ "hello", "hello" ], mediaType: "hello", + digestMultibase: "hello", names: [ "hello", "hello" ], language: Locale [Intl.Locale] { baseName: "en-Latn-US", @@ -6972,6 +6993,7 @@ snapshot[`Deno.inspect(Mention) [auto] 1`] = ` href: URL "https://example.com/", rel: "hello", mediaType: "hello", + digestMultibase: "hello", names: [ "hello", "hello" ], language: Locale [Intl.Locale] { baseName: "en-Latn-US", @@ -6997,6 +7019,7 @@ snapshot[`Deno.inspect(Mention) [auto] 2`] = ` href: URL "https://example.com/", rel: "hello", mediaType: "hello", + digestMultibase: "hello", names: [ "hello", "hello" ], language: Locale [Intl.Locale] { baseName: "en-Latn-US", @@ -7022,6 +7045,7 @@ snapshot[`Deno.inspect(Mention) [auto] 3`] = ` href: URL "https://example.com/", rels: [ "hello", "hello" ], mediaType: "hello", + digestMultibase: "hello", names: [ "hello", "hello" ], language: Locale [Intl.Locale] { baseName: "en-Latn-US", @@ -7993,6 +8017,7 @@ snapshot[`Deno.inspect(Organization) [auto] 1`] = ` preferredUsernames: [ "hello", "hello" ], publicKey: CryptographicKey {}, assertionMethod: Multikey {}, + gateway: URL "https://gateway.example/", manuallyApprovesFollowers: true, inbox: OrderedCollection {}, outbox: OrderedCollection {}, @@ -8059,6 +8084,7 @@ snapshot[`Deno.inspect(Organization) [auto] 2`] = ` preferredUsernames: [ "hello", "hello" ], publicKey: URL "https://example.com/", assertionMethod: URL "https://example.com/", + gateway: URL "https://gateway.example/", manuallyApprovesFollowers: true, inbox: URL "https://example.com/", outbox: URL "https://example.com/", @@ -8125,6 +8151,7 @@ snapshot[`Deno.inspect(Organization) [auto] 3`] = ` preferredUsernames: [ "hello", "hello" ], publicKeys: [ CryptographicKey {}, CryptographicKey {} ], assertionMethods: [ Multikey {}, Multikey {} ], + gateways: [ URL "https://gateway.example/", URL "https://gateway.example/" ], manuallyApprovesFollowers: true, inbox: OrderedCollection {}, outbox: OrderedCollection {}, @@ -8189,7 +8216,8 @@ snapshot[`Deno.inspect(Page) [auto] 1`] = ` replyAuthorization: ReplyAuthorization {}, announceAuthorization: AnnounceAuthorization {}, width: 123, - height: 123 + height: 123, + digestMultibase: "hello" }' `; @@ -8234,7 +8262,8 @@ snapshot[`Deno.inspect(Page) [auto] 2`] = ` replyAuthorization: URL "https://example.com/", announceAuthorization: URL "https://example.com/", width: 123, - height: 123 + height: 123, + digestMultibase: "hello" }' `; @@ -8279,7 +8308,8 @@ snapshot[`Deno.inspect(Page) [auto] 3`] = ` replyAuthorization: ReplyAuthorization {}, announceAuthorization: AnnounceAuthorization {}, width: 123, - height: 123 + height: 123, + digestMultibase: "hello" }' `; @@ -8326,6 +8356,7 @@ snapshot[`Deno.inspect(Person) [auto] 1`] = ` preferredUsernames: [ "hello", "hello" ], publicKey: CryptographicKey {}, assertionMethod: Multikey {}, + gateway: URL "https://gateway.example/", manuallyApprovesFollowers: true, inbox: OrderedCollection {}, outbox: OrderedCollection {}, @@ -8392,6 +8423,7 @@ snapshot[`Deno.inspect(Person) [auto] 2`] = ` preferredUsernames: [ "hello", "hello" ], publicKey: URL "https://example.com/", assertionMethod: URL "https://example.com/", + gateway: URL "https://gateway.example/", manuallyApprovesFollowers: true, inbox: URL "https://example.com/", outbox: URL "https://example.com/", @@ -8458,6 +8490,7 @@ snapshot[`Deno.inspect(Person) [auto] 3`] = ` preferredUsernames: [ "hello", "hello" ], publicKeys: [ CryptographicKey {}, CryptographicKey {} ], assertionMethods: [ Multikey {}, Multikey {} ], + gateways: [ URL "https://gateway.example/", URL "https://gateway.example/" ], manuallyApprovesFollowers: true, inbox: OrderedCollection {}, outbox: OrderedCollection {}, @@ -9550,6 +9583,7 @@ snapshot[`Deno.inspect(Service) [auto] 1`] = ` preferredUsernames: [ "hello", "hello" ], publicKey: CryptographicKey {}, assertionMethod: Multikey {}, + gateway: URL "https://gateway.example/", manuallyApprovesFollowers: true, inbox: OrderedCollection {}, outbox: OrderedCollection {}, @@ -9616,6 +9650,7 @@ snapshot[`Deno.inspect(Service) [auto] 2`] = ` preferredUsernames: [ "hello", "hello" ], publicKey: URL "https://example.com/", assertionMethod: URL "https://example.com/", + gateway: URL "https://gateway.example/", manuallyApprovesFollowers: true, inbox: URL "https://example.com/", outbox: URL "https://example.com/", @@ -9682,6 +9717,7 @@ snapshot[`Deno.inspect(Service) [auto] 3`] = ` preferredUsernames: [ "hello", "hello" ], publicKeys: [ CryptographicKey {}, CryptographicKey {} ], assertionMethods: [ Multikey {}, Multikey {} ], + gateways: [ URL "https://gateway.example/", URL "https://gateway.example/" ], manuallyApprovesFollowers: true, inbox: OrderedCollection {}, outbox: OrderedCollection {}, @@ -10640,7 +10676,8 @@ snapshot[`Deno.inspect(Video) [auto] 1`] = ` replyAuthorization: ReplyAuthorization {}, announceAuthorization: AnnounceAuthorization {}, width: 123, - height: 123 + height: 123, + digestMultibase: "hello" }' `; @@ -10685,7 +10722,8 @@ snapshot[`Deno.inspect(Video) [auto] 2`] = ` replyAuthorization: URL "https://example.com/", announceAuthorization: URL "https://example.com/", width: 123, - height: 123 + height: 123, + digestMultibase: "hello" }' `; @@ -10730,7 +10768,8 @@ snapshot[`Deno.inspect(Video) [auto] 3`] = ` replyAuthorization: ReplyAuthorization {}, announceAuthorization: AnnounceAuthorization {}, width: 123, - height: 123 + height: 123, + digestMultibase: "hello" }' `; diff --git a/packages/vocab/src/application.yaml b/packages/vocab/src/application.yaml index 1ca6c2c07..76e69c9dd 100644 --- a/packages/vocab/src/application.yaml +++ b/packages/vocab/src/application.yaml @@ -7,6 +7,7 @@ entity: true description: Describes a software application. defaultContext: - "https://www.w3.org/ns/activitystreams" +- "https://w3id.org/fep/ef61" - "https://w3id.org/security/v1" - "https://w3id.org/security/data-integrity/v1" - "https://www.w3.org/ns/did/v1" @@ -78,6 +79,20 @@ properties: range: - "https://w3id.org/security#Multikey" +- pluralName: gateways + singularName: gateway + singularAccessor: true + compactName: gateways + uri: "https://w3id.org/fep/ef61/gateways" + container: list + description: | + Gateways where the latest version of this portable actor object can be + retrieved. + + See [FEP-ef61](https://w3id.org/fep/ef61) for details. + range: + - "fedify:gatewayUrl" + - singularName: manuallyApprovesFollowers functional: true compactName: manuallyApprovesFollowers diff --git a/packages/vocab/src/audio.yaml b/packages/vocab/src/audio.yaml index 659334d4b..4baaf829c 100644 --- a/packages/vocab/src/audio.yaml +++ b/packages/vocab/src/audio.yaml @@ -7,6 +7,7 @@ entity: true description: Represents an audio document of any kind. defaultContext: - "https://www.w3.org/ns/activitystreams" -- "https://w3id.org/security/data-integrity/v1" +- "https://w3id.org/security/data-integrity/v2" +- digestMultibase: "https://www.w3.org/ns/credentials/v2#digestMultibase" - "https://gotosocial.org/ns" properties: [] diff --git a/packages/vocab/src/document.yaml b/packages/vocab/src/document.yaml index c7518f973..00ef462c5 100644 --- a/packages/vocab/src/document.yaml +++ b/packages/vocab/src/document.yaml @@ -7,7 +7,8 @@ entity: true description: Represents a document of any kind. defaultContext: - "https://www.w3.org/ns/activitystreams" -- "https://w3id.org/security/data-integrity/v1" +- "https://w3id.org/security/data-integrity/v2" +- digestMultibase: "https://www.w3.org/ns/credentials/v2#digestMultibase" - "https://gotosocial.org/ns" properties: @@ -30,3 +31,15 @@ properties: device-independent pixels of the linked resource. range: - "http://www.w3.org/2001/XMLSchema#nonNegativeInteger" + +- singularName: digestMultibase + functional: true + compactName: digestMultibase + uri: "https://www.w3.org/ns/credentials/v2#digestMultibase" + description: | + The multibase-encoded integrity digest of an external resource represented + by this document. + + See [FEP-ef61](https://w3id.org/fep/ef61) for details. + range: + - "http://www.w3.org/2001/XMLSchema#string" diff --git a/packages/vocab/src/group.yaml b/packages/vocab/src/group.yaml index c428ffbb1..52b4eab56 100644 --- a/packages/vocab/src/group.yaml +++ b/packages/vocab/src/group.yaml @@ -7,6 +7,7 @@ entity: true description: Represents a formal or informal collective of Actors. defaultContext: - "https://www.w3.org/ns/activitystreams" +- "https://w3id.org/fep/ef61" - "https://w3id.org/security/v1" - "https://w3id.org/security/data-integrity/v1" - "https://www.w3.org/ns/did/v1" @@ -78,6 +79,20 @@ properties: range: - "https://w3id.org/security#Multikey" +- pluralName: gateways + singularName: gateway + singularAccessor: true + compactName: gateways + uri: "https://w3id.org/fep/ef61/gateways" + container: list + description: | + Gateways where the latest version of this portable actor object can be + retrieved. + + See [FEP-ef61](https://w3id.org/fep/ef61) for details. + range: + - "fedify:gatewayUrl" + - singularName: manuallyApprovesFollowers functional: true compactName: manuallyApprovesFollowers diff --git a/packages/vocab/src/image.yaml b/packages/vocab/src/image.yaml index dcf43f8e8..939ed65dd 100644 --- a/packages/vocab/src/image.yaml +++ b/packages/vocab/src/image.yaml @@ -7,6 +7,7 @@ entity: true description: An image document of any kind. defaultContext: - "https://www.w3.org/ns/activitystreams" -- "https://w3id.org/security/data-integrity/v1" +- "https://w3id.org/security/data-integrity/v2" +- digestMultibase: "https://www.w3.org/ns/credentials/v2#digestMultibase" - "https://gotosocial.org/ns" properties: [] diff --git a/packages/vocab/src/link.yaml b/packages/vocab/src/link.yaml index ae1127b5b..2aa0ba693 100644 --- a/packages/vocab/src/link.yaml +++ b/packages/vocab/src/link.yaml @@ -12,7 +12,9 @@ description: | object) to the resource identified by the `href`. Properties of the {@link Link} are properties of the reference as opposed to properties of the resource. -defaultContext: "https://www.w3.org/ns/activitystreams" +defaultContext: +- "https://www.w3.org/ns/activitystreams" +- "https://w3id.org/fep/ef61" properties: - singularName: href @@ -48,6 +50,17 @@ properties: range: - "http://www.w3.org/2001/XMLSchema#string" +- singularName: digestMultibase + functional: true + compactName: digestMultibase + uri: "https://www.w3.org/ns/credentials/v2#digestMultibase" + description: | + The multibase-encoded integrity digest of the linked resource. + + See [FEP-ef61](https://w3id.org/fep/ef61) for details. + range: + - "http://www.w3.org/2001/XMLSchema#string" + - pluralName: names singularName: name singularAccessor: true diff --git a/packages/vocab/src/organization.yaml b/packages/vocab/src/organization.yaml index f79aa191a..7fef7c7e6 100644 --- a/packages/vocab/src/organization.yaml +++ b/packages/vocab/src/organization.yaml @@ -7,6 +7,7 @@ entity: true description: Represents an organization. defaultContext: - "https://www.w3.org/ns/activitystreams" +- "https://w3id.org/fep/ef61" - "https://w3id.org/security/v1" - "https://w3id.org/security/data-integrity/v1" - "https://www.w3.org/ns/did/v1" @@ -78,6 +79,20 @@ properties: range: - "https://w3id.org/security#Multikey" +- pluralName: gateways + singularName: gateway + singularAccessor: true + compactName: gateways + uri: "https://w3id.org/fep/ef61/gateways" + container: list + description: | + Gateways where the latest version of this portable actor object can be + retrieved. + + See [FEP-ef61](https://w3id.org/fep/ef61) for details. + range: + - "fedify:gatewayUrl" + - singularName: manuallyApprovesFollowers functional: true compactName: manuallyApprovesFollowers diff --git a/packages/vocab/src/page.yaml b/packages/vocab/src/page.yaml index 4e9622323..8c9468f1b 100644 --- a/packages/vocab/src/page.yaml +++ b/packages/vocab/src/page.yaml @@ -7,6 +7,7 @@ entity: true description: Represents a Web Page. defaultContext: - "https://www.w3.org/ns/activitystreams" -- "https://w3id.org/security/data-integrity/v1" +- "https://w3id.org/security/data-integrity/v2" +- digestMultibase: "https://www.w3.org/ns/credentials/v2#digestMultibase" - "https://gotosocial.org/ns" properties: [] diff --git a/packages/vocab/src/person.yaml b/packages/vocab/src/person.yaml index e99598343..ef4a4613c 100644 --- a/packages/vocab/src/person.yaml +++ b/packages/vocab/src/person.yaml @@ -7,6 +7,7 @@ entity: true description: Represents an individual person. defaultContext: - "https://www.w3.org/ns/activitystreams" +- "https://w3id.org/fep/ef61" - "https://w3id.org/security/v1" - "https://w3id.org/security/data-integrity/v1" - "https://www.w3.org/ns/did/v1" @@ -78,6 +79,20 @@ properties: range: - "https://w3id.org/security#Multikey" +- pluralName: gateways + singularName: gateway + singularAccessor: true + compactName: gateways + uri: "https://w3id.org/fep/ef61/gateways" + container: list + description: | + Gateways where the latest version of this portable actor object can be + retrieved. + + See [FEP-ef61](https://w3id.org/fep/ef61) for details. + range: + - "fedify:gatewayUrl" + - singularName: manuallyApprovesFollowers functional: true compactName: manuallyApprovesFollowers diff --git a/packages/vocab/src/preprocessors.ts b/packages/vocab/src/preprocessors.ts index be781fe1d..645694edd 100644 --- a/packages/vocab/src/preprocessors.ts +++ b/packages/vocab/src/preprocessors.ts @@ -7,7 +7,8 @@ import { Image, Link } from "./vocab.ts"; * When an `icon` or `image` property on a vocabulary object contains an * explicit ActivityStreams `Link` rather than an `Image`, this preprocessor * converts it into an `Image` by mapping `href` to `url`, copying - * `mediaType`, `name`, `width`, and `height`, and discarding the rest. + * `mediaType`, `name`, `width`, `height`, and `digestMultibase`, and + * discarding the rest. * * If the value is not a Link, or the Link has no `href`, it returns * `undefined` so the normal range decoder continues. @@ -44,5 +45,6 @@ export const normalizeLinkToImage: PropertyPreprocessor = async ( names: link.names != null && link.names.length > 0 ? link.names : undefined, width: link.width, height: link.height, + digestMultibase: link.digestMultibase, }); }; diff --git a/packages/vocab/src/service.yaml b/packages/vocab/src/service.yaml index c3d8618c6..d662e25c6 100644 --- a/packages/vocab/src/service.yaml +++ b/packages/vocab/src/service.yaml @@ -7,6 +7,7 @@ entity: true description: Represents a service of any kind. defaultContext: - "https://www.w3.org/ns/activitystreams" +- "https://w3id.org/fep/ef61" - "https://w3id.org/security/v1" - "https://w3id.org/security/data-integrity/v1" - "https://www.w3.org/ns/did/v1" @@ -78,6 +79,20 @@ properties: range: - "https://w3id.org/security#Multikey" +- pluralName: gateways + singularName: gateway + singularAccessor: true + compactName: gateways + uri: "https://w3id.org/fep/ef61/gateways" + container: list + description: | + Gateways where the latest version of this portable actor object can be + retrieved. + + See [FEP-ef61](https://w3id.org/fep/ef61) for details. + range: + - "fedify:gatewayUrl" + - singularName: manuallyApprovesFollowers functional: true compactName: manuallyApprovesFollowers diff --git a/packages/vocab/src/video.yaml b/packages/vocab/src/video.yaml index ace9634f1..8976cd85c 100644 --- a/packages/vocab/src/video.yaml +++ b/packages/vocab/src/video.yaml @@ -7,6 +7,7 @@ entity: true description: Represents a video document of any kind. defaultContext: - "https://www.w3.org/ns/activitystreams" -- "https://w3id.org/security/data-integrity/v1" +- "https://w3id.org/security/data-integrity/v2" +- digestMultibase: "https://www.w3.org/ns/credentials/v2#digestMultibase" - "https://gotosocial.org/ns" properties: [] diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index fd2cf3617..98804bf81 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -28,6 +28,7 @@ import { Activity, Agreement, Announce, + Application, Collection, Commitment, Create, @@ -41,7 +42,9 @@ import { FeaturedItem, FeatureRequest, Follow, + Group, Hashtag, + Image, Intent, InteractionPolicy, InteractionRule, @@ -52,6 +55,7 @@ import { Object, Offer, OrderedCollectionPage, + Organization, Person, Place, Proposal, @@ -59,6 +63,7 @@ import { QuoteAuthorization, QuoteRequest, Reject, + Service, Source, Tombstone, } from "./vocab.ts"; @@ -623,6 +628,242 @@ test("fromJsonLd() handles portable ActivityPub IRIs", async () => { ); }); +test("FEP-ef61: actor gateways round-trip as an ordered URI list", async () => { + const actorClasses = [Application, Group, Organization, Person, Service]; + const gateways = [ + new URL("https://server1.example/"), + new URL("https://server2.example/"), + ]; + + for (const ActorClass of actorClasses) { + const actor = await ActorClass.fromJsonLd({ + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://w3id.org/fep/ef61", + ], + type: ActorClass.name, + id: "ap+ef61://did:key:z6Mkabc/actor", + gateways: gateways.map((gateway) => gateway.href), + }); + deepStrictEqual(actor.gateways, gateways); + + const jsonLd = await actor.toJsonLd() as Record; + deepStrictEqual(jsonLd.type, ActorClass.name); + deepStrictEqual(jsonLd.gateways, gateways.map((gateway) => gateway.href)); + + const restored = await ActorClass.fromJsonLd(jsonLd); + deepStrictEqual(restored.gateways, gateways); + } +}); + +test("FEP-ef61: actor gateways preserve single, empty, and invalid cases", async () => { + const singleGateway = new Person({ + id: new URL("ap+ef61://did%3Akey%3Az6Mkabc/actor"), + gateways: [new URL("https://server.example/")], + }); + deepStrictEqual( + (await singleGateway.toJsonLd() as Record).gateways, + ["https://server.example/"], + ); + + const noGateways = new Person({ + id: new URL("ap+ef61://did%3Akey%3Az6Mkabc/actor"), + gateways: [], + }); + ok(!("gateways" in (await noGateways.toJsonLd() as Record))); + + await rejects( + () => + Person.fromJsonLd({ + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://w3id.org/fep/ef61", + ], + type: "Person", + gateways: ["not a uri"], + }), + TypeError, + ); +}); + +test("FEP-ef61: actor gateways accept @id typed JSON-LD references", async () => { + const actor = await Person.fromJsonLd({ + "@context": [ + "https://www.w3.org/ns/activitystreams", + { + gateways: { + "@id": "https://w3id.org/fep/ef61/gateways", + "@type": "@id", + "@container": "@list", + }, + }, + ], + type: "Person", + id: "ap+ef61://did:key:z6Mkabc/actor", + gateways: ["https://gateway.example/"], + }); + + deepStrictEqual(actor.gateways, [new URL("https://gateway.example/")]); +}); + +test("FEP-ef61: actor gateways must be HTTP(S) base URIs", async () => { + const validGateways = [ + new URL("https://server.example/"), + new URL("http://server.example/"), + ]; + const actor = new Person({ + id: new URL("ap+ef61://did%3Akey%3Az6Mkabc/actor"), + gateways: validGateways, + }); + deepStrictEqual(actor.gateways, validGateways); + + for ( + const gateway of [ + "ftp://server.example/", + "https://user:pass@server.example/", + "https://user@server.example/", + "https://server.example/path", + "https://server.example/?x=1", + "https://server.example/#fragment", + ] + ) { + throws( + () => + new Person({ + id: new URL("ap+ef61://did%3Akey%3Az6Mkabc/actor"), + gateways: [new URL(gateway)], + }), + TypeError, + ); + + await rejects( + () => + Person.fromJsonLd({ + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://w3id.org/fep/ef61", + ], + type: "Person", + gateways: [gateway], + }), + TypeError, + ); + } +}); + +test("FEP-ef61: digestMultibase round-trips on links and media objects", async () => { + const digestMultibase = "zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n"; + + const link = await Link.fromJsonLd({ + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://w3id.org/fep/ef61", + ], + type: "Link", + href: "hl:zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n", + digestMultibase, + }); + deepStrictEqual(link.digestMultibase, digestMultibase); + deepStrictEqual( + (await link.toJsonLd() as Record).digestMultibase, + digestMultibase, + ); + + for (const cls of [Document, Image]) { + const media = await cls.fromJsonLd({ + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://w3id.org/fep/ef61", + ], + type: cls.name, + url: "hl:zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n", + mediaType: "image/png", + digestMultibase, + }); + deepStrictEqual(media.digestMultibase, digestMultibase); + const jsonLd = await media.toJsonLd() as Record; + deepStrictEqual(jsonLd.type, cls.name); + deepStrictEqual(jsonLd.digestMultibase, digestMultibase); + } +}); + +test("FEP-ef61: digestMultibase avoids Data Integrity context conflicts", async () => { + const digestMultibase = "zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n"; + const image = new Image({ + url: new URL("hl:zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n"), + mediaType: "image/png", + digestMultibase, + }); + + const expanded = await image.toJsonLd({ format: "expand" }); + deepStrictEqual( + (expanded as Record[])[0][ + "https://www.w3.org/ns/credentials/v2#digestMultibase" + ], + [{ "@value": digestMultibase }], + ); + ok( + !( + "https://w3id.org/security#digestMultibase" in + (expanded as Record[])[0] + ), + ); + + const compact = await image.toJsonLd() as Record; + deepStrictEqual(compact.digestMultibase, digestMultibase); + ok( + !(compact["@context"] as unknown[]).includes("https://w3id.org/fep/ef61"), + ); + ok( + (compact["@context"] as unknown[]).some((context) => + context != null && typeof context === "object" && + (context as Record).digestMultibase === + "https://www.w3.org/ns/credentials/v2#digestMultibase" + ), + ); +}); + +test("FEP-ef61: digestMultibase parses after Data Integrity v1 contexts", async () => { + const digestMultibase = "zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n"; + const image = await Image.fromJsonLd({ + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://w3id.org/security/data-integrity/v1", + "https://w3id.org/fep/ef61", + ], + type: "Image", + url: "hl:zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n", + mediaType: "image/png", + digestMultibase, + }); + + deepStrictEqual(image.digestMultibase, digestMultibase); +}); + +test("FEP-ef61: Link image normalization preserves digestMultibase", async () => { + const digestMultibase = "zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n"; + const obj = await Object.fromJsonLd({ + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://w3id.org/security/data-integrity/v1", + "https://w3id.org/fep/ef61", + ], + type: "Note", + image: { + type: "Link", + href: "hl:zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n", + mediaType: "image/png", + digestMultibase, + }, + }); + const images = []; + for await (const img of obj.getImages()) { + images.push(img); + } + + deepStrictEqual(images[0]?.digestMultibase, digestMultibase); +}); + test("fromJsonLd() caches text that mentions portable ActivityPub IRIs", async () => { const noteJson = { "@context": [ @@ -1751,6 +1992,7 @@ test("Person.toJsonLd()", async () => { deepStrictEqual(await person.toJsonLd(), { "@context": [ "https://www.w3.org/ns/activitystreams", + "https://w3id.org/fep/ef61", "https://w3id.org/security/v1", "https://w3id.org/security/data-integrity/v1", "https://www.w3.org/ns/did/v1", @@ -2496,6 +2738,7 @@ test("InteractionPolicy.canFeature", async () => { const expected = { "@context": [ "https://www.w3.org/ns/activitystreams", + "https://w3id.org/fep/ef61", "https://w3id.org/security/v1", "https://w3id.org/security/data-integrity/v1", "https://www.w3.org/ns/did/v1", @@ -4745,6 +4988,7 @@ const sampleValues: Record = { ]), "fedify:langTag": new Intl.Locale("en-Latn-US"), "fedify:url": new URL("https://fedify.dev/"), + "fedify:gatewayUrl": new URL("https://gateway.example/"), "fedify:publicKey": rsaPublicKey.publicKey, "fedify:multibaseKey": ed25519PublicKey.publicKey, "fedify:proofPurpose": "assertionMethod",