@elliemae/pui-app-sdk 4.13.5 → 4.13.7

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.
@@ -27,13 +27,15 @@ var import_http_client = require("../../communication/http-client/index.js");
27
27
  const getToken = async ({
28
28
  clientId,
29
29
  redirectUri,
30
- idpCode
30
+ idpCode,
31
+ scope
31
32
  }) => {
32
33
  const params = new URLSearchParams();
33
34
  params.append("grant_type", "authorization_code");
34
35
  params.append("client_id", clientId);
35
36
  params.append("redirect_uri", redirectUri);
36
37
  params.append("code", idpCode);
38
+ params.append("scope", scope);
37
39
  const { data } = await (0, import_http_client.getHTTPClient)().post(
38
40
  "/oauth2/v1/token",
39
41
  params
@@ -113,7 +113,8 @@ const authorize = async ({
113
113
  const { tokenType, accessToken } = await (0, import_auth.getToken)({
114
114
  idpCode,
115
115
  redirectUri,
116
- clientId
116
+ clientId,
117
+ scope
117
118
  });
118
119
  const authorizationToken = `${tokenType} ${accessToken}`;
119
120
  (0, import_helper.setAuthorizationHeader)(authorizationToken);
@@ -26,19 +26,18 @@ var import_react = require("@testing-library/react");
26
26
  var import_react_redux = require("react-redux");
27
27
  var import_history = require("history");
28
28
  var import_store = require("../../data/store.js");
29
- var import_history2 = require("../history.js");
30
29
  var import_app_router = require("../../view/app-router.js");
31
- const renderWithRouterRedux = (ui, {
32
- route = "/",
33
- history = (0, import_history.createMemoryHistory)({ initialEntries: [route] }),
34
- initialState,
35
- store = (0, import_store.createAppStore)(initialState, import_history2.browserHistory)
36
- } = {}) => ({
37
- ...(0, import_react.render)(
38
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_redux.Provider, { store, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_app_router.AppRouter, { history, children: ui }) })
39
- ),
40
- // adding `store` to the returned utilities to allow us
41
- // to reference it in our tests (just try to avoid using
42
- // this to test implementation details).
43
- store
44
- });
30
+ const renderWithRouterRedux = (ui, options) => {
31
+ const { route = "/", basename = "/", initialState } = options || {};
32
+ const { history = (0, import_history.createMemoryHistory)({ initialEntries: [route] }) } = options || {};
33
+ const { store = (0, import_store.createAppStore)(initialState, history) } = options || {};
34
+ return {
35
+ ...(0, import_react.render)(
36
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_redux.Provider, { store, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_app_router.AppRouter, { basename, history, children: ui }) })
37
+ ),
38
+ // adding `store` to the returned utilities to allow us
39
+ // to reference it in our tests (just try to avoid using
40
+ // this to test implementation details).
41
+ store
42
+ };
43
+ };
@@ -2,13 +2,15 @@ import { getHTTPClient } from "../../communication/http-client/index.js";
2
2
  const getToken = async ({
3
3
  clientId,
4
4
  redirectUri,
5
- idpCode
5
+ idpCode,
6
+ scope
6
7
  }) => {
7
8
  const params = new URLSearchParams();
8
9
  params.append("grant_type", "authorization_code");
9
10
  params.append("client_id", clientId);
10
11
  params.append("redirect_uri", redirectUri);
11
12
  params.append("code", idpCode);
13
+ params.append("scope", scope);
12
14
  const { data } = await getHTTPClient().post(
13
15
  "/oauth2/v1/token",
14
16
  params
@@ -89,7 +89,8 @@ const authorize = async ({
89
89
  const { tokenType, accessToken } = await getToken({
90
90
  idpCode,
91
91
  redirectUri,
92
- clientId
92
+ clientId,
93
+ scope
93
94
  });
94
95
  const authorizationToken = `${tokenType} ${accessToken}`;
95
96
  setAuthorizationHeader(authorizationToken);
@@ -3,22 +3,21 @@ import { render } from "@testing-library/react";
3
3
  import { Provider } from "react-redux";
4
4
  import { createMemoryHistory } from "history";
5
5
  import { createAppStore } from "../../data/store.js";
6
- import { browserHistory } from "../history.js";
7
6
  import { AppRouter } from "../../view/app-router.js";
8
- const renderWithRouterRedux = (ui, {
9
- route = "/",
10
- history = createMemoryHistory({ initialEntries: [route] }),
11
- initialState,
12
- store = createAppStore(initialState, browserHistory)
13
- } = {}) => ({
14
- ...render(
15
- /* @__PURE__ */ jsx(Provider, { store, children: /* @__PURE__ */ jsx(AppRouter, { history, children: ui }) })
16
- ),
17
- // adding `store` to the returned utilities to allow us
18
- // to reference it in our tests (just try to avoid using
19
- // this to test implementation details).
20
- store
21
- });
7
+ const renderWithRouterRedux = (ui, options) => {
8
+ const { route = "/", basename = "/", initialState } = options || {};
9
+ const { history = createMemoryHistory({ initialEntries: [route] }) } = options || {};
10
+ const { store = createAppStore(initialState, history) } = options || {};
11
+ return {
12
+ ...render(
13
+ /* @__PURE__ */ jsx(Provider, { store, children: /* @__PURE__ */ jsx(AppRouter, { basename, history, children: ui }) })
14
+ ),
15
+ // adding `store` to the returned utilities to allow us
16
+ // to reference it in our tests (just try to avoid using
17
+ // this to test implementation details).
18
+ store
19
+ };
20
+ };
22
21
  export {
23
22
  renderWithRouterRedux
24
23
  };
@@ -3,6 +3,7 @@ interface GetTokenRequestParams {
3
3
  clientId: string;
4
4
  redirectUri: string;
5
5
  idpCode: string;
6
+ scope: string;
6
7
  }
7
8
  export interface GetTokenResponse {
8
9
  token_type: string;
@@ -14,7 +15,7 @@ interface GetTokenError {
14
15
  export interface GetTokenErrorResponse extends AxiosError {
15
16
  response: AxiosResponse<GetTokenError>;
16
17
  }
17
- export declare const getToken: ({ clientId, redirectUri, idpCode, }: GetTokenRequestParams) => Promise<{
18
+ export declare const getToken: ({ clientId, redirectUri, idpCode, scope, }: GetTokenRequestParams) => Promise<{
18
19
  tokenType: string;
19
20
  accessToken: string;
20
21
  }>;
@@ -3,11 +3,12 @@ import { History } from 'history';
3
3
  import { AppStore, RootState } from '../../data/store.js';
4
4
  interface Args {
5
5
  initialState: RootState;
6
- store: AppStore;
7
- route: string;
8
- history: History;
6
+ store?: AppStore;
7
+ route?: string;
8
+ basename?: string;
9
+ history?: History;
9
10
  }
10
- export declare const renderWithRouterRedux: (ui: React.ReactElement, { route, history, initialState, store, }?: Args) => {
11
+ export declare const renderWithRouterRedux: (ui: React.ReactElement, options?: Args) => {
11
12
  store: import("@reduxjs/toolkit/dist/configureStore.js").ToolkitStore<import("redux").EmptyObject & {
12
13
  waitMessage: import("../../data/wait-message/reducer.js").WaitMessageState;
13
14
  error: import("../../data/error/index.js").ErrorState;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-app-sdk",
3
- "version": "4.13.5",
3
+ "version": "4.13.7",
4
4
  "description": "ICE MT UI Platform Application SDK ",
5
5
  "sideEffects": [
6
6
  "*.css",