-
Notifications
You must be signed in to change notification settings - Fork 0
feat(nip-25): add reaction schemas #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e2017a7
7d1e5e6
47179fe
b5c524e
ee947dc
02e182e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| allOf: | ||
| - $ref: "nips/nip-25/tag/emoji/schema.yaml" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| allOf: | ||
| - $ref: "nips/nip-73/tag/i/schema.yaml" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| allOf: | ||
| - $ref: "nips/nip-73/tag/k/schema.yaml" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| allOf: | ||
| - $ref: "nips/nip-25/tag/e-react/schema.yaml" | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,37 @@ | ||||||||||||||||||||||||||
| $schema: http://json-schema.org/draft-07/schema# | ||||||||||||||||||||||||||
| title: kind17 | ||||||||||||||||||||||||||
| description: Reaction event referencing external content (NIP-25 + NIP-73) | ||||||||||||||||||||||||||
| allOf: | ||||||||||||||||||||||||||
| - $ref: "@/note.yaml" | ||||||||||||||||||||||||||
| - type: object | ||||||||||||||||||||||||||
| properties: | ||||||||||||||||||||||||||
| kind: | ||||||||||||||||||||||||||
| const: 17 | ||||||||||||||||||||||||||
| content: | ||||||||||||||||||||||||||
| type: string | ||||||||||||||||||||||||||
| description: Reaction marker such as "+", "-", or an emoji | ||||||||||||||||||||||||||
| tags: | ||||||||||||||||||||||||||
| type: array | ||||||||||||||||||||||||||
| minItems: 1 | ||||||||||||||||||||||||||
| items: | ||||||||||||||||||||||||||
| allOf: | ||||||||||||||||||||||||||
| - $ref: "@/tag.yaml" | ||||||||||||||||||||||||||
| - if: | ||||||||||||||||||||||||||
| type: array | ||||||||||||||||||||||||||
| minItems: 1 | ||||||||||||||||||||||||||
| items: | ||||||||||||||||||||||||||
| - const: "emoji" | ||||||||||||||||||||||||||
| then: | ||||||||||||||||||||||||||
| $ref: "@/tag/emoji.yaml" | ||||||||||||||||||||||||||
| allOf: | ||||||||||||||||||||||||||
| - contains: | ||||||||||||||||||||||||||
| $ref: "@/tag/external-content-k.yaml" | ||||||||||||||||||||||||||
| errorMessage: | ||||||||||||||||||||||||||
| contains: "tags must include at least one k tag describing the external content type" | ||||||||||||||||||||||||||
| - contains: | ||||||||||||||||||||||||||
| $ref: "@/tag/external-content-i.yaml" | ||||||||||||||||||||||||||
| errorMessage: | ||||||||||||||||||||||||||
| contains: "tags must include at least one i tag referencing the external content" | ||||||||||||||||||||||||||
|
Comment on lines
+29
to
+34
|
||||||||||||||||||||||||||
| errorMessage: | |
| contains: "tags must include at least one k tag describing the external content type" | |
| - contains: | |
| $ref: "@/tag/external-content-i.yaml" | |
| errorMessage: | |
| contains: "tags must include at least one i tag referencing the external content" | |
| - contains: | |
| $ref: "@/tag/external-content-i.yaml" | |
| errorMessage: | |
| allOf: | |
| - "tags must include at least one k tag describing the external content type" | |
| - "tags must include at least one i tag referencing the external content" |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,42 @@ | ||||||||||||||||||||||
| $schema: http://json-schema.org/draft-07/schema# | ||||||||||||||||||||||
| title: kind7 | ||||||||||||||||||||||
| description: Reaction event referencing a nostr event (NIP-25) | ||||||||||||||||||||||
| allOf: | ||||||||||||||||||||||
| - $ref: "@/note.yaml" | ||||||||||||||||||||||
| - type: object | ||||||||||||||||||||||
| properties: | ||||||||||||||||||||||
| kind: | ||||||||||||||||||||||
| const: 7 | ||||||||||||||||||||||
| content: | ||||||||||||||||||||||
| type: string | ||||||||||||||||||||||
| description: "Reaction marker such as '+', '-', an emoji, or a custom :shortcode:" | ||||||||||||||||||||||
| tags: | ||||||||||||||||||||||
| type: array | ||||||||||||||||||||||
| minItems: 1 | ||||||||||||||||||||||
| items: | ||||||||||||||||||||||
| allOf: | ||||||||||||||||||||||
| - $ref: "@/tag.yaml" | ||||||||||||||||||||||
| - if: | ||||||||||||||||||||||
| type: array | ||||||||||||||||||||||
| minItems: 1 | ||||||||||||||||||||||
| items: | ||||||||||||||||||||||
| - const: "emoji" | ||||||||||||||||||||||
| then: | ||||||||||||||||||||||
| $ref: "@/tag/emoji.yaml" | ||||||||||||||||||||||
| contains: | ||||||||||||||||||||||
| $ref: "@/tag/reaction-e.yaml" | ||||||||||||||||||||||
| allOf: | ||||||||||||||||||||||
| - if: | ||||||||||||||||||||||
| contains: | ||||||||||||||||||||||
| type: array | ||||||||||||||||||||||
| minItems: 1 | ||||||||||||||||||||||
| items: | ||||||||||||||||||||||
| - const: "emoji" | ||||||||||||||||||||||
| then: | ||||||||||||||||||||||
| contains: | ||||||||||||||||||||||
| $ref: "@/tag/emoji.yaml" | ||||||||||||||||||||||
|
Comment on lines
+28
to
+37
|
||||||||||||||||||||||
| allOf: | |
| - if: | |
| contains: | |
| type: array | |
| minItems: 1 | |
| items: | |
| - const: "emoji" | |
| then: | |
| contains: | |
| $ref: "@/tag/emoji.yaml" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| $schema: "http://json-schema.org/draft-07/schema#" | ||
| title: reactionETag | ||
| description: Event reference tag for reaction events (NIP-25) | ||
| allOf: | ||
| - $ref: "@/tag.yaml" | ||
| - type: array | ||
| minItems: 2 | ||
| items: | ||
| - const: "e" | ||
| - type: string | ||
| pattern: '^[a-f0-9]{64}$' | ||
| additionalItems: | ||
| anyOf: | ||
| - type: string | ||
| pattern: '^(ws://|wss://).+$' | ||
| - $ref: "@/secp256k1.yaml" | ||
| - type: string | ||
| minLength: 1 | ||
| errorMessage: | ||
| minItems: "e tag must include the event id" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| $schema: "http://json-schema.org/draft-07/schema#" | ||
| title: emojiTag | ||
| description: Custom emoji resource reference for reactions (NIP-25 / NIP-30) | ||
| allOf: | ||
| - $ref: "@/tag.yaml" | ||
| - type: array | ||
| minItems: 3 | ||
| maxItems: 3 | ||
| items: | ||
| - const: "emoji" | ||
| - type: string | ||
| minLength: 1 | ||
| pattern: "^[0-9A-Za-z_:+-]+$" | ||
| description: Shortcode identifying the emoji without surrounding colons | ||
| - type: string | ||
| pattern: "^https?://.+" | ||
| description: HTTPS URL pointing to the emoji image | ||
| errorMessage: | ||
| minItems: "emoji tag must contain ['emoji', <shortcode>, <https url>]" | ||
| maxItems: "emoji tag must contain ['emoji', <shortcode>, <https url>]" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| $schema: "http://json-schema.org/draft-07/schema#" | ||
| title: externalContentIdentifierTag | ||
| description: External content identifier tag (NIP-73) | ||
| allOf: | ||
| - $ref: "@/tag.yaml" | ||
| - type: array | ||
| minItems: 2 | ||
| maxItems: 3 | ||
| items: | ||
| - const: "i" | ||
| - type: string | ||
| minLength: 1 | ||
| description: Identifier or URI for the external resource | ||
| - type: string | ||
| pattern: "^https?://.+" | ||
| description: Optional URL pointing to the external resource | ||
| errorMessage: | ||
| minItems: "i tag must be ['i', <identifier>, ...]" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| $schema: "http://json-schema.org/draft-07/schema#" | ||
| title: externalContentTypeTag | ||
| description: External content type identifier tag (NIP-73) | ||
| allOf: | ||
| - $ref: "@/tag.yaml" | ||
| - type: array | ||
| minItems: 2 | ||
| maxItems: 3 | ||
| items: | ||
| - const: "k" | ||
| - type: string | ||
| minLength: 1 | ||
| pattern: "^[A-Za-z0-9][A-Za-z0-9._+-]*(?::[A-Za-z0-9][A-Za-z0-9._+-]*)*$" | ||
| description: Type identifier for the external resource | ||
| - type: string | ||
| minLength: 1 | ||
| description: Optional subtype or hint for the external resource | ||
| errorMessage: | ||
| minItems: "k tag must be ['k', <type>, ...]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the trailing space after the colon on line 1.