Skip to content

Commit

Permalink
chore: update dependencies; fix CVE-2023-44270
Browse files Browse the repository at this point in the history
  • Loading branch information
bobhageman committed Oct 9, 2023
1 parent f337c9a commit c4f5224
Show file tree
Hide file tree
Showing 48 changed files with 4,081 additions and 4,365 deletions.
2 changes: 1 addition & 1 deletion examples/node/yivi-client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ yivi.use(Client);
yivi
.start()
.then((result) =>
console.log('Successful disclosure! 🎉', util.inspect(result, { showHidden: false, depth: null, colors: true }))
console.log('Successful disclosure! 🎉', util.inspect(result, { showHidden: false, depth: null, colors: true })),
)
.catch((error) => console.error("Couldn't do what you asked 😢", error));
2 changes: 1 addition & 1 deletion examples/node/yivi-console/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ yivi.use(Dummy);
yivi
.start()
.then((result) =>
console.log('Successful disclosure! 🎉', util.inspect(result, { showHidden: false, depth: null, colors: true }))
console.log('Successful disclosure! 🎉', util.inspect(result, { showHidden: false, depth: null, colors: true })),
)
.catch((error) => console.error("Couldn't do what you asked 😢", error));
6,254 changes: 2,964 additions & 3,290 deletions package-lock.json

Large diffs are not rendered by default.

27 changes: 13 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,21 @@
"build": "set -eux; for pkg in ./yivi-css ./yivi-frontend; do (cd $pkg; npm run release); done"
},
"devDependencies": {
"eslint": "^7.21.0",
"eslint-config-prettier": "^8.1.0",
"eslint": "^8.50.0",
"eslint-config-prettier": "^9.0.0",
"eslint-config-prettier-standard": "^4.0.1",
"eslint-config-standard": "^16.0.2",
"eslint-plugin-compat": "^3.9.0",
"eslint-plugin-import": "^2.22.1",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-compat": "^4.2.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-promise": "^4.3.1",
"prettier": "2.2.1",
"prettier-config-standard": "^4.0.0",
"stylelint": "^13.12.0",
"stylelint-config-prettier": "^8.0.2",
"stylelint-config-recommended-scss": "^4.2.0",
"stylelint-prettier": "^1.2.0",
"stylelint-scss": "^3.19.0"
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-promise": "^6.1.1",
"prettier": "3.0.3",
"prettier-config-standard": "^7.0.0",
"stylelint": "^15.10.3",
"stylelint-config-recommended-scss": "^13.0.0",
"stylelint-prettier": "^4.0.2",
"stylelint-scss": "^5.2.1"
},
"repository": {
"type": "git",
Expand Down
10 changes: 5 additions & 5 deletions plugins/yivi-client/session-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ module.exports = class YiviSessionClient {
this._onCancel(mappings);
return false;
}
})
}),
)
.catch((error) =>
this._stateMachine.selectTransition(({ validTransitions }) => {
if (this._options.debugging) console.error('Error starting a new session on the server:', error);
if (validTransitions.includes('fail')) return { transition: 'fail', payload: error };
throw error;
})
}),
);
}
}
Expand All @@ -64,15 +64,15 @@ module.exports = class YiviSessionClient {
.result()
.then((result) =>
this._stateMachine.selectTransition(({ validTransitions }) =>
validTransitions.includes('succeed') ? { transition: 'succeed', payload: result } : false
)
validTransitions.includes('succeed') ? { transition: 'succeed', payload: result } : false,
),
)
.catch((error) =>
this._stateMachine.selectTransition(({ validTransitions }) => {
if (this._options.debugging) console.error('Error getting result from the server:', error);
if (validTransitions.includes('fail')) return { transition: 'fail', payload: error };
throw error;
})
}),
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/yivi-client/session-management.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = class SessionManagement {
.then((r) => {
if (r.status !== 200)
throw new Error(
`Error in fetch: endpoint returned status other than 200 OK. Status: ${r.status} ${r.statusText}`
`Error in fetch: endpoint returned status other than 200 OK. Status: ${r.status} ${r.statusText}`,
);
return r;
})
Expand Down Expand Up @@ -63,7 +63,7 @@ module.exports = class SessionManagement {
.then((r) => {
if (r.status !== 200)
throw new Error(
`Error in fetch: endpoint returned status other than 200 OK. Status: ${r.status} ${r.statusText}`
`Error in fetch: endpoint returned status other than 200 OK. Status: ${r.status} ${r.statusText}`,
);
return r;
})
Expand Down
24 changes: 11 additions & 13 deletions plugins/yivi-client/state-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,9 @@ module.exports = class YiviStateClient {
setTimeout(
() =>
this._stateMachine.selectTransition(({ validTransitions }) =>
validTransitions.includes('pairingRejected')
? { transition: 'pairingRejected', payload: payload }
: false
validTransitions.includes('pairingRejected') ? { transition: 'pairingRejected', payload } : false,
),
this._options.state.pairing.minCheckingDelay
this._options.state.pairing.minCheckingDelay,
);
}
break;
Expand Down Expand Up @@ -78,7 +76,7 @@ module.exports = class YiviStateClient {
try {
this._statusListener.observe(
(s) => this._serverStateChange(s),
(e) => this._serverHandleError(e)
(e) => this._serverHandleError(e),
);
} catch (error) {
if (this._options.debugging) console.error('Observing server state could not be started: ', error);
Expand Down Expand Up @@ -160,25 +158,25 @@ module.exports = class YiviStateClient {
return this._noSuccessTransition(
validTransitions,
'fail',
new Error('Unknown state received from server')
new Error('Unknown state received from server'),
);
}
return false;
})
}),
);
}

_handleNoSuccess(transition, payload) {
return this._stateMachine.selectTransition(({ validTransitions }) =>
this._noSuccessTransition(validTransitions, transition, payload)
this._noSuccessTransition(validTransitions, transition, payload),
);
}

_noSuccessTransition(validTransitions, transition, payload) {
if (validTransitions.includes(transition)) {
return {
transition: transition,
payload: payload,
transition,
payload,
isFinal: !this._canRestart,
};
}
Expand Down Expand Up @@ -232,7 +230,7 @@ module.exports = class YiviStateClient {
}
: false;
}
})
}),
)
.catch((err) => {
if (this._options.debugging) console.error('Error received while updating pairing state:', err);
Expand All @@ -254,8 +252,8 @@ module.exports = class YiviStateClient {
.finally(() => delay)
.then(() =>
this._stateMachine.selectTransition(({ validTransitions }) =>
validTransitions.includes('appConnected') ? { transition: 'appConnected' } : false
)
validTransitions.includes('appConnected') ? { transition: 'appConnected' } : false,
),
)
.catch((err) => {
if (this._options.debugging) console.error('Error received while completing pairing:', err);
Expand Down
4 changes: 2 additions & 2 deletions plugins/yivi-client/status-listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module.exports = class StatusListener {
_getFetchUrl(endpoint) {
return ProtocolVersion.below(
this._mappings.frontendRequest.maxProtocolVersion,
ProtocolVersion.get('chained-sessions')
ProtocolVersion.get('chained-sessions'),
)
? this._options.legacyUrl(this._mappings, endpoint)
: this._options.url(this._mappings, endpoint);
Expand Down Expand Up @@ -130,7 +130,7 @@ module.exports = class StatusListener {
.then((r) => {
if (r.status !== 200)
throw new Error(
`Error in fetch: endpoint returned status other than 200 OK. Status: ${r.status} ${r.statusText}`
`Error in fetch: endpoint returned status other than 200 OK. Status: ${r.status} ${r.statusText}`,
);
return r;
})
Expand Down
2 changes: 1 addition & 1 deletion plugins/yivi-console/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ module.exports = yiviConsole(
const input = prompt(`⌨️ ${message} Do you want to try again? [Yn]`);
return ['y', 'Y', ''].indexOf(input) >= 0;
},
() => prompt('Please enter the pairing code that your Yivi app currently shows: ')
() => prompt('Please enter the pairing code that your Yivi app currently shows: '),
);
2 changes: 1 addition & 1 deletion plugins/yivi-console/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ const yiviConsole = require('./yivi-console');

module.exports = yiviConsole(
(message) => window.confirm(`${message} Do you want to try again?`),
() => window.prompt('Please enter the pairing code that your Yivi app currently shows:')
() => window.prompt('Please enter the pairing code that your Yivi app currently shows:'),
);
2 changes: 1 addition & 1 deletion plugins/yivi-console/yivi-console.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ module.exports = (askRetry, askPairingCode) => {
}

_renderQRcode(payload) {
qrcode.generate(payload.qr);
qrcode.generate(payload.qr, { small: true });
}
};
};
4 changes: 2 additions & 2 deletions plugins/yivi-dummy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = class YiviDummy {
this._doTransition('showQRCode', {
qr: JSON.stringify(this._options.qrPayload),
}),
this._options.timing.prepare
this._options.timing.prepare,
);
break;
case 'PreparingYiviButton':
Expand All @@ -36,7 +36,7 @@ module.exports = class YiviDummy {
this._doTransition('showYiviButton', {
mobile: JSON.stringify(this._options.qrPayload),
}),
this._options.timing.prepare
this._options.timing.prepare,
);
break;
case 'ShowingQRCode':
Expand Down
2 changes: 1 addition & 1 deletion plugins/yivi-popup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = class YiviPopup {
this._popupClosedEarly();
}
return false;
})
}),
);

this._yiviWeb = new YiviWeb({
Expand Down
6 changes: 3 additions & 3 deletions plugins/yivi-web/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ module.exports = class YiviWeb {
this._options,
(t) =>
this._stateMachine.selectTransition(({ validTransitions }) =>
validTransitions.includes(t) ? { transition: t, payload: this._lastPayload } : false
validTransitions.includes(t) ? { transition: t, payload: this._lastPayload } : false,
),
(enteredPairingCode) =>
this._stateMachine.selectTransition(({ validTransitions }) =>
validTransitions.includes('codeEntered')
? { transition: 'codeEntered', payload: { enteredPairingCode } }
: false
)
: false,
),
);

this._addVisibilityListener();
Expand Down
4 changes: 2 additions & 2 deletions yivi-core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = class YiviCore {
new mod({
stateMachine: this._stateMachine,
options: this._options,
})
}),
);
}

Expand Down Expand Up @@ -76,7 +76,7 @@ module.exports = class YiviCore {
(returnValues) => {
const hasValues = returnValues.some((v) => v !== undefined);
return hasValues ? [coreReturnValue, ...returnValues] : coreReturnValue;
}
},
);
}
};
14 changes: 7 additions & 7 deletions yivi-core/state-machine.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = class StateMachine {
*/
transition(transition, payload) {
console.warn(
"The 'transition' function of the yivi-core state machine is deprecated. Please use 'selectTransition'."
"The 'transition' function of the yivi-core state machine is deprecated. Please use 'selectTransition'.",
);
return this.selectTransition(() => ({ transition, payload }));
}
Expand All @@ -38,7 +38,7 @@ module.exports = class StateMachine {
*/
finalTransition(transition, payload) {
console.warn(
"The 'finalTransition' function of the yivi-core state machine is deprecated. Please use 'selectTransition'."
"The 'finalTransition' function of the yivi-core state machine is deprecated. Please use 'selectTransition'.",
);
return this.selectTransition(() => ({
transition,
Expand Down Expand Up @@ -106,11 +106,11 @@ module.exports = class StateMachine {
this._listeners.forEach((func) =>
func({
newState: this._state,
oldState: oldState,
transition: transition,
oldState,
transition,
isFinal: this._inEndState,
payload: payload,
})
payload,
}),
);
}

Expand All @@ -121,7 +121,7 @@ module.exports = class StateMachine {
if (isDisabled) throw new Error(`Transition '${transition}' is currently disabled in state '${this._state}'.`);
if (isFinal && !transitions.endStates.includes(newState))
throw new Error(
`Transition '${transition}' from state '${this._state}' is marked as final, but resulting state ${newState} cannot be an end state.`
`Transition '${transition}' from state '${this._state}' is marked as final, but resulting state ${newState} cannot be an end state.`,
);
return newState;
}
Expand Down
6 changes: 3 additions & 3 deletions yivi-css/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions yivi-css/src/animations/checkmark.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Checkmark
//
// A checkmark to indicate success
//
// Markup:
// <div class="yivi-web-checkmark-animation"></div>
//
// Styleguide Animations.Checkmark

/* Checkmark
*
* A checkmark to indicate success
*
* Markup:
* <div class="yivi-web-checkmark-animation"></div>
*
* Styleguide Animations.Checkmark
*/
@import '../mixins/reset', '../mixins/animation', '../variables/colours';

.yivi-web-checkmark-animation {
Expand Down
21 changes: 11 additions & 10 deletions yivi-css/src/animations/clock.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// Clock
//
// A clock to show timeouts
//
// Markup:
// <div class="yivi-web-clock-animation"></div>
//
// Styleguide Animations.Clock

@use "sass:math";
/* Clock
*
* A clock to show timeouts
*
* Markup:
* <div class="yivi-web-clock-animation"></div>
*
* Styleguide Animations.Clock
*/

@use 'sass:math';

@import '../mixins/reset', '../mixins/animation', '../variables/colours';

Expand Down
Loading

0 comments on commit c4f5224

Please sign in to comment.