aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--SCHEMA.md37
1 files changed, 20 insertions, 17 deletions
diff --git a/SCHEMA.md b/SCHEMA.md
index 93be830..0e1093f 100644
--- a/SCHEMA.md
+++ b/SCHEMA.md
@@ -12,21 +12,24 @@ In this document:
## Form
-| Field | Type | Description | Example |
-| ------------------- | ----------------------------------------- | ----------------------------------------------------------------------------------------- | ---------------------------------------- |
-| `id` | Unique identifier | A user selected, unique, descriptive identifier (used in URL routes, so no spaces) | `"ban-appeals"` |
-| `features` | List of [form features](#form-features) | A list of features to change the behaviour of the form, described in the features section | `["OPEN", "COLLECT_EMAIL"]` |
-| `questions` | List of [form questions](#form-question) | The list of questions to render on a specific form | Too long! See below |
-| `name` | String | Name of the form | `"Summer Code Jam 2100"` |
-| `description` | String | Form description | `"This is my amazing form description."` |
-| `webhook` | [Webhook object](#webhooks) | An optional discord webhook. | See webhook documentation. |
-| `submitted_text` | Optional[String] | An optional string for the response upon submitting. | `"This is my amazing form response."` |
-| `discord_role` | String (optional) | Discord role ID what will be assigned, required when `ASSIGN_ROLE` flag provided. | `784467518298259466` |
+| Field | Type | Description | Example |
+|--------------------|------------------------------------------|------------------------------------------------------------------------------------------------------------------|------------------------------------------------|
+| `id` | Unique identifier | A user selected, unique, descriptive identifier (used in URL routes, so no spaces) | `"ban-appeals"` |
+| `features` | List of [form features](#form-features) | A list of features to change the behaviour of the form, described in the features section | `["OPEN", "COLLECT_EMAIL"]` |
+| `questions` | List of [form questions](#form-question) | The list of questions to render on a specific form | Too long! See below |
+| `name` | String | Name of the form | `"Summer Code Jam 2100"` |
+| `description` | String | Form description | `"This is my amazing form description."` |
+| `webhook` | [Webhook object](#webhooks) | An optional discord webhook. | See webhook documentation. |
+| `submitted_text` | Optional[String] | An optional string for the response upon submitting. | `"This is my amazing form response."` |
+| `discord_role` | String (optional) | Discord role ID what will be assigned, required when `ASSIGN_ROLE` flag provided. | `784467518298259466` |
+| `response_readers` | List[String] | Discord roles which can view the responses of the form. Can not be the everyone role. | `["267629731250176001", "825337057181696020"]` |
+| `editors` | List[String] | Discord roles which have permission to edit, delete, or otherwise modify the form. Can not be the everyone role. | `["409416496733880320"]` |
+
### Form features
| Flag | Description |
-| ------------------ | ----------------------------------------------------------------------------- |
+|--------------------|-------------------------------------------------------------------------------|
| `DISCOVERABLE` | The form should be displayed on the homepage of the forms application. |
| `REQUIRES_LOGIN` | Requires the user to authenticate with Discord before completing the form. |
| `OPEN` | The form is currently accepting responses. |
@@ -39,7 +42,7 @@ In this document:
Discord webhooks to send information upon form submission.
| Field | Type | Description |
-| ----------| ------ | --------------------------------------------------------------------------------------------------------- |
+|-----------|--------|-----------------------------------------------------------------------------------------------------------|
| `url` | String | Discord webhook URL. |
| `message` | String | An optional message to include before the embed. Can use certain [context variables](#webhook-variables). |
@@ -48,7 +51,7 @@ Discord webhooks to send information upon form submission.
The following variables can be used in a webhook's message. The variables must be wrapped by braces (`{}`).
| Name | Description |
-| ------------- | ---------------------------------------------------------------------------- |
+|---------------|------------------------------------------------------------------------------|
| `user` | A discord mention of the user submitting the form, or "User" if unavailable. |
| `response_id` | ID of the submitted response. |
| `form` | Name of the submitted form. |
@@ -59,7 +62,7 @@ The following variables can be used in a webhook's message. The variables must b
### Form question
| Field | Type | Description | Example |
-| ---------- | ---------------------------------------- | ------------------------------------------------ | -------------------- |
+|------------|------------------------------------------|--------------------------------------------------|----------------------|
| `id` | string | Unique identifier of the question | `"aabbcc"` |
| `name` | string | Name of the question | `"What's the time?"` |
| `type` | one of [Question types](#question-types) | The type of input for this question | `"radio"` |
@@ -69,7 +72,7 @@ The following variables can be used in a webhook's message. The variables must b
#### Question types
| Name | Description |
-| ------------ | --------------------------------------------------------- |
+|--------------|-----------------------------------------------------------|
| `radio` | Radio buttons |
| `checkbox` | Checkbox toggle |
| `select` | Dropdown list |
@@ -165,7 +168,7 @@ Textareas require no additional configuration.
## Form response
| Field | Type | Description |
-| ----------- | ---------------------------------------------------- | --------------------------------------------------------------------------- |
+|-------------|------------------------------------------------------|-----------------------------------------------------------------------------|
| `_id`/`id` | MongoDB ObjectID | Random identifier used for the response |
| `user` | Optional [user details object](#user-details-object) | An object describing the user that submitted if the form is not anonymous |
| `antispam` | Optional [anti spam object](#anti-spam-object) | An object containing information about the anti-spam on the form submission |
@@ -197,7 +200,7 @@ The user details contains the information returned by Discord alongside an `admi
The anti-spam object contains information about the source of the form submission.
| Field | Type | Description |
-| ----------------- | ------- | ----------------------------------------------- |
+|-------------------|---------|-------------------------------------------------|
| `ip_hash` | String | hash of the submitting users IP address |
| `user_agent_hash` | String | hash of the submitting users user agent |
| `captcha_pass` | Boolean | Whether the user passsed the hCaptcha |