Clean up feeds spec

This commit is contained in:
Jon Staab 2024-05-17 08:45:08 -07:00
parent a9455fd4ff
commit 9217b33aa2

42
xx.md
View File

@ -34,7 +34,7 @@ A `author` feed includes one or more pubkeys to use in an `authors` filter.
["author", "d97a7541e4603d393c61eaad810c2e2e72684fb5672bde962c75c023d70e763f"] ["author", "d97a7541e4603d393c61eaad810c2e2e72684fb5672bde962c75c023d70e763f"]
``` ```
## CreatedAt ## Created At
A `created_at` feed includes one or more objects describing date ranges for events to fetch. A `created_at` feed includes one or more objects describing date ranges for events to fetch.
These MAY include values `since`, `until`, and `relative`, which may be a list containing These MAY include values `since`, `until`, and `relative`, which may be a list containing
@ -44,7 +44,7 @@ If included in the `relative` list, `since` and `until` values MUST be interpret
`seconds before now`. Negative numbers MUST be interpreted as `seconds after now`. `seconds before now`. Negative numbers MUST be interpreted as `seconds after now`.
```json ```json
["created_at", {"since": 1715293673, "until": 86400, "relative": ["since"]}] ["created_at", {"since": 1715293673, "until": 86400, "relative": ["until"]}]
``` ```
## DVM ## DVM
@ -52,7 +52,7 @@ If included in the `relative` list, `since` and `until` values MUST be interpret
A `dvm` feed includes one or more objects describing a DVM request. Each object MUST A `dvm` feed includes one or more objects describing a DVM request. Each object MUST
have a request `kind`, and MAY have a list of request `tags`, `relays` to send the have a request `kind`, and MAY have a list of request `tags`, `relays` to send the
request to, and a list of `mappings` mapping response tags to feeds. If omitted, request to, and a list of `mappings` mapping response tags to feeds. If omitted,
applications SHOULD provide a resonable set of default `mappings`. applications SHOULD provide a reasonable set of default `mappings`.
```json ```json
[ [
@ -67,17 +67,25 @@ applications SHOULD provide a resonable set of default `mappings`.
## ID ## ID
A `id` feed A `id` feed includes one or more ids of events to fetch.
```json
["id", "b1ee83587c4ebab697719fd5bad22319741134e49933b0528b8cca426cafd59e"]
```
## Kind ## Kind
A `kind` feed A `kind` feed includes one or more kinds of events to fetch.
```json
["kind", 1, 30023]
```
## List ## List
A `dvm` feed includes one or more objects defining one or more `addresses` and a set of A `list` feed includes one or more objects defining one or more `addresses` and optional
`mappings` for how to translate list tags into feeds. If omitted, `mappings` for how to translate list tags into feeds. If omitted, applications SHOULD
applications SHOULD provide a resonable set of default `mappings`. provide a reasonable set of default `mappings`.
```json ```json
[ [
@ -94,7 +102,7 @@ applications SHOULD provide a resonable set of default `mappings`.
A `wot` feed includes one or more objects with optional `min` and `max` properties. These A `wot` feed includes one or more objects with optional `min` and `max` properties. These
MUST be between 0 and 1 (inclusive) so that the interpeting application can scale the filter MUST be between 0 and 1 (inclusive) so that the interpeting application can scale the filter
to their own web of trust's score range. If empty, `min` MUST be interpreted as `0`, and to their own web of trust's score range. If empty, `min` MUST be interpreted as `0`, and
`max` as 1. `max` as `1`.
```json ```json
["wot", {"min": 0.3}] ["wot", {"min": 0.3}]
@ -143,7 +151,7 @@ as standard tag filters.
## Union ## Union
A `union` feed includes two or more feeds. An event may match any feed to match the parent feed. A `union` feed includes zero or more feeds. An event may match any feed to match the parent feed.
Example: Example:
@ -157,7 +165,7 @@ Example:
## Intersection ## Intersection
An `intersection` feed includes two or more feeds. An event must match all given feeds to An `intersection` feed includes zero or more feeds. An event must match all given feeds to
match the parent feed. match the parent feed.
Example: Example:
@ -172,7 +180,7 @@ Example:
## Difference ## Difference
A `difference` feed includes a base feed to fetch, and one or more feeds used to exclude A `difference` feed MAY include a base feed to fetch, and zero or more feeds used to exclude
events from the base feed. events from the base feed.
Example: Example:
@ -194,8 +202,8 @@ Example:
## Symmetric Difference ## Symmetric Difference
A `symmetric_difference` feed includes two or more feeds. An event must match only one feed to match A `symmetric_difference` feed includes zero or more feeds. An event must match only one feed to match
the parent feed. the base feed.
Example: Example:
@ -221,6 +229,12 @@ Example:
] ]
``` ```
# Implementation notes
If a `union`, `difference`, `intersection`, or `symmetric_difference` feed has no entries, it should
be treated as an empty feed. Likewise with other feed types that have no arguments; for example
`["authors"]` should be interprete the same way as a `{"authors": []}` filter.
# Feed Event # Feed Event
A `kind:31890` event defines a feed in an addressable way. The `content` SHOULD be a human- A `kind:31890` event defines a feed in an addressable way. The `content` SHOULD be a human-