/** * 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 { type ModuleType } from "../../const.js"; import { type InitializedConfig, type InitializedReadonlyConfig } from "../initConfig.js"; export type OverridableModuleProperties = { maxHeapSize?: string; loggerEnabled?: boolean; loggingMask?: number; volumes?: Record; envs?: Record; mountedBinaries?: Record; }; export type ConfigV0 = { version: 0; name: string; type?: ModuleType; } & OverridableModuleProperties; type LatestConfig = ConfigV0; export type ModuleConfig = InitializedConfig; export type ModuleConfigReadonly = InitializedReadonlyConfig; export declare const initReadonlyModuleConfig: (configOrConfigDirPathOrUrl: string, absolutePath?: string | undefined) => Promise | null>; export declare const initNewReadonlyModuleConfig: (configPath: string, name: string) => Promise | null>; export declare const moduleSchema: JSONSchemaType; export declare const overridableModuleProperties: { readonly maxHeapSize: { readonly type: "string"; readonly nullable: true; readonly description: "Max size of the heap that a module can allocate in format: [number][whitespace?][specificator?] where ? is an optional field and specificator is one from the following (case-insensitive):\nK, Kb - kilobyte\nKi, KiB - kibibyte\nM, Mb - megabyte\nMi, MiB - mebibyte\nG, Gb - gigabyte\nGi, GiB - gibibyte\nCurrent limit is 4 GiB"; }; readonly loggerEnabled: { readonly type: "boolean"; readonly nullable: true; readonly description: "Set true to allow module to use the Marine SDK logger"; }; readonly loggingMask: { readonly type: "number"; readonly nullable: true; readonly description: "manages the logging targets, described in detail: https://fluence.dev/docs/marine-book/marine-rust-sdk/developing/logging#using-target-map"; }; readonly volumes: { readonly type: "object"; readonly nullable: true; readonly required: readonly []; readonly title: "Volumes"; readonly additionalProperties: { readonly type: "string"; }; readonly properties: { readonly Alias: { readonly type: "string"; readonly description: "path"; }; }; readonly description: "A map of accessible files and their aliases. Aliases should be used in Marine module development because it's hard to know the full path to a file"; }; readonly envs: { readonly type: "object"; readonly title: "Environment variables"; readonly nullable: true; readonly required: readonly []; readonly additionalProperties: { readonly type: "string"; }; readonly properties: { readonly Environment_variable_name: { readonly type: "string"; readonly description: "Environment variable value"; }; }; readonly description: "environment variables accessible by a particular module with standard Rust env API like this: std::env::var(IPFS_ADDR_ENV_NAME). Please note that Marine adds three additional environment variables. Module environment variables could be examined with repl"; }; readonly mountedBinaries: { readonly title: "Mounted binaries"; readonly type: "object"; readonly additionalProperties: { readonly type: "string"; }; readonly properties: { readonly Mounted_binary_name: { readonly type: "string"; readonly description: "Path to a mounted binary"; }; }; readonly nullable: true; readonly required: readonly []; readonly description: "A map of binary executable files that module is allowed to call. Example: curl: /usr/bin/curl"; }; }; export {};