From c88c21cfc96402200948dfdcec6a21bcdf33a0bc Mon Sep 17 00:00:00 2001 From: Cornelis Heuperman <38754228+heuperman@users.noreply.github.com> Date: Fri, 30 Aug 2019 02:01:49 +0100 Subject: [PATCH] Add Rackspace to pkgcloud's storage providers (#37951) --- types/pkgcloud/index.d.ts | 20 +++++++++++++++++++- types/pkgcloud/pkgcloud-tests.ts | 9 +++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/types/pkgcloud/index.d.ts b/types/pkgcloud/index.d.ts index 4f50f44b12..460f84ea74 100644 --- a/types/pkgcloud/index.d.ts +++ b/types/pkgcloud/index.d.ts @@ -2,8 +2,9 @@ // Project: https://github.com/pkgcloud/pkgcloud#readme // Definitions by: Daniel Friesen // Adam Smith +// Cornelis Heuperman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.7 /// @@ -70,11 +71,28 @@ export interface OpenstackProviderOptions { keystoneAuthVersion?: string; } +export type RackspaceRegions = + | 'DFW' // Dallas/Fort Worth, United States + | 'ORD' // Chicago, United States + | 'IAD' // Northern Virginia, United States + | 'LON' // London, United Kingdom + | 'HKG' // Hong Kong, China + | 'SYD'; // Sydney, Australia + +export interface RackspaceProviderOptions { + provider: 'rackspace'; + username: string; + apiKey: string; + region: RackspaceRegions; + useInternal?: boolean; +} + export type ProviderOptions = BaseProviderOptions & Partial< | AmazonProviderOptions | AzureProviderOptions | GoogleProviderOptions | OpenstackProviderOptions + | RackspaceProviderOptions >; /** diff --git a/types/pkgcloud/pkgcloud-tests.ts b/types/pkgcloud/pkgcloud-tests.ts index e050b7e130..ee24bea722 100644 --- a/types/pkgcloud/pkgcloud-tests.ts +++ b/types/pkgcloud/pkgcloud-tests.ts @@ -37,6 +37,15 @@ pkgcloud.storage.createClient({ password: 'password' }); +// Rackspace +pkgcloud.storage.createClient({ + provider: 'rackspace', + username: 'username', + apiKey: 'apiKey', + region: 'DFW', + useInternal: false +}); + // Upload a File { const client = pkgcloud.storage.createClient({