warehouse.ai-api-client
API client to communicate with warehouse.ai.
Install
npm install warehouse.ai-api-client --save
Usage
const { WarehouseSDK } = require('warehouse.ai-api-client');
const sdk = WarehouseSDK({ baseUrl, username, password });
const main = async () => {
await sdk.object().create({
name: 'my-object',
env: 'development',
expiration: '365d',
variant: 'en-US',
version: '1.0.0',
data: { foo: 'bar' }
});
const result = await sdk.object().get({
name: 'my-object',
env: 'development',
acceptedVariants: ['en-US'],
version: '1.0.0'
});
await sdk.object().setHead({
name: 'my-object',
env: 'development',
version: '1.0.0'
});
const result = await sdk.object().getHead({
name: 'my-object',
env: 'development'
});
};
main().catch(console.error);
Test
npm test