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
184 changes: 178 additions & 6 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ tags:
- name: Projects
description: The primary organisational unit — every Story and Case belongs to a Project
- name: Welcome Tours
description: Guided tours of Makerble's own pages for new colleagues, written by Makerble staff; Organisation Admins choose how strict they are
description: Guided tours of Makerble's own pages for new colleagues; Organisation Admins choose each team's stops, wording and how strict they are, and see who has finished
- name: Announcements
description: '"What''s new in Makerble" popups, written and scheduled by Makerble staff in Site Overview'
- name: Albums
Expand Down Expand Up @@ -947,11 +947,15 @@ paths:
Changes only the fields sent. System Access users can change everything; a stop with `_destroy: true`
is removed, and a stop without an `id` is added.

An Organisation Admin of the tour's Organisation can change only how strict it is, as their Welcome
journey settings page does: `mode` (`required` is "Mandatory", `optional` lets people skip or end it),
`start_skippable` ("People can skip the tour when it is first offered"), `later_limit` (how many times
someone can choose "I'll do this later", 1 to 10) and `skippable` on stops that ask for a click. Sending
anything else as an Organisation Admin is refused with 403.
An Organisation Admin of the tour's Organisation can change what their Welcome journey settings page
changes: `mode` (`required` is "Mandatory", `optional` lets people skip or end it), `start_skippable`
("People can skip the tour when it is first offered"), `later_limit` (how many times someone can choose
"I'll do this later", 1 to 10), and for each stop, named by its `id` or its `stop_key`: `included`
(whether the tour shows it; an unticked stop keeps its wording for when it is ticked again), `body` (its
wording, up to 280 characters of plain text; empty means Makerble's `default_body`) and `skippable` (on
stops that ask for a click). A `stop_key` the tour doesn't have yet adds that stop. Essentials stops
(navbar_spaces, navbar_user) are always included. Only the fields sent change. Sending anything else as
an Organisation Admin is refused with 403.
operationId: updateTour
security: [{tokenAuth: []}]
requestBody:
Expand All @@ -965,6 +969,10 @@ paths:
stops:
- id: 678
skippable: true
- id: 679
included: false
- stop_key: contacts_table
body: Every child you work with has a record here.
responses:
"200":
description: The updated Welcome Tour
Expand All @@ -980,6 +988,87 @@ paths:
$ref: '#/components/responses/NotFound'
"422":
$ref: '#/components/responses/UnprocessableEntityList'
/tours/{id}/progress:
parameters:
- name: id
in: path
required: true
schema:
type: integer
get:
tags: [Welcome Tours]
summary: See who has finished a Welcome Tour
description: |
Who has finished the tour, as the Who has finished page shows it: the colleagues in the tour's Team
(everyone in the Organisation for its default tour), by name, each with their team, how far they have
got, how many times they have chosen "I'll do this later" and when they were last reminded. Only
colleagues (Organisation Admins, reporters and observers) are listed, never Contacts or active
participants. `summary` counts the same people: `average_minutes` counts only tours finished without
"I'll do this later". An Organisation Admin of the tour's Organisation, or a System Access user.
operationId: listTourProgress
security: [{tokenAuth: []}]
parameters:
- $ref: '#/components/parameters/Page'
- $ref: '#/components/parameters/PerPage'
responses:
"200":
description: Paginated colleagues and how far each has got
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedTourProgress'
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/ForbiddenError'
"404":
$ref: '#/components/responses/NotFound'
/tours/{id}/reminders:
parameters:
- name: id
in: path
required: true
schema:
type: integer
post:
tags: [Welcome Tours]
summary: Remind a colleague to finish their Welcome Tour
description: |
Emails a colleague who hasn't finished their Welcome Tour a link that opens it at the stop they reached,
as Send a reminder on the Who has finished page does. Each person can be reminded once every 7 days;
a second reminder sooner is refused with 422, saying when the next one can be sent, as is someone who
has finished or isn't a colleague in the Organisation. An Organisation Admin of the tour's Organisation,
or a System Access user.
operationId: createTourReminder
security: [{tokenAuth: []}]
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [user_id]
properties:
user_id:
type: integer
description: The colleague to remind
example:
user_id: 4567
responses:
"201":
description: The reminder was sent
content:
application/json:
schema:
$ref: '#/components/schemas/TourReminder'
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/ForbiddenError'
"404":
$ref: '#/components/responses/NotFound'
"422":
$ref: '#/components/responses/UnprocessableEntityList'
/organisations/{organisation_id}/welcome_journey_settings:
parameters:
- name: organisation_id
Expand Down Expand Up @@ -15111,6 +15200,13 @@ components:
skippable:
type: boolean
description: Whether a click stop shows Skip this stop
included:
type: boolean
description: Whether the tour shows this stop. An unticked stop keeps its wording for when it is ticked again.
default_body:
type: string
nullable: true
description: Makerble's wording for this stop, shown when `body` is empty
TourInput:
type: object
properties:
Expand Down Expand Up @@ -15146,10 +15242,16 @@ components:
type: string
stop_key:
type: string
description: For an Organisation Admin, names the stop instead of `id`, and adds it if the tour doesn't have it
title:
type: string
body:
type: string
nullable: true
description: The stop's wording; empty means Makerble's default. Up to 280 characters for an Organisation Admin.
included:
type: boolean
description: Whether the tour shows this stop
action_text:
type: string
after_text:
Expand All @@ -15167,6 +15269,76 @@ components:
type: array
items:
$ref: '#/components/schemas/Tour'
PaginatedTourProgress:
allOf:
- $ref: '#/components/schemas/PaginationEnvelope'
- type: object
properties:
summary:
$ref: '#/components/schemas/TourProgressSummary'
data:
type: array
items:
$ref: '#/components/schemas/TourProgress'
TourProgressSummary:
type: object
description: The tiles on the Who has finished page
properties:
finished:
type: integer
part_way:
type: integer
not_started:
type: integer
description: Not started, or skipped an optional tour
average_minutes:
type: number
nullable: true
description: Average minutes to finish, counting only tours finished without "I'll do this later"
TourProgress:
type: object
description: One colleague and how far they have got
properties:
user_id:
type: integer
name:
type: string
team:
type: string
nullable: true
description: The first of the Organisation's Teams they joined
status:
type: string
enum: [not_started, in_progress, deferred, completed, skipped]
description: deferred means they chose "I'll do this later"
tour:
type: string
description: As the page shows it, for example "Paused at stop 3 of 7" or "Finished"
later_used:
type: string
nullable: true
description: How many times they chose "I'll do this later" of how many allowed, on a mandatory tour
last_active_at:
type: string
format: date-time
nullable: true
reminded_at:
type: string
format: date-time
nullable: true
description: When they were last sent a reminder
TourReminder:
type: object
properties:
user_id:
type: integer
reminded_at:
type: string
format: date-time
next_reminder_from:
type: string
format: date-time
description: The earliest another reminder can be sent to them
WelcomeJourneySettings:
type: object
properties:
Expand Down
22 changes: 20 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4057,7 +4057,7 @@ function buildDocsPage() {
<h2 class="section-title">Welcome Tours</h2>
<div class="section-desc">
<p>A Welcome Tour is the guided tour of Makerble's own pages that a new colleague is offered after adding their name and photo. Each stop dims the page except one area, such as the Spaces menu or the Contacts table, and either waits for Next or asks the person to click something (<code>action: click</code>). A tour belongs to an Organisation and, optionally, one of its Teams; <code>team_id: null</code> is the Organisation's default tour. Only a <code>live</code> tour is shown, and each Team (and the default) has at most one.</p>
<p>Makerble staff (System Access) see and change every tour. An Organisation Admin sees their own Organisation's tours and can change only how strict they are: <code>mode</code> (<code>required</code> is shown as Mandatory), <code>start_skippable</code>, <code>later_limit</code> (how many times someone can choose "I'll do this later", 1 to 10) and <code>skippable</code> on click stops. Anyone else gets <code>403</code>. How far each person has got isn't available through the API.</p>
<p>Makerble staff (System Access) see and change every tour. An Organisation Admin sees their own Organisation's tours and changes what their Welcome journey settings page changes: how strict a tour is (<code>mode</code>, where <code>required</code> is shown as Mandatory; <code>start_skippable</code>; <code>later_limit</code>, how many times someone can choose "I'll do this later", 1 to 10), and for each stop whether it is <code>included</code>, its wording (<code>body</code>, up to 280 characters; empty uses Makerble's <code>default_body</code>) and whether a click stop is <code>skippable</code>. Essentials stops are always included. They can also see who has finished a tour and send reminders. Anyone else gets <code>403</code>.</p>
<p>Stop keys: <code>navbar_spaces</code>, <code>navbar_user</code>, <code>focus_table</code>, <code>contacts_table</code>, <code>contacts_search</code>, <code>contacts_filters</code>, <code>events_table</code>, <code>event_guests</code>.</p>
</div>
<div class="endpoint-list">
Expand Down Expand Up @@ -4089,7 +4089,25 @@ function buildDocsPage() {
{ code: "403", cls: "response-4xx", desc: "Not allowed, e.g. an Organisation Admin changing the name, status or a stop's wording" },
{ code: "404", cls: "response-4xx", desc: "Not found" },
{ code: "422", cls: "response-4xx", desc: "Validation failed, e.g. a later_limit of 11" }
], "Only the fields sent change. Staff can send everything, and <code>_destroy: true</code> on a stop removes it. An Organisation Admin can send <code>mode</code>, <code>start_skippable</code>, <code>later_limit</code> and <code>stops: [{id, skippable}]</code>.")}
], "Only the fields sent change. Staff can send everything, and <code>_destroy: true</code> on a stop removes it. An Organisation Admin can send <code>mode</code>, <code>start_skippable</code>, <code>later_limit</code> and <code>stops: [{id or stop_key, included, body, skippable}]</code>; a <code>stop_key</code> the tour doesn't have yet adds that stop.")}
${endpointCard("GET", "/tours/{id}/progress", "See who has finished a Welcome Tour", true, [
{ name: "id", in: "path", type: "integer", required: true, desc: "Welcome Tour ID" },
{ 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 colleagues in the tour's Team (everyone for a default tour), each with <code>status</code>, <code>tour</code> (e.g. \"Paused at stop 3 of 7\"), <code>later_used</code>, <code>last_active_at</code> and <code>reminded_at</code>, plus a <code>summary</code> of finished, part-way, not started and average minutes" },
{ code: "403", cls: "response-4xx", desc: "Not an Organisation Admin of its Organisation" },
{ code: "404", cls: "response-4xx", desc: "Not found" }
], "Colleagues only, never Contacts or active participants. <code>average_minutes</code> counts only tours finished without \"I'll do this later\".")}
${endpointCard("POST", "/tours/{id}/reminders", "Remind a colleague to finish their Welcome Tour", true, [
{ name: "id", in: "path", type: "integer", required: true, desc: "Welcome Tour ID" },
{ name: "user_id", in: "body", type: "integer", required: true, desc: "The colleague to remind" }
], [
{ code: "201", cls: "response-2xx", desc: "Reminder emailed: <code>user_id</code>, <code>reminded_at</code> and <code>next_reminder_from</code>" },
{ code: "403", cls: "response-4xx", desc: "Not an Organisation Admin of its Organisation" },
{ code: "404", cls: "response-4xx", desc: "Not found" },
{ code: "422", cls: "response-4xx", desc: "Already reminded in the last 7 days, already finished, or not a colleague in the Organisation" }
], "Emails a link that opens the tour at the stop they reached. Once every 7 days per person.")}
${endpointCard("GET", "/organisations/{organisation_id}/welcome_journey_settings", "Get an Organisation's welcome journey settings", true, [
{ name: "organisation_id", in: "path", type: "integer", required: true, desc: "The Organisation (Charity) ID" }
], [
Expand Down
Loading