spindb 0.35.4 → 0.36.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -9
- package/cli/commands/engines.ts +89 -435
- package/cli/commands/menu/backup-handlers.ts +5 -0
- package/cli/commands/menu/settings-handlers.ts +3 -0
- package/cli/commands/menu/shell-handlers.ts +40 -0
- package/cli/constants.ts +4 -0
- package/cli/helpers.ts +74 -0
- package/config/backup-formats.ts +14 -0
- package/config/engine-defaults.ts +13 -0
- package/config/engines.json +17 -0
- package/core/config-manager.ts +10 -0
- package/core/credential-manager.ts +2 -0
- package/core/dependency-manager.ts +2 -0
- package/core/docker-exporter.ts +7 -0
- package/engines/index.ts +5 -0
- package/engines/weaviate/README.md +302 -0
- package/engines/weaviate/api-client.ts +61 -0
- package/engines/weaviate/backup.ts +145 -0
- package/engines/weaviate/binary-manager.ts +80 -0
- package/engines/weaviate/binary-urls.ts +115 -0
- package/engines/weaviate/cli-utils.ts +43 -0
- package/engines/weaviate/hostdb-releases.ts +23 -0
- package/engines/weaviate/index.ts +1139 -0
- package/engines/weaviate/restore.ts +235 -0
- package/engines/weaviate/version-maps.ts +78 -0
- package/engines/weaviate/version-validator.ts +128 -0
- package/package.json +2 -1
- package/types/index.ts +9 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Weaviate CLI utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides common functions for locating Weaviate binaries,
|
|
5
|
+
* used by both backup.ts and restore.ts to avoid duplication.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { existsSync } from 'fs'
|
|
9
|
+
import { configManager } from '../../core/config-manager'
|
|
10
|
+
import { platformService } from '../../core/platform-service'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Get the path to weaviate binary
|
|
14
|
+
*
|
|
15
|
+
* Lookup order:
|
|
16
|
+
* 1. configManager cache (bundled/downloaded binaries from hostdb)
|
|
17
|
+
* 2. System PATH (fallback for system-installed weaviate)
|
|
18
|
+
*
|
|
19
|
+
* @returns Path to weaviate or null if not found
|
|
20
|
+
*/
|
|
21
|
+
export async function getWeaviatePath(): Promise<string | null> {
|
|
22
|
+
// Check if we have a cached/bundled weaviate from hostdb
|
|
23
|
+
const cachedPath = await configManager.getBinaryPath('weaviate')
|
|
24
|
+
if (cachedPath && existsSync(cachedPath)) {
|
|
25
|
+
return cachedPath
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Fallback to system PATH
|
|
29
|
+
return platformService.findToolPath('weaviate')
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Error message for missing weaviate binary
|
|
34
|
+
* Directs users to download via hostdb (preferred) or system package manager (fallback)
|
|
35
|
+
*/
|
|
36
|
+
export const WEAVIATE_NOT_FOUND_ERROR =
|
|
37
|
+
'weaviate not found. Download Weaviate binaries:\n' +
|
|
38
|
+
' spindb engines download weaviate\n' +
|
|
39
|
+
'\n' +
|
|
40
|
+
'Or run via Docker:\n' +
|
|
41
|
+
' docker run -p 8080:8080 semitechnologies/weaviate\n' +
|
|
42
|
+
'\n' +
|
|
43
|
+
'See: https://weaviate.io/developers/weaviate/installation'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* hostdb Releases Module for Weaviate
|
|
3
|
+
*
|
|
4
|
+
* Fetches Weaviate binary information from the hostdb repository at
|
|
5
|
+
* https://github.com/robertjbass/hostdb
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { createHostdbReleases } from '../../core/hostdb-releases-factory'
|
|
9
|
+
import { WEAVIATE_VERSION_MAP, SUPPORTED_MAJOR_VERSIONS } from './version-maps'
|
|
10
|
+
import { weaviateBinaryManager } from './binary-manager'
|
|
11
|
+
import { Engine } from '../../types'
|
|
12
|
+
|
|
13
|
+
const hostdbReleases = createHostdbReleases({
|
|
14
|
+
engine: Engine.Weaviate,
|
|
15
|
+
displayName: 'Weaviate',
|
|
16
|
+
versionMap: WEAVIATE_VERSION_MAP,
|
|
17
|
+
supportedMajorVersions: SUPPORTED_MAJOR_VERSIONS,
|
|
18
|
+
groupingStrategy: 'single-digit',
|
|
19
|
+
listInstalled: () => weaviateBinaryManager.listInstalled(),
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
export const fetchAvailableVersions = hostdbReleases.fetchAvailableVersions
|
|
23
|
+
export const getLatestVersion = hostdbReleases.getLatestVersion
|