From fe690e99c41517e6806b8ada994fe3fc87719f95 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Sun, 4 Jun 2017 15:40:19 -0400 Subject: [PATCH] dlp|video-intelligence: add to google-cloud (#2354) --- docs/manifest.json | 8 ++++ packages/dlp/src/index.js | 14 +++---- packages/google-cloud/npm-shrinkwrap.json | 24 ++++++++++++ packages/google-cloud/package.json | 8 ++++ packages/google-cloud/src/index.js | 45 +++++++++++++++++++++++ packages/google-cloud/test/index.js | 30 +++++++++++++++ 6 files changed, 121 insertions(+), 8 deletions(-) diff --git a/docs/manifest.json b/docs/manifest.json index 7884ed31744..434a257c988 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -151,6 +151,14 @@ "master" ] }, + { + "id": "dlp", + "name": "@google-cloud/dlp", + "defaultService": "dlp", + "versions": [ + "0.1.0" + ] + }, { "id": "dns", "name": "@google-cloud/dns", diff --git a/packages/dlp/src/index.js b/packages/dlp/src/index.js index 922d1d7e10b..21666baa1dc 100644 --- a/packages/dlp/src/index.js +++ b/packages/dlp/src/index.js @@ -23,15 +23,13 @@ var gapic = { const VERSION = require('../package.json').version; /** - * Create an dlpServiceClient with additional helpers for common - * tasks. + * The [Data Loss Prevention (DLP) API](https://cloud.google.com/dlp) allows + * clients to detect the presence of Personally Identifiable Information (PII) + * and other privacy-sensitive data in user-supplied, unstructured data streams, + * like text blocks or images. * - * The DLP API is a service that allows clients - * to detect the presence of Personally Identifiable Information (PII) and other - * privacy-sensitive data in user-supplied, unstructured data streams, like text - * blocks or images. - * The service also includes methods for sensitive data redaction and - * scheduling of data scans on Google Cloud Platform based data sets. + * The service also includes methods for sensitive data redaction and scheduling + * of data scans on Google Cloud Platform based data sets. * * @param {object=} options - [Configuration object](#/docs). * @param {number=} options.port - The port on which to connect to diff --git a/packages/google-cloud/npm-shrinkwrap.json b/packages/google-cloud/npm-shrinkwrap.json index aadd3519f2b..2b43accf17e 100644 --- a/packages/google-cloud/npm-shrinkwrap.json +++ b/packages/google-cloud/npm-shrinkwrap.json @@ -39,6 +39,18 @@ "from": "@google-cloud/datastore@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/@google-cloud/datastore/-/datastore-1.0.2.tgz" }, + "@google-cloud/dlp": { + "version": "0.1.0", + "from": "@google-cloud/dlp@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/@google-cloud/dlp/-/dlp-0.1.0.tgz", + "dependencies": { + "google-proto-files": { + "version": "0.12.0", + "from": "google-proto-files@>=0.12.0 <0.13.0", + "resolved": "https://registry.npmjs.org/google-proto-files/-/google-proto-files-0.12.0.tgz" + } + } + }, "@google-cloud/dns": { "version": "0.6.2", "from": "@google-cloud/dns@>=0.6.0 <0.7.0", @@ -113,6 +125,18 @@ "from": "@google-cloud/translate@>=0.8.0 <0.9.0", "resolved": "https://registry.npmjs.org/@google-cloud/translate/-/translate-0.8.2.tgz" }, + "@google-cloud/video-intelligence": { + "version": "0.1.0", + "from": "@google-cloud/video-intelligence@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/@google-cloud/video-intelligence/-/video-intelligence-0.1.0.tgz", + "dependencies": { + "google-proto-files": { + "version": "0.12.0", + "from": "google-proto-files@>=0.12.0 <0.13.0", + "resolved": "https://registry.npmjs.org/google-proto-files/-/google-proto-files-0.12.0.tgz" + } + } + }, "@google-cloud/vision": { "version": "0.11.2", "from": "@google-cloud/vision@>=0.11.0 <0.12.0", diff --git a/packages/google-cloud/package.json b/packages/google-cloud/package.json index 7e9ea7946d3..b520b80ce24 100644 --- a/packages/google-cloud/package.json +++ b/packages/google-cloud/package.json @@ -58,6 +58,9 @@ "google cloud datastore", "cloud datastore", "datastore", + "google cloud dlp", + "cloud dlp", + "dlp", "google cloud dns", "cloud dns", "dns", @@ -95,6 +98,9 @@ "google cloud speech", "cloud speech", "speech", + "google cloud video intelligence", + "cloud video intelligence", + "video intelligence", "google cloud vision", "cloud vision", "vision" @@ -104,6 +110,7 @@ "@google-cloud/bigtable": "^0.10.0", "@google-cloud/compute": "^0.7.0", "@google-cloud/datastore": "^1.0.0", + "@google-cloud/dlp": "^0.1.0", "@google-cloud/dns": "^0.6.0", "@google-cloud/language": "^0.10.0", "@google-cloud/logging": "^1.0.0", @@ -115,6 +122,7 @@ "@google-cloud/speech": "^0.9.0", "@google-cloud/storage": "^1.0.0", "@google-cloud/translate": "^0.8.0", + "@google-cloud/video-intelligence": "^0.1.0", "@google-cloud/vision": "^0.11.0", "extend": "^3.0.0" }, diff --git a/packages/google-cloud/src/index.js b/packages/google-cloud/src/index.js index b313d108e31..5f7da98e17f 100644 --- a/packages/google-cloud/src/index.js +++ b/packages/google-cloud/src/index.js @@ -106,6 +106,28 @@ var apis = { */ datastore: require('@google-cloud/datastore'), + /** + * The [Data Loss Prevention (DLP) API](https://cloud.google.com/dlp) allows + * clients to detect the presence of Personally Identifiable Information (PII) + * and other privacy-sensitive data in user-supplied, unstructured data + * streams, like text blocks or images. + * + * The service also includes methods for sensitive data redaction and + * scheduling of data scans on Google Cloud Platform based data sets. + * + * @type {module:dlp} + * + * @return {module:dlp} + * + * @example + * var gcloud = require('google-cloud'); + * var dlp = gcloud.dlp({ + * projectId: 'grape-spaceship-123', + * keyFilename: '/path/to/keyfile.json' + * }); + */ + dlp: require('@google-cloud/dlp'), + /** * [Cloud DNS](https://cloud.google.com/dns/what-is-cloud-dns) is a * high-performance, resilient, global DNS service that provides a cost- @@ -339,6 +361,29 @@ var apis = { */ translate: require('@google-cloud/translate'), + /** + * [Google Cloud Video Intelligence API](https://cloud.google.com/video-intelligence) + * makes videos searchable, and discoverable, by extracting metadata with an + * easy to use REST API. You can now search every moment of every video file + * in your catalog and find every occurrence as well as its significance. It + * quickly annotates videos stored in Google Cloud Storage, and helps you + * identify key nouns entities of your video, and when they occur within the + * video. Separate signal from noise, by retrieving relevant information at + * the video, shot or per frame. + * + * @type {module:video-intelligence} + * + * @return {module:video-intelligence} + * + * @example + * var gcloud = require('google-cloud'); + * var video = gcloud.videoIntelligence({ + * projectId: 'grape-spaceship-123', + * keyFilename: '/path/to/keyfile.json' + * }); + */ + videoIntelligence: require('@google-cloud/video-intelligence'), + /** * The [Cloud Vision API](https://cloud.google.com/vision/docs) allows easy * integration of vision detection features, including image labeling, face diff --git a/packages/google-cloud/test/index.js b/packages/google-cloud/test/index.js index 65a7d373453..922faa13f24 100644 --- a/packages/google-cloud/test/index.js +++ b/packages/google-cloud/test/index.js @@ -36,6 +36,7 @@ var FakeBigQuery = createFakeApi(); var FakeBigtable = createFakeApi(); var FakeCompute = createFakeApi(); var FakeDatastore = createFakeApi(); +var FakeDLP = createFakeApi(); var FakeDNS = createFakeApi(); var FakeLanguage = createFakeApi(); var FakeLogging = createFakeApi(); @@ -47,6 +48,7 @@ var FakeSpanner = createFakeApi(); var FakeSpeech = createFakeApi(); var FakeStorage = createFakeApi(); var FakeTranslate = createFakeApi(); +var FakeVideoIntelligence = createFakeApi(); var FakeVision = createFakeApi(); describe('gcloud', function() { @@ -58,6 +60,7 @@ describe('gcloud', function() { '@google-cloud/bigtable': FakeBigtable, '@google-cloud/compute': FakeCompute, '@google-cloud/datastore': FakeDatastore, + '@google-cloud/dlp': FakeDLP, '@google-cloud/dns': FakeDNS, '@google-cloud/language': FakeLanguage, '@google-cloud/logging': FakeLogging, @@ -69,6 +72,7 @@ describe('gcloud', function() { '@google-cloud/speech': FakeSpeech, '@google-cloud/storage': FakeStorage, '@google-cloud/translate': FakeTranslate, + '@google-cloud/video-intelligence': FakeVideoIntelligence, '@google-cloud/vision': FakeVision }); }); @@ -93,6 +97,10 @@ describe('gcloud', function() { assert.strictEqual(gcloud.datastore, FakeDatastore); }); + it('should export static dlp', function() { + assert.strictEqual(gcloud.dlp, FakeDLP); + }); + it('should export static dns', function() { assert.strictEqual(gcloud.dns, FakeDNS); }); @@ -137,6 +145,10 @@ describe('gcloud', function() { assert.strictEqual(gcloud.translate, FakeTranslate); }); + it('should export static video-intelligence', function() { + assert.strictEqual(gcloud.videoIntelligence, FakeVideoIntelligence); + }); + it('should export static vision', function() { assert.strictEqual(gcloud.vision, FakeVision); }); @@ -208,6 +220,15 @@ describe('gcloud', function() { }); }); + describe('dlp', function() { + it('should create a new DNS', function() { + var dlp = localGcloud.dlp(options); + + assert(dlp instanceof FakeDLP); + assert.strictEqual(dlp.calledWith_[0], options); + }); + }); + describe('dns', function() { it('should create a new DNS', function() { var dns = localGcloud.dns(options); @@ -298,6 +319,15 @@ describe('gcloud', function() { }); }); + describe('video intelligence', function() { + it('should create a new VideoIntelligence', function() { + var videoIntelligence = localGcloud.videoIntelligence(options); + + assert(videoIntelligence instanceof FakeVideoIntelligence); + assert.strictEqual(videoIntelligence.calledWith_[0], options); + }); + }); + describe('vision', function() { it('should create a new Vision', function() { var vision = localGcloud.vision(options);