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 localLogger = new LocalLogger(); | |
function onOpen(e) { | |
localLogger.init(); | |
} | |
function doPost(e) { | |
// Read JSON content from the request | |
const requestBody = JSON.parse(e.postData.contents); |
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 AUTHENTICATION_ENABLED_SETTING = 'Authentication Enabled'; | |
const AUTHENTICATION_TOKEN_SETTING = 'Authentication Token'; | |
/** | |
* Constants for boolean settings values. | |
*/ | |
const YES = 'Yes'; | |
const NO = 'No'; |
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
[ | |
{ | |
"teachername":"Alexandra", | |
"gender":"Female", | |
"homestate":"CA", | |
"major":"English" | |
}, | |
{ | |
"teachername":"Anna", | |
"gender":"Female", |
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
[ | |
{ | |
"teachername":"Alexandra", | |
"gender":"Female", | |
"homestate":"CA", | |
"major":"English" | |
}, | |
{ | |
"teachername":"Andrew", | |
"gender":"Male", |
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 notificationEmailAddress = "[email protected]"; | |
const showNewestMessageFirst = true; | |
const logger = new LocalLogger(notificationEmailAddress, showNewestMessageFirst); | |
function onOpen() { | |
logger.init(); | |
let ui = SpreadsheetApp.getUi(); | |
ui.createMenu('Logging') | |
.addItem("Generate Debug Message", 'generateDebugMessage') |
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
// Mimic an Enum for Severity Levels | |
const Severity = { | |
INFO: 'INFO', | |
WARNING: 'WARNING', | |
ERROR: 'ERROR', | |
DEBUG: 'DEBUG' | |
}; | |
/** | |
* Class representing a logger with functionality to log messages to a Google Spreadsheet. |
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
// Constants for settings labels | |
const SETTINGS_API_KEY_LABEL = 'Stripe API Key'; | |
const SETTINGS_SELECTED_PRODUCT_LABEL = 'Selected Product'; | |
const SETTINGS_DEFAULT_TRIAL_PERIOD_LABEL = 'Default Trial Period (Days)'; | |
const MAIN_SHEET_NAME = 'Subscription Data'; | |
const CURRENCY = 'EUR'; | |
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
/** | |
* Constants for boolean settings values. | |
*/ | |
const YES = 'Yes'; | |
const NO = 'No'; | |
/** | |
* The Settings class provides a way to manage script parameters/settings | |
* directly within a Google Sheet, making it accessible for non-technical users. | |
*/ |
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
/** | |
* Stripe API Client for handling various Stripe operations. | |
*/ | |
class StripeApiClient { | |
constructor(apiKey) { | |
this.apiKey = apiKey; | |
} | |
/** | |
* Private method to make requests to the Stripe API. |
NewerOlder