sardines-core
Version:
Core of sardines.js
225 lines • 6.64 kB
TypeScript
export declare namespace Sardines {
interface ServiceArgument {
name: string;
type: string;
}
interface Service {
application?: string;
name: string;
module: string;
version?: string;
arguments: ServiceArgument[];
returnType: string;
isAsync?: boolean;
filepath?: string;
}
interface ServiceDescriptionFile {
services: Service[];
application: string;
}
interface ServiceIdentity {
application: string;
module: string;
name: string;
version?: string;
}
interface Entry {
providerInfo: ProviderPublicInfo;
user?: string;
password?: string;
token?: string;
}
interface Module {
[serviceName: string]: string;
}
interface Application {
[moduleName: string]: Module;
}
interface DriverSettings {
name: string;
locationType: LocationType;
protocols: string[];
}
enum Platform {
nodejs = "nodejs",
browser = "browser",
reactNative = "reactNative"
}
interface Config {
application: string;
platform: Platform;
exeDir?: string;
srcRootDir?: string;
sardinesDir?: string;
remoteServices?: {
[appName: string]: Application;
};
repositoryEntries: Entry[];
drivers?: DriverSettings[];
}
enum LocationType {
npm_link = "npm_link",
npm = "npm",
file = "file",
git = "git"
}
interface LocationSettings {
name?: string;
locationType: LocationType;
location?: string;
url?: string;
}
interface ServiceSettingsForProvider {
module: string;
name: string;
settings: any;
}
interface ApplicationSettingsForProvider {
protocol?: string;
application: string;
commonSettings: any;
serviceSettings: ServiceSettingsForProvider[];
}
interface DriversForProvider {
[platform: string]: string;
}
interface ProviderPublicInfo {
protocol: string;
driver: string | DriversForProvider;
[key: string]: any;
}
interface ProviderSettings {
protocol: string;
public: ProviderPublicInfo;
[key: string]: any;
}
interface ProviderDefinition {
name: string;
code: LocationSettings;
providerSettings: ProviderSettings;
applicationSettings?: ApplicationSettingsForProvider[];
}
interface ServiceArgument {
name: string;
type: string;
}
interface ApplicationSettings {
name: string;
code: LocationSettings;
version: string;
init: {
service: {
module: string;
name: string;
};
arguments: any[];
}[];
}
interface DeployPlan {
tags?: string[];
providers: ProviderDefinition[];
applications: ApplicationSettings[];
}
namespace Runtime {
enum ServiceEntryType {
dedicated = "dedicated",
proxy = "proxy"
}
interface ServiceEntry {
type: ServiceEntryType;
providerName?: string;
providerInfo?: any;
settingsForProvider?: any;
}
interface Service {
identity: ServiceIdentity;
entries: ServiceEntry[];
arguments?: ServiceArgument[];
returnType?: string;
expireInSeconds?: number;
resourceId?: string;
}
interface DeployResult {
tags?: string[];
providers: ProviderDefinition[];
services: {
[applicationName: string]: Runtime.Service[];
};
resourceId?: string;
}
enum LoadBalancingStrategy {
workloadFocusing = "workloadFocusing",
evenWorkload = "evenWorkload",
random = "random"
}
enum RuntimeStatus {
ready = "ready",
pending = "pending",
deploying = "deploying"
}
enum RuntimeTargetType {
service = "service",
host = "host"
}
enum ResourceType {
host = "host"
}
interface Resource {
name: string;
account: string;
tags?: string[];
type?: ResourceType;
status?: RuntimeStatus;
workload_percentage?: number;
address?: {
ipv4?: string;
ssh_port?: number;
ipv6?: string;
};
cpu_cores?: number;
mem_megabytes?: number;
providers?: Sardines.ProviderDefinition[];
}
interface ServiceCacheItem {
serviceSettingsInProvider?: any;
serviceRuntimeId?: string;
}
interface ServiceCache {
[appName: string]: {
[moduleName: string]: {
[serviceName: string]: {
[versionString: string]: boolean | Runtime.Service | Sardines.Service | ServiceCacheItem;
};
};
};
}
interface ProviderCache {
[pvdrKey: string]: {
providerInfo: Sardines.ProviderPublicInfo | null;
serviceRuntimeIds: string[];
serviceCache: Sardines.Runtime.ServiceCache;
};
}
interface ServiceRuntimeUpdateResult {
[appName: string]: {
[pvdrKey: string]: {
application: string;
module: string;
name: string;
version: string;
runtimeId: string;
}[];
};
}
}
namespace Transform {
const fromServiceToEmptyRuntime: (service: Service) => Runtime.Service | null;
const fromServiceDescriptionFileToServiceCache: (descfile: ServiceDescriptionFile, options?: {
booleanValue: boolean;
version: string;
}) => Runtime.ServiceCache | null;
const mergeServiceCaches: (to: Runtime.ServiceCache, from: Runtime.ServiceCache) => void;
const pushServiceIntoProviderCache: (pvdrCache: Runtime.ProviderCache, pvdrkey: string, pvdr: Sardines.ProviderPublicInfo | null, service: Sardines.ServiceIdentity, value?: any) => void;
}
}
//# sourceMappingURL=sardines.d.ts.map