Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
req,
res,
secure: USING_SSL,
});
const baseUrl = BASE_URL ? { baseUrl: BASE_URL } : {};
const sdk = sharetribeSdk.createInstance({
transitVerbose: TRANSIT_VERBOSE,
clientId: CLIENT_ID,
httpAgent: httpAgent,
httpsAgent: httpsAgent,
tokenStore,
typeHandlers: [
{
type: sharetribeSdk.types.BigDecimal,
customType: Decimal,
writer: v => new sharetribeSdk.types.BigDecimal(v.toString()),
reader: v => new Decimal(v.value),
},
],
...baseUrl,
});
// Until we have a better plan for caching dynamic content and we
// make sure that no sensitive data can appear in the prefetched
// data, let's disable response caching altogether.
res.set(noCacheHeaders);
dataLoader
.loadData(req.url, sdk)
.then(preloadedState => {
writer: v => new sharetribeSdk.types.BigDecimal(v.toString()),
reader: v => new Decimal(v.value),