Skip to content
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
57 changes: 38 additions & 19 deletions packages/@azure/eventgrid/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
# Azure EventGridClient SDK for JavaScript
## Azure EventGridClient SDK for JavaScript

This package contains an isomorphic SDK for EventGridClient.

## Currently supported environments
### Currently supported environments

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

## How to Install
```
### How to Install

```bash
npm install @azure/eventgrid
```

### How to use

## How to use
#### nodejs - Authentication, client creation and publishEvents as an example written in TypeScript.

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

```bash
npm install @azure/ms-rest-nodeauth
```

### nodejs - Authentication, client creation and publishEvents as an example written in TypeScript.
##### Sample code

```ts
import * as msRest from "ms-rest-js";
import * as msRestAzure from "ms-rest-azure-js";
import * as msRestNodeAuth from "ms-rest-nodeauth";
```typescript
import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
import { EventGridClient, EventGridModels, EventGridMappers } from "@azure/eventgrid";
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

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

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

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

```bash
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.

- index.html
Expand All @@ -52,11 +71,11 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
<html lang="en">
<head>
<title>@azure/eventgrid sample</title>
<script src="node_modules/ms-rest-js/dist/msRest.browser.js"></script>
<script src="node_modules/ms-rest-azure-js/dist/msRestAzure.js"></script>
<script src="node_modules/ms-rest-browserauth/dist/msAuth.js"></script>
<script src="node_modules/@azure/ms-rest-js/dist/msRest.browser.js"></script>
<script src="node_modules/@azure/ms-rest-azure-js/dist/msRestAzure.js"></script>
<script src="node_modules/@azure/ms-rest-browserauth/dist/msAuth.js"></script>
<script src="node_modules/@azure/eventgrid/dist/eventgrid.js"></script>
<script>
<script type="text/javascript">
const subscriptionId = "<Subscription_Id>";
const authManager = new msAuth.AuthManager({
clientId: "<client id for your Azure AD app>",
Expand Down Expand Up @@ -88,10 +107,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)
4 changes: 2 additions & 2 deletions packages/@azure/eventgrid/lib/eventGridClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* regenerated.
*/

import * as msRest from "ms-rest-js";
import * as msRestAzure from "ms-rest-azure-js";
import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import * as Models from "./models";
import * as Mappers from "./models/mappers";
import * as Parameters from "./models/parameters";
Expand Down
4 changes: 2 additions & 2 deletions packages/@azure/eventgrid/lib/eventGridClientContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* regenerated.
*/

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

const packageName = "@azure/eventgrid";
const packageVersion = "0.1.0";
Expand Down
87 changes: 86 additions & 1 deletion packages/@azure/eventgrid/lib/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import { BaseResource, CloudError } from "ms-rest-azure-js";
import { BaseResource, CloudError } from "@azure/ms-rest-azure-js";

export { BaseResource, CloudError };

Expand Down Expand Up @@ -1117,6 +1117,54 @@ export interface ContainerRegistryImagePushedEventData extends ContainerRegistry
export interface ContainerRegistryImageDeletedEventData extends ContainerRegistryEventData {
}

/**
* @interface
* An interface representing ContainerRegistryArtifactEventData.
* The content of the event request message.
*
*/
export interface ContainerRegistryArtifactEventData {
/**
* @member {string} [id] The event ID.
*/
id?: string;
/**
* @member {Date} [timestamp] The time at which the event occurred.
*/
timestamp?: Date;
/**
* @member {string} [action] The action that encompasses the provided event.
*/
action?: string;
/**
* @member {ContainerRegistryArtifactEventTarget} [target] The target of the
* event.
*/
target?: ContainerRegistryArtifactEventTarget;
}

/**
* @interface
* An interface representing ContainerRegistryChartPushedEventData.
* Schema of the Data property of an EventGridEvent for a
* Microsoft.ContainerRegistry.ChartPushed event.
*
* @extends ContainerRegistryArtifactEventData
*/
export interface ContainerRegistryChartPushedEventData extends ContainerRegistryArtifactEventData {
}

/**
* @interface
* An interface representing ContainerRegistryChartDeletedEventData.
* Schema of the Data property of an EventGridEvent for a
* Microsoft.ContainerRegistry.ChartDeleted event.
*
* @extends ContainerRegistryArtifactEventData
*/
export interface ContainerRegistryChartDeletedEventData extends ContainerRegistryArtifactEventData {
}

/**
* @interface
* An interface representing ContainerRegistryEventTarget.
Expand Down Expand Up @@ -1225,6 +1273,43 @@ export interface ContainerRegistryEventSource {
instanceID?: string;
}

/**
* @interface
* An interface representing ContainerRegistryArtifactEventTarget.
* The target of the event.
*
*/
export interface ContainerRegistryArtifactEventTarget {
/**
* @member {string} [mediaType] The MIME type of the artifact.
*/
mediaType?: string;
/**
* @member {number} [size] The size in bytes of the artifact.
*/
size?: number;
/**
* @member {string} [digest] The digest of the artifact.
*/
digest?: string;
/**
* @member {string} [repository] The repository name of the artifact.
*/
repository?: string;
/**
* @member {string} [tag] The tag of the artifact.
*/
tag?: string;
/**
* @member {string} [name] The name of the artifact.
*/
name?: string;
/**
* @member {string} [version] The version of the artifact.
*/
version?: string;
}

/**
* @interface
* An interface representing ServiceBusActiveMessagesAvailableWithNoListenersEventData.
Expand Down
Loading