Skip to content

Commit

Permalink
[informatica] Migrate informatica projects to use snippets extraction (
Browse files Browse the repository at this point in the history
…#32927)

### Packages impacted by this PR

- @azure/arm-informaticadatamanagement

### Issues associated with this PR

- #32416

### Describe the problem that is addressed by this PR

Updates all projects under `informatica` to use snippets extraction.

### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?


### Are there test cases added in this PR? _(If not, why?)_


### Provide a list of related PRs _(if any)_


### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_

### Checklists
- [ ] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)
  • Loading branch information
mpodwysocki authored Feb 11, 2025
1 parent b2ef9e4 commit 9199d72
Show file tree
Hide file tree
Showing 60 changed files with 399 additions and 364 deletions.
42 changes: 28 additions & 14 deletions common/config/rush/pnpm-lock.yaml

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

39 changes: 23 additions & 16 deletions sdk/informatica/arm-informaticadatamanagement/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,28 @@ Set the values of the client ID, tenant ID, and client secret of the AAD applica

For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).

```javascript
const { InformaticaDataManagement } = require("@azure/arm-informaticadatamanagement");
const { DefaultAzureCredential } = require("@azure/identity");
// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details.
Using Node.js and Node-like environments, you can use the `DefaultAzureCredential` class to authenticate the client.

```ts snippet:ReadmeSampleCreateClient_Node
import { AstroManagementClient } from "@azure/arm-informaticadatamanagement";
import { DefaultAzureCredential } from "@azure/identity";

const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new InformaticaDataManagement(new DefaultAzureCredential(), subscriptionId);

// For client-side applications running in the browser, use this code instead:
// const credential = new InteractiveBrowserCredential({
// tenantId: "<YOUR_TENANT_ID>",
// clientId: "<YOUR_CLIENT_ID>"
// });
// const client = new InformaticaDataManagement(credential, subscriptionId);
const client = new AstroManagementClient(new DefaultAzureCredential(), subscriptionId);
```

For browser environments, use the `InteractiveBrowserCredential` from the `@azure/identity` package to authenticate.

```ts snippet:ReadmeSampleCreateClient_Browser
import { InteractiveBrowserCredential } from "@azure/identity";
import { AstroManagementClient } from "@azure/arm-informaticadatamanagement";

const subscriptionId = "00000000-0000-0000-0000-000000000000";
const credential = new InteractiveBrowserCredential({
tenantId: "<YOUR_TENANT_ID>",
clientId: "<YOUR_CLIENT_ID>",
});
const client = new AstroManagementClient(credential, subscriptionId);
```

### JavaScript Bundle
Expand All @@ -78,8 +86,9 @@ To use this client library in the browser, first you need to use a bundler. For

Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:

```javascript
const { setLogLevel } = require("@azure/logger");
```ts snippet:SetLogLevel
import { setLogLevel } from "@azure/logger";

setLogLevel("info");
```

Expand All @@ -97,8 +106,6 @@ If you'd like to contribute to this library, please read the [contributing guide

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



[azure_cli]: https://learn.microsoft.com/cli/azure
[azure_sub]: https://azure.microsoft.com/free/
[azure_sub]: https://azure.microsoft.com/free/
Expand Down
2 changes: 1 addition & 1 deletion sdk/informatica/arm-informaticadatamanagement/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/[email protected]",
"use": "@autorest/[email protected]"
}
}
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": "./dist-esm/src/index.d.ts",
"mainEntryPointFilePath": "dist/esm/index.d.ts",
"docModel": {
"enabled": true
},
Expand All @@ -11,7 +11,7 @@
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "./types/arm-informaticadatamanagement.d.ts"
"publicTrimmedFilePath": "dist/arm-informaticadatamanagement.d.ts"
},
"messages": {
"tsdocMessageReporting": {
Expand All @@ -28,4 +28,4 @@
}
}
}
}
}
110 changes: 69 additions & 41 deletions sdk/informatica/arm-informaticadatamanagement/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,66 +8,54 @@
"node": ">=18.0.0"
},
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-auth": "^1.6.0",
"@azure/core-client": "^1.7.0",
"@azure/abort-controller": "^2.1.2",
"@azure/core-auth": "^1.9.0",
"@azure/core-client": "^1.9.2",
"@azure/core-lro": "^2.5.4",
"@azure/core-paging": "^1.2.0",
"@azure/core-rest-pipeline": "^1.14.0",
"tslib": "^2.2.0"
"@azure/core-paging": "^1.6.2",
"@azure/core-rest-pipeline": "^1.19.0",
"tslib": "^2.8.1"
},
"keywords": [
"node",
"azure",
"typescript",
"browser",
"isomorphic"
"isomorphic",
"cloud"
],
"license": "MIT",
"main": "./dist/index.js",
"module": "./dist-esm/src/index.js",
"types": "./types/arm-informaticadatamanagement.d.ts",
"main": "./dist/commonjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/commonjs/index.d.ts",
"devDependencies": {
"@azure-tools/test-credential": "^1.1.0",
"@azure-tools/test-recorder": "^3.0.0",
"@azure-tools/test-credential": "^2.0.0",
"@azure-tools/test-recorder": "^4.1.0",
"@azure-tools/test-utils-vitest": "^1.0.0",
"@azure/dev-tool": "^1.0.0",
"@azure/identity": "^4.0.1",
"@types/chai": "^4.2.8",
"@types/mocha": "^10.0.0",
"@azure/identity": "^4.6.0",
"@azure/logger": "^1.1.4",
"@types/node": "^18.0.0",
"chai": "^4.2.0",
"@vitest/browser": "^3.0.3",
"@vitest/coverage-istanbul": "^3.0.3",
"dotenv": "^16.0.0",
"mocha": "^11.0.2",
"ts-node": "^10.0.0",
"tsx": "^4.7.1",
"typescript": "~5.7.2"
},
"repository": {
"type": "git",
"url": "https://github.com/Azure/azure-sdk-for-js.git"
"playwright": "^1.50.1",
"typescript": "~5.7.2",
"vitest": "^3.0.3"
},
"repository": "github:Azure/azure-sdk-for-js",
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"files": [
"dist/**/*.js",
"dist/**/*.js.map",
"dist/**/*.d.ts",
"dist/**/*.d.ts.map",
"dist-esm/**/*.js",
"dist-esm/**/*.js.map",
"dist-esm/**/*.d.ts",
"dist-esm/**/*.d.ts.map",
"src/**/*.ts",
"dist/",
"README.md",
"LICENSE",
"tsconfig.json",
"review/*",
"CHANGELOG.md",
"types/*"
"review/",
"CHANGELOG.md"
],
"scripts": {
"build": "npm run clean && tsc && dev-tool run bundle && npm run minify && npm run extract-api",
"build": "npm run clean && dev-tool run build-package && dev-tool run extract-api",
"build:browser": "echo skipped",
"build:node": "echo skipped",
"build:samples": "echo skipped.",
Expand All @@ -79,7 +67,7 @@
"format": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:browser": "echo skipped",
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
"integration-test:node": "dev-tool run test:vitest --esm",
"lint": "echo skipped",
"minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
"pack": "npm pack 2>&1",
Expand All @@ -89,8 +77,8 @@
"test:node": "echo skipped",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"unit-test:browser": "echo skipped",
"unit-test:node": "dev-tool run vendored cross-env TEST_MODE=playback npm run integration-test:node",
"update-snippets": "echo skipped"
"unit-test:node": "dev-tool run test:vitest",
"update-snippets": "dev-tool run update-snippets"
},
"sideEffects": false,
"//metadata": {
Expand All @@ -110,5 +98,45 @@
],
"disableDocsMs": true,
"apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-informaticadatamanagement?view=azure-node-preview"
},
"type": "module",
"tshy": {
"project": "./tsconfig.src.json",
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts"
},
"dialects": [
"esm",
"commonjs"
],
"esmDialects": [
"browser",
"react-native"
],
"selfLink": false
},
"browser": "./dist/browser/index.js",
"react-native": "./dist/react-native/index.js",
"exports": {
"./package.json": "./package.json",
".": {
"browser": {
"types": "./dist/browser/index.d.ts",
"default": "./dist/browser/index.js"
},
"react-native": {
"types": "./dist/react-native/index.d.ts",
"default": "./dist/react-native/index.js"
},
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@
*/
import { InformaticaDataManagement } from "@azure/arm-informaticadatamanagement";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

dotenv.config();
import "dotenv/config";

/**
* This sample demonstrates how to List the operations for the provider
*
* @summary List the operations for the provider
* x-ms-original-file: specification/informatica/resource-manager/Informatica.DataManagement/stable/2024-05-08/examples/Operations_List_MaximumSet_Gen.json
*/
async function operationsList() {
async function operationsList(): Promise<void> {
const subscriptionId =
process.env["INFORMATICA_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
Expand All @@ -35,7 +33,7 @@ async function operationsList() {
* @summary List the operations for the provider
* x-ms-original-file: specification/informatica/resource-manager/Informatica.DataManagement/stable/2024-05-08/examples/Operations_List_MinimumSet_Gen.json
*/
async function operationsListMin() {
async function operationsListMin(): Promise<void> {
const subscriptionId =
process.env["INFORMATICA_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
Expand All @@ -47,7 +45,7 @@ async function operationsListMin() {
console.log(resArray);
}

async function main() {
async function main(): Promise<void> {
await operationsList();
await operationsListMin();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@
import type { InformaticaOrganizationResource } from "@azure/arm-informaticadatamanagement";
import { InformaticaDataManagement } from "@azure/arm-informaticadatamanagement";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

dotenv.config();
import "dotenv/config";

/**
* This sample demonstrates how to Create a InformaticaOrganizationResource
*
* @summary Create a InformaticaOrganizationResource
* x-ms-original-file: specification/informatica/resource-manager/Informatica.DataManagement/stable/2024-05-08/examples/Organizations_CreateOrUpdate_MaximumSet_Gen.json
*/
async function organizationsCreateOrUpdate() {
async function organizationsCreateOrUpdate(): Promise<void> {
const subscriptionId =
process.env["INFORMATICA_SUBSCRIPTION_ID"] || "3599DA28-E346-4D9F-811E-189C0445F0FE";
const resourceGroupName = process.env["INFORMATICA_RESOURCE_GROUP"] || "rgopenapi";
Expand Down Expand Up @@ -83,7 +81,7 @@ async function organizationsCreateOrUpdate() {
* @summary Create a InformaticaOrganizationResource
* x-ms-original-file: specification/informatica/resource-manager/Informatica.DataManagement/stable/2024-05-08/examples/Organizations_CreateOrUpdate_MinimumSet_Gen.json
*/
async function organizationsCreateOrUpdateMin() {
async function organizationsCreateOrUpdateMin(): Promise<void> {
const subscriptionId =
process.env["INFORMATICA_SUBSCRIPTION_ID"] || "3599DA28-E346-4D9F-811E-189C0445F0FE";
const resourceGroupName = process.env["INFORMATICA_RESOURCE_GROUP"] || "rgopenapi";
Expand All @@ -101,7 +99,7 @@ async function organizationsCreateOrUpdateMin() {
console.log(result);
}

async function main() {
async function main(): Promise<void> {
await organizationsCreateOrUpdate();
await organizationsCreateOrUpdateMin();
}
Expand Down
Loading

0 comments on commit 9199d72

Please sign in to comment.