UNPKG

@puls-atlas/cli

Version:

The Puls Atlas CLI tool for managing Atlas projects

92 lines 2.85 kB
import { SearchProviderDescriptor } from './SearchProviderDescriptor.js'; export class SearchLifecycleProvider { constructor(descriptor) { if (!(descriptor instanceof SearchProviderDescriptor)) { throw new Error('Atlas search lifecycle providers must be constructed with a SearchProviderDescriptor instance.'); } this.descriptor = descriptor; } get configSectionKey() { return this.descriptor.configSectionKey; } get labels() { return this.descriptor.labels; } get name() { return this.descriptor.id; } #notImplemented(methodName) { throw new Error(`Atlas search provider ${this.name} must implement ${methodName}().`); } createCollectionSchema() { this.#notImplemented('createCollectionSchema'); } getConfigSecretName() { this.#notImplemented('getConfigSecretName'); } createDefaultConfigSection() { this.#notImplemented('createDefaultConfigSection'); } validateConfigSection() { this.#notImplemented('validateConfigSection'); } async resolveAccess() { this.#notImplemented('resolveAccess'); } async ensureManagedAccess(_context, _options = {}) { return null; } getAccessReadiness() { this.#notImplemented('getAccessReadiness'); } getProvisionAccessIssues() { this.#notImplemented('getProvisionAccessIssues'); } getDeployAccessIssues() { this.#notImplemented('getDeployAccessIssues'); } async discoverRemoteTargets() { this.#notImplemented('discoverRemoteTargets'); } async inspectSchemas() { this.#notImplemented('inspectSchemas'); } async reconcileSchemas() { this.#notImplemented('reconcileSchemas'); } getRuntimeSecretReferences(_context) { return []; } getRuntimeSecretReference(context) { return this.getRuntimeSecretReferences(context)[0] ?? null; } getEngineRuntimeContract() { this.#notImplemented('getEngineRuntimeContract'); } getLocalDevelopmentFallbackEnvVars() { return []; } getDestroyNotice() { return null; } async promoteRelease(_context, options = {}) { return { message: `Atlas search provider ${this.name} does not expose provider-side release promotion. Atlas only updates release metadata in the active Atlas search config file for this provider.`, releaseId: options.releaseResult?.release?.active ?? null, status: 'not-supported', target: 'provider-runtime' }; } async getPromotionStatus(_context, options = {}) { return { message: `Atlas search provider ${this.name} does not expose provider-side release promotion status.`, releaseId: options.releaseTarget?.releaseId ?? null, status: 'not-supported', target: options.releaseTarget?.target ?? 'provider-runtime' }; } isRelevantDeployWarning() { return true; } } export default SearchLifecycleProvider;