Remove Explorer.collectionCreationDefaults (#840)

Co-authored-by: Steve Faulkner <southpolesteve@gmail.com>
This commit is contained in:
Hardikkumar Nai
2021-05-27 01:41:47 +05:30
committed by GitHub
parent 6d03cec139
commit 50f83cde87
10 changed files with 26 additions and 98 deletions

View File

@@ -2,7 +2,25 @@ import { AuthType } from "./AuthType";
import { DatabaseAccount } from "./Contracts/DataModels";
import { SubscriptionType } from "./Contracts/SubscriptionType";
import { extractFeatures, Features } from "./Platform/Hosted/extractFeatures";
import { CollectionCreation } from "./Shared/Constants";
import { CollectionCreation, CollectionCreationDefaults } from "./Shared/Constants";
interface ThroughputDefaults {
fixed: number;
unlimited:
| number
| {
collectionThreshold: number;
lessThanOrEqualToThreshold: number;
greatThanThreshold: number;
};
unlimitedmax: number;
unlimitedmin: number;
shared: number;
}
export interface CollectionCreationDefaults {
storage: string;
throughput: ThroughputDefaults;
}
interface UserContext {
readonly authType?: AuthType;
@@ -26,6 +44,7 @@ interface UserContext {
readonly features: Features;
readonly addCollectionFlight: string;
readonly hasWriteAccess: boolean;
collectionCreationDefaults: CollectionCreationDefaults;
}
export type ApiType = "SQL" | "Mongo" | "Gremlin" | "Tables" | "Cassandra";
@@ -43,6 +62,7 @@ const userContext: UserContext = {
useSDKOperations,
addCollectionFlight: CollectionCreation.DefaultAddCollectionDefaultFlight,
subscriptionType: CollectionCreation.DefaultSubscriptionType,
collectionCreationDefaults: CollectionCreationDefaults,
};
function updateUserContext(newContext: Partial<UserContext>): void {