arkturian-storage-sdk
v1.0.1
Published
TypeScript SDK for Arkturian Storage API - AI-powered media storage with Knowledge Graph embeddings
Downloads
28
Maintainers
Readme
@apopovic77/storage-sdk
TypeScript/JavaScript SDK for Arkturian Storage API - AI-powered media storage with Knowledge Graph embeddings.
🔒 PRIVATE PACKAGE - Internal use only
Features
- Full TypeScript Support - Complete type definitions for all API endpoints
- AI-Powered Search - Semantic search using OpenAI embeddings
- Knowledge Graph - Vector similarity search with ChromaDB
- Media Transformations - On-the-fly image/video processing
- Multi-Tenancy - Built-in tenant isolation
- Auto-Generated - Always in sync with the latest API specification
Installation
Prerequisites
This is a private package hosted on GitHub Packages. You need to configure npm to use GitHub Packages registry.
One-time setup:
Create or update .npmrc in your project root:
@apopovic77:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKENReplace YOUR_GITHUB_TOKEN with a GitHub Personal Access Token (classic) with read:packages scope.
Create one here
Install the package:
npm install @apopovic77/storage-sdk
# or
yarn add @apopovic77/storage-sdk
# or
pnpm add @apopovic77/storage-sdkQuick Start
import { Configuration, StorageApi } from '@arkturian/storage-sdk';
// Configure API client
const config = new Configuration({
basePath: 'https://api-storage.arkturian.com',
apiKey: 'your-api-key-here',
});
const storageApi = new StorageApi(config);
// Upload a file
const file = new File(['content'], 'example.jpg', { type: 'image/jpeg' });
const upload = await storageApi.uploadFileStorageUploadPost({
file,
context: 'my-app',
collection_id: 'photos',
});
console.log('Uploaded:', upload.data);
// Search with AI
const search = await storageApi.kgTextSearchStorageKgSearchGet({
query: 'red motocross gloves',
limit: 10,
});
console.log('Search results:', search.data.results);API Reference
Storage Operations
// List storage objects
const list = await storageApi.listStorageObjectsStorageListGet({
limit: 100,
context: 'my-app',
});
// Get single object
const object = await storageApi.getStorageObjectStorageObjectsObjectIdGet({
objectId: 123,
});
// Find similar objects (Knowledge Graph)
const similar = await storageApi.findSimilarStorageSimilarObjectIdGet({
objectId: 123,
limit: 5,
});
// Delete object
await storageApi.deleteStorageObjectStorageObjectsObjectIdDelete({
objectId: 123,
});Knowledge Graph
// Semantic search
const results = await storageApi.kgTextSearchStorageKgSearchGet({
query: 'mountain bike helmet',
limit: 10,
collection_like: 'products',
});
// Get KG stats
const stats = await storageApi.kgStatsStorageKgStatsGet();
console.log('Total embeddings:', stats.data.total_embeddings);
// Manually trigger embedding
await storageApi.createOrRefreshEmbeddingStorageObjectsObjectIdEmbedPost({
objectId: 123,
});Media Transformations
// Get transformed media URL
const mediaUrl = `https://api-storage.arkturian.com/storage/media/123?width=800&format=webp&quality=80`;Configuration
Base URL
const config = new Configuration({
basePath: 'https://api-storage.arkturian.com', // Production
// basePath: 'http://localhost:8002', // Local development
});Authentication
const config = new Configuration({
apiKey: process.env.STORAGE_API_KEY,
// or as a function for dynamic tokens
apiKey: () => getApiKeyFromVault(),
});Axios Options
import axios from 'axios';
const config = new Configuration({
basePath: 'https://api-storage.arkturian.com',
baseOptions: {
timeout: 30000,
headers: {
'User-Agent': 'MyApp/1.0',
},
},
});Error Handling
import { AxiosError } from 'axios';
try {
const upload = await storageApi.uploadFileStorageUploadPost({ file });
} catch (error) {
if (error instanceof AxiosError) {
console.error('API Error:', error.response?.data);
console.error('Status:', error.response?.status);
}
}TypeScript Types
All API models are exported:
import type {
StorageObjectResponse,
KGSearchResponse,
SimilarityResponse,
StorageListResponse,
} from '@arkturian/storage-sdk';Development
This SDK is auto-generated from the OpenAPI specification. Do not modify generated files directly.
Build
npm run buildTest
npm testLinks
License
PRIVATE - All rights reserved. Internal use only.
