Skip to content

Commit 6d9bafc

Browse files
committed
Merge branch 'cloud-iot-core' of https://github.com/GoogleCloudPlatform/nodejs-docs-samples into cloud-iot-core
2 parents 3dafcec + bfa66db commit 6d9bafc

12 files changed

+218
-169
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ on Google Cloud Platform.
9191
Create local credentials by running the following command and following the
9292
oauth2 flow (read more about the command [here][auth_command]):
9393

94-
gcloud beta auth application-default login
94+
gcloud auth application-default login
9595

9696
In non-Google Cloud environments, GCE instances created without the
9797
correct scopes, or local workstations where the

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
},
5656
"devDependencies": {
5757
"@google-cloud/nodejs-repo-tools": "1.4.14",
58-
"@google-cloud/storage": "1.1.0",
58+
"@google-cloud/storage": "1.1.1",
5959
"ava": "0.19.1",
6060
"nyc": "10.3.2",
6161
"shelljs": "0.7.7"

storage/encryption.js

+4-7
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,12 @@ function downloadEncryptedFile (bucketName, srcFilename, destFilename, key) {
108108
destination: destFilename
109109
};
110110

111-
const file = storage
112-
.bucket(bucketName)
113-
.file(srcFilename);
114-
115-
file.setEncryptionKey(Buffer.from(key, 'base64'));
116-
117111
// Descrypts and downloads the file. This can only be done with the key used
118112
// to encrypt and upload the file.
119-
file
113+
storage
114+
.bucket(bucketName)
115+
.file(srcFilename)
116+
.setEncryptionKey(Buffer.from(key, 'base64'))
120117
.download(options)
121118
.then(() => {
122119
console.log(`File ${srcFilename} downloaded to ${destFilename}.`);

storage/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"test": "npm run unit-test && npm run system-test"
2020
},
2121
"dependencies": {
22-
"@google-cloud/storage": "1.1.0",
22+
"@google-cloud/storage": "1.1.1",
2323
"googleapis": "19.0.0",
2424
"moment": "2.18.1",
2525
"safe-buffer": "5.0.1",
@@ -28,7 +28,7 @@
2828
"devDependencies": {
2929
"@google-cloud/nodejs-repo-tools": "1.4.14",
3030
"ava": "0.19.1",
31-
"proxyquire": "1.7.11",
31+
"proxyquire": "1.8.0",
3232
"sinon": "2.2.0",
3333
"uuid": "3.0.1"
3434
},

storage/yarn.lock

+15-58
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@
6060
string-format-obj "^1.1.0"
6161
through2 "^2.0.3"
6262

63-
"@google-cloud/[email protected].13":
64-
version "1.4.13"
65-
resolved "https://registry.yarnpkg.com/@google-cloud/nodejs-repo-tools/-/nodejs-repo-tools-1.4.13.tgz#005556d8b93cb29f16018988e466cf0f9dc6d91f"
63+
"@google-cloud/[email protected].14":
64+
version "1.4.14"
65+
resolved "https://registry.yarnpkg.com/@google-cloud/nodejs-repo-tools/-/nodejs-repo-tools-1.4.14.tgz#b778687bcd798ea172a01d2b92db43ad95a8b0ce"
6666
dependencies:
6767
ava "0.19.1"
6868
colors "1.1.2"
@@ -76,9 +76,9 @@
7676
supertest "3.0.0"
7777
yargs "8.0.1"
7878

79-
"@google-cloud/[email protected].0":
80-
version "1.1.0"
81-
resolved "https://registry.yarnpkg.com/@google-cloud/storage/-/storage-1.1.0.tgz#5e905a1aed4c196d5ce75dcdb5e4cd7ce29a0860"
79+
"@google-cloud/[email protected].1":
80+
version "1.1.1"
81+
resolved "https://registry.yarnpkg.com/@google-cloud/storage/-/storage-1.1.1.tgz#6590b5ce6e779556c9cc7043bd6449d6bc0781de"
8282
dependencies:
8383
"@google-cloud/common" "^0.13.0"
8484
arrify "^1.0.0"
@@ -774,10 +774,6 @@ camelcase@^2.0.0:
774774
version "2.1.1"
775775
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f"
776776

777-
camelcase@^3.0.0:
778-
version "3.0.0"
779-
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a"
780-
781777
camelcase@^4.0.0, camelcase@^4.1.0:
782778
version "4.1.0"
783779
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd"
@@ -2523,12 +2519,6 @@ os-homedir@^1.0.0:
25232519
version "1.0.2"
25242520
resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
25252521

2526-
os-locale@^1.4.0:
2527-
version "1.4.0"
2528-
resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9"
2529-
dependencies:
2530-
lcid "^1.0.0"
2531-
25322522
os-locale@^2.0.0:
25332523
version "2.0.0"
25342524
resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.0.0.tgz#15918ded510522b81ee7ae5a309d54f639fc39a4"
@@ -2746,6 +2736,14 @@ [email protected]:
27462736
module-not-found-error "^1.0.0"
27472737
resolve "~1.1.7"
27482738

2739+
2740+
version "1.8.0"
2741+
resolved "https://registry.yarnpkg.com/proxyquire/-/proxyquire-1.8.0.tgz#02d514a5bed986f04cbb2093af16741535f79edc"
2742+
dependencies:
2743+
fill-keys "^1.0.2"
2744+
module-not-found-error "^1.0.0"
2745+
resolve "~1.1.7"
2746+
27492747
pseudomap@^1.0.1:
27502748
version "1.0.2"
27512749
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
@@ -3110,19 +3108,6 @@ signal-exit@^3.0.0, signal-exit@^3.0.2:
31103108
version "3.0.2"
31113109
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
31123110

3113-
3114-
version "2.1.0"
3115-
resolved "https://registry.yarnpkg.com/sinon/-/sinon-2.1.0.tgz#e057a9d2bf1b32f5d6dd62628ca9ee3961b0cafb"
3116-
dependencies:
3117-
diff "^3.1.0"
3118-
formatio "1.2.0"
3119-
lolex "^1.6.0"
3120-
native-promise-only "^0.8.1"
3121-
path-to-regexp "^1.7.0"
3122-
samsam "^1.1.3"
3123-
text-encoding "0.6.4"
3124-
type-detect "^4.0.0"
3125-
31263111
31273112
version "2.2.0"
31283113
resolved "https://registry.yarnpkg.com/sinon/-/sinon-2.2.0.tgz#3b1b42ff5defcbf51a52a62aca6d61171b9fd262"
@@ -3242,7 +3227,7 @@ string-template@~1.0.0:
32423227
version "1.0.0"
32433228
resolved "https://registry.yarnpkg.com/string-template/-/string-template-1.0.0.tgz#9e9f2233dc00f218718ec379a28a5673ecca8b96"
32443229

3245-
string-width@^1.0.1, string-width@^1.0.2:
3230+
string-width@^1.0.1:
32463231
version "1.0.2"
32473232
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
32483233
dependencies:
@@ -3535,10 +3520,6 @@ [email protected]:
35353520
dependencies:
35363521
extsprintf "1.0.2"
35373522

3538-
which-module@^1.0.0:
3539-
version "1.0.0"
3540-
resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f"
3541-
35423523
which-module@^2.0.0:
35433524
version "2.0.0"
35443525
resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"
@@ -3631,36 +3612,12 @@ yallist@^2.0.0:
36313612
version "2.1.2"
36323613
resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"
36333614

3634-
yargs-parser@^5.0.0:
3635-
version "5.0.0"
3636-
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a"
3637-
dependencies:
3638-
camelcase "^3.0.0"
3639-
36403615
yargs-parser@^7.0.0:
36413616
version "7.0.0"
36423617
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9"
36433618
dependencies:
36443619
camelcase "^4.1.0"
36453620

3646-
3647-
version "7.1.0"
3648-
resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8"
3649-
dependencies:
3650-
camelcase "^3.0.0"
3651-
cliui "^3.2.0"
3652-
decamelize "^1.1.1"
3653-
get-caller-file "^1.0.1"
3654-
os-locale "^1.4.0"
3655-
read-pkg-up "^1.0.1"
3656-
require-directory "^2.1.1"
3657-
require-main-filename "^1.0.1"
3658-
set-blocking "^2.0.0"
3659-
string-width "^1.0.2"
3660-
which-module "^1.0.0"
3661-
y18n "^3.2.1"
3662-
yargs-parser "^5.0.0"
3663-
36643621
36653622
version "8.0.1"
36663623
resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.1.tgz#420ef75e840c1457a80adcca9bc6fa3849de51aa"

video/README.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,27 @@
22

33
# Google Cloud Video Intelligence API Node.js Samples
44

5-
The [Cloud Video Intelligence API][video_docs] allows developers to easily
6-
integrate video analysis within applications, including video labeling, safe search
7-
, and shot change detection.
5+
[![Build](https://storage.googleapis.com/cloud-docs-samples-badges/GoogleCloudPlatform/nodejs-docs-samples/nodejs-docs-samples-videointelligence.svg)]()
86

9-
[video_docs]: https://cloud.google.com/video-intelligence/docs/
7+
The [Cloud Video Intelligence API](https://cloud.google.com/video-intelligence) allows developers to use Google video analysis technology as part of their applications.
108

119
## Table of Contents
1210

1311
* [Setup](#setup)
1412
* [Samples](#samples)
15-
* [Analyze](#analyze)
13+
* [Video Intelligence](#video-intelligence)
1614
* [Running the tests](#running-the-tests)
1715

1816
## Setup
1917

2018
1. Read [Prerequisites][prereq] and [How to run a sample][run] first.
2119
1. Install dependencies:
2220

23-
With `npm`:
21+
With **npm**:
2422

2523
npm install
2624

27-
With `yarn`:
25+
With **yarn**:
2826

2927
yarn install
3028

@@ -33,45 +31,47 @@ integrate video analysis within applications, including video labeling, safe sea
3331

3432
## Samples
3533

36-
### Analyze
34+
### Video Intelligence
3735

38-
View the [documentation][analyze_docs] or the [source code][analyze_code].
36+
View the [documentation][video_0_docs] or the [source code][video_0_code].
3937

4038
__Usage:__ `node analyze.js --help`
4139

4240
```
4341
Commands:
42+
faces <gcsUri> Analyzes faces in a video stored in Google Cloud Storage using the Cloud Video Intelligence API.
4443
shots <gcsUri> Analyzes shot angles in a video stored in Google Cloud Storage using the Cloud Video
4544
Intelligence API.
4645
labels-gcs <gcsUri> Labels objects in a video stored in Google Cloud Storage using the Cloud Video Intelligence API.
4746
labels-file <gcsUri> Labels objects in a video stored locally using the Cloud Video Intelligence API.
47+
safe-search <gcsUri> Detects adult content in a video stored in Google Cloud Storage.
4848
4949
Options:
5050
--help Show help [boolean]
5151
5252
Examples:
53-
node analyze.js shots gs://my-bucket/my-video.mp4
54-
node analyze.js labels-gcs gs://my-bucket/my-video.mp4
55-
node analyze.js labels-file my-video.mp4
56-
node analyze.js unsafe-content gs://my-bucket/my-video.mp4
53+
node analyze.js faces gs://demomaker/volleyball_court.mp4
54+
node analyze.js shots gs://demomaker/volleyball_court.mp4
55+
node analyze.js labels-gcs gs://demomaker/volleyball_court.mp4
56+
node analyze.js labels-file cat.mp4
57+
node analyze.js safe-search gs://demomaker/volleyball_court.mp4
5758
5859
For more information, see https://cloud.google.com/video-intelligence/docs
5960
```
6061

61-
[analyze_docs]: https://cloud.google.com/video-intelligence/docs
62-
[analyze_code]: analyze.js
62+
[video_0_docs]: https://cloud.google.com/video-intelligence/docs
63+
[video_0_code]: analyze.js
6364

6465
## Running the tests
6566

66-
1. Set the `GCLOUD_PROJECT` and `GOOGLE_APPLICATION_CREDENTIALS` environment
67-
variables.
67+
1. Set the **GCLOUD_PROJECT** and **GOOGLE_APPLICATION_CREDENTIALS** environment variables.
6868

6969
1. Run the tests:
7070

71-
With `npm`:
71+
With **npm**:
7272

7373
npm test
7474

75-
With `yarn`:
75+
With **yarn**:
7676

7777
yarn test

0 commit comments

Comments
 (0)