From 1217971884cd39a30d4526d837cdf227f1468130 Mon Sep 17 00:00:00 2001 From: Vinay Vyas <69166360+vinay-google@users.noreply.github.com> Date: Tue, 6 Sep 2022 12:09:23 -0700 Subject: [PATCH] chore: Format files (#206) * chore: Format files * Revert to using google styles for linting * Use single quotes * Fix inconsistent quote properties * Fix invalid or missing license headers check * Fix lint * Fix copyright --- adminSDK/directory/index.js | 3 +- adminSDK/reports/index.js | 7 +- adminSDK/reseller/index.js | 3 +- apps-script/execute/index.js | 7 +- apps-script/quickstart/index.js | 27 +- calendar/quickstart/index.js | 5 +- classroom/quickstart/index.js | 3 +- docs/quickstart/index.js | 3 +- drive/activity-v2/index.js | 10 +- drive/quickstart/index.js | 3 +- .../appdata_snippets/fetch_appdata_folder.js | 4 +- .../drive_v2/appdata_snippets/list_appdata.js | 5 +- .../appdata_snippets/upload_appdata.js | 16 +- .../drive_v2/change_snippets/fetch_changes.js | 5 +- .../change_snippets/fetch_start_page_token.js | 4 +- .../drive_v2/drive_snippets/create_drive.js | 8 +- .../drive_v2/drive_snippets/recover_drives.js | 12 +- .../drive_v2/file snippets/create_folder.js | 8 +- .../drive_v2/file snippets/create_shortcut.js | 9 +- .../drive_v2/file snippets/download_file.js | 6 +- .../drive_v2/file snippets/export_pdf.js | 4 +- .../file snippets/move_file_to_folder.js | 13 +- .../drive_v2/file snippets/search_file.js | 4 +- .../drive_v2/file snippets/share_file.js | 21 +- .../drive_v2/file snippets/touch_file.js | 8 +- .../drive_v2/file snippets/upload_basic.js | 6 +- .../file snippets/upload_to_folder.js | 8 +- .../file snippets/upload_with_conversion.js | 8 +- .../appdata_snippets/fetch_appdata_folder.js | 14 +- .../drive_v3/appdata_snippets/list_appdata.js | 15 +- .../appdata_snippets/upload_appdata.js | 16 +- .../drive_v3/change_snippets/fetch_changes.js | 4 +- .../change_snippets/fetch_start_page_token.js | 4 +- .../drive_v3/drive_snippets/create_drive.js | 8 +- .../drive_v3/drive_snippets/recover_drives.js | 10 +- .../drive_v3/file_snippets/create_folder.js | 8 +- .../drive_v3/file_snippets/create_shortcut.js | 8 +- .../drive_v3/file_snippets/download_file.js | 6 +- .../drive_v3/file_snippets/export_pdf.js | 4 +- .../file_snippets/move_file_to_folder.js | 12 +- .../drive_v3/file_snippets/search_file.js | 4 +- .../drive_v3/file_snippets/share_file.js | 19 +- .../drive_v3/file_snippets/touch_file.js | 8 +- .../drive_v3/file_snippets/upload_basic.js | 6 +- .../file_snippets/upload_to_folder.js | 8 +- .../file_snippets/upload_with_conversion.js | 9 +- drive/snippets/files/config.json | 2 +- drive/snippets/test/helpers.js | 44 +- .../test/test_drive_v2_create_drive.js | 4 +- .../test/test_drive_v2_create_folder.js | 4 +- .../test/test_drive_v2_create_shortcut.js | 4 +- .../test/test_drive_v2_download_file.js | 5 +- .../snippets/test/test_drive_v2_export_pdf.js | 5 +- .../test_drive_v2_fetch_appdata_folder.js | 4 +- .../test/test_drive_v2_fetch_changes.js | 4 +- .../test_drive_v2_fetch_start_page_token.js | 4 +- .../test/test_drive_v2_list_appdata.js | 4 +- .../test/test_drive_v2_move_file_to_folder.js | 4 +- .../test/test_drive_v2_recover_drives.js | 6 +- .../test/test_drive_v2_search_file.js | 4 +- .../snippets/test/test_drive_v2_share_file.js | 7 +- .../snippets/test/test_drive_v2_touch_file.js | 4 +- .../test/test_drive_v2_upload_appdata.js | 4 +- .../test/test_drive_v2_upload_basic.js | 4 +- .../test/test_drive_v2_upload_to_folder.js | 4 +- .../test_drive_v2_upload_with_conversion.js | 4 +- .../test/test_drive_v3_create_drive.js | 4 +- .../test/test_drive_v3_create_folder.js | 4 +- .../test/test_drive_v3_create_shortcut.js | 4 +- .../test/test_drive_v3_download_file.js | 5 +- .../snippets/test/test_drive_v3_export_pdf.js | 5 +- .../test_drive_v3_fetch_appdata_folder.js | 4 +- .../test/test_drive_v3_fetch_changes.js | 4 +- .../test_drive_v3_fetch_start_page_token.js | 4 +- .../test/test_drive_v3_list_appdata.js | 4 +- .../test/test_drive_v3_move_file_to_folder.js | 4 +- .../test/test_drive_v3_recover_drives.js | 6 +- .../test/test_drive_v3_search_file.js | 4 +- .../snippets/test/test_drive_v3_share_file.js | 7 +- .../snippets/test/test_drive_v3_touch_file.js | 4 +- .../test/test_drive_v3_upload_appdata.js | 4 +- .../test/test_drive_v3_upload_basic.js | 4 +- .../test/test_drive_v3_upload_to_folder.js | 4 +- .../test_drive_v3_upload_with_conversion.js | 4 +- forms/snippets/add_item.js | 34 +- forms/snippets/convert_form.js | 24 +- forms/snippets/create_form.js | 8 +- forms/snippets/create_watch.js | 10 +- forms/snippets/get_all_responses.js | 4 +- forms/snippets/get_single_response.js | 4 +- forms/snippets/package-lock.json | 1464 ++++++++--------- forms/snippets/package.json | 26 +- forms/snippets/update_form.js | 23 +- gmail/quickstart/index.js | 3 +- people/quickstart/index.js | 3 +- renovate.json | 4 +- sheets/quickstart/index.js | 3 +- sheets/snippets/package.json | 1 - sheets/snippets/sheets_append_values.js | 5 +- sheets/snippets/sheets_batch_get_values.js | 5 +- sheets/snippets/sheets_batch_update.js | 6 +- sheets/snippets/sheets_batch_update_values.js | 22 +- .../snippets/sheets_conditional_formatting.js | 58 +- sheets/snippets/sheets_create.js | 5 +- sheets/snippets/sheets_get_values.js | 5 +- sheets/snippets/sheets_pivot_table.js | 103 +- sheets/snippets/sheets_update_values.js | 5 +- sheets/snippets/test/helpers.js | 48 +- .../test/test_sheets_append_values.js | 17 +- .../test/test_sheets_batch_get_values.js | 9 +- .../snippets/test/test_sheets_batch_update.js | 12 +- .../test/test_sheets_batch_update_values.js | 14 +- .../test_sheets_conditional_formatting.js | 8 +- sheets/snippets/test/test_sheets_create.js | 4 +- .../snippets/test/test_sheets_get_values.js | 4 +- .../snippets/test/test_sheets_pivot_table.js | 4 +- .../test/test_sheets_update_values.js | 17 +- slides/quickstart/index.js | 7 +- slides/snippets/slides_copy_presentation.js | 5 +- .../snippets/slides_create_bulleted_text.js | 21 +- slides/snippets/slides_create_image.js | 46 +- slides/snippets/slides_create_presentation.js | 10 +- slides/snippets/slides_create_sheets_chart.js | 52 +- slides/snippets/slides_create_slide.js | 26 +- .../slides_create_textbox_with_text.js | 67 +- slides/snippets/slides_image_merging.js | 47 +- .../snippets/slides_refresh_sheets_chart.js | 19 +- slides/snippets/slides_simple_text_replace.js | 30 +- slides/snippets/slides_text_merging.js | 74 +- slides/snippets/slides_text_style_update.js | 99 +- slides/snippets/test/helpers.js | 149 +- .../test/test_slides_copy_presentation.js | 10 +- .../test/test_slides_create_bulleted_text.js | 9 +- .../snippets/test/test_slides_create_image.js | 10 +- .../test/test_slides_create_presentation.js | 11 +- .../test/test_slides_create_sheets_chart.js | 12 +- .../snippets/test/test_slides_create_slide.js | 10 +- .../test_slides_create_textbox_with_text.js | 8 +- .../test/test_slides_image_merging.js | 14 +- .../test/test_slides_refresh_sheets_chart.js | 17 +- .../test/test_slides_simple_text_replace.js | 11 +- .../snippets/test/test_slides_text_merging.js | 10 +- .../test/test_slides_text_style_update.js | 9 +- tasks/quickstart/index.js | 3 +- 144 files changed, 1780 insertions(+), 1555 deletions(-) diff --git a/adminSDK/directory/index.js b/adminSDK/directory/index.js index e6382455..f0f72f84 100644 --- a/adminSDK/directory/index.js +++ b/adminSDK/directory/index.js @@ -1,6 +1,5 @@ /** - * @license - * Copyright Google Inc. + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/adminSDK/reports/index.js b/adminSDK/reports/index.js index ab6469b9..2453c9ce 100644 --- a/adminSDK/reports/index.js +++ b/adminSDK/reports/index.js @@ -1,6 +1,5 @@ /** - * @license - * Copyright Google Inc. + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -103,7 +102,9 @@ async function listLoginEvents(auth) { console.log('Logins:'); activities.forEach((activity) => { - console.log(`${activity.id.time}: ${activity.actor.email} (${activity.events[0].name})`); + console.log( + `${activity.id.time}: ${activity.actor.email} (${activity.events[0].name})`, + ); }); } diff --git a/adminSDK/reseller/index.js b/adminSDK/reseller/index.js index 31b504fd..727c56af 100644 --- a/adminSDK/reseller/index.js +++ b/adminSDK/reseller/index.js @@ -1,6 +1,5 @@ /** - * @license - * Copyright Google Inc. + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps-script/execute/index.js b/apps-script/execute/index.js index 6d92a997..50798c4a 100644 --- a/apps-script/execute/index.js +++ b/apps-script/execute/index.js @@ -1,6 +1,5 @@ /** - * @license - * Copyright Google Inc. + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +27,9 @@ async function callAppsScript() { // Get credentials and build service // TODO (developer) - Use appropriate auth mechanism for your app - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const script = google.script({version: 'v1', auth}); try { diff --git a/apps-script/quickstart/index.js b/apps-script/quickstart/index.js index 8aac1d5d..e37d37b3 100644 --- a/apps-script/quickstart/index.js +++ b/apps-script/quickstart/index.js @@ -1,6 +1,5 @@ /** - * @license - * Copyright Google Inc. + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -83,7 +82,6 @@ async function authorize() { return client; } - /** * Creates a new script project, upload a file, and log the script's URL. * @param {google.auth.OAuth2} auth An authorized OAuth2 client. @@ -99,16 +97,19 @@ async function callAppsScript(auth) { scriptId: res.data.scriptId, auth, resource: { - files: [{ - name: 'hello', - type: 'SERVER_JS', - source: 'function helloWorld() {\n console.log("Hello, world!");\n}', - }, { - name: 'appsscript', - type: 'JSON', - source: '{\"timeZone\":\"America/New_York\",\"exceptionLogging\":' + - '\"CLOUD\"}', - }], + files: [ + { + name: 'hello', + type: 'SERVER_JS', + source: 'function helloWorld() {\n console.log("Hello, world!");\n}', + }, + { + name: 'appsscript', + type: 'JSON', + source: + '{"timeZone":"America/New_York","exceptionLogging":' + '"CLOUD"}', + }, + ], }, }); console.log(`https://script.google.com/d/${res.data.scriptId}/edit`); diff --git a/calendar/quickstart/index.js b/calendar/quickstart/index.js index 4daefdad..1c7b4afc 100644 --- a/calendar/quickstart/index.js +++ b/calendar/quickstart/index.js @@ -1,6 +1,5 @@ /** - * @license - * Copyright Google Inc. + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -91,7 +90,7 @@ async function listEvents(auth) { const calendar = google.calendar({version: 'v3', auth}); const res = await calendar.events.list({ calendarId: 'primary', - timeMin: (new Date()).toISOString(), + timeMin: new Date().toISOString(), maxResults: 10, singleEvents: true, orderBy: 'startTime', diff --git a/classroom/quickstart/index.js b/classroom/quickstart/index.js index 95b7f11b..d7e4ab87 100644 --- a/classroom/quickstart/index.js +++ b/classroom/quickstart/index.js @@ -1,6 +1,5 @@ /** - * @license - * Copyright Google Inc. + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/docs/quickstart/index.js b/docs/quickstart/index.js index 39166419..da7f61c7 100644 --- a/docs/quickstart/index.js +++ b/docs/quickstart/index.js @@ -1,6 +1,5 @@ /** - * @license - * Copyright Google Inc. + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drive/activity-v2/index.js b/drive/activity-v2/index.js index 69f3276e..37f9e2b0 100644 --- a/drive/activity-v2/index.js +++ b/drive/activity-v2/index.js @@ -1,6 +1,5 @@ /** - * @license - * Copyright Google Inc. + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -91,7 +90,7 @@ async function authorize() { async function listDriveActivity(auth) { const service = google.driveactivity({version: 'v2', auth}); const params = { - 'pageSize': 10, + pageSize: 10, }; const res = await service.activity.query({requestBody: params}); const activities = res.data.activities; @@ -105,8 +104,9 @@ async function listDriveActivity(auth) { const action = getActionInfo(activity.primaryActionDetail); const actors = activity.actors.map(getActorInfo); const targets = activity.targets.map(getTargetInfo); - console.log(`${time}: ${truncated(actors)}, ${action}, ` + - `${truncated(targets)}`); + console.log( + `${time}: ${truncated(actors)}, ${action}, ` + `${truncated(targets)}`, + ); }); } diff --git a/drive/quickstart/index.js b/drive/quickstart/index.js index fc52a57c..86f4b39e 100644 --- a/drive/quickstart/index.js +++ b/drive/quickstart/index.js @@ -1,6 +1,5 @@ /** - * @license - * Copyright Google Inc. + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drive/snippets/drive_v2/appdata_snippets/fetch_appdata_folder.js b/drive/snippets/drive_v2/appdata_snippets/fetch_appdata_folder.js index 15eedec3..17bed314 100644 --- a/drive/snippets/drive_v2/appdata_snippets/fetch_appdata_folder.js +++ b/drive/snippets/drive_v2/appdata_snippets/fetch_appdata_folder.js @@ -25,7 +25,9 @@ async function fetchAppdataFolder() { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive.appdata'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive.appdata', + }); const service = google.drive({version: 'v2', auth}); try { const file = await service.files.get({ diff --git a/drive/snippets/drive_v2/appdata_snippets/list_appdata.js b/drive/snippets/drive_v2/appdata_snippets/list_appdata.js index 508f9b62..e3a7ef05 100644 --- a/drive/snippets/drive_v2/appdata_snippets/list_appdata.js +++ b/drive/snippets/drive_v2/appdata_snippets/list_appdata.js @@ -25,7 +25,9 @@ async function listAppdata() { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive.appdata'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive.appdata', + }); const service = google.drive({version: 'v2', auth}); try { const res = await service.files.list({ @@ -44,5 +46,4 @@ async function listAppdata() { } // [END drive_list_appdata] - module.exports = listAppdata; diff --git a/drive/snippets/drive_v2/appdata_snippets/upload_appdata.js b/drive/snippets/drive_v2/appdata_snippets/upload_appdata.js index 8772af5e..18069cc3 100644 --- a/drive/snippets/drive_v2/appdata_snippets/upload_appdata.js +++ b/drive/snippets/drive_v2/appdata_snippets/upload_appdata.js @@ -26,13 +26,17 @@ async function uploadAppdata() { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive.appdata'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive.appdata', + }); const service = google.drive({version: 'v2', auth}); const fileMetadata = { - 'title': 'config.json', - 'parents': [{ - 'id': 'appDataFolder', - }], + title: 'config.json', + parents: [ + { + id: 'appDataFolder', + }, + ], }; const media = { mimeType: 'application/json', @@ -53,6 +57,4 @@ async function uploadAppdata() { } // [END drive_upload_appdata] - module.exports = uploadAppdata; - diff --git a/drive/snippets/drive_v2/change_snippets/fetch_changes.js b/drive/snippets/drive_v2/change_snippets/fetch_changes.js index ffae04ec..7b3714c8 100644 --- a/drive/snippets/drive_v2/change_snippets/fetch_changes.js +++ b/drive/snippets/drive_v2/change_snippets/fetch_changes.js @@ -25,7 +25,9 @@ async function fetchChanges() { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v2', auth}); let pageToken; try { @@ -45,5 +47,4 @@ async function fetchChanges() { } // [END drive_fetch_changes] - module.exports = fetchChanges; diff --git a/drive/snippets/drive_v2/change_snippets/fetch_start_page_token.js b/drive/snippets/drive_v2/change_snippets/fetch_start_page_token.js index de2339bb..65d37588 100644 --- a/drive/snippets/drive_v2/change_snippets/fetch_start_page_token.js +++ b/drive/snippets/drive_v2/change_snippets/fetch_start_page_token.js @@ -25,7 +25,9 @@ async function fetchStartPageToken() { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v2', auth}); try { const res = await service.changes.getStartPageToken(); diff --git a/drive/snippets/drive_v2/drive_snippets/create_drive.js b/drive/snippets/drive_v2/drive_snippets/create_drive.js index 1d4c43b8..75c26d89 100644 --- a/drive/snippets/drive_v2/drive_snippets/create_drive.js +++ b/drive/snippets/drive_v2/drive_snippets/create_drive.js @@ -26,15 +26,17 @@ async function createDrive() { const {google} = require('googleapis'); const uuid = require('uuid'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v2', auth}); const driveMetadata = { - 'name': 'Project resources', + name: 'Project resources', }; const requestId = uuid.v4(); try { - const Drive= await service.drives.insert({ + const Drive = await service.drives.insert({ resource: driveMetadata, requestId: requestId, fields: 'id', diff --git a/drive/snippets/drive_v2/drive_snippets/recover_drives.js b/drive/snippets/drive_v2/drive_snippets/recover_drives.js index f696f549..390c483f 100644 --- a/drive/snippets/drive_v2/drive_snippets/recover_drives.js +++ b/drive/snippets/drive_v2/drive_snippets/recover_drives.js @@ -26,7 +26,9 @@ async function recoverDrives(userEmail) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v2', auth}); const drives = []; const newOrganizerPermission = { @@ -45,7 +47,11 @@ async function recoverDrives(userEmail) { }); Array.prototype.push.apply(drives, res.data.items); for (const drive of res.data.items) { - console.log('Found shared drive without organizer:', drive.name, drive.id); + console.log( + 'Found shared drive without organizer:', + drive.name, + drive.id, + ); await service.permissions.insert({ resource: newOrganizerPermission, fileId: drive.id, @@ -53,7 +59,7 @@ async function recoverDrives(userEmail) { supportsAllDrives: true, fields: 'id', }); - }; + } pageToken = res.nextPageToken; } catch (err) { // TODO(developer) - Handle error diff --git a/drive/snippets/drive_v2/file snippets/create_folder.js b/drive/snippets/drive_v2/file snippets/create_folder.js index bba078cb..ca18fa0f 100644 --- a/drive/snippets/drive_v2/file snippets/create_folder.js +++ b/drive/snippets/drive_v2/file snippets/create_folder.js @@ -25,11 +25,13 @@ async function createFolder() { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v2', auth}); const fileMetadata = { - 'title': 'Invoices', - 'mimeType': 'application/vnd.google-apps.folder', + title: 'Invoices', + mimeType: 'application/vnd.google-apps.folder', }; try { const file = await service.files.insert({ diff --git a/drive/snippets/drive_v2/file snippets/create_shortcut.js b/drive/snippets/drive_v2/file snippets/create_shortcut.js index 5328fd51..5d85ba62 100644 --- a/drive/snippets/drive_v2/file snippets/create_shortcut.js +++ b/drive/snippets/drive_v2/file snippets/create_shortcut.js @@ -25,11 +25,13 @@ async function createShortcut() { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v2', auth}); const fileMetadata = { - 'title': 'Project plan', - 'mimeType': 'application/vnd.google-apps.drive-sdk', + title: 'Project plan', + mimeType: 'application/vnd.google-apps.drive-sdk', }; try { @@ -47,4 +49,3 @@ async function createShortcut() { // [END drive_create_shortcut] module.exports = createShortcut; - diff --git a/drive/snippets/drive_v2/file snippets/download_file.js b/drive/snippets/drive_v2/file snippets/download_file.js index 64232bcc..5e353a00 100644 --- a/drive/snippets/drive_v2/file snippets/download_file.js +++ b/drive/snippets/drive_v2/file snippets/download_file.js @@ -27,7 +27,9 @@ async function downloadFile(fileId) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v2', auth}); try { @@ -41,7 +43,7 @@ async function downloadFile(fileId) { // TODO(developer) - Handle error throw err; } -}; +} // [END drive_download_file] module.exports = downloadFile; diff --git a/drive/snippets/drive_v2/file snippets/export_pdf.js b/drive/snippets/drive_v2/file snippets/export_pdf.js index 40fe44f6..566746d5 100644 --- a/drive/snippets/drive_v2/file snippets/export_pdf.js +++ b/drive/snippets/drive_v2/file snippets/export_pdf.js @@ -27,7 +27,9 @@ async function exportPdf(fileId) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v2', auth}); try { diff --git a/drive/snippets/drive_v2/file snippets/move_file_to_folder.js b/drive/snippets/drive_v2/file snippets/move_file_to_folder.js index 683e4f91..3e59c554 100644 --- a/drive/snippets/drive_v2/file snippets/move_file_to_folder.js +++ b/drive/snippets/drive_v2/file snippets/move_file_to_folder.js @@ -28,7 +28,9 @@ async function moveFileToFolder(fileId, folderId) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v2', auth}); try { @@ -39,9 +41,11 @@ async function moveFileToFolder(fileId, folderId) { }); // Move the file to the new folder - const previousParents = file.data.parents.map(function(parent) { - return parent.id; - }).join(','); + const previousParents = file.data.parents + .map(function(parent) { + return parent.id; + }) + .join(','); const files = await service.files.update({ fileId: fileId, addParents: folderId, @@ -58,4 +62,3 @@ async function moveFileToFolder(fileId, folderId) { // [END drive_move_file_to_folder] module.exports = moveFileToFolder; - diff --git a/drive/snippets/drive_v2/file snippets/search_file.js b/drive/snippets/drive_v2/file snippets/search_file.js index ee22c047..ef00abc6 100644 --- a/drive/snippets/drive_v2/file snippets/search_file.js +++ b/drive/snippets/drive_v2/file snippets/search_file.js @@ -25,7 +25,9 @@ async function searchFile() { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v2', auth}); const files = []; const pageToken = null; diff --git a/drive/snippets/drive_v2/file snippets/share_file.js b/drive/snippets/drive_v2/file snippets/share_file.js index d10c44a8..0cb72954 100644 --- a/drive/snippets/drive_v2/file snippets/share_file.js +++ b/drive/snippets/drive_v2/file snippets/share_file.js @@ -28,19 +28,22 @@ async function shareFile(fileId, targetUser, targetDomain) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v2', auth}); const permissionIds = []; const permissions = [ { - 'type': 'user', - 'role': 'writer', - 'value': targetUser, // Example: 'user@example.com', - }, { - 'type': 'domain', - 'role': 'writer', - 'value': targetDomain, // Example: 'example.com', + type: 'user', + role: 'writer', + value: targetUser, // Example: 'user@example.com', + }, + { + type: 'domain', + role: 'writer', + value: targetDomain, // Example: 'example.com', }, ]; @@ -63,7 +66,7 @@ async function shareFile(fileId, targetUser, targetDomain) { } } return permissionIds; -}; +} // [END drive_share_file] module.exports = shareFile; diff --git a/drive/snippets/drive_v2/file snippets/touch_file.js b/drive/snippets/drive_v2/file snippets/touch_file.js index e7b6fb64..d4b2b822 100644 --- a/drive/snippets/drive_v2/file snippets/touch_file.js +++ b/drive/snippets/drive_v2/file snippets/touch_file.js @@ -28,10 +28,12 @@ async function touchFile(fileId, timestamp) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v2', auth}); const fileMetadata = { - 'modifiedDate': new Date().toISOString(), + modifiedDate: new Date().toISOString(), }; fileMetadata.modifiedTime = timestamp; try { @@ -47,7 +49,7 @@ async function touchFile(fileId, timestamp) { // TODO(developer) - Handle error throw err; } -}; +} // [END drive_touch_file] module.exports = touchFile; diff --git a/drive/snippets/drive_v2/file snippets/upload_basic.js b/drive/snippets/drive_v2/file snippets/upload_basic.js index fd4845a0..faa5c2c5 100644 --- a/drive/snippets/drive_v2/file snippets/upload_basic.js +++ b/drive/snippets/drive_v2/file snippets/upload_basic.js @@ -26,10 +26,12 @@ async function uploadBasic() { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v2', auth}); const fileMetadata = { - 'title': 'photo.jpg', + title: 'photo.jpg', }; const media = { mimeType: 'image/jpeg', diff --git a/drive/snippets/drive_v2/file snippets/upload_to_folder.js b/drive/snippets/drive_v2/file snippets/upload_to_folder.js index afc6b6ce..9ebe801a 100644 --- a/drive/snippets/drive_v2/file snippets/upload_to_folder.js +++ b/drive/snippets/drive_v2/file snippets/upload_to_folder.js @@ -27,11 +27,13 @@ async function uploadToFolder(folderId) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v2', auth}); const fileMetadata = { - 'title': 'photo.jpg', - 'parents': [{id: folderId}], + title: 'photo.jpg', + parents: [{id: folderId}], }; const media = { mimeType: 'image/jpeg', diff --git a/drive/snippets/drive_v2/file snippets/upload_with_conversion.js b/drive/snippets/drive_v2/file snippets/upload_with_conversion.js index dbdc7d7c..54433892 100644 --- a/drive/snippets/drive_v2/file snippets/upload_with_conversion.js +++ b/drive/snippets/drive_v2/file snippets/upload_with_conversion.js @@ -26,11 +26,13 @@ async function uploadWithConversion() { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v2', auth}); const fileMetadata = { - 'title': 'My Report', - 'mimeType': 'application/vnd.google-apps.spreadsheet', + title: 'My Report', + mimeType: 'application/vnd.google-apps.spreadsheet', }; const media = { mimeType: 'text/csv', diff --git a/drive/snippets/drive_v3/appdata_snippets/fetch_appdata_folder.js b/drive/snippets/drive_v3/appdata_snippets/fetch_appdata_folder.js index 05c19366..03d8d753 100644 --- a/drive/snippets/drive_v3/appdata_snippets/fetch_appdata_folder.js +++ b/drive/snippets/drive_v3/appdata_snippets/fetch_appdata_folder.js @@ -15,7 +15,6 @@ */ // [START drive_fetch_appdata_folder] - /** * List out application data folder and prints folder ID * */ @@ -26,14 +25,15 @@ async function fetchAppdataFolder() { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive.appdata'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive.appdata', + }); const service = google.drive({version: 'v3', auth}); try { - const file = await service.files.get( - { - fileId: 'appDataFolder', - fields: 'id', - }); + const file = await service.files.get({ + fileId: 'appDataFolder', + fields: 'id', + }); console.log('File Id:', file.data.id); return file.data.id; } catch (err) { diff --git a/drive/snippets/drive_v3/appdata_snippets/list_appdata.js b/drive/snippets/drive_v3/appdata_snippets/list_appdata.js index 793248a2..9ae5fd6d 100644 --- a/drive/snippets/drive_v3/appdata_snippets/list_appdata.js +++ b/drive/snippets/drive_v3/appdata_snippets/list_appdata.js @@ -25,15 +25,16 @@ async function listAppdata() { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive.appdata'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive.appdata', + }); const service = google.drive({version: 'v3', auth}); try { - const res = await service.files.list( - { - spaces: 'appDataFolder', - fields: 'nextPageToken, files(id, name)', - pageSize: 100, - }); + const res = await service.files.list({ + spaces: 'appDataFolder', + fields: 'nextPageToken, files(id, name)', + pageSize: 100, + }); res.data.files.forEach(function(file) { console.log('Found file:', file.name, file.id); }); diff --git a/drive/snippets/drive_v3/appdata_snippets/upload_appdata.js b/drive/snippets/drive_v3/appdata_snippets/upload_appdata.js index e5cdfdce..270684a5 100644 --- a/drive/snippets/drive_v3/appdata_snippets/upload_appdata.js +++ b/drive/snippets/drive_v3/appdata_snippets/upload_appdata.js @@ -26,7 +26,9 @@ async function uploadAppdata() { const {google} = require('googleapis'); const fs = require('fs'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive.appdata'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive.appdata', + }); const service = google.drive({version: 'v3', auth}); const fileMetadata = { name: 'config.json', @@ -37,12 +39,11 @@ async function uploadAppdata() { body: fs.createReadStream('files/config.json'), }; try { - const file = await service.files.create( - { - resource: fileMetadata, - media: media, - fields: 'id', - }); + const file = await service.files.create({ + resource: fileMetadata, + media: media, + fields: 'id', + }); console.log('File Id:', file.data.id); return file.data.id; } catch (err) { @@ -53,4 +54,3 @@ async function uploadAppdata() { // [END drive_upload_appdata] module.exports = uploadAppdata; - diff --git a/drive/snippets/drive_v3/change_snippets/fetch_changes.js b/drive/snippets/drive_v3/change_snippets/fetch_changes.js index dd82f384..29b6a366 100644 --- a/drive/snippets/drive_v3/change_snippets/fetch_changes.js +++ b/drive/snippets/drive_v3/change_snippets/fetch_changes.js @@ -26,7 +26,9 @@ async function fetchChanges(savedStartPageToken) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive.readonly'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive.readonly', + }); const service = google.drive({version: 'v3', auth}); try { let pageToken = savedStartPageToken; diff --git a/drive/snippets/drive_v3/change_snippets/fetch_start_page_token.js b/drive/snippets/drive_v3/change_snippets/fetch_start_page_token.js index ca136802..cd5e7132 100644 --- a/drive/snippets/drive_v3/change_snippets/fetch_start_page_token.js +++ b/drive/snippets/drive_v3/change_snippets/fetch_start_page_token.js @@ -25,7 +25,9 @@ async function fetchStartPageToken() { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive.appdata'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive.appdata', + }); const service = google.drive({version: 'v3', auth}); try { const res = await service.changes.getStartPageToken({}); diff --git a/drive/snippets/drive_v3/drive_snippets/create_drive.js b/drive/snippets/drive_v3/drive_snippets/create_drive.js index fe550ced..e69a5018 100644 --- a/drive/snippets/drive_v3/drive_snippets/create_drive.js +++ b/drive/snippets/drive_v3/drive_snippets/create_drive.js @@ -26,15 +26,17 @@ async function createDrive() { const {google} = require('googleapis'); const uuid = require('uuid'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v3', auth}); const driveMetadata = { - 'name': 'Project resources', + name: 'Project resources', }; const requestId = uuid.v4(); try { - const Drive= await service.drives.create({ + const Drive = await service.drives.create({ resource: driveMetadata, requestId: requestId, fields: 'id', diff --git a/drive/snippets/drive_v3/drive_snippets/recover_drives.js b/drive/snippets/drive_v3/drive_snippets/recover_drives.js index 36deceaa..638c7e92 100644 --- a/drive/snippets/drive_v3/drive_snippets/recover_drives.js +++ b/drive/snippets/drive_v3/drive_snippets/recover_drives.js @@ -26,7 +26,9 @@ async function recoverDrives(userEmail) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v3', auth}); const drives = []; const newOrganizerPermission = { @@ -45,7 +47,11 @@ async function recoverDrives(userEmail) { }); Array.prototype.push.apply(drives, res.data.items); for (const drive of res.data.drives) { - console.log('Found shared drive without organizer:', drive.name, drive.id); + console.log( + 'Found shared drive without organizer:', + drive.name, + drive.id, + ); await service.permissions.create({ resource: newOrganizerPermission, fileId: drive.id, diff --git a/drive/snippets/drive_v3/file_snippets/create_folder.js b/drive/snippets/drive_v3/file_snippets/create_folder.js index 2d0af2b0..68583f18 100644 --- a/drive/snippets/drive_v3/file_snippets/create_folder.js +++ b/drive/snippets/drive_v3/file_snippets/create_folder.js @@ -26,11 +26,13 @@ async function createFolder() { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v3', auth}); const fileMetadata = { - 'title': 'Invoices', - 'mimeType': 'application/vnd.google-apps.folder', + title: 'Invoices', + mimeType: 'application/vnd.google-apps.folder', }; try { const file = await service.files.create({ diff --git a/drive/snippets/drive_v3/file_snippets/create_shortcut.js b/drive/snippets/drive_v3/file_snippets/create_shortcut.js index b822933f..d08907c4 100644 --- a/drive/snippets/drive_v3/file_snippets/create_shortcut.js +++ b/drive/snippets/drive_v3/file_snippets/create_shortcut.js @@ -26,11 +26,13 @@ async function createShortcut() { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v3', auth}); const fileMetadata = { - 'title': 'Project plan', - 'mimeType': 'application/vnd.google-apps.drive-sdk', + title: 'Project plan', + mimeType: 'application/vnd.google-apps.drive-sdk', }; try { diff --git a/drive/snippets/drive_v3/file_snippets/download_file.js b/drive/snippets/drive_v3/file_snippets/download_file.js index ec0bcc78..eddf69f1 100644 --- a/drive/snippets/drive_v3/file_snippets/download_file.js +++ b/drive/snippets/drive_v3/file_snippets/download_file.js @@ -27,7 +27,9 @@ async function downloadFile(realFileId) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v3', auth}); fileId = realFileId; @@ -42,7 +44,7 @@ async function downloadFile(realFileId) { // TODO(developer) - Handle error throw err; } -}; +} // [END drive_download_file] module.exports = downloadFile; diff --git a/drive/snippets/drive_v3/file_snippets/export_pdf.js b/drive/snippets/drive_v3/file_snippets/export_pdf.js index f18bc3d3..3647011e 100644 --- a/drive/snippets/drive_v3/file_snippets/export_pdf.js +++ b/drive/snippets/drive_v3/file_snippets/export_pdf.js @@ -26,7 +26,9 @@ async function exportPdf(fileId) { // Get credentials and build service // TODO (developer) - Use appropriate auth mechanism for your app - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v3', auth}); try { diff --git a/drive/snippets/drive_v3/file_snippets/move_file_to_folder.js b/drive/snippets/drive_v3/file_snippets/move_file_to_folder.js index f0423ec2..4a2f12a4 100644 --- a/drive/snippets/drive_v3/file_snippets/move_file_to_folder.js +++ b/drive/snippets/drive_v3/file_snippets/move_file_to_folder.js @@ -27,7 +27,9 @@ async function moveFileToFolder(fileId, folderId) { // Get credentials and build service // TODO (developer) - Use appropriate auth mechanism for your app - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v3', auth}); try { @@ -38,9 +40,11 @@ async function moveFileToFolder(fileId, folderId) { }); // Move the file to the new folder - const previousParents = file.data.parents.map(function(parent) { - return parent.id; - }).join(','); + const previousParents = file.data.parents + .map(function(parent) { + return parent.id; + }) + .join(','); const files = await service.files.update({ fileId: fileId, addParents: folderId, diff --git a/drive/snippets/drive_v3/file_snippets/search_file.js b/drive/snippets/drive_v3/file_snippets/search_file.js index c9324980..af6338e8 100644 --- a/drive/snippets/drive_v3/file_snippets/search_file.js +++ b/drive/snippets/drive_v3/file_snippets/search_file.js @@ -25,7 +25,9 @@ async function searchFile() { // Get credentials and build service // TODO (developer) - Use appropriate auth mechanism for your app - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v3', auth}); const files = []; try { diff --git a/drive/snippets/drive_v3/file_snippets/share_file.js b/drive/snippets/drive_v3/file_snippets/share_file.js index bdcb6831..79206471 100644 --- a/drive/snippets/drive_v3/file_snippets/share_file.js +++ b/drive/snippets/drive_v3/file_snippets/share_file.js @@ -28,19 +28,22 @@ async function shareFile(fileId, targetUserEmail, targetDomainName) { // Get credentials and build service // TODO (developer) - Use appropriate auth mechanism for your app - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v3', auth}); const permissionIds = []; const permissions = [ { - 'type': 'user', - 'role': 'writer', - 'emailAddress': targetUserEmail, // 'user@partner.com', - }, { - 'type': 'domain', - 'role': 'writer', - 'domain': targetDomainName, // 'example.com', + type: 'user', + role: 'writer', + emailAddress: targetUserEmail, // 'user@partner.com', + }, + { + type: 'domain', + role: 'writer', + domain: targetDomainName, // 'example.com', }, ]; // Note: Client library does not currently support HTTP batch diff --git a/drive/snippets/drive_v3/file_snippets/touch_file.js b/drive/snippets/drive_v3/file_snippets/touch_file.js index 7e3a502e..f61c7b19 100644 --- a/drive/snippets/drive_v3/file_snippets/touch_file.js +++ b/drive/snippets/drive_v3/file_snippets/touch_file.js @@ -27,10 +27,12 @@ async function touchFile(fileId, Timestamp) { // Get credentials and build service // TODO (developer) - Use appropriate auth mechanism for your app - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v3', auth}); const fileMetadata = { - 'modifiedTime': new Date().toISOString(), + modifiedTime: new Date().toISOString(), }; fileMetadata.modifiedTime = Timestamp; try { @@ -45,7 +47,7 @@ async function touchFile(fileId, Timestamp) { // TODO(developer) - Handle error throw err; } -}; +} // [END drive_touch_file] module.exports = touchFile; diff --git a/drive/snippets/drive_v3/file_snippets/upload_basic.js b/drive/snippets/drive_v3/file_snippets/upload_basic.js index d36a9bf7..bf024bb3 100644 --- a/drive/snippets/drive_v3/file_snippets/upload_basic.js +++ b/drive/snippets/drive_v3/file_snippets/upload_basic.js @@ -26,10 +26,12 @@ async function uploadBasic() { // Get credentials and build service // TODO (developer) - Use appropriate auth mechanism for your app - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v3', auth}); const fileMetadata = { - 'name': 'photo.jpg', + name: 'photo.jpg', }; const media = { mimeType: 'image/jpeg', diff --git a/drive/snippets/drive_v3/file_snippets/upload_to_folder.js b/drive/snippets/drive_v3/file_snippets/upload_to_folder.js index bda52af1..dbbb5113 100644 --- a/drive/snippets/drive_v3/file_snippets/upload_to_folder.js +++ b/drive/snippets/drive_v3/file_snippets/upload_to_folder.js @@ -26,14 +26,16 @@ async function uploadToFolder(folderId) { const {google} = require('googleapis'); // Get credentials and build service // TODO (developer) - Use appropriate auth mechanism for your app - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v3', auth}); // TODO(developer): set folder Id // folderId = '1lWo8HghUBd-3mN4s98ArNFMdqmhqCXH7'; const fileMetadata = { - 'title': 'photo.jpg', - 'parents': [folderId], + title: 'photo.jpg', + parents: [folderId], }; const media = { mimeType: 'image/jpeg', diff --git a/drive/snippets/drive_v3/file_snippets/upload_with_conversion.js b/drive/snippets/drive_v3/file_snippets/upload_with_conversion.js index 2c01a9fa..516cae99 100644 --- a/drive/snippets/drive_v3/file_snippets/upload_with_conversion.js +++ b/drive/snippets/drive_v3/file_snippets/upload_with_conversion.js @@ -25,11 +25,13 @@ async function uploadWithConversion() { const {google} = require('googleapis'); // Get credentials and build service // TODO (developer) - Use appropriate auth mechanism for your app - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v3', auth}); const fileMetadata = { - 'title': 'My Report', - 'mimeType': 'application/vnd.google-apps.spreadsheet', + title: 'My Report', + mimeType: 'application/vnd.google-apps.spreadsheet', }; const media = { mimeType: 'text/csv', @@ -52,4 +54,3 @@ async function uploadWithConversion() { // [END drive_upload_with_conversion] module.exports = uploadWithConversion; - diff --git a/drive/snippets/files/config.json b/drive/snippets/files/config.json index b42f309e..c8c4105e 100644 --- a/drive/snippets/files/config.json +++ b/drive/snippets/files/config.json @@ -1,3 +1,3 @@ { "foo": "bar" -} \ No newline at end of file +} diff --git a/drive/snippets/test/helpers.js b/drive/snippets/test/helpers.js index 69c111e2..12645766 100644 --- a/drive/snippets/test/helpers.js +++ b/drive/snippets/test/helpers.js @@ -1,6 +1,5 @@ /** - * @license - * Copyright Google Inc. + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +25,9 @@ class Helpers { * Creates the Google API Service */ constructor() { - const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); this.service = google.drive({version: 'v3', auth}); this.filesToDelete = []; } @@ -51,8 +52,9 @@ class Helpers { * @return {Promise} A promise to return the Google API service. */ cleanup() { - return Promise.all(this.filesToDelete.map((fileId) => - this.service.files.delete({fileId}))); + return Promise.all( + this.filesToDelete.map((fileId) => this.service.files.delete({fileId})), + ); } /** @@ -77,13 +79,16 @@ class Helpers { * @return {Promise} A promise to return the Google Drive file. */ createTestDocument() { - return this.createFile({ - name: 'Test Document', - mimeType: 'application/vnd.google-apps.document', - }, { - mimeType: 'text/plain', - body: fs.createReadStream('files/document.txt'), - }); + return this.createFile( + { + name: 'Test Document', + mimeType: 'application/vnd.google-apps.document', + }, + { + mimeType: 'text/plain', + body: fs.createReadStream('files/document.txt'), + }, + ); } /** @@ -91,12 +96,15 @@ class Helpers { * @return {Promise} A promise to return the Google Drive file. */ async createTestBlob() { - const file = await this.createFile({ - name: 'photo.jpg', - }, { - mimeType: 'image/jpeg', - body: fs.createReadStream('files/photo.jpg'), - }); + const file = await this.createFile( + { + name: 'photo.jpg', + }, + { + mimeType: 'image/jpeg', + body: fs.createReadStream('files/photo.jpg'), + }, + ); return file; } diff --git a/drive/snippets/test/test_drive_v2_create_drive.js b/drive/snippets/test/test_drive_v2_create_drive.js index 05a69e0a..4dd3aba0 100644 --- a/drive/snippets/test/test_drive_v2_create_drive.js +++ b/drive/snippets/test/test_drive_v2_create_drive.js @@ -27,9 +27,9 @@ describe('Drive snippets', () => { // Note, you must enable creating Team Drives for your service account. // https://support.google.com/a/answer/7337635?hl=en - it('should create a team drive', (async () => { + it('should create a team drive', async () => { const id = await createDrive(); expect(id).toBeDefined(); await helpers.service.teamdrives.delete({teamDriveId: id}); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v2_create_folder.js b/drive/snippets/test/test_drive_v2_create_folder.js index e2aae7af..edb96ad1 100644 --- a/drive/snippets/test/test_drive_v2_create_folder.js +++ b/drive/snippets/test/test_drive_v2_create_folder.js @@ -25,9 +25,9 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should create a folder', (async () => { + it('should create a folder', async () => { const id = await createFolder(); expect(id).toBeDefined(); helpers.deleteFileOnCleanup(id); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v2_create_shortcut.js b/drive/snippets/test/test_drive_v2_create_shortcut.js index 2361e67a..547f2090 100644 --- a/drive/snippets/test/test_drive_v2_create_shortcut.js +++ b/drive/snippets/test/test_drive_v2_create_shortcut.js @@ -25,9 +25,9 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should create a shortcut', (async () => { + it('should create a shortcut', async () => { const id = await createShortcut(); expect(id).toBeDefined(); helpers.deleteFileOnCleanup(id); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v2_download_file.js b/drive/snippets/test/test_drive_v2_download_file.js index 0fdbe246..73e44f3f 100644 --- a/drive/snippets/test/test_drive_v2_download_file.js +++ b/drive/snippets/test/test_drive_v2_download_file.js @@ -18,7 +18,6 @@ const {expect} = require('expect'); const Helpers = require('./helpers'); const downloadFile = require('../drive_v2/file snippets/download_file'); - describe('Drive snippets', () => { const helpers = new Helpers(); @@ -26,9 +25,9 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should download a photo', (async () => { + it('should download a photo', async () => { const file = await helpers.createTestBlob(); const status = await downloadFile(file.data.id); expect(status).toEqual(200); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v2_export_pdf.js b/drive/snippets/test/test_drive_v2_export_pdf.js index 9b46bf05..57f4a4cc 100644 --- a/drive/snippets/test/test_drive_v2_export_pdf.js +++ b/drive/snippets/test/test_drive_v2_export_pdf.js @@ -18,7 +18,6 @@ const {expect} = require('expect'); const Helpers = require('./helpers'); const exportPdf = require('../drive_v3/file_snippets/export_pdf'); - describe('Drive snippets', () => { const helpers = new Helpers(); @@ -26,9 +25,9 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should export a PDF', (async () => { + it('should export a PDF', async () => { const file = await helpers.createTestDocument(); const result = await exportPdf(file.data.id); expect(result.status).toEqual(200); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v2_fetch_appdata_folder.js b/drive/snippets/test/test_drive_v2_fetch_appdata_folder.js index 5b36b749..34f78aeb 100644 --- a/drive/snippets/test/test_drive_v2_fetch_appdata_folder.js +++ b/drive/snippets/test/test_drive_v2_fetch_appdata_folder.js @@ -25,8 +25,8 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should fetch the app data folder', (async () => { + it('should fetch the app data folder', async () => { const id = await fetchAppdataFolder(); expect(id).toBeDefined(); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v2_fetch_changes.js b/drive/snippets/test/test_drive_v2_fetch_changes.js index b73fe79e..6ebbcbe4 100644 --- a/drive/snippets/test/test_drive_v2_fetch_changes.js +++ b/drive/snippets/test/test_drive_v2_fetch_changes.js @@ -26,11 +26,11 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should fetch changes', (async () => { + it('should fetch changes', async () => { const startToken = await fetchStartPageToken(); await helpers.createTestBlob(); const token = await fetchChanges(startToken); expect(token).toBeDefined(); expect(token).not.toEqual(startToken); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v2_fetch_start_page_token.js b/drive/snippets/test/test_drive_v2_fetch_start_page_token.js index e91a3ffc..e4669e19 100644 --- a/drive/snippets/test/test_drive_v2_fetch_start_page_token.js +++ b/drive/snippets/test/test_drive_v2_fetch_start_page_token.js @@ -25,8 +25,8 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should fetch the start page token', (async () => { + it('should fetch the start page token', async () => { const token = await fetchStartPageToken(); expect(token).toBeDefined(); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v2_list_appdata.js b/drive/snippets/test/test_drive_v2_list_appdata.js index 4ba6017e..9e83e9c9 100644 --- a/drive/snippets/test/test_drive_v2_list_appdata.js +++ b/drive/snippets/test/test_drive_v2_list_appdata.js @@ -26,10 +26,10 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should list files', (async () => { + it('should list files', async () => { const id = await uploadAppdata('../files/config.json'); helpers.deleteFileOnCleanup(id); const files = await listAppdata(); expect(files.length).toBeGreaterThan(0); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v2_move_file_to_folder.js b/drive/snippets/test/test_drive_v2_move_file_to_folder.js index 0bd96be4..6914a826 100644 --- a/drive/snippets/test/test_drive_v2_move_file_to_folder.js +++ b/drive/snippets/test/test_drive_v2_move_file_to_folder.js @@ -26,11 +26,11 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should move a file', (async () => { + it('should move a file', async () => { const folderId = await createFolder(); const file = await helpers.createTestBlob(); helpers.deleteFileOnCleanup(folderId); const movedFileStatus = await moveFileToFolder(file.data.id, folderId); expect(movedFileStatus).toEqual(200); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v2_recover_drives.js b/drive/snippets/test/test_drive_v2_recover_drives.js index 1cc35bfb..fcc7f254 100644 --- a/drive/snippets/test/test_drive_v2_recover_drives.js +++ b/drive/snippets/test/test_drive_v2_recover_drives.js @@ -28,11 +28,11 @@ describe('Drive snippets', () => { // Note, you must enable creating Team Drives for your service account. // https://support.google.com/a/answer/7337635?hl=en - it('should recover team drives', (async () => { + it('should recover team drives', async () => { await createOrphanedTeamDrive(); const teamDrives = await recoverDrives('soheil@workspacesamples.dev'); expect(teamDrives.length).toBeDefined(); - })); + }); /** * Creates a standalone Team Drive. @@ -53,5 +53,5 @@ describe('Drive snippets', () => { }); }); return fileId; - }; + } }); diff --git a/drive/snippets/test/test_drive_v2_search_file.js b/drive/snippets/test/test_drive_v2_search_file.js index 6224ef4a..55e863ab 100644 --- a/drive/snippets/test/test_drive_v2_search_file.js +++ b/drive/snippets/test/test_drive_v2_search_file.js @@ -29,9 +29,9 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should search files', (async () => { + it('should search files', async () => { await helpers.createTestBlob(); const files = await searchFiles(); expect(files.length).toBeGreaterThan(0); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v2_share_file.js b/drive/snippets/test/test_drive_v2_share_file.js index 749076a6..416de808 100644 --- a/drive/snippets/test/test_drive_v2_share_file.js +++ b/drive/snippets/test/test_drive_v2_share_file.js @@ -29,12 +29,13 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should share files', (async () => { + it('should share files', async () => { const file = await helpers.createTestBlob(); const ids = await shareFile( file.data.id, 'xyz@workspacesamples.dev', - 'workspacesamples.dev'); + 'workspacesamples.dev', + ); expect(ids.length).toEqual(2); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v2_touch_file.js b/drive/snippets/test/test_drive_v2_touch_file.js index c95ec2a9..37671dab 100644 --- a/drive/snippets/test/test_drive_v2_touch_file.js +++ b/drive/snippets/test/test_drive_v2_touch_file.js @@ -29,10 +29,10 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should update the modified time', (async () => { + it('should update the modified time', async () => { const file = await helpers.createTestBlob(); const now = new Date().toISOString(); const modifiedTime = await touchFile(file.data.id, now); expect(modifiedTime).toEqual(now); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v2_upload_appdata.js b/drive/snippets/test/test_drive_v2_upload_appdata.js index ee4f2611..e69e4470 100644 --- a/drive/snippets/test/test_drive_v2_upload_appdata.js +++ b/drive/snippets/test/test_drive_v2_upload_appdata.js @@ -25,9 +25,9 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should upload a file', (async () => { + it('should upload a file', async () => { const id = await uploadAppdata('../files/config.json'); expect(id).toBeDefined(); helpers.deleteFileOnCleanup(id); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v2_upload_basic.js b/drive/snippets/test/test_drive_v2_upload_basic.js index 976adc41..5720b4ea 100644 --- a/drive/snippets/test/test_drive_v2_upload_basic.js +++ b/drive/snippets/test/test_drive_v2_upload_basic.js @@ -29,9 +29,9 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should upload a photo', (async () => { + it('should upload a photo', async () => { const id = await uploadBasic('../files/photo.jpg'); expect(id).toBeDefined(); helpers.deleteFileOnCleanup(id); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v2_upload_to_folder.js b/drive/snippets/test/test_drive_v2_upload_to_folder.js index 1916f6dd..c0952871 100644 --- a/drive/snippets/test/test_drive_v2_upload_to_folder.js +++ b/drive/snippets/test/test_drive_v2_upload_to_folder.js @@ -30,11 +30,11 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should upload to a folder', (async () => { + it('should upload to a folder', async () => { const folderId = await createFolder(); helpers.deleteFileOnCleanup(folderId); const file = await uploadToFolder(folderId, '../files/photo.jpg'); expect(file).toBeDefined(); helpers.deleteFileOnCleanup(file); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v2_upload_with_conversion.js b/drive/snippets/test/test_drive_v2_upload_with_conversion.js index fb2c7879..e9a33ca1 100644 --- a/drive/snippets/test/test_drive_v2_upload_with_conversion.js +++ b/drive/snippets/test/test_drive_v2_upload_with_conversion.js @@ -29,9 +29,9 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should upload and convert a document', (async () => { + it('should upload and convert a document', async () => { const id = await uploadWithConversion('../files/reports.csv'); expect(id).toBeDefined(); helpers.deleteFileOnCleanup(id); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v3_create_drive.js b/drive/snippets/test/test_drive_v3_create_drive.js index 90afc180..0c0f51ae 100644 --- a/drive/snippets/test/test_drive_v3_create_drive.js +++ b/drive/snippets/test/test_drive_v3_create_drive.js @@ -23,9 +23,9 @@ describe('Drive snippets', () => { // Note, you must enable creating Team Drives for your service account. // https://support.google.com/a/answer/7337635?hl=en - it('should create a team drive', (async () => { + it('should create a team drive', async () => { const id = await createDrive(); expect(id).toBeDefined(); await helpers.service.teamdrives.delete({teamDriveId: id}); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v3_create_folder.js b/drive/snippets/test/test_drive_v3_create_folder.js index e2aae7af..edb96ad1 100644 --- a/drive/snippets/test/test_drive_v3_create_folder.js +++ b/drive/snippets/test/test_drive_v3_create_folder.js @@ -25,9 +25,9 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should create a folder', (async () => { + it('should create a folder', async () => { const id = await createFolder(); expect(id).toBeDefined(); helpers.deleteFileOnCleanup(id); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v3_create_shortcut.js b/drive/snippets/test/test_drive_v3_create_shortcut.js index 68d34869..86a1fca8 100644 --- a/drive/snippets/test/test_drive_v3_create_shortcut.js +++ b/drive/snippets/test/test_drive_v3_create_shortcut.js @@ -25,9 +25,9 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should create a shortcut', (async () => { + it('should create a shortcut', async () => { const id = await createShortcut(); expect(id).toBeDefined(); helpers.deleteFileOnCleanup(id); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v3_download_file.js b/drive/snippets/test/test_drive_v3_download_file.js index 5bb77d90..49586e2b 100644 --- a/drive/snippets/test/test_drive_v3_download_file.js +++ b/drive/snippets/test/test_drive_v3_download_file.js @@ -18,7 +18,6 @@ const {expect} = require('expect'); const Helpers = require('./helpers'); const downloadFile = require('../drive_v3/file_snippets/download_file'); - describe('Drive snippets', () => { const helpers = new Helpers(); @@ -30,9 +29,9 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should download a photo', (async () => { + it('should download a photo', async () => { const file = await helpers.createTestBlob(); const status = await downloadFile(file.data.id); expect(status).toEqual(200); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v3_export_pdf.js b/drive/snippets/test/test_drive_v3_export_pdf.js index d8668bd9..c9f829dd 100644 --- a/drive/snippets/test/test_drive_v3_export_pdf.js +++ b/drive/snippets/test/test_drive_v3_export_pdf.js @@ -18,7 +18,6 @@ const {expect} = require('expect'); const Helpers = require('./helpers'); const exportPdf = require('../drive_v3/file_snippets/export_pdf'); - describe('Drive snippets', () => { const helpers = new Helpers(); @@ -30,9 +29,9 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should export a PDF', (async () => { + it('should export a PDF', async () => { const file = await helpers.createTestDocument(); const result = await exportPdf(file.data.id); expect(result.status).toEqual(200); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v3_fetch_appdata_folder.js b/drive/snippets/test/test_drive_v3_fetch_appdata_folder.js index f5fc8fca..b672568e 100644 --- a/drive/snippets/test/test_drive_v3_fetch_appdata_folder.js +++ b/drive/snippets/test/test_drive_v3_fetch_appdata_folder.js @@ -25,8 +25,8 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should fetch the app data folder', (async () => { + it('should fetch the app data folder', async () => { const id = await fetchAppdataFolder(); expect(id).toBeDefined(); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v3_fetch_changes.js b/drive/snippets/test/test_drive_v3_fetch_changes.js index 29e9f03d..b4dccacc 100644 --- a/drive/snippets/test/test_drive_v3_fetch_changes.js +++ b/drive/snippets/test/test_drive_v3_fetch_changes.js @@ -26,11 +26,11 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should fetch changes', (async () => { + it('should fetch changes', async () => { const startToken = await fetchStartPageToken(); await helpers.createTestBlob(); const token = await fetchChanges(startToken); expect(token).toBeDefined(); expect(token).not.toEqual(startToken); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v3_fetch_start_page_token.js b/drive/snippets/test/test_drive_v3_fetch_start_page_token.js index 9ae98d38..ea98d524 100644 --- a/drive/snippets/test/test_drive_v3_fetch_start_page_token.js +++ b/drive/snippets/test/test_drive_v3_fetch_start_page_token.js @@ -25,8 +25,8 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should fetch the start page token', (async () => { + it('should fetch the start page token', async () => { const token = await fetchStartPageToken(); expect(token).toBeDefined(); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v3_list_appdata.js b/drive/snippets/test/test_drive_v3_list_appdata.js index 988bd551..fc575ad1 100644 --- a/drive/snippets/test/test_drive_v3_list_appdata.js +++ b/drive/snippets/test/test_drive_v3_list_appdata.js @@ -26,10 +26,10 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should list files', (async () => { + it('should list files', async () => { const id = await uploadAppdata('../files/config.json'); helpers.deleteFileOnCleanup(id); const files = await listAppdata(); expect(files.length).toBeDefined(); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v3_move_file_to_folder.js b/drive/snippets/test/test_drive_v3_move_file_to_folder.js index f64a3c23..b5cbacf4 100644 --- a/drive/snippets/test/test_drive_v3_move_file_to_folder.js +++ b/drive/snippets/test/test_drive_v3_move_file_to_folder.js @@ -30,11 +30,11 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should move a file', (async () => { + it('should move a file', async () => { const folderId = await createFolder(); const file = await helpers.createTestBlob(); helpers.deleteFileOnCleanup(folderId); const movedFileStatus = await moveFileToFolder(file.data.id, folderId); expect(movedFileStatus).toEqual(200); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v3_recover_drives.js b/drive/snippets/test/test_drive_v3_recover_drives.js index 7f80c3f3..f991f1e4 100644 --- a/drive/snippets/test/test_drive_v3_recover_drives.js +++ b/drive/snippets/test/test_drive_v3_recover_drives.js @@ -28,11 +28,11 @@ describe('Drive snippets', () => { // Note, you must enable creating Team Drives for your service account. // https://support.google.com/a/answer/7337635?hl=en - it('should recover team drives', (async () => { + it('should recover team drives', async () => { await createOrphanedTeamDrive(); const teamDrives = await recoverDrives('soheil@workspacesamples.dev'); expect(teamDrives.length).toBeDefined(); - })); + }); /** * Creates a standalone Team Drive. @@ -52,5 +52,5 @@ describe('Drive snippets', () => { }); }); return fileId; - }; + } }); diff --git a/drive/snippets/test/test_drive_v3_search_file.js b/drive/snippets/test/test_drive_v3_search_file.js index 0f2bc041..fc281c12 100644 --- a/drive/snippets/test/test_drive_v3_search_file.js +++ b/drive/snippets/test/test_drive_v3_search_file.js @@ -29,9 +29,9 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should search files', (async () => { + it('should search files', async () => { await helpers.createTestBlob(); const files = await searchFiles(); expect(files.length).toBeDefined(); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v3_share_file.js b/drive/snippets/test/test_drive_v3_share_file.js index 3e513a18..8455b6f4 100644 --- a/drive/snippets/test/test_drive_v3_share_file.js +++ b/drive/snippets/test/test_drive_v3_share_file.js @@ -29,12 +29,13 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should share files', (async () => { + it('should share files', async () => { const file = await helpers.createTestBlob(); const ids = await shareFile( file.data.id, 'xyz@workspacesamples.dev', - 'workspacesamples.dev'); + 'workspacesamples.dev', + ); expect(ids.length).toEqual(2); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v3_touch_file.js b/drive/snippets/test/test_drive_v3_touch_file.js index 17072c2b..7341f8eb 100644 --- a/drive/snippets/test/test_drive_v3_touch_file.js +++ b/drive/snippets/test/test_drive_v3_touch_file.js @@ -29,10 +29,10 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should update the modified time', (async () => { + it('should update the modified time', async () => { const file = await helpers.createTestBlob(); const now = new Date().toISOString(); const modifiedTime = await touchFile(file.data.id, now); expect(modifiedTime).toEqual(now); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v3_upload_appdata.js b/drive/snippets/test/test_drive_v3_upload_appdata.js index dba13641..9723c40a 100644 --- a/drive/snippets/test/test_drive_v3_upload_appdata.js +++ b/drive/snippets/test/test_drive_v3_upload_appdata.js @@ -25,9 +25,9 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should upload a file', (async () => { + it('should upload a file', async () => { const id = await uploadAppdata('../files/config.json'); expect(id).toBeDefined(); helpers.deleteFileOnCleanup(id); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v3_upload_basic.js b/drive/snippets/test/test_drive_v3_upload_basic.js index a7e772de..6e7e410f 100644 --- a/drive/snippets/test/test_drive_v3_upload_basic.js +++ b/drive/snippets/test/test_drive_v3_upload_basic.js @@ -29,9 +29,9 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should upload a photo', (async () => { + it('should upload a photo', async () => { const id = await uploadBasic('../files/photo.jpg'); expect(id).toBeDefined(); helpers.deleteFileOnCleanup(id); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v3_upload_to_folder.js b/drive/snippets/test/test_drive_v3_upload_to_folder.js index b0c2cf96..40dd398e 100644 --- a/drive/snippets/test/test_drive_v3_upload_to_folder.js +++ b/drive/snippets/test/test_drive_v3_upload_to_folder.js @@ -30,11 +30,11 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should upload to a folder', (async () => { + it('should upload to a folder', async () => { const folderId = await createFolder(); helpers.deleteFileOnCleanup(folderId); const file = await uploadToFolder(folderId, '../files/photo.jpg'); expect(file).toBeDefined(); helpers.deleteFileOnCleanup(file); - })); + }); }); diff --git a/drive/snippets/test/test_drive_v3_upload_with_conversion.js b/drive/snippets/test/test_drive_v3_upload_with_conversion.js index 28b5a8c6..9162ddcc 100644 --- a/drive/snippets/test/test_drive_v3_upload_with_conversion.js +++ b/drive/snippets/test/test_drive_v3_upload_with_conversion.js @@ -29,9 +29,9 @@ describe('Drive snippets', () => { return helpers.cleanup(); }); - it('should upload and convert a document', (async () => { + it('should upload and convert a document', async () => { const id = await uploadWithConversion('../files/report.csv'); expect(id).toBeDefined(); helpers.deleteFileOnCleanup(id); - })); + }); }); diff --git a/forms/snippets/add_item.js b/forms/snippets/add_item.js index cb8afbca..cd3d7786 100644 --- a/forms/snippets/add_item.js +++ b/forms/snippets/add_item.js @@ -17,9 +17,7 @@ const path = require('path'); const google = require('@googleapis/forms'); -const { - authenticate, -} = require('@google-cloud/local-auth'); +const {authenticate} = require('@google-cloud/local-auth'); async function runSample(query) { const authClient = await authenticate({ @@ -31,8 +29,8 @@ async function runSample(query) { auth: authClient, }); const newForm = { - 'info': { - 'title': 'Creating a new form for batchUpdate in Node', + info: { + title: 'Creating a new form for batchUpdate in Node', }, }; const createResponse = await forms.forms.create({ @@ -42,22 +40,24 @@ async function runSample(query) { // Request body to add video item to a Form const update = { - 'requests': [{ - 'createItem': { - 'item': { - 'title': 'Homework video', - 'description': 'Quizzes in Google Forms', - 'videoItem': { - 'video': { - 'youtubeUri': 'https://www.youtube.com/watch?v=Lt5HqPvM-eI', + requests: [ + { + createItem: { + item: { + title: 'Homework video', + description: 'Quizzes in Google Forms', + videoItem: { + video: { + youtubeUri: 'https://www.youtube.com/watch?v=Lt5HqPvM-eI', + }, }, }, - }, - 'location': { - 'index': 0, + location: { + index: 0, + }, }, }, - }], + ], }; const updateResponse = await forms.forms.batchUpdate({ formId: createResponse.data.formId, diff --git a/forms/snippets/convert_form.js b/forms/snippets/convert_form.js index 3bfcfc8c..ee67442d 100644 --- a/forms/snippets/convert_form.js +++ b/forms/snippets/convert_form.js @@ -17,9 +17,7 @@ const path = require('path'); const google = require('@googleapis/forms'); -const { - authenticate, -} = require('@google-cloud/local-auth'); +const {authenticate} = require('@google-cloud/local-auth'); async function runSample(query) { const authClient = await authenticate({ @@ -31,8 +29,8 @@ async function runSample(query) { auth: authClient, }); const newForm = { - 'info': { - 'title': 'Creating a new form for batchUpdate in Node', + info: { + title: 'Creating a new form for batchUpdate in Node', }, }; const createResponse = await forms.forms.create({ @@ -42,16 +40,18 @@ async function runSample(query) { // Request body to convert form to a quiz const updateRequest = { - 'requests': [{ - 'updateSettings': { - 'settings': { - 'quizSettings': { - 'isQuiz': true, + requests: [ + { + updateSettings: { + settings: { + quizSettings: { + isQuiz: true, + }, }, + updateMask: 'quizSettings.isQuiz', }, - 'updateMask': 'quizSettings.isQuiz', }, - }], + ], }; const res = await forms.forms.batchUpdate({ formId: createResponse.data.formId, diff --git a/forms/snippets/create_form.js b/forms/snippets/create_form.js index 3acec619..b3c91a73 100644 --- a/forms/snippets/create_form.js +++ b/forms/snippets/create_form.js @@ -17,9 +17,7 @@ const path = require('path'); const google = require('@googleapis/forms'); -const { - authenticate, -} = require('@google-cloud/local-auth'); +const {authenticate} = require('@google-cloud/local-auth'); async function runSample(query) { const authClient = await authenticate({ @@ -31,8 +29,8 @@ async function runSample(query) { auth: authClient, }); const newForm = { - 'info': { - 'title': 'Creating a new form in Node', + info: { + title: 'Creating a new form in Node', }, }; const res = await forms.forms.create({ diff --git a/forms/snippets/create_watch.js b/forms/snippets/create_watch.js index 24793760..8cc5fb7e 100644 --- a/forms/snippets/create_watch.js +++ b/forms/snippets/create_watch.js @@ -30,13 +30,13 @@ async function runSample(query) { auth: authClient, }); const watchRequest = { - 'watch': { - 'target': { - 'topic': { - 'topicName': 'projects/', + watch: { + target: { + topic: { + topicName: 'projects/', }, }, - 'eventType': 'RESPONSES', + eventType: 'RESPONSES', }, }; const res = await forms.forms.watches.create({ diff --git a/forms/snippets/get_all_responses.js b/forms/snippets/get_all_responses.js index c9488594..9f69bde4 100644 --- a/forms/snippets/get_all_responses.js +++ b/forms/snippets/get_all_responses.js @@ -17,9 +17,7 @@ const path = require('path'); const google = require('@googleapis/forms'); -const { - authenticate, -} = require('@google-cloud/local-auth'); +const {authenticate} = require('@google-cloud/local-auth'); const formID = ''; diff --git a/forms/snippets/get_single_response.js b/forms/snippets/get_single_response.js index 8e0a0d05..b538b6a6 100644 --- a/forms/snippets/get_single_response.js +++ b/forms/snippets/get_single_response.js @@ -17,9 +17,7 @@ const path = require('path'); const google = require('@googleapis/forms'); -const { - authenticate, -} = require('@google-cloud/local-auth'); +const {authenticate} = require('@google-cloud/local-auth'); const formID = ''; const responseID = ''; diff --git a/forms/snippets/package-lock.json b/forms/snippets/package-lock.json index 35893ae9..8f2e6c77 100644 --- a/forms/snippets/package-lock.json +++ b/forms/snippets/package-lock.json @@ -1,738 +1,738 @@ { - "name": "sheets-api-snippets", - "version": "1.0.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "sheets-api-snippets", - "version": "1.0.0", - "license": "Apache-2.0", - "dependencies": { - "googleapis": "^105.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/arrify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", - "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", - "engines": { - "node": ">=8" - } - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/bignumber.js": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.0.tgz", - "integrity": "sha512-4LwHK4nfDOraBCtst+wOWIHbu1vhvAPJK8g8nROd4iuc3PSEjWif/qwbkh8jwCJz6yDBvtU4KPynETgrfh7y3A==", - "engines": { - "node": "*" - } - }, - "node_modules/buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" - }, - "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/ecdsa-sig-formatter": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", - "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", - "dependencies": { - "safe-buffer": "^5.0.1" - } - }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "node_modules/fast-text-encoding": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.4.tgz", - "integrity": "sha512-x6lDDm/tBAzX9kmsPcZsNbvDs3Zey3+scsxaZElS8xWLgUMAg/oFLeewfUz0mu1CblHhhsu15jGkraldkFh8KQ==" - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "node_modules/gaxios": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-5.0.1.tgz", - "integrity": "sha512-keK47BGKHyyOVQxgcUaSaFvr3ehZYAlvhvpHXy0YB2itzZef+GqZR8TBsfVRWghdwlKrYsn+8L8i3eblF7Oviw==", - "dependencies": { - "extend": "^3.0.2", - "https-proxy-agent": "^5.0.0", - "is-stream": "^2.0.0", - "node-fetch": "^2.6.7" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/gcp-metadata": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.0.0.tgz", - "integrity": "sha512-gfwuX3yA3nNsHSWUL4KG90UulNiq922Ukj3wLTrcnX33BB7PwB1o0ubR8KVvXu9nJH+P5w1j2SQSNNqto+H0DA==", - "dependencies": { - "gaxios": "^5.0.0", - "json-bigint": "^1.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/google-auth-library": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-8.2.0.tgz", - "integrity": "sha512-wCWs44jLT3cbzONVk2NKK1sfWaKCqzR21cudG3r9tV53/DC/wImxEr7HK5OBlEU5Q1iepZsrdFOxvzmC0M/YRQ==", - "dependencies": { - "arrify": "^2.0.0", - "base64-js": "^1.3.0", - "ecdsa-sig-formatter": "^1.0.11", - "fast-text-encoding": "^1.0.0", - "gaxios": "^5.0.0", - "gcp-metadata": "^5.0.0", - "gtoken": "^6.0.0", - "jws": "^4.0.0", - "lru-cache": "^6.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/google-p12-pem": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-4.0.0.tgz", - "integrity": "sha512-lRTMn5ElBdDixv4a86bixejPSRk1boRtUowNepeKEVvYiFlkLuAJUVpEz6PfObDHYEKnZWq/9a2zC98xu62A9w==", - "dependencies": { - "node-forge": "^1.3.1" - }, - "bin": { - "gp12-pem": "build/src/bin/gp12-pem.js" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/googleapis": { - "version": "105.0.0", - "resolved": "https://registry.npmjs.org/googleapis/-/googleapis-105.0.0.tgz", - "integrity": "sha512-wH/jU/6QpqwsjTKj4vfKZz97ne7xT7BBbKwzQEwnbsG8iH9Seyw19P+AuLJcxNNrmgblwLqfr3LORg4Okat1BQ==", - "dependencies": { - "google-auth-library": "^8.0.2", - "googleapis-common": "^6.0.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/googleapis-common": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/googleapis-common/-/googleapis-common-6.0.1.tgz", - "integrity": "sha512-COe4g+58FoIkLUe4ljlCl6ytgSqPYIyCrT9kEp+VDL3Ca5NAOqExZ13whJUZklmSgxS3isEbTBt5c7SgD0kfMA==", - "dependencies": { - "extend": "^3.0.2", - "gaxios": "^5.0.1", - "google-auth-library": "^8.0.2", - "qs": "^6.7.0", - "url-template": "^2.0.8", - "uuid": "^8.0.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/gtoken": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-6.1.1.tgz", - "integrity": "sha512-HPM4VzzPEGxjQ7T2xLrdSYBs+h1c0yHAUiN+8RHPDoiZbndlpg9Sx3SjWcrTt9+N3FHsSABEpjvdQVan5AAuZQ==", - "dependencies": { - "gaxios": "^5.0.1", - "google-p12-pem": "^4.0.0", - "jws": "^4.0.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/json-bigint": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", - "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", - "dependencies": { - "bignumber.js": "^9.0.0" - } - }, - "node_modules/jwa": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", - "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", - "dependencies": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/jws": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", - "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", - "dependencies": { - "jwa": "^2.0.0", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/node-forge": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", - "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", - "engines": { - "node": ">= 6.13.0" - } - }, - "node_modules/object-inspect": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", - "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "node_modules/url-template": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz", - "integrity": "sha512-XdVKMF4SJ0nP/O7XIPB0JwAEuT9lDIYnNsK8yGVe43y0AWoKeJNdv3ZNWh7ksJ6KqQFjOO6ox/VEitLnaVNufw==" - }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "name": "sheets-api-snippets", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "sheets-api-snippets", + "version": "1.0.0", + "license": "Apache-2.0", + "dependencies": { + "googleapis": "^105.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "engines": { + "node": ">=8" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" } + ] }, - "dependencies": { - "agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "requires": { - "debug": "4" - } - }, - "arrify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", - "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==" - }, - "base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" - }, - "bignumber.js": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.0.tgz", - "integrity": "sha512-4LwHK4nfDOraBCtst+wOWIHbu1vhvAPJK8g8nROd4iuc3PSEjWif/qwbkh8jwCJz6yDBvtU4KPynETgrfh7y3A==" - }, - "buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" - }, - "call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - } - }, - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "requires": { - "ms": "2.1.2" - } - }, - "ecdsa-sig-formatter": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", - "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "fast-text-encoding": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.4.tgz", - "integrity": "sha512-x6lDDm/tBAzX9kmsPcZsNbvDs3Zey3+scsxaZElS8xWLgUMAg/oFLeewfUz0mu1CblHhhsu15jGkraldkFh8KQ==" - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "gaxios": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-5.0.1.tgz", - "integrity": "sha512-keK47BGKHyyOVQxgcUaSaFvr3ehZYAlvhvpHXy0YB2itzZef+GqZR8TBsfVRWghdwlKrYsn+8L8i3eblF7Oviw==", - "requires": { - "extend": "^3.0.2", - "https-proxy-agent": "^5.0.0", - "is-stream": "^2.0.0", - "node-fetch": "^2.6.7" - } - }, - "gcp-metadata": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.0.0.tgz", - "integrity": "sha512-gfwuX3yA3nNsHSWUL4KG90UulNiq922Ukj3wLTrcnX33BB7PwB1o0ubR8KVvXu9nJH+P5w1j2SQSNNqto+H0DA==", - "requires": { - "gaxios": "^5.0.0", - "json-bigint": "^1.0.0" - } - }, - "get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", - "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" - } - }, - "google-auth-library": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-8.2.0.tgz", - "integrity": "sha512-wCWs44jLT3cbzONVk2NKK1sfWaKCqzR21cudG3r9tV53/DC/wImxEr7HK5OBlEU5Q1iepZsrdFOxvzmC0M/YRQ==", - "requires": { - "arrify": "^2.0.0", - "base64-js": "^1.3.0", - "ecdsa-sig-formatter": "^1.0.11", - "fast-text-encoding": "^1.0.0", - "gaxios": "^5.0.0", - "gcp-metadata": "^5.0.0", - "gtoken": "^6.0.0", - "jws": "^4.0.0", - "lru-cache": "^6.0.0" - } - }, - "google-p12-pem": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-4.0.0.tgz", - "integrity": "sha512-lRTMn5ElBdDixv4a86bixejPSRk1boRtUowNepeKEVvYiFlkLuAJUVpEz6PfObDHYEKnZWq/9a2zC98xu62A9w==", - "requires": { - "node-forge": "^1.3.1" - } - }, - "googleapis": { - "version": "105.0.0", - "resolved": "https://registry.npmjs.org/googleapis/-/googleapis-105.0.0.tgz", - "integrity": "sha512-wH/jU/6QpqwsjTKj4vfKZz97ne7xT7BBbKwzQEwnbsG8iH9Seyw19P+AuLJcxNNrmgblwLqfr3LORg4Okat1BQ==", - "requires": { - "google-auth-library": "^8.0.2", - "googleapis-common": "^6.0.0" - } - }, - "googleapis-common": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/googleapis-common/-/googleapis-common-6.0.1.tgz", - "integrity": "sha512-COe4g+58FoIkLUe4ljlCl6ytgSqPYIyCrT9kEp+VDL3Ca5NAOqExZ13whJUZklmSgxS3isEbTBt5c7SgD0kfMA==", - "requires": { - "extend": "^3.0.2", - "gaxios": "^5.0.1", - "google-auth-library": "^8.0.2", - "qs": "^6.7.0", - "url-template": "^2.0.8", - "uuid": "^8.0.0" - } - }, - "gtoken": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-6.1.1.tgz", - "integrity": "sha512-HPM4VzzPEGxjQ7T2xLrdSYBs+h1c0yHAUiN+8RHPDoiZbndlpg9Sx3SjWcrTt9+N3FHsSABEpjvdQVan5AAuZQ==", - "requires": { - "gaxios": "^5.0.1", - "google-p12-pem": "^4.0.0", - "jws": "^4.0.0" - } - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" - }, - "https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "requires": { - "agent-base": "6", - "debug": "4" - } - }, - "is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" - }, - "json-bigint": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", - "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", - "requires": { - "bignumber.js": "^9.0.0" - } - }, - "jwa": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", - "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", - "requires": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - } - }, - "jws": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", - "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", - "requires": { - "jwa": "^2.0.0", - "safe-buffer": "^5.0.1" - } - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "requires": { - "whatwg-url": "^5.0.0" - } - }, - "node-forge": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", - "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==" - }, - "object-inspect": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", - "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==" - }, - "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "requires": { - "side-channel": "^1.0.4" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" - }, - "side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "requires": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - } - }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "url-template": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz", - "integrity": "sha512-XdVKMF4SJ0nP/O7XIPB0JwAEuT9lDIYnNsK8yGVe43y0AWoKeJNdv3ZNWh7ksJ6KqQFjOO6ox/VEitLnaVNufw==" - }, - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" - }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "node_modules/bignumber.js": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.0.tgz", + "integrity": "sha512-4LwHK4nfDOraBCtst+wOWIHbu1vhvAPJK8g8nROd4iuc3PSEjWif/qwbkh8jwCJz6yDBvtU4KPynETgrfh7y3A==", + "engines": { + "node": "*" + } + }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "node_modules/fast-text-encoding": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.4.tgz", + "integrity": "sha512-x6lDDm/tBAzX9kmsPcZsNbvDs3Zey3+scsxaZElS8xWLgUMAg/oFLeewfUz0mu1CblHhhsu15jGkraldkFh8KQ==" + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/gaxios": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-5.0.1.tgz", + "integrity": "sha512-keK47BGKHyyOVQxgcUaSaFvr3ehZYAlvhvpHXy0YB2itzZef+GqZR8TBsfVRWghdwlKrYsn+8L8i3eblF7Oviw==", + "dependencies": { + "extend": "^3.0.2", + "https-proxy-agent": "^5.0.0", + "is-stream": "^2.0.0", + "node-fetch": "^2.6.7" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/gcp-metadata": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.0.0.tgz", + "integrity": "sha512-gfwuX3yA3nNsHSWUL4KG90UulNiq922Ukj3wLTrcnX33BB7PwB1o0ubR8KVvXu9nJH+P5w1j2SQSNNqto+H0DA==", + "dependencies": { + "gaxios": "^5.0.0", + "json-bigint": "^1.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/get-intrinsic": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", + "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/google-auth-library": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-8.2.0.tgz", + "integrity": "sha512-wCWs44jLT3cbzONVk2NKK1sfWaKCqzR21cudG3r9tV53/DC/wImxEr7HK5OBlEU5Q1iepZsrdFOxvzmC0M/YRQ==", + "dependencies": { + "arrify": "^2.0.0", + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "fast-text-encoding": "^1.0.0", + "gaxios": "^5.0.0", + "gcp-metadata": "^5.0.0", + "gtoken": "^6.0.0", + "jws": "^4.0.0", + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/google-p12-pem": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-4.0.0.tgz", + "integrity": "sha512-lRTMn5ElBdDixv4a86bixejPSRk1boRtUowNepeKEVvYiFlkLuAJUVpEz6PfObDHYEKnZWq/9a2zC98xu62A9w==", + "dependencies": { + "node-forge": "^1.3.1" + }, + "bin": { + "gp12-pem": "build/src/bin/gp12-pem.js" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/googleapis": { + "version": "105.0.0", + "resolved": "https://registry.npmjs.org/googleapis/-/googleapis-105.0.0.tgz", + "integrity": "sha512-wH/jU/6QpqwsjTKj4vfKZz97ne7xT7BBbKwzQEwnbsG8iH9Seyw19P+AuLJcxNNrmgblwLqfr3LORg4Okat1BQ==", + "dependencies": { + "google-auth-library": "^8.0.2", + "googleapis-common": "^6.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/googleapis-common": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/googleapis-common/-/googleapis-common-6.0.1.tgz", + "integrity": "sha512-COe4g+58FoIkLUe4ljlCl6ytgSqPYIyCrT9kEp+VDL3Ca5NAOqExZ13whJUZklmSgxS3isEbTBt5c7SgD0kfMA==", + "dependencies": { + "extend": "^3.0.2", + "gaxios": "^5.0.1", + "google-auth-library": "^8.0.2", + "qs": "^6.7.0", + "url-template": "^2.0.8", + "uuid": "^8.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/gtoken": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-6.1.1.tgz", + "integrity": "sha512-HPM4VzzPEGxjQ7T2xLrdSYBs+h1c0yHAUiN+8RHPDoiZbndlpg9Sx3SjWcrTt9+N3FHsSABEpjvdQVan5AAuZQ==", + "dependencies": { + "gaxios": "^5.0.1", + "google-p12-pem": "^4.0.0", + "jws": "^4.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "dependencies": { + "bignumber.js": "^9.0.0" + } + }, + "node_modules/jwa": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", + "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", + "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", + "dependencies": { + "jwa": "^2.0.0", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-forge": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", + "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", + "engines": { + "node": ">= 6.13.0" + } + }, + "node_modules/object-inspect": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", + "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" } + ] + }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "node_modules/url-template": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz", + "integrity": "sha512-XdVKMF4SJ0nP/O7XIPB0JwAEuT9lDIYnNsK8yGVe43y0AWoKeJNdv3ZNWh7ksJ6KqQFjOO6ox/VEitLnaVNufw==" + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + }, + "dependencies": { + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "requires": { + "debug": "4" + } + }, + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==" + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, + "bignumber.js": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.0.tgz", + "integrity": "sha512-4LwHK4nfDOraBCtst+wOWIHbu1vhvAPJK8g8nROd4iuc3PSEjWif/qwbkh8jwCJz6yDBvtU4KPynETgrfh7y3A==" + }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "fast-text-encoding": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.4.tgz", + "integrity": "sha512-x6lDDm/tBAzX9kmsPcZsNbvDs3Zey3+scsxaZElS8xWLgUMAg/oFLeewfUz0mu1CblHhhsu15jGkraldkFh8KQ==" + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "gaxios": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-5.0.1.tgz", + "integrity": "sha512-keK47BGKHyyOVQxgcUaSaFvr3ehZYAlvhvpHXy0YB2itzZef+GqZR8TBsfVRWghdwlKrYsn+8L8i3eblF7Oviw==", + "requires": { + "extend": "^3.0.2", + "https-proxy-agent": "^5.0.0", + "is-stream": "^2.0.0", + "node-fetch": "^2.6.7" + } + }, + "gcp-metadata": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.0.0.tgz", + "integrity": "sha512-gfwuX3yA3nNsHSWUL4KG90UulNiq922Ukj3wLTrcnX33BB7PwB1o0ubR8KVvXu9nJH+P5w1j2SQSNNqto+H0DA==", + "requires": { + "gaxios": "^5.0.0", + "json-bigint": "^1.0.0" + } + }, + "get-intrinsic": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", + "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.3" + } + }, + "google-auth-library": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-8.2.0.tgz", + "integrity": "sha512-wCWs44jLT3cbzONVk2NKK1sfWaKCqzR21cudG3r9tV53/DC/wImxEr7HK5OBlEU5Q1iepZsrdFOxvzmC0M/YRQ==", + "requires": { + "arrify": "^2.0.0", + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "fast-text-encoding": "^1.0.0", + "gaxios": "^5.0.0", + "gcp-metadata": "^5.0.0", + "gtoken": "^6.0.0", + "jws": "^4.0.0", + "lru-cache": "^6.0.0" + } + }, + "google-p12-pem": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-4.0.0.tgz", + "integrity": "sha512-lRTMn5ElBdDixv4a86bixejPSRk1boRtUowNepeKEVvYiFlkLuAJUVpEz6PfObDHYEKnZWq/9a2zC98xu62A9w==", + "requires": { + "node-forge": "^1.3.1" + } + }, + "googleapis": { + "version": "105.0.0", + "resolved": "https://registry.npmjs.org/googleapis/-/googleapis-105.0.0.tgz", + "integrity": "sha512-wH/jU/6QpqwsjTKj4vfKZz97ne7xT7BBbKwzQEwnbsG8iH9Seyw19P+AuLJcxNNrmgblwLqfr3LORg4Okat1BQ==", + "requires": { + "google-auth-library": "^8.0.2", + "googleapis-common": "^6.0.0" + } + }, + "googleapis-common": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/googleapis-common/-/googleapis-common-6.0.1.tgz", + "integrity": "sha512-COe4g+58FoIkLUe4ljlCl6ytgSqPYIyCrT9kEp+VDL3Ca5NAOqExZ13whJUZklmSgxS3isEbTBt5c7SgD0kfMA==", + "requires": { + "extend": "^3.0.2", + "gaxios": "^5.0.1", + "google-auth-library": "^8.0.2", + "qs": "^6.7.0", + "url-template": "^2.0.8", + "uuid": "^8.0.0" + } + }, + "gtoken": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-6.1.1.tgz", + "integrity": "sha512-HPM4VzzPEGxjQ7T2xLrdSYBs+h1c0yHAUiN+8RHPDoiZbndlpg9Sx3SjWcrTt9+N3FHsSABEpjvdQVan5AAuZQ==", + "requires": { + "gaxios": "^5.0.1", + "google-p12-pem": "^4.0.0", + "jws": "^4.0.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + }, + "https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "requires": { + "agent-base": "6", + "debug": "4" + } + }, + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" + }, + "json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "requires": { + "bignumber.js": "^9.0.0" + } + }, + "jwa": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", + "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", + "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", + "requires": { + "jwa": "^2.0.0", + "safe-buffer": "^5.0.1" + } + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + } + }, + "node-forge": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", + "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==" + }, + "object-inspect": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", + "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==" + }, + "qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "requires": { + "side-channel": "^1.0.4" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "requires": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + } + }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "url-template": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz", + "integrity": "sha512-XdVKMF4SJ0nP/O7XIPB0JwAEuT9lDIYnNsK8yGVe43y0AWoKeJNdv3ZNWh7ksJ6KqQFjOO6ox/VEitLnaVNufw==" + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" } + } } diff --git a/forms/snippets/package.json b/forms/snippets/package.json index 66160702..01cb5f33 100644 --- a/forms/snippets/package.json +++ b/forms/snippets/package.json @@ -1,16 +1,14 @@ { - "name": "sheets-api-snippets", - "version": "1.0.0", - "description": "Code snippets for the Sheets API", - "private": true, - "scripts": { - }, - "engines": { - "node": ">=14" - }, - "license": "Apache-2.0", - "dependencies": { - "googleapis": "^105.0.0" - } + "name": "sheets-api-snippets", + "version": "1.0.0", + "description": "Code snippets for the Sheets API", + "private": true, + "scripts": {}, + "engines": { + "node": ">=14" + }, + "license": "Apache-2.0", + "dependencies": { + "googleapis": "^105.0.0" } - \ No newline at end of file +} diff --git a/forms/snippets/update_form.js b/forms/snippets/update_form.js index 20de16e0..eb443aea 100644 --- a/forms/snippets/update_form.js +++ b/forms/snippets/update_form.js @@ -16,9 +16,7 @@ const path = require('path'); const google = require('@googleapis/forms'); -const { - authenticate, -} = require('@google-cloud/local-auth'); +const {authenticate} = require('@google-cloud/local-auth'); async function runSample(query) { const authClient = await authenticate({ @@ -30,8 +28,8 @@ async function runSample(query) { auth: authClient, }); const newForm = { - 'info': { - 'title': 'Creating a new form for batchUpdate in Node', + info: { + title: 'Creating a new form for batchUpdate in Node', }, }; const createResponse = await forms.forms.create({ @@ -41,14 +39,17 @@ async function runSample(query) { // Request body to add description to a Form const update = { - 'requests': [{ - 'updateFormInfo': { - 'info': { - 'description': 'Please complete this quiz based on this week\'s readings for class.', + requests: [ + { + updateFormInfo: { + info: { + description: + 'Please complete this quiz based on this week\'s readings for class.', + }, + updateMask: 'description', }, - 'updateMask': 'description', }, - }], + ], }; const res = await forms.forms.batchUpdate({ formId: createResponse.data.formId, diff --git a/gmail/quickstart/index.js b/gmail/quickstart/index.js index d97052bf..7ec90638 100644 --- a/gmail/quickstart/index.js +++ b/gmail/quickstart/index.js @@ -1,6 +1,5 @@ /** - * @license - * Copyright Google Inc. + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/people/quickstart/index.js b/people/quickstart/index.js index b40033f9..866475d0 100644 --- a/people/quickstart/index.js +++ b/people/quickstart/index.js @@ -1,6 +1,5 @@ /** - * @license - * Copyright Google Inc. + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/renovate.json b/renovate.json index 8f8af822..0e452b7e 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,4 @@ { - "extends": [ - "config:base" - ], + "extends": ["config:base"], "baseBranches": ["main"] } diff --git a/sheets/quickstart/index.js b/sheets/quickstart/index.js index f2c6c62e..c77f5612 100644 --- a/sheets/quickstart/index.js +++ b/sheets/quickstart/index.js @@ -1,6 +1,5 @@ /** - * @license - * Copyright Google Inc. + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/sheets/snippets/package.json b/sheets/snippets/package.json index 3cfe24f8..46296ee7 100644 --- a/sheets/snippets/package.json +++ b/sheets/snippets/package.json @@ -12,6 +12,5 @@ "google-auth-library": "^8.2.0", "googleapis": "^105.0.0", "mocha": "^10.0.0" - } } diff --git a/sheets/snippets/sheets_append_values.js b/sheets/snippets/sheets_append_values.js index 181d095a..9aaecab5 100644 --- a/sheets/snippets/sheets_append_values.js +++ b/sheets/snippets/sheets_append_values.js @@ -27,8 +27,9 @@ async function appendValues(spreadsheetId, range, valueInputOption, _values) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth( - {scopes: 'https://www.googleapis.com/auth/spreadsheet'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/spreadsheet', + }); const service = google.sheets({version: 'v4', auth}); let values = [ diff --git a/sheets/snippets/sheets_batch_get_values.js b/sheets/snippets/sheets_batch_get_values.js index 8ed90cfe..674e41e2 100644 --- a/sheets/snippets/sheets_batch_get_values.js +++ b/sheets/snippets/sheets_batch_get_values.js @@ -25,8 +25,9 @@ async function batchGetValues(spreadsheetId, _ranges) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth( - {scopes: 'https://www.googleapis.com/auth/spreadsheet'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/spreadsheet', + }); const service = google.sheets({version: 'v4', auth}); let ranges = [ diff --git a/sheets/snippets/sheets_batch_update.js b/sheets/snippets/sheets_batch_update.js index 4543269a..be9c8db7 100644 --- a/sheets/snippets/sheets_batch_update.js +++ b/sheets/snippets/sheets_batch_update.js @@ -27,8 +27,9 @@ async function batchUpdate(spreadsheetId, title, find, replacement) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth( - {scopes: 'https://www.googleapis.com/auth/spreadsheets'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/spreadsheets', + }); const service = google.sheets({version: 'v4', auth}); const requests = []; @@ -67,4 +68,3 @@ async function batchUpdate(spreadsheetId, title, find, replacement) { // [END sheets_batch_update] module.exports = {batchUpdate}; - diff --git a/sheets/snippets/sheets_batch_update_values.js b/sheets/snippets/sheets_batch_update_values.js index 59dc5140..a8504da7 100644 --- a/sheets/snippets/sheets_batch_update_values.js +++ b/sheets/snippets/sheets_batch_update_values.js @@ -23,12 +23,18 @@ * @param {(string[])[]} _values A 2d array of values to update. * @return {obj} spreadsheet information */ -async function batchUpdateValues(spreadsheetId, range, valueInputOption, _values) { +async function batchUpdateValues( + spreadsheetId, + range, + valueInputOption, + _values, +) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth( - {scopes: 'https://www.googleapis.com/auth/spreadsheet'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/spreadsheet', + }); const service = google.sheets({version: 'v4', auth}); let values = [ @@ -40,10 +46,12 @@ async function batchUpdateValues(spreadsheetId, range, valueInputOption, _values // [START_EXCLUDE silent] values = _values; // [END_EXCLUDE] - const data = [{ - range, - values, - }]; + const data = [ + { + range, + values, + }, + ]; // Additional ranges to update ... const resource = { data, diff --git a/sheets/snippets/sheets_conditional_formatting.js b/sheets/snippets/sheets_conditional_formatting.js index e362c6eb..3a7912d3 100644 --- a/sheets/snippets/sheets_conditional_formatting.js +++ b/sheets/snippets/sheets_conditional_formatting.js @@ -24,8 +24,9 @@ async function conditionalFormatting(spreadsheetId) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth( - {scopes: 'https://www.googleapis.com/auth/spreadsheet'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/spreadsheet', + }); const service = google.sheets({version: 'v4', auth}); const myRange = { @@ -35,39 +36,42 @@ async function conditionalFormatting(spreadsheetId) { startColumnIndex: 0, endColumnIndex: 4, }; - const requests = [{ - addConditionalFormatRule: { - rule: { - ranges: [myRange], - booleanRule: { - condition: { - type: 'CUSTOM_FORMULA', - values: [{userEnteredValue: '=GT($D2,median($D$2:$D$11))'}], - }, - format: { - textFormat: {foregroundColor: {red: 0.8}}, + const requests = [ + { + addConditionalFormatRule: { + rule: { + ranges: [myRange], + booleanRule: { + condition: { + type: 'CUSTOM_FORMULA', + values: [{userEnteredValue: '=GT($D2,median($D$2:$D$11))'}], + }, + format: { + textFormat: {foregroundColor: {red: 0.8}}, + }, }, }, + index: 0, }, - index: 0, }, - }, { - addConditionalFormatRule: { - rule: { - ranges: [myRange], - booleanRule: { - condition: { - type: 'CUSTOM_FORMULA', - values: [{userEnteredValue: '=LT($D2,median($D$2:$D$11))'}], - }, - format: { - backgroundColor: {red: 1, green: 0.4, blue: 0.4}, + { + addConditionalFormatRule: { + rule: { + ranges: [myRange], + booleanRule: { + condition: { + type: 'CUSTOM_FORMULA', + values: [{userEnteredValue: '=LT($D2,median($D$2:$D$11))'}], + }, + format: { + backgroundColor: {red: 1, green: 0.4, blue: 0.4}, + }, }, }, + index: 0, }, - index: 0, }, - }]; + ]; const resource = { requests, }; diff --git a/sheets/snippets/sheets_create.js b/sheets/snippets/sheets_create.js index 01750e6f..c534145c 100644 --- a/sheets/snippets/sheets_create.js +++ b/sheets/snippets/sheets_create.js @@ -24,8 +24,9 @@ async function create(title) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth( - {scopes: 'https://www.googleapis.com/auth/spreadsheet'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/spreadsheet', + }); const service = google.sheets({version: 'v4', auth}); const resource = { diff --git a/sheets/snippets/sheets_get_values.js b/sheets/snippets/sheets_get_values.js index cb57aa70..91a37ea9 100644 --- a/sheets/snippets/sheets_get_values.js +++ b/sheets/snippets/sheets_get_values.js @@ -25,8 +25,9 @@ async function getValues(spreadsheetId, range) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth( - {scopes: 'https://www.googleapis.com/auth/spreadsheet'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/spreadsheet', + }); const service = google.sheets({version: 'v4', auth}); try { diff --git a/sheets/snippets/sheets_pivot_table.js b/sheets/snippets/sheets_pivot_table.js index b4a68406..f968c9b2 100644 --- a/sheets/snippets/sheets_pivot_table.js +++ b/sheets/snippets/sheets_pivot_table.js @@ -24,66 +24,77 @@ async function pivotTable(spreadsheetId) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth( - {scopes: 'https://www.googleapis.com/auth/spreadsheet'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/spreadsheet', + }); const service = google.sheets({version: 'v4', auth}); try { // Create two sheets for our pivot table - let requests = [{ - addSheet: {}, - }, { - addSheet: {}, - }]; + let requests = [ + { + addSheet: {}, + }, + { + addSheet: {}, + }, + ]; let resource = {requests}; let response = await service.spreadsheets.batchUpdate({ spreadsheetId, resource, }); - const sourceSheetId = - response.data.replies[0].addSheet.properties.sheetId; - const targetSheetId = - response.data.replies[1].addSheet.properties.sheetId; + const sourceSheetId = response.data.replies[0].addSheet.properties.sheetId; + const targetSheetId = response.data.replies[1].addSheet.properties.sheetId; - requests = [{ - updateCells: { - rows: { - values: [{ - pivotTable: { - source: { - sheetId: sourceSheetId, - startRowIndex: 0, - startColumnIndex: 0, - endRowIndex: 20, - endColumnIndex: 7, + requests = [ + { + updateCells: { + rows: { + values: [ + { + pivotTable: { + source: { + sheetId: sourceSheetId, + startRowIndex: 0, + startColumnIndex: 0, + endRowIndex: 20, + endColumnIndex: 7, + }, + rows: [ + { + sourceColumnOffset: 1, + showTotals: true, + sortOrder: 'ASCENDING', + }, + ], + columns: [ + { + sourceColumnOffset: 4, + sortOrder: 'ASCENDING', + showTotals: true, + }, + ], + values: [ + { + summarizeFunction: 'COUNTA', + sourceColumnOffset: 4, + }, + ], + valueLayout: 'HORIZONTAL', + }, }, - rows: [{ - sourceColumnOffset: 1, - showTotals: true, - sortOrder: 'ASCENDING', - }], - columns: [{ - sourceColumnOffset: 4, - sortOrder: 'ASCENDING', - showTotals: true, - }], - values: [{ - summarizeFunction: 'COUNTA', - sourceColumnOffset: 4, - }], - valueLayout: 'HORIZONTAL', - }, + ], }, - ], - }, - start: { - sheetId: targetSheetId, - rowIndex: 0, - columnIndex: 0, + start: { + sheetId: targetSheetId, + rowIndex: 0, + columnIndex: 0, + }, + fields: 'pivotTable', }, - fields: 'pivotTable', }, - }]; + ]; resource = { requests, }; diff --git a/sheets/snippets/sheets_update_values.js b/sheets/snippets/sheets_update_values.js index 71fbf04e..55ff468b 100644 --- a/sheets/snippets/sheets_update_values.js +++ b/sheets/snippets/sheets_update_values.js @@ -27,8 +27,9 @@ async function updateValues(spreadsheetId, range, valueInputOption, _values) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth( - {scopes: 'https://www.googleapis.com/auth/spreadsheet'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/spreadsheet', + }); const service = google.sheets({version: 'v4', auth}); let values = [ diff --git a/sheets/snippets/test/helpers.js b/sheets/snippets/test/helpers.js index e21e568e..be6b1447 100644 --- a/sheets/snippets/test/helpers.js +++ b/sheets/snippets/test/helpers.js @@ -25,11 +25,12 @@ class Helpers { * Creates the Google API Service */ constructor() { - const auth = new GoogleAuth( - {scopes: [ - 'https://www.googleapis.com/auth/spreadsheet', - 'https://www.googleapis.com/auth/drive', - ]}); + const auth = new GoogleAuth({ + scopes: [ + 'https://www.googleapis.com/auth/spreadsheet', + 'https://www.googleapis.com/auth/drive', + ], + }); this.sheetsService = google.sheets({version: 'v4', auth}); this.driveService = google.drive({version: 'v3', auth}); this.filesToDelete = []; @@ -55,8 +56,11 @@ class Helpers { * @return {Promise} returns list of deletion promises */ cleanup() { - return Promise.all(this.filesToDelete.map((fileId) => - this.driveService.files.delete({fileId}))); + return Promise.all( + this.filesToDelete.map((fileId) => + this.driveService.files.delete({fileId}), + ), + ); } /** @@ -85,23 +89,25 @@ class Helpers { await this.sheetsService.spreadsheets.batchUpdate({ spreadsheetId, resource: { - requests: [{ - repeatCell: { - range: { - sheetId: 0, - startRowIndex: 0, - endRowIndex: 10, - startColumnIndex: 0, - endColumnIndex: 10, - }, - cell: { - userEnteredValue: { - stringValue: 'Hello', + requests: [ + { + repeatCell: { + range: { + sheetId: 0, + startRowIndex: 0, + endRowIndex: 10, + startColumnIndex: 0, + endColumnIndex: 10, + }, + cell: { + userEnteredValue: { + stringValue: 'Hello', + }, }, + fields: 'userEnteredValue', }, - fields: 'userEnteredValue', }, - }], + ], }, }); return spreadsheetId; diff --git a/sheets/snippets/test/test_sheets_append_values.js b/sheets/snippets/test/test_sheets_append_values.js index 49329210..0d91f8e0 100644 --- a/sheets/snippets/test/test_sheets_append_values.js +++ b/sheets/snippets/test/test_sheets_append_values.js @@ -25,17 +25,22 @@ describe('Spreadsheet append values snippet', () => { return helpers.cleanup(); }); - it('should append values to a spreadsheet', (async () => { + it('should append values to a spreadsheet', async () => { const spreadsheetId = await helpers.createTestSpreadsheet(); await helpers.populateValues(spreadsheetId); - const result = await SheetsAppendValues.appendValues(spreadsheetId, 'Sheet1', 'USER_ENTERED', [ - ['A', 'B'], - ['C', 'D'], - ]); + const result = await SheetsAppendValues.appendValues( + spreadsheetId, + 'Sheet1', + 'USER_ENTERED', + [ + ['A', 'B'], + ['C', 'D'], + ], + ); expect(result.data.tableRange).toBe('Sheet1!A1:J10'); const updates = result.data.updates; expect(updates.updatedRows).toBe(2); expect(updates.updatedColumns).toBe(2); expect(updates.updatedCells).toBe(4); - })); + }); }); diff --git a/sheets/snippets/test/test_sheets_batch_get_values.js b/sheets/snippets/test/test_sheets_batch_get_values.js index 44ebe749..79e6b1ab 100644 --- a/sheets/snippets/test/test_sheets_batch_get_values.js +++ b/sheets/snippets/test/test_sheets_batch_get_values.js @@ -25,13 +25,16 @@ describe('Spreadsheet batch get values snippet', () => { return helpers.cleanup(); }); - it('should batch get spreadsheet values', (async () => { + it('should batch get spreadsheet values', async () => { const spreadsheetId = await helpers.createTestSpreadsheet(); await helpers.populateValues(spreadsheetId); - const result = await SheetsBatchGetValues.batchGetValues(spreadsheetId, ['A1:A3', 'B1:C1']); + const result = await SheetsBatchGetValues.batchGetValues(spreadsheetId, [ + 'A1:A3', + 'B1:C1', + ]); const valueRanges = result.data.valueRanges; expect(valueRanges.length).toBe(2); const values = valueRanges[0].values; expect(values.length).toBe(3); - })); + }); }); diff --git a/sheets/snippets/test/test_sheets_batch_update.js b/sheets/snippets/test/test_sheets_batch_update.js index 77a46d4b..289b8427 100644 --- a/sheets/snippets/test/test_sheets_batch_update.js +++ b/sheets/snippets/test/test_sheets_batch_update.js @@ -25,14 +25,18 @@ describe('Spreadsheet batch update snippet', () => { return helpers.cleanup(); }); - it('should batch update a spreadsheet', (async () => { + it('should batch update a spreadsheet', async () => { const spreadsheetId = await helpers.createTestSpreadsheet(); await helpers.populateValues(spreadsheetId); - const result = await SheetsBatchUpdate.batchUpdate(spreadsheetId, - 'New Title', 'Hello', 'Goodbye'); + const result = await SheetsBatchUpdate.batchUpdate( + spreadsheetId, + 'New Title', + 'Hello', + 'Goodbye', + ); const replies = result.data.replies; expect(replies.length).toBe(2); const findReplaceResponse = replies[1].findReplace; expect(findReplaceResponse.occurrencesChanged).toBe(100); - })); + }); }); diff --git a/sheets/snippets/test/test_sheets_batch_update_values.js b/sheets/snippets/test/test_sheets_batch_update_values.js index 10587c46..9cf6d7d5 100644 --- a/sheets/snippets/test/test_sheets_batch_update_values.js +++ b/sheets/snippets/test/test_sheets_batch_update_values.js @@ -24,17 +24,21 @@ describe('Spreadsheet batch update values snippet', () => { after(() => { return helpers.cleanup(); }); - it('should batch update spreadsheet values', (async () => { + it('should batch update spreadsheet values', async () => { const spreadsheetId = await helpers.createTestSpreadsheet(); - const result = await SheetsBatchUpdateValues.batchUpdateValues(spreadsheetId, - 'A1:B2', 'USER_ENTERED', [ + const result = await SheetsBatchUpdateValues.batchUpdateValues( + spreadsheetId, + 'A1:B2', + 'USER_ENTERED', + [ ['A', 'B'], ['C', 'D'], - ]); + ], + ); const responses = result.data.responses; expect(responses.length).toBe(1); expect(result.data.totalUpdatedRows).toBe(2); expect(result.data.totalUpdatedColumns).toBe(2); expect(result.data.totalUpdatedCells).toBe(4); - })); + }); }); diff --git a/sheets/snippets/test/test_sheets_conditional_formatting.js b/sheets/snippets/test/test_sheets_conditional_formatting.js index 42576694..d757aac2 100644 --- a/sheets/snippets/test/test_sheets_conditional_formatting.js +++ b/sheets/snippets/test/test_sheets_conditional_formatting.js @@ -25,10 +25,12 @@ describe('Spreadsheet conditional formatting snippet', () => { return helpers.cleanup(); }); - it('should conditionally format', (async () => { + it('should conditionally format', async () => { const spreadsheetId = await helpers.createTestSpreadsheet(); await helpers.populateValues(spreadsheetId); - const result = await SheetsConditionalFormatting.conditionalFormatting(spreadsheetId); + const result = await SheetsConditionalFormatting.conditionalFormatting( + spreadsheetId, + ); expect(result.data.replies.length).toBe(2); - })); + }); }); diff --git a/sheets/snippets/test/test_sheets_create.js b/sheets/snippets/test/test_sheets_create.js index 07e038b8..1c2e678b 100644 --- a/sheets/snippets/test/test_sheets_create.js +++ b/sheets/snippets/test/test_sheets_create.js @@ -25,9 +25,9 @@ describe('Spreadsheet create snippet', () => { return helpers.cleanup(); }); - it('should create a spreadsheet', (async () => { + it('should create a spreadsheet', async () => { const id = await SheetsCreate.create('Title'); expect(id).toBeDefined(); helpers.deleteFileOnCleanup(id); - })); + }); }); diff --git a/sheets/snippets/test/test_sheets_get_values.js b/sheets/snippets/test/test_sheets_get_values.js index 8c4741bb..1e5962f1 100644 --- a/sheets/snippets/test/test_sheets_get_values.js +++ b/sheets/snippets/test/test_sheets_get_values.js @@ -25,12 +25,12 @@ describe('Spreadsheet get values snippet', () => { return helpers.cleanup(); }); - it('should get spreadsheet values', (async () => { + it('should get spreadsheet values', async () => { const spreadsheetId = await helpers.createTestSpreadsheet(); await helpers.populateValues(spreadsheetId); const result = await SheetsGetValues.getValues(spreadsheetId, 'A1:C2'); const values = result.data.values; expect(values.length).toBe(2); expect(values[0].length).toBe(3); - })); + }); }); diff --git a/sheets/snippets/test/test_sheets_pivot_table.js b/sheets/snippets/test/test_sheets_pivot_table.js index b1490957..b9f4f2f7 100644 --- a/sheets/snippets/test/test_sheets_pivot_table.js +++ b/sheets/snippets/test/test_sheets_pivot_table.js @@ -25,10 +25,10 @@ describe('Spreadsheet pivot table snippet', () => { return helpers.cleanup(); }); - it('should create pivot tables', (async () => { + it('should create pivot tables', async () => { const spreadsheetId = await helpers.createTestSpreadsheet(); await helpers.populateValues(spreadsheetId); const result = await SheetsPivotTable.pivotTable(spreadsheetId); expect(result).toBeDefined(); - })); + }); }); diff --git a/sheets/snippets/test/test_sheets_update_values.js b/sheets/snippets/test/test_sheets_update_values.js index 64adc392..a49ce295 100644 --- a/sheets/snippets/test/test_sheets_update_values.js +++ b/sheets/snippets/test/test_sheets_update_values.js @@ -25,14 +25,19 @@ describe('Spreadsheet update values snippet', () => { return helpers.cleanup(); }); - it('should update spreadsheet values', (async () => { + it('should update spreadsheet values', async () => { const spreadsheetId = await helpers.createTestSpreadsheet(); - const result = await SheetsUpdateValues.updateValues(spreadsheetId, 'A1:B2', 'USER_ENTERED', [ - ['A', 'B'], - ['C', 'D'], - ]); + const result = await SheetsUpdateValues.updateValues( + spreadsheetId, + 'A1:B2', + 'USER_ENTERED', + [ + ['A', 'B'], + ['C', 'D'], + ], + ); expect(result.data.updatedRows).toBe(2); expect(result.data.updatedColumns).toBe(2); expect(result.data.updatedCells).toBe(4); - })); + }); }); diff --git a/slides/quickstart/index.js b/slides/quickstart/index.js index fedb7554..d93b486c 100644 --- a/slides/quickstart/index.js +++ b/slides/quickstart/index.js @@ -1,6 +1,5 @@ /** - * @license - * Copyright Google Inc. + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -100,7 +99,9 @@ async function listSlides(auth) { } console.log('The presentation contains %s slides:', slides.length); res.data.slides.forEach((slide, i) => { - console.log(`- Slide #${i + 1} contains ${slide.pageElements.length} elements.`); + console.log( + `- Slide #${i + 1} contains ${slide.pageElements.length} elements.`, + ); }); } authorize().then(listSlides).catch(console.error); diff --git a/slides/snippets/slides_copy_presentation.js b/slides/snippets/slides_copy_presentation.js index b1fa95bd..38b7c047 100644 --- a/slides/snippets/slides_copy_presentation.js +++ b/slides/snippets/slides_copy_presentation.js @@ -24,8 +24,9 @@ async function copyPresentation(presentationId, copyTitle) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth( - {scopes: 'https://www.googleapis.com/auth/drive'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/drive', + }); const service = google.drive({version: 'v2', auth}); const request = { diff --git a/slides/snippets/slides_create_bulleted_text.js b/slides/snippets/slides_create_bulleted_text.js index 015bae80..ef4e8065 100644 --- a/slides/snippets/slides_create_bulleted_text.js +++ b/slides/snippets/slides_create_bulleted_text.js @@ -24,21 +24,24 @@ async function createBulletedText(presentationId, shapeId) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth( - {scopes: 'https://www.googleapis.com/auth/presentations'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/presentations', + }); const service = google.slides({version: 'v1', auth}); // Add arrow-diamond-disc bullets to all text in the shape. - const requests = [{ - createParagraphBullets: { - objectId: shapeId, - textRange: { - type: 'ALL', + const requests = [ + { + createParagraphBullets: { + objectId: shapeId, + textRange: { + type: 'ALL', + }, + bulletPreset: 'BULLET_ARROW_DIAMOND_DISC', }, - bulletPreset: 'BULLET_ARROW_DIAMOND_DISC', }, - }]; + ]; // Execute the requests. try { diff --git a/slides/snippets/slides_create_image.js b/slides/snippets/slides_create_image.js index 1bc4735a..1e1a1b30 100644 --- a/slides/snippets/slides_create_image.js +++ b/slides/snippets/slides_create_image.js @@ -24,8 +24,9 @@ async function createImage(presentationId, pageId) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth( - {scopes: 'https://www.googleapis.com/auth/presentations'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/presentations', + }); const service = google.slides({version: 'v1', auth}); @@ -37,26 +38,28 @@ async function createImage(presentationId, pageId) { magnitude: 4000000, unit: 'EMU', }; - const requests = [{ - createImage: { - objectId: imageId, - url: imageUrl, - elementProperties: { - pageObjectId: pageId, - size: { - height: emu4M, - width: emu4M, - }, - transform: { - scaleX: 1, - scaleY: 1, - translateX: 100000, - translateY: 100000, - unit: 'EMU', + const requests = [ + { + createImage: { + objectId: imageId, + url: imageUrl, + elementProperties: { + pageObjectId: pageId, + size: { + height: emu4M, + width: emu4M, + }, + transform: { + scaleX: 1, + scaleY: 1, + translateX: 100000, + translateY: 100000, + unit: 'EMU', + }, }, }, }, - }]; + ]; // Execute the request. try { @@ -65,7 +68,9 @@ async function createImage(presentationId, pageId) { resource: {requests}, }); const createImageResponse = response.data.replies; - console.log(`Created image with ID: ${createImageResponse[0].createImage.objectId}`); + console.log( + `Created image with ID: ${createImageResponse[0].createImage.objectId}`, + ); return createImageResponse; } catch (err) { // TODO (developer) - Handle exception @@ -75,4 +80,3 @@ async function createImage(presentationId, pageId) { // [END slides_create_image] module.exports = {createImage}; - diff --git a/slides/snippets/slides_create_presentation.js b/slides/snippets/slides_create_presentation.js index 9e4717de..63c0f005 100644 --- a/slides/snippets/slides_create_presentation.js +++ b/slides/snippets/slides_create_presentation.js @@ -23,15 +23,18 @@ async function createPresentation(title) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth( - {scopes: 'https://www.googleapis.com/auth/presentations'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/presentations', + }); const service = google.slides({version: 'v1', auth}); try { const presentation = await service.presentations.create({ title, }); - console.log(`Created presentation with ID: ${presentation.data.presentationId}`); + console.log( + `Created presentation with ID: ${presentation.data.presentationId}`, + ); return presentation; } catch (err) { // TODO (developer) - Handle exception @@ -41,4 +44,3 @@ async function createPresentation(title) { // [END slides_create_presentation] module.exports = {createPresentation}; - diff --git a/slides/snippets/slides_create_sheets_chart.js b/slides/snippets/slides_create_sheets_chart.js index fe8e60a7..f926e11c 100644 --- a/slides/snippets/slides_create_sheets_chart.js +++ b/slides/snippets/slides_create_sheets_chart.js @@ -22,12 +22,18 @@ * @param {string} spreadsheetId The spreadsheet ID. * @param {string} sheetChartId The sheet's chart ID. */ -async function createSheetsChart(presentationId, pageId, spreadsheetId, sheetChartId) { +async function createSheetsChart( + presentationId, + pageId, + spreadsheetId, + sheetChartId, +) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth( - {scopes: 'https://www.googleapis.com/auth/presentations'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/presentations', + }); const service = google.slides({version: 'v1', auth}); @@ -39,28 +45,30 @@ async function createSheetsChart(presentationId, pageId, spreadsheetId, sheetCha unit: 'EMU', }; const presentationChartId = 'MyEmbeddedChart'; - const requests = [{ - createSheetsChart: { - objectId: presentationChartId, - spreadsheetId: spreadsheetId, - chartId: sheetChartId, - linkingMode: 'LINKED', - elementProperties: { - pageObjectId: pageId, - size: { - height: emu4M, - width: emu4M, - }, - transform: { - scaleX: 1, - scaleY: 1, - translateX: 100000, - translateY: 100000, - unit: 'EMU', + const requests = [ + { + createSheetsChart: { + objectId: presentationChartId, + spreadsheetId: spreadsheetId, + chartId: sheetChartId, + linkingMode: 'LINKED', + elementProperties: { + pageObjectId: pageId, + size: { + height: emu4M, + width: emu4M, + }, + transform: { + scaleX: 1, + scaleY: 1, + translateX: 100000, + translateY: 100000, + unit: 'EMU', + }, }, }, }, - }]; + ]; // Execute the request. try { diff --git a/slides/snippets/slides_create_slide.js b/slides/snippets/slides_create_slide.js index 296d0925..211ac3e3 100644 --- a/slides/snippets/slides_create_slide.js +++ b/slides/snippets/slides_create_slide.js @@ -24,19 +24,22 @@ async function createSlide(presentationId, pageId) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth( - {scopes: 'https://www.googleapis.com/auth/presentations'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/presentations', + }); const service = google.slides({version: 'v1', auth}); - const requests = [{ - createSlide: { - objectId: pageId, - insertionIndex: '1', - slideLayoutReference: { - predefinedLayout: 'TITLE_AND_TWO_COLUMNS', + const requests = [ + { + createSlide: { + objectId: pageId, + insertionIndex: '1', + slideLayoutReference: { + predefinedLayout: 'TITLE_AND_TWO_COLUMNS', + }, }, }, - }]; + ]; // If you wish to populate the slide with elements, add element create requests here, // using the pageId. @@ -48,7 +51,9 @@ async function createSlide(presentationId, pageId) { requests, }, }); - console.log(`Created slide with ID: ${res.data.replies[0].createSlide.objectId}`); + console.log( + `Created slide with ID: ${res.data.replies[0].createSlide.objectId}`, + ); return res; } catch (err) { // TODO (developer) - handle exception @@ -58,4 +63,3 @@ async function createSlide(presentationId, pageId) { // [END slides_create_slide] module.exports = {createSlide}; - diff --git a/slides/snippets/slides_create_textbox_with_text.js b/slides/snippets/slides_create_textbox_with_text.js index 29763b92..756b638d 100644 --- a/slides/snippets/slides_create_textbox_with_text.js +++ b/slides/snippets/slides_create_textbox_with_text.js @@ -24,8 +24,9 @@ async function createTextboxWithText(presentationId, pageId) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth( - {scopes: 'https://www.googleapis.com/auth/presentations'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/presentations', + }); const service = google.slides({version: 'v1', auth}); const elementId = 'MyTextBox_01'; @@ -33,41 +34,45 @@ async function createTextboxWithText(presentationId, pageId) { magnitude: 350, unit: 'PT', }; - const requests = [{ - createShape: { - objectId: elementId, - shapeType: 'TEXT_BOX', - elementProperties: { - pageObjectId: pageId, - size: { - height: pt350, - width: pt350, - }, - transform: { - scaleX: 1, - scaleY: 1, - translateX: 350, - translateY: 100, - unit: 'PT', + const requests = [ + { + createShape: { + objectId: elementId, + shapeType: 'TEXT_BOX', + elementProperties: { + pageObjectId: pageId, + size: { + height: pt350, + width: pt350, + }, + transform: { + scaleX: 1, + scaleY: 1, + translateX: 350, + translateY: 100, + unit: 'PT', + }, }, }, }, - }, - // Insert text into the box, using the supplied element ID. - { - insertText: { - objectId: elementId, - insertionIndex: 0, - text: 'New Box Text Inserted!', + // Insert text into the box, using the supplied element ID. + { + insertText: { + objectId: elementId, + insertionIndex: 0, + text: 'New Box Text Inserted!', + }, }, - }]; + ]; // Execute the request. try { - const createTextboxWithTextResponse = await service.presentations.batchUpdate({ - presentationId, - resource: {requests}, - }); - const createShapeResponse = createTextboxWithTextResponse.data.replies[0].createShape; + const createTextboxWithTextResponse = + await service.presentations.batchUpdate({ + presentationId, + resource: {requests}, + }); + const createShapeResponse = + createTextboxWithTextResponse.data.replies[0].createShape; console.log(`Created textbox with ID: ${createShapeResponse.objectId}`); return createTextboxWithTextResponse.data; } catch (err) { diff --git a/slides/snippets/slides_image_merging.js b/slides/snippets/slides_image_merging.js index 502fdc7b..abfe8fbc 100644 --- a/slides/snippets/slides_image_merging.js +++ b/slides/snippets/slides_image_merging.js @@ -25,9 +25,12 @@ async function imageMerging(templatePresentationId, imageUrl, customerName) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth( - {scopes: ['https://www.googleapis.com/auth/presentations', - 'https://www.googleapis.com/auth/drive']}); + const auth = new GoogleAuth({ + scopes: [ + 'https://www.googleapis.com/auth/presentations', + 'https://www.googleapis.com/auth/drive', + ], + }); const slidesService = google.slides({version: 'v1', auth}); const driveService = google.drive({version: 'v2', auth}); @@ -46,25 +49,28 @@ async function imageMerging(templatePresentationId, imageUrl, customerName) { const presentationCopyId = driveResponse.data.id; // Create the image merge (replaceAllShapesWithImage) requests. - const requests = [{ - replaceAllShapesWithImage: { - imageUrl: logoUrl, - replaceMethod: 'CENTER_INSIDE', - containsText: { - text: '{{company-logo}}', - matchCase: true, + const requests = [ + { + replaceAllShapesWithImage: { + imageUrl: logoUrl, + replaceMethod: 'CENTER_INSIDE', + containsText: { + text: '{{company-logo}}', + matchCase: true, + }, }, }, - }, { - replaceAllShapesWithImage: { - imageUrl: customerGraphicUrl, - replaceMethod: 'CENTER_INSIDE', - containsText: { - text: '{{customer-graphic}}', - matchCase: true, + { + replaceAllShapesWithImage: { + imageUrl: customerGraphicUrl, + replaceMethod: 'CENTER_INSIDE', + containsText: { + text: '{{customer-graphic}}', + matchCase: true, + }, }, }, - }]; + ]; // Execute the requests for this presentation. const batchUpdateResponse = await slidesService.presentations.batchUpdate({ @@ -75,8 +81,9 @@ async function imageMerging(templatePresentationId, imageUrl, customerName) { }); let numReplacements = 0; for (let i = 0; i < batchUpdateResponse.data.replies.length; ++i) { - numReplacements += batchUpdateResponse.data.replies[i] - .replaceAllShapesWithImage.occurrencesChanged; + numReplacements += + batchUpdateResponse.data.replies[i].replaceAllShapesWithImage + .occurrencesChanged; } console.log(`Created merged presentation with ID: ${presentationCopyId}`); console.log(`Replaced ${numReplacements} shapes with images.`); diff --git a/slides/snippets/slides_refresh_sheets_chart.js b/slides/snippets/slides_refresh_sheets_chart.js index 8a2ebc26..c9d9a703 100644 --- a/slides/snippets/slides_refresh_sheets_chart.js +++ b/slides/snippets/slides_refresh_sheets_chart.js @@ -24,16 +24,19 @@ async function refreshSheetsChart(presentationId, presentationChartId) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth( - {scopes: 'https://www.googleapis.com/auth/presentations'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/presentations', + }); const service = google.slides({version: 'v1', auth}); - const requests = [{ - refreshSheetsChart: { - objectId: presentationChartId, + const requests = [ + { + refreshSheetsChart: { + objectId: presentationChartId, + }, }, - }]; + ]; // Execute the request. try { @@ -43,7 +46,9 @@ async function refreshSheetsChart(presentationId, presentationChartId) { requests, }, }); - console.log(`Refreshed a linked Sheets chart with ID: ${presentationChartId}`); + console.log( + `Refreshed a linked Sheets chart with ID: ${presentationChartId}`, + ); return batchUpdateResponse.data; } catch (err) { // TODO (developer) - Handle exception diff --git a/slides/snippets/slides_simple_text_replace.js b/slides/snippets/slides_simple_text_replace.js index 9bb9b161..3bbfac39 100644 --- a/slides/snippets/slides_simple_text_replace.js +++ b/slides/snippets/slides_simple_text_replace.js @@ -25,25 +25,29 @@ async function simpleTextReplace(presentationId, shapeId, replacementText) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth( - {scopes: 'https://www.googleapis.com/auth/presentations'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/presentations', + }); const service = google.slides({version: 'v1', auth}); // Remove existing text in the shape, then insert new text. - const requests = [{ - deleteText: { - objectId: shapeId, - textRange: { - type: 'ALL', + const requests = [ + { + deleteText: { + objectId: shapeId, + textRange: { + type: 'ALL', + }, }, }, - }, { - insertText: { - objectId: shapeId, - insertionIndex: 0, - text: replacementText, + { + insertText: { + objectId: shapeId, + insertionIndex: 0, + text: replacementText, + }, }, - }]; + ]; // Execute the requests. try { const batchUpdateResponse = await service.presentations.batchUpdate({ diff --git a/slides/snippets/slides_text_merging.js b/slides/snippets/slides_text_merging.js index 89140853..e6810ccf 100644 --- a/slides/snippets/slides_text_merging.js +++ b/slides/snippets/slides_text_merging.js @@ -24,10 +24,13 @@ async function textMerging(templatePresentationId, dataSpreadsheetId) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth( - {scopes: ['https://www.googleapis.com/auth/presentations', - 'https://www.googleapis.com/auth/drive', - 'https://www.googleapis.com/auth/spreadsheet']}); + const auth = new GoogleAuth({ + scopes: [ + 'https://www.googleapis.com/auth/presentations', + 'https://www.googleapis.com/auth/drive', + 'https://www.googleapis.com/auth/spreadsheet', + ], + }); const slidesService = google.slides({version: 'v1', auth}); const sheetsService = google.sheets({version: 'v4', auth}); @@ -64,38 +67,44 @@ async function textMerging(templatePresentationId, dataSpreadsheetId) { const presentationCopyId = driveResponse.data.id; // Create the text merge (replaceAllText) requests for this presentation. - requests = [{ - replaceAllText: { - containsText: { - text: '{{customer-name}}', - matchCase: true, + requests = [ + { + replaceAllText: { + containsText: { + text: '{{customer-name}}', + matchCase: true, + }, + replaceText: customerName, }, - replaceText: customerName, }, - }, { - replaceAllText: { - containsText: { - text: '{{case-description}}', - matchCase: true, + { + replaceAllText: { + containsText: { + text: '{{case-description}}', + matchCase: true, + }, + replaceText: caseDescription, }, - replaceText: caseDescription, }, - }, { - replaceAllText: { - containsText: { - text: '{{total-portfolio}}', - matchCase: true, + { + replaceAllText: { + containsText: { + text: '{{total-portfolio}}', + matchCase: true, + }, + replaceText: totalPortfolio, }, - replaceText: totalPortfolio, }, - }]; + ]; // Execute the requests for this presentation. - const batchUpdateResponse = await slidesService.presentations.batchUpdate({ - presentationId: presentationCopyId, - resource: { - requests, - }, - }); + const batchUpdateResponse = await slidesService.presentations.batchUpdate( + { + presentationId: presentationCopyId, + resource: { + requests, + }, + }, + ); const result = batchUpdateResponse.data; // [START_EXCLUDE silent] responses.push(result.replies); @@ -105,8 +114,10 @@ async function textMerging(templatePresentationId, dataSpreadsheetId) { for (let i = 0; i < result.replies.length; ++i) { numReplacements += result.replies[i].replaceAllText.occurrencesChanged; } - console.log(`Created presentation for ${customerName} with ID: ` + - presentationCopyId); + console.log( + `Created presentation for ${customerName} with ID: ` + + presentationCopyId, + ); console.log(`Replaced ${numReplacements} text instances`); return result; } @@ -118,4 +129,3 @@ async function textMerging(templatePresentationId, dataSpreadsheetId) { // [END slides_text_merging] module.exports = {textMerging}; - diff --git a/slides/snippets/slides_text_style_update.js b/slides/snippets/slides_text_style_update.js index 6485ccb0..85195c12 100644 --- a/slides/snippets/slides_text_style_update.js +++ b/slides/snippets/slides_text_style_update.js @@ -27,67 +27,72 @@ async function textStyleUpdate(presentationId, shapeId) { const {GoogleAuth} = require('google-auth-library'); const {google} = require('googleapis'); - const auth = new GoogleAuth( - {scopes: 'https://www.googleapis.com/auth/presentations'}); + const auth = new GoogleAuth({ + scopes: 'https://www.googleapis.com/auth/presentations', + }); const service = google.slides({version: 'v1', auth}); - const requests = [{ - updateTextStyle: { - objectId: shapeId, - textRange: { - type: 'FIXED_RANGE', - startIndex: 0, - endIndex: 5, - }, - style: { - bold: true, - italic: true, + const requests = [ + { + updateTextStyle: { + objectId: shapeId, + textRange: { + type: 'FIXED_RANGE', + startIndex: 0, + endIndex: 5, + }, + style: { + bold: true, + italic: true, + }, + fields: 'bold,italic', }, - fields: 'bold,italic', }, - }, { - updateTextStyle: { - objectId: shapeId, - textRange: { - type: 'FIXED_RANGE', - startIndex: 5, - endIndex: 10, - }, - style: { - fontFamily: 'Times New Roman', - fontSize: { - magnitude: 14, - unit: 'PT', + { + updateTextStyle: { + objectId: shapeId, + textRange: { + type: 'FIXED_RANGE', + startIndex: 5, + endIndex: 10, }, - foregroundColor: { - opaqueColor: { - rgbColor: { - blue: 1.0, - green: 0.0, - red: 0.0, + style: { + fontFamily: 'Times New Roman', + fontSize: { + magnitude: 14, + unit: 'PT', + }, + foregroundColor: { + opaqueColor: { + rgbColor: { + blue: 1.0, + green: 0.0, + red: 0.0, + }, }, }, }, + fields: 'foregroundColor,fontFamily,fontSize', }, - fields: 'foregroundColor,fontFamily,fontSize', }, - }, { - updateTextStyle: { - objectId: shapeId, - textRange: { - type: 'FIXED_RANGE', - startIndex: 10, - endIndex: 15, - }, - style: { - link: { - url: 'www.example.com', + { + updateTextStyle: { + objectId: shapeId, + textRange: { + type: 'FIXED_RANGE', + startIndex: 10, + endIndex: 15, + }, + style: { + link: { + url: 'www.example.com', + }, }, + fields: 'link', }, - fields: 'link', }, - }]; + ]; // Execute the requests. try { diff --git a/slides/snippets/test/helpers.js b/slides/snippets/test/helpers.js index 759d581a..3eb8aac5 100644 --- a/slides/snippets/test/helpers.js +++ b/slides/snippets/test/helpers.js @@ -1,6 +1,5 @@ /** - * @license - * Copyright Google Inc. + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,14 +24,13 @@ class Helpers { * Creates the Google API Service */ constructor() { - const auth = new GoogleAuth( - { - scopes: [ - 'https://www.googleapis.com/auth/drive', - 'https://www.googleapis.com/auth/presentations', - 'https://www.googleapis.com/auth/spreadsheets', - ], - }); + const auth = new GoogleAuth({ + scopes: [ + 'https://www.googleapis.com/auth/drive', + 'https://www.googleapis.com/auth/presentations', + 'https://www.googleapis.com/auth/spreadsheets', + ], + }); this.driveService = google.drive({version: 'v3', auth}); this.slidesService = google.slides({version: 'v1', auth}); this.sheetsService = google.sheets({version: 'v4', auth}); @@ -59,8 +57,11 @@ class Helpers { * @return {Promise} returns a list of promises */ cleanup() { - return Promise.all(this.filesToDelete.map((fileId) => - this.driveService.files.delete({fileId}))); + return Promise.all( + this.filesToDelete.map((fileId) => + this.driveService.files.delete({fileId}), + ), + ); } /** @@ -117,32 +118,35 @@ class Helpers { magnitude: 350, unit: 'PT', }; - const requests = [{ - createShape: { - objectId: boxId, - shapeType: 'TEXT_BOX', - elementProperties: { - pageObjectId, - size: { - height: pt350, - width: pt350, - }, - transform: { - scaleX: 1, - scaleY: 1, - translateX: 350, - translateY: 100, - unit: 'PT', + const requests = [ + { + createShape: { + objectId: boxId, + shapeType: 'TEXT_BOX', + elementProperties: { + pageObjectId, + size: { + height: pt350, + width: pt350, + }, + transform: { + scaleX: 1, + scaleY: 1, + translateX: 350, + translateY: 100, + unit: 'PT', + }, }, }, }, - }, { - insertText: { - objectId: boxId, - insertionIndex: 0, - text: 'New Box Text Inserted', + { + insertText: { + objectId: boxId, + insertionIndex: 0, + text: 'New Box Text Inserted', + }, }, - }]; + ]; const res = await this.slidesService.presentations.batchUpdate({ presentationId, resource: { @@ -160,34 +164,41 @@ class Helpers { * @param {string} sheetChartId The Sheet's Chart ID * @return {Promise} The chart's object ID */ - async createTestSheetsChart(presentationId, pageId, spreadsheetId, sheetChartId) { + async createTestSheetsChart( + presentationId, + pageId, + spreadsheetId, + sheetChartId, + ) { const chartId = 'MyChart_01'; const emu4M = { magnitude: 4000000, unit: 'EMU', }; - const requests = [{ - createSheetsChart: { - objectId: chartId, - spreadsheetId: spreadsheetId, - chartId: sheetChartId, - linkingMode: 'LINKED', - elementProperties: { - pageObjectId: pageId, - size: { - height: emu4M, - width: emu4M, - }, - transform: { - scaleX: 1, - scaleY: 1, - translateX: 100000, - translateY: 100000, - unit: 'EMU', + const requests = [ + { + createSheetsChart: { + objectId: chartId, + spreadsheetId: spreadsheetId, + chartId: sheetChartId, + linkingMode: 'LINKED', + elementProperties: { + pageObjectId: pageId, + size: { + height: emu4M, + width: emu4M, + }, + transform: { + scaleX: 1, + scaleY: 1, + translateX: 100000, + translateY: 100000, + unit: 'EMU', + }, }, }, }, - }]; + ]; const res = await this.slidesService.presentations.batchUpdate({ presentationId, @@ -225,23 +236,25 @@ class Helpers { await this.sheetsService.spreadsheets.batchUpdate({ spreadsheetId, resource: { - requests: [{ - repeatCell: { - range: { - sheetId: 0, - startRowIndex: 0, - endRowIndex: 15, - startColumnIndex: 0, - endColumnIndex: 15, - }, - cell: { - userEnteredValue: { - stringValue: 'Hello', + requests: [ + { + repeatCell: { + range: { + sheetId: 0, + startRowIndex: 0, + endRowIndex: 15, + startColumnIndex: 0, + endColumnIndex: 15, + }, + cell: { + userEnteredValue: { + stringValue: 'Hello', + }, }, + fields: 'userEnteredValue', }, - fields: 'userEnteredValue', }, - }], + ], }, }); return spreadsheetId; diff --git a/slides/snippets/test/test_slides_copy_presentation.js b/slides/snippets/test/test_slides_copy_presentation.js index 8ec0ab63..f578206c 100644 --- a/slides/snippets/test/test_slides_copy_presentation.js +++ b/slides/snippets/test/test_slides_copy_presentation.js @@ -25,11 +25,13 @@ describe('Presentation snippets', () => { return helpers.cleanup(); }); - it('should copy a presentation', (async () => { + it('should copy a presentation', async () => { const presentationId = await helpers.createTestPresentation(); - const copyId = await SlidesCopyPresentation.copyPresentation(presentationId, 'My' + - ' Duplicate, Presentation'); + const copyId = await SlidesCopyPresentation.copyPresentation( + presentationId, + 'My' + ' Duplicate, Presentation', + ); expect(copyId).toBeDefined(); helpers.deleteFileOnCleanup(copyId.data.id); - })); + }); }); diff --git a/slides/snippets/test/test_slides_create_bulleted_text.js b/slides/snippets/test/test_slides_create_bulleted_text.js index 49f73b01..1a9d95df 100644 --- a/slides/snippets/test/test_slides_create_bulleted_text.js +++ b/slides/snippets/test/test_slides_create_bulleted_text.js @@ -24,12 +24,15 @@ describe('Presentation snippets', () => { return helpers.cleanup(); }); - it('should CreateBulletedText', (async () => { + it('should CreateBulletedText', async () => { const presentationId = await helpers.createTestPresentation(); const pageIds = await helpers.addSlides(presentationId, 1, 'BLANK'); const pageId = pageIds[0]; const boxId = await helpers.createTestTextbox(presentationId, pageId); - const response = await SlidesCreateBulletedText.createBulletedText(presentationId, boxId); + const response = await SlidesCreateBulletedText.createBulletedText( + presentationId, + boxId, + ); expect(1).toEqual(response.replies.length); - })); + }); }); diff --git a/slides/snippets/test/test_slides_create_image.js b/slides/snippets/test/test_slides_create_image.js index 1b79d25f..0ae2c139 100644 --- a/slides/snippets/test/test_slides_create_image.js +++ b/slides/snippets/test/test_slides_create_image.js @@ -24,14 +24,16 @@ describe('Presentation snippets', () => { return helpers.cleanup(); }); - it('should create an image', (async () => { + it('should create an image', async () => { const presentationId = await helpers.createTestPresentation(); const ids = await helpers.addSlides(presentationId, 1, 'BLANK'); const pageId = ids[0]; - const response = await SlidesCreateImage.createImage(presentationId, pageId); + const response = await SlidesCreateImage.createImage( + presentationId, + pageId, + ); expect(response.length).toBe(1); const imageId = response[0].createImage.objectId; expect(imageId).toBeDefined(); - })); + }); }); - diff --git a/slides/snippets/test/test_slides_create_presentation.js b/slides/snippets/test/test_slides_create_presentation.js index 37a3caee..35f17085 100644 --- a/slides/snippets/test/test_slides_create_presentation.js +++ b/slides/snippets/test/test_slides_create_presentation.js @@ -1,6 +1,5 @@ /** - * @license - * Copyright Google Inc. + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,9 +24,11 @@ describe('Presentation snippets', () => { return helpers.cleanup(); }); - it('should create a presentation', (async () => { - const presentation = await SlidesCreatePresentation.createPresentation('Title'); + it('should create a presentation', async () => { + const presentation = await SlidesCreatePresentation.createPresentation( + 'Title', + ); expect(presentation).toBeDefined(); helpers.deleteFileOnCleanup(presentation.data.presentationId); - })); + }); }); diff --git a/slides/snippets/test/test_slides_create_sheets_chart.js b/slides/snippets/test/test_slides_create_sheets_chart.js index a3048947..62a51b32 100644 --- a/slides/snippets/test/test_slides_create_sheets_chart.js +++ b/slides/snippets/test/test_slides_create_sheets_chart.js @@ -28,16 +28,18 @@ describe('Presentation snippets', () => { return helpers.cleanup(); }); - it('should CreateSheetsChart', (async () => { + it('should CreateSheetsChart', async () => { const presentationId = await helpers.createTestPresentation(); const pageIds = await helpers.addSlides(presentationId, 1, 'BLANK'); const pageId = pageIds[0]; - const response = await SlidesCreateSheetsChart.createSheetsChart(presentationId, pageId, + const response = await SlidesCreateSheetsChart.createSheetsChart( + presentationId, + pageId, DATA_SPREADSHEET_ID, - CHART_ID); + CHART_ID, + ); expect(1).toEqual(response.replies.length); const chartId = response.replies[0].createSheetsChart.objectId; expect(chartId).toBeDefined(); - })); + }); }); - diff --git a/slides/snippets/test/test_slides_create_slide.js b/slides/snippets/test/test_slides_create_slide.js index 982c01ea..d82ff070 100644 --- a/slides/snippets/test/test_slides_create_slide.js +++ b/slides/snippets/test/test_slides_create_slide.js @@ -24,12 +24,14 @@ describe('Presentation snippets', () => { return helpers.cleanup(); }); - it('should create a slide', (async () => { + it('should create a slide', async () => { const presentationId = await helpers.createTestPresentation(); await helpers.addSlides(presentationId, 3, 'TITLE_AND_TWO_COLUMNS'); const pageId = 'my_page_id'; - const response = await SlidesCreateSlide.createSlide(presentationId, pageId); + const response = await SlidesCreateSlide.createSlide( + presentationId, + pageId, + ); expect(pageId).toEqual(response.data.replies[0].createSlide.objectId); - })); + }); }); - diff --git a/slides/snippets/test/test_slides_create_textbox_with_text.js b/slides/snippets/test/test_slides_create_textbox_with_text.js index 29712daa..ec1f02a8 100644 --- a/slides/snippets/test/test_slides_create_textbox_with_text.js +++ b/slides/snippets/test/test_slides_create_textbox_with_text.js @@ -25,14 +25,16 @@ describe('Presentation snippets', () => { return helpers.cleanup(); }); - it('should create a textbox with text', (async () => { + it('should create a textbox with text', async () => { const presentationId = await helpers.createTestPresentation(); const ids = await helpers.addSlides(presentationId, 1, 'BLANK'); const pageId = ids[0]; const response = await SlidesCreateTextboxWithText.createTextboxWithText( - presentationId, pageId); + presentationId, + pageId, + ); expect(response.replies.length).toEqual(2); const boxId = response.replies[0].createShape.objectId; expect(boxId).toBeDefined(); - })); + }); }); diff --git a/slides/snippets/test/test_slides_image_merging.js b/slides/snippets/test/test_slides_image_merging.js index 134b0ee0..193f30b1 100644 --- a/slides/snippets/test/test_slides_image_merging.js +++ b/slides/snippets/test/test_slides_image_merging.js @@ -19,7 +19,7 @@ const SlidesImageMerging = require('../slides_image_merging'); const TEMPLATE_PRESENTATION_ID = '1MmTR712m7U_kgeweE57POWwkEyWAV17AVAWjpmltmIg'; const IMAGE_URL = - 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png'; + 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png'; const CUSTOMER_NAME = 'Fake Customer'; describe('Presentation snippets', () => { @@ -29,16 +29,20 @@ describe('Presentation snippets', () => { return helpers.cleanup(); }); - it('should ImageMerging', (async () => { + it('should ImageMerging', async () => { const response = await SlidesImageMerging.imageMerging( - TEMPLATE_PRESENTATION_ID, IMAGE_URL, CUSTOMER_NAME); + TEMPLATE_PRESENTATION_ID, + IMAGE_URL, + CUSTOMER_NAME, + ); const presentationId = response.presentationId; expect(presentationId).toBeDefined(); expect(2).toEqual(response.replies.length); let numReplacements = 0; for (let i = 0; i < response.replies.length; ++i) { - numReplacements += response.replies[i].replaceAllShapesWithImage.occurrencesChanged; + numReplacements += + response.replies[i].replaceAllShapesWithImage.occurrencesChanged; } expect(2).toEqual(numReplacements); - })); + }); }); diff --git a/slides/snippets/test/test_slides_refresh_sheets_chart.js b/slides/snippets/test/test_slides_refresh_sheets_chart.js index d856a351..d1119cfa 100644 --- a/slides/snippets/test/test_slides_refresh_sheets_chart.js +++ b/slides/snippets/test/test_slides_refresh_sheets_chart.js @@ -28,15 +28,20 @@ describe('Presentation snippets', () => { return helpers.cleanup(); }); - it('should RefreshSheetsChart', (async () => { + it('should RefreshSheetsChart', async () => { const presentationId = await helpers.createTestPresentation(); const pageIds = await helpers.addSlides(presentationId, 1, 'BLANK'); const pageId = pageIds[0]; - const sheetChartId = await helpers.createTestSheetsChart(presentationId, pageId, - DATA_SPREADSHEET_ID, CHART_ID); + const sheetChartId = await helpers.createTestSheetsChart( + presentationId, + pageId, + DATA_SPREADSHEET_ID, + CHART_ID, + ); const response = await SlidesRefreshSheetsChart.refreshSheetsChart( - presentationId, sheetChartId); + presentationId, + sheetChartId, + ); expect(1).toEqual(response.replies.length); - })); + }); }); - diff --git a/slides/snippets/test/test_slides_simple_text_replace.js b/slides/snippets/test/test_slides_simple_text_replace.js index 8e6f3f59..1b06f37e 100644 --- a/slides/snippets/test/test_slides_simple_text_replace.js +++ b/slides/snippets/test/test_slides_simple_text_replace.js @@ -24,13 +24,16 @@ describe('Presentation snippets', () => { return helpers.cleanup(); }); - it('should SimpleTextReplace', (async () => { + it('should SimpleTextReplace', async () => { const presentationId = await helpers.createTestPresentation(); const pageIds = await helpers.addSlides(presentationId, 1, 'BLANK'); const pageId = pageIds[0]; const boxId = await helpers.createTestTextbox(presentationId, pageId); - const response = await SlidesSimpleTextReplace.simpleTextReplace(presentationId, boxId, - 'MY NEW TEXT'); + const response = await SlidesSimpleTextReplace.simpleTextReplace( + presentationId, + boxId, + 'MY NEW TEXT', + ); expect(2).toEqual(response.replies.length); - })); + }); }); diff --git a/slides/snippets/test/test_slides_text_merging.js b/slides/snippets/test/test_slides_text_merging.js index 82696e6d..b33da63d 100644 --- a/slides/snippets/test/test_slides_text_merging.js +++ b/slides/snippets/test/test_slides_text_merging.js @@ -26,11 +26,13 @@ describe('Presentation snippets', () => { return helpers.cleanup(); }); - it('should merge text', (async () => { + it('should merge text', async () => { let sheetId = await helpers.createTestSpreadsheet(); sheetId = await helpers.populateValues(sheetId); - const responses = await SlidesTextMerging.textMerging(TEMPLATE_PRESENTATION_ID, - sheetId); + const responses = await SlidesTextMerging.textMerging( + TEMPLATE_PRESENTATION_ID, + sheetId, + ); // console.log(responses); expect(3).toEqual(responses.replies.length); let numReplacements = 0; @@ -38,5 +40,5 @@ describe('Presentation snippets', () => { numReplacements += responses.replies[i].replaceAllText.occurrencesChanged; } expect(4).toEqual(numReplacements); - })); + }); }); diff --git a/slides/snippets/test/test_slides_text_style_update.js b/slides/snippets/test/test_slides_text_style_update.js index 2d21087a..95986907 100644 --- a/slides/snippets/test/test_slides_text_style_update.js +++ b/slides/snippets/test/test_slides_text_style_update.js @@ -24,12 +24,15 @@ describe('Presentation snippets', () => { return helpers.cleanup(); }); - it('should TextStyleUpdate', (async () => { + it('should TextStyleUpdate', async () => { const presentationId = await helpers.createTestPresentation(); const pageIds = await helpers.addSlides(presentationId, 1, 'BLANK'); const pageId = pageIds[0]; const boxId = await helpers.createTestTextbox(presentationId, pageId); - const response = await SlidesTextStyleUpdate.textStyleUpdate(presentationId, boxId); + const response = await SlidesTextStyleUpdate.textStyleUpdate( + presentationId, + boxId, + ); expect(3).toEqual(response.replies.length); - })); + }); }); diff --git a/tasks/quickstart/index.js b/tasks/quickstart/index.js index 24223bb2..20e1ab00 100644 --- a/tasks/quickstart/index.js +++ b/tasks/quickstart/index.js @@ -1,6 +1,5 @@ /** - * @license - * Copyright Google Inc. + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.