From 1422c9522fc7c851794fc6ab1557ed7e55652510 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 19 Oct 2022 08:14:53 +0000 Subject: [PATCH] CodeGen from PR 20272 in Azure/azure-rest-api-specs Add 2022-08-01-preview version to Microsoft.SignalRService/SignalR (#20272) * Adds base for updating Microsoft.SignalRService from version stable/2022-02-01 to version 2022-08-01-preview * Update readme.md * Update swagger and examples * Updates * revert adding 200 response code to put custom domain --- common/config/rush/pnpm-lock.yaml | 13 +- sdk/signalr/arm-signalr/CHANGELOG.md | 26 ++-- sdk/signalr/arm-signalr/README.md | 2 +- sdk/signalr/arm-signalr/_meta.json | 8 +- sdk/signalr/arm-signalr/package.json | 33 ++--- .../arm-signalr/review/arm-signalr.api.md | 140 ++++++------------ sdk/signalr/arm-signalr/src/models/index.ts | 107 ++++++++++--- sdk/signalr/arm-signalr/src/models/mappers.ts | 27 ++++ .../arm-signalr/src/models/parameters.ts | 2 +- .../arm-signalr/src/operations/signalR.ts | 3 +- .../src/operations/signalRCustomDomains.ts | 3 +- .../signalRPrivateEndpointConnections.ts | 3 +- .../signalRSharedPrivateLinkResources.ts | 3 +- .../src/signalRManagementClient.ts | 69 ++++++++- sdk/signalr/arm-signalr/test/sampleTest.ts | 42 +++--- sdk/signalr/arm-signalr/tsconfig.json | 10 +- 16 files changed, 301 insertions(+), 190 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index daa3149f174e..d5def995e762 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -3965,7 +3965,7 @@ packages: dependencies: semver: 7.3.7 shelljs: 0.8.5 - typescript: 4.9.0-dev.20221018 + typescript: 4.9.0-dev.20221019 dev: false /downlevel-dts/0.8.0: @@ -8962,8 +8962,8 @@ packages: hasBin: true dev: false - /typescript/4.9.0-dev.20221018: - resolution: {integrity: sha512-jHigCAzVp9JXy+t9J854z8ooZTtc1luK25iKKFF48w/AfRfTbypn8HkOGWDmb7x7RuAcZxo1zYcYDk4OaUFKjw==} + /typescript/4.9.0-dev.20221019: + resolution: {integrity: sha512-FgRBDKHZQAbayBvRcfFpjtmztLCobGom2k5W5nFqCXDb/XKYn0oG/8s6O9le3lGIt3+1FC7FYMmqvR5qRW50AA==} engines: {node: '>=4.2.0'} hasBin: true dev: false @@ -14734,7 +14734,7 @@ packages: dev: false file:projects/arm-signalr.tgz: - resolution: {integrity: sha512-+R4rYmIABTVnyra21b6JF5WA5/9DpXLbvVcut5bJ0cRUfjzeT17xHkaZdoAJGLgbG0xuQPGS5TCyMdHbTC3a8Q==, tarball: file:projects/arm-signalr.tgz} + resolution: {integrity: sha512-7cQwjrcrp87dKB3t5lMC4imoeUJWpv5GIx+4hWQiRzBpCKfUhSafDVkM/teljryv6nVuBk1yf2uV3yCyu8F1/A==, tarball: file:projects/arm-signalr.tgz} name: '@rush-temp/arm-signalr' version: 0.0.0 dependencies: @@ -14745,6 +14745,8 @@ packages: '@rollup/plugin-json': 4.1.0_rollup@2.79.1 '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 + '@types/chai': 4.3.3 + chai: 4.3.6 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 @@ -14752,11 +14754,10 @@ packages: rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1 tslib: 2.4.0 - typescript: 4.2.4 + typescript: 4.6.4 uglify-js: 3.17.2 transitivePeerDependencies: - '@types/node' - - encoding - supports-color dev: false diff --git a/sdk/signalr/arm-signalr/CHANGELOG.md b/sdk/signalr/arm-signalr/CHANGELOG.md index 33e853ba9ea2..d2c89d743c2c 100644 --- a/sdk/signalr/arm-signalr/CHANGELOG.md +++ b/sdk/signalr/arm-signalr/CHANGELOG.md @@ -1,15 +1,21 @@ # Release History + +## 5.2.0-beta.1 (2022-10-19) + +**Features** -## 5.1.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added Interface CustomCertificate + - Added Interface CustomDomain + - Added Interface PrivateEndpointACL + - Added Interface PrivateEndpointConnection + - Added Interface PrivateLinkResource + - Added Interface ProxyResource + - Added Interface ServerlessSettings + - Added Interface SharedPrivateLinkResource + - Added Interface SignalRResource + - Added Interface TrackedResource + + ## 5.1.0 (2022-03-30) **Features** diff --git a/sdk/signalr/arm-signalr/README.md b/sdk/signalr/arm-signalr/README.md index 3cbed3414f59..c10db9f5949f 100644 --- a/sdk/signalr/arm-signalr/README.md +++ b/sdk/signalr/arm-signalr/README.md @@ -6,7 +6,7 @@ REST API for Azure SignalR Service [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/signalr/arm-signalr) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-signalr) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-signalr) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-signalr?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/signalr/arm-signalr/_meta.json b/sdk/signalr/arm-signalr/_meta.json index eecc06409fb6..c6afa3082f88 100644 --- a/sdk/signalr/arm-signalr/_meta.json +++ b/sdk/signalr/arm-signalr/_meta.json @@ -1,8 +1,8 @@ { - "commit": "3c1da29166fe1306071c939ac1344b092bafd0ce", + "commit": "9366804c62e024801daf8a578924099ff644ccf6", "readme": "specification/signalr/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\signalr\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.18.20220329.1 --generate-sample=true", + "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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/signalr/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.2", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.2.1", - "use": "@autorest/typescript@6.0.0-alpha.18.20220329.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.4", + "use": "@autorest/typescript@6.0.0-rc.2" } \ No newline at end of file diff --git a/sdk/signalr/arm-signalr/package.json b/sdk/signalr/arm-signalr/package.json index 0d82b14055b8..57cd3e135eee 100644 --- a/sdk/signalr/arm-signalr/package.json +++ b/sdk/signalr/arm-signalr/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for SignalRManagementClient.", - "version": "5.1.1", + "version": "5.2.0-beta.1", "engines": { "node": ">=14.0.0" }, @@ -11,9 +11,9 @@ "@azure/core-lro": "^2.2.0", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.0.0", + "@azure/core-client": "^1.5.0", "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.1.0", + "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" }, "keywords": [ @@ -36,13 +36,17 @@ "mkdirp": "^1.0.4", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", - "typescript": "~4.2.0", + "typescript": "~4.6.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", - "@azure-tools/test-recorder": "^1.0.0", + "@azure-tools/test-recorder": "^2.0.0", + "@azure-tools/test-credential": "^1.0.0", "mocha": "^7.1.1", - "cross-env": "^7.0.2" + "@types/chai": "^4.2.8", + "chai": "^4.2.0", + "cross-env": "^7.0.2", + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/signalr/arm-signalr", "repository": { @@ -93,9 +97,8 @@ "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", "unit-test:browser": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", - "integration-test:browser": "echo skipped", - "docs": "echo skipped" + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped" }, "sideEffects": false, "//metadata": { @@ -106,13 +109,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-signalr?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/signalr/arm-signalr/review/arm-signalr.api.md b/sdk/signalr/arm-signalr/review/arm-signalr.api.md index 2ddc9bac6cdd..bebe18e35559 100644 --- a/sdk/signalr/arm-signalr/review/arm-signalr.api.md +++ b/sdk/signalr/arm-signalr/review/arm-signalr.api.md @@ -17,13 +17,13 @@ export type ACLAction = string; export type CreatedByType = string; // @public -export type CustomCertificate = ProxyResource & { - readonly systemData?: SystemData; - readonly provisioningState?: ProvisioningState; +export interface CustomCertificate extends ProxyResource { keyVaultBaseUri: string; keyVaultSecretName: string; keyVaultSecretVersion?: string; -}; + readonly provisioningState?: ProvisioningState; + readonly systemData?: SystemData; +} // @public export interface CustomCertificateList { @@ -32,12 +32,12 @@ export interface CustomCertificateList { } // @public -export type CustomDomain = ProxyResource & { - readonly systemData?: SystemData; - readonly provisioningState?: ProvisioningState; - domainName: string; +export interface CustomDomain extends ProxyResource { customCertificate: ResourceReference; -}; + domainName: string; + readonly provisioningState?: ProvisioningState; + readonly systemData?: SystemData; +} // @public export interface CustomDomainList { @@ -82,151 +82,102 @@ export { KeyType_2 as KeyType } // @public export enum KnownACLAction { - // (undocumented) Allow = "Allow", - // (undocumented) Deny = "Deny" } // @public export enum KnownCreatedByType { - // (undocumented) Application = "Application", - // (undocumented) Key = "Key", - // (undocumented) ManagedIdentity = "ManagedIdentity", - // (undocumented) User = "User" } // @public export enum KnownFeatureFlags { - // (undocumented) EnableConnectivityLogs = "EnableConnectivityLogs", - // (undocumented) EnableLiveTrace = "EnableLiveTrace", - // (undocumented) EnableMessagingLogs = "EnableMessagingLogs", - // (undocumented) ServiceMode = "ServiceMode" } // @public export enum KnownKeyType { - // (undocumented) Primary = "Primary", - // (undocumented) Salt = "Salt", - // (undocumented) Secondary = "Secondary" } // @public export enum KnownManagedIdentityType { - // (undocumented) None = "None", - // (undocumented) SystemAssigned = "SystemAssigned", - // (undocumented) UserAssigned = "UserAssigned" } // @public export enum KnownPrivateLinkServiceConnectionStatus { - // (undocumented) Approved = "Approved", - // (undocumented) Disconnected = "Disconnected", - // (undocumented) Pending = "Pending", - // (undocumented) Rejected = "Rejected" } // @public export enum KnownProvisioningState { - // (undocumented) Canceled = "Canceled", - // (undocumented) Creating = "Creating", - // (undocumented) Deleting = "Deleting", - // (undocumented) Failed = "Failed", - // (undocumented) Moving = "Moving", - // (undocumented) Running = "Running", - // (undocumented) Succeeded = "Succeeded", - // (undocumented) Unknown = "Unknown", - // (undocumented) Updating = "Updating" } // @public export enum KnownScaleType { - // (undocumented) Automatic = "Automatic", - // (undocumented) Manual = "Manual", - // (undocumented) None = "None" } // @public export enum KnownServiceKind { - // (undocumented) RawWebSockets = "RawWebSockets", - // (undocumented) SignalR = "SignalR" } // @public export enum KnownSharedPrivateLinkResourceStatus { - // (undocumented) Approved = "Approved", - // (undocumented) Disconnected = "Disconnected", - // (undocumented) Pending = "Pending", - // (undocumented) Rejected = "Rejected", - // (undocumented) Timeout = "Timeout" } // @public export enum KnownSignalRRequestType { - // (undocumented) ClientConnection = "ClientConnection", - // (undocumented) Restapi = "RESTAPI", - // (undocumented) ServerConnection = "ServerConnection", - // (undocumented) Trace = "Trace" } // @public export enum KnownSignalRSkuTier { - // (undocumented) Basic = "Basic", - // (undocumented) Free = "Free", - // (undocumented) Premium = "Premium", - // (undocumented) Standard = "Standard" } // @public export enum KnownUpstreamAuthType { - // (undocumented) ManagedIdentity = "ManagedIdentity", - // (undocumented) None = "None" } @@ -350,18 +301,18 @@ export interface PrivateEndpoint { } // @public -export type PrivateEndpointACL = NetworkACL & { +export interface PrivateEndpointACL extends NetworkACL { name: string; -}; +} // @public -export type PrivateEndpointConnection = ProxyResource & { - readonly systemData?: SystemData; - readonly provisioningState?: ProvisioningState; - privateEndpoint?: PrivateEndpoint; +export interface PrivateEndpointConnection extends ProxyResource { readonly groupIds?: string[]; + privateEndpoint?: PrivateEndpoint; privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; -}; + readonly provisioningState?: ProvisioningState; + readonly systemData?: SystemData; +} // @public export interface PrivateEndpointConnectionList { @@ -370,12 +321,12 @@ export interface PrivateEndpointConnectionList { } // @public -export type PrivateLinkResource = ProxyResource & { +export interface PrivateLinkResource extends ProxyResource { groupId?: string; requiredMembers?: string[]; requiredZoneNames?: string[]; shareablePrivateLinkResourceTypes?: ShareablePrivateLinkResourceType[]; -}; +} // @public export interface PrivateLinkResourceList { @@ -397,7 +348,8 @@ export type PrivateLinkServiceConnectionStatus = string; export type ProvisioningState = string; // @public -export type ProxyResource = Resource & {}; +export interface ProxyResource extends Resource { +} // @public export interface RegenerateKeyParameters { @@ -439,6 +391,11 @@ export interface ResourceSku { // @public export type ScaleType = string; +// @public +export interface ServerlessSettings { + connectionTimeoutInSeconds?: number; +} + // @public export interface ServerlessUpstreamSettings { templates?: UpstreamTemplate[]; @@ -467,14 +424,14 @@ export interface ShareablePrivateLinkResourceType { } // @public -export type SharedPrivateLinkResource = ProxyResource & { - readonly systemData?: SystemData; +export interface SharedPrivateLinkResource extends ProxyResource { groupId?: string; privateLinkResourceId?: string; readonly provisioningState?: ProvisioningState; requestMessage?: string; readonly status?: SharedPrivateLinkResourceStatus; -}; + readonly systemData?: SystemData; +} // @public export interface SharedPrivateLinkResourceList { @@ -803,31 +760,32 @@ export type SignalRRegenerateKeyResponse = SignalRKeys; export type SignalRRequestType = string; // @public -export type SignalRResource = TrackedResource & { - sku?: ResourceSku; - kind?: ServiceKind; - identity?: ManagedIdentity; - readonly systemData?: SystemData; - readonly provisioningState?: ProvisioningState; +export interface SignalRResource extends TrackedResource { + cors?: SignalRCorsSettings; + disableAadAuth?: boolean; + disableLocalAuth?: boolean; readonly externalIP?: string; + features?: SignalRFeature[]; readonly hostName?: string; + readonly hostNamePrefix?: string; + identity?: ManagedIdentity; + kind?: ServiceKind; + liveTraceConfiguration?: LiveTraceConfiguration; + networkACLs?: SignalRNetworkACLs; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + readonly provisioningState?: ProvisioningState; + publicNetworkAccess?: string; readonly publicPort?: number; + resourceLogConfiguration?: ResourceLogConfiguration; + serverless?: ServerlessSettings; readonly serverPort?: number; - readonly version?: string; - readonly privateEndpointConnections?: PrivateEndpointConnection[]; readonly sharedPrivateLinkResources?: SharedPrivateLinkResource[]; + sku?: ResourceSku; + readonly systemData?: SystemData; tls?: SignalRTlsSettings; - readonly hostNamePrefix?: string; - features?: SignalRFeature[]; - liveTraceConfiguration?: LiveTraceConfiguration; - resourceLogConfiguration?: ResourceLogConfiguration; - cors?: SignalRCorsSettings; upstream?: ServerlessUpstreamSettings; - networkACLs?: SignalRNetworkACLs; - publicNetworkAccess?: string; - disableLocalAuth?: boolean; - disableAadAuth?: boolean; -}; + readonly version?: string; +} // @public export interface SignalRResourceList { @@ -958,12 +916,12 @@ export interface SystemData { } // @public -export type TrackedResource = Resource & { +export interface TrackedResource extends Resource { location?: string; tags?: { [propertyName: string]: string; }; -}; +} // @public export interface UpstreamAuthSettings { diff --git a/sdk/signalr/arm-signalr/src/models/index.ts b/sdk/signalr/arm-signalr/src/models/index.ts index ddac0b10076b..d6dba3818517 100644 --- a/sdk/signalr/arm-signalr/src/models/index.ts +++ b/sdk/signalr/arm-signalr/src/models/index.ts @@ -219,7 +219,7 @@ export interface ResourceSku { /** * The name of the SKU. Required. * - * Allowed values: Standard_S1, Free_F1 + * Allowed values: Standard_S1, Free_F1, Premium_P1 */ name: string; /** @@ -242,8 +242,9 @@ export interface ResourceSku { * Optional, integer. The unit count of the resource. 1 by default. * * If present, following values are allowed: - * Free: 1 - * Standard: 1,2,5,10,20,50,100 + * Free: 1; + * Standard: 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100; + * Premium: 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100; */ capacity?: number; } @@ -379,6 +380,21 @@ export interface SignalRCorsSettings { allowedOrigins?: string[]; } +/** Serverless settings. */ +export interface ServerlessSettings { + /** + * Gets or sets Client Connection Timeout. Optional to be set. + * Value in seconds. + * Default value is 30 seconds. + * Customer should set the timeout to a shorter period if messages are expected to be sent in shorter intervals, + * and want the client to disconnect more quickly after the last message is sent. + * You can set the timeout to a longer period if messages are expected to be sent in longer intervals, + * and they want to keep the same client connection alive during this session. + * The service considers the client disconnected if it hasn't received a message (including keep-alive) in this interval. + */ + connectionTimeoutInSeconds?: number; +} + /** The settings for the Upstream when the service is in server-less mode. */ export interface ServerlessUpstreamSettings { /** Gets or sets the list of Upstream URL templates. Order matters, and the first matching template takes effects. */ @@ -649,24 +665,24 @@ export interface SkuCapacity { } /** The resource model definition for a ARM proxy resource. It will have everything other than required location and tags */ -export type ProxyResource = Resource & {}; +export interface ProxyResource extends Resource {} /** The resource model definition for a ARM tracked top level resource. */ -export type TrackedResource = Resource & { +export interface TrackedResource extends Resource { /** The GEO location of the resource. e.g. West US | East US | North Central US | South Central US. */ location?: string; /** Tags of the service which is a list of key value pairs that describe the resource. */ tags?: { [propertyName: string]: string }; -}; +} /** ACL for a private endpoint */ -export type PrivateEndpointACL = NetworkACL & { +export interface PrivateEndpointACL extends NetworkACL { /** Name of the private endpoint connection */ name: string; -}; +} /** A private endpoint connection to an azure resource */ -export type PrivateEndpointConnection = ProxyResource & { +export interface PrivateEndpointConnection extends ProxyResource { /** * Metadata pertaining to creation and last modification of the resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -686,10 +702,10 @@ export type PrivateEndpointConnection = ProxyResource & { readonly groupIds?: string[]; /** Connection state of the private endpoint connection */ privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; -}; +} /** Describes a Shared Private Link Resource */ -export type SharedPrivateLinkResource = ProxyResource & { +export interface SharedPrivateLinkResource extends ProxyResource { /** * Metadata pertaining to creation and last modification of the resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -711,10 +727,10 @@ export type SharedPrivateLinkResource = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly status?: SharedPrivateLinkResourceStatus; -}; +} /** A custom certificate. */ -export type CustomCertificate = ProxyResource & { +export interface CustomCertificate extends ProxyResource { /** * Metadata pertaining to creation and last modification of the resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -731,10 +747,10 @@ export type CustomCertificate = ProxyResource & { keyVaultSecretName: string; /** Certificate secret version. */ keyVaultSecretVersion?: string; -}; +} /** A custom domain */ -export type CustomDomain = ProxyResource & { +export interface CustomDomain extends ProxyResource { /** * Metadata pertaining to creation and last modification of the resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -749,10 +765,10 @@ export type CustomDomain = ProxyResource & { domainName: string; /** Reference to a resource. */ customCertificate: ResourceReference; -}; +} /** Private link resource */ -export type PrivateLinkResource = ProxyResource & { +export interface PrivateLinkResource extends ProxyResource { /** Group Id of the private link resource */ groupId?: string; /** Required members of the private link resource */ @@ -761,10 +777,10 @@ export type PrivateLinkResource = ProxyResource & { requiredZoneNames?: string[]; /** The list of resources that are onboarded to private link service */ shareablePrivateLinkResourceTypes?: ShareablePrivateLinkResourceType[]; -}; +} /** A class represent a resource. */ -export type SignalRResource = TrackedResource & { +export interface SignalRResource extends TrackedResource { /** The billing information of the resource. */ sku?: ResourceSku; /** The kind of the service, it can be SignalR or RawWebSockets */ @@ -838,6 +854,8 @@ export type SignalRResource = TrackedResource & { resourceLogConfiguration?: ResourceLogConfiguration; /** Cross-Origin Resource Sharing (CORS) settings. */ cors?: SignalRCorsSettings; + /** Serverless settings. */ + serverless?: ServerlessSettings; /** The settings for the Upstream when the service is in server-less mode. */ upstream?: ServerlessUpstreamSettings; /** Network ACLs for the resource */ @@ -860,13 +878,17 @@ export type SignalRResource = TrackedResource & { * When set as true, connection with AuthType=aad won't work. */ disableAadAuth?: boolean; -}; +} /** Known values of {@link SignalRSkuTier} that the service accepts. */ export enum KnownSignalRSkuTier { + /** Free */ Free = "Free", + /** Basic */ Basic = "Basic", + /** Standard */ Standard = "Standard", + /** Premium */ Premium = "Premium" } @@ -884,14 +906,23 @@ export type SignalRSkuTier = string; /** Known values of {@link ProvisioningState} that the service accepts. */ export enum KnownProvisioningState { + /** Unknown */ Unknown = "Unknown", + /** Succeeded */ Succeeded = "Succeeded", + /** Failed */ Failed = "Failed", + /** Canceled */ Canceled = "Canceled", + /** Running */ Running = "Running", + /** Creating */ Creating = "Creating", + /** Updating */ Updating = "Updating", + /** Deleting */ Deleting = "Deleting", + /** Moving */ Moving = "Moving" } @@ -914,9 +945,13 @@ export type ProvisioningState = string; /** Known values of {@link CreatedByType} that the service accepts. */ export enum KnownCreatedByType { + /** User */ User = "User", + /** Application */ Application = "Application", + /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", + /** Key */ Key = "Key" } @@ -934,9 +969,13 @@ export type CreatedByType = string; /** Known values of {@link PrivateLinkServiceConnectionStatus} that the service accepts. */ export enum KnownPrivateLinkServiceConnectionStatus { + /** Pending */ Pending = "Pending", + /** Approved */ Approved = "Approved", + /** Rejected */ Rejected = "Rejected", + /** Disconnected */ Disconnected = "Disconnected" } @@ -954,10 +993,15 @@ export type PrivateLinkServiceConnectionStatus = string; /** Known values of {@link SharedPrivateLinkResourceStatus} that the service accepts. */ export enum KnownSharedPrivateLinkResourceStatus { + /** Pending */ Pending = "Pending", + /** Approved */ Approved = "Approved", + /** Rejected */ Rejected = "Rejected", + /** Disconnected */ Disconnected = "Disconnected", + /** Timeout */ Timeout = "Timeout" } @@ -976,9 +1020,13 @@ export type SharedPrivateLinkResourceStatus = string; /** Known values of {@link FeatureFlags} that the service accepts. */ export enum KnownFeatureFlags { + /** ServiceMode */ ServiceMode = "ServiceMode", + /** EnableConnectivityLogs */ EnableConnectivityLogs = "EnableConnectivityLogs", + /** EnableMessagingLogs */ EnableMessagingLogs = "EnableMessagingLogs", + /** EnableLiveTrace */ EnableLiveTrace = "EnableLiveTrace" } @@ -996,7 +1044,9 @@ export type FeatureFlags = string; /** Known values of {@link UpstreamAuthType} that the service accepts. */ export enum KnownUpstreamAuthType { + /** None */ None = "None", + /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity" } @@ -1012,7 +1062,9 @@ export type UpstreamAuthType = string; /** Known values of {@link ACLAction} that the service accepts. */ export enum KnownACLAction { + /** Allow */ Allow = "Allow", + /** Deny */ Deny = "Deny" } @@ -1028,9 +1080,13 @@ export type ACLAction = string; /** Known values of {@link SignalRRequestType} that the service accepts. */ export enum KnownSignalRRequestType { + /** ClientConnection */ ClientConnection = "ClientConnection", + /** ServerConnection */ ServerConnection = "ServerConnection", + /** Restapi */ Restapi = "RESTAPI", + /** Trace */ Trace = "Trace" } @@ -1048,7 +1104,9 @@ export type SignalRRequestType = string; /** Known values of {@link ServiceKind} that the service accepts. */ export enum KnownServiceKind { + /** SignalR */ SignalR = "SignalR", + /** RawWebSockets */ RawWebSockets = "RawWebSockets" } @@ -1064,8 +1122,11 @@ export type ServiceKind = string; /** Known values of {@link ManagedIdentityType} that the service accepts. */ export enum KnownManagedIdentityType { + /** None */ None = "None", + /** SystemAssigned */ SystemAssigned = "SystemAssigned", + /** UserAssigned */ UserAssigned = "UserAssigned" } @@ -1082,8 +1143,11 @@ export type ManagedIdentityType = string; /** Known values of {@link KeyType} that the service accepts. */ export enum KnownKeyType { + /** Primary */ Primary = "Primary", + /** Secondary */ Secondary = "Secondary", + /** Salt */ Salt = "Salt" } @@ -1100,8 +1164,11 @@ export type KeyType = string; /** Known values of {@link ScaleType} that the service accepts. */ export enum KnownScaleType { + /** None */ None = "None", + /** Manual */ Manual = "Manual", + /** Automatic */ Automatic = "Automatic" } diff --git a/sdk/signalr/arm-signalr/src/models/mappers.ts b/sdk/signalr/arm-signalr/src/models/mappers.ts index da39a1dd3ef7..c9e43fdd19a0 100644 --- a/sdk/signalr/arm-signalr/src/models/mappers.ts +++ b/sdk/signalr/arm-signalr/src/models/mappers.ts @@ -856,6 +856,26 @@ export const SignalRCorsSettings: coreClient.CompositeMapper = { } }; +export const ServerlessSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServerlessSettings", + modelProperties: { + connectionTimeoutInSeconds: { + defaultValue: 30, + constraints: { + InclusiveMaximum: 120, + InclusiveMinimum: 1 + }, + serializedName: "connectionTimeoutInSeconds", + type: { + name: "Number" + } + } + } + } +}; + export const ServerlessUpstreamSettings: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1868,6 +1888,13 @@ export const SignalRResource: coreClient.CompositeMapper = { className: "SignalRCorsSettings" } }, + serverless: { + serializedName: "properties.serverless", + type: { + name: "Composite", + className: "ServerlessSettings" + } + }, upstream: { serializedName: "properties.upstream", type: { diff --git a/sdk/signalr/arm-signalr/src/models/parameters.ts b/sdk/signalr/arm-signalr/src/models/parameters.ts index b47908b84d44..71e307959ffe 100644 --- a/sdk/signalr/arm-signalr/src/models/parameters.ts +++ b/sdk/signalr/arm-signalr/src/models/parameters.ts @@ -48,7 +48,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-02-01", + defaultValue: "2022-08-01-preview", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/signalr/arm-signalr/src/operations/signalR.ts b/sdk/signalr/arm-signalr/src/operations/signalR.ts index 1bc8be0677ad..aa3d2272d8d5 100644 --- a/sdk/signalr/arm-signalr/src/operations/signalR.ts +++ b/sdk/signalr/arm-signalr/src/operations/signalR.ts @@ -369,7 +369,8 @@ export class SignalRImpl implements SignalR { ); const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" }); await poller.poll(); return poller; diff --git a/sdk/signalr/arm-signalr/src/operations/signalRCustomDomains.ts b/sdk/signalr/arm-signalr/src/operations/signalRCustomDomains.ts index 2d51ebc39d04..693fb2d69931 100644 --- a/sdk/signalr/arm-signalr/src/operations/signalRCustomDomains.ts +++ b/sdk/signalr/arm-signalr/src/operations/signalRCustomDomains.ts @@ -297,7 +297,8 @@ export class SignalRCustomDomainsImpl implements SignalRCustomDomains { ); const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" }); await poller.poll(); return poller; diff --git a/sdk/signalr/arm-signalr/src/operations/signalRPrivateEndpointConnections.ts b/sdk/signalr/arm-signalr/src/operations/signalRPrivateEndpointConnections.ts index fcf6a63e457d..e402011ba56b 100644 --- a/sdk/signalr/arm-signalr/src/operations/signalRPrivateEndpointConnections.ts +++ b/sdk/signalr/arm-signalr/src/operations/signalRPrivateEndpointConnections.ts @@ -237,7 +237,8 @@ export class SignalRPrivateEndpointConnectionsImpl ); const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" }); await poller.poll(); return poller; diff --git a/sdk/signalr/arm-signalr/src/operations/signalRSharedPrivateLinkResources.ts b/sdk/signalr/arm-signalr/src/operations/signalRSharedPrivateLinkResources.ts index 86a5afbc76d8..1d6af8314f43 100644 --- a/sdk/signalr/arm-signalr/src/operations/signalRSharedPrivateLinkResources.ts +++ b/sdk/signalr/arm-signalr/src/operations/signalRSharedPrivateLinkResources.ts @@ -316,7 +316,8 @@ export class SignalRSharedPrivateLinkResourcesImpl ); const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" }); await poller.poll(); return poller; diff --git a/sdk/signalr/arm-signalr/src/signalRManagementClient.ts b/sdk/signalr/arm-signalr/src/signalRManagementClient.ts index 415c2ce670ea..0d3fa81d8b3a 100644 --- a/sdk/signalr/arm-signalr/src/signalRManagementClient.ts +++ b/sdk/signalr/arm-signalr/src/signalRManagementClient.ts @@ -7,6 +7,12 @@ */ import * as coreClient from "@azure/core-client"; +import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest +} from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { OperationsImpl, @@ -63,7 +69,7 @@ export class SignalRManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-signalr/5.1.1`; + const packageDetails = `azsdk-js-arm-signalr/5.2.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -82,12 +88,42 @@ export class SignalRManagementClient extends coreClient.ServiceClient { options.endpoint ?? options.baseUri ?? "https://management.azure.com" }; super(optionsWithDefaults); + + let bearerTokenAuthenticationPolicyFound: boolean = false; + if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + (pipelinePolicy) => + pipelinePolicy.name === + coreRestPipeline.bearerTokenAuthenticationPolicyName + ); + } + if ( + !options || + !options.pipeline || + options.pipeline.getOrderedPolicies().length == 0 || + !bearerTokenAuthenticationPolicyFound + ) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + credential: credentials, + scopes: `${optionsWithDefaults.credentialScopes}`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge + } + }) + ); + } // Parameter assignments this.subscriptionId = subscriptionId; // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-02-01"; + this.apiVersion = options.apiVersion || "2022-08-01-preview"; this.operations = new OperationsImpl(this); this.signalR = new SignalRImpl(this); this.usages = new UsagesImpl(this); @@ -102,6 +138,35 @@ export class SignalRManagementClient extends coreClient.ServiceClient { this.signalRSharedPrivateLinkResources = new SignalRSharedPrivateLinkResourcesImpl( this ); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return "api-version=" + apiVersion; + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + } + }; + this.pipeline.addPolicy(apiVersionPolicy); } operations: Operations; diff --git a/sdk/signalr/arm-signalr/test/sampleTest.ts b/sdk/signalr/arm-signalr/test/sampleTest.ts index e0877dd55c3c..25aeb3ebcc36 100644 --- a/sdk/signalr/arm-signalr/test/sampleTest.ts +++ b/sdk/signalr/arm-signalr/test/sampleTest.ts @@ -7,43 +7,37 @@ */ import { - env, - record, - RecorderEnvironmentSetup, - Recorder + Recorder, + RecorderStartOptions, + env } from "@azure-tools/test-recorder"; -import * as assert from "assert"; +import { assert } from "chai"; +import { Context } from "mocha"; -const recorderEnvSetup: RecorderEnvironmentSetup = { - replaceableVariables: { - 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" - }, - customizationsOnRecordings: [ - (recording: any): any => - recording.replace( - /"access_token":"[^"]*"/g, - `"access_token":"access_token"` - ) - ], - queryParametersToSkip: [] +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 () { - recorder = record(this, recorderEnvSetup); + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); }); - afterEach(async function () { + afterEach(async function() { await recorder.stop(); }); - it("sample test", async function () { + it("sample test", async function() { console.log("Hi, I'm a test!"); }); }); diff --git a/sdk/signalr/arm-signalr/tsconfig.json b/sdk/signalr/arm-signalr/tsconfig.json index b5227bc29af1..3e6ae96443f3 100644 --- a/sdk/signalr/arm-signalr/tsconfig.json +++ b/sdk/signalr/arm-signalr/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-signalr": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"