const isDemoMode = require('./isDemoMode')
const isAuthenticated = require('./isAuthenticated')
const createDate = require('./createDate')

const createServerlessContext = async (integrationContext) => {
	return createContext(integrationContext.event.headers, integrationContext.req)
}

const createMicroContext = async (integrationContext) => {
	return createContext(integrationContext.req.headers, integrationContext.req)
}

const createContext = async (req, headers) => {
	return {
		isDemoMode,
		isAuthenticated: await isAuthenticated(headers['authorization']),
		dateDetails: createDate(headers['time-zone']),
		headers,
		req
	}
}

module.exports = {
	createServerlessContext,
	createMicroContext
}
@@ -242,21 +242,11 @@
 ext.
-event.headers
+req
 , in
@@ -254,35 +254,45 @@
 egrationContext.
-req
+event.headers
 )%0A%7D%0A%0Aconst creat
@@ -383,24 +383,16 @@
 text.req
-.headers
 , integr
@@ -407,16 +407,24 @@
 text.req
+.headers
 )%0A%7D%0A%0Acon

Fix param order