diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 420edc61fb2e..c38891d0a6c3 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -4887,7 +4887,7 @@ packages: dependencies: semver: 7.5.4 shelljs: 0.8.5 - typescript: 5.2.0-dev.20230725 + typescript: 5.2.0-dev.20230726 dev: false /duplexer3/0.1.5: @@ -10400,8 +10400,8 @@ packages: hasBin: true dev: false - /typescript/5.2.0-dev.20230725: - resolution: {integrity: sha512-ckVbPpSTdPA/Fxnrq1/mzO+LgzA64VPjm6YvV/axwZKgxviVHiUy0VvKS5EGBOpgFBwCNuN+ir24KIBGYWQCgQ==} + /typescript/5.2.0-dev.20230726: + resolution: {integrity: sha512-WXVjQVYHgcJwZh0r5TzBl42dzg6ap9VS0+8dm76/i0T/BhLnmC3CIBsLHZ5WQ3l1CqO/W5kSuywX94xVg98otA==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -12419,7 +12419,7 @@ packages: dev: false file:projects/arm-changes.tgz: - resolution: {integrity: sha512-GehZqDZ2RhV/MxQ0YnbyM0ZhK+d6t787jWET6S9zfVuYVsRyfC0AD8ISSRsXwBPb+RbObYx+1CTlE9KhJi7wbg==, tarball: file:projects/arm-changes.tgz} + resolution: {integrity: sha512-JgGTcW0AHMbPq8Yo6Lxk8+ncDW+UGVmhnoWXFLRGiAa2iV963LfieIByl59BKQOVIuB7bJwP3VhkQHDCPgIo8A==, tarball: file:projects/arm-changes.tgz} name: '@rush-temp/arm-changes' version: 0.0.0 dependencies: @@ -12433,7 +12433,8 @@ packages: '@types/node': 14.18.54 chai: 4.3.7 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.3.1 + mkdirp: 2.1.6 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 @@ -13974,7 +13975,7 @@ packages: dev: false file:projects/arm-features.tgz: - resolution: {integrity: sha512-wzYIQeNpQRjY0n/buj54ZFySiXwPOhGFSdDhYRfkTmv0tk+Ql+0JtSRnk6KpE5H2M88lndj8eL08K2Y7YASfDA==, tarball: file:projects/arm-features.tgz} + resolution: {integrity: sha512-oj7xl0ymgjBmw7XDlnn0zobmL4ChH1D8wKsPLHTObPCP2sZ0/hGzm3dkowRqCEf8MvHB4lMhvy+Il3jg2V96Kw==, tarball: file:projects/arm-features.tgz} name: '@rush-temp/arm-features' version: 0.0.0 dependencies: @@ -13988,7 +13989,8 @@ packages: '@types/node': 14.18.54 chai: 4.3.7 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.3.1 + mkdirp: 2.1.6 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 @@ -14583,7 +14585,7 @@ packages: dev: false file:projects/arm-links.tgz: - resolution: {integrity: sha512-SasnkMqF1QsK07NqeeYAlrYHhhGwkJlpG+YUd783pBa4pCs5dDTZ88EVvqbfAE5XwFeeowhNBnC55A1h1LR2hQ==, tarball: file:projects/arm-links.tgz} + resolution: {integrity: sha512-PXDiPU/KhpJmpDrKvkCl/REH8l4KVDDWomcrbL9IHFsG+jBcio4ZE0N4/IAvJ6Z6lVs8YVsPXNOoMdBmHfI3GQ==, tarball: file:projects/arm-links.tgz} name: '@rush-temp/arm-links' version: 0.0.0 dependencies: @@ -14597,7 +14599,8 @@ packages: '@types/node': 14.18.54 chai: 4.3.7 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.3.1 + mkdirp: 2.1.6 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 @@ -14666,7 +14669,7 @@ packages: dev: false file:projects/arm-locks.tgz: - resolution: {integrity: sha512-MPanNrEY5x4seG4Xsx1IdCPnqlJtQfqVkEOLOj5gIocAsH0PSwdHNms3MrseEeqHt7EeeRM9/G7vyqIFX7xTsA==, tarball: file:projects/arm-locks.tgz} + resolution: {integrity: sha512-9yesDBzIB6ZJvQd+rNLuDu12o0owKku3zuObxCK5Gj/mw/AZOlfYenCMvA64CaBjzuLskMDXBkfxMJd+Dg267g==, tarball: file:projects/arm-locks.tgz} name: '@rush-temp/arm-locks' version: 0.0.0 dependencies: @@ -14680,7 +14683,8 @@ packages: '@types/node': 14.18.54 chai: 4.3.7 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.3.1 + mkdirp: 2.1.6 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 @@ -14803,7 +14807,7 @@ packages: dev: false file:projects/arm-managedapplications.tgz: - resolution: {integrity: sha512-1Z2BnCUZjOKqEu31DKPmb+vBaSx2J9oUnvtzPleSm/FpUpa3oCgtWkNHwWG0BWI5A/j9RGbpkLAfFnLZwUQapQ==, tarball: file:projects/arm-managedapplications.tgz} + resolution: {integrity: sha512-Ij4f9pbNwCn6hFOVD74vO2WZv+xwMg5bV08a25Kez+DqcMbzdz72o9tDKBSb30zAzQaHUC0yH42VuGionYoBfA==, tarball: file:projects/arm-managedapplications.tgz} name: '@rush-temp/arm-managedapplications' version: 0.0.0 dependencies: @@ -14817,7 +14821,8 @@ packages: '@types/node': 14.18.54 chai: 4.3.7 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.3.1 + mkdirp: 2.1.6 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 @@ -15705,7 +15710,7 @@ packages: dev: false file:projects/arm-policy.tgz: - resolution: {integrity: sha512-bujYRtPnaCJrOaM96o1BN+dxqTmJGCCm/ZlHwohsY2oPVk0AqYiw68MefDKBYLD6mw7VZARX9AUqHoAHaFMz6w==, tarball: file:projects/arm-policy.tgz} + resolution: {integrity: sha512-YCMfyNqBZHvtU3To1+aA+1A1eSXS1Yii5fLmz/QAF232ECZyUCL8859zbRQvkRF0Z6VS0y0yn1jY1nEV+6K3Bw==, tarball: file:projects/arm-policy.tgz} name: '@rush-temp/arm-policy' version: 0.0.0 dependencies: @@ -16399,7 +16404,7 @@ packages: dev: false file:projects/arm-resources.tgz: - resolution: {integrity: sha512-Hui4Gr/1c3mwTD/+Me5Clhncbm6S3b84HUjrHKCVOOUJWdshuhbmOsCPQjVMsaubWUdK5eVA9FMGl0k99JtweA==, tarball: file:projects/arm-resources.tgz} + resolution: {integrity: sha512-jlPOAHhK4oQMYyOGV958G1jYr6JLX8aTXs67h2FwZMCpTn9N7HFG5UzaURK76mRvi2SAYKwU+JD3yAJhSTzrWQ==, tarball: file:projects/arm-resources.tgz} name: '@rush-temp/arm-resources' version: 0.0.0 dependencies: @@ -17271,7 +17276,7 @@ packages: dev: false file:projects/arm-templatespecs.tgz: - resolution: {integrity: sha512-xwRUA9TZWw550T5v+ks6MZ8w+5us52zlm6dqG4wIzFzheRNLN0ngnscXj8jeVrPFGlFsADRnEwAf7Aq2d2NNTA==, tarball: file:projects/arm-templatespecs.tgz} + resolution: {integrity: sha512-Je0sfftlbVUim0KwTtsR7kRkjaAb7+h/NLQviZyYO3gGciasEa8vrt0iQK2oLRvtoQekevJur6toX+X+FJBe3g==, tarball: file:projects/arm-templatespecs.tgz} name: '@rush-temp/arm-templatespecs' version: 0.0.0 dependencies: @@ -17285,7 +17290,8 @@ packages: '@types/node': 14.18.54 chai: 4.3.7 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.3.1 + mkdirp: 2.1.6 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 diff --git a/sdk/links/arm-links/CHANGELOG.md b/sdk/links/arm-links/CHANGELOG.md index 6f7b8b1743c1..1366a4b2cb16 100644 --- a/sdk/links/arm-links/CHANGELOG.md +++ b/sdk/links/arm-links/CHANGELOG.md @@ -1,15 +1,12 @@ # Release History - -## 2.0.2 (2022-11-22) - -**Features** - --  Exposes `getContinuationToken` helper function to extract continuation token - -**Bugs Fixed** -  -- A series of small bug fixs relevant to authentication and apiVersion policy - + +## 3.0.0 (2023-07-26) + +**Breaking Changes** + + - Class ManagementLinkClient has a new signature + - Interface ResourceLinksListAtSubscriptionNextOptionalParams no longer has parameter filter + ## 2.0.1 (2022-04-18) **features** diff --git a/sdk/links/arm-links/LICENSE b/sdk/links/arm-links/LICENSE index 5d1d36e0af80..3a1d9b6f24f7 100644 --- a/sdk/links/arm-links/LICENSE +++ b/sdk/links/arm-links/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2022 Microsoft +Copyright (c) 2023 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 diff --git a/sdk/links/arm-links/_meta.json b/sdk/links/arm-links/_meta.json index 4b98b8203a1f..010d5fc88f53 100644 --- a/sdk/links/arm-links/_meta.json +++ b/sdk/links/arm-links/_meta.json @@ -1,8 +1,8 @@ { - "commit": "a42f1b58607091c4f255ead152a8ef323fa0b280", - "readme": "specification\\resources\\resource-manager\\readme.md", - "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resources\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.3.20221108.1 --generate-sample=true", + "commit": "5fde98bcf518ad94e577bb2914189f95bb649eb7", + "readme": "specification/resources/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@^6.0.4", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.3.20221108.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.1", + "use": "@autorest/typescript@^6.0.4" } \ No newline at end of file diff --git a/sdk/links/arm-links/package.json b/sdk/links/arm-links/package.json index 8926ffde7bb2..7d329a153310 100644 --- a/sdk/links/arm-links/package.json +++ b/sdk/links/arm-links/package.json @@ -3,13 +3,13 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ManagementLinkClient.", - "version": "2.0.2", + "version": "3.0.0", "engines": { "node": ">=14.0.0" }, "dependencies": { "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.6.1", + "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" @@ -31,12 +31,13 @@ "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-multi-entry": "^6.0.0", "@rollup/plugin-node-resolve": "^13.1.3", - "mkdirp": "^1.0.4", + "mkdirp": "^2.1.2", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "~5.0.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", + "dotenv": "^16.0.0", "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", @@ -44,11 +45,9 @@ "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", - "@azure/arm-resources": "^5.0.0", "@types/node": "^14.0.0", "@azure/dev-tool": "^1.0.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/links/arm-links", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" @@ -109,5 +108,6 @@ } ] }, - "autoPublish": true -} + "autoPublish": true, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/links/arm-links" +} \ No newline at end of file diff --git a/sdk/links/arm-links/review/arm-links.api.md b/sdk/links/arm-links/review/arm-links.api.md index 0bbbaff74a79..a021f89e39ad 100644 --- a/sdk/links/arm-links/review/arm-links.api.md +++ b/sdk/links/arm-links/review/arm-links.api.md @@ -16,6 +16,7 @@ export class ManagementLinkClient extends coreClient.ServiceClient { // (undocumented) $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ManagementLinkClientOptionalParams); + constructor(credentials: coreAuth.TokenCredential, options?: ManagementLinkClientOptionalParams); // (undocumented) apiVersion: string; // (undocumented) @@ -23,7 +24,7 @@ export class ManagementLinkClient extends coreClient.ServiceClient { // (undocumented) resourceLinks: ResourceLinks; // (undocumented) - subscriptionId: string; + subscriptionId?: string; } // @public @@ -141,7 +142,6 @@ export type ResourceLinksListAtSourceScopeResponse = ResourceLinkResult; // @public export interface ResourceLinksListAtSubscriptionNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public diff --git a/sdk/links/arm-links/src/managementLinkClient.ts b/sdk/links/arm-links/src/managementLinkClient.ts index ba642926cc86..a60c55482145 100644 --- a/sdk/links/arm-links/src/managementLinkClient.ts +++ b/sdk/links/arm-links/src/managementLinkClient.ts @@ -21,7 +21,7 @@ import { ManagementLinkClientOptionalParams } from "./models"; export class ManagementLinkClient extends coreClient.ServiceClient { $host: string; apiVersion: string; - subscriptionId: string; + subscriptionId?: string; /** * Initializes a new instance of the ManagementLinkClient class. @@ -33,12 +33,26 @@ export class ManagementLinkClient extends coreClient.ServiceClient { credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ManagementLinkClientOptionalParams + ); + constructor( + credentials: coreAuth.TokenCredential, + options?: ManagementLinkClientOptionalParams + ); + constructor( + credentials: coreAuth.TokenCredential, + subscriptionIdOrOptions?: ManagementLinkClientOptionalParams | string, + options?: ManagementLinkClientOptionalParams ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); + + let subscriptionId: string | undefined; + + if (typeof subscriptionIdOrOptions === "string") { + subscriptionId = subscriptionIdOrOptions; + } else if (typeof subscriptionIdOrOptions === "object") { + options = subscriptionIdOrOptions; } // Initializing default values for options @@ -50,7 +64,7 @@ export class ManagementLinkClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-links/2.0.2`; + const packageDetails = `azsdk-js-arm-links/3.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` diff --git a/sdk/links/arm-links/src/models/index.ts b/sdk/links/arm-links/src/models/index.ts index 1a730f96d3e2..1788384b5787 100644 --- a/sdk/links/arm-links/src/models/index.ts +++ b/sdk/links/arm-links/src/models/index.ts @@ -138,10 +138,7 @@ export type ResourceLinksListAtSourceScopeResponse = ResourceLinkResult; /** Optional parameters. */ export interface ResourceLinksListAtSubscriptionNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the list resource links operation. The supported filter for list resource links is targetId. For example, $filter=targetId eq {value} */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listAtSubscriptionNext operation. */ export type ResourceLinksListAtSubscriptionNextResponse = ResourceLinkResult; diff --git a/sdk/links/arm-links/src/operations/operations.ts b/sdk/links/arm-links/src/operations/operations.ts index 26969f581fd6..d62cec21b1d3 100644 --- a/sdk/links/arm-links/src/operations/operations.ts +++ b/sdk/links/arm-links/src/operations/operations.ts @@ -137,7 +137,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.OperationListResult } }, - queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], serializer diff --git a/sdk/links/arm-links/src/operations/resourceLinks.ts b/sdk/links/arm-links/src/operations/resourceLinks.ts index 4585f8d526f0..8b639e997e81 100644 --- a/sdk/links/arm-links/src/operations/resourceLinks.ts +++ b/sdk/links/arm-links/src/operations/resourceLinks.ts @@ -355,7 +355,6 @@ const listAtSubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ResourceLinkResult } }, - queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.nextLink, @@ -372,7 +371,6 @@ const listAtSourceScopeNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ResourceLinkResult } }, - queryParameters: [Parameters.apiVersion, Parameters.filter1], urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.scope], headerParameters: [Parameters.accept], serializer diff --git a/sdk/links/arm-links/src/pagingHelper.ts b/sdk/links/arm-links/src/pagingHelper.ts index d85fc13bce1e..269a2b9814b5 100644 --- a/sdk/links/arm-links/src/pagingHelper.ts +++ b/sdk/links/arm-links/src/pagingHelper.ts @@ -13,11 +13,11 @@ export interface PageInfo { const pageMap = new WeakMap(); /** - * Given a result page from a pageable operation, returns a - * continuation token that can be used to begin paging from + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from * that point later. - * @param page A result object from calling .byPage() on a paged operation. - * @returns The continuation token that can be passed into byPage(). + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. */ export function getContinuationToken(page: unknown): string | undefined { if (typeof page !== "object" || page === null) { diff --git a/sdk/links/arm-links/test/sampleTest.ts b/sdk/links/arm-links/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/links/arm-links/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/links/arm-links/tsconfig.json b/sdk/links/arm-links/tsconfig.json index 433cb8777ded..24ca8ae4e47e 100644 --- a/sdk/links/arm-links/tsconfig.json +++ b/sdk/links/arm-links/tsconfig.json @@ -15,23 +15,15 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-links": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", "./test/**/*.ts", - "samples-dev/**/*.ts", "./test/**/*.ts", - "samples-dev/**/*.ts", "./test/**/*.ts", - "samples-dev/**/*.ts", "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"