@machinemetrics/mm-react-tools 5.0.0-1 → 5.0.0-3
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/README.md +2 -1
- package/dist/MMEmbeddedAppProvider.d.ts +1 -0
- package/dist/MMEmbeddedAppProvider.d.ts.map +1 -1
- package/dist/MMProvider.d.ts +1 -3
- package/dist/MMProvider.d.ts.map +1 -1
- package/dist/localStorage.d.ts +2 -0
- package/dist/localStorage.d.ts.map +1 -1
- package/dist/mm-react-tools.es.js +8365 -8062
- package/dist/pkce.d.ts +4 -0
- package/dist/pkce.d.ts.map +1 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -37,6 +37,8 @@ npm install react react-router-dom styled-components @apollo/client
|
|
|
37
37
|
|
|
38
38
|
Wrap your application in the `MMProvider` to wire up everything necessary to authenticate against MachineMetrics Cloud with OAuth.
|
|
39
39
|
|
|
40
|
+
Sign-in uses the OAuth authorization-code flow with PKCE (S256). **There is no `clientSecret` prop**: a browser app is a public client and must not ship a secret. If you are upgrading from v4, delete `clientSecret` from your config and rotate that secret — it has been in every build that included it.
|
|
41
|
+
|
|
40
42
|
```jsx
|
|
41
43
|
import React from 'react';
|
|
42
44
|
import ReactDOM from 'react-dom';
|
|
@@ -46,7 +48,6 @@ import App from './App';
|
|
|
46
48
|
ReactDOM.render(
|
|
47
49
|
<MMProvider
|
|
48
50
|
clientId={process.env.REACT_APP_CLIENT_ID}
|
|
49
|
-
clientSecret={process.env.REACT_APP_CLIENT_SECRET}
|
|
50
51
|
releaseStage={process.env.REACT_APP_RELEASE_STAGE}
|
|
51
52
|
scope={'reporting'}
|
|
52
53
|
>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MMEmbeddedAppProvider.d.ts","sourceRoot":"","sources":["../src/MMEmbeddedAppProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MMEmbeddedAppProvider.d.ts","sourceRoot":"","sources":["../src/MMEmbeddedAppProvider.tsx"],"names":[],"mappings":"AAsBA,eAAO,MAAM,yBAAyB,UAAmB,CAAC;AAK1D,QAAA,MAAM,qBAAqB,+CA2vB1B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
package/dist/MMProvider.d.ts
CHANGED
|
@@ -9,8 +9,6 @@ export interface MMProviderProps {
|
|
|
9
9
|
scope?: string;
|
|
10
10
|
/** OAuth client id. */
|
|
11
11
|
clientId: string;
|
|
12
|
-
/** OAuth client secret, used when exchanging the authorization code. */
|
|
13
|
-
clientSecret?: string;
|
|
14
12
|
/**
|
|
15
13
|
* Selects the default url set. Known stages keep autocomplete; a plain
|
|
16
14
|
* `string` (e.g. from JSON config) is also accepted and validated at runtime.
|
|
@@ -25,6 +23,6 @@ export interface MMProviderProps {
|
|
|
25
23
|
/** Overrides for the urls derived from `releaseStage`. */
|
|
26
24
|
urls?: Partial<MMUrls>;
|
|
27
25
|
}
|
|
28
|
-
declare const MMProvider: ({ domain, children, scope, clientId,
|
|
26
|
+
declare const MMProvider: ({ domain, children, scope, clientId, releaseStage, refreshJwtIntervalMs, device, graphQLRoleOverride, urls: customUrls, ...legacyProps }: MMProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
27
|
export default MMProvider;
|
|
30
28
|
//# sourceMappingURL=MMProvider.d.ts.map
|
package/dist/MMProvider.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MMProvider.d.ts","sourceRoot":"","sources":["../src/MMProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"MMProvider.d.ts","sourceRoot":"","sources":["../src/MMProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAuBf,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAG1C,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,SAAS,GAAG,aAAa,CAAC;AA4CtE,MAAM,WAAW,eAAe;IAC9B,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uBAAuB;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,YAAY,EAAE,cAAc,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAC7C,uEAAuE;IACvE,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,8DAA8D;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,0DAA0D;IAC1D,IAAI,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CACxB;AAED,QAAA,MAAM,UAAU,GAAI,0IAWjB,eAAe,4CAmVjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
package/dist/localStorage.d.ts
CHANGED
|
@@ -6,4 +6,6 @@ export declare const retrieveAuthState: () => string | null;
|
|
|
6
6
|
export declare const storeAuthState: (state: any) => void;
|
|
7
7
|
export declare const storePopupMode: (active: any) => void;
|
|
8
8
|
export declare const retrievePopupMode: () => boolean;
|
|
9
|
+
export declare const retrieveCodeVerifier: () => string | null;
|
|
10
|
+
export declare const storeCodeVerifier: (verifier?: string | null) => void;
|
|
9
11
|
//# sourceMappingURL=localStorage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localStorage.d.ts","sourceRoot":"","sources":["../src/localStorage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"localStorage.d.ts","sourceRoot":"","sources":["../src/localStorage.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,mBAAmB,qBAE/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,OAAO,GAAG,SAM1C,CAAC;AAEF,eAAO,MAAM,mBAAmB,qBAE/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,MAAM,GAAG,SAMzC,CAAC;AAEF,eAAO,MAAM,iBAAiB,qBAE7B,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,OAAO,GAAG,SAMxC,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,QAAQ,GAAG,SAMzC,CAAC;AAEF,eAAO,MAAM,iBAAiB,eAE7B,CAAC;AAIF,eAAO,MAAM,oBAAoB,qBAEhC,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,WAAW,MAAM,GAAG,IAAI,SAMzD,CAAC"}
|