-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DO NOT MERGE: example of library usage #1540
Conversation
@@ -0,0 +1,3 @@ | |||
--- |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -0,0 +1,26 @@ | |||
# Drive v3 API Samples |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -0,0 +1,90 @@ | |||
// Copyright 2018, Google, LLC. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
const path = require('path'); | ||
const fs = require('fs'); | ||
|
||
const keyfile = path.join(__dirname, '..', 'oauth2.keys.json'); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
}); | ||
const server = app.listen(3000); | ||
// open the browser to the authorize url to start the workflow | ||
opn(this.authorizeUrl, {wait: false}); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
* Lists the names and IDs of up to 10 files. | ||
* @param {auth.OAuth2} auth An authorized OAuth2 client. | ||
*/ | ||
function listFiles(auth) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -0,0 +1,36 @@ | |||
# Drive v3 API Samples | |||
|
|||
These samples allow you to list files on Google Drive using this library in the browser. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
So about handwritten vs generated samples. No way we can generate samples for all APIs, it's something @vchudnov-g is working on for GAPIC libraries and it's unlikely we can do anything about it for this library. I assumed all the samples are hand-written, just like they are now in https://github.com/googleapis/google-api-nodejs-client/tree/master/samples. But what we can actually do is to have |
👋 @alexander-fenster is this still a thing? |
If we want to have samples for browser usage that we can have it but this particular PR was more like a proof of concept. Closing for now, if we decide to make samples, this PR can be reopened. |
* fix: add hashes to requirements.txt and update Docker images so they require hashes. * fix: add hashes to docker/owlbot/java/src * Squashed commit of the following: commit ab7384ea1c30df8ec2e175566ef2508e6c3a2acb Author: Jeffrey Rennie <rennie@google.com> Date: Tue Aug 23 11:38:48 2022 -0700 fix: remove pip install statements (#1546) because the tools are already installed in the docker image as of googleapis/testing-infra-docker#227 commit 302667c9ab7210da42cc337e8f39fe1ea99049ef Author: WhiteSource Renovate <bot@renovateapp.com> Date: Tue Aug 23 19:50:28 2022 +0200 chore(deps): update dependency setuptools to v65.2.0 (#1541) Co-authored-by: Anthonios Partheniou <partheniou@google.com> commit 6e9054fd91d1b500cae58ff72ee9aeb626077756 Author: WhiteSource Renovate <bot@renovateapp.com> Date: Tue Aug 23 19:42:51 2022 +0200 chore(deps): update dependency nbconvert to v7 (#1543) Co-authored-by: Anthonios Partheniou <partheniou@google.com> commit d229a1258999f599a90a9b674a1c5541e00db588 Author: Alexander Fenster <fenster@google.com> Date: Mon Aug 22 15:04:53 2022 -0700 fix: update google-gax and remove obsolete deps (#1545) commit 13ce62621e70059b2f5e3a7bade735f91c53339c Author: Jeffrey Rennie <rennie@google.com> Date: Mon Aug 22 11:08:21 2022 -0700 chore: remove release config and script (#1540) We don't release to pypi anymore. * chore: rollback java changes to move forward with other languages until Java's docker image is fixed Source-Link: googleapis/synthtool@4826337 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:7fefeb9e517db2dd8c8202d9239ff6788d6852bc92dd3aac57a46059679ac9de
* fix: add hashes to requirements.txt and update Docker images so they require hashes. * fix: add hashes to docker/owlbot/java/src * Squashed commit of the following: commit ab7384ea1c30df8ec2e175566ef2508e6c3a2acb Author: Jeffrey Rennie <rennie@google.com> Date: Tue Aug 23 11:38:48 2022 -0700 fix: remove pip install statements (#1546) because the tools are already installed in the docker image as of googleapis/testing-infra-docker#227 commit 302667c9ab7210da42cc337e8f39fe1ea99049ef Author: WhiteSource Renovate <bot@renovateapp.com> Date: Tue Aug 23 19:50:28 2022 +0200 chore(deps): update dependency setuptools to v65.2.0 (#1541) Co-authored-by: Anthonios Partheniou <partheniou@google.com> commit 6e9054fd91d1b500cae58ff72ee9aeb626077756 Author: WhiteSource Renovate <bot@renovateapp.com> Date: Tue Aug 23 19:42:51 2022 +0200 chore(deps): update dependency nbconvert to v7 (#1543) Co-authored-by: Anthonios Partheniou <partheniou@google.com> commit d229a1258999f599a90a9b674a1c5541e00db588 Author: Alexander Fenster <fenster@google.com> Date: Mon Aug 22 15:04:53 2022 -0700 fix: update google-gax and remove obsolete deps (#1545) commit 13ce62621e70059b2f5e3a7bade735f91c53339c Author: Jeffrey Rennie <rennie@google.com> Date: Mon Aug 22 11:08:21 2022 -0700 chore: remove release config and script (#1540) We don't release to pypi anymore. * chore: rollback java changes to move forward with other languages until Java's docker image is fixed Source-Link: googleapis/synthtool@4826337 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:7fefeb9e517db2dd8c8202d9239ff6788d6852bc92dd3aac57a46059679ac9de Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
DO NOT MERGE
This is the suggested format of the micro-packages. Webpackable.
Two samples are included:
samples/node/quickstart.js
- quickstart sample (node samples/node/quickstart.js
)samples/web/webserver.js
- webpacked sample (npm run webpack
, thennode samples/web/webserver.js
).Please let me know what you think! I'll update the generator then. It can wait till auth library v3.0 release.