@abgov/adsp-sdk-mcp-server 0.0.0

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.
Files changed (124) hide show
  1. package/README.md +51 -0
  2. package/assets/docs/architecture.md +79 -0
  3. package/assets/docs/getting-started.md +118 -0
  4. package/assets/docs/important-notes.md +47 -0
  5. package/assets/docs/index.md +9 -0
  6. package/assets/docs/platform/deployment.md +80 -0
  7. package/assets/docs/platform/getting-started.md +66 -0
  8. package/assets/docs/platform/operations.md +8 -0
  9. package/assets/docs/platform/platform-django-sdk.md +330 -0
  10. package/assets/docs/platform/platform-dotnet-sdk.md +457 -0
  11. package/assets/docs/platform/platform-flask-sdk.md +355 -0
  12. package/assets/docs/platform/platform-node-sdk.md +433 -0
  13. package/assets/docs/platform/platform-spring-sdk.md +344 -0
  14. package/assets/docs/platform/platform.md +8 -0
  15. package/assets/docs/services/access-service.md +75 -0
  16. package/assets/docs/services/agent-service.md +316 -0
  17. package/assets/docs/services/cache-service.md +61 -0
  18. package/assets/docs/services/calendar-service.md +86 -0
  19. package/assets/docs/services/comment-service.md +87 -0
  20. package/assets/docs/services/configuration-service.md +92 -0
  21. package/assets/docs/services/directory-service.md +57 -0
  22. package/assets/docs/services/event-service.md +122 -0
  23. package/assets/docs/services/feedback-service.md +152 -0
  24. package/assets/docs/services/file-service.md +164 -0
  25. package/assets/docs/services/form-service.md +149 -0
  26. package/assets/docs/services/notification-service.md +151 -0
  27. package/assets/docs/services/pdf-service.md +116 -0
  28. package/assets/docs/services/pii-service.md +45 -0
  29. package/assets/docs/services/push-service.md +106 -0
  30. package/assets/docs/services/services.md +6 -0
  31. package/assets/docs/services/status-service.md +29 -0
  32. package/assets/docs/services/task-service.md +139 -0
  33. package/assets/docs/services/tenant-service.md +18 -0
  34. package/assets/docs/services/token-handler.md +135 -0
  35. package/assets/docs/services/value-service.md +80 -0
  36. package/assets/docs/services/verify-service.md +61 -0
  37. package/assets/docs/tutorials/access-service/access-service.md +9 -0
  38. package/assets/docs/tutorials/access-service/adsp-clients.md +29 -0
  39. package/assets/docs/tutorials/access-service/application-clients.md +61 -0
  40. package/assets/docs/tutorials/access-service/front-end-access.md +53 -0
  41. package/assets/docs/tutorials/access-service/introduction.md +33 -0
  42. package/assets/docs/tutorials/access-service/tenants.md +68 -0
  43. package/assets/docs/tutorials/access-service/themes.md +43 -0
  44. package/assets/docs/tutorials/feedback-service/accessing-data.md +41 -0
  45. package/assets/docs/tutorials/feedback-service/feedback-service.md +9 -0
  46. package/assets/docs/tutorials/feedback-service/installation.md +142 -0
  47. package/assets/docs/tutorials/feedback-service/introduction.md +28 -0
  48. package/assets/docs/tutorials/feedback-service/security.md +40 -0
  49. package/assets/docs/tutorials/feedback-service/triggering.md +21 -0
  50. package/assets/docs/tutorials/file-service/file-service.md +9 -0
  51. package/assets/docs/tutorials/file-service/file-types.md +35 -0
  52. package/assets/docs/tutorials/file-service/introduction.md +34 -0
  53. package/assets/docs/tutorials/file-service/security.md +31 -0
  54. package/assets/docs/tutorials/file-service/working-with.md +65 -0
  55. package/assets/docs/tutorials/form-service/Integration.md +31 -0
  56. package/assets/docs/tutorials/form-service/ai-agent.md +450 -0
  57. package/assets/docs/tutorials/form-service/building-forms.md +264 -0
  58. package/assets/docs/tutorials/form-service/cheat-sheet.md +1461 -0
  59. package/assets/docs/tutorials/form-service/custom-error-messages.md +87 -0
  60. package/assets/docs/tutorials/form-service/data-registers.md +204 -0
  61. package/assets/docs/tutorials/form-service/file-uploader.md +81 -0
  62. package/assets/docs/tutorials/form-service/form-app.md +72 -0
  63. package/assets/docs/tutorials/form-service/form-editor.md +62 -0
  64. package/assets/docs/tutorials/form-service/form-service.md +9 -0
  65. package/assets/docs/tutorials/form-service/form-submissions.md +77 -0
  66. package/assets/docs/tutorials/form-service/instructions.md +173 -0
  67. package/assets/docs/tutorials/form-service/introduction.md +66 -0
  68. package/assets/docs/tutorials/form-service/repeated-items.md +87 -0
  69. package/assets/docs/tutorials/form-service/security.md +36 -0
  70. package/assets/docs/tutorials/form-service/steppers.md +237 -0
  71. package/assets/docs/tutorials/notification-service/emailAttachment.md +75 -0
  72. package/assets/docs/tutorials/notification-service/events.md +20 -0
  73. package/assets/docs/tutorials/notification-service/introduction.md +37 -0
  74. package/assets/docs/tutorials/notification-service/notification-service.md +9 -0
  75. package/assets/docs/tutorials/notification-service/notification-types.md +86 -0
  76. package/assets/docs/tutorials/notification-service/subscribers.md +33 -0
  77. package/assets/docs/tutorials/pdf-service/building-a-template.md +339 -0
  78. package/assets/docs/tutorials/pdf-service/generate-a-pdf.md +150 -0
  79. package/assets/docs/tutorials/pdf-service/handlebars.md +51 -0
  80. package/assets/docs/tutorials/pdf-service/introduction.md +26 -0
  81. package/assets/docs/tutorials/pdf-service/pdf-service.md +9 -0
  82. package/assets/docs/tutorials/pdf-service/puppeteer.md +25 -0
  83. package/assets/docs/tutorials/pdf-service/video.md +18 -0
  84. package/assets/docs/tutorials/status-service/Introduction.md +46 -0
  85. package/assets/docs/tutorials/status-service/health.md +51 -0
  86. package/assets/docs/tutorials/status-service/notices.md +34 -0
  87. package/assets/docs/tutorials/status-service/notifications.md +107 -0
  88. package/assets/docs/tutorials/status-service/status-service.md +9 -0
  89. package/assets/docs/tutorials/status-service/status.md +35 -0
  90. package/assets/docs/tutorials/status-service/webhooks.md +24 -0
  91. package/assets/docs/tutorials/task-service/introduction.md +23 -0
  92. package/assets/docs/tutorials/task-service/task-app.md +43 -0
  93. package/assets/docs/tutorials/task-service/task-definitions.md +49 -0
  94. package/assets/docs/tutorials/task-service/task-queues.md +67 -0
  95. package/assets/docs/tutorials/task-service/task-service.md +9 -0
  96. package/assets/docs/tutorials/tutorials.md +8 -0
  97. package/package.json +18 -0
  98. package/src/docs/docsRepository.d.ts +22 -0
  99. package/src/docs/docsRepository.js +110 -0
  100. package/src/docs/docsRepository.js.map +1 -0
  101. package/src/main.d.ts +2 -0
  102. package/src/main.js +16 -0
  103. package/src/main.js.map +1 -0
  104. package/src/sdk-reference/reference.d.ts +17 -0
  105. package/src/sdk-reference/reference.js +547 -0
  106. package/src/sdk-reference/reference.js.map +1 -0
  107. package/src/sdk-reference/search.d.ts +6 -0
  108. package/src/sdk-reference/search.js +41 -0
  109. package/src/sdk-reference/search.js.map +1 -0
  110. package/src/server.d.ts +6 -0
  111. package/src/server.js +30 -0
  112. package/src/server.js.map +1 -0
  113. package/src/tools/registerDocsTools.d.ts +3 -0
  114. package/src/tools/registerDocsTools.js +66 -0
  115. package/src/tools/registerDocsTools.js.map +1 -0
  116. package/src/tools/registerQuickstartTool.d.ts +2 -0
  117. package/src/tools/registerQuickstartTool.js +82 -0
  118. package/src/tools/registerQuickstartTool.js.map +1 -0
  119. package/src/tools/registerSdkTools.d.ts +2 -0
  120. package/src/tools/registerSdkTools.js +43 -0
  121. package/src/tools/registerSdkTools.js.map +1 -0
  122. package/src/tools/types.d.ts +12 -0
  123. package/src/tools/types.js +3 -0
  124. package/src/tools/types.js.map +1 -0
@@ -0,0 +1,316 @@
1
+ ---
2
+ layout: page
3
+ title: Agent service
4
+ nav_order: 21
5
+ parent: Services
6
+ ---
7
+
8
+ # Agent service
9
+
10
+ Agent service provides AI-powered agents that can assist users with various tasks. The service supports configurable agents with custom instructions, tools, and role-based access control. Agents can be accessed via REST API or WebSocket for real-time streaming interactions.
11
+
12
+ ## Client roles
13
+
14
+ client `urn:ads:platform:agent-service`
15
+
16
+ | name | description |
17
+ | :--------- | :------------------------------------------------------------------------------------------------------- |
18
+ | agent-user | Role for users with access to agents. Included in tenant admin role. |
19
+ | agent-tool | Agent tool role assigned to agent service service account. Used to grant resource access to agent tools. |
20
+
21
+ Users must have the `urn:ads:platform:agent-service:agent-user` client role to interact with agents. Additionally, agents can be configured with specific `userRoles` to restrict access to particular user roles.
22
+
23
+ ## Concepts
24
+
25
+ ### Agent
26
+
27
+ An agent is an AI assistant configured with specific instructions, tools, and optional access to other agents. Agents are configured in the [configuration service](configuration-service.md) under the `platform:agent-service` namespace and name.
28
+
29
+ Each agent configuration includes:
30
+
31
+ - **name**: Display name for the agent
32
+ - **description**: Optional description of the agent's purpose
33
+ - **instructions**: System prompt that defines the agent's behavior
34
+ - **outputSchema**: Optional JSON Schema object that defines the structure of the agent's response. When configured, the agent will return structured output matching this schema alongside text responses.
35
+ - **userRoles**: Optional array of roles required to use the agent
36
+ - **agents**: Optional array of other agent IDs this agent can delegate to
37
+ - **tools**: Optional array of tools available to the agent
38
+ - **mcp**: Optional MCP server configuration that adds tools from external MCP servers. You can optionally limit access with `capabilities` per server.
39
+
40
+ ### Tools
41
+
42
+ Tools extend agent capabilities by allowing them to perform specific actions. The service provides built-in tools and supports custom API request tools.
43
+
44
+ Built-in tools:
45
+
46
+ - `schemaDefinitionTool`: Retrieves JSON schema definitions
47
+ - `formConfigurationRetrievalTool`: Retrieves form configurations
48
+ - `formConfigurationUpdateTool`: Updates form configurations
49
+ - `fileDownloadTool`: Downloads files from the file service
50
+
51
+ Custom API tools can be configured to call external APIs on behalf of the agent.
52
+
53
+ ### Threads
54
+
55
+ Conversations with agents are organized into threads. Each thread maintains context across multiple messages, allowing for coherent multi-turn conversations. Thread IDs can be provided by the client or generated automatically.
56
+
57
+ ### Structured Output
58
+
59
+ Agents can be configured with a JSON Schema that defines the structure of their output. When an agent has an `outputSchema` defined, it will return both text responses and structured JSON objects matching that schema. This is useful for extracting machine-readable data from agent responses, such as:
60
+
61
+ - Parsing form data
62
+ - Extracting entities or classifications
63
+ - Standardized API responses
64
+ - Validating response format
65
+
66
+ The agent will attempt to return data matching the schema; if schema validation fails, the agent will fall back to text-only responses with a warning in the conversation logs.
67
+
68
+ ## Code examples
69
+
70
+ ### Configure an agent
71
+
72
+ Agents are configured using the [configuration service](configuration-service.md). Note that new configuration may take up to 15 mins to apply.
73
+
74
+ ```typescript
75
+ const configurationServiceUrl = 'https://configuration-service.adsp.alberta.ca';
76
+
77
+ const request = {
78
+ operation: 'UPDATE',
79
+ update: {
80
+ 'my-assistant': {
81
+ name: 'My Assistant',
82
+ description: 'A helpful assistant for my application',
83
+ instructions: 'You are a helpful assistant. Answer questions clearly and concisely.',
84
+ userRoles: ['my-app-user'],
85
+ tools: ['schemaDefinitionTool'],
86
+ },
87
+ },
88
+ };
89
+
90
+ await fetch(`${configurationServiceUrl}/configuration/v2/configuration/platform/agent-service`, {
91
+ method: 'PATCH',
92
+ headers: {
93
+ Authorization: `Bearer ${accessToken}`,
94
+ 'Content-Type': 'application/json',
95
+ },
96
+ body: JSON.stringify(request),
97
+ });
98
+ ```
99
+
100
+ ### List available agents
101
+
102
+ ```typescript
103
+ const agentServiceUrl = 'https://agent-service.adsp.alberta.ca';
104
+
105
+ const response = await fetch(`${agentServiceUrl}/agent/v1/agents`, {
106
+ method: 'GET',
107
+ headers: {
108
+ Authorization: `Bearer ${accessToken}`,
109
+ },
110
+ });
111
+
112
+ const { agents } = await response.json();
113
+ ```
114
+
115
+ ### Message an agent (REST API)
116
+
117
+ Send a message to an agent and receive a complete response. If the agent has a `outputSchema` configured, the response will also include a `output` field with structured data.
118
+
119
+ ```typescript
120
+ const agentServiceUrl = 'https://agent-service.adsp.alberta.ca';
121
+ const agentId = 'my-assistant';
122
+
123
+ const response = await fetch(`${agentServiceUrl}/agent/v1/agents/${agentId}`, {
124
+ method: 'POST',
125
+ headers: {
126
+ Authorization: `Bearer ${accessToken}`,
127
+ 'Content-Type': 'application/json',
128
+ },
129
+ body: JSON.stringify({
130
+ content: 'Hello, can you help me with a question?',
131
+ }),
132
+ });
133
+
134
+ const { agent, content, output } = await response.json();
135
+
136
+ // content contains the text response
137
+ // output contains structured data if outputSchema was configured (null otherwise)
138
+ if (output) {
139
+ console.log('Structured response:', output);
140
+ }
141
+ ```
142
+
143
+ ### Stream agent responses (WebSocket)
144
+
145
+ Connect via WebSocket for real-time streaming responses. The WebSocket endpoint uses Socket.IO and requires the tenant name as the namespace. When the response is complete, the done event will include any structured `output` if the agent has an `outputSchema` configured.
146
+
147
+ ```typescript
148
+ import { io } from 'socket.io-client';
149
+
150
+ const socket = io('https://agent-service.adsp.alberta.ca/My Tenant', {
151
+ auth: {
152
+ token: accessToken,
153
+ },
154
+ });
155
+
156
+ socket.on('connect', () => {
157
+ console.log('Connected to agent service');
158
+ });
159
+
160
+ // Send a message to an agent
161
+ socket.send({
162
+ agent: 'my-assistant',
163
+ threadId: 'optional-thread-id',
164
+ messageId: 'optional-message-id',
165
+ content: 'Hello, can you help me?',
166
+ context: {
167
+ // Optional context data for the agent
168
+ },
169
+ });
170
+
171
+ // Receive streaming response
172
+ socket.on('stream', (data) => {
173
+ const { agent, threadId, messageId, replyTo, content, output, done } = data;
174
+ if (done) {
175
+ console.log('Response complete');
176
+ // If the agent has a outputSchema, structured data is included here
177
+ if (output) {
178
+ console.log('Structured response:', output);
179
+ }
180
+ } else {
181
+ // Streaming text content arrives as deltas
182
+ process.stdout.write(content);
183
+ }
184
+ });
185
+
186
+ // Handle errors
187
+ socket.on('error', (message) => {
188
+ console.error('Agent error:', message);
189
+ });
190
+ ```
191
+
192
+ ### Configure a custom API tool
193
+
194
+ Agents can be configured with custom tools that call external APIs.
195
+
196
+ ```typescript
197
+ const request = {
198
+ operation: 'UPDATE',
199
+ update: {
200
+ 'api-assistant': {
201
+ name: 'API Assistant',
202
+ instructions: 'You help users interact with external APIs.',
203
+ tools: [
204
+ 'schemaDefinitionTool',
205
+ {
206
+ id: 'getWeather',
207
+ type: 'api',
208
+ description: 'Gets current weather for a location',
209
+ inputSchema: {
210
+ type: 'object',
211
+ properties: {
212
+ location: { type: 'string', description: 'City name' },
213
+ },
214
+ required: ['location'],
215
+ },
216
+ outputSchema: {
217
+ type: 'object',
218
+ properties: {
219
+ temperature: { type: 'number' },
220
+ conditions: { type: 'string' },
221
+ },
222
+ },
223
+ method: 'GET',
224
+ api: 'urn:ads:platform:weather-service:v1',
225
+ path: '/weather',
226
+ userContext: true,
227
+ },
228
+ ],
229
+ },
230
+ },
231
+ };
232
+ ```
233
+
234
+ ### Configure MCP server capabilities
235
+
236
+ Agents can be configured to use tools exposed by external MCP servers.
237
+
238
+ ```typescript
239
+ const request = {
240
+ operation: 'UPDATE',
241
+ update: {
242
+ 'mcp-assistant': {
243
+ name: 'MCP Assistant',
244
+ instructions: 'Use MCP tools when they help answer user requests.',
245
+ mcp: {
246
+ servers: [
247
+ {
248
+ id: 'goa-design-system',
249
+ url: 'https://example.com/mcp',
250
+ headers: {
251
+ Authorization: 'Bearer <mcp-token>',
252
+ },
253
+ // Optional: restrict to a subset of tools from this MCP server.
254
+ capabilities: ['getComponent', 'searchTokens'],
255
+ },
256
+ ],
257
+ },
258
+ },
259
+ },
260
+ };
261
+ ```
262
+
263
+ When loaded, MCP tools are namespaced as `<serverId>_<toolName>` to avoid naming collisions across servers.
264
+
265
+ ### Configure structured output
266
+
267
+ Agents can be configured with a JSON Schema to return structured data. This is useful for extracting machine-readable information from agent responses.
268
+
269
+ ```typescript
270
+ const configurationServiceUrl = 'https://configuration-service.adsp.alberta.ca';
271
+
272
+ const request = {
273
+ operation: 'UPDATE',
274
+ update: {
275
+ 'data-extractor': {
276
+ name: 'Data Extractor',
277
+ description: 'Extracts structured data from unstructured text',
278
+ instructions:
279
+ 'You are an expert at extracting structured information. Extract all relevant data and return it as valid JSON matching the provided schema.',
280
+ outputSchema: {
281
+ type: 'object',
282
+ properties: {
283
+ entities: {
284
+ type: 'array',
285
+ items: {
286
+ type: 'object',
287
+ properties: {
288
+ name: { type: 'string' },
289
+ type: { type: 'string', enum: ['person', 'organization', 'location'] },
290
+ confidence: { type: 'number', minimum: 0, maximum: 1 },
291
+ },
292
+ required: ['name', 'type'],
293
+ },
294
+ },
295
+ sentiment: {
296
+ type: 'string',
297
+ enum: ['positive', 'neutral', 'negative'],
298
+ },
299
+ summary: { type: 'string' },
300
+ },
301
+ required: ['entities', 'sentiment'],
302
+ },
303
+ tools: ['schemaDefinitionTool'],
304
+ },
305
+ },
306
+ };
307
+
308
+ await fetch(`${configurationServiceUrl}/configuration/v2/configuration/platform/agent-service`, {
309
+ method: 'PATCH',
310
+ headers: {
311
+ Authorization: `Bearer ${accessToken}`,
312
+ 'Content-Type': 'application/json',
313
+ },
314
+ body: JSON.stringify(request),
315
+ });
316
+ ```
@@ -0,0 +1,61 @@
1
+ ---
2
+ layout: page
3
+ title: Cache service
4
+ nav_order: 20
5
+ parent: Services
6
+ ---
7
+
8
+ # Cache service
9
+ Cache service provides a read-through cache to upstream *targets*. Unlike generic HTTP shared cache solutions, the cache service is integrated into the ADSP multi-tenant security layer and user context aware. This allows it to cache resources protected by role-based access control (RBAC) using user-specific cache entries.
10
+
11
+ ## Client roles
12
+ client `urn:ads:platform:cache-service`
13
+
14
+ | name | description |
15
+ |:-|:-|
16
+ | cache-reader | Reader role that allows a user to make requests through the cache service API. |
17
+
18
+ Requests without a JWT bearer token in the `Authorization` header don't have any user context for cache service and associated responses are cached and shared across anonymous users. This is similar to regular HTTP shared caches.
19
+
20
+ Requests with a JWT bearer token in the `Authorization` header are handled in the user context, the credential is passed through for the upstream request, and associated responses are cached in the user context (effectively including `sub`, `aud`, claims related to roles). This means that:
21
+ - Two users making the same request will not share a cache entry
22
+ - One user authenticated in two contexts with different `aud` claim, such as from a limited public application and from a private application, making the same request will not share a cache entry between contexts.
23
+ - One user with two different short-lived access tokens making the same request can share a cache entry if the cache entry did not expire between requests. This is because access token specific claims like `exp` are not included in the user context for caching.
24
+
25
+
26
+ ## Limitations
27
+ ### Cache context
28
+ For each request, the cache service generically generates a cache key based on the request context including the request path, query, and user context. Matrix and custom header based parameters are not included.
29
+
30
+ The cache user context only includes a subset of values from the request access token including `sub`, `aud`, and roles related claims based on the default roles mapper. This allows cache entries to be reused across different access tokens, different relying party clients `azp`, and if basic profile attributes like name and email change. However, this means that non-RBAC based permission schemes will not generally work correctly with user context cache entries.
31
+
32
+ ### Cache invalidation
33
+ Cache invalidation is supported using a configurable TTL and via invalidation events. The cache key is a digest of the request values and cache service does not generally understand the semantic meaning of values (e.g. if an element of the path is a unique identifier of a domain entity). However, the cache service includes the cache key in an invalidation context set, which unlike the cache key is based only on the tenant and request path. Domain events that include the URN of an affected resource can be used to invalidate the set associated with that resource path. Note that the resource URN must be resolvable by the [directory](directory-service.md).
34
+
35
+ ### Client gzip support
36
+ Cache service makes upstream requests with `Accept-Encoding` header value of `gzip` and will cache the response content in its compressed form if the upstream server supports `gzip`. It will not decompress the content for clients, and so it will reject requests where `Accept-Encoding` indicates client does not accept `gzip`.
37
+
38
+ ## Concepts
39
+ ### Target
40
+ Targets are upstream services and APIs that cache service can provide read-through requests to. This configuration is a whitelist that restricts the upstream resources available through the cache service API. Targets are configured as service or API URNs and must be registered in [directory service](directory-service.md), and an associated TTL can be set. Targets are configured in the [configuration service](configuration-service.md) under the `platform:cache-service` namespace and name.
41
+
42
+ ### Access target
43
+ Cache service includes a special target for the [access service](access-service.md) admin API at `urn:ads:platform:access-service:v1`. This target is pre-configured for read-through to the admin API, and includes specific invalidation logic based on admin events. Note invalidation requires that the `adsp-event-listener` must be enabled in the tenant realm so that admin events are signaled via the [event service](event-service.md).
44
+
45
+ ## Code examples
46
+ ### Download file through cache
47
+ ```typescript
48
+ const fileApiId = 'urn:ads:platform:file-service:v1';
49
+ const fileId = '52269261-45c0-434e-9467-a888f0bcb4b7';
50
+ await fetch(
51
+ `https://cache-service.adsp.alberta.ca/cache/v1/cache/${fileApiId}/files/${fileId}/download`,
52
+ {
53
+ method: 'GET',
54
+ headers: {
55
+ 'Authorization': `Bearer ${accessToken}`,
56
+ }
57
+ }
58
+ );
59
+ ```
60
+
61
+ The cache service will add an `adsp-cache-status` header to the response with possible values of `HIT` and `MISS` to indicate if the response was retrieved from cache.
@@ -0,0 +1,86 @@
1
+ ---
2
+ layout: page
3
+ title: Calendar service
4
+ nav_order: 12
5
+ parent: Services
6
+ ---
7
+
8
+ # Calendar service
9
+ Calendar service provides information about dates, and a model for calendars, calendar events, and scheduling.
10
+
11
+ This service manages date and times in a particular timezone (America/Edmonton) rather than UTC or a particular UTC offset. In practice this means that dates within daylight savings will use MDT offset whereas dates outside will use MST offset. Date time values sent into the API will be converted to the service timezone.
12
+
13
+ ## Client roles
14
+ client `urn:ads:platform:calendar-service`
15
+
16
+ | name | description |
17
+ |:-|:-|
18
+ | calendar-admin | Administrator role for calendar service. This role allows a user to read and updated calendar events. |
19
+
20
+ User access is primary controlled via configuration on each calendar with `updaterRoles` and `readerRoles` representing: the roles that grant update permission; and roles that grand read permission respectively.
21
+
22
+ ## Concepts
23
+ ### Dates
24
+ Calendar service provides informational endpoints for Dates that includes information like which days are business days and which are holidays.
25
+
26
+ ### Calendar
27
+ Calender is a container for *events*. Each calender has basic name and description information which is publicly accessible. Calendars are configured in the [configuration service](configuration-service.md) under the `platform:calendar-service` namespace and name.
28
+
29
+ ### Calendar event
30
+ Calender 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.
31
+
32
+ ### Attendee
33
+ Attendees represent people attending a particular *event*. Blanks attendees (no name or email) can be created to represent available appointment slots.
34
+
35
+ ## Code examples
36
+ ### Getting business days
37
+ Calendar service API provides information endpoints for dates, including which dates are business days.
38
+ ```typescript
39
+ const top = 100;
40
+ const criteria = {
41
+ min: 20200101,
42
+ max: 20220101,
43
+ isBusinessDay: true,
44
+ }
45
+
46
+ const response = await fetch(
47
+ `https://calendar-service.adsp.alberta.ca/calendar/v1/dates?top=${top}&criteria=${JSON.stringify(criteria)}`
48
+ );
49
+
50
+ const {
51
+ results,
52
+ page,
53
+ } = await response.json();
54
+ ```
55
+
56
+ ### Creating a calendar event
57
+ ```typescript
58
+ const calendarEvent = {
59
+ name: 'My Event',
60
+ description: 'This is an example of a calendar event.',
61
+ start: '2021-11-02T12:00:00Z',
62
+ end: '2021-11-02T13:30:00Z',
63
+ isPublic: false,
64
+ }
65
+
66
+ const response = await fetch(
67
+ `https://calendar-service.adsp.alberta.ca/calendar/v1/calendars/${calendar}/events`,
68
+ {
69
+ method: 'POST',
70
+ headers: {
71
+ 'Authorization': `Bearer ${accessToken}`,
72
+ 'Content-Type': 'application/json',
73
+ },
74
+ body: JSON.stringify(calendarEvent),
75
+ }
76
+ );
77
+
78
+ const {
79
+ id,
80
+ name,
81
+ description,
82
+ start,
83
+ end,
84
+ isPublic,
85
+ } = await response.json();
86
+ ```
@@ -0,0 +1,87 @@
1
+ ---
2
+ layout: page
3
+ title: Comment service
4
+ nav_order: 16
5
+ parent: Services
6
+ ---
7
+
8
+ # Comment service
9
+ Comment service allows users to create topics and post comments against the topics. Topics are of a particular topic type, and the type determines the roles permitted to administer, read, or comment on a topic.
10
+
11
+ A topic is intended to be an aggregate root for comments, and should be associated to an entity that is the subject of the comments. Topic includes a `resourceId` property for referencing the associated entity. For example, in a case management use case, a topic references a case using the case ID, and comments regarding the case are children of that topic.
12
+
13
+ ## Client roles
14
+ client `urn:ads:platform:comment-service`
15
+
16
+ | name | description |
17
+ |:-|:-|
18
+ | comment-admin | Administrator role that grants permission to administer topics and comments. |
19
+ | topic-setter | Topic setter role that grants permissions to managed topics. |
20
+
21
+ Topic administer, read, or comment access is controlled by configuration of `adminRoles`, `readerRoles`, and `commenterRoles` on each topic type.
22
+
23
+ ## Concepts
24
+ ### Topic type
25
+ Topic type is configuration for a category of *topics*. The type includes configuration of roles allowed to administer, read, or comment on topics of the type. Topic types are configured in the [configuration service](configuration-service.md) under the `platform:comment-service` namespace and name.
26
+
27
+ ### Topic
28
+ Topics are aggregate roots of *comments* and represent the subject of associated *comments*. Topics are intended to reference entities in other domain models so that comments can be recorded against any entity.
29
+
30
+ ### Comment
31
+ Comments represent user authored descriptive information regarding a *topic* like notes or discussions.
32
+
33
+ ## Code examples
34
+
35
+ ### Create a topic
36
+ Create a topic referencing a case so that comments on the case can be created. `typeId` is the ID of a configured Topic type.
37
+
38
+ ```typescript
39
+ const response = await fetch(
40
+ 'https://comment-service.adsp.alberta.ca/comment/v1/topics',
41
+ {
42
+ method: 'POST',
43
+ headers: {
44
+ 'Authorization': `Bearer ${accessToken}`,
45
+ },
46
+ body: {
47
+ typeId: 'case-notes',
48
+ name: 'Comments on Case-123'
49
+ resourceId: 'urn:ads:demo:case-services:v1:/cases/case-123'
50
+ },
51
+ }
52
+ );
53
+
54
+ const {
55
+ id,
56
+ urn,
57
+ name,
58
+ resourceId,
59
+ securityClassification
60
+ } = await response.json();
61
+ ```
62
+
63
+ ### Add a comment to a topic
64
+ Add a comment against an existing topic, so that it can be retrieved and read later.
65
+
66
+ ```typescript
67
+ const response = await fetch(
68
+ `https://comment-service.adsp.alberta.ca/comment/v1/topics/${topicId}/comments`,
69
+ {
70
+ method: 'POST',
71
+ headers: {
72
+ 'Authorization': `Bearer ${accessToken}`,
73
+ },
74
+ body: {
75
+ title,
76
+ comment
77
+ },
78
+ }
79
+ );
80
+
81
+ const {
82
+ id,
83
+ title,
84
+ comment,
85
+ createdBy
86
+ } = await response.json();
87
+ ```
@@ -0,0 +1,92 @@
1
+ ---
2
+ layout: page
3
+ title: Configuration service
4
+ nav_order: 4
5
+ parent: Services
6
+ ---
7
+
8
+ # Configuration service
9
+ Configuration service provides a store for infrequently changing configuration and includes a concept of revisions to support 'version locking' of configuration. The service can store arbitrary json objects as configuration with support for optional write-time validation using json schemas.
10
+
11
+ ## Client roles
12
+ client `urn:ads:platform:configuration-service`
13
+
14
+ | name | description |
15
+ |:-|:-|
16
+ | configuration-admin | Administrator role for configuration service. This role grants read and write access to configuration. It is part of the tenant-admin composite role and allows tenant administrators to configure platform services. |
17
+ | configuration-reader | Reader role for configuration service. This role is used to allow service accounts to read configuration. |
18
+
19
+ ## Concepts
20
+ ### Configuration definition
21
+ Configuration definition is an optional metadata description for a particular *configuration* (identified by a specific namespace and name). The definition provides write-time validation via json schema. Configuration definitions are configured in the [configuration service](configuration-service.md) under the `platform:configuration-service` namespace and name.
22
+
23
+ ### Configuration
24
+ Configuration stores values represented by a json object at a particular namespace and name. Configuration includes *revisions* that represent current and past value snapshots.
25
+
26
+ ### Revision
27
+ Revisions are specific snapshots of *configuration*. Updates to configuration values are applied to the latest revision and the current value is captured in a snapshot when a new revision is created. This can be used to version lock configuration for consumers; the configured application should request a specific revision use deployment parameterization mechanisms, like environment variables, to allow for updating to later revisions.
28
+
29
+ ## Code examples
30
+ ### Read a revision of configuration
31
+ ```typescript
32
+ const configurationServiceUrl = 'https://configuration-service.adsp.alberta.ca';
33
+ const namespace = 'support';
34
+ const name = 'formula-values';
35
+ const response = await fetch(
36
+ `${configurationServiceUrl}/configuration/v2/configuration/${namespace}/${name}/revisions/1`,
37
+ {
38
+ method: 'GET',
39
+ headers: {
40
+ 'Authorization': `Bearer ${accessToken}`,
41
+ }
42
+ }
43
+ );
44
+ const configuration = await response.json();
45
+ ```
46
+
47
+ ### Update configuration
48
+ Updates are applied to the latest revision of configuration.
49
+ ```typescript
50
+ const configurationServiceUrl = 'https://configuration-service.adsp.alberta.ca';
51
+ const namespace = 'support';
52
+ const name = 'formula-values';
53
+ const request = {
54
+ operation: 'UPDATE',
55
+ update: {
56
+ valueA: 'this is a configuration value',
57
+ valueB: 123,
58
+ }
59
+ }
60
+
61
+ await fetch(
62
+ `${configurationServiceUrl}/configuration/v2/configuration/${namespace}/${name}`,
63
+ {
64
+ method: 'PATCH',
65
+ headers: {
66
+ 'Authorization': `Bearer ${accessToken}`,
67
+ 'Content-Type': 'application/json'
68
+ },
69
+ body: JSON.stringify(request),
70
+ }
71
+ );
72
+ ```
73
+
74
+ ### Create a revision
75
+ Create a revision to snapshot the latest configuration. The snapshot cannot be modified afterwards.
76
+ ```typescript
77
+ const configurationServiceUrl = 'https://configuration-service.adsp.alberta.ca';
78
+ const namespace = 'support';
79
+ const name = 'formula-values';
80
+
81
+ await fetch(
82
+ `${configurationServiceUrl}/configuration/v2/configuration/${namespace}/${name}`,
83
+ {
84
+ method: 'POST',
85
+ headers: {
86
+ 'Authorization': `Bearer ${accessToken}`,
87
+ 'Content-Type': 'application/json'
88
+ },
89
+ body: JSON.stringify({revision: true}),
90
+ }
91
+ );
92
+ ```