diff --git a/openapi.yaml b/openapi.yaml index 4634611..dfacc57 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1617,6 +1617,112 @@ paths: $ref: '#/components/responses/ForbiddenError' "422": $ref: '#/components/responses/UnprocessableEntityList' + /tour_stops: + get: + tags: [Feature Tours] + summary: List the stops a tour can use + description: | + Lists every stop Makerble knows: the stops Welcome Tours and feature tours are built from. Each one focuses + on one part of one page, such as the Filters button on Contacts. Use a stop's `key` as the `stop_key` of a + feature tour's or a Welcome Tour's stop. + + Stops come in registry order, grouped by feature (`group_name`, such as Contacts, Checklists, Registers or + Results Canvas; "Other" for a stop with no group). Each says which page it opens (`page`), whether it waits + for Next or for a click, Makerble's default wording, the wording it shows instead when the person has + nothing on that page yet (`empty`), and who it is shown to (`shown_to`). A stop the person can't use is + skipped when the tour runs. + + Each stop also says how many feature tours and Welcome Tours use it. Send `group_name` to list one + feature's stops. Marketing and Admin users can change a stop's default title and text with + `PATCH /tour_stops/{key}`. + + System Access users (Makerble staff) only. Anyone else gets 403. + operationId: listTourStops + security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + - name: group_name + in: query + required: false + description: Only the stops in this feature group, e.g. `Registers` + schema: + type: string + example: Registers + responses: + "200": + description: Paginated stops + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedTourStopDefinitions' + example: + page: 1 + page_size: 1 + page_count: 36 + total_count: 36 + data: + - key: contacts_filters + label: 'Contacts: Filters' + group_name: Contacts + page: Contacts (contacts) + action: click + action_label: Waits for a click + default_title: Narrow the list down + default_body: Filters let you see just the people you need, such as one year group. + empty: null + shown_to: Skipped for someone who is not a member of the organisation + feature_tour_count: 1 + welcome_tour_count: 0 + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/ForbiddenError' + /tour_stops/{key}: + patch: + tags: [Feature Tours] + summary: Change a stop's default wording + description: | + Changes Makerble's default title and text for one stop, as Site Overview › Tour Stops does. Every + Welcome Tour and feature tour stop that has no wording of its own shows the new default straight away. + + Only the fields sent change. A field sent empty, or the same as Makerble's original wording, goes back to + the original. Returns the stop as `GET /tour_stops` lists it. + + Marketing and Admin users (Makerble staff) only. Support users and anyone else get 403. + operationId: updateTourStop + security: [{tokenAuth: []}] + parameters: + - name: key + in: path + required: true + description: The stop's key, from `GET /tour_stops` + schema: + type: string + example: contacts_table + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TourStopWordingInput' + example: + default_title: Your contacts + responses: + "200": + description: The stop with its new default wording + content: + application/json: + schema: + $ref: '#/components/schemas/TourStopDefinition' + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/ForbiddenError' + "404": + $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntityList' /feature_tours/{id}: parameters: - name: id @@ -19342,6 +19448,10 @@ components: type: string nullable: true description: Which part of which page the stop focuses on + group_name: + type: string + nullable: true + description: The feature the stop belongs to, such as Contacts or Registers; "Other" when it has none, null for a stop Makerble no longer knows action: type: string enum: [next, click, ""] @@ -19400,6 +19510,79 @@ components: description: Up to 600 characters; empty means Makerble's default _destroy: type: boolean + TourStopDefinition: + type: object + description: One of the stops Makerble knows, for building a Welcome Tour or a feature tour + properties: + key: + type: string + description: The stop's key, sent as `stop_key` when adding it to a tour + label: + type: string + description: Which part of which page the stop focuses on + group_name: + type: string + description: The feature the stop belongs to, such as Contacts or Registers; "Other" when it has none + page: + type: string + description: The page the stop opens, as a page name and its key, a path, or in words when it is worked out for each person + action: + type: string + enum: [next, click] + description: Whether the stop waits for Next or asks the person to click something + action_label: + type: string + description: '`action` in words: "Next button" or "Waits for a click"' + default_title: + type: string + nullable: true + description: Makerble's title for the stop + default_body: + type: string + nullable: true + description: Makerble's wording for the stop + empty: + type: object + nullable: true + description: What the stop shows someone who can open its page but has nothing on it yet; null when it is skipped instead + properties: + title: + type: string + body: + type: string + page: + type: string + nullable: true + description: The page the empty variant opens, when it isn't the stop's own page + shown_to: + type: string + description: Who sees the stop, e.g. "Only for Organisation Editors" or "Skipped for someone without a Checklist" + feature_tour_count: + type: integer + description: How many feature tours use the stop + welcome_tour_count: + type: integer + description: How many Welcome Tours use the stop + TourStopWordingInput: + type: object + properties: + default_title: + type: string + maxLength: 120 + description: Makerble's title for the stop; empty goes back to the original + default_body: + type: string + maxLength: 600 + description: Makerble's text for the stop; empty goes back to the original + PaginatedTourStopDefinitions: + allOf: + - $ref: '#/components/schemas/PaginationEnvelope' + - type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/TourStopDefinition' PaginatedFeatureTours: allOf: - $ref: '#/components/schemas/PaginationEnvelope' diff --git a/server.js b/server.js index a64dc7c..7506af4 100644 --- a/server.js +++ b/server.js @@ -4784,7 +4784,7 @@ function buildDocsPage() {
A feature tour is a short guided tour that introduces one feature to people who already use Makerble. Unlike a Welcome Tour it belongs to no Organisation: Makerble staff write it once. A live tour with a page_key is offered by "Take the tour" on that page's Intro (the Show/Hide Guidance panel at the top of a Manage page, such as contacts); each Intro has at most one live tour. auto_prompt offers it once, the first time someone opens its page.
Each stop is one of the stops Welcome Tours use, named by stop_key, and shows Makerble's default_title and default_body unless it has its own title or body. System Access users (Makerble staff) only; anyone else gets 403.
Each stop is one of the stops Welcome Tours use, named by stop_key, and shows Makerble's default_title and default_body unless it has its own title or body. GET /tour_stops lists every stop Makerble knows, grouped by feature, with the page each opens and its default wording. System Access users (Makerble staff) only; anyone else gets 403.
Registers" },
+ { name: "page", type: "integer", required: false, desc: "Page number" },
+ { name: "per_page", type: "integer", required: false, desc: "Records per page (default 10, max 200)" }
+ ], [
+ { code: "200", cls: "response-2xx", desc: "Paginated stops in registry order, each with its key (a tour stop's stop_key), label, group_name, page, action, default wording, empty variant, shown_to, and how many feature tours and Welcome Tours use it" },
+ { code: "403", cls: "response-4xx", desc: "The user doesn't have System Access" }
+ ], "The stops Welcome Tours and feature tours are built from. The list is the same for everyone and changes only when Makerble releases new stops.")}
+ ${endpointCard("PATCH", "/tour_stops/{key}", "Change a stop's default wording", true, [
+ { name: "key", in: "path", type: "string", required: true, desc: "The stop's key, from GET /tour_stops" }
+ ], [
+ { code: "200", cls: "response-2xx", desc: "The stop with its new default wording" },
+ { code: "403", cls: "response-4xx", desc: "The user isn't a Marketing or Admin user" },
+ { code: "404", cls: "response-4xx", desc: "No stop has this key" },
+ { code: "422", cls: "response-4xx", desc: "Validation failed, e.g. a title over 120 characters" }
+ ], "Body: default_title, default_body. Only the fields sent change; an empty one goes back to Makerble's original. Every tour stop without its own wording shows the new default.")}
${endpointCard("GET", "/feature_tours/{id}", "Get a feature tour", true, [
{ name: "id", in: "path", type: "integer", required: true, desc: "Feature tour ID" }
], [