This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = (api, middleware, context) => ( | |
middleware.reverse() | |
.reduce( | |
(next, current) => executor(current, next, context), | |
(...args) => Promise.resolve(api.handler.apply(api.hostObject, args)) | |
) | |
) | |
const executor = (middleware, next, context) => ( | |
(...args) => ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"Id": "Dateline Standard Time", | |
"DisplayName": "(UTC-12:00) International Date Line West", | |
"StandardName": "Dateline Standard Time", | |
"DaylightName": "Dateline Daylight Time", | |
"BaseUtcOffset": "-12:00:00", | |
"AdjustmentRules": null, | |
"SupportsDaylightSavingTime": false | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Dateline Standard Time": "Etc/GMT+12", | |
"UTC-11": "Etc/GMT+11", | |
"Aleutian Standard Time": "America/Adak", | |
"Hawaiian Standard Time": "Pacific/Honolulu", | |
"Marquesas Standard Time": "Pacific/Marquesas", | |
"Alaskan Standard Time": "America/Anchorage", | |
"UTC-09": "Etc/GMT+9", | |
"Pacific Standard Time (Mexico)": "America/Tijuana", | |
"UTC-08": "Etc/GMT+8", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetch = require('node-fetch') | |
const querystring = require('querystring') | |
var data = querystring.stringify({ | |
"grant_type": "password", | |
// client_id and client_secret are from the System OAuth -> Application Registrations screen on the ServiceNow portal | |
"client_id": "", | |
"client_secret": "", | |
// username and password are valid user credentials for a user in the ServiceNow instance | |
"username": "", |