diff --git a/openapi.yaml b/openapi.yaml index ed96eb2..c6dcbf6 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -15103,6 +15103,13 @@ paths: `suggested`, `leave` (nothing matched, so it is left to set up later) or `none` (nothing to set up). `charity_id` picks which of your organisations is using it (default: the template's own if it is yours, else your first). + + Installing a Toolkit: pass `toolkit_id`. Any template in a Toolkit you can see can be used, + published or not. Steps that point at the Toolkit's own Surveys, Contact Forms and story Labels + then default to `toolkit` (`default_item_id: toolkit`, with the installed item's name under + `toolkit`): the copies installing the Toolkit added, shown as "Installed with this Toolkit". A + step whose item wasn't installed falls back to its hint as usual. A template that isn't in the + Toolkit, or a Toolkit you can't see, is a 404. security: [{tokenAuth: []}] parameters: - name: id @@ -15113,6 +15120,11 @@ paths: in: query required: false schema: {type: integer} + - name: toolkit_id + in: query + required: false + description: Installing this Toolkit, which holds the template + schema: {type: integer} responses: "200": description: The steps and their choices @@ -15159,6 +15171,8 @@ paths: `{step_id, leave: true}` to set it up later. Steps left out take their default. A step left for later is never set to "Any": it shows as Needs setting up and doesn't tick off until someone chooses what counts. Returns the new Checklist and the steps that still need setting up. + With `toolkit_id` (installing a Toolkit), `item_id: toolkit` sets a step up with the Toolkit's + installed item; see **Suggested mapping**. security: [{tokenAuth: []}] parameters: - name: id @@ -15173,6 +15187,7 @@ paths: type: object properties: charity_id: {type: integer} + toolkit_id: {type: integer, description: Installing this Toolkit, which holds the template} name: {type: string} mapping: type: array diff --git a/server.js b/server.js index 31a4c76..14f24dc 100644 --- a/server.js +++ b/server.js @@ -3675,14 +3675,16 @@ function buildDocsPage() { ])} ${endpointCard("GET", "/checklist_templates/{id}/mapping", "Suggested mapping for using a template", true, [ { name: "id", in: "path", type: "integer", required: true, desc: "An ImpactStore template, or one of your own" }, - { name: "charity_id", type: "integer", required: false, desc: "Which of your organisations is using it" } + { name: "charity_id", type: "integer", required: false, desc: "Which of your organisations is using it" }, + { name: "toolkit_id", type: "integer", required: false, desc: "Installing this Toolkit: steps pointing at its own Surveys, Contact Forms and story Labels default to toolkit, the copies the install added" } ], [ - { code: "200", cls: "response-2xx", desc: "Each step's hint, options, suggested match, original (your own template), can_create and default (original, suggested, leave or none)" }, - { code: "404", cls: "response-4xx", desc: "Another organisation's unpublished template" } + { code: "200", cls: "response-2xx", desc: "Each step's hint, options, suggested match, original (your own template), toolkit (installing a Toolkit), can_create and default (toolkit, original, suggested, leave or none)" }, + { code: "404", cls: "response-4xx", desc: "Another organisation's unpublished template, or one that isn't in the Toolkit" } ])} ${endpointCard("POST", "/checklist_templates/{id}/use", "Use a template", true, [ { name: "id", in: "path", type: "integer", required: true, desc: "The template's id" }, { name: "charity_id", in: "body", type: "integer", required: false, desc: "Which of your organisations is using it" }, + { name: "toolkit_id", in: "body", type: "integer", required: false, desc: "Installing this Toolkit; item_id: toolkit then uses its installed item" }, { name: "name", in: "body", type: "string", required: false, desc: "The new Checklist's name" }, { name: "mapping", in: "body", type: "array", required: false, desc: "Per step: {step_id, item_id}, {step_id, create} or {step_id, leave: true}. Steps left out take their default" } ], [