Skip to main content
Version: 1.0.0 (beta)

SDK Smart Services

Gli SDK ufficiali di Smart Services semplificano l'integrazione con i nostri servizi AI e di automazione, fornendo librerie native per i linguaggi di programmazione piΓΉ popolari.

SDK disponibili​

🟨 JavaScript/TypeScript​

  • NPM Package: @teamsystem/smart-services-sdk
  • Supporto: Node.js 16+, Browser (con bundler)
  • Features: Promise-based, TypeScript definitions, auto-retry

🟦 .NET (C#)​

  • NuGet Package: TeamSystem.SmartServices.SDK
  • Supporto: .NET 6+, .NET Framework 4.8+
  • Features: Async/await, strong typing, dependency injection

🟩 Python​

  • PyPI Package: teamsystem-smart-services
  • Supporto: Python 3.8+
  • Features: Async/await, type hints, pytest integration

🟧 Java (In sviluppo)​

  • Maven Package: com.teamsystem:smart-services-sdk
  • Supporto: Java 11+, Android
  • Status: Coming soon in v1.1.0

Caratteristiche comuni​

πŸ” Autenticazione automatica​

  • Gestione automatica dei token OAuth 2.0
  • Refresh automatico dei token scaduti
  • Supporto per API Key e Client Credentials

Retry e resilienza​

  • Retry automatico per errori temporanei
  • Backoff esponenziale configurabile
  • Circuit breaker per fallimenti ripetuti

Monitoring e logging​

  • Logging strutturato delle richieste
  • Metriche di performance integrate
  • Tracciamento distribuito

Type safety​

  • Modelli di dati strongly-typed
  • Validazione automatica dei parametri
  • IntelliSense completo negli IDE

Installazione rapida​

JavaScript/Node.js​

npm install @teamsystem/smart-services-sdk
import { SmartServicesClient } from '@teamsystem/smart-services-sdk';

const client = new SmartServicesClient({
apiKey: process.env.SMART_SERVICES_API_KEY,
environment: 'production'
});

.NET/C#​

dotnet add package TeamSystem.SmartServices.SDK
using TeamSystem.SmartServices;

var client = new SmartServicesClient(new SmartServicesOptions
{
ApiKey = Environment.GetEnvironmentVariable("SMART_SERVICES_API_KEY"),
Environment = SmartServicesEnvironment.Production
});

Python​

pip install teamsystem-smart-services
from teamsystem_smart_services import SmartServicesClient

client = SmartServicesClient(
api_key=os.environ['SMART_SERVICES_API_KEY'],
environment='production'
)

Esempi di utilizzo​

Analisi documento (Multi-linguaggio)​

// Analisi fattura con JavaScript
const result = await client.ai.analyzeDocument({
file: './invoice.pdf',
type: 'invoice',
language: 'it'
});

console.log(`Fornitore: ${result.supplier.name}`);
console.log(`Totale: €${result.amounts.total}`);

Workflow automation​

// Creazione workflow
const workflow = await client.automation.createWorkflow({
name: 'Processo Approvazione Fatture',
trigger: {
type: 'document_uploaded',
filters: { document_type: 'invoice' }
},
steps: [
{
type: 'ai_analysis',
service: 'document_analysis'
},
{
type: 'approval_request',
assignee: 'finance_team'
},
{
type: 'integration',
target: 'erp_system'
}
]
});

Configurazione avanzata​

Gestione ambienti​

// Configurazione per ambienti diversi
const client = new SmartServicesClient({
apiKey: process.env.SMART_SERVICES_API_KEY,
environment: process.env.NODE_ENV === 'production' ? 'production' : 'sandbox',
timeout: 30000,
retryAttempts: 3,
retryDelay: 1000
});

Logging personalizzato​

// Configurazione logging
const client = new SmartServicesClient({
apiKey: 'your-api-key',
logger: {
level: 'debug',
format: 'json',
destination: './logs/smart-services.log'
}
});

Interceptors per richieste​

// Aggiunta di headers personalizzati
client.interceptors.request.use((config) => {
config.headers['X-Request-ID'] = generateRequestId();
config.headers['X-User-Agent'] = 'MyApp/1.0.0';
return config;
});

// Logging delle risposte
client.interceptors.response.use((response) => {
console.log(`Request completed: ${response.status} ${response.statusText}`);
return response;
});

Testing​

Unit testing con mock​

// Jest test con mock
import { SmartServicesClient } from '@teamsystem/smart-services-sdk';
import { mockDocumentAnalysis } from '@teamsystem/smart-services-sdk/testing';

describe('Document Analysis', () => {
let client;

beforeEach(() => {
client = new SmartServicesClient({ apiKey: 'test-key' });
mockDocumentAnalysis();
});

test('should analyze invoice correctly', async () => {
const result = await client.ai.analyzeDocument({
file: './test-invoice.pdf',
type: 'invoice'
});

expect(result.supplier.name).toBe('Test Supplier');
expect(result.amounts.total).toBe(1000);
});
});

Integration testing​

// Test di integrazione
const client = new SmartServicesClient({
apiKey: process.env.TEST_API_KEY,
environment: 'sandbox'
});

test('integration: full document analysis flow', async () => {
const result = await client.ai.analyzeDocument({
file: './fixtures/sample-invoice.pdf',
type: 'invoice',
language: 'it'
});

expect(result.status).toBe('completed');
expect(result.confidence).toBeGreaterThan(0.8);
});

Migrazione e aggiornamenti​

Versioning policy​

  • Patch releases (1.0.x): Bug fixes, nessun breaking change
  • Minor releases (1.x.0): Nuove features, backward compatible
  • Major releases (x.0.0): Breaking changes, migration guide fornita

Changelog​

Mantieni sempre aggiornato il tuo SDK:

# Controlla la versione corrente
npm list @teamsystem/smart-services-sdk

# Aggiorna alla latest
npm update @teamsystem/smart-services-sdk

Supporto e community​

πŸ“š Risorse​

πŸ’¬ Community​

πŸ› Report bugs​


Gli SDK sono open source e contributi dalla community sono benvenuti!