@forgerock/davinci-client 0.0.0-beta-20251124184351 → 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 (85) hide show
  1. package/dist/src/index.d.ts +4 -0
  2. package/dist/src/index.d.ts.map +1 -0
  3. package/dist/src/index.js +10 -0
  4. package/dist/src/index.js.map +1 -0
  5. package/dist/src/lib/client.store.d.ts +352 -0
  6. package/dist/src/lib/client.store.d.ts.map +1 -0
  7. package/dist/src/lib/client.store.js +308 -0
  8. package/dist/src/lib/client.store.js.map +1 -0
  9. package/dist/src/lib/client.store.utils.d.ts +74 -0
  10. package/dist/src/lib/client.store.utils.d.ts.map +1 -0
  11. package/dist/src/lib/client.store.utils.js +48 -0
  12. package/dist/src/lib/client.store.utils.js.map +1 -0
  13. package/dist/src/lib/client.types.d.ts +71 -0
  14. package/dist/src/lib/client.types.d.ts.map +1 -0
  15. package/dist/src/lib/client.types.js +2 -0
  16. package/dist/src/lib/client.types.js.map +1 -0
  17. package/dist/src/lib/collector.types.d.ts +448 -0
  18. package/dist/src/lib/collector.types.d.ts.map +1 -0
  19. package/dist/src/lib/collector.types.js +8 -0
  20. package/dist/src/lib/collector.types.js.map +1 -0
  21. package/dist/src/lib/collector.utils.d.ts +154 -0
  22. package/dist/src/lib/collector.utils.d.ts.map +1 -0
  23. package/dist/src/lib/collector.utils.js +651 -0
  24. package/dist/src/lib/collector.utils.js.map +1 -0
  25. package/dist/src/lib/config.slice.d.ts +42 -0
  26. package/dist/src/lib/config.slice.d.ts.map +1 -0
  27. package/dist/src/lib/config.slice.js +59 -0
  28. package/dist/src/lib/config.slice.js.map +1 -0
  29. package/dist/src/lib/config.types.d.ts +12 -0
  30. package/dist/src/lib/config.types.d.ts.map +1 -0
  31. package/dist/src/lib/config.types.js +2 -0
  32. package/dist/src/lib/config.types.js.map +1 -0
  33. package/dist/src/lib/davinci.api.d.ts +31 -0
  34. package/dist/src/lib/davinci.api.d.ts.map +1 -0
  35. package/dist/src/lib/davinci.api.js +347 -0
  36. package/dist/src/lib/davinci.api.js.map +1 -0
  37. package/dist/src/lib/davinci.types.d.ts +328 -0
  38. package/dist/src/lib/davinci.types.d.ts.map +1 -0
  39. package/dist/src/lib/davinci.types.js +11 -0
  40. package/dist/src/lib/davinci.types.js.map +1 -0
  41. package/dist/src/lib/davinci.utils.d.ts +22 -0
  42. package/dist/src/lib/davinci.utils.d.ts.map +1 -0
  43. package/dist/src/lib/davinci.utils.js +170 -0
  44. package/dist/src/lib/davinci.utils.js.map +1 -0
  45. package/dist/src/lib/fido/fido.d.ts +27 -0
  46. package/dist/src/lib/fido/fido.d.ts.map +1 -0
  47. package/dist/src/lib/fido/fido.js +108 -0
  48. package/dist/src/lib/fido/fido.js.map +1 -0
  49. package/dist/src/lib/fido/fido.utils.d.ts +31 -0
  50. package/dist/src/lib/fido/fido.utils.d.ts.map +1 -0
  51. package/dist/src/lib/fido/fido.utils.js +115 -0
  52. package/dist/src/lib/fido/fido.utils.js.map +1 -0
  53. package/dist/src/lib/index.d.ts +3 -0
  54. package/dist/src/lib/index.d.ts.map +1 -0
  55. package/dist/src/lib/index.js +9 -0
  56. package/dist/src/lib/index.js.map +1 -0
  57. package/dist/src/lib/node.reducer.d.ts +27 -0
  58. package/dist/src/lib/node.reducer.d.ts.map +1 -0
  59. package/dist/src/lib/node.reducer.js +230 -0
  60. package/dist/src/lib/node.reducer.js.map +1 -0
  61. package/dist/src/lib/node.slice.d.ts +181 -0
  62. package/dist/src/lib/node.slice.d.ts.map +1 -0
  63. package/dist/src/lib/node.slice.js +261 -0
  64. package/dist/src/lib/node.slice.js.map +1 -0
  65. package/dist/src/lib/node.types.d.ts +119 -0
  66. package/dist/src/lib/node.types.d.ts.map +1 -0
  67. package/dist/src/lib/node.types.js +2 -0
  68. package/dist/src/lib/node.types.js.map +1 -0
  69. package/dist/src/lib/node.utils.d.ts +4 -0
  70. package/dist/src/lib/node.utils.d.ts.map +1 -0
  71. package/dist/src/lib/node.utils.js +32 -0
  72. package/dist/src/lib/node.utils.js.map +1 -0
  73. package/dist/src/lib/wellknown.api.d.ts +5 -0
  74. package/dist/src/lib/wellknown.api.d.ts.map +1 -0
  75. package/dist/src/lib/wellknown.api.js +22 -0
  76. package/dist/src/lib/wellknown.api.js.map +1 -0
  77. package/dist/src/lib/wellknown.types.d.ts +38 -0
  78. package/dist/src/lib/wellknown.types.d.ts.map +1 -0
  79. package/dist/src/lib/wellknown.types.js +2 -0
  80. package/dist/src/lib/wellknown.types.js.map +1 -0
  81. package/dist/src/types.d.ts +45 -0
  82. package/dist/src/types.d.ts.map +1 -0
  83. package/dist/src/types.js +7 -0
  84. package/dist/src/types.js.map +1 -0
  85. package/package.json +6 -6
@@ -0,0 +1,181 @@
1
+ /**
2
+ * Import the needed reducers
3
+ */
4
+ import { updateCollectorValues } from './node.reducer.js';
5
+ /**
6
+ * Import the types
7
+ */
8
+ import type { PayloadAction } from '@reduxjs/toolkit';
9
+ import type { DavinciErrorResponse, DaVinciFailureResponse, DaVinciNextResponse, DaVinciSuccessResponse } from './davinci.types.js';
10
+ import type { ContinueNode, SuccessNode, ErrorNode, StartNode, FailureNode } from './node.types.js';
11
+ /**
12
+ * @const initialNodeState - Initial state for the node slice
13
+ */
14
+ export declare const initialNodeState: {
15
+ cache: null;
16
+ client: {
17
+ status: "start";
18
+ };
19
+ error: null;
20
+ server: {
21
+ status: "start";
22
+ };
23
+ status: "start";
24
+ };
25
+ /**
26
+ * @const nodeSlice - Slice for handling the node state
27
+ * @see https://redux-toolkit.js.org/api/createSlice
28
+ */
29
+ export declare const nodeSlice: import("@reduxjs/toolkit").Slice<ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode, {
30
+ /**
31
+ * @method error - Method for creating an error node
32
+ * @param {Object} state - The current state of the slice
33
+ * @param {PayloadAction<DaVinciErrorCacheEntry<DavinciErrorResponse>>} action - The action to be dispatched
34
+ * @returns {ErrorNode} - The error node
35
+ */
36
+ error(state: import("immer").WritableDraft<ContinueNode> | import("immer").WritableDraft<ErrorNode> | import("immer").WritableDraft<FailureNode> | import("immer").WritableDraft<StartNode> | import("immer").WritableDraft<SuccessNode>, action: PayloadAction<{
37
+ data: DavinciErrorResponse;
38
+ requestId: string;
39
+ httpStatus: number;
40
+ }>): import("immer").WritableDraft<ErrorNode>;
41
+ /**
42
+ * @method failure - Method for creating an error node
43
+ * @param {Object} state - The current state of the slice
44
+ * @param {PayloadAction<DaVinciFailureResponse>} action - The action to be dispatched
45
+ * @returns {FailureNode} - The error node
46
+ */
47
+ failure(state: import("immer").WritableDraft<ContinueNode> | import("immer").WritableDraft<ErrorNode> | import("immer").WritableDraft<FailureNode> | import("immer").WritableDraft<StartNode> | import("immer").WritableDraft<SuccessNode>, action: PayloadAction<{
48
+ data: DaVinciFailureResponse | unknown;
49
+ requestId: string;
50
+ httpStatus: number;
51
+ }>): import("immer").WritableDraft<FailureNode>;
52
+ /**
53
+ * @method next - Method for creating a next node
54
+ * @param {Object} state - The current state of the slice
55
+ * @param {PayloadAction<DaVinciNextResponse>} action - The action to be dispatched
56
+ * @returns {ContinueNode} - The next node
57
+ */
58
+ next(state: import("immer").WritableDraft<ContinueNode> | import("immer").WritableDraft<ErrorNode> | import("immer").WritableDraft<FailureNode> | import("immer").WritableDraft<StartNode> | import("immer").WritableDraft<SuccessNode>, action: PayloadAction<{
59
+ data: DaVinciNextResponse;
60
+ requestId: string;
61
+ httpStatus: number;
62
+ }>): import("immer").WritableDraft<ContinueNode>;
63
+ /**
64
+ * @method start - Method for creating a start node
65
+ * @param {Object} state - The current state of the slice
66
+ * @returns {StartNode} - The start node
67
+ */
68
+ success(state: import("immer").WritableDraft<ContinueNode> | import("immer").WritableDraft<ErrorNode> | import("immer").WritableDraft<FailureNode> | import("immer").WritableDraft<StartNode> | import("immer").WritableDraft<SuccessNode>, action: PayloadAction<{
69
+ data: DaVinciSuccessResponse;
70
+ requestId: string;
71
+ httpStatus: number;
72
+ }>): import("immer").WritableDraft<SuccessNode>;
73
+ /**
74
+ * @method update - Method for updating collector values with the node
75
+ * @param {Object} state - The current state of the slice
76
+ * @param {PayloadAction<unknown>} action - The action to be dispatched
77
+ * @returns {ContinueNode} - The next node
78
+ */
79
+ update(state: import("immer").WritableDraft<ContinueNode> | import("immer").WritableDraft<ErrorNode> | import("immer").WritableDraft<FailureNode> | import("immer").WritableDraft<StartNode> | import("immer").WritableDraft<SuccessNode>, action: ReturnType<typeof updateCollectorValues>): import("immer").WritableDraft<ContinueNode>;
80
+ }, "node", "node", {
81
+ selectClient: (state: ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode) => {
82
+ action: string;
83
+ collectors: import("./node.types.js").Collectors[];
84
+ description?: string;
85
+ name?: string;
86
+ status: "continue";
87
+ } | {
88
+ action: string;
89
+ collectors: import("./node.types.js").Collectors[];
90
+ description?: string;
91
+ name?: string;
92
+ status: "error";
93
+ } | {
94
+ status: "failure";
95
+ } | {
96
+ status: "start";
97
+ } | {
98
+ authorization?: {
99
+ code
100
+ /**
101
+ * @method failure - Method for creating an error node
102
+ * @param {Object} state - The current state of the slice
103
+ * @param {PayloadAction<DaVinciFailureResponse>} action - The action to be dispatched
104
+ * @returns {FailureNode} - The error node
105
+ */
106
+ ?: string;
107
+ state?: string;
108
+ };
109
+ status: "success";
110
+ } | null;
111
+ selectCollectors: (state: ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode) => {
112
+ error: null;
113
+ state: import("./node.types.js").Collectors[];
114
+ } | {
115
+ error: {
116
+ readonly code: "unknown";
117
+ readonly type: "state_error";
118
+ readonly message: "`collectors` are only available on nodes with `status` of continue or error";
119
+ };
120
+ state: never[];
121
+ };
122
+ selectCollector: (state: ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode, id: string) => {
123
+ error: null;
124
+ state: import("./node.types.js").Collectors | undefined;
125
+ } | {
126
+ error: {
127
+ readonly code: "unknown";
128
+ readonly type: "state_error";
129
+ readonly message: "`collectors` are only available on nodes with `status` of continue or error";
130
+ };
131
+ state: null;
132
+ };
133
+ selectError: (state: ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode) => import("./node.types.js").DaVinciError | null;
134
+ selectErrorCollectors: (state: ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode) => {
135
+ error: null;
136
+ state: import("./node.types.js").CollectorErrors[];
137
+ } | {
138
+ error: {
139
+ readonly code: "unknown";
140
+ readonly type: "state_error";
141
+ readonly message: "`errorCollectors` are only available on nodes with `status` of error";
142
+ };
143
+ state: never[];
144
+ };
145
+ selectServer: (state: ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode) => {
146
+ _links?: import("./davinci.types.js").Links;
147
+ id?: string;
148
+ interactionId?: string;
149
+ interactionToken?: string;
150
+ href?: string;
151
+ eventName?: string;
152
+ status: "continue";
153
+ } | {
154
+ _links?: import("./davinci.types.js").Links;
155
+ eventName?: string;
156
+ id?: string;
157
+ interactionId?: string;
158
+ interactionToken?: string;
159
+ status: "error";
160
+ } | {
161
+ _links?: import("./davinci.types.js").Links;
162
+ eventName?: string;
163
+ href?: string;
164
+ id?: string;
165
+ interactionId?: string;
166
+ interactionToken?: string;
167
+ status: "failure";
168
+ } | {
169
+ status: "start";
170
+ } | {
171
+ _links?: import("./davinci.types.js").Links;
172
+ eventName?: string;
173
+ id?: string;
174
+ interactionId?: string;
175
+ interactionToken?: string;
176
+ href?: string;
177
+ session?: string;
178
+ status: "success";
179
+ } | null;
180
+ }>;
181
+ //# sourceMappingURL=node.slice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.slice.d.ts","sourceRoot":"","sources":["../../../src/lib/node.slice.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,OAAO,EAAwB,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAGhF;;GAEG;AACH,OAAO,KAAK,EAAS,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAG7D,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAWpG;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;CAUR,CAAC;AAItB;;;GAGG;AACH,eAAO,MAAM,SAAS;IAIlB;;;;;OAKG;sPAGO,aAAa,CAAC;QAAE,IAAI,EAAE,oBAAoB,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IAsC9F;;;;;OAKG;wPAGO,aAAa,CAAC;QACpB,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC;QACvC,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IA2CJ;;;;;OAKG;qPAGO,aAAa,CAAC;QACpB,IAAI,EAAE,mBAAmB,CAAC;QAC1B,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IA8CJ;;;;OAIG;wPAGO,aAAa,CAAC;QACpB,IAAI,EAAE,sBAAsB,CAAC;QAC7B,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IA+BJ;;;;;OAKG;uPACmB,UAAU,CAAC,OAAO,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;YAjK9D;;;;;eAKG;YACH,CAPJ;iBAEY,CAAC;;;;;;;;;;;;;;;mGA4LoB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCrC,CAAC"}
@@ -0,0 +1,261 @@
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
+ /**
8
+ * Import the required utilities from Redux Toolkit
9
+ */
10
+ import { createSlice } from '@reduxjs/toolkit';
11
+ /**
12
+ * Import the needed reducers
13
+ */
14
+ import { nodeCollectorReducer } from './node.reducer.js';
15
+ import { getCollectorErrors } from './node.utils.js';
16
+ /**
17
+ * The possible statuses for the four types of nodes
18
+ */
19
+ const CONTINUE_STATUS = 'continue';
20
+ const ERROR_STATUS = 'error';
21
+ const FAILURE_STATUS = 'failure';
22
+ const SUCCESS_STATUS = 'success';
23
+ const START_STATUS = 'start';
24
+ /**
25
+ * @const initialNodeState - Initial state for the node slice
26
+ */
27
+ export const initialNodeState = {
28
+ cache: null,
29
+ client: {
30
+ status: START_STATUS,
31
+ },
32
+ error: null,
33
+ server: {
34
+ status: START_STATUS,
35
+ },
36
+ status: START_STATUS,
37
+ };
38
+ /**
39
+ * @const nodeSlice - Slice for handling the node state
40
+ * @see https://redux-toolkit.js.org/api/createSlice
41
+ */
42
+ export const nodeSlice = createSlice({
43
+ name: 'node',
44
+ initialState: initialNodeState,
45
+ reducers: {
46
+ /**
47
+ * @method error - Method for creating an error node
48
+ * @param {Object} state - The current state of the slice
49
+ * @param {PayloadAction<DaVinciErrorCacheEntry<DavinciErrorResponse>>} action - The action to be dispatched
50
+ * @returns {ErrorNode} - The error node
51
+ */
52
+ error(state, action) {
53
+ const newState = state;
54
+ // Reference to the original response from DaVinci in the cache
55
+ newState.cache = {
56
+ key: action.payload.requestId,
57
+ };
58
+ // Data for the client to consume
59
+ newState.client = {
60
+ ...state.client,
61
+ status: ERROR_STATUS,
62
+ };
63
+ newState.error = {
64
+ code: action.payload.data.code,
65
+ collectors: getCollectorErrors(action.payload.data),
66
+ message: action.payload.data.message,
67
+ internalHttpStatus: action.payload.data.httpResponseCode,
68
+ status: 'error',
69
+ type: 'davinci_error',
70
+ };
71
+ newState.httpStatus = action.payload.httpStatus;
72
+ // Data that the server users
73
+ newState.server = {
74
+ ...state.server,
75
+ status: ERROR_STATUS,
76
+ };
77
+ // Used to help detect the node type
78
+ newState.status = ERROR_STATUS;
79
+ return newState;
80
+ },
81
+ /**
82
+ * @method failure - Method for creating an error node
83
+ * @param {Object} state - The current state of the slice
84
+ * @param {PayloadAction<DaVinciFailureResponse>} action - The action to be dispatched
85
+ * @returns {FailureNode} - The error node
86
+ */
87
+ failure(state, action) {
88
+ const newState = state;
89
+ newState.cache = {
90
+ key: action.payload.requestId,
91
+ };
92
+ newState.client = {
93
+ status: FAILURE_STATUS,
94
+ };
95
+ if (action.payload.data && typeof action.payload.data === 'object') {
96
+ const data = action.payload.data;
97
+ newState.error = {
98
+ code: data['code'] || 'unknown',
99
+ message: data['message'] || data['errorMessage'] || '',
100
+ internalHttpStatus: typeof data['httpResponseCode'] === 'number' ? data['httpResponseCode'] : 0,
101
+ status: FAILURE_STATUS,
102
+ type: 'davinci_error',
103
+ };
104
+ }
105
+ else {
106
+ newState.error = {
107
+ code: 'unknown',
108
+ message: 'An unknown error occurred',
109
+ status: FAILURE_STATUS,
110
+ type: 'network_error',
111
+ };
112
+ }
113
+ newState.httpStatus = action.payload.httpStatus;
114
+ newState.server = {
115
+ status: FAILURE_STATUS,
116
+ };
117
+ newState.status = FAILURE_STATUS;
118
+ return newState;
119
+ },
120
+ /**
121
+ * @method next - Method for creating a next node
122
+ * @param {Object} state - The current state of the slice
123
+ * @param {PayloadAction<DaVinciNextResponse>} action - The action to be dispatched
124
+ * @returns {ContinueNode} - The next node
125
+ */
126
+ next(state, action) {
127
+ const newState = state;
128
+ const collectors = nodeCollectorReducer([], {
129
+ type: action.type,
130
+ payload: {
131
+ fields: action.payload.data?.form?.components?.fields,
132
+ formData: action.payload.data?.formData,
133
+ },
134
+ });
135
+ const submitCollector = collectors.filter((collector) => collector.type === 'SubmitCollector')[0];
136
+ newState.cache = {
137
+ key: action.payload.requestId,
138
+ };
139
+ newState.client = {
140
+ action: submitCollector?.output.key,
141
+ description: action.payload.data?.form?.description,
142
+ collectors,
143
+ name: action.payload.data.form?.name,
144
+ status: CONTINUE_STATUS,
145
+ };
146
+ newState.error = null;
147
+ newState.httpStatus = action.payload.httpStatus;
148
+ newState.server = {
149
+ _links: action.payload.data._links,
150
+ id: action.payload.data.id,
151
+ interactionId: action.payload.data.interactionId,
152
+ interactionToken: action.payload.data.interactionToken,
153
+ eventName: action.payload.data.eventName || 'continue',
154
+ status: CONTINUE_STATUS,
155
+ };
156
+ // Used to help detect the node type
157
+ newState.status = CONTINUE_STATUS;
158
+ return newState;
159
+ },
160
+ /**
161
+ * @method start - Method for creating a start node
162
+ * @param {Object} state - The current state of the slice
163
+ * @returns {StartNode} - The start node
164
+ */
165
+ success(state, action) {
166
+ const newState = state;
167
+ newState.cache = {
168
+ key: action.payload.requestId,
169
+ };
170
+ newState.client = {
171
+ authorization: {
172
+ code: action.payload.data.authorizeResponse?.code,
173
+ state: action.payload.data.authorizeResponse?.state,
174
+ },
175
+ status: SUCCESS_STATUS,
176
+ };
177
+ newState.httpStatus = action.payload.httpStatus;
178
+ newState.server = {
179
+ id: action.payload.data.id,
180
+ interactionId: action.payload.data.interactionId,
181
+ interactionToken: action.payload.data.interactionToken,
182
+ session: action.payload.data.session?.id,
183
+ status: SUCCESS_STATUS,
184
+ };
185
+ newState.error = null;
186
+ newState.status = SUCCESS_STATUS;
187
+ return newState;
188
+ },
189
+ /**
190
+ * @method update - Method for updating collector values with the node
191
+ * @param {Object} state - The current state of the slice
192
+ * @param {PayloadAction<unknown>} action - The action to be dispatched
193
+ * @returns {ContinueNode} - The next node
194
+ */
195
+ update(state, action) {
196
+ const newState = state;
197
+ newState.client.collectors = nodeCollectorReducer(newState.client.collectors, action);
198
+ return newState;
199
+ },
200
+ },
201
+ selectors: {
202
+ selectClient: (state) => {
203
+ return state.client;
204
+ },
205
+ selectCollectors: (state) => {
206
+ if (state.client && 'collectors' in state.client) {
207
+ return {
208
+ error: null,
209
+ state: state?.client.collectors,
210
+ };
211
+ }
212
+ return {
213
+ error: {
214
+ code: 'unknown',
215
+ type: 'state_error',
216
+ message: `\`collectors\` are only available on nodes with \`status\` of ${CONTINUE_STATUS} or ${ERROR_STATUS}`,
217
+ },
218
+ state: [],
219
+ };
220
+ },
221
+ selectCollector: (state, id) => {
222
+ if (state.client && 'collectors' in state.client) {
223
+ return {
224
+ error: null,
225
+ state: state.client.collectors?.find((collector) => collector.id === id),
226
+ };
227
+ }
228
+ return {
229
+ error: {
230
+ code: 'unknown',
231
+ type: 'state_error',
232
+ message: `\`collectors\` are only available on nodes with \`status\` of ${CONTINUE_STATUS} or ${ERROR_STATUS}`,
233
+ },
234
+ state: null,
235
+ };
236
+ },
237
+ selectError: (state) => {
238
+ return state.error;
239
+ },
240
+ selectErrorCollectors: (state) => {
241
+ if (state.status === ERROR_STATUS) {
242
+ return {
243
+ error: null,
244
+ state: state.error?.collectors || [],
245
+ };
246
+ }
247
+ return {
248
+ error: {
249
+ code: 'unknown',
250
+ type: 'state_error',
251
+ message: `\`errorCollectors\` are only available on nodes with \`status\` of ${ERROR_STATUS}`,
252
+ },
253
+ state: [],
254
+ };
255
+ },
256
+ selectServer: (state) => {
257
+ return state.server;
258
+ },
259
+ },
260
+ });
261
+ //# sourceMappingURL=node.slice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.slice.js","sourceRoot":"","sources":["../../../src/lib/node.slice.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH;;GAEG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C;;GAEG;AACH,OAAO,EAAE,oBAAoB,EAAyB,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAgBrD;;GAEG;AACH,MAAM,eAAe,GAAG,UAAU,CAAC;AACnC,MAAM,YAAY,GAAG,OAAO,CAAC;AAC7B,MAAM,cAAc,GAAG,SAAS,CAAC;AACjC,MAAM,cAAc,GAAG,SAAS,CAAC;AACjC,MAAM,YAAY,GAAG,OAAO,CAAC;AAE7B;;GAEG;AACH,MAAM,CA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aACZ,CAAC;QACJ,CAAC;QACD,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE;YACrB,OAAO,KAAK,CAAC,KAAK,CAAC;QACrB,CAAC;QACD,qBAAqB,EAAE,CAAC,KAAK,EAAE,EAAE;YAC/B,IAAI,KAAK,CAAC,MAAM,KAAK,YAAY,EAAE,CAAC;gBAClC,OAAO;oBACL,KAAK,EAAE,IAAI;oBACX,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,UAAU,IAAI,EAAE;iBACrC,CAAC;YACJ,CAAC;YACD,OAAO;gBACL,KAAK,EAAE;oBACL,IAAI,EAAE,SAAS;oBACf,IAAI,EAAE,aAAa;oBACnB,OAAO,EAAE,sEAAsE,YAAY,EAAE;iBACrF;gBACV,KAAK,EAAE,EAAE;aACV,CAAC;QACJ,CAAC;QACD,YAAY,EAAE,CAAC,KAAK,EAAE,EAAE;YACtB,OAAO,KAAK,CAAC,MAAM,CAAC;QACtB,CAAC;KACF;CACF,CAAC,CAAC"}
@@ -0,0 +1,119 @@
1
+ import { GenericError } from '@forgerock/sdk-types';
2
+ import type { FlowCollector, PasswordCollector, TextCollector, IdpCollector, SubmitCollector, ActionCollector, SingleValueCollector, SingleSelectCollector, MultiSelectCollector, DeviceAuthenticationCollector, DeviceRegistrationCollector, ReadOnlyCollector, ValidatedTextCollector, PhoneNumberCollector, ProtectCollector, UnknownCollector, FidoRegistrationCollector, FidoAuthenticationCollector } from './collector.types.js';
3
+ import type { Links } from './davinci.types.js';
4
+ export type Collectors = FlowCollector | PasswordCollector | TextCollector | SingleSelectCollector | IdpCollector | SubmitCollector | ActionCollector<'ActionCollector'> | SingleValueCollector<'SingleValueCollector'> | MultiSelectCollector | DeviceAuthenticationCollector | DeviceRegistrationCollector | PhoneNumberCollector | ReadOnlyCollector | ValidatedTextCollector | ProtectCollector | FidoRegistrationCollector | FidoAuthenticationCollector | UnknownCollector;
5
+ export interface CollectorErrors {
6
+ code: string;
7
+ message: string;
8
+ target: string;
9
+ }
10
+ export interface ContinueNode {
11
+ cache: {
12
+ key: string;
13
+ };
14
+ client: {
15
+ action: string;
16
+ collectors: Collectors[];
17
+ description?: string;
18
+ name?: string;
19
+ status: 'continue';
20
+ };
21
+ error: null;
22
+ httpStatus: number;
23
+ server: {
24
+ _links?: Links;
25
+ id?: string;
26
+ interactionId?: string;
27
+ interactionToken?: string;
28
+ href?: string;
29
+ eventName?: string;
30
+ status: 'continue';
31
+ };
32
+ status: 'continue';
33
+ }
34
+ export interface DaVinciError extends Omit<GenericError, 'error'> {
35
+ collectors?: CollectorErrors[];
36
+ internalHttpStatus?: number;
37
+ message: string;
38
+ status: 'error' | 'failure' | 'unknown';
39
+ }
40
+ export interface ErrorNode {
41
+ cache: {
42
+ key: string;
43
+ };
44
+ client: {
45
+ action: string;
46
+ collectors: Collectors[];
47
+ description?: string;
48
+ name?: string;
49
+ status: 'error';
50
+ };
51
+ error: DaVinciError;
52
+ httpStatus: number;
53
+ server: {
54
+ _links?: Links;
55
+ eventName?: string;
56
+ id?: string;
57
+ interactionId?: string;
58
+ interactionToken?: string;
59
+ status: 'error';
60
+ } | null;
61
+ status: 'error';
62
+ }
63
+ export interface FailureNode {
64
+ cache: {
65
+ key: string;
66
+ };
67
+ client: {
68
+ status: 'failure';
69
+ };
70
+ error: DaVinciError;
71
+ httpStatus: number;
72
+ server: {
73
+ _links?: Links;
74
+ eventName?: string;
75
+ href?: string;
76
+ id?: string;
77
+ interactionId?: string;
78
+ interactionToken?: string;
79
+ status: 'failure';
80
+ } | null;
81
+ status: 'failure';
82
+ }
83
+ export interface StartNode {
84
+ cache: null;
85
+ client: {
86
+ status: 'start';
87
+ };
88
+ error: DaVinciError | null;
89
+ server: {
90
+ status: 'start';
91
+ };
92
+ status: 'start';
93
+ }
94
+ export interface SuccessNode {
95
+ cache: {
96
+ key: string;
97
+ };
98
+ client: {
99
+ authorization?: {
100
+ code?: string;
101
+ state?: string;
102
+ };
103
+ status: 'success';
104
+ } | null;
105
+ error: null;
106
+ httpStatus: number;
107
+ server: {
108
+ _links?: Links;
109
+ eventName?: string;
110
+ id?: string;
111
+ interactionId?: string;
112
+ interactionToken?: string;
113
+ href?: string;
114
+ session?: string;
115
+ status: 'success';
116
+ };
117
+ status: 'success';
118
+ }
119
+ //# sourceMappingURL=node.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.types.d.ts","sourceRoot":"","sources":["../../../src/lib/node.types.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,6BAA6B,EAC7B,2BAA2B,EAC3B,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,yBAAyB,EACzB,2BAA2B,EAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD,MAAM,MAAM,UAAU,GAClB,aAAa,GACb,iBAAiB,GACjB,aAAa,GACb,qBAAqB,GACrB,YAAY,GACZ,eAAe,GACf,eAAe,CAAC,iBAAiB,CAAC,GAClC,oBAAoB,CAAC,sBAAsB,CAAC,GAC5C,oBAAoB,GACpB,6BAA6B,GAC7B,2BAA2B,GAC3B,oBAAoB,GACpB,iBAAiB,GACjB,sBAAsB,GACtB,gBAAgB,GAChB,yBAAyB,GACzB,2BAA2B,GAC3B,gBAAgB,CAAC;AAErB,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,MAAM,EAAE;QACN,MAAM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AU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE;QACN,MAAM,CAAC,EAAE,KAAK,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,SAAS,CAAC;KACnB,CAAC;IACF,MAAM,EAAE,SAAS,CAAC;CACnB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=node.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.types.js","sourceRoot":"","sources":["../../../src/lib/node.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { DavinciErrorResponse } from './davinci.types.js';
2
+ import { CollectorErrors } from './node.types.js';
3
+ export declare function getCollectorErrors(error: DavinciErrorResponse): CollectorErrors[];
4
+ //# sourceMappingURL=node.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.utils.d.ts","sourceRoot":"","sources":["../../../src/lib/node.utils.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,oBAAoB,qBA+B7D"}
@@ -0,0 +1,32 @@
1
+ export function getCollectorErrors(error) {
2
+ const details = error.details;
3
+ if (!details || !Array.isArray(details)) {
4
+ return [];
5
+ }
6
+ return details.reduce((acc, next) => {
7
+ if (!next.rawResponse) {
8
+ return acc;
9
+ }
10
+ if (!next.rawResponse.code) {
11
+ return acc;
12
+ }
13
+ if (next.rawResponse.code !== 'INVALID_DATA') {
14
+ return acc;
15
+ }
16
+ if (!Array.isArray(next.rawResponse.details)) {
17
+ return acc;
18
+ }
19
+ next.rawResponse.details.forEach((item) => {
20
+ if (!item.target) {
21
+ return;
22
+ }
23
+ acc.push({
24
+ code: item.code || '',
25
+ message: item.message || '',
26
+ target: item.target,
27
+ });
28
+ });
29
+ return acc;
30
+ }, []);
31
+ }
32
+ //# sourceMappingURL=node.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.utils.js","sourceRoot":"","sources":["../../../src/lib/node.utils.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,kBAAkB,CAAC,KAA2B;IAC5D,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IAC9B,IAAI,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACxC,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,OAAO,CAAC,MAAM,CAAoB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;QACrD,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,OAAO,GAAG,CAAC;QACb,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;YAC3B,OAAO,GAAG,CAAC;QACb,CAAC;QACD,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;YAC7C,OAAO,GAAG,CAAC;QACb,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;YAC7C,OAAO,GAAG,CAAC;QACb,CAAC;QACD,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,EAAQ,EAAE;YAC9C,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;gBACjB,OAAO;YACT,CAAC;YACD,GAAG,CAAC,IAAI,CAAC;gBACP,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,EAAE;gBACrB,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE;gBAC3B,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { WellknownResponse } from './wellknown.types.js';
2
+ export declare const wellknownApi: 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>, {
3
+ wellknown: import("@reduxjs/toolkit/query").QueryDefinition<string, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, never, WellknownResponse, "wellknown", unknown>;
4
+ }, "wellknown", never, typeof import("@reduxjs/toolkit/query").coreModuleName>;
5
+ //# sourceMappingURL=wellknown.api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wellknown.api.d.ts","sourceRoot":"","sources":["../../../src/lib/wellknown.api.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,eAAO,MAAM,YAAY;;8EAavB,CAAC"}