@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,151 @@
1
+ ---
2
+ layout: page
3
+ title: Notification service
4
+ nav_order: 9
5
+ parent: Services
6
+ ---
7
+
8
+ # Notification service
9
+ Notification service provides the ability to generate and send notifications based on domain events sent via the [event service](event-service.md). This service also includes a concept of subscriptions and subscribers to support management of subscriber preferences and unsubscribe.
10
+
11
+ *Subscribers* and *subscriptions* fall broadly into two categories: self-managed and application managed. Authenticated users with a subscriber role may subscribe to, managed, and unsubscribe from notifications based on their own access permissions; in this case the *subscriber* is associated with the user. Alternatively, applications can manage *subscriptions* under service account credentials and in this case the application determines the management actions available to the *subscriber*.
12
+
13
+ ## Client roles
14
+ client `urn:ads:platform:notification-service`
15
+
16
+ | name | description |
17
+ |:-|:-|
18
+ | subscription-admin | Administrator role for notification service subscriptions. This role grants read and write of subscriptions. For example, a user with this role can remove subscriptions and delete subscribers. |
19
+ | subscription-app | Subscription application role for the notification service. This role is used to grant service accounts permission to manage subscribers and subscriptions. |
20
+
21
+ ## Concepts
22
+ ### Notification type
23
+ Notification type represents a bundled set of notifications that can be subscribed to and provides the access roles for that set. For example, an 'Application Progress' type could include notifications for submission of the application, processing started, and application processed. A subscriber has a subscription to the set and cannot subscribe to the individual notifications in the set. Notification types are configured in the [configuration service](configuration-service.md) under the `platform:notification-service` namespace and name.
24
+
25
+ ### Notification
26
+ A notification is a specific communication sent to a subscriber. It contains a message and is send to an address via a specific channel.
27
+
28
+ ### Subscriber
29
+ A subscriber represents a receiver of notifications. Subscriber is not a representation of a specific person; i.e. a person may have distinct subscribers for notifications for traffic tickets versus for grants. Subscribers also do not necessarily have distinct emails or phone numbers and it is up to the consuming application to determine how subscribers are used in their domain.
30
+
31
+ ### Subscription
32
+ *Subscribers* have subscriptions to *notification types*. Each subscription relates a subscriber to a notification type and optionally includes criteria. The subscription criteria filters events that result in notifications to the associated subscriber. For example, in the case of 'Application Progress', the applicant is only subscribed to notifications regarding their specific application and this is handled as a subscription criteria.
33
+
34
+ ## Code examples
35
+ ### Configure a notification type
36
+ Notification types are configured using the [configuration service](configuration-service.md).
37
+
38
+ ```typescript
39
+ const configurationServiceUrl = 'https://configuration-service.adsp.alberta.ca';
40
+ const request = {
41
+ operation: 'UPDATE',
42
+ update: {
43
+ 'application-health-updates': {
44
+ id: 'application-health-updates',
45
+ name: 'Application Health Updates',
46
+ description: 'Provides notification of changes on application health checks.',
47
+ publicSubscribe: true,
48
+ subscriberRoles: [],
49
+ channels: ['email'],
50
+ events: [
51
+ {
52
+ namespace: 'status-service',
53
+ name: 'health-check-started',
54
+ templates: {
55
+ email: {
56
+ subject: '{{ event.payload.application.name }} Health Check Started',
57
+ body: 'Application health check started for {{ event.payload.application.name }}.',
58
+ }
59
+ },
60
+ }
61
+ ],
62
+ }
63
+ }
64
+ }
65
+
66
+ await fetch(
67
+ `${configurationServiceUrl}/configuration/v2/configuration/platform/notification-service`,
68
+ {
69
+ method: 'PATCH',
70
+ headers: {
71
+ 'Authorization': `Bearer ${accessToken}`,
72
+ 'Content-Type': 'application/json'
73
+ },
74
+ body: JSON.stringify(request),
75
+ }
76
+ );
77
+ ```
78
+
79
+ ### Subscribe to a notification type for the current user
80
+ Users can create a subscription for themselves and user details from the access token, like user email address, are used to populate the subscriber. A subscriber is created if there is no existing subscriber associated with the user ID.
81
+
82
+ For this type of subscription request, the user must have a subscriber role.
83
+
84
+ ```typescript
85
+ const response = await fetch(
86
+ `https://notification-service.adsp.alberta.ca/subscription/v1/types/${typeId}/subscriptions?userSub=true`,
87
+ {
88
+ method: 'POST',
89
+ headers: {
90
+ 'Authorization': `Bearer ${accessToken}`,
91
+ 'Content-Type': 'application/json',
92
+ },
93
+ body: JSON.stringify({
94
+ criteria: {
95
+ correlationId,
96
+ context,
97
+ },
98
+ }),
99
+ }
100
+ );
101
+
102
+ const {
103
+ typeId,
104
+ subscriber,
105
+ criteria,
106
+ } = await response.json();
107
+ ```
108
+
109
+ ### Update subscriber (notification preferences)
110
+ Users can update their subscriber preferences including the channels of notification. The order of channels represents the preferred channels for notifications.
111
+
112
+ ```typescript
113
+ const response = await fetch(
114
+ `https://notification-service.adsp.alberta.ca/subscription/v1/subscribers/${subscriberId}`,
115
+ {
116
+ method: 'PATCH',
117
+ headers: {
118
+ 'Authorization': `Bearer ${accessToken}`,
119
+ 'Content-Type': 'application/json',
120
+ },
121
+ body: JSON.stringify({
122
+ addressAs: 'A.N.Other',
123
+ channels: [
124
+ {
125
+ channel: 'email',
126
+ address: 'a.n.other@acme.org',
127
+ }
128
+ ]
129
+ }),
130
+ }
131
+ );
132
+
133
+ const {
134
+ id,
135
+ addressAs,
136
+ channels,
137
+ } = await response.json();
138
+ ```
139
+
140
+ ### Unsubscribe from a notification type
141
+ ```typescript
142
+ const response = await fetch(
143
+ `https://notification-service.adsp.alberta.ca/subscription/v1/types/${typeId}/subscriptions/${subscriberId}`,
144
+ {
145
+ method: 'DELETE',
146
+ headers: { 'Authorization': `Bearer ${accessToken}` },
147
+ }
148
+ );
149
+
150
+ const { deleted } = await response.json();
151
+ ```
@@ -0,0 +1,116 @@
1
+ ---
2
+ layout: page
3
+ title: PDF service
4
+ nav_order: 15
5
+ parent: Services
6
+ ---
7
+
8
+ # PDF service
9
+
10
+ PDF service provides utility PDF operations like generation of PDFs from templates. For a more in-depth description of how the service works, please see the [PDF Tutorial](/adsp-monorepo/tutorials/pdf-service/introduction.html)
11
+
12
+ ## Client roles
13
+
14
+ client `urn:ads:platform:pdf-service`
15
+
16
+ | name | description |
17
+ | :------------ | :----------------------------------------------------------------------------------------------------- |
18
+ | pdf-generator | Generator role for the PDF service. This role grants the ability to generate PDF files from templates. |
19
+
20
+ ## Concepts
21
+
22
+ ### PDF template
23
+
24
+ _Templates_ represent a standard PDF document with template variables for its contents.
25
+
26
+ ### Job
27
+
28
+ PDF service performs operations asynchronously using a job queue. _Jobs_ represent the state of those operations in the queue and are retained for around 24 hrs.
29
+
30
+ ## Code examples
31
+
32
+ ### Configure a template
33
+
34
+ Templates are configured using the [configuration service](configuration-service.md).
35
+
36
+ ```typescript
37
+ const configurationServiceUrl = 'https://configuration-service.adsp.alberta.ca';
38
+ const request = {
39
+ operation: 'UPDATE',
40
+ update: {
41
+ 'submission-summary': {
42
+ id: 'submission-summary',
43
+ name: 'Submission summary',
44
+ description: 'Provides a summary of the submission',
45
+ // HTML with handlebars template string
46
+ template,
47
+ },
48
+ },
49
+ };
50
+
51
+ await fetch(`${configurationServiceUrl}/configuration/v2/configuration/platform/pdf-service`, {
52
+ method: 'PATCH',
53
+ headers: {
54
+ Authorization: `Bearer ${accessToken}`,
55
+ 'Content-Type': 'application/json',
56
+ },
57
+ body: JSON.stringify(request),
58
+ });
59
+ ```
60
+
61
+ ### Create a PDF generation job
62
+
63
+ Generated PDFs are uploaded to the [file service](file-service.md) and the _file type_ used can be specified in the request. This allows you to generate a PDF file that can be directly downloaded by authorized users.
64
+
65
+ ```typescript
66
+ const request = {
67
+ operation: 'generate',
68
+ templateId: 'submission-summary',
69
+ filename: 'my-submission-summary.pdf'
70
+ fileType: 'submission-documents',
71
+ // Template is hydrated with a context of { data }; variables in the template should look like {{ data.myProperty }}.
72
+ data: {},
73
+ }
74
+
75
+ const response = await fetch(
76
+ 'https://pdf-service.adsp.alberta.ca/pdf/v1/jobs',
77
+ {
78
+ method: 'POST',
79
+ headers: {
80
+ 'Authorization': `Bearer ${accessToken}`,
81
+ 'Content-Type': 'application/json'
82
+ },
83
+ body: JSON.stringify(request),
84
+ }
85
+ );
86
+
87
+ const {
88
+ urn,
89
+ id,
90
+ status,
91
+ } = await response.json();
92
+ ```
93
+
94
+ ### Retrieving the generated PDF
95
+
96
+ Generated PDFs are uploaded to the file service.
97
+
98
+ ```typescript
99
+ const response = await fetch(`https://pdf-service.adsp.alberta.ca/pdf/v1/jobs/${jobId}`, {
100
+ method: 'GET',
101
+ headers: {
102
+ Authorization: `Bearer ${accessToken}`,
103
+ 'Content-Type': 'application/json',
104
+ },
105
+ });
106
+
107
+ const {
108
+ status,
109
+ result: { urn, id: fileId },
110
+ } = await response.json();
111
+
112
+ await fetch(`https://file-service.adsp.alberta.ca/file/v1/files/${fileId}/download`, {
113
+ method: 'GET',
114
+ headers: { Authorization: `Bearer ${accessToken}` },
115
+ });
116
+ ```
@@ -0,0 +1,45 @@
1
+ ---
2
+ layout: page
3
+ title: PII service
4
+ nav_order: 19
5
+ parent: Services
6
+ ---
7
+
8
+ # PII service
9
+ PII service provides an API for analyzing for and anonymizing Personally Identifiable Information (PII) in unstructured text content. It is based on [Presidio](https://github.com/microsoft/presidio), applies the ADSP multi-tenant security layer using the [ADSP Flask SDK](../platform/platform-flask-sdk.md), and adds *recognizers* for some Canadian *entities*.
10
+
11
+ ## Client roles
12
+ client `urn:ads:platform:pii-service`
13
+
14
+ | name | description |
15
+ |:-|:-|
16
+ | pii-analyzer | Analyzer role that allows a user or service account to make PII service API requests. |
17
+
18
+ ## Concepts
19
+ ### Entities
20
+ Entities represent categories of objects found in language. Presidio is based on Natural Language Processing capabilities in the Python ecosystem, and it applies Named Entity Recognition as a part of its processing pipeline.
21
+
22
+ ### Recognizer
23
+ Recognizers are extensible components used by Presidio to identify PII entities. PII service adds recognizers for Canadian bank account number, passport, postal code, and social insurance number.
24
+
25
+ ## Code examples
26
+ ### Anonymize text
27
+ ```typescript
28
+ const request = {
29
+ text: 'My text content to anonymize',
30
+ language: 'en',
31
+ score_threshold: 0.8,
32
+ }
33
+
34
+ await fetch(
35
+ 'https://pii-service.adsp.alberta.ca/pii/v1/anonymize',
36
+ {
37
+ method: 'POST',
38
+ headers: {
39
+ 'Authorization': `Bearer ${accessToken}`,
40
+ 'Content-Type': 'application/json'
41
+ },
42
+ body: JSON.stringify(request),
43
+ }
44
+ );
45
+ ```
@@ -0,0 +1,106 @@
1
+ ---
2
+ layout: page
3
+ title: Push service
4
+ nav_order: 7
5
+ parent: Services
6
+ ---
7
+
8
+ # Push service
9
+ Push service provides push mode gateway to events emitted in the [event service](event-service.md). It supports server side events and web sockets via [socket.io](https://socket.io).
10
+
11
+ Note that the web socket and socket.io endpoints are not part of the RESTful API and are not included in the Open API documentation for the service.
12
+
13
+ ## Client roles
14
+ client `urn:ads:platform:push-service`
15
+
16
+ | name | description |
17
+ |:-|:-|
18
+ | stream-listener | Stream listener role for push service. This role is used to allow an account to subscribe to any stream. |
19
+
20
+ User access is primary controlled via configuration on each stream with `subscriberRoles` representing the roles that grant read permission.
21
+
22
+ ## Concepts
23
+ ### Stream
24
+ Stream represents a collection of domain events that can be subscribed to through the gateway. Streams can optionally include projections for the events, so that only a subset of the payload is provided to the subscribing clients. Streams are configured in the [configuration service](configuration-service.md) under the `platform:push-service` namespace and name.
25
+
26
+ ## Code examples
27
+ ### Configure a stream
28
+ Streams are configured using the [configuration service](configuration-service.md).
29
+
30
+ ```typescript
31
+ const configurationServiceUrl = 'https://configuration-service.adsp.alberta.ca';
32
+ const request = {
33
+ operation: 'UPDATE',
34
+ update: {
35
+ 'application-health': {
36
+ id: 'application-health',
37
+ name: 'Application Health',
38
+ description: 'Includes events indicating application health.',
39
+ publicSubscribe: true,
40
+ subscriberRoles: [],
41
+ events: [
42
+ {
43
+ namespace: 'status-service',
44
+ name: 'health-check-started',
45
+ map: {
46
+ // Optional configuration of the projection of the event.
47
+ },
48
+ criteria: {
49
+ // Optional criteria for events included in the stream.
50
+ }
51
+ }
52
+ ],
53
+ }
54
+ }
55
+ }
56
+
57
+ await fetch(
58
+ `${configurationServiceUrl}/configuration/v2/configuration/platform/push-service`,
59
+ {
60
+ method: 'PATCH',
61
+ headers: {
62
+ 'Authorization': `Bearer ${accessToken}`,
63
+ 'Content-Type': 'application/json'
64
+ },
65
+ body: JSON.stringify(request),
66
+ }
67
+ );
68
+ ```
69
+
70
+ ### Connect to a stream via server side events
71
+ Server side event with Authorization header may require a polyfill. Alternatively, use a token query parameter to provide the access token.
72
+
73
+ ```typescript
74
+ const eventSource = new EventSource(
75
+ `https://push-service.adsp.alberta.ca/stream/v1/streams/${streamId}`,
76
+ {
77
+ headers: { Authorization: `Bearer ${accessToken}` }
78
+ }
79
+ );
80
+ eventSource.onmessage = function(e) {
81
+ // on message
82
+ }
83
+ eventSource.onerror = function(err) {
84
+ // on error
85
+ }
86
+ ```
87
+
88
+ ### Connect to a stream via socket.io
89
+ Socket.io connections use namespaces for tenancy. Each connection is made to a specific tenant.
90
+
91
+ ```typescript
92
+ import { io } from 'socket.io-client';
93
+ const socket = io(
94
+ `https://push-service.adsp.alberta.ca/${tenantId}?stream=${streamId}`,
95
+ {
96
+ withCredentials: true,
97
+ extraHeaders: {
98
+ Authorization: `Bearer ${accessToken}`,
99
+ },
100
+ },
101
+ );
102
+
103
+ socket.on(`${eventNamespace}:${eventName}`, (event) => {
104
+ // Handle the event.
105
+ });
106
+ ```
@@ -0,0 +1,6 @@
1
+ ---
2
+ layout: page
3
+ title: Services
4
+ nav_order: 4
5
+ has_children: true
6
+ ---
@@ -0,0 +1,29 @@
1
+ ---
2
+ layout: page
3
+ title: Status service
4
+ nav_order: 13
5
+ parent: Services
6
+ ---
7
+
8
+ # Status service
9
+ Status services provides configuration of applications, operational status of those applications, and allows posting of service notices.
10
+
11
+ ## Client roles
12
+ client `urn:ads:platform:status-service`
13
+
14
+ | name | description |
15
+ |:-|:-|
16
+ | status-admin | Administrator role for status service. This role allows a user to read and update status service entities. |
17
+
18
+ ## Concepts
19
+ ### Application
20
+ Applications represent digital services that an end user may wish to access. Each application should be meaningful and distinguishable to end users, so that they understand what tasks may be unavailable to the outage of any particular application.
21
+
22
+ ### Status
23
+ The status of an application indicates whether the service is fully available to end users, may be experiencing disruption, or is in planned or unplanned outage.
24
+
25
+ ### Health check
26
+ Health checks poll against an application endpoint to check for issues. It helps the tenant administrators monitor for issues but does not automatically update status.
27
+
28
+ ### Notice
29
+ Notices are important messages to users regarding upcoming changes to an application. For example, they can be used to inform users of scheduled maintenance events or service disruptions.
@@ -0,0 +1,139 @@
1
+ ---
2
+ layout: page
3
+ title: Task service
4
+ nav_order: 11
5
+ parent: Services
6
+ ---
7
+
8
+ # Task service
9
+ Task service provides a model for tasks, queues, and work assignment.
10
+
11
+ ## Client roles
12
+ client `urn:ads:platform:task-service`
13
+
14
+ | name | description |
15
+ |:-|:-|
16
+ | task-admin | Administrator role for task service. This role allows a user to read, updated, and assign tasks. |
17
+ | task-writer | Writer role for task service. This role allows a user to update tasks. |
18
+ | task-reader | Reader role for task service. This role allows a user to access tasks across queues. |
19
+
20
+ User access is primary controlled via configuration on each queue with `workerRoles` and `assignerRoles` representing: the roles that grant permission to assign and prioritize tasks; and roles that grant permission to self-assign, start, and complete tasks.
21
+
22
+ ## Concepts
23
+ ### Queue
24
+ Queue represents a particular work unit with roles for works and assigners and a ordered stream of *tasks*. Tasks default to first in-first out order and tasks with a higher priority are promoted to the front. Queues are configured in the [configuration service](configuration-service.md) under the `platform:task-service` namespace and name.
25
+
26
+ ### Task
27
+ Task represents a unit of work in a *queue*. Each task has basic name and description as well as a priority. Tasks have a basic lifecycle of: Pending -> In Progress -> Stopped (optional) -> Completed or Cancelled.
28
+
29
+ ### Assignment
30
+ *Tasks* are assigned to people for completion. Each task can be assigned to one person at a time (sole responsibility). Workers can self-assign tasks and assigners can assign tasks to others.
31
+
32
+ ## Code examples
33
+ ### Configure a queue
34
+ Queues are configured using the [configuration service](configuration-service.md). Note that new configuration may take up to 15 mins to apply.
35
+
36
+ ```typescript
37
+ const configurationServiceUrl = 'https://configuration-service.adsp.alberta.ca';
38
+
39
+ const namespace = 'my-service';
40
+ const name = 'intake-submissions';
41
+ const request = {
42
+ operation: 'UPDATE',
43
+ update: {
44
+ queues: {
45
+ [`${namespace}:${name}`]: {
46
+ namespace,
47
+ name,
48
+ context: {},
49
+ assignerRoles: ['intake-supervisors'],
50
+ workerRoles: ['intake-assessors'],
51
+ }
52
+ }
53
+ }
54
+ }
55
+
56
+ await fetch(
57
+ `${configurationServiceUrl}/configuration/v2/configuration/platform/task-service`,
58
+ {
59
+ method: 'PATCH',
60
+ headers: {
61
+ 'Authorization': `Bearer ${accessToken}`,
62
+ 'Content-Type': 'application/json'
63
+ },
64
+ body: JSON.stringify(request),
65
+ }
66
+ );
67
+ ```
68
+
69
+ ### Create and queue a task
70
+ ```typescript
71
+ const namespace = 'support';
72
+ const name = 'intake-processing';
73
+ const task = {
74
+ name: 'process-application-123',
75
+ description: 'Process Application 123',
76
+ priority: 'Normal',
77
+ recordId: 'f669be59-bd38-4ca4-8749-19248060fc63',
78
+ }
79
+
80
+ await fetch(
81
+ `https://task-service.adsp.alberta.ca/task/v1/queues/${namespace}/${name}/tasks`,
82
+ {
83
+ method: 'POST',
84
+ headers: {
85
+ 'Authorization': `Bearer ${accessToken}`,
86
+ 'Content-Type': 'application/json',
87
+ },
88
+ body: JSON.stringify(task),
89
+ }
90
+ );
91
+ ```
92
+
93
+ ### Get queued tasks
94
+ Tasks are returned in order with highest priority tasks first and, within each priority, oldest tasks first.
95
+ ```typescript
96
+ const namespace = 'support';
97
+ const name = 'intake-processing';
98
+ const top = 20;
99
+
100
+ await fetch(
101
+ `https://task-service.adsp.alberta.ca/task/v1/queues/${namespace}/${name}/tasks?top=${top}`,
102
+ {
103
+ method: 'GET',
104
+ headers: {
105
+ Authorization: `Bearer ${accessToken}`,
106
+ },
107
+ }
108
+ );
109
+ ```
110
+
111
+ ### Assign a task
112
+ Tasks can be assigned by users with one of the assigner roles for the queue or self-assigned by users with one of the worker roles.
113
+
114
+ ```typescript
115
+ const taskServiceUrl = 'https://task-service.adsp.alberta.ca';
116
+ const taskId = 'b7aba911-7bd9-485e-b0e9-416506f025d9';
117
+ const namespace = 'support';
118
+ const name = 'intake-processing';
119
+ const request = {
120
+ operation: 'assign',
121
+ assignTo: {
122
+ id: 'ed2243ed-948a-4f84-a785-c9cf2d5f355e',
123
+ email: 'a.n.other@gov.ab.ca',
124
+ name: 'A. N. Other',
125
+ },
126
+ }
127
+
128
+ await fetch(
129
+ `${taskServiceUrl}/task/v1/queues/${namespace}/${name}/tasks/${taskId}`,
130
+ {
131
+ method: 'POST',
132
+ headers: {
133
+ 'Authorization': `Bearer ${accessToken}`,
134
+ 'Content-Type': 'application/json',
135
+ },
136
+ body: JSON.stringify(request),
137
+ }
138
+ );
139
+ ```
@@ -0,0 +1,18 @@
1
+ ---
2
+ layout: page
3
+ title: Tenant service
4
+ nav_order: 1
5
+ parent: Services
6
+ ---
7
+
8
+ # Tenant service
9
+ Tenant service provides the infrastructure for multi-tenancy in ADSP. It provides the APIs that allow for operations like creation of new tenants and lookup of tenants.
10
+
11
+ Tenant users and applications do not need to interact with tenant service directly.
12
+
13
+ ## Client roles
14
+ client `urn:ads:platform:tenant-service`
15
+
16
+ | name | description |
17
+ |:-|:-|
18
+ | tenant-admin | Administrator role for tenant service. This role grants a user access to tenant administration. It is also a composite role that includes roles for configuration of other platform services. |