/** * Copyright 2023 Fluence Labs Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import type { JSONSchemaType } from "ajv"; import { IPFS_ADDR_PROPERTY, MARINE_BUILD_ARGS_PROPERTY, type ContractsENV, type FluenceEnv } from "../../const.js"; import { type InitializedConfig, type InitializedReadonlyConfig } from "../initConfig.js"; import { type OverridableModuleProperties } from "./module.js"; import { type OverridableSpellProperties } from "./spell.js"; export declare const MIN_WORKERS = 1; export declare const TARGET_WORKERS = 3; export type OverrideModules = Record; type ServiceV1 = { get: string; overrideModules?: OverrideModules; }; type ConfigV1 = { version: 1; services?: Record; relays?: FluenceEnv | Array; }; export declare const AQUA_INPUT_PATH_PROPERTY = "aquaInputPath"; type FluenceConfigSpell = { get: string; } & OverridableSpellProperties; type Deal = { minWorkers?: number; targetWorkers?: number; }; type Worker = { services?: Array; spells?: Array; }; type Host = { peerIds: Array; }; type ConfigV2 = Omit & { version: 2; dependencies?: { npm?: Record; cargo?: Record; }; [AQUA_INPUT_PATH_PROPERTY]?: string; aquaOutputTSPath?: string; aquaOutputJSPath?: string; hosts?: Record; workers?: Record; deals?: Record; chainNetwork?: ContractsENV; spells?: Record; aquaImports?: Array; cliVersion?: string; [MARINE_BUILD_ARGS_PROPERTY]?: string; [IPFS_ADDR_PROPERTY]?: string; }; export declare function assertIsArrayWithHostsOrDeals(unknownArr: [string, unknown][]): asserts unknownArr is [string, Host | Deal][]; type ConfigV3 = Omit & { version: 3; customFluenceEnv?: { contractsEnv: ContractsENV; relays: Array; }; }; type ConfigV4 = Omit & { version: 4; defaultSecretKeyName?: string; relaysPath?: string; }; type ConfigV5 = Omit & { version: 5; deals?: Record; hosts?: Record; }; type LatestConfig = ConfigV5; export type FluenceConfig = InitializedConfig; export type FluenceConfigReadonly = InitializedReadonlyConfig; export type FluenceConfigWithServices = FluenceConfig & { services: NonNullable; }; export declare function isFluenceConfigWithServices(config: FluenceConfig): config is FluenceConfigWithServices; export declare const initFluenceConfigWithPath: (path: string) => Promise | null>; export declare const initNewFluenceConfig: () => Promise>; export declare const initFluenceConfig: () => Promise | null>; export declare const initReadonlyFluenceConfig: () => Promise | null>; export declare const fluenceSchema: JSONSchemaType; export {};