function doGet() {
}
function getEmailAddress() {
}
function sendmail(email = '[email protected]') {
}(function(e, a) { for(var i in a) e[i] = a[i]; }(this, /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var _server_webapp__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
/* harmony import */ var _es6__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
/* harmony import */ var _email__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(14);
global.doGet = _server_webapp__WEBPACK_IMPORTED_MODULE_0__["default"];
global.getEmailAddress = _email__WEBPACK_IMPORTED_MODULE_2__["default"];
global.sendmail = (email = '[email protected]') => {
GmailApp.sendEmail(email, 'Apps Script Starter', 'Hello Google Apps Script');
}; // global.doGet = e => {
// const text = '<b>I love appsScript</b>';
// const output = HtmlService.createHtmlOutput(text);
// output.setTitle(text);
// output.addMetaTag('viewport', 'width=device-width, initial-scale=1');
// output.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL);
// return output;
// };
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(1)))
/***/ }),
/* 1 */
/***/ (function(module, exports) {
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || new Function("return this")();
} catch (e) {
// This works if the window reference is available
if (typeof window === "object") g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
/* 2 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
const doGet = () => {
const title = 'Google Apps Script';
const fileName = 'index.html';
return HtmlService.createHtmlOutputFromFile(fileName).setTitle(title).setXFrameOptionsMode(HtmlService.XFrameOptionsMode.DEFAULT);
};
/* harmony default export */ __webpack_exports__["default"] = (doGet);
/***/ }),
/* 3 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _arrow_functions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
/* harmony import */ var _arrow_functions__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_arrow_functions__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _block_scopes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
/* harmony import */ var _block_scopes__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_block_scopes__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _destructuring__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6);
/* harmony import */ var _es6_classes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
/* harmony import */ var _es6_classes__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_es6_classes__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _export_import__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8);
/* harmony import */ var _filter_map_reduce__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9);
/* harmony import */ var _filter_map_reduce__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_filter_map_reduce__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _let_const__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(10);
/* harmony import */ var _let_const__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_let_const__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _spread_rest_operators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(11);
/* harmony import */ var _spread_rest_operators__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_spread_rest_operators__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _template_literals__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(12);
/* harmony import */ var _template_literals__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_template_literals__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _optional_chaining__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(13);
/* harmony import */ var _optional_chaining__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_optional_chaining__WEBPACK_IMPORTED_MODULE_9__);
/***/ }),
/* 4 */
/***/ (function(module, exports) {
const add = (a, b) => a + b;
Logger.log(`The sum of 2 and 3 is ${add(2, 3)}`);
const max = (a, b) => {
if (a > b) return a;
return b;
};
Logger.log(`The bigger of 10 and 12 is ${max(10, 12)}`);
/* default arguments in functions */
const multiply = (value, factor = 2) => value * factor;
Logger.log(`2*10 = ${multiply(2, 10)}`);
Logger.log(`3*2 = ${multiply(3, 2)}`);
/***/ }),
/* 5 */
/***/ (function(module, exports) {
const name = 'Amit Agarwal';
let country = 'USA';
country = 'India';
Logger.log(`${name} lives in ${country}`);
/***/ }),
/* 6 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
const person = {
name: 'Amit Agarwal',
website: 'https://digitalinspiration.com/',
email: '[email protected]'
};
const {
name,
email,
country = 'unknown'
} = person;
Logger.log(`${name}'s email address is ${email}. Their country is ${country}`);
/* harmony default export */ __webpack_exports__["default"] = (person);
/***/ }),
/* 7 */
/***/ (function(module, exports) {
/* eslint-disable max-classes-per-file */
class Person {
constructor(name = 'Anonymous', gender = 'Unknown') {
this.name = name;
this.gender = gender;
}
printDetails() {
return `${this.name} is ${this.gender}`;
}
}
const person = new Person('Amit Agarwal', 'male');
Logger.log(person.printDetails());
class Employee extends Person {
constructor(name, gender, role) {
super(name, gender);
this.role = role;
}
printRole() {
return `${this.name} is ${this.role}`;
}
}
const employee = new Employee('Amit', 'male', 'Google Developer');
Logger.log(employee.printDetails());
Logger.log(employee.printRole());
/***/ }),
/* 8 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SCRIPT_TIMEOUT", function() { return SCRIPT_TIMEOUT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCurrentTime", function() { return getCurrentTime; });
/* harmony import */ var _destructuring__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
const SCRIPT_TIMEOUT = 1000 * 60 * 5;
const getCurrentTime = () => Date.now();
Logger.log(_destructuring__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/* 9 */
/***/ (function(module, exports) {
/* Array functions */
const numbers = [10, 20, 30];
/* Print the nubmers */
numbers.forEach(number => {
Logger.log(number);
});
/* Double the numbers */
const doubleIt = numbers.map(number => number * 2);
Logger.log(doubleIt);
/* Only numbers > 10 */
const bigNumbers = numbers.filter(number => number > 10);
Logger.log(bigNumbers);
/* Add the numbers */
const sum = numbers.reduce((accumulator, currentValue) => accumulator + currentValue, 0);
Logger.log(`The sum of ${numbers.join(', ')} is ${sum}`);
/* Remove duplicates with reduce */
const arr = [1, 2, 1, 2, 3, 5, 4, 5, 3, 4, 4, 4, 4];
const result = arr.sort().reduce((accumulator, current) => {
const {
length
} = accumulator;
if (length === 0 || accumulator[length - 1] !== current) {
accumulator.push(current);
}
return accumulator;
}, []);
Logger.log(result); // [1,2,3,4,5]
/***/ }),
/* 10 */
/***/ (function(module, exports) {
/* let and const */
const name = 'Amit Agarwal';
Logger.log(`The name is ${name}`);
for (let i = 0; i < 5; i += 1) {
Logger.log(`The count is ${i}`);
}
/***/ }),
/* 11 */
/***/ (function(module, exports) {
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
const animals = ['Monkey', 'Lion', 'Zebra'];
const birds = ['Sparrow', 'Pigeon', 'Parrot'];
const species = [...animals, ...birds];
Logger.log(species);
const person = {
name: 'Amit Agarwal',
email: '[email protected]'
};
const website = {
url: 'https://digitalinspiration.com/'
};
const personDetails = _objectSpread({}, person, {}, website, {
twitter: '@labnol'
});
Logger.log(personDetails);
/* Update the email address only */
const emailUpdated = _objectSpread({}, personDetails, {
email: '[email protected]'
});
Logger.log(emailUpdated);
const stack = ['Google Apps Script', 'JavaScript', 'Firebase', 'Node.js', 'Webpack', 'Babel'];
const [gas, js, ...others] = stack;
Logger.log(`${gas} is similar to ${js}`);
Logger.log(others);
const newPerson = {
name: 'Amit Agarwal',
email: '[email protected]',
website: 'https://digitalinspiration.com/'
};
const {
name,
age = 'unknown'
} = newPerson;
Logger.log(`${name} is ${age} years old`);
/***/ }),
/* 12 */
/***/ (function(module, exports) {
const name = 'Amit Agarwal';
Logger.log(`${name} has ${name.length} characters`);
Logger.log(`${name} in uppercase is ${name.toUpperCase()}`);
Logger.log(`The date is ${new Date().toUTCString()}`);
/***/ }),
/* 13 */
/***/ (function(module, exports) {
var _person$address, _person$address2;
const person = {
name: 'Amit Agarwal',
gender: 'Male',
address: {
country: 'India'
}
};
Logger.log((person === null || person === void 0 ? void 0 : person.gender) || 'Data not available'); // Access deeply nested properties
Logger.log((person === null || person === void 0 ? void 0 : (_person$address = person.address) === null || _person$address === void 0 ? void 0 : _person$address.country) || 'Unknown Location');
Logger.log(((_person$address2 = person.address) === null || _person$address2 === void 0 ? void 0 : _person$address2.country) || 'Unknown Location');
/***/ }),
/* 14 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// email.js
const getEmailAddress = () => {
const userEmail = Session.getActiveUser().getEmail();
const aliases = GmailApp.getAliases();
const emails = [userEmail, ...aliases];
Logger.log(`Your emails are: ${emails.join(', ')}`);
};
/* harmony default export */ __webpack_exports__["default"] = (getEmailAddress);
/***/ })
/******/ ])));
I tried it twice with the same result too.