mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-15 17:22:25 -05:00
* Rebase from main branch * Made mssql a module * remove rpc specific stuff * Added create sas RPC call * Backup to url works now * Moved createSas RPC to the BlobService * Relocated createSas RPC from sql-dataprotocolclient to the mssql * After rebase * Removed duplicate symbol * Renamed Blob to AzureBlob and relocated CreateSasResponse to mssql extension * Removed AzureBlobProvider, removed AzureBlobService feature * renamed blob to azureblob, converted thenable to promise * Simplify API * fixes * docs update, blob to azureblob update * bumped sts version * Fix config Co-authored-by: chgagnon <chgagnon@microsoft.com>
25 lines
1.3 KiB
TypeScript
25 lines
1.3 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import * as mssql from 'mssql';
|
|
import { ExtHostAzureBlobShape } from 'sql/workbench/api/common/sqlExtHost.protocol';
|
|
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
|
|
import { IExtHostExtensionService } from 'vs/workbench/api/common/extHostExtensionService';
|
|
|
|
export class ExtHostAzureBlob extends ExtHostAzureBlobShape {
|
|
constructor(@IExtHostExtensionService private _extHostExtensionService: IExtHostExtensionService,) {
|
|
super();
|
|
}
|
|
|
|
public override $createSas(connectionUri: string, blobContainerUri: string, blobStorageKey: string, storageAccountName: string, expirationDate: string): Thenable<mssql.CreateSasResponse> {
|
|
const api = this.getApi();
|
|
return api.azureBlob.createSas(connectionUri, blobContainerUri, blobStorageKey, storageAccountName, expirationDate);
|
|
}
|
|
|
|
private getApi(): mssql.IExtension {
|
|
return this._extHostExtensionService.getExtensionExports(new ExtensionIdentifier(mssql.extension.name)) as mssql.IExtension;
|
|
}
|
|
}
|