@abgov/adsp-sdk-mcp-server 1.11.0 → 1.12.1

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.
@@ -6,56 +6,63 @@ parent: Services
6
6
  ---
7
7
 
8
8
  # Feedback service
9
+
9
10
  Feedback service allows users to submit feedback regarding their service interaction. It includes an backend API and a frontend widget.
10
11
 
11
12
  ## Client roles
13
+
12
14
  client `urn:ads:platform:feedback-service`
13
15
 
14
- | name | description |
15
- |:-|:-|
16
+ | name | description |
17
+ | :---------------- | :------------------------------------------------- |
16
18
  | feedback-provider | Provider role that allows a user to send feedback. |
17
19
 
18
- *Sites* can be configured to allow anonymous feedback and in that case the send feedback request is not expected to include any credential. For *sites* that don't allow anonymous feedback, the request must be in the context of a user with the `urn:ads:platform:feedback-service:feedback-provider` client role. In order to allow feedback from all authenticated users of an application, the associated client can include a hardcode role mapper to add the role to access tokens.
20
+ _Sites_ can be configured to allow anonymous feedback and in that case the send feedback request is not expected to include any credential. For _sites_ that don't allow anonymous feedback, the request must be in the context of a user with the `urn:ads:platform:feedback-service:feedback-provider` client role. In order to allow feedback from all authenticated users of an application, the associated client can include a hardcode role mapper to add the role to access tokens.
19
21
 
20
22
  ## Concepts
23
+
21
24
  ### Site
25
+
22
26
  A site represents a website against which feedback can be provided. A site can be configured to allow anonymous feedback, so that feedback is accepted from unauthenticated users. This may decrease the quality of feedback. Note that the feedback API does not (and is not reliably able to) check that feedback originates from the associated site. Sites are configured in the [configuration service](configuration-service.md) under the `platform:feedback-service` namespace and name.
23
27
 
24
28
  ### Feedback anonymization
29
+
25
30
  The feedback service processes text content of submitted feedback using the [PII service](pii-service.md) to remove personally identifiable information.
26
31
 
27
32
  ## Code examples
33
+
28
34
  ### Configure a site
35
+
29
36
  Sites are configured using the [configuration service](configuration-service.md). Note that new configuration may take up to 15 mins to apply.
30
37
 
31
38
  ```typescript
32
- const configurationServiceUrl = 'https://configuration-service.adsp.alberta.ca';
39
+ const configurationServiceUrl = 'https://configuration-service.adsp.alberta.ca';
33
40
 
34
- const request = {
35
- operation: 'UPDATE',
36
- update: {
37
- sites: [{
41
+ const request = {
42
+ operation: 'UPDATE',
43
+ update: {
44
+ sites: [
45
+ {
38
46
  url: 'https://my-application.alberta.ca',
39
47
  allowAnonymous: false,
40
- }]
41
- }
42
- }
43
-
44
- await fetch(
45
- `${configurationServiceUrl}/configuration/v2/configuration/platform/feedback-service`,
46
- {
47
- method: 'PATCH',
48
- headers: {
49
- 'Authorization': `Bearer ${accessToken}`,
50
- 'Content-Type': 'application/json'
51
48
  },
52
- body: JSON.stringify(request),
53
- }
54
- );
49
+ ],
50
+ },
51
+ };
52
+
53
+ await fetch(`${configurationServiceUrl}/configuration/v2/configuration/platform/feedback-service`, {
54
+ method: 'PATCH',
55
+ headers: {
56
+ Authorization: `Bearer ${accessToken}`,
57
+ 'Content-Type': 'application/json',
58
+ },
59
+ body: JSON.stringify(request),
60
+ });
55
61
  ```
56
62
 
57
63
  ### Attach feedback widget
58
- Feedback service provides a script for a frontend widget. The script sets a `adspFeedback` global variable when it is loaded, then the hosting site needs to initialize the widget with the name of the associated tenant.
64
+
65
+ Feedback service provides a script for a frontend widget. The script sets a `adspFeedback` global variable when it is loaded, then the hosting site needs to initialize the widget with the name of the associated tenant, and css version for design system, default is 1.0 .
59
66
 
60
67
  ```html
61
68
  <head>
@@ -65,14 +72,16 @@ Feedback service provides a script for a frontend widget. The script sets a `ads
65
72
  ...
66
73
  <body>
67
74
  <!-- Site body -->
68
- <script>adspFeedback.initialize({tenant: 'My Tenant'})</script>
69
- <body>
75
+ <script>
76
+ adspFeedback.initialize({ tenant: 'My Tenant', designSystemsVersion: '2.0' });
77
+ </script>
78
+ <body></body>
79
+ </body>
70
80
  ```
71
81
 
72
82
  The widget uses the location from which it is loaded to determine the feedback API URL, and uses the current site location for the context of the feedback. However, the hosting application can customize the widget behaviour via its interface.
73
83
 
74
84
  ```typescript
75
-
76
85
  interface AdspFeedback {
77
86
  initialize(options: FeedbackOptions): void;
78
87
  }
@@ -94,59 +103,55 @@ export interface FeedbackContext {
94
103
  ```
95
104
 
96
105
  ### Send feedback
106
+
97
107
  The `rating` field accepts one of the following values:
98
108
 
99
- | Value | Description |
100
- |:-|:-|
101
- | terrible | Very Difficult |
102
- | bad | Difficult |
103
- | neutral | Neutral |
104
- | good | Easy |
105
- | delightful | Very Easy |
109
+ | Value | Description |
110
+ | :--------- | :------------- |
111
+ | terrible | Very Difficult |
112
+ | bad | Difficult |
113
+ | neutral | Neutral |
114
+ | good | Easy |
115
+ | delightful | Very Easy |
106
116
 
107
117
  ```typescript
108
- const feedback = {
109
- tenant: 'My Tenant',
110
- context: {
111
- site: 'https://my-application.alberta.ca',
112
- view: '/site-view',
113
- },
114
- rating: 'good',
115
- comment: 'My experience was pretty good.',
116
- technicalIssue: 'I experienced some issues with slow loading.',
117
- }
118
-
119
- await fetch(
120
- `https://feedback-service.adsp.alberta.ca/feedback/v1/feedback`,
121
- {
122
- method: 'POST',
123
- headers: {
124
- 'Authorization': `Bearer ${accessToken}`,
125
- 'Content-Type': 'application/json',
126
- },
127
- body: JSON.stringify(feedback),
128
- }
129
- );
118
+ const feedback = {
119
+ tenant: 'My Tenant',
120
+ context: {
121
+ site: 'https://my-application.alberta.ca',
122
+ view: '/site-view',
123
+ },
124
+ rating: 'good',
125
+ comment: 'My experience was pretty good.',
126
+ technicalIssue: 'I experienced some issues with slow loading.',
127
+ };
128
+
129
+ await fetch(`https://feedback-service.adsp.alberta.ca/feedback/v1/feedback`, {
130
+ method: 'POST',
131
+ headers: {
132
+ Authorization: `Bearer ${accessToken}`,
133
+ 'Content-Type': 'application/json',
134
+ },
135
+ body: JSON.stringify(feedback),
136
+ });
130
137
  ```
131
138
 
132
139
  ### Retrieving feedback
140
+
133
141
  After anonymization, feedback is written to the [value service](value-service.md) and can be retrieved via its API.
134
142
 
135
143
  ```typescript
136
- const valueServiceUrl = 'https://value-service.adsp.alberta.ca';
137
- const top = 50;
138
- const timestampMin = `2024-10-10T12:00:00Z`;
139
-
140
- const response = await fetch(
141
- `${valueServiceUrl}/value/v1/feedback-service/values/feedback?top=${top}&timestampMin=${timestampMin}`,
142
- {
143
- method: 'GET',
144
- headers: { Authorization: `Bearer ${accessToken}` }
145
- }
146
- );
147
-
148
- const {
149
- results,
150
- page,
151
- } = await response.json();
152
- ```
144
+ const valueServiceUrl = 'https://value-service.adsp.alberta.ca';
145
+ const top = 50;
146
+ const timestampMin = `2024-10-10T12:00:00Z`;
147
+
148
+ const response = await fetch(
149
+ `${valueServiceUrl}/value/v1/feedback-service/values/feedback?top=${top}&timestampMin=${timestampMin}`,
150
+ {
151
+ method: 'GET',
152
+ headers: { Authorization: `Bearer ${accessToken}` },
153
+ },
154
+ );
155
+
156
+ const { results, page } = await response.json();
157
+ ```
@@ -37,7 +37,7 @@ Keycloak uses FreeMarker files to build server-side webpages that then get serve
37
37
  Probably the easiest way to build and test a new theme is:
38
38
 
39
39
  - read the [keycloak guide](https://www.keycloak.org/docs/18.0/server_development/) for developing themes
40
- - clone the [access-service git repository](https://github.com/GovAlta/access-service/tree/main)
40
+ - clone the Access service repository, and
41
41
  - follow the instructions in the repository to build, test, and deploy your new templates.
42
42
 
43
- If you have any questions please contact the ADSP team on slack (#adsp-connect) or email us at [ADSP Support](adsp@gov.ab.ca).
43
+ The Access service repository is maintained by the ADSP team in a private Government of Alberta organization, so you will need to request access before you can clone it. Please contact the ADSP team on slack (#adsp-connect) or email us at [ADSP Support](adsp@gov.ab.ca) to request access, or if you have any questions.
@@ -73,6 +73,21 @@ The tenant name will be extracted from the access token, and the feedback inform
73
73
 
74
74
  Note: The service itself does not make a record of the user ID in the access token. If this is desired you can use the [correlation ID](#target-correlationid) for this purpose.
75
75
 
76
+ For applications that need to use Design Systems 2.0 components add a parameter `designSystemsVersion: '2.0'` in the initialize method as shown below:
77
+
78
+ ```html
79
+ <body>
80
+ ...
81
+ <script>
82
+ adspFeedback.initialize({
83
+ designSystemsVersion: '2.0',
84
+ getAccessToken: () => {<your getter method>}});
85
+ </script>
86
+ </body>
87
+ ```
88
+
89
+ By default the Feedback widget will show Design Systems 1.0 if the parameter `designSystemsVersion: '2.0'` is not provided.
90
+
76
91
  #### Anonymous access
77
92
 
78
93
  For anonymous access you must submit your tenant name directly, as follows:
@@ -27,6 +27,8 @@ Note: in some UI schemas you will see "ComponentProps" in the options element. C
27
27
 
28
28
  Here are some out-of-the-box formats that not only render with the correct input widget, but ensure that the data provided by users is valid. NOTE: There is a known issue in jsonforms that allows an empty string to satisfy the required validation rule. To work around this, you should also add a minimum length of 1 to required string fields (see Limited text with required validation) below.
29
29
 
30
+ The Name, Address, and Email examples below reuse definitions from the [ADSP common schema](https://adsp.alberta.ca/common.v1.schema.json). Add the data schema property first, then add a UI schema control whose <code>scope</code> uses the same property name.
31
+
30
32
  <table>
31
33
  <tr>
32
34
  <th>Format</th>
@@ -34,6 +36,57 @@ Here are some out-of-the-box formats that not only render with the correct input
34
36
  <th>JSON schema</th>
35
37
  <th>UI schema</th>
36
38
  </tr>
39
+ <tr>
40
+ <td>Name</td>
41
+ <td>A structured name control with first name, optional middle name, and last name fields. The common definition includes validation and requires the first and last names.</td>
42
+ <td><pre><code>
43
+ {
44
+ "applicantName": {
45
+ "$ref": "https://adsp.alberta.ca/common.v1.schema.json#/definitions/personFullName"
46
+ }
47
+ }
48
+ </code></pre></td>
49
+ <td><pre><code>
50
+ {
51
+ "type": "Control",
52
+ "scope": "#/properties/applicantName"
53
+ }
54
+ </code></pre></td>
55
+ </tr>
56
+ <tr>
57
+ <td>Address</td>
58
+ <td>A structured Alberta postal address control with address lookup. Use <code>postalAddressCanada</code> instead of <code>postalAddressAlberta</code> when addresses from any Canadian province or territory are allowed.</td>
59
+ <td><pre><code>
60
+ {
61
+ "mailingAddress": {
62
+ "$ref": "https://adsp.alberta.ca/common.v1.schema.json#/definitions/postalAddressAlberta"
63
+ }
64
+ }
65
+ </code></pre></td>
66
+ <td><pre><code>
67
+ {
68
+ "type": "Control",
69
+ "scope": "#/properties/mailingAddress"
70
+ }
71
+ </code></pre></td>
72
+ </tr>
73
+ <tr>
74
+ <td>Email</td>
75
+ <td>An email input with the common schema's email format validation and 100-character limit.</td>
76
+ <td><pre><code>
77
+ {
78
+ "contactEmail": {
79
+ "$ref": "https://adsp.alberta.ca/common.v1.schema.json#/definitions/email"
80
+ }
81
+ }
82
+ </code></pre></td>
83
+ <td><pre><code>
84
+ {
85
+ "type": "Control",
86
+ "scope": "#/properties/contactEmail"
87
+ }
88
+ </code></pre></td>
89
+ </tr>
37
90
  <tr>
38
91
  <td>Date</td>
39
92
  <td>A calendar date picker for selecting a date value in ISO format (YYYY-MM-DD).</td>
@@ -300,6 +353,7 @@ Here are some out-of-the-box formats that not only render with the correct input
300
353
  }
301
354
  </code></pre></td>
302
355
  </tr>
356
+
303
357
  <tr>
304
358
  <td>Checkbox with required validation</td>
305
359
  <td>A required checkbox that must be checked (confirmed) to satisfy the form requirement.</td>
@@ -635,6 +689,56 @@ For when the user must select from a limited set of answers.
635
689
  }
636
690
  </code></pre></td>
637
691
  </tr>
692
+ <tr>
693
+ <td>Radio Button 2</td>
694
+ <td>Another way to provide a set/list radio buttons along with hint text</td>
695
+ <td>
696
+ <pre><code>
697
+ {
698
+ "carType": {
699
+ "type": "array",
700
+ "default": [],
701
+ "items": {
702
+ "type": "string",
703
+ "oneOf": [
704
+ {
705
+ "const": "Acura",
706
+ "title": "Acura SUV",
707
+ "description": "Acura SUv -- This is for hint text"
708
+ },
709
+ {
710
+ "const": "Toyota",
711
+ "title": "Toyota SUV",
712
+ "description": "Toyota SUV -- This is for hint text"
713
+ },
714
+ {
715
+ "const": "Mazda SUV",
716
+ "title": "Mazda SUV ",
717
+ "description": "Toyota SUV -- This is for hint text"
718
+ }
719
+ ],
720
+ "uniqueItems": true
721
+ },
722
+ "minItems": 1,
723
+ "errorMessage": {
724
+ "minItems": "Choose all that apply is required"
725
+ }
726
+ }
727
+ }
728
+ </code></pre>
729
+ </td>
730
+ <td><pre><code>
731
+ {
732
+ "type": "Control",
733
+ "scope": "#/properties/carType",
734
+ "label": "Choose the car Type that best applies.",
735
+ "options": {
736
+ "format": "radio"
737
+ }
738
+ },
739
+ </code></pre></td>
740
+ </tr>
741
+
638
742
  <tr>
639
743
  <td>Checkbox</td>
640
744
  <td>A set of checkboxes for selecting multiple options from a list simultaneously.</td>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/adsp-sdk-mcp-server",
3
- "version": "1.11.0",
3
+ "version": "1.12.1",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Government of Alberta - MCP server for ADSP documentation and Node SDK reference lookup.",
6
6
  "repository": "https://github.com/GovAlta/adsp-monorepo",