{"id":26140943,"url":"https://github.com/patrick204nqh/gas-integrations","last_synced_at":"2025-10-13T02:04:38.037Z","repository":{"id":276671056,"uuid":"929492525","full_name":"patrick204nqh/gas-integrations","owner":"patrick204nqh","description":"GAS Integrations is a Google Apps Script library written in TypeScript that provides high-level integrations for Google Sheets, Google Docs, and common utility functions","archived":false,"fork":false,"pushed_at":"2025-02-10T03:31:07.000Z","size":57,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-13T02:03:07.584Z","etag":null,"topics":["apps-script","gas","gas-library","google-apps-script"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patrick204nqh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-08T17:14:28.000Z","updated_at":"2025-02-10T03:31:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"3b997223-541e-45b8-8482-79fee3b4769b","html_url":"https://github.com/patrick204nqh/gas-integrations","commit_stats":null,"previous_names":["patrick204nqh/gas-integrations"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/patrick204nqh/gas-integrations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrick204nqh%2Fgas-integrations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrick204nqh%2Fgas-integrations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrick204nqh%2Fgas-integrations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrick204nqh%2Fgas-integrations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patrick204nqh","download_url":"https://codeload.github.com/patrick204nqh/gas-integrations/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrick204nqh%2Fgas-integrations/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014003,"owners_count":26085343,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apps-script","gas","gas-library","google-apps-script"],"created_at":"2025-03-11T02:58:32.789Z","updated_at":"2025-10-13T02:04:37.771Z","avatar_url":"https://github.com/patrick204nqh.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GAS Integrations\n\nGAS Integrations is a Google Apps Script library written in TypeScript that provides high-level integrations for Google Sheets, Google Docs, and common utility functions. Once deployed via clasp, it exposes a global object `GasIntegrations` which can be added as a library to your Apps Script projects.\n\n## Features Overview\n\n- **Easy Integration**: Provides seamless integration with Google Sheets and Google Docs.\n- **Script Property Support**: Avoids hardcoded values by using Script Properties.\n- **Logging Utilities**: Built-in logging functions for debugging.\n- **Modular \u0026 Scalable**: Designed for flexibility and reusability.\n- **Deploy via Clasp**: Easy deployment with Google Apps Script.\n\n\u003e **Note**: Currently, this library supports integrations for Google Sheets and Google Docs. However, it is designed to be extensible, allowing future integration with other Google Apps such as Gmail, Calendar, and Drive.\n\n## Setup\n\n### 1. Clone \u0026 Install Dependencies\n\n```bash\ngit clone https://github.com/patrick204nqh/gas-integrations.git\ncd gas-integrations\nyarn install\n```\n\n### 2. Build the Library\n\nBuild the project (using Rollup) to produce the deployable file:\n\n```bash\nyarn build\n```\n\n### 3. Deploy with Clasp\n\nMake sure you're logged in with clasp, then deploy:\n\n```bash\nyarn deploy\n```\n\n### 4. Add the Library to Your Apps Script Project\n\n- Open your Apps Script project.\n- Go to **Libraries**\n- Paste your library's key (from the deployed project) and select the latest version.\n- The library will be available under the global namespace `GasIntegrations`.\n\n---\n\n## Exported Functions\n\n### Sheets Integration\n\nProvides methods to work with Google Sheets.\n\n#### Creating a new Sheets Integration instance\n\nTo create a new Sheets integration, use the following:\n\n```js\nvar sheets = GasIntegrations.newSheetService(\"YOUR_SPREADSHEET_ID\");\n```\n\nThe table below outlines available functions for Sheets integration.\n\n| **Method**                                    | **Parameters**                                           | **Description**                                                      |\n| --------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------------------- |\n| `readData(sheetName, range)`                  | `sheetName: string`, `range: string`                     | Reads and returns a 2D array of values from the specified range.     |\n| `writeData(sheetName, range, values)`         | `sheetName: string`, `range: string`, `values: any[][]`  | Writes a 2D array of values to the specified range.                  |\n| `appendRow(sheetName, values)`                | `sheetName: string`, `values: any[]`                     | Appends a new row at the bottom of the sheet.                        |\n| `insertRow(sheetName, rowIndex, values)`      | `sheetName: string`, `rowIndex: number`, `values: any[]` | Inserts a new row at the given index and fills it with values.       |\n| `clearRange(sheetName, range)`                | `sheetName: string`, `range: string`                     | Clears the contents of the specified range.                          |\n| `updateCell(sheetName, cell, value)`          | `sheetName: string`, `cell: string`, `value: any`        | Updates a single cell with a new value.                              |\n| `setBackgroundColor(sheetName, range, color)` | `sheetName: string`, `range: string`, `color: string`    | Sets the background color for the specified range (e.g., \"#FF0000\"). |\n| `getLastRow(sheetName)`                       | `sheetName: string`                                      | Returns the last row number that contains content.                   |\n\n### Docs Integration\n\nProvides methods to work with Google Docs.\n\n#### Creating a new Docs Integration instance\n\nTo create a new Docs integration, use the following:\n\n```js\nvar docs = GasIntegrations.newDocService(\"YOUR_DOCUMENT_ID\");\n```\n\nThe table below outlines available functions for Docs integration.\n\n| **Method**                                | **Parameters**                                 | **Description**                                                 |\n| ----------------------------------------- | ---------------------------------------------- | --------------------------------------------------------------- |\n| `getBodyText()`                           | _none_                                         | Retrieves the complete text content from the document's body.   |\n| `appendText(text)`                        | `text: string`                                 | Appends a new paragraph of text to the document.                |\n| `replaceText(searchPattern, replacement)` | `searchPattern: string`, `replacement: string` | Replaces text in the document using the provided regex pattern. |\n\n### Logging Functions\n\n\u003cdetails\u003e\u003csummary\u003emore details\u003c/summary\u003e\n\n| **Function**        | **Description**                                     |\n| ------------------- | --------------------------------------------------- |\n| `logInfo(message)`  | Logs an informational message using `Logger.log()`. |\n| `logWarn(message)`  | Logs a warning message using `Logger.log()`.        |\n| `logError(message)` | Logs an error message using `Logger.log()`.         |\n\n## \u003c/details\u003e\n\n## Usage in Apps Script\n\nAfter adding the library to your project, you can access its exported functions.\n\n### Example: Sheets Integration\n\n```js\nfunction testSheets() {\n  var spreadsheetId = \"YOUR_SPREADSHEET_ID\"; // Replace with your spreadsheet ID.\n  var sheets = GasIntegrations.newSheetService(spreadsheetId);\n\n  // Read data from a range.\n  var data = sheets.readData(\"Sheet1\", \"A1:A10\");\n  Logger.log(data);\n\n  // Append a new row.\n  sheets.appendRow(\"Sheet1\", [\"New\", \"Row\", \"Data\"]);\n}\n```\n\n### Example: Docs Integration\n\n```js\nfunction testDocs() {\n  var documentId = \"YOUR_DOCUMENT_ID\"; // Replace with your document ID.\n  var docs = GasIntegrations.newDocService(documentId);\n\n  // Append text to the document.\n  docs.appendText(\"Added via GasIntegrations library.\");\n\n  // Log the document's body text.\n  Logger.log(docs.getBodyText());\n}\n```\n\n### Example: Logging Usage\n\n\u003cdetails\u003e\u003csummary\u003emore details\u003c/summary\u003e\n\n```js\nfunction testLogging() {\n  GasIntegrations.logInfo(\"This is an info log.\");\n  GasIntegrations.logWarn(\"This is a warning log.\");\n  GasIntegrations.logError(\"This is an error log.\");\n}\n```\n\n\u003c/details\u003e\n\n---\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrick204nqh%2Fgas-integrations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrick204nqh%2Fgas-integrations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrick204nqh%2Fgas-integrations/lists"}