@abgov/adsp-sdk-mcp-server 1.12.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
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/adsp-sdk-mcp-server",
3
- "version": "1.12.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",