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
786 changes: 394 additions & 392 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion sdk/devcenter/developer-devcenter-rest/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"rules": {
"@azure/azure-sdk/ts-modules-only-named": "warn",
"@azure/azure-sdk/ts-apiextractor-json-types": "warn",
"tsdoc/syntax": "warn"
"@azure/azure-sdk/ts-package-json-types": "warn",
"@azure/azure-sdk/ts-package-json-engine-is-present": "warn",
"tsdoc/syntax": "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"
}
}
26 changes: 3 additions & 23 deletions sdk/devcenter/developer-devcenter-rest/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
# Azure DevCenter REST client library for JavaScript


The Azure DevCenter library provides access to manage resources for Microsoft Dev Box and Azure Deployment Environments. This package enables managing developer machines and environments in Azure.

Use the package for Azure DevCenter to:
> Create, access, manage, and delete Dev Box resources
> Create, deploy, manage, and delete Environment resources

DevCenter service

**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**
Expand All @@ -27,9 +20,7 @@ Key links:
### Prerequisites

- You must have an [Azure subscription](https://azure.microsoft.com/free/) to use this package.
- You must have [configured](https://learn.microsoft.com/azure/dev-box/quickstart-configure-dev-box-service) a DevCenter, Project, Network Connection, Dev Box Definition, and Pool before you can create Dev Boxes
- You must have [configured](https://learn.microsoft.com/azure/deployment-environments/) a DevCenter, Project, Catalog, and Environment Type before you can create Environments


### Install the `@azure-rest/developer-devcenter` package

Install the Azure DevCenter REST client REST client library for JavaScript with `npm`:
Expand All @@ -50,19 +41,8 @@ After setup, you can choose which type of [credential](https://github.com/Azure/
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 value of dev center endpoint as environment variable:
DEVCENTER_ENDPOINT

## Key Concepts

### REST Client

This client is one of our REST clients. We highly recommend you read how to use a REST client [here](https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/rest-clients.md).

### DevCenter Concepts
Dev Boxes refer to managed developer machines running in Azure. Dev Boxes are provisioned in Pools, which define the network and image used for a Dev Box.

Environments refer to templated developer environments, which combine a template (Catalog Item) and parameters, as well as an Environment Type which defines permissions and where the resources are deployed.
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 Down
25 changes: 19 additions & 6 deletions sdk/devcenter/developer-devcenter-rest/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
{
"$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" },
"docModel": {
"enabled": true
},
"apiReport": {
"enabled": true,
"reportFolder": "./review"
},
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "./types/developer-devcenter.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"
}
}
}
}
}
27 changes: 12 additions & 15 deletions sdk/devcenter/developer-devcenter-rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
"@azure/core-rest-pipeline": "^1.5.0",
"@azure/logger": "^1.0.0",
"tslib": "^2.6.2",
"@azure/core-lro": "^2.5.4",
"@azure/abort-controller": "^1.0.0",
"@azure/core-lro": "3.0.0-beta.1",
"@azure/abort-controller": "^2.0.0",
"@azure/core-paging": "^1.5.0"
},
"devDependencies": {
Expand All @@ -75,9 +75,9 @@
"typescript": "~5.4.5",
"tshy": "^1.11.1",
"@azure/core-util": "^1.0.0",
"@azure-tools/test-credential": "^2.0.0",
"@azure-tools/test-credential": "^1.1.0",
"@azure/identity": "^4.0.1",
"@azure-tools/test-recorder": "^4.0.0",
"@azure-tools/test-recorder": "^3.0.0",
"@vitest/browser": "^1.3.1",
"@vitest/coverage-istanbul": "^1.3.1",
"playwright": "^1.41.2",
Expand All @@ -92,8 +92,8 @@
"lint": "eslint package.json api-extractor.json src test --ext .ts --ext .cts --ext .mts",
"lint:fix": "eslint package.json api-extractor.json src test --ext .ts --ext .cts --ext .mts --fix --fix-type [problem,suggestion]",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"unit-test:browser": "echo skipped",
"unit-test:node": "dev-tool run test:vitest -- -c vitest.config.ts",
"unit-test:browser": "npm run build:test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:node": "dev-tool run test:vitest --no-test-proxy",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:browser": "echo skipped",
"integration-test:node": "echo skipped",
Expand All @@ -114,30 +114,27 @@
"./package.json": "./package.json",
".": {
"browser": {
"source": "./src/index.ts",
"types": "./dist/browser/index.d.ts",
"default": "./dist/browser/index.js"
},
"react-native": {
"source": "./src/index.ts",
"types": "./dist/react-native/index.d.ts",
"default": "./dist/react-native/index.js"
},
"import": {
"source": "./src/index.ts",
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"source": "./src/index.ts",
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
}
},
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"//sampleConfiguration": {
"productName": "Azure DevCenter",
"productSlugs": [
"azure"
],
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure-rest/developer-devcenter"
}
}
"types": "./dist/commonjs/index.d.ts"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

```ts

import { AbortSignalLike } from '@azure/abort-controller';
import { CancelOnProgress } from '@azure/core-lro';
import { Client } from '@azure-rest/core-client';
import { ClientOptions } from '@azure-rest/core-client';
import { CreateHttpPollerOptions } from '@azure/core-lro';
Expand All @@ -16,7 +18,6 @@ import { PagedAsyncIterableIterator } from '@azure/core-paging';
import { PathUncheckedResponse } from '@azure-rest/core-client';
import { RawHttpHeaders } from '@azure/core-rest-pipeline';
import { RequestParameters } from '@azure-rest/core-client';
import { SimplePollerLike } from '@azure/core-lro';
import { StreamableMethod } from '@azure-rest/core-client';
import { TokenCredential } from '@azure/core-auth';

Expand Down Expand Up @@ -439,7 +440,7 @@ export type EnvironmentTypeEnableStatusOutput = "Enabled" | "Disabled" | string;
// @public
export interface EnvironmentTypeOutput {
deploymentTargetId: string;
name: string;
readonly name: string;
status: EnvironmentTypeEnableStatusOutput;
}

Expand Down Expand Up @@ -1534,6 +1535,27 @@ export interface ScheduleOutput {
type: ScheduledTypeOutput;
}

// @public
export interface SimplePollerLike<TState extends OperationState<TResult>, TResult> {
getOperationState(): TState;
getResult(): TResult | undefined;
isDone(): boolean;
isStopped(): boolean;
onProgress(callback: (state: TState) => void): CancelOnProgress;
poll(options?: {
abortSignal?: AbortSignalLike;
}): Promise<TState>;
pollUntilDone(pollOptions?: {
abortSignal?: AbortSignalLike;
}): Promise<TResult>;
serialize(): Promise<string>;
// @deprecated
stopPolling(): void;
submitted(): Promise<void>;
// @deprecated
toString(): string;
}

// @public (undocumented)
export interface SkipAction {
post(options?: SkipActionParameters): StreamableMethod<SkipAction204Response | SkipActionDefaultResponse>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,17 @@ export default function createClient(
logger: options.loggingOptions?.logger ?? logger.info,
},
credentials: {
scopes: options.credentials?.scopes ?? ["https://devcenter.azure.com/.default"],
scopes: options.credentials?.scopes ?? [
"https://devcenter.azure.com/.default",
],
},
};

const client = getClient(endpointUrl, credentials, options) as AzureDeveloperDevCenterClient;
const client = getClient(
endpointUrl,
credentials,
options,
) as AzureDeveloperDevCenterClient;

return client;
}
Loading