@abgov/adsp-sdk-mcp-server 1.15.0 → 1.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/docs/platform/deployment.md +11 -10
- package/assets/docs/services/access-service-backup-disaster-recovery.md +83 -0
- package/assets/docs/services/audit-service.md +468 -0
- package/assets/docs/services/calendar-service.md +127 -5
- package/assets/docs/services/event-service.md +81 -50
- package/assets/docs/services/form-service.md +40 -1
- package/assets/docs/services/project-planner-service.md +90 -0
- package/assets/docs/services/token-handler.md +85 -45
- package/assets/docs/services/value-service.md +49 -6
- package/assets/docs/tutorials/form-service/data-registers.md +40 -45
- package/package.json +1 -1
- package/src/sdk-reference/reference.js +88 -0
- package/src/sdk-reference/reference.js.map +1 -1
|
@@ -15,22 +15,76 @@ client `urn:ads:platform:calendar-service`
|
|
|
15
15
|
|
|
16
16
|
| name | description |
|
|
17
17
|
|:-|:-|
|
|
18
|
-
| calendar-admin | Administrator role for calendar service. This role allows a user to
|
|
18
|
+
| calendar-admin | Administrator role for calendar service. This role allows a user to create, update, and delete the tenant's calendar definitions, and to read and update events in any calendar. It is part of the tenant-admin composite role. |
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
`calendar-admin` is a Keycloak client role. It is created under the `urn:ads:platform:calendar-service` client when a tenant realm is created, and tenant administrators have it through the `tenant-admin` composite role. If your realm does not include it (for example, the realm was created before calendar service was available), add it from the *Service roles* tab of Access service in tenant administration. See [Access management](../important-notes.md#access-management).
|
|
21
|
+
|
|
22
|
+
Access to events is primarily controlled by each calendar's `readRoles` and `updateRoles`. Read roles grant access to private events and their attendees; update roles also grant permission to create, update, and delete events and attendees. `calendar-admin` grants both for all calendars.
|
|
21
23
|
|
|
22
24
|
## Concepts
|
|
23
25
|
### Dates
|
|
24
26
|
Calendar service provides informational endpoints for Dates that includes information like which days are business days and which are holidays.
|
|
25
27
|
|
|
26
28
|
### Calendar
|
|
27
|
-
|
|
29
|
+
A calendar is a container for *events*. Each calendar has a name, display name, and description, which are publicly accessible, and the `readRoles` and `updateRoles` that control access to its events.
|
|
30
|
+
|
|
31
|
+
Calendar definitions are stored in the [configuration service](configuration-service.md) under the `platform:calendar-service` namespace and name. Each definition has a `source`:
|
|
32
|
+
- `tenant` calendars are created and managed by the tenant using the calendar service API or the calendar service page in tenant administration.
|
|
33
|
+
- `core` calendars are registered by platform services, such as the `form-intake` calendar of form service. Tenants can use core calendars but cannot change them; they are view-only in tenant administration.
|
|
34
|
+
|
|
35
|
+
| Method | Path | Description | Required role |
|
|
36
|
+
|:-|:-|:-|:-|
|
|
37
|
+
| `GET` | `/calendar/v1/calendars` | Lists calendar definitions with their `source`. Anonymous requests only receive core calendars. | None |
|
|
38
|
+
| `GET` | `/calendar/v1/calendars/{name}` | Retrieves a calendar. | None |
|
|
39
|
+
| `POST` | `/calendar/v1/calendars` | Creates a tenant calendar. Returns 201 with the calendar. | `calendar-admin` |
|
|
40
|
+
| `PUT` | `/calendar/v1/calendars/{name}` | Replaces a tenant calendar. Returns 200 with the calendar. | `calendar-admin` |
|
|
41
|
+
| `DELETE` | `/calendar/v1/calendars/{name}` | Deletes a tenant calendar that has no events. Returns 204. | `calendar-admin` |
|
|
42
|
+
|
|
43
|
+
`calendar-admin` is sufficient to manage tenant calendars; `configuration-admin` is not required. Anonymous requests for a specific calendar, including its public events, must identify the tenant by name using the `tenant` query parameter. Platform (core) users specify the tenant using the `tenantId` query parameter.
|
|
44
|
+
|
|
45
|
+
Create and update requests take a body with the following properties; other properties are not allowed.
|
|
46
|
+
|
|
47
|
+
| property | required | description |
|
|
48
|
+
|:-|:-|:-|
|
|
49
|
+
| `name` | yes | Up to 50 letters, numbers, spaces, hyphens, or underscores. On update, this must match `{name}` in the path. |
|
|
50
|
+
| `displayName` | yes | Display name of up to 32 characters; cannot be blank. |
|
|
51
|
+
| `description` | no | Description of up to 250 characters. |
|
|
52
|
+
| `readRoles` | yes | Roles that can read private events and attendees. Can be an empty array. |
|
|
53
|
+
| `updateRoles` | yes | Roles that can read and change events and attendees. Can be an empty array. |
|
|
54
|
+
|
|
55
|
+
Create, update, and delete requests return:
|
|
56
|
+
- 400 if the request body or calendar name is invalid.
|
|
57
|
+
- 401 if the request is not authenticated.
|
|
58
|
+
- 403 if the user does not have the `calendar-admin` role in the tenant.
|
|
59
|
+
- 404 on update or delete if the tenant has no calendar with that name. Core calendars cannot be updated or deleted.
|
|
60
|
+
- 409 on create if a tenant or core calendar with the name already exists, or on delete if the calendar has events.
|
|
61
|
+
- 502 if the configuration service is unavailable.
|
|
62
|
+
|
|
63
|
+
Successful changes signal `calendar-definition-created`, `calendar-definition-updated`, and `calendar-definition-deleted` [domain events](event-service.md). Each event includes the calendar definition and the user who made the change.
|
|
28
64
|
|
|
29
65
|
### Calendar event
|
|
30
|
-
|
|
66
|
+
Calendar events represent a scheduled activity. Each event has some basic name and description information as well as start and end time. Events can be made public so that anonymous users can read their fields; their attendees remain accessible only to authorized users.
|
|
67
|
+
|
|
68
|
+
### Recurring event
|
|
69
|
+
An event can optionally repeat by including a `recurrence`. The model is a subset of the iCalendar (RFC 5545) recurrence rule:
|
|
70
|
+
|
|
71
|
+
| Property | Description |
|
|
72
|
+
|---|---|
|
|
73
|
+
| `frequency` | `daily`, `weekly`, `monthly`, or `yearly`. Monthly and yearly use the day of the event start; months or years without that day (e.g. the 31st, Feb 29) are skipped. |
|
|
74
|
+
| `interval` | Optional, defaults to 1. For example, `weekly` with `interval: 2` is every two weeks. |
|
|
75
|
+
| `daysOfWeek` | Optional, weekly only. Values from `MO`, `TU`, `WE`, `TH`, `FR`, `SA`, `SU`. Must include the day of the event start. |
|
|
76
|
+
| `end.until` | Optional. Last date (inclusive) that an occurrence can start. |
|
|
77
|
+
| `end.count` | Optional. Number of occurrences, including the first. Can't be used with `until`. |
|
|
78
|
+
|
|
79
|
+
The event `start` and `end` are the first occurrence. Occurrences are generated in Mountain time and keep the same local time across daylight saving changes.
|
|
80
|
+
|
|
81
|
+
- Retrieving events with `from` and `to` returns each occurrence in the range. Occurrences have the `id` of the recurring event and a `recurrenceId` with the original start of the occurrence.
|
|
82
|
+
- Retrieving events without `from` and `to` returns each recurring event once.
|
|
83
|
+
- Updating or deleting the event applies to all occurrences.
|
|
84
|
+
- `DELETE /calendar/v1/calendars/{name}/events/{id}/occurrences/{date}` cancels one occurrence. Cancelled occurrences are listed in `recurrence.exclusions` of the event and can't be restored.
|
|
31
85
|
|
|
32
86
|
### Attendee
|
|
33
|
-
Attendees represent people attending a particular *event*.
|
|
87
|
+
Attendees represent people attending a particular *event*. Blank attendees (no name or email) can be created to represent available appointment slots.
|
|
34
88
|
|
|
35
89
|
## Code examples
|
|
36
90
|
### Getting business days
|
|
@@ -53,6 +107,37 @@ Calendar service API provides information endpoints for dates, including which d
|
|
|
53
107
|
} = await response.json();
|
|
54
108
|
```
|
|
55
109
|
|
|
110
|
+
### Creating a calendar
|
|
111
|
+
Requires the `calendar-admin` role.
|
|
112
|
+
```typescript
|
|
113
|
+
const calendar = {
|
|
114
|
+
name: 'site-inspections',
|
|
115
|
+
displayName: 'Site inspections',
|
|
116
|
+
description: 'Calendar of scheduled site inspections.',
|
|
117
|
+
readRoles: ['inspection-viewer'],
|
|
118
|
+
updateRoles: ['inspection-scheduler'],
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const response = await fetch(
|
|
122
|
+
'https://calendar-service.adsp.alberta.ca/calendar/v1/calendars',
|
|
123
|
+
{
|
|
124
|
+
method: 'POST',
|
|
125
|
+
headers: {
|
|
126
|
+
'Authorization': `Bearer ${accessToken}`,
|
|
127
|
+
'Content-Type': 'application/json',
|
|
128
|
+
},
|
|
129
|
+
body: JSON.stringify(calendar),
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
const {
|
|
134
|
+
urn,
|
|
135
|
+
name,
|
|
136
|
+
displayName,
|
|
137
|
+
source,
|
|
138
|
+
} = await response.json();
|
|
139
|
+
```
|
|
140
|
+
|
|
56
141
|
### Creating a calendar event
|
|
57
142
|
```typescript
|
|
58
143
|
const calendarEvent = {
|
|
@@ -84,3 +169,40 @@ Calendar service API provides information endpoints for dates, including which d
|
|
|
84
169
|
isPublic,
|
|
85
170
|
} = await response.json();
|
|
86
171
|
```
|
|
172
|
+
|
|
173
|
+
### Creating a recurring calendar event
|
|
174
|
+
```typescript
|
|
175
|
+
const calendarEvent = {
|
|
176
|
+
name: 'Team meeting',
|
|
177
|
+
start: '2026-09-29T10:00:00-06:00',
|
|
178
|
+
end: '2026-09-29T11:00:00-06:00',
|
|
179
|
+
recurrence: {
|
|
180
|
+
frequency: 'weekly',
|
|
181
|
+
daysOfWeek: ['TU'],
|
|
182
|
+
end: { until: '2026-12-15' },
|
|
183
|
+
},
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const response = await fetch(
|
|
187
|
+
`https://calendar-service.adsp.alberta.ca/calendar/v1/calendars/${calendar}/events`,
|
|
188
|
+
{
|
|
189
|
+
method: 'POST',
|
|
190
|
+
headers: {
|
|
191
|
+
'Authorization': `Bearer ${accessToken}`,
|
|
192
|
+
'Content-Type': 'application/json',
|
|
193
|
+
},
|
|
194
|
+
body: JSON.stringify(calendarEvent),
|
|
195
|
+
}
|
|
196
|
+
);
|
|
197
|
+
|
|
198
|
+
const { id } = await response.json();
|
|
199
|
+
|
|
200
|
+
// Cancel the October 13 occurrence only.
|
|
201
|
+
await fetch(
|
|
202
|
+
`https://calendar-service.adsp.alberta.ca/calendar/v1/calendars/${calendar}/events/${id}/occurrences/2026-10-13`,
|
|
203
|
+
{
|
|
204
|
+
method: 'DELETE',
|
|
205
|
+
headers: { 'Authorization': `Bearer ${accessToken}` },
|
|
206
|
+
}
|
|
207
|
+
);
|
|
208
|
+
```
|
|
@@ -6,66 +6,77 @@ parent: Services
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Event service
|
|
9
|
+
|
|
9
10
|
Event service allows consumers to send domain events. These events can be used to support additional capabilities aside from the application itself; out of the box, the event service logs domain events to the event log which can be used for traceability of domain operations.
|
|
10
11
|
|
|
11
12
|
## Client roles
|
|
13
|
+
|
|
12
14
|
client `urn:ads:platform:event-service`
|
|
13
15
|
|
|
14
|
-
| name
|
|
15
|
-
|
|
16
|
+
| name | description |
|
|
17
|
+
| :----------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
16
18
|
| event-sender | Sender role for event service. This role is used to allow a service account to send domain events via the event service. Note that the account with the role will be able to send any domain event including platform defined events. |
|
|
19
|
+
| event-reader | Reader role for event service. This role is used to allow users to query the event log, including counting events matching search criteria. It is part of the tenant-admin composite role. |
|
|
17
20
|
|
|
18
21
|
## Concepts
|
|
22
|
+
|
|
19
23
|
### Event definition
|
|
20
|
-
|
|
24
|
+
|
|
25
|
+
Event definition is an optional metadata description of a _domain event_ (identified by a specific namespace and name). They are used for downstream capabilities. For example, the payload schema description allows the [notification service](notification-service.md) to validate variables within notification message templates. Event definitions are configured in the [configuration service](configuration-service.md) under the `platform:event-service` namespace and name.
|
|
21
26
|
|
|
22
27
|
### Event
|
|
28
|
+
|
|
23
29
|
Domain events represent key changes at a domain model level. For example, an intake application process could include events like: application draft created, application submitted, application processing started, application processing completed.
|
|
24
30
|
|
|
25
31
|
### Event log
|
|
26
|
-
|
|
32
|
+
|
|
33
|
+
Event log records all _events_ emitted via the event service and keeps basic metrics including a count of different events. These metrics can represent key domain metrics; in the intake application example, the count of application submitted events represents the volume of applications.
|
|
34
|
+
|
|
35
|
+
In the tenant management app, the Event log page initially searches **Last 7 days**, covering the preceding 168 hours through the current time, with both UTC timestamp boundaries included in the API request. The date range filter also offers **Last hour**, **Today**, **Last 24 hours**, **Last 30 days**, and **Custom**. Today starts at midnight in Mountain Time (`America/Edmonton`, including daylight saving time). Rolling periods cover the indicated number of elapsed hours or 24-hour days, ending when Search is clicked.
|
|
36
|
+
|
|
37
|
+
Select a period and click **Search** to apply it along with any other filters. Start and end date/time controls display the selected period in Mountain Time. They are disabled for predefined periods and editable for **Custom**, initially filled with the selected period. The end must be later than the start. **Reset** clears other filters and immediately searches Last 7 days again. Removing the date range chip clears the selected period and searches without a lower date limit, retaining other applied filters. Pagination pins an upper timestamp at search time so new events do not shift the result pages or count. Search is disabled when no criteria are selected. An empty result displays **No Events Found**.
|
|
27
38
|
|
|
28
39
|
## Code examples
|
|
40
|
+
|
|
29
41
|
### Configure an event definition
|
|
42
|
+
|
|
30
43
|
Event definitions are configured using the [configuration service](configuration-service.md). Note that new configuration may take up to 15 mins to apply.
|
|
31
44
|
|
|
32
45
|
```typescript
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
await fetch(
|
|
56
|
-
`${configurationServiceUrl}/configuration/v2/configuration/platform/event-service`,
|
|
57
|
-
{
|
|
58
|
-
method: 'PATCH',
|
|
59
|
-
headers: {
|
|
60
|
-
'Authorization': `Bearer ${accessToken}`,
|
|
61
|
-
'Content-Type': 'application/json'
|
|
46
|
+
const configurationServiceUrl = 'https://configuration-service.adsp.alberta.ca';
|
|
47
|
+
const request = {
|
|
48
|
+
operation: 'UPDATE',
|
|
49
|
+
update: {
|
|
50
|
+
'domain-service': {
|
|
51
|
+
name: 'domain-service',
|
|
52
|
+
definitions: {
|
|
53
|
+
'domain-event': {
|
|
54
|
+
name: 'domain-event',
|
|
55
|
+
description: 'Signalled on significant domain state change.',
|
|
56
|
+
payloadSchema: {
|
|
57
|
+
type: 'object',
|
|
58
|
+
properties: {
|
|
59
|
+
value: { type: 'string' },
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
62
63
|
},
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
await fetch(`${configurationServiceUrl}/configuration/v2/configuration/platform/event-service`, {
|
|
69
|
+
method: 'PATCH',
|
|
70
|
+
headers: {
|
|
71
|
+
Authorization: `Bearer ${accessToken}`,
|
|
72
|
+
'Content-Type': 'application/json',
|
|
73
|
+
},
|
|
74
|
+
body: JSON.stringify(request),
|
|
75
|
+
});
|
|
66
76
|
```
|
|
67
77
|
|
|
68
78
|
### Send an event
|
|
79
|
+
|
|
69
80
|
```typescript
|
|
70
81
|
const event = {
|
|
71
82
|
namespace: 'support-program',
|
|
@@ -100,23 +111,43 @@ Event definitions are configured using the [configuration service](configuration
|
|
|
100
111
|
```
|
|
101
112
|
|
|
102
113
|
### Search the event log
|
|
114
|
+
|
|
103
115
|
The event log is stored as a value (event-service:event) in the [value service](value-service.md) and can be queried using the value API.
|
|
104
116
|
|
|
105
117
|
```typescript
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
118
|
+
const valueServiceUrl = 'https://value-service.adsp.alberta.ca';
|
|
119
|
+
const top = 50;
|
|
120
|
+
const timestampMin = `2021-10-10T12:00:00Z`;
|
|
109
121
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
122
|
+
const response = await fetch(
|
|
123
|
+
`${valueServiceUrl}/value/v1/event-service/values/event?top=${top}×tampMin=${timestampMin}`,
|
|
124
|
+
{
|
|
125
|
+
method: 'GET',
|
|
126
|
+
headers: { Authorization: `Bearer ${accessToken}` },
|
|
127
|
+
},
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
const { results, page } = await response.json();
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Count events in the event log
|
|
134
|
+
|
|
135
|
+
The count of events matching the event log search criteria is available directly from the event service, so
|
|
136
|
+
consumers do not need to use the value API. Namespace and name are each optional and independent of one another;
|
|
137
|
+
other supplied criteria (timestamp range, correlation ID) are combined with namespace and name when determining
|
|
138
|
+
the count.
|
|
139
|
+
|
|
140
|
+
```typescript
|
|
141
|
+
const eventServiceUrl = 'https://event-service.adsp.alberta.ca';
|
|
142
|
+
const timestampMin = `2021-10-10T12:00:00Z`;
|
|
143
|
+
|
|
144
|
+
const response = await fetch(
|
|
145
|
+
`${eventServiceUrl}/event/v1/events/count?namespace=application-events×tampMin=${timestampMin}`,
|
|
146
|
+
{
|
|
147
|
+
method: 'GET',
|
|
148
|
+
headers: { Authorization: `Bearer ${accessToken}` },
|
|
149
|
+
},
|
|
150
|
+
);
|
|
117
151
|
|
|
118
|
-
|
|
119
|
-
results,
|
|
120
|
-
page,
|
|
121
|
-
} = await response.json();
|
|
152
|
+
const { count } = await response.json();
|
|
122
153
|
```
|
|
@@ -15,9 +15,11 @@ client `urn:ads:platform:form-service`
|
|
|
15
15
|
|
|
16
16
|
| name | description |
|
|
17
17
|
|:-|:-|
|
|
18
|
-
| form-admin | Administrator role for form service. This role allows a user to query and unlock forms. |
|
|
18
|
+
| form-admin | Administrator role for form service. This role allows a user to query and unlock forms, and to manage data registers. |
|
|
19
19
|
| intake-application | Intake application role for form service. This role is used to grant a service account the ability to retrieve draft forms and submit forms on behalf of an anonymous applicant. |
|
|
20
20
|
|
|
21
|
+
The data register API also accepts the configuration service role `urn:ads:platform:configuration-service:configuration-admin`, which tenant administrators have by default.
|
|
22
|
+
|
|
21
23
|
|
|
22
24
|
## Concepts
|
|
23
25
|
### Form definition
|
|
@@ -29,6 +31,43 @@ Form represents a particular instance of an application including the informatio
|
|
|
29
31
|
### Draft expiry
|
|
30
32
|
Draft forms include an expiry process so that information entered into draft forms are purged if the draft is abandoned. If a draft form is not accessed for some expiry period, the form is locked and the applicant is notified. In this state, the form cannot be accessed by the applicant but can be unlocked by an administrator. If the form remains in a locked state for some additional expiry period, the form is deleted so that applicant information is not unnecessarily retained.
|
|
31
33
|
|
|
34
|
+
### Data register
|
|
35
|
+
Data register is a named list of values used to populate drop downs and other choice controls in forms. Each value is either a string or an object, such as a `label` and `value` pair. Forms reference a register by its URN in the UI schema. See the [data registers tutorial](../tutorials/form-service/data-registers.md) for how to use registers in a form.
|
|
36
|
+
|
|
37
|
+
## Data registers
|
|
38
|
+
Form service provides an API to manage the data registers of a tenant. Tenant administrators can also manage them in the tenant management webapp under Form service → Register data.
|
|
39
|
+
|
|
40
|
+
Form service stores each register in the [configuration service](configuration-service.md) in two parts:
|
|
41
|
+
- **Definition**: the `data-register:<name>` entry in the tenant's `platform:configuration-service` configuration. It holds the register's schema and description.
|
|
42
|
+
- **Entries**: the configuration with namespace `data-register` and the register's name. It holds the array of values.
|
|
43
|
+
|
|
44
|
+
### Endpoints
|
|
45
|
+
All endpoints require a user with the `urn:ads:platform:form-service:form-admin` role or the `urn:ads:platform:configuration-service:configuration-admin` role, in the context of a tenant. A core user must specify the tenant with the `tenantId` query parameter. Every endpoint returns 401 if the user is not authenticated, 403 if the user has neither role, and 502 if configuration service fails.
|
|
46
|
+
|
|
47
|
+
| Method | Path | Description | Responses |
|
|
48
|
+
|:-|:-|:-|:-|
|
|
49
|
+
| GET | `/form/v1/registers` | Lists the tenant's data registers. | 200 |
|
|
50
|
+
| GET | `/form/v1/registers/{name}` | Gets a data register. | 200, 404 |
|
|
51
|
+
| POST | `/form/v1/registers` | Creates a data register from `name`, `description` and `entries`. `entries` defaults to an empty array. | 201, 400, 409 |
|
|
52
|
+
| PATCH | `/form/v1/registers/{name}` | Updates `description` and/or `entries`. A field that is not sent is left unchanged. | 200, 400, 404 |
|
|
53
|
+
| DELETE | `/form/v1/registers/{name}` | Deletes the data register's entries and definition. | 204, 404 |
|
|
54
|
+
|
|
55
|
+
Registers are returned as `{ namespace: 'data-register', name, description, entries }`.
|
|
56
|
+
|
|
57
|
+
### Rules
|
|
58
|
+
- **Existence**: a register exists only when both its definition (with an array schema) and its entries exist. A register missing either part is not listed. It returns 404 and does not block a create with the same name. This means a create or delete can be retried after a partial failure.
|
|
59
|
+
- **Active revision**: `entries` come from the active revision of the configuration, or from the latest revision if none is active. The form app uses the same revision at runtime.
|
|
60
|
+
- **Writing entries publishes them**: configuration service only writes to the latest revision. When a create or update writes `entries` and an older revision is pinned as active, the pin moves to the revision just written, so the change is live straight away. The older revision stays in the revision history and can be pinned again in configuration service. Updating only `description` leaves the pin alone.
|
|
61
|
+
- **Names**: 1 to 50 letters, numbers, spaces, hyphens and underscores. Names can't start or end with a space. Names are case sensitive.
|
|
62
|
+
- **Entries**: an array whose items are all strings or objects.
|
|
63
|
+
- **URN**: forms reference a register as `urn:ads:platform:configuration:v2:/configuration/data-register/<name>`. The name is not URL encoded in the URN.
|
|
64
|
+
- **Deleting removes data**: a delete removes the register's entries, including their revision history, and its definition. Forms that reference the register lose its options.
|
|
65
|
+
- **Anonymous access**: registers are not readable by anonymous applicants unless `anonymousRead` is set on the definition in configuration service. An update keeps this setting, but the API does not set it.
|
|
66
|
+
- **Errors**: when configuration service rejects a request, form service returns 400. When configuration service fails or denies access, form service returns 502.
|
|
67
|
+
- **Service account role**: form service calls configuration service with its own service account. Deleting a register and moving the active revision need that account to have the configuration service `configuration-admin` role.
|
|
68
|
+
|
|
69
|
+
Form service does not emit its own events for data registers. Configuration service emits `configuration-updated` and `configuration-deleted` for the underlying configuration.
|
|
70
|
+
|
|
32
71
|
## Code examples
|
|
33
72
|
### Create a draft form for an anonymous applicant
|
|
34
73
|
```typescript
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: page
|
|
3
|
+
title: Project planner service
|
|
4
|
+
nav_order: 20
|
|
5
|
+
parent: Services
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Project planner service
|
|
9
|
+
Project planner service helps people new to ADSP describe a business problem and turn it into a plan for using ADSP services. It builds a structured *business model* of the problem, matches it to known GoA *business patterns*, proposes *solution hypotheses* with recommended services, and points the user to each service's workspace.
|
|
10
|
+
|
|
11
|
+
Recommendations are hypotheses for the user to refine; the planner is not a replacement for early discovery or business analysis.
|
|
12
|
+
|
|
13
|
+
## Client roles
|
|
14
|
+
client `urn:ads:platform:project-planner-service`
|
|
15
|
+
|
|
16
|
+
| name | description |
|
|
17
|
+
|:-|:-|
|
|
18
|
+
| planner-admin | Administrator role. Allows access to all solutions in the tenant. |
|
|
19
|
+
| planner-user | User role. Allows creating and working on own solutions. |
|
|
20
|
+
|
|
21
|
+
## Concepts
|
|
22
|
+
### Solution
|
|
23
|
+
The persistent state of a planning effort: problem statement, business concepts (actors, goals, activities, decisions, evidence, business rules, constraints, evaluation criteria, workflows, outcomes, documents, events, external systems, assumptions, unknowns), decisions with the reasons they were made, open questions, pattern matches, hypotheses, specialist progress, artifacts and next steps. A solution survives across sessions so users do not need to repeat information.
|
|
24
|
+
|
|
25
|
+
### Business pattern
|
|
26
|
+
A template describing a typical GoA application type: domain language, strong and weak signals, likely service mappings, clarifying questions, assumptions and known unknowns. The 19 application types from the planner requirements are built in (Case Management is fully specified). Tenants can extend or override patterns through configuration in the `platform:project-planner-service` namespace and name.
|
|
27
|
+
|
|
28
|
+
Matching is deterministic: each domain term counts 1 and each strong signal counts 2. Weak signals never add to the score. A score of 8 or more is high confidence, 4 or more is medium, otherwise low; low confidence results include the pattern's clarifying questions.
|
|
29
|
+
|
|
30
|
+
### Specialist
|
|
31
|
+
Each ADSP service has a specialist definition with questions, dependencies, risks and a workspace path. Consulting a specialist reports fit for the solution, questions to ask, dependency status and risks.
|
|
32
|
+
|
|
33
|
+
Specialists have two responsibilities:
|
|
34
|
+
|
|
35
|
+
1. **Guide the planner.** When the planner consults a specialist (`POST /solutions/{id}/consult/{service}`), the result states whether the service is a good fit (`fit`), which parts of the solution it can support (`supports`), constraints, dependencies and risks the planner may not have considered, and, when a plan is supplied in `proposal`, a `validation` verdict (`sound`, `needs-changes` or `not-a-fit`) with findings.
|
|
36
|
+
2. **Guide a user directly.** `POST /specialists/{service}/chat` is a multi-turn conversation with a single service specialist and needs no planner session. The `intent` selects the task: `ask` (answer questions), `recommend` (service-specific solutions), `design` (refine a service-specific design), `validate` (verdict and findings) or `sample` (sample code or configuration). The response contains `chatId`, `reply`, `suggestions`, `samples`, `validation` and `followUps`. An optional `solutionId` gives the specialist the solution context. Without AI, a rule-based reply with the service's questions and pitfalls is returned.
|
|
37
|
+
|
|
38
|
+
## API
|
|
39
|
+
Base path `/planner/v1`. See the service swagger docs for details.
|
|
40
|
+
|
|
41
|
+
| method | path | description |
|
|
42
|
+
|:-|:-|:-|
|
|
43
|
+
| GET | /patterns, /patterns/{patternId} | Retrieve business patterns. |
|
|
44
|
+
| POST | /patterns/match | Match free text against patterns. |
|
|
45
|
+
| POST | /patterns | Create a custom pattern (admin). |
|
|
46
|
+
| PUT | /patterns/{id} | Update or customize a pattern (admin). |
|
|
47
|
+
| DELETE | /patterns/{id} | Delete a custom pattern or reset a customized built-in (admin). |
|
|
48
|
+
| GET | /specialists | Retrieve service specialists. |
|
|
49
|
+
| GET, POST | /solutions | List own solutions (all for planner-admin) or create one. |
|
|
50
|
+
| GET, PATCH, DELETE | /solutions/{id} | Retrieve, update, or delete a solution. |
|
|
51
|
+
| POST | /solutions/{id}/analyze | Extract concepts, match patterns, generate hypotheses and next steps. Body `mode` is `ai` (default when a model is configured) or `rules`. |
|
|
52
|
+
| POST | /solutions/{id}/consult/{service} | Consult a service specialist. Optional body `question`, `proposal` and `mode`. |
|
|
53
|
+
| POST | /specialists/{service}/chat | Converse directly with a service specialist. Body `message` (required), `chatId` (continues a saved chat), `intent`, `solutionId`, `mode`. The server keeps the history. |
|
|
54
|
+
| GET | /specialists/chats | List your saved specialist chats (filters service, solutionId). |
|
|
55
|
+
| GET | /specialists/chats/export | Download all your chats as JSON. |
|
|
56
|
+
| GET | /specialists/chats/{chatId} | Load a saved chat. |
|
|
57
|
+
| GET | /specialists/chats/{chatId}/export | Download one chat as JSON. |
|
|
58
|
+
| DELETE | /specialists/chats/{chatId} | Delete a saved chat. |
|
|
59
|
+
| POST | /solutions/{id}/chat | Send a message (`{message, mode}`); the analysis is refined using the answers and conversation and the reply is appended to `state.conversation`. |
|
|
60
|
+
| POST | /solutions/{id}/blueprint | Generates the complete project blueprint (`state.blueprint`): overview, technical architecture (layers and diagram), ADSP service mapping, notes from specialist consultations of every recommended service, core workflows, data and governance, and delivery plan. Saved consultations are reused; body `{mode?, refreshConsultations?}`. Requires an analyzed solution (400 otherwise). |
|
|
61
|
+
| POST | /solutions/{id}/discovery | Discovery conversation (Compressed View Mode 2). Body `{message?, mode?, force?, restart?}`. The planner replies with one message of clarifying questions and scores six factors (problem, users, process, information, communication, constraints). When the average (`state.confidence.score`) reaches 50, or `force` is true, the solution is analyzed and presented (`state.discovery.ready`). `restart` clears the discovery thread. Replies keep working after the solution is presented: each one re-runs the analysis, so the solution is refined from the discovery answers. |
|
|
62
|
+
| PUT | /solutions/{id}/questions/{questionId} | Answer a clarifying question (`{answer}`); an empty answer reopens it. |
|
|
63
|
+
| GET | /solutions/{id}/export | Download the solution as a JSON attachment. |
|
|
64
|
+
| GET | /analysis/options | Available analysis modes, the default mode and the model name. |
|
|
65
|
+
|
|
66
|
+
## AI analysis
|
|
67
|
+
AI analysis calls an OpenAI-compatible chat completions endpoint (the GoA Model as a Service) and is the default mode when `MAAS_API_KEY` is set. The result is validated against the pattern catalog and specialist list. If the model call fails or is not configured, the service falls back to rule-based analysis and records a warning in the solution `analysis` field. Requests retry up to 3 times with exponential backoff on 5xx, 429 and network errors.
|
|
68
|
+
|
|
69
|
+
| environment variable | default | description |
|
|
70
|
+
|:-|:-|:-|
|
|
71
|
+
| MAAS_API_KEY | | Virtual key for the model service. Supply as a secret; AI mode is off when empty. |
|
|
72
|
+
| MAAS_BASE_URL | https://maas.int.gov.ab.ca/v1 | Model service base URL. |
|
|
73
|
+
| MAAS_MODEL | GOA-Default | Model name. |
|
|
74
|
+
| MAAS_TIMEOUT_MS | 120000 | Per-request timeout. |
|
|
75
|
+
|
|
76
|
+
## Events
|
|
77
|
+
| name | description |
|
|
78
|
+
|:-|:-|
|
|
79
|
+
| solution-created | Signalled when a solution is created. |
|
|
80
|
+
| solution-updated | Signalled when a solution is updated, analyzed or consulted. |
|
|
81
|
+
| solution-deleted | Signalled when a solution is deleted. |
|
|
82
|
+
|
|
83
|
+
## Business pattern library
|
|
84
|
+
|
|
85
|
+
The service ships 19 built-in business patterns (case management, grant applications, permit/licence, registration, inspection, complaint intake, consultation, eligibility, booking, document submission, incident reporting, FOIP-style requests, referral routing, status tracking, audit trail, public reporting, document generation, notification subscriptions, internal service requests). Each pattern provides: name, purpose, domain language, common features (`commonFeatures`), strong signals, weak or misleading signals, likely ADSP service mappings (each with a reason), clarifying questions, assumptions and known unknowns. Tenants manage patterns through the API (`planner-admin` role only for writes):
|
|
86
|
+
|
|
87
|
+
- `POST /patterns` creates a custom pattern. The `id` is optional and defaults to a slug of the name.
|
|
88
|
+
- `PUT /patterns/{id}` updates a pattern. Updating a built-in pattern stores a tenant copy that overrides it.
|
|
89
|
+
- `DELETE /patterns/{id}` deletes a custom pattern. Deleting a customized built-in pattern restores the built-in version. Built-in patterns themselves cannot be deleted.
|
|
90
|
+
Each pattern returned by the API has a `source` of `built-in`, `customized` or `custom`. The effective catalogue is built-in patterns, overridden by configuration (`patterns`), overridden by tenant patterns stored through the API, and it feeds both rule-based matching and AI analysis. Service mappings must reference a known specialist service.
|