@forgerock/device-client 0.0.0-beta-20251222204813

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 (52) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +253 -0
  3. package/dist/src/index.d.ts +2 -0
  4. package/dist/src/index.d.ts.map +1 -0
  5. package/dist/src/index.js +8 -0
  6. package/dist/src/index.js.map +1 -0
  7. package/dist/src/lib/device.store.d.ts +186 -0
  8. package/dist/src/lib/device.store.d.ts.map +1 -0
  9. package/dist/src/lib/device.store.js +306 -0
  10. package/dist/src/lib/device.store.js.map +1 -0
  11. package/dist/src/lib/device.store.utils.d.ts +4 -0
  12. package/dist/src/lib/device.store.utils.d.ts.map +1 -0
  13. package/dist/src/lib/device.store.utils.js +12 -0
  14. package/dist/src/lib/device.store.utils.js.map +1 -0
  15. package/dist/src/lib/services/index.d.ts +38 -0
  16. package/dist/src/lib/services/index.d.ts.map +1 -0
  17. package/dist/src/lib/services/index.js +98 -0
  18. package/dist/src/lib/services/index.js.map +1 -0
  19. package/dist/src/lib/types/bound-device.types.d.ts +35 -0
  20. package/dist/src/lib/types/bound-device.types.d.ts.map +1 -0
  21. package/dist/src/lib/types/bound-device.types.js +2 -0
  22. package/dist/src/lib/types/bound-device.types.js.map +1 -0
  23. package/dist/src/lib/types/index.d.ts +8 -0
  24. package/dist/src/lib/types/index.d.ts.map +1 -0
  25. package/dist/src/lib/types/index.js +14 -0
  26. package/dist/src/lib/types/index.js.map +1 -0
  27. package/dist/src/lib/types/oath.types.d.ts +42 -0
  28. package/dist/src/lib/types/oath.types.d.ts.map +1 -0
  29. package/dist/src/lib/types/oath.types.js +2 -0
  30. package/dist/src/lib/types/oath.types.js.map +1 -0
  31. package/dist/src/lib/types/profile-device.types.d.ts +57 -0
  32. package/dist/src/lib/types/profile-device.types.d.ts.map +1 -0
  33. package/dist/src/lib/types/profile-device.types.js +2 -0
  34. package/dist/src/lib/types/profile-device.types.js.map +1 -0
  35. package/dist/src/lib/types/push-device.types.d.ts +99 -0
  36. package/dist/src/lib/types/push-device.types.d.ts.map +1 -0
  37. package/dist/src/lib/types/push-device.types.js +2 -0
  38. package/dist/src/lib/types/push-device.types.js.map +1 -0
  39. package/dist/src/lib/types/updateDeviceProfile.types.d.ts +58 -0
  40. package/dist/src/lib/types/updateDeviceProfile.types.d.ts.map +1 -0
  41. package/dist/src/lib/types/updateDeviceProfile.types.js +2 -0
  42. package/dist/src/lib/types/updateDeviceProfile.types.js.map +1 -0
  43. package/dist/src/lib/types/webauthn.types.d.ts +58 -0
  44. package/dist/src/lib/types/webauthn.types.d.ts.map +1 -0
  45. package/dist/src/lib/types/webauthn.types.js +2 -0
  46. package/dist/src/lib/types/webauthn.types.js.map +1 -0
  47. package/dist/src/types.d.ts +2 -0
  48. package/dist/src/types.d.ts.map +1 -0
  49. package/dist/src/types.js +8 -0
  50. package/dist/src/types.js.map +1 -0
  51. package/dist/tsconfig.lib.tsbuildinfo +1 -0
  52. package/package.json +40 -0
@@ -0,0 +1,306 @@
1
+ import { configureStore } from '@reduxjs/toolkit';
2
+ import { deviceService } from './services/index.js';
3
+ import { handleError } from './device.store.utils.js';
4
+ /**
5
+ * @function deviceClient
6
+ * @description Returns a device management object containing methods for handling various device types
7
+ * @param {ConfigOptions} config The configuration options for the device client
8
+ * @returns Methods for handling various device types
9
+ */
10
+ export const deviceClient = (config) => {
11
+ const { middleware, reducerPath, reducer, endpoints } = deviceService({
12
+ baseUrl: config.serverConfig?.baseUrl ?? '',
13
+ realmPath: config?.realmPath ?? '',
14
+ });
15
+ const store = configureStore({
16
+ reducer: {
17
+ [reducerPath]: reducer,
18
+ },
19
+ middleware: (getDefaultMiddleware) => getDefaultMiddleware().concat(middleware),
20
+ });
21
+ return {
22
+ /**
23
+ * Oath device management methods.
24
+ */
25
+ oath: {
26
+ /**
27
+ * Retrieves Oath devices based on the specified query.
28
+ *
29
+ * @async
30
+ * @function get
31
+ * @param {RetrieveOathQuery} query - The query used to retrieve Oath devices.
32
+ * @returns {Promise<OathDevice[] | { error: unknown }>} - A promise that resolves to the retrieved data or an error object if the response is not valid.
33
+ */
34
+ get: async function (query) {
35
+ try {
36
+ const response = await store.dispatch(endpoints.getOathDevices.initiate(query));
37
+ if (!response || !response.data || !response.data.result) {
38
+ throw new Error('response did not contain data');
39
+ }
40
+ return response.data.result;
41
+ }
42
+ catch (error) {
43
+ return { error };
44
+ }
45
+ },
46
+ /**
47
+ * Deletes an Oath device based on the provided query and device information.
48
+ *
49
+ * @async
50
+ * @function delete
51
+ * @param {RetrieveOathQuery & { device: OathDevice }} query - The query and device information used to delete the Oath device.
52
+ * @returns {Promise<null | { error: unknown }>} - A promise that resolves to null or an error object if the response is not valid.
53
+ */
54
+ delete: async function (query) {
55
+ try {
56
+ const { error } = await store.dispatch(endpoints.deleteOathDevice.initiate(query));
57
+ if (error) {
58
+ handleError(error, 'Failed to delete device: ');
59
+ }
60
+ return null;
61
+ }
62
+ catch (error) {
63
+ return { error };
64
+ }
65
+ },
66
+ },
67
+ /**
68
+ * Push device management methods.
69
+ */
70
+ push: {
71
+ /**
72
+ * Retrieves Push devices based on the specified query.
73
+ *
74
+ * @async
75
+ * @function get
76
+ * @param {PushDeviceQuery} query - The query used to retrieve Push devices.
77
+ * @returns {Promise<PushDevice[] | { error: unknown }>} - A promise that resolves to the retrieved data or an error object if the response is not valid.
78
+ */
79
+ get: async function (query) {
80
+ try {
81
+ const response = await store.dispatch(endpoints.getPushDevices.initiate(query));
82
+ if (!response || !response.data || !response.data.result) {
83
+ throw new Error('response did not contain data');
84
+ }
85
+ return response.data.result;
86
+ }
87
+ catch (error) {
88
+ return { error };
89
+ }
90
+ },
91
+ /**
92
+ * Deletes a Push device based on the provided query.
93
+ *
94
+ * @async
95
+ * @function delete
96
+ * @param {DeleteDeviceQuery} query - The query used to delete the Push device.
97
+ * @returns {Promise<null | { error: unknown }>} - A promise that resolves to null or an error object if the response is not valid.
98
+ */
99
+ delete: async function (query) {
100
+ try {
101
+ const { error } = await store.dispatch(endpoints.deletePushDevice.initiate(query));
102
+ if (error) {
103
+ handleError(error, 'Failed to delete device: ');
104
+ }
105
+ return null;
106
+ }
107
+ catch (error) {
108
+ return { error };
109
+ }
110
+ },
111
+ },
112
+ /**
113
+ * WebAuthn device management methods.
114
+ */
115
+ webAuthn: {
116
+ /**
117
+ * Retrieves WebAuthn devices based on the specified query.
118
+ *
119
+ * @async
120
+ * @function get
121
+ * @param {WebAuthnQuery} query - The query used to retrieve WebAuthn devices.
122
+ * @returns {Promise<WebAuthnDevice[] | { error: unknown }>} - A promise that resolves to the retrieved data or an error object if the response is not valid.
123
+ */
124
+ get: async function (query) {
125
+ try {
126
+ const response = await store.dispatch(endpoints.getWebAuthnDevices.initiate(query));
127
+ if (!response || !response.data || !response.data.result) {
128
+ throw new Error('response did not contain data');
129
+ }
130
+ return response.data.result;
131
+ }
132
+ catch (error) {
133
+ return { error };
134
+ }
135
+ },
136
+ /**
137
+ * Updates the name of a WebAuthn device based on the provided query and body.
138
+ *
139
+ * @async
140
+ * @function update
141
+ * @param {WebAuthnQuery & { device: WebAuthnDevice }} query - The query and body used to update the WebAuthn device name.
142
+ * @returns {Promise<UpdatedWebAuthnDevice | { error: unknown }>} - A promise that resolves to the response data or an error object if the response is not valid.
143
+ */
144
+ update: async function (query) {
145
+ try {
146
+ const response = await store.dispatch(endpoints.updateWebAuthnDeviceName.initiate(query));
147
+ if (!response || !response.data) {
148
+ throw new Error('response did not contain data');
149
+ }
150
+ return response.data;
151
+ }
152
+ catch (error) {
153
+ return { error };
154
+ }
155
+ },
156
+ /**
157
+ * Deletes a WebAuthn device based on the provided query and body.
158
+ *
159
+ * @async
160
+ * @function delete
161
+ * @param {WebAuthnQuery & { device: WebAuthnDevice | UpdatedWebAuthnDevice }} query - The query and body used to delete the WebAuthn device.
162
+ * @returns {Promise<null | { error: unknown }>} - A promise that resolves to null or an error object if the response is not valid.
163
+ */
164
+ delete: async function (query) {
165
+ try {
166
+ const { error } = await store.dispatch(endpoints.deleteWebAuthnDeviceName.initiate(query));
167
+ if (error) {
168
+ handleError(error, 'Failed to delete device: ');
169
+ }
170
+ return null;
171
+ }
172
+ catch (error) {
173
+ return { error };
174
+ }
175
+ },
176
+ },
177
+ /**
178
+ * Bound devices management methods.
179
+ */
180
+ bound: {
181
+ /**
182
+ * Retrieves bound devices based on the specified query.
183
+ *
184
+ * @async
185
+ * @function get
186
+ * @param {GetBoundDevicesQuery} query - The query used to retrieve bound devices.
187
+ * @returns {Promise<Device[] | { error: unknown }>} - A promise that resolves to the retrieved data or an error object if the response is not valid.
188
+ */
189
+ get: async function (query) {
190
+ try {
191
+ const response = await store.dispatch(endpoints.getBoundDevices.initiate(query));
192
+ if (!response || !response.data || !response.data.result) {
193
+ throw new Error('response did not contain data');
194
+ }
195
+ return response.data.result;
196
+ }
197
+ catch (error) {
198
+ return { error };
199
+ }
200
+ },
201
+ /**
202
+ * Deletes a bound device based on the provided query.
203
+ *
204
+ * @async
205
+ * @function delete
206
+ * @param {BoundDeviceQuery} query - The query used to delete the bound device.
207
+ * @returns {Promise<null | { error: unknown }>} - A promise that resolves to null or an error object if the response is not valid.
208
+ */
209
+ delete: async function (query) {
210
+ try {
211
+ const { error } = await store.dispatch(endpoints.deleteBoundDevice.initiate(query));
212
+ if (error) {
213
+ handleError(error, 'Failed to delete device: ');
214
+ }
215
+ return null;
216
+ }
217
+ catch (error) {
218
+ return { error };
219
+ }
220
+ },
221
+ /**
222
+ * Updates the name of a bound device based on the provided query.
223
+ *
224
+ * @async
225
+ * @function update
226
+ * @param {BoundDeviceQuery} query - The query used to update the bound device name.
227
+ * @returns {Promise<Device | { error: unknown }>} - A promise that resolves to the response data or an error object if the response is not valid.
228
+ */
229
+ update: async function (query) {
230
+ try {
231
+ const response = await store.dispatch(endpoints.updateBoundDevice.initiate(query));
232
+ if (!response || !response.data) {
233
+ throw new Error('response did not contain data');
234
+ }
235
+ return response.data;
236
+ }
237
+ catch (error) {
238
+ return { error };
239
+ }
240
+ },
241
+ },
242
+ profile: {
243
+ /**
244
+ * Get profile devices
245
+ *
246
+ * @async
247
+ * @function update
248
+ * @param {GetProfileDevices} query - The query used to get profile devices
249
+ * @returns {Promise<ProfileDevice[] | { error: unknown }>} - A promise that resolves to the response data or an error object if the response is not valid.
250
+ */
251
+ get: async function (query) {
252
+ try {
253
+ const response = await store.dispatch(endpoints.getDeviceProfiles.initiate(query));
254
+ if (!response || !response.data || !response.data.result) {
255
+ throw new Error('response did not contain data');
256
+ }
257
+ return response.data.result;
258
+ }
259
+ catch (error) {
260
+ return { error };
261
+ }
262
+ },
263
+ /**
264
+ * Get profile devices
265
+ *
266
+ * @async
267
+ * @function update
268
+ * @param {ProfileDevicesQuery} query - The query used to update a profile device
269
+ * @returns {Promise<ProfileDevice | { error: unknown }>} - A promise that resolves to the response data or or an error object if the response is not valid.
270
+ */
271
+ update: async function (query) {
272
+ try {
273
+ const response = await store.dispatch(endpoints.updateDeviceProfile.initiate(query));
274
+ if (!response || !response.data) {
275
+ throw new Error('response did not contain data');
276
+ }
277
+ return response.data;
278
+ }
279
+ catch (error) {
280
+ return { error };
281
+ }
282
+ },
283
+ /**
284
+ * Get profile devices
285
+ *
286
+ * @async
287
+ * @function update
288
+ * @param {ProfileDevicesQuery} query - The query used to update a profile device
289
+ * @returns {Promise<null | { error: unknown }>} - A promise that resolves to null or an error object if the response is not valid.
290
+ */
291
+ delete: async function (query) {
292
+ try {
293
+ const { error } = await store.dispatch(endpoints.deleteDeviceProfile.initiate(query));
294
+ if (error) {
295
+ handleError(error, 'Failed to delete device profile: ');
296
+ }
297
+ return null;
298
+ }
299
+ catch (error) {
300
+ return { error };
301
+ }
302
+ },
303
+ },
304
+ };
305
+ };
306
+ //# sourceMappingURL=device.store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device.store.js","sourceRoot":"","sources":["../../../src/lib/device.store.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,kBA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AQ,GAAG,MAAM,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;oBAErF,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;wBAChC,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;oBACnD,CAAC;oBAED,OAAO,QAAQ,CAAC,IAAI,CAAC;gBACvB,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,EAAE,KAAK,EAAE,CAAC;gBACnB,CAAC;YACH,CAAC;YACD;;;;;;;eAOG;YACH,MAAM,EAAE,KAAK,WAAW,KAA0B;gBAChD,IAAI,CAAC;oBACH,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;oBAEtF,IAAI,KAAK,EAAE,CAAC;wBACV,WAAW,CAAC,KAAK,EAAE,mCAAmC,CAAC,CAAC;oBAC1D,CAAC;oBAED,OAAO,IAAI,CAAC;gBACd,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,EAAE,KAAK,EAAE,CAAC;gBACnB,CAAC;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { SerializedError } from '@reduxjs/toolkit';
2
+ import { FetchBaseQueryError } from '@reduxjs/toolkit/query';
3
+ export declare function handleError(error: FetchBaseQueryError | SerializedError, message?: string): void;
4
+ //# sourceMappingURL=device.store.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device.store.utils.d.ts","sourceRoot":"","sources":["../../../src/lib/device.store.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,wBAAgB,WAAW,CAAC,KAAK,EAAE,mBAAmB,GAAG,eAAe,EAAE,OAAO,CAAC,EAAE,MAAM,QAWzF"}
@@ -0,0 +1,12 @@
1
+ export function handleError(error, message) {
2
+ /**
3
+ * Handle an RTK Query error after narrowing to either FetchBaseQueryError or SerializedError
4
+ * https://redux-toolkit.js.org/rtk-query/usage-with-typescript#type-safe-error-handling
5
+ */
6
+ if ('status' in error) {
7
+ const errMsg = 'error' in error ? error.error : JSON.stringify(error.data);
8
+ throw new Error(`${message ?? ''}${errMsg}`);
9
+ }
10
+ throw new Error(`${message ?? ''}${error.message}`);
11
+ }
12
+ //# sourceMappingURL=device.store.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device.store.utils.js","sourceRoot":"","sources":["../../../src/lib/device.store.utils.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,WAAW,CAAC,KAA4C,EAAE,OAAgB;IACxF;;;OAGG;IACH,IAAI,QAAQ,IAAI,KAAK,EAAE,CAAC;QACtB,MAAM,MAAM,GAAG,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3E,MAAM,IAAI,KAAK,CAAC,GAAG,OAAO,IAAI,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,GAAG,OAAO,IAAI,EAAE,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;AACtD,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { DeletedOathDevice, OathDevice, OathResponse, RetrieveOathQuery } from '../types/oath.types.js';
2
+ import { DeleteDeviceQuery, DeletedPushDevice, PushDevice, PushDeviceQuery } from '../types/push-device.types.js';
3
+ import { BoundDeviceQuery, Device, GetBoundDevicesQuery } from '../types/bound-device.types.js';
4
+ import { UpdatedWebAuthnDevice, WebAuthnDevice, WebAuthnQuery } from '../types/webauthn.types.js';
5
+ import { ProfileDevice, GetProfileDevices, ProfileDevicesQuery } from '../types/profile-device.types.js';
6
+ export interface GeneralResponse<T> {
7
+ pagedResultsCookie: string | null;
8
+ remainingPagedResults: number;
9
+ resultCount: number;
10
+ totalPagedResults: number;
11
+ totalPagedResultsPolicy: string;
12
+ result: T;
13
+ }
14
+ export declare const deviceService: ({ baseUrl, realmPath }: {
15
+ baseUrl: string;
16
+ realmPath: string;
17
+ }) => import("@reduxjs/toolkit/query").Api<import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, {
18
+ getOathDevices: import("@reduxjs/toolkit/query").QueryDefinition<RetrieveOathQuery, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, never, OathResponse, "deviceClient", unknown>;
19
+ deleteOathDevice: import("@reduxjs/toolkit/query").MutationDefinition<RetrieveOathQuery & {
20
+ device: OathDevice;
21
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, never, DeletedOathDevice, "deviceClient", unknown>;
22
+ getPushDevices: import("@reduxjs/toolkit/query").QueryDefinition<PushDeviceQuery, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, never, GeneralResponse<PushDevice[]>, "deviceClient", unknown>;
23
+ deletePushDevice: import("@reduxjs/toolkit/query").MutationDefinition<DeleteDeviceQuery, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, never, DeletedPushDevice, "deviceClient", unknown>;
24
+ getWebAuthnDevices: import("@reduxjs/toolkit/query").QueryDefinition<WebAuthnQuery, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, never, GeneralResponse<WebAuthnDevice[]>, "deviceClient", unknown>;
25
+ updateWebAuthnDeviceName: import("@reduxjs/toolkit/query").MutationDefinition<WebAuthnQuery & {
26
+ device: WebAuthnDevice;
27
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, never, UpdatedWebAuthnDevice, "deviceClient", unknown>;
28
+ deleteWebAuthnDeviceName: import("@reduxjs/toolkit/query").MutationDefinition<WebAuthnQuery & {
29
+ device: UpdatedWebAuthnDevice | WebAuthnDevice;
30
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, never, UpdatedWebAuthnDevice, "deviceClient", unknown>;
31
+ getBoundDevices: import("@reduxjs/toolkit/query").MutationDefinition<GetBoundDevicesQuery, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, never, GeneralResponse<Device[]>, "deviceClient", unknown>;
32
+ updateBoundDevice: import("@reduxjs/toolkit/query").MutationDefinition<BoundDeviceQuery, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, never, Device, "deviceClient", unknown>;
33
+ deleteBoundDevice: import("@reduxjs/toolkit/query").MutationDefinition<BoundDeviceQuery, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, never, GeneralResponse<Device>, "deviceClient", unknown>;
34
+ getDeviceProfiles: import("@reduxjs/toolkit/query").QueryDefinition<GetProfileDevices, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, never, GeneralResponse<ProfileDevice[]>, "deviceClient", unknown>;
35
+ updateDeviceProfile: import("@reduxjs/toolkit/query").MutationDefinition<Omit<ProfileDevicesQuery, "uuid">, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, never, ProfileDevice, "deviceClient", unknown>;
36
+ deleteDeviceProfile: import("@reduxjs/toolkit/query").MutationDefinition<ProfileDevicesQuery, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, never, ProfileDevice, "deviceClient", unknown>;
37
+ }, "deviceClient", never, typeof import("@reduxjs/toolkit/query").coreModuleName>;
38
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/index.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,eAAe,EAChB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAEhG,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAClG,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,kCAAkC,CAAC;AAE1C,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,uBAAuB,EAAE,MAAM,CAAC;IAChC,MAAM,EAAE,CAAC,CAAC;CACX;AAED,eAAO,MAAM,aAAa,GAAI,wBAAwB;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE;;;gBAwBtD,UAAU;;;;;;gBA8Bd,cAAc;;;gBAUd,qBAAqB,GAAG,cAAc;;;;;;;;iFA6CpE,CAAC"}
@@ -0,0 +1,98 @@
1
+ /*
2
+ * Copyright (c) 2025 Ping Identity Corporation. All rights reserved.
3
+ *
4
+ * This software may be modified and distributed under the terms
5
+ * of the MIT license. See the LICENSE file for details.
6
+ */
7
+ import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query';
8
+ export const deviceService = ({ baseUrl, realmPath }) => createApi({
9
+ reducerPath: 'deviceClient',
10
+ baseQuery: fetchBaseQuery({
11
+ credentials: 'include',
12
+ prepareHeaders: (headers) => {
13
+ headers.set('Content-Type', 'application/json');
14
+ headers.set('Accept', 'application/json');
15
+ headers.set('x-requested-with', 'forgerock-sdk');
16
+ headers.set('x-requested-platform', 'javascript');
17
+ return headers;
18
+ },
19
+ baseUrl,
20
+ }),
21
+ endpoints: (builder) => ({
22
+ // oath endpoints
23
+ getOathDevices: builder.query({
24
+ query: ({ realm = realmPath, userId }) => `json/realms/${realm}/users/${userId}/devices/2fa/oath?_queryFilter=true`,
25
+ }),
26
+ deleteOathDevice: builder.mutation({
27
+ query: ({ realm = realmPath, userId, device }) => ({
28
+ method: 'DELETE',
29
+ url: `json/realms/${realm}/users/${userId}/devices/2fa/oath/${device.uuid}`,
30
+ body: device,
31
+ }),
32
+ }),
33
+ // push device
34
+ getPushDevices: builder.query({
35
+ query: ({ realm = realmPath, userId }) => `/json/realms/${realm}/users/${userId}/devices/2fa/push?_queryFilter=true`,
36
+ }),
37
+ deletePushDevice: builder.mutation({
38
+ query: ({ realm = realmPath, userId, device }) => ({
39
+ url: `/json/realms/${realm}/users/${userId}/devices/2fa/push/${device.uuid}`,
40
+ method: 'DELETE',
41
+ body: {},
42
+ }),
43
+ }),
44
+ // webauthn devices
45
+ getWebAuthnDevices: builder.query({
46
+ query: ({ realm = realmPath, userId }) => `/json/realms/${realm}/users/${userId}/devices/2fa/webauthn?_queryFilter=true`,
47
+ }),
48
+ updateWebAuthnDeviceName: builder.mutation({
49
+ query: ({ realm = realmPath, userId, device }) => ({
50
+ url: `/json/realms/${realm}/users/${userId}/devices/2fa/webauthn/${device.uuid}`,
51
+ method: 'PUT',
52
+ body: device,
53
+ }),
54
+ }),
55
+ deleteWebAuthnDeviceName: builder.mutation({
56
+ query: ({ realm = realmPath, userId, device }) => ({
57
+ url: `/json/realms/${realm}/users/${userId}/devices/2fa/webauthn/${device.uuid}`,
58
+ method: 'DELETE',
59
+ body: device,
60
+ }),
61
+ }),
62
+ getBoundDevices: builder.mutation({
63
+ query: ({ realm = realmPath, userId }) => `/json/realms/${realm}/users/${userId}/devices/2fa/binding?_queryFilter=true`,
64
+ }),
65
+ updateBoundDevice: builder.mutation({
66
+ query: ({ realm = realmPath, userId, device }) => ({
67
+ url: `/json/realms/root/realms/${realm}/users/${userId}/devices/2fa/binding/${device.uuid}`,
68
+ method: 'PUT',
69
+ body: device,
70
+ }),
71
+ }),
72
+ deleteBoundDevice: builder.mutation({
73
+ query: ({ realm = realmPath, userId, device }) => ({
74
+ url: `/json/realms/root/realms/${realm}/users/${userId}/devices/2fa/binding/${device.uuid}`,
75
+ method: 'DELETE',
76
+ body: device,
77
+ }),
78
+ }),
79
+ getDeviceProfiles: builder.query({
80
+ query: ({ realm = realmPath, userId }) => `json/realms/${realm}/users/${userId}/devices/profile?_queryFilter=true`,
81
+ }),
82
+ updateDeviceProfile: builder.mutation({
83
+ query: ({ realm = realmPath, userId, device }) => ({
84
+ url: `json/realms/${realm}/users/${userId}/devices/profile/${device.identifier}`,
85
+ method: 'PUT',
86
+ body: device,
87
+ }),
88
+ }),
89
+ deleteDeviceProfile: builder.mutation({
90
+ query: ({ realm = realmPath, userId, device }) => ({
91
+ url: `json/realms/${realm}/users/${userId}/devices/profile/${device.identifier}`,
92
+ method: 'DELETE',
93
+ body: device,
94
+ }),
95
+ }),
96
+ }),
97
+ });
98
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/services/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AA+BnE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAE,OAAO,EAAE,SAAS,EAA0C,EAAE,EAAE,CAC9F,SAAS,CAAC;IACR,WAAW,EAAE,cAAc;IAC3B,SAAS,EAAE,cAAc,CAAC;QACxB,WAAW,EAAE,SAAS;QACtB,cAAc,EAAE,CAAC,OAAO,EAAE,EAAE;YAC1B,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;YAChD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realm?: string;
4
+ };
5
+ export type BoundDeviceQuery = GetBoundDevicesQuery & {
6
+ device: Device;
7
+ };
8
+ export type DeviceResponse = {
9
+ result: Device[];
10
+ resultCount: number;
11
+ pagedResultsCookie: null;
12
+ totalPagedResultsPolicy: string;
13
+ totalPagedResults: -1;
14
+ remainingPagedResults: -1;
15
+ };
16
+ export type Device = {
17
+ _id: string;
18
+ _rev: string;
19
+ createdDate: number;
20
+ lastAccessDate: number;
21
+ deviceId: string;
22
+ deviceName: string;
23
+ uuid: string;
24
+ recoveryCodes: string[];
25
+ key: {
26
+ kty: string;
27
+ kid: string;
28
+ use: string;
29
+ alg: string;
30
+ n: string;
31
+ e: string;
32
+ };
33
+ deviceManagementStatus: boolean;
34
+ };
35
+ //# sourceMappingURL=bound-device.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bound-device.types.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/bound-device.types.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzE,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,IAAI,CAAC;IACzB,uBAAuB,EAAE,MAAM,CAAC;IAChC,iBAAiB,EAAE,CAAC,CAAC,CAAC;IACtB,qBAAqB,EAAE,CAAC,CAAC,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,GAAG,EAAE;QACH,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;IACF,sBAAsB,EAAE,OAAO,CAAC;CACjC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=bound-device.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bound-device.types.js","sourceRoot":"","sources":["../../../../src/lib/types/bound-device.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ export type { ConfigOptions } from '@forgerock/javascript-sdk';
2
+ export * from './oath.types.js';
3
+ export * from './webauthn.types.js';
4
+ export * from './profile-device.types.js';
5
+ export * from './push-device.types.js';
6
+ export * from './bound-device.types.js';
7
+ export * from './updateDeviceProfile.types.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/index.ts"],"names":[],"mappings":"AAQA,YAAY,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG/D,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC"}
@@ -0,0 +1,14 @@
1
+ /*
2
+ * Copyright (c) 2025 Ping Identity Corporation. All rights reserved.
3
+ *
4
+ * This software may be modified and distributed under the terms
5
+ * of the MIT license. See the LICENSE file for details.
6
+ */
7
+ // Re-export local types
8
+ export * from './oath.types.js';
9
+ export * from './webauthn.types.js';
10
+ export * from './profile-device.types.js';
11
+ export * from './push-device.types.js';
12
+ export * from './bound-device.types.js';
13
+ export * from './updateDeviceProfile.types.js';
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/types/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,wBAAwB;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC"}
@@ -0,0 +1,42 @@
1
+ export type OathDevice = {
2
+ _id: string;
3
+ deviceManagementStatus: boolean;
4
+ deviceName: string;
5
+ uuid: string;
6
+ createdDate: number;
7
+ lastAccessDate: number;
8
+ _rev: string;
9
+ };
10
+ export type DeleteOathQuery = {
11
+ realm?: string;
12
+ userId: string;
13
+ uuid: string;
14
+ };
15
+ export type RetrieveOathQuery = {
16
+ realm?: string;
17
+ userId: string;
18
+ };
19
+ export type OathResponse = {
20
+ pagedResultsCookie: string | null;
21
+ remainingPagedResults: number;
22
+ resultCount: number;
23
+ totalPagedResults: number;
24
+ totalPagedResultsPolicy: string;
25
+ result: OathDevice[];
26
+ };
27
+ export type DeletedOathDevice = {
28
+ _id: string;
29
+ _rev: string;
30
+ uuid: string;
31
+ recoveryCodes: string[];
32
+ createdDate: number;
33
+ lastAccessDate: number;
34
+ sharedSecret: string;
35
+ deviceName: string;
36
+ lastLogin: number;
37
+ counter: number;
38
+ checksumDigit: boolean;
39
+ truncationOffset: number;
40
+ clockDriftSeconds: number;
41
+ };
42
+ //# sourceMappingURL=oath.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oath.types.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/oath.types.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;I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ath.types.js","sourceRoot":"","sources":["../../../../src/lib/types/oath.types.ts"],"names":[],"mappings":""}