Skip to content

Commit

Permalink
CodeGen from PR 31334 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge c78225082f6dbb6358b1024b1b9bd668743acf1b into 74695171c408e136fa629451d23d98aac98e3981
  • Loading branch information
SDKAuto committed Nov 19, 2024
1 parent d1a67f0 commit b56b4ba
Show file tree
Hide file tree
Showing 38 changed files with 312 additions and 10,043 deletions.
29 changes: 23 additions & 6 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 0 additions & 19 deletions sdk/eventgrid/eventgrid-system-events/.nycrc

This file was deleted.

26 changes: 0 additions & 26 deletions sdk/eventgrid/eventgrid-system-events/CHANGELOG.md

This file was deleted.

4 changes: 2 additions & 2 deletions sdk/eventgrid/eventgrid-system-events/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2020 Microsoft
Copyright (c) 2024 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
Expand All @@ -18,4 +18,4 @@ 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.
SOFTWARE.
67 changes: 21 additions & 46 deletions sdk/eventgrid/eventgrid-system-events/README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,46 @@
# Azure Event Grid Namespaces client library for JavaScript
# Azure SystemEvents REST client library for JavaScript

Azure Event Grid system events are published by Azure services to system topics. The models in this package map to events sent by various Azure services.
Azure Messaging EventGrid SystemEvents

**Please rely heavily on our [REST client docs](https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/rest-clients.md) to use this library**

Key links:

- [Source code](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/eventgrid/eventgrid-system-events/)
- [Package (NPM)](https://www.npmjs.com/package/@azure/eventgrid-system-events)
- [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/eventgrid-namespaces/)
- [Product documentation](https://docs.microsoft.com/azure/event-grid/)
- [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/eventgrid-system-events?view=azure-node-preview)

## Getting started

### Currently supported environments

- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)
- Latest versions of Safari, Chrome, Edge, and Firefox.

See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
- LTS versions of Node.js

### Prerequisites

- An [Azure subscription][azure_sub].
- An existing [Event Grid][event_grid] Topic or Domain. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli].

If you use the Azure CLI, replace `<your-resource-group-name>` and `<your-resource-name>` with your own unique names:
- You must have an [Azure subscription](https://azure.microsoft.com/free/) to use this package.

#### Create an Event Grid Topic

```bash
az eventgrid topic create --location <location> --resource-group <your-resource-group-name> --name <your-resource-name>
```
### Install the `@azure/eventgrid-system-events` package

#### Create an Event Grid Domain
Install the Azure SystemEvents REST client REST client library for JavaScript with `npm`:

```bash
az eventgrid domain create --location <location> --resource-group <your-resource-group-name> --name <your-resource-name>
npm install @azure/eventgrid-system-events
```

### Install the `@azure/eventgrid-system-events` package
### Create and authenticate a `SystemEventsClient`

Install the Azure Event Grid System Events client library for JavaScript with `npm`:
To use an [Azure Active Directory (AAD) token credential](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token),
provide an instance of the desired credential type obtained from the
[@azure/identity](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) library.

```bash
npm install @azure/eventgrid-system-events
```
To authenticate with AAD, you must first `npm` install [`@azure/identity`](https://www.npmjs.com/package/@azure/identity)

## Key concepts
After setup, you can choose which type of [credential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) from `@azure/identity` to use.
As an example, [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential)
can be used to authenticate the client.

This package provides a list of System Events that could be used to publish events to EventGrid.
Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:
AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET

## Troubleshooting

Expand All @@ -61,22 +54,4 @@ const { setLogLevel } = require("@azure/logger");
setLogLevel("info");
```

For more detailed instructions on how to enable the logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).

## Contributing

If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.

## Related projects

- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Feventgrid%2Feventgrid%2FREADME.png)

[azure_cli]: https://docs.microsoft.com/cli/azure
[azure_sub]: https://azure.microsoft.com/free/
[event_grid]: https://docs.microsoft.com/azure/event-grid
[azure_portal]: https://portal.azure.com
[azure-core-tracing-github]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-tracing
[cloud-events-distributed-tracing-spec]: https://github.com/cloudevents/spec/blob/v1.0.1/extensions/distributed-tracing.md
[eventgrid-on-kubernetes-using-azure-arc]: https://docs.microsoft.com/azure/event-grid/kubernetes/
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
4 changes: 2 additions & 2 deletions sdk/eventgrid/eventgrid-system-events/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "types/src/index.d.ts",
"mainEntryPointFilePath": "./dist/esm/index.d.ts",
"docModel": {
"enabled": true
},
Expand Down Expand Up @@ -28,4 +28,4 @@
}
}
}
}
}
13 changes: 10 additions & 3 deletions sdk/eventgrid/eventgrid-system-events/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ export default [
...azsdkEslint.configs.recommended,
{
rules: {
"@typescript-eslint/naming-convention": "warn",
},
},
"@azure/azure-sdk/ts-modules-only-named": "warn",
"@azure/azure-sdk/ts-apiextractor-json-types": "warn",
"@azure/azure-sdk/ts-package-json-types": "warn",
"@azure/azure-sdk/ts-package-json-engine-is-present": "warn",
"@azure/azure-sdk/ts-package-json-module": "off",
"@azure/azure-sdk/ts-package-json-files-required": "off",
"@azure/azure-sdk/ts-package-json-main-is-cjs": "off",
"tsdoc/syntax": "warn"
}
}
];
117 changes: 0 additions & 117 deletions sdk/eventgrid/eventgrid-system-events/karma.conf.js

This file was deleted.

Loading

0 comments on commit b56b4ba

Please sign in to comment.