synapse-react-client 3.1.26 → 3.1.27
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/containers/TextField.d.ts +3 -1
- package/dist/containers/TextField.js +10 -4
- package/dist/containers/TextField.js.map +1 -1
- package/dist/umd/synapse-react-client.development.js +31 -3
- package/dist/umd/synapse-react-client.development.js.map +3 -3
- package/dist/umd/synapse-react-client.production.min.js +50 -50
- package/dist/utils/SynapseClient.d.ts +9 -0
- package/dist/utils/SynapseClient.js +19 -5
- package/dist/utils/SynapseClient.js.map +1 -1
- package/dist/utils/hooks/useLogin.js +4 -0
- package/dist/utils/hooks/useLogin.js.map +1 -1
- package/dist/utils/synapseTypes/TotpSecret.d.ts +20 -0
- package/dist/utils/synapseTypes/TotpSecret.js +3 -0
- package/dist/utils/synapseTypes/TotpSecret.js.map +1 -0
- package/dist/utils/theme/palette/Palettes.d.ts +3 -1
- package/dist/utils/theme/palette/Palettes.js +16 -15
- package/dist/utils/theme/palette/Palettes.js.map +1 -1
- package/package.json +3 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TextFieldProps as MuiTextFieldProps } from '@mui/material';
|
|
3
|
-
type TextFieldProps = Pick<MuiTextFieldProps, 'autoComplete' | 'autoFocus' | 'disabled' | 'error' | 'fullWidth' | 'id' | 'label' | 'maxRows' | 'minRows' | 'multiline' | 'onBlur' | 'onChange' | 'placeholder' | 'required' | 'sx' | 'type' | 'value'
|
|
3
|
+
type TextFieldProps = Pick<MuiTextFieldProps, 'autoComplete' | 'autoFocus' | 'disabled' | 'error' | 'fullWidth' | 'id' | 'inputProps' | 'label' | 'maxRows' | 'minRows' | 'multiline' | 'onBlur' | 'onChange' | 'placeholder' | 'required' | 'sx' | 'type' | 'value'> & {
|
|
4
|
+
noWrapInFormControl?: boolean;
|
|
5
|
+
};
|
|
4
6
|
/**
|
|
5
7
|
* A styled text field built using MUI components and designed to match the Sage Design System (SDS) input fields.
|
|
6
8
|
*/
|
|
@@ -9,11 +9,17 @@ var material_1 = require("@mui/material");
|
|
|
9
9
|
function TextField(props) {
|
|
10
10
|
var id = (0, react_1.useId)();
|
|
11
11
|
var palette = (0, material_1.useTheme)().palette;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
var noWrapInFormControl = props.noWrapInFormControl, rest = tslib_1.__rest(props, ["noWrapInFormControl"]);
|
|
13
|
+
var Wrapper = (0, react_1.useMemo)(function () {
|
|
14
|
+
return noWrapInFormControl
|
|
15
|
+
? function (props) { return (react_1.default.createElement(react_1.default.Fragment, null, props.children)); }
|
|
16
|
+
: function (props) { return (react_1.default.createElement(material_1.FormControl, { fullWidth: true, sx: { my: 1 } }, props.children)); };
|
|
17
|
+
}, [noWrapInFormControl]);
|
|
18
|
+
return (react_1.default.createElement(Wrapper, null,
|
|
19
|
+
props.label && (react_1.default.createElement(material_1.Typography, { component: 'label', htmlFor: props.id || id, variant: 'body1', sx: { fontWeight: 700, mb: '4px' } },
|
|
14
20
|
props.label,
|
|
15
|
-
props.required ? (react_1.default.createElement(material_1.Box, { component: 'span', sx: { ml: '3px', color: 'secondary.main' } }, '*')) : (react_1.default.createElement(react_1.default.Fragment, null))),
|
|
16
|
-
react_1.default.createElement(material_1.InputBase, tslib_1.__assign({},
|
|
21
|
+
props.required ? (react_1.default.createElement(material_1.Box, { component: 'span', sx: { ml: '3px', color: 'secondary.main' } }, '*')) : (react_1.default.createElement(react_1.default.Fragment, null)))),
|
|
22
|
+
react_1.default.createElement(material_1.InputBase, tslib_1.__assign({}, rest, { id: props.id || id, sx: tslib_1.__assign(tslib_1.__assign({ backgroundColor: 'grey.200', px: 2, py: 1 }, props.sx), { '&.Mui-focused': {
|
|
17
23
|
backgroundColor: palette.background.default,
|
|
18
24
|
outline: "1px solid ".concat(palette.primary.main),
|
|
19
25
|
} }) }))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.js","sourceRoot":"","sources":["../../src/lib/containers/TextField.tsx"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"TextField.js","sourceRoot":"","sources":["../../src/lib/containers/TextField.tsx"],"names":[],"mappings":";;;AAAA,qDAA6C;AAC7C,0CAOsB;AAwBtB;;GAEG;AACH,SAAwB,SAAS,CAAC,KAAqB;IACrD,IAAM,EAAE,GAAG,IAAA,aAAK,GAAE,CAAA;IACV,IAAA,OAAO,GAAK,IAAA,mBAAQ,GAAE,QAAf,CAAe;IACtB,IAAA,mBAAmB,GAAc,KAAK,oBAAnB,EAAK,IAAI,kBAAK,KAAK,EAAxC,uBAAgC,CAAF,CAAU;IAC9C,IAAM,OAAO,GAAG,IAAA,eAAO,EACrB;QACE,OAAA,mBAAmB;YACjB,CAAC,CAAC,UAAC,KAAsC,IAAK,OAAA,CAC1C,8BAAC,eAAK,CAAC,QAAQ,QAAE,KAAK,CAAC,QAAQ,CAAkB,CAClD,EAF2C,CAE3C;YACH,CAAC,CAAC,UAAC,KAAsC,IAAK,OAAA,CAC1C,8BAAC,sBAAW,IAAC,SAAS,QAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,IACjC,KAAK,CAAC,QAAQ,CACH,CACf,EAJ2C,CAI3C;IARL,CAQK,EACP,CAAC,mBAAmB,CAAC,CACtB,CAAA;IACD,OAAO,CACL,8BAAC,OAAO;QACL,KAAK,CAAC,KAAK,IAAI,CACd,8BAAC,qBAAU,IACT,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,KAAK,CAAC,EAAE,IAAI,EAAE,EACvB,OAAO,EAAE,OAAO,EAChB,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE;YAEjC,KAAK,CAAC,KAAK;YACX,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAChB,8BAAC,cAAG,IAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAC/D,GAAG,CACA,CACP,CAAC,CAAC,CAAC,CACF,6DAAK,CACN,CACU,CACd;QACD,8BAAC,oBAAS,uBACJ,IAAI,IACR,EAAE,EAAE,KAAK,CAAC,EAAE,IAAI,EAAE,EAClB,EAAE,sCACA,eAAe,EAAE,UAAU,EAC3B,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,CAAC,IACF,KAAK,CAAC,EAAE,KACX,eAAe,EAAE;oBACf,eAAe,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO;oBAC3C,OAAO,EAAE,oBAAa,OAAO,CAAC,OAAO,CAAC,IAAI,CAAE;iBAC7C,OAEQ,CACL,CACX,CAAA;AACH,CAAC;AApDD,4BAoDC"}
|
|
@@ -29928,7 +29928,7 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
|
|
|
29928
29928
|
"package.json"(exports2, module2) {
|
|
29929
29929
|
module2.exports = {
|
|
29930
29930
|
name: "synapse-react-client",
|
|
29931
|
-
version: "3.1.
|
|
29931
|
+
version: "3.1.27",
|
|
29932
29932
|
private: false,
|
|
29933
29933
|
main: "dist/index.js",
|
|
29934
29934
|
types: "./dist/index.d.ts",
|
|
@@ -29989,6 +29989,7 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
|
|
|
29989
29989
|
"mui-one-time-password-input": "^1.0.4",
|
|
29990
29990
|
"plotly.js-basic-dist": "^2.11.1",
|
|
29991
29991
|
pluralize: "^8.0.0",
|
|
29992
|
+
qrcode: "^1.5.1",
|
|
29992
29993
|
raf: "^3.4.1",
|
|
29993
29994
|
"react-app-polyfill": "^3.0.0",
|
|
29994
29995
|
"react-bootstrap": "^1.5.2",
|
|
@@ -30073,6 +30074,7 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
|
|
|
30073
30074
|
"@types/plotly.js": "^1.54.20",
|
|
30074
30075
|
"@types/plotly.js-basic-dist": "^1.54.0",
|
|
30075
30076
|
"@types/pluralize": "^0.0.29",
|
|
30077
|
+
"@types/qrcode": "^1.5.0",
|
|
30076
30078
|
"@types/react": "^18.0.27",
|
|
30077
30079
|
"@types/react-addons-css-transition-group": "^15.0.5",
|
|
30078
30080
|
"@types/react-dom": "^18.0.6",
|
|
@@ -36910,6 +36912,7 @@ Please use another name.` : formatMuiErrorMessage(18));
|
|
|
36910
36912
|
changePasswordWithToken: () => changePasswordWithToken,
|
|
36911
36913
|
checkUploadComplete: () => checkUploadComplete,
|
|
36912
36914
|
clearDownloadListV2: () => clearDownloadListV2,
|
|
36915
|
+
complete2FAEnrollment: () => complete2FAEnrollment,
|
|
36913
36916
|
consentToOAuth2Request: () => consentToOAuth2Request,
|
|
36914
36917
|
createACL: () => createACL,
|
|
36915
36918
|
createEntity: () => createEntity,
|
|
@@ -37087,6 +37090,7 @@ Please use another name.` : formatMuiErrorMessage(18));
|
|
|
37087
37090
|
setAccessTokenCookie: () => setAccessTokenCookie,
|
|
37088
37091
|
signOut: () => signOut,
|
|
37089
37092
|
signSynapseTermsOfUse: () => signSynapseTermsOfUse,
|
|
37093
|
+
start2FAEnrollment: () => start2FAEnrollment,
|
|
37090
37094
|
startMultipartUpload: () => startMultipartUpload,
|
|
37091
37095
|
submitDataAccessRequest: () => submitDataAccessRequest,
|
|
37092
37096
|
submitFormData: () => submitFormData,
|
|
@@ -37766,6 +37770,22 @@ Please use another name.` : formatMuiErrorMessage(18));
|
|
|
37766
37770
|
)
|
|
37767
37771
|
);
|
|
37768
37772
|
};
|
|
37773
|
+
function start2FAEnrollment(accessToken) {
|
|
37774
|
+
return doPost(
|
|
37775
|
+
"/auth/v1/2fa/enroll",
|
|
37776
|
+
null,
|
|
37777
|
+
accessToken,
|
|
37778
|
+
0 /* REPO_ENDPOINT */
|
|
37779
|
+
);
|
|
37780
|
+
}
|
|
37781
|
+
function complete2FAEnrollment(request, accessToken) {
|
|
37782
|
+
return doPost(
|
|
37783
|
+
"/auth/v1/2fa",
|
|
37784
|
+
request,
|
|
37785
|
+
accessToken,
|
|
37786
|
+
0 /* REPO_ENDPOINT */
|
|
37787
|
+
);
|
|
37788
|
+
}
|
|
37769
37789
|
var createEntity = (entity, accessToken) => {
|
|
37770
37790
|
return doPost(
|
|
37771
37791
|
ENTITY,
|
|
@@ -62560,6 +62580,9 @@ Please use another name.` : formatMuiErrorMessage(18));
|
|
|
62560
62580
|
}
|
|
62561
62581
|
}
|
|
62562
62582
|
}, [twoFaErrorResponse]);
|
|
62583
|
+
(0, import_react25.useEffect)(() => {
|
|
62584
|
+
setErrorMessage(void 0);
|
|
62585
|
+
}, [step]);
|
|
62563
62586
|
function finishLogin(loginResponse) {
|
|
62564
62587
|
return __async(this, null, function* () {
|
|
62565
62588
|
yield SynapseClient_exports.setAccessTokenCookie(loginResponse.accessToken);
|
|
@@ -88719,7 +88742,12 @@ ${e4.message}`);
|
|
|
88719
88742
|
function TextField3(props) {
|
|
88720
88743
|
const id2 = (0, import_react159.useId)();
|
|
88721
88744
|
const { palette: palette3 } = useTheme4();
|
|
88722
|
-
|
|
88745
|
+
const _a = props, { noWrapInFormControl } = _a, rest2 = __objRest(_a, ["noWrapInFormControl"]);
|
|
88746
|
+
const Wrapper3 = (0, import_react159.useMemo)(
|
|
88747
|
+
() => noWrapInFormControl ? (props2) => /* @__PURE__ */ import_react159.default.createElement(import_react159.default.Fragment, null, props2.children) : (props2) => /* @__PURE__ */ import_react159.default.createElement(FormControl_default, { fullWidth: true, sx: { my: 1 } }, props2.children),
|
|
88748
|
+
[noWrapInFormControl]
|
|
88749
|
+
);
|
|
88750
|
+
return /* @__PURE__ */ import_react159.default.createElement(Wrapper3, null, props.label && /* @__PURE__ */ import_react159.default.createElement(
|
|
88723
88751
|
Typography_default,
|
|
88724
88752
|
{
|
|
88725
88753
|
component: "label",
|
|
@@ -88731,7 +88759,7 @@ ${e4.message}`);
|
|
|
88731
88759
|
props.required ? /* @__PURE__ */ import_react159.default.createElement(Box_default, { component: "span", sx: { ml: "3px", color: "secondary.main" } }, "*") : /* @__PURE__ */ import_react159.default.createElement(import_react159.default.Fragment, null)
|
|
88732
88760
|
), /* @__PURE__ */ import_react159.default.createElement(
|
|
88733
88761
|
InputBase_default,
|
|
88734
|
-
__spreadProps(__spreadValues({},
|
|
88762
|
+
__spreadProps(__spreadValues({}, rest2), {
|
|
88735
88763
|
id: props.id || id2,
|
|
88736
88764
|
sx: __spreadProps(__spreadValues({
|
|
88737
88765
|
backgroundColor: "grey.200",
|