format(all): json formatting

This commit is contained in:
kehiy
2024-09-03 20:41:31 +03:30
parent b4a2561df7
commit e6552476aa
36 changed files with 206 additions and 194 deletions

28
29.md
View File

@@ -42,14 +42,14 @@ Relays should prevent late publication (messages published now with a timestamp
This is the basic unit of a "microblog" root text note sent to a group.
```js
```jsonc
"kind": 11,
"content": "hello my friends lovers of pizza",
"tags": [
["h", "<group-id>"],
["previous", "<event-id-first-chars>", "<event-id-first-chars>", ...]
["previous", "<event-id-first-chars>", "<event-id-first-chars>", /*...*/]
]
...
// other fields...
```
- *threaded text reply* (`kind:12`)
@@ -63,14 +63,14 @@ This is the basic unit of a "microblog" reply note sent to a group. It's the sam
This is the basic unit of a _chat message_ sent to a group.
```js
```jsonc
"kind": 9,
"content": "hello my friends lovers of pizza",
"tags": [
["h", "<group-id>"],
["previous", "<event-id-first-chars>", "<event-id-first-chars>", ...]
["previous", "<event-id-first-chars>", "<event-id-first-chars>", /*...*/]
]
...
// other fields...
```
- *chat message threaded reply* (`kind:10`)
@@ -83,7 +83,7 @@ Similar to `kind:12`, this is the basic unit of a chat message sent to a group.
Any user can send one of these events to the relay in order to be automatically or manually added to the group. If the group is `open` the relay will automatically issue a `kind:9000` in response adding this user. Otherwise group admins may choose to query for these requests and act upon them.
```js
```json
{
"kind": 9021,
"content": "optional reason",
@@ -97,7 +97,7 @@ Any user can send one of these events to the relay in order to be automatically
Any user can send one of these events to the relay in order to be automatically removed from the group. The relay will automatically issue a `kind:9001` in response removing this user.
```js
```json
{
"kind": 9022,
"content": "optional reason",
@@ -111,13 +111,13 @@ Any user can send one of these events to the relay in order to be automatically
Clients can send these events to a relay in order to accomplish a moderation action. Relays must check if the pubkey sending the event is capable of performing the given action. The relay may discard the event after taking action or keep it as a moderation log.
```js
```json
{
"kind": 90xx,
"content": "optional reason",
"tags": [
["h", "<group-id>"],
["previous", ...]
["previous", /*...*/]
]
}
```
@@ -142,7 +142,7 @@ This event defines the metadata for the group -- basically how clients should di
If the group is forked and hosted in multiple relays, there will be multiple versions of this event in each different relay and so on.
```js
```jsonc
{
"kind": 39000,
"content": "",
@@ -154,7 +154,7 @@ If the group is forked and hosted in multiple relays, there will be multiple ver
["public"], // or ["private"]
["open"] // or ["closed"]
]
...
// other fields...
}
```
@@ -177,7 +177,7 @@ The list of capabilities, as defined by this NIP, for now, is the following:
- `edit-group-status`
- `delete-group`
```js
```json
{
"kind": 39001,
"content": "list of admins for the pizza lovers group",
@@ -186,7 +186,7 @@ The list of capabilities, as defined by this NIP, for now, is the following:
["p", "<pubkey1-as-hex>", "ceo", "add-user", "edit-metadata", "delete-event", "remove-user"],
["p", "<pubkey2-as-hex>", "secretary", "add-user", "delete-event"]
]
...
// other fields...
}
```