Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15035,6 +15035,11 @@ paths:
approval, and is a 422 naming the steps (`missing_hint_step_ids`) while any that needs a hint
has none. `share: organisation` stops sharing it; Checklists already made from it don't change.
Only Organisation Admins can (403 otherwise).

In a Toolkit, `toolkit_id` with `toolkit_items` points survey, form and story label steps at
the Toolkit's own Surveys, Contact Forms and story Labels, as Edit Toolkit items does on the
Toolkit's page. You must be able to edit the Toolkit (403), and it must hold this template (404).
An item that isn't one of the Toolkit's is a 422.
security: [{tokenAuth: []}]
parameters:
- name: id
Expand All @@ -15054,6 +15059,17 @@ paths:
journey_part: {type: string, enum: [referral, enrolment, safeguarding, exit_and_alumni]}
hints: {type: object, additionalProperties: {type: string}}
share: {type: string, enum: [organisation, impact_store]}
toolkit_id:
type: integer
description: A Toolkit holding this template, that you can edit, for toolkit_items
toolkit_items:
type: object
additionalProperties: {type: string}
description: |
The template's step ids mapped to one of the Toolkit's own items: `StoryCategory:<id>`
(a Survey), `BeneficiaryCategory:<id>` (a Contact Form) or `Label:<id>` (a story Label),
or "" for the hint alone. Installing the Toolkit sets those steps up with no mapping.
Each step's `toolkit_item_kind` says which kind it can take (null for none).
example:
hints:
"88": a baseline wellbeing survey
Expand Down
11 changes: 7 additions & 4 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3642,7 +3642,7 @@ function buildDocsPage() {
${endpointCard("GET", "/checklist_templates/{id}", "Get one of My Checklist Templates", true, [
{ name: "id", in: "path", type: "integer", required: true, desc: "The template's id" }
], [
{ code: "200", cls: "response-2xx", desc: "The template with its <code>stages</code> and <code>steps</code>, each with its <code>hint</code> and <code>needs_hint</code>" },
{ code: "200", cls: "response-2xx", desc: "The template with its <code>stages</code> and <code>steps</code>, each with its <code>hint</code>, <code>needs_hint</code>, <code>toolkit_item_kind</code> and <code>toolkit_item</code> (<code>{type, id, name}</code> or <code>null</code>)" },
{ code: "404", cls: "response-4xx", desc: "Not one of your organisations' templates" }
])}
${endpointCard("POST", "/checklist_templates", "Save a Checklist as a template", true, [
Expand All @@ -3661,11 +3661,14 @@ function buildDocsPage() {
${endpointCard("PATCH", "/checklist_templates/{id}", "Change, publish or stop sharing a template", true, [
{ name: "id", in: "path", type: "integer", required: true, desc: "The template's id" },
{ name: "hints", in: "body", type: "object", required: false, desc: "The template's step ids → hint" },
{ name: "share", in: "body", type: "string", required: false, desc: "<code>impact_store</code> publishes it for Makerble's approval; <code>organisation</code> stops sharing it" }
{ name: "share", in: "body", type: "string", required: false, desc: "<code>impact_store</code> publishes it for Makerble's approval; <code>organisation</code> stops sharing it" },
{ name: "toolkit_id", in: "body", type: "integer", required: false, desc: "A Toolkit holding this template, that you can edit, for <code>toolkit_items</code>" },
{ name: "toolkit_items", in: "body", type: "object", required: false, desc: "The template's step ids → one of the Toolkit's own items, as <code>StoryCategory:12</code> (Survey), <code>BeneficiaryCategory:5</code> (Contact Form) or <code>Label:7</code> (story Label), or <code>\"\"</code> for the hint alone. Installing the Toolkit sets those steps up with no mapping" }
], [
{ code: "200", cls: "response-2xx", desc: "The changed template" },
{ code: "403", cls: "response-4xx", desc: "Not an Organisation Admin" },
{ code: "422", cls: "response-4xx", desc: "A step that needs a hint has none: <code>missing_hint_step_ids</code>" }
{ code: "403", cls: "response-4xx", desc: "Not an Organisation Admin, or you can't edit the Toolkit" },
{ code: "404", cls: "response-4xx", desc: "Not one of your templates, or the Toolkit doesn't hold it" },
{ code: "422", cls: "response-4xx", desc: "A step that needs a hint has none: <code>missing_hint_step_ids</code>; or a step's Toolkit item isn't one of the Toolkit's" }
])}
${endpointCard("DELETE", "/checklist_templates/{id}", "Delete a template", true, [
{ name: "id", in: "path", type: "integer", required: true, desc: "The template's id" }
Expand Down
Loading