@forgerock/davinci-client 1.0.0 → 1.1.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/authorize.utils.d.ts.map +1 -0
- package/dist/src/lib/authorize.utils.js +47 -0
- package/dist/src/lib/authorize.utils.js.map +1 -0
- package/dist/src/lib/client.store.d.ts +351 -0
- package/dist/src/lib/client.store.d.ts.map +1 -0
- package/dist/src/lib/client.store.js +295 -0
- package/dist/src/lib/client.store.js.map +1 -0
- package/dist/src/lib/client.store.utils.d.ts +61 -0
- package/dist/src/lib/client.store.utils.d.ts.map +1 -0
- package/dist/src/lib/client.store.utils.js +35 -0
- package/dist/src/lib/client.store.utils.js.map +1 -0
- package/dist/src/lib/client.types.d.ts +17 -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 +255 -0
- package/dist/src/lib/collector.types.d.ts.map +1 -0
- package/dist/src/lib/collector.types.js +11 -0
- package/dist/src/lib/collector.types.js.map +1 -0
- package/dist/src/lib/collector.utils.d.ts +100 -0
- package/dist/src/lib/collector.utils.d.ts.map +1 -0
- package/dist/src/lib/collector.utils.js +349 -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 +29 -0
- package/dist/src/lib/davinci.api.d.ts.map +1 -0
- package/dist/src/lib/davinci.api.js +333 -0
- package/dist/src/lib/davinci.api.js.map +1 -0
- package/dist/{lib → src/lib}/davinci.types.d.ts +62 -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 -3
- package/dist/src/lib/davinci.utils.d.ts.map +1 -0
- package/dist/src/lib/davinci.utils.js +185 -0
- package/dist/src/lib/davinci.utils.js.map +1 -0
- package/dist/src/lib/effects/request.effect.mock.d.ts +4 -0
- package/dist/src/lib/effects/request.effect.mock.d.ts.map +1 -0
- package/dist/src/lib/effects/request.effect.mock.js +106 -0
- package/dist/src/lib/effects/request.effect.mock.js.map +1 -0
- package/dist/src/lib/effects/request.effect.types.d.ts +20 -0
- package/dist/src/lib/effects/request.effect.types.d.ts.map +1 -0
- package/dist/src/lib/effects/request.effect.types.js +2 -0
- package/dist/src/lib/effects/request.effect.types.js.map +1 -0
- package/dist/src/lib/effects/request.effect.unions.d.ts +12 -0
- package/dist/src/lib/effects/request.effect.unions.d.ts.map +1 -0
- package/dist/src/lib/effects/request.effect.unions.js +16 -0
- package/dist/src/lib/effects/request.effect.unions.js.map +1 -0
- package/dist/src/lib/effects/request.effect.utils.d.ts +27 -0
- package/dist/src/lib/effects/request.effect.utils.d.ts.map +1 -0
- package/dist/src/lib/effects/request.effect.utils.js +57 -0
- package/dist/src/lib/effects/request.effect.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 +143 -0
- package/dist/src/lib/node.reducer.js.map +1 -0
- package/dist/{lib → src/lib}/node.slice.d.ts +34 -23
- package/dist/src/lib/node.slice.d.ts.map +1 -0
- package/dist/src/lib/node.slice.js +231 -0
- package/dist/src/lib/node.slice.js.map +1 -0
- package/dist/{lib → src/lib}/node.types.d.ts +16 -7
- 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/{types.d.ts → src/types.d.ts} +9 -1
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +8 -0
- package/dist/src/types.js.map +1 -0
- package/package.json +49 -20
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -4
- 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.map +0 -1
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{lib → src/lib}/authorize.utils.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,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":"AAAA;;GAEG;AACH,MAAM,MAAM,yBAAyB,GACjC,eAAe,GACf,mBAAmB,GACnB,sBAAsB,CAAC;AAE3B,MAAM,WAAW,6BAA6B,CAAC,CAAC,SAAS,yBAAyB;IAChF,QAAQ,EAAE,sBAAsB,CAAC;IACjC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,CAAC,CAAC;IACR,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;QACjC,IAAI,E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
|
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
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { AsyncConfigOptions } from '@forgerock/javascript-sdk/src/config/interfaces';
|
|
2
|
-
import { WellknownResponse } from './wellknown.types';
|
|
3
|
-
export interface DaVinciConfig extends AsyncConfigOptions {
|
|
4
|
-
responseType?: string;
|
|
5
|
-
}
|
|
6
|
-
export interface InternalDaVinciConfig extends DaVinciConfig {
|
|
7
|
-
wellknownResponse: WellknownResponse;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=config.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.types.d.ts","sourceRoot":"","sources":["../../src/lib/config.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,WAAW,aAAc,SAAQ,kBAAkB;IACvD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,qBAAsB,SAAQ,aAAa;IAC1D,iBAAiB,EAAE,iBAAiB,CAAC;CACtC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @const davinciApi - Define the DaVinci API for Redux state management
|
|
3
|
-
* @see https://redux-toolkit.js.org/rtk-query/overview
|
|
4
|
-
*/
|
|
5
|
-
export declare const davinciApi: 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>, {
|
|
6
|
-
/**
|
|
7
|
-
* @method flow - method for initiating a new flow with the DaVinci API
|
|
8
|
-
*/
|
|
9
|
-
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">;
|
|
10
|
-
/**
|
|
11
|
-
* @method next - method for initiating the next node in the current flow
|
|
12
|
-
*/
|
|
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
|
-
/**
|
|
15
|
-
* @method start - method for initiating a DaVinci flow
|
|
16
|
-
* @param - needs no arguments, but need to declare types to make it explicit
|
|
17
|
-
*/
|
|
18
|
-
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">;
|
|
19
|
-
}, "davinci", never, typeof import('@reduxjs/toolkit/query').coreModuleName>;
|
|
20
|
-
//# sourceMappingURL=davinci.api.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"davinci.api.d.ts","sourceRoot":"","sources":["../../src/lib/davinci.api.ts"],"names":[],"mappings":"AAoBA;;;GAGG;AACH,eAAO,MAAM,UAAU;IAWnB;;OAEG;;IAsEH;;OAEG;;IA2EH;;;OAGG;;4EAwFL,CAAC"}
|
package/dist/lib/davinci.api.js
DELETED
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import { createApi as p, fetchBaseQuery as y } from "@reduxjs/toolkit/query";
|
|
2
|
-
import { createAuthorizeUrl as l } from "./authorize.utils.js";
|
|
3
|
-
import { transformActionRequest as f, handleResponse as u, transformSubmitRequest as h } from "./davinci.utils.js";
|
|
4
|
-
const w = p({
|
|
5
|
-
reducerPath: "davinci",
|
|
6
|
-
baseQuery: y({
|
|
7
|
-
prepareHeaders: (a) => (a.set("Accept", "application/json"), a.set("x-requested-with", "ping-sdk"), a.set("x-requested-platform", "javascript"), a)
|
|
8
|
-
}),
|
|
9
|
-
endpoints: (a) => ({
|
|
10
|
-
/**
|
|
11
|
-
* @method flow - method for initiating a new flow with the DaVinci API
|
|
12
|
-
*/
|
|
13
|
-
flow: a.mutation({
|
|
14
|
-
/**
|
|
15
|
-
* @method queryFn - This is just a wrapper around the fetch call
|
|
16
|
-
*/
|
|
17
|
-
async queryFn(i, t, r, o) {
|
|
18
|
-
const e = t.getState(), n = e.node.server._links, s = f(e.node, i.action);
|
|
19
|
-
let c = "";
|
|
20
|
-
return n && "next" in n && (c = n.next.href || ""), await o({
|
|
21
|
-
// TODO: If we don't have a `next.href`, we should handle this better
|
|
22
|
-
url: c,
|
|
23
|
-
credentials: "include",
|
|
24
|
-
method: "POST",
|
|
25
|
-
headers: {
|
|
26
|
-
"Content-Type": "application/json",
|
|
27
|
-
interactionId: e.node.server.interactionId,
|
|
28
|
-
interactionToken: e.node.server.interactionToken
|
|
29
|
-
},
|
|
30
|
-
body: JSON.stringify(s)
|
|
31
|
-
});
|
|
32
|
-
},
|
|
33
|
-
/**
|
|
34
|
-
* @method onQueryStarted - method for handling the response from the DaVinci API
|
|
35
|
-
*
|
|
36
|
-
* The method name below is a bit misleading. It is not just
|
|
37
|
-
* called when the query is started, but throughout the lifecycle of
|
|
38
|
-
* the API, including when the query is fulfilled. This is because
|
|
39
|
-
* the query is started, and then the response is awaited, and then
|
|
40
|
-
* the response is processed.
|
|
41
|
-
*
|
|
42
|
-
* NOTE: The below is repeated for each endpoint, which is not "DRY",
|
|
43
|
-
* but doing it inline reduces the typing complexity as all the
|
|
44
|
-
* parameters are pre-typed from the library.
|
|
45
|
-
*/
|
|
46
|
-
async onQueryStarted(i, t) {
|
|
47
|
-
let r;
|
|
48
|
-
try {
|
|
49
|
-
r = (await t.queryFulfilled).meta?.response;
|
|
50
|
-
} catch (e) {
|
|
51
|
-
r = e.meta?.response;
|
|
52
|
-
}
|
|
53
|
-
const o = t.getCacheEntry();
|
|
54
|
-
u(o, t.dispatch, r?.status || 0);
|
|
55
|
-
}
|
|
56
|
-
}),
|
|
57
|
-
/**
|
|
58
|
-
* @method next - method for initiating the next node in the current flow
|
|
59
|
-
*/
|
|
60
|
-
next: a.mutation({
|
|
61
|
-
/**
|
|
62
|
-
* @method queryFn - This is just a wrapper around the fetch call
|
|
63
|
-
*/
|
|
64
|
-
async queryFn(i, t, r, o) {
|
|
65
|
-
const e = t.getState(), n = e.node.server._links;
|
|
66
|
-
let s, c = "";
|
|
67
|
-
return n && "next" in n && (c = n.next.href || ""), i ? s = i : s = h(e.node), await o({
|
|
68
|
-
url: c,
|
|
69
|
-
credentials: "include",
|
|
70
|
-
method: "POST",
|
|
71
|
-
headers: {
|
|
72
|
-
"Content-Type": "application/json",
|
|
73
|
-
interactionId: e.node.server.interactionId,
|
|
74
|
-
interactionToken: e.node.server.interactionToken
|
|
75
|
-
},
|
|
76
|
-
body: JSON.stringify(s)
|
|
77
|
-
});
|
|
78
|
-
},
|
|
79
|
-
/**
|
|
80
|
-
* @method onQueryStarted - method for handling the response from the DaVinci API
|
|
81
|
-
*
|
|
82
|
-
* The method name below is a bit misleading. It is not just
|
|
83
|
-
* called when the query is started, but throughout the lifecycle of
|
|
84
|
-
* the API, including when the query is fulfilled. This is because
|
|
85
|
-
* the query is started, and then the response is awaited, and then
|
|
86
|
-
* the response is processed.
|
|
87
|
-
*
|
|
88
|
-
* NOTE: The below is repeated for each endpoint, which is not "DRY",
|
|
89
|
-
* but doing it inline reduces the typing complexity as all the
|
|
90
|
-
* parameters are pre-typed from the library.
|
|
91
|
-
*/
|
|
92
|
-
async onQueryStarted(i, t) {
|
|
93
|
-
let r;
|
|
94
|
-
try {
|
|
95
|
-
r = (await t.queryFulfilled).meta?.response;
|
|
96
|
-
} catch (e) {
|
|
97
|
-
r = e.meta?.response;
|
|
98
|
-
}
|
|
99
|
-
const o = t.getCacheEntry();
|
|
100
|
-
u(o, t.dispatch, r?.status || 0);
|
|
101
|
-
}
|
|
102
|
-
}),
|
|
103
|
-
/**
|
|
104
|
-
* @method start - method for initiating a DaVinci flow
|
|
105
|
-
* @param - needs no arguments, but need to declare types to make it explicit
|
|
106
|
-
*/
|
|
107
|
-
start: a.mutation({
|
|
108
|
-
/**
|
|
109
|
-
* @method queryFn - This is just a wrapper around the fetch call
|
|
110
|
-
*/
|
|
111
|
-
async queryFn(i, t, r, o) {
|
|
112
|
-
const e = t.getState();
|
|
113
|
-
if (!e)
|
|
114
|
-
return {
|
|
115
|
-
error: {
|
|
116
|
-
status: 400,
|
|
117
|
-
data: "Store must be initialized before use"
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
const n = e.config.endpoints.authorize;
|
|
121
|
-
if (!n)
|
|
122
|
-
return { error: { status: 400, data: "authorizeEndpoint URL must be set" } };
|
|
123
|
-
try {
|
|
124
|
-
const s = await l(n, {
|
|
125
|
-
clientId: e?.config?.clientId,
|
|
126
|
-
login: "redirect",
|
|
127
|
-
// TODO: improve this in SDK to be more semantic
|
|
128
|
-
redirectUri: e?.config?.redirectUri,
|
|
129
|
-
responseType: e?.config?.responseType,
|
|
130
|
-
scope: e?.config?.scope
|
|
131
|
-
});
|
|
132
|
-
return await o({
|
|
133
|
-
url: s,
|
|
134
|
-
credentials: "include",
|
|
135
|
-
method: "GET",
|
|
136
|
-
headers: {
|
|
137
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
} catch (s) {
|
|
141
|
-
return s instanceof Error ? { error: { status: 400, data: s.message } } : { error: { status: 400, data: "An unknown error occurred" } };
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
/**
|
|
145
|
-
* @method onQueryStarted - method for handling the response from the DaVinci API
|
|
146
|
-
*
|
|
147
|
-
* The method name below is a bit misleading. It is not just
|
|
148
|
-
* called when the query is started, but throughout the lifecycle of
|
|
149
|
-
* the API, including when the query is fulfilled. This is because
|
|
150
|
-
* the query is started, and then the response is awaited, and then
|
|
151
|
-
* the response is processed.
|
|
152
|
-
*
|
|
153
|
-
* NOTE: The below is repeated for each endpoint, which is not "DRY",
|
|
154
|
-
* but doing it inline reduces the typing complexity as all the
|
|
155
|
-
* parameters are pre-typed from the library.
|
|
156
|
-
*/
|
|
157
|
-
async onQueryStarted(i, t) {
|
|
158
|
-
let r;
|
|
159
|
-
try {
|
|
160
|
-
r = (await t.queryFulfilled).meta?.response;
|
|
161
|
-
} catch (e) {
|
|
162
|
-
r = e.meta?.response;
|
|
163
|
-
}
|
|
164
|
-
const o = t.getCacheEntry();
|
|
165
|
-
u(o, t.dispatch, r?.status || 0);
|
|
166
|
-
}
|
|
167
|
-
})
|
|
168
|
-
})
|
|
169
|
-
});
|
|
170
|
-
export {
|
|
171
|
-
w as davinciApi
|
|
172
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"davinci.types.d.ts","sourceRoot":"","sources":["../../src/lib/davinci.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,4BAA4B,EAC7B,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE;QACV,SAAS,EAAE,QAAQ,GAAG,QAAQ,CAAC;QAC/B,IAAI,EAAE;YACJ,SAAS,EAAE,MAAM,CAAC;YAClB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;SACpC,CAAC;KACH,CAAC;CACH;AAED;;GAEG;AAEH,MAAM,WAAW,mBAAmB;IAElC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,wCAAwC,CAAC,EAAE,OAAO,CAAC;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAGD,MAAM,WAAW,KAAK;IAEpB,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH;AAED;;GAEG;AAEH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IAGd,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AACD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,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,mBAAmB,CAAC;IAC3B,cAAc,EAAE,OAAO,CAAC;IACxB,IAAI,EAAE,kBAAkB,CAAC;CAC1B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"davinci.utils.d.ts","sourceRoot":"","sources":["../../src/lib/davinci.utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAIjD,OAAO,KAAK,EACV,iBAAiB,EAIjB,cAAc,EAEf,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,YAAY,GAAG,cAAc,CAyBzE;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,cAAc,CAYzF;AAED,wBAAgB,cAAc,CAAC,UAAU,EAAE,iBAAiB,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAsH/F"}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { nodeSlice as o } from "./node.slice.js";
|
|
2
|
-
function n(t) {
|
|
3
|
-
const a = t.client?.collectors?.filter(
|
|
4
|
-
(e) => e.category === "SingleValueCollector"
|
|
5
|
-
)?.reduce((e, r) => (e[r.input.key] = r.input.value, e), {});
|
|
6
|
-
return {
|
|
7
|
-
id: t.server.id || "",
|
|
8
|
-
eventName: t.server.eventName || "",
|
|
9
|
-
interactionId: t.server.interactionId || "",
|
|
10
|
-
parameters: {
|
|
11
|
-
eventType: "submit",
|
|
12
|
-
data: {
|
|
13
|
-
actionKey: t.client?.action || "",
|
|
14
|
-
formData: a || {}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
function d(t, s) {
|
|
20
|
-
return {
|
|
21
|
-
id: t.server.id || "",
|
|
22
|
-
eventName: t.server.eventName || "",
|
|
23
|
-
interactionId: t.server.interactionId || "",
|
|
24
|
-
parameters: {
|
|
25
|
-
eventType: "action",
|
|
26
|
-
data: {
|
|
27
|
-
actionKey: s
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
function f(t, s, a) {
|
|
33
|
-
if (t.isError && t.error.status >= 500) {
|
|
34
|
-
const e = t.error.data, r = t.requestId;
|
|
35
|
-
s(o.actions.failure({ data: e, requestId: r, httpStatus: t.error.status }));
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
if (t.isError && t.error.status >= 400 && t.error.status < 500) {
|
|
39
|
-
const e = t.error.data, r = t.requestId;
|
|
40
|
-
if (e.code === 1999 || e.code === "requestTimedOut") {
|
|
41
|
-
s(o.actions.failure({ data: e, requestId: r, httpStatus: t.error.status }));
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
if (e.connectorId === "pingOneAuthenticationConnector" && (e.capabilityName === "returnSuccessResponseRedirect" || e.capabilityName === "setSession")) {
|
|
45
|
-
s(o.actions.failure({ data: e, requestId: r, httpStatus: t.error.status }));
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
s(o.actions.error({ data: e, requestId: r, httpStatus: t.error.status }));
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
if (t.isError && t.error.status === "FETCH_ERROR") {
|
|
52
|
-
const e = {
|
|
53
|
-
code: t.error.status,
|
|
54
|
-
message: "Fetch Error: Please ensure a correct Client ID for your OAuth application."
|
|
55
|
-
}, r = t.requestId;
|
|
56
|
-
s(o.actions.failure({ data: e, requestId: r, httpStatus: t.error.status }));
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
if (t.isSuccess && "error" in t.data) {
|
|
60
|
-
const e = t.data, r = t.requestId;
|
|
61
|
-
s(
|
|
62
|
-
o.actions.failure({
|
|
63
|
-
data: e.error,
|
|
64
|
-
requestId: r,
|
|
65
|
-
httpStatus: a
|
|
66
|
-
})
|
|
67
|
-
);
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
if (t.isSuccess && "status" in t.data) {
|
|
71
|
-
const e = t.data.status.toLowerCase();
|
|
72
|
-
if (e === "failure") {
|
|
73
|
-
const r = t.data, i = t.requestId;
|
|
74
|
-
s(
|
|
75
|
-
o.actions.failure({
|
|
76
|
-
data: r.error,
|
|
77
|
-
requestId: i,
|
|
78
|
-
httpStatus: e
|
|
79
|
-
})
|
|
80
|
-
);
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
if (t.isSuccess) {
|
|
85
|
-
const e = t.requestId;
|
|
86
|
-
if ("eventName" in t.data && t.data.eventName === "continue") {
|
|
87
|
-
const r = t.data;
|
|
88
|
-
s(o.actions.next({ data: r, requestId: e, httpStatus: a }));
|
|
89
|
-
} else if ("session" in t.data || "authorizeResponse" in t.data) {
|
|
90
|
-
const r = t.data;
|
|
91
|
-
s(o.actions.success({ data: r, requestId: e, httpStatus: a }));
|
|
92
|
-
} else {
|
|
93
|
-
const r = t.data;
|
|
94
|
-
s(o.actions.failure({ data: r, requestId: e, httpStatus: a }));
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
export {
|
|
99
|
-
f as handleResponse,
|
|
100
|
-
d as transformActionRequest,
|
|
101
|
-
n as transformSubmitRequest
|
|
102
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error.types.d.ts","sourceRoot":"","sources":["../../src/lib/error.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EACA,gBAAgB,GAChB,eAAe,GACf,gBAAgB,GAChB,eAAe,GACf,aAAa,GACb,eAAe,CAAC;CACrB"}
|
package/dist/lib/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { DaVinciField } from './davinci.types';
|
|
2
|
-
import { ActionCollector, FlowCollector, PasswordCollector, SingleValueCollector, SocialLoginCollector, SubmitCollector, TextCollector } from './collector.types.js';
|
|
3
|
-
/**
|
|
4
|
-
* @const nextCollectorValues - Action for setting the next collector values
|
|
5
|
-
* @see https://redux-toolkit.js.org/api/createAction
|
|
6
|
-
*
|
|
7
|
-
* This is for internal "collector" setup for handling the state of the current node
|
|
8
|
-
*/
|
|
9
|
-
export declare const nextCollectorValues: import('@reduxjs/toolkit').ActionCreatorWithPayload<DaVinciField[], string>;
|
|
10
|
-
export declare const updateCollectorValues: import('@reduxjs/toolkit').ActionCreatorWithPayload<{
|
|
11
|
-
id: string;
|
|
12
|
-
value: string;
|
|
13
|
-
index?: number;
|
|
14
|
-
}, string>;
|
|
15
|
-
/**
|
|
16
|
-
* @const nodeCollectorReducer - Reducer for handling the collector values
|
|
17
|
-
* @see https://redux-toolkit.js.org/api/createReducer
|
|
18
|
-
*/
|
|
19
|
-
export declare const nodeCollectorReducer: import('@reduxjs/toolkit').Reducer<(FlowCollector | PasswordCollector | TextCollector | SocialLoginCollector | SubmitCollector | ActionCollector<"ActionCollector"> | SingleValueCollector<"SingleValueCollector">)[]> & {
|
|
20
|
-
getInitialState: () => (FlowCollector | PasswordCollector | TextCollector | SocialLoginCollector | SubmitCollector | ActionCollector<"ActionCollector"> | SingleValueCollector<"SingleValueCollector">)[];
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=node.reducer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node.reducer.d.ts","sourceRoot":"","sources":["../../src/lib/node.reducer.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EACL,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACd,MAAM,sBAAsB,CAAC;AAE9B;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,6EAA4C,CAAC;AAC7E,eAAO,MAAM,qBAAqB;QAC5B,MAAM;WACH,MAAM;YACL,MAAM;UACC,CAAC;AAelB;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;CAkD/B,CAAC"}
|