@forgerock/davinci-client 0.0.0-beta-20250414111925 → 0.0.0-beta-20250414113129
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/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +8 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/lib/authorize.utils.d.ts +22 -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/src/lib/config.slice.d.ts +42 -0
- 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/src/lib/davinci.types.d.ts +239 -0
- 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/src/lib/davinci.utils.d.ts +25 -0
- 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/device.store.d.ts +126 -0
- package/dist/src/lib/device.store.d.ts.map +1 -0
- package/dist/src/lib/device.store.js +200 -0
- package/dist/src/lib/device.store.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 +6 -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 +3 -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/src/lib/node.slice.d.ts +145 -0
- 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/src/lib/node.types.d.ts +118 -0
- 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/services/index.d.ts +24 -0
- package/dist/src/lib/services/index.d.ts.map +1 -0
- package/dist/src/lib/services/index.js +81 -0
- package/dist/src/lib/services/index.js.map +1 -0
- package/dist/src/lib/types/binding-device.types.d.ts +31 -0
- package/dist/src/lib/types/binding-device.types.d.ts.map +1 -0
- package/dist/src/lib/types/binding-device.types.js +2 -0
- package/dist/src/lib/types/binding-device.types.js.map +1 -0
- package/dist/src/lib/types/index.d.ts +6 -0
- package/dist/src/lib/types/index.d.ts.map +1 -0
- package/dist/src/lib/types/index.js +12 -0
- package/dist/src/lib/types/index.js.map +1 -0
- package/dist/src/lib/types/oath.types.d.ts +41 -0
- package/dist/src/lib/types/oath.types.d.ts.map +1 -0
- package/dist/src/lib/types/oath.types.js +2 -0
- package/dist/src/lib/types/oath.types.js.map +1 -0
- package/dist/src/lib/types/push-device.types.d.ts +84 -0
- package/dist/src/lib/types/push-device.types.d.ts.map +1 -0
- package/dist/src/lib/types/push-device.types.js +2 -0
- package/dist/src/lib/types/push-device.types.js.map +1 -0
- package/dist/src/lib/types/updateDeviceProfile.types.d.ts +58 -0
- package/dist/src/lib/types/updateDeviceProfile.types.d.ts.map +1 -0
- package/dist/src/lib/types/updateDeviceProfile.types.js +2 -0
- package/dist/src/lib/types/updateDeviceProfile.types.js.map +1 -0
- package/dist/src/lib/types/webauthn.types.d.ts +69 -0
- package/dist/src/lib/types/webauthn.types.d.ts.map +1 -0
- package/dist/src/lib/types/webauthn.types.js +2 -0
- package/dist/src/lib/types/webauthn.types.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 +38 -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 +31 -0
- 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 +3 -2
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FetchArgs, FetchBaseQueryError, FetchBaseQueryMeta, QueryReturnValue } from '@reduxjs/toolkit/query';
|
|
2
|
+
import type { ActionTypes } from './request.effect.unions.js';
|
|
3
|
+
export interface Action {
|
|
4
|
+
type: ActionTypes;
|
|
5
|
+
payload: any;
|
|
6
|
+
}
|
|
7
|
+
export interface ModifiedFetchArgs extends Omit<FetchArgs, 'url'> {
|
|
8
|
+
url: URL;
|
|
9
|
+
headers?: Headers;
|
|
10
|
+
}
|
|
11
|
+
export type RequestMiddleware = (req: ModifiedFetchArgs, action: Action, next: () => ModifiedFetchArgs) => void;
|
|
12
|
+
export interface RequestObj {
|
|
13
|
+
url: URL;
|
|
14
|
+
init: RequestInit;
|
|
15
|
+
}
|
|
16
|
+
export interface QueryApi {
|
|
17
|
+
applyMiddleware(middleware: RequestMiddleware[]): QueryApi;
|
|
18
|
+
applyQuery(callback: (request: FetchArgs) => Promise<QueryReturnValue<unknown, FetchBaseQueryError, FetchBaseQueryMeta>>): Promise<QueryReturnValue<unknown, FetchBaseQueryError, FetchBaseQueryMeta>>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=request.effect.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.effect.types.d.ts","sourceRoot":"","sources":["../../../../src/lib/effects/request.effect.types.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,WAAW,CAAC;IAElB,OAAO,EAAE,GAAG,CAAC;CACd;AAED,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC;IAC/D,GAAG,EAAE,GAAG,CAAC;IACT,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,iBAAiB,GAAG,CAC9B,GAAG,EAAE,iBAAiB,EACtB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,iBAAiB,KAC1B,IAAI,CAAC;AAEV,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,GAAG,CAAC;IACT,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,MAAM,WAAW,QAAQ;IACvB,eAAe,CAAC,UAAU,EAAE,iBAAiB,EAAE,GAAG,QAAQ,CAAC;IAC3D,UAAU,CACR,QAAQ,EAAE,CACR,OAAO,EAAE,SAAS,KACf,OAAO,CAAC,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,CAAC,CAAC,GAC/E,OAAO,CAAC,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,CAAC,CAAC,CAAC;CAChF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.effect.types.js","sourceRoot":"","sources":["../../../../src/lib/effects/request.effect.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const actionTypes: {
|
|
2
|
+
readonly start: "DAVINCI_START";
|
|
3
|
+
readonly next: "DAVINCI_NEXT";
|
|
4
|
+
readonly flow: "DAVINCI_FLOW";
|
|
5
|
+
readonly success: "DAVINCI_SUCCESS";
|
|
6
|
+
readonly error: "DAVINCI_ERROR";
|
|
7
|
+
readonly failure: "DAVINCI_FAILURE";
|
|
8
|
+
readonly resume: "DAVINCI_RESUME";
|
|
9
|
+
};
|
|
10
|
+
export type ActionTypes = (typeof actionTypes)[keyof typeof actionTypes];
|
|
11
|
+
export type EndpointTypes = keyof typeof actionTypes;
|
|
12
|
+
//# sourceMappingURL=request.effect.unions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.effect.unions.d.ts","sourceRoot":"","sources":["../../../../src/lib/effects/request.effect.unions.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW;;;;;;;;CAQd,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AACzE,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,WAAW,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
export const actionTypes = {
|
|
8
|
+
start: 'DAVINCI_START',
|
|
9
|
+
next: 'DAVINCI_NEXT',
|
|
10
|
+
flow: 'DAVINCI_FLOW',
|
|
11
|
+
success: 'DAVINCI_SUCCESS',
|
|
12
|
+
error: 'DAVINCI_ERROR',
|
|
13
|
+
failure: 'DAVINCI_FAILURE',
|
|
14
|
+
resume: 'DAVINCI_RESUME',
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=request.effect.unions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.effect.unions.js","sourceRoot":"","sources":["../../../../src/lib/effects/request.effect.unions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,KAAK,EAAE,eAAe;IACtB,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,iBAAiB;IAC1B,KAAK,EAAE,eAAe;IACtB,OAAO,EAAE,iBAAiB;IAC1B,MAAM,EAAE,gBAAgB;CAChB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FetchArgs, FetchBaseQueryError, FetchBaseQueryMeta, QueryReturnValue } from '@reduxjs/toolkit/query';
|
|
2
|
+
import type { ActionTypes, EndpointTypes } from './request.effect.unions.js';
|
|
3
|
+
import type { ModifiedFetchArgs, RequestMiddleware } from './request.effect.types.js';
|
|
4
|
+
/**
|
|
5
|
+
* @function middlewareWrapper - A "Node" and "Redux" style middleware that is called just before
|
|
6
|
+
* the request is made from the SDK. This allows you access to the request for modification.
|
|
7
|
+
* @param request - A request object container of the URL and the Request Init object
|
|
8
|
+
* @param action - The action object that is passed into the middleware communicating intent
|
|
9
|
+
* @param action.type - A "Redux" style type that contains the serialized action
|
|
10
|
+
* @param action.payload - The payload of the action that can contain metadata
|
|
11
|
+
* @returns {function} - Function that takes middleware parameter & runs middleware against request
|
|
12
|
+
*/
|
|
13
|
+
export declare function middlewareWrapper(request: ModifiedFetchArgs, { type, payload }: {
|
|
14
|
+
type: ActionTypes;
|
|
15
|
+
payload?: any;
|
|
16
|
+
}): (middleware: RequestMiddleware[] | undefined) => ModifiedFetchArgs;
|
|
17
|
+
/**
|
|
18
|
+
* @function initQuery - Initializes a query object with the provided request object
|
|
19
|
+
* @param {FetchArgs} fetchArgs - The request object to initialize the query with
|
|
20
|
+
* @param {string} endpoint - The endpoint to be used for the query
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
export declare function initQuery(fetchArgs: FetchArgs, endpoint: EndpointTypes): {
|
|
24
|
+
applyMiddleware(middleware: RequestMiddleware[] | undefined): /*elided*/ any;
|
|
25
|
+
applyQuery(callback: (request: FetchArgs) => Promise<QueryReturnValue<unknown, FetchBaseQueryError, FetchBaseQueryMeta>>): Promise<QueryReturnValue<unknown, FetchBaseQueryError, FetchBaseQueryMeta>>;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=request.effect.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.effect.utils.d.ts","sourceRoot":"","sources":["../../../../src/lib/effects/request.effect.utils.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEtF;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,iBAAiB,EAE1B,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,OAAO,CAAC,EAAE,GAAG,CAAA;CAAE,GACtD,CAAC,UAAU,EAAE,iBAAiB,EAAE,GAAG,SAAS,KAAK,iBAAiB,CAoBpE;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa;gCAOvC,iBAAiB,EAAE,GAAG,SAAS;yBAS/C,CACR,OAAO,EAAE,SAAS,KACf,OAAO,CAAC,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,CAAC,CAAC;EAOrF"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { actionTypes } from './request.effect.unions.js';
|
|
2
|
+
/**
|
|
3
|
+
* @function middlewareWrapper - A "Node" and "Redux" style middleware that is called just before
|
|
4
|
+
* the request is made from the SDK. This allows you access to the request for modification.
|
|
5
|
+
* @param request - A request object container of the URL and the Request Init object
|
|
6
|
+
* @param action - The action object that is passed into the middleware communicating intent
|
|
7
|
+
* @param action.type - A "Redux" style type that contains the serialized action
|
|
8
|
+
* @param action.payload - The payload of the action that can contain metadata
|
|
9
|
+
* @returns {function} - Function that takes middleware parameter & runs middleware against request
|
|
10
|
+
*/
|
|
11
|
+
export function middlewareWrapper(request,
|
|
12
|
+
// eslint-disable-next-line
|
|
13
|
+
{ type, payload }) {
|
|
14
|
+
// no mutation and no reassignment
|
|
15
|
+
const actionCopy = Object.freeze({ type, payload });
|
|
16
|
+
return (middleware) => {
|
|
17
|
+
if (!Array.isArray(middleware)) {
|
|
18
|
+
return request;
|
|
19
|
+
}
|
|
20
|
+
// Copy middleware so the `shift` below doesn't mutate source
|
|
21
|
+
const mwareCopy = middleware.map((fn) => fn);
|
|
22
|
+
function iterator() {
|
|
23
|
+
const nextMiddlewareToBeCalled = mwareCopy.shift();
|
|
24
|
+
if (nextMiddlewareToBeCalled)
|
|
25
|
+
nextMiddlewareToBeCalled(request, actionCopy, iterator);
|
|
26
|
+
return request;
|
|
27
|
+
}
|
|
28
|
+
return iterator();
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @function initQuery - Initializes a query object with the provided request object
|
|
33
|
+
* @param {FetchArgs} fetchArgs - The request object to initialize the query with
|
|
34
|
+
* @param {string} endpoint - The endpoint to be used for the query
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
37
|
+
export function initQuery(fetchArgs, endpoint) {
|
|
38
|
+
let modifiedRequest = {
|
|
39
|
+
...fetchArgs,
|
|
40
|
+
url: new URL(fetchArgs.url),
|
|
41
|
+
headers: new Headers(fetchArgs.headers),
|
|
42
|
+
};
|
|
43
|
+
const queryApi = {
|
|
44
|
+
applyMiddleware(middleware) {
|
|
45
|
+
// Iterates and executes provided middleware functions
|
|
46
|
+
// Allow middleware to mutate `request` argument
|
|
47
|
+
const runMiddleware = middlewareWrapper(modifiedRequest, { type: actionTypes[endpoint] });
|
|
48
|
+
modifiedRequest = runMiddleware(middleware);
|
|
49
|
+
return queryApi;
|
|
50
|
+
},
|
|
51
|
+
async applyQuery(callback) {
|
|
52
|
+
return await callback({ ...modifiedRequest, url: modifiedRequest.url.toString() });
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
return queryApi;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=request.effect.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.effect.utils.js","sourceRoot":"","sources":["../../../../src/lib/effects/request.effect.utils.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAKzD;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAC/B,OAA0B;AAC1B,2BAA2B;AAC3B,EAAE,IAAI,EAAE,OAAO,EAAwC;IAEvD,kCAAkC;IAClC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAEpD,OAAO,CAAC,UAA2C,EAAE,EAAE;QACrD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;YAC/B,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,6DAA6D;QAC7D,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;QAE7C,SAAS,QAAQ;YACf,MAAM,wBAAwB,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GACf,aAAa,GACb,eAAe,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.types.js","sourceRoot":"","sources":["../../../src/lib/error.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
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 { davinci } from './client.store.js';
|
|
8
|
+
export { davinci };
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { DaVinciField } from './davinci.types.js';
|
|
2
|
+
import { ActionCollector, MultiSelectCollector, SingleSelectCollector, FlowCollector, PasswordCollector, SingleValueCollector, IdpCollector, SubmitCollector, TextCollector, ReadOnlyCollector, ValidatedTextCollector } 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<{
|
|
10
|
+
fields: DaVinciField[];
|
|
11
|
+
formData: {
|
|
12
|
+
value: Record<string, unknown>;
|
|
13
|
+
};
|
|
14
|
+
}, string>;
|
|
15
|
+
export declare const updateCollectorValues: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
16
|
+
id: string;
|
|
17
|
+
value: string | string[];
|
|
18
|
+
index?: number;
|
|
19
|
+
}, string>;
|
|
20
|
+
/**
|
|
21
|
+
* @const nodeCollectorReducer - Reducer for handling the collector values
|
|
22
|
+
* @see https://redux-toolkit.js.org/api/createReducer
|
|
23
|
+
*/
|
|
24
|
+
export declare const nodeCollectorReducer: import("@reduxjs/toolkit").Reducer<(TextCollector | SingleSelectCollector | PasswordCollector | ValidatedTextCollector | MultiSelectCollector | IdpCollector | SubmitCollector | FlowCollector | ReadOnlyCollector | ActionCollector<"ActionCollector"> | SingleValueCollector<"SingleValueCollector">)[]> & {
|
|
25
|
+
getInitialState: () => (TextCollector | SingleSelectCollector | PasswordCollector | ValidatedTextCollector | MultiSelectCollector | IdpCollector | SubmitCollector | FlowCollector | ReadOnlyCollector | ActionCollector<"ActionCollector"> | SingleValueCollector<"SingleValueCollector">)[];
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=node.reducer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.reducer.d.ts","sourceRoot":"","sources":["../../../src/lib/node.reducer.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,EACZ,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,sBAAsB,CAAC;AAE9B;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;YACtB,YAAY,EAAE;cACZ;QAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE;UAC/B,CAAC;AAChB,eAAO,MAAM,qBAAqB;QAC5B,MAAM;WACH,MAAM,GAAG,MAAM,EAAE;YAChB,MAAM;UACC,CAAC;AAmBlB;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;CAuH/B,CAAC"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Ping Identity Corporation. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* This software may be modified and distributed under the terms
|
|
5
|
+
* of the MIT license. See the LICENSE file for details.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Import the required utilities from Redux Toolkit
|
|
9
|
+
*/
|
|
10
|
+
import { createAction, createReducer } from '@reduxjs/toolkit';
|
|
11
|
+
/**
|
|
12
|
+
* Import the collector utilities
|
|
13
|
+
*/
|
|
14
|
+
import { returnActionCollector, returnFlowCollector, returnPasswordCollector, returnSingleValueCollector, returnIdpCollector, returnSubmitCollector, returnTextCollector, returnSingleSelectCollector, returnMultiSelectCollector, returnReadOnlyCollector, } from './collector.utils.js';
|
|
15
|
+
/**
|
|
16
|
+
* @const nextCollectorValues - Action for setting the next collector values
|
|
17
|
+
* @see https://redux-toolkit.js.org/api/createAction
|
|
18
|
+
*
|
|
19
|
+
* This is for internal "collector" setup for handling the state of the current node
|
|
20
|
+
*/
|
|
21
|
+
export const nextCollectorValues = createAction('node/next');
|
|
22
|
+
export const updateCollectorValues = createAction('node/update');
|
|
23
|
+
/**
|
|
24
|
+
* @const initialCollectorValues - Initial state for the collector values
|
|
25
|
+
*/
|
|
26
|
+
const initialCollectorValues = [];
|
|
27
|
+
/**
|
|
28
|
+
* @const nodeCollectorReducer - Reducer for handling the collector values
|
|
29
|
+
* @see https://redux-toolkit.js.org/api/createReducer
|
|
30
|
+
*/
|
|
31
|
+
export const nodeCollectorReducer = createReducer(initialCollectorValues, (builder) => {
|
|
32
|
+
builder
|
|
33
|
+
/**
|
|
34
|
+
* Using the `nextCollectorValues` const (e.g. `'node/next'`) to add the case
|
|
35
|
+
* 'node/next' is essentially derived `createSlice` below. `node.next()` is
|
|
36
|
+
* transformed to `'node/next'` for the action type.
|
|
37
|
+
*/
|
|
38
|
+
.addCase(nextCollectorValues, (_, action) => {
|
|
39
|
+
const fields = action.payload.fields;
|
|
40
|
+
// Map the fields to the initial state with the schema of Generic Collector
|
|
41
|
+
const collectors = Array.isArray(fields)
|
|
42
|
+
? fields.map((field, idx) => {
|
|
43
|
+
/**
|
|
44
|
+
* Some collectors may not have the same properties as others;
|
|
45
|
+
* LABEL field types are one of them, so let's catch them first.
|
|
46
|
+
*/
|
|
47
|
+
if (field.type === 'LABEL') {
|
|
48
|
+
return returnReadOnlyCollector(field, idx);
|
|
49
|
+
}
|
|
50
|
+
// *Some* collectors may have default or existing data to display
|
|
51
|
+
const data = action.payload.formData &&
|
|
52
|
+
action.payload.formData.value &&
|
|
53
|
+
action.payload.formData.value[field.key];
|
|
54
|
+
// Match specific collectors
|
|
55
|
+
switch (field.type) {
|
|
56
|
+
case 'CHECKBOX':
|
|
57
|
+
case 'COMBOBOX': {
|
|
58
|
+
// Intentional fall-through
|
|
59
|
+
const strArr = data;
|
|
60
|
+
return returnMultiSelectCollector(field, idx, strArr);
|
|
61
|
+
}
|
|
62
|
+
case 'DROPDOWN':
|
|
63
|
+
case 'RADIO': {
|
|
64
|
+
// Intentional fall-through
|
|
65
|
+
const str = data;
|
|
66
|
+
return returnSingleSelectCollector(field, idx, str);
|
|
67
|
+
}
|
|
68
|
+
case 'FLOW_BUTTON':
|
|
69
|
+
case 'FLOW_LINK': {
|
|
70
|
+
// Intentional fall-through
|
|
71
|
+
// No data to send
|
|
72
|
+
return returnFlowCollector(field, idx);
|
|
73
|
+
}
|
|
74
|
+
case 'PASSWORD':
|
|
75
|
+
case 'PASSWORD_VERIFY': {
|
|
76
|
+
// No data to send
|
|
77
|
+
return returnPasswordCollector(field, idx);
|
|
78
|
+
}
|
|
79
|
+
case 'TEXT': {
|
|
80
|
+
const str = data;
|
|
81
|
+
return returnTextCollector(field, idx, str);
|
|
82
|
+
}
|
|
83
|
+
case 'SOCIAL_LOGIN_BUTTON': {
|
|
84
|
+
// No data to send
|
|
85
|
+
return returnIdpCollector(field, idx);
|
|
86
|
+
}
|
|
87
|
+
case 'SUBMIT_BUTTON': {
|
|
88
|
+
// No data to send
|
|
89
|
+
return returnSubmitCollector(field, idx);
|
|
90
|
+
}
|
|
91
|
+
default:
|
|
92
|
+
// Default is handled below
|
|
93
|
+
}
|
|
94
|
+
// Generic Collectors
|
|
95
|
+
if (field.type.includes('BUTTON') || field.type.includes('LINK')) {
|
|
96
|
+
// No data to send
|
|
97
|
+
return returnActionCollector(field, idx, 'ActionCollector');
|
|
98
|
+
}
|
|
99
|
+
const str = data;
|
|
100
|
+
return returnSingleValueCollector(field, idx, 'SingleValueCollector', str);
|
|
101
|
+
})
|
|
102
|
+
: [];
|
|
103
|
+
return collectors || [];
|
|
104
|
+
})
|
|
105
|
+
/**
|
|
106
|
+
* Using the `updateCollectorValues` const (e.g. `'node/update'`) to add the case
|
|
107
|
+
* 'node/next' is essentially derived `createSlice` below. `node.next()` is
|
|
108
|
+
* transformed to `'node/next'` for the action type.
|
|
109
|
+
*/
|
|
110
|
+
.addCase(updateCollectorValues, (state, action) => {
|
|
111
|
+
const collector = state.find((collector) => collector.id === action.payload.id);
|
|
112
|
+
if (!collector) {
|
|
113
|
+
throw new Error('No collector found to update');
|
|
114
|
+
}
|
|
115
|
+
if (collector.category === 'ActionCollector') {
|
|
116
|
+
throw new Error('ActionCollectors are read-only');
|
|
117
|
+
}
|
|
118
|
+
if (collector.category === 'NoValueCollector') {
|
|
119
|
+
throw new Error('NoValueCollectors, like ReadOnlyCollectors, are read-only');
|
|
120
|
+
}
|
|
121
|
+
if (action.payload.value === undefined) {
|
|
122
|
+
throw new Error('Value argument cannot be undefined');
|
|
123
|
+
}
|
|
124
|
+
if (collector.category === 'SingleValueCollector' ||
|
|
125
|
+
collector.category === 'ValidatedSingleValueCollector') {
|
|
126
|
+
if (Array.isArray(action.payload.value)) {
|
|
127
|
+
throw new Error('SingleValueCollector does not accept an array');
|
|
128
|
+
}
|
|
129
|
+
collector.input.value = action.payload.value;
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (collector.category === 'MultiValueCollector') {
|
|
133
|
+
if (Array.isArray(action.payload.value)) {
|
|
134
|
+
collector.input.value = [...action.payload.value];
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
collector.input.value.push(action.payload.value);
|
|
138
|
+
}
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
//# sourceMappingURL=node.reducer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.reducer.js","sourceRoot":"","sources":["../../../src/lib/node.reducer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE/D;;GAEG;AACH,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EACvB,0BAA0B,EAC1B,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,2BAA2B,EAC3B,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAgB9B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,YAAY,CAG5C,WAAW,CAAC,CAAC;AAChB,MAAM,CAAC,MAAM,qBAAqB,GAAG,YAAY,CAI9C,aAAa,CAAC,CAAC;AAElB;;GAEG;AACH,MAAM,sBAAsB,GAYtB,EAAE,CAAC;AAET;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAC,sBAAsB,EAAE,CAAC,OAAO,EAAE,EAAE;IACpF,OAAO;QACL;;;;WAIG;SACF,OAAO,CAAC,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CAAC,KAAK,CAAC,CAAC;YACnD,CAAC;YACD,OAAO;QACT,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Import the needed reducers
|
|
3
|
+
*/
|
|
4
|
+
import { updateCollectorValues } from './node.reducer.js';
|
|
5
|
+
/**
|
|
6
|
+
* Import the types
|
|
7
|
+
*/
|
|
8
|
+
import type { PayloadAction } from '@reduxjs/toolkit';
|
|
9
|
+
import type { SubmitCollector } from './collector.types.js';
|
|
10
|
+
import type { DavinciErrorResponse, DaVinciFailureResponse, DaVinciNextResponse, DaVinciSuccessResponse } from './davinci.types.js';
|
|
11
|
+
import type { ContinueNode, SuccessNode, ErrorNode, StartNode, FailureNode } from './node.types.js';
|
|
12
|
+
/**
|
|
13
|
+
* @const initialNodeState - Initial state for the node slice
|
|
14
|
+
*/
|
|
15
|
+
export declare const initialNodeState: {
|
|
16
|
+
cache: null;
|
|
17
|
+
client: {
|
|
18
|
+
status: string;
|
|
19
|
+
};
|
|
20
|
+
error: null;
|
|
21
|
+
server: {
|
|
22
|
+
status: string;
|
|
23
|
+
};
|
|
24
|
+
status: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* @const nodeSlice - Slice for handling the node state
|
|
28
|
+
* @see https://redux-toolkit.js.org/api/createSlice
|
|
29
|
+
*/
|
|
30
|
+
export declare const nodeSlice: import("@reduxjs/toolkit").Slice<ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode, {
|
|
31
|
+
/**
|
|
32
|
+
* @method error - Method for creating an error node
|
|
33
|
+
* @param {Object} state - The current state of the slice
|
|
34
|
+
* @param {PayloadAction<DaVinciErrorCacheEntry<DavinciErrorResponse>>} action - The action to be dispatched
|
|
35
|
+
* @returns {ErrorNode} - The error node
|
|
36
|
+
*/
|
|
37
|
+
error(state: import("immer").WritableDraft<ContinueNode> | import("immer").WritableDraft<ErrorNode> | import("immer").WritableDraft<FailureNode> | import("immer").WritableDraft<StartNode> | import("immer").WritableDraft<SuccessNode>, action: PayloadAction<{
|
|
38
|
+
data: DavinciErrorResponse;
|
|
39
|
+
requestId: string;
|
|
40
|
+
httpStatus: number;
|
|
41
|
+
}>): import("immer").WritableDraft<ErrorNode>;
|
|
42
|
+
/**
|
|
43
|
+
* @method failure - Method for creating an error node
|
|
44
|
+
* @param {Object} state - The current state of the slice
|
|
45
|
+
* @param {PayloadAction<DaVinciFailureResponse>} action - The action to be dispatched
|
|
46
|
+
* @returns {FailureNode} - The error node
|
|
47
|
+
*/
|
|
48
|
+
failure(state: import("immer").WritableDraft<ContinueNode> | import("immer").WritableDraft<ErrorNode> | import("immer").WritableDraft<FailureNode> | import("immer").WritableDraft<StartNode> | import("immer").WritableDraft<SuccessNode>, action: PayloadAction<{
|
|
49
|
+
data: DaVinciFailureResponse | unknown;
|
|
50
|
+
requestId: string;
|
|
51
|
+
httpStatus: number;
|
|
52
|
+
}>): import("immer").WritableDraft<FailureNode>;
|
|
53
|
+
/**
|
|
54
|
+
* @method next - Method for creating a next node
|
|
55
|
+
* @param {Object} state - The current state of the slice
|
|
56
|
+
* @param {PayloadAction<DaVinciNextResponse>} action - The action to be dispatched
|
|
57
|
+
* @returns {ContinueNode} - The next node
|
|
58
|
+
*/
|
|
59
|
+
next(state: import("immer").WritableDraft<ContinueNode> | import("immer").WritableDraft<ErrorNode> | import("immer").WritableDraft<FailureNode> | import("immer").WritableDraft<StartNode> | import("immer").WritableDraft<SuccessNode>, action: PayloadAction<{
|
|
60
|
+
data: DaVinciNextResponse;
|
|
61
|
+
requestId: string;
|
|
62
|
+
httpStatus: number;
|
|
63
|
+
}>): import("immer").WritableDraft<ContinueNode>;
|
|
64
|
+
/**
|
|
65
|
+
* @method start - Method for creating a start node
|
|
66
|
+
* @param {Object} state - The current state of the slice
|
|
67
|
+
* @returns {StartNode} - The start node
|
|
68
|
+
*/
|
|
69
|
+
success(state: import("immer").WritableDraft<ContinueNode> | import("immer").WritableDraft<ErrorNode> | import("immer").WritableDraft<FailureNode> | import("immer").WritableDraft<StartNode> | import("immer").WritableDraft<SuccessNode>, action: PayloadAction<{
|
|
70
|
+
data: DaVinciSuccessResponse;
|
|
71
|
+
requestId: string;
|
|
72
|
+
httpStatus: number;
|
|
73
|
+
}>): import("immer").WritableDraft<SuccessNode>;
|
|
74
|
+
/**
|
|
75
|
+
* @method update - Method for updating collector values with the node
|
|
76
|
+
* @param {Object} state - The current state of the slice
|
|
77
|
+
* @param {PayloadAction<unknown>} action - The action to be dispatched
|
|
78
|
+
* @returns {ContinueNode} - The next node
|
|
79
|
+
*/
|
|
80
|
+
update(state: import("immer").WritableDraft<ContinueNode> | import("immer").WritableDraft<ErrorNode> | import("immer").WritableDraft<FailureNode> | import("immer").WritableDraft<StartNode> | import("immer").WritableDraft<SuccessNode>, action: ReturnType<typeof updateCollectorValues>): import("immer").WritableDraft<ContinueNode>;
|
|
81
|
+
}, "node", "node", {
|
|
82
|
+
selectClient: (state: ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode) => {
|
|
83
|
+
action: string;
|
|
84
|
+
collectors: import("./node.types.js").Collectors[];
|
|
85
|
+
description?: string;
|
|
86
|
+
name?: string;
|
|
87
|
+
status: "continue";
|
|
88
|
+
} | {
|
|
89
|
+
action: string;
|
|
90
|
+
collectors: import("./node.types.js").Collectors[];
|
|
91
|
+
description?: string;
|
|
92
|
+
name?: string;
|
|
93
|
+
status: "error";
|
|
94
|
+
} | {
|
|
95
|
+
status: "failure";
|
|
96
|
+
} | {
|
|
97
|
+
status: "start";
|
|
98
|
+
} | {
|
|
99
|
+
authorization?: {
|
|
100
|
+
code?: string;
|
|
101
|
+
state?: string;
|
|
102
|
+
};
|
|
103
|
+
status: "success";
|
|
104
|
+
} | null;
|
|
105
|
+
selectCollectors: (state: ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode) => import("./node.types.js").Collectors[];
|
|
106
|
+
selectCollector: (state: ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode, id: string) => import("./collector.types.js").TextCollector | import("./collector.types.js").SingleSelectCollector | import("./collector.types.js").PasswordCollector | import("./collector.types.js").SingleValueCollectorNoValue<"SingleValueCollector"> | import("./collector.types.js").ValidatedTextCollector | import("./collector.types.js").MultiSelectCollector | import("./collector.types.js").IdpCollector | SubmitCollector | import("./collector.types.js").FlowCollector | import("./collector.types.js").ActionCollectorNoUrl<"ActionCollector"> | import("./collector.types.js").ReadOnlyCollector | undefined;
|
|
107
|
+
selectError: (state: ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode) => import("./node.types.js").DaVinciError | null;
|
|
108
|
+
selectErrorCollectors: (state: ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode) => import("./node.types.js").CollectorErrors[];
|
|
109
|
+
selectServer: (state: ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode) => {
|
|
110
|
+
_links?: import("./davinci.types.js").Links;
|
|
111
|
+
id?: string;
|
|
112
|
+
interactionId?: string;
|
|
113
|
+
interactionToken?: string;
|
|
114
|
+
href?: string;
|
|
115
|
+
eventName?: string;
|
|
116
|
+
status: "continue";
|
|
117
|
+
} | {
|
|
118
|
+
_links?: import("./davinci.types.js").Links;
|
|
119
|
+
eventName?: string;
|
|
120
|
+
id?: string;
|
|
121
|
+
interactionId?: string;
|
|
122
|
+
interactionToken?: string;
|
|
123
|
+
status: "error";
|
|
124
|
+
} | {
|
|
125
|
+
_links?: import("./davinci.types.js").Links;
|
|
126
|
+
eventName?: string;
|
|
127
|
+
href?: string;
|
|
128
|
+
id?: string;
|
|
129
|
+
interactionId?: string;
|
|
130
|
+
interactionToken?: string;
|
|
131
|
+
status: "failure";
|
|
132
|
+
} | {
|
|
133
|
+
status: "start";
|
|
134
|
+
} | {
|
|
135
|
+
_links?: import("./davinci.types.js").Links;
|
|
136
|
+
eventName?: string;
|
|
137
|
+
id?: string;
|
|
138
|
+
interactionId?: string;
|
|
139
|
+
interactionToken?: string;
|
|
140
|
+
href?: string;
|
|
141
|
+
session?: string;
|
|
142
|
+
status: "success";
|
|
143
|
+
} | null;
|
|
144
|
+
}>;
|
|
145
|
+
//# sourceMappingURL=node.slice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.slice.d.ts","sourceRoot":"","sources":["../../../src/lib/node.slice.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,OAAO,EAAwB,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAGhF;;GAEG;AACH,OAAO,KAAK,EAAS,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAWpG;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;CAU5B,CAAC;AAIF;;;GAGG;AACH,eAAO,MAAM,SAAS;IAIlB;;;;;OAKG;sPAGO,aAAa,CAAC;QAAE,IAAI,EAAE,oBAAoB,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IAsC9F;;;;;OAKG;wPAGO,aAAa,CAAC;QACpB,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC;QACvC,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IA2CJ;;;;;OAKG;qPAGO,aAAa,CAAC;QACpB,IAAI,EAAE,mBAAmB,CAAC;QAC1B,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IA4CJ;;;;OAIG;wPAGO,aAAa,CAAC;QACpB,IAAI,EA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