Comparing version 0.0.2-BETA to 0.1.0
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.<Array.<String>></code> | ||
* [.getTypes([hidden])](#Handler+getTypes) ⇒ <code>Promise.<Array.<String>></code> | ||
* [.getInfo()](#Handler+getInfo) ⇒ <code>Promise.<Object></code> | ||
* [.getRandom(options)](#Handler+getRandom) ⇒ <code>Promise.<Object></code> | ||
* [Wolken](#Wolken) | ||
* [new Wolken(key, [options])](#new_Wolken_new) | ||
* [.getSauce(file)](#Wolken+getRandom) ⇒ <code>Promise.<Array.<Object>></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>'Bearer'</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.<Array.<String>></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.<Array.<String>></code> - All the available tags. | ||
**Kind**: Instance method of [``Wolken``](#Wolken) | ||
**Returns**: <code>Promise.<Array.<Object>></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.<Array.<String>></code> | ||
Gets a list of all the available types in the API. | ||
**Kind**: instance method of [<code>Handler</code>](#Handler) | ||
**Returns**: <code>Promise.<Array.<String>></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.<Object></code> | ||
Gets a list of all the available tags in the API. | ||
**Kind**: instance method of [<code>Handler</code>](#Handler) | ||
**Returns**: <code>Promise.<Object></code> - Information about the API. | ||
<a name="Handler+getRandom"></a> | ||
### handler.getRandom(options) ⇒ <code>Promise.<Object></code> | ||
Get's a random image from the API. | ||
**Kind**: instance method of [<code>Handler</code>](#Handler) | ||
**Returns**: <code>Promise.<Object></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.<String></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. | | ||
11
index.js
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
104855
1
18
175
- Removedimport-export@^1.0.1
- Removedimport-export@1.0.1(transitive)
- Removednode-hook@0.4.1(transitive)