2.0.1 • Published 9 months ago

rigelsdk v2.0.1

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
9 months ago

Getting started

Installation

Install with yarn or npm: yarn or npm:

# yarn
yarn add rigelsdk
# npm
npm i rigelsdk --save

Import the lib with es6 or cjs

// es6
import rigelsdk from 'rigelsdk';
// cjs
const rigelsdk = require('rigelsdk');

Usage examples

#!/usr/bin/env node
const KEY = 'secretkey';
const SALT = 'secretsalt';
const BASE_URL = '<put rigel url here>'; //~http://localhost:8080/rigel

const rigelSDK = new rigelsdk.SDK(BASE_URL, KEY, SALT);

const proxyURL = await rigelSDK.proxyImage(
  'https://www.pakainfo.com/wp-content/uploads/2021/09/image-url-for-testing.jpg',
  new rigelsdk.Options({ Width: 100, Height: 100, Type: ImageType.WEBP }),
  Date.now() + 1000 * 60 * 60 * 24, // 1 day expiry
);

// Creating short url
const shortURL = await rigelSDK.tryShortURL(
  'https://www.pakainfo.com/wp-content/uploads/2021/09/image-url-for-testing.jpg',
  new rigelsdk.Options({ Width: 100, Height: 100, Type: ImageType.WEBP }),
  Date.now() + 1000 * 60 * 60 * 24, // 1 day expiry
);

// BatchedCache
const batchedCachedImageArgs: models.ProxyParams[] = [
  new models.ProxyParams({
    img: 'https://www.pakainfo.com/wp-content/uploads/2021/09/image-url-for-testing.jpg',
    options: new models.Options({
      Height: 100,
      Width: 100,
      Type: ImageType.WEBP,
    }),
  }),
  new models.ProxyParams({
    img: 'hhtps://img.freepik.com/premium-photo/baby-cat-british-shorthair_648604-47.jpg',
    options: new models.Options({
      Height: 100,
      Width: 100,
      Type: ImageType.WEBP,
    }),
  }),
];
const result: models.CacheImageResponse[] = await rigelSDK.batchedCacheImage(batchedCachedImageArgs, -1);

🤝 Contributing

Contributions, issues and feature requests are welcome!Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

📝 License

This SDK is distributed under the Apache License, Version 2.0, see LICENSE.txt for more information.

1.7.0

9 months ago

2.0.1

9 months ago

2.0.0

9 months ago

1.6.1

1 year ago

1.5.1

1 year ago

1.5.0

1 year ago

1.4.0

1 year ago

1.3.0

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago