Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

[AutoPR] cognitiveservices/data-plane/ContentModerator #2694

Merged
4 commits merged into from
Jul 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions lib/services/contentModerator/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
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.
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.
18 changes: 18 additions & 0 deletions lib/services/contentModerator/lib/models/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,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.
Expand Down Expand Up @@ -232,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[];
Expand Down Expand Up @@ -294,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]
Expand Down
1 change: 1 addition & 0 deletions lib/services/contentModerator/lib/models/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ 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');
Expand Down
16 changes: 16 additions & 0 deletions lib/services/contentModerator/lib/models/pII.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class PII {
/**
* Create a PII.
* @member {array} [email]
* @member {array} [sSN]
* @member {array} [iPA]
* @member {array} [phone]
* @member {array} [address]
Expand Down Expand Up @@ -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',
Expand Down
61 changes: 61 additions & 0 deletions lib/services/contentModerator/lib/models/sSN.js
Original file line number Diff line number Diff line change
@@ -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;
1 change: 1 addition & 0 deletions lib/services/contentModerator/lib/models/screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,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]
Expand Down
32 changes: 16 additions & 16 deletions lib/services/contentModerator/lib/operations/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -921,15 +921,15 @@ export interface TextModeration {
* Detects profanity in more than 100 languages and match against custom and
* shared blacklists.
*
* @param {string} language Language of the terms.
*
* @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.
*
* @param {string} [options.language] Language of the text.
*
* @param {boolean} [options.autocorrect] Autocorrect text.
*
* @param {boolean} [options.pII] Detect personal identifiable information.
Expand All @@ -947,23 +947,23 @@ 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<HttpOperationResponse<models.Screen>>;
screenTextWithHttpOperationResponse(textContentType: string, textContent: stream.Readable, options?: { language? : string, autocorrect? : boolean, pII? : boolean, listId? : string, classify? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise<HttpOperationResponse<models.Screen>>;

/**
* @summary Detect profanity and match against custom and shared blacklists
*
* Detects profanity in more than 100 languages and match against custom and
* shared blacklists.
*
* @param {string} language Language of the terms.
*
* @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.
*
* @param {string} [options.language] Language of the text.
*
* @param {boolean} [options.autocorrect] Autocorrect text.
*
* @param {boolean} [options.pII] Detect personal identifiable information.
Expand Down Expand Up @@ -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<models.Screen>;
screenText(language: string, textContentType: string, textContent: string, callback: ServiceCallback<models.Screen>): void;
screenText(language: string, textContentType: string, textContent: string, options: { autocorrect? : boolean, pII? : boolean, listId? : string, classify? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<models.Screen>): void;
screenText(textContentType: string, textContent: stream.Readable, options?: { language? : string, autocorrect? : boolean, pII? : boolean, listId? : string, classify? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise<models.Screen>;
screenText(textContentType: string, textContent: stream.Readable, callback: ServiceCallback<models.Screen>): void;
screenText(textContentType: string, textContent: stream.Readable, options: { language? : string, autocorrect? : boolean, pII? : boolean, listId? : string, classify? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<models.Screen>): void;


/**
Expand All @@ -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.
*
Expand All @@ -1024,7 +1024,7 @@ export interface TextModeration {
*
* @reject {Error|ServiceError} - The error object.
*/
detectLanguageWithHttpOperationResponse(textContentType: string, textContent: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<HttpOperationResponse<models.DetectedLanguage>>;
detectLanguageWithHttpOperationResponse(textContentType: string, textContent: stream.Readable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<HttpOperationResponse<models.DetectedLanguage>>;

/**
* This operation will detect the language of given input content. Returns the
Expand All @@ -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.
*
Expand Down Expand Up @@ -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<models.DetectedLanguage>;
detectLanguage(textContentType: string, textContent: string, callback: ServiceCallback<models.DetectedLanguage>): void;
detectLanguage(textContentType: string, textContent: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<models.DetectedLanguage>): void;
detectLanguage(textContentType: string, textContent: stream.Readable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<models.DetectedLanguage>;
detectLanguage(textContentType: string, textContent: stream.Readable, callback: ServiceCallback<models.DetectedLanguage>): void;
detectLanguage(textContentType: string, textContent: stream.Readable, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<models.DetectedLanguage>): void;
}

/**
Expand Down
Loading