@forgerock/davinci-client 1.0.0 → 1.2.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/LICENSE +21 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +9 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/lib/client.store.d.ts +352 -0
- package/dist/src/lib/client.store.d.ts.map +1 -0
- package/dist/src/lib/client.store.js +300 -0
- package/dist/src/lib/client.store.js.map +1 -0
- package/dist/src/lib/client.store.utils.d.ts +74 -0
- package/dist/src/lib/client.store.utils.d.ts.map +1 -0
- package/dist/src/lib/client.store.utils.js +48 -0
- package/dist/src/lib/client.store.utils.js.map +1 -0
- package/dist/src/lib/client.types.d.ts +19 -0
- package/dist/src/lib/client.types.d.ts.map +1 -0
- package/dist/src/lib/client.types.js +2 -0
- package/dist/src/lib/client.types.js.map +1 -0
- package/dist/src/lib/collector.types.d.ts +360 -0
- package/dist/src/lib/collector.types.d.ts.map +1 -0
- package/dist/src/lib/collector.types.js +8 -0
- package/dist/src/lib/collector.types.js.map +1 -0
- package/dist/src/lib/collector.utils.d.ts +117 -0
- package/dist/src/lib/collector.utils.d.ts.map +1 -0
- package/dist/src/lib/collector.utils.js +463 -0
- package/dist/src/lib/collector.utils.js.map +1 -0
- package/dist/{lib → src/lib}/config.slice.d.ts +12 -5
- package/dist/src/lib/config.slice.d.ts.map +1 -0
- package/dist/src/lib/config.slice.js +59 -0
- package/dist/src/lib/config.slice.js.map +1 -0
- package/dist/src/lib/config.types.d.ts +12 -0
- package/dist/src/lib/config.types.d.ts.map +1 -0
- package/dist/src/lib/config.types.js +2 -0
- package/dist/src/lib/config.types.js.map +1 -0
- package/dist/src/lib/davinci.api.d.ts +31 -0
- package/dist/src/lib/davinci.api.d.ts.map +1 -0
- package/dist/src/lib/davinci.api.js +346 -0
- package/dist/src/lib/davinci.api.js.map +1 -0
- package/dist/{lib → src/lib}/davinci.types.d.ts +101 -8
- package/dist/src/lib/davinci.types.d.ts.map +1 -0
- package/dist/src/lib/davinci.types.js +11 -0
- package/dist/src/lib/davinci.types.js.map +1 -0
- package/dist/{lib → src/lib}/davinci.utils.d.ts +10 -6
- package/dist/src/lib/davinci.utils.d.ts.map +1 -0
- package/dist/src/lib/davinci.utils.js +168 -0
- package/dist/src/lib/davinci.utils.js.map +1 -0
- package/dist/src/lib/error.types.d.ts.map +1 -0
- package/dist/src/lib/error.types.js +2 -0
- package/dist/src/lib/error.types.js.map +1 -0
- package/dist/src/lib/index.d.ts.map +1 -0
- package/dist/src/lib/index.js +9 -0
- package/dist/src/lib/index.js.map +1 -0
- package/dist/src/lib/node.reducer.d.ts +27 -0
- package/dist/src/lib/node.reducer.d.ts.map +1 -0
- package/dist/src/lib/node.reducer.js +193 -0
- package/dist/src/lib/node.reducer.js.map +1 -0
- package/dist/{lib → src/lib}/node.slice.d.ts +55 -26
- package/dist/src/lib/node.slice.d.ts.map +1 -0
- package/dist/src/lib/node.slice.js +261 -0
- package/dist/src/lib/node.slice.js.map +1 -0
- package/dist/{lib → src/lib}/node.types.d.ts +17 -8
- package/dist/src/lib/node.types.d.ts.map +1 -0
- package/dist/src/lib/node.types.js +2 -0
- package/dist/src/lib/node.types.js.map +1 -0
- package/dist/src/lib/node.utils.d.ts +4 -0
- package/dist/src/lib/node.utils.d.ts.map +1 -0
- package/dist/src/lib/node.utils.js +32 -0
- package/dist/src/lib/node.utils.js.map +1 -0
- package/dist/src/lib/wellknown.api.d.ts +5 -0
- package/dist/src/lib/wellknown.api.d.ts.map +1 -0
- package/dist/src/lib/wellknown.api.js +22 -0
- package/dist/src/lib/wellknown.api.js.map +1 -0
- package/dist/src/lib/wellknown.types.d.ts.map +1 -0
- package/dist/src/lib/wellknown.types.js +2 -0
- package/dist/src/lib/wellknown.types.js.map +1 -0
- package/dist/src/types.d.ts +40 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +7 -0
- package/dist/src/types.js.map +1 -0
- package/package.json +39 -20
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -4
- package/dist/lib/authorize.utils.d.ts +0 -22
- package/dist/lib/authorize.utils.d.ts.map +0 -1
- package/dist/lib/authorize.utils.js +0 -23
- package/dist/lib/client.store.d.ts +0 -149
- package/dist/lib/client.store.d.ts.map +0 -1
- package/dist/lib/client.store.js +0 -131
- package/dist/lib/client.store.utils.d.ts +0 -46
- package/dist/lib/client.store.utils.d.ts.map +0 -1
- package/dist/lib/client.store.utils.js +0 -19
- package/dist/lib/client.types.d.ts +0 -9
- package/dist/lib/client.types.d.ts.map +0 -1
- package/dist/lib/collector.types.d.ts +0 -78
- package/dist/lib/collector.types.d.ts.map +0 -1
- package/dist/lib/collector.utils.d.ts +0 -54
- package/dist/lib/collector.utils.d.ts.map +0 -1
- package/dist/lib/collector.utils.js +0 -88
- package/dist/lib/config.slice.d.ts.map +0 -1
- package/dist/lib/config.slice.js +0 -40
- package/dist/lib/config.types.d.ts +0 -9
- package/dist/lib/config.types.d.ts.map +0 -1
- package/dist/lib/davinci.api.d.ts +0 -20
- package/dist/lib/davinci.api.d.ts.map +0 -1
- package/dist/lib/davinci.api.js +0 -172
- package/dist/lib/davinci.types.d.ts.map +0 -1
- package/dist/lib/davinci.utils.d.ts.map +0 -1
- package/dist/lib/davinci.utils.js +0 -102
- package/dist/lib/error.types.d.ts.map +0 -1
- package/dist/lib/index.d.ts.map +0 -1
- package/dist/lib/node.reducer.d.ts +0 -22
- package/dist/lib/node.reducer.d.ts.map +0 -1
- package/dist/lib/node.reducer.js +0 -31
- package/dist/lib/node.slice.d.ts.map +0 -1
- package/dist/lib/node.slice.js +0 -160
- package/dist/lib/node.types.d.ts.map +0 -1
- package/dist/lib/wellknown.api.d.ts +0 -5
- package/dist/lib/wellknown.api.d.ts.map +0 -1
- package/dist/lib/wellknown.api.js +0 -15
- package/dist/lib/wellknown.types.d.ts.map +0 -1
- package/dist/types.d.ts +0 -23
- package/dist/types.d.ts.map +0 -1
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{lib → src/lib}/error.types.d.ts +0 -0
- /package/dist/{lib → src/lib}/index.d.ts +0 -0
- /package/dist/{lib → src/lib}/wellknown.types.d.ts +0 -0
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { DaVinciConfig } from './config.types.js';
|
|
2
|
-
import { DaVinciAction, DaVinciRequest } from './davinci.types.js';
|
|
3
|
-
import { SingleValueCollectors } from './collector.types.js';
|
|
4
|
-
import { InitFlow, Updater } from './client.types.js';
|
|
5
|
-
/**
|
|
6
|
-
* Create a client function that returns a set of methods
|
|
7
|
-
* to interact with and normalize the DaVinci API.
|
|
8
|
-
*
|
|
9
|
-
* @function davinciClient - returns an "observable" client for DaVinci flows
|
|
10
|
-
* @param {ConfigurationOptions} options - the configuration options for the client
|
|
11
|
-
* @returns {Observable} - an observable client for DaVinci flows
|
|
12
|
-
*/
|
|
13
|
-
export declare function davinci({ config }: {
|
|
14
|
-
config: DaVinciConfig;
|
|
15
|
-
}): Promise<{
|
|
16
|
-
subscribe: (listener: () => void) => import('@reduxjs/toolkit').Unsubscribe;
|
|
17
|
-
/**
|
|
18
|
-
* @method flow - Method for initiating a new flow, different than current flow
|
|
19
|
-
* @param {DaVinciAction} action - the action to initiate the flow
|
|
20
|
-
* @returns {function} - an async function to call the flow
|
|
21
|
-
*/
|
|
22
|
-
flow: (action: DaVinciAction) => InitFlow;
|
|
23
|
-
/**
|
|
24
|
-
* @method next - Method for initiating the next node in the current flow
|
|
25
|
-
* @param {DaVinciRequest} args - the arguments to pass to the next
|
|
26
|
-
* @returns {Promise} - a promise that resolves to the next node
|
|
27
|
-
*/
|
|
28
|
-
next: (args?: DaVinciRequest) => Promise<import('./node.types.js').ContinueNode | import('./node.types.js').ErrorNode | import('./node.types.js').FailureNode | import('./node.types.js').StartNode | import('./node.types.js').SuccessNode | {
|
|
29
|
-
error: string;
|
|
30
|
-
cache: null;
|
|
31
|
-
client: {
|
|
32
|
-
status: "start";
|
|
33
|
-
};
|
|
34
|
-
server: {
|
|
35
|
-
status: "start";
|
|
36
|
-
};
|
|
37
|
-
status: "start";
|
|
38
|
-
}>;
|
|
39
|
-
/**
|
|
40
|
-
* @method start - Method for initiating a DaVinci flow
|
|
41
|
-
* @returns {Promise} - a promise that initiates a DaVinci flow and returns a node
|
|
42
|
-
*/
|
|
43
|
-
start: () => Promise<import('./node.types.js').ContinueNode | import('./node.types.js').ErrorNode | import('./node.types.js').FailureNode | import('./node.types.js').StartNode | import('./node.types.js').SuccessNode>;
|
|
44
|
-
/**
|
|
45
|
-
* @method update - Exclusive method for updating the current node with user provided values
|
|
46
|
-
* @param {SingleValueCollector} collector - the collector to update
|
|
47
|
-
* @returns {function} - an function to call for updating collector value
|
|
48
|
-
*/
|
|
49
|
-
update: (collector: SingleValueCollectors) => Updater;
|
|
50
|
-
/**
|
|
51
|
-
* @method client - Selector to get the node.client from state
|
|
52
|
-
* @returns {Node.client} - the client property from the current node
|
|
53
|
-
*/
|
|
54
|
-
getClient: () => {
|
|
55
|
-
action: string;
|
|
56
|
-
collectors: import('./node.types.js').Collectors[];
|
|
57
|
-
description?: string;
|
|
58
|
-
name?: string;
|
|
59
|
-
status: "continue";
|
|
60
|
-
} | {
|
|
61
|
-
status: "error";
|
|
62
|
-
} | {
|
|
63
|
-
status: "failure";
|
|
64
|
-
} | {
|
|
65
|
-
status: "start";
|
|
66
|
-
} | {
|
|
67
|
-
authorization?: {
|
|
68
|
-
code?: string;
|
|
69
|
-
state?: string;
|
|
70
|
-
};
|
|
71
|
-
status: "success";
|
|
72
|
-
} | null;
|
|
73
|
-
/**
|
|
74
|
-
* @method collectors - Selector to get the collectors from state
|
|
75
|
-
* @returns {Collector[]} - The collectors from the current node in state
|
|
76
|
-
*/
|
|
77
|
-
getCollectors: () => import('./node.types.js').Collectors[];
|
|
78
|
-
getError: () => import('./node.types.js').DaVinciError | null;
|
|
79
|
-
/**
|
|
80
|
-
* @method node - Selector to get the node from state
|
|
81
|
-
* @returns {Node} - the current node from state
|
|
82
|
-
*/
|
|
83
|
-
getNode: () => import('./node.types.js').ContinueNode | import('./node.types.js').ErrorNode | import('./node.types.js').FailureNode | import('./node.types.js').StartNode | import('./node.types.js').SuccessNode;
|
|
84
|
-
/**
|
|
85
|
-
* @method server - Selector to get the node.server from state
|
|
86
|
-
* @returns {Node.server} - the server property from the current node
|
|
87
|
-
*/
|
|
88
|
-
getServer: () => {
|
|
89
|
-
_links?: import('./davinci.types.js').Links;
|
|
90
|
-
id?: string;
|
|
91
|
-
interactionId?: string;
|
|
92
|
-
interactionToken?: string;
|
|
93
|
-
href?: string;
|
|
94
|
-
eventName?: string;
|
|
95
|
-
status: "continue";
|
|
96
|
-
} | {
|
|
97
|
-
_links?: import('./davinci.types.js').Links;
|
|
98
|
-
eventName?: string;
|
|
99
|
-
id?: string;
|
|
100
|
-
interactionId?: string;
|
|
101
|
-
interactionToken?: string;
|
|
102
|
-
status: "error";
|
|
103
|
-
} | {
|
|
104
|
-
_links?: import('./davinci.types.js').Links;
|
|
105
|
-
eventName?: string;
|
|
106
|
-
href?: string;
|
|
107
|
-
id?: string;
|
|
108
|
-
interactionId?: string;
|
|
109
|
-
interactionToken?: string;
|
|
110
|
-
status: "failure";
|
|
111
|
-
} | {
|
|
112
|
-
status: "start";
|
|
113
|
-
} | {
|
|
114
|
-
_links?: import('./davinci.types.js').Links;
|
|
115
|
-
eventName?: string;
|
|
116
|
-
id?: string;
|
|
117
|
-
interactionId?: string;
|
|
118
|
-
interactionToken?: string;
|
|
119
|
-
href?: string;
|
|
120
|
-
session?: string;
|
|
121
|
-
status: "success";
|
|
122
|
-
} | null;
|
|
123
|
-
/**
|
|
124
|
-
* Utilities to help query cached responses from server
|
|
125
|
-
*/
|
|
126
|
-
cache: {
|
|
127
|
-
getLatestResponse: () => ((state: import('@reduxjs/toolkit/query').RootState<{
|
|
128
|
-
flow: import('@reduxjs/toolkit/query').MutationDefinition<any, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, never, unknown, "davinci">;
|
|
129
|
-
next: import('@reduxjs/toolkit/query').MutationDefinition<any, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, never, unknown, "davinci">;
|
|
130
|
-
start: import('@reduxjs/toolkit/query').MutationDefinition<void, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, never, unknown, "davinci">;
|
|
131
|
-
}, never, "davinci">) => import('@reduxjs/toolkit/query').MutationResultSelectorResult<import('@reduxjs/toolkit/query').MutationDefinition<any, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, never, unknown, "davinci">>) | {
|
|
132
|
-
error: {
|
|
133
|
-
message: string;
|
|
134
|
-
type: string;
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
|
-
getResponseWithId: (requestId: string) => ((state: import('@reduxjs/toolkit/query').RootState<{
|
|
138
|
-
flow: import('@reduxjs/toolkit/query').MutationDefinition<any, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, never, unknown, "davinci">;
|
|
139
|
-
next: import('@reduxjs/toolkit/query').MutationDefinition<any, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, never, unknown, "davinci">;
|
|
140
|
-
start: import('@reduxjs/toolkit/query').MutationDefinition<void, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, never, unknown, "davinci">;
|
|
141
|
-
}, never, "davinci">) => import('@reduxjs/toolkit/query').MutationResultSelectorResult<import('@reduxjs/toolkit/query').MutationDefinition<any, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, never, unknown, "davinci">>) | {
|
|
142
|
-
error: {
|
|
143
|
-
message: string;
|
|
144
|
-
type: string;
|
|
145
|
-
};
|
|
146
|
-
};
|
|
147
|
-
};
|
|
148
|
-
}>;
|
|
149
|
-
//# sourceMappingURL=client.store.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.store.d.ts","sourceRoot":"","sources":["../../src/lib/client.store.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE3D;;;;;;;GAOG;AACH,wBAAsB,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,aAAa,CAAA;CAAE;;IAyB/D;;;;OAIG;mBACY,aAAa,KAAG,QAAQ;IAevC;;;;OAIG;kBACiB,cAAc;;;;;;;;;;;IAclC;;;OAGG;;IAMH;;;;OAIG;wBACiB,qBAAqB,KAAG,OAAO;IA6CnD;;;OAGG;;;;;;;;;;;;;;;gBA9FgB,CAAC;iBAAqB,CAAC;;;;IAiG1C;;;OAGG;;;IAiBH;;;OAGG;;IAKH;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAMH;;OAEG;;;;;;;;;;;;uCAgB8B,MAAM;;;;;;;;;;;GAc1C"}
|
package/dist/lib/client.store.js
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { createClientStore as d } from "./client.store.utils.js";
|
|
2
|
-
import { nodeSlice as n } from "./node.slice.js";
|
|
3
|
-
import { davinciApi as o } from "./davinci.api.js";
|
|
4
|
-
import { configSlice as p } from "./config.slice.js";
|
|
5
|
-
import { wellknownApi as g } from "./wellknown.api.js";
|
|
6
|
-
async function C({ config: a }) {
|
|
7
|
-
const t = d();
|
|
8
|
-
if (!a.serverConfig.wellknown)
|
|
9
|
-
throw new Error("`wellknown` property is a required as part of the `config.serverOptions`");
|
|
10
|
-
if (!a.clientId)
|
|
11
|
-
throw new Error("`clientId` property is a required as part of the `config`");
|
|
12
|
-
const { data: i } = await t.dispatch(
|
|
13
|
-
g.endpoints.wellknown.initiate(a.serverConfig.wellknown)
|
|
14
|
-
);
|
|
15
|
-
if (!i)
|
|
16
|
-
throw new Error("error fetching `wellknown` response for OpenId Configuration");
|
|
17
|
-
return t.dispatch(p.actions.set({ ...a, wellknownResponse: i })), {
|
|
18
|
-
// Pass store methods to the client
|
|
19
|
-
subscribe: t.subscribe,
|
|
20
|
-
/**
|
|
21
|
-
* @method flow - Method for initiating a new flow, different than current flow
|
|
22
|
-
* @param {DaVinciAction} action - the action to initiate the flow
|
|
23
|
-
* @returns {function} - an async function to call the flow
|
|
24
|
-
*/
|
|
25
|
-
flow: (e) => e.action ? async function() {
|
|
26
|
-
return await t.dispatch(o.endpoints.flow.initiate(e)), n.selectSlice(t.getState());
|
|
27
|
-
} : (console.error("Missing `argument.action`"), async function() {
|
|
28
|
-
return { error: { message: "Missing argument.action", type: "argument_error" } };
|
|
29
|
-
}),
|
|
30
|
-
/**
|
|
31
|
-
* @method next - Method for initiating the next node in the current flow
|
|
32
|
-
* @param {DaVinciRequest} args - the arguments to pass to the next
|
|
33
|
-
* @returns {Promise} - a promise that resolves to the next node
|
|
34
|
-
*/
|
|
35
|
-
next: async (e) => {
|
|
36
|
-
const r = n.selectSlice(t.getState());
|
|
37
|
-
return r.status === "start" ? {
|
|
38
|
-
...r,
|
|
39
|
-
error: "Please use `start` before calling `next`"
|
|
40
|
-
} : (await t.dispatch(o.endpoints.next.initiate(e)), n.selectSlice(t.getState()));
|
|
41
|
-
},
|
|
42
|
-
/**
|
|
43
|
-
* @method start - Method for initiating a DaVinci flow
|
|
44
|
-
* @returns {Promise} - a promise that initiates a DaVinci flow and returns a node
|
|
45
|
-
*/
|
|
46
|
-
start: async () => (await t.dispatch(o.endpoints.start.initiate()), t.getState().node),
|
|
47
|
-
/**
|
|
48
|
-
* @method update - Exclusive method for updating the current node with user provided values
|
|
49
|
-
* @param {SingleValueCollector} collector - the collector to update
|
|
50
|
-
* @returns {function} - an function to call for updating collector value
|
|
51
|
-
*/
|
|
52
|
-
update: (e) => {
|
|
53
|
-
if (!e.id)
|
|
54
|
-
return console.error("Argument for `collector` has no ID"), function() {
|
|
55
|
-
return {
|
|
56
|
-
error: { message: "Argument for `collector` has no ID", type: "argument_error" }
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
const { id: r } = e, s = n.selectors.selectCollector(t.getState(), r);
|
|
60
|
-
return s ? s.category !== "SingleValueCollector" ? (console.error("Collector is not a SingleValueCollector and cannot be updated"), function() {
|
|
61
|
-
return {
|
|
62
|
-
error: {
|
|
63
|
-
message: "Collector is not a SingleValueCollector and cannot be updated",
|
|
64
|
-
type: "state_error"
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
}) : function(c, l) {
|
|
68
|
-
try {
|
|
69
|
-
return t.dispatch(n.actions.update({ id: r, value: c, index: l })), null;
|
|
70
|
-
} catch (u) {
|
|
71
|
-
return { error: { message: u.message, type: "internal_error" } };
|
|
72
|
-
}
|
|
73
|
-
} : function() {
|
|
74
|
-
return console.error("Collector not found"), {
|
|
75
|
-
error: { message: "Collector not found", type: "state_error" }
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
},
|
|
79
|
-
/**
|
|
80
|
-
* @method client - Selector to get the node.client from state
|
|
81
|
-
* @returns {Node.client} - the client property from the current node
|
|
82
|
-
*/
|
|
83
|
-
getClient: () => n.selectors.selectClient(t.getState()),
|
|
84
|
-
/**
|
|
85
|
-
* @method collectors - Selector to get the collectors from state
|
|
86
|
-
* @returns {Collector[]} - The collectors from the current node in state
|
|
87
|
-
*/
|
|
88
|
-
getCollectors: () => {
|
|
89
|
-
const e = t.getState(), r = n.selectors.selectClient(e);
|
|
90
|
-
return r && "collectors" in r ? n.selectors.selectCollectors(e) || [] : [];
|
|
91
|
-
},
|
|
92
|
-
getError: () => {
|
|
93
|
-
const e = t.getState();
|
|
94
|
-
return n.selectors.selectError(e);
|
|
95
|
-
},
|
|
96
|
-
/**
|
|
97
|
-
* @method node - Selector to get the node from state
|
|
98
|
-
* @returns {Node} - the current node from state
|
|
99
|
-
*/
|
|
100
|
-
getNode: () => n.selectSlice(t.getState()),
|
|
101
|
-
/**
|
|
102
|
-
* @method server - Selector to get the node.server from state
|
|
103
|
-
* @returns {Node.server} - the server property from the current node
|
|
104
|
-
*/
|
|
105
|
-
getServer: () => {
|
|
106
|
-
const e = t.getState();
|
|
107
|
-
return n.selectors.selectServer(e);
|
|
108
|
-
},
|
|
109
|
-
/**
|
|
110
|
-
* Utilities to help query cached responses from server
|
|
111
|
-
*/
|
|
112
|
-
cache: {
|
|
113
|
-
getLatestResponse: () => {
|
|
114
|
-
const e = n.selectSlice(t.getState());
|
|
115
|
-
if (!e.cache?.key)
|
|
116
|
-
return console.error("Cannot find current node's cache key or no current node"), { error: { message: "Cannot find current node", type: "state_error" } };
|
|
117
|
-
const r = o.endpoints.flow.select(e.cache.key), s = o.endpoints.next.select(e.cache.key), c = o.endpoints.start.select(e.cache.key);
|
|
118
|
-
return r || s || c;
|
|
119
|
-
},
|
|
120
|
-
getResponseWithId: (e) => {
|
|
121
|
-
if (!e)
|
|
122
|
-
return console.error("Please provide the cache key"), { error: { message: "Please provide the cache key", type: "argument_error" } };
|
|
123
|
-
const r = o.endpoints.flow.select(e), s = o.endpoints.next.select(e), c = o.endpoints.start.select(e);
|
|
124
|
-
return r || s || c;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
export {
|
|
130
|
-
C as davinci
|
|
131
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ErrorNode, ContinueNode, StartNode, SuccessNode } from '../types.js';
|
|
2
|
-
export declare function createClientStore(): import('@reduxjs/toolkit').EnhancedStore<{
|
|
3
|
-
config: {
|
|
4
|
-
endpoints: import('./wellknown.types.js').Endpoints;
|
|
5
|
-
clientId: string;
|
|
6
|
-
redirectUri: string;
|
|
7
|
-
responseType: string;
|
|
8
|
-
scope: string;
|
|
9
|
-
};
|
|
10
|
-
node: import('./node.types.js').ContinueNode | import('./node.types.js').ErrorNode | import('./node.types.js').FailureNode | import('./node.types.js').StartNode | import('./node.types.js').SuccessNode;
|
|
11
|
-
davinci: import('@reduxjs/toolkit/query').CombinedState<{
|
|
12
|
-
flow: import('@reduxjs/toolkit/query').MutationDefinition<any, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, never, unknown, "davinci">;
|
|
13
|
-
next: import('@reduxjs/toolkit/query').MutationDefinition<any, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, never, unknown, "davinci">;
|
|
14
|
-
start: import('@reduxjs/toolkit/query').MutationDefinition<void, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, never, unknown, "davinci">;
|
|
15
|
-
}, never, "davinci">;
|
|
16
|
-
wellknown: import('@reduxjs/toolkit/query').CombinedState<{
|
|
17
|
-
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, import('./wellknown.types.js').WellknownResponse, "wellknown">;
|
|
18
|
-
}, never, "wellknown">;
|
|
19
|
-
}, import('@reduxjs/toolkit').UnknownAction, import('@reduxjs/toolkit').Tuple<[import('@reduxjs/toolkit').StoreEnhancer<{
|
|
20
|
-
dispatch: import('@reduxjs/toolkit').ThunkDispatch<{
|
|
21
|
-
config: {
|
|
22
|
-
endpoints: import('./wellknown.types.js').Endpoints;
|
|
23
|
-
clientId: string;
|
|
24
|
-
redirectUri: string;
|
|
25
|
-
responseType: string;
|
|
26
|
-
scope: string;
|
|
27
|
-
};
|
|
28
|
-
node: import('./node.types.js').ContinueNode | import('./node.types.js').ErrorNode | import('./node.types.js').FailureNode | import('./node.types.js').StartNode | import('./node.types.js').SuccessNode;
|
|
29
|
-
davinci: import('@reduxjs/toolkit/query').CombinedState<{
|
|
30
|
-
flow: import('@reduxjs/toolkit/query').MutationDefinition<any, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, never, unknown, "davinci">;
|
|
31
|
-
next: import('@reduxjs/toolkit/query').MutationDefinition<any, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, never, unknown, "davinci">;
|
|
32
|
-
start: import('@reduxjs/toolkit/query').MutationDefinition<void, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, never, unknown, "davinci">;
|
|
33
|
-
}, never, "davinci">;
|
|
34
|
-
wellknown: import('@reduxjs/toolkit/query').CombinedState<{
|
|
35
|
-
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, import('./wellknown.types.js').WellknownResponse, "wellknown">;
|
|
36
|
-
}, never, "wellknown">;
|
|
37
|
-
}, undefined, import('@reduxjs/toolkit').UnknownAction>;
|
|
38
|
-
}>, import('@reduxjs/toolkit').StoreEnhancer]>>;
|
|
39
|
-
type ClientStore = typeof createClientStore;
|
|
40
|
-
export type RootState = ReturnType<ReturnType<ClientStore>['getState']>;
|
|
41
|
-
export interface RootStateWithNode<T extends ErrorNode | ContinueNode | StartNode | SuccessNode> extends RootState {
|
|
42
|
-
node: T;
|
|
43
|
-
}
|
|
44
|
-
export type AppDispatch = ReturnType<ReturnType<ClientStore>['dispatch']>;
|
|
45
|
-
export {};
|
|
46
|
-
//# sourceMappingURL=client.store.utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.store.utils.d.ts","sourceRoot":"","sources":["../../src/lib/client.store.utils.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG9E,wBAAgB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gDAWhC;AAED,KAAK,WAAW,GAAG,OAAO,iBAAiB,CAAC;AAE5C,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;AAExE,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,SAAS,GAAG,YAAY,GAAG,SAAS,GAAG,WAAW,CAC7F,SAAQ,SAAS;IACjB,IAAI,EAAE,CAAC,CAAC;CACT;AAED,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { configureStore as c } from "@reduxjs/toolkit";
|
|
2
|
-
import { configSlice as i } from "./config.slice.js";
|
|
3
|
-
import { nodeSlice as d } from "./node.slice.js";
|
|
4
|
-
import { davinciApi as r } from "./davinci.api.js";
|
|
5
|
-
import { wellknownApi as e } from "./wellknown.api.js";
|
|
6
|
-
function f() {
|
|
7
|
-
return c({
|
|
8
|
-
reducer: {
|
|
9
|
-
config: i.reducer,
|
|
10
|
-
node: d.reducer,
|
|
11
|
-
[r.reducerPath]: r.reducer,
|
|
12
|
-
[e.reducerPath]: e.reducer
|
|
13
|
-
},
|
|
14
|
-
middleware: (o) => o().concat(r.middleware).concat(e.middleware)
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
export {
|
|
18
|
-
f as createClientStore
|
|
19
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { GenericError } from './error.types';
|
|
2
|
-
import { ErrorNode, FailureNode, ContinueNode, StartNode, SuccessNode } from './node.types';
|
|
3
|
-
export type InitFlow = (() => Promise<{
|
|
4
|
-
error: GenericError;
|
|
5
|
-
}>) | (() => Promise<ContinueNode | ErrorNode | StartNode | SuccessNode | FailureNode>);
|
|
6
|
-
export type Updater = (value: string, index?: number) => {
|
|
7
|
-
error: GenericError;
|
|
8
|
-
} | null;
|
|
9
|
-
//# sourceMappingURL=client.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.types.d.ts","sourceRoot":"","sources":["../../src/lib/client.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE5F,MAAM,MAAM,QAAQ,GAChB,CAAC,MAAM,OAAO,CAAC;IAAE,KAAK,EAAE,YAAY,CAAA;CAAE,CAAC,CAAC,GACxC,CAAC,MAAM,OAAO,CAAC,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC;AAEtF,MAAM,MAAM,OAAO,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK;IAAE,KAAK,EAAE,YAAY,CAAA;CAAE,GAAG,IAAI,CAAC"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @interface SingleValueCollector - Represents a request to collect a single value from the user, like email or password.
|
|
3
|
-
*/
|
|
4
|
-
export type SingleValueCollectorTypes = 'TextCollector' | 'PasswordCollector' | 'SingleValueCollector';
|
|
5
|
-
export interface SingleValueCollectorWithValue<T extends SingleValueCollectorTypes> {
|
|
6
|
-
category: 'SingleValueCollector';
|
|
7
|
-
error: string | null;
|
|
8
|
-
type: T;
|
|
9
|
-
id: string;
|
|
10
|
-
name: string;
|
|
11
|
-
input: {
|
|
12
|
-
key: string;
|
|
13
|
-
value: string | number | boolean;
|
|
14
|
-
type: string;
|
|
15
|
-
};
|
|
16
|
-
output: {
|
|
17
|
-
key: string;
|
|
18
|
-
label: string;
|
|
19
|
-
type: string;
|
|
20
|
-
value: string;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export interface SingleValueCollectorNoValue<T extends SingleValueCollectorTypes> {
|
|
24
|
-
category: 'SingleValueCollector';
|
|
25
|
-
error: string | null;
|
|
26
|
-
type: T;
|
|
27
|
-
id: string;
|
|
28
|
-
name: string;
|
|
29
|
-
input: {
|
|
30
|
-
key: string;
|
|
31
|
-
value: string | number | boolean;
|
|
32
|
-
type: string;
|
|
33
|
-
};
|
|
34
|
-
output: {
|
|
35
|
-
key: string;
|
|
36
|
-
label: string;
|
|
37
|
-
type: string;
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
export type SingleValueCollectors = SingleValueCollectorWithValue<'SingleValueCollector'> | SingleValueCollectorWithValue<'TextCollector'> | SingleValueCollectorNoValue<'PasswordCollector'>;
|
|
41
|
-
export type SingleValueCollector<T extends SingleValueCollectorTypes> = SingleValueCollectorWithValue<T> | SingleValueCollectorNoValue<T>;
|
|
42
|
-
/**
|
|
43
|
-
* @interface ActionCollector - Represents a user option to perform an action, like submitting a form or choosing another flow.
|
|
44
|
-
*/
|
|
45
|
-
export type ActionCollectorTypes = 'FlowCollector' | 'SubmitCollector' | 'SocialLoginCollector' | 'ActionCollector';
|
|
46
|
-
export interface ActionCollectorNoUrl<T extends ActionCollectorTypes> {
|
|
47
|
-
category: 'ActionCollector';
|
|
48
|
-
error: string | null;
|
|
49
|
-
type: T;
|
|
50
|
-
id: string;
|
|
51
|
-
name: string;
|
|
52
|
-
output: {
|
|
53
|
-
key: string;
|
|
54
|
-
label: string;
|
|
55
|
-
type: string;
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
export interface ActionCollectorWithUrl<T extends ActionCollectorTypes> {
|
|
59
|
-
category: 'ActionCollector';
|
|
60
|
-
error: string | null;
|
|
61
|
-
type: T;
|
|
62
|
-
id: string;
|
|
63
|
-
name: string;
|
|
64
|
-
output: {
|
|
65
|
-
key: string;
|
|
66
|
-
label: string;
|
|
67
|
-
type: string;
|
|
68
|
-
url?: string | null;
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
export type ActionCollector<T extends ActionCollectorTypes> = ActionCollectorNoUrl<T> | ActionCollectorWithUrl<T>;
|
|
72
|
-
export type ActionCollectors = ActionCollectorWithUrl<'SocialLoginCollector'> | ActionCollectorNoUrl<'ActionCollector'> | ActionCollectorNoUrl<'FlowCollector'> | ActionCollectorNoUrl<'SubmitCollector'>;
|
|
73
|
-
export type FlowCollector = ActionCollectorNoUrl<'FlowCollector'>;
|
|
74
|
-
export type PasswordCollector = SingleValueCollectorNoValue<'PasswordCollector'>;
|
|
75
|
-
export type TextCollector = SingleValueCollectorWithValue<'TextCollector'>;
|
|
76
|
-
export type SocialLoginCollector = ActionCollectorWithUrl<'SocialLoginCollector'>;
|
|
77
|
-
export type SubmitCollector = ActionCollectorNoUrl<'SubmitCollector'>;
|
|
78
|
-
//# sourceMappingURL=collector.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"collector.types.d.ts","sourceRoot":"","sources":["../../src/lib/collector.types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { ActionCollectors, ActionCollectorTypes, SingleValueCollectors, SingleValueCollectorTypes } from './collector.types';
|
|
2
|
-
import { DaVinciField } from './davinci.types';
|
|
3
|
-
/**
|
|
4
|
-
* @function returnActionCollector - Creates an ActionCollector object based on the provided field and index.
|
|
5
|
-
* @param {DaVinciField} field - The field object containing key, label, type, and links.
|
|
6
|
-
* @param {number} idx - The index to be used in the id of the ActionCollector.
|
|
7
|
-
* @param {ActionCollectorTypes} [collectorType] - Optional type of the ActionCollector.
|
|
8
|
-
* @returns {ActionCollector} The constructed ActionCollector object.
|
|
9
|
-
*/
|
|
10
|
-
export declare function returnActionCollector<CollectorType extends ActionCollectorTypes>(field: DaVinciField, idx: number, collectorType: CollectorType): ActionCollectors;
|
|
11
|
-
/**
|
|
12
|
-
* @function returnFlowCollector - Returns a flow collector object
|
|
13
|
-
* @param {DaVinciField} field - The field representing the flow button
|
|
14
|
-
* @param {number} idx - The index of the field in the form
|
|
15
|
-
* @returns {FlowCollector} - The flow collector object
|
|
16
|
-
*/
|
|
17
|
-
export declare function returnFlowCollector(field: DaVinciField, idx: number): ActionCollectors;
|
|
18
|
-
/**
|
|
19
|
-
* @function returnSocialLoginCollector - Returns a social login collector object
|
|
20
|
-
* @param {DaVinciField} field - The field representing the social login button
|
|
21
|
-
* @param {number} idx - The index of the field in the form
|
|
22
|
-
* @returns {SocialLoginCollector} - The social login collector object
|
|
23
|
-
*/
|
|
24
|
-
export declare function returnSocialLoginCollector(field: DaVinciField, idx: number): ActionCollectors;
|
|
25
|
-
/**
|
|
26
|
-
* @function returnSubmitCollector - Returns a submit collector object
|
|
27
|
-
* @param {DaVinciField} field - The field representing the submit button
|
|
28
|
-
* @param {number} idx - The index of the field in the form
|
|
29
|
-
* @returns {ActionCollector} - The submit collector object
|
|
30
|
-
*/
|
|
31
|
-
export declare function returnSubmitCollector(field: DaVinciField, idx: number): ActionCollectors;
|
|
32
|
-
/**
|
|
33
|
-
* @function returnSingleValueCollector - Creates a SingleValueCollector object based on the provided field, index, and optional collector type.
|
|
34
|
-
* @param {DaVinciField} field - The field object containing key, label, type, and links.
|
|
35
|
-
* @param {number} idx - The index to be used in the id of the SingleValueCollector.
|
|
36
|
-
* @param {SingleValueCollectorTypes} [collectorType] - Optional type of the SingleValueCollector.
|
|
37
|
-
* @returns {SingleValueCollector} The constructed SingleValueCollector object.
|
|
38
|
-
*/
|
|
39
|
-
export declare function returnSingleValueCollector<CollectorType extends SingleValueCollectorTypes = 'SingleValueCollector'>(field: DaVinciField, idx: number, collectorType: CollectorType): SingleValueCollectors;
|
|
40
|
-
/**
|
|
41
|
-
* @function returnPasswordCollector - Creates a PasswordCollector object based on the provided field and index.
|
|
42
|
-
* @param {DaVinciField} field - The field object containing key, label, type, and links.
|
|
43
|
-
* @param {number} idx - The index to be used in the id of the PasswordCollector.
|
|
44
|
-
* @returns {PasswordCollector} The constructed PasswordCollector object.
|
|
45
|
-
*/
|
|
46
|
-
export declare function returnPasswordCollector(field: DaVinciField, idx: number): SingleValueCollectors;
|
|
47
|
-
/**
|
|
48
|
-
* @function returnTextCollector - Creates a TextCollector object based on the provided field and index.
|
|
49
|
-
* @param {DaVinciField} field - The field object containing key, label, type, and links.
|
|
50
|
-
* @param {number} idx - The index to be used in the id of the TextCollector.
|
|
51
|
-
* @returns {TextCollector} The constructed TextCollector object.
|
|
52
|
-
*/
|
|
53
|
-
export declare function returnTextCollector(field: DaVinciField, idx: number): SingleValueCollectors;
|
|
54
|
-
//# sourceMappingURL=collector.utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"collector.utils.d.ts","sourceRoot":"","sources":["../../src/lib/collector.utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,EAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,SAAS,oBAAoB,EAC9E,KAAK,EAAE,YAAY,EACnB,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,aAAa,GAC3B,gBAAgB,CAwClB;AAED;;;;;GAKG;AAEH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,oBAEnE;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,oBAE1E;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,oBAErE;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,aAAa,SAAS,yBAAyB,GAAG,sBAAsB,EACxE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,GAAG,qBAAqB,CAkDvF;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,yBAEvE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,yBAEnE"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
function r(e, o, n) {
|
|
2
|
-
let t = "";
|
|
3
|
-
return "key" in e || (t = `${t}Key is not found in the field object. `), "label" in e || (t = `${t}Label is not found in the field object. `), "type" in e || (t = `${t}Type is not found in the field object. `), n === "SocialLoginCollector" ? {
|
|
4
|
-
category: "ActionCollector",
|
|
5
|
-
error: t || null,
|
|
6
|
-
type: n,
|
|
7
|
-
id: `${e.key}-${o}`,
|
|
8
|
-
name: e.key,
|
|
9
|
-
output: {
|
|
10
|
-
key: e.key,
|
|
11
|
-
label: e.label,
|
|
12
|
-
type: e.type,
|
|
13
|
-
url: e.links?.authenticate?.href || null
|
|
14
|
-
}
|
|
15
|
-
} : {
|
|
16
|
-
category: "ActionCollector",
|
|
17
|
-
error: t || null,
|
|
18
|
-
type: n || "ActionCollector",
|
|
19
|
-
id: `${e.key}-${o}`,
|
|
20
|
-
name: e.key,
|
|
21
|
-
output: {
|
|
22
|
-
key: e.key,
|
|
23
|
-
label: e.label,
|
|
24
|
-
type: e.type
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
function u(e, o) {
|
|
29
|
-
return r(e, o, "FlowCollector");
|
|
30
|
-
}
|
|
31
|
-
function y(e, o) {
|
|
32
|
-
return r(e, o, "SocialLoginCollector");
|
|
33
|
-
}
|
|
34
|
-
function c(e, o) {
|
|
35
|
-
return r(e, o, "SubmitCollector");
|
|
36
|
-
}
|
|
37
|
-
function l(e, o, n) {
|
|
38
|
-
let t = "";
|
|
39
|
-
return "key" in e || (t = `${t}Key is not found in the field object. `), "label" in e || (t = `${t}Label is not found in the field object. `), "type" in e || (t = `${t}Type is not found in the field object. `), n === "PasswordCollector" ? {
|
|
40
|
-
category: "SingleValueCollector",
|
|
41
|
-
error: t || null,
|
|
42
|
-
type: n,
|
|
43
|
-
id: `${e.key}-${o}`,
|
|
44
|
-
name: e.key,
|
|
45
|
-
input: {
|
|
46
|
-
key: e.key,
|
|
47
|
-
value: "",
|
|
48
|
-
type: e.type
|
|
49
|
-
},
|
|
50
|
-
output: {
|
|
51
|
-
key: e.key,
|
|
52
|
-
label: e.label,
|
|
53
|
-
type: e.type
|
|
54
|
-
}
|
|
55
|
-
} : {
|
|
56
|
-
category: "SingleValueCollector",
|
|
57
|
-
error: t || null,
|
|
58
|
-
type: n || "SingleValueCollector",
|
|
59
|
-
id: `${e.key}-${o}`,
|
|
60
|
-
name: e.key,
|
|
61
|
-
input: {
|
|
62
|
-
key: e.key,
|
|
63
|
-
value: "",
|
|
64
|
-
type: e.type
|
|
65
|
-
},
|
|
66
|
-
output: {
|
|
67
|
-
key: e.key,
|
|
68
|
-
label: e.label,
|
|
69
|
-
type: e.type,
|
|
70
|
-
value: ""
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
function a(e, o) {
|
|
75
|
-
return l(e, o, "PasswordCollector");
|
|
76
|
-
}
|
|
77
|
-
function i(e, o) {
|
|
78
|
-
return l(e, o, "TextCollector");
|
|
79
|
-
}
|
|
80
|
-
export {
|
|
81
|
-
r as returnActionCollector,
|
|
82
|
-
u as returnFlowCollector,
|
|
83
|
-
a as returnPasswordCollector,
|
|
84
|
-
l as returnSingleValueCollector,
|
|
85
|
-
y as returnSocialLoginCollector,
|
|
86
|
-
c as returnSubmitCollector,
|
|
87
|
-
i as returnTextCollector
|
|
88
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.slice.d.ts","sourceRoot":"","sources":["../../src/lib/config.slice.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAe,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEnE;;GAEG;AACH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAcjD;;;GAGG;AACH,eAAO,MAAM,WAAW;eAXL,SAAS;;;;;;IAgBxB;;;;;OAKG;;mBArBY,SAAS;;;;;gBAsBL,aAAa,CAAC,qBAAqB,CAAC;;eAtBxC,SAAS;;;;;GAkD1B,CAAC"}
|
package/dist/lib/config.slice.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { createSlice as d } from "@reduxjs/toolkit";
|
|
2
|
-
const c = {
|
|
3
|
-
endpoints: {},
|
|
4
|
-
clientId: "",
|
|
5
|
-
redirectUri: "",
|
|
6
|
-
responseType: "",
|
|
7
|
-
scope: ""
|
|
8
|
-
}, t = d({
|
|
9
|
-
name: "config",
|
|
10
|
-
initialState: c,
|
|
11
|
-
reducerPath: "config",
|
|
12
|
-
reducers: {
|
|
13
|
-
/**
|
|
14
|
-
* @method set - Set the configuration for the DaVinci client
|
|
15
|
-
* @param {Object} state - The current state of the slice
|
|
16
|
-
* @param {PayloadAction<InternalDaVinciConfig>} action - The action to be dispatched
|
|
17
|
-
* @returns {void}
|
|
18
|
-
*/
|
|
19
|
-
set(o, e) {
|
|
20
|
-
o.clientId = e.payload.clientId || "", o.redirectUri = e.payload.redirectUri || `${location.origin}/handle-redirect`, "responseType" in e.payload && e.payload.responseType ? o.responseType = e.payload.responseType : o.responseType = "code", o.scope = e.payload.scope || "openid";
|
|
21
|
-
const {
|
|
22
|
-
authorization_endpoint: n,
|
|
23
|
-
issuer: i,
|
|
24
|
-
introspection_endpoint: p,
|
|
25
|
-
token_endpoint: r,
|
|
26
|
-
userinfo_endpoint: s
|
|
27
|
-
} = e.payload.wellknownResponse;
|
|
28
|
-
o.endpoints = {
|
|
29
|
-
authorize: n,
|
|
30
|
-
issuer: i,
|
|
31
|
-
introspection: p,
|
|
32
|
-
tokens: r,
|
|
33
|
-
userinfo: s
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
export {
|
|
39
|
-
t as configSlice
|
|
40
|
-
};
|