stateDiagram-v2
[*] --> OrderDataPackage: click
OrderDataPackage --> OrderError
OrderDataPackage --> OrderSuccess
OrderError --> [*]
OrderSuccess --> PollDelay
PollDelay --> DataExportStatus
import * as winston from "winston"; | |
import path from "path"; | |
import DailyRotateFile from "winston-daily-rotate-file"; | |
const { json, timestamp, combine } = winston.format; | |
const { Console } = winston.transports; | |
export default function CreateLogger(appName: string, nodeEnv: string, logFolder: string): winston.Logger { | |
const dailyRotateFile: DailyRotateFile = new DailyRotateFile({ | |
filename: path.join(logFolder, `ui-${appName}-%DATE%.log`), | |
datePattern: "YYYY-MM-DD-HH", |
module.exports = { | |
"env": { | |
"es2021": true, | |
"node": true | |
}, | |
"extends": [ | |
"eslint:recommended", | |
], | |
"rules": { | |
"indent": [ |
export default function smoothScrollTop(): Promise<null> { | |
let lastScrollTop = Infinity; | |
return new Promise((resolve) => { | |
const smoothScrollTopImpl = () => { | |
const top = document.documentElement.scrollTop || document.body.scrollTop; | |
if (top > 0 && lastScrollTop > top) { | |
lastScrollTop = top; | |
window.requestAnimationFrame(smoothScrollTopImpl); | |
window.scrollTo(0, top - (top / 8)); | |
} else { |
import * as React from "react"; | |
import * as faker from "faker"; | |
function batch(count: number = 10): Faker.Card[] { | |
// return [faker.helpers.createCard()]; | |
return [ | |
faker.helpers.createCard(), | |
faker.helpers.createCard(), | |
faker.helpers.createCard(), |
const path = require('path'); | |
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | |
module.exports = function (env, argv) { | |
const isProduction = argv.mode === "production" | |
const plugins = []; | |
plugins.push( | |
new MiniCssExtractPlugin({ |
var urlParse = require('url-parse'); | |
var testurl = 'http://www.book.com//one/asdf//#123?a=12'; | |
var parsed = urlParse(testurl.replace(/([^:]\/)\/+/g, '$1'), {}); | |
parsed.set('protocol', 'https:'); |
The auth server is distinct from the key-cloak api gateway.
An express server's middleware will need access to some key-cloak services. These services would include the current bearer token and an async function fetchApiToken.
This could be implemented as middleware, including a middleware at the top of your stack could init this manager, including fetching the initial token. It would need to have some way to set the credentials that will be used to get the token from the auth server. It would provide the getToken and fetchApiToken functions on the req.app.locals[some-key] property. The key should be configurable, or maybe just over-rideable.
IDEA: instead of a getToken function we could be more like aws4.sign(options, credentials), as shown in got docs, where options is an object with headers and presumably headers.Authentication. The function mutates the headers object directly :(
Getting the intial key should be required for a successful ecv check.
process.on('uncaughtException', (e) => { | |
console.log('XXXX UNCAUGHT EXCEPTION XXXX'); | |
}); | |
process.on('unhandledRejection', (e) => { | |
console.log('XXXX UNHANDLED REJECTION XXXX'); | |
}); | |
const newError = (name = 'GenericError', message = 'error messaage') => { | |
const e = new Error(message); |