JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 232
  • Score
    100M100P100Q77548F
  • License MIT

Node.JS API to communicate with warehouse.ai

Package Exports

  • warehouse.ai-api-client
  • warehouse.ai-api-client/lib/index.js
  • warehouse.ai-api-client/lib/utils/file
  • warehouse.ai-api-client/lib/utils/file.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (warehouse.ai-api-client) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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