Skip to content

Commit c1e1ae1

Browse files
Use async functions everywhere and ES6 arrow functions
1 parent dfed1f6 commit c1e1ae1

File tree

9 files changed

+1793
-82
lines changed

9 files changed

+1793
-82
lines changed

index.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
const joi = require('joi')
66

7-
module.exports = (config) => {
7+
module.exports = (config) => {
88
const schema = joi.object().keys({
99
AUTH0_URL: joi.string().uri().trim().required(),
1010
AUTH0_AUDIENCE: joi.string().uri().trim().required(),
@@ -25,84 +25,84 @@ module.exports = (config) => {
2525
// Export functions
2626
return {
2727
// Event API functions
28-
postEvent: (reqBody) => {
28+
postEvent: async (reqBody) => {
2929
return require('./src/EventsApi').postEvent(config, reqBody)
3030
},
31-
postError: (reqBody) => {
31+
postError: async (reqBody) => {
3232
return require('./src/EventsApi').postError(config, reqBody)
3333
},
3434

3535
// Topics API functions
36-
getTopics: () => {
36+
getTopics: async () => {
3737
return require('./src/TopicsApi').getTopics(config)
3838
},
39-
headTopics: () => {
39+
headTopics: async () => {
4040
return require('./src/TopicsApi').headTopics(config)
4141
},
4242

4343
// Health checks API functions
44-
getHealth: () => {
44+
getHealth: async () => {
4545
return require('./src/HealthChecksApi').getHealth(config)
4646
},
47-
headHealth: () => {
47+
headHealth: async () => {
4848
return require('./src/HealthChecksApi').headHealth(config)
4949
},
5050

5151
// Placeholder API functions
52-
clearPlaceholdersCache: () => {
52+
clearPlaceholdersCache: async () => {
5353
return require('./src/PlaceholdersApi').clearPlaceholdersCache(config)
5454
},
5555

5656
// Service API functions
57-
getServices: () => {
57+
getServices: async () => {
5858
return require('./src/ServiceApi').getServices(config)
5959
},
60-
headServices: () => {
60+
headServices: async () => {
6161
return require('./src/ServiceApi').headServices(config)
6262
},
63-
createService: (reqBody) => {
63+
createService: async (reqBody) => {
6464
return require('./src/ServiceApi').createService(config, reqBody)
6565
},
66-
getService: (serviceName) => {
66+
getService: async (serviceName) => {
6767
return require('./src/ServiceApi').getService(config, serviceName)
6868
},
69-
headService: (serviceName) => {
69+
headService: async (serviceName) => {
7070
return require('./src/ServiceApi').headService(config, serviceName)
7171
},
72-
updateService: (serviceName, reqBody) => {
72+
updateService: async (serviceName, reqBody) => {
7373
return require('./src/ServiceApi').updateService(config, serviceName, reqBody)
7474
},
75-
patchService: (serviceName, reqBody) => {
75+
patchService: async (serviceName, reqBody) => {
7676
return require('./src/ServiceApi').patchService(config, serviceName, reqBody)
7777
},
78-
deleteService: (serviceName) => {
78+
deleteService: async (serviceName) => {
7979
return require('./src/ServiceApi').deleteService(config, serviceName)
8080
},
8181

82-
getServicePayloads: (serviceName) => {
82+
getServicePayloads: async (serviceName) => {
8383
return require('./src/ServiceApi').getServicePayloads(config, serviceName)
8484
},
85-
headServicePayloads: (serviceName) => {
85+
headServicePayloads: async (serviceName) => {
8686
return require('./src/ServiceApi').headServicePayloads(config, serviceName)
8787
},
88-
createServicePayload: (serviceName, reqBody) => {
88+
createServicePayload: async (serviceName, reqBody) => {
8989
return require('./src/ServiceApi').createServicePayload(config, serviceName, reqBody)
9090
},
91-
getServicePayload: (serviceName, payloadName) => {
91+
getServicePayload: async (serviceName, payloadName) => {
9292
return require('./src/ServiceApi').getServicePayload(config, serviceName, payloadName)
9393
},
94-
headServicePayload: (serviceName, payloadName) => {
94+
headServicePayload: async (serviceName, payloadName) => {
9595
return require('./src/ServiceApi').headServicePayload(config, serviceName, payloadName)
9696
},
97-
updateServicePayload: (serviceName, payloadName, reqBody) => {
97+
updateServicePayload: async (serviceName, payloadName, reqBody) => {
9898
return require('./src/ServiceApi').updateServicePayload(config, serviceName, payloadName, reqBody)
9999
},
100-
patchServicePayload: (serviceName, payloadName, reqBody) => {
100+
patchServicePayload: async (serviceName, payloadName, reqBody) => {
101101
return require('./src/ServiceApi').patchServicePayload(config, serviceName, payloadName, reqBody)
102102
},
103-
deleteServicePayload: (serviceName, payloadName) => {
103+
deleteServicePayload: async (serviceName, payloadName) => {
104104
return require('./src/ServiceApi').deleteServicePayload(config, serviceName, payloadName)
105105
}
106106

107-
}
108-
}
107+
}
108+
}

0 commit comments

Comments
 (0)