Expand description

This module contains types and functions for handling ActivityPub and Activity Streams 2.0 objects. Everything here centers around Object, so I would suggest starting there.

ActivityPub and Activity Streams 2.0 are available under the W3C document license, which requires the full text of the following notice to be viewable in derivative works, so here it is:

W3C Software and Document Notice and License

This work is being provided by the copyright holders under the following license.

License

By obtaining and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.

Permission to copy, modify, and distribute this work, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the work or portions thereof, including modifications:

  • The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
  • Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software and Document Short Notice should be included.
  • Notice of any changes or modifications, through a copyright statement on the new code or document such as “This software or document includes material copied from or derived from [title and URI of the W3C document]. Copyright © [YEAR] W3C® (MIT, ERCIM, Keio, Beihang).”

Disclaimers

THIS WORK IS PROVIDED “AS IS,” AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENT WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.

COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENT.

The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the work without specific, written prior permission. Title to copyright in this work will at all times remain with copyright holders.

Notes

This version: http://www.w3.org/Consortium/Legal/2015/copyright-software-and-document

Previous version: http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231

This version makes clear that the license is applicable to both software and text, by changing the name and substituting “work” for instances of “software and its documentation.” It moves “notice of changes or modifications to the files” to the copyright notice, to make clear that the license is compatible with other liberal licenses.

Modules

Saves ActivityPub objects into the database or sends them to remote servers.
Delivers activities to inboxes asynchronously.

Macros

Convenience macro for defining functions that return a string wrapped in the necessary types to fit the Object::type_ field.

Structs

ActivityPub-defined endpoints-structure for Actors. See the “endpoints” field under 4.1 Actor objects.
A serialization-wise transparent struct for holding date times, just to specify that it should serialize and deserialize to and from RFC 3339 dates.
A general struct describing any* Activity Streams 2.0 object. See also: Activity Vocabulary.

Enums

One or more Links.
Either an Object or a Link which should refer to a (possibly remote) Object.

Functions

Convenience function for creating the string "https://www.w3.org/ns/activitystreams" wrapped in the necessary types for the context field of an Object.
Returns the string "CollectionPage" wrapped by define_link.
Returns the string "Create" wrapped by define_link.
Returns the string "OrderedCollection" wrapped by define_link.
Returns the string "Person" wrapped by define_link.

Type Definitions

A string containing any URI.
A string that is written in the language of the context, which may not be defined. See 4.7 Natural Language Values in the Activity Streams 2.0 spec for more info.
A map of translated strings, each one translated to the language indicated in the key. See 4.7 Natural Language Values in the Activity Streams 2.0 spec for more info.
A string representing a resource or other relevant information. These can be URLs, but sometimes just specific strings as defined in the Activity Vocabulary, such as “Follow” (which refers to the Follow activity).
A string used as the type for Object properties that do not have further meaning aside from just being a string as far as these types go.