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

unb-api

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unb-api - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

108

index.d.ts

@@ -12,14 +12,33 @@ declare module 'unb-api' {

public getUserBalance(guild_id: string, user_id: string): Promise<User>;
public getUserBalance(guildId: string, userId: string): Promise<User>;
public setUserBalance(guild_id: string, user_id: string, balance: Balance): Promise<User>;
public setUserBalance(guildId: string, userId: string, balance: Balance): Promise<User>;
public editUserBalance(guild_id: string, user_id: string, balance: Balance): Promise<User>;
public editUserBalance(guildId: string, userId: string, balance: Balance): Promise<User>;
public getGuildLeaderboard(guild_id: string, query?: object): Promise<User[]> | Promise<{ users: User[], totalPages: number }>;
public getGuildLeaderboard(guildId: string, query?: object): Promise<User[]> | Promise<{ users: User[], totalPages: number }>;
public getGuild(guild_id: string): Promise<Guild>;
public getGuild(guildId: string): Promise<Guild>;
public getApplicationPermission(guild_id: string): Promise<Permission>;
public getApplicationPermission(guildId: string): Promise<Permission>;
public getItems(guildId: string, options?: ItemListOptions): Promise<{ page: number, totalPages: number, items: StoreItem[] }>
public getItem(guildId: string, itemId: string): Promise<StoreItem>
public editItem(guildId: string, itemId: string, data: StoreItem | object, options?: { cascadeUpdate?: boolean }): Promise<StoreItem>
public deleteItem(guildId: string, itemId: string): Promise<any>
public getInventoryItems(guildId: string, userId: string, options?: ItemListOptions): Promise<{ page: number, totalPages: number, items: InventoryItem[] }>
public getInventoryItem(guildId: string, userId: string, itemId: string): Promise<InventoryItem>
public addInventoryItem(guildId: string, userId: string, itemId: string, quantity?: string | number, options?: { inventoryUserId?: string }): Promise<InventoryItem>
public removeInventoryItem(guildId: string, userId: string, itemId: string, quantity?: string | number): Promise<any>
private _request(method: string, endpoint: string, data?: object): Promise<any>;

@@ -69,6 +88,81 @@ }

public allow: string;
public json: string
public json: string;
public has(permission: string | string[]): boolean;
}
export class BaseItem {
public constructor(data: object);
public name: string;
public description?: string;
public isUsable: boolean;
public isSellable: boolean;
public requirements: StoreItemRequirement[];
public actions: StoreItemAction[];
public emojiUnicode?: string;
public emojiId?: string;
}
export class StoreItem extends BaseItem {
public constructor(data: object);
public id: string;
public price: number;
public stockRemaining: number;
public unlimitedStock: boolean;
public isInventory: boolean;
public expiresAt?: Date;
}
export class InventoryItem extends BaseItem {
public itemId: string;
public quantity: number;
}
enum StoreItemRequirementType {
REQUIREMENT_TYPE_UNKNOWN,
ROLE,
TOTAL_BALANCE,
ITEM,
}
enum StoreItemRequirementMatchType {
MATCH_TYPE_UNKNOWN,
EVERY,
AT_LEAST_ONE,
NONE,
}
enum StoreItemActionType {
ACTION_TYPE_UNKNOWN,
RESPOND,
ADD_ROLES,
REMOVE_ROLES,
ADD_BALANCE,
REMOVE_BALANCE,
ADD_ITEMS,
REMOVE_ITEMS,
}
export class StoreItemRequirement {
type: StoreItemRequirementType;
matchType: StoreItemRequirementMatchType;
ids: string[];
balance: number;
}
export class StoreItemAction {
type: StoreItemActionType;
ids: string[];
message: object; // discord message object
balance: number;
}
export type ItemListOptions = {
limit: number;
page: number;
sort: string[]
query: string;
}
}

2

package.json
{
"name": "unb-api",
"version": "1.3.0",
"version": "1.3.1",
"description": "API wrapper for UnbelievaBoat Discord Bot API",

@@ -5,0 +5,0 @@ "main": "src/index.js",

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