@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
|
@@ -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">;
|
|
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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Ping Identity Corporation. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* This software may be modified and distributed under the terms
|
|
5
|
+
* of the MIT license. See the LICENSE file for details.
|
|
6
|
+
*/
|
|
7
|
+
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query';
|
|
8
|
+
export const wellknownApi = createApi({
|
|
9
|
+
reducerPath: 'wellknown',
|
|
10
|
+
baseQuery: fetchBaseQuery({
|
|
11
|
+
prepareHeaders: (headers) => {
|
|
12
|
+
headers.set('Accept', 'application/json');
|
|
13
|
+
return headers;
|
|
14
|
+
},
|
|
15
|
+
}),
|
|
16
|
+
endpoints: (builder) => ({
|
|
17
|
+
wellknown: builder.query({
|
|
18
|
+
query: (endpoint) => ({ url: endpoint }),
|
|
19
|
+
}),
|
|
20
|
+
}),
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=wellknown.api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wellknown.api.js","sourceRoot":"","sources":["../../../src/lib/wellknown.api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGnE,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC;IACpC,WAAW,EAAE,WAAW;IACxB,SAAS,EAAE,cAAc,CAAC;QACxB,cAAc,EAAE,CAAC,OAAO,EAAE,EAAE;YAC1B,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;YAC1C,OAAO,OAAO,CAAC;QACjB,CAAC;KACF,CAAC;IACF,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QACvB,SAAS,EAAE,OAAO,CAAC,KAAK,CAA4B;YAClD,KAAK,EAAE,CAAC,QAAgB,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;SACjD,CAAC;KACH,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wellknown.types.d.ts","sourceRoot":"","sources":["../../../src/lib/wellknown.types.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qCAAqC,EAAE,MAAM,CAAC;IAC9C,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,6BAA6B,EAAE,MAAM,CAAC;IACtC,0BAA0B,EAAE,MAAM,CAAC;IACnC,2BAA2B,EAAE,MAAM,CAAC;IACpC,+BAA+B,EAAE,MAAM,CAAC;IACxC,qCAAqC,EAAE,MAAM,CAAC;IAC9C,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,wBAAwB,EAAE,MAAM,EAAE,CAAC;IACnC,wBAAwB,EAAE,MAAM,EAAE,CAAC;IACnC,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,uBAAuB,EAAE,MAAM,EAAE,CAAC;IAClC,qCAAqC,EAAE,MAAM,EAAE,CAAC;IAChD,qCAAqC,EAAE,MAAM,EAAE,CAAC;IAChD,2CAA2C,EAAE,MAAM,EAAE,CAAC;IACtD,qCAAqC,EAAE,MAAM,EAAE,CAAC;IAChD,gDAAgD,EAAE,MAAM,EAAE,CAAC;IAC3D,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,gCAAgC,EAAE,MAAM,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wellknown.types.js","sourceRoot":"","sources":["../../../src/lib/wellknown.types.ts"],"names":[],"mappings":""}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import 'immer';
|
|
1
2
|
import type * as collectors from './lib/collector.types.js';
|
|
2
3
|
import type * as config from './lib/config.types.js';
|
|
3
4
|
import type * as nodes from './lib/node.types.js';
|
|
4
5
|
import type * as client from './lib/client.types.js';
|
|
6
|
+
import type * as effect from './lib/effects/request.effect.types.js';
|
|
5
7
|
export type DaVinciConfig = config.DaVinciConfig;
|
|
6
8
|
export type Updater = client.Updater;
|
|
7
9
|
export type InitFlow = client.InitFlow;
|
|
10
|
+
export type Validator = client.Validator;
|
|
8
11
|
export type StartNode = nodes.StartNode;
|
|
9
12
|
export type ContinueNode = nodes.ContinueNode;
|
|
10
13
|
export type ErrorNode = nodes.ErrorNode;
|
|
@@ -18,6 +21,11 @@ export type SingleValueCollector<T extends collectors.SingleValueCollectorTypes>
|
|
|
18
21
|
export type FlowCollector = collectors.FlowCollector;
|
|
19
22
|
export type PasswordCollector = collectors.PasswordCollector;
|
|
20
23
|
export type TextCollector = collectors.TextCollector;
|
|
21
|
-
export type
|
|
24
|
+
export type IdpCollector = collectors.IdpCollector;
|
|
22
25
|
export type SubmitCollector = collectors.SubmitCollector;
|
|
26
|
+
export type ValidatedTextCollector = collectors.ValidatedTextCollector;
|
|
27
|
+
export type ReadOnlyCollector = collectors.ReadOnlyCollector;
|
|
28
|
+
export type MultiSelectCollector = collectors.MultiSelectCollector;
|
|
29
|
+
export type SingleSelectCollector = collectors.SingleSelectCollector;
|
|
30
|
+
export type RequestMiddleware = effect.RequestMiddleware;
|
|
23
31
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAMA,OAAO,OAAO,CAAC;AAEf,OAAO,KAAK,KAAK,UAAU,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,KAAK,MAAM,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,KAAK,KAAK,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,MAAM,uCAAuC,CAAC;AAErE,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;AAEjD,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;AACrC,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AACvC,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;AAEzC,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;AACxC,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;AAC9C,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;AACxC,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;AAC5C,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;AAE5C,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,CAAC;AAE1F,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;AAC1C,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC,YAAY,CAAC;AAExD,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,UAAU,CAAC,oBAAoB,IACnE,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;AAChC,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,UAAU,CAAC,yBAAyB,IAC7E,UAAU,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;AAErC,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC;AACrD,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,iBAAiB,CAAC;AAC7D,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC;AACrD,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;AACnD,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,eAAe,CAAC;AACzD,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,sBAAsB,CAAC;AACvE,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,iBAAiB,CAAC;AAC7D,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,oBAAoB,CAAC;AACnE,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,qBAAqB,CAAC;AAErE,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Ping Identity Corporation. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* This software may be modified and distributed under the terms
|
|
5
|
+
* of the MIT license. See the LICENSE file for details.
|
|
6
|
+
*/
|
|
7
|
+
import 'immer'; // Side-effect needed only for getting types in workspace
|
|
8
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,OAAO,CAAC,CAAC,yDAAyD"}
|
package/package.json
CHANGED
|
@@ -1,32 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forgerock/davinci-client",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"main": "./dist/index.js",
|
|
5
|
-
"module": "./dist/index.js",
|
|
6
|
-
"typings": "./dist/index.d.ts",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"files": [
|
|
9
|
-
"dist"
|
|
10
|
-
],
|
|
3
|
+
"version": "1.1.0",
|
|
11
4
|
"repository": {
|
|
12
5
|
"type": "git",
|
|
13
|
-
"url": "git+https://github.com
|
|
6
|
+
"url": "git+https://github.com/ForgeRock/ping-javascript-sdk.git",
|
|
14
7
|
"directory": "packages/davinci-client"
|
|
15
8
|
},
|
|
9
|
+
"sideEffects": [
|
|
10
|
+
"./src/types.js"
|
|
11
|
+
],
|
|
12
|
+
"type": "module",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": "./dist/src/index.js",
|
|
15
|
+
"./types": "./dist/src/types.d.ts"
|
|
16
|
+
},
|
|
17
|
+
"main": "./dist/src/index.js",
|
|
18
|
+
"module": "./dist/src/index.js",
|
|
19
|
+
"typings": "./dist/src/index.d.ts",
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"!dist/tsconfig.lib.tsbuildinfo",
|
|
23
|
+
"./LICENSE"
|
|
24
|
+
],
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@forgerock/javascript-sdk": "4.7.0",
|
|
27
|
+
"@reduxjs/toolkit": "^2.2.5",
|
|
28
|
+
"immer": "^10.1.1"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"vitest": "^3.0.4"
|
|
32
|
+
},
|
|
16
33
|
"publishConfig": {
|
|
17
34
|
"access": "public"
|
|
18
35
|
},
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
36
|
+
"nx": {
|
|
37
|
+
"tags": [
|
|
38
|
+
"scope:package"
|
|
39
|
+
],
|
|
40
|
+
"targets": {
|
|
41
|
+
"build": {
|
|
42
|
+
"executor": "@nx/js:tsc",
|
|
43
|
+
"outputs": [
|
|
44
|
+
"{options.outputPath}"
|
|
45
|
+
],
|
|
46
|
+
"options": {
|
|
47
|
+
"outputPath": "packages/davinci-client/dist",
|
|
48
|
+
"main": "packages/davinci-client/src/index.ts",
|
|
49
|
+
"tsConfig": "packages/davinci-client/tsconfig.lib.json",
|
|
50
|
+
"generatePackageJson": false,
|
|
51
|
+
"assets": []
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
24
55
|
},
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
"./types": "./dist/types.d.ts"
|
|
56
|
+
"scripts": {
|
|
57
|
+
"lint": "pnpm nx nxLint",
|
|
58
|
+
"test": "pnpm nx nxTest",
|
|
59
|
+
"test:watch": "pnpm nx nxTest --watch"
|
|
31
60
|
}
|
|
32
61
|
}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
package/dist/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authorize.utils.d.ts","sourceRoot":"","sources":["../../src/lib/authorize.utils.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,UAAU,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,MAAM,CAAC,CA+BjB"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ResponseType as l, PKCE as a } from "@forgerock/javascript-sdk";
|
|
2
|
-
import { generateAndStoreAuthUrlValues as d } from "@forgerock/javascript-sdk/src/oauth2-client/state-pkce";
|
|
3
|
-
async function h(r, e) {
|
|
4
|
-
const n = new URL(r).origin, [t, o] = d({
|
|
5
|
-
clientId: e.clientId,
|
|
6
|
-
login: e.login,
|
|
7
|
-
serverConfig: { baseUrl: n },
|
|
8
|
-
responseType: l.Code
|
|
9
|
-
}), s = await a.createChallenge(t.verifier), c = new URLSearchParams({
|
|
10
|
-
code_challenge: s,
|
|
11
|
-
code_challenge_method: "S256",
|
|
12
|
-
client_id: e.clientId,
|
|
13
|
-
redirect_uri: e.redirectUri,
|
|
14
|
-
response_mode: "pi.flow",
|
|
15
|
-
response_type: e.responseType,
|
|
16
|
-
scope: e.scope,
|
|
17
|
-
state: t.state
|
|
18
|
-
}), i = new URL(`${r}?${c.toString()}`);
|
|
19
|
-
return o(), i.toString();
|
|
20
|
-
}
|
|
21
|
-
export {
|
|
22
|
-
h as createAuthorizeUrl
|
|
23
|
-
};
|
|
@@ -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"}
|