diff --git a/lib/services/contentModerator/LICENSE.txt b/lib/services/contentModerator/LICENSE.txt
index 0313a903d7..5431ba98b9 100644
--- a/lib/services/contentModerator/LICENSE.txt
+++ b/lib/services/contentModerator/LICENSE.txt
@@ -1,21 +1,21 @@
-The MIT License (MIT)
-
-Copyright (c) 2017 Microsoft
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
\ No newline at end of file
+The MIT License (MIT)
+
+Copyright (c) 2018 Microsoft
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/lib/services/contentModerator/lib/contentModeratorAPIClient.d.ts b/lib/services/contentModerator/lib/contentModeratorAPIClient.d.ts
index 859564471e..3a860ba336 100644
--- a/lib/services/contentModerator/lib/contentModeratorAPIClient.d.ts
+++ b/lib/services/contentModerator/lib/contentModeratorAPIClient.d.ts
@@ -9,9 +9,10 @@
*/
import { ServiceClient, ServiceClientOptions, ServiceClientCredentials } from 'ms-rest';
+import * as models from "./models";
import * as operations from "./operations";
-declare class ContentModeratorAPIClient extends ServiceClient {
+export default class ContentModeratorAPIClient extends ServiceClient {
/**
* @class
* Initializes a new instance of the ContentModeratorAPIClient class.
@@ -47,4 +48,4 @@ declare class ContentModeratorAPIClient extends ServiceClient {
reviews: operations.Reviews;
}
-export = ContentModeratorAPIClient;
+export { ContentModeratorAPIClient, models as ContentModeratorAPIModels };
diff --git a/lib/services/contentModerator/lib/contentModeratorAPIClient.js b/lib/services/contentModerator/lib/contentModeratorAPIClient.js
index fc4ff34637..b30f454c60 100644
--- a/lib/services/contentModerator/lib/contentModeratorAPIClient.js
+++ b/lib/services/contentModerator/lib/contentModeratorAPIClient.js
@@ -65,3 +65,6 @@ class ContentModeratorAPIClient extends ServiceClient {
}
module.exports = ContentModeratorAPIClient;
+module.exports['default'] = ContentModeratorAPIClient;
+module.exports.ContentModeratorAPIClient = ContentModeratorAPIClient;
+module.exports.ContentModeratorAPIModels = models;
diff --git a/lib/services/contentModerator/lib/models/classification.js b/lib/services/contentModerator/lib/models/classification.js
index c3643ebb5c..13cc16eabb 100644
--- a/lib/services/contentModerator/lib/models/classification.js
+++ b/lib/services/contentModerator/lib/models/classification.js
@@ -10,6 +10,8 @@
'use strict';
+const models = require('./index');
+
/**
* The classification details of the text.
*
@@ -17,9 +19,18 @@
class Classification {
/**
* Create a Classification.
- * @member {number} [adultScore] The adult score.
- * @member {number} [racyScore] The racy score.
- * @member {number} [offensiveScore] The offensive score.
+ * @member {object} [category1] The category1 score details of the text. Click here for more
+ * details on category classification.
+ * @member {number} [category1.score] The category1 score.
+ * @member {object} [category2] The category2 score details of the text. Click here for more
+ * details on category classification.
+ * @member {number} [category2.score] The category2 score.
+ * @member {object} [category3] The category3 score details of the text. Click here for more
+ * details on category classification.
+ * @member {number} [category3.score] The category3 score.
* @member {boolean} [reviewRecommended] The review recommended flag.
*/
constructor() {
@@ -39,25 +50,28 @@ class Classification {
name: 'Composite',
className: 'Classification',
modelProperties: {
- adultScore: {
+ category1: {
required: false,
- serializedName: 'AdultScore',
+ serializedName: 'Category1',
type: {
- name: 'Number'
+ name: 'Composite',
+ className: 'ClassificationCategory1'
}
},
- racyScore: {
+ category2: {
required: false,
- serializedName: 'RacyScore',
+ serializedName: 'Category2',
type: {
- name: 'Number'
+ name: 'Composite',
+ className: 'ClassificationCategory2'
}
},
- offensiveScore: {
+ category3: {
required: false,
- serializedName: 'OffensiveScore',
+ serializedName: 'Category3',
type: {
- name: 'Number'
+ name: 'Composite',
+ className: 'ClassificationCategory3'
}
},
reviewRecommended: {
diff --git a/lib/services/contentModerator/lib/models/classificationCategory1.js b/lib/services/contentModerator/lib/models/classificationCategory1.js
new file mode 100644
index 0000000000..8584409ba3
--- /dev/null
+++ b/lib/services/contentModerator/lib/models/classificationCategory1.js
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+/**
+ * The category1 score details of the text. Click here for more details
+ * on category classification.
+ *
+ */
+class ClassificationCategory1 {
+ /**
+ * Create a ClassificationCategory1.
+ * @member {number} [score] The category1 score.
+ */
+ constructor() {
+ }
+
+ /**
+ * Defines the metadata of ClassificationCategory1
+ *
+ * @returns {object} metadata of ClassificationCategory1
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'Classification_Category1',
+ type: {
+ name: 'Composite',
+ className: 'ClassificationCategory1',
+ modelProperties: {
+ score: {
+ required: false,
+ serializedName: 'Score',
+ type: {
+ name: 'Number'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = ClassificationCategory1;
diff --git a/lib/services/contentModerator/lib/models/classificationCategory2.js b/lib/services/contentModerator/lib/models/classificationCategory2.js
new file mode 100644
index 0000000000..721f2e84c3
--- /dev/null
+++ b/lib/services/contentModerator/lib/models/classificationCategory2.js
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+/**
+ * The category2 score details of the text. Click here for more details
+ * on category classification.
+ *
+ */
+class ClassificationCategory2 {
+ /**
+ * Create a ClassificationCategory2.
+ * @member {number} [score] The category2 score.
+ */
+ constructor() {
+ }
+
+ /**
+ * Defines the metadata of ClassificationCategory2
+ *
+ * @returns {object} metadata of ClassificationCategory2
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'Classification_Category2',
+ type: {
+ name: 'Composite',
+ className: 'ClassificationCategory2',
+ modelProperties: {
+ score: {
+ required: false,
+ serializedName: 'Score',
+ type: {
+ name: 'Number'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = ClassificationCategory2;
diff --git a/lib/services/contentModerator/lib/models/classificationCategory3.js b/lib/services/contentModerator/lib/models/classificationCategory3.js
new file mode 100644
index 0000000000..7bd7c477d5
--- /dev/null
+++ b/lib/services/contentModerator/lib/models/classificationCategory3.js
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+/**
+ * The category3 score details of the text. Click here for more details
+ * on category classification.
+ *
+ */
+class ClassificationCategory3 {
+ /**
+ * Create a ClassificationCategory3.
+ * @member {number} [score] The category3 score.
+ */
+ constructor() {
+ }
+
+ /**
+ * Defines the metadata of ClassificationCategory3
+ *
+ * @returns {object} metadata of ClassificationCategory3
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'Classification_Category3',
+ type: {
+ name: 'Composite',
+ className: 'ClassificationCategory3',
+ modelProperties: {
+ score: {
+ required: false,
+ serializedName: 'Score',
+ type: {
+ name: 'Number'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = ClassificationCategory3;
diff --git a/lib/services/contentModerator/lib/models/index.d.ts b/lib/services/contentModerator/lib/models/index.d.ts
index b36762536f..9de671bced 100644
--- a/lib/services/contentModerator/lib/models/index.d.ts
+++ b/lib/services/contentModerator/lib/models/index.d.ts
@@ -71,21 +71,72 @@ export interface Frames {
videoFrames?: Frame[];
}
+/**
+ * @class
+ * Initializes a new instance of the ClassificationCategory1 class.
+ * @constructor
+ * The category1 score details of the text. Click here for more details
+ * on category classification.
+ *
+ * @member {number} [score] The category1 score.
+ */
+export interface ClassificationCategory1 {
+ score?: number;
+}
+
+/**
+ * @class
+ * Initializes a new instance of the ClassificationCategory2 class.
+ * @constructor
+ * The category2 score details of the text. Click here for more details
+ * on category classification.
+ *
+ * @member {number} [score] The category2 score.
+ */
+export interface ClassificationCategory2 {
+ score?: number;
+}
+
+/**
+ * @class
+ * Initializes a new instance of the ClassificationCategory3 class.
+ * @constructor
+ * The category3 score details of the text. Click here for more details
+ * on category classification.
+ *
+ * @member {number} [score] The category3 score.
+ */
+export interface ClassificationCategory3 {
+ score?: number;
+}
+
/**
* @class
* Initializes a new instance of the Classification class.
* @constructor
* The classification details of the text.
*
- * @member {number} [adultScore] The adult score.
- * @member {number} [racyScore] The racy score.
- * @member {number} [offensiveScore] The offensive score.
+ * @member {object} [category1] The category1 score details of the text. Click here for more details
+ * on category classification.
+ * @member {number} [category1.score] The category1 score.
+ * @member {object} [category2] The category2 score details of the text. Click here for more details
+ * on category classification.
+ * @member {number} [category2.score] The category2 score.
+ * @member {object} [category3] The category3 score details of the text. Click here for more details
+ * on category classification.
+ * @member {number} [category3.score] The category3 score.
* @member {boolean} [reviewRecommended] The review recommended flag.
*/
export interface Classification {
- adultScore?: number;
- racyScore?: number;
- offensiveScore?: number;
+ category1?: ClassificationCategory1;
+ category2?: ClassificationCategory2;
+ category3?: ClassificationCategory3;
reviewRecommended?: boolean;
}
@@ -125,6 +176,21 @@ export interface Email {
index?: number;
}
+/**
+ * @class
+ * Initializes a new instance of the SSN class.
+ * @constructor
+ * Detected SSN details.
+ *
+ * @member {string} [text] Detected SSN in the input text content.
+ * @member {number} [index] Index(Location) of the SSN in the input text
+ * content.
+ */
+export interface SSN {
+ text?: string;
+ index?: number;
+}
+
/**
* @class
* Initializes a new instance of the IPA class.
@@ -181,12 +247,14 @@ export interface Address {
* Personal Identifier Information details.
*
* @member {array} [email]
+ * @member {array} [sSN]
* @member {array} [iPA]
* @member {array} [phone]
* @member {array} [address]
*/
export interface PII {
email?: Email[];
+ sSN?: SSN[];
iPA?: IPA[];
phone?: Phone[];
address?: Address[];
@@ -223,9 +291,18 @@ export interface DetectedTerms {
* @member {string} [autoCorrectedText] The autocorrected text
* @member {array} [misrepresentation] The misrepresentation text.
* @member {object} [classification] The classification details of the text.
- * @member {number} [classification.adultScore] The adult score.
- * @member {number} [classification.racyScore] The racy score.
- * @member {number} [classification.offensiveScore] The offensive score.
+ * @member {object} [classification.category1] The category1 score details of
+ * the text. Click here for
+ * more details on category classification.
+ * @member {number} [classification.category1.score] The category1 score.
+ * @member {object} [classification.category2] The category2 score details of
+ * the text. Click here for
+ * more details on category classification.
+ * @member {number} [classification.category2.score] The category2 score.
+ * @member {object} [classification.category3] The category3 score details of
+ * the text. Click here for
+ * more details on category classification.
+ * @member {number} [classification.category3.score] The category3 score.
* @member {boolean} [classification.reviewRecommended] The review recommended
* flag.
* @member {object} [status] The evaluate status.
@@ -234,6 +311,7 @@ export interface DetectedTerms {
* @member {string} [status.exception] Exception status.
* @member {object} [pII] Personal Identifier Information details.
* @member {array} [pII.email]
+ * @member {array} [pII.sSN]
* @member {array} [pII.iPA]
* @member {array} [pII.phone]
* @member {array} [pII.address]
diff --git a/lib/services/contentModerator/lib/models/index.js b/lib/services/contentModerator/lib/models/index.js
index feacb8f3cd..58ea462c62 100644
--- a/lib/services/contentModerator/lib/models/index.js
+++ b/lib/services/contentModerator/lib/models/index.js
@@ -18,9 +18,13 @@ exports.KeyValuePair = require('./keyValuePair');
exports.Tag = require('./tag');
exports.Frame = require('./frame');
exports.Frames = require('./frames');
+exports.ClassificationCategory1 = require('./classificationCategory1');
+exports.ClassificationCategory2 = require('./classificationCategory2');
+exports.ClassificationCategory3 = require('./classificationCategory3');
exports.Classification = require('./classification');
exports.Status = require('./status');
exports.Email = require('./email');
+exports.SSN = require('./sSN');
exports.IPA = require('./iPA');
exports.Phone = require('./phone');
exports.Address = require('./address');
diff --git a/lib/services/contentModerator/lib/models/pII.js b/lib/services/contentModerator/lib/models/pII.js
index 9a7e0d936e..1636e48ab9 100644
--- a/lib/services/contentModerator/lib/models/pII.js
+++ b/lib/services/contentModerator/lib/models/pII.js
@@ -20,6 +20,7 @@ class PII {
/**
* Create a PII.
* @member {array} [email]
+ * @member {array} [sSN]
* @member {array} [iPA]
* @member {array} [phone]
* @member {array} [address]
@@ -56,6 +57,21 @@ class PII {
}
}
},
+ sSN: {
+ required: false,
+ serializedName: 'SSN',
+ type: {
+ name: 'Sequence',
+ element: {
+ required: false,
+ serializedName: 'SSNElementType',
+ type: {
+ name: 'Composite',
+ className: 'SSN'
+ }
+ }
+ }
+ },
iPA: {
required: false,
serializedName: 'IPA',
diff --git a/lib/services/contentModerator/lib/models/sSN.js b/lib/services/contentModerator/lib/models/sSN.js
new file mode 100644
index 0000000000..f3bd39350b
--- /dev/null
+++ b/lib/services/contentModerator/lib/models/sSN.js
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+/**
+ * Detected SSN details.
+ *
+ */
+class SSN {
+ /**
+ * Create a SSN.
+ * @member {string} [text] Detected SSN in the input text content.
+ * @member {number} [index] Index(Location) of the SSN in the input text
+ * content.
+ */
+ constructor() {
+ }
+
+ /**
+ * Defines the metadata of SSN
+ *
+ * @returns {object} metadata of SSN
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'SSN',
+ type: {
+ name: 'Composite',
+ className: 'SSN',
+ modelProperties: {
+ text: {
+ required: false,
+ serializedName: 'Text',
+ type: {
+ name: 'String'
+ }
+ },
+ index: {
+ required: false,
+ serializedName: 'Index',
+ type: {
+ name: 'Number'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = SSN;
diff --git a/lib/services/contentModerator/lib/models/screen.js b/lib/services/contentModerator/lib/models/screen.js
index 1b130a0083..9515f90a3d 100644
--- a/lib/services/contentModerator/lib/models/screen.js
+++ b/lib/services/contentModerator/lib/models/screen.js
@@ -24,9 +24,18 @@ class Screen {
* @member {string} [autoCorrectedText] The autocorrected text
* @member {array} [misrepresentation] The misrepresentation text.
* @member {object} [classification] The classification details of the text.
- * @member {number} [classification.adultScore] The adult score.
- * @member {number} [classification.racyScore] The racy score.
- * @member {number} [classification.offensiveScore] The offensive score.
+ * @member {object} [classification.category1] The category1 score details of
+ * the text. Click here
+ * for more details on category classification.
+ * @member {number} [classification.category1.score] The category1 score.
+ * @member {object} [classification.category2] The category2 score details of
+ * the text. Click here
+ * for more details on category classification.
+ * @member {number} [classification.category2.score] The category2 score.
+ * @member {object} [classification.category3] The category3 score details of
+ * the text. Click here
+ * for more details on category classification.
+ * @member {number} [classification.category3.score] The category3 score.
* @member {boolean} [classification.reviewRecommended] The review
* recommended flag.
* @member {object} [status] The evaluate status.
@@ -35,6 +44,7 @@ class Screen {
* @member {string} [status.exception] Exception status.
* @member {object} [pII] Personal Identifier Information details.
* @member {array} [pII.email]
+ * @member {array} [pII.sSN]
* @member {array} [pII.iPA]
* @member {array} [pII.phone]
* @member {array} [pII.address]
diff --git a/lib/services/contentModerator/lib/operations/index.d.ts b/lib/services/contentModerator/lib/operations/index.d.ts
index ffeb6dc06a..f4ca2edfd1 100644
--- a/lib/services/contentModerator/lib/operations/index.d.ts
+++ b/lib/services/contentModerator/lib/operations/index.d.ts
@@ -926,7 +926,7 @@ export interface TextModeration {
* @param {string} textContentType The content type. Possible values include:
* 'text/plain', 'text/html', 'text/xml', 'text/markdown'
*
- * @param {string} textContent Content to screen.
+ * @param {object} textContent Content to screen.
*
* @param {object} [options] Optional Parameters.
*
@@ -947,7 +947,7 @@ export interface TextModeration {
*
* @reject {Error|ServiceError} - The error object.
*/
- screenTextWithHttpOperationResponse(language: string, textContentType: string, textContent: string, options?: { autocorrect? : boolean, pII? : boolean, listId? : string, classify? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>;
+ screenTextWithHttpOperationResponse(language: string, textContentType: string, textContent: stream.Readable, options?: { autocorrect? : boolean, pII? : boolean, listId? : string, classify? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
* @summary Detect profanity and match against custom and shared blacklists
@@ -960,7 +960,7 @@ export interface TextModeration {
* @param {string} textContentType The content type. Possible values include:
* 'text/plain', 'text/html', 'text/xml', 'text/markdown'
*
- * @param {string} textContent Content to screen.
+ * @param {object} textContent Content to screen.
*
* @param {object} [options] Optional Parameters.
*
@@ -997,9 +997,9 @@ export interface TextModeration {
*
* {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
*/
- screenText(language: string, textContentType: string, textContent: string, options?: { autocorrect? : boolean, pII? : boolean, listId? : string, classify? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise;
- screenText(language: string, textContentType: string, textContent: string, callback: ServiceCallback): void;
- screenText(language: string, textContentType: string, textContent: string, options: { autocorrect? : boolean, pII? : boolean, listId? : string, classify? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ screenText(language: string, textContentType: string, textContent: stream.Readable, options?: { autocorrect? : boolean, pII? : boolean, listId? : string, classify? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise;
+ screenText(language: string, textContentType: string, textContent: stream.Readable, callback: ServiceCallback): void;
+ screenText(language: string, textContentType: string, textContent: stream.Readable, options: { autocorrect? : boolean, pII? : boolean, listId? : string, classify? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
/**
@@ -1011,7 +1011,7 @@ export interface TextModeration {
* @param {string} textContentType The content type. Possible values include:
* 'text/plain', 'text/html', 'text/xml', 'text/markdown'
*
- * @param {string} textContent Content to screen.
+ * @param {object} textContent Content to screen.
*
* @param {object} [options] Optional Parameters.
*
@@ -1024,7 +1024,7 @@ export interface TextModeration {
*
* @reject {Error|ServiceError} - The error object.
*/
- detectLanguageWithHttpOperationResponse(textContentType: string, textContent: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ detectLanguageWithHttpOperationResponse(textContentType: string, textContent: stream.Readable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
* This operation will detect the language of given input content. Returns the
@@ -1035,7 +1035,7 @@ export interface TextModeration {
* @param {string} textContentType The content type. Possible values include:
* 'text/plain', 'text/html', 'text/xml', 'text/markdown'
*
- * @param {string} textContent Content to screen.
+ * @param {object} textContent Content to screen.
*
* @param {object} [options] Optional Parameters.
*
@@ -1064,9 +1064,9 @@ export interface TextModeration {
*
* {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
*/
- detectLanguage(textContentType: string, textContent: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- detectLanguage(textContentType: string, textContent: string, callback: ServiceCallback): void;
- detectLanguage(textContentType: string, textContent: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ detectLanguage(textContentType: string, textContent: stream.Readable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ detectLanguage(textContentType: string, textContent: stream.Readable, callback: ServiceCallback): void;
+ detectLanguage(textContentType: string, textContent: stream.Readable, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
}
/**
diff --git a/lib/services/contentModerator/lib/operations/textModeration.js b/lib/services/contentModerator/lib/operations/textModeration.js
index ffa5afab78..7e9dcd86ce 100644
--- a/lib/services/contentModerator/lib/operations/textModeration.js
+++ b/lib/services/contentModerator/lib/operations/textModeration.js
@@ -24,7 +24,7 @@ const WebResource = msRest.WebResource;
* @param {string} textContentType The content type. Possible values include:
* 'text/plain', 'text/html', 'text/xml', 'text/markdown'
*
- * @param {string} textContent Content to screen.
+ * @param {object} textContent Content to screen.
*
* @param {object} [options] Optional Parameters.
*
@@ -89,8 +89,8 @@ function _screenText(language, textContentType, textContent, options, callback)
if (textContentType === null || textContentType === undefined || typeof textContentType.valueOf() !== 'string') {
throw new Error('textContentType cannot be null or undefined and it must be of type string.');
}
- if (textContent === null || textContent === undefined || typeof textContent.valueOf() !== 'string') {
- throw new Error('textContent cannot be null or undefined and it must be of type string.');
+ if (textContent === null || textContent === undefined) {
+ throw new Error('textContent cannot be null or undefined and it must be of type object.');
}
} catch (error) {
return callback(error);
@@ -136,25 +136,7 @@ function _screenText(language, textContentType, textContent, options, callback)
}
}
// Serialize Request
- let requestContent = null;
- let requestModel = null;
- try {
- if (textContent !== null && textContent !== undefined) {
- let requestModelMapper = {
- required: true,
- serializedName: 'Text Content',
- type: {
- name: 'String'
- }
- };
- requestModel = client.serialize(requestModelMapper, textContent, 'textContent');
- requestContent = JSON.stringify(requestModel);
- }
- } catch (error) {
- let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` +
- `payload - ${JSON.stringify(textContent, null, 2)}.`);
- return callback(serializationError);
- }
+ let requestContent = textContent;
httpRequest.body = requestContent;
// Send Request
return client.pipeline(httpRequest, (err, response, responseBody) => {
@@ -222,7 +204,7 @@ function _screenText(language, textContentType, textContent, options, callback)
* @param {string} textContentType The content type. Possible values include:
* 'text/plain', 'text/html', 'text/xml', 'text/markdown'
*
- * @param {string} textContent Content to screen.
+ * @param {object} textContent Content to screen.
*
* @param {object} [options] Optional Parameters.
*
@@ -260,8 +242,8 @@ function _detectLanguage(textContentType, textContent, options, callback) {
if (textContentType === null || textContentType === undefined || typeof textContentType.valueOf() !== 'string') {
throw new Error('textContentType cannot be null or undefined and it must be of type string.');
}
- if (textContent === null || textContent === undefined || typeof textContent.valueOf() !== 'string') {
- throw new Error('textContent cannot be null or undefined and it must be of type string.');
+ if (textContent === null || textContent === undefined) {
+ throw new Error('textContent cannot be null or undefined and it must be of type object.');
}
} catch (error) {
return callback(error);
@@ -290,25 +272,7 @@ function _detectLanguage(textContentType, textContent, options, callback) {
}
}
// Serialize Request
- let requestContent = null;
- let requestModel = null;
- try {
- if (textContent !== null && textContent !== undefined) {
- let requestModelMapper = {
- required: true,
- serializedName: 'Text Content',
- type: {
- name: 'String'
- }
- };
- requestModel = client.serialize(requestModelMapper, textContent, 'textContent');
- requestContent = JSON.stringify(requestModel);
- }
- } catch (error) {
- let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` +
- `payload - ${JSON.stringify(textContent, null, 2)}.`);
- return callback(serializationError);
- }
+ let requestContent = textContent;
httpRequest.body = requestContent;
// Send Request
return client.pipeline(httpRequest, (err, response, responseBody) => {
@@ -390,7 +354,7 @@ class TextModeration {
* @param {string} textContentType The content type. Possible values include:
* 'text/plain', 'text/html', 'text/xml', 'text/markdown'
*
- * @param {string} textContent Content to screen.
+ * @param {object} textContent Content to screen.
*
* @param {object} [options] Optional Parameters.
*
@@ -436,7 +400,7 @@ class TextModeration {
* @param {string} textContentType The content type. Possible values include:
* 'text/plain', 'text/html', 'text/xml', 'text/markdown'
*
- * @param {string} textContent Content to screen.
+ * @param {object} textContent Content to screen.
*
* @param {object} [options] Optional Parameters.
*
@@ -502,7 +466,7 @@ class TextModeration {
* @param {string} textContentType The content type. Possible values include:
* 'text/plain', 'text/html', 'text/xml', 'text/markdown'
*
- * @param {string} textContent Content to screen.
+ * @param {object} textContent Content to screen.
*
* @param {object} [options] Optional Parameters.
*
@@ -538,7 +502,7 @@ class TextModeration {
* @param {string} textContentType The content type. Possible values include:
* 'text/plain', 'text/html', 'text/xml', 'text/markdown'
*
- * @param {string} textContent Content to screen.
+ * @param {object} textContent Content to screen.
*
* @param {object} [options] Optional Parameters.
*
diff --git a/lib/services/contentModerator/package.json b/lib/services/contentModerator/package.json
index 24078388fe..dc0072b0fa 100644
--- a/lib/services/contentModerator/package.json
+++ b/lib/services/contentModerator/package.json
@@ -1,35 +1,21 @@
{
"name": "azure-cognitiveservices-contentmoderator",
"author": "Microsoft Corporation",
- "contributors": [
- "Xu, Willie "
- ],
+ "description": "ContentModeratorAPIClient Library with typescript type definitions for node",
"version": "1.0.0-preview",
- "description": "Microsoft Azure Cognitive Services Content Moderator API Client Library for Node.js",
- "tags": [
- "azure",
- "sdk"
- ],
- "keywords": [
- "node",
- "azure"
- ],
- "main": "./lib/contentModeratorAPIClient.js",
- "types": "./lib/contentModeratorAPIClient.d.ts",
- "license": "MIT",
"dependencies": {
- "ms-rest": "^2.2.5",
- "ms-rest-azure": "^2.5.0"
+ "ms-rest": "^2.3.2"
},
- "homepage": "http://github.com/Azure/azure-sdk-for-node",
+ "keywords": [ "node", "azure" ],
+ "license": "MIT",
+ "main": "./lib/contentModeratorAPIClient.js",
+ "types": "./lib/contentModeratorAPIClient.d.ts",
+ "homepage": "http://github.com/azure/azure-sdk-for-node",
"repository": {
"type": "git",
- "url": "git@github.com:Azure/azure-sdk-for-node.git"
+ "url": "https://github.com/azure/azure-sdk-for-node.git"
},
"bugs": {
"url": "http://github.com/Azure/azure-sdk-for-node/issues"
- },
- "scripts": {
- "test": "npm -s run-script jshint"
}
-}
\ No newline at end of file
+}