Skip to content

Commit

Permalink
feat: add support for Google Team drives
Browse files Browse the repository at this point in the history
Replicating code from google sheets and using API ref from https://developers.google.com/drive/api/reference/rest/v3/files/list
  • Loading branch information
Startouf committed May 11, 2024
1 parent da21aa8 commit 755e187
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/pieces/community/google-forms/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const googleForms = createPiece({
minimumSupportedRelease: '0.5.0',
logoUrl: 'https://cdn.activepieces.com/pieces/google-forms.png',
categories: [PieceCategory.FORMS_AND_SURVEYS],
authors: ["kishanprmr","MoShizzle","khaledmashaly","abuaboud"],
authors: ["kishanprmr","MoShizzle","khaledmashaly","abuaboud","Startouf"],
auth: googleFormsAuth,
actions: [
createCustomApiCallAction({
Expand Down
13 changes: 11 additions & 2 deletions packages/pieces/community/google-forms/src/lib/common/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,18 @@ import {
} from '@activepieces/pieces-common';

export const googleFormsCommon = {
include_team_drives: Property.Checkbox({
displayName: 'Include Team Drive Forms',
description:
'Determines if forms from Team Drives should be included in the results.',
defaultValue: false,
required: false,
}),
form_id: Property.Dropdown({
displayName: 'Form',
required: true,
refreshers: [],
options: async ({ auth }) => {
refreshers: ['include_team_drives'],
options: async ({ auth, include_team_drives }) => {
if (!auth) {
return {
disabled: true,
Expand All @@ -26,6 +33,8 @@ export const googleFormsCommon = {
url: `https://www.googleapis.com/drive/v3/files`,
queryParams: {
q: "mimeType='application/vnd.google-apps.form'",
includeItemsFromAllDrives: include_team_drives,
supportsAllDrives: 'true',
},
authentication: {
type: AuthenticationType.BEARER_TOKEN,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const newResponse = createTrigger({
description: 'Triggers when there is new response',
props: {
form_id: googleFormsCommon.form_id,
include_team_drives: googleFormsCommon.include_team_drives,
},
sampleData: {
responseId:
Expand Down

0 comments on commit 755e187

Please sign in to comment.