diff --git a/.vscode/settings.json b/.vscode/settings.json index 5acc3260..51212990 100755 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -27,8 +27,10 @@ "cSpell.words": [ "bccs", "btos", + "cfworker", "codegen", "Deno", + "discoverability", "docloader", "fedify", "fediverse", diff --git a/codegen/__snapshots__/class.test.ts.snap b/codegen/__snapshots__/class.test.ts.snap index 5896c56b..ff4fbf31 100644 --- a/codegen/__snapshots__/class.test.ts.snap +++ b/codegen/__snapshots__/class.test.ts.snap @@ -4831,6 +4831,10 @@ export class Application extends Object { #_3bgkPwJanyTCoVFM9ovRcus8tKkU: (Collection | URL)[] = []; #_3sG2Hdwn9qzKGu9mpYkqakAMUkH9: (Collection | URL)[] = []; #_sEoQwUbfk4hEfugzNQ2ZiDcLMkG: Endpoints[] = []; +#_gAJzg1QDc4rcefFsUzGSYmyXvNH: boolean[] = []; +#_2kGKkJtoFWg8c18PaVSqj9NKP4t7: boolean[] = []; +#_79S8K4f5J9MWUgCxziRyUe6PTHZ: boolean[] = []; +#_2diCorzqPGQQqftp6e4SrCEwEnyk: boolean[] = []; /** * Constructs a new instance of Application with the given values. @@ -4854,7 +4858,7 @@ btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: (string | LanguageString)[];publicKey?: CryptographicKey | URL | null; -publicKeys?: (CryptographicKey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | URL | null;outbox?: OrderedCollection | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;linked?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;} +publicKeys?: (CryptographicKey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | URL | null;outbox?: OrderedCollection | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;linked?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;} ) { super(values); if (\\"preferredUsername\\" in values && values.preferredUsername != null) { @@ -4923,6 +4927,22 @@ super(values); if (\\"endpoints\\" in values && values.endpoints != null) { this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG = [values.endpoints]; } + + if (\\"discoverable\\" in values && values.discoverable != null) { + this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH = [values.discoverable]; + } + + if (\\"suspended\\" in values && values.suspended != null) { + this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7 = [values.suspended]; + } + + if (\\"memorial\\" in values && values.memorial != null) { + this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ = [values.memorial]; + } + + if (\\"indexable\\" in values && values.indexable != null) { + this.#_2diCorzqPGQQqftp6e4SrCEwEnyk = [values.indexable]; + } } /** @@ -4948,7 +4968,7 @@ btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: (string | LanguageString)[];publicKey?: CryptographicKey | URL | null; -publicKeys?: (CryptographicKey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | URL | null;outbox?: OrderedCollection | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;linked?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;} +publicKeys?: (CryptographicKey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | URL | null;outbox?: OrderedCollection | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;linked?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;} = {}): Application { const clone = super.clone(values) as unknown as Application;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf; if (\\"preferredUsername\\" in values && values.preferredUsername != null) { @@ -5017,6 +5037,22 @@ const clone = super.clone(values) as unknown as Application;clone.#_3isuDgRAKSnt if (\\"endpoints\\" in values && values.endpoints != null) { clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG = [values.endpoints]; } + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH; + if (\\"discoverable\\" in values && values.discoverable != null) { + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH = [values.discoverable]; + } + clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7 = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7; + if (\\"suspended\\" in values && values.suspended != null) { + clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7 = [values.suspended]; + } + clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ; + if (\\"memorial\\" in values && values.memorial != null) { + clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ = [values.memorial]; + } + clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk; + if (\\"indexable\\" in values && values.indexable != null) { + clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk = [values.indexable]; + } return clone; } @@ -5544,6 +5580,40 @@ get endpoints(): (Endpoints | null) { return this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG[0]; } +/** Allows users to opt-in or opt-out of discoverability features like + * the profile directory. This flag may also be used as an indicator of + * the user's preferences toward being included in external discovery services, + * such as search engines or other indexing tools. + * + */ +get discoverable(): (boolean | null) { + if (this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH.length < 1) return null; + return this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH[0]; + } + +/** Reports whether a user was locally suspended, for better handling of + * these accounts. + * + */ +get suspended(): (boolean | null) { + if (this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7.length < 1) return null; + return this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7[0]; + } + +/** Whether the actor is in-memorial state. + */ +get memorial(): (boolean | null) { + if (this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ.length < 1) return null; + return this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ[0]; + } + +/** Whether the actor allows to be indexed. + */ +get indexable(): (boolean | null) { + if (this.#_2diCorzqPGQQqftp6e4SrCEwEnyk.length < 1) return null; + return this.#_2diCorzqPGQQqftp6e4SrCEwEnyk[0]; + } + /** * Converts this object to a JSON-LD structure. * @returns The JSON-LD representation of this object. @@ -5648,6 +5718,38 @@ get endpoints(): (Endpoints | null) { } if (array.length > 0) values[\\"https://www.w3.org/ns/activitystreams#endpoints\\"] = array; + array = []; + for (const v of this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH) { + array.push( + { \\"@value\\": v } + ); + } + if (array.length > 0) values[\\"http://joinmastodon.org/ns#discoverable\\"] = array; + + array = []; + for (const v of this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7) { + array.push( + { \\"@value\\": v } + ); + } + if (array.length > 0) values[\\"http://joinmastodon.org/ns#suspended\\"] = array; + + array = []; + for (const v of this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ) { + array.push( + { \\"@value\\": v } + ); + } + if (array.length > 0) values[\\"http://joinmastodon.org/ns#memorial\\"] = array; + + array = []; + for (const v of this.#_2diCorzqPGQQqftp6e4SrCEwEnyk) { + array.push( + { \\"@value\\": v } + ); + } + if (array.length > 0) values[\\"http://joinmastodon.org/ns#indexable\\"] = array; + values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Application\\"]; if (this.id) values[\\"@id\\"] = this.id.href; if (options.expand) { @@ -5655,7 +5757,7 @@ get endpoints(): (Endpoints | null) { } return await jsonld.compact( values, - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\"], + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\"}], options ); } @@ -5825,6 +5927,34 @@ get endpoints(): (Endpoints | null) { v, options)) } instance.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG = _sEoQwUbfk4hEfugzNQ2ZiDcLMkG; + const _gAJzg1QDc4rcefFsUzGSYmyXvNH: boolean[] = []; + + for (const v of values[\\"http://joinmastodon.org/ns#discoverable\\"] ?? []) { + if (v == null) continue; + _gAJzg1QDc4rcefFsUzGSYmyXvNH.push(v[\\"@value\\"]) + } + instance.#_gAJzg1QDc4rcefFsUzGSYmyXvNH = _gAJzg1QDc4rcefFsUzGSYmyXvNH; + const _2kGKkJtoFWg8c18PaVSqj9NKP4t7: boolean[] = []; + + for (const v of values[\\"http://joinmastodon.org/ns#suspended\\"] ?? []) { + if (v == null) continue; + _2kGKkJtoFWg8c18PaVSqj9NKP4t7.push(v[\\"@value\\"]) + } + instance.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7 = _2kGKkJtoFWg8c18PaVSqj9NKP4t7; + const _79S8K4f5J9MWUgCxziRyUe6PTHZ: boolean[] = []; + + for (const v of values[\\"http://joinmastodon.org/ns#memorial\\"] ?? []) { + if (v == null) continue; + _79S8K4f5J9MWUgCxziRyUe6PTHZ.push(v[\\"@value\\"]) + } + instance.#_79S8K4f5J9MWUgCxziRyUe6PTHZ = _79S8K4f5J9MWUgCxziRyUe6PTHZ; + const _2diCorzqPGQQqftp6e4SrCEwEnyk: boolean[] = []; + + for (const v of values[\\"http://joinmastodon.org/ns#indexable\\"] ?? []) { + if (v == null) continue; + _2diCorzqPGQQqftp6e4SrCEwEnyk.push(v[\\"@value\\"]) + } + instance.#_2diCorzqPGQQqftp6e4SrCEwEnyk = _2diCorzqPGQQqftp6e4SrCEwEnyk; return instance; } @@ -5947,6 +6077,22 @@ get endpoints(): (Endpoints | null) { if (_sEoQwUbfk4hEfugzNQ2ZiDcLMkG.length == 1) { proxy.endpoints = _sEoQwUbfk4hEfugzNQ2ZiDcLMkG[0]; } + const _gAJzg1QDc4rcefFsUzGSYmyXvNH = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH; + if (_gAJzg1QDc4rcefFsUzGSYmyXvNH.length == 1) { + proxy.discoverable = _gAJzg1QDc4rcefFsUzGSYmyXvNH[0]; + } + const _2kGKkJtoFWg8c18PaVSqj9NKP4t7 = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7; + if (_2kGKkJtoFWg8c18PaVSqj9NKP4t7.length == 1) { + proxy.suspended = _2kGKkJtoFWg8c18PaVSqj9NKP4t7[0]; + } + const _79S8K4f5J9MWUgCxziRyUe6PTHZ = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ; + if (_79S8K4f5J9MWUgCxziRyUe6PTHZ.length == 1) { + proxy.memorial = _79S8K4f5J9MWUgCxziRyUe6PTHZ[0]; + } + const _2diCorzqPGQQqftp6e4SrCEwEnyk = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk; + if (_2diCorzqPGQQqftp6e4SrCEwEnyk.length == 1) { + proxy.indexable = _2diCorzqPGQQqftp6e4SrCEwEnyk[0]; + } return proxy; } @@ -9186,6 +9332,10 @@ export class Group extends Object { #_3bgkPwJanyTCoVFM9ovRcus8tKkU: (Collection | URL)[] = []; #_3sG2Hdwn9qzKGu9mpYkqakAMUkH9: (Collection | URL)[] = []; #_sEoQwUbfk4hEfugzNQ2ZiDcLMkG: Endpoints[] = []; +#_gAJzg1QDc4rcefFsUzGSYmyXvNH: boolean[] = []; +#_2kGKkJtoFWg8c18PaVSqj9NKP4t7: boolean[] = []; +#_79S8K4f5J9MWUgCxziRyUe6PTHZ: boolean[] = []; +#_2diCorzqPGQQqftp6e4SrCEwEnyk: boolean[] = []; /** * Constructs a new instance of Group with the given values. @@ -9209,7 +9359,7 @@ btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: (string | LanguageString)[];publicKey?: CryptographicKey | URL | null; -publicKeys?: (CryptographicKey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | URL | null;outbox?: OrderedCollection | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;linked?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;} +publicKeys?: (CryptographicKey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | URL | null;outbox?: OrderedCollection | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;linked?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;} ) { super(values); if (\\"preferredUsername\\" in values && values.preferredUsername != null) { @@ -9278,6 +9428,22 @@ super(values); if (\\"endpoints\\" in values && values.endpoints != null) { this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG = [values.endpoints]; } + + if (\\"discoverable\\" in values && values.discoverable != null) { + this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH = [values.discoverable]; + } + + if (\\"suspended\\" in values && values.suspended != null) { + this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7 = [values.suspended]; + } + + if (\\"memorial\\" in values && values.memorial != null) { + this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ = [values.memorial]; + } + + if (\\"indexable\\" in values && values.indexable != null) { + this.#_2diCorzqPGQQqftp6e4SrCEwEnyk = [values.indexable]; + } } /** @@ -9303,7 +9469,7 @@ btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: (string | LanguageString)[];publicKey?: CryptographicKey | URL | null; -publicKeys?: (CryptographicKey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | URL | null;outbox?: OrderedCollection | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;linked?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;} +publicKeys?: (CryptographicKey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | URL | null;outbox?: OrderedCollection | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;linked?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;} = {}): Group { const clone = super.clone(values) as unknown as Group;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf; if (\\"preferredUsername\\" in values && values.preferredUsername != null) { @@ -9372,6 +9538,22 @@ const clone = super.clone(values) as unknown as Group;clone.#_3isuDgRAKSntq9Xdbj if (\\"endpoints\\" in values && values.endpoints != null) { clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG = [values.endpoints]; } + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH; + if (\\"discoverable\\" in values && values.discoverable != null) { + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH = [values.discoverable]; + } + clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7 = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7; + if (\\"suspended\\" in values && values.suspended != null) { + clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7 = [values.suspended]; + } + clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ; + if (\\"memorial\\" in values && values.memorial != null) { + clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ = [values.memorial]; + } + clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk; + if (\\"indexable\\" in values && values.indexable != null) { + clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk = [values.indexable]; + } return clone; } @@ -9899,6 +10081,40 @@ get endpoints(): (Endpoints | null) { return this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG[0]; } +/** Allows users to opt-in or opt-out of discoverability features like + * the profile directory. This flag may also be used as an indicator of + * the user's preferences toward being included in external discovery services, + * such as search engines or other indexing tools. + * + */ +get discoverable(): (boolean | null) { + if (this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH.length < 1) return null; + return this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH[0]; + } + +/** Reports whether a user was locally suspended, for better handling of + * these accounts. + * + */ +get suspended(): (boolean | null) { + if (this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7.length < 1) return null; + return this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7[0]; + } + +/** Whether the actor is in-memorial state. + */ +get memorial(): (boolean | null) { + if (this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ.length < 1) return null; + return this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ[0]; + } + +/** Whether the actor allows to be indexed. + */ +get indexable(): (boolean | null) { + if (this.#_2diCorzqPGQQqftp6e4SrCEwEnyk.length < 1) return null; + return this.#_2diCorzqPGQQqftp6e4SrCEwEnyk[0]; + } + /** * Converts this object to a JSON-LD structure. * @returns The JSON-LD representation of this object. @@ -10003,6 +10219,38 @@ get endpoints(): (Endpoints | null) { } if (array.length > 0) values[\\"https://www.w3.org/ns/activitystreams#endpoints\\"] = array; + array = []; + for (const v of this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH) { + array.push( + { \\"@value\\": v } + ); + } + if (array.length > 0) values[\\"http://joinmastodon.org/ns#discoverable\\"] = array; + + array = []; + for (const v of this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7) { + array.push( + { \\"@value\\": v } + ); + } + if (array.length > 0) values[\\"http://joinmastodon.org/ns#suspended\\"] = array; + + array = []; + for (const v of this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ) { + array.push( + { \\"@value\\": v } + ); + } + if (array.length > 0) values[\\"http://joinmastodon.org/ns#memorial\\"] = array; + + array = []; + for (const v of this.#_2diCorzqPGQQqftp6e4SrCEwEnyk) { + array.push( + { \\"@value\\": v } + ); + } + if (array.length > 0) values[\\"http://joinmastodon.org/ns#indexable\\"] = array; + values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Group\\"]; if (this.id) values[\\"@id\\"] = this.id.href; if (options.expand) { @@ -10010,7 +10258,7 @@ get endpoints(): (Endpoints | null) { } return await jsonld.compact( values, - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\"], + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\"}], options ); } @@ -10180,6 +10428,34 @@ get endpoints(): (Endpoints | null) { v, options)) } instance.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG = _sEoQwUbfk4hEfugzNQ2ZiDcLMkG; + const _gAJzg1QDc4rcefFsUzGSYmyXvNH: boolean[] = []; + + for (const v of values[\\"http://joinmastodon.org/ns#discoverable\\"] ?? []) { + if (v == null) continue; + _gAJzg1QDc4rcefFsUzGSYmyXvNH.push(v[\\"@value\\"]) + } + instance.#_gAJzg1QDc4rcefFsUzGSYmyXvNH = _gAJzg1QDc4rcefFsUzGSYmyXvNH; + const _2kGKkJtoFWg8c18PaVSqj9NKP4t7: boolean[] = []; + + for (const v of values[\\"http://joinmastodon.org/ns#suspended\\"] ?? []) { + if (v == null) continue; + _2kGKkJtoFWg8c18PaVSqj9NKP4t7.push(v[\\"@value\\"]) + } + instance.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7 = _2kGKkJtoFWg8c18PaVSqj9NKP4t7; + const _79S8K4f5J9MWUgCxziRyUe6PTHZ: boolean[] = []; + + for (const v of values[\\"http://joinmastodon.org/ns#memorial\\"] ?? []) { + if (v == null) continue; + _79S8K4f5J9MWUgCxziRyUe6PTHZ.push(v[\\"@value\\"]) + } + instance.#_79S8K4f5J9MWUgCxziRyUe6PTHZ = _79S8K4f5J9MWUgCxziRyUe6PTHZ; + const _2diCorzqPGQQqftp6e4SrCEwEnyk: boolean[] = []; + + for (const v of values[\\"http://joinmastodon.org/ns#indexable\\"] ?? []) { + if (v == null) continue; + _2diCorzqPGQQqftp6e4SrCEwEnyk.push(v[\\"@value\\"]) + } + instance.#_2diCorzqPGQQqftp6e4SrCEwEnyk = _2diCorzqPGQQqftp6e4SrCEwEnyk; return instance; } @@ -10302,6 +10578,22 @@ get endpoints(): (Endpoints | null) { if (_sEoQwUbfk4hEfugzNQ2ZiDcLMkG.length == 1) { proxy.endpoints = _sEoQwUbfk4hEfugzNQ2ZiDcLMkG[0]; } + const _gAJzg1QDc4rcefFsUzGSYmyXvNH = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH; + if (_gAJzg1QDc4rcefFsUzGSYmyXvNH.length == 1) { + proxy.discoverable = _gAJzg1QDc4rcefFsUzGSYmyXvNH[0]; + } + const _2kGKkJtoFWg8c18PaVSqj9NKP4t7 = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7; + if (_2kGKkJtoFWg8c18PaVSqj9NKP4t7.length == 1) { + proxy.suspended = _2kGKkJtoFWg8c18PaVSqj9NKP4t7[0]; + } + const _79S8K4f5J9MWUgCxziRyUe6PTHZ = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ; + if (_79S8K4f5J9MWUgCxziRyUe6PTHZ.length == 1) { + proxy.memorial = _79S8K4f5J9MWUgCxziRyUe6PTHZ[0]; + } + const _2diCorzqPGQQqftp6e4SrCEwEnyk = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk; + if (_2diCorzqPGQQqftp6e4SrCEwEnyk.length == 1) { + proxy.indexable = _2diCorzqPGQQqftp6e4SrCEwEnyk[0]; + } return proxy; } @@ -11996,6 +12288,10 @@ export class Organization extends Object { #_3bgkPwJanyTCoVFM9ovRcus8tKkU: (Collection | URL)[] = []; #_3sG2Hdwn9qzKGu9mpYkqakAMUkH9: (Collection | URL)[] = []; #_sEoQwUbfk4hEfugzNQ2ZiDcLMkG: Endpoints[] = []; +#_gAJzg1QDc4rcefFsUzGSYmyXvNH: boolean[] = []; +#_2kGKkJtoFWg8c18PaVSqj9NKP4t7: boolean[] = []; +#_79S8K4f5J9MWUgCxziRyUe6PTHZ: boolean[] = []; +#_2diCorzqPGQQqftp6e4SrCEwEnyk: boolean[] = []; /** * Constructs a new instance of Organization with the given values. @@ -12019,7 +12315,7 @@ btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: (string | LanguageString)[];publicKey?: CryptographicKey | URL | null; -publicKeys?: (CryptographicKey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | URL | null;outbox?: OrderedCollection | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;linked?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;} +publicKeys?: (CryptographicKey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | URL | null;outbox?: OrderedCollection | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;linked?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;} ) { super(values); if (\\"preferredUsername\\" in values && values.preferredUsername != null) { @@ -12088,6 +12384,22 @@ super(values); if (\\"endpoints\\" in values && values.endpoints != null) { this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG = [values.endpoints]; } + + if (\\"discoverable\\" in values && values.discoverable != null) { + this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH = [values.discoverable]; + } + + if (\\"suspended\\" in values && values.suspended != null) { + this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7 = [values.suspended]; + } + + if (\\"memorial\\" in values && values.memorial != null) { + this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ = [values.memorial]; + } + + if (\\"indexable\\" in values && values.indexable != null) { + this.#_2diCorzqPGQQqftp6e4SrCEwEnyk = [values.indexable]; + } } /** @@ -12113,7 +12425,7 @@ btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: (string | LanguageString)[];publicKey?: CryptographicKey | URL | null; -publicKeys?: (CryptographicKey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | URL | null;outbox?: OrderedCollection | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;linked?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;} +publicKeys?: (CryptographicKey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | URL | null;outbox?: OrderedCollection | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;linked?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;} = {}): Organization { const clone = super.clone(values) as unknown as Organization;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf; if (\\"preferredUsername\\" in values && values.preferredUsername != null) { @@ -12182,6 +12494,22 @@ const clone = super.clone(values) as unknown as Organization;clone.#_3isuDgRAKSn if (\\"endpoints\\" in values && values.endpoints != null) { clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG = [values.endpoints]; } + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH; + if (\\"discoverable\\" in values && values.discoverable != null) { + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH = [values.discoverable]; + } + clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7 = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7; + if (\\"suspended\\" in values && values.suspended != null) { + clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7 = [values.suspended]; + } + clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ; + if (\\"memorial\\" in values && values.memorial != null) { + clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ = [values.memorial]; + } + clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk; + if (\\"indexable\\" in values && values.indexable != null) { + clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk = [values.indexable]; + } return clone; } @@ -12709,6 +13037,40 @@ get endpoints(): (Endpoints | null) { return this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG[0]; } +/** Allows users to opt-in or opt-out of discoverability features like + * the profile directory. This flag may also be used as an indicator of + * the user's preferences toward being included in external discovery services, + * such as search engines or other indexing tools. + * + */ +get discoverable(): (boolean | null) { + if (this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH.length < 1) return null; + return this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH[0]; + } + +/** Reports whether a user was locally suspended, for better handling of + * these accounts. + * + */ +get suspended(): (boolean | null) { + if (this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7.length < 1) return null; + return this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7[0]; + } + +/** Whether the actor is in-memorial state. + */ +get memorial(): (boolean | null) { + if (this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ.length < 1) return null; + return this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ[0]; + } + +/** Whether the actor allows to be indexed. + */ +get indexable(): (boolean | null) { + if (this.#_2diCorzqPGQQqftp6e4SrCEwEnyk.length < 1) return null; + return this.#_2diCorzqPGQQqftp6e4SrCEwEnyk[0]; + } + /** * Converts this object to a JSON-LD structure. * @returns The JSON-LD representation of this object. @@ -12813,6 +13175,38 @@ get endpoints(): (Endpoints | null) { } if (array.length > 0) values[\\"https://www.w3.org/ns/activitystreams#endpoints\\"] = array; + array = []; + for (const v of this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH) { + array.push( + { \\"@value\\": v } + ); + } + if (array.length > 0) values[\\"http://joinmastodon.org/ns#discoverable\\"] = array; + + array = []; + for (const v of this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7) { + array.push( + { \\"@value\\": v } + ); + } + if (array.length > 0) values[\\"http://joinmastodon.org/ns#suspended\\"] = array; + + array = []; + for (const v of this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ) { + array.push( + { \\"@value\\": v } + ); + } + if (array.length > 0) values[\\"http://joinmastodon.org/ns#memorial\\"] = array; + + array = []; + for (const v of this.#_2diCorzqPGQQqftp6e4SrCEwEnyk) { + array.push( + { \\"@value\\": v } + ); + } + if (array.length > 0) values[\\"http://joinmastodon.org/ns#indexable\\"] = array; + values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Organization\\"]; if (this.id) values[\\"@id\\"] = this.id.href; if (options.expand) { @@ -12820,7 +13214,7 @@ get endpoints(): (Endpoints | null) { } return await jsonld.compact( values, - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\"], + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\"}], options ); } @@ -12990,6 +13384,34 @@ get endpoints(): (Endpoints | null) { v, options)) } instance.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG = _sEoQwUbfk4hEfugzNQ2ZiDcLMkG; + const _gAJzg1QDc4rcefFsUzGSYmyXvNH: boolean[] = []; + + for (const v of values[\\"http://joinmastodon.org/ns#discoverable\\"] ?? []) { + if (v == null) continue; + _gAJzg1QDc4rcefFsUzGSYmyXvNH.push(v[\\"@value\\"]) + } + instance.#_gAJzg1QDc4rcefFsUzGSYmyXvNH = _gAJzg1QDc4rcefFsUzGSYmyXvNH; + const _2kGKkJtoFWg8c18PaVSqj9NKP4t7: boolean[] = []; + + for (const v of values[\\"http://joinmastodon.org/ns#suspended\\"] ?? []) { + if (v == null) continue; + _2kGKkJtoFWg8c18PaVSqj9NKP4t7.push(v[\\"@value\\"]) + } + instance.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7 = _2kGKkJtoFWg8c18PaVSqj9NKP4t7; + const _79S8K4f5J9MWUgCxziRyUe6PTHZ: boolean[] = []; + + for (const v of values[\\"http://joinmastodon.org/ns#memorial\\"] ?? []) { + if (v == null) continue; + _79S8K4f5J9MWUgCxziRyUe6PTHZ.push(v[\\"@value\\"]) + } + instance.#_79S8K4f5J9MWUgCxziRyUe6PTHZ = _79S8K4f5J9MWUgCxziRyUe6PTHZ; + const _2diCorzqPGQQqftp6e4SrCEwEnyk: boolean[] = []; + + for (const v of values[\\"http://joinmastodon.org/ns#indexable\\"] ?? []) { + if (v == null) continue; + _2diCorzqPGQQqftp6e4SrCEwEnyk.push(v[\\"@value\\"]) + } + instance.#_2diCorzqPGQQqftp6e4SrCEwEnyk = _2diCorzqPGQQqftp6e4SrCEwEnyk; return instance; } @@ -13112,6 +13534,22 @@ get endpoints(): (Endpoints | null) { if (_sEoQwUbfk4hEfugzNQ2ZiDcLMkG.length == 1) { proxy.endpoints = _sEoQwUbfk4hEfugzNQ2ZiDcLMkG[0]; } + const _gAJzg1QDc4rcefFsUzGSYmyXvNH = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH; + if (_gAJzg1QDc4rcefFsUzGSYmyXvNH.length == 1) { + proxy.discoverable = _gAJzg1QDc4rcefFsUzGSYmyXvNH[0]; + } + const _2kGKkJtoFWg8c18PaVSqj9NKP4t7 = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7; + if (_2kGKkJtoFWg8c18PaVSqj9NKP4t7.length == 1) { + proxy.suspended = _2kGKkJtoFWg8c18PaVSqj9NKP4t7[0]; + } + const _79S8K4f5J9MWUgCxziRyUe6PTHZ = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ; + if (_79S8K4f5J9MWUgCxziRyUe6PTHZ.length == 1) { + proxy.memorial = _79S8K4f5J9MWUgCxziRyUe6PTHZ[0]; + } + const _2diCorzqPGQQqftp6e4SrCEwEnyk = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk; + if (_2diCorzqPGQQqftp6e4SrCEwEnyk.length == 1) { + proxy.indexable = _2diCorzqPGQQqftp6e4SrCEwEnyk[0]; + } return proxy; } @@ -13280,6 +13718,10 @@ export class Person extends Object { #_3bgkPwJanyTCoVFM9ovRcus8tKkU: (Collection | URL)[] = []; #_3sG2Hdwn9qzKGu9mpYkqakAMUkH9: (Collection | URL)[] = []; #_sEoQwUbfk4hEfugzNQ2ZiDcLMkG: Endpoints[] = []; +#_gAJzg1QDc4rcefFsUzGSYmyXvNH: boolean[] = []; +#_2kGKkJtoFWg8c18PaVSqj9NKP4t7: boolean[] = []; +#_79S8K4f5J9MWUgCxziRyUe6PTHZ: boolean[] = []; +#_2diCorzqPGQQqftp6e4SrCEwEnyk: boolean[] = []; /** * Constructs a new instance of Person with the given values. @@ -13303,7 +13745,7 @@ btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: (string | LanguageString)[];publicKey?: CryptographicKey | URL | null; -publicKeys?: (CryptographicKey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | URL | null;outbox?: OrderedCollection | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;linked?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;} +publicKeys?: (CryptographicKey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | URL | null;outbox?: OrderedCollection | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;linked?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;} ) { super(values); if (\\"preferredUsername\\" in values && values.preferredUsername != null) { @@ -13372,6 +13814,22 @@ super(values); if (\\"endpoints\\" in values && values.endpoints != null) { this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG = [values.endpoints]; } + + if (\\"discoverable\\" in values && values.discoverable != null) { + this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH = [values.discoverable]; + } + + if (\\"suspended\\" in values && values.suspended != null) { + this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7 = [values.suspended]; + } + + if (\\"memorial\\" in values && values.memorial != null) { + this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ = [values.memorial]; + } + + if (\\"indexable\\" in values && values.indexable != null) { + this.#_2diCorzqPGQQqftp6e4SrCEwEnyk = [values.indexable]; + } } /** @@ -13397,7 +13855,7 @@ btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: (string | LanguageString)[];publicKey?: CryptographicKey | URL | null; -publicKeys?: (CryptographicKey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | URL | null;outbox?: OrderedCollection | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;linked?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;} +publicKeys?: (CryptographicKey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | URL | null;outbox?: OrderedCollection | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;linked?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;} = {}): Person { const clone = super.clone(values) as unknown as Person;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf; if (\\"preferredUsername\\" in values && values.preferredUsername != null) { @@ -13466,6 +13924,22 @@ const clone = super.clone(values) as unknown as Person;clone.#_3isuDgRAKSntq9Xdb if (\\"endpoints\\" in values && values.endpoints != null) { clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG = [values.endpoints]; } + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH; + if (\\"discoverable\\" in values && values.discoverable != null) { + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH = [values.discoverable]; + } + clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7 = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7; + if (\\"suspended\\" in values && values.suspended != null) { + clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7 = [values.suspended]; + } + clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ; + if (\\"memorial\\" in values && values.memorial != null) { + clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ = [values.memorial]; + } + clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk; + if (\\"indexable\\" in values && values.indexable != null) { + clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk = [values.indexable]; + } return clone; } @@ -13993,6 +14467,40 @@ get endpoints(): (Endpoints | null) { return this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG[0]; } +/** Allows users to opt-in or opt-out of discoverability features like + * the profile directory. This flag may also be used as an indicator of + * the user's preferences toward being included in external discovery services, + * such as search engines or other indexing tools. + * + */ +get discoverable(): (boolean | null) { + if (this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH.length < 1) return null; + return this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH[0]; + } + +/** Reports whether a user was locally suspended, for better handling of + * these accounts. + * + */ +get suspended(): (boolean | null) { + if (this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7.length < 1) return null; + return this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7[0]; + } + +/** Whether the actor is in-memorial state. + */ +get memorial(): (boolean | null) { + if (this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ.length < 1) return null; + return this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ[0]; + } + +/** Whether the actor allows to be indexed. + */ +get indexable(): (boolean | null) { + if (this.#_2diCorzqPGQQqftp6e4SrCEwEnyk.length < 1) return null; + return this.#_2diCorzqPGQQqftp6e4SrCEwEnyk[0]; + } + /** * Converts this object to a JSON-LD structure. * @returns The JSON-LD representation of this object. @@ -14097,6 +14605,38 @@ get endpoints(): (Endpoints | null) { } if (array.length > 0) values[\\"https://www.w3.org/ns/activitystreams#endpoints\\"] = array; + array = []; + for (const v of this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH) { + array.push( + { \\"@value\\": v } + ); + } + if (array.length > 0) values[\\"http://joinmastodon.org/ns#discoverable\\"] = array; + + array = []; + for (const v of this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7) { + array.push( + { \\"@value\\": v } + ); + } + if (array.length > 0) values[\\"http://joinmastodon.org/ns#suspended\\"] = array; + + array = []; + for (const v of this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ) { + array.push( + { \\"@value\\": v } + ); + } + if (array.length > 0) values[\\"http://joinmastodon.org/ns#memorial\\"] = array; + + array = []; + for (const v of this.#_2diCorzqPGQQqftp6e4SrCEwEnyk) { + array.push( + { \\"@value\\": v } + ); + } + if (array.length > 0) values[\\"http://joinmastodon.org/ns#indexable\\"] = array; + values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Person\\"]; if (this.id) values[\\"@id\\"] = this.id.href; if (options.expand) { @@ -14104,7 +14644,7 @@ get endpoints(): (Endpoints | null) { } return await jsonld.compact( values, - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\"], + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\"}], options ); } @@ -14274,6 +14814,34 @@ get endpoints(): (Endpoints | null) { v, options)) } instance.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG = _sEoQwUbfk4hEfugzNQ2ZiDcLMkG; + const _gAJzg1QDc4rcefFsUzGSYmyXvNH: boolean[] = []; + + for (const v of values[\\"http://joinmastodon.org/ns#discoverable\\"] ?? []) { + if (v == null) continue; + _gAJzg1QDc4rcefFsUzGSYmyXvNH.push(v[\\"@value\\"]) + } + instance.#_gAJzg1QDc4rcefFsUzGSYmyXvNH = _gAJzg1QDc4rcefFsUzGSYmyXvNH; + const _2kGKkJtoFWg8c18PaVSqj9NKP4t7: boolean[] = []; + + for (const v of values[\\"http://joinmastodon.org/ns#suspended\\"] ?? []) { + if (v == null) continue; + _2kGKkJtoFWg8c18PaVSqj9NKP4t7.push(v[\\"@value\\"]) + } + instance.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7 = _2kGKkJtoFWg8c18PaVSqj9NKP4t7; + const _79S8K4f5J9MWUgCxziRyUe6PTHZ: boolean[] = []; + + for (const v of values[\\"http://joinmastodon.org/ns#memorial\\"] ?? []) { + if (v == null) continue; + _79S8K4f5J9MWUgCxziRyUe6PTHZ.push(v[\\"@value\\"]) + } + instance.#_79S8K4f5J9MWUgCxziRyUe6PTHZ = _79S8K4f5J9MWUgCxziRyUe6PTHZ; + const _2diCorzqPGQQqftp6e4SrCEwEnyk: boolean[] = []; + + for (const v of values[\\"http://joinmastodon.org/ns#indexable\\"] ?? []) { + if (v == null) continue; + _2diCorzqPGQQqftp6e4SrCEwEnyk.push(v[\\"@value\\"]) + } + instance.#_2diCorzqPGQQqftp6e4SrCEwEnyk = _2diCorzqPGQQqftp6e4SrCEwEnyk; return instance; } @@ -14396,6 +14964,22 @@ get endpoints(): (Endpoints | null) { if (_sEoQwUbfk4hEfugzNQ2ZiDcLMkG.length == 1) { proxy.endpoints = _sEoQwUbfk4hEfugzNQ2ZiDcLMkG[0]; } + const _gAJzg1QDc4rcefFsUzGSYmyXvNH = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH; + if (_gAJzg1QDc4rcefFsUzGSYmyXvNH.length == 1) { + proxy.discoverable = _gAJzg1QDc4rcefFsUzGSYmyXvNH[0]; + } + const _2kGKkJtoFWg8c18PaVSqj9NKP4t7 = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7; + if (_2kGKkJtoFWg8c18PaVSqj9NKP4t7.length == 1) { + proxy.suspended = _2kGKkJtoFWg8c18PaVSqj9NKP4t7[0]; + } + const _79S8K4f5J9MWUgCxziRyUe6PTHZ = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ; + if (_79S8K4f5J9MWUgCxziRyUe6PTHZ.length == 1) { + proxy.memorial = _79S8K4f5J9MWUgCxziRyUe6PTHZ[0]; + } + const _2diCorzqPGQQqftp6e4SrCEwEnyk = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk; + if (_2diCorzqPGQQqftp6e4SrCEwEnyk.length == 1) { + proxy.indexable = _2diCorzqPGQQqftp6e4SrCEwEnyk[0]; + } return proxy; } @@ -15964,6 +16548,10 @@ export class Service extends Object { #_3bgkPwJanyTCoVFM9ovRcus8tKkU: (Collection | URL)[] = []; #_3sG2Hdwn9qzKGu9mpYkqakAMUkH9: (Collection | URL)[] = []; #_sEoQwUbfk4hEfugzNQ2ZiDcLMkG: Endpoints[] = []; +#_gAJzg1QDc4rcefFsUzGSYmyXvNH: boolean[] = []; +#_2kGKkJtoFWg8c18PaVSqj9NKP4t7: boolean[] = []; +#_79S8K4f5J9MWUgCxziRyUe6PTHZ: boolean[] = []; +#_2diCorzqPGQQqftp6e4SrCEwEnyk: boolean[] = []; /** * Constructs a new instance of Service with the given values. @@ -15987,7 +16575,7 @@ btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: (string | LanguageString)[];publicKey?: CryptographicKey | URL | null; -publicKeys?: (CryptographicKey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | URL | null;outbox?: OrderedCollection | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;linked?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;} +publicKeys?: (CryptographicKey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | URL | null;outbox?: OrderedCollection | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;linked?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;} ) { super(values); if (\\"preferredUsername\\" in values && values.preferredUsername != null) { @@ -16056,6 +16644,22 @@ super(values); if (\\"endpoints\\" in values && values.endpoints != null) { this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG = [values.endpoints]; } + + if (\\"discoverable\\" in values && values.discoverable != null) { + this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH = [values.discoverable]; + } + + if (\\"suspended\\" in values && values.suspended != null) { + this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7 = [values.suspended]; + } + + if (\\"memorial\\" in values && values.memorial != null) { + this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ = [values.memorial]; + } + + if (\\"indexable\\" in values && values.indexable != null) { + this.#_2diCorzqPGQQqftp6e4SrCEwEnyk = [values.indexable]; + } } /** @@ -16081,7 +16685,7 @@ btos?: (Object | URL)[];cc?: Object | URL | null; ccs?: (Object | URL)[];bcc?: Object | URL | null; bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;preferredUsername?: string | LanguageString | null; preferredUsernames?: (string | LanguageString)[];publicKey?: CryptographicKey | URL | null; -publicKeys?: (CryptographicKey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | URL | null;outbox?: OrderedCollection | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;linked?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;} +publicKeys?: (CryptographicKey | URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | URL | null;outbox?: OrderedCollection | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;linked?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;} = {}): Service { const clone = super.clone(values) as unknown as Service;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf; if (\\"preferredUsername\\" in values && values.preferredUsername != null) { @@ -16150,6 +16754,22 @@ const clone = super.clone(values) as unknown as Service;clone.#_3isuDgRAKSntq9Xd if (\\"endpoints\\" in values && values.endpoints != null) { clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG = [values.endpoints]; } + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH; + if (\\"discoverable\\" in values && values.discoverable != null) { + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH = [values.discoverable]; + } + clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7 = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7; + if (\\"suspended\\" in values && values.suspended != null) { + clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7 = [values.suspended]; + } + clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ; + if (\\"memorial\\" in values && values.memorial != null) { + clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ = [values.memorial]; + } + clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk; + if (\\"indexable\\" in values && values.indexable != null) { + clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk = [values.indexable]; + } return clone; } @@ -16677,6 +17297,40 @@ get endpoints(): (Endpoints | null) { return this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG[0]; } +/** Allows users to opt-in or opt-out of discoverability features like + * the profile directory. This flag may also be used as an indicator of + * the user's preferences toward being included in external discovery services, + * such as search engines or other indexing tools. + * + */ +get discoverable(): (boolean | null) { + if (this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH.length < 1) return null; + return this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH[0]; + } + +/** Reports whether a user was locally suspended, for better handling of + * these accounts. + * + */ +get suspended(): (boolean | null) { + if (this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7.length < 1) return null; + return this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7[0]; + } + +/** Whether the actor is in-memorial state. + */ +get memorial(): (boolean | null) { + if (this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ.length < 1) return null; + return this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ[0]; + } + +/** Whether the actor allows to be indexed. + */ +get indexable(): (boolean | null) { + if (this.#_2diCorzqPGQQqftp6e4SrCEwEnyk.length < 1) return null; + return this.#_2diCorzqPGQQqftp6e4SrCEwEnyk[0]; + } + /** * Converts this object to a JSON-LD structure. * @returns The JSON-LD representation of this object. @@ -16781,6 +17435,38 @@ get endpoints(): (Endpoints | null) { } if (array.length > 0) values[\\"https://www.w3.org/ns/activitystreams#endpoints\\"] = array; + array = []; + for (const v of this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH) { + array.push( + { \\"@value\\": v } + ); + } + if (array.length > 0) values[\\"http://joinmastodon.org/ns#discoverable\\"] = array; + + array = []; + for (const v of this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7) { + array.push( + { \\"@value\\": v } + ); + } + if (array.length > 0) values[\\"http://joinmastodon.org/ns#suspended\\"] = array; + + array = []; + for (const v of this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ) { + array.push( + { \\"@value\\": v } + ); + } + if (array.length > 0) values[\\"http://joinmastodon.org/ns#memorial\\"] = array; + + array = []; + for (const v of this.#_2diCorzqPGQQqftp6e4SrCEwEnyk) { + array.push( + { \\"@value\\": v } + ); + } + if (array.length > 0) values[\\"http://joinmastodon.org/ns#indexable\\"] = array; + values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Service\\"]; if (this.id) values[\\"@id\\"] = this.id.href; if (options.expand) { @@ -16788,7 +17474,7 @@ get endpoints(): (Endpoints | null) { } return await jsonld.compact( values, - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\"], + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\"}], options ); } @@ -16958,6 +17644,34 @@ get endpoints(): (Endpoints | null) { v, options)) } instance.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG = _sEoQwUbfk4hEfugzNQ2ZiDcLMkG; + const _gAJzg1QDc4rcefFsUzGSYmyXvNH: boolean[] = []; + + for (const v of values[\\"http://joinmastodon.org/ns#discoverable\\"] ?? []) { + if (v == null) continue; + _gAJzg1QDc4rcefFsUzGSYmyXvNH.push(v[\\"@value\\"]) + } + instance.#_gAJzg1QDc4rcefFsUzGSYmyXvNH = _gAJzg1QDc4rcefFsUzGSYmyXvNH; + const _2kGKkJtoFWg8c18PaVSqj9NKP4t7: boolean[] = []; + + for (const v of values[\\"http://joinmastodon.org/ns#suspended\\"] ?? []) { + if (v == null) continue; + _2kGKkJtoFWg8c18PaVSqj9NKP4t7.push(v[\\"@value\\"]) + } + instance.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7 = _2kGKkJtoFWg8c18PaVSqj9NKP4t7; + const _79S8K4f5J9MWUgCxziRyUe6PTHZ: boolean[] = []; + + for (const v of values[\\"http://joinmastodon.org/ns#memorial\\"] ?? []) { + if (v == null) continue; + _79S8K4f5J9MWUgCxziRyUe6PTHZ.push(v[\\"@value\\"]) + } + instance.#_79S8K4f5J9MWUgCxziRyUe6PTHZ = _79S8K4f5J9MWUgCxziRyUe6PTHZ; + const _2diCorzqPGQQqftp6e4SrCEwEnyk: boolean[] = []; + + for (const v of values[\\"http://joinmastodon.org/ns#indexable\\"] ?? []) { + if (v == null) continue; + _2diCorzqPGQQqftp6e4SrCEwEnyk.push(v[\\"@value\\"]) + } + instance.#_2diCorzqPGQQqftp6e4SrCEwEnyk = _2diCorzqPGQQqftp6e4SrCEwEnyk; return instance; } @@ -17080,6 +17794,22 @@ get endpoints(): (Endpoints | null) { if (_sEoQwUbfk4hEfugzNQ2ZiDcLMkG.length == 1) { proxy.endpoints = _sEoQwUbfk4hEfugzNQ2ZiDcLMkG[0]; } + const _gAJzg1QDc4rcefFsUzGSYmyXvNH = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH; + if (_gAJzg1QDc4rcefFsUzGSYmyXvNH.length == 1) { + proxy.discoverable = _gAJzg1QDc4rcefFsUzGSYmyXvNH[0]; + } + const _2kGKkJtoFWg8c18PaVSqj9NKP4t7 = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7; + if (_2kGKkJtoFWg8c18PaVSqj9NKP4t7.length == 1) { + proxy.suspended = _2kGKkJtoFWg8c18PaVSqj9NKP4t7[0]; + } + const _79S8K4f5J9MWUgCxziRyUe6PTHZ = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ; + if (_79S8K4f5J9MWUgCxziRyUe6PTHZ.length == 1) { + proxy.memorial = _79S8K4f5J9MWUgCxziRyUe6PTHZ[0]; + } + const _2diCorzqPGQQqftp6e4SrCEwEnyk = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk; + if (_2diCorzqPGQQqftp6e4SrCEwEnyk.length == 1) { + proxy.indexable = _2diCorzqPGQQqftp6e4SrCEwEnyk[0]; + } return proxy; } diff --git a/codegen/schema.ts b/codegen/schema.ts index 0b8148cb..6c2cb807 100644 --- a/codegen/schema.ts +++ b/codegen/schema.ts @@ -1,7 +1,10 @@ import { join } from "jsr:@std/path@^0.218.2"; import * as url from "jsr:@std/url@^0.218.2"; import { parse } from "jsr:@std/yaml@^0.218.2"; -import { Schema as JsonSchema } from "https://deno.land/x/jema@v1.1.9/schema.js"; +import { + Schema as JsonSchema, + Validator, +} from "npm:@cfworker/json-schema@1.12.8"; import { readDirRecursive } from "./fs.ts"; /** @@ -172,27 +175,28 @@ export class SchemaError extends Error { } } -async function loadSchemaSchema(): Promise { +async function loadSchemaValidator(): Promise { const thisFile = new URL(import.meta.url); const response = await fetch(url.join(url.dirname(thisFile), "schema.yaml")); const content = await response.text(); const schemaObject = parse(content); - const schema = new JsonSchema(schemaObject as object); - await schema.deref(); - return schema; + return new Validator(schemaObject as JsonSchema); } -const schemaSchema: JsonSchema = await loadSchemaSchema(); +const schemaValidator: Validator = await loadSchemaValidator(); async function loadSchema(path: string): Promise { const content = await Deno.readTextFile(path); const schema = parse(content); + const result = schemaValidator.validate(schema); const errors: SchemaError[] = []; - for (const e of schemaSchema.errors(schema)) { - errors.push(new SchemaError(path, `${path}: ${e.message}`)); + if (result.valid) return schema as TypeSchema; + for (const e of result.errors) { + errors.push( + new SchemaError(path, `${path}:${e.instanceLocation}: ${e.error}`), + ); } - if (errors.length > 0) throw new AggregateError(errors); - return schema as TypeSchema; + throw new AggregateError(errors); } /** diff --git a/examples/blog/federation/mod.ts b/examples/blog/federation/mod.ts index 99a4ef1e..d38a4943 100644 --- a/examples/blog/federation/mod.ts +++ b/examples/blog/federation/mod.ts @@ -49,8 +49,12 @@ federation.setActorDispatcher("/users/{handle}", async (ctx, handle, key) => { name: blog.title, summary: blog.description, preferredUsername: handle, - url: new URL("/", ctx.request.url), + url: new URL("/", ctx.url), published: blog.published, + discoverable: true, + suspended: false, + indexable: true, + memorial: false, // A `Context` object has several purposes, and one of // them is to provide a way to generate URIs for the dispatchers and // the collections: diff --git a/vocab/__snapshots__/vocab.test.ts.snap b/vocab/__snapshots__/vocab.test.ts.snap index 49315ea4..038065d0 100644 --- a/vocab/__snapshots__/vocab.test.ts.snap +++ b/vocab/__snapshots__/vocab.test.ts.snap @@ -733,7 +733,11 @@ snapshot[`Deno.inspect(Application) [auto] 1`] = ` followers: Collection {}, linked: Collection {}, streams: [ Collection {} ], - endpoints: Endpoints {} + endpoints: Endpoints {}, + discoverable: true, + suspended: true, + memorial: true, + indexable: true }' `; @@ -789,7 +793,11 @@ snapshot[`Deno.inspect(Application) [auto] 2`] = ` followers: URL "https://example.com/", linked: URL "https://example.com/", streams: [ URL "https://example.com/" ], - endpoints: Endpoints {} + endpoints: Endpoints {}, + discoverable: true, + suspended: true, + memorial: true, + indexable: true }' `; @@ -857,7 +865,11 @@ snapshot[`Deno.inspect(Application) [auto] 3`] = ` followers: Collection {}, linked: Collection {}, streams: [ Collection {}, Collection {} ], - endpoints: Endpoints {} + endpoints: Endpoints {}, + discoverable: true, + suspended: true, + memorial: true, + indexable: true }' `; @@ -3051,7 +3063,11 @@ snapshot[`Deno.inspect(Group) [auto] 1`] = ` followers: Collection {}, linked: Collection {}, streams: [ Collection {} ], - endpoints: Endpoints {} + endpoints: Endpoints {}, + discoverable: true, + suspended: true, + memorial: true, + indexable: true }' `; @@ -3107,7 +3123,11 @@ snapshot[`Deno.inspect(Group) [auto] 2`] = ` followers: URL "https://example.com/", linked: URL "https://example.com/", streams: [ URL "https://example.com/" ], - endpoints: Endpoints {} + endpoints: Endpoints {}, + discoverable: true, + suspended: true, + memorial: true, + indexable: true }' `; @@ -3175,7 +3195,11 @@ snapshot[`Deno.inspect(Group) [auto] 3`] = ` followers: Collection {}, linked: Collection {}, streams: [ Collection {}, Collection {} ], - endpoints: Endpoints {} + endpoints: Endpoints {}, + discoverable: true, + suspended: true, + memorial: true, + indexable: true }' `; @@ -4688,7 +4712,11 @@ snapshot[`Deno.inspect(Organization) [auto] 1`] = ` followers: Collection {}, linked: Collection {}, streams: [ Collection {} ], - endpoints: Endpoints {} + endpoints: Endpoints {}, + discoverable: true, + suspended: true, + memorial: true, + indexable: true }' `; @@ -4744,7 +4772,11 @@ snapshot[`Deno.inspect(Organization) [auto] 2`] = ` followers: URL "https://example.com/", linked: URL "https://example.com/", streams: [ URL "https://example.com/" ], - endpoints: Endpoints {} + endpoints: Endpoints {}, + discoverable: true, + suspended: true, + memorial: true, + indexable: true }' `; @@ -4812,7 +4844,11 @@ snapshot[`Deno.inspect(Organization) [auto] 3`] = ` followers: Collection {}, linked: Collection {}, streams: [ Collection {}, Collection {} ], - endpoints: Endpoints {} + endpoints: Endpoints {}, + discoverable: true, + suspended: true, + memorial: true, + indexable: true }' `; @@ -5020,7 +5056,11 @@ snapshot[`Deno.inspect(Person) [auto] 1`] = ` followers: Collection {}, linked: Collection {}, streams: [ Collection {} ], - endpoints: Endpoints {} + endpoints: Endpoints {}, + discoverable: true, + suspended: true, + memorial: true, + indexable: true }' `; @@ -5076,7 +5116,11 @@ snapshot[`Deno.inspect(Person) [auto] 2`] = ` followers: URL "https://example.com/", linked: URL "https://example.com/", streams: [ URL "https://example.com/" ], - endpoints: Endpoints {} + endpoints: Endpoints {}, + discoverable: true, + suspended: true, + memorial: true, + indexable: true }' `; @@ -5144,7 +5188,11 @@ snapshot[`Deno.inspect(Person) [auto] 3`] = ` followers: Collection {}, linked: Collection {}, streams: [ Collection {}, Collection {} ], - endpoints: Endpoints {} + endpoints: Endpoints {}, + discoverable: true, + suspended: true, + memorial: true, + indexable: true }' `; @@ -5998,7 +6046,11 @@ snapshot[`Deno.inspect(Service) [auto] 1`] = ` followers: Collection {}, linked: Collection {}, streams: [ Collection {} ], - endpoints: Endpoints {} + endpoints: Endpoints {}, + discoverable: true, + suspended: true, + memorial: true, + indexable: true }' `; @@ -6054,7 +6106,11 @@ snapshot[`Deno.inspect(Service) [auto] 2`] = ` followers: URL "https://example.com/", linked: URL "https://example.com/", streams: [ URL "https://example.com/" ], - endpoints: Endpoints {} + endpoints: Endpoints {}, + discoverable: true, + suspended: true, + memorial: true, + indexable: true }' `; @@ -6122,7 +6178,11 @@ snapshot[`Deno.inspect(Service) [auto] 3`] = ` followers: Collection {}, linked: Collection {}, streams: [ Collection {}, Collection {} ], - endpoints: Endpoints {} + endpoints: Endpoints {}, + discoverable: true, + suspended: true, + memorial: true, + indexable: true }' `; diff --git a/vocab/application.yaml b/vocab/application.yaml index e7a3324c..88d098a9 100644 --- a/vocab/application.yaml +++ b/vocab/application.yaml @@ -7,6 +7,11 @@ description: Describes a software application. defaultContext: - "https://www.w3.org/ns/activitystreams" - "https://w3id.org/security/v1" +- toot: "http://joinmastodon.org/ns#" + discoverable: "toot:discoverable" + suspended: "toot:suspended" + memorial: "toot:memorial" + indexable: "toot:indexable" properties: - pluralName: preferredUsernames @@ -138,3 +143,37 @@ properties: a link to a JSON-LD document with these properties. range: - "https://www.w3.org/ns/activitystreams#Endpoints" + +- singularName: discoverable + functional: true + uri: "http://joinmastodon.org/ns#discoverable" + description: | + Allows users to opt-in or opt-out of discoverability features like + the profile directory. This flag may also be used as an indicator of + the user's preferences toward being included in external discovery services, + such as search engines or other indexing tools. + range: + - "http://www.w3.org/2001/XMLSchema#boolean" + +- singularName: suspended + functional: true + uri: "http://joinmastodon.org/ns#suspended" + description: | + Reports whether a user was locally suspended, for better handling of + these accounts. + range: + - "http://www.w3.org/2001/XMLSchema#boolean" + +- singularName: memorial + functional: true + uri: "http://joinmastodon.org/ns#memorial" + description: Whether the actor is in-memorial state. + range: + - "http://www.w3.org/2001/XMLSchema#boolean" + +- singularName: indexable + functional: true + uri: "http://joinmastodon.org/ns#indexable" + description: Whether the actor allows to be indexed. + range: + - "http://www.w3.org/2001/XMLSchema#boolean" diff --git a/vocab/group.yaml b/vocab/group.yaml index d4781981..de961c97 100644 --- a/vocab/group.yaml +++ b/vocab/group.yaml @@ -7,6 +7,11 @@ description: Represents a formal or informal collective of Actors. defaultContext: - "https://www.w3.org/ns/activitystreams" - "https://w3id.org/security/v1" +- toot: "http://joinmastodon.org/ns#" + discoverable: "toot:discoverable" + suspended: "toot:suspended" + memorial: "toot:memorial" + indexable: "toot:indexable" properties: - pluralName: preferredUsernames @@ -138,3 +143,37 @@ properties: a link to a JSON-LD document with these properties. range: - "https://www.w3.org/ns/activitystreams#Endpoints" + +- singularName: discoverable + functional: true + uri: "http://joinmastodon.org/ns#discoverable" + description: | + Allows users to opt-in or opt-out of discoverability features like + the profile directory. This flag may also be used as an indicator of + the user's preferences toward being included in external discovery services, + such as search engines or other indexing tools. + range: + - "http://www.w3.org/2001/XMLSchema#boolean" + +- singularName: suspended + functional: true + uri: "http://joinmastodon.org/ns#suspended" + description: | + Reports whether a user was locally suspended, for better handling of + these accounts. + range: + - "http://www.w3.org/2001/XMLSchema#boolean" + +- singularName: memorial + functional: true + uri: "http://joinmastodon.org/ns#memorial" + description: Whether the actor is in-memorial state. + range: + - "http://www.w3.org/2001/XMLSchema#boolean" + +- singularName: indexable + functional: true + uri: "http://joinmastodon.org/ns#indexable" + description: Whether the actor allows to be indexed. + range: + - "http://www.w3.org/2001/XMLSchema#boolean" diff --git a/vocab/organization.yaml b/vocab/organization.yaml index 0f3dff15..15357728 100644 --- a/vocab/organization.yaml +++ b/vocab/organization.yaml @@ -7,6 +7,11 @@ description: Represents an organization. defaultContext: - "https://www.w3.org/ns/activitystreams" - "https://w3id.org/security/v1" +- toot: "http://joinmastodon.org/ns#" + discoverable: "toot:discoverable" + suspended: "toot:suspended" + memorial: "toot:memorial" + indexable: "toot:indexable" properties: - pluralName: preferredUsernames @@ -138,3 +143,37 @@ properties: a link to a JSON-LD document with these properties. range: - "https://www.w3.org/ns/activitystreams#Endpoints" + +- singularName: discoverable + functional: true + uri: "http://joinmastodon.org/ns#discoverable" + description: | + Allows users to opt-in or opt-out of discoverability features like + the profile directory. This flag may also be used as an indicator of + the user's preferences toward being included in external discovery services, + such as search engines or other indexing tools. + range: + - "http://www.w3.org/2001/XMLSchema#boolean" + +- singularName: suspended + functional: true + uri: "http://joinmastodon.org/ns#suspended" + description: | + Reports whether a user was locally suspended, for better handling of + these accounts. + range: + - "http://www.w3.org/2001/XMLSchema#boolean" + +- singularName: memorial + functional: true + uri: "http://joinmastodon.org/ns#memorial" + description: Whether the actor is in-memorial state. + range: + - "http://www.w3.org/2001/XMLSchema#boolean" + +- singularName: indexable + functional: true + uri: "http://joinmastodon.org/ns#indexable" + description: Whether the actor allows to be indexed. + range: + - "http://www.w3.org/2001/XMLSchema#boolean" diff --git a/vocab/person.yaml b/vocab/person.yaml index 5f8e7084..3b20ad9d 100644 --- a/vocab/person.yaml +++ b/vocab/person.yaml @@ -7,6 +7,11 @@ description: Represents an individual person. defaultContext: - "https://www.w3.org/ns/activitystreams" - "https://w3id.org/security/v1" +- toot: "http://joinmastodon.org/ns#" + discoverable: "toot:discoverable" + suspended: "toot:suspended" + memorial: "toot:memorial" + indexable: "toot:indexable" properties: - pluralName: preferredUsernames @@ -138,3 +143,37 @@ properties: a link to a JSON-LD document with these properties. range: - "https://www.w3.org/ns/activitystreams#Endpoints" + +- singularName: discoverable + functional: true + uri: "http://joinmastodon.org/ns#discoverable" + description: | + Allows users to opt-in or opt-out of discoverability features like + the profile directory. This flag may also be used as an indicator of + the user's preferences toward being included in external discovery services, + such as search engines or other indexing tools. + range: + - "http://www.w3.org/2001/XMLSchema#boolean" + +- singularName: suspended + functional: true + uri: "http://joinmastodon.org/ns#suspended" + description: | + Reports whether a user was locally suspended, for better handling of + these accounts. + range: + - "http://www.w3.org/2001/XMLSchema#boolean" + +- singularName: memorial + functional: true + uri: "http://joinmastodon.org/ns#memorial" + description: Whether the actor is in-memorial state. + range: + - "http://www.w3.org/2001/XMLSchema#boolean" + +- singularName: indexable + functional: true + uri: "http://joinmastodon.org/ns#indexable" + description: Whether the actor allows to be indexed. + range: + - "http://www.w3.org/2001/XMLSchema#boolean" diff --git a/vocab/service.yaml b/vocab/service.yaml index 1267d1c4..c3fce7e2 100644 --- a/vocab/service.yaml +++ b/vocab/service.yaml @@ -7,6 +7,11 @@ description: Represents a service of any kind. defaultContext: - "https://www.w3.org/ns/activitystreams" - "https://w3id.org/security/v1" +- toot: "http://joinmastodon.org/ns#" + discoverable: "toot:discoverable" + suspended: "toot:suspended" + memorial: "toot:memorial" + indexable: "toot:indexable" properties: - pluralName: preferredUsernames @@ -138,3 +143,37 @@ properties: a link to a JSON-LD document with these properties. range: - "https://www.w3.org/ns/activitystreams#Endpoints" + +- singularName: discoverable + functional: true + uri: "http://joinmastodon.org/ns#discoverable" + description: | + Allows users to opt-in or opt-out of discoverability features like + the profile directory. This flag may also be used as an indicator of + the user's preferences toward being included in external discovery services, + such as search engines or other indexing tools. + range: + - "http://www.w3.org/2001/XMLSchema#boolean" + +- singularName: suspended + functional: true + uri: "http://joinmastodon.org/ns#suspended" + description: | + Reports whether a user was locally suspended, for better handling of + these accounts. + range: + - "http://www.w3.org/2001/XMLSchema#boolean" + +- singularName: memorial + functional: true + uri: "http://joinmastodon.org/ns#memorial" + description: Whether the actor is in-memorial state. + range: + - "http://www.w3.org/2001/XMLSchema#boolean" + +- singularName: indexable + functional: true + uri: "http://joinmastodon.org/ns#indexable" + description: Whether the actor allows to be indexed. + range: + - "http://www.w3.org/2001/XMLSchema#boolean"