Skip to content

Commit

Permalink
beautify presenter docs (#2732)
Browse files Browse the repository at this point in the history
Improving js syntax
Adding js highlighting
Deleting deleted presenters
Specifying required and optional parameters
  • Loading branch information
hjanott authored Nov 25, 2024
1 parent cf020c4 commit dec9a05
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 123 deletions.
4 changes: 2 additions & 2 deletions docs/migration_route.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ enum MigrationState {
"success": true,
"status"?: MigrationState,
"output"?: str,
"exception"?: str,
"exception"?: str
}
```
`output` always contains the full output of the migration command up to this point. `exception` contains the thrown exception, if any, which can only be the case if the command is finished (meaning `status != "migration_running"`). After issuing a migration command, it is waited a short period of time for the thread to finish, so the status can be all of these things for any command (e.g. after calling `migrate`, the returned status can be either `MIGRATION_RUNNING` if the migrations did not finish directly or `FINALIZATION_REQUIRED` if the migration is already done).
Expand All @@ -41,7 +41,7 @@ The `stats` return value is the following:
"positions": int,
"events": int,
"partially_migrated_positions": int,
"fully_migrated_positions": int,
"fully_migrated_positions": int
}
}
```
Expand Down
12 changes: 6 additions & 6 deletions docs/presenters/check_database.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# Payload
```
```js
{
// optional
meeting_id: integer;
meeting_id: integer
}
```

# Returns
If okay:
```
```js
{
ok: boolean,
ok: boolean
}
```
else:
```
```js
{
ok: boolean,
errors: string,
errors: string
}
```

Expand Down
10 changes: 5 additions & 5 deletions docs/presenters/check_database_all.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Payload
```
```js
{
}
```

# Returns
If okay:
```
```js
{
ok: boolean,
ok: boolean
}
```
else:
```
```js
{
ok: boolean,
errors: string,
errors: string
}
```

Expand Down
4 changes: 2 additions & 2 deletions docs/presenters/export_meeting.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Payload

```
```js
{
meeting_id: Id
meeting_id: Id // required
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/presenters/get_active_users_amount.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Nothing

```js
{
active_users_amount: Number;
active_users_amount: Number
}
```

Expand Down
6 changes: 3 additions & 3 deletions docs/presenters/get_forwarding_committees.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Payload

```
```js
{
meeting_id: Id
meeting_id: Id // required
}
```

# Returns

```
```js
string[]
```

Expand Down
12 changes: 6 additions & 6 deletions docs/presenters/get_forwarding_meetings.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Payload

```
```js
{
meeting_id: Id
meeting_id: Id // required
}
```

# Returns

```
```js
[
{
id: Id
name: string
default_meeting_id: Id
id: Id,
name: string,
default_meeting_id: Id,
meeting: [{id: Id, name: string, start_time:timestamp|null, end_time:timestamp|null}, ...]
},
...
Expand Down
18 changes: 9 additions & 9 deletions docs/presenters/get_mediafile_context.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

```js
{
mediafile_ids: Id[];
mediafile_ids: Id[] // required
}
```

Expand All @@ -15,16 +15,16 @@
published: boolean,
meetings_of_interest: {
[meeting_id: Id]: {
name: string;
holds_attachments: boolean;
holds_logos: boolean;
holds_fonts: boolean;
holds_current_projections: boolean;
holds_history_projections: boolean;
holds_preview_projections: boolean;
name: string,
holds_attachments: boolean,
holds_logos: boolean,
holds_fonts: boolean,
holds_current_projections: boolean,
holds_history_projections: boolean,
holds_preview_projections: boolean
}
},
children_amount: int,
children_amount: int
}
}
```
Expand Down
28 changes: 0 additions & 28 deletions docs/presenters/get_meetings.md

This file was deleted.

20 changes: 10 additions & 10 deletions docs/presenters/get_user_related_models.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

```js
{
user_ids: Id[];
user_ids: Id[] // required
}
```

Expand All @@ -12,16 +12,16 @@
{
[user_id: Id]: {
organization_management_level: OML-String,
committees: [{ id: Id; name: String; cml: CML-String; }],
committees: [{ id: Id, name: String, cml: CML-String }],
meetings: [{
id: Id;
name: String;
is_active_in_organization_id: Id;
is_locked: boolean;
motion_submitter_ids: Id[];
assignment_candidate_ids: Id[];
speaker_ids: Id[];
locked_out: boolean;
id: Id,
name: String,
is_active_in_organization_id: Id,
is_locked: boolean,
motion_submitter_ids: Id[],
assignment_candidate_ids: Id[],
speaker_ids: Id[],
locked_out: boolean
}]
}
}
Expand Down
4 changes: 2 additions & 2 deletions docs/presenters/get_user_scope.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

```js
{
user_ids: Id[];
user_ids: Id[] // required
}
```

Expand All @@ -13,7 +13,7 @@
user_id: Id: {
collection: String, # one of "meeting", "committee" or "organization"
id: Id,
user_oml: String, # one of "superadmin", "can_manage_organization", "can_manage_users", ""
user_oml: String, # one of "superadmin", "can_manage_organization", "can_manage_users", ""
committee_ids: int[] // Ids of all committees the user is part of
}
}
Expand Down
11 changes: 6 additions & 5 deletions docs/presenters/get_users.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
# Payload

```
```js
{
// optional
start_index: number,
entries: number,
sort_criteria: string[], // can contain ["username", "first_name", "last_name"],
reverse: boolean,
filter?: string,
filter?: string
}
```

# Returns

```
```js
[
{
id: Id,
username: string,
first_name: string,
last_name: string,
last_name: string
},
...
]
Expand All @@ -28,4 +29,4 @@

The request user needs OML `can_manage_users` or higher. Otherwise an error is returned.

Returns all users, that have `filer` in `username`, `first_name`, `last_name`. If filter is `null`, all users are returned. The users are sorted by `sort_criteria`. If it is not given, the default is `["username", "first_name", "last_name"]`. If `reverse` is true, the order is reversed. Lastly, the users are paginated beginning at `start_index` with at max `entries` number of users.
Returns all users, that have `filter` in `username`, `first_name`, `last_name`. If filter is `null`, all users are returned. The users are sorted by `sort_criteria`. If it is not given, the default is `["username", "first_name", "last_name"]`. If `reverse` is true, the order is reversed. Lastly, the users can be paginated beginning at `start_index` with at max `entries` number of users.
36 changes: 0 additions & 36 deletions docs/presenters/search_deleted_models.md

This file was deleted.

12 changes: 6 additions & 6 deletions docs/presenters/search_for_id_by_external_id.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
```js
{
// required
collection: string;
external_id: string;
context_id: Id;
collection: string,
external_id: string,
context_id: Id
}
```
## Returns
```js
{
id: Id;
id: Id
}
```
in the case one id is found.
```js
{
id: null;
error: string;
id: null,
error: string
}
```
else.
Expand Down
5 changes: 3 additions & 2 deletions docs/presenters/search_users.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

```js
{
// required
permission_type: "meeting" | "committee" | "organization"
permission_id: number, // Id of permission scope object
search: {
Expand All @@ -10,7 +11,7 @@
"first_name": string,
"last_name": string,
"email": string,
"member_number": string,
"member_number": string
}[]
}
```
Expand All @@ -24,7 +25,7 @@
"first_name": string,
"last_name": string,
"email": string,
"member_number": string,
"member_number": string
}[][]
```
A double array: The outer array has the same length as the request's `search` array and contains
Expand Down

0 comments on commit dec9a05

Please sign in to comment.