From eb9780f2558ceadf2ba039502f6a171c156b8092 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 20 Jul 2025 03:02:23 +0000 Subject: [PATCH 1/6] Initial plan From 78784ca18b96c6051b166c4f33496a243b94f2e0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 20 Jul 2025 03:06:38 +0000 Subject: [PATCH 2/6] Initial exploration and planning for makesheet package Co-authored-by: dckc <150986+dckc@users.noreply.github.com> --- packages/discover-dl/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/discover-dl/package.json b/packages/discover-dl/package.json index 3e6bf38..2d46310 100644 --- a/packages/discover-dl/package.json +++ b/packages/discover-dl/package.json @@ -1,6 +1,5 @@ { "type": "module", - "devDependencies": {}, "dependencies": { "csv-parse": "^5.4.0", "jstoxml": "^3.2.7" From 1c60517bf926c8c14bb9ed7b5d56700d2b062b98 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 20 Jul 2025 03:09:44 +0000 Subject: [PATCH 3/6] Complete makesheet package implementation Co-authored-by: dckc <150986+dckc@users.noreply.github.com> --- packages/makesheet/.claspignore | 2 + packages/makesheet/README.md | 72 +++++++++++++++++++++++++++++ packages/makesheet/appsscript.json | 11 +++++ packages/makesheet/example-usage.mk | 46 ++++++++++++++++++ packages/makesheet/package.json | 19 ++++++++ packages/makesheet/sheetInfo.js | 20 ++++++++ 6 files changed, 170 insertions(+) create mode 100644 packages/makesheet/.claspignore create mode 100644 packages/makesheet/README.md create mode 100644 packages/makesheet/appsscript.json create mode 100644 packages/makesheet/example-usage.mk create mode 100644 packages/makesheet/package.json create mode 100644 packages/makesheet/sheetInfo.js diff --git a/packages/makesheet/.claspignore b/packages/makesheet/.claspignore new file mode 100644 index 0000000..66efddb --- /dev/null +++ b/packages/makesheet/.claspignore @@ -0,0 +1,2 @@ +.git/** +node_modules/** \ No newline at end of file diff --git a/packages/makesheet/README.md b/packages/makesheet/README.md new file mode 100644 index 0000000..a69174f --- /dev/null +++ b/packages/makesheet/README.md @@ -0,0 +1,72 @@ +# makesheet + +Google Sheets timestamp service for Make-based workflows. + +## Overview + +This package provides a Google Apps Script web app that returns the modification timestamp of a Google Sheet. This is useful for Make-based build systems that need to track when a sheet has been modified to trigger downstream processing. + +## Setup + +1. Install clasp globally if you haven't already: + ```bash + npm install -g @google/clasp + ``` + +2. Login to Google Apps Script: + ```bash + yarn login + ``` + +3. Create a new Google Apps Script project and note the script ID. + +4. Update `.clasp.json` with your script ID: + ```json + { + "scriptId": "your-script-id-here", + "rootDir": "." + } + ``` + +5. Push the code to Google Apps Script: + ```bash + yarn push + ``` + +6. Deploy as a web app and note the deployment ID: + ```bash + yarn deploy + ``` + +## Usage + +Once deployed, you can query the modification time of a Google Sheet using: + +```bash +curl -s "https://script.google.com/macros/s/YOUR_DEPLOYMENT_ID/exec?sheetId=YOUR_SHEET_ID" +``` + +This returns a JSON response: +```json +{ + "modifiedTime": "2023-12-01T15:30:45.123Z" +} +``` + +Or an error response: +```json +{ + "error": "sheetId parameter required" +} +``` + +## Integration with Make + +Use the provided `example-usage.mk` file as a reference for integrating with Make-based workflows. + +## Scripts + +- `yarn push` - Push code to Google Apps Script +- `yarn deploy` - Push and deploy as web app (requires DEPLOYMENT_ID env var) +- `yarn curl` - Test the deployed web app (requires DEPLOYMENT_ID and SHEET_ID env vars) +- `yarn login` - Login to Google Apps Script \ No newline at end of file diff --git a/packages/makesheet/appsscript.json b/packages/makesheet/appsscript.json new file mode 100644 index 0000000..22cedb1 --- /dev/null +++ b/packages/makesheet/appsscript.json @@ -0,0 +1,11 @@ +{ + "webapp": { + "access": "ANYONE_ANONYMOUS", + "executeAs": "USER_DEPLOYING" + }, + "timeZone": "America/Chicago", + "dependencies": { + }, + "exceptionLogging": "STACKDRIVER", + "runtimeVersion": "V8" +} \ No newline at end of file diff --git a/packages/makesheet/example-usage.mk b/packages/makesheet/example-usage.mk new file mode 100644 index 0000000..2137808 --- /dev/null +++ b/packages/makesheet/example-usage.mk @@ -0,0 +1,46 @@ +# Example usage of makesheet package in Makefile workflows +# +# Set these environment variables: +# DEPLOYMENT_ID = your Google Apps Script deployment ID +# SHEET_ID = the Google Sheet ID you want to track + +# Target file to store the sheet's timestamp +SHEET_TIMESTAMP_FILE = sheet.timestamp + +# URL for the deployed makesheet web app +SHEET_INFO_URL = https://script.google.com/macros/s/$(DEPLOYMENT_ID)/exec + +# Create a timestamp file based on the sheet's last modification time +$(SHEET_TIMESTAMP_FILE): + curl -s "$(SHEET_INFO_URL)?sheetId=$(SHEET_ID)" | \ + jq -r '.modifiedTime' | \ + xargs -I {} touch -d {} $@ + +# Example target that depends on the sheet timestamp +data-processing: $(SHEET_TIMESTAMP_FILE) + @echo "Processing data from sheet (last modified: $$(cat $(SHEET_TIMESTAMP_FILE)))" + # Your data processing commands here + +# Clean up timestamp file +clean: + rm -f $(SHEET_TIMESTAMP_FILE) + +# Check if sheet has been modified since last processing +check-sheet-status: $(SHEET_TIMESTAMP_FILE) + @if [ -f $(SHEET_TIMESTAMP_FILE) ]; then \ + echo "Sheet timestamp file exists: $$(ls -la $(SHEET_TIMESTAMP_FILE))"; \ + else \ + echo "Sheet timestamp file does not exist, will be created"; \ + fi + +# Alternative approach: always check and update if sheet is newer +update-if-newer: + @CURRENT_TIME=$$(curl -s "$(SHEET_INFO_URL)?sheetId=$(SHEET_ID)" | jq -r '.modifiedTime'); \ + if [ ! -f $(SHEET_TIMESTAMP_FILE) ] || [ "$$(date -r $(SHEET_TIMESTAMP_FILE) -u +%Y-%m-%dT%H:%M:%S.%3NZ)" != "$$CURRENT_TIME" ]; then \ + echo "Sheet has been modified, updating timestamp"; \ + echo "$$CURRENT_TIME" | xargs -I {} touch -d {} $(SHEET_TIMESTAMP_FILE); \ + else \ + echo "Sheet has not been modified since last check"; \ + fi + +.PHONY: data-processing clean check-sheet-status update-if-newer \ No newline at end of file diff --git a/packages/makesheet/package.json b/packages/makesheet/package.json new file mode 100644 index 0000000..20ae7ec --- /dev/null +++ b/packages/makesheet/package.json @@ -0,0 +1,19 @@ +{ + "name": "makesheet", + "version": "0.1.0", + "description": "Google Sheets timestamp service for Make-based workflows", + "main": "sheetInfo.js", + "author": "Dan Connolly", + "license": "MIT", + "scripts": { + "push": "clasp push", + "deploy": "clasp push; clasp deploy --deploymentId $DEPLOYMENT_ID", + "curl": "curl -L https://script.google.com/macros/s/$DEPLOYMENT_ID/exec?sheetId=$SHEET_ID", + "login": "clasp login" + }, + "devDependencies": { + "@google/clasp": "^2.3.0", + "@types/google-apps-script": "^1.0.17", + "typescript": "^4.0.5" + } +} \ No newline at end of file diff --git a/packages/makesheet/sheetInfo.js b/packages/makesheet/sheetInfo.js new file mode 100644 index 0000000..b8cbc99 --- /dev/null +++ b/packages/makesheet/sheetInfo.js @@ -0,0 +1,20 @@ +function doGet(e) { + const sheetId = e.parameter.sheetId; + if (!sheetId) { + return createJsonResponse({ error: "sheetId parameter required" }); + } + + try { + const file = DriveApp.getFileById(sheetId); + const modifiedTime = file.getLastUpdated().toISOString(); + return createJsonResponse({ modifiedTime }); + } catch (error) { + return createJsonResponse({ error: error.toString() }); + } +} + +function createJsonResponse(data) { + return ContentService + .createTextOutput(JSON.stringify(data)) + .setMimeType(ContentService.MimeType.JSON); +} \ No newline at end of file From b3bfb59277e910577bc0d1fc7c49420c8314d8cc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 20 Jul 2025 03:21:10 +0000 Subject: [PATCH 4/6] Add Airbnb style linting and test functions to makesheet package Co-authored-by: dckc <150986+dckc@users.noreply.github.com> --- package.json | 3 ++- packages/makesheet/.eslintrc.json | 37 ++++++++++++++++++++++++++++ packages/makesheet/README.md | 19 +++++++++++++- packages/makesheet/package.json | 4 ++- packages/makesheet/sheetInfo.js | 41 +++++++++++++++++++++++++------ 5 files changed, 93 insertions(+), 11 deletions(-) create mode 100644 packages/makesheet/.eslintrc.json diff --git a/package.json b/package.json index 286cddb..57570f1 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "packages/br-cal", "packages/br-script", "packages/discover-dl", - "packages/lm-sync" + "packages/lm-sync", + "packages/makesheet" ], "devDependencies": { "@endo/eslint-plugin": "^0.5.1", diff --git a/packages/makesheet/.eslintrc.json b/packages/makesheet/.eslintrc.json new file mode 100644 index 0000000..ea52165 --- /dev/null +++ b/packages/makesheet/.eslintrc.json @@ -0,0 +1,37 @@ +{ + "extends": [ + "airbnb-base" + ], + "env": { + "es6": true + }, + "rules": { + "quotes": [ + "error", + "single", + { + "avoidEscape": true, + "allowTemplateLiterals": true + } + ], + "comma-dangle": ["error", "always-multiline"], + "no-console": "off", + "no-unused-vars": [ + "error", + { + "argsIgnorePattern": "^_", + "varsIgnorePattern": "^_" + } + ], + "no-undef": "off", + "no-underscore-dangle": [ + "error", + { + "allowAfterThis": false, + "allowAfterSuper": false, + "enforceInMethodNames": false, + "allow": ["_testDoGet", "_testCreateJsonResponse"] + } + ] + } +} \ No newline at end of file diff --git a/packages/makesheet/README.md b/packages/makesheet/README.md index a69174f..a5b9455 100644 --- a/packages/makesheet/README.md +++ b/packages/makesheet/README.md @@ -69,4 +69,21 @@ Use the provided `example-usage.mk` file as a reference for integrating with Mak - `yarn push` - Push code to Google Apps Script - `yarn deploy` - Push and deploy as web app (requires DEPLOYMENT_ID env var) - `yarn curl` - Test the deployed web app (requires DEPLOYMENT_ID and SHEET_ID env vars) -- `yarn login` - Login to Google Apps Script \ No newline at end of file +- `yarn login` - Login to Google Apps Script +- `yarn lint` - Run ESLint to check code style (Airbnb style) +- `yarn lint-fix` - Run ESLint and automatically fix issues + +## Testing + +The code includes test functions that can be used with the Google Apps Script debugger: + +- `_testDoGet()` - Tests the main `doGet` function with various input scenarios +- `_testCreateJsonResponse()` - Tests the JSON response creation function + +To run tests in the Google Apps Script editor: +1. Open your script in the Google Apps Script editor +2. Select one of the test functions from the function dropdown +3. Click the run button to execute the test +4. View the output in the console + +This approach follows the pattern suggested for testing Google Apps Script functions without requiring external test frameworks. \ No newline at end of file diff --git a/packages/makesheet/package.json b/packages/makesheet/package.json index 20ae7ec..7eb88de 100644 --- a/packages/makesheet/package.json +++ b/packages/makesheet/package.json @@ -9,7 +9,9 @@ "push": "clasp push", "deploy": "clasp push; clasp deploy --deploymentId $DEPLOYMENT_ID", "curl": "curl -L https://script.google.com/macros/s/$DEPLOYMENT_ID/exec?sheetId=$SHEET_ID", - "login": "clasp login" + "login": "clasp login", + "lint": "eslint *.js", + "lint-fix": "eslint --fix *.js" }, "devDependencies": { "@google/clasp": "^2.3.0", diff --git a/packages/makesheet/sheetInfo.js b/packages/makesheet/sheetInfo.js index b8cbc99..5b76b12 100644 --- a/packages/makesheet/sheetInfo.js +++ b/packages/makesheet/sheetInfo.js @@ -1,9 +1,15 @@ +function createJsonResponse(data) { + return ContentService.createTextOutput(JSON.stringify(data)).setMimeType( + ContentService.MimeType.JSON, + ); +} + function doGet(e) { - const sheetId = e.parameter.sheetId; + const { sheetId } = e.parameter; if (!sheetId) { - return createJsonResponse({ error: "sheetId parameter required" }); + return createJsonResponse({ error: 'sheetId parameter required' }); } - + try { const file = DriveApp.getFileById(sheetId); const modifiedTime = file.getLastUpdated().toISOString(); @@ -13,8 +19,27 @@ function doGet(e) { } } -function createJsonResponse(data) { - return ContentService - .createTextOutput(JSON.stringify(data)) - .setMimeType(ContentService.MimeType.JSON); -} \ No newline at end of file +// Test functions for use with Google Apps Script debugger +function _testDoGet() { + console.log('Testing doGet with missing sheetId...'); + const resultMissing = doGet({ parameter: {} }); + console.log('Result:', resultMissing.getContent()); + + console.log('Testing doGet with invalid sheetId...'); + const resultInvalid = doGet({ parameter: { sheetId: 'invalid-id' } }); + console.log('Result:', resultInvalid.getContent()); + + // Note: To test with a valid sheet ID, replace 'your-test-sheet-id' + // with an actual Google Sheets ID you have access to + console.log('Testing doGet with valid sheetId (uncomment to test)...'); + // const resultValid = doGet({ parameter: { sheetId: 'your-test-sheet-id' } }); + // console.log('Result:', resultValid.getContent()); +} + +function _testCreateJsonResponse() { + console.log('Testing createJsonResponse...'); + const testData = { test: 'value', timestamp: new Date().toISOString() }; + const response = createJsonResponse(testData); + console.log('Response content:', response.getContent()); + console.log('Response MIME type:', response.getMimeType()); +} From ee3ee2e74095ecf4827e3a959e37661f0ea962f5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 20 Jul 2025 03:40:16 +0000 Subject: [PATCH 5/6] Address PR feedback: fix newlines, remove main field, add JSDoc, implement OCap pattern, add CONTRIBUTING.md, improve README docs Co-authored-by: dckc <150986+dckc@users.noreply.github.com> --- packages/discover-dl/package.json | 1 + packages/makesheet/.claspignore | 2 +- packages/makesheet/.gitignore | 1 + packages/makesheet/CONTRIBUTING.md | 49 +++++++++++++++++++++++++++++ packages/makesheet/README.md | 10 +++--- packages/makesheet/example-usage.mk | 2 +- packages/makesheet/package.json | 12 ++++--- packages/makesheet/sheetInfo.js | 36 +++++++++++++++++++-- 8 files changed, 100 insertions(+), 13 deletions(-) create mode 100644 packages/makesheet/.gitignore create mode 100644 packages/makesheet/CONTRIBUTING.md diff --git a/packages/discover-dl/package.json b/packages/discover-dl/package.json index 2d46310..3e6bf38 100644 --- a/packages/discover-dl/package.json +++ b/packages/discover-dl/package.json @@ -1,5 +1,6 @@ { "type": "module", + "devDependencies": {}, "dependencies": { "csv-parse": "^5.4.0", "jstoxml": "^3.2.7" diff --git a/packages/makesheet/.claspignore b/packages/makesheet/.claspignore index 66efddb..c1278dd 100644 --- a/packages/makesheet/.claspignore +++ b/packages/makesheet/.claspignore @@ -1,2 +1,2 @@ .git/** -node_modules/** \ No newline at end of file +node_modules/** diff --git a/packages/makesheet/.gitignore b/packages/makesheet/.gitignore new file mode 100644 index 0000000..d8b83df --- /dev/null +++ b/packages/makesheet/.gitignore @@ -0,0 +1 @@ +package-lock.json diff --git a/packages/makesheet/CONTRIBUTING.md b/packages/makesheet/CONTRIBUTING.md new file mode 100644 index 0000000..031b354 --- /dev/null +++ b/packages/makesheet/CONTRIBUTING.md @@ -0,0 +1,49 @@ +# Contributing to makesheet + +## Code Style + +This project follows Airbnb JavaScript style guidelines. Use ESLint to check and fix code style: + +```bash +yarn lint +yarn lint-fix +``` + +## Object Capability (OCap) Discipline + +This project follows object-capability discipline to enable secure composition and testing. This means avoiding ambient authority where possible. + +### Ambient Authority Pattern + +When functions need to access global APIs (like `DriveApp.getFileById`), use dependency injection to allow callers to provide these capabilities: + +```js +function doGet(e, io = {}) { + const { + getFileById = DriveApp.getFileById, + } = io; + // ... use getFileById instead of DriveApp.getFileById directly +} +``` + +This pattern provides several benefits: + +1. **Testability**: Callers can inject mock implementations for testing +2. **Attenuation**: Callers can provide restricted versions of capabilities +3. **Composability**: Functions become more modular and reusable +4. **Security**: Reduces ambient authority and enables principle of least privilege + +### References + +For more details on object-capability discipline, see the [Agoric OCap Discipline wiki](https://github.com/Agoric/agoric-sdk/wiki/OCap-Discipline). + +## Testing + +Since this is Google Apps Script code, we use test functions that can be executed in the Google Apps Script debugger: + +1. Create test functions prefixed with underscore (e.g., `_testDoGet`) +2. Use `console.log` to output test results +3. Run tests by selecting the test function in the GAS editor and clicking run +4. View results in the console output + +This approach allows testing without external frameworks while maintaining the ability to test core functionality. \ No newline at end of file diff --git a/packages/makesheet/README.md b/packages/makesheet/README.md index a5b9455..23da340 100644 --- a/packages/makesheet/README.md +++ b/packages/makesheet/README.md @@ -8,7 +8,7 @@ This package provides a Google Apps Script web app that returns the modification ## Setup -1. Install clasp globally if you haven't already: +1. Install clasp globally (required for deployment, though you could add it as a devDependency if preferred): ```bash npm install -g @google/clasp ``` @@ -18,7 +18,8 @@ This package provides a Google Apps Script web app that returns the modification yarn login ``` -3. Create a new Google Apps Script project and note the script ID. +3. Create a new Google Apps Script project and note the script ID. + [See the Google Apps Script documentation](https://developers.google.com/apps-script/guides/projects) for detailed instructions on creating projects. 4. Update `.clasp.json` with your script ID: ```json @@ -37,6 +38,7 @@ This package provides a Google Apps Script web app that returns the modification ```bash yarn deploy ``` + [See the clasp deployment documentation](https://developers.google.com/apps-script/guides/clasp#deployments) for more details on deployment options and web app configuration. ## Usage @@ -66,8 +68,8 @@ Use the provided `example-usage.mk` file as a reference for integrating with Mak ## Scripts -- `yarn push` - Push code to Google Apps Script -- `yarn deploy` - Push and deploy as web app (requires DEPLOYMENT_ID env var) +- `yarn push` - Push code to Google Apps Script (uploads your local files to the remote project) +- `yarn deploy` - Push and deploy as web app (requires DEPLOYMENT_ID env var) (creates a new web app version that can be accessed via URL) - `yarn curl` - Test the deployed web app (requires DEPLOYMENT_ID and SHEET_ID env vars) - `yarn login` - Login to Google Apps Script - `yarn lint` - Run ESLint to check code style (Airbnb style) diff --git a/packages/makesheet/example-usage.mk b/packages/makesheet/example-usage.mk index 2137808..dd34374 100644 --- a/packages/makesheet/example-usage.mk +++ b/packages/makesheet/example-usage.mk @@ -43,4 +43,4 @@ update-if-newer: echo "Sheet has not been modified since last check"; \ fi -.PHONY: data-processing clean check-sheet-status update-if-newer \ No newline at end of file +.PHONY: data-processing clean check-sheet-status update-if-newer diff --git a/packages/makesheet/package.json b/packages/makesheet/package.json index 7eb88de..e8539c8 100644 --- a/packages/makesheet/package.json +++ b/packages/makesheet/package.json @@ -2,20 +2,22 @@ "name": "makesheet", "version": "0.1.0", "description": "Google Sheets timestamp service for Make-based workflows", - "main": "sheetInfo.js", - "author": "Dan Connolly", + "author": "Dan Connolly (with GitHub Copilot)", "license": "MIT", "scripts": { "push": "clasp push", "deploy": "clasp push; clasp deploy --deploymentId $DEPLOYMENT_ID", "curl": "curl -L https://script.google.com/macros/s/$DEPLOYMENT_ID/exec?sheetId=$SHEET_ID", "login": "clasp login", - "lint": "eslint *.js", - "lint-fix": "eslint --fix *.js" + "lint": "eslint --config .eslintrc.json --no-eslintrc *.js", + "lint-fix": "eslint --config .eslintrc.json --no-eslintrc --fix *.js" }, "devDependencies": { "@google/clasp": "^2.3.0", "@types/google-apps-script": "^1.0.17", - "typescript": "^4.0.5" + "typescript": "^4.0.5", + "eslint": "^7.32.0", + "eslint-config-airbnb-base": "^14.2.1", + "eslint-plugin-import": "^2.22.1" } } \ No newline at end of file diff --git a/packages/makesheet/sheetInfo.js b/packages/makesheet/sheetInfo.js index 5b76b12..4354aca 100644 --- a/packages/makesheet/sheetInfo.js +++ b/packages/makesheet/sheetInfo.js @@ -1,17 +1,33 @@ +/** + * Creates a JSON response for the web app + * @param {Object} data - The data to include in the JSON response + * @returns {GoogleAppsScript.Content.TextOutput} The JSON response + */ function createJsonResponse(data) { return ContentService.createTextOutput(JSON.stringify(data)).setMimeType( ContentService.MimeType.JSON, ); } -function doGet(e) { +/** + * Main web app handler that returns sheet modification timestamps + * @param {GoogleAppsScript.Events.DoGet} e - The GET request event + * @param {Object} io - Dependency injection object for testing + * @param {Function} io.getFileById - Function to get file by ID (defaults to DriveApp.getFileById) + * @returns {GoogleAppsScript.Content.TextOutput} JSON response with timestamp or error + */ +function doGet(e, io = {}) { + const { + getFileById = DriveApp.getFileById, + } = io; + const { sheetId } = e.parameter; if (!sheetId) { return createJsonResponse({ error: 'sheetId parameter required' }); } try { - const file = DriveApp.getFileById(sheetId); + const file = getFileById(sheetId); const modifiedTime = file.getLastUpdated().toISOString(); return createJsonResponse({ modifiedTime }); } catch (error) { @@ -20,6 +36,9 @@ function doGet(e) { } // Test functions for use with Google Apps Script debugger +/** + * Test function for doGet with various scenarios + */ function _testDoGet() { console.log('Testing doGet with missing sheetId...'); const resultMissing = doGet({ parameter: {} }); @@ -29,6 +48,16 @@ function _testDoGet() { const resultInvalid = doGet({ parameter: { sheetId: 'invalid-id' } }); console.log('Result:', resultInvalid.getContent()); + console.log('Testing doGet with mock getFileById...'); + const mockFile = { + getLastUpdated: () => new Date('2023-12-01T15:30:45.123Z'), + }; + const mockIo = { + getFileById: () => mockFile, + }; + const resultMock = doGet({ parameter: { sheetId: 'test-id' } }, mockIo); + console.log('Result:', resultMock.getContent()); + // Note: To test with a valid sheet ID, replace 'your-test-sheet-id' // with an actual Google Sheets ID you have access to console.log('Testing doGet with valid sheetId (uncomment to test)...'); @@ -36,6 +65,9 @@ function _testDoGet() { // console.log('Result:', resultValid.getContent()); } +/** + * Test function for createJsonResponse + */ function _testCreateJsonResponse() { console.log('Testing createJsonResponse...'); const testData = { test: 'value', timestamp: new Date().toISOString() }; From b20f0990d6de4f7b3ce957c0eb0f5881d4392bcc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 20 Jul 2025 21:27:59 +0000 Subject: [PATCH 6/6] Fix missing newlines in JSON files (package.json, appsscript.json, .eslintrc.json) Co-authored-by: dckc <150986+dckc@users.noreply.github.com> --- packages/makesheet/.eslintrc.json | 2 +- packages/makesheet/appsscript.json | 2 +- packages/makesheet/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/makesheet/.eslintrc.json b/packages/makesheet/.eslintrc.json index ea52165..cec9acb 100644 --- a/packages/makesheet/.eslintrc.json +++ b/packages/makesheet/.eslintrc.json @@ -34,4 +34,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/makesheet/appsscript.json b/packages/makesheet/appsscript.json index 22cedb1..b8a8e97 100644 --- a/packages/makesheet/appsscript.json +++ b/packages/makesheet/appsscript.json @@ -8,4 +8,4 @@ }, "exceptionLogging": "STACKDRIVER", "runtimeVersion": "V8" -} \ No newline at end of file +} diff --git a/packages/makesheet/package.json b/packages/makesheet/package.json index e8539c8..e1add2b 100644 --- a/packages/makesheet/package.json +++ b/packages/makesheet/package.json @@ -20,4 +20,4 @@ "eslint-config-airbnb-base": "^14.2.1", "eslint-plugin-import": "^2.22.1" } -} \ No newline at end of file +}