TypeScript SDK for the Fixle API. Manage properties, inspections, and appliances.
npm install @spectorasoftware/fixle-sdkAdd to your .npmrc:
@spectorasoftware:registry=https://npm.pkg.github.com
Then install:
npm install @spectorasoftware/fixle-sdknpm install git+https://github.com/spectorasoftware/fixle-sdk.gitimport { FixleClient } from '@spectorasoftware/fixle-sdk';
const client = new FixleClient({
apiUrl: 'https://api.fixle.com',
apiKey: 'your-api-key'
});
// Create a property
const propertyId = await client.findOrCreateProperty('123 Main St, Portland, OR 97201');
// Create an inspection
await client.createInspection(propertyId, 12345);
// Create an inspection with inspector image
await client.createInspection(propertyId, 12345, 'https://example.com/inspector.jpg');
// Add an appliance
await client.createAppliance(propertyId, {
item_name: 'Water Heater',
section_name: 'Basement',
brand: 'Rheem',
model: 'XE50M06ST45U1',
serial_number: 'ABC123',
manufacturer: 'Rheem Manufacturing',
year: '2020'
});new FixleClient(config: FixleClientConfig)| Parameter | Type | Description |
|---|---|---|
config.apiUrl |
string |
Base URL of the Fixle API |
config.apiKey |
string |
API key for authentication |
Creates a new property from an address string.
const propertyId = await client.findOrCreateProperty('123 Main St, Portland, OR 97201');createInspection(propertyId: number, inspectionId: number, inspectorImageUrl?: string): Promise<void>
Creates an inspection record for a property.
// Without inspector image
await client.createInspection(123, 45678);
// With inspector image
await client.createInspection(123, 45678, 'https://example.com/inspector.jpg');| Parameter | Type | Description |
|---|---|---|
propertyId |
number |
ID of the property |
inspectionId |
number |
External inspection ID |
inspectorImageUrl |
string (optional) |
URL to inspector's profile image |
Creates an appliance record for a property.
await client.createAppliance(123, {
item_name: 'Water Heater',
section_name: 'Basement',
brand: 'Rheem',
model: 'XE50M06ST45U1',
serial_number: 'ABC123',
manufacturer: 'Rheem Manufacturing',
year: '2020'
});| Field | Type | Description |
|---|---|---|
item_name |
string |
Name of the appliance |
section_name |
string |
Location/section where found |
brand |
string | null |
Brand name |
model |
string | null |
Model number |
serial_number |
string | null |
Serial number |
manufacturer |
string | null |
Manufacturer name |
year |
string | null |
Year of manufacture |
# Install dependencies
npm install
# Build
npm run build
# Run tests
npm test
# Run unit tests only
npm run test:unit
# Run tests with coverage
npm run test:coverageMIT