Skip to content

Commit

Permalink
switch ext ids
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdickinson committed Sep 30, 2024
1 parent 467fe6a commit 7c033e6
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
- name: update the schema
run: |
body="$(jq -rcM -n --arg content "$(cat plugin.yaml)" '{"name":"events", "schema": $content}')"
EXTENSION_ID=ext_01j24z4yc2emetf0hysrnyg41j
EXTENSION_ID=ext_01j8r4jqawfd6tjxh85t3988kc
curl -sLfi \
-H "Authorization: Bearer $XTP_TOKEN" \
-H "content-type: application/json" \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: test the schema
run: |
body="$(jq -rcM -n --arg content "$(cat plugin.yaml)" '{"name":"events_test", "schema": $content}')"
EXTENSION_ID=ext_01j24zpza4e63rzkz1pya80ey7
EXTENSION_ID=ext_01j8t7m4s6e0trqftejwvh1je5
curl -sLfi \
-H "Authorization: Bearer $XTP_TOKEN" \
-H "content-type: application/json" \
Expand Down
67 changes: 30 additions & 37 deletions plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,41 @@ version: v1-draft
exports:
handle:
input:
"$ref": "#/components/schemas/IncomingEvent"
$ref: "#/components/schemas/IncomingEvent"
contentType: application/json

imports:
react:
input:
"$ref": "#/components/schemas/OutgoingReaction"
$ref: "#/components/schemas/OutgoingReaction"
contentType: application/json
output:
"$ref": "#/components/schemas/Result"
$ref: "#/components/schemas/Result"
contentType: application/json

request:
input:
"$ref": "#/components/schemas/OutgoingRequest"
$ref: "#/components/schemas/OutgoingRequest"
contentType: application/json
output:
"$ref": "#/components/schemas/Result"
$ref: "#/components/schemas/Result"
contentType: application/json

sendMessage:
input:
"$ref": "#/components/schemas/OutgoingMessage"
$ref: "#/components/schemas/OutgoingMessage"
contentType: application/json
output:
"$ref": "#/components/schemas/Result"
$ref: "#/components/schemas/Result"
contentType: application/json

watchMessage:
input:
type: string
description: The ID of a message to watch
description: the id of a message to watch
contentType: text/plain; charset=utf-8
output:
"$ref": "#/components/schemas/Result"
$ref: "#/components/schemas/Result"
contentType: application/json

components:
Expand All @@ -52,15 +52,14 @@ components:
kind:
type: string
description: The reason for the event

message:
"$ref": '#/components/schemas/IncomingMessage'
nullable: true
$ref: '#/components/schemas/IncomingMessage'
reaction:
"$ref": '#/components/schemas/IncomingReaction'
nullable: true
response:
"$ref": '#/components/schemas/IncomingResponse'
nullable: true
$ref: '#/components/schemas/IncomingReaction'
response:
$ref: '#/components/schemas/IncomingResponse'

channel:
type: string
description: The channel the message was received in
Expand All @@ -69,27 +68,24 @@ components:
description: An HTTP request
properties:
method:
description: the http method
type: string
description: The HTTP method
nullable: true
url:
description: the url
type: string
description: The URL
headers:
description: the http headers
type: object
description: The HTTP headers
nullable: true
body:
description: the http body
type: string
description: The HTTP body
nullable: true

OutgoingReaction:
description: Send a reaction
description: send a reaction
properties:
messageId:
type: string
description: The message ID
description: the message id
with:
type: string
description: The emoji reaction
Expand All @@ -99,22 +95,22 @@ components:
properties:
id:
type: string
description: The identifier the plugin sent
description: the identifier the plugin sent
status:
description: the http status code
type: number
description: The HTTP status code
headers:
description: the http headers
type: object
description: The HTTP headers
body:
description: the http body
type: string
description: The HTTP body

IncomingReaction:
description: A reaction happened
properties:
message:
"$ref": '#/components/schemas/IncomingMessage'
$ref: '#/components/schemas/IncomingMessage'
from:
type: string
description: The username that reacted
Expand All @@ -127,7 +123,7 @@ components:
properties:
id:
type: string
description: An ID identifying the message
description: An id identifying the message.
content:
type: string
description: The message text
Expand All @@ -136,8 +132,7 @@ components:
description: The author of the message
reference:
type: string
description: The ID of the message to which this message replies
nullable: true
description: The id of the message to which this message replies

OutgoingMessage:
description: An outgoing message
Expand All @@ -148,18 +143,16 @@ components:
channel:
type: string
description: The channel the message was received in
nullable: true
reply:
type: string
description: A message ID to reply to
nullable: true

Result:
description: A result
description: A result.
properties:
id:
type: string
description: An ID for the result
description: An id for the result
errorCode:
type: number
description: |
Expand Down

0 comments on commit 7c033e6

Please sign in to comment.