@truedat/auth 6.11.1 → 6.12.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/auth",
3
- "version": "6.11.1",
3
+ "version": "6.12.0",
4
4
  "description": "Truedat Web Auth",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -86,7 +86,7 @@
86
86
  ]
87
87
  },
88
88
  "dependencies": {
89
- "@truedat/core": "6.11.1",
89
+ "@truedat/core": "6.12.0",
90
90
  "auth0-js": "9.23.3",
91
91
  "decode-uri-component": "^0.2.2",
92
92
  "jwt-decode": "^2.2.0",
@@ -109,5 +109,5 @@
109
109
  "react-dom": ">= 16.8.6 < 17",
110
110
  "semantic-ui-react": ">= 2.0.3 < 2.2"
111
111
  },
112
- "gitHead": "a684646f8503335b666ea82b85a6c0aa8fbd2336"
112
+ "gitHead": "a182d4660919ab242d3150ef4a51641815913a39"
113
113
  }
@@ -0,0 +1,8 @@
1
+ import useSWR from "swr";
2
+ import { apiJson } from "@truedat/core/services/api";
3
+ import { API_AGENTS } from "../users/api";
4
+
5
+ export const useAgents = () => {
6
+ const { data, error } = useSWR(API_AGENTS, apiJson);
7
+ return { agents: data?.data?.data, error, loading: !error && !data };
8
+ };
package/src/users/api.js CHANGED
@@ -1,3 +1,4 @@
1
+ const API_AGENTS = "/api/users/agents";
1
2
  const API_USER = "/api/users/:id";
2
3
  const API_USERS = "/api/users";
3
4
  const API_USER_CHANGE_PASSWORD = "/api/password";
@@ -6,6 +7,7 @@ const API_INIT = "/api/init";
6
7
  const API_CAN_INIT = "/api/init/can";
7
8
 
8
9
  export {
10
+ API_AGENTS,
9
11
  API_USER,
10
12
  API_USERS,
11
13
  API_USERS_SEARCH,
@@ -32,6 +32,10 @@ const userTypeOptions = (formatMessage) => [
32
32
  text: formatMessage({ id: "user.type.service" }),
33
33
  value: "service",
34
34
  },
35
+ {
36
+ text: formatMessage({ id: "user.type.agent" }),
37
+ value: "agent",
38
+ },
35
39
  ];
36
40
 
37
41
  export const PasswordFormFields = ({ control, errors }) => {
@@ -27,6 +27,7 @@ const renderOpts = {
27
27
  "user.type.admin": "admin",
28
28
  "user.type.service": "service",
29
29
  "user.type.user": "user",
30
+ "user.type.agent": "Ai Agent",
30
31
  "users.actions.create": "create",
31
32
  "users.actions.edit": "edit",
32
33
  },
@@ -27,6 +27,7 @@ const renderOpts = {
27
27
  "user.type.admin": "admin",
28
28
  "user.type.service": "service",
29
29
  "user.type.user": "user",
30
+ "user.type.agent": "Ai Agent",
30
31
  },
31
32
  },
32
33
  };
@@ -27,6 +27,7 @@ const renderOpts = {
27
27
  "user.type.admin": "admin",
28
28
  "user.type.service": "service",
29
29
  "user.type.user": "user",
30
+ "user.type.agent": "Ai Agent",
30
31
  "users.actions.create": "create",
31
32
  },
32
33
  },
@@ -28,6 +28,7 @@ const renderOpts = {
28
28
  "user.form.role": "role",
29
29
  "user.type.admin": "admin",
30
30
  "user.type.service": "service",
31
+ "user.type.agent": "Ai Agent",
31
32
  "user.type.user": "user",
32
33
  "users.actions.create": "create",
33
34
  "users.actions.edit": "edit",
@@ -190,6 +190,19 @@ exports[`<EditUser /> matches the latest snapshot 1`] = `
190
190
  service
191
191
  </span>
192
192
  </div>
193
+ <div
194
+ aria-checked="false"
195
+ aria-selected="false"
196
+ class="item"
197
+ role="option"
198
+ style="pointer-events: all;"
199
+ >
200
+ <span
201
+ class="text"
202
+ >
203
+ Ai Agent
204
+ </span>
205
+ </div>
193
206
  </div>
194
207
  </div>
195
208
  </div>
@@ -171,6 +171,19 @@ exports[`<InitialUser /> matches the latest snapshot 1`] = `
171
171
  service
172
172
  </span>
173
173
  </div>
174
+ <div
175
+ aria-checked="false"
176
+ aria-selected="false"
177
+ class="item"
178
+ role="option"
179
+ style="pointer-events: all;"
180
+ >
181
+ <span
182
+ class="text"
183
+ >
184
+ Ai Agent
185
+ </span>
186
+ </div>
174
187
  </div>
175
188
  </div>
176
189
  </div>
@@ -190,6 +190,19 @@ exports[`<NewUser /> matches the latest snapshot 1`] = `
190
190
  service
191
191
  </span>
192
192
  </div>
193
+ <div
194
+ aria-checked="false"
195
+ aria-selected="false"
196
+ class="item"
197
+ role="option"
198
+ style="pointer-events: all;"
199
+ >
200
+ <span
201
+ class="text"
202
+ >
203
+ Ai Agent
204
+ </span>
205
+ </div>
193
206
  </div>
194
207
  </div>
195
208
  </div>
@@ -155,6 +155,19 @@ exports[`<UserForm /> matches the latest snapshot 1`] = `
155
155
  service
156
156
  </span>
157
157
  </div>
158
+ <div
159
+ aria-checked="false"
160
+ aria-selected="false"
161
+ class="item"
162
+ role="option"
163
+ style="pointer-events: all;"
164
+ >
165
+ <span
166
+ class="text"
167
+ >
168
+ Ai Agent
169
+ </span>
170
+ </div>
158
171
  </div>
159
172
  </div>
160
173
  </div>