Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wolken

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wolken - npm Package Compare versions

Comparing version 0.0.2-BETA to 0.1.0

.c9/.nakignore

85

API.md

@@ -5,43 +5,70 @@ # API Documentation

## Wolken
## Handler
Weeb.sh handler
**Kind**: Global Class
**Properties**:
**Kind**: global class
| Name | Type | Description |
| --- | --- | --- |
| key | ``String`` | API Key |
| options | ``Object`` | various query options |
| options.allowHidden | ``Boolean`` | allow hidden images to be displayed.|
| options.allowNSFW | ``Boolean`` or ``String`` | Whether to allow NSFW results. If this is a string, it should be "only". |
* [Handler](#Handler)
* [new Handler(key, [keyType])](#new_Handler_new)
* [.getTags([hidden])](#Handler+getTags) ⇒ <code>Promise.&lt;Array.&lt;String&gt;&gt;</code>
* [.getTypes([hidden])](#Handler+getTypes) ⇒ <code>Promise.&lt;Array.&lt;String&gt;&gt;</code>
* [.getInfo()](#Handler+getInfo) ⇒ <code>Promise.&lt;Object&gt;</code>
* [.getRandom(options)](#Handler+getRandom) ⇒ <code>Promise.&lt;Object&gt;</code>
* [Wolken](#Wolken)
* [new Wolken(key, [options])](#new_Wolken_new)
* [.getSauce(file)](#Wolken+getRandom) ⇒ <code>Promise.&lt;Array.&lt;Object&gt;&gt;</code>
<a name="new_Handler_new"></a>
<a name="new_Wolken_new"></a>
### new Handler(key, [keyType])
### new Wolken(key, {options})
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| key | <code>String</code> | | your API key for weeb.sh |
| [keyType] | <code>String</code> | <code>&#x27;Bearer&#x27;</code> | Type of key you're using. Either 'Bearer' or 'Wolke' |
| Param | Type | Description |
| --- | --- | --- |
| key | ``String`` | API Key |
| options | ``Object`` | various query options |
| options.allowHidden | ``Boolean`` | allow hidden images to be displayed.|
| options.allowNSFW | ``Boolean`` or ``String`` | Whether to allow NSFW results. If this is a string, it should be "only". |
<a name="Handler+getTags"></a>
<a name="Wolken+getRandom"></a>
### handler.getTags([hidden]) ⇒ <code>Promise.&lt;Array.&lt;String&gt;&gt;</code>
Gets a list of all the available tags in the API.
gets a random image from the API
**Kind**: instance method of [<code>Handler</code>](#Handler)
**Returns**: <code>Promise.&lt;Array.&lt;String&gt;&gt;</code> - All the available tags.
**Kind**: Instance method of [``Wolken``](#Wolken)
**Returns**: <code>Promise.&lt;Array.&lt;Object&gt;&gt;</code>
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| [hidden] | <code>Boolean</code> | <code>false</code> | Whether to retrieve hidden tags. |
<a name="Handler+getTypes"></a>
### handler.getTypes([hidden]) ⇒ <code>Promise.&lt;Array.&lt;String&gt;&gt;</code>
Gets a list of all the available types in the API.
**Kind**: instance method of [<code>Handler</code>](#Handler)
**Returns**: <code>Promise.&lt;Array.&lt;String&gt;&gt;</code> - All the available types.
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| [hidden] | <code>Boolean</code> | <code>false</code> | Whether to retrieve hidden types. |
<a name="Handler+getInfo"></a>
### handler.getInfo() ⇒ <code>Promise.&lt;Object&gt;</code>
Gets a list of all the available tags in the API.
**Kind**: instance method of [<code>Handler</code>](#Handler)
**Returns**: <code>Promise.&lt;Object&gt;</code> - Information about the API.
<a name="Handler+getRandom"></a>
### handler.getRandom(options) ⇒ <code>Promise.&lt;Object&gt;</code>
Get's a random image from the API.
**Kind**: instance method of [<code>Handler</code>](#Handler)
**Returns**: <code>Promise.&lt;Object&gt;</code> - .
| Param | Type | Description |
| --- | --- | --- |
| options | ``Object`` | Options to pass to the query. |
| options.type | ``String`` | Category of the image to get. Either this or `options.tags` are required. |
| options.tags | ``Array<String>`` | Tags that the image should have. |
| options.filetype | ``String`` | The filetype the image should be. |
| options | <code>Object</code> | Options to pass to the API. |
| options.type | <code>String</code> | Category of the image to get. Either this or `options.tags` are required. |
| options.tags | <code>Array.&lt;String&gt;</code> | Tags that the image should have. Either this or `options.type` are required. |
| [options.allowNSFW] | <code>Boolean</code> \| <code>String</code> | Whether to allow NSFW results. If this is a string, it should be 'only'. |
| [options.hidden] | <code>Boolean</code> | Whether to allow hidden results. |
| [options.filetype] | <code>String</code> | The filetype the image should be. |

@@ -1,3 +0,8 @@

// import and export statement polyfill
require('import-export');
require('./lib/Wolken');
const Handler = require('./lib/Handler');
const Constants = require('./lib/Constants');
const Wolken = Handler;
Wolken.Handler = Handler;
Wolken.Constants = Constants;
module.exports = Wolken;
const BASE_URL = 'https://api.weeb.sh';
const ENDPOINTS = {
INFO: '/images/',
TAGS: '/images/tags',
TYPES: '/images/types',
UPLOAD: '/images/upload',
RANDOM: '/images/random',
TYPE: '/images/types'
RANDOM: '/images/random'
};
const KEY_TYPES = [
'Wolke',
'Bearer'
];
const FILETYPES = [

@@ -16,2 +23,2 @@ 'jpeg',

module.exports = {BASE_URL, ENDPOINTS, FILETYPES};
module.exports = {BASE_URL, ENDPOINTS, FILETYPES, KEY_TYPES};
{
"name": "wolken",
"version": "0.0.2-BETA",
"version": "0.1.0",
"description": "a weeb.sh wrapper",

@@ -26,4 +26,3 @@ "main": "index.js",

"dependencies": {
"form-data": "^2.3.1",
"import-export": "^1.0.1"
"form-data": "^2.3.1"
},

@@ -30,0 +29,0 @@ "devDependencies": {

@@ -0,0 +0,0 @@ ## Wolken

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc