Skip to content
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

Closed
wants to merge 8 commits into from
Closed

Conversation

alexander-fenster
Copy link
Contributor

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, then node 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.

@alexander-fenster alexander-fenster added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jan 10, 2019
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jan 10, 2019
src/apis/drive/package.json Show resolved Hide resolved
@@ -0,0 +1,3 @@
---

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@@ -0,0 +1,26 @@
# Drive v3 API Samples

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@@ -0,0 +1,90 @@
// Copyright 2018, Google, LLC.

This comment was marked as spam.

This comment was marked as spam.

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.

This comment was marked as spam.

});
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.

* 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.

src/apis/drive/samples/package.json Show resolved Hide resolved
src/apis/drive/samples/package.json Show resolved Hide resolved
@@ -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.

This comment was marked as spam.

@alexander-fenster
Copy link
Contributor Author

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 webserver.js stuff copied across all APIs to show how to perform OAuth2 workflow with the given API - just have it authenticated and show how to load the given client library in the browser. The whole webserver.js and the auth part of index.html.template is going to be the same across all APIs. What do you think?

@JustinBeckwith
Copy link
Contributor

👋 @alexander-fenster is this still a thing?

@alexander-fenster
Copy link
Contributor Author

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.

@JustinBeckwith JustinBeckwith deleted the drive-test branch February 8, 2019 02:44
gcf-owl-bot bot added a commit that referenced this pull request Aug 24, 2022
* 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
SurferJeffAtGoogle pushed a commit that referenced this pull request Aug 30, 2022
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement. do not merge Indicates a pull request not ready for merge, due to either quality or timing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants