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

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

Closed
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
59 changes: 21 additions & 38 deletions packages/@azure/cognitiveservices-contentmoderator/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,26 @@
## An isomorphic javascript sdk for - ContentModeratorClient
# An isomorphic javascript sdk for - ContentModeratorClient
This project provides an isomorphic javascript package. Right now it supports:
- node.js version 6.x.x or higher
- browser javascript

This package contains an isomorphic SDK for ContentModeratorClient.

### Currently supported environments

- Node.js version 6.x.x or higher
- Browser JavaScript

### How to Install
## How to Install

- nodejs
```
npm install @azure/cognitiveservices-contentmoderator
```

### How to use

#### nodejs - Authentication, client creation and getDetails listManagementImageLists as an example written in TypeScript.

##### Install @azure/ms-rest-nodeauth

```
npm install @azure/ms-rest-nodeauth
- browser
```html
<script type="text/javascript" src="@azure/cognitiveservices-contentmoderator/dist/cognitiveservices-contentmoderator.js"></script>
```

##### Sample code
## How to use

### nodejs - Authentication, client creation and getDetails listManagementImageLists as an example written in TypeScript.

```ts
import * as msRest from "@azure/ms-rest-js";
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
import * as msRest from "ms-rest-js";
import * as msRestNodeAuth from "ms-rest-nodeauth";
import { ContentModeratorClient, ContentModeratorModels, ContentModeratorMappers } from "@azure/cognitiveservices-contentmoderator";
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

Expand All @@ -43,26 +36,16 @@ msRestNodeAuth.interactiveLogin().then((creds) => {
});
```

#### browser - Authentication, client creation and getDetails listManagementImageLists as an example written in JavaScript.

##### Install @azure/ms-rest-browserauth

```
npm install @azure/ms-rest-browserauth
```

##### Sample code

See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser.
### browser - Authentication, client creation and getDetails listManagementImageLists as an example written in javascript.

- index.html
```html
<!DOCTYPE html>
<html lang="en">
<head>
<title>@azure/cognitiveservices-contentmoderator sample</title>
<script src="node_modules/@azure/ms-rest-js/dist/msRest.browser.js"></script>
<script src="node_modules/@azure/ms-rest-browserauth/dist/msAuth.js"></script>
<script src="node_modules/ms-rest-js/dist/msRest.browser.js"></script>
<script src="node_modules/ms-rest-browserauth/dist/msAuth.js"></script>
<script src="node_modules/@azure/cognitiveservices-contentmoderator/dist/cognitiveservices-contentmoderator.js"></script>
<script type="text/javascript">
const subscriptionId = "<Subscription_Id>";
Expand All @@ -87,10 +70,10 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
});
</script>
</head>
<body></body>
<body>
</body>
</html>
```

## Related projects

- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
# Related projects
- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";
import * as Models from "./models";
import * as Mappers from "./models/mappers";
import * as operations from "./operations";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";

const packageName = "@azure/cognitiveservices-contentmoderator";
const packageVersion = "0.1.0";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";


/**
Expand Down Expand Up @@ -543,7 +543,7 @@ export interface Evaluate {
*/
isImageAdultClassified?: boolean;
/**
* @member {number} [racyClassificationScore] The racy classication score.
* @member {number} [racyClassificationScore] The racy classification score.
*/
racyClassificationScore?: number;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";


export const KeyValuePair: msRest.CompositeMapper = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";

export const autocorrect: msRest.OperationQueryParameter = {
parameterPath: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";
import * as Models from "../models";
import * as Mappers from "../models/imageModerationMappers";
import * as Parameters from "../models/parameters";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";
import * as Models from "../models";
import * as Mappers from "../models/listManagementImageMappers";
import * as Parameters from "../models/parameters";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";
import * as Models from "../models";
import * as Mappers from "../models/listManagementImageListsMappers";
import * as Parameters from "../models/parameters";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";
import * as Models from "../models";
import * as Mappers from "../models/listManagementTermMappers";
import * as Parameters from "../models/parameters";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";
import * as Models from "../models";
import * as Mappers from "../models/listManagementTermListsMappers";
import * as Parameters from "../models/parameters";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";
import * as Models from "../models";
import * as Mappers from "../models/reviewsMappers";
import * as Parameters from "../models/parameters";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";
import * as Models from "../models";
import * as Mappers from "../models/textModerationMappers";
import * as Parameters from "../models/parameters";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "ContentModeratorClient Library with typescript type definitions for node.js and browser.",
"version": "0.1.0",
"dependencies": {
"@azure/ms-rest-js": "^1.1.0",
"ms-rest-js": "^1.0.460",
"tslib": "^1.9.3"
},
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import nodeResolve from "rollup-plugin-node-resolve";
*/
const config = {
input: './esm/contentModeratorClient.js',
external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"],
external: ["ms-rest-js", "ms-rest-azure-js"],
output: {
file: "./dist/cognitiveservices-contentmoderator.js",
format: "umd",
name: "Azure.CognitiveservicesContentmoderator",
sourcemap: true,
globals: {
"@azure/ms-rest-js": "msRest",
"@azure/ms-rest-azure-js": "msRestAzure"
"ms-rest-js": "msRest",
"ms-rest-azure-js": "msRestAzure"
},
banner: `/*
* Copyright (c) Microsoft Corporation. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"outDir": "./esm",
"importHelpers": true
},
"include": ["./lib/**/*.ts"],
"include": ["./lib/**/*"],
"exclude": ["node_modules"]
}