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

[data-plane] refresh defender-easm-rest sdk #30976

Merged
merged 33 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
5ac6313
[data-plane] refresh defender-easm-rest sdk
kazrael2119 Sep 3, 2024
b388630
format
kazrael2119 Sep 5, 2024
2d8dd88
Update CHANGELOG.md
kazrael2119 Sep 9, 2024
d12614e
merge main
kazrael2119 Nov 6, 2024
e857752
merge main and regen
kazrael2119 Dec 16, 2024
6d2e3ef
update
kazrael2119 Dec 16, 2024
194f253
merge main
kazrael2119 Dec 16, 2024
72c6f48
update
kazrael2119 Dec 16, 2024
8b0f06e
update
kazrael2119 Dec 16, 2024
98e3da6
Update sdk/easm/defender-easm-rest/CHANGELOG.md
kazrael2119 Dec 16, 2024
9f505c7
Update package.json
kazrael2119 Dec 16, 2024
15d4fe1
Merge branch 'defender-easm-rest-refresh' of https://github.com/kazra…
kazrael2119 Dec 16, 2024
38c3f97
update
kazrael2119 Dec 16, 2024
a4a0aa9
Update assets.json
kazrael2119 Dec 16, 2024
9ec00e9
merge main
kazrael2119 Dec 19, 2024
6fa2e9b
update
kazrael2119 Dec 20, 2024
6675ef2
merge main
kazrael2119 Jan 17, 2025
5c5aa54
merge main
kazrael2119 Jan 23, 2025
28c918f
Delete __azurite_db_table__.json
kazrael2119 Jan 23, 2025
c01eb8c
Update vitest.browser.config.ts
kazrael2119 Jan 23, 2025
f83b485
Migration: Update package.json, tsconfig.json, and api-extractor.json
kazrael2119 Jan 23, 2025
28ea427
Migration: Update test config
kazrael2119 Jan 23, 2025
5fbe957
Migration: Clean up files
kazrael2119 Jan 23, 2025
c9efd4e
Migration: Apply codemod: "fixSourceFile"
kazrael2119 Jan 23, 2025
026cd87
Migration: Apply codemod: "fixTestingImports"
kazrael2119 Jan 23, 2025
5ab166d
Migration: Apply codemod: "replaceAssertIsRejected"
kazrael2119 Jan 23, 2025
b54fcfa
Migration: Apply codemod: "replaceSinonStub"
kazrael2119 Jan 23, 2025
f49afbd
Migration: Apply codemod: "addViHelper"
kazrael2119 Jan 23, 2025
d30dc5a
Migration: Apply codemod: "replaceSupportTracing"
kazrael2119 Jan 23, 2025
f69e279
Migration: Apply codemod: "replaceTestUtils"
kazrael2119 Jan 23, 2025
e14e48e
Migration: rushx format
kazrael2119 Jan 23, 2025
d98600e
Update pnpm-lock.yaml
kazrael2119 Jan 23, 2025
ca8b6fb
Update assets.json
kazrael2119 Jan 23, 2025
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
4 changes: 2 additions & 2 deletions common/config/rush/pnpm-lock.yaml

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

9 changes: 2 additions & 7 deletions sdk/easm/defender-easm-rest/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
# Release History

## 1.0.0-beta.2 (Unreleased)
## 1.0.0-beta.2 (2024-09-09)
kazrael2119 marked this conversation as resolved.
Show resolved Hide resolved

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes
- refresh @azure-rest/defender-easm sdk

## 1.0.0-beta.1 (2023-11-07)

Expand Down
21 changes: 21 additions & 0 deletions sdk/easm/defender-easm-rest/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

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
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.
12 changes: 4 additions & 8 deletions sdk/easm/defender-easm-rest/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Azure DefenderEasm REST client library for JavaScript
# Azure Easm REST client library for JavaScript

Defender EASM discovers and maps your digital attack surface to provide an "outside-in" perspective using probes to discover assets. The assets are provided with detailed metadata associated, including vulnerabilities, configurations and web components, allowing customers to view and prioritize external risk. The EASM REST API enables you to develop clients that integrate with your application.

Expand All @@ -8,8 +8,7 @@ Key links:

- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/easm/defender-easm-rest)
- [Package (NPM)](https://www.npmjs.com/package/@azure-rest/defender-easm)
- [API reference documentation](https://azure.github.io/azure-sdk-for-js)
- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/easm/defender-easm-rest/samples/v1-beta)
- [API reference documentation](https://docs.microsoft.com/javascript/api/@azure-rest/defender-easm?view=azure-node-preview)

kazrael2119 marked this conversation as resolved.
Show resolved Hide resolved
## Getting started

Expand All @@ -23,7 +22,7 @@ Key links:

### Install the `@azure-rest/defender-easm` package

Install the Azure DefenderEasm REST client REST client library for JavaScript with `npm`:
Install the Azure Easm REST client REST client library for JavaScript with `npm`:

```bash
npm install @azure-rest/defender-easm
Expand All @@ -35,15 +34,12 @@ To use an [Azure Active Directory (AAD) token credential](https://github.com/Azu
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.

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

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.

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

### Logging
Expand Down
27 changes: 7 additions & 20 deletions sdk/easm/defender-easm-rest/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,18 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "dist/esm/index.d.ts",
"docModel": {
"enabled": true
},
"apiReport": {
"enabled": true,
"reportFolder": "./review"
},
"mainEntryPointFilePath": "./dist/esm/index.d.ts",
"docModel": { "enabled": true },
"apiReport": { "enabled": true, "reportFolder": "./review" },
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "dist/defender-easm.d.ts"
"publicTrimmedFilePath": "./types/defender-easm.d.ts"
},
"messages": {
"tsdocMessageReporting": {
"default": {
"logLevel": "none"
}
},
"tsdocMessageReporting": { "default": { "logLevel": "none" } },
"extractorMessageReporting": {
"ae-missing-release-tag": {
"logLevel": "none"
},
"ae-unresolved-link": {
"logLevel": "none"
}
"ae-missing-release-tag": { "logLevel": "none" },
"ae-unresolved-link": { "logLevel": "none" }
}
}
}
12 changes: 10 additions & 2 deletions sdk/easm/defender-easm-rest/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import azsdkEslint from "@azure/eslint-plugin-azure-sdk";

export default azsdkEslint.config([
export default [
...azsdkEslint.configs.recommended,
{
rules: {
"@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",
},
},
]);
];
175 changes: 83 additions & 92 deletions sdk/easm/defender-easm-rest/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
{
"name": "@azure-rest/defender-easm",
"sdk-type": "client",
"author": "Microsoft Corporation",
"version": "1.0.0-beta.2",
"description": "Defender EASM Client",
"description": "A generated SDK for EasmClient.",
"engines": {
"node": ">=18.0.0"
},
"sideEffects": false,
"autoPublish": false,
"tshy": {
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts"
},
"dialects": [
"esm",
"commonjs"
],
"esmDialects": [
"browser",
"react-native"
],
"selfLink": false
},
"type": "module",
"keywords": [
"node",
"azure",
Expand All @@ -12,108 +31,77 @@
"browser",
"isomorphic"
],
"author": "Microsoft Corporation",
"license": "MIT",
"main": "./dist/commonjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/commonjs/index.d.ts",
"repository": "github:Azure/azure-sdk-for-js",
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"files": [
"dist/",
"dist",
"README.md",
"LICENSE"
"LICENSE",
"review/*",
"CHANGELOG.md"
],
"engines": {
"node": ">=18.0.0"
},
"scripts": {
"build": "npm run clean && dev-tool run build-package && dev-tool run extract-api",
"build:samples": "echo skipped.",
"build:test": "echo skipped.",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\" \"test/**/*.ts\"",
"clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"execute:samples": "echo skipped",
"extract-api": "dev-tool run vendored rimraf review && dev-tool run vendored mkdirp ./review && dev-tool run extract-api",
"format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\" \"test/**/*.ts\"",
"generate:client": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
"integration-test:node": "dev-tool run test:vitest --esm",
"lint": "eslint package.json api-extractor.json src test",
"lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]",
"pack": "npm pack 2>&1",
"test": "npm run clean && npm run build:test && npm run unit-test",
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser",
"test:node": "npm run clean && npm run build:test && npm run unit-test:node",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"unit-test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
"unit-test:node": "dev-tool run test:vitest",
"update-snippets": "echo skipped"
},
"sideEffects": false,
"autoPublish": false,
"dependencies": {
"@azure-rest/core-client": "^2.3.1",
"@azure/core-auth": "^1.9.0",
"@azure/core-lro": "^2.7.2",
"@azure/core-paging": "^1.6.2",
"@azure/core-rest-pipeline": "^1.18.0",
"@azure/logger": "^1.1.4",
"tslib": "^2.8.1"
},
"devDependencies": {
"@azure-tools/test-credential": "^2.0.0",
"@azure-tools/test-recorder": "^4.1.0",
"@azure-tools/test-utils-vitest": "^1.0.0",
"@azure/core-util": "^1.0.0",
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/identity": "^4.0.1",
"@types/node": "^18.0.0",
"@vitest/browser": "^2.1.6",
"@vitest/coverage-istanbul": "^2.1.6",
"dotenv": "^16.0.0",
"eslint": "^9.9.0",
"playwright": "^1.49.0",
"typescript": "~5.6.2",
"vitest": "^2.1.6"
"sdk-type": "client",
"repository": "github:Azure/azure-sdk-for-js",
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/easm/defender-easm-rest/README.md",
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
"//metadata": {
"constantPaths": [
{
"path": "src/easm.ts",
"path": "src/easmClient.ts",
"prefix": "userAgentInfo"
}
]
},
"browser": "./dist/browser/index.js",
"//sampleConfiguration": {
"productName": "Defender EASM Client",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://learn.microsoft.com/azure/external-attack-surface-management/"
"dependencies": {
"@azure-rest/core-client": "^2.3.1",
"@azure/core-auth": "^1.6.0",
"@azure/core-rest-pipeline": "^1.5.0",
"@azure/logger": "^1.0.0",
"tslib": "^2.6.2"
},
"type": "module",
"tshy": {
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts"
},
"dialects": [
"esm",
"commonjs"
],
"esmDialects": [
"browser",
"react-native"
],
"selfLink": false,
"project": "./tsconfig.src.json"
"devDependencies": {
"dotenv": "^16.0.0",
"@microsoft/api-extractor": "^7.40.3",
"@types/node": "^18.0.0",
"eslint": "^9.9.0",
"typescript": "~5.6.2",
"@azure/identity": "^4.2.1",
"@vitest/browser": "^2.0.5",
"@vitest/coverage-istanbul": "^2.0.5",
"playwright": "^1.41.2",
"vitest": "^2.0.5",
"@azure-tools/test-credential": "^2.0.0",
"@azure-tools/test-recorder": "^4.0.0",
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0"
},
"scripts": {
"clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"extract-api": "dev-tool run vendored rimraf review && dev-tool run vendored mkdirp ./review && dev-tool run extract-api",
"pack": "npm pack 2>&1",
"lint": "eslint package.json api-extractor.json src test",
"lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"unit-test:browser": "npm run build:test && dev-tool run test:vitest --browser",
"unit-test:node": "dev-tool run test:vitest",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:browser": "echo skipped",
"integration-test:node": "echo skipped",
"build:samples": "echo skipped",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ",
"execute:samples": "echo skipped",
"format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ",
"generate:client": "echo skipped",
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
"build:test": "npm run clean && dev-tool run build-package && dev-tool run build-test",
"build": "npm run clean && dev-tool run build-package && dev-tool run vendored mkdirp ./review && dev-tool run extract-api",
"test:node": "npm run clean && dev-tool run build-package && npm run unit-test:node && npm run integration-test:node",
"test": "npm run clean && dev-tool run build-package && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test",
"update-snippets": "echo skipped"
},
"exports": {
"./package.json": "./package.json",
Expand All @@ -135,5 +123,8 @@
"default": "./dist/commonjs/index.js"
}
}
}
},
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"module": "./dist/esm/index.js"
}
Loading
Loading