warehouse.ai-api-client

7.1.2 • Public • Published

warehouse.ai-api-client

Version npm License npm Downloads Build Status

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 () => {
  // Create an object
  await sdk.object().create({
    name: 'my-object',
    env: 'development',
    expiration: '365d',
    variant: 'en-US',
    version: '1.0.0',
    data: { foo: 'bar' }
  });

  // Get an object
  const result = await sdk.object().get({
    name: 'my-object',
    env: 'development',
    acceptedVariants: ['en-US'],
    version: '1.0.0'
  });

  // Set object head
  await sdk.object().setHead({
    name: 'my-object',
    env: 'development',
    version: '1.0.0'
  });

  // Get head
  const result = await sdk.object().getHead({
    name: 'my-object',
    env: 'development'
  });
};

main().catch(console.error);

Test

npm test

/warehouse.ai-api-client/

    Package Sidebar

    Install

    npm i warehouse.ai-api-client

    Weekly Downloads

    99

    Version

    7.1.2

    License

    MIT

    Unpacked Size

    30.9 kB

    Total Files

    22

    Last publish

    Collaborators

    • mmason2
    • jpina1-godaddy
    • jacopodaeli
    • jgowdy
    • ibrandao
    • jpage
    • kinetifex
    • rxmarbles
    • kquerna
    • 3rdeden
    • jcrugzz
    • dcousineau
    • decompil3d
    • indexzero
    • msluther
    • swaagie
    • wjarvis
    • sbw
    • sivanmehta
    • fritzmonkey
    • elubin
    • salilagrawal
    • jwilhelm
    • celiawaggoner
    • jh2oman