Skip to content
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-entitysearch/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,26 @@
## An isomorphic javascript sdk for - EntitySearchAPIClient
# An isomorphic javascript sdk for - EntitySearchAPIClient
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 EntitySearchAPIClient.

### Currently supported environments

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

### How to Install
## How to Install

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

### How to use

#### nodejs - Authentication, client creation and search entities 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-entitysearch/dist/cognitiveservices-entitysearch.js"></script>
```

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

### nodejs - Authentication, client creation and search entities 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 { EntitySearchAPIClient, EntitySearchAPIModels, EntitySearchAPIMappers } from "@azure/cognitiveservices-entitysearch";
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

Expand Down Expand Up @@ -55,26 +48,16 @@ msRestNodeAuth.interactiveLogin().then((creds) => {
});
```

#### browser - Authentication, client creation and search entities 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 search entities as an example written in javascript.

- index.html
```html
<!DOCTYPE html>
<html lang="en">
<head>
<title>@azure/cognitiveservices-entitysearch 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-entitysearch/dist/cognitiveservices-entitysearch.js"></script>
<script type="text/javascript">
const subscriptionId = "<Subscription_Id>";
Expand Down Expand Up @@ -111,10 +94,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";
import * as Models from "./models";

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

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


/**
Expand Down Expand Up @@ -1203,7 +1203,7 @@ export interface PostalAddress {
*/
readonly addressCountry?: string;
/**
* @member {string} [countryIso] The two letter ISO code of this countr. For
* @member {string} [countryIso] The two letter ISO code of this country. For
* example, US.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
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 QueryContext: msRest.CompositeMapper = {
Expand Down Expand Up @@ -115,6 +115,11 @@ export const Response: msRest.CompositeMapper = {
element: {
type: {
name: "Composite",
polymorphicDiscriminator: {
serializedName: "_type",
clientName: "_type"
},
uberParent: "ContractualRulesContractualRule",
className: "ContractualRulesContractualRule"
}
}
Expand Down Expand Up @@ -159,6 +164,8 @@ export const Thing: msRest.CompositeMapper = {
serializedName: "image",
type: {
name: "Composite",
polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator,
uberParent: "ResponseBase",
className: "ImageObject"
}
},
Expand Down Expand Up @@ -212,6 +219,8 @@ export const CreativeWork: msRest.CompositeMapper = {
element: {
type: {
name: "Composite",
polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator,
uberParent: "ResponseBase",
className: "Thing"
}
}
Expand Down Expand Up @@ -283,6 +292,8 @@ export const ImageObject: msRest.CompositeMapper = {
serializedName: "thumbnail",
type: {
name: "Composite",
polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator,
uberParent: "ResponseBase",
className: "ImageObject"
}
}
Expand Down Expand Up @@ -386,6 +397,8 @@ export const Entities: msRest.CompositeMapper = {
element: {
type: {
name: "Composite",
polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator,
uberParent: "ResponseBase",
className: "Thing"
}
}
Expand All @@ -412,6 +425,8 @@ export const Places: msRest.CompositeMapper = {
element: {
type: {
name: "Composite",
polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator,
uberParent: "ResponseBase",
className: "Thing"
}
}
Expand Down Expand Up @@ -443,6 +458,8 @@ export const SearchResponse: msRest.CompositeMapper = {
serializedName: "entities",
type: {
name: "Composite",
polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator,
uberParent: "ResponseBase",
className: "Entities"
}
},
Expand All @@ -451,6 +468,8 @@ export const SearchResponse: msRest.CompositeMapper = {
serializedName: "places",
type: {
name: "Composite",
polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator,
uberParent: "ResponseBase",
className: "Places"
}
}
Expand Down Expand Up @@ -696,6 +715,8 @@ export const Place: msRest.CompositeMapper = {
serializedName: "address",
type: {
name: "Composite",
polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator,
uberParent: "ResponseBase",
className: "PostalAddress"
}
},
Expand Down Expand Up @@ -747,6 +768,8 @@ export const LocalBusiness: msRest.CompositeMapper = {
element: {
type: {
name: "Composite",
polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator,
uberParent: "ResponseBase",
className: "ImageObject"
}
}
Expand Down Expand Up @@ -903,6 +926,8 @@ export const ContractualRulesLicenseAttribution: msRest.CompositeMapper = {
serializedName: "license",
type: {
name: "Composite",
polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator,
uberParent: "ResponseBase",
className: "License"
}
},
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 acceptLanguage: msRest.OperationParameter = {
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/entitiesOperationsMappers";
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": "EntitySearchAPIClient 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/entitySearchAPIClient.js',
external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"],
external: ["ms-rest-js", "ms-rest-azure-js"],
output: {
file: "./dist/cognitiveservices-entitysearch.js",
format: "umd",
name: "Azure.CognitiveservicesEntitysearch",
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"]
}