Skip to content

Commit

Permalink
Deploying to gh-pages from @ 5de2c2a 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
violog committed Jul 5, 2024
1 parent 5e6a56d commit ace0e81
Show file tree
Hide file tree
Showing 2 changed files with 281 additions and 98 deletions.
225 changes: 165 additions & 60 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@
"/integrations/geo-points-svc/v1/public/event_types": {
"get": {
"tags": [
"Events"
"Event types"
],
"summary": "List event types",
"description": "Returns public configuration of all event types.\nBasically, it is event static metadata (model `EventStaticMeta`)\nfor each event type in the system.\n",
Expand Down Expand Up @@ -463,6 +463,156 @@
"$ref": "#/components/responses/internalError"
}
}
},
"post": {
"tags": [
"Event types"
],
"summary": "Create event type",
"description": "Creates a new event type. Requires **admin** role in JWT.\nThe type must not be present in the system.\n",
"operationId": "createEventType",
"requestBody": {
"required": true,
"content": {
"application/vnd.api+json": {
"schema": {
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/EventType"
}
}
}
}
}
},
"responses": {
"204": {
"description": "No content"
},
"400": {
"$ref": "#/components/responses/invalidParameter"
},
"401": {
"$ref": "#/components/responses/invalidAuth"
},
"409": {
"description": "Event type already exists",
"content": {
"application/vnd.api+json": {
"schema": {
"$ref": "#/components/schemas/Errors"
}
}
}
},
"500": {
"$ref": "#/components/responses/internalError"
}
}
}
},
"/integrations/geo-points-svc/v1/public/event_types/{name}": {
"get": {
"tags": [
"Event types"
],
"summary": "Get event type",
"description": "Returns public configuration of event type by its unique name",
"operationId": "getEventType",
"responses": {
"200": {
"description": "Success",
"content": {
"application/vnd.api+json": {
"schema": {
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/EventType"
}
}
}
}
}
}
},
"404": {
"$ref": "#/components/responses/notFound"
},
"500": {
"$ref": "#/components/responses/internalError"
}
}
},
"patch": {
"tags": [
"Event types"
],
"summary": "Update event type",
"description": "Update an existing event type. Requires **admin** role in JWT.\n**All attributes** are updated, ensure to pass every existing field too.\nAlthough this is not JSON:API compliant, it is much easier to work with\nin Go, because differentiating between `{}` and `{\"field\": null}`\nrequires custom unmarshalling implementation.\n",
"operationId": "updateEventType",
"requestBody": {
"required": true,
"content": {
"application/vnd.api+json": {
"schema": {
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/EventType"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/vnd.api+json": {
"schema": {
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/EventType"
}
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/invalidParameter"
},
"401": {
"$ref": "#/components/responses/invalidAuth"
},
"404": {
"$ref": "#/components/responses/notFound"
},
"500": {
"$ref": "#/components/responses/internalError"
}
}
}
},
"/integrations/geo-points-svc/v1/public/events": {
Expand Down Expand Up @@ -1188,15 +1338,17 @@
},
"EventStaticMeta": {
"type": "object",
"description": "Primary event metadata in plain JSON. This is a template\nto be filled by `dynamic` when it's present.\n",
"description": "Primary event metadata in plain JSON. This is a template\nto be filled by `dynamic` when it's present.\n\nThis structure is also reused as request body to event type creation and update.\n",
"required": [
"name",
"reward",
"title",
"description",
"short_description",
"frequency",
"flag"
"flag",
"auto_claim",
"disabled"
],
"properties": {
"name": {
Expand Down Expand Up @@ -1256,14 +1408,22 @@
},
"flag": {
"type": "string",
"description": "Event configuration flag:\n - active: Events can be opened, fulfilled, claimed\n - not_started: Event are not available yet, see `starts_at`\n - expired: Event is not available, as it has already expired, see `expires_at`\n - disabled: Event is disabled in the system\n\nIf event is disabled, it doesn't matter if it's expired or not started:\nit has `disabled` flag.\n",
"description": "Event configuration flag:\n - active: Events can be opened, fulfilled, claimed\n - not_started: Event are not available yet, see `starts_at`\n - expired: Event is not available, as it has already expired, see `expires_at`\n - disabled: Event is disabled in the system\n\nIf event is disabled, it doesn't matter if it's expired or not started:\nit has `disabled` flag.\n\nDo not specify this field on creation: this structure is reused for request body too.\n",
"enum": [
"active",
"not_started",
"expired",
"disabled"
]
},
"auto_claim": {
"type": "boolean",
"description": "Whether the event is automatically claimed on fulfillment, or requires manual claim"
},
"disabled": {
"type": "boolean",
"description": "Whether the event is disabled in the system. Disabled events can only be retrieved."
},
"qr_code_value": {
"type": "string",
"description": "Base64-encoded QR code. Must match the code provided in event type.",
Expand Down Expand Up @@ -1361,55 +1521,6 @@
}
}
},
"JoinProgram": {
"allOf": [
{
"$ref": "#/components/schemas/JoinProgramKey"
},
{
"type": "object",
"x-go-is-request": true,
"required": [
"attributes"
],
"properties": {
"attributes": {
"type": "object",
"required": [
"country"
],
"properties": {
"country": {
"type": "string",
"example": "5589842"
}
}
}
}
}
]
},
"JoinProgramKey": {
"type": "object",
"required": [
"id",
"type"
],
"properties": {
"id": {
"type": "string",
"description": "Nullifier of the points owner",
"example": "0x123...abc",
"pattern": "^0x[0-9a-fA-F]{64}$"
},
"type": {
"type": "string",
"enum": [
"join_program"
]
}
}
},
"VerifyPassport": {
"allOf": [
{
Expand All @@ -1424,8 +1535,7 @@
"properties": {
"attributes": {
"required": [
"anonymous_id",
"country"
"anonymous_id"
],
"type": "object",
"properties": {
Expand All @@ -1434,11 +1544,6 @@
"description": "Unique identifier of the passport.",
"example": "2bd3a2532096fee10a45a40e444a11b4d00a707f3459376087747de05996fbf5"
},
"country": {
"type": "string",
"description": "ISO 3166-1 alpha-3 country code, must match the one provided in `proof`.\n",
"example": "UKR"
},
"proof": {
"type": "object",
"format": "types.ZKProof",
Expand Down
Loading

0 comments on commit ace0e81

Please sign in to comment.