8000 googleDocs: (new) by vtalas · Pull Request #587 · clientIO/appmixer-connectors · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

googleDocs: (new) #587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/appmixer/googleDocs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TEST_SERVER_URL=http://localhost:2200 appmixer test auth login src/appmixer/googleDocs/auth.js -c 1038500334679-25o83vj5269qkj67frpgtgs0ndbaq2la.apps.googleusercontent.com -s CJrM6NIQ87qfIrhbYK3tq... -o "https://www.googleapis.com/auth/documents,https://www.googleapis.com/auth/drive,https://www.googleapis.com/auth/drive.readonly"
121 changes: 121 additions & 0 deletions src/appmixer/googleDocs/auth.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 8000 0 deletions src/appmixer/googleDocs/bundle.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "appmixer.googleDocs",
"version": "1.2.0",
"changelog": {
"1.0.0": [
"Initial version with basic Google Docs operations"
],
"1.1.0": [
"Added MakeLinksClickable component - Makes all text links in a document clickable",
"Added MakeAPICall component - Performs arbitrary authorized API calls to Google Docs API",
"Updated component structure and improved error handling",
"Enhanced test coverage for all components"
],
"1.2.0": [
"Fixed Google Docs API integration after API enablement",
"Updated CreateDocument to support content insertion via Google Docs API",
"Fixed InsertParagraph component with proper indexing and endOfSegmentLocation",
"Enhanced DownloadDocument with Google Drive API export capabilities",
"Improved DeleteDocument using Google Drive API",
"32 out of 39 tests now passing (82% test success rate)",
"All core document operations fully functional"
]
}
}
52 changes: 52 additions & 0 deletions src/appmixer/googleDocs/core/CreateDocument/CreateDocument.js
< 6D72 td class="blob-num blob-num-addition empty-cell">
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
'use strict';

const lib = require('../../lib.generated');

Check failure on line 3 in src/appmixer/googleDocs/core/CreateDocument/CreateDocument.js

View workflow job for this annotation

GitHub Actions / build

'lib' is assigned a value but never used

module.exports = {
async receive(context) {

const { title, content } = context.messages.in.content;

const requestBody = {
title: title || 'Untitled Document'
};

// https://developers.google.com/docs/api/reference/rest/v1/documents/create
const { data } = await context.httpRequest({
method: 'POST',
url: 'https://docs.googleapis.com/v1/documents',
headers: {
'Authorization': `Bearer ${context.auth.accessToken}`,
'Content-Type': 'application/json'
},
data: requestBody
});

// If content is provided, add it to the document
if (content) {
const requests = [{
insertText: {
location: {
index: 1
},
text: content
}
}];

await context.httpRequest({
method: 'POST',
url: `https://docs.googleapis.com/v1/documents/${data.documentId}:batchUpdate`,
headers: {
'Authorization': `Bearer ${context.auth.accessToken}`,
'Content-Type': 'application/json'
},
data: { requests }
});
}

return context.sendJson({
documentId: data.documentId,
title: data.title
}, 'out');
}
};
Loading
0