mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-23 02:41:39 +00:00
Split all script data access methods (#197)
* Split all script data access methods * More cleanup * Fix Typo
This commit is contained in:
@@ -88,10 +88,6 @@ export interface Resource {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ResourceRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface Collection extends Resource {
|
||||
defaultTtl?: number;
|
||||
indexingPolicy?: IndexingPolicy;
|
||||
@@ -104,39 +100,12 @@ export interface Collection extends Resource {
|
||||
geospatialConfig?: GeospatialConfig;
|
||||
}
|
||||
|
||||
export interface CreateCollectionWithRpResponse extends Resource {
|
||||
properties: Collection;
|
||||
name: string;
|
||||
type: string;
|
||||
}
|
||||
|
||||
export interface CollectionRequest extends ResourceRequest {
|
||||
defaultTtl?: number;
|
||||
indexingPolicy?: IndexingPolicy;
|
||||
partitionKey?: PartitionKey;
|
||||
uniqueKeyPolicy?: UniqueKeyPolicy;
|
||||
conflictResolutionPolicy?: ConflictResolutionPolicy;
|
||||
}
|
||||
|
||||
export interface Database extends Resource {
|
||||
collections?: Collection[];
|
||||
}
|
||||
|
||||
export interface DocumentId extends Resource {}
|
||||
|
||||
export interface Script extends Resource {
|
||||
body: string;
|
||||
}
|
||||
|
||||
export interface StoredProcedure extends Script {}
|
||||
|
||||
export interface UserDefinedFunction extends Script {}
|
||||
|
||||
export interface Trigger extends Script {
|
||||
triggerType: string;
|
||||
triggerOperation: string;
|
||||
}
|
||||
|
||||
export interface ConflictId extends Resource {
|
||||
resourceId?: string;
|
||||
resourceType?: string;
|
||||
@@ -259,28 +228,6 @@ export interface ErrorDataModel {
|
||||
code?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines a property bag for telemetry e.g. see ITelemetryError.
|
||||
*/
|
||||
export interface ITelemetryProperties {
|
||||
[propertyName: string]: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines a property bag for telemetry e.g. see ITelemetryError.
|
||||
*/
|
||||
export interface ITelemetryEvent {
|
||||
name: string;
|
||||
properties?: ITelemetryProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines an error to be logged as telemetry data.
|
||||
*/
|
||||
export interface ITelemetryError extends ITelemetryEvent {
|
||||
error: any;
|
||||
}
|
||||
|
||||
export interface CreateDatabaseAndCollectionRequest {
|
||||
databaseId: string;
|
||||
collectionId: string;
|
||||
@@ -307,11 +254,6 @@ export enum AutopilotTier {
|
||||
Tier4 = 4
|
||||
}
|
||||
|
||||
export interface RpOptions {
|
||||
// tier is sent as string, autoscale as object (AutoPilotCreationSettings)
|
||||
[key: string]: string | AutoPilotCreationSettings;
|
||||
}
|
||||
|
||||
export interface Query {
|
||||
id: string;
|
||||
resourceId: string;
|
||||
@@ -347,12 +289,6 @@ export interface CreateCollectionParams {
|
||||
uniqueKeyPolicy?: UniqueKeyPolicy;
|
||||
}
|
||||
|
||||
export interface SharedThroughputRange {
|
||||
minimumRU: number;
|
||||
maximumRU: number;
|
||||
defaultRU: number;
|
||||
}
|
||||
|
||||
export interface Notification {
|
||||
id: string;
|
||||
kind: string;
|
||||
@@ -495,25 +431,6 @@ export interface NotebookConfigurationEndpointInfo {
|
||||
token: string;
|
||||
}
|
||||
|
||||
export interface SparkCluster {
|
||||
id: string;
|
||||
name: string;
|
||||
type: string;
|
||||
properties: {
|
||||
kind: string;
|
||||
driverSize: string;
|
||||
workerSize: string;
|
||||
workerInstanceCount: number;
|
||||
creationTime: string;
|
||||
status: string;
|
||||
libraries?: SparkClusterLibrary[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface SparkClusterFeedResponse {
|
||||
value: SparkCluster[];
|
||||
}
|
||||
|
||||
export interface SparkClusterConnectionInfo {
|
||||
userName: string;
|
||||
password: string;
|
||||
@@ -555,79 +472,10 @@ export interface MongoParameters extends RpParameters {
|
||||
analyticalStorageTtl?: number;
|
||||
}
|
||||
|
||||
export interface GraphParameters extends RpParameters {
|
||||
pk: string;
|
||||
coll: string;
|
||||
cd: Boolean;
|
||||
indexingPolicy?: IndexingPolicy;
|
||||
}
|
||||
|
||||
export interface CreationRequest {
|
||||
properties: {
|
||||
resource: {
|
||||
id: string;
|
||||
};
|
||||
options: RpOptions;
|
||||
};
|
||||
}
|
||||
|
||||
export interface SqlCollectionParameters extends RpParameters {
|
||||
uniqueKeyPolicy?: UniqueKeyPolicy;
|
||||
pk: string;
|
||||
coll: string;
|
||||
cd: Boolean;
|
||||
analyticalStorageTtl?: number;
|
||||
indexingPolicy?: IndexingPolicy;
|
||||
}
|
||||
|
||||
export interface MongoCreationRequest extends CreationRequest {
|
||||
properties: {
|
||||
resource: {
|
||||
id: string;
|
||||
analyticalStorageTtl?: number;
|
||||
shardKey?: {};
|
||||
};
|
||||
options: RpOptions;
|
||||
};
|
||||
}
|
||||
|
||||
export interface GraphCreationRequest extends CreationRequest {
|
||||
properties: {
|
||||
resource: {
|
||||
id: string;
|
||||
partitionKey: {};
|
||||
indexingPolicy?: IndexingPolicy;
|
||||
};
|
||||
options: RpOptions;
|
||||
};
|
||||
}
|
||||
|
||||
export interface CreateDatabaseWithRpResponse {
|
||||
id: string;
|
||||
name: string;
|
||||
type: string;
|
||||
properties: {
|
||||
id: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface SparkClusterLibrary {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface SqlCollectionCreationRequest extends CreationRequest {
|
||||
properties: {
|
||||
resource: {
|
||||
uniqueKeyPolicy?: UniqueKeyPolicy;
|
||||
id: string;
|
||||
partitionKey: {};
|
||||
analyticalStorageTtl?: number;
|
||||
indexingPolicy?: IndexingPolicy;
|
||||
};
|
||||
options: RpOptions;
|
||||
};
|
||||
}
|
||||
|
||||
export interface Library extends SparkClusterLibrary {
|
||||
properties: {
|
||||
kind: "Jar";
|
||||
|
||||
@@ -1,16 +1,22 @@
|
||||
import * as DataModels from "./DataModels";
|
||||
import {
|
||||
QueryMetrics,
|
||||
Resource,
|
||||
StoredProcedureDefinition,
|
||||
TriggerDefinition,
|
||||
UserDefinedFunctionDefinition
|
||||
} from "@azure/cosmos";
|
||||
import Q from "q";
|
||||
import { CassandraTableKey, CassandraTableKeys } from "../Explorer/Tables/TableDataClient";
|
||||
import { CommandButtonComponentProps } from "../Explorer/Controls/CommandButton/CommandButtonComponent";
|
||||
import { ConsoleData } from "../Explorer/Menus/NotificationConsole/NotificationConsoleComponent";
|
||||
import { QueryMetrics } from "@azure/cosmos";
|
||||
import { UploadDetails } from "../workers/upload/definitions";
|
||||
import Explorer from "../Explorer/Explorer";
|
||||
import UserDefinedFunction from "../Explorer/Tree/UserDefinedFunction";
|
||||
import { ConsoleData } from "../Explorer/Menus/NotificationConsole/NotificationConsoleComponent";
|
||||
import { CassandraTableKey, CassandraTableKeys } from "../Explorer/Tables/TableDataClient";
|
||||
import ConflictId from "../Explorer/Tree/ConflictId";
|
||||
import DocumentId from "../Explorer/Tree/DocumentId";
|
||||
import StoredProcedure from "../Explorer/Tree/StoredProcedure";
|
||||
import Trigger from "../Explorer/Tree/Trigger";
|
||||
import DocumentId from "../Explorer/Tree/DocumentId";
|
||||
import ConflictId from "../Explorer/Tree/ConflictId";
|
||||
import UserDefinedFunction from "../Explorer/Tree/UserDefinedFunction";
|
||||
import { UploadDetails } from "../workers/upload/definitions";
|
||||
import * as DataModels from "./DataModels";
|
||||
|
||||
export interface TokenProvider {
|
||||
getAuthHeader(): Promise<Headers>;
|
||||
@@ -153,13 +159,13 @@ export interface Collection extends CollectionBase {
|
||||
collapseUserDefinedFunctions(): void;
|
||||
collapseTriggers(): void;
|
||||
|
||||
loadUserDefinedFunctions(): Q.Promise<any>;
|
||||
loadStoredProcedures(): Q.Promise<any>;
|
||||
loadTriggers(): Q.Promise<any>;
|
||||
loadUserDefinedFunctions(): Promise<any>;
|
||||
loadStoredProcedures(): Promise<any>;
|
||||
loadTriggers(): Promise<any>;
|
||||
|
||||
createStoredProcedureNode(data: DataModels.StoredProcedure): StoredProcedure;
|
||||
createUserDefinedFunctionNode(data: DataModels.UserDefinedFunction): UserDefinedFunction;
|
||||
createTriggerNode(data: DataModels.Trigger): Trigger;
|
||||
createStoredProcedureNode(data: StoredProcedureDefinition & Resource): StoredProcedure;
|
||||
createUserDefinedFunctionNode(data: UserDefinedFunctionDefinition & Resource): UserDefinedFunction;
|
||||
createTriggerNode(data: TriggerDefinition & Resource): Trigger;
|
||||
findStoredProcedureWithId(sprocRid: string): StoredProcedure;
|
||||
findTriggerWithId(triggerRid: string): Trigger;
|
||||
findUserDefinedFunctionWithId(udfRid: string): UserDefinedFunction;
|
||||
|
||||
Reference in New Issue
Block a user